@tempoxyz/id 0.0.0-stage → 0.0.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 +80 -2
- package/dist/App.d.ts +20 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +26 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/ccip-Cq1mMiVl.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/client/assets/index-B7YJVP00.css +1 -0
- package/dist/app/client/assets/index-UXTxXCLk.js +55 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/db/auth.d.ts +3207 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +330 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +932 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +171 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +489 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-11GtFGrq.js +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js +31 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js.map +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/call-UQamaCKN.js +32 -0
- package/dist/app/server/assets/call-UQamaCKN.js.map +1 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js +2 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-CS900nSP.css +1 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js +10 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js.map +1 -0
- package/dist/app/server/assets/core-B1HCXUmx.js +56 -0
- package/dist/app/server/assets/core-B1HCXUmx.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js.map +1 -0
- package/dist/app/server/assets/dist-BxSwugSY.js +1 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js +2 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js.map +1 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js +15 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js +5 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js +6 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js.map +1 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-MkHAI9Jk.js +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/rolldown-runtime-B0Z9INg1.js +1 -0
- package/dist/app/server/assets/router-CcbyBCI4.css +1 -0
- package/dist/app/server/assets/router-xjZtEeaI.js +7 -0
- package/dist/app/server/assets/router-xjZtEeaI.js.map +1 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js +9 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js.map +1 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js +2 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js.map +1 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js +2 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js.map +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js +2 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js.map +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js.map +1 -0
- package/dist/app/server/index.js +574 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +38 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +62 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +36 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +14 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +27 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +20 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +88 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +49 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +85 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +178 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +29 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +39 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +35 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +41 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +89 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +14 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +9 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +16 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +76 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +9 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +17 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +12 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +13 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +18 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +11 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +15 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +101 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +90 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +161 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +113 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +170 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +227 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +85 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +83 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +39 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +34 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Provider.d.ts +16 -0
- package/dist/client/Provider.d.ts.map +1 -0
- package/dist/client/Provider.js +12 -0
- package/dist/client/Provider.js.map +1 -0
- package/dist/client/Step.d.ts +21 -0
- package/dist/client/Step.d.ts.map +1 -0
- package/dist/client/Step.js +16 -0
- package/dist/client/Step.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +40 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +16 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +25 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +34 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +53 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +79 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +84 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +63 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +115 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +105 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +88 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +60 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/provider.d.ts +49 -0
- package/dist/client/actions/provider.d.ts.map +1 -0
- package/dist/client/actions/provider.js +34 -0
- package/dist/client/actions/provider.js.map +1 -0
- package/dist/client/actions/realm.d.ts +24 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +15 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +153 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +236 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +14 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +106 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +129 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +33 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +46 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +9 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +58 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +45 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +20 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3051 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +472 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4058 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +137 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +532 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +326 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Device.d.ts +371 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +271 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +57 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +609 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +679 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1456 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1030 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +65 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +35 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +49 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +101 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +33 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +56 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +19 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +57 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +146 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +65 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +528 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +658 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +105 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +224 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +190 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +148 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +281 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +477 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +115 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +197 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +51 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +103 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Wallet.d.ts +37 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +43 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/worker.d.ts +12 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +12 -0
- package/dist/worker.js.map +1 -0
- package/package.json +79 -3
- package/src/Api.ts +151 -0
- package/src/App.ts +56 -0
- package/src/api/account.ts +311 -0
- package/src/api/authenticate.ts +1290 -0
- package/src/api/authorize.ts +1030 -0
- package/src/api/device.ts +874 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +335 -0
- package/src/api/lib/Auth.ts +134 -0
- package/src/api/lib/Consent.ts +339 -0
- package/src/api/lib/Cors.ts +107 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +265 -0
- package/src/api/lib/FirstAccount.ts +90 -0
- package/src/api/lib/KeySigner.ts +393 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +34 -0
- package/src/api/lib/SignInConsent.ts +316 -0
- package/src/api/oauth.ts +1282 -0
- package/src/api/provider.ts +441 -0
- package/src/app/components/Button.tsx +128 -0
- package/src/app/components/CodeInput.tsx +186 -0
- package/src/app/components/ErrorMessage.tsx +66 -0
- package/src/app/components/Grant.tsx +323 -0
- package/src/app/components/Input.tsx +48 -0
- package/src/app/components/Tooltip.tsx +45 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/crons/cleanup.ts +42 -0
- package/src/app/db/auth.ts +416 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/_journal.json +83 -0
- package/src/app/db/schema.ts +218 -0
- package/src/app/env.ts +49 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Loader.ts +24 -0
- package/src/app/package.json +8 -0
- package/src/app/routeTree.gen.ts +198 -0
- package/src/app/router.tsx +48 -0
- package/src/app/routes/[_].flows.tsx +3001 -0
- package/src/app/routes/__root.tsx +91 -0
- package/src/app/routes/authorize.tsx +197 -0
- package/src/app/routes/choose-account.tsx +111 -0
- package/src/app/routes/deposit.tsx +105 -0
- package/src/app/routes/device.tsx +227 -0
- package/src/app/routes/index.tsx +115 -0
- package/src/app/routes/login.tsx +506 -0
- package/src/app/screens/Account.tsx +347 -0
- package/src/app/screens/Approval.tsx +276 -0
- package/src/app/screens/ChooseAccount.tsx +240 -0
- package/src/app/screens/Deposit.tsx +762 -0
- package/src/app/screens/DeviceApproval.tsx +480 -0
- package/src/app/screens/SignIn.tsx +362 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +204 -0
- package/src/app/vite.config.ts +95 -0
- package/src/app/void.config.ts +29 -0
- package/src/app/zyzz.config.ts +274 -0
- package/src/cli/Admin.ts +73 -0
- package/src/cli/Apps.ts +29 -0
- package/src/cli/Cli.ts +42 -0
- package/src/cli/Project.ts +117 -0
- package/src/cli/Realms.ts +50 -0
- package/src/cli/Session.ts +239 -0
- package/src/cli/User.ts +45 -0
- package/src/cli/V1.ts +57 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +101 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +86 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +16 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +168 -0
- package/src/client/Auth.ts +285 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +410 -0
- package/src/client/Key.ts +140 -0
- package/src/client/Pending.ts +46 -0
- package/src/client/Permissions.ts +39 -0
- package/src/client/Provider.ts +18 -0
- package/src/client/Step.ts +24 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +42 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +57 -0
- package/src/client/actions/device.ts +151 -0
- package/src/client/actions/email.ts +141 -0
- package/src/client/actions/oauth.ts +182 -0
- package/src/client/actions/passkey.ts +141 -0
- package/src/client/actions/provider.ts +70 -0
- package/src/client/actions/realm.ts +36 -0
- package/src/client/actions/redirect.ts +408 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +15 -0
- package/src/client/internal/api.ts +224 -0
- package/src/client/internal/headless.ts +77 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +71 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client.ts +19 -0
- package/src/index.ts +6 -0
- package/src/internal/Apps.ts +718 -0
- package/src/internal/Auth.ts +203 -0
- package/src/internal/Authorize.ts +424 -0
- package/src/internal/Balance.ts +168 -0
- package/src/internal/BodyLimit.ts +36 -0
- package/src/internal/Chain.ts +16 -0
- package/src/internal/Device.ts +469 -0
- package/src/internal/Env.ts +58 -0
- package/src/internal/ErrorResponse.ts +854 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1339 -0
- package/src/internal/Limits.ts +39 -0
- package/src/internal/Log.ts +178 -0
- package/src/internal/LogLine.ts +87 -0
- package/src/internal/Logout.ts +336 -0
- package/src/internal/Migrations.ts +86 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +211 -0
- package/src/internal/Passkey.ts +1052 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +402 -0
- package/src/internal/Provider.ts +125 -0
- package/src/internal/RateLimit.ts +259 -0
- package/src/internal/Realm.ts +768 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +168 -0
- package/src/internal/SigningKey.ts +286 -0
- package/src/internal/TempoAccount.ts +342 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +158 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Wallet.ts +62 -0
- package/src/internal/owners/Passkey.ts +72 -0
- package/src/internal/owners/Privy.ts +81 -0
- package/src/internal/owners/Secp256k1.ts +143 -0
- package/src/types/app.d.ts +19 -0
- package/src/worker.ts +11 -0
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"./assets/rolldown-runtime-B0Z9INg1.js";import{$ as a,A as o,At as s,B as c,Bt as l,C as u,Ct as d,D as f,Dt as p,E as m,En as h,Et as g,F as _,Ft as v,G as y,Gn as b,Gt as x,H as S,Ht as C,I as w,In as E,It as D,J as O,Jt as k,K as A,Kt as j,L as M,Lt as N,M as P,Mt as F,N as ee,Nt as te,O as I,Ot as L,P as ne,Pt as re,Q as ie,R as ae,Rn as oe,Rt as se,S as ce,St as le,T as ue,Tn as de,Tt as fe,U as pe,Un as me,Ut as he,V as ge,Vn as _e,Vt as ve,W as ye,Wn as be,Wt as xe,X as Se,Y as Ce,Yt as we,Z as Te,Zt as Ee,_ as De,_t as Oe,a as ke,at as Ae,b as R,bt as je,c as Me,ct as Ne,d as Pe,dt as Fe,et as Ie,f as Le,fn as Re,ft as ze,g as Be,gn as Ve,gt as He,h as Ue,hn as We,ht as Ge,i as Ke,in as qe,it as Je,j as Ye,jn as Xe,jt as Ze,k as Qe,kt as $e,l as et,ln as tt,lt as nt,m as rt,mn as it,n as at,nt as ot,o as st,on as ct,ot as lt,p as ut,pn as dt,pt as ft,q as pt,qt as mt,r as ht,rn as gt,rt as _t,s as vt,sn as yt,st as bt,t as xt,tt as St,u as Ct,un as wt,ut as Tt,v as Et,vn as Dt,w as Ot,wn as kt,wt as At,x as jt,xn as Mt,xt as Nt,y as Pt,z as Ft,zn as It,zt as Lt}from"./assets/cookie-Cce9CrIP.js";import{C as Rt,D as zt,E as Bt,O as Vt,S as Ht,T as z,_ as Ut,a as Wt,b as Gt,c as Kt,d as qt,f as Jt,k as Yt,l as Xt,m as Zt,o as Qt,p as $t,s as en,u as tn,v as nn,w as rn,x as B}from"./assets/schemas-C2lCYmR5.js";import{$ as an,$t as on,A as sn,At as cn,B as ln,Bt as un,C as dn,Ct as fn,D as pn,Dt as mn,E as hn,Et as gn,F as _n,Ft as vn,G as yn,Gt as bn,H as xn,Ht as V,I as Sn,It as Cn,J as wn,Jt as Tn,K as En,Kt as Dn,L as On,Lt as kn,M as An,Mt as jn,N as Mn,Nt as Nn,O as Pn,Ot as Fn,P as In,Pt as Ln,Q as Rn,Qt as zn,R as Bn,Rt as Vn,S as Hn,St as Un,T as Wn,Tt as Gn,U as Kn,Ut as qn,V as Jn,Vt as Yn,W as Xn,Wt as Zn,X as Qn,Xt as $n,Y as er,Yt as tr,Z as nr,Zt as rr,_ as ir,_t as ar,a as or,an as sr,at as cr,b as lr,bt as ur,c as dr,cn as fr,ct as pr,d as mr,dn as hr,dt as gr,en as _r,et as vr,f as yr,fn as br,ft as xr,g as Sr,gt as Cr,h as wr,ht as Tr,i as Er,in as Dr,it as Or,j as kr,jt as Ar,k as jr,kt as Mr,l as Nr,ln as Pr,lt as Fr,m as Ir,mn as Lr,mt as Rr,n as zr,nn as Br,nt as Vr,o as Hr,on as Ur,ot as Wr,p as Gr,pn as Kr,pt as qr,q as Jr,qt as Yr,r as Xr,rn as Zr,rt as Qr,s as $r,sn as ei,st as ti,t as ni,tn as ri,tt as ii,u as ai,un as oi,ut as si,v as ci,vt as li,w as ui,wt as di,x as fi,xt as pi,y as mi,yt as hi,z as gi,zt as _i}from"./assets/authorize-C95F-9E1-CbESJKGU.js";import{$ as vi,A as yi,D as bi,M as xi,N as Si,O as Ci,R as wi,T as Ti,V as Ei,_ as H,a as Di,b as Oi,c as ki,d as Ai,f as ji,g as Mi,h as Ni,i as Pi,j as Fi,k as Ii,m as Li,o as Ri,p as zi,q as Bi,t as Vi,v as U,x as Hi,z as Ui}from"./assets/get-id-field-B0x109VU.js";import{a as Wi,c as Gi,i as Ki,l as qi,n as Ji,o as Yi,r as Xi,s as Zi,t as Qi,u as $i}from"./assets/schema-check-Cf7QOZZD.js";import{n as ea,r as ta,t as na}from"./assets/factory-ipHlJXZY.js";import{$ as ra,$t as ia,A as aa,Cn as oa,Ct as sa,D as ca,En as la,Et as ua,I as da,Mn as fa,N as pa,O as ma,On as ha,Ot as ga,Q as _a,R as va,Sn as ya,St as ba,Z as xa,Zt as Sa,at as Ca,bt as wa,gt as Ta,in as Ea,jn as Da,k as Oa,n as ka,ot as Aa,p as ja,sn as Ma,t as Na,wn as Pa,yn as Fa,yt as Ia}from"./assets/call-UQamaCKN.js";import{H as La,K as Ra,V as za,W as Ba,X as Va,Y as Ha,Z as Ua,z as Wa}from"./assets/utils-C4ZXZIZW.js";import{a as Ga,c as Ka,o as qa,s as Ja,t as Ya}from"./assets/secp256k1-buM5g4AL.js";import{n as Xa}from"./assets/index-CLddUTqr-xpSuLpBt.js";import"./assets/dist-BxSwugSY.js";import{n as Za}from"./assets/index-DZEfthgZ-8Uq5s5Pt.js";import{c as Qa}from"./assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js";import{i as $a,n as eo,o as to,r as no,s as ro,t as io}from"./assets/dist-Dg3PQqiW.js";import"cloudflare:workers";import ao,{PassThrough as oo,Readable as so}from"node:stream";import{AsyncLocalStorage as co}from"node:async_hooks";import lo,{randomBytes as uo,scrypt as fo}from"node:crypto";import po from"node:events";import mo from"node:util";import ho from"node:util/types";import go from"node:dns";import _o from"node:fs";import vo from"node:net";import yo from"node:tls";import bo from"node:path";import xo from"node:string_decoder";function So(e){return Error(`[unenv] ${e} is not implemented yet!`)}var Co=globalThis.performance?.timeOrigin??Date.now(),wo=globalThis.performance?.now?globalThis.performance.now.bind(globalThis.performance):()=>Date.now()-Co,To={name:`node`,entryType:`node`,startTime:0,duration:0,nodeStart:0,v8Start:0,bootstrapComplete:0,environment:0,loopStart:0,loopExit:0,idleTime:0,uvMetricsInfo:{loopCount:0,events:0,eventsWaiting:0},detail:void 0,toJSON(){return this}},Eo=class{__unenv__=!0;detail;entryType=`event`;name;startTime;constructor(e,t){this.name=e,this.startTime=t?.startTime||wo(),this.detail=t?.detail}get duration(){return wo()-this.startTime}toJSON(){return{name:this.name,entryType:this.entryType,startTime:this.startTime,duration:this.duration,detail:this.detail}}},Do=class extends Eo{entryType=`mark`;constructor(){super(...arguments)}get duration(){return 0}},Oo=class extends Eo{entryType=`measure`},ko=class extends Eo{entryType=`resource`;serverTiming=[];connectEnd=0;connectStart=0;decodedBodySize=0;domainLookupEnd=0;domainLookupStart=0;encodedBodySize=0;fetchStart=0;initiatorType=``;name=``;nextHopProtocol=``;redirectEnd=0;redirectStart=0;requestStart=0;responseEnd=0;responseStart=0;secureConnectionStart=0;startTime=0;transferSize=0;workerStart=0;responseStatus=0},Ao=class{__unenv__=!0;getEntries(){return[]}getEntriesByName(e,t){return[]}getEntriesByType(e){return[]}},jo=class{__unenv__=!0;timeOrigin=Co;eventCounts=new Map;_entries=[];_resourceTimingBufferSize=0;navigation=void 0;timing=void 0;timerify(e,t){throw So(`Performance.timerify`)}get nodeTiming(){return To}eventLoopUtilization(){return{}}markResourceTiming(){return new ko(``)}onresourcetimingbufferfull=null;now(){return this.timeOrigin===Co?wo():Date.now()-this.timeOrigin}clearMarks(e){this._entries=e?this._entries.filter(t=>t.name!==e):this._entries.filter(e=>e.entryType!==`mark`)}clearMeasures(e){this._entries=e?this._entries.filter(t=>t.name!==e):this._entries.filter(e=>e.entryType!==`measure`)}clearResourceTimings(){this._entries=this._entries.filter(e=>e.entryType!==`resource`||e.entryType!==`navigation`)}getEntries(){return this._entries}getEntriesByName(e,t){return this._entries.filter(n=>n.name===e&&(!t||n.entryType===t))}getEntriesByType(e){return this._entries.filter(t=>t.entryType===e)}mark(e,t){let n=new Do(e,t);return this._entries.push(n),n}measure(e,t,n){let r,i;typeof t==`string`?(r=this.getEntriesByName(t,`mark`)[0]?.startTime,i=this.getEntriesByName(n,`mark`)[0]?.startTime):(r=Number.parseFloat(t?.start)||this.now(),i=Number.parseFloat(t?.end)||this.now());let a=new Oo(e,{startTime:r,detail:{start:r,end:i}});return this._entries.push(a),a}setResourceTimingBufferSize(e){this._resourceTimingBufferSize=e}addEventListener(e,t,n){throw So(`Performance.addEventListener`)}removeEventListener(e,t,n){throw So(`Performance.removeEventListener`)}dispatchEvent(e){throw So(`Performance.dispatchEvent`)}toJSON(){return this}},Mo=class{__unenv__=!0;static supportedEntryTypes=[];_callback=null;constructor(e){this._callback=e}takeRecords(){return[]}disconnect(){throw So(`PerformanceObserver.disconnect`)}observe(e){throw So(`PerformanceObserver.observe`)}bind(e){return e}runInAsyncScope(e,t,...n){return e.call(t,...n)}asyncId(){return 0}triggerAsyncId(){return 0}emitDestroy(){return this}},No=globalThis.performance&&`addEventListener`in globalThis.performance?globalThis.performance:new jo;if(!(`__unenv__`in No)){let e=jo.prototype;for(let t of Object.getOwnPropertyNames(e))if(t!==`constructor`&&!(t in No)){let n=Object.getOwnPropertyDescriptor(e,t);n&&Object.defineProperty(No,t,n)}}globalThis.performance=No,globalThis.Performance=jo,globalThis.PerformanceEntry=Eo,globalThis.PerformanceMark=Do,globalThis.PerformanceMeasure=Oo,globalThis.PerformanceObserver=Mo,globalThis.PerformanceObserverEntryList=Ao,globalThis.PerformanceResourceTiming=ko;function Po(e){return e.replaceAll(`~`,`~~`).replaceAll(`\0`,`~0`).replaceAll(`�`,`~r`).replaceAll(`/`,`\0`)}var Fo=e(b(),1).useEffect;function Io(e){return e}var Lo=Symbol.asyncIterator,Ro=Symbol.hasInstance,zo=Symbol.isConcatSpreadable,Bo=Symbol.iterator,Vo=Symbol.match,Ho=Symbol.matchAll,Uo=Symbol.replace,Wo=Symbol.search,Go=Symbol.species,Ko=Symbol.split,qo=Symbol.toPrimitive,Jo=Symbol.toStringTag,Yo=Symbol.unscopables,Xo={0:`Symbol.asyncIterator`,1:`Symbol.hasInstance`,2:`Symbol.isConcatSpreadable`,3:`Symbol.iterator`,4:`Symbol.match`,5:`Symbol.matchAll`,6:`Symbol.replace`,7:`Symbol.search`,8:`Symbol.species`,9:`Symbol.split`,10:`Symbol.toPrimitive`,11:`Symbol.toStringTag`,12:`Symbol.unscopables`},Zo={[Lo]:0,[Ro]:1,[zo]:2,[Bo]:3,[Vo]:4,[Ho]:5,[Uo]:6,[Wo]:7,[Go]:8,[Ko]:9,[qo]:10,[Jo]:11,[Yo]:12},Qo={0:Lo,1:Ro,2:zo,3:Bo,4:Vo,5:Ho,6:Uo,7:Wo,8:Go,9:Ko,10:qo,11:Jo,12:Yo},$o={2:`!0`,3:`!1`,1:`void 0`,0:`null`,4:`-0`,5:`1/0`,6:`-1/0`,7:`0/0`},es={2:!0,3:!1,1:void 0,0:null,4:-0,5:1/0,6:-1/0,7:NaN},ts={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},ns={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function rs(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function is(e){return rs(2,void 0,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}var as=is(2),os=is(3),ss=is(1),cs=is(0),ls=is(4),us=is(5),ds=is(6),fs=is(7),ps=64,ms=/[\x00-\x07\x0b\x0e-\x1f<\u2028\u2029\ud800-\udfff]/;function hs(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case`
|
|
2
|
+
`:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return}}function gs(e){if(e.length>=ps&&!ms.test(e))return JSON.stringify(e).slice(1,-1);let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=hs(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function _s(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return`
|
|
3
|
+
`;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return` `;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function vs(e){return typeof e==`string`&&!e.includes(`\\`)?e:e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,_s)}var{toString:ys}=Object.prototype,bs={parsing:1,serialization:2,deserialization:3};function xs(e){return`Seroval Error (step: ${bs[e]})`}var Ss=(e,t)=>xs(e),Cs=class extends Error{constructor(e,t){super(Ss(e,t)),this.cause=t}},ws=class extends Cs{constructor(e){super(`parsing`,e)}},Ts=class extends Cs{constructor(e){super(`deserialization`,e)}};function Es(e){return`Seroval Error (specific: ${e})`}var Ds=class extends Error{constructor(e){super(Es(1)),this.value=e}},Os=class extends Error{constructor(e){super(Es(2))}},ks=class extends Error{constructor(e){super(Es(3))}},As=class extends Error{constructor(e){super(Es(4))}},js=class extends Error{constructor(e){super(Es(5)),this.value=e}},Ms=class extends Error{constructor(e){super(Es(6))}},Ns=class extends Error{constructor(e){super(Es(7))}},Ps=class extends Error{constructor(e){super(Es(8))}},Fs=class extends Error{constructor(e){super(Es(9))}},Is=`__SEROVAL_REFS__`,Ls=`self.$R`;function Rs(e){return e==null?`${Ls}=${Ls}||[]`:`(${Ls}=${Ls}||{})["${gs(e)}"]=[]`}var zs=new Map,Bs=new Map;function Vs(e){return zs.has(e)}function Hs(e){return Bs.has(e)}function Us(e){if(Vs(e))return zs.get(e);throw new js(e)}function Ws(e){if(Hs(e))return Bs.get(e);throw new Ms(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,Is,{value:Bs,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,Is,{value:Bs,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,Is,{value:Bs,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,Is,{value:Bs,configurable:!0,writable:!1,enumerable:!1});function Gs(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function Ks(e){let t=ts[Gs(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function qs(e,t){let n=Ks(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function Js(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function Ys(e){switch(e){case 1/0:return us;case-1/0:return ds}return e===e?Object.is(e,-0)?ls:rs(0,void 0,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0):fs}function Xs(e){return rs(1,void 0,gs(e),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function Zs(e){return rs(3,void 0,``+e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function Qs(e){return rs(4,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function $s(e,t){let n=t.valueOf();return rs(5,e,n===n?t.toISOString():``,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function ec(e,t,n){return rs(36,e,n.toString(),t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function tc(e,t){return rs(6,e,void 0,gs(t.source),t.flags,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function nc(e,t){return rs(17,e,Zo[t],void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function rc(e,t){return rs(18,e,gs(Us(t)),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function ic(e,t,n){return rs(25,e,n,gs(t),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function ac(e,t,n){return rs(9,e,void 0,void 0,void 0,void 0,void 0,n,void 0,void 0,Js(t),void 0)}function oc(e,t){return rs(21,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}var sc=1e6;function cc(e,t,n){if(t.length>sc)throw new Ds(t);return rs(15,e,void 0,t.constructor.name,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.length)}function lc(e,t,n){if(t.length>sc)throw new Ds(t);return rs(16,e,void 0,t.constructor.name,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.length)}function uc(e,t,n){if(t.byteLength>sc)throw new Ds(t);return rs(20,e,void 0,void 0,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.byteLength)}function dc(e,t,n){return rs(13,e,Gs(t),void 0,gs(t.message),n,void 0,void 0,void 0,void 0,void 0,void 0)}function fc(e,t,n){return rs(14,e,Gs(t),void 0,gs(t.message),n,void 0,void 0,void 0,void 0,void 0,void 0)}function pc(e,t){return rs(7,e,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0,void 0)}function mc(e,t){return rs(28,void 0,void 0,void 0,void 0,void 0,void 0,[e,t],void 0,void 0,void 0,void 0)}function hc(e,t){return rs(30,void 0,void 0,void 0,void 0,void 0,void 0,[e,t],void 0,void 0,void 0,void 0)}function gc(e,t,n){return rs(31,e,void 0,void 0,void 0,void 0,void 0,n,t,void 0,void 0,void 0)}function _c(e,t){return rs(32,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function vc(e,t){return rs(33,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function yc(e,t){return rs(34,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function bc(e,t,n,r){return rs(35,e,n,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0,r)}var xc=class{constructor(e,t){this.value=e,this.replacement=t}},Sc=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e},Cc=(e,t)=>{e.s(t),e.p.s=1,e.p.v=t},wc=(e,t)=>{e.f(t),e.p.s=2,e.p.v=t},Tc=Sc.toString(),Ec=Cc.toString(),Dc=wc.toString(),Oc=(()=>{let e=[],t=[],n=!0,r=!1,i=0,a={flush(e,n,r){for(r=0;r<i;r++){let i=t[r];i&&i[n](e)}},up(t,i,a,o){for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},on(e,r=0){let o=n;if(n){for(r=0;r<i&&t[r];r++);r===i&&i++,t[r]=e}return a.up(e),()=>{if(n&&o){for(o=!1,t[r]=void 0;i>0&&!t[i-1];)i--;t.length=i}}}};return{__SEROVAL_STREAM__:!0,on(e){return a.on(e)},next(t){n&&(e.push(t),a.flush(t,`next`))},throw(i){n&&(e.push(i),a.flush(i,`throw`),n=!1,r=!1,t.length=0)},return(i){n&&(e.push(i),a.flush(i,`return`),n=!1,r=!0,t.length=0)}}}).toString(),kc=e=>t=>()=>{let n=0,r={[e](){return r},next(){if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r},Ac=kc.toString(),jc=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c={finalize(e=0,t=s.length){for(;e<t;e++)s[e].s({done:!0,value:void 0})}};n.on({next(e){let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw(e){let t=s.shift();t&&t.f(e),c.finalize(),i=o.length,a=!0,o.push(e)},return(e){let t=s.shift();t&&t.s({done:!0,value:e}),c.finalize(),i=o.length,o.push(e)}});let l={[e](){return l},next(){if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l},Mc=jc.toString(),Nc=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer},Pc=Nc.toString(),Fc=class{constructor(e,t,n){this.v=e,this.t=t,this.d=n}};function Ic(e){return e instanceof Fc}function Lc(e,t,n){return new Fc(e,t,n)}function Rc(e){let t=[],n=-1,r=-1,i=e[Bo]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,r=n,t.push(e);break}return Lc(t,n,r)}var zc=kc(Bo);function Bc(e){return zc(e)}var Vc={},Hc={},Uc={0:{},1:{},2:{},3:{},4:{},5:{}},Wc={0:`[]`,1:Tc,2:Ec,3:Dc,4:Oc,5:Pc},Gc=class{constructor(){this.buffer=[],this.listeners=[],this.alive=!0,this.success=!1,this.count=0}flush(e,t){for(let r=0;r<this.count;r++){var n;(n=this.listeners[r])==null||n[t](e)}}replay(e){for(let t=0,n=this.buffer.length;t<n;t++){let r=this.buffer[t];!this.alive&&t===n-1?e[this.success?`return`:`throw`](r):e.next(r)}}on(e){let t=this.alive,n=0;if(t){for(;n<this.count&&this.listeners[n];n++);n===this.count&&this.count++,this.listeners[n]=e}return this.replay(e),()=>{if(this.alive&&t){for(t=!1,this.listeners[n]=void 0;this.count>0&&!this.listeners[this.count-1];)this.count--;this.listeners.length=this.count}}}next(e){this.alive&&(this.buffer.push(e),this.flush(e,`next`))}throw(e){this.alive&&(this.buffer.push(e),this.flush(e,`throw`),this.alive=!1,this.success=!1,this.listeners.length=0)}return(e){this.alive&&(this.buffer.push(e),this.flush(e,`return`),this.alive=!1,this.success=!0,this.listeners.length=0)}};function Kc(e){return e instanceof Gc}function qc(){return new Gc}function Jc(e,t){let n=qc(),r=e[Lo](),i=!1,a=!1;t?.push(()=>{a||i||(i=!0,Promise.resolve().then(()=>r.return?.call(r)).catch(()=>{}))});async function o(){try{for(;!i;){let e=await r.next();if(i)return;if(e.done){a=!0,n.return(e.value);break}n.next(e.value)}}catch(e){a=!0,i||n.throw(e)}}return o().catch(()=>{}),n}var Yc=jc(Lo,Sc);function Xc(e){return Yc(e)}async function Zc(e){try{return[1,await e]}catch(e){return[0,e]}}function Qc(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:127^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3,compactArrayBufferViews:t.compactArrayBufferViews??!1}}function $c(e,t){e.marked.add(t)}function el(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function tl(e,t){let n=e.refs.get(t);return n==null?{type:0,value:el(e,t)}:($c(e,n),{type:1,value:Qs(n)})}function nl(e,t){let n=tl(e,t);return n.type===1?n:Vs(t)?{type:2,value:rc(n.value,t)}:n}function rl(e,t){let n=nl(e,t);if(n.type!==0)return n.value;if(t in Zo)return nc(n.value,t);throw new Ds(t)}function il(e,t){let n=tl(e,Uc[t]);return n.type===1?n.value:rs(26,n.value,t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function al(e){let t=tl(e,Vc);return t.type===1?t.value:rs(27,t.value,void 0,void 0,void 0,void 0,void 0,void 0,rl(e,Bo),void 0,void 0,void 0)}function ol(e){let t=tl(e,Hc);return t.type===1?t.value:rs(29,t.value,void 0,void 0,void 0,void 0,void 0,[il(e,1),rl(e,Lo)],void 0,void 0,void 0,void 0)}function sl(e,t,n,r){return rs(n?11:10,e,void 0,void 0,void 0,r,void 0,void 0,void 0,void 0,Js(t),void 0)}function cl(e,t,n,r){return rs(8,t,void 0,void 0,void 0,void 0,{k:n,v:r},void 0,il(e,0),void 0,void 0,void 0)}function ll(e,t,n){return rs(22,t,n,void 0,void 0,void 0,void 0,void 0,il(e,1),void 0,void 0,void 0)}function ul(e,t){if(!e.compactArrayBufferViews)return t;let n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice().buffer,r=t.constructor;return new r(n)}function dl(e){if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=new Uint8Array(e);if(typeof t.toBase64==`function`)return t.toBase64();let n=``;for(let e=0,r=t.length;e<r;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function fl(e,t,n){return rs(19,t,dl(n),void 0,void 0,void 0,void 0,void 0,il(e,5),void 0,void 0,void 0)}function pl(e,t){return{base:Qc(e,t),child:void 0}}var ml=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Pl(this._p,this.depth,e)}};async function hl(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await Pl(e,t,n[i]):r[i]=0;return r}async function gl(e,t,n,r){return ac(n,r,await hl(e,t,r))}async function _l(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(gs(r[n][0])),a.push(await Pl(e,t,r[n][1]));return Bo in n&&(i.push(rl(e.base,Bo)),a.push(mc(al(e.base),await Pl(e,t,Rc(n))))),Lo in n&&(i.push(rl(e.base,Lo)),a.push(hc(ol(e.base),await Pl(e,t,Jc(n))))),Jo in n&&(i.push(rl(e.base,Jo)),a.push(Xs(n[Jo]))),zo in n&&(i.push(rl(e.base,zo)),a.push(n[zo]?as:os)),{k:i,v:a}}async function vl(e,t,n,r,i){return sl(n,r,i,await _l(e,t,r))}async function yl(e,t,n,r){return oc(n,await Pl(e,t,r.valueOf()))}async function bl(e,t,n,r){return r=ul(e.base,r),cc(n,r,await Pl(e,t,r.buffer))}async function xl(e,t,n,r){return r=ul(e.base,r),lc(n,r,await Pl(e,t,r.buffer))}async function Sl(e,t,n,r){return r=ul(e.base,r),uc(n,r,await Pl(e,t,r.buffer))}async function Cl(e,t,n,r){let i=qs(r,e.base.features);return dc(n,r,i?await _l(e,t,i):void 0)}async function wl(e,t,n,r){let i=qs(r,e.base.features);return fc(n,r,i?await _l(e,t,i):void 0)}async function Tl(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(await Pl(e,t,n)),a.push(await Pl(e,t,o));return cl(e.base,n,i,a)}async function El(e,t,n,r){let i=[];for(let n of r.keys())i.push(await Pl(e,t,n));return pc(n,i)}async function Dl(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return ic(n,o.tag,await o.parse.async(r,new ml(e,t),{id:n}))}}async function Ol(e,t,n,r){let[i,a]=await Zc(r);return rs(12,n,i,void 0,void 0,void 0,void 0,void 0,await Pl(e,t,a),void 0,void 0,void 0)}function kl(e,t,n,r,i){let a=[],o=n.on({next:n=>{$c(this.base,t),Pl(this,e,n).then(e=>{a.push(_c(t,e))},e=>{i(e),o()})},throw:n=>{$c(this.base,t),Pl(this,e,n).then(e=>{a.push(vc(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{$c(this.base,t),Pl(this,e,n).then(e=>{a.push(yc(t,e)),r(a),o()},e=>{i(e),o()})}})}async function Al(e,t,n,r){return gc(n,il(e.base,4),await new Promise(kl.bind(e,t,n,r)))}async function jl(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await Pl(e,t,r.v[n]);return bc(n,i,r.t,r.d)}async function Ml(e,t,n,r){if(Array.isArray(r))return gl(e,t,n,r);if(Kc(r))return Al(e,t,n,r);if(Ic(r))return jl(e,t,n,r);let i=r.constructor;if(i!==void 0&&typeof i!=`function`){let e=Object.getPrototypeOf(r);i=e===null?void 0:e.constructor}if(i===xc)return Pl(e,t,r.replacement);let a=await Dl(e,t,n,r);if(a)return a;switch(i){case Object:return vl(e,t,n,r,!1);case void 0:return vl(e,t,n,r,!0);case Date:return $s(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Cl(e,t,n,r);case Number:case Boolean:case String:case BigInt:return yl(e,t,n,r);case ArrayBuffer:return fl(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return bl(e,t,n,r);case DataView:return Sl(e,t,n,r);case Map:return Tl(e,t,n,r);case Set:return El(e,t,n,r)}if(i===Promise||r instanceof Promise)return Ol(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return tc(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return xl(e,t,n,r)}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return wl(e,t,n,r);if(o&64&&typeof Temporal<`u`)switch(i){case Temporal.Instant:return ec(n,0,r);case Temporal.Duration:return ec(n,1,r);case Temporal.PlainDate:return ec(n,2,r);case Temporal.PlainDateTime:return ec(n,3,r);case Temporal.PlainMonthDay:return ec(n,4,r);case Temporal.PlainTime:return ec(n,5,r);case Temporal.PlainYearMonth:return ec(n,6,r);case Temporal.ZonedDateTime:return ec(n,7,r)}if(r instanceof Error)return Cl(e,t,n,r);if(Bo in r||Lo in r)return vl(e,t,n,r,!!i);throw new Ds(r)}async function Nl(e,t,n){let r=nl(e.base,n);if(r.type!==0)return r.value;let i=await Dl(e,t,r.value,n);if(i)return i;throw new Ds(n)}async function Pl(e,t,n){if(t>=e.base.depthLimit)throw new Fs(e.base.depthLimit);switch(typeof n){case`boolean`:return n?as:os;case`undefined`:return ss;case`string`:return Xs(n);case`number`:return Ys(n);case`bigint`:return Zs(n);case`object`:if(n){let r=nl(e.base,n);return r.type===0?await Ml(e,t+1,r.value,n):r.value}return cs;case`symbol`:return rl(e.base,n);case`function`:return Nl(e,t,n);default:throw new Ds(n)}}async function Fl(e,t){try{return await Pl(e,0,t)}catch(e){throw e instanceof ws?e:new ws(e)}}function Il(e){return e}function Ll(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Ll(e,r.extends))}}function Rl(e){if(e){let t=new Set;return Ll(t,e),[...t]}}function zl(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new Ns(e)}}function Bl(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function Vl(e){switch(e){case Lo:case zo:case Jo:case Bo:return!0;default:return!1}}var Hl=1e6,Ul=512,Wl=1e4,Gl=2e4;function Kl(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var ql=1e3;function Jl(e,t){let n=t.maxBase64Length??Hl;if(!Number.isSafeInteger(n)||n<0)throw RangeError(`maxBase64Length must be a non-negative safe integer`);let r=t.refs||new Map;return`types`in r||Object.assign(r,{types:new Map}),{mode:e,plugins:t.plugins,refs:r,features:t.features??127^(t.disabledFeatures||0),depthLimit:t.depthLimit||ql,maxBase64Length:n}}function Yl(e){return{mode:1,base:Jl(1,e),child:void 0,state:{marked:new Set(e.markedRefs)}}}var Xl=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return Ru(this._p,this.depth,e)}};function Zl(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Ps({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function Ql(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&`then`in e&&typeof e.then==`function`}function $l(e,t,n){return Zl(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function eu(e,t,n){return Zl(e.base,t),e.base.refs.set(t,n),n}function tu(e,t,n){return e.mode===1?$l(e,t,n):eu(e,t,n)}function nu(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new Ps(e)}function ru(e,t){return tu(e,t.i,Ws(vs(t.s)))}function iu(e,t){if(!Array.isArray(t))throw new Ps(e)}function au(e,t,n){let r=n.a;iu(n,r);let i=r.length,a=tu(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=Ru(e,t,o));return Kl(a,n.o),a}function ou(e,t,n){Bl(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function su(e,t,n,r,i){if(typeof r==`string`)ou(n,vs(r),Ru(e,t,i));else{let a=Ru(e,t,r);switch(typeof a){case`string`:ou(n,a,Ru(e,t,i));break;case`symbol`:Vl(a)&&(n[a]=Ru(e,t,i));break;default:throw new Ps(r)}}}function cu(e,t,n){e.base.refs.types.set(t,n)}function lu(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new Ps(t)}function uu(e,t,n,r){let i=n.k;if(iu(n,i),iu(n,n.v),i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)su(e,t,r,i[a],o[a]);return r}function du(e,t,n){let r=tu(e,n.i,n.t===10?{}:Object.create(null));return uu(e,t,n.p,r),Kl(r,n.o),r}function fu(e,t){return tu(e,t.i,new Date(t.s))}function pu(e,t){if(!(e.base.features&64))throw new Os(t);let n;switch(t.c){case 0:n=Temporal.Instant.from(t.s);break;case 1:n=Temporal.Duration.from(t.s);break;case 2:n=Temporal.PlainDate.from(t.s);break;case 3:n=Temporal.PlainDateTime.from(t.s);break;case 4:n=Temporal.PlainMonthDay.from(t.s);break;case 5:n=Temporal.PlainTime.from(t.s);break;case 6:n=Temporal.PlainYearMonth.from(t.s);break;case 7:n=Temporal.ZonedDateTime.from(t.s);break;default:throw new Ps(t)}return tu(e,t.i,n)}function mu(e,t){if(e.base.features&32){let n=vs(t.c);if(n.length>Gl)throw new Ps(t);return tu(e,t.i,new RegExp(n,t.m))}throw new Os(t)}function hu(e,t,n){let r=tu(e,n.i,new Set);iu(n,n.a);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(Ru(e,t,a[i]));return r}function gu(e,t,n){let r=tu(e,n.i,new Map);iu(n,n.e.k),iu(n,n.e.v);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(Ru(e,t,a[i]),Ru(e,t,o[i]));return r}function _u(e,t){if(typeof t.s!=`string`)throw new Ps(t);if(t.s.length>e.base.maxBase64Length)throw RangeError(`ArrayBuffer exceeds maxBase64Length (`+e.base.maxBase64Length+`)`);let n=vs(t.s),r;if(n.length<Ul||typeof Buffer>`u`)r=Nc(n);else{let e=atob(n);r=new ArrayBuffer(e.length),Buffer.from(r).write(e,`latin1`)}return tu(e,t.i,r)}function vu(e,t,n){let r=zl(n.c),i=Ru(e,t,n.f);if(!(i instanceof ArrayBuffer))throw new Ps(n);let a=n.b??0;if(a<0||a>i.byteLength)throw new Ps(n);return tu(e,n.i,new r(i,a,n.l))}function yu(e,t,n){let r=Ru(e,t,n.f);if(!(r instanceof ArrayBuffer))throw new Ps(n);let i=n.b??0;if(i<0||i>r.byteLength)throw new Ps(n);return tu(e,n.i,new DataView(r,i,n.l))}function bu(e,t,n,r){if(n.p){let i=uu(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function xu(e,t,n){return bu(e,t,n,tu(e,n.i,AggregateError([],vs(n.m))))}function Su(e,t,n){let r=nu(n,ns,n.s);return bu(e,t,n,tu(e,n.i,new r(vs(n.m))))}function Cu(e,t,n){let r=Sc(),i=tu(e,n.i,r.p),a=Ru(e,t,n.f);if(Ql(a))throw new Ps(n.f);return n.s?r.s(a):r.f(a),i}function wu(e,t,n){return tu(e,n.i,Object(Ru(e,t,n.f)))}function Tu(e,t,n){let r=e.base.plugins;if(r){let i=vs(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return tu(e,n.i,o.deserialize(n.s,new Xl(e,t),{id:n.i}))}}throw new ks(n.c)}function Eu(e,t){let n=tu(e,t.i,tu(e,t.s,Sc()).p);return cu(e,t.s,22),n}function Du(e,t,n){let r=e.base.refs.get(n.i);if(r){lu(e,n,n.i,22);let i=Ru(e,t,n.a[1]);if(Ql(i))throw new Ps(n.a[1]);n.t===23?r.s(i):r.f(i)}else throw new As(`Promise`)}function Ou(e,t,n){Ru(e,t,n.a[0]);let r=Ru(e,t,n.a[1]);if(!Ic(r))throw new Ps(n.a[1]);return Bc(r)}function ku(e,t,n){Ru(e,t,n.a[0]);let r=Ru(e,t,n.a[1]);if(!Kc(r))throw new Ps(n.a[1]);return Xc(r)}function Au(e,t,n){let r=tu(e,n.i,qc());cu(e,n.i,31);let i=n.a;iu(n,i);let a=i.length;if(a)for(let n=0;n<a;n++)Ru(e,t,i[n]);return r}function ju(e,t,n){let r=e.base.refs.get(n.i);if(r)lu(e,n,n.i,31),r.next(Ru(e,t,n.f));else throw new As(`Stream`)}function Mu(e,t,n){let r=e.base.refs.get(n.i);if(r)lu(e,n,n.i,31),r.throw(Ru(e,t,n.f));else throw new As(`Stream`)}function Nu(e,t,n){let r=e.base.refs.get(n.i);if(r)lu(e,n,n.i,31),r.return(Ru(e,t,n.f));else throw new As(`Stream`)}function Pu(e,t,n){Ru(e,t,n.f)}function Fu(e,t,n){Ru(e,t,n.a[1])}function Iu(e,t){return Number.isInteger(e)&&e>=-1&&e<t}function Lu(e,t,n){iu(n,n.a);let r=n.a.length;if(!(Iu(n.s,r)&&Iu(n.l,r)))throw new Ps(n);let i=tu(e,n.i,Lc([],n.s,n.l));for(let a=0;a<r;a++)i.v[a]=Ru(e,t,n.a[a]);return i}function Ru(e,t,n){if(t>e.base.depthLimit)throw new Fs(e.base.depthLimit);switch(t+=1,n.t){case 2:return nu(n,es,n.s);case 0:return Number(n.s);case 1:return vs(String(n.s));case 3:if(String(n.s).length>Wl)throw new Ps(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return ru(e,n);case 9:return au(e,t,n);case 10:case 11:return du(e,t,n);case 5:return fu(e,n);case 6:return mu(e,n);case 7:return hu(e,t,n);case 8:return gu(e,t,n);case 19:return _u(e,n);case 16:case 15:return vu(e,t,n);case 20:return yu(e,t,n);case 14:return xu(e,t,n);case 13:return Su(e,t,n);case 12:return Cu(e,t,n);case 17:return nu(n,Qo,n.s);case 21:return wu(e,t,n);case 25:return Tu(e,t,n);case 22:return Eu(e,n);case 23:case 24:return Du(e,t,n);case 28:return Ou(e,t,n);case 30:return ku(e,t,n);case 31:return Au(e,t,n);case 32:return ju(e,t,n);case 33:return Mu(e,t,n);case 34:return Nu(e,t,n);case 27:return Pu(e,t,n);case 29:return Fu(e,t,n);case 35:return Lu(e,t,n);case 36:return pu(e,n);default:throw new Os(n)}}function zu(e,t){try{return Ru(e,0,t)}catch(e){throw new Ts(e)}}var Bu=(()=>T).toString(),Vu=/=>/.test(Bu);function Hu(e,t){return Vu?(e.length===1?e[0]:`(`+e.join(`,`)+`)`)+`=>`+(t.startsWith(`{`)?`(`+t+`)`:t):`function(`+e.join(`,`)+`){return `+t+`}`}function Uu(e,t){return Vu?(e.length===1?e[0]:`(`+e.join(`,`)+`)`)+`=>{`+t+`}`:`function(`+e.join(`,`)+`){`+t+`}`}var Wu=`hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_`,Gu=34,Ku=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_`,qu=64;function Ju(e){let t=e%Gu,n=Wu[t];for(e=(e-t)/Gu;e>0;)t=e%qu,n+=Ku[t],e=(e-t)/qu;return n}var Yu=/^[$A-Z_][0-9A-Z_$]*$/i;function Xu(e){let t=e[0];return(t===`$`||t===`_`||t>=`A`&&t<=`Z`||t>=`a`&&t<=`z`)&&Yu.test(e)}function Zu(e){switch(e.t){case 0:return e.s+`=`+e.v;case 2:return e.s+`.set(`+e.k+`,`+e.v+`)`;case 1:return e.s+`.add(`+e.v+`)`;case 3:return e.s+`.delete(`+e.k+`)`;case 4:return`Object.defineProperty(`+e.s+`,"__proto__",{value:`+e.k+`,configurable:!0,enumerable:!0,writable:!0})`}}function Qu(e){let t=[],n=e[0];for(let r=1,i=e.length,a,o=n;r<i;r++)a=e[r],a.t===0&&a.v===o.v?n={t:0,s:a.s,k:void 0,v:Zu(n)}:a.t===2&&a.s===o.s?n={t:2,s:Zu(n),k:a.k,v:a.v}:a.t===1&&a.s===o.s?n={t:1,s:Zu(n),k:void 0,v:a.v}:a.t===3&&a.s===o.s?n={t:3,s:Zu(n),k:a.k,v:void 0}:(t.push(n),n=a),o=a;return t.push(n),t}function $u(e){if(e.length){let t=``,n=Qu(e);for(let e=0,r=n.length;e<r;e++)t+=Zu(n[e])+`,`;return t}}var ed=`Object.create(null)`,td=`new Set`,nd=`new Map`,rd=`Promise.resolve`,id=`Promise.reject`,ad={3:`Object.freeze`,2:`Object.seal`,1:`Object.preventExtensions`,0:void 0};function od(e,t){return{mode:e,plugins:t.plugins,features:t.features,marked:new Set(t.markedRefs),stack:[],flags:[],assignments:[]}}function sd(e){return{mode:2,base:od(2,e),state:e,child:void 0}}var cd=class{constructor(e){this._p=e}serialize(e){return gf(this._p,e)}};function ld(e,t){let n=e.valid.get(t);n??(n=e.valid.size,e.valid.set(t,n));let r=e.vars[n];return r??(r=Ju(n),e.vars[n]=r),r}function ud(e){return`$R[`+e+`]`}function dd(e,t){return e.mode===1?ld(e.state,t):ud(t)}function fd(e,t){e.marked.add(t)}function pd(e,t){return e.marked.has(t)}function md(e,t,n){t!==0&&(fd(e.base,n),e.base.flags.push({type:t,value:dd(e,n)}))}function hd(e){let t=``;for(let n=0,r=e.flags,i=r.length;n<i;n++){let e=r[n];t+=ad[e.type]+`(`+e.value+`),`}return t}function gd(e){let t=$u(e.assignments),n=hd(e);return t?n?t+n:t:n}function _d(e,t,n){e.assignments.push({t:0,s:t,k:void 0,v:n})}function vd(e,t,n){e.base.assignments.push({t:1,s:dd(e,t),k:void 0,v:n})}function yd(e,t,n,r){e.base.assignments.push({t:2,s:dd(e,t),k:n,v:r})}function bd(e,t,n){e.base.assignments.push({t:3,s:dd(e,t),k:n,v:void 0})}function xd(e,t,n,r){_d(e.base,dd(e,t)+`[`+n+`]`,r)}function Sd(e,t,n,r){Bl(n)?_d(e.base,dd(e,t)+`.`+n,r):e.base.assignments.push({t:4,s:dd(e,t),k:r,v:void 0})}function Cd(e,t,n,r){_d(e.base,dd(e,t)+`.v[`+n+`]`,r)}function wd(e,t){return t.t===4&&e.stack.includes(t.i)}function Td(e,t,n){return e.mode===1&&!pd(e.base,t)?n:dd(e,t)+`=`+n}function Ed(e){return`__SEROVAL_REFS__.get("`+e.s+`")`}function Dd(e,t,n,r){return n?wd(e.base,n)?(fd(e.base,t),xd(e,t,r,dd(e,n.i)),``):gf(e,n):``}function Od(e,t){let n=t.i,r=t.a,i=r.length;if(i>0){e.base.stack.push(n);let a=Dd(e,n,r[0],0),o=a===``;for(let t=1,s;t<i;t++)s=Dd(e,n,r[t],t),a+=`,`+s,o=s===``;return e.base.stack.pop(),md(e,t.o,t.i),`[`+a+(o?`,]`:`]`)}return`[]`}function kd(e,t,n,r){if(typeof n==`string`){let i=Number(n),a=i>=0&&i.toString()===n||Xu(n);if(wd(e.base,r)){let o=dd(e,r.i);return fd(e.base,t.i),a&&i!==i?Sd(e,t.i,n,o):xd(e,t.i,a?n:`"`+n+`"`,o),``}return Bl(n)?(a?n:`"`+n+`"`)+`:`+gf(e,r):`["`+n+`"]:`+gf(e,r)}return`[`+gf(e,n)+`]:`+gf(e,r)}function Ad(e,t,n){let r=n.k,i=r.length;if(i>0){let a=n.v;e.base.stack.push(t.i);let o=kd(e,t,r[0],a[0]);for(let n=1,s=o;n<i;n++)s=kd(e,t,r[n],a[n]),o+=(s&&o&&`,`)+s;return e.base.stack.pop(),`{`+o+`}`}return`{}`}function jd(e,t){return md(e,t.o,t.i),Ad(e,t,t.p)}function Md(e,t,n,r){let i=Ad(e,t,n);return i===`{}`?r:`Object.assign(`+r+`,`+i+`)`}function Nd(e,t,n,r,i){let a=e.base,o=gf(e,i),s=Number(r),c=s>=0&&s.toString()===r||Xu(r);if(wd(a,i))c&&s!==s?Sd(e,t.i,r,o):xd(e,t.i,c?r:`"`+r+`"`,o);else{let i=a.assignments;a.assignments=n,c&&s!==s?Sd(e,t.i,r,o):xd(e,t.i,c?r:`"`+r+`"`,o),a.assignments=i}}function Pd(e,t,n,r,i){if(typeof r==`string`)Nd(e,t,n,r,i);else{let a=e.base,o=a.stack;a.stack=[];let s=gf(e,i);a.stack=o;let c=a.assignments;a.assignments=n,xd(e,t.i,gf(e,r),s),a.assignments=c}}function Fd(e,t,n){let r=n.k,i=r.length;if(i>0){let a=[],o=n.v;e.base.stack.push(t.i);for(let n=0;n<i;n++)Pd(e,t,a,r[n],o[n]);return e.base.stack.pop(),$u(a)}}function Id(e,t,n){if(t.p){let r=e.base;if(r.features&8)n=Md(e,t,t.p,n);else{fd(r,t.i);let i=Fd(e,t,t.p);if(i)return`(`+Td(e,t.i,n)+`,`+i+dd(e,t.i)+`)`}}return n}function Ld(e,t){return md(e,t.o,t.i),Id(e,t,ed)}function Rd(e){return`new Date("`+e.s+`")`}var zd={0:`Temporal.Instant`,1:`Temporal.Duration`,2:`Temporal.PlainDate`,3:`Temporal.PlainDateTime`,4:`Temporal.PlainMonthDay`,5:`Temporal.PlainTime`,6:`Temporal.PlainYearMonth`,7:`Temporal.ZonedDateTime`};function Bd(e,t){if(e.base.features&64)return zd[t.c]+`.from("`+t.s+`")`;throw new Os(t)}function Vd(e,t){if(e.base.features&32)return`/`+vs(t.c)+`/`+t.m;throw new Os(t)}function Hd(e,t,n){let r=e.base;return wd(r,n)?(fd(r,t),vd(e,t,dd(e,n.i)),``):gf(e,n)}function Ud(e,t){let n=td,r=t.a,i=r.length,a=t.i;if(i>0){e.base.stack.push(a);let t=Hd(e,a,r[0]);for(let n=1,o=t;n<i;n++)o=Hd(e,a,r[n]),t+=(o&&t&&`,`)+o;e.base.stack.pop(),t&&(n+=`([`+t+`])`)}return n}function Wd(e,t,n,r,i){let a=e.base;if(wd(a,n)){let o=dd(e,n.i);if(fd(a,t),wd(a,r))return yd(e,t,o,dd(e,r.i)),``;if(r.t!==4&&r.i!=null&&pd(a,r.i)){let n=`(`+gf(e,r)+`,[`+i+`,`+i+`])`;return yd(e,t,o,dd(e,r.i)),bd(e,t,i),n}let s=a.stack;return a.stack=[],yd(e,t,o,gf(e,r)),a.stack=s,``}if(wd(a,r)){let o=dd(e,r.i);if(fd(a,t),n.t!==4&&n.i!=null&&pd(a,n.i)){let r=`(`+gf(e,n)+`,[`+i+`,`+i+`])`;return yd(e,t,dd(e,n.i),o),bd(e,t,i),r}let s=a.stack;return a.stack=[],yd(e,t,gf(e,n),o),a.stack=s,``}return`[`+gf(e,n)+`,`+gf(e,r)+`]`}function Gd(e,t){let n=nd,r=t.e.k,i=r.length,a=t.i,o=t.f,s=dd(e,o.i),c=e.base;if(i>0){let o=t.e.v;c.stack.push(a);let l=Wd(e,a,r[0],o[0],s);for(let t=1,n=l;t<i;t++)n=Wd(e,a,r[t],o[t],s),l+=(n&&l&&`,`)+n;c.stack.pop(),l&&(n+=`([`+l+`])`)}return o.t===26&&(fd(c,o.i),n=`(`+gf(e,o)+`,`+n+`)`),n}function Kd(e,t){return $d(e,t.f)+`("`+t.s+`")`}function qd(e,t){return`new `+t.c+`(`+gf(e,t.f)+`,`+t.b+`,`+t.l+`)`}function Jd(e,t){return`new DataView(`+gf(e,t.f)+`,`+t.b+`,`+t.l+`)`}function Yd(e,t){let n=t.i;e.base.stack.push(n);let r=Id(e,t,`new AggregateError([],"`+t.m+`")`);return e.base.stack.pop(),r}function Xd(e,t){return Id(e,t,`new `+ts[t.s]+`("`+t.m+`")`)}function Zd(e,t){let n,r=t.f,i=t.i,a=t.s?rd:id,o=e.base;if(wd(o,r)){let i=dd(e,r.i);n=a+(t.s?`().then(`+Hu([],i)+`)`:`().catch(`+Uu([],`throw `+i)+`)`)}else{o.stack.push(i);let t=gf(e,r);o.stack.pop(),n=a+`(`+t+`)`}return n}function Qd(e,t){return`Object(`+gf(e,t.f)+`)`}function $d(e,t){let n=gf(e,t);return t.t===4?n:`(`+n+`)`}function ef(e,t){if(e.mode===1)throw new Os(t);return`(`+Td(e,t.s,$d(e,t.f)+`()`)+`).p`}function tf(e,t){if(e.mode===1)throw new Os(t);return $d(e,t.a[0])+`(`+dd(e,t.i)+`,`+gf(e,t.a[1])+`)`}function nf(e,t){if(e.mode===1)throw new Os(t);return $d(e,t.a[0])+`(`+dd(e,t.i)+`,`+gf(e,t.a[1])+`)`}function rf(e,t){let n=e.base.plugins;if(n)for(let r=0,i=n.length;r<i;r++){let i=n[r];if(i.tag===t.c)return e.child??=new cd(e),i.serialize(t.s,e.child,{id:t.i})}throw new ks(t.c)}function af(e,t){let n=``,r=!1;return t.f.t!==4&&(fd(e.base,t.f.i),n=`(`+gf(e,t.f)+`,`,r=!0),n+=Td(e,t.i,`(`+Ac+`)(`+dd(e,t.f.i)+`)`),r&&(n+=`)`),n}function of(e,t){return $d(e,t.a[0])+`(`+gf(e,t.a[1])+`)`}function sf(e,t){let n=t.a[0],r=t.a[1],i=e.base,a=``;n.t!==4&&(fd(i,n.i),a+=`(`+gf(e,n)),r.t!==4&&(fd(i,r.i),a+=(a?`,`:`(`)+gf(e,r)),a&&(a+=`,`);let o=Td(e,t.i,`(`+Mc+`)(`+dd(e,r.i)+`,`+dd(e,n.i)+`)`);return a?a+o+`)`:o}function cf(e,t){return $d(e,t.a[0])+`(`+gf(e,t.a[1])+`)`}function lf(e,t){let n=Td(e,t.i,$d(e,t.f)+`()`),r=t.a.length;if(r){let i=gf(e,t.a[0]);for(let n=1;n<r;n++)i+=`,`+gf(e,t.a[n]);return`(`+n+`,`+i+`,`+dd(e,t.i)+`)`}return n}function uf(e,t){return dd(e,t.i)+`.next(`+gf(e,t.f)+`)`}function df(e,t){return dd(e,t.i)+`.throw(`+gf(e,t.f)+`)`}function ff(e,t){return dd(e,t.i)+`.return(`+gf(e,t.f)+`)`}function pf(e,t,n,r){let i=e.base;return wd(i,r)?(fd(i,t),Cd(e,t,n,dd(e,r.i)),``):gf(e,r)}function mf(e,t){let n=t.a,r=n.length,i=t.i;if(r>0){e.base.stack.push(i);let a=pf(e,i,0,n[0]);for(let t=1,o=a;t<r;t++)o=pf(e,i,t,n[t]),a+=(o&&a&&`,`)+o;if(e.base.stack.pop(),a)return`{__SEROVAL_SEQUENCE__:!0,v:[`+a+`],t:`+t.s+`,d:`+t.l+`}`}return`{__SEROVAL_SEQUENCE__:!0,v:[],t:-1,d:0}`}function hf(e,t){switch(t.t){case 17:return Xo[t.s];case 18:return Ed(t);case 9:return Od(e,t);case 10:return jd(e,t);case 11:return Ld(e,t);case 5:return Rd(t);case 6:return Vd(e,t);case 7:return Ud(e,t);case 8:return Gd(e,t);case 19:return Kd(e,t);case 16:case 15:return qd(e,t);case 20:return Jd(e,t);case 14:return Yd(e,t);case 13:return Xd(e,t);case 12:return Zd(e,t);case 21:return Qd(e,t);case 22:return ef(e,t);case 25:return rf(e,t);case 26:return Wc[t.s];case 35:return mf(e,t);case 36:return Bd(e,t);default:throw new Os(t)}}function gf(e,t){switch(t.t){case 2:return $o[t.s];case 0:return``+t.s;case 1:return`"`+t.s+`"`;case 3:return t.s+`n`;case 4:return dd(e,t.i);case 23:return tf(e,t);case 24:return nf(e,t);case 27:return af(e,t);case 28:return of(e,t);case 29:return sf(e,t);case 30:return cf(e,t);case 31:return lf(e,t);case 32:return uf(e,t);case 33:return df(e,t);case 34:return ff(e,t);default:return Td(e,t.i,hf(e,t))}}function _f(e,t){let n=gf(e,t),r=t.i;if(r==null)return n;let i=gd(e.base),a=dd(e,r),o=e.state.scopeId,s=o==null?``:`$R`,c=i?`(`+n+`,`+i+a+`)`:n;if(s===``)return t.t===10&&!i?`(`+c+`)`:c;let l=o==null?`()`:`($R["`+gs(o)+`"])`;return`(`+Hu([s],c)+`)`+l}var vf=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Gf(this._p,this.depth,e)}},yf=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Gf(this._p,this.depth,e)}parseWithError(e){return Qf(this._p,this.depth,e)}isAlive(){return this._p.state.alive}pushPendingState(){Xf(this._p)}popPendingState(){Zf(this._p)}onParse(e){Kf(this._p,e)}onError(e){qf(this._p,e)}addCleanup(e){this._p.state.cleanups.push(e)}};function bf(e){return{alive:!0,pending:0,initial:!0,buffer:[],onParse:e.onParse,onError:e.onError,onDone:e.onDone,cleanups:[]}}function xf(e){return{type:2,base:Qc(2,e),state:bf(e)}}function Sf(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=Gf(e,t,n[i]):r[i]=0;return r}function Cf(e,t,n,r){return ac(n,r,Sf(e,t,r))}function wf(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(gs(r[n][0])),a.push(Gf(e,t,r[n][1]));return Bo in n&&(i.push(rl(e.base,Bo)),a.push(mc(al(e.base),Gf(e,t,Rc(n))))),Lo in n&&(i.push(rl(e.base,Lo)),a.push(hc(ol(e.base),Gf(e,t,e.type===1?qc():Jc(n,e.state.cleanups))))),Jo in n&&(i.push(rl(e.base,Jo)),a.push(Xs(n[Jo]))),zo in n&&(i.push(rl(e.base,zo)),a.push(n[zo]?as:os)),{k:i,v:a}}function Tf(e,t,n,r,i){return sl(n,r,i,wf(e,t,r))}function Ef(e,t,n,r){return oc(n,Gf(e,t,r.valueOf()))}function Df(e,t,n,r){return r=ul(e.base,r),cc(n,r,Gf(e,t,r.buffer))}function Of(e,t,n,r){return r=ul(e.base,r),lc(n,r,Gf(e,t,r.buffer))}function kf(e,t,n,r){return r=ul(e.base,r),uc(n,r,Gf(e,t,r.buffer))}function Af(e,t,n,r){let i=qs(r,e.base.features);return dc(n,r,i?wf(e,t,i):void 0)}function jf(e,t,n,r){let i=qs(r,e.base.features);return fc(n,r,i?wf(e,t,i):void 0)}function Mf(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(Gf(e,t,n)),a.push(Gf(e,t,o));return cl(e.base,n,i,a)}function Nf(e,t,n,r){let i=[];for(let n of r.keys())i.push(Gf(e,t,n));return pc(n,i)}function Pf(e,t,n,r){let i=gc(n,il(e.base,4),[]);return e.type===1||(Xf(e),r.on({next:r=>{if(e.state.alive){let i=Qf(e,t,r);i&&Kf(e,_c(n,i))}},throw:r=>{if(e.state.alive){let i=Qf(e,t,r);i&&Kf(e,vc(n,i))}Zf(e)},return:r=>{if(e.state.alive){let i=Qf(e,t,r);i&&Kf(e,yc(n,i))}Zf(e)}})),i}function Ff(e,t,n){if(this.state.alive){let r=Qf(this,t,n);r&&Kf(this,rs(23,e,void 0,void 0,void 0,void 0,void 0,[il(this.base,2),r],void 0,void 0,void 0,void 0)),Zf(this)}}function If(e,t,n){if(this.state.alive){let r=Qf(this,t,n);r&&Kf(this,rs(24,e,void 0,void 0,void 0,void 0,void 0,[il(this.base,3),r],void 0,void 0,void 0,void 0))}Zf(this)}function Lf(e,t,n,r){let i=el(e.base,{});return e.type===2&&(Xf(e),r.then(Ff.bind(e,i,t),If.bind(e,i,t))),ll(e.base,n,i)}function Rf(e,t,n,r,i){for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.sync&&o.test(r))return ic(n,o.tag,o.parse.sync(r,new vf(e,t),{id:n}))}}function zf(e,t,n,r,i){for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.stream&&o.test(r))return ic(n,o.tag,o.parse.stream(r,new yf(e,t),{id:n}))}}function Bf(e,t,n,r){let i=e.base.plugins;if(i)return e.type===1?Rf(e,t,n,r,i):zf(e,t,n,r,i)}function Vf(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=Gf(e,t,r.v[n]);return bc(n,i,r.t,r.d)}function Hf(e,t,n,r,i){switch(i){case Object:return Tf(e,t,n,r,!1);case void 0:return Tf(e,t,n,r,!0);case Date:return $s(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Af(e,t,n,r);case Number:case Boolean:case String:case BigInt:return Ef(e,t,n,r);case ArrayBuffer:return fl(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Df(e,t,n,r);case DataView:return kf(e,t,n,r);case Map:return Mf(e,t,n,r);case Set:return Nf(e,t,n,r)}if(i===Promise||r instanceof Promise)return Lf(e,t,n,r);let a=e.base.features;if(a&32&&i===RegExp)return tc(n,r);if(a&16)switch(i){case BigInt64Array:case BigUint64Array:return Of(e,t,n,r)}if(a&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return jf(e,t,n,r);if(a&64&&typeof Temporal<`u`)switch(i){case Temporal.Instant:return ec(n,0,r);case Temporal.Duration:return ec(n,1,r);case Temporal.PlainDate:return ec(n,2,r);case Temporal.PlainDateTime:return ec(n,3,r);case Temporal.PlainMonthDay:return ec(n,4,r);case Temporal.PlainTime:return ec(n,5,r);case Temporal.PlainYearMonth:return ec(n,6,r);case Temporal.ZonedDateTime:return ec(n,7,r)}if(r instanceof Error)return Af(e,t,n,r);if(Bo in r||Lo in r)return Tf(e,t,n,r,!!i);throw new Ds(r)}function Uf(e,t,n,r){if(Array.isArray(r))return Cf(e,t,n,r);if(Kc(r))return Pf(e,t,n,r);if(Ic(r))return Vf(e,t,n,r);let i=r.constructor;if(i!==void 0&&typeof i!=`function`){let e=Object.getPrototypeOf(r);i=e===null?void 0:e.constructor}return i===xc?Gf(e,t,r.replacement):Bf(e,t,n,r)||Hf(e,t,n,r,i)}function Wf(e,t,n){let r=nl(e.base,n);if(r.type!==0)return r.value;let i=Bf(e,t,r.value,n);if(i)return i;throw new Ds(n)}function Gf(e,t,n){if(t>=e.base.depthLimit)throw new Fs(e.base.depthLimit);switch(typeof n){case`boolean`:return n?as:os;case`undefined`:return ss;case`string`:return Xs(n);case`number`:return Ys(n);case`bigint`:return Zs(n);case`object`:if(n){let r=nl(e.base,n);return r.type===0?Uf(e,t+1,r.value,n):r.value}return cs;case`symbol`:return rl(e.base,n);case`function`:return Wf(e,t,n);default:throw new Ds(n)}}function Kf(e,t){e.state.initial?e.state.buffer.push(t):Yf(e,t,!1)}function qf(e,t){if(e.state.onError)e.state.onError(t);else throw t instanceof ws?t:new ws(t)}function Jf(e){e.state.onDone&&e.state.onDone();for(let t=0,n=e.state.cleanups.length;t<n;t++)e.state.cleanups[t]()}function Yf(e,t,n){try{e.state.onParse(t,n)}catch(t){qf(e,t)}}function Xf(e){e.state.pending++}function Zf(e){--e.state.pending<=0&&Jf(e)}function Qf(e,t,n){try{return Gf(e,t,n)}catch(t){qf(e,t);return}}function $f(e,t){let n=Qf(e,0,t);n&&(Yf(e,n,!0),e.state.initial=!1,ep(e,e.state),e.state.pending<=0&&tp(e))}function ep(e,t){for(let n=0,r=t.buffer.length;n<r;n++)Yf(e,t.buffer[n],!1)}function tp(e){e.state.alive&&(Jf(e),e.state.alive=!1)}async function np(e,t={}){let n=Rl(t.plugins);return await Fl(pl(2,{compactArrayBufferViews:t.compactArrayBufferViews,plugins:n,disabledFeatures:t.disabledFeatures,refs:t.refs}),e)}function rp(e,t){let n=Rl(t.plugins),r=xf({compactArrayBufferViews:t.compactArrayBufferViews,plugins:n,refs:t.refs,disabledFeatures:t.disabledFeatures,onParse(e,i){let a=sd({plugins:n,features:r.base.features,scopeId:t.scopeId,markedRefs:r.base.marked}),o;try{o=_f(a,e)}catch(e){t.onError&&t.onError(e);return}t.onSerialize(o,i)},onError:t.onError,onDone:t.onDone});return $f(r,e),tp.bind(null,r)}function ip(e,t){let n=Rl(t.plugins),r=xf({compactArrayBufferViews:t.compactArrayBufferViews,plugins:n,refs:t.refs,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit,onParse:t.onParse,onError:t.onError,onDone:t.onDone});return $f(r,e),tp.bind(null,r)}function ap(e,t={}){let n=Rl(t.plugins),r=t.disabledFeatures||0,i=e.f??127;return zu(Yl({maxBase64Length:t.maxBase64Length,plugins:n,markedRefs:e.m,features:i&~r,disabledFeatures:r}),e.t)}function op(e){return Il({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n){return{v:n.parse(e.toSerializable(t))}},async async(t,n){return{v:await n.parse(e.toSerializable(t))}},stream(t,n){return{v:n.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,n){return e.fromSerializable(n.deserialize(t.v))}})}var sp=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}};function cp(e,t){let n=e[1];e.length=0,n?.(t)}var lp=yt();function up(){let e=gt(),t=e.routesById[me];Ee(e,t);let n=(0,lp.jsxs)(lp.Fragment,{children:[!1,(0,lp.jsx)(dp,{})]});return e.options.InnerWrap?(0,lp.jsx)(e.options.InnerWrap,{children:n}):n}function dp(){let e=gt(),t=e._rendered,n=e.stores.matches.get(),r=n[0],i=r?.routeId;Fo(()=>{t[0]===n&&cp(t,!0)},[t,n]);let a=i?(0,lp.jsx)(we,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,lp.jsx)(ct,{getResetKey:()=>r,onCatch:void 0,children:a})}function fp({router:e,children:t,...n}){E(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,lp.jsx)(qe.Provider,{value:e,children:t});return e.options.Wrap?(0,lp.jsx)(e.options.Wrap,{children:r}):r}function pp({router:e,...t}){return(0,lp.jsx)(fp,{router:e,...t,children:(0,lp.jsx)(up,{})})}function mp(e){return(0,lp.jsx)(pp,{router:e.router})}var hp=Il({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}});function gp(e){let t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(t.join(``))}function _p(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var vp=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function yp(e){try{return`t`+vp.decode(e)}catch{return`b`+gp(e)}}var bp=new TextEncoder;function xp(e){let t=e.slice(1);return e[0]===`t`?bp.encode(t):_p(t)}function Sp(e,t,n){n?.throwIfAborted();let r=qc(),i=e.getReader(),a=!0,o=()=>{a=!1,n?.removeEventListener(`abort`,c),i.releaseLock()},s=e=>a?(i.cancel(e).catch(()=>{}),o(),!0):!1,c=()=>{s(n.reason)&&r.throw(n.reason)};return n?.addEventListener(`abort`,c),(async()=>{try{for(;a;){let{done:e,value:n}=await i.read();if(!a)return;if(e){o(),r.return(void 0);return}r.next(t(n))}}catch(e){s(e)&&r.throw(e)}})(),[r,s]}function Cp(e,t){let n,r=!1;return new ReadableStream({start(i){let a=e.on({next(e){if(!r)try{i.enqueue(t(e))}catch(e){r=!0;let t=n;n=void 0,t?.(),i.error(e)}},throw(e){r||(r=!0,n=void 0,i.error(e))},return(){r||(r=!0,n=void 0,i.close())}});r?a():n=a},cancel(){let e=n;n=void 0,e?.()}})}function wp(e){return Il({tag:`tss/RawStream`,test:e=>e instanceof sp,parse:{async:async(t,n)=>{let r=await n.parse(t.hint===`text`),[i]=Sp(t.stream,t.hint===`text`?yp:gp,e);return{text:r,stream:await n.parse(i)}}},serialize:void 0,deserialize:void 0})}var Tp=wp(),Ep=Il({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize:void 0,deserialize(e,t){return Cp(t.deserialize(e.stream),t.deserialize(e.text)?xp:_p)}}),Dp={},Op=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(e)}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),kp=Il({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===Dp},parse:{sync(){return Dp},async async(){return await Promise.resolve(Dp)},stream(){return Dp}},serialize(){return Op.toString()},deserialize(){return Dp}});async function Ap(e,t){try{for(;;){let n=await t.read();if(n.done){e.return(n.value),t.releaseLock();break}e.next(n.value)}}catch(n){t.releaseLock(),e.throw(n)}}function jp(e){e.cancel().catch(()=>{}),e.releaseLock()}function Mp(e){let t=qc(),n=e.getReader(),r=jp.bind(null,n);return Ap(t,n).catch(r),[t,r]}var Np=Il({tag:`seroval/plugins/web/ReadableStream`,extends:[kp],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Dp),stream:t.parse(qc())}},async async(e,t){return{factory:await t.parse(Dp),stream:await t.parse(Mp(e)[0])}},stream(e,t){let[n,r]=Mp(e);return t.addCleanup(r),{factory:t.parse(Dp),stream:t.parse(n)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){let n=t.deserialize(e.stream);if(!n||typeof n!=`object`||!Kc(n))throw Error(`Expected a stream source.`);return Op(n)}});function Pp(e){return[hp,e?wp(e):Tp,Np]}var Fp=[Ep,...Pp()];function Ip(e){let t=1;return Il({tag:`tss/RawStream`,test(e){return e instanceof sp},parse:{stream(n,r){let i=t++;return e(i,n.stream),{streamId:r.parse(i)}}},serialize:void 0,deserialize:void 0})}var Lp=`$_TSR`;function Rp(e,t){return Il({tag:`$TSR/t/`+e.key,test:e.test,parse:{stream(t,n){return{v:n.parse(e.toSerializable(t))}}},serialize(n,r){return t&&(t.didRun=!0),Lp+`.t.get("`+e.key+`")(`+r.serialize(n.v)+`)`},deserialize:void 0})}var zp=`self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]}`,Bp=new TextEncoder,Vp=`</body></html>`,Hp=`<\/script>`,Up=Vp.indexOf(`y`),Wp=Hp.indexOf(`p`),Gp=Bp.encode(Vp),Kp=Bp.encode(Hp);function qp(e,t,n,r=0){return Bp.encodeInto(t===0?e:e.slice(t),r===0?n:n.subarray(r))}function Jp(e,t,n=0,r=!1){let{pattern:i,anchorIndex:a}=e,o=e.matched,s,c=n;for(;c<t.length;){if(o===0){if(a>0&&c<t.length-a){let e=t.indexOf(i[a],c+a);if(e<0){c=t.length-a;continue}c=e-a}else if(c=t.indexOf(i[0],c),c<0)return e.matched=o,s}let n=t[c];if(n===i[o]?o++:o=+(n===i[0]),c++,o===i.length){if(o=0,!r)return e.matched=o,c;s=c}}return e.matched=o,s}function Yp(e,t,n=0,r=0){let i=e.indexOf(t[r],n+r);for(;i>=0;){let n=i-r;if(n+t.length>e.length)return-1;let a=0;for(;a<t.length&&e[n+a]===t[a];)a++;if(a===t.length)return n;i=e.indexOf(t[r],i+1)}return-1}function Xp(e,t,n=0){candidate:for(let r=Math.min(t.length-1,e.length-n);r>0;r--){let n=e.length-r;for(let i=0;i<r;i++)if(e[n+i]!==t[i])continue candidate;return n}}var Zp=new TextEncoder,Qp=`;`,$p=16384,em=16777216,tm=4096,nm=256,rm=16384,im=65536,am=im,om=`data-tsr-stream-part`,sm=`{let s=document.currentScript,p;while((p=s.previousElementSibling)&&p.hasAttribute('${om}'))p.remove();s.remove()}`,cm=Qp+sm,lm=`document.currentScript.remove()<\/script>`,um=`document.currentScript.remove();/*$tsr-stream-boundary*/`,dm=`;/*$tsr-stream-boundary*/<\/script>`,fm=dm.lastIndexOf(`*`),pm=Zp.encode(dm),mm=Lp+`.router=`,hm=Lp+`.p(()=>`,gm=[Rs(`tsr`),zp],_m={Waiting:0,Ready:1,Active:2,Done:3,Failed:4};function vm(e){return e.replace(/[&"'<>]/g,e=>`&#${e.charCodeAt(0)};`)}function ym(e,t){let n=[];for(let r of e){if(!r)continue;let e=n[n.length-1];e?.children&&e.children.length+1+r.length<=$p?e.children+=Qp+r:n.push({tag:`script`,attrs:{nonce:t,[om]:``},children:r})}let r=n[n.length-1];if(r){let e=r.children;e.length+cm.length<=$p?r.children=e+cm:n.push({tag:`script`,attrs:{nonce:t,[om]:``},children:sm})}return{before:n,boundary:{tag:`script`,attrs:{nonce:t},children:um}}}var bm=class{constructor(e,t){this.nonce=e,this.queuedSources=[],this.queuedSourceHead=0,this.initialTaken=!1,this.barrierLifted=!1,this.producerDone=!1,this.retainedSources=0,this.regularCodeUnits=0,this.hasOversizedSource=!1,this.segmentIndex=0,this.closingSegmentIndex=0,this.source=``,this.sourceOffset=0,this.outputCapacity=nm,this.outputState=_m.Waiting,this.takeInitialHydrationScriptTags=this.takeInitialHydrationScriptTags.bind(this);let n=t??gm;for(let e of n){if(!this.account(e))break;this.queuedSources.push(e)}}get state(){return this.outputState}get error(){return this.outputError}notify(){try{this.listener?.()}catch(e){console.error(`Hydration script output listener error:`,e)}}refresh(e=!0){let t=this.outputState===_m.Failed?_m.Failed:this.active?_m.Active:typeof this.consumer==`object`&&this.initialTaken&&this.barrierLifted&&!this.queueIsEmpty()?_m.Ready:this.producerDone&&this.initialTaken&&this.queueIsEmpty()?_m.Done:_m.Waiting;this.outputState!==t&&(this.outputState=t,e&&this.notify())}clearTimeoutIfSet(){this.timeout!==void 0&&(clearTimeout(this.timeout),this.timeout=void 0)}queueIsEmpty(){return this.queuedSourceHead===this.queuedSources.length}clearQueue(){this.queuedSources=[],this.queuedSourceHead=0}dropBufferedOutput(){this.clearQueue(),this.active=void 0,this.retainedSources=0,this.regularCodeUnits=0,this.hasOversizedSource=!1,this.segmentIndex=0,this.closingSegmentIndex=0,this.source=``,this.sourceOffset=0,this.outputCapacity=nm,this.opening=void 0}fail(e){this.consumer!==`cleaned`&&this.outputState!==_m.Failed&&(this.outputError=e,this.clearTimeoutIfSet(),this.dropBufferedOutput(),this.outputState=_m.Failed,this.notify())}rejectBacklog(e){return this.fail(Error(`SSR hydration backlog exceeded maximum ${e} count`)),!1}account(e){if(this.retainedSources===tm)return this.rejectBacklog(`source-part`);if(e.length>em){if(this.hasOversizedSource)return this.rejectBacklog(`code-unit`);this.hasOversizedSource=!0}else if(this.regularCodeUnits+e.length>em)return this.rejectBacklog(`code-unit`);else this.regularCodeUnits+=e.length;return this.retainedSources++,!0}releaseSource(e){this.retainedSources--,e.length>em?this.hasOversizedSource=!1:this.regularCodeUnits-=e.length}releaseAccounting(e){for(let t of e)t!==void 0&&this.releaseSource(t)}liftBarrier(){this.consumer!==`cleaned`&&!this.barrierLifted&&(this.barrierLifted=!0,this.refresh())}producerCanWrite(){return this.consumer!==`cleaned`&&this.outputState!==_m.Failed&&!this.producerDone}pushSource(e){if(!this.producerCanWrite())return!1;if(this.account(e))this.queuedSources.push(e),this.initialTaken&&this.refresh();else return!1;return this.producerCanWrite()}takeQueuedBatch(e){if(this.queuedSourceHead===0&&e===this.queuedSources.length){let e=this.queuedSources;return this.clearQueue(),e}let t=this.queuedSourceHead+e,n=this.queuedSources.slice(this.queuedSourceHead,t);for(let e=this.queuedSourceHead;e<t;e++)this.queuedSources[e]=void 0;return this.queuedSourceHead=t,this.queueIsEmpty()?this.clearQueue():this.queuedSourceHead>=1024&&this.queuedSourceHead>=this.queuedSources.length-this.queuedSourceHead&&(this.queuedSources=this.queuedSources.slice(this.queuedSourceHead),this.queuedSourceHead=0),n}release(e){this.releaseAccounting(e),this.active=void 0,this.source=``,this.sourceOffset=0,this.refresh(!1)}advanceSource(){let e=this.active;if(this.segmentIndex>0&&this.segmentIndex<this.closingSegmentIndex){let t=this.segmentIndex-1>>1;if(this.segmentIndex%2==1){let n=e[t];n!==void 0&&(this.releaseSource(n),e[t]=void 0)}}if(this.segmentIndex++,this.segmentIndex<this.closingSegmentIndex){let t=this.segmentIndex-1>>1;this.source=this.segmentIndex%2==1?e[t]:Qp}else this.segmentIndex===this.closingSegmentIndex?this.source=lm:this.release(e);this.sourceOffset=0}pullActive(){let e=new Uint8Array(this.outputCapacity),t=0;for(;this.active;)if(this.sourceOffset===this.source.length)this.advanceSource();else if(t===e.length)break;else{let n=qp(this.source,this.sourceOffset,e,t);if(n.read===0)break;this.sourceOffset+=n.read,t+=n.written}if(t===0)throw Error(`SSR router script record produced no output`);return t===e.length?e:t*2<e.length?e.slice(0,t):e.subarray(0,t)}pullReady(){let e=this.opening??=this.nonce?`<script nonce="${vm(this.nonce)}">`:`<script>`,t=e.length+40,n=0;for(let e=this.queuedSourceHead;e<this.queuedSources.length;e++){let r=this.queuedSources[e],i=t+1+r.length;if(n>0&&i>am||(t=i,n++,t>am))break}let r=this.takeQueuedBatch(n);if(t<=rm){let t=r.length===1?r[0]:r.join(Qp),n=Zp.encode(e+t+`;document.currentScript.remove()<\/script>`);return this.release(r),n}return this.active=r,this.segmentIndex=0,this.closingSegmentIndex=(r.length<<1)+1,this.source=e,this.sourceOffset=0,this.outputCapacity=Math.max(nm,Math.min(im,t)),this.outputState=_m.Active,this.pullActive()}pullChunk(){if(this.outputState!==_m.Ready&&this.outputState!==_m.Active)throw Error(`Hydration script output is not ready`);try{return this.outputState===_m.Ready?this.pullReady():this.pullActive()}catch(e){throw this.fail(e),e}}subscribe(e){if(this.consumer===`cleaned`)return()=>{};if(this.listener)throw Error(`SSR hydration output already has a subscriber`);return this.listener=e,()=>{this.listener===e&&(this.listener=void 0)}}pushSerializedSource(e,t,n){let r=t?mm+e:e;return n&&(r=hm+r+`)`),this.pushSource(r)}finish(){this.pushSource(`$_TSR.e()`)&&(this.producerDone=!0,this.clearTimeoutIfSet(),this.refresh())}takeInitialHydrationScriptTags(){if(this.consumer===`cleaned`||this.outputState===_m.Failed||this.initialTaken)return;let e=this.queuedSources,t=ym(e,this.nonce);return this.initialTaken=!0,this.releaseAccounting(e),e.length=0,this.queuedSourceHead=0,this.refresh(),t}disableHydration(){this.consumer!==`cleaned`&&this.outputState!==_m.Failed&&((this.initialTaken||this.consumer!==void 0||this.producerDone)&&de(),this.releaseAccounting(this.queuedSources),this.clearQueue(),this.initialTaken=!0,this.barrierLifted=!0,this.producerDone=!0,this.refresh())}isInitialTaken(){return this.initialTaken}skipInitialTake(){this.consumer!==`cleaned`&&!this.initialTaken&&(this.initialTaken=!0,this.refresh())}claimOutput(){if(this.consumer===`cleaned`)throw Error(`SSR hydration script output is already cleaned up`);if(this.consumer!==void 0)throw Error(`SSR hydration script output already has a consumer`);return this.consumer=this,this.refresh(!1),this}reserveFastPath(e){let t=this.consumer===e;return this.outputState===_m.Failed||!this.producerDone||!this.initialTaken||!this.queueIsEmpty()||this.active||!t?!1:(this.consumer=`fast-path`,!0)}startSerializationTimeout(e){this.consumer===`cleaned`||this.outputState===_m.Failed||this.producerDone||this.timeout!==void 0||(this.timeout=setTimeout(()=>{this.timeout=void 0,this.consumer!==`cleaned`&&this.outputState!==_m.Failed&&!this.producerDone&&(console.error(`Serialization timeout after app render finished`),this.fail(Error(`Serialization timeout after app render finished`)))},e))}cleanup(){this.consumer!==`cleaned`&&(this.consumer=`cleaned`,this.clearTimeoutIfSet(),this.dropBufferedOutput(),this.listener=void 0,this.outputError=void 0,this.producerDone=!0,this.outputState=_m.Done)}};function xm(e,t){return new bm(e,t)}var Sm=globalThis.Buffer,Cm=Sm?e=>Sm.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`):gp,wm=()=>{},Tm=()=>{},Em=`((s,u=1)=>new ReadableStream({start(c,f){f=s.on({next(b){const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)},throw(e){s=u=0;c.error(e)},return(){s=u=0;c.close()}});u=u&&f},cancel(){u&&u()}}))`,Dm=`((s,u=1,e=new TextEncoder)=>new ReadableStream({start(c,f){f=s.on({next(v){const x=v.slice(1);if(v[0]==='t')c.enqueue(e.encode(x));else{const d=atob(x),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}},throw(x){s=u=0;c.error(x)},return(){s=u=0;c.close()}});u=u&&f},cancel(){u&&u()}}))`;function Om(e,t,n){return Il({tag:e,test(e){return e===t},parse:{stream(){return{}}},serialize(){return n},deserialize:void 0})}var km=[hp,Il({tag:`tss/RawStream`,extends:[Om(`tss/RawStreamFactory`,wm,Em),Om(`tss/RawStreamFactoryText`,Tm,Dm)],test(e){return e instanceof sp},parse:{stream(e,t){let n=e.hint===`text`,r=t.parse(n?Tm:wm),[i,a]=Sp(e.stream,n?yp:Cm);return t.addCleanup(a),{factory:r,stream:t.parse(i)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize:void 0}),Np];function Am(e){let t={i:Po(e.id),u:e.updatedAt,s:e.status};for(let[n,r]of[[`__beforeLoadContext`,`b`],[`loaderData`,`l`],[`error`,`e`],[`ssr`,`ssr`]])e[n]!==void 0&&(t[r]=e[n]);return e._notFound&&(t.g=!0),t}function jm(e){try{e?.()}catch(e){console.error(`Error disposing SSR serialization:`,e)}}function Mm(e,t,n){let r=e.slice();e.length=0;for(let e of r)try{e(n)}catch(e){console.error(t,e)}}var Nm=100,Pm=new WeakMap;function Fm(e){let t=Pm.get(e);if(t)return t;let n=h(Nm);return Pm.set(e,n),n}function Im(e,t){let n=e.inlineCss?.styles,r=t.inlineCssHrefs;if(!n||!r?.length)return;let i=``;for(let e of r)i+=n[e];return i}function Lm(e,t){let n=Im(e,t);return n===void 0?void 0:wt(n)}function Rm(e){let t=``;for(let n=0;n<e.length;n++)t+=(n===0?``:`\0`)+e[n].routeId;return t}function zm(e,t,n){{let t=Fm(e).get(n);if(t)return t}let r=Bm(e,t);return Fm(e).set(n,r),r}function Bm(e,t){let n=e.inlineCss?.styles,r={};if(!n){for(let n of t){let t=e.routes[n.routeId];t&&(r[n.routeId]=t)}return{routes:r,hasStrippedRoutes:!1}}let i=[],a=new Set,o=!1;for(let s of t){let t=s.routeId,c=e.routes[t];if(!c)continue;let l=Vm(n,c,i,a);l!==c&&(o=!0),r[t]=l}return{routes:r,hasStrippedRoutes:o,...i.length?{inlineCssHrefs:i}:{}}}function Vm(e,t,n,r){let i=t.css;if(!i)return t;if(i.length===0){let e={...t};return delete e.css,e}let a;for(let t=0;t<i.length;t++){let o=i[t],s=dt(o);e[s]===void 0?a&&a.push(o):(r.has(s)||(r.add(s),n.push(s)),a||=i.slice(0,t))}if(!a)return t;if(a.length>0)return{...t,css:a};let o={...t};return delete o.css,o}function Hm(e){return!!e.scripts?.length||!!e.css?.length}function Um(e){return!!e&&(!!e.preloads?.length||Hm(e))}function Wm(e,t){let n=t?.preloads?.length?[...t.preloads,...e?.preloads??[]]:e?.preloads,r=t?.scripts?.length?[...t.scripts,...e?.scripts??[]]:e?.scripts,i=t?.css?.length?[...t.css,...e?.css??[]]:e?.css;return{...e??{},...n?.length?{preloads:n}:{},...r?.length?{scripts:r}:{},...i?.length?{css:i}:{}}}function Gm(e,t,n,r){let i={...e?{scriptFormat:e}:{},...t?{inlineStyle:t}:{},routes:n};return Um(r)?{...i,routes:{...n,[me]:Wm(n[me],r)}}:i}function Km({router:e,manifest:t,getRequestAssets:n}){let r;e.ssr={get manifest(){if(!t)return t;let i=n?.(),a=Um(i);if(!a&&!t.inlineCss)return t;let o,s=t.routes;if(t.inlineCss){let n=Dt(e.stores.matches.get()),i=Rm(n);if(r?.cacheKey===i)o=r.inlineCssAsset,s=r.routes;else{let e=zm(t,n,i);o=Lm(t,e),e.hasStrippedRoutes&&(s={...t.routes,...e.routes}),r={cacheKey:i,inlineCssAsset:o,routes:s}}}return Gm(t.scriptFormat,o,s,a?i:void 0)}};let i=`idle`,a=!1,o=[],s=[],c=!1,l=!1,u,d=xm(e.options.ssr?.nonce),f={hydrationScripts:d,dehydrate:async n=>{i!==`idle`&&de(),n?.signal?.throwIfAborted(),i=`started`;let r=Dt(e.stores.matches.get());e.isShell()&&(r=r.slice(0,1));let a=r.map(Am),o;if(t){let e=Rm(r),i=zm(t,r,e);o=Gm(t.scriptFormat,i.inlineCssHrefs?tt():void 0,i.routes,n?.requestAssets)}let s={manifest:o,matches:a},f=e.options.dehydrate,p=f?n?.signal?await Ve(f.call(e.options),n.signal):await f.call(e.options):void 0;if(n?.signal?.throwIfAborted(),c)return;p!==void 0&&(s.dehydratedData=p);let m={didRun:!1},h=e.options.serializationAdapters,g=h?[...h.map(e=>Rp(e,m)),...km]:km,_=!1,v=!1,y=e=>{if(_||c)return;_=!0;let t=u;u=void 0,e===!0?(l=!0,d.finish()):e&&d.fail(e.error),t&&queueMicrotask(()=>jm(t))},b,x=rp(s,{refs:new Map,plugins:g,onSerialize:(e,t)=>{_||c||(v||=t,d.pushSerializedSource(e,t,m.didRun)||y(!1))},onError:e=>{_||c||(console.error(`Serialization error:`,e),b={error:e},y({error:e}))},scopeId:`tsr`,onDone:()=>{v&&y(!0)}});if(c||_?jm(x):u=x,b)throw b.error},onRenderFinished:e=>{if(!c){if(a)try{e()}catch(e){console.error(`Error in render finished listener:`,e)}else o.push(e)}},onCleanup:e=>{if(c)try{e(l)}catch(e){console.error(`Error in SSR cleanup listener:`,e)}else s.push(e)},setRenderFinished:()=>{c||a||(a=!0,d.liftBarrier(),Mm(o,`Error in render finished listener:`,void 0))},disableHydration:()=>{c||i===`disabled`||(i!==`idle`&&de(),d.disableHydration(),i=`disabled`)},takeInitialHydrationScriptTags:d.takeInitialHydrationScriptTags,cleanup(){if(c)return;c=!0,d.cleanup();let t=u;u=void 0,jm(t),Mm(s,`Error in SSR cleanup listener:`,l),o.length=0,e.ssr=void 0,e.serverSsr=void 0}};e.serverSsr=f;for(let t of e.serverSsrLifecycle?.onServerSsrAttach??[])try{t(f)}catch(e){console.error(`SSR attach listener error:`,e)}}function qm(e,t){typeof e==`string`&&(e=e.replace(`\\`,`%5C`));let n=new URL(e,t),r=n.pathname.startsWith(`//`),i=Xe(r?n.pathname.replace(/^\/+/,`/`):n.pathname),a=new URLSearchParams(n.search),o=i+(a.size>0?`?`:``)+a.toString()+n.hash;return{url:new URL(o,n.origin),handledProtocolRelativeURL:r}}function Jm(e){return typeof e!=`object`||!e||!(`response`in e)||!(e.response instanceof Response)||!(`serverSsrCleanup`in e)?!1:e.serverSsrCleanup===`none`||e.serverSsrCleanup===`stream`&&`dispose`in e&&typeof e.dispose==`function`}function Ym(e){if(e instanceof Response)return{response:e,serverSsrCleanup:`none`};if(Jm(e))return e;throw TypeError(`Expected a Response from the SSR handler`)}function Xm(e,t){let n=e.body;n&&n.cancel(t).catch(console.error)}function Zm(e,t){let n=Ym(e);n.serverSsrCleanup===`stream`?n.dispose(t):Xm(n.response,t)}function Qm(e){return e._serverResult?.type===`render`?e._serverResult.status:200}function $m(e,t){let n=t.body;if(!n)throw Error(`Invariant failed: SSR stream response requires a body`);return{response:t,serverSsrCleanup:`stream`,dispose(t){e.serverSsr?.cleanup(),n.cancel(t).catch(()=>{})}}}function eh(e,t,n){let r=Ym(t);if(r.serverSsrCleanup!==`stream`)return n.aborted&&Zm(t,n.reason),r;let i=()=>{Zm(r,n.reason)};if(n.aborted)return i(),r;let a=e?.serverSsr;return a?.hydrationScripts.requestSignal===n?(a.onCleanup(()=>{n.aborted&&i()}),r):(n.addEventListener(`abort`,i,{once:!0}),a&&a.onCleanup(()=>{n.removeEventListener(`abort`,i)}),r)}function th(e,t,n){return Zm(e,n),{response:t,serverSsrCleanup:`none`}}function nh(e,t){let n=Ym(e);return Zm(n,t),{response:new Response(null,n.response),serverSsrCleanup:`none`}}function rh(e){return e}function ih(e){if(Array.isArray(e))return e.flatMap(e=>ih(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function ah(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function oh(...e){return e.reduce((e,t)=>{let n=ah(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?ih(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}var sh=6e4,ch=256,lh=65536,uh={BeforeBoundary:0,Merge:1,HeldClose:2,PassThrough:3};function dh(e){try{e.releaseLock()}catch{}}function fh(e,t){let n=e.cancel(t).catch(()=>{});return dh(e),n}function ph(e,t,n,r,i,a){try{e===`complete`?n.close():e===`failure`&&n.error(t)}catch{}let o=e!==`complete`;if(o)try{a?.(t)}catch{}let s=o?fh(r,t):dh(r);return i.cleanup(),s}function mh(e){return e?.lifetimeMs??(e?.timeoutMs??sh)*2}function hh(){let e=Error(`SSR stream transform aborted by router SSR cleanup`);return e.name=`AbortError`,e}function gh(e,t){if(!e)return;let n=()=>t(e.reason);return e.addEventListener(`abort`,n,{once:!0}),()=>e.removeEventListener(`abort`,n)}function _h(e,t){let n=setTimeout(e,t);return n.unref?.(),n}function vh(e,t,n,r){let i=t?.signal,a,o,s=()=>{o?.(),o=void 0,i&&e.hydrationScripts.requestSignal===i&&(e.hydrationScripts.requestSignal=void 0),a!==void 0&&(clearTimeout(a),a=void 0)},c=mh(t);return a=_h(()=>{if(n())return;let e=Error(`Stream lifetime exceeded`);console.warn(`SSR stream transform exceeded maximum lifetime (${c}ms), forcing cleanup`),r(`failure`,e)},c),o=gh(i,e=>{r(`failure`,e)}),i&&(e.hydrationScripts.requestSignal=i),e.onCleanup(()=>{n()||r(`failure`,hh())}),s}function yh(e,t,n){try{t?.(n)}catch{}e.cleanup()}function bh(e,t){let n=e.length-t,r=Math.min(lh,Math.max(ch,Math.min(e.length,n*3))),i=new Uint8Array(r),{read:a,written:o}=qp(e,t,i);return{bytes:o===i.length?i:i.subarray(0,o),read:a}}function xh(e,t,n){let r=e.serverSsr;if(!r)throw Error(`Invariant failed: router.serverSsr is required`);let i=r.hydrationScripts,a;try{a=t.getReader()}catch(e){throw yh(r,n?.onAbort,e),e}try{if(n?.signal?.throwIfAborted(),i.reserveFastPath())return Sh(r,a,void 0,n);let e=i.claimOutput();if(e.state===_m.Failed)throw e.error;return Sh(r,a,e,n)}catch(e){throw fh(a,e),yh(r,n?.onAbort,e),e}}function Sh(e,t,n,r){let i=e.hydrationScripts,a,o=!1,s=!1,c=n?uh.BeforeBoundary:uh.PassThrough,l=!1,u,d=!1,f,p,m=0,h,g,_=0,v=r?.rendererSafePoint===`script-close`,y=r?.rendererSafePoint===`record-end`,b,x,S,C,w=()=>{};function E(){return new Promise(e=>{C=e})}function D(){let e=C;C=void 0,e?.()}function O(e){return e.length!==0&&(a.enqueue(e),!0)}function k(){p=void 0,h=void 0,g===void 0&&y&&S===void 0&&(l=!0)}function A(e,t,n=e===p.length){let r=p,i=m===0&&e===r.length?r:r.subarray(m,e);return m=e,t&&(l=!0),n&&k(),O(i)}function j(){let e=g,t=bh(e,_);_+=t.read,p=t.bytes,m=0,_===e.length&&(g=void 0)}function M(){let e=p;if(!i.isInitialTaken())return A(e.length,!1);let t=Jp(b??={pattern:pm,anchorIndex:fm,matched:0},e,m);return t===void 0?A(e.length,!1):(c=uh.Merge,i.liftBarrier(),A(t,!0))}function N(e,t){return m=e,c=uh.HeldClose,x&&(x.matched=0),l=!0,m===p.length&&k(),t?O(t):!1}function P(e){let t=p;return N(e+Gp.length,e===m?void 0:t.subarray(m,e))}function F(e){let t=ee(p,m,e);return t!==void 0&&A(t,!0)}function ee(e,t,r){let i=n.state;if(r===t||i===_m.Done)return;let a=r===e.length?e:e.subarray(0,r),o=x??={pattern:Kp,anchorIndex:Wp,matched:0},s=i===_m.Waiting,c=Jp(o,a,t,s);if(c!==void 0)return s&&(o.matched=0),c}function te(){let e=p,t=S,n=Math.min(e.length-m,Gp.length),r=new Uint8Array(t.length+n);r.set(t),r.set(e.subarray(m,m+n),t.length);let i=Yp(r,Gp,0,Up),a=i<0?Xp(r,Gp):void 0,o=i>=0?i:a??r.length;if(v){let n=ee(r,0,o);if(n!==void 0)return m+=n-t.length,S=void 0,l=!0,m===e.length&&k(),O(r.subarray(0,n))}return i>=0?(S=void 0,N(m+i+Gp.length-t.length,i===0?void 0:r.subarray(0,i))):(S=a===void 0?void 0:r.slice(a),m+=n,O(o===r.length?r:r.subarray(0,o)))}function I(){let e=p;if(S){if(te())return!0;if(c===uh.HeldClose)return!1;if(m>=e.length)return k(),!1}let t=h??=Yp(e,Gp,m,Up);if(t>=0)return v&&F(t)?!0:P(t);let n=Xp(e,Gp,m),r=n??e.length;return v&&F(r)?!0:(S=n===void 0?void 0:e.slice(n),A(r,!1,!0))}function L(){if(m>=p.length)return k(),!1;if(l=!1,c===uh.BeforeBoundary)return M();if(c===uh.Merge)return I();let e=p;return v&&F(e.length)?!0:A(e.length,!1)}function ne(n,i){if(!o)return o=!0,u?.(),u=void 0,w(),f=void 0,p=void 0,h=void 0,g=void 0,S=void 0,D(),ph(n,i,a,t,e,r?.onAbort)}function re(){d||f||o||(d=!0,t.read().then(e=>{d=!1,o||(e.done?ie(e):f=e,D())},e=>{d=!1,o||ce(e)}))}function ie(t){if(t.done){s=!0,l=S===void 0,i.startSerializationTimeout(r?.timeoutMs??sh),e.setRenderFinished();return}let n=t.value;if(typeof n==`string`){if(n.length===0)return;g=n,_=0,l=!1,j()}else n.byteLength!==0&&(p=n,m=0,l=!1)}async function ae(){if(g!==void 0){j();return}if(f){let e=f;f=void 0,ie(e);return}if(!(c!==uh.BeforeBoundary&&l&&n.state!==_m.Done)&&!d){let e=await t.read();if(o)return;ie(e);return}let e=E();re(),await e}async function oe(){try{for(;;){if(p){let e=m===0?p:p.subarray(m);if(p=void 0,O(e))return;continue}if(g!==void 0){j();continue}if(s){ne(`complete`);return}if(d){await E();continue}let e=f;if(e)f=void 0;else if(e=await t.read(),o)return;if(e.done||typeof e.value==`string`)ie(e);else if(e.value.byteLength>0){a.enqueue(e.value);return}}}catch(e){ce(e)}}async function se(){let e=n;for(;!o;){let t=e.state;if(t===_m.Active){a.enqueue(e.pullChunk());return}if(c!==uh.BeforeBoundary&&l&&t===_m.Ready){!s&&!p&&g===void 0&&re(),a.enqueue(e.pullChunk());return}if(c===uh.Merge&&t===_m.Done&&S===void 0&&i.reserveFastPath(e))return c=uh.PassThrough,u?.(),u=void 0,oe();if(p){if(L())return}else{if(s){if(c===uh.BeforeBoundary){i.skipInitialTake(),c=uh.Merge,l=!0;continue}if(S){let e=S;if(S=void 0,l=!0,O(e))return;continue}if(t===_m.Waiting){await E();continue}if(c===uh.HeldClose){a.enqueue(Gp.slice()),ne(`complete`);return}ne(`complete`);return}await ae()}}}function ce(e){o||(console.error(`Error processing appStream:`,e),ne(`failure`,e))}let le=new ReadableStream({start(e){a=e},pull(){return c===uh.PassThrough?oe():se().catch(ce)},cancel(e){return ne(`cancel`,e)}});return n&&(u=n.subscribe(()=>{n.state===_m.Failed?ne(`failure`,n.error):D()})),w=vh(e,r,()=>o,ne),le}var Ch=i((e=>{var t=b(),n=k(),r=Symbol.for(`react.transitional.element`),i=Symbol.for(`react.portal`),a=Symbol.for(`react.fragment`),o=Symbol.for(`react.strict_mode`),s=Symbol.for(`react.profiler`),c=Symbol.for(`react.consumer`),l=Symbol.for(`react.context`),u=Symbol.for(`react.forward_ref`),d=Symbol.for(`react.suspense`),f=Symbol.for(`react.suspense_list`),p=Symbol.for(`react.memo`),m=Symbol.for(`react.lazy`),h=Symbol.for(`react.scope`),g=Symbol.for(`react.activity`),_=Symbol.for(`react.legacy_hidden`),v=Symbol.for(`react.memo_cache_sentinel`),y=Symbol.for(`react.view_transition`),x=Symbol.for(`react.recoverable`),S=Symbol.iterator;function C(e){return typeof e!=`object`||!e?null:(e=S&&e[S]||e[`@@iterator`],typeof e==`function`?e:null)}var w=Symbol.for(`react.optimistic_key`),E=Array.isArray;function D(e,t){var n=e.length&3,r=e.length-n,i=t;for(t=0;t<r;){var a=e.charCodeAt(t)&255|(e.charCodeAt(++t)&255)<<8|(e.charCodeAt(++t)&255)<<16|(e.charCodeAt(++t)&255)<<24;++t,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)|0,a=a<<15|a>>>17,a=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)|0,i^=a,i=i<<13|i>>>19,i=5*(i&65535)+((5*(i>>>16)&65535)<<16)|0,i=(i&65535)+27492+(((i>>>16)+58964&65535)<<16)}switch(a=0,n){case 3:a^=(e.charCodeAt(t+2)&255)<<16;case 2:a^=(e.charCodeAt(t+1)&255)<<8;case 1:a^=e.charCodeAt(t)&255,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)|0,a=a<<15|a>>>17,i^=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)|0}return i^=e.length,i^=i>>>16,i=2246822507*(i&65535)+((2246822507*(i>>>16)&65535)<<16)|0,i^=i>>>13,i=3266489909*(i&65535)+((3266489909*(i>>>16)&65535)<<16)|0,(i^i>>>16)>>>0}function O(e){setTimeout(function(){throw e})}var A=Promise,j=typeof queueMicrotask==`function`?queueMicrotask:function(e){A.resolve(null).then(e).catch(O)},M=null,N=0;function P(e,t){if(t.byteLength!==0){if(4096<t.byteLength)0<N&&(e.enqueue(new Uint8Array(M.buffer,0,N)),M=new Uint8Array(4096),N=0),e.enqueue(t);else{var n=M.length-N;n<t.byteLength&&(n===0?e.enqueue(M):(M.set(t.subarray(0,n),N),e.enqueue(M),t=t.subarray(n)),M=new Uint8Array(4096),N=0),M.set(t,N),N+=t.byteLength}}}function F(e,t){return P(e,t),!0}function ee(e){M&&0<N&&(e.enqueue(new Uint8Array(M.buffer,0,N)),M=null,N=0)}var te=new TextEncoder;function I(e){return te.encode(e)}function L(e){return te.encode(e)}function ne(e){return e.byteLength}function re(e,t){typeof e.error==`function`?e.error(t):e.close()}var ie=Object.assign,ae=Object.prototype.hasOwnProperty,oe=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),se={},ce={};function le(e){return ae.call(ce,e)?!0:ae.call(se,e)?!1:oe.test(e)?ce[e]=!0:(se[e]=!0,!1)}var ue=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `)),de=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),fe=/["'&<>]/;function pe(e){if(typeof e==`boolean`||typeof e==`number`||typeof e==`bigint`)return``+e;e=``+e;var t=fe.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.slice(i,r)),i=r+1,n+=t}e=i===r?n:n+e.slice(i,r)}return e}var me=/([A-Z])/g,he=/^ms-/,ge=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _e(e){return ge.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}var ve=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=ye.d;ye.d={f:xe.f,r:xe.r,D:wr,C:Tr,L:Er,m:Dr,X:kr,S:Or,M:Ar};var Se=[],Ce=null;L(`"></template>`);var we=L(`<script`),Te=L(`<\/script>`),Ee=L(`<script src="`),De=L(`<script type="module" src="`),Oe=L(` nonce="`),ke=L(` integrity="`),Ae=L(` crossorigin="`),R=L(` async=""><\/script>`),je=L(`<style`),Me=/(<\/|<)(s)(cript)/gi;function Ne(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}var Pe=L(`<script type="importmap">`),Fe=L(`<\/script>`);function Ie(e,t,n,r,i,a){n=typeof t==`string`?t:t&&t.script;var o=n===void 0?we:L(`<script nonce="`+pe(n)+`"`),s=typeof t==`string`?void 0:t&&t.style,c=s===void 0?je:L(`<style nonce="`+pe(s)+`"`),l=e.idPrefix,u=[],d=e.bootstrapScriptContent,f=e.bootstrapScripts,p=e.bootstrapModules;if(d!==void 0&&(u.push(o),gr(u,e),u.push(pt,I((``+d).replace(Me,Ne)),Te)),d=[],r!==void 0&&(d.push(n===void 0?Pe:L(`<script type="importmap" nonce="`+pe(n)+`">`)),d.push(I((``+JSON.stringify(r)).replace(Me,Ne))),d.push(Fe)),r=i?{preconnects:``,fontPreloads:``,highImagePreloads:``,remainingCapacity:2+(typeof a==`number`?a:2e3)}:null,i={placeholderPrefix:L(l+`P:`),segmentPrefix:L(l+`S:`),boundaryPrefix:L(l+`B:`),startInlineScript:o,startInlineStyle:c,preamble:Re(),externalRuntimeScript:null,bootstrapChunks:u,importMapChunks:d,onHeaders:i,headers:r,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:{script:n,style:s},hoistableState:null,stylesToHoist:!1},f!==void 0)for(r=0;r<f.length;r++)l=f[r],s=o=void 0,c={rel:`preload`,as:`script`,fetchPriority:`low`,nonce:t},typeof l==`string`?c.href=a=l:(c.href=a=l.src,c.integrity=s=typeof l.integrity==`string`?l.integrity:void 0,c.crossOrigin=o=typeof l==`string`||l.crossOrigin==null?void 0:l.crossOrigin===`use-credentials`?`use-credentials`:``),l=e,d=a,l.scriptResources[d]=null,l.moduleScriptResources[d]=null,l=[],St(l,c),i.bootstrapScripts.add(l),u.push(Ee,I(pe(a)),nt),n&&u.push(Oe,I(pe(n)),nt),typeof s==`string`&&u.push(ke,I(pe(s)),nt),typeof o==`string`&&u.push(Ae,I(pe(o)),nt),gr(u,e),u.push(R);if(p!==void 0)for(t=0;t<p.length;t++)s=p[t],a=r=void 0,o={rel:`modulepreload`,fetchPriority:`low`,nonce:n},typeof s==`string`?o.href=f=s:(o.href=f=s.src,o.integrity=a=typeof s.integrity==`string`?s.integrity:void 0,o.crossOrigin=r=typeof s==`string`||s.crossOrigin==null?void 0:s.crossOrigin===`use-credentials`?`use-credentials`:``),s=e,c=f,s.scriptResources[c]=null,s.moduleScriptResources[c]=null,s=[],St(s,o),i.bootstrapScripts.add(s),u.push(De,I(pe(f)),nt),n&&u.push(Oe,I(pe(n)),nt),typeof a==`string`&&u.push(ke,I(pe(a)),nt),typeof r==`string`&&u.push(Ae,I(pe(r)),nt),gr(u,e),u.push(R);return i}function Le(e,t,n,r,i){return{idPrefix:e===void 0?``:e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:i,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function Re(){return{htmlChunks:null,headChunks:null,bodyChunks:null}}function ze(e,t,n,r){return{insertionMode:e,selectedValue:t,tagScope:n,viewTransition:r}}function Be(e){return ze(e===`http://www.w3.org/2000/svg`?4:e===`http://www.w3.org/1998/Math/MathML`?5:0,null,0,null)}function Ve(e,t,n){var r=e.tagScope&-25;switch(t){case`noscript`:return ze(2,null,r|1,null);case`select`:return ze(2,n.value==null?n.defaultValue:n.value,r,null);case`svg`:return ze(4,null,r,null);case`picture`:return ze(2,null,r|2,null);case`math`:return ze(5,null,r,null);case`foreignObject`:return ze(2,null,r,null);case`table`:return ze(6,null,r,null);case`thead`:case`tbody`:case`tfoot`:return ze(7,null,r,null);case`colgroup`:return ze(9,null,r,null);case`tr`:return ze(8,null,r,null);case`head`:if(2>e.insertionMode)return ze(3,null,r,null);break;case`html`:if(e.insertionMode===0)return ze(1,null,r,null)}return 6<=e.insertionMode||2>e.insertionMode?ze(2,null,r,null):e.viewTransition!==null||e.tagScope!==r?ze(e.insertionMode,e.selectedValue,r,null):e}function He(e){return e===null?null:{update:e.update,enter:`none`,exit:`none`,share:e.update,parentEnter:`none`,parentExit:`none`,name:e.autoName,autoName:e.autoName,nameIdx:0}}function Ue(e,t){return t.tagScope&32&&(e.instructions|=128),ze(t.insertionMode,t.selectedValue,t.tagScope|12,He(t.viewTransition))}function We(e,t){e=He(t.viewTransition);var n=t.tagScope|16;return e!==null&&e.share!==`none`&&(n|=64),ze(t.insertionMode,t.selectedValue,n,e)}function Ge(e,t,n){return e=`_`+e.idPrefix+`R_`+t,0<n&&(e+=`H`+n.toString(32)),e+`_`}var Ke=L(`<!-- -->`);function qe(e,t,n,r){return t===``?r:(r&&e.push(Ke),e.push(I(pe(t))),!0)}function Je(e,t){t=t.viewTransition,t!==null&&(t.name!==`auto`&&(at(e,`vt-name`,t.nameIdx===0?t.name:t.name+`_`+t.nameIdx),t.nameIdx++),at(e,`vt-update`,t.update),t.enter!==`none`&&at(e,`vt-enter`,t.enter),t.exit!==`none`&&at(e,`vt-exit`,t.exit),t.share!==`none`&&at(e,`vt-share`,t.share))}var Ye=new Map,Xe=L(` style="`),Ze=L(`:`),Qe=L(`;`);function $e(e,t){if(typeof t!=`object`)throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");var n=!0,r;for(r in t)if(ae.call(t,r)){var i=t[r];if(i!=null&&typeof i!=`boolean`&&i!==``){if(r.indexOf(`--`)===0){var a=I(pe(r));i=I(pe((``+i).trim()))}else a=Ye.get(r),a===void 0&&(a=L(pe(r.replace(me,`-$1`).toLowerCase().replace(he,`-ms-`))),Ye.set(r,a)),i=typeof i==`number`?i===0||ue.has(r)?I(``+i):I(i+`px`):I(pe((``+i).trim()));n?(n=!1,e.push(Xe,a,Ze,i)):e.push(Qe,a,Ze,i)}}n||e.push(nt)}var et=L(` `),tt=L(`="`),nt=L(`"`),rt=L(`=""`);function it(e,t,n){n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(et,I(t),rt)}function at(e,t,n){typeof n!=`function`&&typeof n!=`symbol`&&typeof n!=`boolean`&&e.push(et,I(t),tt,I(pe(n)),nt)}var ot=L(pe(`javascript:throw new Error('React form unexpectedly submitted.')`)),st=L(`<input type="hidden"`);function ct(e,t){this.push(st),lt(e),at(this,`name`,t),at(this,`value`,e),this.push(mt)}function lt(e){if(typeof e!=`string`)throw Error(`File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration.`)}function ut(e,t){if(typeof t.$$FORM_ACTION==`function`){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);return r&&r.data?.forEach(lt),r}catch(e){if(typeof e==`object`&&e&&typeof e.then==`function`)throw e}}return null}function dt(e,t,n,r,i,a,o,s){var c=null;if(typeof r==`function`){var l=ut(t,r);l===null?(e.push(et,I(`formAction`),tt,ot,nt),o=a=i=r=s=null,yt(t,n)):(s=l.name,r=l.action||``,i=l.encType,a=l.method,o=l.target,c=l.data)}return s!=null&&ft(e,`name`,s),r!=null&&ft(e,`formAction`,r),i!=null&&ft(e,`formEncType`,i),a!=null&&ft(e,`formMethod`,a),o!=null&&ft(e,`formTarget`,o),c}function ft(e,t,n){switch(t){case`className`:at(e,`class`,n);break;case`tabIndex`:at(e,`tabindex`,n);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:at(e,t,n);break;case`style`:$e(e,n);break;case`src`:case`href`:if(n===``)break;case`action`:case`formAction`:if(n==null||typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=_e(``+n),e.push(et,I(t),tt,I(pe(n)),nt);break;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`autoFocus`:case`multiple`:case`muted`:it(e,t.toLowerCase(),n);break;case`xlinkHref`:if(typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=_e(``+n),e.push(et,I(`xlink:href`),tt,I(pe(n)),nt);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:typeof n!=`function`&&typeof n!=`symbol`&&e.push(et,I(t),tt,I(pe(n)),nt);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(et,I(t),rt);break;case`capture`:case`download`:!0===n?e.push(et,I(t),rt):!1!==n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(et,I(t),tt,I(pe(n)),nt);break;case`cols`:case`rows`:case`size`:case`span`:typeof n!=`function`&&typeof n!=`symbol`&&!isNaN(n)&&1<=n&&e.push(et,I(t),tt,I(pe(n)),nt);break;case`rowSpan`:case`start`:typeof n==`function`||typeof n==`symbol`||isNaN(n)||e.push(et,I(t),tt,I(pe(n)),nt);break;case`xlinkActuate`:at(e,`xlink:actuate`,n);break;case`xlinkArcrole`:at(e,`xlink:arcrole`,n);break;case`xlinkRole`:at(e,`xlink:role`,n);break;case`xlinkShow`:at(e,`xlink:show`,n);break;case`xlinkTitle`:at(e,`xlink:title`,n);break;case`xlinkType`:at(e,`xlink:type`,n);break;case`xmlBase`:at(e,`xml:base`,n);break;case`xmlLang`:at(e,`xml:lang`,n);break;case`xmlSpace`:at(e,`xml:space`,n);break;default:if((!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`)&&(t=de.get(t)||t,le(t))){switch(typeof n){case`function`:case`symbol`:return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`)return}e.push(et,I(t),tt,I(pe(n)),nt)}}}var pt=L(`>`),mt=L(`/>`);function ht(e,t,n){if(t!=null){if(n!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof t!=`object`||!(`__html`in t))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");t=t.__html,t!=null&&e.push(I(``+t))}}function gt(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}var _t=L(` selected=""`),vt=L(`addEventListener("submit",function(a){if(!a.defaultPrevented){var b=a.target,d=a.submitter,c=b.action,e=d;if(d){var f=d.getAttribute("formAction");null!=f&&(c=f,e=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===c&&(a.preventDefault(),a=new FormData(b,e),c=b.ownerDocument||b,(c.$$reactFormReplay=c.$$reactFormReplay||[]).push(b,d,a))}});`);function yt(e,t){if(!(e.instructions&16)){e.instructions|=16;var n=t.preamble,r=t.bootstrapChunks;(n.htmlChunks||n.headChunks)&&r.length===0?(r.push(t.startInlineScript),gr(r,e),r.push(pt,vt,Te)):r.unshift(t.startInlineScript,pt,vt,Te)}}var bt=L(`<!--F!-->`),xt=L(`<!--F-->`);function St(e,t){for(var n in e.push(It(`link`)),t)if(ae.call(t,n)){var r=t[n];if(r!=null)switch(n){case`children`:case`dangerouslySetInnerHTML`:throw Error("link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:ft(e,n,r)}}return e.push(mt),null}var Ct=/(<\/|<)(s)(tyle)/gi;function wt(e,t,n,r){return``+t+(n===`s`?`\\73 `:`\\53 `)+r}function Tt(e,t,n,r){for(var i in e.push(It(n)),t)if(ae.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:case`dangerouslySetInnerHTML`:throw Error(n+" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:ft(e,i,a)}}return Je(e,r),e.push(mt),null}function Et(e,t){e.push(It(`title`));var n=null,r=null,i;for(i in t)if(ae.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:ft(e,i,a)}}return e.push(pt),t=Array.isArray(n)?2>n.length?n[0]:null:n,typeof t!=`function`&&typeof t!=`symbol`&&t!=null&&e.push(I(pe(``+t))),ht(e,r,n),e.push(Bt(`title`)),null}var Dt=L(`<!--head-->`),Ot=L(`<!--body-->`),kt=L(`<!--html-->`);function At(e,t){e.push(It(`script`));var n=null,r=null,i;for(i in t)if(ae.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:ft(e,i,a)}}return e.push(pt),ht(e,r,n),typeof n==`string`&&e.push(I((``+n).replace(Me,Ne))),e.push(Bt(`script`)),null}function jt(e,t,n,r){e.push(It(n));var i=n=null,a;for(a in t)if(ae.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:ft(e,a,o)}}return Je(e,r),e.push(pt),ht(e,i,n),n}function Mt(e,t,n,r){e.push(It(n));var i=n=null,a;for(a in t)if(ae.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:ft(e,a,o)}}return Je(e,r),e.push(pt),ht(e,i,n),typeof n==`string`?(e.push(I(pe(n))),null):n}var Nt=L(`
|
|
4
|
+
`),Pt=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ft=new Map;function It(e){var t=Ft.get(e);if(t===void 0){if(!Pt.test(e))throw Error(`Invalid tag: `+e);t=L(`<`+e),Ft.set(e,t)}return t}var Lt=L(`<!DOCTYPE html>`);function Rt(e,t,n,r,i,a,o,s,c){switch(t){case`div`:case`span`:case`svg`:case`path`:break;case`a`:e.push(It(`a`));var l=null,u=null,d;for(d in n)if(ae.call(n,d)){var f=n[d];if(f!=null)switch(d){case`children`:l=f;break;case`dangerouslySetInnerHTML`:u=f;break;case`href`:f===``?at(e,`href`,``):ft(e,d,f);break;default:ft(e,d,f)}}if(Je(e,s),e.push(pt),ht(e,u,l),typeof l==`string`){e.push(I(pe(l)));var p=null}else p=l;return p;case`g`:case`p`:case`li`:break;case`select`:e.push(It(`select`));var m=null,h=null,g;for(g in n)if(ae.call(n,g)){var _=n[g];if(_!=null)switch(g){case`children`:m=_;break;case`dangerouslySetInnerHTML`:h=_;break;case`defaultValue`:case`value`:break;default:ft(e,g,_)}}return Je(e,s),e.push(pt),ht(e,h,m),m;case`option`:var v=s.selectedValue;e.push(It(`option`));var y=null,b=null,x=null,S=null,C;for(C in n)if(ae.call(n,C)){var w=n[C];if(w!=null)switch(C){case`children`:y=w;break;case`selected`:x=w;break;case`dangerouslySetInnerHTML`:S=w;break;case`value`:b=w;default:ft(e,C,w)}}if(v!=null){var D=b===null?gt(y):``+b;if(E(v)){for(var O=0;O<v.length;O++)if(``+v[O]===D){e.push(_t);break}}else``+v===D&&e.push(_t)}else x&&e.push(_t);return e.push(pt),ht(e,S,y),y;case`textarea`:e.push(It(`textarea`));var k=null,A=null,j=null,M;for(M in n)if(ae.call(n,M)){var N=n[M];if(N!=null)switch(M){case`children`:j=N;break;case`value`:k=N;break;case`defaultValue`:A=N;break;case`dangerouslySetInnerHTML`:throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");default:ft(e,M,N)}}if(k===null&&A!==null&&(k=A),Je(e,s),e.push(pt),j!=null){if(k!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(E(j)){if(1<j.length)throw Error(`<textarea> can only have at most one child.`);k=``+j[0]}k=``+j}return typeof k==`string`&&k[0]===`
|
|
5
|
+
`&&e.push(Nt),k!==null&&e.push(I(pe(``+k))),null;case`input`:e.push(It(`input`));var P=null,F=null,ee=null,te=null,L=null,ne=null,re=null,oe=null,se=null,ce;for(ce in n)if(ae.call(n,ce)){var ue=n[ce];if(ue!=null)switch(ce){case`children`:case`dangerouslySetInnerHTML`:throw Error("input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");case`name`:P=ue;break;case`formAction`:F=ue;break;case`formEncType`:ee=ue;break;case`formMethod`:te=ue;break;case`formTarget`:L=ue;break;case`defaultChecked`:se=ue;break;case`defaultValue`:re=ue;break;case`checked`:oe=ue;break;case`value`:ne=ue;break;default:ft(e,ce,ue)}}var de=dt(e,r,i,F,ee,te,L,P);return oe===null?se!==null&&it(e,`checked`,se):it(e,`checked`,oe),ne===null?re!==null&&ft(e,`value`,re):ft(e,`value`,ne),Je(e,s),e.push(mt),de?.forEach(ct,e),null;case`button`:e.push(It(`button`));var fe=null,me=null,he=null,ge=null,ve=null,ye=null,be=null,xe;for(xe in n)if(ae.call(n,xe)){var Ce=n[xe];if(Ce!=null)switch(xe){case`children`:fe=Ce;break;case`dangerouslySetInnerHTML`:me=Ce;break;case`name`:he=Ce;break;case`formAction`:ge=Ce;break;case`formEncType`:ve=Ce;break;case`formMethod`:ye=Ce;break;case`formTarget`:be=Ce;break;default:ft(e,xe,Ce)}}var we=dt(e,r,i,ge,ve,ye,be,he);if(Je(e,s),e.push(pt),we?.forEach(ct,e),ht(e,me,fe),typeof fe==`string`){e.push(I(pe(fe)));var Te=null}else Te=fe;return Te;case`form`:e.push(It(`form`));var Ee=null,De=null,Oe=null,ke=null,Ae=null,R=null,je;for(je in n)if(ae.call(n,je)){var Me=n[je];if(Me!=null)switch(je){case`children`:Ee=Me;break;case`dangerouslySetInnerHTML`:De=Me;break;case`action`:Oe=Me;break;case`encType`:ke=Me;break;case`method`:Ae=Me;break;case`target`:R=Me;break;default:ft(e,je,Me)}}var Ne=null,Pe=null;if(typeof Oe==`function`){var Fe=ut(r,Oe);Fe===null?(e.push(et,I(`action`),tt,ot,nt),R=Ae=ke=Oe=null,yt(r,i)):(Oe=Fe.action||``,ke=Fe.encType,Ae=Fe.method,R=Fe.target,Ne=Fe.data,Pe=Fe.name)}if(Oe!=null&&ft(e,`action`,Oe),ke!=null&&ft(e,`encType`,ke),Ae!=null&&ft(e,`method`,Ae),R!=null&&ft(e,`target`,R),Je(e,s),e.push(pt),Pe!==null&&(e.push(st),at(e,`name`,Pe),e.push(mt),Ne?.forEach(ct,e)),ht(e,De,Ee),typeof Ee==`string`){e.push(I(pe(Ee)));var Ie=null}else Ie=Ee;return Ie;case`menuitem`:for(var Le in e.push(It(`menuitem`)),n)if(ae.call(n,Le)){var Re=n[Le];if(Re!=null)switch(Le){case`children`:case`dangerouslySetInnerHTML`:throw Error("menuitems cannot have `children` nor `dangerouslySetInnerHTML`.");default:ft(e,Le,Re)}}return Je(e,s),e.push(pt),null;case`object`:e.push(It(`object`));var ze=null,Be=null,Ve;for(Ve in n)if(ae.call(n,Ve)){var He=n[Ve];if(He!=null)switch(Ve){case`children`:ze=He;break;case`dangerouslySetInnerHTML`:Be=He;break;case`data`:var Ue=_e(``+He);if(Ue===``)break;e.push(et,I(`data`),tt,I(pe(Ue)),nt);break;default:ft(e,Ve,He)}}if(Je(e,s),e.push(pt),ht(e,Be,ze),typeof ze==`string`){e.push(I(pe(ze)));var We=null}else We=ze;return We;case`title`:var Ge=s.tagScope&1,qe=s.tagScope&4;if(s.insertionMode===4||Ge||n.itemProp!=null)var Ye=Et(e,n);else qe?Ye=null:(Et(i.hoistableChunks,n),Ye=void 0);return Ye;case`link`:var Xe=s.tagScope&1,Ze=s.tagScope&4,Qe=n.rel,rt=n.href,lt=n.precedence;if(s.insertionMode===4||Xe||n.itemProp!=null||typeof Qe!=`string`||typeof rt!=`string`||rt===``){St(e,n);var vt=null}else if(n.rel===`stylesheet`){if(typeof lt!=`string`||n.disabled!=null||n.onLoad||n.onError)vt=St(e,n);else{var bt=i.styles.get(lt),xt=r.styleResources.hasOwnProperty(rt)?r.styleResources[rt]:void 0;if(xt!==null){r.styleResources[rt]=null,bt||(bt={precedence:I(pe(lt)),rules:[],hrefs:[],sheets:new Map},i.styles.set(lt,bt));var Pt={state:0,props:ie({},n,{"data-precedence":n.precedence,precedence:null})};if(xt){xt.length===2&&jr(Pt.props,xt);var Ft=i.preloads.stylesheets.get(rt);Ft&&0<Ft.length?Ft.length=0:Pt.state=1}bt.sheets.set(rt,Pt),o&&o.stylesheets.add(Pt)}else if(bt){var Rt=bt.sheets.get(rt);Rt&&o&&o.stylesheets.add(Rt)}c&&e.push(Ke),vt=null}}else n.onLoad||n.onError?vt=St(e,n):(c&&e.push(Ke),vt=Ze?null:St(i.hoistableChunks,n));return vt;case`script`:var zt=s.tagScope&1,Vt=n.async;if(typeof n.src!=`string`||!n.src||!Vt||typeof Vt==`function`||typeof Vt==`symbol`||n.onLoad||n.onError||s.insertionMode===4||zt||n.itemProp!=null)var Ht=At(e,n);else{var z=n.src;if(n.type===`module`)var Ut=r.moduleScriptResources,Wt=i.preloads.moduleScripts;else Ut=r.scriptResources,Wt=i.preloads.scripts;var Gt=Ut.hasOwnProperty(z)?Ut[z]:void 0;if(Gt!==null){Ut[z]=null;var Kt=n;if(Gt){Gt.length===2&&(Kt=ie({},n),jr(Kt,Gt));var qt=Wt.get(z);qt&&(qt.length=0)}var Jt=[];i.scripts.add(Jt),At(Jt,Kt)}c&&e.push(Ke),Ht=null}return Ht;case`style`:var Yt=s.tagScope&1,Xt=n.precedence,Zt=n.href,Qt=n.nonce;if(s.insertionMode===4||Yt||n.itemProp!=null||typeof Xt!=`string`||typeof Zt!=`string`||Zt===``){e.push(It(`style`));var $t=null,en=null,tn;for(tn in n)if(ae.call(n,tn)){var nn=n[tn];if(nn!=null)switch(tn){case`children`:$t=nn;break;case`dangerouslySetInnerHTML`:en=nn;break;default:ft(e,tn,nn)}}e.push(pt);var rn=Array.isArray($t)?2>$t.length?$t[0]:null:$t;typeof rn!=`function`&&typeof rn!=`symbol`&&rn!=null&&e.push(I((``+rn).replace(Ct,wt))),ht(e,en,$t),e.push(Bt(`style`));var B=null}else{var an=i.styles.get(Xt);if((r.styleResources.hasOwnProperty(Zt)?r.styleResources[Zt]:void 0)!==null){r.styleResources[Zt]=null,an||(an={precedence:I(pe(Xt)),rules:[],hrefs:[],sheets:new Map},i.styles.set(Xt,an));var on=i.nonce.style;if(!on||on===Qt){an.hrefs.push(I(pe(Zt)));var sn=an.rules,cn=null,ln=null,un;for(un in n)if(ae.call(n,un)){var dn=n[un];if(dn!=null)switch(un){case`children`:cn=dn;break;case`dangerouslySetInnerHTML`:ln=dn}}var fn=Array.isArray(cn)?2>cn.length?cn[0]:null:cn;typeof fn!=`function`&&typeof fn!=`symbol`&&fn!=null&&sn.push(I((``+fn).replace(Ct,wt))),ht(sn,ln,cn)}}an&&o&&o.styles.add(an),c&&e.push(Ke),B=void 0}return B;case`meta`:var pn=s.tagScope&1,mn=s.tagScope&4;if(s.insertionMode===4||pn||n.itemProp!=null)var hn=Tt(e,n,`meta`,s);else c&&e.push(Ke),hn=mn?null:typeof n.charSet==`string`?Tt(i.charsetChunks,n,`meta`,s):n.name===`viewport`?Tt(i.viewportChunks,n,`meta`,s):Tt(i.hoistableChunks,n,`meta`,s);return hn;case`listing`:case`pre`:e.push(It(t));var gn=null,_n=null,vn;for(vn in n)if(ae.call(n,vn)){var yn=n[vn];if(yn!=null)switch(vn){case`children`:gn=yn;break;case`dangerouslySetInnerHTML`:_n=yn;break;default:ft(e,vn,yn)}}if(Je(e,s),e.push(pt),_n!=null){if(gn!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof _n!=`object`||!(`__html`in _n))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");var bn=_n.__html;bn!=null&&(typeof bn==`string`&&0<bn.length&&bn[0]===`
|
|
6
|
+
`?e.push(Nt,I(bn)):e.push(I(``+bn)))}return typeof gn==`string`&&gn[0]===`
|
|
7
|
+
`&&e.push(Nt),gn;case`img`:var xn=s.tagScope&3,V=n.src,Sn=n.srcSet;if(!(n.loading===`lazy`||!V&&!Sn||typeof V!=`string`&&V!=null||typeof Sn!=`string`&&Sn!=null||n.fetchPriority===`low`||xn)&&(typeof V!=`string`||V[4]!==`:`||V[0]!==`d`&&V[0]!==`D`||V[1]!==`a`&&V[1]!==`A`||V[2]!==`t`&&V[2]!==`T`||V[3]!==`a`&&V[3]!==`A`)&&(typeof Sn!=`string`||Sn[4]!==`:`||Sn[0]!==`d`&&Sn[0]!==`D`||Sn[1]!==`a`&&Sn[1]!==`A`||Sn[2]!==`t`&&Sn[2]!==`T`||Sn[3]!==`a`&&Sn[3]!==`A`)){o!==null&&s.tagScope&64&&(o.suspenseyImages=!0);var Cn=typeof n.sizes==`string`?n.sizes:void 0,wn=Sn?Sn+`
|
|
8
|
+
`+(Cn||``):V,Tn=i.preloads.images,En=Tn.get(wn);if(En)(n.fetchPriority===`high`||10>i.highImagePreloads.size)&&(Tn.delete(wn),i.highImagePreloads.add(En));else if(!r.imageResources.hasOwnProperty(wn)){r.imageResources[wn]=Se;var Dn=n.crossOrigin,On=typeof Dn==`string`?Dn===`use-credentials`?Dn:``:void 0,kn=i.headers,An;kn&&0<kn.remainingCapacity&&typeof n.srcSet!=`string`&&(n.fetchPriority===`high`||500>kn.highImagePreloads.length)&&(An=Mr(V,`image`,{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:On,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),0<=(kn.remainingCapacity-=An.length+2))?(i.resets.image[wn]=Se,kn.highImagePreloads&&(kn.highImagePreloads+=`, `),kn.highImagePreloads+=An):(En=[],St(En,{rel:`preload`,as:`image`,href:Sn?void 0:V,imageSrcSet:Sn,imageSizes:Cn,crossOrigin:On,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),n.fetchPriority===`high`||10>i.highImagePreloads.size?i.highImagePreloads.add(En):(i.bulkPreloads.add(En),Tn.set(wn,En)))}}return Tt(e,n,`img`,s);case`base`:case`area`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`param`:case`source`:case`track`:case`wbr`:return Tt(e,n,t,s);case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:break;case`head`:if(2>s.insertionMode){var jn=a||i.preamble;if(jn.headChunks)throw Error("The `<head>` tag may only be rendered once.");a!==null&&e.push(Dt),jn.headChunks=[];var Mn=jt(jn.headChunks,n,`head`,s)}else Mn=Mt(e,n,`head`,s);return Mn;case`body`:if(2>s.insertionMode){var Nn=a||i.preamble;if(Nn.bodyChunks)throw Error("The `<body>` tag may only be rendered once.");a!==null&&e.push(Ot),Nn.bodyChunks=[];var Pn=jt(Nn.bodyChunks,n,`body`,s)}else Pn=Mt(e,n,`body`,s);return Pn;case`html`:if(s.insertionMode===0){var Fn=a||i.preamble;if(Fn.htmlChunks)throw Error("The `<html>` tag may only be rendered once.");a!==null&&e.push(kt),Fn.htmlChunks=[Lt];var In=jt(Fn.htmlChunks,n,`html`,s)}else In=Mt(e,n,`html`,s);return In;default:if(t.indexOf(`-`)!==-1){e.push(It(t));var Ln=null,Rn=null,zn;for(zn in n)if(ae.call(n,zn)){var Bn=n[zn];if(Bn!=null){var Vn=zn;switch(zn){case`children`:Ln=Bn;break;case`dangerouslySetInnerHTML`:Rn=Bn;break;case`style`:$e(e,Bn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`className`:Vn=`class`;default:if(le(zn)&&typeof Bn!=`function`&&typeof Bn!=`symbol`&&!1!==Bn){if(!0===Bn)Bn=``;else if(typeof Bn==`object`)continue;e.push(et,I(Vn),tt,I(pe(Bn)),nt)}}}}return Je(e,s),e.push(pt),ht(e,Rn,Ln),Ln}}return Mt(e,n,t,s)}var zt=new Map;function Bt(e){var t=zt.get(e);return t===void 0&&(t=L(`</`+e+`>`),zt.set(e,t)),t}function Vt(e,t){e=e.preamble,e.htmlChunks===null&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),e.headChunks===null&&t.headChunks&&(e.headChunks=t.headChunks),e.bodyChunks===null&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function Ht(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)P(e,t[n]);return n<t.length?(n=t[n],t.length=0,F(e,n)):!0}var z=L(`requestAnimationFrame(function(){$RT=performance.now()});`),Ut=L(`<template id="`),Wt=L(`"></template>`),Gt=L(`<!--&-->`),Kt=L(`<!--/&-->`),qt=L(`<!--$-->`),Jt=L(`<!--$?--><template id="`),Yt=L(`"></template>`),Xt=L(`<!--$!-->`),Zt=L(`<!--/$-->`),Qt=L(`<template`),$t=L(`"`),en=L(` data-dgst="`);L(` data-msg="`),L(` data-stck="`),L(` data-cstck="`);var tn=L(`></template>`);function nn(e,t,n){if(P(e,Jt),n===null)throw Error(`An ID must have been assigned before we can complete the boundary.`);return P(e,t.boundaryPrefix),P(e,I(n.toString(16))),F(e,Yt)}var rn=L(`<div hidden id="`),B=L(`">`),an=L(`</div>`),on=L(`<svg aria-hidden="true" style="display:none" id="`),sn=L(`">`),cn=L(`</svg>`),ln=L(`<math aria-hidden="true" style="display:none" id="`),un=L(`">`),dn=L(`</math>`),fn=L(`<table hidden id="`),pn=L(`">`),mn=L(`</table>`),hn=L(`<table hidden><tbody id="`),gn=L(`">`),_n=L(`</tbody></table>`),vn=L(`<table hidden><tr id="`),yn=L(`">`),bn=L(`</tr></table>`),xn=L(`<table hidden><colgroup id="`),V=L(`">`),Sn=L(`</colgroup></table>`);function Cn(e,t,n,r){switch(n.insertionMode){case 0:case 1:case 3:case 2:return P(e,rn),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,B);case 4:return P(e,on),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,sn);case 5:return P(e,ln),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,un);case 6:return P(e,fn),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,pn);case 7:return P(e,hn),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,gn);case 8:return P(e,vn),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,yn);case 9:return P(e,xn),P(e,t.segmentPrefix),P(e,I(r.toString(16))),F(e,V);default:throw Error(`Unknown insertion mode. This is a bug in React.`)}}function wn(e,t){switch(t.insertionMode){case 0:case 1:case 3:case 2:return F(e,an);case 4:return F(e,cn);case 5:return F(e,dn);case 6:return F(e,mn);case 7:return F(e,_n);case 8:return F(e,bn);case 9:return F(e,Sn);default:throw Error(`Unknown insertion mode. This is a bug in React.`)}}var Tn=L(`$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`),En=L(`$RS("`),Dn=L(`","`),On=L(`")<\/script>`);L(`<template data-rsi="" data-sid="`),L(`" data-pid="`);var kn=L(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
|
|
9
|
+
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`),An=I(`$RV=function(B,g){function h(a,c){var e=a.getAttribute(c);e&&(c=a.style,l.push(a,c.viewTransitionName,c.viewTransitionClass),"auto"!==e&&(c.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+N++ +"_"),a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,c.viewTransitionName=a,C=!0)}var C=!1,N=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var k=g[f].querySelectorAll("[vt-share]"),d=0;d<k.length;d++){var b=k[d];m.set(b.getAttribute("vt-name"),b)}var u=[];for(k=0;k<g.length;k+=2){var D=g[k],x=D.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){b=D;for(f=0;b;){if(8===b.nodeType){var t=b.data;if("/$"===t)if(0===f)break;else f--;else"$"!==t&&"$?"!==t&&"$~"!==t&&"$!"!==t||f++}else if(1===b.nodeType){d=b;var E=d.getAttribute("vt-name"),y=m.get(E);h(d,y?"vt-share":"vt-exit");y&&(h(y,"vt-share"),m.set(E,null));for(var F=d.querySelectorAll("[vt-share]"),
|
|
10
|
+
z=0;z<F.length;z++){var G=F[z],H=G.getAttribute("vt-name"),I=m.get(H);I&&(h(G,"vt-share"),h(I,"vt-share"),m.set(H,null))}var J=d.querySelectorAll("[vt-parent-exit]");for(d=0;d<J.length;d++)h(J[d],"vt-parent-exit")}b=b.nextSibling}for(var K=g[k+1],n=K.firstElementChild;n;){null!==m.get(n.getAttribute("vt-name"))&&h(n,"vt-enter");var L=n.querySelectorAll("[vt-parent-enter]");for(b=0;b<L.length;b++)h(L[b],"vt-parent-enter");n=n.nextElementSibling}b=x;do for(var p=b.firstElementChild;p;){var M=p.getAttribute("vt-update");
|
|
11
|
+
M&&"none"!==M&&!l.includes(p)&&h(p,"vt-update");p=p.nextElementSibling}while((b=b.parentNode)&&1===b.nodeType&&"none"!==b.getAttribute("vt-update"));u.push.apply(u,K.querySelectorAll('img[src]:not([loading="lazy"])'))}}}if(C){var A=document.__reactViewTransition=document.startViewTransition({update:function(){B(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],c={},e=0;e<u.length;c={g:c.g},e++)if(c.g=u[e],!c.g.complete){var q=c.g.getBoundingClientRect();0<q.bottom&&0<q.right&&
|
|
12
|
+
q.top<window.innerHeight&&q.left<window.innerWidth&&(q=new Promise(function(w){return function(r){w.g.addEventListener("load",r);w.g.addEventListener("error",r)}}(c)),a.push(q))}return Promise.race([Promise.all(a),new Promise(function(w){var r=performance.now();setTimeout(w,2300>r&&2E3<r?2300-r:500)})])},types:[]});A.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var c=l[a],e=c.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===c.getAttribute("style")&&c.removeAttribute("style")}});
|
|
13
|
+
A.finished.finally(function(){document.__reactViewTransition===A&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}B(g)}.bind(null,$RV);`),jn=L(`$RC("`),Mn=L(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
|
|
14
|
+
"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
|
|
15
|
+
"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`),Nn=L(`$RR("`),Pn=L(`","`),Fn=L(`",`),In=L(`"`),Ln=L(`)<\/script>`);L(`<template data-rci="" data-bid="`),L(`<template data-rri="" data-bid="`),L(`" data-sid="`),L(`" data-sty="`);var Rn=L(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,null!=c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};`),zn=L(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,null!=c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("`),Bn=L(`$RX("`),Vn=L(`"`),Hn=L(`,`),Un=L(`null`),Wn=L(`)<\/script>`);L(`<template data-rxi="" data-bid="`),L(`" data-dgst="`),L(`" data-msg="`),L(`" data-stck="`),L(`" data-cstck="`);var Gn=/[<\u2028\u2029]/g;function Kn(e){return JSON.stringify(e).replace(Gn,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var qn=/[&><\u2028\u2029]/g;function Jn(e){return JSON.stringify(e).replace(qn,function(e){switch(e){case`&`:return`\\u0026`;case`>`:return`\\u003e`;case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var Yn=L(` media="not all" data-precedence="`),Xn=L(`" data-href="`),Zn=L(`">`),Qn=L(`</style>`),$n=!1,er=!0;function tr(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(P(this,Ce.startInlineStyle),P(this,Yn),P(this,e.precedence),P(this,Xn);r<n.length-1;r++)P(this,n[r]),P(this,lr);for(P(this,n[r]),P(this,Zn),r=0;r<t.length;r++)P(this,t[r]);er=F(this,Qn),$n=!0,t.length=0,n.length=0}}function nr(e){return e.state===2?!1:$n=!0}function rr(e,t,n){return $n=!1,er=!0,Ce=n,t.styles.forEach(tr,e),Ce=null,t.stylesheets.forEach(nr),$n&&(n.stylesToHoist=!0),er}function ir(e){for(var t=0;t<e.length;t++)P(this,e[t]);e.length=0}var ar=[];function or(e){St(ar,e.props);for(var t=0;t<ar.length;t++)P(this,ar[t]);ar.length=0,e.state=2}var sr=L(` data-precedence="`),cr=L(`" data-href="`),lr=L(` `),ur=L(`">`),dr=L(`</style>`);function fr(e){var t=0<e.sheets.size;e.sheets.forEach(or,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(P(this,Ce.startInlineStyle),P(this,sr),P(this,e.precedence),e=0,r.length){for(P(this,cr);e<r.length-1;e++)P(this,r[e]),P(this,lr);P(this,r[e])}for(P(this,ur),e=0;e<n.length;e++)P(this,n[e]);P(this,dr),n.length=0,r.length=0}}function pr(e){if(e.state===0){e.state=1;var t=e.props;for(St(ar,{rel:`preload`,as:`style`,href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<ar.length;e++)P(this,ar[e]);ar.length=0}}function mr(e){e.sheets.forEach(pr,this),e.sheets.clear()}L(`<link rel="expect" href="#`),L(`" blocking="render"/>`);var hr=L(` id="`);function gr(e,t){!(t.instructions&32)&&(t.instructions|=32,e.push(hr,I(pe(`_`+t.idPrefix+`R_`)),nt))}var _r=L(`[`),vr=L(`,[`),yr=L(`,`),br=L(`]`);function xr(e,t){P(e,_r);var n=_r;t.stylesheets.forEach(function(t){if(t.state!==2){if(t.state===3)P(e,n),P(e,I(Jn(``+t.props.href))),P(e,br),n=vr;else{P(e,n);var r=t.props[`data-precedence`],i=t.props;for(var a in P(e,I(Jn(_e(``+t.props.href)))),r=``+r,P(e,yr),P(e,I(Jn(r))),i)if(ae.call(i,a)&&(r=i[a],r!=null))switch(a){case`href`:case`rel`:case`precedence`:case`data-precedence`:break;case`children`:case`dangerouslySetInnerHTML`:throw Error("link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:Sr(e,a,r)}P(e,br),n=vr,t.state=3}}}),P(e,br)}function Sr(e,t,n){var r=t.toLowerCase();switch(typeof n){case`function`:case`symbol`:return}switch(t){case`innerHTML`:case`dangerouslySetInnerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`style`:case`ref`:return;case`className`:r=`class`,t=``+n;break;case`hidden`:if(!1===n)return;t=``;break;case`src`:case`href`:n=_e(n),t=``+n;break;default:if(2<t.length&&(t[0]===`o`||t[0]===`O`)&&(t[1]===`n`||t[1]===`N`)||!le(t))return;t=``+n}P(e,yr),P(e,I(Jn(r))),P(e,yr),P(e,I(Jn(t)))}function Cr(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function wr(e){var t=da();if(t){var n=t.resumableState,r=t.renderState;if(typeof e==`string`&&e){if(!n.dnsResources.hasOwnProperty(e)){n.dnsResources[e]=null,n=r.headers;var i,a;(a=n&&0<n.remainingCapacity)&&(a=(i=`<`+(``+e).replace(Nr,Pr)+`>; rel=dns-prefetch`,0<=(n.remainingCapacity-=i.length+2))),a?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=`, `),n.preconnects+=i):(i=[],St(i,{href:e,rel:`dns-prefetch`}),r.preconnects.add(i))}fo(t)}}else xe.D(e)}function Tr(e,t){var n=da();if(n){var r=n.resumableState,i=n.renderState;if(typeof e==`string`&&e){var a=t===`use-credentials`?`credentials`:typeof t==`string`?`anonymous`:`default`;if(!r.connectResources[a].hasOwnProperty(e)){r.connectResources[a][e]=null,r=i.headers;var o,s;if(s=r&&0<r.remainingCapacity){if(s=`<`+(``+e).replace(Nr,Pr)+`>; rel=preconnect`,typeof t==`string`){var c=(``+t).replace(Fr,Ir);s+=`; crossorigin="`+c+`"`}s=(o=s,0<=(r.remainingCapacity-=o.length+2))}s?(i.resets.connect[a][e]=null,r.preconnects&&(r.preconnects+=`, `),r.preconnects+=o):(a=[],St(a,{rel:`preconnect`,href:e,crossOrigin:t}),i.preconnects.add(a))}fo(n)}}else xe.C(e,t)}function Er(e,t,n){var r=da();if(r){var i=r.resumableState,a=r.renderState;if(t&&e){switch(t){case`image`:if(n)var o=n.imageSrcSet,s=n.imageSizes,c=n.fetchPriority;var l=o?o+`
|
|
16
|
+
`+(s||``):e;if(i.imageResources.hasOwnProperty(l))return;i.imageResources[l]=Se,i=a.headers;var u;i&&0<i.remainingCapacity&&typeof o!=`string`&&c===`high`&&(u=Mr(e,t,n),0<=(i.remainingCapacity-=u.length+2))?(a.resets.image[l]=Se,i.highImagePreloads&&(i.highImagePreloads+=`, `),i.highImagePreloads+=u):(i=[],St(i,ie({rel:`preload`,href:o?void 0:e,as:t},n)),c===`high`?a.highImagePreloads.add(i):(a.bulkPreloads.add(i),a.preloads.images.set(l,i)));break;case`style`:if(i.styleResources.hasOwnProperty(e))return;o=[],St(o,ie({rel:`preload`,href:e,as:t},n)),i.styleResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?Se:[n.crossOrigin,n.integrity],a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case`script`:if(i.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),St(o,ie({rel:`preload`,href:e,as:t},n)),i.scriptResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?Se:[n.crossOrigin,n.integrity];break;default:if(i.unknownResources.hasOwnProperty(t)){if(o=i.unknownResources[t],o.hasOwnProperty(e))return}else o={},i.unknownResources[t]=o;if(o[e]=Se,(i=a.headers)&&0<i.remainingCapacity&&t===`font`&&(l=Mr(e,t,n),0<=(i.remainingCapacity-=l.length+2)))a.resets.font[e]=Se,i.fontPreloads&&(i.fontPreloads+=`, `),i.fontPreloads+=l;else switch(i=[],e=ie({rel:`preload`,href:e,as:t},n),St(i,e),t){case`font`:a.fontPreloads.add(i);break;default:a.bulkPreloads.add(i)}}fo(r)}}else xe.L(e,t,n)}function Dr(e,t){var n=da();if(n){var r=n.resumableState,i=n.renderState;if(e){var a=t&&typeof t.as==`string`?t.as:`script`;switch(a){case`script`:if(r.moduleScriptResources.hasOwnProperty(e))return;a=[],r.moduleScriptResources[e]=!t||typeof t.crossOrigin!=`string`&&typeof t.integrity!=`string`?Se:[t.crossOrigin,t.integrity],i.preloads.moduleScripts.set(e,a);break;default:if(r.moduleUnknownResources.hasOwnProperty(a)){var o=r.moduleUnknownResources[a];if(o.hasOwnProperty(e))return}else o={},r.moduleUnknownResources[a]=o;a=[],o[e]=Se}St(a,ie({rel:`modulepreload`,href:e},t)),i.bulkPreloads.add(a),fo(n)}}else xe.m(e,t)}function Or(e,t,n){var r=da();if(r){var i=r.resumableState,a=r.renderState;if(e){t||=`default`;var o=a.styles.get(t),s=i.styleResources.hasOwnProperty(e)?i.styleResources[e]:void 0;s!==null&&(i.styleResources[e]=null,o||(o={precedence:I(pe(t)),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,o)),t={state:0,props:ie({rel:`stylesheet`,href:e,"data-precedence":t},n)},s&&(s.length===2&&jr(t.props,s),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),o.sheets.set(e,t),fo(r))}}else xe.S(e,t,n)}function kr(e,t){var n=da();if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;a!==null&&(r.scriptResources[e]=null,t=ie({src:e,async:!0},t),a&&(a.length===2&&jr(t,a),e=i.preloads.scripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),At(e,t),fo(n))}}else xe.X(e,t)}function Ar(e,t){var n=da();if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;a!==null&&(r.moduleScriptResources[e]=null,t=ie({src:e,type:`module`,async:!0},t),a&&(a.length===2&&jr(t,a),e=i.preloads.moduleScripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),At(e,t),fo(n))}}else xe.M(e,t)}function jr(e,t){e.crossOrigin??=t[0],e.integrity??=t[1]}function Mr(e,t,n){for(var r in e=(``+e).replace(Nr,Pr),t=(``+t).replace(Fr,Ir),t=`<`+e+`>; rel=preload; as="`+t+`"`,n)ae.call(n,r)&&(e=n[r],typeof e==`string`&&(t+=`; `+r.toLowerCase()+`="`+(``+e).replace(Fr,Ir)+`"`));return t}var Nr=/[<>\r\n]/g;function Pr(e){switch(e){case`<`:return`%3C`;case`>`:return`%3E`;case`
|
|
17
|
+
`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}var Fr=/["';,\r\n]/g;function Ir(e){switch(e){case`"`:return`%22`;case`'`:return`%27`;case`;`:return`%3B`;case`,`:return`%2C`;case`
|
|
18
|
+
`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}function Lr(e){this.styles.add(e)}function Rr(e){this.stylesheets.add(e)}function zr(e,t){t.styles.forEach(Lr,e),t.stylesheets.forEach(Rr,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function Br(e,t){return t?e.suspenseyImages:0<e.stylesheets.size||e.suspenseyImages}var Vr=Function.prototype.bind,Hr=typeof AsyncLocalStorage==`function`,Ur=Hr?new AsyncLocalStorage:null,Wr=Symbol.for(`react.client.reference`);function Gr(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Wr?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case a:return`Fragment`;case s:return`Profiler`;case o:return`StrictMode`;case d:return`Suspense`;case f:return`SuspenseList`;case g:return`Activity`;case y:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case i:return`Portal`;case l:return e.displayName||`Context`;case c:return(e._context.displayName||`Context`)+`.Consumer`;case u:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case p:return t=e.displayName||null,t===null?Gr(e.type)||`Memo`:t;case m:t=e._payload,e=e._init;try{return Gr(e(t))}catch{}}return null}var Kr={},qr=null;function Jr(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(`The stacks must reach the root at the same time. This is a bug in React.`)}else{if(n===null)throw Error(`The stacks must reach the root at the same time. This is a bug in React.`);Jr(e,n)}t.context._currentValue=t.value}}function Yr(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&Yr(e)}function Xr(e){var t=e.parent;t!==null&&Xr(t),e.context._currentValue=e.value}function Zr(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(`The depth must equal at least at zero before reaching the root. This is a bug in React.`);e.depth===t.depth?Jr(e,t):Zr(e,t)}function Qr(e,t){var n=t.parent;if(n===null)throw Error(`The depth must equal at least at zero before reaching the root. This is a bug in React.`);e.depth===n.depth?Jr(e,n):Qr(e,n),t.context._currentValue=t.value}function $r(e){var t=qr;t!==e&&(t===null?Xr(e):e===null?Yr(t):t.depth===e.depth?Jr(t,e):t.depth>e.depth?Zr(t,e):Qr(t,e),qr=e)}var ei={enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},ti={id:1,overflow:``};function ni(e){var t=e.overflow;return e=e.id,(e&~(1<<32-ii(e)-1)).toString(32)+t}function ri(e,t,n){var r=e.id;e=e.overflow;var i=32-ii(r)-1;r&=~(1<<i),n+=1;var a=32-ii(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-ii(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var ii=Math.clz32?Math.clz32:si,ai=Math.log,oi=Math.LN2;function si(e){return e>>>=0,e===0?32:31-(ai(e)/oi|0)|0}function ci(){}var li=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`.");function ui(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ci,ci),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,e===void 0&&!(`reason`in t)?Error("A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`."):e;default:switch(typeof t.status==`string`?t.then(ci,ci):(e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason}throw di=t,li}}var di=null;function fi(){if(di===null)throw Error(`Expected a suspended thenable. This is a bug in React. Please file an issue.`);var e=di;return di=null,e}function pi(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mi=typeof Object.is==`function`?Object.is:pi,hi=null,gi=null,_i=null,vi=null,yi=null,bi=null,xi=!1,Si=!1,Ci=0,wi=0,Ti=-1,Ei=0,H=null;function Di(e){if(e=e._reason,typeof e==`function`)try{var t=e()}catch{t=`The reason for browser-only rendering could not be determined because its initializer threw.`}else t=e;return t=Error("Browser-only rendering was requested by `browser()`.",e===void 0?void 0:{cause:t}),Object.defineProperty(t,x,{value:!0}),t}function Oi(e){return typeof e!=`object`||!e?!1:!0===e[x]}function ki(e){var t=Error(`The server render could not complete because client rendering was requested outside a Suspense boundary. See this error's cause for additional details.`,ae.call(e,`cause`)?{cause:e.cause}:void 0);if(e=e.stack,e!==void 0){var n=e.indexOf(`
|
|
19
|
+
`);t.stack=t.name+`: `+t.message+(n===-1?``:e.slice(n))}else t.stack=void 0;return t}var Ai=null,ji=0;function Mi(){if(hi===null)throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
20
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
21
|
+
2. You might be breaking the Rules of Hooks
|
|
22
|
+
3. You might have more than one copy of React in the same app
|
|
23
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`);return hi}function Ni(){if(0<ji)throw Error(`Rendered more hooks than during the previous render`);return{memoizedState:null,queue:null,next:null}}function Pi(){return bi===null?yi===null?(xi=!1,yi=bi=Ni()):(xi=!0,bi=yi):bi.next===null?(xi=!1,bi=bi.next=Ni()):(xi=!0,bi=bi.next),bi}function Fi(){var e=H;return H=null,e}function Ii(){vi=_i=gi=hi=null,Si=!1,yi=null,ji=0,bi=Ai=null}function Li(e,t){return typeof t==`function`?t(e):t}function Ri(e,t,n){if(hi=Mi(),bi=Pi(),xi){var r=bi.queue;if(t=r.dispatch,Ai!==null&&(n=Ai.get(r),n!==void 0)){Ai.delete(r),r=bi.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return bi.memoizedState=r,[r,t]}return[bi.memoizedState,t]}return e=e===Li?typeof t==`function`?t():t:n===void 0?t:n(t),bi.memoizedState=e,e=bi.queue={last:null,dispatch:null},e=e.dispatch=Bi.bind(null,hi,e),[bi.memoizedState,e]}function zi(e,t){if(hi=Mi(),bi=Pi(),t=t===void 0?null:t,bi!==null){var n=bi.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!mi(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),bi.memoizedState=[e,t],e}function Bi(e,t,n){if(25<=ji)throw Error(`Too many re-renders. React limits the number of renders to prevent an infinite loop.`);if(e===hi){if(Si=!0,e={action:n,next:null},Ai===null&&(Ai=new Map),n=Ai.get(t),n===void 0)Ai.set(t,e);else{for(t=n;t.next!==null;)t=t.next;t.next=e}}}function Vi(){throw Error(`A function wrapped in useEffectEvent can't be called during rendering.`)}function U(){throw Error(`startTransition cannot be called during server rendering.`)}function Hi(){throw Error(`Cannot update optimistic state while rendering.`)}function Ui(e,t,n){Mi();var r=wi++,i=_i;if(typeof e.$$FORM_ACTION==`function`){var a=null,o=vi;i=i.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(i!==null&&typeof s==`function`){var c=i[1];s.call(e,i[2],i[3])&&(a=n===void 0?`k`+D(JSON.stringify([o,null,r]),0):`p`+n,c===a&&(Ti=r,t=i[0]))}var l=e.bind(null,t);return e=function(e){l(e)},typeof l.$$FORM_ACTION==`function`&&(e.$$FORM_ACTION=function(e){e=l.$$FORM_ACTION(e),n!==void 0&&(n+=``,e.action=n);var t=e.data;return t&&(a===null&&(a=n===void 0?`k`+D(JSON.stringify([o,null,r]),0):`p`+n),t.append(`$ACTION_KEY`,a)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function Wi(e){var t=Ei;return Ei+=1,H===null&&(H=[]),ui(H,e,t)}function Gi(){throw Error(`Cache cannot be refreshed during server rendering.`)}var Ki={readContext:function(e){return e._currentValue},use:function(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Wi(e);if(e.$$typeof===x)throw Di(e);if(e.$$typeof===l)return e._currentValue}throw Error(`An unsupported type was passed to use(): `+String(e))},useContext:function(e){return Mi(),e._currentValue},useMemo:zi,useReducer:Ri,useRef:function(e){hi=Mi(),bi=Pi();var t=bi.memoizedState;return t===null?(e={current:e},bi.memoizedState=e):t},useState:function(e){return Ri(Li,e)},useInsertionEffect:ci,useLayoutEffect:ci,useCallback:function(e,t){return zi(function(){return e},t)},useImperativeHandle:ci,useEffect:ci,useDebugValue:ci,useDeferredValue:function(e,t){return Mi(),t===void 0?e:t},useTransition:function(){return Mi(),[!1,U]},useId:function(){var e=ni(gi.treeContext),t=qi;if(t===null)throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component.`);return Ge(t,e,Ci++)},useSyncExternalStore:function(e,t,n){if(n===void 0)throw Error(`Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.`);return n()},useOptimistic:function(e){return Mi(),[e,Hi]},useActionState:Ui,useFormState:Ui,useHostTransitionStatus:function(){return Mi(),be},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=v;return t},useCacheRefresh:function(){return Gi},useEffectEvent:function(){return Vi}},qi=null,Ji={getCacheForType:function(){throw Error(`Not implemented.`)},cacheSignal:function(){throw Error(`Not implemented.`)}};function Yi(e,t){e=(e.name||`Error`)+`: `+(e.message||``);for(var n=0;n<t.length;n++)e+=`
|
|
24
|
+
at `+t[n].toString();return e}var Xi,Zi;function Qi(e){if(Xi===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Xi=t&&t[1]||``,Zi=-1<e.stack.indexOf(`
|
|
25
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
26
|
+
`+Xi+e+Zi}var $i=!1;function ea(e,t){if(!e||$i)return``;$i=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=Yi;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
27
|
+
`),l=s.split(`
|
|
28
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
29
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{$i=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Qi(n):``}function ta(e){if(typeof e==`string`)return Qi(e);if(typeof e==`function`)return e.prototype&&e.prototype.isReactComponent?ea(e,!0):ea(e,!1);if(typeof e==`object`&&e){switch(e.$$typeof){case u:return ea(e.render,!1);case p:return ea(e.type,!1);case m:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch{return Qi(`Lazy`)}return ta(e)}if(typeof e.name==`string`){a:{n=e.name,t=e.env;var r=e.debugLocation;if(r!=null&&(e=Error.prepareStackTrace,Error.prepareStackTrace=Yi,r=r.stack,Error.prepareStackTrace=e,r.startsWith(`Error: react-stack-top-frame
|
|
30
|
+
`)&&(r=r.slice(29)),e=r.indexOf(`
|
|
31
|
+
`),e!==-1&&(r=r.slice(e+1)),e=r.indexOf(`react_stack_bottom_frame`),e!==-1&&(e=r.lastIndexOf(`
|
|
32
|
+
`,e)),e=e===-1?``:r=r.slice(0,e),r=e.lastIndexOf(`
|
|
33
|
+
`),e=r===-1?e:e.slice(r+1),e.indexOf(n)!==-1)){n=`
|
|
34
|
+
`+e;break a}n=Qi(n+(t?` [`+t+`]`:``))}return n}}switch(e){case f:return Qi(`SuspenseList`);case d:return Qi(`Suspense`);case y:return Qi(`ViewTransition`)}return``}function na(e,t){return e=e==null||typeof e==`string`?e:e.default,t=t==null||typeof t==`string`?t:t.default,t==null?e===`auto`?null:e:t===`auto`?null:t}function ra(e,t){return(500<t.byteSize||Br(t.contentState,!1)||t.defer)&&t.preamble===null}function ia(e){if(typeof e==`object`&&e&&typeof e.environmentName==`string`){var t=e.environmentName;e=[e].slice(0),typeof e[0]==`string`?e.splice(0,1,`\x1B[0m\x1B[7m%c%s\x1B[0m%c `+e[0],`background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px`,` `+t+` `,``):e.splice(0,0,`\x1B[0m\x1B[7m%c%s\x1B[0m%c`,`background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px`,` `+t+` `,``),e.unshift(console),t=Vr.apply(console.error,e),t()}else console.error(e);return null}function aa(e,t,n,r,i,a,o,s,c,l,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=r===void 0?12800:r,this.status=10,this.fatalError=null,this.aborted=!1,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=d,this.pingedTasks=[],this.currentTask=null,this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.postponedState=this.trackedPostpones=null,this.onError=i===void 0?ia:i,this.onBrowserBailout=a===void 0?ci:a,this.onAllReady=o===void 0?ci:o,this.onShellReady=s===void 0?ci:s,this.onShellError=c===void 0?ci:c,this.onFatalError=l===void 0?ci:l,this.renderLifetimeController=null,this.formState=u===void 0?null:u}function oa(e,t,n,r,i,a,o,s,c,l,u,d){return t=new aa(t,n,r,i,a,o,s,c,l,u,d),n=ga(t,0,null,r,!1,!1),n.parentFlushed=!0,e=ma(t,null,e,-1,null,n,null,null,t.abortableTasks,null,r,null,ti,null,null),_a(e),t.pingedTasks.push(e),t}function sa(e,t,n,r,i,a,o,s,c,l,u){return e=oa(e,t,n,r,i,a,o,s,c,l,u,void 0),e.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}function ca(e,t,n,r,i,a,o,s,c){return n=new aa(t.resumableState,n,t.rootFormatContext,t.progressiveChunkSize,r,i,a,o,s,c,null),n.nextSegmentId=t.nextSegmentId,typeof t.replaySlots==`number`?(r=ga(n,0,null,t.rootFormatContext,!1,!1),r.parentFlushed=!0,e=ma(n,null,e,-1,null,r,null,null,n.abortableTasks,null,t.rootFormatContext,null,ti,null,null),_a(e),n.pingedTasks.push(e),n):(e=ha(n,null,{nodes:t.replayNodes,slots:t.replaySlots,pendingTasks:0},e,-1,null,null,n.abortableTasks,null,t.rootFormatContext,null,ti,null,null),_a(e),n.pingedTasks.push(e),n)}function la(e,t,n,r,i,a,o,s,c){return e=ca(e,t,n,r,i,a,o,s,c),e.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}var ua=null;function da(){if(ua)return ua;if(Hr){var e=Ur.getStore();if(e)return e}return null}function fa(e,t){e.pingedTasks.push(t),e.pingedTasks.length===1&&(e.flushScheduled=e.destination!==null,e.trackedPostpones!==null||e.status===10?j(function(){return Xa(e)}):setTimeout(function(){return Xa(e)},0))}function pa(e,t,n,r,i){return n={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,defer:i,fallbackAbortableTasks:n,errorDigest:null,contentState:Cr(),fallbackState:Cr(),preamble:r,tracked:null},t!==null&&(t.pendingTasks++,r=t.boundaries,r!==null&&(e.allPendingTasks++,n.pendingTasks++,r.push(n)),e=t.inheritedHoistables,e!==null&&zr(n.contentState,e)),n}function ma(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){e.allPendingTasks++,i===null?e.pendingRootTasks++:i.pendingTasks++,p!==null&&p.pendingTasks++;var h={replay:null,node:n,childIndex:r,ping:{resolve:function(){return fa(e,h)},reject:function(t){e.aborted?h.abortSet.delete(h)&&Ua(h,e,t):fa(e,h)}},blockedBoundary:i,blockedSegment:a,blockedPreamble:o,hoistableState:s,abortSet:c,keyPath:l,formatContext:u,context:d,treeContext:f,row:p,componentStack:m,thenableState:t};return c.add(h),h}function ha(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.allPendingTasks++,a===null?e.pendingRootTasks++:a.pendingTasks++,f!==null&&f.pendingTasks++,n.pendingTasks++;var m={replay:n,node:r,childIndex:i,ping:{resolve:function(){return fa(e,m)},reject:function(t){e.aborted?m.abortSet.delete(m)&&Ua(m,e,t):fa(e,m)}},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:o,abortSet:s,keyPath:c,formatContext:l,context:u,treeContext:d,row:f,componentStack:p,thenableState:t};return s.add(m),m}function ga(e,t,n,r,i,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function _a(e){var t=e.node;if(typeof t==`object`&&t)switch(t.$$typeof){case r:e.componentStack={parent:e.componentStack,type:t.type}}}function va(e){return e===null?null:{parent:e.parent,type:`Suspense Fallback`}}function ya(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n=``,r=e;do n+=ta(r.type),r=r.parent;while(r);var i=n}catch(e){i=`
|
|
35
|
+
Error generating stack: `+e.message+`
|
|
36
|
+
`+e.stack}return Object.defineProperty(t,"componentStack",{value:i}),i}}),t}function ba(e,t,n){if(Oi(t))return e=e.onBrowserBailout,e(t,n),``;if(e=e.onError,t=e(t,n),t==null||typeof t==`string`)return t===``?void 0:t}function xa(e,t){var n=e.onShellError,r=e.onFatalError;e.pendingRootTasks!==0&&n(t),r(t),ho(e),e.destination===null?(e.status=12,e.aborted||(e.fatalError=t)):(e.status=13,re(e.destination,t))}function Sa(e,t){Ca(e,t.next,t.hoistables)}function Ca(e,t,n){for(;t!==null;){n!==null&&(zr(t.hoistables,n),t.inheritedHoistables=n);var r=t.boundaries;if(r!==null){t.boundaries=null;for(var i=0;i<r.length;i++){var a=r[i];n!==null&&zr(a.contentState,n),Ya(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;n=t.hoistables,t=t.next}}function wa(e,t){var n=t.boundaries;if(n!==null&&t.pendingTasks===n.length){for(var r=!0,i=0;i<n.length;i++){var a=n[i];if(a.pendingTasks!==1||a.parentFlushed||ra(e,a)){r=!1;break}}r&&Ca(e,t,t.hoistables)}}function Ta(e){var t={pendingTasks:1,boundaries:null,hoistables:Cr(),inheritedHoistables:null,together:!1,next:null};return e!==null&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function Ea(e,t,n,r,i){var a=t.keyPath,o=t.treeContext,s=t.row;t.keyPath=n,n=r.length;var c=null;if(t.replay!==null){var l=t.replay.slots;if(typeof l==`object`&&l)for(var u=0;u<n;u++){var d=i!==`backwards`&&i!==`unstable_legacy-backwards`?u:n-1-u,f=r[d];t.row=c=Ta(c),t.treeContext=ri(o,n,d);var p=l[d];typeof p==`number`?(Aa(e,t,p,f,d),delete l[d]):za(e,t,f,d),--c.pendingTasks===0&&Sa(e,c)}else for(l=0;l<n;l++)u=i!==`backwards`&&i!==`unstable_legacy-backwards`?l:n-1-l,d=r[u],t.row=c=Ta(c),t.treeContext=ri(o,n,u),za(e,t,d,u),--c.pendingTasks===0&&Sa(e,c)}else if(i!==`backwards`&&i!==`unstable_legacy-backwards`)for(i=0;i<n;i++)l=r[i],t.row=c=Ta(c),t.treeContext=ri(o,n,i),za(e,t,l,i),--c.pendingTasks===0&&Sa(e,c);else{for(l=t.blockedSegment,u=l.children.length,d=l.chunks.length,f=0;f<n;f++){p=i===`unstable_legacy-backwards`?n-1-f:f;var m=r[p];t.row=c=Ta(c),t.treeContext=ri(o,n,p);var h=ga(e,d,null,t.formatContext,p!==0||l.lastPushedText,!0);l.children.splice(u,0,h),t.blockedSegment=h;try{za(e,t,m,p),h.lastPushedText&&h.textEmbedded&&h.chunks.push(Ke),h.status=1,Ja(e,t.blockedBoundary,h),--c.pendingTasks===0&&Sa(e,c)}catch(t){throw h.status=e.aborted?3:4,t}}t.blockedSegment=l,l.lastPushedText=!1}s!==null&&c!==null&&0<c.pendingTasks&&(s.pendingTasks++,c.next=s),t.treeContext=o,t.row=s,t.keyPath=a}function Da(e,t,n,r,i,a){var o=t.thenableState;for(t.thenableState=null,hi={},gi=t,_i=e,vi=n,wi=Ci=0,Ti=-1,Ei=0,H=o,e=r(i,a);Si;)Si=!1,wi=Ci=0,Ti=-1,Ei=0,ji+=1,bi=null,e=r(i,a);return Ii(),e}function Oa(e,t,n,r,i,a,o){var s=!1;if(a!==0&&e.formState!==null){var c=t.blockedSegment;if(c!==null){s=!0,c=c.chunks;for(var l=0;l<a;l++)l===o?c.push(bt):c.push(xt)}}a=t.keyPath,t.keyPath=n,i?(n=t.treeContext,t.treeContext=ri(n,1,0),za(e,t,r,-1),t.treeContext=n):s?za(e,t,r,-1):ja(e,t,r,-1),t.keyPath=a}function ka(e,t,n,r,i,v){if(typeof r==`function`){if(r.prototype&&r.prototype.isReactComponent){var b=i;if(`ref`in i)for(var x in b={},i)x!==`ref`&&(b[x]=i[x]);var S=r.defaultProps;if(S)for(var w in b===i&&(b=ie({},b,i)),S)b[w]===void 0&&(b[w]=S[w]);var D=b,O=Kr,k=r.contextType;typeof k==`object`&&k&&(O=k._currentValue);var A=new r(D,O),j=A.state===void 0?null:A.state;A.updater=ei,A.props=D,A.state=j;var M={queue:[],replace:!1};A._reactInternals=M;var N=r.contextType;A.context=typeof N==`object`&&N?N._currentValue:Kr;var P=r.getDerivedStateFromProps;if(typeof P==`function`){var F=P(D,j);A.state=F==null?j:ie({},j,F)}if(typeof r.getDerivedStateFromProps!=`function`&&typeof A.getSnapshotBeforeUpdate!=`function`&&(typeof A.UNSAFE_componentWillMount==`function`||typeof A.componentWillMount==`function`)){var ee=A.state;if(typeof A.componentWillMount==`function`&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount==`function`&&A.UNSAFE_componentWillMount(),ee!==A.state&&ei.enqueueReplaceState(A,A.state,null),M.queue!==null&&0<M.queue.length){var te=M.queue,I=M.replace;if(M.queue=null,M.replace=!1,I&&te.length===1)A.state=te[0];else{for(var L=I?te[0]:A.state,ne=!0,re=+!!I;re<te.length;re++){var ae=te[re],oe=typeof ae==`function`?ae.call(A,L,D,void 0):ae;oe!=null&&(ne?(ne=!1,L=ie({},L,oe)):ie(L,oe))}A.state=L}}else M.queue=null}var se=A.render();if(e.aborted)throw null;var ce=t.keyPath;t.keyPath=n,ja(e,t,se,-1),t.keyPath=ce}else{var le=Da(e,t,n,r,i,void 0);if(e.aborted)throw null;Oa(e,t,n,le,Ci!==0,wi,Ti)}}else if(typeof r==`string`){var ue=t.blockedSegment;if(ue===null){var de=i.children,fe=t.formatContext,pe=t.keyPath;t.formatContext=Ve(fe,r,i),t.keyPath=n,za(e,t,de,-1),t.formatContext=fe,t.keyPath=pe}else{var me=Rt(ue.chunks,r,i,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,ue.lastPushedText);ue.lastPushedText=!1;var he=t.formatContext,ge=t.keyPath;if(t.keyPath=n,(t.formatContext=Ve(he,r,i)).insertionMode===3){var _e=ga(e,0,null,t.formatContext,!1,!1);ue.preambleChildren.push(_e),t.blockedSegment=_e;try{za(e,t,me,-1),_e.lastPushedText&&_e.textEmbedded&&_e.chunks.push(Ke),_e.status=1,Ja(e,t.blockedBoundary,_e)}finally{t.blockedSegment=ue}}else za(e,t,me,-1);t.formatContext=he,t.keyPath=ge;a:{var ve=ue.chunks,ye=e.resumableState;switch(r){case`title`:case`style`:case`script`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break a;case`body`:if(1>=he.insertionMode){ye.hasBody=!0;break a}break;case`html`:if(he.insertionMode===0){ye.hasHtml=!0;break a}break;case`head`:if(1>=he.insertionMode)break a}ve.push(Bt(r))}ue.lastPushedText=!1}}else{switch(r){case _:case o:case s:case a:var be=t.keyPath;t.keyPath=n,ja(e,t,i.children,-1),t.keyPath=be;return;case g:var xe=t.blockedSegment;if(xe===null){if(i.mode!==`hidden`){var Se=t.keyPath;t.keyPath=n,za(e,t,i.children,-1),t.keyPath=Se}}else if(i.mode!==`hidden`){xe.chunks.push(Gt),xe.lastPushedText=!1;var Ce=t.keyPath;t.keyPath=n,za(e,t,i.children,-1),t.keyPath=Ce,xe.chunks.push(Kt),xe.lastPushedText=!1}return;case f:a:{var we=i.children,Te=i.revealOrder;if(Te!==`independent`&&Te!==`together`){if(E(we)){Ea(e,t,n,we,Te);break a}var Ee=C(we);if(Ee){var De=Ee.call(we);if(De){var Oe=De.next();if(!Oe.done){do Oe=De.next();while(!Oe.done);Ea(e,t,n,we,Te)}break a}}}if(Te===`together`){var ke=t.keyPath,Ae=t.row,R=t.row=Ta(null);R.boundaries=[],R.together=!0,t.keyPath=n,ja(e,t,we,-1),--R.pendingTasks===0&&Sa(e,R),t.keyPath=ke,t.row=Ae,Ae!==null&&0<R.pendingTasks&&(Ae.pendingTasks++,R.next=Ae)}else{var je=t.keyPath;t.keyPath=n,ja(e,t,we,-1),t.keyPath=je}}return;case y:var Me=t.formatContext,Ne=t.keyPath,Pe=e.resumableState;if(i.name!=null&&i.name!==`auto`)var Fe=i.name;else Fe=Ge(Pe,ni(t.treeContext),0);var Ie=Fe,Le=e.resumableState,Be=na(i.default,i.update),He=na(i.default,i.enter),qe=na(i.default,i.exit),Je=na(i.default,i.share),Ye=i.name;if(Be??=`auto`,He??=`auto`,qe??=`auto`,Ye==null){var Xe=Me.viewTransition;Xe===null?(Ye=`auto`,Je=`none`):(Ye=Xe.name,Je=Xe.share)}else Je??=`auto`,Me.tagScope&4&&(Le.instructions|=128);Me.tagScope&8?Le.instructions|=128:qe=`none`,Me.tagScope&16?Le.instructions|=128:He=`none`;var Ze={update:Be,enter:He,exit:qe,share:Je,parentEnter:`none`,parentExit:`none`,name:Ye,autoName:Ie,nameIdx:0},Qe=Me.tagScope&-25;if(Qe=Be===`none`?Qe&-33:Qe|32,He!==`none`&&(Qe|=64),t.formatContext=ze(Me.insertionMode,Me.selectedValue,Qe,Ze),t.keyPath=n,i.name!=null&&i.name!==`auto`)ja(e,t,i.children,-1);else{var $e=t.treeContext;t.treeContext=ri($e,1,0),za(e,t,i.children,-1),t.treeContext=$e}t.formatContext=Me,t.keyPath=Ne;return;case h:throw Error(`ReactDOMServer does not yet support scope components.`);case d:a:if(t.replay!==null){var et=t.keyPath,tt=t.formatContext,nt=t.row;t.keyPath=n,t.formatContext=We(e.resumableState,tt),t.row=null;var rt=i.children;try{za(e,t,rt,-1)}finally{t.keyPath=et,t.formatContext=tt,t.row=nt}}else{var it=t.keyPath,at=t.formatContext,ot=t.row,st=t.blockedBoundary,ct=t.blockedPreamble,lt=t.hoistableState,ut=t.blockedSegment,dt=i.fallback,ft=i.children,pt=new Set,mt=pa(e,t.row,pt,2>t.formatContext.insertionMode?{content:Re(),fallback:Re()}:null,!1),ht=ga(e,ut.chunks.length,mt,t.formatContext,!1,!1);ut.children.push(ht),ut.lastPushedText=!1;var gt=ga(e,0,null,t.formatContext,!1,!1);gt.parentFlushed=!0;var _t=e.trackedPostpones;if(_t!==null){var vt=t.componentStack,yt=[n[0],`Suspense Fallback`,n[2]];if(_t!==null){var bt=[yt[1],yt[2],[],null];_t.workingMap.set(yt,bt),mt.tracked={contentKeyPath:n,fallbackNode:bt}}t.blockedSegment=ht,t.blockedPreamble=mt.preamble===null?null:mt.preamble.fallback,t.keyPath=yt,t.formatContext=Ue(e.resumableState,at),t.componentStack=va(vt);try{za(e,t,dt,-1),ht.lastPushedText&&ht.textEmbedded&&ht.chunks.push(Ke),ht.status=1,Ja(e,st,ht)}catch(t){throw ht.status=e.aborted?3:4,t}finally{t.blockedSegment=ut,t.blockedPreamble=ct,t.keyPath=it,t.formatContext=at}var xt=ma(e,null,ft,-1,mt,gt,mt.preamble===null?null:mt.preamble.content,mt.contentState,t.abortSet,n,We(e.resumableState,t.formatContext),t.context,t.treeContext,null,vt);_a(xt),e.pingedTasks.push(xt)}else{t.blockedBoundary=mt,t.blockedPreamble=mt.preamble===null?null:mt.preamble.content,t.hoistableState=mt.contentState,t.blockedSegment=gt,t.keyPath=n,t.formatContext=We(e.resumableState,at),t.row=null;try{if(za(e,t,ft,-1),gt.lastPushedText&>.textEmbedded&>.chunks.push(Ke),gt.status=1,Ja(e,mt,gt),qa(mt,gt),mt.pendingTasks===0&&mt.status===0){if(mt.status=1,!ra(e,mt)){ot!==null&&--ot.pendingTasks===0&&Sa(e,ot),e.pendingRootTasks===0&&t.blockedPreamble&&$a(e);break a}}else ot!==null&&ot.together&&wa(e,ot)}catch(n){if(mt.status=4,e.aborted){gt.status=3;var St=e.fatalError}else gt.status=4,St=n;var Ct=ya(t.componentStack);mt.errorDigest=ba(e,St,Ct),Ia(e,mt)}finally{t.blockedBoundary=st,t.blockedPreamble=ct,t.hoistableState=lt,t.blockedSegment=ut,t.keyPath=it,t.formatContext=at,t.row=ot}var wt=ma(e,null,dt,-1,st,ht,mt.preamble===null?null:mt.preamble.fallback,mt.fallbackState,pt,[n[0],`Suspense Fallback`,n[2]],Ue(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,va(t.componentStack));_a(wt),e.pingedTasks.push(wt)}}return}if(typeof r==`object`&&r)switch(r.$$typeof){case u:if(`ref`in i){var Tt={};for(var Et in i)Et!==`ref`&&(Tt[Et]=i[Et])}else Tt=i;Oa(e,t,n,Da(e,t,n,r.render,Tt,v),Ci!==0,wi,Ti);return;case p:ka(e,t,n,r.type,i,v);return;case l:var Dt=i.children,Ot=t.keyPath,kt=i.value,At=r._currentValue;r._currentValue=kt;var jt=qr,Mt={parent:jt,depth:jt===null?0:jt.depth+1,context:r,parentValue:At,value:kt};qr=Mt,t.context=Mt,t.keyPath=n,ja(e,t,Dt,-1);var Nt=qr;if(Nt===null)throw Error(`Tried to pop a Context at the root of the app. This is a bug in React.`);Nt.context._currentValue=Nt.parentValue,t.context=qr=Nt.parent,t.keyPath=Ot;return;case c:var Pt=i.children,Ft=Pt(r._context._currentValue),It=t.keyPath;t.keyPath=n,ja(e,t,Ft,-1),t.keyPath=It;return;case m:var Lt=r._init,zt=Lt(r._payload);if(e.aborted)throw null;ka(e,t,n,zt,i,v);return}throw Error(`Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: `+((r==null?r:typeof r)+`.`))}}function Aa(e,t,n,r,i){var a=t.replay,o=t.blockedBoundary,s=ga(e,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,za(e,t,r,i),s.status=1,Ja(e,o,s),o===null?e.completedRootSegment=s:(qa(o,s),o.parentFlushed&&e.partialBoundaries.push(o))}finally{t.replay=a,t.blockedSegment=null}}function ja(e,t,n,r){t.replay!==null&&typeof t.replay.slots==`number`?Aa(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,_a(t),Ma(e,t),t.componentStack=n)}function Ma(e,t){var n=t.node,a=t.childIndex;if(n!==null){if(typeof n==`object`){switch(n.$$typeof){case r:var o=n.type,s=n.key,c=n.props;n=c.ref;var u=n===void 0?null:n,f=Gr(o),p=s==null||s===w?a===-1?0:a:s;if(s=[t.keyPath,f,p],t.replay!==null)a:{var h=t.replay;for(a=h.nodes,n=0;n<a.length;n++){var g=a[n];if(p===g[1]){if(g.length===4){if(f!==null&&f!==g[0])throw Error(`Expected the resume to render <`+g[0]+`> in this slot but instead it rendered <`+f+`>. The tree doesn't match so React will fallback to client rendering.`);var _=g[2],v=g[3],y=t.node;t.replay={nodes:_,slots:v,pendingTasks:1};try{if(ka(e,t,s,o,c,u),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(`Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.`);t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===li||typeof r.then==`function`||r.message===`Maximum call stack size exceeded`))throw t.node===y?t.replay=h:a.splice(n,1),r;t.replay.pendingTasks--,s=ya(t.componentStack),y=e,c=t.blockedBoundary,e=e.aborted?e.fatalError:r,s=ba(y,e,s),Va(y,c,_,v,e,s)}t.replay=h}else{if(o!==d)throw Error(`Expected the resume to render <Suspense> in this slot but instead it rendered <`+(Gr(o)||`Unknown`)+`>. The tree doesn't match so React will fallback to client rendering.`);b:{h=g[5],o=g[2],u=g[3],f=g[4]===null?[]:g[4][2],g=g[4]===null?null:g[4][3],p=t.keyPath;var b=t.formatContext,x=t.row,S=t.replay,D=t.blockedBoundary,O=t.hoistableState,k=c.children;c=c.fallback;var A=new Set,j=pa(e,t.row,A,2>t.formatContext.insertionMode?{content:Re(),fallback:Re()}:null,!1);j.parentFlushed=!0,j.rootSegmentID=h,t.blockedBoundary=j,t.hoistableState=j.contentState,t.keyPath=s,t.formatContext=We(e.resumableState,b),t.row=null,t.replay={nodes:o,slots:u,pendingTasks:1};try{if(za(e,t,k,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(`Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.`);if(t.replay.pendingTasks--,j.pendingTasks===0&&j.status===0){j.status=1,e.completedBoundaries.push(j);break b}}catch(n){j.status=4,_=e.aborted?e.fatalError:n,v=ya(t.componentStack),y=ba(e,_,v),j.errorDigest=y,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(j)}finally{t.blockedBoundary=D,t.hoistableState=O,t.replay=S,t.keyPath=p,t.formatContext=b,t.row=x}_=ha(e,null,{nodes:f,slots:g,pendingTasks:0},c,-1,D,j.fallbackState,A,[s[0],`Suspense Fallback`,s[2]],Ue(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,va(t.componentStack)),_a(_),e.pingedTasks.push(_)}}a.splice(n,1);break a}}}else ka(e,t,s,o,c,u);return;case i:throw Error(`Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.`);case m:if(_=n._init,n=_(n._payload),e.aborted)throw null;ja(e,t,n,a);return}if(E(n)){Na(e,t,n,a);return}if((_=C(n))&&(_=_.call(n))){if(n=_.next(),!n.done){v=[];do v.push(n.value),n=_.next();while(!n.done);Na(e,t,v,a)}return}if(typeof n.then==`function`)return t.thenableState=null,ja(e,t,Wi(n),a);if(n.$$typeof===l)return ja(e,t,n._currentValue,a);throw a=Object.prototype.toString.call(n),Error(`Objects are not valid as a React child (found: `+(a===`[object Object]`?`object with keys {`+Object.keys(n).join(`, `)+`}`:a)+`). If you meant to render a collection of children, use an array instead.`)}typeof n==`string`?(a=t.blockedSegment,a!==null&&(a.lastPushedText=qe(a.chunks,n,e.renderState,a.lastPushedText))):(typeof n==`number`||typeof n==`bigint`)&&(a=t.blockedSegment,a!==null&&(a.lastPushedText=qe(a.chunks,``+n,e.renderState,a.lastPushedText)))}}function Na(e,t,n,r){var i=t.keyPath;if(r!==-1&&(t.keyPath=[t.keyPath,`Fragment`,r],t.replay!==null)){for(var a=t.replay,o=a.nodes,s=0;s<o.length;s++){var c=o[s];if(c[1]===r){r=c[2],c=c[3],t.replay={nodes:r,slots:c,pendingTasks:1};try{if(Na(e,t,n,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(`Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.`);t.replay.pendingTasks--}catch(i){if(typeof i==`object`&&i&&(i===li||typeof i.then==`function`))throw i;t.replay.pendingTasks--;var l=ya(t.componentStack);n=e;var u=t.blockedBoundary;e=e.aborted?e.fatalError:i,l=ba(n,e,l),Va(n,u,r,c,e,l)}t.replay=a,o.splice(s,1);break}}t.keyPath=i}else if(a=t.treeContext,o=n.length,t.replay!==null&&(s=t.replay.slots,typeof s==`object`&&s)){for(r=0;r<o;r++)c=n[r],t.treeContext=ri(a,o,r),u=s[r],typeof u==`number`?(Aa(e,t,u,c,r),delete s[r]):za(e,t,c,r);t.treeContext=a,t.keyPath=i}else{for(s=0;s<o;s++)r=n[s],t.treeContext=ri(a,o,s),za(e,t,r,s);t.treeContext=a,t.keyPath=i}}function Pa(e,t,n){n.status=5,n.rootSegmentID=e.nextSegmentId++;var r=n.tracked;if(r===null||(e=r.contentKeyPath,e===null))throw Error(`It should not be possible to postpone at the root. This is a bug in React.`);r=r.fallbackNode;var i=[],a=t.workingMap.get(e);return a===void 0?(n=[e[1],e[2],i,null,r,n.rootSegmentID],t.workingMap.set(e,n),vo(n,e[0],t),n):(a[4]=r,a[5]=n.rootSegmentID,a)}function Fa(e,t,n,r){r.status=5;var i=n.keyPath,a=n.blockedBoundary;if(a===null)r.id=e.nextSegmentId++,t.rootSlots=r.id,e.completedRootSegment!==null&&(e.completedRootSegment.status=5);else{if(a!==null&&a.status===0){var o=Pa(e,t,a);if(a.tracked!==null&&a.tracked.contentKeyPath===i&&n.childIndex===-1){r.id===-1&&(r.id=r.parentFlushed?a.rootSegmentID:e.nextSegmentId++),o[3]=r.id;return}}if(r.id===-1&&(r.id=r.parentFlushed&&a!==null?a.rootSegmentID:e.nextSegmentId++),n.childIndex===-1)i===null?t.rootSlots=r.id:(n=t.workingMap.get(i),n===void 0?(n=[i[1],i[2],[],r.id],vo(n,i[0],t)):n[3]=r.id);else{if(i===null){if(e=t.rootSlots,e===null)e=t.rootSlots={};else if(typeof e==`number`)throw Error(`It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React.`)}else if(a=t.workingMap,o=a.get(i),o===void 0)e={},o=[i[1],i[2],[],e],a.set(i,o),vo(o,i[0],t);else if(e=o[3],e===null)e=o[3]={};else if(typeof e==`number`)throw Error(`It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React.`);e[n.childIndex]=r.id}}}function Ia(e,t){e=e.trackedPostpones,e!==null&&(t=t.tracked,t!==null&&(t=t.contentKeyPath,t!==null&&(e=e.workingMap.get(t),e!==void 0&&(e.length=4,e[2]=[],e[3]=null))))}function La(e,t,n){return ha(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function Ra(e,t,n){var r=t.blockedSegment,i=ga(e,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(i),r.lastPushedText=!1,ma(e,n,t.node,t.childIndex,t.blockedBoundary,i,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function za(e,t,n,r){var i=t.formatContext,a=t.context,o=t.keyPath,s=t.treeContext,c=t.componentStack,l=t.blockedSegment;if(l===null){l=t.replay;try{return ja(e,t,n,r)}catch(u){if(Ii(),n=u===li?fi():u,!e.aborted&&typeof n==`object`&&n){if(typeof n.then==`function`){r=u===li?Fi():null,e=La(e,t,r).ping,n.then(e.resolve,e.reject),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,$r(a);return}if(n.message===`Maximum call stack size exceeded`){n=u===li?Fi():null,n=La(e,t,n),e.pingedTasks.push(n),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,$r(a);return}}}}else{var u=l.children.length,d=l.chunks.length;try{return ja(e,t,n,r)}catch(r){if(Ii(),l.children.length=u,l.chunks.length=d,n=r===li?fi():r,!e.aborted&&typeof n==`object`&&n){if(typeof n.then==`function`){l=n,n=r===li?Fi():null,e=Ra(e,t,n).ping,l.then(e.resolve,e.reject),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,$r(a);return}if(n.message===`Maximum call stack size exceeded`){l=r===li?Fi():null,l=Ra(e,t,l),e.pingedTasks.push(l),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,$r(a);return}}}}throw t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,$r(a),n}function Ba(e){var t=e.blockedBoundary,n=e.blockedSegment;n!==null&&(n.status=3,Ya(this,t,e.row,n))}function Va(e,t,n,r,i,a){for(var o=0;o<n.length;o++){var s=n[o];if(s.length===4)Va(e,t,s[2],s[3],i,a);else{s=s[5];var c=e,l=a,u=pa(c,null,new Set,null,!1);u.parentFlushed=!0,u.rootSegmentID=s,u.status=4,u.errorDigest=l,u.parentFlushed&&c.clientRenderedBoundaries.push(u)}}if(n.length=0,r!==null){if(t===null)throw Error(`We should not have any resumable nodes in the shell. This is a bug in React.`);if(t.status!==4&&(t.status=4,t.errorDigest=a,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),typeof r==`object`)for(var d in r)delete r[d]}}function Ha(e,t){if(e!==t.currentTask){var n=e.blockedBoundary;e=e.blockedSegment,e!==null&&(e.status=3),n!==null&&n.fallbackAbortableTasks.forEach(function(e){return Ha(e,t)})}}function Ua(e,t,n){if(e!==t.currentTask){var r=e.blockedBoundary,i=e.blockedSegment;if(i===null||i.status===3){var a=ya(e.componentStack),o=Oi(n);if(r===null){if(r=e.replay,r===null){o||t.trackedPostpones===null||i===null?o?(e=ki(n),ba(t,e,a),t.status!==12&&t.status!==13&&xa(t,e)):(ba(t,n,a),t.status!==12&&t.status!==13&&xa(t,n)):(r=t.trackedPostpones,ba(t,n,a),Fa(t,r,e,i),Ya(t,null,e.row,i));return}t.status!==12&&t.status!==13&&(r.pendingTasks--,r.pendingTasks===0&&0<r.nodes.length&&(a=ba(t,n,a),Va(t,null,r.nodes,r.slots,n,a)),t.pendingRootTasks--,t.pendingRootTasks===0&&Ga(t))}else{var s=t.trackedPostpones;if(r.status!==4){if(!o&&s!==null&&i!==null)return ba(t,n,a),Fa(t,s,e,i),r.fallbackAbortableTasks.forEach(function(e){return Ua(e,t,n)}),r.fallbackAbortableTasks.clear(),Ya(t,r,e.row,i);r.status=4,a=ba(t,n,a),r.errorDigest=a,Ia(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)}r.pendingTasks--,a=r.row,a!==null&&--a.pendingTasks===0&&Sa(t,a),r.fallbackAbortableTasks.forEach(function(e){return Ua(e,t,n)}),r.fallbackAbortableTasks.clear()}e=e.row,e!==null&&--e.pendingTasks===0&&Sa(t,e),t.allPendingTasks--,t.allPendingTasks===0&&Ka(t)}}}function Wa(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var i=n.headers;if(i){n.headers=null;var a=i.preconnects;if(i.fontPreloads&&(a&&(a+=`, `),a+=i.fontPreloads),i.highImagePreloads&&(a&&(a+=`, `),a+=i.highImagePreloads),!t){var o=n.styles.values(),s=o.next();b:for(;0<i.remainingCapacity&&!s.done;s=o.next())for(var c=s.value.sheets.values(),l=c.next();0<i.remainingCapacity&&!l.done;l=c.next()){var u=l.value,d=u.props,f=d.href,p=u.props,m=Mr(p.href,`style`,{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(i.remainingCapacity-=m.length+2))n.resets.style[f]=Se,a&&(a+=`, `),a+=m,n.resets.style[f]=typeof d.crossOrigin==`string`||typeof d.integrity==`string`?[d.crossOrigin,d.integrity]:Se;else break b}}r(a?{Link:a}:{})}}}catch(t){ba(e,t,{})}}function Ga(e){e.trackedPostpones===null&&Wa(e,!0),e.trackedPostpones===null&&$a(e),e=e.onShellReady,e()}function Ka(e){Wa(e,e.trackedPostpones===null||e.completedRootSegment===null||e.completedRootSegment.status!==5),$a(e),e=e.onAllReady,e()}function qa(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null&&t.children[0].id===-1){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status!==1&&n.status!==3&&n.status!==4||qa(e,n)}else e.completedSegments.push(t)}function Ja(e,t,n){if(ne!==null){n=n.chunks;for(var r=0,i=0;i<n.length;i++)r+=n[i].byteLength;t===null?e.byteSize+=r:t.byteSize+=r}}function Ya(e,t,n,r){if(n!==null&&(--n.pendingTasks===0?Sa(e,n):n.together&&wa(e,n)),e.allPendingTasks--,t===null){if(r!==null&&r.parentFlushed){if(e.completedRootSegment!==null)throw Error(`There can only be one root segment. This is a bug in React.`);e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&Ga(e)}else if(t.pendingTasks--,t.status!==4){if(t.pendingTasks===0){if(t.status===0&&(t.status=1),r!==null&&r.parentFlushed&&(r.status===1||r.status===3)&&qa(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.status===1)n=t.row,n!==null&&zr(n.hoistables,t.contentState),ra(e,t)||(e.allPendingTasks++,t.fallbackAbortableTasks.forEach(Ba,e),t.fallbackAbortableTasks.clear(),n!==null&&--n.pendingTasks===0&&Sa(e,n),e.allPendingTasks--),e.pendingRootTasks===0&&e.trackedPostpones===null&&t.preamble!==null&&$a(e);else if(t.status===5&&(t=t.row,t!==null)){if(e.trackedPostpones!==null){n=e.trackedPostpones;var i=t.next;if(i!==null&&(r=i.boundaries,r!==null))for(i.boundaries=null,i=0;i<r.length;i++){var a=r[i];Pa(e,n,a),Ya(e,a,null,null)}}e.allPendingTasks++,--t.pendingTasks===0&&Sa(e,t),e.allPendingTasks--}}else r===null||!r.parentFlushed||r.status!==1&&r.status!==3||(qa(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)),t=t.row,t!==null&&t.together&&wa(e,t)}e.allPendingTasks===0&&Ka(e)}function Xa(e){if(!(e.aborted||11<e.status)){var t=qr,n=ve.H;ve.H=Ki;var r=ve.A;ve.A=Ji;var i=ua;ua=e;var a=qi;qi=e.resumableState;try{for(var o=e.pingedTasks,s=0;s<o.length;s++){var c=o[s],l=e,u=c.blockedSegment;if(u===null){a:if(c.replay.pendingTasks!==0){var d=l.currentTask;l.currentTask=c,$r(c.context);var f=c.node;try{if(typeof c.replay.slots==`number`?Aa(l,c,c.replay.slots,c.node,c.childIndex):Ma(l,c),c.replay.pendingTasks===1&&0<c.replay.nodes.length)throw Error(`Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.`);c.replay.pendingTasks--,c.abortSet.delete(c),Ya(l,c.blockedBoundary,c.row,null)}catch(e){Ii();var p=e===li?fi():e;if(l.aborted){e===li&&(c.thenableState=Fi()),l.currentTask=d;var m=l;Ha(c,m),c.abortSet.delete(c),Ua(c,m,m.fatalError)}else{if(typeof p==`object`&&p){if(typeof p.then==`function`){var h=c.ping;p.then(h.resolve,h.reject),c.thenableState=e===li?Fi():null;break a}if(p.message===`Maximum call stack size exceeded`&&c.node!==f){c.thenableState=null,l.pingedTasks.push(c);break a}}c.replay.pendingTasks--,c.abortSet.delete(c);var g=ya(c.componentStack);m=l;var _=c.blockedBoundary,v=l.aborted?l.fatalError:p,y=c.replay.nodes,b=c.replay.slots,x=ba(m,v,g);Va(m,_,y,b,v,x),l.pendingRootTasks--,l.pendingRootTasks===0&&Ga(l),l.allPendingTasks--,l.allPendingTasks===0&&Ka(l)}}finally{l.currentTask=d}}}else a:if(m=u,m.status===0){var S=l.currentTask;l.currentTask=c,$r(c.context);var C=m.children.length,w=m.chunks.length,E=c.node;try{Ma(l,c),m.lastPushedText&&m.textEmbedded&&m.chunks.push(Ke),c.abortSet.delete(c),m.status=1,Ja(l,c.blockedBoundary,m),Ya(l,c.blockedBoundary,c.row,m)}catch(e){Ii(),m.children.length=C,m.chunks.length=w;var D=e===li?fi():e;if(l.aborted)e===li&&(c.thenableState=Fi()),l.currentTask=S,m=l,Ha(c,m),c.abortSet.delete(c),Ua(c,m,m.fatalError);else{if(typeof D==`object`&&D){if(typeof D.then==`function`){m.status=0,c.thenableState=e===li?Fi():null;var O=c.ping;D.then(O.resolve,O.reject);break a}if(D.message===`Maximum call stack size exceeded`&&c.node!==E){m.status=0,c.thenableState=null,l.pingedTasks.push(c);break a}}var k=ya(c.componentStack);c.abortSet.delete(c),m.status=4;var A=c.blockedBoundary,j=c.row;if(j!==null&&--j.pendingTasks===0&&Sa(l,j),l.allPendingTasks--,A===null){if(Oi(D)){var M=ki(D);ba(l,M,k),xa(l,M)}else ba(l,D,k),xa(l,D)}else{var N=ba(l,D,k);if(A.pendingTasks--,A.status!==4){A.status=4,A.errorDigest=N,Ia(l,A);var P=A.row;P!==null&&(l.allPendingTasks++,--P.pendingTasks===0&&Sa(l,P),l.allPendingTasks--),A.parentFlushed&&l.clientRenderedBoundaries.push(A),l.pendingRootTasks===0&&l.trackedPostpones===null&&A.preamble!==null&&$a(l)}l.allPendingTasks===0&&Ka(l)}}}finally{l.currentTask=S}}}o.splice(0,s),e.destination!==null&&co(e,e.destination)}catch(t){ba(e,t,{}),xa(e,t)}finally{qi=a,ve.H=n,ve.A=r,n===Ki&&$r(t),ua=i}}}function Za(e,t,n){t.preambleChildren.length&&n.push(t.preambleChildren);for(var r=!1,i=0;i<t.children.length;i++)r=Qa(e,t.children[i],n)||r;return r}function Qa(e,t,n){var r=t.boundary;if(r===null)return Za(e,t,n);var i=r.preamble;if(i===null)return!1;switch(r.status){case 1:if(Vt(e.renderState,i.content),e.byteSize+=r.byteSize,t=r.completedSegments[0],!t)throw Error(`A previously unvisited boundary must have exactly one root segment. This is a bug in React.`);return Za(e,t,n);case 5:if(e.trackedPostpones!==null)return!0;case 4:if(t.status===1)return Vt(e.renderState,i.fallback),Za(e,t,n);default:return!0}}function $a(e){if(e.completedRootSegment&&e.completedPreambleSegments===null){var t=[],n=e.byteSize,r=Qa(e,e.completedRootSegment,t),i=e.renderState.preamble;!1===r||i.headChunks&&i.bodyChunks?e.completedPreambleSegments=t:e.byteSize=n}}function eo(e,t,n,r){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return r=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,P(t,Ut),P(t,e.placeholderPrefix),e=I(r.toString(16)),P(t,e),F(t,Wt);case 1:n.status=2;var i=!0,a=n.chunks,o=0;n=n.children;for(var s=0;s<n.length;s++){for(i=n[s];o<i.index;o++)P(t,a[o]);i=no(e,t,i,r)}for(;o<a.length-1;o++)P(t,a[o]);return o<a.length&&(i=F(t,a[o])),i;case 3:return!0;default:throw Error(`Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.`)}}var to=0;function no(e,t,n,r){var i=n.boundary;if(i===null)return eo(e,t,n,r);if(n.boundary=null,i.parentFlushed=!0,i.status===4){var a=i.row;a!==null&&--a.pendingTasks===0&&Sa(e,a),i=i.errorDigest,F(t,Xt),P(t,Qt),i!=null&&(P(t,en),P(t,I(pe(i))),P(t,$t)),F(t,tn),eo(e,t,n,r)}else if(i.status!==1)i.status===0&&(i.rootSegmentID=e.nextSegmentId++),0<i.completedSegments.length&&e.partialBoundaries.push(i),nn(t,e.renderState,i.rootSegmentID),r&&zr(r,i.fallbackState),eo(e,t,n,r);else if(!oo&&ra(e,i)&&(to+i.byteSize>e.progressiveChunkSize||Br(i.contentState,so)||i.defer))i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),nn(t,e.renderState,i.rootSegmentID),eo(e,t,n,r);else{if(to+=i.byteSize,r&&zr(r,i.contentState),n=i.row,n!==null&&ra(e,i)&&--n.pendingTasks===0&&Sa(e,n),F(t,qt),n=i.completedSegments,n.length!==1)throw Error(`A previously unvisited boundary must have exactly one root segment. This is a bug in React.`);no(e,t,n[0],r)}return F(t,Zt)}function ro(e,t,n,r){return Cn(t,e.renderState,n.parentFormatContext,n.id),no(e,t,n,r),wn(t,n.parentFormatContext)}function io(e,t,n){to=n.byteSize;for(var r=n.completedSegments,i=0;i<r.length;i++)ao(e,t,n,r[i]);r.length=0,r=n.row,r!==null&&ra(e,n)&&--r.pendingTasks===0&&Sa(e,r),rr(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,i=n.rootSegmentID,n=n.contentState;var a=e.stylesToHoist,o=!!(r.instructions&128);return e.stylesToHoist=!1,P(t,e.startInlineScript),P(t,pt),a?(!(r.instructions&4)&&(r.instructions|=4,P(t,Rn)),!(r.instructions&2)&&(r.instructions|=2,P(t,kn)),o&&!(r.instructions&256)&&(r.instructions|=256,P(t,An)),r.instructions&8?P(t,Nn):(r.instructions|=8,P(t,Mn))):(!(r.instructions&2)&&(r.instructions|=2,P(t,kn)),o&&!(r.instructions&256)&&(r.instructions|=256,P(t,An)),P(t,jn)),r=I(i.toString(16)),P(t,e.boundaryPrefix),P(t,r),P(t,Pn),P(t,e.segmentPrefix),P(t,r),a?(P(t,Fn),xr(t,n)):P(t,In),n=F(t,Ln),Ht(t,e)&&n}function ao(e,t,n,r){if(r.status===2)return!0;var i=n.contentState,a=r.id;if(a===-1){if((r.id=n.rootSegmentID)===-1)throw Error(`A root segment ID must have been assigned by now. This is a bug in React.`);return ro(e,t,r,i)}return a===n.rootSegmentID?ro(e,t,r,i):(ro(e,t,r,i),n=e.resumableState,e=e.renderState,P(t,e.startInlineScript),P(t,pt),n.instructions&1?P(t,En):(n.instructions|=1,P(t,Tn)),P(t,e.segmentPrefix),a=I(a.toString(16)),P(t,a),P(t,Dn),P(t,e.placeholderPrefix),P(t,a),t=F(t,On),t)}var oo=!1,so=!1;function co(e,t){M=new Uint8Array(4096),N=0;try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(r!==null){if(r.status===5)return;var i=e.completedPreambleSegments;if(i===null)return;to=e.byteSize;var a=e.resumableState,o=e.renderState,s=o.preamble,c=s.htmlChunks,l=s.headChunks,u;if(c){for(u=0;u<c.length;u++)P(t,c[u]);if(l)for(u=0;u<l.length;u++)P(t,l[u]);else P(t,It(`head`)),P(t,pt)}else if(l)for(u=0;u<l.length;u++)P(t,l[u]);var d=o.charsetChunks;for(u=0;u<d.length;u++)P(t,d[u]);d.length=0,o.preconnects.forEach(ir,t),o.preconnects.clear();var f=o.viewportChunks;for(u=0;u<f.length;u++)P(t,f[u]);f.length=0,o.fontPreloads.forEach(ir,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(ir,t),o.highImagePreloads.clear(),Ce=o,o.styles.forEach(fr,t),Ce=null;var p=o.importMapChunks;for(u=0;u<p.length;u++)P(t,p[u]);p.length=0,o.bootstrapScripts.forEach(ir,t),o.scripts.forEach(ir,t),o.scripts.clear(),o.bulkPreloads.forEach(ir,t),o.bulkPreloads.clear(),c||l||(a.instructions|=32);var m=o.hoistableChunks;for(u=0;u<m.length;u++)P(t,m[u]);for(a=m.length=0;a<i.length;a++){var h=i[a];for(o=0;o<h.length;o++)no(e,t,h[o],null)}var g=e.renderState.preamble,_=g.headChunks;(g.htmlChunks||_)&&P(t,Bt(`head`));var v=g.bodyChunks;if(v)for(i=0;i<v.length;i++)P(t,v[i]);so=!0,no(e,t,r,null),so=!1,e.completedRootSegment=null;var y=e.renderState;if(e.allPendingTasks!==0||e.clientRenderedBoundaries.length!==0||e.completedBoundaries.length!==0||e.trackedPostpones!==null&&(e.trackedPostpones.rootNodes.length!==0||e.trackedPostpones.rootSlots!==null)){var b=e.resumableState;if(!(b.instructions&64)){if(b.instructions|=64,P(t,y.startInlineScript),!(b.instructions&32)){b.instructions|=32;var x=`_`+b.idPrefix+`R_`;P(t,hr),P(t,I(pe(x))),P(t,nt)}P(t,pt),P(t,z),F(t,Te)}}Ht(t,y)}var S=e.renderState;r=0;var C=S.viewportChunks;for(r=0;r<C.length;r++)P(t,C[r]);C.length=0,S.preconnects.forEach(ir,t),S.preconnects.clear(),S.fontPreloads.forEach(ir,t),S.fontPreloads.clear(),S.highImagePreloads.forEach(ir,t),S.highImagePreloads.clear(),S.styles.forEach(mr,t),S.scripts.forEach(ir,t),S.scripts.clear(),S.bulkPreloads.forEach(ir,t),S.bulkPreloads.clear();var w=S.hoistableChunks;for(r=0;r<w.length;r++)P(t,w[r]);w.length=0;var E=e.clientRenderedBoundaries;for(n=0;n<E.length;n++){var D=E[n];S=t;var O=e.resumableState,k=e.renderState,A=D.rootSegmentID,j=D.errorDigest;P(S,k.startInlineScript),P(S,pt),O.instructions&4?P(S,Bn):(O.instructions|=4,P(S,zn)),P(S,k.boundaryPrefix),P(S,I(A.toString(16))),P(S,Vn),j!=null&&(P(S,Hn),j==null?P(S,Un):P(S,I(Kn(j))));var te=F(S,Wn);if(!te){e.destination=null,n++,E.splice(0,n);return}}E.splice(0,n);var L=e.completedBoundaries;for(n=0;n<L.length;n++)if(!io(e,t,L[n])){e.destination=null,n++,L.splice(0,n);return}L.splice(0,n),ee(t),M=new Uint8Array(4096),N=0,oo=!0;var ne=e.partialBoundaries;for(n=0;n<ne.length;n++){var re=ne[n];a:{E=e,D=t,to=re.byteSize;var ie=re.completedSegments;for(te=0;te<ie.length;te++)if(!ao(E,D,re,ie[te])){te++,ie.splice(0,te);var ae=!1;break a}ie.splice(0,te);var oe=re.row;oe!==null&&oe.together&&re.pendingTasks===1&&(oe.pendingTasks===1?Ca(E,oe,oe.hoistables):oe.pendingTasks--),ae=rr(D,re.contentState,E.renderState)}if(!ae){e.destination=null,n++,ne.splice(0,n);return}}ne.splice(0,n),oo=!1;var se=e.completedBoundaries;for(n=0;n<se.length;n++)if(!io(e,t,se[n])){e.destination=null,n++,se.splice(0,n);return}se.splice(0,n)}}finally{oo=!1,n=e.postponedState,n!==null&&(n.nextSegmentId=e.nextSegmentId),e.allPendingTasks===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0?(e.flushScheduled=!1,n=e.resumableState,n.hasBody&&P(t,Bt(`body`)),n.hasHtml&&P(t,Bt(`html`)),ee(t),ho(e),e.status=13,t.close(),e.destination=null):ee(t)}}function lo(e){e.flushScheduled=e.destination!==null,j(Hr?function(){return Ur.run(e,Xa,e)}:function(){return Xa(e)}),setTimeout(function(){e.status===10&&(e.status=11),e.trackedPostpones===null&&(Hr?Ur.run(e,uo,e):uo(e))},0)}function uo(e){Wa(e,e.pendingRootTasks===0)}function fo(e){!1===e.flushScheduled&&e.pingedTasks.length===0&&e.destination!==null&&(e.flushScheduled=!0,setTimeout(function(){var t=e.destination;t?co(e,t):e.flushScheduled=!1},0))}function po(e,t){if(e.status===12)e.status=13,e=e.fatalError,Oi(e)&&(e=ki(e)),re(t,e);else if(e.status!==13&&e.destination===null){e.destination=t;try{co(e,t)}catch(t){ba(e,t,{}),xa(e,t)}}}function mo(e,t){try{if(0<t.size){var n=e.fatalError;t.forEach(function(t){return Ua(t,e,n)}),t.clear()}e.destination!==null&&co(e,e.destination)}catch(t){ba(e,t,{}),xa(e,t)}}function ho(e){e=e.renderLifetimeController,e!==null&&e.abort(`The render ended.`)}function go(e,t){if(t.aborted)_o(e,t.reason);else{var n=new AbortController;e.renderLifetimeController=n,t.addEventListener(`abort`,function(){_o(e,t.reason)},{signal:n.signal})}}function _o(e,t){if(!(e.aborted||e.status!==11&&e.status!==10)){ho(e);var n=typeof t==`object`&&!!t&&t.$$typeof===x;e.aborted=!0,t=n?Di(t):t===void 0?Error(`The render was aborted by the server without a reason.`):typeof t==`object`&&t&&typeof t.then==`function`?Error(`The render was aborted by the server with a promise.`):t,e.fatalError=t;var r=e.abortableTasks;r.forEach(function(t){return Ha(t,e)}),setTimeout(function(){return mo(e,r)},0)}}function vo(e,t,n){if(t===null)n.rootNodes.push(e);else{var r=n.workingMap,i=r.get(t);i===void 0&&(i=[t[1],t[2],[],null],r.set(t,i),vo(i,t[0],n)),i[2].push(e)}}function yo(e){var t=e.trackedPostpones;if(t===null||t.rootNodes.length===0&&t.rootSlots===null)return e.trackedPostpones=null;var n=e.completedRootSegment===null||e.completedRootSegment.status!==5&&e.completedPreambleSegments!==null;if(n){var r=e.nextSegmentId,i=t.rootSlots,a=e.resumableState;a.bootstrapScriptContent=void 0,a.bootstrapScripts=void 0,a.bootstrapModules=void 0}else{r=0,i=-1,a=e.resumableState;var o=e.renderState;a.nextFormID=0,a.hasBody=!1,a.hasHtml=!1,a.unknownResources={font:o.resets.font},a.dnsResources=o.resets.dns,a.connectResources=o.resets.connect,a.imageResources=o.resets.image,a.styleResources=o.resets.style,a.scriptResources={},a.moduleUnknownResources={},a.moduleScriptResources={},a.instructions=0}return t={nextSegmentId:r,rootFormatContext:e.rootFormatContext,progressiveChunkSize:e.progressiveChunkSize,resumableState:e.resumableState,replayNodes:t.rootNodes,replaySlots:i},n&&(e.postponedState=t),t}function bo(){var e=t.version;if(e!==`19.3.0`)throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
|
|
37
|
+
- react: `+(e+`
|
|
38
|
+
- react-dom: 19.3.0
|
|
39
|
+
Learn more: https://react.dev/warnings/version-mismatch`))}bo(),bo(),e.prerender=function(e,t){return new Promise(function(n,r){var i=t?t.onHeaders:void 0,a;i&&(a=function(e){i(new Headers(e))});var o=Le(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),s=sa(e,o,Ie(o,void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,a,t?t.maxHeadersLength:void 0),Be(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,t?t.onBrowserBailout:void 0,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){po(s,e)},cancel:function(e){s.destination=null,_o(s,e)}},{highWaterMark:0});e={postponed:yo(s),prelude:e},n(e)},void 0,void 0,r);t&&t.signal&&go(s,t.signal),lo(s)})},e.renderToReadableStream=function(e,t){return new Promise(function(n,r){var i,a,o=new Promise(function(e,t){a=e,i=t}),s=t?t.onHeaders:void 0,c;s&&(c=function(e){s(new Headers(e))});var l=Le(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),u=oa(e,l,Ie(l,t?t.nonce:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,c,t?t.maxHeadersLength:void 0),Be(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,t?t.onBrowserBailout:void 0,a,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){po(u,e)},cancel:function(e){u.destination=null,_o(u,e)}},{highWaterMark:0});e.allReady=o,n(e)},function(e){o.catch(function(){}),r(e)},i,t?t.formState:void 0);t&&t.signal&&go(u,t.signal),lo(u)})},e.resume=function(e,t,n){return new Promise(function(r,i){var a,o,s=new Promise(function(e,t){o=e,a=t}),c=ca(e,t,Ie(t.resumableState,n?n.nonce:void 0,void 0,void 0,void 0,void 0),n?n.onError:void 0,n?n.onBrowserBailout:void 0,o,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){po(c,e)},cancel:function(e){c.destination=null,_o(c,e)}},{highWaterMark:0});e.allReady=s,r(e)},function(e){s.catch(function(){}),i(e)},a);n&&n.signal&&go(c,n.signal),lo(c)})},e.resumeAndPrerender=function(e,t,n){return new Promise(function(r,i){var a=la(e,t,Ie(t.resumableState,void 0,void 0,void 0,void 0,void 0),n?n.onError:void 0,n?n.onBrowserBailout:void 0,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){po(a,e)},cancel:function(e){a.destination=null,_o(a,e)}},{highWaterMark:0});e={postponed:yo(a),prelude:e},r(e)},void 0,void 0,i);n&&n.signal&&go(a,n.signal),lo(a)})},e.version=`19.3.0`})),wh=i((e=>{var t=b(),n=k();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=Symbol.for(`react.transitional.element`),a=Symbol.for(`react.portal`),o=Symbol.for(`react.fragment`),s=Symbol.for(`react.strict_mode`),c=Symbol.for(`react.profiler`),l=Symbol.for(`react.consumer`),u=Symbol.for(`react.context`),d=Symbol.for(`react.forward_ref`),f=Symbol.for(`react.suspense`),p=Symbol.for(`react.suspense_list`),m=Symbol.for(`react.memo`),h=Symbol.for(`react.lazy`),g=Symbol.for(`react.scope`),_=Symbol.for(`react.activity`),v=Symbol.for(`react.legacy_hidden`),y=Symbol.for(`react.memo_cache_sentinel`),x=Symbol.for(`react.view_transition`),S=Symbol.for(`react.recoverable`),C=Symbol.iterator;function w(e){return typeof e!=`object`||!e?null:(e=C&&e[C]||e[`@@iterator`],typeof e==`function`?e:null)}var E=Symbol.for(`react.optimistic_key`),D=Array.isArray;function O(e,t){var n=e.length&3,r=e.length-n,i=t;for(t=0;t<r;){var a=e.charCodeAt(t)&255|(e.charCodeAt(++t)&255)<<8|(e.charCodeAt(++t)&255)<<16|(e.charCodeAt(++t)&255)<<24;++t,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)|0,a=a<<15|a>>>17,a=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)|0,i^=a,i=i<<13|i>>>19,i=5*(i&65535)+((5*(i>>>16)&65535)<<16)|0,i=(i&65535)+27492+(((i>>>16)+58964&65535)<<16)}switch(a=0,n){case 3:a^=(e.charCodeAt(t+2)&255)<<16;case 2:a^=(e.charCodeAt(t+1)&255)<<8;case 1:a^=e.charCodeAt(t)&255,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)|0,a=a<<15|a>>>17,i^=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)|0}return i^=e.length,i^=i>>>16,i=2246822507*(i&65535)+((2246822507*(i>>>16)&65535)<<16)|0,i^=i>>>13,i=3266489909*(i&65535)+((3266489909*(i>>>16)&65535)<<16)|0,(i^i>>>16)>>>0}var A=Object.assign,j=Object.prototype.hasOwnProperty,M=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),N={},P={};function F(e){return j.call(P,e)?!0:j.call(N,e)?!1:M.test(e)?P[e]=!0:(N[e]=!0,!1)}var ee=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `)),te=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),I=/["'&<>]/;function L(e){if(typeof e==`boolean`||typeof e==`number`||typeof e==`bigint`)return``+e;e=``+e;var t=I.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.slice(i,r)),i=r+1,n+=t}e=i===r?n:n+e.slice(i,r)}return e}var ne=/([A-Z])/g,re=/^ms-/,ie=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ae(e){return ie.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}var oe=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=se.d;se.d={f:le.f,r:le.r,D:vt,C:yt,L:bt,m:xt,X:Ct,S:St,M:wt};var ue=[],de=null,fe=/(<\/|<)(s)(cript)/gi;function pe(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}function me(e,t,n,r,i){return{idPrefix:e===void 0?``:e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:i,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function he(e,t,n,r){return{insertionMode:e,selectedValue:t,tagScope:n,viewTransition:r}}function ge(e,t,n){var r=e.tagScope&-25;switch(t){case`noscript`:return he(2,null,r|1,null);case`select`:return he(2,n.value==null?n.defaultValue:n.value,r,null);case`svg`:return he(4,null,r,null);case`picture`:return he(2,null,r|2,null);case`math`:return he(5,null,r,null);case`foreignObject`:return he(2,null,r,null);case`table`:return he(6,null,r,null);case`thead`:case`tbody`:case`tfoot`:return he(7,null,r,null);case`colgroup`:return he(9,null,r,null);case`tr`:return he(8,null,r,null);case`head`:if(2>e.insertionMode)return he(3,null,r,null);break;case`html`:if(e.insertionMode===0)return he(1,null,r,null)}return 6<=e.insertionMode||2>e.insertionMode?he(2,null,r,null):e.viewTransition!==null||e.tagScope!==r?he(e.insertionMode,e.selectedValue,r,null):e}function _e(e){return e===null?null:{update:e.update,enter:`none`,exit:`none`,share:e.update,parentEnter:`none`,parentExit:`none`,name:e.autoName,autoName:e.autoName,nameIdx:0}}function ve(e,t){return t.tagScope&32&&(e.instructions|=128),he(t.insertionMode,t.selectedValue,t.tagScope|12,_e(t.viewTransition))}function ye(e,t){e=_e(t.viewTransition);var n=t.tagScope|16;return e!==null&&e.share!==`none`&&(n|=64),he(t.insertionMode,t.selectedValue,n,e)}function be(e,t,n){return e=`_`+e.idPrefix+`R_`+t,0<n&&(e+=`H`+n.toString(32)),e+`_`}function xe(e,t){t=t.viewTransition,t!==null&&(t.name!==`auto`&&(Te(e,`vt-name`,t.nameIdx===0?t.name:t.name+`_`+t.nameIdx),t.nameIdx++),Te(e,`vt-update`,t.update),t.enter!==`none`&&Te(e,`vt-enter`,t.enter),t.exit!==`none`&&Te(e,`vt-exit`,t.exit),t.share!==`none`&&Te(e,`vt-share`,t.share))}var Se=new Map;function Ce(e,t){if(typeof t!=`object`)throw Error(r(62));var n=!0,i;for(i in t)if(j.call(t,i)){var a=t[i];if(a!=null&&typeof a!=`boolean`&&a!==``){if(i.indexOf(`--`)===0){var o=L(i);a=L((``+a).trim())}else o=Se.get(i),o===void 0&&(o=L(i.replace(ne,`-$1`).toLowerCase().replace(re,`-ms-`)),Se.set(i,o)),a=typeof a==`number`?a===0||ee.has(i)?``+a:a+`px`:L((``+a).trim());n?(n=!1,e.push(` style="`,o,`:`,a)):e.push(`;`,o,`:`,a)}}n||e.push(`"`)}function we(e,t,n){n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`=""`)}function Te(e,t,n){typeof n!=`function`&&typeof n!=`symbol`&&typeof n!=`boolean`&&e.push(` `,t,`="`,L(n),`"`)}var Ee=L(`javascript:throw new Error('React form unexpectedly submitted.')`);function De(e,t){this.push(`<input type="hidden"`),Oe(e),Te(this,`name`,t),Te(this,`value`,e),this.push(`/>`)}function Oe(e){if(typeof e!=`string`)throw Error(r(480))}function ke(e,t){if(typeof t.$$FORM_ACTION==`function`){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);return r&&r.data?.forEach(Oe),r}catch(e){if(typeof e==`object`&&e&&typeof e.then==`function`)throw e}}return null}function Ae(e,t,n,r,i,a,o,s){var c=null;if(typeof r==`function`){var l=ke(t,r);l===null?(e.push(` `,`formAction`,`="`,Ee,`"`),o=a=i=r=s=null,Ne(t,n)):(s=l.name,r=l.action||``,i=l.encType,a=l.method,o=l.target,c=l.data)}return s!=null&&R(e,`name`,s),r!=null&&R(e,`formAction`,r),i!=null&&R(e,`formEncType`,i),a!=null&&R(e,`formMethod`,a),o!=null&&R(e,`formTarget`,o),c}function R(e,t,n){switch(t){case`className`:Te(e,`class`,n);break;case`tabIndex`:Te(e,`tabindex`,n);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Te(e,t,n);break;case`style`:Ce(e,n);break;case`src`:case`href`:if(n===``)break;case`action`:case`formAction`:if(n==null||typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=ae(``+n),e.push(` `,t,`="`,L(n),`"`);break;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`autoFocus`:case`multiple`:case`muted`:we(e,t.toLowerCase(),n);break;case`xlinkHref`:if(typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=ae(``+n),e.push(` `,`xlink:href`,`="`,L(n),`"`);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`="`,L(n),`"`);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`=""`);break;case`capture`:case`download`:!0===n?e.push(` `,t,`=""`):!1!==n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`="`,L(n),`"`);break;case`cols`:case`rows`:case`size`:case`span`:typeof n!=`function`&&typeof n!=`symbol`&&!isNaN(n)&&1<=n&&e.push(` `,t,`="`,L(n),`"`);break;case`rowSpan`:case`start`:typeof n==`function`||typeof n==`symbol`||isNaN(n)||e.push(` `,t,`="`,L(n),`"`);break;case`xlinkActuate`:Te(e,`xlink:actuate`,n);break;case`xlinkArcrole`:Te(e,`xlink:arcrole`,n);break;case`xlinkRole`:Te(e,`xlink:role`,n);break;case`xlinkShow`:Te(e,`xlink:show`,n);break;case`xlinkTitle`:Te(e,`xlink:title`,n);break;case`xlinkType`:Te(e,`xlink:type`,n);break;case`xmlBase`:Te(e,`xml:base`,n);break;case`xmlLang`:Te(e,`xml:lang`,n);break;case`xmlSpace`:Te(e,`xml:space`,n);break;default:if((!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`)&&(t=te.get(t)||t,F(t))){switch(typeof n){case`function`:case`symbol`:return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`)return}e.push(` `,t,`="`,L(n),`"`)}}}function je(e,t,n){if(t!=null){if(n!=null)throw Error(r(60));if(typeof t!=`object`||!(`__html`in t))throw Error(r(61));t=t.__html,t!=null&&e.push(``+t)}}function Me(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}function Ne(e,t){if(!(e.instructions&16)){e.instructions|=16;var n=t.preamble,r=t.bootstrapChunks;(n.htmlChunks||n.headChunks)&&r.length===0?(r.push(t.startInlineScript),mt(r,e),r.push(`>`,`addEventListener("submit",function(a){if(!a.defaultPrevented){var b=a.target,d=a.submitter,c=b.action,e=d;if(d){var f=d.getAttribute("formAction");null!=f&&(c=f,e=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===c&&(a.preventDefault(),a=new FormData(b,e),c=b.ownerDocument||b,(c.$$reactFormReplay=c.$$reactFormReplay||[]).push(b,d,a))}});`,`<\/script>`)):r.unshift(t.startInlineScript,`>`,`addEventListener("submit",function(a){if(!a.defaultPrevented){var b=a.target,d=a.submitter,c=b.action,e=d;if(d){var f=d.getAttribute("formAction");null!=f&&(c=f,e=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===c&&(a.preventDefault(),a=new FormData(b,e),c=b.ownerDocument||b,(c.$$reactFormReplay=c.$$reactFormReplay||[]).push(b,d,a))}});`,`<\/script>`)}}function Pe(e,t){for(var n in e.push(We(`link`)),t)if(j.call(t,n)){var i=t[n];if(i!=null)switch(n){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:R(e,n,i)}}return e.push(`/>`),null}var Fe=/(<\/|<)(s)(tyle)/gi;function Ie(e,t,n,r){return``+t+(n===`s`?`\\73 `:`\\53 `)+r}function Le(e,t,n,i){for(var a in e.push(We(n)),t)if(j.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,n));default:R(e,a,o)}}return xe(e,i),e.push(`/>`),null}function Re(e,t){e.push(We(`title`));var n=null,r=null,i;for(i in t)if(j.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:R(e,i,a)}}return e.push(`>`),t=Array.isArray(n)?2>n.length?n[0]:null:n,typeof t!=`function`&&typeof t!=`symbol`&&t!=null&&e.push(L(``+t)),je(e,r,n),e.push(qe(`title`)),null}function ze(e,t){e.push(We(`script`));var n=null,r=null,i;for(i in t)if(j.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:R(e,i,a)}}return e.push(`>`),je(e,r,n),typeof n==`string`&&e.push((``+n).replace(fe,pe)),e.push(qe(`script`)),null}function Be(e,t,n,r){e.push(We(n));var i=n=null,a;for(a in t)if(j.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:R(e,a,o)}}return xe(e,r),e.push(`>`),je(e,i,n),n}function Ve(e,t,n,r){e.push(We(n));var i=n=null,a;for(a in t)if(j.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:R(e,a,o)}}return xe(e,r),e.push(`>`),je(e,i,n),typeof n==`string`?(e.push(L(n)),null):n}var He=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ue=new Map;function We(e){var t=Ue.get(e);if(t===void 0){if(!He.test(e))throw Error(r(65,e));t=`<`+e,Ue.set(e,t)}return t}function Ge(e,t,n,i,a,o,s,c,l){switch(t){case`div`:case`span`:case`svg`:case`path`:break;case`a`:e.push(We(`a`));var u=null,d=null,f;for(f in n)if(j.call(n,f)){var p=n[f];if(p!=null)switch(f){case`children`:u=p;break;case`dangerouslySetInnerHTML`:d=p;break;case`href`:p===``?Te(e,`href`,``):R(e,f,p);break;default:R(e,f,p)}}if(xe(e,c),e.push(`>`),je(e,d,u),typeof u==`string`){e.push(L(u));var m=null}else m=u;return m;case`g`:case`p`:case`li`:break;case`select`:e.push(We(`select`));var h=null,g=null,_;for(_ in n)if(j.call(n,_)){var v=n[_];if(v!=null)switch(_){case`children`:h=v;break;case`dangerouslySetInnerHTML`:g=v;break;case`defaultValue`:case`value`:break;default:R(e,_,v)}}return xe(e,c),e.push(`>`),je(e,g,h),h;case`option`:var y=c.selectedValue;e.push(We(`option`));var b=null,x=null,S=null,C=null,w;for(w in n)if(j.call(n,w)){var E=n[w];if(E!=null)switch(w){case`children`:b=E;break;case`selected`:S=E;break;case`dangerouslySetInnerHTML`:C=E;break;case`value`:x=E;default:R(e,w,E)}}if(y!=null){var O=x===null?Me(b):``+x;if(D(y)){for(var k=0;k<y.length;k++)if(``+y[k]===O){e.push(` selected=""`);break}}else``+y===O&&e.push(` selected=""`)}else S&&e.push(` selected=""`);return e.push(`>`),je(e,C,b),b;case`textarea`:e.push(We(`textarea`));var M=null,N=null,P=null,ee;for(ee in n)if(j.call(n,ee)){var te=n[ee];if(te!=null)switch(ee){case`children`:P=te;break;case`value`:M=te;break;case`defaultValue`:N=te;break;case`dangerouslySetInnerHTML`:throw Error(r(91));default:R(e,ee,te)}}if(M===null&&N!==null&&(M=N),xe(e,c),e.push(`>`),P!=null){if(M!=null)throw Error(r(92));if(D(P)){if(1<P.length)throw Error(r(93));M=``+P[0]}M=``+P}return typeof M==`string`&&M[0]===`
|
|
40
|
+
`&&e.push(`
|
|
41
|
+
`),M!==null&&e.push(L(``+M)),null;case`input`:e.push(We(`input`));var I=null,ne=null,re=null,ie=null,oe=null,se=null,ce=null,le=null,de=null,fe;for(fe in n)if(j.call(n,fe)){var pe=n[fe];if(pe!=null)switch(fe){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`input`));case`name`:I=pe;break;case`formAction`:ne=pe;break;case`formEncType`:re=pe;break;case`formMethod`:ie=pe;break;case`formTarget`:oe=pe;break;case`defaultChecked`:de=pe;break;case`defaultValue`:ce=pe;break;case`checked`:le=pe;break;case`value`:se=pe;break;default:R(e,fe,pe)}}var me=Ae(e,i,a,ne,re,ie,oe,I);return le===null?de!==null&&we(e,`checked`,de):we(e,`checked`,le),se===null?ce!==null&&R(e,`value`,ce):R(e,`value`,se),xe(e,c),e.push(`/>`),me?.forEach(De,e),null;case`button`:e.push(We(`button`));var he=null,ge=null,_e=null,ve=null,ye=null,be=null,Se=null,Oe;for(Oe in n)if(j.call(n,Oe)){var He=n[Oe];if(He!=null)switch(Oe){case`children`:he=He;break;case`dangerouslySetInnerHTML`:ge=He;break;case`name`:_e=He;break;case`formAction`:ve=He;break;case`formEncType`:ye=He;break;case`formMethod`:be=He;break;case`formTarget`:Se=He;break;default:R(e,Oe,He)}}var Ue=Ae(e,i,a,ve,ye,be,Se,_e);if(xe(e,c),e.push(`>`),Ue?.forEach(De,e),je(e,ge,he),typeof he==`string`){e.push(L(he));var Ge=null}else Ge=he;return Ge;case`form`:e.push(We(`form`));var Ke=null,Je=null,Ye=null,Xe=null,Ze=null,Qe=null,$e;for($e in n)if(j.call(n,$e)){var et=n[$e];if(et!=null)switch($e){case`children`:Ke=et;break;case`dangerouslySetInnerHTML`:Je=et;break;case`action`:Ye=et;break;case`encType`:Xe=et;break;case`method`:Ze=et;break;case`target`:Qe=et;break;default:R(e,$e,et)}}var tt=null,nt=null;if(typeof Ye==`function`){var rt=ke(i,Ye);rt===null?(e.push(` `,`action`,`="`,Ee,`"`),Qe=Ze=Xe=Ye=null,Ne(i,a)):(Ye=rt.action||``,Xe=rt.encType,Ze=rt.method,Qe=rt.target,tt=rt.data,nt=rt.name)}if(Ye!=null&&R(e,`action`,Ye),Xe!=null&&R(e,`encType`,Xe),Ze!=null&&R(e,`method`,Ze),Qe!=null&&R(e,`target`,Qe),xe(e,c),e.push(`>`),nt!==null&&(e.push(`<input type="hidden"`),Te(e,`name`,nt),e.push(`/>`),tt?.forEach(De,e)),je(e,Je,Ke),typeof Ke==`string`){e.push(L(Ke));var it=null}else it=Ke;return it;case`menuitem`:for(var at in e.push(We(`menuitem`)),n)if(j.call(n,at)){var ot=n[at];if(ot!=null)switch(at){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(400));default:R(e,at,ot)}}return xe(e,c),e.push(`>`),null;case`object`:e.push(We(`object`));var st=null,ct=null,lt;for(lt in n)if(j.call(n,lt)){var ut=n[lt];if(ut!=null)switch(lt){case`children`:st=ut;break;case`dangerouslySetInnerHTML`:ct=ut;break;case`data`:var dt=ae(``+ut);if(dt===``)break;e.push(` `,`data`,`="`,L(dt),`"`);break;default:R(e,lt,ut)}}if(xe(e,c),e.push(`>`),je(e,ct,st),typeof st==`string`){e.push(L(st));var ft=null}else ft=st;return ft;case`title`:var pt=c.tagScope&1,mt=c.tagScope&4;if(c.insertionMode===4||pt||n.itemProp!=null)var ht=Re(e,n);else mt?ht=null:(Re(a.hoistableChunks,n),ht=void 0);return ht;case`link`:var gt=c.tagScope&1,_t=c.tagScope&4,vt=n.rel,yt=n.href,bt=n.precedence;if(c.insertionMode===4||gt||n.itemProp!=null||typeof vt!=`string`||typeof yt!=`string`||yt===``){Pe(e,n);var xt=null}else if(n.rel===`stylesheet`){if(typeof bt!=`string`||n.disabled!=null||n.onLoad||n.onError)xt=Pe(e,n);else{var St=a.styles.get(bt),Ct=i.styleResources.hasOwnProperty(yt)?i.styleResources[yt]:void 0;if(Ct!==null){i.styleResources[yt]=null,St||(St={precedence:L(bt),rules:[],hrefs:[],sheets:new Map},a.styles.set(bt,St));var wt={state:0,props:A({},n,{"data-precedence":n.precedence,precedence:null})};if(Ct){Ct.length===2&&Tt(wt.props,Ct);var Dt=a.preloads.stylesheets.get(yt);Dt&&0<Dt.length?Dt.length=0:wt.state=1}St.sheets.set(yt,wt),s&&s.stylesheets.add(wt)}else if(St){var Ot=St.sheets.get(yt);Ot&&s&&s.stylesheets.add(Ot)}l&&e.push(`<!-- -->`),xt=null}}else n.onLoad||n.onError?xt=Pe(e,n):(l&&e.push(`<!-- -->`),xt=_t?null:Pe(a.hoistableChunks,n));return xt;case`script`:var kt=c.tagScope&1,At=n.async;if(typeof n.src!=`string`||!n.src||!At||typeof At==`function`||typeof At==`symbol`||n.onLoad||n.onError||c.insertionMode===4||kt||n.itemProp!=null)var jt=ze(e,n);else{var Mt=n.src;if(n.type===`module`)var Nt=i.moduleScriptResources,Pt=a.preloads.moduleScripts;else Nt=i.scriptResources,Pt=a.preloads.scripts;var Ft=Nt.hasOwnProperty(Mt)?Nt[Mt]:void 0;if(Ft!==null){Nt[Mt]=null;var It=n;if(Ft){Ft.length===2&&(It=A({},n),Tt(It,Ft));var Lt=Pt.get(Mt);Lt&&(Lt.length=0)}var Rt=[];a.scripts.add(Rt),ze(Rt,It)}l&&e.push(`<!-- -->`),jt=null}return jt;case`style`:var zt=c.tagScope&1,Bt=n.precedence,Vt=n.href,Ht=n.nonce;if(c.insertionMode===4||zt||n.itemProp!=null||typeof Bt!=`string`||typeof Vt!=`string`||Vt===``){e.push(We(`style`));var z=null,Ut=null,Wt;for(Wt in n)if(j.call(n,Wt)){var Gt=n[Wt];if(Gt!=null)switch(Wt){case`children`:z=Gt;break;case`dangerouslySetInnerHTML`:Ut=Gt;break;default:R(e,Wt,Gt)}}e.push(`>`);var Kt=Array.isArray(z)?2>z.length?z[0]:null:z;typeof Kt!=`function`&&typeof Kt!=`symbol`&&Kt!=null&&e.push((``+Kt).replace(Fe,Ie)),je(e,Ut,z),e.push(qe(`style`));var qt=null}else{var Jt=a.styles.get(Bt);if((i.styleResources.hasOwnProperty(Vt)?i.styleResources[Vt]:void 0)!==null){i.styleResources[Vt]=null,Jt||(Jt={precedence:L(Bt),rules:[],hrefs:[],sheets:new Map},a.styles.set(Bt,Jt));var Yt=a.nonce.style;if(!Yt||Yt===Ht){Jt.hrefs.push(L(Vt));var Xt=Jt.rules,Zt=null,Qt=null,$t;for($t in n)if(j.call(n,$t)){var en=n[$t];if(en!=null)switch($t){case`children`:Zt=en;break;case`dangerouslySetInnerHTML`:Qt=en}}var tn=Array.isArray(Zt)?2>Zt.length?Zt[0]:null:Zt;typeof tn!=`function`&&typeof tn!=`symbol`&&tn!=null&&Xt.push((``+tn).replace(Fe,Ie)),je(Xt,Qt,Zt)}}Jt&&s&&s.styles.add(Jt),l&&e.push(`<!-- -->`),qt=void 0}return qt;case`meta`:var nn=c.tagScope&1,rn=c.tagScope&4;if(c.insertionMode===4||nn||n.itemProp!=null)var B=Le(e,n,`meta`,c);else l&&e.push(`<!-- -->`),B=rn?null:typeof n.charSet==`string`?Le(a.charsetChunks,n,`meta`,c):n.name===`viewport`?Le(a.viewportChunks,n,`meta`,c):Le(a.hoistableChunks,n,`meta`,c);return B;case`listing`:case`pre`:e.push(We(t));var an=null,on=null,sn;for(sn in n)if(j.call(n,sn)){var cn=n[sn];if(cn!=null)switch(sn){case`children`:an=cn;break;case`dangerouslySetInnerHTML`:on=cn;break;default:R(e,sn,cn)}}if(xe(e,c),e.push(`>`),on!=null){if(an!=null)throw Error(r(60));if(typeof on!=`object`||!(`__html`in on))throw Error(r(61));var ln=on.__html;ln!=null&&(typeof ln==`string`&&0<ln.length&&ln[0]===`
|
|
42
|
+
`?e.push(`
|
|
43
|
+
`,ln):e.push(``+ln))}return typeof an==`string`&&an[0]===`
|
|
44
|
+
`&&e.push(`
|
|
45
|
+
`),an;case`img`:var un=c.tagScope&3,dn=n.src,fn=n.srcSet;if(!(n.loading===`lazy`||!dn&&!fn||typeof dn!=`string`&&dn!=null||typeof fn!=`string`&&fn!=null||n.fetchPriority===`low`||un)&&(typeof dn!=`string`||dn[4]!==`:`||dn[0]!==`d`&&dn[0]!==`D`||dn[1]!==`a`&&dn[1]!==`A`||dn[2]!==`t`&&dn[2]!==`T`||dn[3]!==`a`&&dn[3]!==`A`)&&(typeof fn!=`string`||fn[4]!==`:`||fn[0]!==`d`&&fn[0]!==`D`||fn[1]!==`a`&&fn[1]!==`A`||fn[2]!==`t`&&fn[2]!==`T`||fn[3]!==`a`&&fn[3]!==`A`)){s!==null&&c.tagScope&64&&(s.suspenseyImages=!0);var pn=typeof n.sizes==`string`?n.sizes:void 0,mn=fn?fn+`
|
|
46
|
+
`+(pn||``):dn,hn=a.preloads.images,gn=hn.get(mn);if(gn)(n.fetchPriority===`high`||10>a.highImagePreloads.size)&&(hn.delete(mn),a.highImagePreloads.add(gn));else if(!i.imageResources.hasOwnProperty(mn)){i.imageResources[mn]=ue;var _n=n.crossOrigin,vn=typeof _n==`string`?_n===`use-credentials`?_n:``:void 0,yn=a.headers,bn;yn&&0<yn.remainingCapacity&&typeof n.srcSet!=`string`&&(n.fetchPriority===`high`||500>yn.highImagePreloads.length)&&(bn=Et(dn,`image`,{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:vn,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),0<=(yn.remainingCapacity-=bn.length+2))?(a.resets.image[mn]=ue,yn.highImagePreloads&&(yn.highImagePreloads+=`, `),yn.highImagePreloads+=bn):(gn=[],Pe(gn,{rel:`preload`,as:`image`,href:fn?void 0:dn,imageSrcSet:fn,imageSizes:pn,crossOrigin:vn,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),n.fetchPriority===`high`||10>a.highImagePreloads.size?a.highImagePreloads.add(gn):(a.bulkPreloads.add(gn),hn.set(mn,gn)))}}return Le(e,n,`img`,c);case`base`:case`area`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`param`:case`source`:case`track`:case`wbr`:return Le(e,n,t,c);case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:break;case`head`:if(2>c.insertionMode){var xn=o||a.preamble;if(xn.headChunks)throw Error(r(545,"`<head>`"));o!==null&&e.push(`<!--head-->`),xn.headChunks=[];var V=Be(xn.headChunks,n,`head`,c)}else V=Ve(e,n,`head`,c);return V;case`body`:if(2>c.insertionMode){var Sn=o||a.preamble;if(Sn.bodyChunks)throw Error(r(545,"`<body>`"));o!==null&&e.push(`<!--body-->`),Sn.bodyChunks=[];var Cn=Be(Sn.bodyChunks,n,`body`,c)}else Cn=Ve(e,n,`body`,c);return Cn;case`html`:if(c.insertionMode===0){var wn=o||a.preamble;if(wn.htmlChunks)throw Error(r(545,"`<html>`"));o!==null&&e.push(`<!--html-->`),wn.htmlChunks=[``];var Tn=Be(wn.htmlChunks,n,`html`,c)}else Tn=Ve(e,n,`html`,c);return Tn;default:if(t.indexOf(`-`)!==-1){e.push(We(t));var En=null,Dn=null,On;for(On in n)if(j.call(n,On)){var kn=n[On];if(kn!=null){var An=On;switch(On){case`children`:En=kn;break;case`dangerouslySetInnerHTML`:Dn=kn;break;case`style`:Ce(e,kn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`className`:An=`class`;default:if(F(On)&&typeof kn!=`function`&&typeof kn!=`symbol`&&!1!==kn){if(!0===kn)kn=``;else if(typeof kn==`object`)continue;e.push(` `,An,`="`,L(kn),`"`)}}}}return xe(e,c),e.push(`>`),je(e,Dn,En),En}}return Ve(e,n,t,c)}var Ke=new Map;function qe(e){var t=Ke.get(e);return t===void 0&&(t=`</`+e+`>`,Ke.set(e,t)),t}function Je(e,t){e=e.preamble,e.htmlChunks===null&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),e.headChunks===null&&t.headChunks&&(e.headChunks=t.headChunks),e.bodyChunks===null&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function Ye(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)e.push(t[n]);return n<t.length?(n=t[n],t.length=0,e.push(n)):!0}function Xe(e,t,n){if(e.push(`<!--$?--><template id="`),n===null)throw Error(r(395));return e.push(t.boundaryPrefix),t=n.toString(16),e.push(t),e.push(`"></template>`)}function Ze(e,t,n,i){switch(n.insertionMode){case 0:case 1:case 3:case 2:return e.push(`<div hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 4:return e.push(`<svg aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 5:return e.push(`<math aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 6:return e.push(`<table hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 7:return e.push(`<table hidden><tbody id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 8:return e.push(`<table hidden><tr id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 9:return e.push(`<table hidden><colgroup id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);default:throw Error(r(397))}}function Qe(e,t){switch(t.insertionMode){case 0:case 1:case 3:case 2:return e.push(`</div>`);case 4:return e.push(`</svg>`);case 5:return e.push(`</math>`);case 6:return e.push(`</table>`);case 7:return e.push(`</tbody></table>`);case 8:return e.push(`</tr></table>`);case 9:return e.push(`</colgroup></table>`);default:throw Error(r(397))}}var $e=/[<\u2028\u2029]/g;function et(e){return JSON.stringify(e).replace($e,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var tt=/[&><\u2028\u2029]/g;function nt(e){return JSON.stringify(e).replace(tt,function(e){switch(e){case`&`:return`\\u0026`;case`>`:return`\\u003e`;case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var rt=!1,it=!0;function at(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(this.push(de.startInlineStyle),this.push(` media="not all" data-precedence="`),this.push(e.precedence),this.push(`" data-href="`);r<n.length-1;r++)this.push(n[r]),this.push(` `);for(this.push(n[r]),this.push(`">`),r=0;r<t.length;r++)this.push(t[r]);it=this.push(`</style>`),rt=!0,t.length=0,n.length=0}}function ot(e){return e.state===2?!1:rt=!0}function st(e,t,n){return rt=!1,it=!0,de=n,t.styles.forEach(at,e),de=null,t.stylesheets.forEach(ot),rt&&(n.stylesToHoist=!0),it}function ct(e){for(var t=0;t<e.length;t++)this.push(e[t]);e.length=0}var lt=[];function ut(e){Pe(lt,e.props);for(var t=0;t<lt.length;t++)this.push(lt[t]);lt.length=0,e.state=2}function dt(e){var t=0<e.sheets.size;e.sheets.forEach(ut,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(this.push(de.startInlineStyle),this.push(` data-precedence="`),this.push(e.precedence),e=0,r.length){for(this.push(`" data-href="`);e<r.length-1;e++)this.push(r[e]),this.push(` `);this.push(r[e])}for(this.push(`">`),e=0;e<n.length;e++)this.push(n[e]);this.push(`</style>`),n.length=0,r.length=0}}function ft(e){if(e.state===0){e.state=1;var t=e.props;for(Pe(lt,{rel:`preload`,as:`style`,href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<lt.length;e++)this.push(lt[e]);lt.length=0}}function pt(e){e.sheets.forEach(ft,this),e.sheets.clear()}function mt(e,t){!(t.instructions&32)&&(t.instructions|=32,e.push(` id="`,L(`_`+t.idPrefix+`R_`),`"`))}function ht(e,t){e.push(`[`);var n=`[`;t.stylesheets.forEach(function(t){if(t.state!==2){if(t.state===3)e.push(n),t=nt(``+t.props.href),e.push(t),e.push(`]`),n=`,[`;else{e.push(n);var i=t.props[`data-precedence`],a=t.props,o=ae(``+t.props.href);for(var s in o=nt(o),e.push(o),i=``+i,e.push(`,`),i=nt(i),e.push(i),a)if(j.call(a,s)&&(i=a[s],i!=null))switch(s){case`href`:case`rel`:case`precedence`:case`data-precedence`:break;case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:gt(e,s,i)}e.push(`]`),n=`,[`,t.state=3}}}),e.push(`]`)}function gt(e,t,n){var r=t.toLowerCase();switch(typeof n){case`function`:case`symbol`:return}switch(t){case`innerHTML`:case`dangerouslySetInnerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`style`:case`ref`:return;case`className`:r=`class`,t=``+n;break;case`hidden`:if(!1===n)return;t=``;break;case`src`:case`href`:n=ae(n),t=``+n;break;default:if(2<t.length&&(t[0]===`o`||t[0]===`O`)&&(t[1]===`n`||t[1]===`N`)||!F(t))return;t=``+n}e.push(`,`),r=nt(r),e.push(r),e.push(`,`),r=nt(t),e.push(r)}function _t(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function vt(e){var t=$n||null;if(t){var n=t.resumableState,r=t.renderState;if(typeof e==`string`&&e){if(!n.dnsResources.hasOwnProperty(e)){n.dnsResources[e]=null,n=r.headers;var i,a;(a=n&&0<n.remainingCapacity)&&(a=(i=`<`+(``+e).replace(Dt,Ot)+`>; rel=dns-prefetch`,0<=(n.remainingCapacity-=i.length+2))),a?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=`, `),n.preconnects+=i):(i=[],Pe(i,{href:e,rel:`dns-prefetch`}),r.preconnects.add(i))}Yr(t)}}else le.D(e)}function yt(e,t){var n=$n||null;if(n){var r=n.resumableState,i=n.renderState;if(typeof e==`string`&&e){var a=t===`use-credentials`?`credentials`:typeof t==`string`?`anonymous`:`default`;if(!r.connectResources[a].hasOwnProperty(e)){r.connectResources[a][e]=null,r=i.headers;var o,s;if(s=r&&0<r.remainingCapacity){if(s=`<`+(``+e).replace(Dt,Ot)+`>; rel=preconnect`,typeof t==`string`){var c=(``+t).replace(kt,At);s+=`; crossorigin="`+c+`"`}s=(o=s,0<=(r.remainingCapacity-=o.length+2))}s?(i.resets.connect[a][e]=null,r.preconnects&&(r.preconnects+=`, `),r.preconnects+=o):(a=[],Pe(a,{rel:`preconnect`,href:e,crossOrigin:t}),i.preconnects.add(a))}Yr(n)}}else le.C(e,t)}function bt(e,t,n){var r=$n||null;if(r){var i=r.resumableState,a=r.renderState;if(t&&e){switch(t){case`image`:if(n)var o=n.imageSrcSet,s=n.imageSizes,c=n.fetchPriority;var l=o?o+`
|
|
47
|
+
`+(s||``):e;if(i.imageResources.hasOwnProperty(l))return;i.imageResources[l]=ue,i=a.headers;var u;i&&0<i.remainingCapacity&&typeof o!=`string`&&c===`high`&&(u=Et(e,t,n),0<=(i.remainingCapacity-=u.length+2))?(a.resets.image[l]=ue,i.highImagePreloads&&(i.highImagePreloads+=`, `),i.highImagePreloads+=u):(i=[],Pe(i,A({rel:`preload`,href:o?void 0:e,as:t},n)),c===`high`?a.highImagePreloads.add(i):(a.bulkPreloads.add(i),a.preloads.images.set(l,i)));break;case`style`:if(i.styleResources.hasOwnProperty(e))return;o=[],Pe(o,A({rel:`preload`,href:e,as:t},n)),i.styleResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?ue:[n.crossOrigin,n.integrity],a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case`script`:if(i.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),Pe(o,A({rel:`preload`,href:e,as:t},n)),i.scriptResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?ue:[n.crossOrigin,n.integrity];break;default:if(i.unknownResources.hasOwnProperty(t)){if(o=i.unknownResources[t],o.hasOwnProperty(e))return}else o={},i.unknownResources[t]=o;if(o[e]=ue,(i=a.headers)&&0<i.remainingCapacity&&t===`font`&&(l=Et(e,t,n),0<=(i.remainingCapacity-=l.length+2)))a.resets.font[e]=ue,i.fontPreloads&&(i.fontPreloads+=`, `),i.fontPreloads+=l;else switch(i=[],e=A({rel:`preload`,href:e,as:t},n),Pe(i,e),t){case`font`:a.fontPreloads.add(i);break;default:a.bulkPreloads.add(i)}}Yr(r)}}else le.L(e,t,n)}function xt(e,t){var n=$n||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=t&&typeof t.as==`string`?t.as:`script`;switch(a){case`script`:if(r.moduleScriptResources.hasOwnProperty(e))return;a=[],r.moduleScriptResources[e]=!t||typeof t.crossOrigin!=`string`&&typeof t.integrity!=`string`?ue:[t.crossOrigin,t.integrity],i.preloads.moduleScripts.set(e,a);break;default:if(r.moduleUnknownResources.hasOwnProperty(a)){var o=r.moduleUnknownResources[a];if(o.hasOwnProperty(e))return}else o={},r.moduleUnknownResources[a]=o;a=[],o[e]=ue}Pe(a,A({rel:`modulepreload`,href:e},t)),i.bulkPreloads.add(a),Yr(n)}}else le.m(e,t)}function St(e,t,n){var r=$n||null;if(r){var i=r.resumableState,a=r.renderState;if(e){t||=`default`;var o=a.styles.get(t),s=i.styleResources.hasOwnProperty(e)?i.styleResources[e]:void 0;s!==null&&(i.styleResources[e]=null,o||(o={precedence:L(t),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,o)),t={state:0,props:A({rel:`stylesheet`,href:e,"data-precedence":t},n)},s&&(s.length===2&&Tt(t.props,s),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),o.sheets.set(e,t),Yr(r))}}else le.S(e,t,n)}function Ct(e,t){var n=$n||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;a!==null&&(r.scriptResources[e]=null,t=A({src:e,async:!0},t),a&&(a.length===2&&Tt(t,a),e=i.preloads.scripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),ze(e,t),Yr(n))}}else le.X(e,t)}function wt(e,t){var n=$n||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;a!==null&&(r.moduleScriptResources[e]=null,t=A({src:e,type:`module`,async:!0},t),a&&(a.length===2&&Tt(t,a),e=i.preloads.moduleScripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),ze(e,t),Yr(n))}}else le.M(e,t)}function Tt(e,t){e.crossOrigin??=t[0],e.integrity??=t[1]}function Et(e,t,n){for(var r in e=(``+e).replace(Dt,Ot),t=(``+t).replace(kt,At),t=`<`+e+`>; rel=preload; as="`+t+`"`,n)j.call(n,r)&&(e=n[r],typeof e==`string`&&(t+=`; `+r.toLowerCase()+`="`+(``+e).replace(kt,At)+`"`));return t}var Dt=/[<>\r\n]/g;function Ot(e){switch(e){case`<`:return`%3C`;case`>`:return`%3E`;case`
|
|
48
|
+
`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}var kt=/["';,\r\n]/g;function At(e){switch(e){case`"`:return`%22`;case`'`:return`%27`;case`;`:return`%3B`;case`,`:return`%2C`;case`
|
|
49
|
+
`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}function jt(e){this.styles.add(e)}function Mt(e){this.stylesheets.add(e)}function Nt(e,t){t.styles.forEach(jt,e),t.stylesheets.forEach(Mt,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function Pt(e,t){var n=e.idPrefix,r=[],i=e.bootstrapScriptContent,a=e.bootstrapScripts,o=e.bootstrapModules;i!==void 0&&(r.push(`<script`),mt(r,e),r.push(`>`,(``+i).replace(fe,pe),`<\/script>`)),i=n+`P:`;var s=n+`S:`;n+=`B:`;var c=new Set,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=new Set,h={images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map};if(a!==void 0)for(var g=0;g<a.length;g++){var _=a[g],v,y=void 0,b=void 0,x={rel:`preload`,as:`script`,fetchPriority:`low`,nonce:void 0};typeof _==`string`?x.href=v=_:(x.href=v=_.src,x.integrity=b=typeof _.integrity==`string`?_.integrity:void 0,x.crossOrigin=y=typeof _==`string`||_.crossOrigin==null?void 0:_.crossOrigin===`use-credentials`?`use-credentials`:``),_=e;var S=v;_.scriptResources[S]=null,_.moduleScriptResources[S]=null,_=[],Pe(_,x),f.add(_),r.push(`<script src="`,L(v),`"`),typeof b==`string`&&r.push(` integrity="`,L(b),`"`),typeof y==`string`&&r.push(` crossorigin="`,L(y),`"`),mt(r,e),r.push(` async=""><\/script>`)}if(o!==void 0)for(a=0;a<o.length;a++)x=o[a],y=v=void 0,b={rel:`modulepreload`,fetchPriority:`low`,nonce:void 0},typeof x==`string`?b.href=g=x:(b.href=g=x.src,b.integrity=y=typeof x.integrity==`string`?x.integrity:void 0,b.crossOrigin=v=typeof x==`string`||x.crossOrigin==null?void 0:x.crossOrigin===`use-credentials`?`use-credentials`:``),x=e,_=g,x.scriptResources[_]=null,x.moduleScriptResources[_]=null,x=[],Pe(x,b),f.add(x),r.push(`<script type="module" src="`,L(g),`"`),typeof y==`string`&&r.push(` integrity="`,L(y),`"`),typeof v==`string`&&r.push(` crossorigin="`,L(v),`"`),mt(r,e),r.push(` async=""><\/script>`);return{placeholderPrefix:i,segmentPrefix:s,boundaryPrefix:n,startInlineScript:`<script`,startInlineStyle:`<style`,preamble:{htmlChunks:null,headChunks:null,bodyChunks:null},externalRuntimeScript:null,bootstrapChunks:r,importMapChunks:[],onHeaders:void 0,headers:null,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:c,fontPreloads:l,highImagePreloads:u,styles:d,bootstrapScripts:f,scripts:p,bulkPreloads:m,preloads:h,nonce:{script:void 0,style:void 0},stylesToHoist:!1,generateStaticMarkup:t}}function Ft(e,t,n,r){return n.generateStaticMarkup?(e.push(L(t)),!1):(t===``?e=r:(r&&e.push(`<!-- -->`),e.push(L(t)),e=!0),e)}function It(e,t,n,r){t.generateStaticMarkup||n&&r&&e.push(`<!-- -->`)}var Lt=Function.prototype.bind,Rt=Symbol.for(`react.client.reference`);function zt(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Rt?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case o:return`Fragment`;case c:return`Profiler`;case s:return`StrictMode`;case f:return`Suspense`;case p:return`SuspenseList`;case _:return`Activity`;case x:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case a:return`Portal`;case u:return e.displayName||`Context`;case l:return(e._context.displayName||`Context`)+`.Consumer`;case d:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case m:return t=e.displayName||null,t===null?zt(e.type)||`Memo`:t;case h:t=e._payload,e=e._init;try{return zt(e(t))}catch{}}return null}var Bt={},Vt=null;function Ht(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(r(401))}else{if(n===null)throw Error(r(401));Ht(e,n)}t.context._currentValue2=t.value}}function z(e){e.context._currentValue2=e.parentValue,e=e.parent,e!==null&&z(e)}function Ut(e){var t=e.parent;t!==null&&Ut(t),e.context._currentValue2=e.value}function Wt(e,t){if(e.context._currentValue2=e.parentValue,e=e.parent,e===null)throw Error(r(402));e.depth===t.depth?Ht(e,t):Wt(e,t)}function Gt(e,t){var n=t.parent;if(n===null)throw Error(r(402));e.depth===n.depth?Ht(e,n):Gt(e,n),t.context._currentValue2=t.value}function Kt(e){var t=Vt;t!==e&&(t===null?Ut(e):e===null?z(t):t.depth===e.depth?Ht(t,e):t.depth>e.depth?Wt(t,e):Gt(t,e),Vt=e)}var qt={enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},Jt={id:1,overflow:``};function Yt(e){var t=e.overflow;return e=e.id,(e&~(1<<32-Zt(e)-1)).toString(32)+t}function Xt(e,t,n){var r=e.id;e=e.overflow;var i=32-Zt(r)-1;r&=~(1<<i),n+=1;var a=32-Zt(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-Zt(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var Zt=Math.clz32?Math.clz32:en,Qt=Math.log,$t=Math.LN2;function en(e){return e>>>=0,e===0?32:31-(Qt(e)/$t|0)|0}function tn(){}var nn=Error(r(460));function rn(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,e===void 0&&!(`reason`in t)?Error(r(600)):e;default:switch(typeof t.status==`string`?t.then(tn,tn):(e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason}throw B=t,nn}}var B=null;function an(){if(B===null)throw Error(r(459));var e=B;return B=null,e}function on(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var sn=typeof Object.is==`function`?Object.is:on,cn=null,ln=null,un=null,dn=null,fn=null,pn=null,mn=!1,hn=!1,gn=0,_n=0,vn=-1,yn=0,bn=null;function xn(e){if(e=e._reason,typeof e==`function`)try{var t=e()}catch{t=`The reason for browser-only rendering could not be determined because its initializer threw.`}else t=e;return t=Error(r(603),e===void 0?void 0:{cause:t}),Object.defineProperty(t,S,{value:!0}),t}function V(e){return typeof e!=`object`||!e?!1:!0===e[S]}function Sn(e){var t=Error(r(604),j.call(e,`cause`)?{cause:e.cause}:void 0);if(e=e.stack,e!==void 0){var n=e.indexOf(`
|
|
50
|
+
`);t.stack=t.name+`: `+t.message+(n===-1?``:e.slice(n))}else t.stack=void 0;return t}var Cn=null,wn=0;function Tn(){if(cn===null)throw Error(r(321));return cn}function En(){if(0<wn)throw Error(r(312));return{memoizedState:null,queue:null,next:null}}function Dn(){return pn===null?fn===null?(mn=!1,fn=pn=En()):(mn=!0,pn=fn):pn.next===null?(mn=!1,pn=pn.next=En()):(mn=!0,pn=pn.next),pn}function On(){var e=bn;return bn=null,e}function kn(){dn=un=ln=cn=null,hn=!1,fn=null,wn=0,pn=Cn=null}function An(e,t){return typeof t==`function`?t(e):t}function jn(e,t,n){if(cn=Tn(),pn=Dn(),mn){var r=pn.queue;if(t=r.dispatch,Cn!==null&&(n=Cn.get(r),n!==void 0)){Cn.delete(r),r=pn.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return pn.memoizedState=r,[r,t]}return[pn.memoizedState,t]}return e=e===An?typeof t==`function`?t():t:n===void 0?t:n(t),pn.memoizedState=e,e=pn.queue={last:null,dispatch:null},e=e.dispatch=Nn.bind(null,cn,e),[pn.memoizedState,e]}function Mn(e,t){if(cn=Tn(),pn=Dn(),t=t===void 0?null:t,pn!==null){var n=pn.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!sn(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),pn.memoizedState=[e,t],e}function Nn(e,t,n){if(25<=wn)throw Error(r(301));if(e===cn){if(hn=!0,e={action:n,next:null},Cn===null&&(Cn=new Map),n=Cn.get(t),n===void 0)Cn.set(t,e);else{for(t=n;t.next!==null;)t=t.next;t.next=e}}}function Pn(){throw Error(r(440))}function Fn(){throw Error(r(394))}function In(){throw Error(r(479))}function Ln(e,t,n){Tn();var r=_n++,i=un;if(typeof e.$$FORM_ACTION==`function`){var a=null,o=dn;i=i.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(i!==null&&typeof s==`function`){var c=i[1];s.call(e,i[2],i[3])&&(a=n===void 0?`k`+O(JSON.stringify([o,null,r]),0):`p`+n,c===a&&(vn=r,t=i[0]))}var l=e.bind(null,t);return e=function(e){l(e)},typeof l.$$FORM_ACTION==`function`&&(e.$$FORM_ACTION=function(e){e=l.$$FORM_ACTION(e),n!==void 0&&(n+=``,e.action=n);var t=e.data;return t&&(a===null&&(a=n===void 0?`k`+O(JSON.stringify([o,null,r]),0):`p`+n),t.append(`$ACTION_KEY`,a)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function Rn(e){var t=yn;return yn+=1,bn===null&&(bn=[]),rn(bn,e,t)}function zn(){throw Error(r(393))}var Bn={readContext:function(e){return e._currentValue2},use:function(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Rn(e);if(e.$$typeof===S)throw xn(e);if(e.$$typeof===u)return e._currentValue2}throw Error(r(438,String(e)))},useContext:function(e){return Tn(),e._currentValue2},useMemo:Mn,useReducer:jn,useRef:function(e){cn=Tn(),pn=Dn();var t=pn.memoizedState;return t===null?(e={current:e},pn.memoizedState=e):t},useState:function(e){return jn(An,e)},useInsertionEffect:tn,useLayoutEffect:tn,useCallback:function(e,t){return Mn(function(){return e},t)},useImperativeHandle:tn,useEffect:tn,useDebugValue:tn,useDeferredValue:function(e,t){return Tn(),t===void 0?e:t},useTransition:function(){return Tn(),[!1,Fn]},useId:function(){var e=Yt(ln.treeContext),t=Vn;if(t===null)throw Error(r(404));return be(t,e,gn++)},useSyncExternalStore:function(e,t,n){if(n===void 0)throw Error(r(407));return n()},useOptimistic:function(e){return Tn(),[e,In]},useActionState:Ln,useFormState:Ln,useHostTransitionStatus:function(){return Tn(),ce},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=y;return t},useCacheRefresh:function(){return zn},useEffectEvent:function(){return Pn}},Vn=null,Hn={getCacheForType:function(){throw Error(r(248))},cacheSignal:function(){throw Error(r(248))}},Un,Wn;function Gn(e){if(Un===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Un=t&&t[1]||``,Wn=-1<e.stack.indexOf(`
|
|
51
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
52
|
+
`+Un+e+Wn}var Kn=!1;function qn(e,t){if(!e||Kn)return``;Kn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
53
|
+
`),l=s.split(`
|
|
54
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
55
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Kn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Gn(n):``}function Jn(e){if(typeof e==`string`)return Gn(e);if(typeof e==`function`)return e.prototype&&e.prototype.isReactComponent?qn(e,!0):qn(e,!1);if(typeof e==`object`&&e){switch(e.$$typeof){case d:return qn(e.render,!1);case m:return qn(e.type,!1);case h:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch{return Gn(`Lazy`)}return Jn(e)}if(typeof e.name==`string`){a:{n=e.name,t=e.env;var r=e.debugLocation;if(r!=null&&(e=Error.prepareStackTrace,Error.prepareStackTrace=void 0,r=r.stack,Error.prepareStackTrace=e,r.startsWith(`Error: react-stack-top-frame
|
|
56
|
+
`)&&(r=r.slice(29)),e=r.indexOf(`
|
|
57
|
+
`),e!==-1&&(r=r.slice(e+1)),e=r.indexOf(`react_stack_bottom_frame`),e!==-1&&(e=r.lastIndexOf(`
|
|
58
|
+
`,e)),e=e===-1?``:r=r.slice(0,e),r=e.lastIndexOf(`
|
|
59
|
+
`),e=r===-1?e:e.slice(r+1),e.indexOf(n)!==-1)){n=`
|
|
60
|
+
`+e;break a}n=Gn(n+(t?` [`+t+`]`:``))}return n}}switch(e){case p:return Gn(`SuspenseList`);case f:return Gn(`Suspense`);case x:return Gn(`ViewTransition`)}return``}function Yn(e,t){return(500<t.byteSize||t.defer)&&t.preamble===null}function Xn(e){if(typeof e==`object`&&e&&typeof e.environmentName==`string`){var t=e.environmentName;e=[e].slice(0),typeof e[0]==`string`?e.splice(0,1,`[%s] `+e[0],` `+t+` `):e.splice(0,0,`[%s]`,` `+t+` `),e.unshift(console),t=Lt.apply(console.error,e),t()}else console.error(e);return null}function Zn(e,t,n,r,i,a,o,s,c,l,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=r===void 0?12800:r,this.status=10,this.fatalError=null,this.aborted=!1,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=d,this.pingedTasks=[],this.currentTask=null,this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.postponedState=this.trackedPostpones=null,this.onError=i===void 0?Xn:i,this.onBrowserBailout=a===void 0?tn:a,this.onAllReady=o===void 0?tn:o,this.onShellReady=s===void 0?tn:s,this.onShellError=c===void 0?tn:c,this.onFatalError=l===void 0?tn:l,this.renderLifetimeController=null,this.formState=u===void 0?null:u}function Qn(e,t,n,r,i,a,o,s,c,l,u,d){return t=new Zn(t,n,r,i,a,o,s,c,l,u,d),n=ir(t,0,null,r,!1,!1),n.parentFlushed=!0,e=nr(t,null,e,-1,null,n,null,null,t.abortableTasks,null,r,null,Jt,null,null),ar(e),t.pingedTasks.push(e),t}var $n=null;function er(e,t){e.pingedTasks.push(t),e.pingedTasks.length===1&&(e.flushScheduled=e.destination!==null,Lr(e))}function tr(e,t,n,r,i){return n={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,defer:i,fallbackAbortableTasks:n,errorDigest:null,contentState:_t(),fallbackState:_t(),preamble:r,tracked:null},t!==null&&(t.pendingTasks++,r=t.boundaries,r!==null&&(e.allPendingTasks++,n.pendingTasks++,r.push(n)),e=t.inheritedHoistables,e!==null&&Nt(n.contentState,e)),n}function nr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){e.allPendingTasks++,i===null?e.pendingRootTasks++:i.pendingTasks++,p!==null&&p.pendingTasks++;var h={replay:null,node:n,childIndex:r,ping:{resolve:function(){return er(e,h)},reject:function(t){e.aborted?h.abortSet.delete(h)&&jr(h,e,t):er(e,h)}},blockedBoundary:i,blockedSegment:a,blockedPreamble:o,hoistableState:s,abortSet:c,keyPath:l,formatContext:u,context:d,treeContext:f,row:p,componentStack:m,thenableState:t};return c.add(h),h}function rr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.allPendingTasks++,a===null?e.pendingRootTasks++:a.pendingTasks++,f!==null&&f.pendingTasks++,n.pendingTasks++;var m={replay:n,node:r,childIndex:i,ping:{resolve:function(){return er(e,m)},reject:function(t){e.aborted?m.abortSet.delete(m)&&jr(m,e,t):er(e,m)}},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:o,abortSet:s,keyPath:c,formatContext:l,context:u,treeContext:d,row:f,componentStack:p,thenableState:t};return s.add(m),m}function ir(e,t,n,r,i,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function ar(e){var t=e.node;if(typeof t==`object`&&t)switch(t.$$typeof){case i:e.componentStack={parent:e.componentStack,type:t.type}}}function or(e){return e===null?null:{parent:e.parent,type:`Suspense Fallback`}}function sr(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n=``,r=e;do n+=Jn(r.type),r=r.parent;while(r);var i=n}catch(e){i=`
|
|
61
|
+
Error generating stack: `+e.message+`
|
|
62
|
+
`+e.stack}return Object.defineProperty(t,"componentStack",{value:i}),i}}),t}function cr(e,t,n){if(V(t))return e=e.onBrowserBailout,e(t,n),``;if(e=e.onError,t=e(t,n),t==null||typeof t==`string`)return t===``?void 0:t}function lr(e,t){var n=e.onShellError,r=e.onFatalError;e.pendingRootTasks!==0&&n(t),r(t),Qr(e),e.destination===null?(e.status=12,e.aborted||(e.fatalError=t)):(e.status=13,e.destination.destroy(t))}function ur(e,t){dr(e,t.next,t.hoistables)}function dr(e,t,n){for(;t!==null;){n!==null&&(Nt(t.hoistables,n),t.inheritedHoistables=n);var r=t.boundaries;if(r!==null){t.boundaries=null;for(var i=0;i<r.length;i++){var a=r[i];n!==null&&Nt(a.contentState,n),Ir(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;n=t.hoistables,t=t.next}}function fr(e,t){var n=t.boundaries;if(n!==null&&t.pendingTasks===n.length){for(var r=!0,i=0;i<n.length;i++){var a=n[i];if(a.pendingTasks!==1||a.parentFlushed||Yn(e,a)){r=!1;break}}r&&dr(e,t,t.hoistables)}}function pr(e){var t={pendingTasks:1,boundaries:null,hoistables:_t(),inheritedHoistables:null,together:!1,next:null};return e!==null&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function mr(e,t,n,r,i){var a=t.keyPath,o=t.treeContext,s=t.row;t.keyPath=n,n=r.length;var c=null;if(t.replay!==null){var l=t.replay.slots;if(typeof l==`object`&&l)for(var u=0;u<n;u++){var d=i!==`backwards`&&i!==`unstable_legacy-backwards`?u:n-1-u,f=r[d];t.row=c=pr(c),t.treeContext=Xt(o,n,d);var p=l[d];typeof p==`number`?(vr(e,t,p,f,d),delete l[d]):Dr(e,t,f,d),--c.pendingTasks===0&&ur(e,c)}else for(l=0;l<n;l++)u=i!==`backwards`&&i!==`unstable_legacy-backwards`?l:n-1-l,d=r[u],t.row=c=pr(c),t.treeContext=Xt(o,n,u),Dr(e,t,d,u),--c.pendingTasks===0&&ur(e,c)}else if(i!==`backwards`&&i!==`unstable_legacy-backwards`)for(i=0;i<n;i++)l=r[i],t.row=c=pr(c),t.treeContext=Xt(o,n,i),Dr(e,t,l,i),--c.pendingTasks===0&&ur(e,c);else{for(l=t.blockedSegment,u=l.children.length,d=l.chunks.length,f=0;f<n;f++){p=i===`unstable_legacy-backwards`?n-1-f:f;var m=r[p];t.row=c=pr(c),t.treeContext=Xt(o,n,p);var h=ir(e,d,null,t.formatContext,p!==0||l.lastPushedText,!0);l.children.splice(u,0,h),t.blockedSegment=h;try{Dr(e,t,m,p),It(h.chunks,e.renderState,h.lastPushedText,h.textEmbedded),h.status=1,--c.pendingTasks===0&&ur(e,c)}catch(t){throw h.status=e.aborted?3:4,t}}t.blockedSegment=l,l.lastPushedText=!1}s!==null&&c!==null&&0<c.pendingTasks&&(s.pendingTasks++,c.next=s),t.treeContext=o,t.row=s,t.keyPath=a}function hr(e,t,n,r,i,a){var o=t.thenableState;for(t.thenableState=null,cn={},ln=t,un=e,dn=n,_n=gn=0,vn=-1,yn=0,bn=o,e=r(i,a);hn;)hn=!1,_n=gn=0,vn=-1,yn=0,wn+=1,pn=null,e=r(i,a);return kn(),e}function gr(e,t,n,r,i,a,o){var s=!1;if(a!==0&&e.formState!==null){var c=t.blockedSegment;if(c!==null){s=!0,c=c.chunks;for(var l=0;l<a;l++)l===o?c.push(`<!--F!-->`):c.push(`<!--F-->`)}}a=t.keyPath,t.keyPath=n,i?(n=t.treeContext,t.treeContext=Xt(n,1,0),Dr(e,t,r,-1),t.treeContext=n):s?Dr(e,t,r,-1):yr(e,t,r,-1),t.keyPath=a}function _r(e,t,n,i,a,y){if(typeof i==`function`){if(i.prototype&&i.prototype.isReactComponent){var b=a;if(`ref`in a)for(var S in b={},a)S!==`ref`&&(b[S]=a[S]);var C=i.defaultProps;if(C)for(var E in b===a&&(b=A({},b,a)),C)b[E]===void 0&&(b[E]=C[E]);var O=b,k=Bt,j=i.contextType;typeof j==`object`&&j&&(k=j._currentValue2);var M=new i(O,k),N=M.state===void 0?null:M.state;M.updater=qt,M.props=O,M.state=N;var P={queue:[],replace:!1};M._reactInternals=P;var F=i.contextType;M.context=typeof F==`object`&&F?F._currentValue2:Bt;var ee=i.getDerivedStateFromProps;if(typeof ee==`function`){var te=ee(O,N);M.state=te==null?N:A({},N,te)}if(typeof i.getDerivedStateFromProps!=`function`&&typeof M.getSnapshotBeforeUpdate!=`function`&&(typeof M.UNSAFE_componentWillMount==`function`||typeof M.componentWillMount==`function`)){var I=M.state;if(typeof M.componentWillMount==`function`&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount==`function`&&M.UNSAFE_componentWillMount(),I!==M.state&&qt.enqueueReplaceState(M,M.state,null),P.queue!==null&&0<P.queue.length){var L=P.queue,ne=P.replace;if(P.queue=null,P.replace=!1,ne&&L.length===1)M.state=L[0];else{for(var re=ne?L[0]:M.state,ie=!0,ae=+!!ne;ae<L.length;ae++){var oe=L[ae],se=typeof oe==`function`?oe.call(M,re,O,void 0):oe;se!=null&&(ie?(ie=!1,re=A({},re,se)):A(re,se))}M.state=re}}else P.queue=null}var ce=M.render();if(e.aborted)throw null;var le=t.keyPath;t.keyPath=n,yr(e,t,ce,-1),t.keyPath=le}else{var ue=hr(e,t,n,i,a,void 0);if(e.aborted)throw null;gr(e,t,n,ue,gn!==0,_n,vn)}}else if(typeof i==`string`){var de=t.blockedSegment;if(de===null){var fe=a.children,pe=t.formatContext,me=t.keyPath;t.formatContext=ge(pe,i,a),t.keyPath=n,Dr(e,t,fe,-1),t.formatContext=pe,t.keyPath=me}else{var he=Ge(de.chunks,i,a,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,de.lastPushedText);de.lastPushedText=!1;var _e=t.formatContext,xe=t.keyPath;if(t.keyPath=n,(t.formatContext=ge(_e,i,a)).insertionMode===3){var Se=ir(e,0,null,t.formatContext,!1,!1);de.preambleChildren.push(Se),t.blockedSegment=Se;try{Dr(e,t,he,-1),It(Se.chunks,e.renderState,Se.lastPushedText,Se.textEmbedded),Se.status=1}finally{t.blockedSegment=de}}else Dr(e,t,he,-1);t.formatContext=_e,t.keyPath=xe;a:{var Ce=de.chunks,we=e.resumableState;switch(i){case`title`:case`style`:case`script`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break a;case`body`:if(1>=_e.insertionMode){we.hasBody=!0;break a}break;case`html`:if(_e.insertionMode===0){we.hasHtml=!0;break a}break;case`head`:if(1>=_e.insertionMode)break a}Ce.push(qe(i))}de.lastPushedText=!1}}else{switch(i){case v:case s:case c:case o:var Te=t.keyPath;t.keyPath=n,yr(e,t,a.children,-1),t.keyPath=Te;return;case _:var Ee=t.blockedSegment;if(Ee===null){if(a.mode!==`hidden`){var De=t.keyPath;t.keyPath=n,Dr(e,t,a.children,-1),t.keyPath=De}}else if(a.mode!==`hidden`){e.renderState.generateStaticMarkup||Ee.chunks.push(`<!--&-->`),Ee.lastPushedText=!1;var Oe=t.keyPath;t.keyPath=n,Dr(e,t,a.children,-1),t.keyPath=Oe,e.renderState.generateStaticMarkup||Ee.chunks.push(`<!--/&-->`),Ee.lastPushedText=!1}return;case p:a:{var ke=a.children,Ae=a.revealOrder;if(Ae!==`independent`&&Ae!==`together`){if(D(ke)){mr(e,t,n,ke,Ae);break a}var R=w(ke);if(R){var je=R.call(ke);if(je){var Me=je.next();if(!Me.done){do Me=je.next();while(!Me.done);mr(e,t,n,ke,Ae)}break a}}}if(Ae===`together`){var Ne=t.keyPath,Pe=t.row,Fe=t.row=pr(null);Fe.boundaries=[],Fe.together=!0,t.keyPath=n,yr(e,t,ke,-1),--Fe.pendingTasks===0&&ur(e,Fe),t.keyPath=Ne,t.row=Pe,Pe!==null&&0<Fe.pendingTasks&&(Pe.pendingTasks++,Fe.next=Pe)}else{var Ie=t.keyPath;t.keyPath=n,yr(e,t,ke,-1),t.keyPath=Ie}}return;case x:var Le=t.formatContext,Re=t.keyPath,ze=e.resumableState;if((a.name==null||a.name===`auto`)&&be(ze,Yt(t.treeContext),0),t.formatContext=Le,t.keyPath=n,a.name!=null&&a.name!==`auto`)yr(e,t,a.children,-1);else{var Be=t.treeContext;t.treeContext=Xt(Be,1,0),Dr(e,t,a.children,-1),t.treeContext=Be}t.formatContext=Le,t.keyPath=Re;return;case g:throw Error(r(343));case f:a:if(t.replay!==null){var Ve=t.keyPath,He=t.formatContext,Ue=t.row;t.keyPath=n,t.formatContext=ye(e.resumableState,He),t.row=null;var We=a.children;try{Dr(e,t,We,-1)}finally{t.keyPath=Ve,t.formatContext=He,t.row=Ue}}else{var Ke=t.keyPath,Je=t.formatContext,Ye=t.row,Xe=t.blockedBoundary,Ze=t.blockedPreamble,Qe=t.hoistableState,$e=t.blockedSegment,et=a.fallback,tt=a.children,nt=new Set,rt=tr(e,t.row,nt,null,!1),it=ir(e,$e.chunks.length,rt,t.formatContext,!1,!1);$e.children.push(it),$e.lastPushedText=!1;var at=ir(e,0,null,t.formatContext,!1,!1);at.parentFlushed=!0;var ot=e.trackedPostpones;if(ot!==null){var st=t.componentStack,ct=[n[0],`Suspense Fallback`,n[2]];if(ot!==null){var lt=[ct[1],ct[2],[],null];ot.workingMap.set(ct,lt),rt.tracked={contentKeyPath:n,fallbackNode:lt}}t.blockedSegment=it,t.blockedPreamble=rt.preamble===null?null:rt.preamble.fallback,t.keyPath=ct,t.formatContext=ve(e.resumableState,Je),t.componentStack=or(st);try{Dr(e,t,et,-1),It(it.chunks,e.renderState,it.lastPushedText,it.textEmbedded),it.status=1}catch(t){throw it.status=e.aborted?3:4,t}finally{t.blockedSegment=$e,t.blockedPreamble=Ze,t.keyPath=Ke,t.formatContext=Je}var ut=nr(e,null,tt,-1,rt,at,rt.preamble===null?null:rt.preamble.content,rt.contentState,t.abortSet,n,ye(e.resumableState,t.formatContext),t.context,t.treeContext,null,st);ar(ut),e.pingedTasks.push(ut)}else{t.blockedBoundary=rt,t.blockedPreamble=rt.preamble===null?null:rt.preamble.content,t.hoistableState=rt.contentState,t.blockedSegment=at,t.keyPath=n,t.formatContext=ye(e.resumableState,Je),t.row=null;try{if(Dr(e,t,tt,-1),It(at.chunks,e.renderState,at.lastPushedText,at.textEmbedded),at.status=1,Fr(rt,at),rt.pendingTasks===0&&rt.status===0){if(rt.status=1,!Yn(e,rt)){Ye!==null&&--Ye.pendingTasks===0&&ur(e,Ye),e.pendingRootTasks===0&&t.blockedPreamble&&Br(e);break a}}else Ye!==null&&Ye.together&&fr(e,Ye)}catch(n){if(rt.status=4,e.aborted){at.status=3;var dt=e.fatalError}else at.status=4,dt=n;var ft=sr(t.componentStack);rt.errorDigest=cr(e,dt,ft),wr(e,rt)}finally{t.blockedBoundary=Xe,t.blockedPreamble=Ze,t.hoistableState=Qe,t.blockedSegment=$e,t.keyPath=Ke,t.formatContext=Je,t.row=Ye}var pt=nr(e,null,et,-1,Xe,it,rt.preamble===null?null:rt.preamble.fallback,rt.fallbackState,nt,[n[0],`Suspense Fallback`,n[2]],ve(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,or(t.componentStack));ar(pt),e.pingedTasks.push(pt)}}return}if(typeof i==`object`&&i)switch(i.$$typeof){case d:if(`ref`in a){var mt={};for(var ht in a)ht!==`ref`&&(mt[ht]=a[ht])}else mt=a;gr(e,t,n,hr(e,t,n,i.render,mt,y),gn!==0,_n,vn);return;case m:_r(e,t,n,i.type,a,y);return;case u:var gt=a.children,_t=t.keyPath,vt=a.value,yt=i._currentValue2;i._currentValue2=vt;var bt=Vt,xt={parent:bt,depth:bt===null?0:bt.depth+1,context:i,parentValue:yt,value:vt};Vt=xt,t.context=xt,t.keyPath=n,yr(e,t,gt,-1);var St=Vt;if(St===null)throw Error(r(403));St.context._currentValue2=St.parentValue,t.context=Vt=St.parent,t.keyPath=_t;return;case l:var Ct=a.children,wt=Ct(i._context._currentValue2),Tt=t.keyPath;t.keyPath=n,yr(e,t,wt,-1),t.keyPath=Tt;return;case h:var Et=i._init,Dt=Et(i._payload);if(e.aborted)throw null;_r(e,t,n,Dt,a,y);return}throw Error(r(130,i==null?i:typeof i,``))}}function vr(e,t,n,r,i){var a=t.replay,o=t.blockedBoundary,s=ir(e,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,Dr(e,t,r,i),s.status=1,o===null?e.completedRootSegment=s:(Fr(o,s),o.parentFlushed&&e.partialBoundaries.push(o))}finally{t.replay=a,t.blockedSegment=null}}function yr(e,t,n,r){t.replay!==null&&typeof t.replay.slots==`number`?vr(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,ar(t),br(e,t),t.componentStack=n)}function br(e,t){var n=t.node,o=t.childIndex;if(n!==null){if(typeof n==`object`){switch(n.$$typeof){case i:var s=n.type,c=n.key,l=n.props;n=l.ref;var d=n===void 0?null:n,p=zt(s),m=c==null||c===E?o===-1?0:o:c;if(c=[t.keyPath,p,m],t.replay!==null)a:{var g=t.replay;for(o=g.nodes,n=0;n<o.length;n++){var _=o[n];if(m===_[1]){if(_.length===4){if(p!==null&&p!==_[0])throw Error(r(490,_[0],p));var v=_[2],y=_[3],b=t.node;t.replay={nodes:v,slots:y,pendingTasks:1};try{if(_r(e,t,c,s,l,d),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===nn||typeof r.then==`function`||r.message===`Maximum call stack size exceeded`))throw t.node===b?t.replay=g:o.splice(n,1),r;t.replay.pendingTasks--,c=sr(t.componentStack),b=e,l=t.blockedBoundary,e=e.aborted?e.fatalError:r,c=cr(b,e,c),kr(b,l,v,y,e,c)}t.replay=g}else{if(s!==f)throw Error(r(490,`Suspense`,zt(s)||`Unknown`));b:{g=_[5],s=_[2],d=_[3],p=_[4]===null?[]:_[4][2],_=_[4]===null?null:_[4][3],m=t.keyPath;var x=t.formatContext,S=t.row,C=t.replay,O=t.blockedBoundary,k=t.hoistableState,A=l.children;l=l.fallback;var j=new Set,M=tr(e,t.row,j,null,!1);M.parentFlushed=!0,M.rootSegmentID=g,t.blockedBoundary=M,t.hoistableState=M.contentState,t.keyPath=c,t.formatContext=ye(e.resumableState,x),t.row=null,t.replay={nodes:s,slots:d,pendingTasks:1};try{if(Dr(e,t,A,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));if(t.replay.pendingTasks--,M.pendingTasks===0&&M.status===0){M.status=1,e.completedBoundaries.push(M);break b}}catch(n){M.status=4,v=e.aborted?e.fatalError:n,y=sr(t.componentStack),b=cr(e,v,y),M.errorDigest=b,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(M)}finally{t.blockedBoundary=O,t.hoistableState=k,t.replay=C,t.keyPath=m,t.formatContext=x,t.row=S}v=rr(e,null,{nodes:p,slots:_,pendingTasks:0},l,-1,O,M.fallbackState,j,[c[0],`Suspense Fallback`,c[2]],ve(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,or(t.componentStack)),ar(v),e.pingedTasks.push(v)}}o.splice(n,1);break a}}}else _r(e,t,c,s,l,d);return;case a:throw Error(r(257));case h:if(v=n._init,n=v(n._payload),e.aborted)throw null;yr(e,t,n,o);return}if(D(n)){xr(e,t,n,o);return}if((v=w(n))&&(v=v.call(n))){if(n=v.next(),!n.done){y=[];do y.push(n.value),n=v.next();while(!n.done);xr(e,t,y,o)}return}if(typeof n.then==`function`)return t.thenableState=null,yr(e,t,Rn(n),o);if(n.$$typeof===u)return yr(e,t,n._currentValue2,o);throw o=Object.prototype.toString.call(n),Error(r(31,o===`[object Object]`?`object with keys {`+Object.keys(n).join(`, `)+`}`:o))}typeof n==`string`?(o=t.blockedSegment,o!==null&&(o.lastPushedText=Ft(o.chunks,n,e.renderState,o.lastPushedText))):(typeof n==`number`||typeof n==`bigint`)&&(o=t.blockedSegment,o!==null&&(o.lastPushedText=Ft(o.chunks,``+n,e.renderState,o.lastPushedText)))}}function xr(e,t,n,i){var a=t.keyPath;if(i!==-1&&(t.keyPath=[t.keyPath,`Fragment`,i],t.replay!==null)){for(var o=t.replay,s=o.nodes,c=0;c<s.length;c++){var l=s[c];if(l[1]===i){i=l[2],l=l[3],t.replay={nodes:i,slots:l,pendingTasks:1};try{if(xr(e,t,n,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===nn||typeof r.then==`function`))throw r;t.replay.pendingTasks--;var u=sr(t.componentStack);n=e;var d=t.blockedBoundary;e=e.aborted?e.fatalError:r,u=cr(n,e,u),kr(n,d,i,l,e,u)}t.replay=o,s.splice(c,1);break}}t.keyPath=a}else if(o=t.treeContext,s=n.length,t.replay!==null&&(c=t.replay.slots,typeof c==`object`&&c)){for(i=0;i<s;i++)l=n[i],t.treeContext=Xt(o,s,i),d=c[i],typeof d==`number`?(vr(e,t,d,l,i),delete c[i]):Dr(e,t,l,i);t.treeContext=o,t.keyPath=a}else{for(c=0;c<s;c++)i=n[c],t.treeContext=Xt(o,s,c),Dr(e,t,i,c);t.treeContext=o,t.keyPath=a}}function Sr(e,t,n){n.status=5,n.rootSegmentID=e.nextSegmentId++;var i=n.tracked;if(i===null||(e=i.contentKeyPath,e===null))throw Error(r(486));i=i.fallbackNode;var a=[],o=t.workingMap.get(e);return o===void 0?(n=[e[1],e[2],a,null,i,n.rootSegmentID],t.workingMap.set(e,n),ei(n,e[0],t),n):(o[4]=i,o[5]=n.rootSegmentID,o)}function Cr(e,t,n,i){i.status=5;var a=n.keyPath,o=n.blockedBoundary;if(o===null)i.id=e.nextSegmentId++,t.rootSlots=i.id,e.completedRootSegment!==null&&(e.completedRootSegment.status=5);else{if(o!==null&&o.status===0){var s=Sr(e,t,o);if(o.tracked!==null&&o.tracked.contentKeyPath===a&&n.childIndex===-1){i.id===-1&&(i.id=i.parentFlushed?o.rootSegmentID:e.nextSegmentId++),s[3]=i.id;return}}if(i.id===-1&&(i.id=i.parentFlushed&&o!==null?o.rootSegmentID:e.nextSegmentId++),n.childIndex===-1)a===null?t.rootSlots=i.id:(n=t.workingMap.get(a),n===void 0?(n=[a[1],a[2],[],i.id],ei(n,a[0],t)):n[3]=i.id);else{if(a===null){if(e=t.rootSlots,e===null)e=t.rootSlots={};else if(typeof e==`number`)throw Error(r(491))}else if(o=t.workingMap,s=o.get(a),s===void 0)e={},s=[a[1],a[2],[],e],o.set(a,s),ei(s,a[0],t);else if(e=s[3],e===null)e=s[3]={};else if(typeof e==`number`)throw Error(r(491));e[n.childIndex]=i.id}}}function wr(e,t){e=e.trackedPostpones,e!==null&&(t=t.tracked,t!==null&&(t=t.contentKeyPath,t!==null&&(e=e.workingMap.get(t),e!==void 0&&(e.length=4,e[2]=[],e[3]=null))))}function Tr(e,t,n){return rr(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function Er(e,t,n){var r=t.blockedSegment,i=ir(e,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(i),r.lastPushedText=!1,nr(e,n,t.node,t.childIndex,t.blockedBoundary,i,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function Dr(e,t,n,r){var i=t.formatContext,a=t.context,o=t.keyPath,s=t.treeContext,c=t.componentStack,l=t.blockedSegment;if(l===null){l=t.replay;try{return yr(e,t,n,r)}catch(u){if(kn(),n=u===nn?an():u,!e.aborted&&typeof n==`object`&&n){if(typeof n.then==`function`){r=u===nn?On():null,e=Tr(e,t,r).ping,n.then(e.resolve,e.reject),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,Kt(a);return}if(n.message===`Maximum call stack size exceeded`){n=u===nn?On():null,n=Tr(e,t,n),e.pingedTasks.push(n),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,Kt(a);return}}}}else{var u=l.children.length,d=l.chunks.length;try{return yr(e,t,n,r)}catch(r){if(kn(),l.children.length=u,l.chunks.length=d,n=r===nn?an():r,!e.aborted&&typeof n==`object`&&n){if(typeof n.then==`function`){l=n,n=r===nn?On():null,e=Er(e,t,n).ping,l.then(e.resolve,e.reject),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,Kt(a);return}if(n.message===`Maximum call stack size exceeded`){l=r===nn?On():null,l=Er(e,t,l),e.pingedTasks.push(l),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,Kt(a);return}}}}throw t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,Kt(a),n}function Or(e){var t=e.blockedBoundary,n=e.blockedSegment;n!==null&&(n.status=3,Ir(this,t,e.row,n))}function kr(e,t,n,i,a,o){for(var s=0;s<n.length;s++){var c=n[s];if(c.length===4)kr(e,t,c[2],c[3],a,o);else{c=c[5];var l=e,u=o,d=tr(l,null,new Set,null,!1);d.parentFlushed=!0,d.rootSegmentID=c,d.status=4,d.errorDigest=u,d.parentFlushed&&l.clientRenderedBoundaries.push(d)}}if(n.length=0,i!==null){if(t===null)throw Error(r(487));if(t.status!==4&&(t.status=4,t.errorDigest=o,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),typeof i==`object`)for(var f in i)delete i[f]}}function Ar(e,t){if(e!==t.currentTask){var n=e.blockedBoundary;e=e.blockedSegment,e!==null&&(e.status=3),n!==null&&n.fallbackAbortableTasks.forEach(function(e){return Ar(e,t)})}}function jr(e,t,n){if(e!==t.currentTask){var r=e.blockedBoundary,i=e.blockedSegment;if(i===null||i.status===3){var a=sr(e.componentStack),o=V(n);if(r===null){if(r=e.replay,r===null){o||t.trackedPostpones===null||i===null?o?(e=Sn(n),cr(t,e,a),t.status!==12&&t.status!==13&&lr(t,e)):(cr(t,n,a),t.status!==12&&t.status!==13&&lr(t,n)):(r=t.trackedPostpones,cr(t,n,a),Cr(t,r,e,i),Ir(t,null,e.row,i));return}t.status!==12&&t.status!==13&&(r.pendingTasks--,r.pendingTasks===0&&0<r.nodes.length&&(a=cr(t,n,a),kr(t,null,r.nodes,r.slots,n,a)),t.pendingRootTasks--,t.pendingRootTasks===0&&Nr(t))}else{var s=t.trackedPostpones;if(r.status!==4){if(!o&&s!==null&&i!==null)return cr(t,n,a),Cr(t,s,e,i),r.fallbackAbortableTasks.forEach(function(e){return jr(e,t,n)}),r.fallbackAbortableTasks.clear(),Ir(t,r,e.row,i);r.status=4,a=cr(t,n,a),r.errorDigest=a,wr(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)}r.pendingTasks--,a=r.row,a!==null&&--a.pendingTasks===0&&ur(t,a),r.fallbackAbortableTasks.forEach(function(e){return jr(e,t,n)}),r.fallbackAbortableTasks.clear()}e=e.row,e!==null&&--e.pendingTasks===0&&ur(t,e),t.allPendingTasks--,t.allPendingTasks===0&&Pr(t)}}}function Mr(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var i=n.headers;if(i){n.headers=null;var a=i.preconnects;if(i.fontPreloads&&(a&&(a+=`, `),a+=i.fontPreloads),i.highImagePreloads&&(a&&(a+=`, `),a+=i.highImagePreloads),!t){var o=n.styles.values(),s=o.next();b:for(;0<i.remainingCapacity&&!s.done;s=o.next())for(var c=s.value.sheets.values(),l=c.next();0<i.remainingCapacity&&!l.done;l=c.next()){var u=l.value,d=u.props,f=d.href,p=u.props,m=Et(p.href,`style`,{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(i.remainingCapacity-=m.length+2))n.resets.style[f]=ue,a&&(a+=`, `),a+=m,n.resets.style[f]=typeof d.crossOrigin==`string`||typeof d.integrity==`string`?[d.crossOrigin,d.integrity]:ue;else break b}}r(a?{Link:a}:{})}}}catch(t){cr(e,t,{})}}function Nr(e){e.trackedPostpones===null&&Mr(e,!0),e.trackedPostpones===null&&Br(e),e=e.onShellReady,e()}function Pr(e){Mr(e,e.trackedPostpones===null||e.completedRootSegment===null||e.completedRootSegment.status!==5),Br(e),e=e.onAllReady,e()}function Fr(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null&&t.children[0].id===-1){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status!==1&&n.status!==3&&n.status!==4||Fr(e,n)}else e.completedSegments.push(t)}function Ir(e,t,n,i){if(n!==null&&(--n.pendingTasks===0?ur(e,n):n.together&&fr(e,n)),e.allPendingTasks--,t===null){if(i!==null&&i.parentFlushed){if(e.completedRootSegment!==null)throw Error(r(389));e.completedRootSegment=i}e.pendingRootTasks--,e.pendingRootTasks===0&&Nr(e)}else if(t.pendingTasks--,t.status!==4){if(t.pendingTasks===0){if(t.status===0&&(t.status=1),i!==null&&i.parentFlushed&&(i.status===1||i.status===3)&&Fr(t,i),t.parentFlushed&&e.completedBoundaries.push(t),t.status===1)n=t.row,n!==null&&Nt(n.hoistables,t.contentState),Yn(e,t)||(e.allPendingTasks++,t.fallbackAbortableTasks.forEach(Or,e),t.fallbackAbortableTasks.clear(),n!==null&&--n.pendingTasks===0&&ur(e,n),e.allPendingTasks--),e.pendingRootTasks===0&&e.trackedPostpones===null&&t.preamble!==null&&Br(e);else if(t.status===5&&(t=t.row,t!==null)){if(e.trackedPostpones!==null){n=e.trackedPostpones;var a=t.next;if(a!==null&&(i=a.boundaries,i!==null))for(a.boundaries=null,a=0;a<i.length;a++){var o=i[a];Sr(e,n,o),Ir(e,o,null,null)}}e.allPendingTasks++,--t.pendingTasks===0&&ur(e,t),e.allPendingTasks--}}else i===null||!i.parentFlushed||i.status!==1&&i.status!==3||(Fr(t,i),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)),t=t.row,t!==null&&t.together&&fr(e,t)}e.allPendingTasks===0&&Pr(e)}function Lr(e){if(!(e.aborted||11<e.status)){var t=Vt,n=oe.H;oe.H=Bn;var i=oe.A;oe.A=Hn;var a=$n;$n=e;var o=Vn;Vn=e.resumableState;try{for(var s=e.pingedTasks,c=0;c<s.length;c++){var l=s[c],u=e,d=l.blockedSegment;if(d===null){a:if(l.replay.pendingTasks!==0){var f=u.currentTask;u.currentTask=l,Kt(l.context);var p=l.node;try{if(typeof l.replay.slots==`number`?vr(u,l,l.replay.slots,l.node,l.childIndex):br(u,l),l.replay.pendingTasks===1&&0<l.replay.nodes.length)throw Error(r(488));l.replay.pendingTasks--,l.abortSet.delete(l),Ir(u,l.blockedBoundary,l.row,null)}catch(e){kn();var m=e===nn?an():e;if(u.aborted){e===nn&&(l.thenableState=On()),u.currentTask=f;var h=u;Ar(l,h),l.abortSet.delete(l),jr(l,h,h.fatalError)}else{if(typeof m==`object`&&m){if(typeof m.then==`function`){var g=l.ping;m.then(g.resolve,g.reject),l.thenableState=e===nn?On():null;break a}if(m.message===`Maximum call stack size exceeded`&&l.node!==p){l.thenableState=null,u.pingedTasks.push(l);break a}}l.replay.pendingTasks--,l.abortSet.delete(l);var _=sr(l.componentStack);h=u;var v=l.blockedBoundary,y=u.aborted?u.fatalError:m,b=l.replay.nodes,x=l.replay.slots,S=cr(h,y,_);kr(h,v,b,x,y,S),u.pendingRootTasks--,u.pendingRootTasks===0&&Nr(u),u.allPendingTasks--,u.allPendingTasks===0&&Pr(u)}}finally{u.currentTask=f}}}else a:if(h=d,h.status===0){var C=u.currentTask;u.currentTask=l,Kt(l.context);var w=h.children.length,E=h.chunks.length,D=l.node;try{br(u,l),It(h.chunks,u.renderState,h.lastPushedText,h.textEmbedded),l.abortSet.delete(l),h.status=1,Ir(u,l.blockedBoundary,l.row,h)}catch(e){kn(),h.children.length=w,h.chunks.length=E;var O=e===nn?an():e;if(u.aborted)e===nn&&(l.thenableState=On()),u.currentTask=C,h=u,Ar(l,h),l.abortSet.delete(l),jr(l,h,h.fatalError);else{if(typeof O==`object`&&O){if(typeof O.then==`function`){h.status=0,l.thenableState=e===nn?On():null;var k=l.ping;O.then(k.resolve,k.reject);break a}if(O.message===`Maximum call stack size exceeded`&&l.node!==D){h.status=0,l.thenableState=null,u.pingedTasks.push(l);break a}}var A=sr(l.componentStack);l.abortSet.delete(l),h.status=4;var j=l.blockedBoundary,M=l.row;if(M!==null&&--M.pendingTasks===0&&ur(u,M),u.allPendingTasks--,j===null){if(V(O)){var N=Sn(O);cr(u,N,A),lr(u,N)}else cr(u,O,A),lr(u,O)}else{var P=cr(u,O,A);if(j.pendingTasks--,j.status!==4){j.status=4,j.errorDigest=P,wr(u,j);var F=j.row;F!==null&&(u.allPendingTasks++,--F.pendingTasks===0&&ur(u,F),u.allPendingTasks--),j.parentFlushed&&u.clientRenderedBoundaries.push(j),u.pendingRootTasks===0&&u.trackedPostpones===null&&j.preamble!==null&&Br(u)}u.allPendingTasks===0&&Pr(u)}}}finally{u.currentTask=C}}}s.splice(0,c),e.destination!==null&&Jr(e,e.destination)}catch(t){cr(e,t,{}),lr(e,t)}finally{Vn=o,oe.H=n,oe.A=i,n===Bn&&Kt(t),$n=a}}}function Rr(e,t,n){t.preambleChildren.length&&n.push(t.preambleChildren);for(var r=!1,i=0;i<t.children.length;i++)r=zr(e,t.children[i],n)||r;return r}function zr(e,t,n){var i=t.boundary;if(i===null)return Rr(e,t,n);var a=i.preamble;if(a===null)return!1;switch(i.status){case 1:if(Je(e.renderState,a.content),e.byteSize+=i.byteSize,t=i.completedSegments[0],!t)throw Error(r(391));return Rr(e,t,n);case 5:if(e.trackedPostpones!==null)return!0;case 4:if(t.status===1)return Je(e.renderState,a.fallback),Rr(e,t,n);default:return!0}}function Br(e){if(e.completedRootSegment&&e.completedPreambleSegments===null){var t=[],n=e.byteSize,r=zr(e,e.completedRootSegment,t),i=e.renderState.preamble;!1===r||i.headChunks&&i.bodyChunks?e.completedPreambleSegments=t:e.byteSize=n}}function Vr(e,t,n,i){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return i=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,t.push(`<template id="`),t.push(e.placeholderPrefix),e=i.toString(16),t.push(e),t.push(`"></template>`);case 1:n.status=2;var a=!0,o=n.chunks,s=0;n=n.children;for(var c=0;c<n.length;c++){for(a=n[c];s<a.index;s++)t.push(o[s]);a=Ur(e,t,a,i)}for(;s<o.length-1;s++)t.push(o[s]);return s<o.length&&(a=t.push(o[s])),a;case 3:return!0;default:throw Error(r(390))}}var Hr=0;function Ur(e,t,n,i){var a=n.boundary;if(a===null)return Vr(e,t,n,i);if(n.boundary=null,a.parentFlushed=!0,a.status===4){var o=a.row;return o!==null&&--o.pendingTasks===0&&ur(e,o),e.renderState.generateStaticMarkup||(a=a.errorDigest,t.push(`<!--$!-->`),t.push(`<template`),a!=null&&(t.push(` data-dgst="`),a=L(a),t.push(a),t.push(`"`)),t.push(`></template>`)),Vr(e,t,n,i),e=e.renderState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}if(a.status!==1)return a.status===0&&(a.rootSegmentID=e.nextSegmentId++),0<a.completedSegments.length&&e.partialBoundaries.push(a),Xe(t,e.renderState,a.rootSegmentID),i&&Nt(i,a.fallbackState),Vr(e,t,n,i),t.push(`<!--/$-->`);if(!qr&&Yn(e,a)&&(Hr+a.byteSize>e.progressiveChunkSize||a.defer))return a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),Xe(t,e.renderState,a.rootSegmentID),Vr(e,t,n,i),t.push(`<!--/$-->`);if(Hr+=a.byteSize,i&&Nt(i,a.contentState),n=a.row,n!==null&&Yn(e,a)&&--n.pendingTasks===0&&ur(e,n),e.renderState.generateStaticMarkup||t.push(`<!--$-->`),n=a.completedSegments,n.length!==1)throw Error(r(391));return Ur(e,t,n[0],i),e=e.renderState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}function Wr(e,t,n,r){return Ze(t,e.renderState,n.parentFormatContext,n.id),Ur(e,t,n,r),Qe(t,n.parentFormatContext)}function Gr(e,t,n){Hr=n.byteSize;for(var r=n.completedSegments,i=0;i<r.length;i++)Kr(e,t,n,r[i]);r.length=0,r=n.row,r!==null&&Yn(e,n)&&--r.pendingTasks===0&&ur(e,r),st(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,i=n.rootSegmentID,n=n.contentState;var a=e.stylesToHoist,o=!!(r.instructions&128);return e.stylesToHoist=!1,t.push(e.startInlineScript),t.push(`>`),a?(!(r.instructions&4)&&(r.instructions|=4,t.push(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,null!=c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};`)),!(r.instructions&2)&&(r.instructions|=2,t.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
|
|
63
|
+
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),o&&!(r.instructions&256)&&(r.instructions|=256,t.push(`$RV=function(B,g){function h(a,c){var e=a.getAttribute(c);e&&(c=a.style,l.push(a,c.viewTransitionName,c.viewTransitionClass),"auto"!==e&&(c.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+N++ +"_"),a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,c.viewTransitionName=a,C=!0)}var C=!1,N=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var k=g[f].querySelectorAll("[vt-share]"),d=0;d<k.length;d++){var b=k[d];m.set(b.getAttribute("vt-name"),b)}var u=[];for(k=0;k<g.length;k+=2){var D=g[k],x=D.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){b=D;for(f=0;b;){if(8===b.nodeType){var t=b.data;if("/$"===t)if(0===f)break;else f--;else"$"!==t&&"$?"!==t&&"$~"!==t&&"$!"!==t||f++}else if(1===b.nodeType){d=b;var E=d.getAttribute("vt-name"),y=m.get(E);h(d,y?"vt-share":"vt-exit");y&&(h(y,"vt-share"),m.set(E,null));for(var F=d.querySelectorAll("[vt-share]"),
|
|
64
|
+
z=0;z<F.length;z++){var G=F[z],H=G.getAttribute("vt-name"),I=m.get(H);I&&(h(G,"vt-share"),h(I,"vt-share"),m.set(H,null))}var J=d.querySelectorAll("[vt-parent-exit]");for(d=0;d<J.length;d++)h(J[d],"vt-parent-exit")}b=b.nextSibling}for(var K=g[k+1],n=K.firstElementChild;n;){null!==m.get(n.getAttribute("vt-name"))&&h(n,"vt-enter");var L=n.querySelectorAll("[vt-parent-enter]");for(b=0;b<L.length;b++)h(L[b],"vt-parent-enter");n=n.nextElementSibling}b=x;do for(var p=b.firstElementChild;p;){var M=p.getAttribute("vt-update");
|
|
65
|
+
M&&"none"!==M&&!l.includes(p)&&h(p,"vt-update");p=p.nextElementSibling}while((b=b.parentNode)&&1===b.nodeType&&"none"!==b.getAttribute("vt-update"));u.push.apply(u,K.querySelectorAll('img[src]:not([loading="lazy"])'))}}}if(C){var A=document.__reactViewTransition=document.startViewTransition({update:function(){B(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],c={},e=0;e<u.length;c={g:c.g},e++)if(c.g=u[e],!c.g.complete){var q=c.g.getBoundingClientRect();0<q.bottom&&0<q.right&&
|
|
66
|
+
q.top<window.innerHeight&&q.left<window.innerWidth&&(q=new Promise(function(w){return function(r){w.g.addEventListener("load",r);w.g.addEventListener("error",r)}}(c)),a.push(q))}return Promise.race([Promise.all(a),new Promise(function(w){var r=performance.now();setTimeout(w,2300>r&&2E3<r?2300-r:500)})])},types:[]});A.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var c=l[a],e=c.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===c.getAttribute("style")&&c.removeAttribute("style")}});
|
|
67
|
+
A.finished.finally(function(){document.__reactViewTransition===A&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}B(g)}.bind(null,$RV);`)),r.instructions&8?t.push(`$RR("`):(r.instructions|=8,t.push(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
|
|
68
|
+
"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
|
|
69
|
+
"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`))):(!(r.instructions&2)&&(r.instructions|=2,t.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
|
|
70
|
+
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),o&&!(r.instructions&256)&&(r.instructions|=256,t.push(`$RV=function(B,g){function h(a,c){var e=a.getAttribute(c);e&&(c=a.style,l.push(a,c.viewTransitionName,c.viewTransitionClass),"auto"!==e&&(c.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+N++ +"_"),a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,c.viewTransitionName=a,C=!0)}var C=!1,N=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var k=g[f].querySelectorAll("[vt-share]"),d=0;d<k.length;d++){var b=k[d];m.set(b.getAttribute("vt-name"),b)}var u=[];for(k=0;k<g.length;k+=2){var D=g[k],x=D.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){b=D;for(f=0;b;){if(8===b.nodeType){var t=b.data;if("/$"===t)if(0===f)break;else f--;else"$"!==t&&"$?"!==t&&"$~"!==t&&"$!"!==t||f++}else if(1===b.nodeType){d=b;var E=d.getAttribute("vt-name"),y=m.get(E);h(d,y?"vt-share":"vt-exit");y&&(h(y,"vt-share"),m.set(E,null));for(var F=d.querySelectorAll("[vt-share]"),
|
|
71
|
+
z=0;z<F.length;z++){var G=F[z],H=G.getAttribute("vt-name"),I=m.get(H);I&&(h(G,"vt-share"),h(I,"vt-share"),m.set(H,null))}var J=d.querySelectorAll("[vt-parent-exit]");for(d=0;d<J.length;d++)h(J[d],"vt-parent-exit")}b=b.nextSibling}for(var K=g[k+1],n=K.firstElementChild;n;){null!==m.get(n.getAttribute("vt-name"))&&h(n,"vt-enter");var L=n.querySelectorAll("[vt-parent-enter]");for(b=0;b<L.length;b++)h(L[b],"vt-parent-enter");n=n.nextElementSibling}b=x;do for(var p=b.firstElementChild;p;){var M=p.getAttribute("vt-update");
|
|
72
|
+
M&&"none"!==M&&!l.includes(p)&&h(p,"vt-update");p=p.nextElementSibling}while((b=b.parentNode)&&1===b.nodeType&&"none"!==b.getAttribute("vt-update"));u.push.apply(u,K.querySelectorAll('img[src]:not([loading="lazy"])'))}}}if(C){var A=document.__reactViewTransition=document.startViewTransition({update:function(){B(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],c={},e=0;e<u.length;c={g:c.g},e++)if(c.g=u[e],!c.g.complete){var q=c.g.getBoundingClientRect();0<q.bottom&&0<q.right&&
|
|
73
|
+
q.top<window.innerHeight&&q.left<window.innerWidth&&(q=new Promise(function(w){return function(r){w.g.addEventListener("load",r);w.g.addEventListener("error",r)}}(c)),a.push(q))}return Promise.race([Promise.all(a),new Promise(function(w){var r=performance.now();setTimeout(w,2300>r&&2E3<r?2300-r:500)})])},types:[]});A.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var c=l[a],e=c.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===c.getAttribute("style")&&c.removeAttribute("style")}});
|
|
74
|
+
A.finished.finally(function(){document.__reactViewTransition===A&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}B(g)}.bind(null,$RV);`)),t.push(`$RC("`)),r=i.toString(16),t.push(e.boundaryPrefix),t.push(r),t.push(`","`),t.push(e.segmentPrefix),t.push(r),a?(t.push(`",`),ht(t,n)):t.push(`"`),n=t.push(`)<\/script>`),Ye(t,e)&&n}function Kr(e,t,n,i){if(i.status===2)return!0;var a=n.contentState,o=i.id;if(o===-1){if((i.id=n.rootSegmentID)===-1)throw Error(r(392));return Wr(e,t,i,a)}return o===n.rootSegmentID?Wr(e,t,i,a):(Wr(e,t,i,a),n=e.resumableState,e=e.renderState,t.push(e.startInlineScript),t.push(`>`),n.instructions&1?t.push(`$RS("`):(n.instructions|=1,t.push(`$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`)),t.push(e.segmentPrefix),o=o.toString(16),t.push(o),t.push(`","`),t.push(e.placeholderPrefix),t.push(o),t=t.push(`")<\/script>`),t)}var qr=!1;function Jr(e,t){try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(r!==null){if(r.status===5)return;var i=e.completedPreambleSegments;if(i===null)return;Hr=e.byteSize;var a=e.resumableState,o=e.renderState,s=o.preamble,c=s.htmlChunks,l=s.headChunks,u;if(c){for(u=0;u<c.length;u++)t.push(c[u]);if(l)for(u=0;u<l.length;u++)t.push(l[u]);else{var d=We(`head`);t.push(d),t.push(`>`)}}else if(l)for(u=0;u<l.length;u++)t.push(l[u]);var f=o.charsetChunks;for(u=0;u<f.length;u++)t.push(f[u]);f.length=0,o.preconnects.forEach(ct,t),o.preconnects.clear();var p=o.viewportChunks;for(u=0;u<p.length;u++)t.push(p[u]);p.length=0,o.fontPreloads.forEach(ct,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(ct,t),o.highImagePreloads.clear(),de=o,o.styles.forEach(dt,t),de=null;var m=o.importMapChunks;for(u=0;u<m.length;u++)t.push(m[u]);m.length=0,o.bootstrapScripts.forEach(ct,t),o.scripts.forEach(ct,t),o.scripts.clear(),o.bulkPreloads.forEach(ct,t),o.bulkPreloads.clear(),a.instructions|=32;var h=o.hoistableChunks;for(u=0;u<h.length;u++)t.push(h[u]);for(a=h.length=0;a<i.length;a++){var g=i[a];for(o=0;o<g.length;o++)Ur(e,t,g[o],null)}var _=e.renderState.preamble,v=_.headChunks;if(_.htmlChunks||v){var y=qe(`head`);t.push(y)}var b=_.bodyChunks;if(b)for(i=0;i<b.length;i++)t.push(b[i]);Ur(e,t,r,null),e.completedRootSegment=null;var x=e.renderState;if(e.allPendingTasks!==0||e.clientRenderedBoundaries.length!==0||e.completedBoundaries.length!==0||e.trackedPostpones!==null&&(e.trackedPostpones.rootNodes.length!==0||e.trackedPostpones.rootSlots!==null)){var S=e.resumableState;if(!(S.instructions&64)){if(S.instructions|=64,t.push(x.startInlineScript),!(S.instructions&32)){S.instructions|=32;var C=`_`+S.idPrefix+`R_`;t.push(` id="`);var w=L(C);t.push(w),t.push(`"`)}t.push(`>`),t.push(`requestAnimationFrame(function(){$RT=performance.now()});`),t.push(`<\/script>`)}}Ye(t,x)}var E=e.renderState;r=0;var D=E.viewportChunks;for(r=0;r<D.length;r++)t.push(D[r]);D.length=0,E.preconnects.forEach(ct,t),E.preconnects.clear(),E.fontPreloads.forEach(ct,t),E.fontPreloads.clear(),E.highImagePreloads.forEach(ct,t),E.highImagePreloads.clear(),E.styles.forEach(pt,t),E.scripts.forEach(ct,t),E.scripts.clear(),E.bulkPreloads.forEach(ct,t),E.bulkPreloads.clear();var O=E.hoistableChunks;for(r=0;r<O.length;r++)t.push(O[r]);O.length=0;var k=e.clientRenderedBoundaries;for(n=0;n<k.length;n++){var A=k[n];E=t;var j=e.resumableState,M=e.renderState,N=A.rootSegmentID,P=A.errorDigest;E.push(M.startInlineScript),E.push(`>`),j.instructions&4?E.push(`$RX("`):(j.instructions|=4,E.push(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,null!=c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("`)),E.push(M.boundaryPrefix);var F=N.toString(16);if(E.push(F),E.push(`"`),P!=null){if(E.push(`,`),P==null)E.push(`null`);else{var ee=et(P);E.push(ee)}}var te=E.push(`)<\/script>`);if(!te){e.destination=null,n++,k.splice(0,n);return}}k.splice(0,n);var I=e.completedBoundaries;for(n=0;n<I.length;n++)if(!Gr(e,t,I[n])){e.destination=null,n++,I.splice(0,n);return}I.splice(0,n),qr=!0;var ne=e.partialBoundaries;for(n=0;n<ne.length;n++){var re=ne[n];a:{k=e,A=t,Hr=re.byteSize;var ie=re.completedSegments;for(te=0;te<ie.length;te++)if(!Kr(k,A,re,ie[te])){te++,ie.splice(0,te);var ae=!1;break a}ie.splice(0,te);var oe=re.row;oe!==null&&oe.together&&re.pendingTasks===1&&(oe.pendingTasks===1?dr(k,oe,oe.hoistables):oe.pendingTasks--),ae=st(A,re.contentState,k.renderState)}if(!ae){e.destination=null,n++,ne.splice(0,n);return}}ne.splice(0,n),qr=!1;var se=e.completedBoundaries;for(n=0;n<se.length;n++)if(!Gr(e,t,se[n])){e.destination=null,n++,se.splice(0,n);return}se.splice(0,n)}}finally{qr=!1,n=e.postponedState,n!==null&&(n.nextSegmentId=e.nextSegmentId),e.allPendingTasks===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&(e.flushScheduled=!1,n=e.resumableState,n.hasBody&&(ne=qe(`body`),t.push(ne)),n.hasHtml&&(n=qe(`html`),t.push(n)),Qr(e),e.status=13,t.push(null),e.destination=null)}}function Yr(e){if(!1===e.flushScheduled&&e.pingedTasks.length===0&&e.destination!==null){e.flushScheduled=!0;var t=e.destination;t?Jr(e,t):e.flushScheduled=!1}}function Xr(e,t){if(e.status===12)e.status=13,e=e.fatalError,V(e)&&(e=Sn(e)),t.destroy(e);else if(e.status!==13&&e.destination===null){e.destination=t;try{Jr(e,t)}catch(t){cr(e,t,{}),lr(e,t)}}}function Zr(e,t){try{if(0<t.size){var n=e.fatalError;t.forEach(function(t){return jr(t,e,n)}),t.clear()}e.destination!==null&&Jr(e,e.destination)}catch(t){cr(e,t,{}),lr(e,t)}}function Qr(e){e=e.renderLifetimeController,e!==null&&e.abort(`The render ended.`)}function $r(e,t){if(!(e.aborted||e.status!==11&&e.status!==10)){Qr(e);var n=typeof t==`object`&&!!t&&t.$$typeof===S;e.aborted=!0,t=n?xn(t):t===void 0?Error(r(432)):typeof t==`object`&&t&&typeof t.then==`function`?Error(r(530)):t,e.fatalError=t,t=e.abortableTasks,t.forEach(function(t){return Ar(t,e)}),Zr(e,t)}}function ei(e,t,n){if(t===null)n.rootNodes.push(e);else{var r=n.workingMap,i=r.get(t);i===void 0&&(i=[t[1],t[2],[],null],r.set(t,i),ei(i,t[0],n)),i[2].push(e)}}function ti(){}function ni(e,t,n,i){var a=!1,o=null,s=``,c=!1;if(t=me(t?t.identifierPrefix:void 0),e=Qn(e,t,Pt(t,n),he(0,null,0,null),1/0,ti,void 0,void 0,function(){c=!0},void 0,void 0,void 0),e.flushScheduled=e.destination!==null,Lr(e),e.status===10&&(e.status=11),e.trackedPostpones===null&&Mr(e,e.pendingRootTasks===0),$r(e,i),Xr(e,{push:function(e){return e!==null&&(s+=e),!0},destroy:function(e){a=!0,o=e}}),a&&o!==i)throw o;if(!c)throw Error(r(426));return s}e.renderToStaticMarkup=function(e,t){return ni(e,t,!0,`The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.renderToString=function(e,t){return ni(e,t,!1,`The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.version=`19.3.0`})),Th=i((e=>{var t=Ch(),n=wh();e.version=t.version,e.renderToReadableStream=t.renderToReadableStream,e.renderToString=n.renderToString,e.renderToStaticMarkup=n.renderToStaticMarkup,e.resume=t.resume})),Eh=` daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! channel/|google/)google(?!(?:wv|app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!cam)scan|(?<!lib)http|24x7|;\\s\\w+;$|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+/1\\.0;|\\bbw/|\\bdlc\\b|\\bort/|\\bperl\\b|\\btime/|\\||^[<\\(;]|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[\\w\\-]+/[\\w]+$|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^blackbox exporter|^bot|^clamav[ /]|^claude-code/|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^exodusmovement|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\((?:compatible;)?(?:\\s?[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^ps_daily/|^python|^rank|^read|^reed|^remove\\.bg/|^rest|^rss|^snapchat|^sora |^space bison|^stape/|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|abuse|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|attracta|audit|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|collapsify\\b|convertify|cookiehubverify/|crawl|cursor/|cypress/|dareboost|datanyze|dejaclick|detect|discovery|dmbrowser|download|exaleadcloudview|feed|firephp|foregenix|functionize|grab|hardenize\\b|headless|hotjar|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|linktiger|mail\\.ru/|manager|manus-user/|marketgoo/|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|openvas|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|playwright|powermarks|preview|productfinder|prospectingstudio|proxy|ptst[ /]\\d|radar|readable/|retriever|rexx;|rigor|rss\\b|scrape|securityheaders|selenium|server|silktide|sindup/|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|testlocally|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|watchtowr|webglance|webkit2png|whatcms/|xtate/`,Dh=/bot|crawl|http|lighthouse|scan|search|spider/i,Oh;function kh(){if(Oh instanceof RegExp)return Oh;try{Oh=new RegExp(Eh,`i`)}catch{Oh=Dh}return Oh}var Ah=e=>typeof e==`string`&&e!==``;function jh(e){return Ah(e)&&kh().test(e)}var Mh=jh,Nh=e(Th(),1),Ph=async({request:e,router:t,responseHeaders:n,children:r})=>{let i=e.signal;if(i.aborted)throw t.serverSsr?.cleanup(),i.reason;let a=!1,o=Mh(e.headers.get(`User-Agent`)),s=e=>(t,n)=>{!a&&!i.aborted&&console.error(`Error in ${e}:`,t,n)};try{if(typeof Nh.renderToReadableStream==`function`){let e=await Nh.renderToReadableStream(r,{signal:i,nonce:t.options.ssr?.nonce,progressiveChunkSize:1/0,onError:s(`renderToReadableStream`)}),c=o?new AbortController:void 0,l=xh(t,e,{rendererSafePoint:`script-close`,signal:i,onAbort:e=>{a=!0,c?.abort(e)}});return c&&await Ve(e.allReady,c.signal),$m(t,new Response(l,{status:Qm(t),headers:n}))}if(typeof Nh.default.renderToPipeableStream==`function`){let e=new oo,c,l,u=new Promise(e=>{l=e}),d=new AbortController,f=e=>{if(!a){a=!0,d.abort(e);try{c?.abort(e)}catch{}}};try{c=Nh.default.renderToPipeableStream(r,{nonce:t.options.ssr?.nonce,progressiveChunkSize:1/0,...o?{onAllReady:l}:{onShellReady:l},onError:s(`renderToPipeableStream`),onShellError:e=>d.abort(e)});let a=xh(t,so.toWeb(e),{rendererSafePoint:`script-close`,signal:i,onAbort:f});return await Ve(u,d.signal),c.pipe(e),$m(t,new Response(a,{status:Qm(t),headers:n}))}catch(e){throw f(e),e}}throw Error(`No renderToReadableStream or renderToPipeableStream found in react-dom/server. Ensure you are using a version of react-dom that supports streaming.`)}catch(e){throw t.serverSsr?.cleanup(),e}},Fh=rh(({request:e,router:t,responseHeaders:n})=>Ph({request:e,router:t,responseHeaders:n,children:(0,lp.jsx)(mp,{router:t})})),Ih=(()=>{let e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})(),Lh=URL,Rh=Response;function zh(e){return decodeURI(e.includes(`%25`)?e.replace(/%25/g,`%2525`):e)}var Bh=`h3.internal.event.`,Vh=Symbol.for(`${Bh}res`),Hh=Symbol.for(`${Bh}res.headers`),Uh=Symbol.for(`${Bh}res.err.headers`),Wh=class{app;req;url;context;static __is_event__=!0;constructor(e,t,n){this.context=t||e.context||new Ih,this.req=e,this.app=n;let r=e._url,i=r&&r instanceof URL?r:new Lh(e.url);i.pathname.includes(`%`)&&(i.pathname=zh(i.pathname)),this.url=i}get res(){return this[Vh]||=new Gh}get runtime(){return this.req.runtime}waitUntil(e){this.req.waitUntil?.(e)}toString(){return`[${this.req.method}] ${this.req.url}`}toJSON(){return this.toString()}get node(){return this.req.runtime?.node}get headers(){return this.req.headers}get path(){return this.url.pathname+this.url.search}get method(){return this.req.method}},Gh=class{status;statusText;get headers(){return this[Hh]||=new Headers}get errHeaders(){return this[Uh]||=new Headers}},Kh=/[^\u0009\u0020-\u007E]/g;function qh(e=``){return e.replace(Kh,``)}function Jh(e,t=200){return!e||(typeof e==`string`&&(e=+e),e<100||e>599)?t:e}var Yh=class e extends Error{get name(){return`HTTPError`}status;statusText;headers;cause;data;body;unhandled;static isError(e){return e instanceof Error&&e?.name===`HTTPError`}static status(t,n,r){return new e({...r,statusText:n,status:t})}constructor(e,t){let n,r;typeof e==`string`?(n=e,r=t):r=e;let i=Jh(r?.status||r?.statusCode||r?.cause?.status||r?.cause?.statusCode,500),a=qh(r?.statusText||r?.statusMessage||r?.cause?.statusText||r?.cause?.statusMessage),o=n||r?.message||r?.cause?.message||r?.statusText||r?.statusMessage||[`HTTPError`,i,a].filter(Boolean).join(` `);super(o,{cause:r}),this.cause=r,this.status=i,this.statusText=a||void 0;let s=r?.headers||r?.cause?.headers;this.headers=s?new Headers(s):void 0,this.unhandled=r?.unhandled??r?.cause?.unhandled??void 0,this.data=r?.data,this.body=r?.body}get statusCode(){return this.status}get statusMessage(){return this.statusText}toJSON(){let e=this.unhandled;return{status:this.status,statusText:this.statusText,unhandled:e,message:e?`HTTPError`:this.message,data:e?void 0:this.data,...e?void 0:this.body}}};function Xh(e,t){if(e==null)return!0;if(t!==`object`)return t===`boolean`||t===`number`||t===`string`;if(typeof e.toJSON==`function`||Array.isArray(e))return!0;if(typeof e.pipe==`function`||typeof e.pipeTo==`function`)return!1;if(e instanceof Ih)return!0;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}var Zh=Symbol.for(`h3.notFound`),Qh=Symbol.for(`h3.handled`);function $h(e,t,n={}){if(typeof e?.then==`function`)return(e.catch?.(e=>e)||Promise.resolve(e)).then(e=>$h(e,t,n));let r=tg(e,t,n);if(typeof r?.then==`function`)return $h(r,t,n);let{onResponse:i}=n;return i?Promise.resolve(i(r,t)).then(()=>r):r}var eg=class{#e;#t;body;constructor(e,t){this.body=e,this.#t=t}get status(){return this.#t?.status||200}get statusText(){return this.#t?.statusText||`OK`}get headers(){return this.#e||=new Headers(this.#t?.headers)}};function tg(e,t,n,r){if(e===Qh)return new Rh(null);if(e===Zh&&(e=new Yh({status:404,message:`Cannot find any route matching [${t.req.method}] ${t.url}`})),e&&e instanceof Error){let i=Yh.isError(e),a=i?e:new Yh(e);i||(a.unhandled=!0,e?.stack&&(a.stack=e.stack)),a.unhandled&&!n.silent&&console.error(a);let{onError:o}=n,s=t[Vh]?.[Uh];return o&&!r?Promise.resolve(o(a,t)).catch(e=>e).then(r=>tg(r??e,t,n,!0)):lg(a,n.debug,s)}let i=t[Vh],a=i?.[Hh];if(t[Vh]=void 0,!(e instanceof Response)){let r=sg(e,t,n),o=r.status||i?.status;return new Rh(cg(t.req.method,o)?null:r.body,{status:o,statusText:r.statusText||i?.statusText,headers:r.headers&&a?ng(r.headers,a):r.headers||a})}if(!a||r||!e.ok)return e;try{return ng(e.headers,a,e.headers),e}catch{return new Rh(cg(t.req.method,e.status)?null:e.body,{status:e.status,statusText:e.statusText,headers:ng(e.headers,a)})}}function ng(e,t,n=new Headers(e)){for(let[e,r]of t)e===`set-cookie`?n.append(e,r):n.set(e,r);return n}var rg=e=>(...t)=>{throw Error(`Headers are frozen (${e} ${t.join(`, `)})`)},ig=class extends Headers{set=rg(`set`);append=rg(`append`);delete=rg(`delete`)},ag=new ig({"content-length":`0`}),og=new ig({"content-type":`application/json;charset=UTF-8`});function sg(e,t,n){if(e==null)return{body:``,headers:ag};let r=typeof e;if(r===`string`)return{body:e};if(e instanceof Uint8Array)return t.res.headers.set(`content-length`,e.byteLength.toString()),{body:e};if(e instanceof eg||e?.constructor?.name===`HTTPResponse`)return e;if(Xh(e,r))return{body:JSON.stringify(e,void 0,n.debug?2:void 0),headers:og};if(r===`bigint`)return{body:e.toString(),headers:og};if(e instanceof Blob){let t=new Headers({"content-type":e.type,"content-length":e.size.toString()}),n=e.name;return n&&(n=encodeURIComponent(n),t.set(`content-disposition`,`filename="${n}"; filename*=UTF-8''${n}`)),{body:e.stream(),headers:t}}return r===`symbol`?{body:e.toString()}:r===`function`?{body:`${e.name}()`}:{body:e}}function cg(e,t){return e===`HEAD`||t===100||t===101||t===102||t===204||t===205||t===304}function lg(e,t,n){let r=e.headers?ng(og,e.headers):new Headers(og);return n&&(r=ng(r,n)),new Rh(JSON.stringify({...e.toJSON(),stack:t&&e.stack?e.stack.split(`
|
|
75
|
+
`).map(e=>e.trim()):void 0},void 0,t?2:void 0),{status:e.status,statusText:e.statusText,headers:r})}var ug=Symbol.for(`tanstack-start:event-storage`),dg=globalThis;dg[ug]||(dg[ug]=new co);var fg=dg[ug];function pg(e){return(typeof e==`object`||typeof e==`function`)&&e!==null&&typeof e.then==`function`}function mg(e){let t=e;if(typeof t.getSetCookie==`function`)return t.getSetCookie();let n=e.get(`set-cookie`);return n?[n]:[]}function hg(e,t){if(e.ok)return;let n=mg(t.res.headers);if(n.length===0)return;let r=mg(e.headers);e.headers.delete(`set-cookie`);for(let t of r)e.headers.append(`set-cookie`,t);for(let t of n)e.headers.append(`set-cookie`,t)}function gg(e,t){let n=vg(e);return hg(n,t),n}function _g(e,t){return pg(e)?Promise.resolve(e).then(e=>gg(e,t),e=>gg(yg(e),t)):gg(e,t)}function vg(e){return e instanceof Response?e:new Response(`Internal Server Error`,{status:500})}function yg(e){if(e instanceof Response)return e;if(e instanceof Error)throw e;return new Response(`Internal Server Error`,{status:500})}function bg(e){return(t,n)=>{let r;try{r=new Wh(t)}catch(e){if(e instanceof URIError)return new Response(null,{status:400,statusText:`Bad Request`});throw e}let i;try{i=fg.run({h3Event:r},()=>e(t,n))}catch(e){i=yg(e)}return $h(_g(i,r),r)}}function xg(){let e=fg.getStore();if(!e)throw Error(`No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`);return e.h3Event}function Sg(){return xg().res}var Cg={TSS_SHELL:`X-TSS_SHELL`};async function wg(e){let{tsrStartManifest:t}=await import(`./assets/_tanstack-start-manifest_v-11GtFGrq.js`),n=t(),r=n.routes;r[me];let i={};for(let e in r){let t=r[e],n={};t.preloads&&t.preloads.length>0&&(n.preloads=t.preloads),t.scripts&&t.scripts.length>0&&(n.scripts=t.scripts),t.css?.length&&(n.css=t.css),(n.preloads||n.scripts||n.css)&&(i[e]=n)}return{...n.scriptFormat?{scriptFormat:n.scriptFormat}:{},...n.inlineCss?{inlineCss:n.inlineCss}:{},routes:i}}var Tg={};async function Eg(e,t){let n=Tg[e];if(!n)throw Error(`Server function info not found for `+e);let r=n.module??=await n.importer();if(!r)throw Error(`Server function module not resolved for `+e);let i=r[n.functionName];if(!i)throw Error(`Server function module export not resolved for serverFn ID: `+e);return i}var Dg=`__TSS_CONTEXT`,Og=Symbol.for(`TSS_SERVER_FUNCTION`),kg=`x-tss-serialized`,Ag=`x-tss-raw`,jg=`application/x-tss-framed`,Mg=16777216,Ng=1024,Pg=`${jg}; v=1`,Fg=()=>j().startOptions;function Ig(e){return[...(Fg()?.serializationAdapters)?.map(op)??[],...e]}var Lg=new TextEncoder,Rg=new Uint8Array,zg=4096;function Bg(e,t,n){if(n.byteLength>16777216)throw RangeError(`Frame payload exceeds ${Mg} bytes`);let r=new Uint8Array(9+n.length);return r[0]=e,r[1]=t>>>24&255,r[2]=t>>>16&255,r[3]=t>>>8&255,r[4]=t&255,r[5]=n.length>>>24&255,r[6]=n.length>>>16&255,r[7]=n.length>>>8&255,r[8]=n.length&255,r.set(n,9),r}function Vg(e){let t=e instanceof Error?e.message:String(e??`Unknown error`),n=t.length>zg?`${t.slice(0,zg)}…`:t;return Lg.encode(n)}function Hg(e,t={}){let n,r=!1,i=0,a,o,s=new Set,c=new Set,l=()=>m(t.signal?.reason),u=()=>{let e=a;a=void 0,e?.()},d=(e,t)=>{e.cancel(t).catch(()=>{})},f=(e,t)=>{e.cancel(t).catch(()=>{})},p=e=>{if(r)return!1;r=[e],t.signal?.removeEventListener(`abort`,l),u();for(let t of s)d(t,e);for(let t of c)f(t,e);return c.clear(),!0},m=e=>{if(p(e))try{n.error(e)}catch{}},h=async()=>{for(;!r&&(n.desiredSize??0)<=0;)await new Promise(e=>{a=e});return!r},g=(e,t,i)=>{if(r)return!1;if(!o&&(n.desiredSize??0)>0)return n.enqueue(Bg(e,t,i)),!0;let a=async()=>await h()?(n.enqueue(Bg(e,t,i)),!0):!1,s=o?o.then(a):a(),c=()=>{o===l&&(o=void 0)},l=s.then(c,c);return o=l,s},_=()=>{if(i===0&&p())try{n.close()}catch{}},v=e=>{i++,e().then(()=>{i--,_()},e=>{i--,m(e)})};async function y(e,t){let n=t.getReader();s.add(n);try{for(;!r;){let{done:t,value:i}=await n.read();if(r)return;if(t){let t=g(2,e,Rg);t!==!0&&await t;return}if(!(i instanceof Uint8Array))throw TypeError(`RawStream chunks must be Uint8Array`);let a=0;do{let t=g(1,e,i.byteLength<=16777216?i:i.subarray(a,a+Mg));if(t!==!0&&(t===!1||!await t))return;a+=Mg}while(a<i.byteLength)}}catch(t){if(!r){let n=g(3,e,Vg(t));n!==!0&&await n}}finally{s.delete(n),n.releaseLock()}}async function b(){let t=e.getReader();s.add(t);try{for(;!r;){let{done:e,value:n}=await t.read();if(r){if(!e)for(let e of n.rawStreams)f(e.stream,r[0]);return}if(e)return;for(let e of n.rawStreams)c.add(e.stream);let i=g(0,0,n.json);if(i!==!0&&(i===!1||!await i))return;for(let e of n.rawStreams)c.delete(e.stream),v(y.bind(void 0,e.id,e.stream))}}catch(e){r||m(e)}finally{s.delete(t),t.releaseLock()}}return new ReadableStream({start(r){n=r,t.signal?.aborted?(f(e,t.signal.reason),m(t.signal.reason)):(t.signal?.addEventListener(`abort`,l,{once:!0}),v(b))},pull(){u()},cancel(e){p(e)&&t.onCancel?.(e)}})}function Ug(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function Wg(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))Ug(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))Ug(e)&&(n[e]=t[e]);return n}function Gg(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))Ug(n)&&(t[n]=e[n]);return t}function Kg(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}var qg=(e,t)=>{let n={type:`request`,...t||e},r=e=>qg({},Object.assign(n,{validator:e,inputValidator:e}));return{options:n,middleware:e=>qg({},Object.assign(n,{middleware:e})),validator:r,inputValidator:r,client:e=>qg({},Object.assign(n,{client:e})),server:e=>qg({},Object.assign(n,{server:e}))}},Jg=(e={})=>qg().server(async t=>{let n=t;return e.filter&&!await e.filter(n)||await Yg(e,n)?t.next():e_(e,n)});async function Yg(e,t){let n=await Xg(e,t);return n===!0||n===void 0&&e.allowRequestsWithoutOriginCheck===!0}async function Xg(e,t){let n=t.request.headers.get(`Sec-Fetch-Site`);if(n!==null)return Zg(e.secFetchSite??`same-origin`,n,t);let r=t.request.headers.get(`Origin`);if(r!==null)return e.origin?Zg(e.origin,r,t):r===new URL(t.request.url).origin;let i=t.request.headers.get(`Referer`);if(i!==null&&e.referer!==!1){if(typeof e.referer==`function`)return e.referer(i,t);if(e.origin){let n=Qg(i);return n!==void 0&&Zg(e.origin,n,t)}return $g(i,new URL(t.request.url).origin)}}async function Zg(e,t,n){return typeof e==`function`?e(t,n):Array.isArray(e)?e.includes(t):t===e}function Qg(e){try{return new URL(e).origin}catch{return}}function $g(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;if(e.length===t.length)return!0;let n=e.charCodeAt(t.length);return n===47||n===63||n===35}async function e_(e,t){return typeof e.failureResponse==`function`?e.failureResponse(t):e.failureResponse?.clone()??new Response(`Forbidden`,{status:403})}var t_=void 0,n_=[`multipart/form-data`,`application/x-www-form-urlencoded`],r_=1e6,i_=1024,a_=33554432,o_=new TextEncoder;function s_(e){return o_.encode(JSON.stringify(e))}function c_(e,t,n){return t>=i_||n+e.byteLength>a_}function l_(e){try{e()}catch{}}function u_(e,t){e.cancel(t).catch(()=>{})}var d_=async({request:e,context:t,serverFnId:n})=>{let r=e.method.toUpperCase(),i=new URL(e.url),a=await Eg(n,{origin:`client`});if(a.method&&r!==a.method)return new Response(`expected ${a.method} method. Got ${r}`,{status:405,headers:{Allow:a.method}});let o=e.headers.get(`x-tsr-serverFn`)===`true`;t_??=Ig(Fp);let s=e.headers.get(`Content-Type`);try{let n;if(n_.some(e=>s&&s.includes(e))){r===`GET`&&de();let i=await e.formData(),o=i.get(Dg);i.delete(Dg);let s={context:t,data:i,method:r};if(typeof o==`string`)try{let e=ap(JSON.parse(o),{plugins:t_});typeof e==`object`&&e&&(s.context=Wg(e,t))}catch{}n=await a(s)}else if(r===`GET`){let e=i.searchParams.get(`payload`);if(e&&e.length>r_)throw Error(`Payload too large`);let o=e?ap(JSON.parse(e),{plugins:t_}):void 0;n=await a({data:o?.data,context:Wg(o?.context,t),method:r})}else{let i=s?.includes(`application/json`)?ap(await e.json(),{plugins:t_}):void 0;n=await a({data:i?.data,context:Wg(i?.context,t),method:r})}let c=n.error===void 0?n.result:n.error;return be(n)&&(n=p_(n)),!o&&(c instanceof Response||typeof c!=`object`||!c)?c:c instanceof Response?(_e(c)||c.headers.set(Ag,`true`),c):f_(n,e.signal,t_)}catch(e){if(e instanceof Response)return e;if(be(e))return p_(e);console.error(`Server Fn Error!`,e);let t=JSON.stringify(await np(e,{refs:new Map,plugins:t_})),n=Sg(),r={"Content-Type":`application/json`,[kg]:`true`};try{return new Response(t,{status:n.status??500,statusText:n.statusText,headers:r})}catch{return new Response(t,{status:500,statusText:``,headers:r})}}};function f_(e,t,n){let r=Sg(),i=[],a=0,o=[],s=!1,c=!1,l,u,d=(e,t)=>{if(l)return;c||=t;let n=s_(e);c_(n,i.length,a)?l=[Error(`Server function serialization exceeded its pending output limit`)]:(i.push(n),a+=n.byteLength)},f=()=>{c&&(s=!0)},p=e=>{l??=[e]},m=ip(e,{refs:new Map,plugins:[Ip((e,t)=>{if(l)u_(t,l[0]);else if(e>1024){let e=Error(`Too many raw streams in framed response (max ${Ng})`);u_(t,e),p(e)}else o.push({id:e,stream:t})}),...n],onParse(e,t){d(e,t)},onDone(){f()},onError:e=>{p(e)}});if(l){l_(m);for(let e of o)u_(e.stream,l[0]);throw l[0]}if(s||(u=m),s&&o.length===0&&i.length===1)return new Response(i[0],{status:r.status,statusText:r.statusText,headers:{"Content-Type":`application/json`,[kg]:`true`}});if(s&&i.length===1){let e=i[0];if(e.byteLength>16777216){let e=Error(`Server function serialization exceeded its pending output limit`);for(let t of o)u_(t.stream,e);throw e}let n=o.splice(0);return i.length=0,w(new ReadableStream({start(t){t.enqueue({json:e,rawStreams:n}),t.close()},cancel(e){for(let t of n)u_(t.stream,e)}}),{signal:t})}let{readable:h,writable:g}=new TransformStream,_=g.getWriter(),v=new AbortController,y=0,b=new Set,x=e=>{if(l)return;l=[e];let t=u;u=void 0;for(let t of o.splice(0))u_(t.stream,e);for(let t of b)for(let n of t.rawStreams)u_(n.stream,e);b.clear(),v.abort(e),_.abort(e).catch(()=>{}),t&&l_(t)},S=(e,t)=>{if(l){for(let e of t)u_(e.stream,l[0]);return!1}if(e.byteLength>16777216||c_(e,b.size,y)){let e=Error(`Server function serialization exceeded its pending output limit`);for(let n of t)u_(n.stream,e);return p(e),!1}y+=e.byteLength;let n={json:e,rawStreams:t};return b.add(n),_.write(n).then(()=>{b.delete(n),y-=e.byteLength},r=>{let i=b.delete(n);if(y-=e.byteLength,i)for(let e of t)u_(e.stream,r)}),!0};d=e=>{l||S(s_(e),o.splice(0))},f=()=>{l||(u=void 0,_.close().catch(()=>{}))},p=e=>{x(e)};let C=o.splice(0);for(let e=0;e<i.length;e++){let t=e===i.length-1;if(!S(i[e],t?C:[])){if(!t)for(let e of C)u_(e.stream,l[0]);throw i.length=0,l[0]}}return i.length=0,s&&f(),_.closed.catch(e=>{x(e)}),w(h,{signal:AbortSignal.any([v.signal,t]),onCancel:x});function w(e,t){let n=Hg(e,t);try{return new Response(n,{status:r.status,statusText:r.statusText,headers:{"Content-Type":Pg,[kg]:`true`}})}catch(e){throw u_(n,e),e}}}function p_(e){let{headers:t,...n}=e,r=new Response(JSON.stringify(n),{status:404,headers:t});return r.headers.set(`Content-Type`,`application/json`),r}var m_=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,h_=new Set([`fetch`,`font`,`image`,`script`,`style`,`track`]);function g_(e,t){return t===void 0?e:m_.test(t)?`${e}=${t}`:`${e}=${JSON.stringify(t)}`}function __(e){let t=[`<${e.href}>`,g_(`rel`,e.rel)];return e.as&&t.push(g_(`as`,e.as)),e.crossOrigin!==void 0&&t.push(g_(`crossorigin`,e.crossOrigin||void 0)),e.type&&t.push(g_(`type`,e.type)),e.integrity&&t.push(g_(`integrity`,e.integrity)),e.referrerPolicy&&t.push(g_(`referrerpolicy`,e.referrerPolicy)),e.fetchPriority&&t.push(g_(`fetchpriority`,e.fetchPriority)),t.join(`; `)}function v_(e,t,n){let r=e?.[t]??(n?e?.[n]:void 0);return typeof r==`string`?r:void 0}function y_(e){let t=v_(e,`as`);return t&&h_.has(t)?t:void 0}function b_(e,t){let n=v_(t,`crossOrigin`,`crossorigin`),r=v_(t,`type`),i=v_(t,`integrity`),a=v_(t,`referrerPolicy`,`referrerpolicy`),o=v_(t,`fetchPriority`,`fetchpriority`);n!==void 0&&(e.crossOrigin=n),r&&(e.type=r),i&&(e.integrity=i),a&&(e.referrerPolicy=a),o&&(e.fetchPriority=o)}function x_(e){let t=v_(e,`href`),n=v_(e,`rel`);if(!t||!n)return;let r=n.split(/\s+/),i,a;if(r.includes(`modulepreload`))i=`modulepreload`,a=`script`;else if(r.includes(`stylesheet`))i=`preload`,a=`style`;else if(r.includes(`preload`)){if(a=y_(e),!a)return;i=`preload`}else r.includes(`preconnect`)?(i=`preconnect`,a=void 0):r.includes(`dns-prefetch`)&&(i=`dns-prefetch`,a=void 0);if(!i)return;let o={href:t,rel:i};return a&&(o.as=a),b_(o,e),o}function S_(e,t){let n=[];for(let r of t){let t=e.routes[r.id];if(t){for(let r of t.preloads??[]){let t=Re(e,r),i={href:t.href,rel:t.rel,as:`script`};t.crossOrigin!==void 0&&(i.crossOrigin=t.crossOrigin),n.push(i)}for(let r of t.css??[]){let t=dt(r);if(e.inlineCss?.styles[t]!==void 0)continue;let i=We(r),a={href:t,rel:`preload`,as:`style`};i.crossOrigin!==void 0&&(a.crossOrigin=i.crossOrigin),n.push(a)}}}return n}function C_(e){let t=[];for(let n of e){let e=n.links;if(Array.isArray(e))for(let n of e){let e=x_(n);e&&t.push(e)}}return t}function w_(e){let t=[],n=[];for(let r of e.hints){let i=__(r);e.sentLinks.has(i)||(e.sentLinks.add(i),e.sentHints.push(r),t.push(r),n.push(i))}if(t.length||e.phase===`dynamic`)return{phase:e.phase,hints:t,links:n,allHints:e.sentHints.slice(),allLinks:Array.from(e.sentLinks)}}function T_(e){for(let t of e.hints){let n=__(t);e.sentLinks.has(n)||(e.sentLinks.add(n),e.entries.push({phase:e.phase,hint:t,link:n}))}}function E_(e){if(!e.filter)return e.entries.map(e=>e.link);try{let t=[];for(let n of e.entries)e.filter(n)&&t.push(n.link);return t}catch(e){return console.error(`Error filtering response Link headers:`,e),[]}}function D_(e,t,n){try{let r=n(t);r&&Promise.resolve(r).catch(t=>{console.error(`Error sending ${e} early hints:`,t)})}catch(t){console.error(`Error sending ${e} early hints:`,t)}}function O_(e){if(typeof e==`object`)return e.filter}function k_(e){for(let t of E_(e))e.responseHeaders.append(`Link`,t)}function A_(e){for(let t=0;t<e.event.hints.length;t++)e.entries.push({phase:e.phase,hint:e.event.hints[t],link:e.event.links[t]})}function j_(e){let t=e.onEarlyHints?w_({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,sentHints:e.sentHints}):void 0;t&&D_(e.phase,t,e.onEarlyHints),e.responseLinkHeaderEntries&&(t?A_({phase:e.phase,event:t,entries:e.responseLinkHeaderEntries}):T_({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,entries:e.responseLinkHeaderEntries}))}function M_(e){if(!e?.onEarlyHints&&!e?.responseLinkHeader)return;let t=new Set,n=e.onEarlyHints?[]:void 0,r=e.responseLinkHeader?[]:void 0,i=O_(e.responseLinkHeader);return{collectStatic:({manifest:i,matchedRoutes:a})=>{a?.length&&j_({phase:`static`,hints:S_(i,a),sentLinks:t,sentHints:n,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:r})},collectDynamic:i=>{j_({phase:`dynamic`,hints:C_(i),sentLinks:t,sentHints:n,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:r})},appendResponseHeaders:e=>{r?.length&&k_({responseHeaders:e,entries:r,filter:i})}}}function N_(e){return typeof e==`string`?{href:e}:e}function P_(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\a `).replace(/\r/g,`\\d `).replace(/\f/g,`\\c `)}async function F_(e){let{strings:t,urls:n}=e.template;if(t.length!==n.length+1)throw Error(`TanStack Start inlineCss template for ${e.stylesheetHref} is invalid`);let r=t[0];for(let i=0;i<n.length;i++){let a=N_(await e.transformFn({kind:`css-url`,url:n[i],stylesheetHref:e.stylesheetHref}));r+=P_(a.href)+t[i+1]}return r}async function I_(e,t){let n={},r=await Promise.all(Object.entries(e.styles).map(async([n,r])=>{let i=e.templates?.[n];return[n,i?await F_({stylesheetHref:n,template:i,transformFn:t}):r]}));for(let[e,t]of r)n[e]=t;return{styles:n,...e.templates?{templates:e.templates}:{}}}function L_(e,t){if(e)return typeof e==`string`?e:e[t]}function R_(e){return`prefix`in e}function z_(e){if(typeof e==`string`){let t=e;return{type:`transform`,transformFn:({url:e})=>({href:`${t}${e}`}),cache:!0}}if(typeof e==`function`)return{type:`transform`,transformFn:e,cache:!0};if(R_(e)){let{prefix:t,crossOrigin:n}=e;return{type:`transform`,transformFn:({url:e,kind:r})=>{let i=`${t}${e}`;if(r===`css-url`)return{href:i};let a=L_(n,r);return a?{href:i,crossOrigin:a}:{href:i}},cache:!0}}return`createTransform`in e&&e.createTransform?{type:`createTransform`,createTransform:e.createTransform,cache:e.cache!==!1}:{type:`transform`,transformFn:typeof e.transform==`string`?(({url:t})=>({href:`${e.transform}${t}`})):e.transform,cache:e.cache!==!1}}function B_(e,t){if(typeof e==`string`)return t.crossOrigin?t:t.href;let n={...e,href:t.href};return t.crossOrigin?n.crossOrigin=t.crossOrigin:delete n.crossOrigin,n}async function V_(e,t,n){let r=structuredClone(e),i=n?.inlineCss!==!1,a=new Map,o=e=>{let n=a.get(e);if(n)return n;let r=Promise.resolve(t({url:e,kind:`script`})).then(N_);return a.set(e,r),r};i?r.inlineCss&&=await I_(r.inlineCss,t):delete r.inlineCss;for(let e of Object.values(r.routes))if(e.preloads?.length&&(e.preloads=await Promise.all(e.preloads.map(async e=>{let t=await o(it(e).href);return B_(e,{href:t.href,crossOrigin:t.crossOrigin})}))),e.css?.length&&!r.inlineCss&&(e.css=await Promise.all(e.css.map(async e=>{let n=N_(await t({url:We(e).href,kind:`stylesheet`}));return B_(e,{href:n.href,crossOrigin:n.crossOrigin})}))),e.scripts?.length)for(let t of e.scripts){let e=t.attrs?.src;if(typeof e!=`string`)continue;let n=await o(e);t.attrs={...t.attrs,src:n.href},n.crossOrigin?t.attrs.crossOrigin=n.crossOrigin:delete t.attrs.crossOrigin}return r}function H_(e,t){return{...e.scriptFormat?{scriptFormat:e.scriptFormat}:{},...t?.inlineCss!==!1&&e.inlineCss?{inlineCss:structuredClone(e.inlineCss)}:{},routes:{...e.routes}}}function U_(e){if(typeof e!=`function`)return e??!0}async function W_(e){return e.requestInlineCss===void 0?typeof e.handlerInlineCss==`function`?await e.handlerInlineCss({request:e.request}):e.handlerInlineCss??!0:e.requestInlineCss}function G_(e){let t;return()=>(t||=e().catch(e=>{throw t=void 0,e}),t)}function K_(e,t){let n=e===void 0?void 0:z_(e),r=!n||n.cache,i=!!e&&typeof e==`object`&&`warmup`in e&&e.warmup===!0,a,o=()=>{a=void 0};return{cache:r,warmup:i,clearCachedCreateTransform:o,getTransformFn:async e=>{if(n)return n.type===`createTransform`?!r||!t.cacheCreateTransform?n.createTransform(e):(a||=Promise.resolve(n.createTransform(e)).catch(e=>{throw o(),e}),a):n.transformFn}}}function q_(e){let t=new Map,n=K_(e.transformAssets,{cacheCreateTransform:e.cacheCreateTransform}),r=U_(e.inlineCss),i=async t=>{let r=await n.getTransformFn({warmup:!1,request:t.request}),i=await W_({request:t.request,handlerInlineCss:e.inlineCss,requestInlineCss:t.requestInlineCss});return{getBaseManifest:t.getBaseManifest,transformFn:r,cache:n.cache,inlineCss:i}},a=async(e,t)=>Q_({...await i(e),finalManifestCache:t});return{warmup:({getBaseManifest:e})=>$_({enabled:n.warmup,handlerDefaultInlineCss:r,cache:n.cache,finalManifestCache:t,getBaseManifest:e,getTransformFn:()=>n.getTransformFn({warmup:!0}),onError:n.clearCachedCreateTransform}),resolveCached:e=>a(e,t),resolveUncached:e=>a(e,void 0)}}function J_(e){return e?`inline-css`:`linked-css`}function Y_(e,t,n){let r=n.catch(n=>{throw e.get(t)===r&&e.delete(t),n});return e.set(t,r),r}function X_(e,t,n){return e.get(t)||Y_(e,t,Promise.resolve().then(n))}async function Z_(e){return e.transformFn?await V_(e.base,e.transformFn,{inlineCss:e.inlineCss}):H_(e.base,{inlineCss:e.inlineCss})}async function Q_(e){let t=async()=>Z_({base:await e.getBaseManifest(),transformFn:e.transformFn,inlineCss:e.inlineCss});return e.finalManifestCache&&(!e.transformFn||e.cache)?X_(e.finalManifestCache,J_(e.inlineCss),t):t()}function $_(e){if(!e.enabled||e.handlerDefaultInlineCss===void 0||!e.cache)return;let t=e.handlerDefaultInlineCss,n=X_(e.finalManifestCache,J_(t),async()=>{let[n,r]=await Promise.all([e.getBaseManifest(),e.getTransformFn()]);return Z_({base:n,transformFn:r,inlineCss:t})});return e.onError&&n.catch(e.onError),n}var ev=Io({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(Og in e)?!1:!!e[Og],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>async(t,n)=>{let r=await Eg(e,{origin:`client`}),i=await r({data:t?.data,context:t?.context,method:r.method??`GET`},n);if(i.error!==void 0)throw i.error;return i.result}});function tv(e){return oh({"Content-Type":`text/html; charset=utf-8`},...Dt(e.router.stores.matches.get()).map(e=>e.headers))}var nv,rv=Jg({filter:e=>e.handlerType===`serverFn`}),iv=G_(()=>wg()),av=()=>iv(),ov=M_;async function sv(){let[e,t,n]=await Promise.all([import(`./assets/router-xjZtEeaI.js`),import(`./assets/start-C63VetBp.js`),import(`./assets/empty-plugin-adapters-BaGcmrjC.js`)]);return{routerEntry:e,startEntry:t,pluginAdapters:n}}function cv(){return nv||=sv(),nv}var lv=`/`,uv=`/_serverFn/`,dv=process.env.TSS_PRERENDERING===`true`,fv=process.env.TSS_SHELL===`true`,pv=`Internal Server Error`,mv=`Internal Server Error`;function hv(){throw Error(pv)}function gv(){throw Error(mv)}function _v(e){return Jm(e)||e instanceof Response?e:e?.response}var vv=new WeakMap;function yv(e,t){let n=_v(e);(Jm(n)||n instanceof Response)&&Zm(n,t)}function bv(e){return e instanceof Response&&e.body!==null}function xv(e,t){return bv(t)&&(t.body===e.response.body||vv.get(t)===e.response)}function Sv(e,t){let{response:n,sourceBody:r,streamResponse:i}=e;i?.dispose(t),(!i||n.body!==r)&&n.body.cancel(t).catch(()=>{})}function Cv(e){let{response:t,sourceBody:n,streamResponse:r}=e;return r?r.response===t&&t.body===n?r:t.body===n?{...r,response:t}:{...r,response:t,dispose(t){Sv(e,t)}}:t}function wv(e){return t=>yv(t,e.reason)}async function Tv(e,t,n,r,i){let a=-1,o,s=!1,c=wv(r),l=e=>{let t=Jm(e)?e:void 0,r=t?.serverSsrCleanup===`stream`?t:void 0,i=t?t.response:e,a=o;s?i!==n.response&&yv(e,`late middleware response`):(a&&a.response===i?a.streamResponse??=r:a&&xv(a,i)?(a.response=i,a.streamResponse??=r):(a&&Sv(a,`middleware response replaced`),o=bv(i)?{response:i,sourceBody:i.body,streamResponse:r}:void 0),n.response=i)},u=()=>{n.response!==o?.response&&l(n.response)},d;function f(e){let t=p(e);return d=t,t}async function p(o){if(r.throwIfAborted(),o){o.context&&(n.context=Wg(n.context,o.context));for(let e of Object.keys(o))e===`response`?l(o.response):e!==`context`&&(n[e]=o[e])}a++;let s=a===e.length,p=a<e.length?e[a]:s?t:void 0,m=s&&i?i:f;if(!p)return n;let h;try{let e=p({...n,next:m});if(d&&e===d){if(d=void 0,await e,r.aborted)throw r.reason;return n}It(e)?h=await Ve(e,r,c,c):(h=e,r.throwIfAborted())}catch(e){if(u(),r.aborted)throw h!==void 0&&c(h),e!==r.reason&&c(e),r.reason;if(e instanceof Response)return l(e),n;throw e}if(s&&i&&!h&&hv(),u(),h&&h!==n){let e=_v(h);e!==void 0&&e!==n.response&&l(e),e!==h&&h.context&&h.context!==n.context&&(n.context=Wg(n.context,h.context))}return n}try{await p();let e=n.response;if(e||hv(),u(),r.aborted)throw r.reason;return s=!0,o?Cv(o):e}catch(e){throw s=!0,o&&Sv(o,r.aborted?r.reason:e),e}}function Ev(e){let t=typeof e==`function`?{}:e,n=typeof e==`function`?e:e.handler,r=q_({...t,cacheCreateTransform:!0}),i=r.resolveCached;return r.warmup({getBaseManifest:()=>av(void 0)}),bg(async(e,t)=>{let r=e.signal,a,o,s=!1;try{r.throwIfAborted();let{url:c,handledProtocolRelativeURL:l}=qm(e.url),u=c.pathname+c.search+c.hash,d=c.origin;if(l)return Response.redirect(c,308);let f=await Ve(cv(),r),p=!!uv&&c.pathname.startsWith(uv),m=f.startEntry.startInstance,h;if(m){let e=m.getOptions();h=It(e)?await Ve(e,r):e,r.throwIfAborted()}else h={};let{hasPluginAdapters:g,pluginSerializationAdapters:_}=f.pluginAdapters,v=[...h.serializationAdapters||[],...g?_:[],ev],y={...h,requestMiddleware:m?h.requestMiddleware:p?[rv]:void 0,serializationAdapters:v},b=y.requestMiddleware?Kg(y.requestMiddleware):[],x=new Set(b),S=()=>(o??=(async()=>{r.throwIfAborted();let t=await Ve(f.routerEntry.getRouter(),r),n=fv;dv&&!n&&(n=e.headers.get(Cg.TSS_SHELL)===`true`);let i=Mt(u);return t.update({history:i,isShell:n,isPrerendering:dv,origin:t.options.origin??d,defaultSsr:y.defaultSsr,serializationAdapters:[...y.serializationAdapters,...t.options.serializationAdapters||[]],basepath:lv}),a=t,t})(),o),C=p?`serverFn`:`router`,w={getRouter:S,startOptions:y,request:e,executedRequestMiddlewares:x,handlerType:C},E;if(p){let n=c.pathname.slice(uv.length).split(`/`)[0];if(!n)throw Error(`Invalid server action param for serverFnId`);E=({context:r})=>mt({...w,contextAfterGlobalMiddlewares:r},()=>d_({request:e,context:t?.context,serverFnId:n}))}else{let a=async(a,o)=>{if(!/(^|,)\s*(\*\/\*|text\/html)/.test(e.headers.get(`Accept`)||`*/*`))return Ym(Response.json({error:`Only HTML requests are supported here`},{status:406}));let s=await Ve(i({request:e,requestInlineCss:t?.inlineCss,getBaseManifest:()=>av(o)}),r),c=ov({onEarlyHints:t?.onEarlyHints,responseLinkHeader:t?.responseLinkHeader});c?.collectStatic({manifest:s,matchedRoutes:o});let l=await S();if(Km({router:l,manifest:s,getRequestAssets:()=>j({throwIfNotFound:!1})?.requestAssets}),l.options.additionalContext={serverContext:a},await l.load({_signal:r}),r.throwIfAborted(),l._serverResult?.type===`redirect`)return Ym(l._serverResult.redirect);c?.collectDynamic(Dt(l.stores.matches.get()));let u=j({throwIfNotFound:!1});await l.serverSsr.dehydrate({requestAssets:u?.requestAssets,signal:r}),r.throwIfAborted();let d=tv({router:l});c?.appendResponseHeaders(d),r.throwIfAborted();let f=wv(r);return Ym(await Ve(n({request:e,router:l,responseHeaders:d}),r,f,f))};E=({context:t})=>mt({...w,contextAfterGlobalMiddlewares:t},()=>Av({getRouter:S,request:e,url:c,executeRouter:a,context:t,executedRequestMiddlewares:x}))}let D=await Tv(b.map(e=>e.options.server),E,{request:e,pathname:c.pathname,handlerType:C,context:Gg(t?.context)},r),O;try{O=await Ov(D,S,r,p&&e.headers.get(`x-tsr-serverFn`)===`true`),e.method===`HEAD`&&(O=nh(O,`HEAD body stripped`))}catch(e){throw yv(D,r.aborted?r.reason:e),e}return eh(a,O,r),r.throwIfAborted(),s=O.serverSsrCleanup===`stream`,O.response}finally{a?.serverSsr&&!s&&a.serverSsr.cleanup()}})}var Dv=new Set;async function Ov(e,t,n,r){n.throwIfAborted();let i=Ym(e),a=i.response;if(!_e(a))return i;let o=a.options,s=a.headers.get(`Location`)||o.href;if(!s&&o.to&&typeof o.to==`string`&&!o.to.startsWith(`/`))throw Error(`Server side redirects must use absolute paths via the 'href' or 'to' options. The redirect() method's "to" property accepts an internal path only. Use the "href" property to provide an external URL. Received: ${JSON.stringify(o)}`);if(!s&&[`params`,`search`,`hash`].some(e=>typeof o[e]==`function`))throw Error(`Server side redirects must use static search, params, and hash values and do not support functional values. Received functional values for: ${Object.keys(o).filter(e=>typeof o[e]==`function`).map(e=>`"${e}"`).join(`, `)}`);if(n.throwIfAborted(),s&&!oe(s,Dv))o.href=s,a.headers.set(`Location`,s);else{let e=await t();n.throwIfAborted(),e.resolveRedirect(a)}if(r){let e={...o};delete e.headers;let t=new Headers(a.headers);return t.set(`content-type`,`application/json`),th(i,Response.json({...e,isSerializedRedirect:!0},{headers:t}),`redirect response replaced`)}return i}function kv(e,t){return t.some(e=>e.options.params?.parse??e.options.parseParams)?n=>{let r=Object.assign(Object.create(null),n.params);for(let e of t){let t=e.options.params?.parse??e.options.parseParams;t&&Object.assign(r,t(r))}return e({...n,params:r})}:e}async function Av({getRouter:e,request:t,url:n,executeRouter:r,context:i,executedRequestMiddlewares:a}){let o=await e(),s=kt(o.rewrite,n).pathname,[c,l,u]=o.getMatchedRoutes(s),d=u&&l[`**`]===void 0,f=[],p=e=>r(e.context,c),m;for(let e of c){let t=e.options.server?.middleware;if(t){let e=Kg(t);for(let t of e)a.has(t)||f.push(t.options.server)}}let h=u?.options.server;if(h?.handlers&&d){let e=typeof h.handlers==`function`?h.handlers({createHandlers:e=>e}):h.handlers,n=t.method.toUpperCase(),r=n===`HEAD`?e.HEAD??e.GET??e.ANY:e[n]??e.ANY;if(r){let e=!!u.options.component;if(typeof r!=`function`&&r.middleware?.length){let e=Kg(r.middleware);for(let t of e)f.push(t.options.server)}let t=typeof r==`function`?r:r.handler;if(t){let n=kv(t,c);e?f.push(n):(p=n,m=gv)}}}return Ym(await Tv(f,p,{request:t,context:i,params:l,pathname:s,handlerType:`router`},t.signal,m))}var jv=[`__VOID_`,`__PROJECT_`],Mv=[`ISR_CACHE`];function Nv(e){return e.__VOID_ISR_DEPLOYMENT_ID!=null}var Pv=Symbol.for(`void.envContext.v1`),Fv=globalThis;Fv[Pv]??=new co;var Iv=Fv[Pv],Lv;typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`&&import(`cloudflare:workers`).then(e=>{Lv=Rv(e.env)??void 0}).catch(()=>{});function Rv(e){return typeof e!=`object`||!e||`then`in e&&typeof e.then==`function`?null:e}function zv(){return Rv(globalThis.__env__)}function Bv(){return Iv.getStore()??zv()??Lv??(()=>{throw Error(`env: Cloudflare env is unavailable. Use void runtime bindings inside Nuxt/SvelteKit/Analog server request handlers or Worker handlers.`)})()}var Vv=Symbol.for(`void.runtimeRequestScope.v1`),Hv=globalThis;Hv[Vv]??=new co;var Uv=Hv[Vv];function Wv(e,t,n){let r=Uv.getStore();if(!r){if(n)return n();throw Error(`env: Request-scoped resource is unavailable outside a runtime handler.`)}if(r.resources.has(e))return r.resources.get(e);let i=t();return r.resources.set(e,i),i}function Gv(e,t){let n=Rv(e);if(!n)return t();if(Uv.getStore())return Iv.run(n,t);let r={resources:new Map};return Iv.run(n,()=>Uv.run(r,t))}function Kv(e,t){return jv.some(t=>e.startsWith(t))?!0:Nv(t)&&Mv.includes(e)}function qv(e){return new Proxy(e,{get(e,t,n){if(!(typeof t==`string`&&Kv(t,e)))return Reflect.get(e,t,n)},has(e,t){return typeof t==`string`&&Kv(t,e)?!1:Reflect.has(e,t)},ownKeys(e){return Reflect.ownKeys(e).filter(t=>typeof t!=`string`||!Kv(t,e))},getOwnPropertyDescriptor(e,t){if(!(typeof t==`string`&&Kv(t,e)))return Reflect.getOwnPropertyDescriptor(e,t)}})}function Jv(){return qv(Bv())}function Yv(e){let t=Bv();if(!Kv(e,t))return t[e]}var Xv=class extends Error{res;status;constructor(e=500,t){super(t?.message,{cause:t?.cause}),this.res=t?.res,this.status=e}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},Zv=Symbol(),Qv=(e,t)=>new Response(e,{headers:{"Content-Type":t.replace(/^[^;]+/,e=>e.toLowerCase())}}).formData(),$v=1e4,ey=e=>`headers`in e,ty=async(e,t=Object.create(null))=>{let{all:n=!1,dot:r=!1}=t,i=(ey(e)?e.headers:e.raw.headers).get(`Content-Type`)?.split(`;`)[0].trim().toLowerCase();return i===`multipart/form-data`||i===`application/x-www-form-urlencoded`?ny(e,{all:n,dot:r}):{}};async function ny(e,t){if(!ey(e)&&e.bodyCache.formData)return ry(await e.bodyCache.formData,t);let n=ey(e)?e.headers:e.raw.headers,r=Qv(await e.arrayBuffer(),n.get(`Content-Type`)||``);ey(e)||(e.bodyCache.formData=r);let i=await r;return i?ry(i,t):{}}function ry(e,t){let n=Object.create(null),r={count:0};return e.forEach((e,r)=>{t.all||r.endsWith(`[]`)?iy(n,r,e):n[r]=e}),t.dot&&Object.entries(n).forEach(([e,t])=>{e.includes(`.`)&&(ay(n,e,t,r),delete n[e])}),n}var iy=(e,t,n)=>{e[t]===void 0?e[t]=t.endsWith(`[]`)?[n]:n:Array.isArray(e[t])?e[t].push(n):e[t]=[e[t],n]},ay=(e,t,n,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let i=e,a=t.split(`.`,34);a.length>33&&oy(),a.forEach((e,t)=>{t===a.length-1?i[e]=n:((!i[e]||typeof i[e]!=`object`||Array.isArray(i[e])||i[e]instanceof File)&&(r.count++>=$v&&oy(),i[e]=Object.create(null)),i=i[e])})},oy=()=>{throw Error(`Nesting limit exceeded`)},sy=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t=`/`,n=[[]]){this.raw=e,this.path=t,this.#t=n}param(e){return e?this.#n(e):this.#r()}#n(e){let t=this.#t[0][this.routeIndex]?.[1][e],n=this.#i(t);return n&&x(n)}#r(){let e={},t=Object.keys(this.#t[0][this.routeIndex]?.[1]??{});for(let n of t){let t=this.#i(this.#t[0][this.routeIndex][1][n]);t!==void 0&&(e[n]=x(t))}return e}#i(e){return this.#t[1]?this.#t[1][e]:e}query(e){return l(this.url,e)}queries(e){return ve(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t=Object.create(null);return this.raw.headers.forEach((e,n)=>{t[n]=e}),t}async parseBody(e){return ty(this,e)}#a=e=>{let{bodyCache:t,raw:n}=this,r=t[e];if(r)return r;for(let r in t)return t[r].then(t=>{r===`json`&&(t=JSON.stringify(t));let i=r===`formData`?void 0:n.headers.get(`content-type`);return new Response(t,{headers:i?{"Content-Type":i}:void 0})[e]()});return t[e]=n[e]()};json(){return this.#a(`text`).then(e=>JSON.parse(e))}text(){return this.#a(`text`)}arrayBuffer(){return this.#a(`arrayBuffer`)}bytes(){return this.#a(`arrayBuffer`).then(e=>new Uint8Array(e))}blob(){return this.#a(`blob`)}formData(){return this.#a(`formData`)}addValidatedData(e,t){(this.#e??={})[e]=t}valid(e){return this.#e?.[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[Zv](){return this.#t}get matchedRoutes(){return this.#t[0].map(([[,e]])=>e)}get routePath(){return this.#t[0].map(([[,e]])=>e)[this.routeIndex].path}},cy={Stringify:1,BeforeStream:2,Stream:3},ly=(e,t)=>{let n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},uy=async(e,t,n,r,i)=>{typeof e==`object`&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let a=e.callbacks;if(!a?.length)return Promise.resolve(e);i?i[0]+=e:i=[e];let o=Promise.all(a.map(e=>e({phase:t,buffer:i,context:r}))).then(e=>Promise.all(e.filter(Boolean).map(e=>uy(e,t,!1,r,i))).then(()=>i[0]));return n?ly(await o,a):o},dy=`text/plain; charset=UTF-8`,fy=(e,t)=>({"Content-Type":e,...t}),py=(e,t)=>new Response(e,t),my=class{#e;#t;env={};#n;finalized=!1;error;#r;#i;#a;#o;#s;#c;#l;#u;#d;constructor(e,t){this.#e=e,t&&(this.#i=t.executionCtx,this.env=t.env,this.#c=t.notFoundHandler,this.#d=t.path,this.#u=t.matchResult)}get req(){return this.#t??=new sy(this.#e,this.#d,this.#u),this.#t}get event(){if(this.#i&&`respondWith`in this.#i)return this.#i;throw Error(`This context has no FetchEvent`)}get executionCtx(){if(this.#i)return this.#i;throw Error(`This context has no ExecutionContext`)}get res(){return this.#a||=py(null,{headers:this.#l??=new Headers})}set res(e){if(this.#a&&e){e=py(e.body,e);for(let[t,n]of this.#a.headers.entries())if(t!==`content-type`){if(t===`set-cookie`){let t=this.#a.headers.getSetCookie();e.headers.delete(`set-cookie`);for(let n of t)e.headers.append(`set-cookie`,n)}else e.headers.set(t,n)}}this.#a=e,this.finalized=!0}render=(...e)=>(this.#s??=e=>this.html(e),this.#s(...e));setLayout=e=>this.#o=e;getLayout=()=>this.#o;setRenderer=e=>{this.#s=e};header=(e,t,n)=>{this.finalized&&(this.#a=py(this.#a.body,this.#a));let r=this.#a?this.#a.headers:this.#l??=new Headers;t===void 0?r.delete(e):n?.append?r.append(e,t):r.set(e,t)};status=e=>{this.#r=e};set=(e,t)=>{this.#n??=new Map,this.#n.set(e,t)};get=e=>this.#n?this.#n.get(e):void 0;get var(){return this.#n?Object.fromEntries(this.#n):{}}#f(e,t,n){let r=this.#a?new Headers(this.#a.headers):this.#l;if(typeof t==`object`&&t.headers){r??=new Headers;for(let[e,n]of new Headers(t.headers))e===`set-cookie`?r.append(e,n):r.set(e,n)}if(n){if(!r){let e=0;for(let t in n)if(++e>1||typeof n[t]!=`string`){r=new Headers;break}}if(r)for(let e in n){let t=n[e];if(typeof t==`string`)r.set(e,t);else{r.delete(e);for(let n of t)r.append(e,n)}}}return py(e,{status:typeof t==`number`?t:t?.status??this.#r,headers:r??n})}newResponse=(...e)=>this.#f(...e);body=(e,t,n)=>this.#f(e,t,n);text=(e,t,n)=>!this.#l&&!this.#r&&!t&&!n&&!this.finalized?new Response(e):this.#f(e,t,fy(dy,n));json=(e,t,n)=>this.#f(JSON.stringify(e),t,fy(`application/json`,n));html=(e,t,n)=>{let r=e=>this.#f(e,t,fy(`text/html; charset=UTF-8`,n));return typeof e==`object`?uy(e,cy.Stringify,!1,{}).then(r):r(e)};redirect=(e,t)=>{let n=String(e);return this.header(`Location`,/[^\x00-\xFF]/.test(n)?encodeURI(n):n),this.newResponse(null,t??302)};notFound=()=>(this.#c??=()=>py(),this.#c(this))},hy=(e,t,n)=>(r,i)=>{let a=-1;return o(0);async function o(s){if(s<=a)throw Error(`next() called multiple times`);a=s;let c,l=!1,u;if(e[s]?(u=e[s][0][0],r.req.routeIndex=s):u=s===e.length&&i||void 0,u)try{c=await u(r,()=>o(s+1))}catch(e){if(e instanceof Error&&t)r.error=e,c=await t(e,r),l=!0;else throw e}else r.finalized===!1&&n&&(c=await n(r));return c&&(r.finalized===!1||l)&&(r.res=c),r}},gy=[`get`,`post`,`put`,`delete`,`options`,`patch`,`query`],_y=`Can not add a route since the matcher is already built.`,vy=class extends Error{},yy=`__COMPOSED_HANDLER`,by=e=>e.text(`404 Not Found`,404),xy=(e,t)=>{if(`getResponse`in e){let n=e.getResponse();return t.newResponse(n.body,n)}return console.error(e),t.text(`Internal Server Error`,500)},Sy=class e{get;post;put;delete;options;patch;query;all;on;use;router;getPath;_basePath=`/`;#e=`/`;routes=[];constructor(e={}){[...gy,`all`].forEach(e=>{this[e]=(t,...n)=>{let r=e.toUpperCase();return typeof t==`string`?this.#e=t:this.#r(r,this.#e,t),n.forEach(e=>{this.#r(r,this.#e,e)}),this}}),this.on=(e,t,...n)=>{for(let r of[t].flat()){this.#e=r;for(let t of[e].flat()){let e=t.toUpperCase();for(let t of n)this.#r(e,this.#e,t)}}return this},this.use=(e,...t)=>(typeof e==`string`?this.#e=e:(this.#e=`*`,t.unshift(e)),t.forEach(e=>{this.#r(`ALL`,this.#e,e)}),this);let{strict:t,...n}=e;Object.assign(this,n),this.getPath=t??!0?e.getPath??N:se}#t(){let t=new e({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#n=this.#n,t.routes=this.routes,t}#n=by;errorHandler=xy;route(e,t){let n=this.basePath(e);return t.routes.map(e=>{let r;t.errorHandler===xy?r=e.handler:(r=async(n,r)=>(await hy([],t.errorHandler)(n,()=>e.handler(n,r))).res,r[yy]=e.handler),n.#r(e.method,e.path,r,e.basePath)}),this}basePath(e){let t=this.#t();return t._basePath=C(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#n=e,this);mount(e,t,n){let r,i;n&&(typeof n==`function`?i=n:(i=n.optionHandler,r=n.replaceRequest===!1?e=>e:n.replaceRequest));let a=i?e=>{let t=i(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};return r||=(()=>{let t=C(this._basePath,e),n=t===`/`?0:t.length;return e=>{let t=new URL(e.url);return t.pathname=this.getPath(e).slice(n)||`/`,new Request(t,e)}})(),this.#r(`ALL`,C(e,`*`),async(e,n)=>{let i=await t(r(e.req.raw),...a(e));if(i)return i;await n()}),this}#r(e,t,n,r){t=C(this._basePath,t);let i={basePath:r===void 0?this._basePath:C(this._basePath,r),path:t,method:e,handler:n};this.router.add(e,t,[n,i]),this.routes.push(i)}#i(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#a(e,t,n,r){if(r===`HEAD`)return(async()=>new Response(null,await this.#a(e,t,n,`GET`)))();let i=this.getPath(e,{env:n}),a=this.router.match(r,i),o=new my(e,{path:i,matchResult:a,env:n,executionCtx:t,notFoundHandler:this.#n});if(a[0].length===1){let e;try{e=a[0][0][0][0](o,async()=>{o.res=await this.#n(o)})}catch(e){return this.#i(e,o)}return e instanceof Promise?e.then(e=>e||(o.finalized?o.res:this.#n(o))).catch(e=>this.#i(e,o)):e??this.#n(o)}let s=hy(a[0],this.errorHandler,this.#n);return(async()=>{try{let e=await s(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#i(e,o)}})()}fetch=(e,...t)=>this.#a(e,t[1],t[0],e.method);request=(e,t,n,r)=>e instanceof Request?this.fetch(t?new Request(e,t):e,n,r):(e=e.toString(),this.fetch(new Request(/^https?:\/\//.test(e)?e:`http://localhost${C(`/`,e)}`,t),n,r));fire=()=>{addEventListener(`fetch`,e=>{e.respondWith(this.#a(e.request,e,void 0,e.request.method))})}},Cy=()=>Object.create(null),wy=[];function Ty(e,t){let n=this.buildAllMatchers(),r=((e,t)=>{let r=n[e]||n.ALL,i=r[2][t];if(i)return i;let a=t.match(r[0]);if(!a)return[[],wy];let o=a.indexOf(``,1);return[r[1][o],a]});return this.match=r,r(e,t)}var Ey=`[^/]+`,Dy=`(?:|/.*)`,Oy=Symbol(),ky=new Set(`.\\+*[^]$()`);function Ay(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1?1:e===`.*`||e===`(?:|/.*)`?t===`(?:|/.*)`?-1:1:t===`.*`||t===`(?:|/.*)`?-1:e===`[^/]+`?1:t===`[^/]+`?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var jy=class e{#e;#t;#n=Cy();insert(t,n,r,i,a){let o=this;for(let n=0,a=t.length;n<a;n++){let s=t[n],c=s.length===1?s===`*`?n===a-1?[``,``,`.*`]:[``,``,Ey]:null:s===`/*`?[``,``,Dy]:s.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),l;if(c){let t=c[1],n=c[2]||`[^/]+`;if(t&&c[2]&&(n===`.*`||(n=n.replace(/^\((?!\?:)(?=[^)]+\)$)/,`(?:`),/\((?!\?:)/.test(n))||n.length===1&&ky.has(n)))throw Oy;if(l=o.#n[n],!l){if(n!==`.*`&&n!==`(?:|/.*)`){for(let e in o.#n)if((n.length>1||e.length>1)&&e!==`.*`&&e!==`(?:|/.*)`)throw Oy}l=o.#n[n]=new e}t!==``&&(l.#t??=i.varIndex++,r.push([t,l.#t]))}else if(l=o.#n[s],!l){for(let e in o.#n)if(e.length>1&&e!==`.*`&&e!==`(?:|/.*)`)throw Oy;l=o.#n[s]=new e}o=l}if(o.#e!==void 0)throw Oy;o.#e=a?-1:n}buildRegExpStr(){let e=Object.keys(this.#n).sort(Ay).map(e=>{let t=this.#n[e],n=t.buildRegExpStr();return n===``?``:(typeof t.#t==`number`?`(${e})@${t.#t}`:ky.has(e)?`\\${e}`:e)+n}).filter(Boolean);return typeof this.#e==`number`&&this.#e!==-1&&e.unshift(`#${this.#e}`),e.length===0?``:e.length===1?e[0]:`(?:`+e.join(`|`)+`)`}},My=class{#e={varIndex:0};#t=new jy;#n=0;paths=Cy();insert(e,t){if(t){this.#t.insert(e.split(``),0,[],this.#e,!0);return}let n=[],r=[],i=e;for(let e=0;;){let t=!1;if(i=i.replace(/\{[^}]+\}/g,n=>{let i=`@\\${e}`;return r[e]=[i,n],e++,t=!0,i}),!t)break}let a=i.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=r.length-1;e>=0;e--){let[t]=r[e];for(let n=a.length-1;n>=0;n--)if(a[n].indexOf(t)!==-1){a[n]=a[n].replace(t,r[e][1]);break}}this.#t.insert(a,this.#n,n,this.#e,!1),this.paths[e]=[this.#n++,n]}buildRegExp(){let e=this.#t.buildRegExpStr();if(e===``)return[/^$/,[],[]];let t=0,n=[],r=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(e,i,a)=>i===void 0?(a===void 0||(r[Number(a)]=++t),``):(n[++t]=Number(i),`$()`)),[RegExp(`^${e}`),n,r]}},Ny=Cy();function Py(e){return Ny[e]??=RegExp(`^${e.replace(/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,(e,t)=>t?`\\${t}`:e===`/*`?Dy:e===`*`?`.*`:`/:${Ey}`)}$`)}function Fy(e,t){for(let n of Object.keys(e).sort((e,t)=>t.length-e.length))if(Py(n).test(t))return[...e[n]]}var Iy=class{name=`RegExpRouter`;#e;#t;#n;constructor(){this.#e={ALL:Cy()},this.#t={ALL:Cy()},this.#n={ALL:new My}}#r(e,t){try{this.#n[e].insert(t,!/\*|\/:/.test(t))}catch(e){throw e===Oy?new vy(t):e}}add(e,t,n){let r=this.#e,i=this.#t;if(!r)throw Error(_y);if(!r[e]){this.#n[e]=new My;for(let t of[r,i]){t[e]=Cy();for(let n in t.ALL)t[e][n]=[...t.ALL[n]],this.#r(e,n)}}t===`/*`&&(t=`*`);let a=e===`ALL`?Object.keys(r):[e];if(/\*$/.test(t)){let e=Py(t);for(let e of a)r[e][t]||(this.#r(e,t),r[e][t]=Fy(r[e],t)||Fy(r.ALL,t)||[]);for(let o of[r,i])for(let r of a)for(let i in o[r])e.test(i)&&o[r][i].push([n,t]);return}let o=D(t)||[t];for(let e of o)for(let t of a)i[t][e]||(this.#r(t,e),i[t][e]=Fy(r[t],e)||Fy(r.ALL,e)||[]),i[t][e].push([n,e])}match=Ty;buildAllMatchers(){let e=Cy();for(let t of Object.keys(this.#t))e[t]=this.#i(t);return this.#e=this.#t=this.#n=void 0,Ny=Cy(),e}#i(e){let t=this.#e[e],n=this.#t[e],r=this.#n[e],i=Cy(),a=[],[o,s,c]=r.buildRegExp();for(let e of[t,n])for(let t in e){let n=e[t],o=r.paths[t];o?a[o[0]]=n.map(([e,t])=>[e,r.paths[t][1].reduceRight((e,[t],n)=>(e[t]=c[o[1][n][1]],e),Cy())]):i[t]=[n.map(([e])=>[e,Cy()]),wy]}return[o,s.map(e=>a[e]),i]}},Ly=class{name=`SmartRouter`;#e=[];#t=[];constructor(e){this.#e=e.routers}add(e,t,n){if(!this.#t)throw Error(_y);this.#t.push([e,t,n])}match(e,t){if(!this.#t)throw Error(`Fatal error`);let n=this.#e,r=this.#t,i=n.length,a=0,o;for(;a<i;a++){let i=n[a];try{for(let e=0,t=r.length;e<t;e++)i.add(...r[e]);o=i.match(e,t)}catch(e){if(e instanceof vy)continue;throw e}this.match=i.match.bind(i),this.#e=[i],this.#t=void 0;break}if(a===i)throw Error(`Fatal error`);return this.name=`SmartRouter + ${this.activeRouter.name}`,o}get activeRouter(){if(this.#t||this.#e.length!==1)throw Error(`No active router has been determined yet.`);return this.#e[0]}},Ry=Cy(),zy=0,By=class e{#e=[];#t=Cy();#n=[];#r;#i=Ry;insert(t,n,r){let i=this,a=xe(n),o=new Set,s=0;for(let t of a){let n=a[++s],r=Lt(t,n)||(n===void 0&&t&&t.indexOf(`*`)===t.length-1?t:null),c=Array.isArray(r),l=c?r[0]:r||t,u=i.#t[l]||=new e;r&&!u.#r&&(u.#r=r,i.#n.push(u)),i=u,c&&o.add(r[1])}i.#e.push({[t]:{handler:r,possibleKeys:[...o],score:++zy}})}#a(e,t,n,r,i){for(let a=0,o=t.#e.length;a<o;a++){let o=t.#e[a],s=o[n]||o.ALL;if(s){s.params=Cy(),e.push(s);for(let e=0,t=s.possibleKeys.length;e<t;e++){let t=s.possibleKeys[e];s.params[t]=i?.[t]&&!e?i[t]:r[t]??i?.[t]}}}}search(e,t){let n=[];this.#i=Ry;let r=[this],i=he(t),a=[],o=i.length,s=null;for(let c=0;c<o;c++){let l=i[c],u=c===o-1,d=[];for(let f=0,p=r.length;f<p;f++){let p=r[f],m=p.#t[l];m&&(m.#i=p.#i,u?(m.#t[`*`]&&this.#a(n,m.#t[`*`],e,p.#i),this.#a(n,m,e,p.#i)):d.push(m));for(let r of p.#n){let f=r.#r,m=p.#i===Ry?{}:{...p.#i};if(typeof f==`string`){(f===`*`||l.startsWith(f.slice(0,-1)))&&(this.#a(n,r,e,p.#i),f===`*`&&(r.#i=m,d.push(r)));continue}let[,h,g]=f;if(l||g!==!0){if(g!==!0){if(!s){s=[];let e=+(t[0]===`/`);for(let t=0;t<o;t++)s[t]=e,e+=i[t].length+1}let l=t.slice(s[c]),u=g.exec(l);if(u){m[h]=u[0],this.#a(n,r,e,p.#i,m),u[0].length===l.length&&r.#t[`*`]&&this.#a(n,r.#t[`*`],e,p.#i,m);for(let e in r.#t){r.#i=m;let e=u[0].match(/\//g)?.length??0;(a[e]||=[]).push(r);break}continue}}(g===!0||g.test(l))&&(m[h]=l,u?(this.#a(n,r,e,m,p.#i),r.#t[`*`]&&this.#a(n,r.#t[`*`],e,m,p.#i)):(r.#i=m,d.push(r)))}}}let f=a.shift();r=f?d.concat(f):d}return n[1]&&n.sort((e,t)=>e.score-t.score),[n.map(({handler:e,params:t})=>[e,t])]}},Vy=class{name=`TrieRouter`;#e=new By;add(e,t,n){for(let r of D(t)||[t])this.#e.insert(e,r,n)}match(e,t){return this.#e.search(e,t)}},Hy=class extends Sy{constructor(e={}){super(e),this.router=e.router??new Ly({routers:[new Iy,new Vy]})}},Uy=(...e)=>async function(t,n){let r=!1,i=()=>(r=!0,n()),a,o;for(let n of e)try{let e=await n(t,i);if(e===!0&&!t.finalized)await i();else if(e===!1){a=Error(`No successful middleware found`);continue}else e&&e!==!0&&(o=e);a=void 0;break}catch(e){if(a=e,r)break}if(a)throw a;return o},Wy=(...e)=>async function(t,n){let r=t.req.routeIndex;await hy(e.map(e=>[[async(t,n)=>{t.req.routeIndex=r;let i=await e(t,n);if(i===!1)throw Error(`Unmet condition`);return i}]]))(t,n)},Gy=(e,...t)=>{let n,r=(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==`string`)n||=new Vy,n.add(`ALL`,e,!0);else return e}).filter(Boolean);n&&r.unshift(e=>!!n?.match(`ALL`,e.req.path)?.[0]?.[0]?.[0]);let i=Uy(e=>r.some(t=>t(e)),Wy(...t));return async function(e,t){await i(e,t)}},Ky=[`same-origin`,`same-site`,`none`,`cross-site`],qy=e=>Ky.includes(e),Jy=/^(GET|HEAD|OPTIONS)$/,Yy=/^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i,Xy=e=>{let t=(e=>e?typeof e==`string`?t=>t===e:typeof e==`function`?e:t=>e.includes(t):(e,t)=>e===new URL(t.req.url).origin)(e?.origin),n=async(e,n)=>e!==void 0&&await t(e,n),r=(e=>e?typeof e==`string`?t=>t===e:typeof e==`function`?e:t=>e.includes(t):e=>e===`same-origin`)(e?.secFetchSite),i=async(e,t)=>e===void 0||!qy(e)?!1:await r(e,t);return async function(e,t){if(!Jy.test(e.req.method)&&Yy.test(e.req.header(`content-type`)||`text/plain`)&&!await i(e.req.header(`sec-fetch-site`),e)&&!await n(e.req.header(`origin`),e))throw new Xv(403,{res:new Response(`Forbidden`,{status:403})});await t()}},Zy={crossOriginEmbedderPolicy:[`Cross-Origin-Embedder-Policy`,`require-corp`],crossOriginResourcePolicy:[`Cross-Origin-Resource-Policy`,`same-origin`],crossOriginOpenerPolicy:[`Cross-Origin-Opener-Policy`,`same-origin`],originAgentCluster:[`Origin-Agent-Cluster`,`?1`],referrerPolicy:[`Referrer-Policy`,`no-referrer`],strictTransportSecurity:[`Strict-Transport-Security`,`max-age=15552000; includeSubDomains`],xContentTypeOptions:[`X-Content-Type-Options`,`nosniff`],xDnsPrefetchControl:[`X-DNS-Prefetch-Control`,`off`],xDownloadOptions:[`X-Download-Options`,`noopen`],xFrameOptions:[`X-Frame-Options`,`SAMEORIGIN`],xPermittedCrossDomainPolicies:[`X-Permitted-Cross-Domain-Policies`,`none`],xXssProtection:[`X-XSS-Protection`,`0`]},Qy={crossOriginEmbedderPolicy:!1,crossOriginResourcePolicy:!0,crossOriginOpenerPolicy:!0,originAgentCluster:!0,referrerPolicy:!0,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!0,xDownloadOptions:!0,xFrameOptions:!0,xPermittedCrossDomainPolicies:!0,xXssProtection:!0,removePoweredBy:!0,permissionsPolicy:{}},$y=e=>{let t={...Qy,...e},n=eb(t),r=[];if(t.contentSecurityPolicy){let[e,i]=tb(t.contentSecurityPolicy,`Content-Security-Policy`);e&&r.push(e),n.push([`Content-Security-Policy`,i])}if(t.contentSecurityPolicyReportOnly){let[e,i]=tb(t.contentSecurityPolicyReportOnly,`Content-Security-Policy-Report-Only`);e&&r.push(e),n.push([`Content-Security-Policy-Report-Only`,i])}return t.permissionsPolicy&&Object.keys(t.permissionsPolicy).length>0&&n.push([`Permissions-Policy`,nb(t.permissionsPolicy)]),t.reportingEndpoints&&n.push([`Reporting-Endpoints`,ib(t.reportingEndpoints)]),t.reportTo&&n.push([`Report-To`,ab(t.reportTo)]),async function(e,i){let a=r.length===0?n:r.reduce((t,n)=>n(e,t),n);await i(),ob(e,a),t?.removePoweredBy&&e.res.headers.delete(`X-Powered-By`)}};function eb(e){return Object.entries(Zy).filter(([t])=>e[t]).map(([t,n])=>{let r=e[t];return typeof r==`string`?[n[0],r]:n})}function tb(e,t){let n=[],r=[];for(let[t,i]of Object.entries(e)){let e=Array.isArray(i)?i:[i];e.forEach((e,i)=>{if(typeof e==`function`){let a=i*2+2+r.length;n.push((n,r)=>{r[a]=e(n,t)})}}),r.push(t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>t?`-`+e.toLowerCase():e.toLowerCase()),...e.flatMap(e=>[` `,e]),`; `)}return r.pop(),n.length===0?[void 0,r.join(``)]:[(e,r)=>r.map(r=>{if(r[0]===t){let t=r[1].slice();return n.forEach(n=>{n(e,t)}),[r[0],t.join(``)]}return r}),r]}function nb(e){return Object.entries(e).map(([e,t])=>{let n=rb(e);return typeof t==`boolean`?`${n}=${t?`*`:`()`}`:Array.isArray(t)?t.length===0?`${n}=()`:t.length===1&&t[0]===`*`?`${n}=*`:t.length===1&&t[0]===`none`?`${n}=()`:`${n}=(${t.map(e=>[`self`,`src`].includes(e)?e:`"${e}"`).join(` `)})`:``}).filter(Boolean).join(`, `)}function rb(e){return e.replace(/([a-z\d])([A-Z])/g,`$1-$2`).toLowerCase()}function ib(e=[]){return e.map(e=>`${e.name}="${e.url}"`).join(`, `)}function ab(e=[]){return e.map(e=>JSON.stringify(e)).join(`, `)}function ob(e,t){t.forEach(([t,n])=>{e.res.headers.set(t,n)})}var sb=e=>async function(t,n){if(e?.alwaysRedirect&&(t.req.method===`GET`||t.req.method===`HEAD`)&&t.req.path!==`/`&&t.req.path.at(-1)===`/`){let e=new URL(t.req.url);return e.pathname=e.pathname.substring(0,e.pathname.length-1),t.redirect(e.toString(),301)}if(await n(),!e?.alwaysRedirect&&t.res.status===404&&(t.req.method===`GET`||t.req.method===`HEAD`)&&t.req.path!==`/`&&t.req.path.at(-1)===`/`){let e=new URL(t.req.url);e.pathname=e.pathname.substring(0,e.pathname.length-1),t.res=t.redirect(e.toString(),301)}},cb=`<redacted>`,lb=`VOID_ENV_UNMASK`;function ub(e,t,n={}){return n.unmask||typeof e!=`string`||e.length===0?t:t.split(e).join(cb)}var db=null;function fb(){if(db!==null)return db;try{db=globalThis.process?.env?.[lb]===`1`}catch{db=!1}return db&&console.error(`[void/env] ${lb}=1 is set — env validation errors will include raw values. Unset it before sharing logs.`),db}var pb=Symbol.for(`void.env.registry`),mb=globalThis,hb=mb[pb]??={schema:null,hasDefineEnvBeenCalled:!1,bootValidation:null},gb=new WeakMap,_b=[];function vb(e){let t=gb.get(e);return t||(t=new Map,gb.set(e,t),_b.push(t)),t}function yb(){return Object.fromEntries(Object.entries({BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!0,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`}).filter(([e])=>e.startsWith(`VITE_`)))}var bb=class extends Error{key;issues;constructor(e,t){super(`Invalid env "${e}": ${t.map(e=>e.message).join(`, `)}`),this.name=`EnvValidationError`,this.key=e,this.issues=t}};function xb(e){let t=Bv();if(Kv(e,t))return;let n=Jv(),r=yb(),i=Object.hasOwn(r,e)?r[e]:n[e];if(!hb.schema)return i;let a=hb.schema[e];if(!a)return i;let o=vb(t);if(o.has(e))return o.get(e);let s=a[`~standard`].validate(i);if(s instanceof Promise)throw Error(`env: Async validator for '${e}' cannot be resolved synchronously. Proxy property access is synchronous, so async Standard Schema validators must be pre-resolved by calling \`_validateEnvOnce(env)\` at worker boot (Void splices this into the generated entry) or by awaiting \`validateAllEnv(env)\` before the first \`env.${e}\` read. Once pre-validated, the resolved value is cached and served synchronously here.`);if(s.issues){let t=fb();throw new bb(e,s.issues.map(e=>({...e,message:ub(i,e.message,{unmask:t})})))}return o.set(e,s.value),s.value}var Sb=new Proxy({},{get(e,t){if(typeof t!=`symbol`)return xb(t)},has(e,t){return typeof t==`symbol`?!1:Object.hasOwn(yb(),t)||Reflect.has(Jv(),t)},ownKeys(){return[...new Set([...Reflect.ownKeys(Jv()),...Object.keys(yb())])]},getOwnPropertyDescriptor(e,t){if(typeof t!=`symbol`)return{enumerable:!0,configurable:!0,value:xb(String(t))}}});function Cb(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}var wb;(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(wb=`jose/v6.2.12`);var Tb=Symbol();async function Eb(e,t,n,r=fetch){let i=await r(e,{method:`GET`,signal:n,redirect:`manual`,headers:t}).catch(e=>{throw e.name===`TimeoutError`?new fr:e});if(i.status!==200)throw new Ur(`Expected 200 OK from the JSON Web Key Set HTTP response`);try{return await i.json()}catch{throw new Ur(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}var Db=Symbol();function Ob(e,t){return Number.isFinite(e)&&Date.now()<e+t}function kb(e,t,n){if(Number.isNaN(e))throw TypeError(`"${n}" option must not be NaN`);return typeof e==`number`?e:t}function Ab(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);let n=new URL(e.href).href,r=t??{},i=r.timeoutDuration;if(typeof i==`number`&&(!Number.isInteger(i)||i<0))throw TypeError(`"timeoutDuration" option must be a non-negative integer`);let a=typeof i==`number`?i:5e3,o=kb(r.cooldownDuration,3e4,`cooldownDuration`),s=kb(r.cacheMaxAge,6e5,`cacheMaxAge`),c=new Headers(r.headers);wb&&!c.has(`User-Agent`)&&c.set(`User-Agent`,wb),c.has(`accept`)||c.set(`accept`,`application/json, application/jwk-set+json`);let l=r[Tb],u=r[Db],d,f,p=0,m=0,h;if(u&&typeof u==`object`){let{uat:e,jwks:t}=u;Ob(e,s)&&sr(t)&&(d=e,h=ri(t))}let g=async()=>{if(f&&Cb()&&(f=void 0),!f){let e=++p,t=f=Eb(n,c,AbortSignal.timeout(a),l).then(t=>{let n=ri(t);if(e<=m)return;h=n;let r=Date.now();u&&(u.uat=r,u.jwks=t),d=r,m=e}).finally(()=>{f===t&&(f=void 0)})}await f};return Object.defineProperties(async(e,t)=>{(!h||!Ob(d,s))&&await g();try{return await h(e,t)}catch(n){if(n instanceof ei&&!Ob(d,o))return await g(),h(e,t);throw n}},{coolingDown:{get:()=>Ob(d,o),enumerable:!0},fresh:{get:()=>Ob(d,s),enumerable:!0},reload:{value:g,enumerable:!0},reloading:{get:()=>!!f,enumerable:!0},jwks:{value:()=>h?.jwks(),enumerable:!0}})}var jb={N:16384,r:16,p:1,dkLen:64};function Mb(e,t){return new Promise((n,r)=>{fo(e.normalize(`NFKC`),t,jb.dkLen,{N:jb.N,r:jb.r,p:jb.p,maxmem:128*jb.N*jb.r*2},(e,t)=>{e?r(e):n(t)})})}async function Nb(e){let t=uo(16).toString(`hex`);return`${t}:${(await Mb(e,t)).toString(`hex`)}`}async function Pb(e,t){let[n,r]=e.split(`:`);if(!n||!r)throw Error(`Invalid password hash`);return(await Mb(t,n)).toString(`hex`)===r}var Fb=Nb,Ib=async({hash:e,password:t})=>Pb(e,t),Lb=[`state`,`client_id`,`redirect_uri`,`response_type`,`code_challenge`,`code_challenge_method`,`nonce`,`scope`],Rb=new Set(Lb);async function zb({id:e,options:t,authorizationEndpoint:n,state:r,codeVerifier:i,scopes:a,claims:o,redirectURI:s,duration:c,prompt:l,accessType:u,responseType:d,display:f,loginHint:p,nonce:m,hd:h,responseMode:g,additionalParams:_,scopeJoiner:v}){t=typeof t==`function`?await t():t;let y=new URL(t.authorizationEndpoint||n);y.searchParams.set(`response_type`,d||`code`);let b=_i(t.clientId);if(!b)throw Error(`OAuth provider requires clientId`);if(y.searchParams.set(`client_id`,b),y.searchParams.set(`state`,r),a?.length&&y.searchParams.set(`scope`,a.join(v||` `)),y.searchParams.set(`redirect_uri`,t.redirectURI||s),c&&y.searchParams.set(`duration`,c),f&&y.searchParams.set(`display`,f),p&&y.searchParams.set(`login_hint`,p),m&&y.searchParams.set(`nonce`,m),l&&y.searchParams.set(`prompt`,l),h&&y.searchParams.set(`hd`,h),u&&y.searchParams.set(`access_type`,u),g&&y.searchParams.set(`response_mode`,g),i){let e=await kn(i);y.searchParams.set(`code_challenge_method`,`S256`),y.searchParams.set(`code_challenge`,e)}if(o){let e=o.reduce((e,t)=>(e[t]=null,e),{});y.searchParams.set(`claims`,JSON.stringify({id_token:{email:null,email_verified:null,...e}}))}if(_)for(let[e,t]of Object.entries(_))Rb.has(e)||y.searchParams.set(e,t);return y}var Bb=Rt(z(),z()).refine(e=>!Object.keys(e).some(e=>Rb.has(e)),{message:`additionalParams cannot include reserved OAuth parameters: ${Lb.join(`, `)}`}).meta({description:`Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).`}).optional();function Vb(e,t){return t===`basic`?{method:`client_secret_basic`}:e.clientSecret?{method:`client_secret_post`}:{method:`none`}}function Hb(e,t,n){if(t.clientSecret||n.has(`client_secret`))throw Error(`${e} token endpoint authentication cannot be combined with clientSecret`)}function Ub(e,t){t&&e.set(`client_id`,t)}function Wb(e,t){if(!t.clientSecret)throw Error(`${e} token endpoint authentication requires clientSecret`)}function Gb(e,t){if(!t)throw Error(`${e} token endpoint authentication requires clientId`)}function Kb({body:e,options:t,clientId:n,requireClientSecret:r}){r&&Wb(`client_secret_post`,t),t.clientSecret&&(Gb(`client_secret_post`,n),Ub(e,n),e.set(`client_secret`,t.clientSecret))}function qb({headers:e,options:t,clientId:n,body:r}){if(r.has(`client_secret`))throw Error(`client_secret_basic token endpoint authentication cannot be combined with client_secret body parameters`);Wb(`client_secret_basic`,t),Gb(`client_secret_basic`,n),e.authorization=Cn(n,t.clientSecret)}function Jb(e){if(e.has(`client_assertion`)!==e.has(`client_assertion_type`))throw Error(`client_assertion and client_assertion_type must both be provided`)}async function Yb({body:e,headers:t,options:n,tokenEndpoint:r,grantType:i,tokenEndpointAuth:a,authentication:o}){Jb(e);let s=_i(n.clientId);if(e.has(`client_assertion`)){if(a)throw Error(`client_assertion body parameters cannot be combined with tokenEndpointAuth`);Hb(`private_key_jwt`,n,e),Ub(e,s);return}let c=a??Vb(n,o);if(c.method===`custom`)await c.customizeRequest({body:e,headers:t,options:n,tokenEndpoint:r,grantType:i}),Jb(e);else if(c.method===`private_key_jwt`){if(Hb(c.method,n,e),Gb(c.method,s),!r)throw Error(`private_key_jwt token endpoint authentication requires tokenEndpoint`);let t=await Ln({getClientAssertion:c.getClientAssertion,context:{clientId:s,tokenEndpoint:r,grantType:i}});Ub(e,s);for(let[n,r]of Object.entries(t))e.set(n,r)}else if(c.method===`none`){if(Hb(c.method,n,e),i===`client_credentials`)throw Error(`none token endpoint authentication cannot be used with client_credentials grant`);Gb(c.method,s),Ub(e,s)}else c.method===`client_secret_basic`?qb({headers:t,options:n,clientId:s,body:e}):Kb({body:e,options:n,clientId:s,requireClientSecret:a?.method===`client_secret_post`})}var Xb=new Set([`grant_type`,`refresh_token`,`__proto__`,`constructor`,`prototype`]);async function Zb({refreshToken:e,options:t,authentication:n,tokenEndpointAuth:r,tokenEndpoint:i,extraParams:a,resource:o}){t=typeof t==`function`?await t():t;let s=$b({refreshToken:e,options:t,extraParams:a,resource:o});return await Yb({body:s.body,headers:s.headers,options:t,tokenEndpoint:i??``,grantType:`refresh_token`,tokenEndpointAuth:r,authentication:n}),s}function Qb(e,t){if(t)for(let[n,r]of Object.entries(t))Xb.has(n)||e.set(n,r)}function $b({refreshToken:e,options:t,extraParams:n,resource:r}){let i=new URLSearchParams,a={"content-type":`application/x-www-form-urlencoded`,accept:`application/json`};if(i.set(`grant_type`,`refresh_token`),i.set(`refresh_token`,e),r){if(typeof r==`string`)i.append(`resource`,r);else for(let e of r)i.append(`resource`,e)}return n&&Qb(i,n),{body:i,headers:a}}async function ex({refreshToken:e,options:t,tokenEndpoint:n,authentication:r,tokenEndpointAuth:i,extraParams:a,resource:o}){let{body:s,headers:c}=await Zb({refreshToken:e,options:t,authentication:r,tokenEndpointAuth:i,tokenEndpoint:n,extraParams:a,resource:o}),{data:l,error:u}=await jn(n,{method:`POST`,body:s,headers:c});if(u)throw u;let d={accessToken:l.access_token,refreshToken:l.refresh_token,tokenType:l.token_type,scopes:Yn(l.scope),idToken:l.id_token};return l.expires_in&&(d.accessTokenExpiresAt=new Date(new Date().getTime()+l.expires_in*1e3)),l.refresh_token_expires_in&&(d.refreshTokenExpiresAt=new Date(new Date().getTime()+l.refresh_token_expires_in*1e3)),d}async function tx({code:e,codeVerifier:t,redirectURI:n,options:r,authentication:i,tokenEndpointAuth:a,tokenEndpoint:o,deviceId:s,headers:c,additionalParams:l={},resource:u}){r=typeof r==`function`?await r():r;let d=nx({code:e,codeVerifier:t,redirectURI:n,options:r,deviceId:s,headers:c,additionalParams:l,resource:u});return await Yb({body:d.body,headers:d.headers,options:r,tokenEndpoint:o??``,grantType:`authorization_code`,tokenEndpointAuth:a,authentication:i}),d}function nx({code:e,codeVerifier:t,redirectURI:n,options:r,deviceId:i,headers:a,additionalParams:o={},resource:s}){let c=new URLSearchParams,l={"content-type":`application/x-www-form-urlencoded`,accept:`application/json`,...a};if(c.set(`grant_type`,`authorization_code`),c.set(`code`,e),t&&c.set(`code_verifier`,t),r.clientKey&&c.set(`client_key`,r.clientKey),i&&c.set(`device_id`,i),c.set(`redirect_uri`,r.redirectURI||n),s){if(typeof s==`string`)c.append(`resource`,s);else for(let e of s)c.append(`resource`,e)}for(let[e,t]of Object.entries(o))c.has(e)||c.append(e,t);return{body:c,headers:l}}async function rx({code:e,codeVerifier:t,redirectURI:n,options:r,tokenEndpoint:i,authentication:a,tokenEndpointAuth:o,deviceId:s,headers:c,additionalParams:l={},resource:u}){let{body:d,headers:f}=await tx({code:e,codeVerifier:t,redirectURI:n,options:r,authentication:a,tokenEndpointAuth:o,tokenEndpoint:i,deviceId:s,headers:c,additionalParams:l,resource:u}),{data:p,error:m}=await jn(i,{method:`POST`,body:d,headers:f});if(m)throw m;return Vn(p)}async function ix(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function ax(e,t,n=`exact`){return typeof e==`string`?e===t||n===`exact-or-sha256`&&e===await ix(t):!1}function ox(e){let t=e.options??{};return!t.disableIdTokenSignIn&&!!(e.idToken||t.verifyIdToken)}async function sx(e,t,n,r){let i=e.options??{};if(i.disableIdTokenSignIn)return!1;try{if(i.verifyIdToken)return await i.verifyIdToken(t,n,r);let a=e.idToken;if(!a)return!1;if(`verify`in a)return await a.verify(t,n,r);if(t.split(`.`).length!==3)return a.allowOpaqueToken===!0;let{alg:o}=zn(t),{payload:s}=await Zr(t,a.jwks,{issuer:a.issuer,audience:a.audience,algorithms:a.algorithms??(o?[o]:void 0),maxTokenAge:a.maxTokenAge,clockTolerance:30});return!(n&&!await ax(s.nonce,n,a.nonceComparison)||a.verifyClaims&&!a.verifyClaims(s))}catch{return!1}}var cx=/[\u0000-\u001f\u007f-\u009f]/,lx=`https://better-auth.invalid`,ux=/%2[fF]|%5[cC]/,dx=e=>{let t=e;try{t=decodeURIComponent(e)}catch{}let n=[];for(let e of t.split(`/`))e===`..`?n.pop():e!==`.`&&e!==``&&n.push(e);return n.length>0?`/${n.join(`/`)}`:``},fx=e=>{if(cx.test(e))return null;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t).toLowerCase(),r=e.slice(t+1),i=``;if(r.startsWith(`//`)){r=r.slice(2);let e=r.search(/[/?#]/);e===-1?(i=r,r=``):(i=r.slice(0,e),r=r.slice(e))}let a=r.search(/[?#]/),o=dx(a===-1?r:r.slice(0,a));return{scheme:n,authority:i.toLowerCase(),path:o}},px=e=>{if(!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||cx.test(e))return!1;let t=e.search(/[?#]/),n=t===-1?e:e.slice(0,t);if(ux.test(n))return!1;try{return new URL(e,lx).origin===lx}catch{return!1}},mx=(e,t,n)=>{if(e.startsWith(`/`))return n?.allowRelativePaths===!0&&px(e);if(t.includes(`*`)||t.includes(`?`)){if(t.includes(`://`))return li(t)(qr(e)||e);let n=xr(e);return n?li(t)(n):!1}let r=Rr(e);if(r===`http:`||r===`https:`||!r)return t===qr(e);let i=fx(e),a=fx(t);return!i||!a||i.scheme!==a.scheme||a.authority&&i.authority!==a.authority?!1:!a.path||i.path===a.path||i.path.startsWith(`${a.path}/`)};function hx(e,t,n){let r=!1;return function(...i){return r||=((n?.warn??console.warn)(`[Deprecation] ${t}`),!0),e.apply(this,i)}}function gx(e){return e.context.skipOriginCheck===!0&&e.context.options.advanced?.disableCSRFCheck===void 0}function _x(e){let t=e.context.skipOriginCheck;if(t===!0)return!0;if(Array.isArray(t)&&e.request)try{let n=new URL(e.context.baseURL).pathname,r=si(e.request.url,n);return t.some(e=>{let t=e.replace(/\/+$/,``);return r===t||r.startsWith(`${t}/`)})}catch{}return!1}var vx=hx(function(){},`disableOriginCheck: true currently also disables CSRF checks. In a future version, disableOriginCheck will ONLY disable URL validation. To keep CSRF disabled, add disableCSRFCheck: true to your config.`),yx=ur(async e=>{if(e.request?.method===`GET`||e.request?.method===`OPTIONS`||e.request?.method===`HEAD`||!e.request||(await xx(e),_x(e)))return;let{body:t,query:n}=e,r=t?.callbackURL||n?.callbackURL,i=t?.redirectTo,a=t?.errorCallbackURL,o=t?.newUserCallbackURL,s=(t,n)=>{if(t){if(typeof t!=`string`)throw H.fromStatus(`BAD_REQUEST`,{message:`Invalid ${n}: expected a string`});if(!e.context.isTrustedOrigin(t,{allowRelativePaths:n!==`origin`}))throw e.context.logger.error(`Invalid ${n}: ${t}`),e.context.logger.info(`If it's a valid URL, please add ${t} to trustedOrigins in your auth config\n`,`Current list of trustedOrigins: ${e.context.trustedOrigins}`),n===`origin`?H.from(`FORBIDDEN`,V.INVALID_ORIGIN):n===`callbackURL`?H.from(`FORBIDDEN`,V.INVALID_CALLBACK_URL):n===`redirectURL`?H.from(`FORBIDDEN`,V.INVALID_REDIRECT_URL):n===`errorCallbackURL`?H.from(`FORBIDDEN`,V.INVALID_ERROR_CALLBACK_URL):n===`newUserCallbackURL`?H.from(`FORBIDDEN`,V.INVALID_NEW_USER_CALLBACK_URL):H.fromStatus(`FORBIDDEN`,{message:`Invalid ${n}`})}};r&&s(r,`callbackURL`),i&&s(i,`redirectURL`),a&&s(a,`errorCallbackURL`),o&&s(o,`newUserCallbackURL`)}),bx=e=>ur(async t=>{if(!t.request||_x(t))return;let n=e(t),r=(e,n)=>{if(e&&!t.context.isTrustedOrigin(e,{allowRelativePaths:n!==`origin`}))throw t.context.logger.error(`Invalid ${n}: ${e}`),t.context.logger.info(`If it's a valid URL, please add ${e} to trustedOrigins in your auth config\n`,`Current list of trustedOrigins: ${t.context.trustedOrigins}`),n===`origin`?H.from(`FORBIDDEN`,V.INVALID_ORIGIN):n===`callbackURL`?H.from(`FORBIDDEN`,V.INVALID_CALLBACK_URL):n===`redirectURL`?H.from(`FORBIDDEN`,V.INVALID_REDIRECT_URL):n===`errorCallbackURL`?H.from(`FORBIDDEN`,V.INVALID_ERROR_CALLBACK_URL):n===`newUserCallbackURL`?H.from(`FORBIDDEN`,V.INVALID_NEW_USER_CALLBACK_URL):H.fromStatus(`FORBIDDEN`,{message:`Invalid ${n}`})},i=Array.isArray(n)?n:[n];for(let e of i)r(e,`callbackURL`)});async function xx(e,t=!1){let n=e.request?.headers;if(!n||!e.request)return;let r=n.get(`origin`),i=r||n.get(`referer`)||``,a=n.has(`cookie`);if(e.context.skipCSRFCheck)return;if(gx(e)){e.context.options.advanced?.disableOriginCheck===!0&&vx();return}if(_x(e)||!(t||a))return;let o=r===`null`&&n.get(`sec-fetch-site`)===`same-origin`?gr(void 0,e.context.options.basePath,e.request,!1,e.context.options.advanced?.trustedProxyHeaders):void 0,s=(o?qr(o):void 0)??i;if(!s||s===`null`)throw H.from(`FORBIDDEN`,V.MISSING_OR_NULL_ORIGIN);let c=Array.isArray(e.context.options.trustedOrigins)?e.context.trustedOrigins:[...e.context.trustedOrigins,...(await e.context.options.trustedOrigins?.(e.request))?.filter(e=>!!e)||[]];if(!c.some(e=>mx(s,e)))throw e.context.logger.error(`Invalid origin: ${s}`),e.context.logger.info(`If it's a valid URL, please add ${s} to trustedOrigins in your auth config\n`,`Current list of trustedOrigins: ${c}`),H.from(`FORBIDDEN`,V.INVALID_ORIGIN)}var Sx=ur(async e=>{e.request&&await Cx(e)});async function Cx(e){let t=e.request;if(!t||e.context.skipCSRFCheck||gx(e))return;let n=t.headers;if(n.has(`cookie`))return await xx(e);let r=n.get(`Sec-Fetch-Site`),i=n.get(`Sec-Fetch-Mode`),a=n.get(`Sec-Fetch-Dest`);if(r&&r.trim()||i&&i.trim()||a&&a.trim()){if(r===`cross-site`&&i===`navigate`)throw e.context.logger.error(`Blocked cross-site navigation login attempt (CSRF protection)`,{secFetchSite:r,secFetchMode:i,secFetchDest:a}),H.from(`FORBIDDEN`,V.CROSS_SITE_NAVIGATION_LOGIN_BLOCKED);return await xx(e,!0)}if(n.get(`origin`)||n.get(`referer`))return await xx(e,!0)}var wx=new Map,Tx=1e5;function Ex(){let e=Date.now();for(let[t,n]of wx)e>=n.expiresAt&&wx.delete(t);if(wx.size<=Tx)return;let t=wx.size-Tx,n=0;for(let e of wx.keys())if(wx.delete(e),++n>=t)break}function Dx(e,t,n){let r=t.window*1e3;return e?n-e.lastRequest>=r?{next:{...e,count:1,lastRequest:n},update:!0,allowed:!0,retryAfter:null}:e.count>=t.max?{next:e,update:!0,allowed:!1,retryAfter:kx(e.lastRequest,t.window)}:{next:{...e,count:e.count+1,lastRequest:n},update:!0,allowed:!0,retryAfter:null}:{next:{key:``,count:1,lastRequest:n},update:!1,allowed:!0,retryAfter:null}}function Ox(e){return new Response(JSON.stringify({message:`Too many requests. Please try again later.`}),{status:429,statusText:`Too Many Requests`,headers:{"Content-Type":`application/json`,"X-Retry-After":e.toString()}})}function kx(e,t){let n=Date.now(),r=t*1e3;return Math.ceil((e+r-n)/1e3)}function Ax(e){let t=`rateLimit`,n=e.adapter,r=Math.max(...jx(e)),i=async e=>{let r=(await n.findMany({model:t,where:[{field:`key`,value:e}]}))[0];return typeof r?.lastRequest==`bigint`&&(r.lastRequest=Number(r.lastRequest)),r},a=async(e,s)=>{s.window>r&&(r=s.window);let c=s.window*1e3,l=await i(e),u=Date.now();if(!l)try{return await n.create({model:t,data:{key:e,count:1,lastRequest:u}}),{allowed:!0,retryAfter:null}}catch(t){if(!await i(e))throw t;return a(e,s)}if(u-l.lastRequest>=c)return await n.incrementOne({model:t,where:[{field:`key`,value:e},{field:`lastRequest`,operator:`lte`,value:l.lastRequest}],increment:{},set:{count:1,lastRequest:u}})?(await o(u),{allowed:!0,retryAfter:null}):a(e,s);let d=u-c;if(await n.incrementOne({model:t,where:[{field:`key`,value:e},{field:`lastRequest`,operator:`gt`,value:d},{field:`count`,operator:`lt`,value:s.max}],increment:{count:1},set:{lastRequest:u}}))return{allowed:!0,retryAfter:null};let f=await i(e);return!f||u-f.lastRequest>=c?a(e,s):{allowed:!1,retryAfter:kx(f.lastRequest,s.window)}},o=async i=>{let a=i-r*1e3;await e.runInBackgroundOrAwait(n.deleteMany({model:t,where:[{field:`lastRequest`,operator:`lt`,value:a}]}).then(()=>void 0).catch(t=>e.logger.error(`Error pruning rate limit rows`,t)))};return{consume:a}}function jx(e){let t=[e.rateLimit.window,...Lx().map(e=>e.window)];for(let n of e.options.plugins||[])n.rateLimit&&t.push(...n.rateLimit.map(e=>e.window));if(e.rateLimit.customRules)for(let n of Object.values(e.rateLimit.customRules))n&&typeof n!=`function`&&t.push(n.window);let n=t.filter(e=>Number.isFinite(e)&&e>0);return n.length>0?n:[e.rateLimit.window]}function Mx(e,t){if(e.options.rateLimit?.customStorage)return e.options.rateLimit.customStorage;let n=e.rateLimit.storage;if(n===`secondary-storage`){let t=t=>t??e.options.rateLimit?.window??10,n=e.options.secondaryStorage?.increment;if(!n)throw new U(`Secondary-storage rate limiting requires SecondaryStorage.increment.`);return{consume:async(e,r)=>await n(e,t(r.window))<=r.max?{allowed:!0,retryAfter:null}:{allowed:!1,retryAfter:r.window}}}if(n===`memory`){let t=t=>t??e.options.rateLimit?.window??10;return{async consume(e,n){Ex();let r=Date.now(),i=wx.get(e),a=Dx(i&&r<i.expiresAt?i.data:void 0,n,r);return a.allowed&&wx.set(e,{data:{...a.next,key:e},expiresAt:r+t(n.window)*1e3}),{allowed:a.allowed,retryAfter:a.retryAfter}}}}return Ax(e)}var Nx=!1,Px=`no-trusted-ip`;async function Fx(e,t){let n=new URL(t.baseURL).pathname,r=si(e.url,n),i=t.rateLimit.window,a=t.rateLimit.max,o=pr(e,t.options);if(!o&&t.options.advanced?.ipAddress?.disableIpTracking)return null;!o&&!Nx&&(t.logger.warn("Rate limiting could not determine a client IP and is falling back to a single shared per-path bucket. Ensure your runtime forwards a trusted client IP header, then set `advanced.ipAddress.ipAddressHeaders` or `advanced.ipAddress.trustedProxies` so the address can be resolved."),Nx=!0);let s=Wr(o??Px,r),c=Lx().find(e=>e.pathMatcher(r));c&&(i=c.window,a=c.max);for(let e of t.options.plugins||[])if(e.rateLimit){let t=e.rateLimit.find(e=>e.pathMatcher(r));if(t){i=t.window,a=t.max;break}}if(t.rateLimit.customRules){let n=Object.keys(t.rateLimit.customRules).find(e=>e.includes(`*`)?li(e)(r):e===r);if(n){let r=t.rateLimit.customRules[n],o=typeof r==`function`?await r(e,{window:i,max:a}):r;if(o&&(i=o.window,a=o.max),o===!1)return null}}return{key:s,currentWindow:i,currentMax:a}}async function Ix(e,t){if(!t.rateLimit.enabled)return;let n=await Fx(e,t);if(!n)return;let{key:r,currentWindow:i,currentMax:a}=n,o=Mx(t,{window:i}),s={window:i,max:a},{allowed:c,retryAfter:l}=await o.consume(r,s);if(!c)return Ox(l??i)}function Lx(){return[{pathMatcher(e){return e.startsWith(`/sign-in`)||e.startsWith(`/sign-up`)||e.startsWith(`/change-password`)||e.startsWith(`/change-email`)},window:10,max:3},{pathMatcher(e){return e===`/request-password-reset`||e===`/send-verification-email`||e.startsWith(`/forget-password`)||e===`/email-otp/send-verification-otp`||e===`/email-otp/request-password-reset`},window:60,max:3}]}var Rx=`better-auth.session-cache+jwt`,zx=`better-auth:session-cache`;function Bx(e){let t={clockTolerance:15,audience:e?.audience??`better-auth:session-cache`};return e?.issuer&&(t.issuer=e.issuer),t}function Vx(e){let t=_n(e);return!t||typeof e.iss!=`string`||!e.iss||e.sub!==t.user.id||e.sid!==t.session.token?null:{...e,...t}}function Hx(e){if(!e?.method)throw new H(`FORBIDDEN`,{code:`validation_source_missing`,message:`User validation source is required`});if(e.method===`oauth`&&!e.oauth?.providerId)throw new H(`FORBIDDEN`,{code:`validation_source_missing`,message:`OAuth user validation source requires oauth.providerId`});if((e.method===`sso-oidc`||e.method===`sso-saml`)&&!e.sso?.providerId)throw new H(`FORBIDDEN`,{code:`validation_source_missing`,message:`SSO user validation source requires sso.providerId`})}async function Ux(e,t){let n=e.context.options.user?.validateUserInfo;if(!n)return;Hx(t.source);let r;try{r=await n(t,e)}catch(t){throw e.context.logger.error(`validateUserInfo callback threw`,t),new H(`FORBIDDEN`,{code:`validation_failed`,message:`User validation failed`})}if(r?.error)throw new H(`FORBIDDEN`,{code:r.error,message:r.errorDescription||r.error})}var Wx=async e=>{let t=await Yr(`SHA-256`).digest(new TextEncoder().encode(e));return Ui.encode(new Uint8Array(t),{padding:!1})};async function Gx(e,t){return!t||t===`plain`?e:t===`hashed`?Wx(e):typeof t==`object`&&`hash`in t?t.hash(e):e}function Kx(e,t){if(t){if(typeof t==`object`&&`default`in t){if(t.overrides){for(let[n,r]of Object.entries(t.overrides))if(e.startsWith(n))return r}return t.default}return t}}function qx(e,t){let n=Di(t.options),r=t.hooks;async function i(t,i,a){let o=Un(),s=t;for(let{source:e,hooks:t}of r){let r=t[i]?.create?.before;if(r){let t=await n(`db create.before ${i}`,{[ci]:`create.before`,[Ri]:i,[ir]:e},()=>r(s,o));if(t===!1)return null;typeof t==`object`&&`data`in t&&(s={...s,...t.data})}}let c=null;(!a||a.executeMainFn)&&(c=await(await vr(e)).create({model:i,data:s,forceAllowId:!0})),a?.fn&&(c=await a.fn(c??s));for(let{source:e,hooks:t}of r){let r=t[i]?.create?.after;r&&await ii(async()=>{await n(`db create.after ${i}`,{[ci]:`create.after`,[Ri]:i,[ir]:e},()=>r(c,o))})}return c}async function a(t,i,a,o){let s=Un(),c=t;for(let{source:e,hooks:i}of r){let r=i[a]?.update?.before;if(r){let i=await n(`db update.before ${a}`,{[ci]:`update.before`,[Ri]:a,[ir]:e},()=>r(t,s));if(i===!1)return null;typeof i==`object`&&`data`in i&&(c={...c,...i.data})}}let l=o?await o.fn(c):null,u=!o||o.executeMainFn?await(await vr(e)).update({model:a,update:c,where:i}):l;for(let{source:e,hooks:t}of r){let r=t[a]?.update?.after;r&&await ii(async()=>{await n(`db update.after ${a}`,{[ci]:`update.after`,[Ri]:a,[ir]:e},()=>r(u,s))})}return u}async function o(t,i,a,o){let s=Un(),c=t;for(let{source:e,hooks:i}of r){let r=i[a]?.update?.before;if(r){let i=await n(`db updateMany.before ${a}`,{[ci]:`updateMany.before`,[Ri]:a,[ir]:e},()=>r(t,s));if(i===!1)return null;typeof i==`object`&&`data`in i&&(c={...c,...i.data})}}let l=o?await o.fn(c):null,u=!o||o.executeMainFn?await(await vr(e)).updateMany({model:a,update:c,where:i}):l;for(let{source:e,hooks:t}of r){let r=t[a]?.update?.after;r&&await ii(async()=>{await n(`db updateMany.after ${a}`,{[ci]:`updateMany.after`,[Ri]:a,[ir]:e},()=>r(u,s))})}return u}async function s(t,i,a){let o=Un(),s=null;try{s=(await(await vr(e)).findMany({model:i,where:t,limit:1}))[0]||null}catch{}if(s)for(let{source:e,hooks:t}of r){let r=t[i]?.delete?.before;if(r&&await n(`db delete.before ${i}`,{"better_auth.hook.type":`delete.before`,"db.collection.name":i,"better_auth.context":e},()=>r(s,o))===!1)return null}let c=a?await a.fn(t):null,l=(!a||a.executeMainFn)&&s?await(await vr(e)).delete({model:i,where:t}):c;if(s)for(let{source:e,hooks:t}of r){let r=t[i]?.delete?.after;r&&await ii(async()=>{await n(`db delete.after ${i}`,{[ci]:`delete.after`,[Ri]:i,[ir]:e},()=>r(s,o))})}return l}async function c(t,i,a){let o=Un(),s=[];try{s=await(await vr(e)).findMany({model:i,where:t})}catch{}for(let e of s)for(let{source:t,hooks:a}of r){let r=a[i]?.delete?.before;if(r&&await n(`db delete.before ${i}`,{"better_auth.hook.type":`delete.before`,"db.collection.name":i,"better_auth.context":t},()=>r(e,o))===!1)return null}let c=a?await a.fn(t):null,l=!a||a.executeMainFn?await(await vr(e)).deleteMany({model:i,where:t}):c;for(let e of s)for(let{source:t,hooks:a}of r){let r=a[i]?.delete?.after;r&&await ii(async()=>{await n(`db delete.after ${i}`,{[ci]:`delete.after`,[Ri]:i,[ir]:t},()=>r(e,o))})}return l}async function l(t,i,a,o){let s=Un(),c=r.flatMap(({source:e,hooks:n})=>{let r=n[t]?.delete?.before;return r?[{source:e,fn:r}]:[]}),l=o??null;if(c.length){if(!l)try{l=(await(await vr(e)).findMany({model:t,where:i,limit:1}))[0]||null}catch{}if(l){for(let{source:e,fn:r}of c)if(await n(`db delete.before ${t}`,{"better_auth.hook.type":`delete.before`,"db.collection.name":t,"better_auth.context":e},()=>r(l,s))===!1)return null}}let u=await a();if(!u)return null;for(let{source:e,hooks:i}of r){let r=i[t]?.delete?.after;r&&await ii(async()=>{await n(`db delete.after ${t}`,{[ci]:`delete.after`,[Ri]:t,[ir]:e},()=>r(u,s))})}return u}return{createWithHooks:i,updateWithHooks:a,updateManyWithHooks:o,deleteWithHooks:s,deleteManyWithHooks:c,consumeOneWithHooks:l}}function Jx(e,t=Date.now()){let n=typeof e==`number`?e:e.getTime();return Math.max(Math.floor((n-t)/1e3),0)}var Yx=(e,t)=>{let n=t.logger,r=t.options,i=r.secondaryStorage,a=new Map,o=r.session?.expiresIn||604800,s=!!i&&r.session?.storeSessionInDatabase===!0&&r.session?.preserveSessionInDatabase!==!0,{createWithHooks:c,updateWithHooks:l,updateManyWithHooks:u,deleteWithHooks:d,deleteManyWithHooks:f,consumeOneWithHooks:p}=qx(e,t),m=t=>{let n=[...t,{field:`expiresAt`,value:new Date,operator:`gt`}];return f(n,`session`,{fn:async()=>{await(await vr(e)).updateMany({model:`session`,where:n,update:{expiresAt:new Date}})},executeMainFn:!1})};async function h(e){if(!i)return;let t=await i.get(`active-sessions-${e.id}`);if(!t)return;let n=Date.now(),r=(Ai(t)||[]).filter(e=>e.expiresAt>n);await Promise.all(r.map(async({token:t})=>{let r=await i.get(t);if(!r)return;let a=Ai(r);if(!a)return;let o=Jx(a.session.expiresAt,n);await i.set(t,JSON.stringify({session:a.session,user:e}),Math.floor(o))}))}async function g(e){if(!i)return[];let t=await i.get(`active-sessions-${e}`);return t&&Ai(t)||[]}async function _(e,t){if(!i)return;let n=new Set(t.map(e=>e.token));for(let{token:e}of t)await i.delete(e);let r=`active-sessions-${e}`,a=await g(e),o=Date.now(),s=a.filter(e=>e.expiresAt>o&&!n.has(e.token));s.sort((e,t)=>e.expiresAt-t.expiresAt);let c=s.at(-1)?.expiresAt;c?await i.set(r,JSON.stringify(s),Jx(c,o)):await i.delete(r)}async function v(e,t){if(!i)return;let r=t??await g(e);await ii(()=>_(e,r),{onError(e){n.error(`Failed to delete committed user sessions from secondary storage`,e)}})}async function y(e,t){let n=a.get(e)??Promise.resolve(),r,i=new Promise(e=>{r=e}),o=n.catch(()=>{}).then(()=>i);a.set(e,o),await n.catch(()=>{});try{return await t()}finally{r(),a.get(e)===o&&a.delete(e)}}return{createOAuthUser:async(t,n)=>Qr(e,async()=>{let e=await c({createdAt:new Date,updatedAt:new Date,...t,email:t.email?.toLowerCase()},`user`,void 0);if(!e)throw new H(`BAD_REQUEST`,{message:`Failed to create user`});return{user:e,account:await c({...n,userId:e.id,createdAt:new Date,updatedAt:new Date},`account`,void 0)}}),createUser:async(e,t)=>{let i={createdAt:new Date,updatedAt:new Date,...e,email:e.email?.toLowerCase()};if(r.user?.validateUserInfo){let e={...t,action:`create-user`};Hx(e);let r;try{r=pi()}catch(e){throw n.error(`Unable to run validateUserInfo: missing endpoint context`,e),new H(`FORBIDDEN`,{code:`validation_context_missing`,message:`User validation requires an endpoint context`})}await Ux(r,{user:i,source:e})}return await c(i,`user`,void 0)},createAccount:async e=>await c({createdAt:new Date,updatedAt:new Date,...e},`account`,void 0),listSessions:async(n,r)=>{if(s)return(await(await vr(e)).findMany({model:`session`,where:[{field:`userId`,value:n},{field:`expiresAt`,value:new Date,operator:`gt`}]})).map(e=>Jr(t.options,e));if(i){let e=await i.get(`active-sessions-${n}`);if(!e)return[];let r=Ai(e)||[],a=Date.now(),o=new Set,s=[];for(let{token:e,expiresAt:n}of r){if(n<=a||o.has(e))continue;o.add(e);let r=await i.get(e);if(r)try{let e=typeof r==`string`?JSON.parse(r):r;if(!e?.session)continue;s.push(Jr(t.options,{...e.session,expiresAt:new Date(e.session.expiresAt)}))}catch{continue}}return s}return await(await vr(e)).findMany({model:`session`,where:[{field:`userId`,value:n},...r?.onlyActiveSessions?[{field:`expiresAt`,value:new Date,operator:`gt`}]:[]]})},listUsers:async(t,n,r,i)=>await(await vr(e)).findMany({model:`user`,limit:t,offset:n,sortBy:r,where:i}),countTotalUsers:async t=>{let n=await(await vr(e)).count({model:`user`,where:t});return typeof n==`string`?parseInt(n):n},deleteUser:async e=>{let t=await g(e);(!i||r.session?.storeSessionInDatabase)&&await f([{field:`userId`,value:e}],`session`,void 0),await f([{field:`userId`,value:e}],`account`,void 0),await d([{field:`id`,value:e}],`user`,void 0)!==null&&await v(e,t)},createSession:async(a,l,u,d,f)=>{let p=await(async()=>{let e=Un();return e?.headers||e?.request?.headers})(),m=r.session?.storeSessionInDatabase,h=f?.deferSecondaryStorageWrites===!0&&s,{id:g,..._}=u||{},v;if(i&&!m){let e=t.generateId({model:`session`});v=e===!1?Pi():e}let y=xn(r),b={...v?{id:v}:{},ipAddress:p&&pr(p,r)||``,userAgent:p?.get(`user-agent`)||``,..._,expiresAt:ln(l?86400:o,`sec`),userId:a,token:Pi(32),createdAt:new Date,updatedAt:new Date,...y,...d?_:{}},x=async t=>{if(!i)return t;let n=await i.get(`active-sessions-${a}`),r=[],o=Date.now();n&&(r=Ai(n)||[],r=r.filter(e=>e.expiresAt>o&&e.token!==b.token));let s=[...r,{token:b.token,expiresAt:b.expiresAt.getTime()}].sort((e,t)=>e.expiresAt-t.expiresAt),c=Jx(s.at(-1)?.expiresAt??b.expiresAt.getTime(),o);c>0&&await i.set(`active-sessions-${a}`,JSON.stringify(s),c);let l=await(await vr(e)).findOne({model:`user`,where:[{field:`id`,value:a}]}),u=Jx(b.expiresAt,o);return u>0&&await i.set(b.token,JSON.stringify({session:t,user:l}),u),t};return await c(b,`session`,i?{fn:async e=>h?(await ii(async()=>{await x(e)},{onError(e){n.error(`Failed to mirror committed session to secondary storage`,e)}}),e):x(e),executeMainFn:m}:void 0)},findSession:async n=>{if(i){let e=await i.get(n);if(!e&&(!r.session?.storeSessionInDatabase||t.options.session?.preserveSessionInDatabase))return null;if(e){let n=Ai(e);return n?{session:Jr(t.options,{...n.session,expiresAt:new Date(n.session.expiresAt),createdAt:new Date(n.session.createdAt),updatedAt:new Date(n.session.updatedAt)}),user:er(t.options,{...n.user,createdAt:new Date(n.user.createdAt),updatedAt:new Date(n.user.updatedAt)})}:null}}let a=await(await vr(e)).findOne({model:`session`,where:[{value:n,field:`token`}],join:{user:!0}});if(!a)return null;let{user:o,...s}=a;return o?{session:Jr(t.options,s),user:er(t.options,o)}:null},findSessions:async(t,n)=>{let r=[...new Set(t)],a=new Map,o=[];if(i)for(let e of r){let t=await i.get(e);if(t)try{let r=typeof t==`string`?JSON.parse(t):t;if(!r)continue;let i=new Date(r.session.expiresAt);if(n?.onlyActiveSessions&&i<=new Date)continue;let o={session:{...r.session,expiresAt:new Date(r.session.expiresAt)},user:{...r.user,createdAt:new Date(r.user.createdAt),updatedAt:new Date(r.user.updatedAt)}};a.set(e,o)}catch{continue}else o.push(e)}let c=i?o:r;if(c.length>0&&(!i||s)){let t=await(await vr(e)).findMany({model:`session`,limit:c.length,where:[{field:`token`,value:c,operator:`in`},...n?.onlyActiveSessions?[{field:`expiresAt`,value:new Date,operator:`gt`}]:[]],join:{user:!0}});for(let{user:e,...n}of t)e&&a.set(n.token,{session:n,user:e})}return r.flatMap(e=>{let t=a.get(e);return t?[t]:[]})},updateSession:async(e,n)=>await l(n,[{field:`token`,value:e}],`session`,i?{async fn(n){let r=await i.get(e);if(!r)return null;let a=Ai(r);if(!a)return null;let o={...a.session,...n,expiresAt:new Date(n.expiresAt??a.session.expiresAt),createdAt:new Date(a.session.createdAt),updatedAt:new Date(n.updatedAt??a.session.updatedAt)},s=Jr(t.options,o),c=Date.now(),l=new Date(s.expiresAt).getTime(),u=Jx(l,c);if(u>0){await i.set(e,JSON.stringify({session:s,user:a.user}),u);let t=`active-sessions-${s.userId}`,n=await i.get(t),r=(n&&Ai(n)||[]).filter(t=>t.token!==e&&t.expiresAt>c).concat([{token:e,expiresAt:l}]).sort((e,t)=>e.expiresAt-t.expiresAt),o=r.at(-1)?.expiresAt;o&&o>c?await i.set(t,JSON.stringify(r),Jx(o,c)):await i.delete(t)}return s},executeMainFn:r.session?.storeSessionInDatabase}:void 0),deleteSession:async e=>{if(i){let a=await i.get(e);if(a){let{session:t}=Ai(a)??{};if(!t){n.error(`Session not found in secondary storage`);return}let r=t.userId,o=await i.get(`active-sessions-${r}`);if(o){let t=Ai(o)||[],n=Date.now(),a=t.filter(t=>t.expiresAt>n&&t.token!==e),s=a.sort((e,t)=>e.expiresAt-t.expiresAt).at(-1)?.expiresAt;a.length>0&&s&&s>Date.now()?await i.set(`active-sessions-${r}`,JSON.stringify(a),Jx(s,n)):await i.delete(`active-sessions-${r}`)}else n.error(`Active sessions list not found in secondary storage`)}if(await i.delete(e),!r.session?.storeSessionInDatabase)return;if(t.options.session?.preserveSessionInDatabase){await m([{field:`token`,value:e}]);return}}await d([{field:`token`,value:e}],`session`,void 0)},deleteAccounts:async e=>{await f([{field:`userId`,value:e}],`account`,void 0)},deleteAccount:async e=>{await d([{field:`id`,value:e}],`account`,void 0)},deleteUserSessions:async e=>{let n=await g(e);if(i){if(!r.session?.storeSessionInDatabase){await v(e,n);return}if(t.options.session?.preserveSessionInDatabase){await m([{field:`userId`,value:e}])!==null&&await v(e,n);return}}await f([{field:`userId`,value:e}],`session`,void 0)!==null&&await v(e,n)},deleteSessions:async e=>{if(i){if(await Promise.all(e.map(e=>i.delete(e))),!r.session?.storeSessionInDatabase)return;if(t.options.session?.preserveSessionInDatabase){await m([{field:`token`,value:e,operator:`in`}]);return}}await f([{field:`token`,value:e,operator:`in`}],`session`,void 0)},findAccountOwnerByKey:async({providerId:t,accountId:n})=>{let r=await(await vr(e)).findMany({model:`account`,where:[{field:`providerId`,value:t},{field:`accountId`,value:n}],limit:2,join:{user:!0}});if(r.length>1)throw new U(`Multiple accounts match the same accountId for provider ${JSON.stringify(t)}. Resolve duplicate account identities before continuing.`);let i=r[0];if(!i)return null;let{user:a,...o}=i;return a?{kind:`owned`,user:a,account:o}:{kind:`orphaned`,account:o}},findUserByEmail:async(t,n)=>{let r=await(await vr(e)).findOne({model:`user`,where:[{value:t.toLowerCase(),field:`email`}],join:{...n?.includeAccounts?{account:!0}:{}}});if(!r)return null;let{account:i,...a}=r;return{user:a,accounts:i??[]}},findUserById:async t=>t?await(await vr(e)).findOne({model:`user`,where:[{field:`id`,value:t}]}):null,linkAccount:async e=>await c({createdAt:new Date,updatedAt:new Date,...e},`account`,void 0),updateUser:async(e,t)=>{let r=await l({...t,...t.email?{email:t.email.toLowerCase()}:{}},[{field:`id`,value:e}],`user`,void 0);return await ii(()=>h(r),{onError(e){n.error(`Failed to refresh committed user sessions in secondary storage`,e)}}),r},updateUserByEmail:async(e,t)=>{let r=await l({...t,...t.email?{email:t.email.toLowerCase()}:{}},[{field:`email`,value:e.toLowerCase()}],`user`,void 0);return await ii(()=>h(r),{onError(e){n.error(`Failed to refresh committed user sessions in secondary storage`,e)}}),r},updatePassword:async(e,t)=>{await u({password:t},[{field:`userId`,value:e},{field:`providerId`,value:`credential`},{field:`accountId`,value:e}],`account`,void 0)},findAccounts:async t=>await(await vr(e)).findMany({model:`account`,where:[{field:`userId`,value:t}]}),findCredentialAccount:async t=>(await vr(e)).findOne({model:`account`,where:[{field:`userId`,value:t},{field:`providerId`,value:`credential`},{field:`accountId`,value:t}]}),findAccountByKey:async({providerId:t,accountId:n})=>{let r=await(await vr(e)).findMany({model:`account`,limit:2,where:[{field:`providerId`,value:t},{field:`accountId`,value:n}]});if(r.length>1)throw new U(`Multiple accounts match the same accountId for provider ${JSON.stringify(t)}. Resolve duplicate account identities before continuing.`);return r[0]??null},findAccountByUserId:async t=>await(await vr(e)).findMany({model:`account`,where:[{field:`userId`,value:t}]}),updateAccount:async(e,t)=>await l(t,[{field:`id`,value:e}],`account`,void 0),createVerificationValue:async e=>{let t=Kx(e.identifier,r.verification?.storeIdentifier),n=await Gx(e.identifier,t);return await c({createdAt:new Date,updatedAt:new Date,...e,identifier:n},`verification`,i?{async fn(e){let t=Jx(e.expiresAt);return t>0&&await i.set(`verification:${n}`,JSON.stringify(e),t),e},executeMainFn:r.verification?.storeInDatabase}:void 0)},findVerificationValue:async t=>{let n=Kx(t,r.verification?.storeIdentifier),a=await Gx(t,n);if(i){let e=await i.get(`verification:${a}`);if(e){let t=Ai(e);if(t)return t}if(n&&n!==`plain`){let e=await i.get(`verification:${t}`);if(e){let t=Ai(e);if(t)return t}}if(!r.verification?.storeInDatabase)return null}let o=await vr(e);async function s(e){return o.findMany({model:`verification`,where:[{field:`identifier`,value:e}],sortBy:{field:`createdAt`,direction:`desc`},limit:1})}let c=await s(a);return!c.length&&n&&n!==`plain`&&(c=await s(t)),r.verification?.disableCleanup||await f([{field:`expiresAt`,value:new Date,operator:`lt`}],`verification`,void 0),c[0]||null},deleteVerificationByIdentifier:async e=>{let t=await Gx(e,Kx(e,r.verification?.storeIdentifier));i&&await i.delete(`verification:${t}`),(!i||r.verification?.storeInDatabase)&&await d([{field:`identifier`,value:t}],`verification`,void 0)},consumeVerificationValue:async t=>{let n=Kx(t,r.verification?.storeIdentifier),a=await Gx(t,n),o=n&&n!==`plain`?[a,t]:[a],s=e=>{if(!e)return null;let t=typeof e==`string`?Ai(e):typeof e==`object`?e:null;if(!t)return null;let n=new Date(t.expiresAt);return Number.isFinite(n.getTime())?{...t,expiresAt:n}:null},c=null;if(i&&!r.verification?.storeInDatabase){let e=async e=>s(await i.getAndDelete(e));for(let t of o){let n=await e(`verification:${t}`);if(n){await Promise.all(o.filter(e=>e!==t).map(e=>i.delete(`verification:${e}`))),c=n;break}}}else{let t=async t=>y(`verification:${t}`,()=>Qr(e,async()=>{let n=await vr(e),r=[{field:`identifier`,value:t}],i=(await n.findMany({model:`verification`,where:r,sortBy:{field:`createdAt`,direction:`desc`},limit:1}))[0]??null;return i?p(`verification`,[{field:`id`,value:i.id}],async()=>{let e=await n.consumeOne({model:`verification`,where:[{field:`id`,value:i.id}]});return e?(await n.deleteMany({model:`verification`,where:r}),e):null},i):null}));for(let e of o)if(c=await t(e),c)break;c&&i&&await Promise.all(o.map(e=>i.delete(`verification:${e}`)))}return!c||c.expiresAt<new Date?null:c},reserveVerificationValue:async t=>{let n=Vi(new Uint8Array(await Yr(`SHA-256`).digest(new TextEncoder().encode(`reserve:`+t.identifier))),r),a=Kx(t.identifier,r.verification?.storeIdentifier),o=await Gx(t.identifier,a);if(i&&!r.verification?.storeInDatabase)throw new U(`reserveVerificationValue requires database-backed verification storage. Set verification.storeInDatabase to true for flows that reserve verification values.`);try{await e.create({model:`verification`,data:{id:n,identifier:o,value:t.value,expiresAt:t.expiresAt,createdAt:new Date,updatedAt:new Date},forceAllowId:!0})}catch(t){if(await e.findOne({model:`verification`,where:[{field:`id`,value:n}]}))return!1;throw t}if(i){let e=Jx(t.expiresAt);e>0&&await i.set(`verification:${o}`,JSON.stringify({id:n,identifier:o,value:t.value,expiresAt:t.expiresAt}),e)}return!0},updateVerificationByIdentifier:async(e,t)=>{let n=await Gx(e,Kx(e,r.verification?.storeIdentifier));if(i){let e=await i.get(`verification:${n}`);if(e){let a=Ai(e);if(a){let e={...a,...t},o=e.expiresAt??a.expiresAt,s=Jx(o instanceof Date?o:new Date(o));if(s>0&&await i.set(`verification:${n}`,JSON.stringify(e),s),!r.verification?.storeInDatabase)return e}}}return!i||r.verification?.storeInDatabase?await l(t,[{field:`identifier`,value:n}],`verification`,void 0):t},refreshUserSessions:h}};async function Xx(e){let t=e.options,n=t.plugins||[],r=[],i=[];for(let a of n)if(a.init){let n=a.init(e),o;if(o=On(n)?await n:n,typeof o==`object`){if(o.options){let{databaseHooks:e,trustedOrigins:n,...s}=o.options;e&&i.push({source:`plugin:${a.id}`,hooks:e}),n&&r.push(n),t=Sr(t,s)}o.context&&Object.assign(e,o.context)}}if(r.length>0){let e=[...t.trustedOrigins?[t.trustedOrigins]:[],...r],n=e.filter(Array.isArray).flat(),i=e.filter(e=>typeof e==`function`);i.length>0?t.trustedOrigins=async e=>{let t=await Promise.all(i.map(t=>t(e)));return[...n,...t.flat()].filter(e=>typeof e==`string`&&e!==``)}:t.trustedOrigins=n}t.databaseHooks&&i.push({source:`user`,hooks:t.databaseHooks}),e.internalAdapter=Yx(e.adapter,{options:t,logger:e.logger,hooks:i,generateId:e.generateId}),e.options=t}function Zx(e){return e.advanced?.crossSubDomainCookies?.enabled,[]}async function Qx(e,t){let n=[];if(Tr(e.baseURL)){let t=e.baseURL.allowedHosts,r=e.baseURL.protocol;for(let e of t)e.includes(`://`)?n.push(e):((!r||r===`https`||r===`auto`)&&n.push(`https://${e}`),(r===`http`||r===`auto`||wr(e))&&n.push(`http://${e}`));if(e.baseURL.fallback)try{n.push(new URL(e.baseURL.fallback).origin)}catch{}}else{let r=gr(typeof e.baseURL==`string`?e.baseURL:void 0,e.basePath,t);r&&n.push(new URL(r).origin)}if(e.trustedOrigins&&(Array.isArray(e.trustedOrigins)&&n.push(...e.trustedOrigins),typeof e.trustedOrigins==`function`)){let r=await e.trustedOrigins(t);n.push(...r)}let r=Ci.BETTER_AUTH_TRUSTED_ORIGINS;return r&&n.push(...r.split(`,`)),n.filter(e=>!!e)}function $x(e){if(Cr(e?.request))return e.request;if(!e?.headers)return;let t=e.headers instanceof Headers?e.headers:new Headers(e.headers);if(t.has(`host`)||t.has(`x-forwarded-host`))return t}function eS(e){return e.advanced?.trustedProxyHeaders??!1}async function tS(e,t,n){let r=e.options.baseURL,i=ar(r,e.options.basePath||`/api/auth`,t,void 0,n);if(!i)throw new U(`Could not resolve base URL from request. Check your allowedHosts config.`);let a=Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e));a.baseURL=i,a.options={...e.options,baseURL:qr(i)||void 0};let o={...a.options,baseURL:r},s=typeof e.options.trustedOrigins==`function`||typeof e.options.account?.accountLinking?.trustedProviders==`function`,c;return c=s?Cr(t)?t:t?new Request(i,{headers:t}):void 0:void 0,a.trustedOrigins=await Qx(o,c),a.trustedProviders=await rS(a.options,c),e.options.advanced?.crossSubDomainCookies?.enabled&&(a.authCookies=An(a.options),a.createAuthCookie=jr(a.options)),a}async function nS(e,t){if(e)for(let n of e){let e=typeof n==`function`?await n():n;if(e[t.field??`id`]===t.value)return e}}async function rS(e,t){let n=e.account?.accountLinking?.trustedProviders;return n?Array.isArray(n)?n.filter(e=>!!e):(await n(t)??[]).filter(e=>!!e):[]}function iS(e){return e}async function aS(e,t,n){let r={tokens:t,profile:n},i=e.accountSubject,a=await i(r),o=String(a);if(typeof a==`number`&&!Number.isFinite(a)||o.trim().length===0||o===`undefined`||o===`null`)throw new U(`OAUTH_ACCOUNT_SUBJECT_INVALID`);return{providerId:e.id,accountId:o}}async function oS(e,t,n){try{return await aS(e,t,n)}catch{throw H.from(`UNAUTHORIZED`,V.FAILED_TO_GET_USER_INFO)}}var sS={NO_CODE:`no_code`,PROVIDER_NOT_FOUND:`oauth_provider_not_found`,ISSUER_MISSING:`issuer_missing`,ISSUER_MISMATCH:`issuer_mismatch`,INVALID_CODE:`invalid_code`,NONCE_BINDING_MISSING:`nonce_binding_missing`,UNABLE_TO_GET_USER_INFO:`unable_to_get_user_info`,NO_CALLBACK_URL:`no_callback_url`,UNABLE_TO_LINK_ACCOUNT:`unable_to_link_account`,EMAIL_DOES_NOT_MATCH:`email_does_not_match`,ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_USER:`account_already_linked_to_different_user`,EMAIL_NOT_FOUND:`email_not_found`,EMAIL_NOT_VERIFIED:`email_not_verified`},cS=`https://www.better-auth.com/docs/concepts/oauth#handling-providers-without-email`;function lS(e,t,n,r){let i=new URLSearchParams({error:n});r&&i.set(`error_description`,r);let a=Fr(t,i);throw e.redirect(a)}function uS(e,t){return`${t?.source===`generic`?`Generic OAuth provider "${e}"`:`Provider "${e}"`} did not return an email${t?.source===`id_token`?` in the id token`:``}. Either request the provider's email scope, or create a placeholder via \`mapProfileToUser\`. See ${cS}`}function dS(e){return e.startsWith(`$ba$`)?!0:e.length%2==0&&/^[0-9a-f]+$/i.test(e)}function fS(e,t){return e&&(t.options.account?.encryptOAuthTokens&&dS(e)?bn({key:t.secretConfig,data:e}):e)}function pS(e,t){return t.options.account?.encryptOAuthTokens&&e?Dn({key:t.secretConfig,data:e}):e}function mS(e){return e.callbackPath?e.callbackPath.startsWith(`/`)?e.callbackPath:`/${e.callbackPath}`:`/callback/${e.id}`}function hS(e){if(e)try{return e.clone()}catch{return new Request(e.url,{cache:e.cache,credentials:e.credentials,headers:e.headers,integrity:e.integrity,keepalive:e.keepalive,method:e.method,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,signal:e.signal})}}async function gS(e,t,n,r=3600,i){return await $n({email:t.toLowerCase(),updateTo:n?.toLowerCase(),...i},e,r)}async function _S(e,t){if(!e.context.options.emailVerification?.sendVerificationEmail)throw e.context.logger.error(`Verification email isn't enabled.`),H.from(`BAD_REQUEST`,V.VERIFICATION_EMAIL_NOT_ENABLED);let n=await gS(e.context.secret,t.email,void 0,e.context.options.emailVerification?.expiresIn),r=e.body.callbackURL?encodeURIComponent(e.body.callbackURL):`%2F`,i=`${e.context.baseURL}/verify-email?token=${n}&callbackURL=${r}`;await e.context.options.emailVerification.sendVerificationEmail({user:t,url:i,token:n},e.request)}var vS=hi(`/send-verification-email`,{method:`POST`,operationId:`sendVerificationEmail`,cloneRequest:!0,body:B({email:Zt().meta({description:`The email to send the verification email to`}),callbackURL:z().meta({description:`The URL to use for email verification callback`}).optional()}),metadata:{openapi:{operationId:`sendVerificationEmail`,description:`Send a verification email to the user`,requestBody:{content:{"application/json":{schema:{type:`object`,properties:{email:{type:`string`,description:`The email to send the verification email to`,example:`user@example.com`},callbackURL:{type:`string`,description:`The URL to use for email verification callback`,example:`https://example.com/callback`,nullable:!0}},required:[`email`]}}}},responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`,description:`Indicates if the email was sent successfully`,example:!0}}}}}},400:{description:`Bad Request`,content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`,description:`Error message`,example:`Verification email isn't enabled`}}}}}}}}}},async e=>{if(!e.context.options.emailVerification?.sendVerificationEmail)throw e.context.logger.error(`Verification email isn't enabled.`),H.from(`BAD_REQUEST`,V.VERIFICATION_EMAIL_NOT_ENABLED);let{email:t}=e.body,n=await fi(e);if(!n){let n=Date.now(),r=await e.context.internalAdapter.findUserByEmail(t),i;if(!r||r.user.emailVerified)await gS(e.context.secret,t,void 0,e.context.options.emailVerification?.expiresIn);else try{await _S(e,r.user)}catch(e){i=e}let a=500-(Date.now()-n);if(a>0&&await new Promise(e=>setTimeout(e,a)),i)throw i;return e.json({status:!0})}if(n?.user.email.toLowerCase()!==t.toLowerCase())throw H.from(`BAD_REQUEST`,V.EMAIL_MISMATCH);if(n?.user.emailVerified)throw H.from(`BAD_REQUEST`,V.EMAIL_ALREADY_VERIFIED);return await _S(e,n.user),e.json({status:!0})}),yS=hi(`/verify-email`,{method:`GET`,operationId:`verifyEmail`,query:B({token:z().meta({description:`The token to verify the email`}),callbackURL:z().meta({description:`The URL to redirect to after email verification`}).optional()}),use:[bx(e=>e.query.callbackURL)],metadata:{openapi:{description:`Verify the email of the user`,parameters:[{name:`token`,in:`query`,description:`The token to verify the email`,required:!0,schema:{type:`string`}},{name:`callbackURL`,in:`query`,description:`The URL to redirect to after email verification`,required:!1,schema:{type:`string`}}],responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{user:{type:`object`,$ref:`#/components/schemas/User`},status:{type:`boolean`,description:`Indicates if the email was verified successfully`}},required:[`user`,`status`]}}}}}}}},async e=>{function t(t){if(e.query.callbackURL){let n=new URLSearchParams({error:t.code}),r=Fr(e.query.callbackURL,n);throw e.redirect(r)}throw H.from(`UNAUTHORIZED`,t)}let{token:n}=e.query,r;try{r=await Zr(n,new TextEncoder().encode(e.context.secret),{algorithms:[`HS256`]})}catch(e){return e instanceof oi?t(V.TOKEN_EXPIRED):t(V.INVALID_TOKEN)}let i=B({email:Zt(),updateTo:z().optional(),requestType:z().optional()}).parse(r.payload),a=await e.context.internalAdapter.findUserByEmail(i.email);if(!a)return t(V.USER_NOT_FOUND);if(i.updateTo){let n=await fi(e);if(n&&n.user.email!==i.email)return t(V.INVALID_USER);switch(i.requestType){case`change-email-confirmation`:{let t=await gS(e.context.secret,i.email,i.updateTo,e.context.options.emailVerification?.expiresIn,{requestType:`change-email-verification`}),n=e.query.callbackURL?encodeURIComponent(e.query.callbackURL):`%2F`,r=`${e.context.baseURL}/verify-email?token=${t}&callbackURL=${n}`;if(e.context.options.emailVerification?.sendVerificationEmail&&await e.context.runInBackgroundOrAwait(e.context.options.emailVerification.sendVerificationEmail({user:{...a.user,email:i.updateTo},url:r,token:t},hS(e.request))),e.query.callbackURL)throw e.redirect(e.query.callbackURL);return e.json({status:!0})}case`change-email-verification`:{let t=n;if(!t){let n=await e.context.internalAdapter.createSession(a.user.id);if(!n)throw H.from(`INTERNAL_SERVER_ERROR`,V.FAILED_TO_CREATE_SESSION);t={session:n,user:a.user}}let r=await e.context.internalAdapter.updateUserByEmail(i.email,{email:i.updateTo,emailVerified:!0});if(e.context.options.emailVerification?.afterEmailVerification&&await e.context.options.emailVerification.afterEmailVerification(r,e.request),await In(e,{session:t.session,user:{...t.user,email:i.updateTo,emailVerified:!0}}),e.query.callbackURL)throw e.redirect(e.query.callbackURL);return e.json({status:!0,user:er(e.context.options,r)})}default:{let t=n;if(!t){let n=await e.context.internalAdapter.createSession(a.user.id);if(!n)throw H.from(`INTERNAL_SERVER_ERROR`,V.FAILED_TO_CREATE_SESSION);t={session:n,user:a.user}}let r=await e.context.internalAdapter.updateUserByEmail(i.email,{email:i.updateTo,emailVerified:!1}),o=await gS(e.context.secret,i.updateTo),s=e.query.callbackURL?encodeURIComponent(e.query.callbackURL):`%2F`;if(e.context.options.emailVerification?.sendVerificationEmail&&await e.context.runInBackgroundOrAwait(e.context.options.emailVerification.sendVerificationEmail({user:r,url:`${e.context.baseURL}/verify-email?token=${o}&callbackURL=${s}`,token:o},hS(e.request))),await In(e,{session:t.session,user:{...t.user,email:i.updateTo,emailVerified:!1}}),e.query.callbackURL)throw e.redirect(e.query.callbackURL);return e.json({status:!0,user:er(e.context.options,r)})}}}if(a.user.emailVerified){if(e.query.callbackURL)throw e.redirect(e.query.callbackURL);return e.json({status:!0,user:null})}e.context.options.emailVerification?.beforeEmailVerification&&await e.context.options.emailVerification.beforeEmailVerification(a.user,e.request);let o=await e.context.internalAdapter.updateUserByEmail(i.email,{emailVerified:!0});if(e.context.options.emailVerification?.afterEmailVerification&&await e.context.options.emailVerification.afterEmailVerification(o,e.request),e.context.options.emailVerification?.autoSignInAfterVerification){let t=await fi(e);if(!t||t.user.email!==i.email){let t=await e.context.internalAdapter.createSession(a.user.id);if(!t)throw H.from(`INTERNAL_SERVER_ERROR`,V.FAILED_TO_CREATE_SESSION);await In(e,{session:t,user:{...a.user,emailVerified:!0}})}else await In(e,{session:t.session,user:{...t.user,emailVerified:!0}})}if(e.query.callbackURL)throw e.redirect(e.query.callbackURL);return e.json({status:!0,user:null})});function bS(e,t){return{linked:!1,error:{code:e,message:t}}}async function xS(e,{link:t,userInfo:n,account:r,profile:i,scopes:a}){try{await Ux(e,{user:{...n,id:t.userId,email:n.email??void 0},source:{action:`link-account`,method:`oauth`,oauth:{providerId:r.providerId,profile:i}}})}catch(e){if(!fn(e)||!e.body?.code)throw e;return bS(e.body.code,e.body.message)}if(!e.context.trustedProviders.includes(r.providerId)&&!n.emailVerified||e.context.options.account?.accountLinking?.enabled===!1)return e.context.logger.error(`Unable to link account - untrusted provider`),bS(sS.UNABLE_TO_LINK_ACCOUNT);if(n.email?.toLowerCase()!==t.email.toLowerCase()&&e.context.options.account?.accountLinking?.allowDifferentEmails!==!0)return bS(sS.EMAIL_DOES_NOT_MATCH);let o=await e.context.internalAdapter.findAccountByKey(r);if(o){if(o.userId.toString()!==t.userId.toString())return bS(sS.ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_USER);let n=un(o.scope,a),i=Object.fromEntries(Object.entries({providerId:r.providerId,accessToken:await pS(r.accessToken,e.context),refreshToken:await pS(r.refreshToken,e.context),idToken:r.idToken,accessTokenExpiresAt:r.accessTokenExpiresAt,refreshTokenExpiresAt:r.refreshTokenExpiresAt,scope:n||void 0}).filter(([e,t])=>t!==void 0));await e.context.internalAdapter.updateAccount(o.id,i)}else if(!await e.context.internalAdapter.createAccount({userId:t.userId,...r,accessToken:await pS(r.accessToken,e.context),refreshToken:await pS(r.refreshToken,e.context),scope:a?.join(`,`)??r.scope}))return bS(sS.UNABLE_TO_LINK_ACCOUNT);return await wS(e,t.userId,n),{linked:!0}}async function SS(e,t){let{userInfo:n,account:r,callbackURL:i,disableSignUp:a,overrideUserInfo:o}=t,s=t.source??{method:`oauth`,oauth:{providerId:r.providerId}},c=!!t.selectedUser||t.requireExactAccountBinding===!0,l=null,u=await e.context.internalAdapter.findAccountOwnerByKey({providerId:r.providerId,accountId:r.accountId}).catch(t=>{e.context.logger.error(`Better auth was unable to query your database.
|
|
76
|
+
Error: `,t),lS(e,e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`,`internal_server_error`)});if(u?.kind===`orphaned`)return e.context.logger.error(`OAuth account references a missing user. Repair the account before retrying authentication.`),{error:`unable to link account`,data:null,isRegister:!1};let d=await(async()=>{if(u?.kind===`owned`){if(t.selectedUser&&u.user.id!==t.selectedUser.userId)throw new H(`CONFLICT`,{code:`account_ownership_conflict`,message:`Account is already linked to another user`});return{user:u.user,linkedAccount:u.account,accounts:[u.account]}}if(t.selectedUser){let n=await e.context.internalAdapter.findUserById(t.selectedUser.userId);if(!n)throw new H(`NOT_FOUND`,{code:`user_not_found`,message:`User not found`});return{user:n,linkedAccount:null,accounts:[]}}let r=await e.context.internalAdapter.findUserByEmail(n.email.toLowerCase(),{includeAccounts:!0});return r?{user:r.user,linkedAccount:null,accounts:r.accounts}:null})().catch(t=>{if(fn(t))throw t;e.context.logger.error(`Better auth was unable to query your database.
|
|
77
|
+
Error: `,t),lS(e,e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`,`internal_server_error`)}),f=d?.user,p=!f;if(d){let i=d.linkedAccount??d.accounts.find(e=>e.providerId===r.providerId&&e.accountId===r.accountId);if(i){let{id:a,...o}=n;await Ux(e,{user:{...o,id:d.user.id,email:n.email.toLowerCase()},source:{...s,action:`sign-in`}});let u=e.context.options.account?.updateAccountOnSignIn===!1?{}:Object.fromEntries(Object.entries({providerId:r.providerId,idToken:r.idToken,accessToken:await pS(r.accessToken,e.context),refreshToken:await pS(r.refreshToken,e.context),accessTokenExpiresAt:r.accessTokenExpiresAt,refreshTokenExpiresAt:r.refreshTokenExpiresAt}).filter(([e,t])=>t!==void 0));if(e.context.options.account?.storeAccountCookie){let n={...i,...u};t.deferNonDatabaseWrites?l=n:await gi(e,n)}if(Object.keys(u).length>0){let n=await e.context.internalAdapter.updateAccount(i.id,u);if(!n)return{error:`unable to update account`,data:null};if(c&&(n.accountId!==r.accountId||n.providerId!==r.providerId||n.userId!==d.user.id))throw new H(`CONFLICT`,{code:`account_hook_binding_conflict`,message:`Account hook changed the selected authentication binding`});t.deferNonDatabaseWrites&&l&&(l=n)}!t.selectedUser&&n.emailVerified&&!d.user.emailVerified&&n.email.toLowerCase()===d.user.email&&await e.context.internalAdapter.updateUser(d.user.id,{emailVerified:!0})}else{let i=e.context.options.account?.accountLinking,a=t.isTrustedProvider||t.trustProviderByName!==!1&&e.context.trustedProviders.includes(r.providerId),o=i?.requireLocalEmailVerified??!0;if(!t.selectedUser&&(!a&&!n.emailVerified||o&&!d.user.emailVerified||i?.enabled===!1||i?.disableImplicitLinking===!0))return Fi()&&e.context.logger.warn(`User already exist but account isn't linked to ${r.providerId}. To read more about how account linking works in Better Auth see https://www.better-auth.com/docs/concepts/users-accounts#account-linking.`),{error:`account not linked`,data:null};try{let{id:i,...a}=n;await Ux(e,{user:{...a,id:d.user.id,email:n.email.toLowerCase()},source:{...s,action:`link-account`}});let o=await e.context.internalAdapter.linkAccount({providerId:r.providerId,accountId:r.accountId,userId:d.user.id,accessToken:await pS(r.accessToken,e.context),refreshToken:await pS(r.refreshToken,e.context),idToken:r.idToken,accessTokenExpiresAt:r.accessTokenExpiresAt,refreshTokenExpiresAt:r.refreshTokenExpiresAt,scope:r.scope});if(!o)return{error:`unable to link account`,data:null};if(c&&(o.accountId!==r.accountId||o.providerId!==r.providerId||o.userId!==d.user.id))throw new H(`CONFLICT`,{code:`account_hook_binding_conflict`,message:`Account hook changed the selected authentication binding`});e.context.options.account?.storeAccountCookie&&(t.deferNonDatabaseWrites?l=o:await gi(e,o))}catch(t){if(fn(t))throw t;return e.context.logger.error(`Unable to link account`,t),{error:`unable to link account`,data:null}}!t.selectedUser&&n.emailVerified&&!d.user.emailVerified&&n.email.toLowerCase()===d.user.email&&await e.context.internalAdapter.updateUser(d.user.id,{emailVerified:!0}),t.selectedUser||(f=await wS(e,d.user.id,n)??f)}if(t.selectedUser?t.selectedUser.profile===`update`:o){let{id:r,email:i,emailVerified:a,name:o,image:s,...c}=n,l=yn(e.context.options,c,`update`),u=await e.context.internalAdapter.updateUser(d.user.id,{name:o,image:s,...l,email:n.email.toLowerCase(),emailVerified:n.email.toLowerCase()===d.user.email&&d.user.emailVerified||n.emailVerified});if(u??e.context.logger.warn(`Could not update user info during OAuth sign in; preserving existing user for session.`),t.selectedUser&&u&&u.id!==t.selectedUser.userId)throw new H(`CONFLICT`,{code:`user_hook_selection_conflict`,message:`User hook changed the selected user`});f=u??f}}else{if(a)return{error:`signup disabled`,data:null,isRegister:!1};try{let{id:i,email:a,emailVerified:o,name:u,image:d,...p}=n,m=yn(e.context.options,p,`create`),h={accessToken:await pS(r.accessToken,e.context),refreshToken:await pS(r.refreshToken,e.context),idToken:r.idToken,accessTokenExpiresAt:r.accessTokenExpiresAt,refreshTokenExpiresAt:r.refreshTokenExpiresAt,scope:r.scope,providerId:r.providerId,accountId:r.accountId},{createdUser:g,createdAccount:_}=await Qr(e.context.adapter,async()=>{let t=await e.context.internalAdapter.createUser({name:u,image:d,...m,email:n.email.toLowerCase(),emailVerified:n.emailVerified},s);return{createdUser:t,createdAccount:await e.context.internalAdapter.createAccount({...h,userId:t.id})}});if(c&&(_.accountId!==r.accountId||_.providerId!==r.providerId||_.userId!==g.id))throw new H(`CONFLICT`,{code:`account_hook_binding_conflict`,message:`Account hook changed the selected authentication binding`});f=g,e.context.options.account?.storeAccountCookie&&(t.deferNonDatabaseWrites?l=_:await gi(e,_))}catch(t){if(fn(t))throw t;return e.context.logger.error(`Unable to create OAuth user`,t),{error:`unable to create user`,data:null,isRegister:!1}}}if(!f)return{error:`unable to create user`,data:null,isRegister:!1};let m=e.context.socialProviders.find(e=>e.id===r.providerId)?.options?.requireEmailVerification;if(p&&!f.emailVerified&&(e.context.options.emailVerification?.sendOnSignUp??m)&&await CS(e,f,i,t.deferNonDatabaseWrites),m&&!f.emailVerified)return!p&&e.context.options.emailVerification?.sendOnSignIn&&await CS(e,f,i,t.deferNonDatabaseWrites),{error:sS.EMAIL_NOT_VERIFIED,data:null,isRegister:p};let h=await e.context.internalAdapter.createSession(f.id,void 0,void 0,void 0,{deferSecondaryStorageWrites:t.deferNonDatabaseWrites===!0});if(!h)return{error:`unable to create session`,data:null,isRegister:!1};if(c&&h.userId!==(t.selectedUser?.userId??f.id))throw new H(`CONFLICT`,{code:`session_hook_user_conflict`,message:`Session hook changed the selected user`});return{data:{session:h,user:f},error:null,isRegister:p,accountCookie:l}}async function CS(e,t,n,r){let i=e.context.options.emailVerification?.sendVerificationEmail;if(!i)return;let a=async()=>{try{let r=await gS(e.context.secret,t.email,void 0,e.context.options.emailVerification?.expiresIn),a=`${e.context.baseURL}/verify-email?token=${r}&callbackURL=${encodeURIComponent(n||`/`)}`;await e.context.runInBackgroundOrAwait(i({user:t,url:a,token:r},e.request))}catch(t){e.context.logger.error(`Failed to send OAuth verification email`,t)}};r?await ii(a):await a()}async function wS(e,t,n){if(e.context.options.account?.accountLinking?.updateUserInfoOnLink===!0)try{let{email:r,emailVerified:i,name:a,image:o,...s}=n,c=yn(e.context.options,s,`update`);return await e.context.internalAdapter.updateUser(t,{name:a,image:o,...c})}catch(t){e.context.logger.warn(`Could not update user info on account link`,t);return}}var TS=vi(`better-auth:oauth-encryption:v1`);function ES(e,t){return Bi(Kr(br,vi(e),TS,vi(`better-auth:${t}:v1`),32))}function DS(e,t){return typeof e==`string`?ES(e,t):{keys:new Map(Array.from(e.keys,([e,n])=>[e,ES(n,t)])),currentVersion:e.currentVersion,...e.legacySecret&&{legacySecret:ES(e.legacySecret,t)}}}var OS=nn({callbackURL:z(),codeVerifier:z(),errorURL:z().optional(),newUserURL:z().optional(),expiresAt:Gt(),oauthState:z().optional(),link:B({email:z(),userId:Lr()}).optional(),requestSignUp:Xt().optional(),idTokenNonce:z().optional(),serverContext:Rt(z(),Vt()).optional()}),kS=e=>`auth-state:${e}`;new Set(Object.keys(OS.shape));var AS=class extends U{code;details;errorURL;constructor(e,t){super(e,t),this.code=t.code,this.details=t.details,this.errorURL=t.errorURL}};async function jS(e,t,n){let r=Tn(32);if(e.context.oauthConfig.storeStateStrategy===`cookie`){let i={...t,oauthState:r},a=await Dn({key:DS(e.context.secretConfig,`oauth-state-cookie`),data:JSON.stringify(i)}),o=e.context.createAuthCookie(n?.cookieName??`oauth_state`,{maxAge:600});return e.setCookie(o.name,a,o.attributes),{state:r,codeVerifier:t.codeVerifier}}let i=e.context.createAuthCookie(n?.cookieName??`state`,{maxAge:300});await e.setSignedCookie(i.name,r,e.context.secret,i.attributes);let a=new Date;if(a.setMinutes(a.getMinutes()+10),!await e.context.internalAdapter.createVerificationValue({value:JSON.stringify({...t,oauthState:r}),identifier:kS(r),expiresAt:a}))throw new AS(`Unable to create verification. Make sure the database adapter is properly working and there is a verification table in the database`,{code:`state_generation_error`});return{state:r,codeVerifier:t.codeVerifier}}async function MS(e,t,n){if(!t)throw new AS(`State not found in OAuth callback`,{code:`state_not_found`});let r=e.context.oauthConfig.storeStateStrategy,i;if(r===`cookie`){let r=e.context.createAuthCookie(n?.cookieName??`oauth_state`),a=e.getCookie(r.name);if(!a)throw new AS(`State mismatch: auth state cookie not found`,{code:`state_mismatch`,details:{state:t}});try{let t=await bn({key:DS(e.context.secretConfig,`oauth-state-cookie`),data:a});i=OS.parse(JSON.parse(t))}catch(e){throw new AS(`State invalid: Failed to decrypt or parse auth state`,{code:`state_invalid`,details:{state:t},cause:e})}if(!i.oauthState||i.oauthState!==t)throw new AS(`State mismatch: OAuth state parameter does not match stored state`,{code:`state_security_mismatch`,details:{state:t},errorURL:i.errorURL});kr(e,r)}else{let r=await e.context.internalAdapter.findVerificationValue(kS(t));if(!r)throw new AS(`State mismatch: verification not found`,{code:`state_mismatch`,details:{state:t}});if(i=OS.parse(JSON.parse(r.value)),i.oauthState!==void 0&&i.oauthState!==t)throw new AS(`State mismatch: OAuth state parameter does not match stored state`,{code:`state_security_mismatch`,details:{state:t},errorURL:i.errorURL});let a=e.context.createAuthCookie(n?.cookieName??`state`),o=await e.getSignedCookie(a.name,e.context.secret);if(!(n?.skipStateCookieCheck??e.context.oauthConfig.skipStateCookieCheck)&&(!o||o!==t))throw new AS(`State mismatch: State not persisted correctly`,{code:`state_security_mismatch`,details:{state:t},errorURL:i.errorURL});kr(e,a),await e.context.internalAdapter.deleteVerificationByIdentifier(kS(t))}if(i.expiresAt<Date.now())throw new AS(`Invalid state: request expired`,{code:`state_mismatch`,details:{expiresAt:i.expiresAt},errorURL:i.errorURL});return i}function NS(e){return e.requiresIdTokenNonce?Tn(32):void 0}async function PS(e,t){let n=e.body?.callbackURL||e.context.options.baseURL;if(!n)throw H.from(`BAD_REQUEST`,V.CALLBACK_URL_REQUIRED);let r=t?.codeVerifier??Tn(128),i=await Rn(),a=i&&Object.keys(i).length?i:void 0,o={...t?.additionalData?t.additionalData:{},callbackURL:n,codeVerifier:r,errorURL:e.body?.errorCallbackURL,newUserURL:e.body?.newUserCallbackURL,link:t?.link,serverContext:a,expiresAt:Date.now()+6e5,requestSignUp:e.body?.requestSignUp,idTokenNonce:t?.idTokenNonce};await an(o);try{return jS(e,o)}catch(t){throw e.context.logger.error(`Failed to create verification`,t),new H(`INTERNAL_SERVER_ERROR`,{message:`Unable to create verification`,cause:t})}}async function FS(e){let t=e.query.state||e.body?.state,n=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`,r;try{r=await MS(e,t)}catch(t){e.context.logger.error(`Failed to parse state`,t);let r=`internal_server_error`,i=n;t instanceof AS&&(r=t.code===`state_security_mismatch`?`state_mismatch`:t.code,i=t.errorURL||n),lS(e,i,r)}return r.errorURL||(r.errorURL=n),r&&await an(r),r}var IS=e=>{let t=`https://appleid.apple.com/auth/token`;return{id:`apple`,name:`Apple`,accountSubject:({profile:e})=>e.sub,async createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i,codeVerifier:a}){if(!_i(e.clientId)||!e.clientSecret)throw Hi.error(`Client ID and client secret are required for Apple. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);let o=e.disableDefaultScope?[]:[`email`,`name`];return e.scope&&o.push(...e.scope),n&&o.push(...n),await zb({id:`apple`,options:e,authorizationEndpoint:`https://appleid.apple.com/auth/authorize`,scopes:o,state:t,redirectURI:r,codeVerifier:a,responseMode:`form_post`,responseType:`code id_token`,additionalParams:i})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),idToken:{jwks:e=>LS(e.kid),issuer:`https://appleid.apple.com`,audience:e.audience&&e.audience.length?e.audience:e.appBundleIdentifier?e.appBundleIdentifier:e.clientId,maxTokenAge:`1h`,nonceComparison:`exact-or-sha256`},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:e,tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.idToken)return null;let n=rr(t.idToken);if(!n)return null;let r;r=t.user?.name?`${t.user.name.firstName||``} ${t.user.name.lastName||``}`.trim():n.name||``;let i=typeof n.email_verified==`boolean`?n.email_verified:n.email_verified===`true`,a={...n,name:r},o=await e.mapProfileToUser?.(a);return{user:{name:a.name,emailVerified:i,email:n.email,...o},data:a}},options:e}},LS=async e=>{let{data:t}=await Nn(`https://appleid.apple.com/auth/keys`);if(!t?.keys)throw new H(`BAD_REQUEST`,{message:`Keys not found`});let n=t.keys.find(t=>t.kid===e);if(!n)throw Error(`JWK with kid ${e} not found`);return await on(n,n.alg)},RS=e=>{let t=`https://auth.atlassian.com/oauth/token`;return{id:`atlassian`,name:`Atlassian`,accountSubject:({profile:e})=>e.account_id,async createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){if(!e.clientId||!e.clientSecret)throw Hi.error(`Client Id and Secret are required for Atlassian`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(!r)throw new U(`codeVerifier is required for Atlassian`);let o=e.disableDefaultScope?[]:[`read:jira-user`,`offline_access`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`atlassian`,options:e,authorizationEndpoint:`https://auth.atlassian.com/authorize`,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:{...a??{},audience:`api.atlassian.com`},prompt:e.prompt})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.accessToken)return null;try{let{data:n}=await Nn(`https://api.atlassian.com/me`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(!n)return null;let r=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,image:n.picture,emailVerified:!1,...r},data:n}}catch(e){return Hi.error(`Failed to fetch user info from Atlassian:`,e),null}},options:e}},zS=`https://dash.cloudflare.com/oauth2/auth`,BS=`https://dash.cloudflare.com/oauth2/token`,VS=`https://api.cloudflare.com/client/v4/user`,HS=e=>{let t=e.clientSecret?`client_secret_basic`:`none`;return{method:e.tokenEndpointAuthMethod??t}},US=e=>({id:`cloudflare`,name:`Cloudflare`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i}){let a=e.disableDefaultScope?[]:[`user-details.read`];return e.scope?.length&&a.push(...e.scope),n?.length&&a.push(...n),zb({id:`cloudflare`,options:e,authorizationEndpoint:zS,scopes:a.length?[...new Set(a)]:void 0,state:t,codeVerifier:r,redirectURI:i})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:r})=>rx({code:t,codeVerifier:n,redirectURI:r,options:e,tokenEndpoint:BS,tokenEndpointAuth:HS(e)}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:BS,tokenEndpointAuth:HS(e)}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(VS,{headers:{authorization:`Bearer ${t.accessToken}`}});if(r||!n?.success||!n.result)return Hi.error(`Failed to fetch user info from Cloudflare:`,r??n?.errors),null;let i=n.result,a=[i.first_name,i.last_name].filter(Boolean).join(` `)||i.email,o=await e.mapProfileToUser?.(i);return{user:{name:a,email:i.email,emailVerified:!1,...o},data:i}},options:e}),WS=e=>{if(!e.domain||!e.region||!e.userPoolId)throw Hi.error(`Domain, region and userPoolId are required for Amazon Cognito. Make sure to provide them in the options.`),new U(`DOMAIN_AND_REGION_REQUIRED`);let t=e.domain.replace(/^https?:\/\//,``),n=`https://${t}/oauth2/authorize`,r=`https://${t}/oauth2/token`,i=`https://${t}/oauth2/userinfo`;return{id:`cognito`,name:`Cognito`,accountSubject:({profile:e})=>e.sub,async createAuthorizationURL({state:t,scopes:r,codeVerifier:i,redirectURI:a,additionalParams:o}){if(!_i(e.clientId))throw Hi.error(`ClientId is required for Amazon Cognito. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(e.requireClientSecret&&!e.clientSecret)throw Hi.error(`Client Secret is required when requireClientSecret is true. Make sure to provide it in the options.`),new U(`CLIENT_SECRET_REQUIRED`);let s=e.disableDefaultScope?[]:[`openid`,`profile`,`email`];e.scope&&s.push(...e.scope),r&&s.push(...r);let c=await zb({id:`cognito`,options:{...e},authorizationEndpoint:n,scopes:s,state:t,codeVerifier:i,redirectURI:a,prompt:e.prompt,additionalParams:{...e.identityProvider?{identity_provider:e.identityProvider}:{},...o??{}}}),l=c.searchParams.get(`scope`);if(l){c.searchParams.delete(`scope`);let e=encodeURIComponent(l),t=c.toString(),n=t.includes(`?`)?`&`:`?`;return new URL(`${t}${n}scope=${e}`)}return c},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:i})=>rx({code:t,codeVerifier:n,redirectURI:i,options:e,tokenEndpoint:r}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:r}),idToken:{jwks:t=>GS(t.kid,e.region,e.userPoolId),issuer:`https://cognito-idp.${e.region}.amazonaws.com/${e.userPoolId}`,audience:e.clientId,maxTokenAge:`1h`},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(t.idToken)try{let n=rr(t.idToken);if(!n)return null;let r=n.name||n.given_name||n.username||``,i={...n,name:r},a=await e.mapProfileToUser?.(i);return{user:{name:i.name,email:n.email,image:n.picture,emailVerified:n.email_verified,...a},data:i}}catch(e){Hi.error(`Failed to decode ID token:`,e)}if(t.accessToken)try{let{data:n}=await Nn(i,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(n){let t=await e.mapProfileToUser?.(n);return{user:{name:n.name||n.given_name||n.username||``,email:n.email,image:n.picture,emailVerified:n.email_verified,...t},data:n}}}catch(e){Hi.error(`Failed to fetch user info from Cognito:`,e)}return null},options:e}},GS=async(e,t,n)=>{let r=`https://cognito-idp.${t}.amazonaws.com/${n}/.well-known/jwks.json`;try{let{data:t}=await Nn(r);if(!t?.keys)throw new H(`BAD_REQUEST`,{message:`Keys not found`});let n=t.keys.find(t=>t.kid===e);if(!n)throw Error(`JWK with kid ${e} not found`);return await on(n,n.alg)}catch(e){throw Hi.error(`Failed to fetch Cognito public key:`,e),e}},KS=e=>{let t=`https://discord.com/api/oauth2/token`;return{id:`discord`,name:`Discord`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`identify`,`email`];n&&a.push(...n),e.scope&&a.push(...e.scope);let o=a.includes(`bot`);return zb({id:`discord`,options:e,authorizationEndpoint:`https://discord.com/api/oauth2/authorize`,scopes:a,state:t,redirectURI:r,prompt:e.prompt||`none`,additionalParams:{...o&&e.permissions!==void 0?{permissions:String(e.permissions)}:{},...i??{}}})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://discord.com/api/users/@me`,{headers:{authorization:`Bearer ${t.accessToken}`}});if(r)return null;if(n.avatar===null)n.image_url=`https://cdn.discordapp.com/embed/avatars/${n.discriminator===`0`?Number(BigInt(n.id)>>BigInt(22))%6:parseInt(n.discriminator)%5}.png`;else{let e=n.avatar.startsWith(`a_`)?`gif`:`png`;n.image_url=`https://cdn.discordapp.com/avatars/${n.id}/${n.avatar}.${e}`}let i=await e.mapProfileToUser?.(n);return{user:{name:n.global_name||n.username||``,email:n.email,emailVerified:n.verified,image:n.image_url,...i},data:n}},options:e}},qS=e=>{let t=`https://api.dropboxapi.com/oauth2/token`;return{id:`dropbox`,name:`Dropbox`,accountSubject:({profile:e})=>e.account_id,createAuthorizationURL:async({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a})=>{let o=e.disableDefaultScope?[]:[`account_info.read`];return e.scope&&o.push(...e.scope),n&&o.push(...n),await zb({id:`dropbox`,options:e,authorizationEndpoint:`https://www.dropbox.com/oauth2/authorize`,scopes:o,state:t,redirectURI:i,codeVerifier:r,additionalParams:{...e.accessType?{token_access_type:e.accessType}:{},...a??{}}})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>await rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.dropboxapi.com/2/users/get_current_account`,{method:`POST`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name?.display_name,email:n.email,emailVerified:n.email_verified||!1,image:n.profile_photo_url,...i},data:n}},options:e}};async function JS(e,t){let n=_i(t.clientId);if(!n||!t.clientSecret)return null;let r=Array.isArray(t.clientId)?t.clientId:[t.clientId],{data:i,error:a}=await Nn(`https://graph.facebook.com/debug_token`,{query:{input_token:e,access_token:`${n}|${t.clientSecret}`}});if(a||!i?.data)return null;let{is_valid:o,app_id:s,user_id:c}=i.data;return o!==!0||!s||!r.includes(s)||!c?null:c}var YS=e=>({id:`facebook`,name:`Facebook`,accountSubject:({profile:e})=>`sub`in e?e.sub:e.id,async createAuthorizationURL({state:t,scopes:n,redirectURI:r,loginHint:i,additionalParams:a}){if(!_i(e.clientId)||!e.clientSecret)throw Hi.error(`Client ID and client secret are required for Facebook. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);let o=e.disableDefaultScope?[]:[`email`,`public_profile`];return e.scope&&o.push(...e.scope),n&&o.push(...n),await zb({id:`facebook`,options:e,authorizationEndpoint:`https://www.facebook.com/v24.0/dialog/oauth`,scopes:o,state:t,redirectURI:r,loginHint:i,additionalParams:{...e.configId?{config_id:e.configId}:{},...a??{}}})},validateAuthorizationCode:async({code:t,redirectURI:n})=>rx({code:t,redirectURI:n,options:e,tokenEndpoint:`https://graph.facebook.com/v24.0/oauth/access_token`}),idToken:{jwks:Ab(new URL(`https://limited.facebook.com/.well-known/oauth/openid/jwks/`)),issuer:`https://www.facebook.com`,audience:e.clientId,algorithms:[`RS256`],allowOpaqueToken:!0},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:`https://graph.facebook.com/v24.0/oauth/access_token`}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(t.idToken&&t.idToken.split(`.`).length===3){let n=rr(t.idToken),r=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,image:n.picture,emailVerified:!1,...r},data:n}}let n=t.accessToken;if(!n)return null;let r=await JS(n,e);if(!r)return null;let{data:i,error:a}=await Nn(`https://graph.facebook.com/me?fields=`+[`id`,`name`,`email`,`picture`,...e?.fields||[]].join(`,`),{auth:{type:`Bearer`,token:n}});if(a||i.id!==r)return null;let o=await e.mapProfileToUser?.(i);return{user:{name:i.name,email:i.email,image:i.picture.data.url,emailVerified:i.email_verified??!1,...o},data:i}},options:e}),XS=e=>{let t=`https://api.figma.com/v1/oauth/token`;return{id:`figma`,name:`Figma`,accountSubject:({profile:e})=>e.id,async createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){if(!e.clientId||!e.clientSecret)throw Hi.error(`Client Id and Client Secret are required for Figma. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(!r)throw new U(`codeVerifier is required for Figma`);let o=e.disableDefaultScope?[]:[`current_user:read`];return e.scope&&o.push(...e.scope),n&&o.push(...n),await zb({id:`figma`,options:e,authorizationEndpoint:`https://www.figma.com/oauth`,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:a})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t,authentication:`basic`}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t,authentication:`basic`}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);try{let{data:n}=await Nn(`https://api.figma.com/v1/me`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(!n)return Hi.error(`Failed to fetch user from Figma`),null;let r=await e.mapProfileToUser?.(n);return{user:{name:n.handle,email:n.email,image:n.img_url,emailVerified:!1,...r},data:n}}catch(e){return Hi.error(`Failed to fetch user info from Figma:`,e),null}},options:e}},ZS=e=>{let t=`https://github.com/login/oauth/access_token`;return{id:`github`,name:`GitHub`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,loginHint:r,codeVerifier:i,redirectURI:a,additionalParams:o}){let s=e.disableDefaultScope?[]:[`read:user`,`user:email`];return e.scope&&s.push(...e.scope),n&&s.push(...n),zb({id:`github`,options:e,authorizationEndpoint:`https://github.com/login/oauth/authorize`,scopes:s,state:t,codeVerifier:i,redirectURI:a,loginHint:r,prompt:e.prompt,additionalParams:o})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>{let{body:a,headers:o}=await tx({code:n,codeVerifier:r,redirectURI:i,options:e}),{data:s,error:c}=await Nn(t,{method:`POST`,body:a,headers:o});return c?(Hi.error(`GitHub OAuth token exchange failed:`,c),null):`error`in s?(Hi.error(`GitHub OAuth token exchange failed:`,s),null):Vn(s)},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.github.com/user`,{headers:{"User-Agent":`better-auth`,authorization:`Bearer ${t.accessToken}`}});if(r)return null;let{data:i}=await Nn(`https://api.github.com/user/emails`,{headers:{Authorization:`Bearer ${t.accessToken}`,"User-Agent":`better-auth`}});!n.email&&i&&(n.email=(i.find(e=>e.primary)??i[0])?.email);let a=i?.find(e=>e.email===n.email)?.verified??!1,o=await e.mapProfileToUser?.(n);return{user:{name:n.name||n.login||``,email:n.email,image:n.avatar_url,emailVerified:a,...o},data:n}},options:e}},QS=(e=``)=>e.split(`://`).map(e=>e.replace(/\/{2,}/g,`/`)).join(`://`),$S=e=>{let t=e||`https://gitlab.com`;return{authorizationEndpoint:QS(`${t}/oauth/authorize`),tokenEndpoint:QS(`${t}/oauth/token`),userinfoEndpoint:QS(`${t}/api/v4/user`)}},eC=e=>{let{authorizationEndpoint:t,tokenEndpoint:n,userinfoEndpoint:r}=$S(e.issuer),i=`gitlab`;return{id:i,name:`Gitlab`,accountSubject:({profile:e})=>e.id,createAuthorizationURL:async({state:n,scopes:r,codeVerifier:a,loginHint:o,redirectURI:s,additionalParams:c})=>{let l=e.disableDefaultScope?[]:[`read_user`];return e.scope&&l.push(...e.scope),r&&l.push(...r),await zb({id:i,options:e,authorizationEndpoint:t,scopes:l,state:n,redirectURI:s,codeVerifier:a,loginHint:o,additionalParams:c})},validateAuthorizationCode:async({code:t,redirectURI:r,codeVerifier:i})=>rx({code:t,redirectURI:r,options:e,codeVerifier:i,tokenEndpoint:n}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:n}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:i}=await Nn(r,{headers:{authorization:`Bearer ${t.accessToken}`}});if(i||n.state!==`active`||n.locked)return null;let a=await e.mapProfileToUser?.(n);return{user:{name:n.name??n.username??``,email:n.email,image:n.avatar_url,emailVerified:n.email_verified??!1,...a},data:n}},options:e}},tC=`1h`,nC=`RS256`,rC=(e,t)=>e?typeof t!=`string`||!t?!1:e===`*`||t===e:!0,iC=e=>({id:`google`,name:`Google`,accountSubject:({profile:e})=>e.sub,async createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,loginHint:a,display:o,additionalParams:s}){if(!_i(e.clientId)||!e.clientSecret)throw Hi.error(`Client Id and Client Secret is required for Google. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(!r)throw new U(`codeVerifier is required for Google`);let c=e.disableDefaultScope?[]:[`email`,`profile`,`openid`];return e.scope&&c.push(...e.scope),n&&c.push(...n),await zb({id:`google`,options:e,authorizationEndpoint:`https://accounts.google.com/o/oauth2/v2/auth`,scopes:c,state:t,codeVerifier:r,redirectURI:i,prompt:e.prompt,accessType:e.accessType,display:o||e.display,loginHint:a,hd:e.hd,additionalParams:{...e.includeGrantedScopes===!1?{}:{include_granted_scopes:`true`},...s??{}}})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:r})=>rx({code:t,codeVerifier:n,redirectURI:r,options:e,tokenEndpoint:`https://oauth2.googleapis.com/token`}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:`https://oauth2.googleapis.com/token`}),idToken:{jwks:e=>aC(e.kid),issuer:[`https://accounts.google.com`,`accounts.google.com`],audience:e.clientId,maxTokenAge:tC,verifyClaims:e.hd?t=>rC(e.hd,t.hd):void 0},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.idToken)return null;let n=rr(t.idToken);if(!rC(e.hd,n.hd))return Hi.error(`Google sign-in rejected: id token hosted domain (hd) "${n.hd??`<missing>`}" does not satisfy the configured "hd" option "${e.hd}".`),null;let r=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,image:n.picture,emailVerified:n.email_verified,...r},data:n}},options:e}),aC=async e=>{let[t]=await oC(e);if(!t)throw Error(`JWK with kid ${e} not found`);return t},oC=async e=>{let{data:t}=await Nn(`https://www.googleapis.com/oauth2/v3/certs`);if(!t?.keys)throw new H(`BAD_REQUEST`,{message:`Keys not found`});let n=e?t.keys.filter(t=>t.kid===e):t.keys;if(!n.length)throw Error(`JWK with kid ${e} not found`);return Promise.all(n.map(e=>on(e,nC)))},sC=e=>{let t=`https://huggingface.co/oauth/token`;return{id:`huggingface`,name:`Hugging Face`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`openid`,`profile`,`email`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`huggingface`,options:e,authorizationEndpoint:`https://huggingface.co/oauth/authorize`,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:a})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://huggingface.co/oauth/userinfo`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name||n.preferred_username||``,email:n.email,image:n.picture,emailVerified:n.email_verified??!1,...i},data:n}},options:e}},cC=e=>{let t=`https://kauth.kakao.com/oauth/token`;return{id:`kakao`,name:`Kakao`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`account_email`,`profile_image`,`profile_nickname`];return e.scope&&a.push(...e.scope),n&&a.push(...n),zb({id:`kakao`,options:e,authorizationEndpoint:`https://kauth.kakao.com/oauth/authorize`,scopes:a,state:t,redirectURI:r,additionalParams:i})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://kapi.kakao.com/v2/user/me`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(r||!n)return null;let i=await e.mapProfileToUser?.(n),a=n.kakao_account||{},o=a.profile||{};return{user:{name:o.nickname||a.name||``,email:a.email,image:o.profile_image_url||o.thumbnail_image_url,emailVerified:!!a.is_email_valid&&!!a.is_email_verified,...i},data:n}},options:e}},lC=e=>({id:`kick`,name:`Kick`,accountSubject:({profile:e})=>e.user_id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,codeVerifier:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`user:read`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`kick`,redirectURI:r,options:e,authorizationEndpoint:`https://id.kick.com/oauth/authorize`,scopes:o,codeVerifier:i,state:t,additionalParams:a})},async validateAuthorizationCode({code:t,redirectURI:n,codeVerifier:r}){return rx({code:t,redirectURI:n,options:e,tokenEndpoint:`https://id.kick.com/oauth/token`,codeVerifier:r})},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientSecret:e.clientSecret},tokenEndpoint:`https://id.kick.com/oauth/token`}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.kick.com/public/v1/users`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=n.data[0],a=await e.mapProfileToUser?.(i);return{user:{name:i.name,email:i.email,image:i.profile_picture,emailVerified:!1,...a},data:i}},options:e}),uC=e=>{let t=`https://api.line.me/oauth2/v2.1/token`;return{id:`line`,name:`LINE`,accountSubject:({profile:e})=>e.sub,async createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,loginHint:a,additionalParams:o}){let s=e.disableDefaultScope?[]:[`openid`,`profile`,`email`];return e.scope&&s.push(...e.scope),n&&s.push(...n),await zb({id:`line`,options:e,authorizationEndpoint:`https://access.line.me/oauth2/v2.1/authorize`,scopes:s,state:t,codeVerifier:r,redirectURI:i,loginHint:a,additionalParams:o})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientSecret:e.clientSecret},tokenEndpoint:t}),idToken:{verify:async(t,n)=>{let r=new URLSearchParams;r.set(`id_token`,t),r.set(`client_id`,e.clientId),n&&r.set(`nonce`,n);let{data:i,error:a}=await Nn(`https://api.line.me/oauth2/v2.1/verify`,{method:`POST`,headers:{"content-type":`application/x-www-form-urlencoded`},body:r});return!(a||!i||i.aud!==e.clientId||i.nonce&&i.nonce!==n)}},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let n=null;if(t.idToken)try{n=rr(t.idToken)}catch{}if(!n){let{data:e}=await Nn(`https://api.line.me/oauth2/v2.1/userinfo`,{headers:{authorization:`Bearer ${t.accessToken}`}});n=e||null}if(!n)return null;let r=await e.mapProfileToUser?.(n);return{user:{name:n.name||``,email:n.email,image:n.picture,emailVerified:!1,...r},data:n}},options:e}},dC=e=>{let t=`https://api.linear.app/oauth/token`;return{id:`linear`,name:`Linear`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,loginHint:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`read`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`linear`,options:e,authorizationEndpoint:`https://linear.app/oauth/authorize`,scopes:o,state:t,redirectURI:i,loginHint:r,additionalParams:a})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.linear.app/graphql`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${t.accessToken}`},body:JSON.stringify({query:`
|
|
78
|
+
query {
|
|
79
|
+
viewer {
|
|
80
|
+
id
|
|
81
|
+
name
|
|
82
|
+
email
|
|
83
|
+
avatarUrl
|
|
84
|
+
active
|
|
85
|
+
createdAt
|
|
86
|
+
updatedAt
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`})});if(r||!n?.data?.viewer)return null;let i=n.data.viewer,a=await e.mapProfileToUser?.(i);return{user:{name:n.data.viewer.name,email:n.data.viewer.email,image:n.data.viewer.avatarUrl,emailVerified:!1,...a},data:i}},options:e}},fC=e=>{let t=`https://www.linkedin.com/oauth/v2/accessToken`;return{id:`linkedin`,name:`Linkedin`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL:async({state:t,scopes:n,redirectURI:r,loginHint:i,additionalParams:a})=>{let o=e.disableDefaultScope?[]:[`profile`,`email`,`openid`];return e.scope&&o.push(...e.scope),n&&o.push(...n),await zb({id:`linkedin`,options:e,authorizationEndpoint:`https://www.linkedin.com/oauth/v2/authorization`,scopes:o,state:t,loginHint:i,redirectURI:r,additionalParams:a})},validateAuthorizationCode:async({code:n,redirectURI:r})=>await rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.linkedin.com/v2/userinfo`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,emailVerified:n.email_verified??!1,image:n.picture,...i},data:n}},options:e}},pC=`9188040d-6c67-4c5b-b112-36a304b66dad`,mC=e=>{let t=e.tenantId||`common`,n=e.authority||`https://login.microsoftonline.com`;for(;n.endsWith(`/`);)n=n.slice(0,-1);let r=`${n}/${t}/oauth2/v2.0/authorize`,i=`${n}/${t}/oauth2/v2.0/token`;if(e.clientSecret&&e.clientAssertion)throw new U(`Microsoft Entra ID clientAssertion cannot be combined with clientSecret`);let a=e.clientAssertion?{method:`private_key_jwt`,getClientAssertion:e.clientAssertion}:void 0;return{id:`microsoft`,name:`Microsoft EntraID`,accountSubject:({profile:e})=>e.oid,createAuthorizationURL(t){if(!_i(e.clientId))throw Hi.error(`Client Id is required for Microsoft Entra ID. Make sure to provide it in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);let n=e.disableDefaultScope?[]:[`openid`,`profile`,`email`,`User.Read`,`offline_access`];return e.scope&&n.push(...e.scope),t.scopes&&n.push(...t.scopes),zb({id:`microsoft`,options:e,authorizationEndpoint:r,state:t.state,codeVerifier:t.codeVerifier,scopes:n,redirectURI:t.redirectURI,prompt:e.prompt,loginHint:t.loginHint,additionalParams:t.additionalParams})},validateAuthorizationCode({code:t,codeVerifier:n,redirectURI:r}){return rx({code:t,codeVerifier:n,redirectURI:r,options:e,tokenEndpoint:i,tokenEndpointAuth:a})},idToken:{jwks:e=>hC(e.kid,t,n),algorithms:[`RS256`],audience:e.clientId,maxTokenAge:`1h`,issuer:t!==`common`&&t!==`organizations`&&t!==`consumers`?`${n}/${t}/v2.0`:void 0,verifyClaims:e=>{let r=e.tid;return!(typeof r!=`string`||e.iss!==`${n}/${r}/v2.0`||t===`organizations`&&r===pC||t===`consumers`&&r!==pC)}},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.idToken)return null;let n=rr(t.idToken);if(typeof n.oid!=`string`||n.oid.trim().length===0)return Hi.error(`Microsoft Entra ID token did not include a valid oid claim; unable to resolve a stable account identifier.`),null;let r=e.profilePhotoSize||48;!e.disableProfilePhoto&&t.accessToken&&await Nn(`https://graph.microsoft.com/v1.0/me/photos/${r}x${r}/$value`,{headers:{Authorization:`Bearer ${t.accessToken}`},async onResponse(e){if(e.response.ok)try{let t=await e.response.clone().arrayBuffer();n.picture=`data:image/jpeg;base64, ${wi.encode(t)}`}catch(e){Hi.error(e&&typeof e==`object`&&`name`in e?e.name:``,e)}}});let i=await e.mapProfileToUser?.(n),a=n.email_verified===void 0?!!(n.email&&(n.verified_primary_email?.includes(n.email)||n.verified_secondary_email?.includes(n.email))):n.email_verified;return{user:{name:n.name,email:n.email,image:n.picture,emailVerified:a,...i},data:n}},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>{let n=e.disableDefaultScope?[]:[`openid`,`profile`,`email`,`User.Read`,`offline_access`];return e.scope&&n.push(...e.scope),ex({refreshToken:t,options:{clientId:e.clientId,clientSecret:e.clientSecret},extraParams:{scope:n.join(` `)},tokenEndpoint:i,tokenEndpointAuth:a})},options:e}},hC=async(e,t,n)=>{let{data:r}=await Nn(`${n}/${t}/discovery/v2.0/keys`);if(!r?.keys)throw new H(`BAD_REQUEST`,{message:`Keys not found`});let i=r.keys.find(t=>t.kid===e);if(!i)throw Error(`JWK with kid ${e} not found`);return await on(i,i.alg??`RS256`)},gC=e=>{let t=`https://nid.naver.com/oauth2.0/token`;return{id:`naver`,name:`Naver`,accountSubject:({profile:e})=>e.response.id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`profile`,`email`];return e.scope&&a.push(...e.scope),n&&a.push(...n),zb({id:`naver`,options:e,authorizationEndpoint:`https://nid.naver.com/oauth2.0/authorize`,scopes:a,state:t,redirectURI:r,additionalParams:i})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://openapi.naver.com/v1/nid/me`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(r||!n||n.resultcode!==`00`)return null;let i=await e.mapProfileToUser?.(n),a=n.response||{};return{user:{name:a.name||a.nickname||``,email:a.email,image:a.profile_image,emailVerified:!1,...i},data:n}},options:e}},_C=e=>{let t=`https://api.notion.com/v1/oauth/token`;return{id:`notion`,name:`Notion`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,loginHint:r,redirectURI:i,additionalParams:a}){let o=(e.disableDefaultScope,[]);return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`notion`,options:e,authorizationEndpoint:`https://api.notion.com/v1/oauth/authorize`,scopes:o,state:t,redirectURI:i,loginHint:r,additionalParams:{...a??{},owner:`user`}})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t,authentication:`basic`}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.notion.com/v1/users/me`,{headers:{Authorization:`Bearer ${t.accessToken}`,"Notion-Version":`2022-06-28`}});if(r||!n)return null;let i=n.bot?.owner?.user;if(!i)return null;let a=await e.mapProfileToUser?.(i);return{user:{name:i.name||``,email:i.person?.email||null,image:i.avatar_url,emailVerified:!1,...a},data:i}},options:e}},vC=e=>{let t=e.issuer||`https://idp.paybin.io`,n=`${t}/oauth2/authorize`,r=`${t}/oauth2/token`;return{id:`paybin`,name:`Paybin`,accountSubject:({profile:e})=>e.sub,async createAuthorizationURL({state:t,scopes:r,codeVerifier:i,redirectURI:a,loginHint:o,additionalParams:s}){if(!e.clientId||!e.clientSecret)throw Hi.error(`Client Id and Client Secret is required for Paybin. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(!i)throw new U(`codeVerifier is required for Paybin`);let c=e.disableDefaultScope?[]:[`openid`,`email`,`profile`];return e.scope&&c.push(...e.scope),r&&c.push(...r),await zb({id:`paybin`,options:e,authorizationEndpoint:n,scopes:c,state:t,codeVerifier:i,redirectURI:a,prompt:e.prompt,loginHint:o,additionalParams:s})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:i})=>rx({code:t,codeVerifier:n,redirectURI:i,options:e,tokenEndpoint:r}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:r}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.idToken)return null;let n=rr(t.idToken),r=await e.mapProfileToUser?.(n);return{user:{name:n.name||n.preferred_username||``,email:n.email,image:n.picture,emailVerified:n.email_verified||!1,...r},data:n}},options:e}},yC=e=>{let t=(e.environment||`sandbox`)===`sandbox`,n=t?`https://www.sandbox.paypal.com/signin/authorize`:`https://www.paypal.com/signin/authorize`,r=t?`https://api-m.sandbox.paypal.com/v1/oauth2/token`:`https://api-m.paypal.com/v1/oauth2/token`,i=t?`https://api-m.sandbox.paypal.com/v1/identity/oauth2/userinfo`:`https://api-m.paypal.com/v1/identity/oauth2/userinfo`,a={clientId:e.clientId,clientSecret:e.clientSecret},o={method:`client_secret_basic`};return{id:`paypal`,name:`PayPal`,accountSubject:({profile:e})=>e.user_id,async createAuthorizationURL({state:t,codeVerifier:r,redirectURI:i,additionalParams:a}){if(!e.clientId||!e.clientSecret)throw Hi.error(`Client Id and Client Secret is required for PayPal. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);return await zb({id:`paypal`,options:e,authorizationEndpoint:n,scopes:[],state:t,codeVerifier:r,redirectURI:i,prompt:e.prompt,additionalParams:a})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:i})=>{try{return await rx({code:t,codeVerifier:n,redirectURI:e.redirectURI||i,options:a,tokenEndpoint:r,tokenEndpointAuth:o})}catch(e){throw Hi.error(`PayPal token exchange failed:`,e),new U(`FAILED_TO_GET_ACCESS_TOKEN`)}},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async e=>{try{return await ex({refreshToken:e,options:a,tokenEndpoint:r,tokenEndpointAuth:o})}catch(e){throw Hi.error(`PayPal token refresh failed:`,e),new U(`FAILED_TO_REFRESH_ACCESS_TOKEN`)}},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.accessToken)return Hi.error(`Access token is required to fetch PayPal user info`),null;try{let n=await Nn(`${i}?schema=paypalv1.1`,{headers:{Authorization:`Bearer ${t.accessToken}`,Accept:`application/json`}});if(!n.data)return Hi.error(`Failed to fetch user info from PayPal`),null;let r=n.data;if(t.idToken){let e;try{e=rr(t.idToken).sub}catch(e){return Hi.error(`Failed to decode PayPal ID token:`,e),null}let n=r.sub??r.user_id;if(!e||n!==e)return Hi.error(`PayPal user info subject does not match ID token subject`),null}let a=await e.mapProfileToUser?.(r);return{user:{name:r.name,email:r.email,image:r.picture,emailVerified:r.email_verified,...a},data:r}}catch(e){return Hi.error(`Failed to fetch user info from PayPal:`,e),null}},options:e}},bC=e=>{let t=`https://api.polar.sh/v1/oauth2/token`;return{id:`polar`,name:`Polar`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`openid`,`profile`,`email`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`polar`,options:e,authorizationEndpoint:`https://polar.sh/oauth2/authorize`,scopes:o,state:t,codeVerifier:r,redirectURI:i,prompt:e.prompt,additionalParams:a})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.polar.sh/v1/oauth2/userinfo`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.public_name||n.username||``,email:n.email,image:n.avatar_url,emailVerified:n.email_verified??!1,...i},data:n}},options:e}},xC=`https://backboard.railway.com/oauth/auth`,SC=`https://backboard.railway.com/oauth/token`,CC=`https://backboard.railway.com/oauth/me`,wC=e=>({id:`railway`,name:`Railway`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`openid`,`email`,`profile`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`railway`,options:e,authorizationEndpoint:xC,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:a})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:r})=>rx({code:t,codeVerifier:n,redirectURI:r,options:e,tokenEndpoint:SC,authentication:`basic`}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:SC,authentication:`basic`}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(CC,{headers:{authorization:`Bearer ${t.accessToken}`}});if(r||!n)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,image:n.picture,emailVerified:!1,...i},data:n}},options:e}),TC=`placeholder.invalid`;function EC({identifier:e,namespace:t}){let n=Zt().safeParse(`${e}@${t}.${TC}`);if(!n.success)throw TypeError(`Invalid placeholder email`);return n.data}var DC={apple:IS,atlassian:RS,cloudflare:US,cognito:WS,discord:KS,facebook:YS,figma:XS,github:ZS,microsoft:mC,google:iC,huggingface:sC,slack:e=>{let t=`https://slack.com/api/openid.connect.token`;return{id:`slack`,name:`Slack`,accountSubject:({profile:e})=>e[`https://slack.com/user_id`],createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`openid`,`profile`,`email`];return n&&a.push(...n),e.scope&&a.push(...e.scope),zb({id:`slack`,options:e,authorizationEndpoint:`https://slack.com/openid/connect/authorize`,scopes:a,state:t,redirectURI:r,additionalParams:i})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://slack.com/api/openid.connect.userInfo`,{headers:{authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name||``,email:n.email,emailVerified:n.email_verified,image:n.picture||n[`https://slack.com/user_image_512`],...i},data:n}},options:e}},spotify:e=>{let t=`https://accounts.spotify.com/api/token`;return{id:`spotify`,name:`Spotify`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`user-read-email`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`spotify`,options:e,authorizationEndpoint:`https://accounts.spotify.com/authorize`,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:a})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.spotify.com/v1/me`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.display_name,email:n.email,image:n.images[0]?.url,emailVerified:!1,...i},data:n}},options:e}},twitch:e=>{let t=`https://id.twitch.tv/oauth2/token`;return{id:`twitch`,name:`Twitch`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`user:read:email`,`openid`];return e.scope&&a.push(...e.scope),n&&a.push(...n),zb({id:`twitch`,redirectURI:r,options:e,authorizationEndpoint:`https://id.twitch.tv/oauth2/authorize`,scopes:a,state:t,claims:e.claims||[`email`,`email_verified`,`preferred_username`,`picture`],additionalParams:i})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:r,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let n=t.idToken;if(!n)return Hi.error(`No idToken found in token`),null;let r=rr(n),i=await e.mapProfileToUser?.(r);return{user:{name:r.preferred_username,email:r.email,image:r.picture,emailVerified:r.email_verified,...i},data:r}},options:e}},twitter:e=>{let t=`https://api.x.com/2/oauth2/token`;return{id:`twitter`,name:`Twitter`,accountSubject:({profile:e})=>e.data.id,createAuthorizationURL(t){let n=e.disableDefaultScope?[]:[`users.read`,`tweet.read`,`offline.access`,`users.email`];return e.scope&&n.push(...e.scope),t.scopes&&n.push(...t.scopes),zb({id:`twitter`,options:e,authorizationEndpoint:`https://x.com/i/oauth2/authorize`,scopes:n,state:t.state,codeVerifier:t.codeVerifier,redirectURI:t.redirectURI,additionalParams:t.additionalParams})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i})=>rx({code:n,codeVerifier:r,authentication:`basic`,redirectURI:i,options:e,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},authentication:`basic`,tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.x.com/2/users/me?user.fields=profile_image_url`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}});if(r)return null;let{data:i,error:a}=await Nn(`https://api.x.com/2/users/me?user.fields=confirmed_email`,{method:`GET`,headers:{Authorization:`Bearer ${t.accessToken}`}}),o=!1;!a&&i?.data?.confirmed_email&&(n.data.email=i.data.confirmed_email,o=!0);let s=await e.mapProfileToUser?.(n);return{user:{name:n.data.name,email:n.data.email||EC({identifier:n.data.id,namespace:`twitter`}),image:n.data.profile_image_url,emailVerified:o,...s},data:n}},options:e}},dropbox:qS,kick:lC,linear:dC,linkedin:fC,gitlab:eC,tiktok:e=>{let t=`https://open.tiktokapis.com/v2/oauth/token/`,n={method:`custom`,customizeRequest({body:t}){t.set(`client_key`,e.clientKey),t.set(`client_secret`,e.clientSecret)}};return{id:`tiktok`,name:`TikTok`,accountSubject:({profile:e})=>e.data.user.open_id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`user.info.profile`];e.scope&&a.push(...e.scope),n&&a.push(...n);let o=new URL(`https://www.tiktok.com/v2/auth/authorize`);if(o.searchParams.set(`scope`,a.join(`,`)),o.searchParams.set(`response_type`,`code`),o.searchParams.set(`client_key`,e.clientKey),o.searchParams.set(`redirect_uri`,e.redirectURI||r),o.searchParams.set(`state`,t),i)for(let[e,t]of Object.entries(i))Rb.has(e)||e!==`client_key`&&o.searchParams.set(e,t);return o},validateAuthorizationCode:async({code:r,codeVerifier:i,redirectURI:a})=>rx({code:r,codeVerifier:i,redirectURI:e.redirectURI||a,options:{},tokenEndpoint:t,tokenEndpointAuth:n}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async e=>ex({refreshToken:e,options:{},tokenEndpoint:t,tokenEndpointAuth:n}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://open.tiktokapis.com/v2/user/info/?fields=${[`open_id`,`avatar_large_url`,`display_name`,`username`].join(`,`)}`,{headers:{authorization:`Bearer ${t.accessToken}`}});return r?null:{user:{email:n.data.user.email||EC({identifier:n.data.user.open_id,namespace:`tiktok`}),name:n.data.user.display_name||n.data.user.username||``,image:n.data.user.avatar_large_url,emailVerified:!1},data:n}},options:e}},reddit:e=>{let t=`https://www.reddit.com/api/v1/access_token`,n={clientId:e.clientId,clientSecret:e.clientSecret},r={method:`client_secret_basic`};return{id:`reddit`,name:`Reddit`,accountSubject:({profile:e})=>e.id,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`identity`];return e.scope&&a.push(...e.scope),n&&a.push(...n),zb({id:`reddit`,options:e,authorizationEndpoint:`https://www.reddit.com/api/v1/authorize`,scopes:a,state:t,redirectURI:r,duration:e.duration,additionalParams:i})},validateAuthorizationCode:async({code:i,redirectURI:a})=>rx({code:i,redirectURI:e.redirectURI||a,options:n,tokenEndpoint:t,tokenEndpointAuth:r,headers:{accept:`text/plain`,"user-agent":`better-auth`}}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async e=>ex({refreshToken:e,options:n,tokenEndpoint:t,tokenEndpointAuth:r}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://oauth.reddit.com/api/v1/me`,{headers:{Authorization:`Bearer ${t.accessToken}`,"User-Agent":`better-auth`}});if(r)return null;let i=await e.mapProfileToUser?.(n),a=i?.email||EC({identifier:n.id,namespace:`reddit`});return{user:{name:n.name,image:n.icon_img?.split(`?`)[0],...i,email:a,emailVerified:i?.emailVerified??!1},data:n}},options:e}},roblox:e=>{let t=`https://apis.roblox.com/oauth/v1/token`;return{id:`roblox`,name:`Roblox`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`openid`,`profile`];return e.scope&&a.push(...e.scope),n&&a.push(...n),zb({id:`roblox`,options:e,authorizationEndpoint:`https://apis.roblox.com/oauth/v1/authorize`,scopes:a,state:t,redirectURI:r,prompt:e.prompt||`select_account consent`,additionalParams:i})},validateAuthorizationCode:async({code:n,redirectURI:r})=>rx({code:n,redirectURI:e.redirectURI||r,options:e,tokenEndpoint:t,authentication:`post`}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://apis.roblox.com/oauth/v1/userinfo`,{headers:{authorization:`Bearer ${t.accessToken}`}});if(r)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.nickname||n.preferred_username||``,image:n.picture,email:EC({identifier:n.sub,namespace:`roblox`}),emailVerified:!1,...i},data:{...n}}},options:e}},salesforce:e=>{let t=(e.environment??`production`)===`sandbox`,n=e.loginUrl?`https://${e.loginUrl}/services/oauth2/authorize`:t?`https://test.salesforce.com/services/oauth2/authorize`:`https://login.salesforce.com/services/oauth2/authorize`,r=e.loginUrl?`https://${e.loginUrl}/services/oauth2/token`:t?`https://test.salesforce.com/services/oauth2/token`:`https://login.salesforce.com/services/oauth2/token`,i=e.loginUrl?`https://${e.loginUrl}/services/oauth2/userinfo`:t?`https://test.salesforce.com/services/oauth2/userinfo`:`https://login.salesforce.com/services/oauth2/userinfo`;return{id:`salesforce`,name:`Salesforce`,accountSubject:({profile:e})=>e.user_id,async createAuthorizationURL({state:t,scopes:r,codeVerifier:i,redirectURI:a,additionalParams:o}){if(!e.clientId||!e.clientSecret)throw Hi.error(`Client Id and Client Secret are required for Salesforce. Make sure to provide them in the options.`),new U(`CLIENT_ID_AND_SECRET_REQUIRED`);if(!i)throw new U(`codeVerifier is required for Salesforce`);let s=e.disableDefaultScope?[]:[`openid`,`email`,`profile`];return e.scope&&s.push(...e.scope),r&&s.push(...r),zb({id:`salesforce`,options:e,authorizationEndpoint:n,scopes:s,state:t,codeVerifier:i,redirectURI:e.redirectURI||a,additionalParams:o})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:i})=>rx({code:t,codeVerifier:n,redirectURI:e.redirectURI||i,options:e,tokenEndpoint:r}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>ex({refreshToken:t,options:{clientId:e.clientId,clientSecret:e.clientSecret},tokenEndpoint:r}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);try{let{data:n}=await Nn(i,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(!n)return Hi.error(`Failed to fetch user info from Salesforce`),null;let r=await e.mapProfileToUser?.(n);return{user:{name:n.name,email:n.email,image:n.photos?.picture||n.photos?.thumbnail,emailVerified:n.email_verified??!1,...r},data:n}}catch(e){return Hi.error(`Failed to fetch user info from Salesforce:`,e),null}},options:e}},vk:e=>{let t=`https://id.vk.com/oauth2/auth`;return{id:`vk`,name:`VK`,accountSubject:({profile:e})=>e.user.user_id,async createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){let o=e.disableDefaultScope?[]:[`email`,`phone`];return e.scope&&o.push(...e.scope),n&&o.push(...n),zb({id:`vk`,options:e,authorizationEndpoint:`https://id.vk.com/authorize`,scopes:o,state:t,redirectURI:i,codeVerifier:r,additionalParams:a})},validateAuthorizationCode:async({code:n,codeVerifier:r,redirectURI:i,deviceId:a})=>rx({code:n,codeVerifier:r,redirectURI:e.redirectURI||i,options:e,deviceId:a,tokenEndpoint:t}),refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async n=>ex({refreshToken:n,options:{clientId:e.clientId,clientKey:e.clientKey,clientSecret:e.clientSecret},tokenEndpoint:t}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);if(!t.accessToken)return null;let{data:n,error:r}=await Nn(`https://id.vk.com/oauth2/user_info`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({access_token:t.accessToken,client_id:e.clientId}).toString()});if(r)return null;let i=await e.mapProfileToUser?.(n);return!n.user.email&&!i?.email?null:{user:{first_name:n.user.first_name,last_name:n.user.last_name,email:n.user.email,image:n.user.avatar,emailVerified:!1,birthday:n.user.birthday,sex:n.user.sex,name:`${n.user.first_name} ${n.user.last_name}`,...i},data:n}},options:e}},zoom:e=>{let t={pkce:!0,...e};return{id:`zoom`,name:`Zoom`,accountSubject:({profile:e})=>e.id,createAuthorizationURL:async({state:e,redirectURI:n,codeVerifier:r,additionalParams:i})=>zb({id:`zoom`,options:t,authorizationEndpoint:`https://zoom.us/oauth/authorize`,state:e,redirectURI:n,codeVerifier:t.pkce?r:void 0,additionalParams:i}),validateAuthorizationCode:async({code:e,redirectURI:n,codeVerifier:r})=>rx({code:e,redirectURI:t.redirectURI||n,codeVerifier:r,options:t,tokenEndpoint:`https://zoom.us/oauth/token`,authentication:`post`}),refreshAccessToken:t.refreshAccessToken?t.refreshAccessToken:async e=>ex({refreshToken:e,options:{clientId:t.clientId,clientKey:t.clientKey,clientSecret:t.clientSecret},tokenEndpoint:`https://zoom.us/oauth/token`}),async getUserInfo(e){if(t.getUserInfo)return t.getUserInfo(e);let{data:n,error:r}=await Nn(`https://api.zoom.us/v2/users/me`,{headers:{authorization:`Bearer ${e.accessToken}`}});if(r)return null;let i=await t.mapProfileToUser?.(n);return{user:{name:n.display_name,image:n.pic_url,email:n.email,emailVerified:!!n.verified,...i},data:{...n}}}}},notion:_C,kakao:cC,naver:gC,line:uC,paybin:vC,paypal:yC,polar:bC,railway:wC,vercel:e=>({id:`vercel`,name:`Vercel`,accountSubject:({profile:e})=>e.sub,createAuthorizationURL({state:t,scopes:n,codeVerifier:r,redirectURI:i,additionalParams:a}){if(!r)throw new U(`codeVerifier is required for Vercel`);let o;return(e.scope!==void 0||n!==void 0)&&(o=[],e.scope&&o.push(...e.scope),n&&o.push(...n)),zb({id:`vercel`,options:e,authorizationEndpoint:`https://vercel.com/oauth/authorize`,scopes:o,state:t,codeVerifier:r,redirectURI:i,additionalParams:a})},validateAuthorizationCode:async({code:t,codeVerifier:n,redirectURI:r})=>rx({code:t,codeVerifier:n,redirectURI:r,options:e,tokenEndpoint:`https://api.vercel.com/login/oauth/token`}),async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let{data:n,error:r}=await Nn(`https://api.vercel.com/login/oauth/userinfo`,{headers:{Authorization:`Bearer ${t.accessToken}`}});if(r||!n)return null;let i=await e.mapProfileToUser?.(n);return{user:{name:n.name??n.preferred_username??``,email:n.email,image:n.picture,emailVerified:n.email_verified??!1,...i},data:n}},options:e}),wechat:e=>({id:`wechat`,name:`WeChat`,accountSubject:({profile:e})=>e.unionid||e.openid,createAuthorizationURL({state:t,scopes:n,redirectURI:r,additionalParams:i}){let a=e.disableDefaultScope?[]:[`snsapi_login`];e.scope&&a.push(...e.scope),n&&a.push(...n);let o=new URL(`https://open.weixin.qq.com/connect/qrconnect`);if(o.searchParams.set(`scope`,a.join(`,`)),o.searchParams.set(`response_type`,`code`),o.searchParams.set(`appid`,e.clientId),o.searchParams.set(`redirect_uri`,e.redirectURI||r),o.searchParams.set(`state`,t),o.searchParams.set(`lang`,e.lang||`cn`),i)for(let[e,t]of Object.entries(i))Rb.has(e)||e!==`appid`&&o.searchParams.set(e,t);return o.hash=`wechat_redirect`,o},validateAuthorizationCode:async({code:t})=>{let{data:n,error:r}=await Nn(`https://api.weixin.qq.com/sns/oauth2/access_token?`+new URLSearchParams({appid:e.clientId,secret:e.clientSecret,code:t,grant_type:`authorization_code`}).toString(),{method:`GET`});if(r||!n||n.errcode)throw Error(`Failed to validate authorization code: ${n?.errmsg||r?.message||`Unknown error`}`);return{tokenType:`Bearer`,accessToken:n.access_token,refreshToken:n.refresh_token,accessTokenExpiresAt:new Date(Date.now()+n.expires_in*1e3),scopes:n.scope.split(`,`),openid:n.openid,unionid:n.unionid}},refreshAccessToken:e.refreshAccessToken?e.refreshAccessToken:async t=>{let{data:n,error:r}=await Nn(`https://api.weixin.qq.com/sns/oauth2/refresh_token?`+new URLSearchParams({appid:e.clientId,grant_type:`refresh_token`,refresh_token:t}).toString(),{method:`GET`});if(r||!n||n.errcode)throw Error(`Failed to refresh access token: ${n?.errmsg||r?.message||`Unknown error`}`);return{tokenType:`Bearer`,accessToken:n.access_token,refreshToken:n.refresh_token,accessTokenExpiresAt:new Date(Date.now()+n.expires_in*1e3),scopes:n.scope.split(`,`)}},async getUserInfo(t){if(e.getUserInfo)return e.getUserInfo(t);let n=t.openid;if(!n)return null;let{data:r,error:i}=await Nn(`https://api.weixin.qq.com/sns/userinfo?`+new URLSearchParams({access_token:t.accessToken||``,openid:n,lang:`zh_CN`}).toString(),{method:`GET`});if(i||!r||r.errcode)return null;let a=await e.mapProfileToUser?.(r),o=r.unionid||r.openid||n;return{user:{name:r.nickname,email:r.email||EC({identifier:o,namespace:`wechat`}),image:r.headimgurl,emailVerified:!1,...a},data:r}},options:e})},OC=Object.keys(DC),kC=Wt(OC).or(z());function AC(e){return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}var jC=hi(`/list-accounts`,{method:`GET`,use:[Pn],metadata:{openapi:{operationId:`listUserAccounts`,description:`List all accounts linked to the user`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`array`,items:{type:`object`,properties:{id:{type:`string`},providerId:{type:`string`},createdAt:{type:`string`,format:`date-time`},updatedAt:{type:`string`,format:`date-time`},accountId:{type:`string`},userId:{type:`string`},scopes:{type:`array`,items:{type:`string`}}},required:[`id`,`providerId`,`createdAt`,`updatedAt`,`accountId`,`userId`,`scopes`]}}}}}}}}},async e=>{let t=e.context.session,n=await e.context.internalAdapter.findAccounts(t.user.id);return e.json(n.map(t=>{let{scope:n,...r}=Xn(e.context.options,t);return{...r,scopes:AC(n)}}))}),MC=hi(`/link-social`,{method:`POST`,requireHeaders:!0,body:B({callbackURL:z().meta({description:`The URL to redirect to after the user has signed in`}).optional(),provider:kC,idToken:B({token:z(),nonce:z().optional(),accessToken:z().optional(),refreshToken:z().optional()}).optional(),requestSignUp:Xt().optional(),scopes:en(z()).meta({description:`Additional scopes to request from the provider`}).optional(),errorCallbackURL:z().meta({description:`The URL to redirect to if there is an error during the link process`}).optional(),disableRedirect:Xt().meta({description:`Disable automatic redirection to the provider. Useful for handling the redirection yourself`}).optional(),loginHint:z().meta({description:`The login hint to use for the authorization code request`}).optional(),additionalParams:Bb,additionalData:Rt(z(),Qt()).optional()}),use:[Pn],metadata:{openapi:{description:`Link a social account to the user`,operationId:`linkSocialAccount`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{url:{type:`string`,description:`The authorization URL to redirect the user to`},redirect:{type:`boolean`,description:`Indicates if the user should be redirected to the authorization URL`},status:{type:`boolean`}},required:[`redirect`]}}}}}}}},async e=>{let t=e.context.session,n=await nS(e.context.socialProviders,{value:e.body.provider});if(!n)throw e.context.logger.error(`Provider not found. Make sure to add the provider in your auth config`,{provider:e.body.provider}),H.from(`NOT_FOUND`,V.PROVIDER_NOT_FOUND);if(e.body.idToken){if(!ox(n))throw e.context.logger.error(`Provider does not support id token verification`,{provider:e.body.provider}),H.from(`NOT_FOUND`,V.ID_TOKEN_NOT_SUPPORTED);let{token:r,nonce:i}=e.body.idToken;if(!await sx(n,r,i,e))throw e.context.logger.warn(`Invalid id token`,{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.INVALID_TOKEN);let a=await n.getUserInfo({idToken:r,accessToken:e.body.idToken.accessToken,refreshToken:e.body.idToken.refreshToken});if(!a||!a?.user)throw e.context.logger.error(`Failed to get user info`,{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.FAILED_TO_GET_USER_INFO);if(!a.user.email)throw e.context.logger.error(uS(e.body.provider,{source:`id_token`}),{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.USER_EMAIL_NOT_FOUND);let o=await oS(n,{idToken:r,accessToken:e.body.idToken.accessToken,refreshToken:e.body.idToken.refreshToken},a.data),s=await e.context.internalAdapter.findAccountByKey(o);if(s?.userId===t.user.id){let i=Object.fromEntries(Object.entries({providerId:n.id,accessToken:await pS(e.body.idToken.accessToken,e.context),idToken:r,refreshToken:await pS(e.body.idToken.refreshToken,e.context)}).filter(([e,t])=>t!==void 0));return await e.context.internalAdapter.updateAccount(s.id,i),await wS(e,t.user.id,a.user),e.json({url:``,status:!0,redirect:!1})}if(s)throw H.from(`CONFLICT`,V.SOCIAL_ACCOUNT_ALREADY_LINKED);if(!e.context.trustedProviders.includes(n.id)&&!a.user.emailVerified||e.context.options.account?.accountLinking?.enabled===!1)throw H.from(`UNAUTHORIZED`,{message:`Account not linked - linking not allowed`,code:`LINKING_NOT_ALLOWED`});if(a.user.email?.toLowerCase()!==t.user.email.toLowerCase()&&e.context.options.account?.accountLinking?.allowDifferentEmails!==!0)throw H.from(`UNAUTHORIZED`,{message:`Account not linked - different emails not allowed`,code:`LINKING_DIFFERENT_EMAILS_NOT_ALLOWED`});try{await e.context.internalAdapter.createAccount({userId:t.user.id,...o,accessToken:await pS(e.body.idToken.accessToken,e.context),idToken:r,refreshToken:await pS(e.body.idToken.refreshToken,e.context)})}catch{throw H.from(`EXPECTATION_FAILED`,{message:`Account not linked - unable to create account`,code:`LINKING_FAILED`})}return await wS(e,t.user.id,a.user),e.json({url:``,status:!0,redirect:!1})}let r=NS(n),i=await PS(e,{link:{userId:t.user.id,email:t.user.email},additionalData:e.body.additionalData,idTokenNonce:r}),a=await n.createAuthorizationURL({state:i.state,codeVerifier:i.codeVerifier,idTokenNonce:r,redirectURI:`${e.context.baseURL}${mS(n)}`,scopes:e.body.scopes,loginHint:e.body.loginHint,additionalParams:e.body.additionalParams});return e.body.disableRedirect||e.setHeader(`Location`,a.toString()),e.json({url:a.toString(),redirect:!e.body.disableRedirect})}),NC=hi(`/unlink-account`,{method:`POST`,body:B({accountId:z().meta({description:`The Better Auth account ID to unlink`})}),use:[mi],metadata:{openapi:{description:`Unlink an account`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`}}}}}}}}}},async e=>{let{accountId:t}=e.body,n=await e.context.internalAdapter.findAccounts(e.context.session.user.id);if(n.length===1&&!e.context.options.account?.accountLinking?.allowUnlinkingAll)throw H.from(`BAD_REQUEST`,V.FAILED_TO_UNLINK_LAST_ACCOUNT);let r=n.find(e=>e.id===t);if(!r)throw H.from(`BAD_REQUEST`,V.ACCOUNT_NOT_FOUND);return await e.context.internalAdapter.deleteAccount(r.id),e.json({status:!0})});async function PC(e,t){let n=await fi(e,{disableCookieCache:Hn(e)});if(!n&&(e.request||e.headers))throw e.error(`UNAUTHORIZED`);let r=n?.user?.id||t;if(!r)throw H.from(`BAD_REQUEST`,{message:`Either userId or session is required`,code:`USER_ID_OR_SESSION_REQUIRED`});return r}var FC=zt([rn({accountId:z().meta({description:`The Better Auth account ID`}),userId:z().meta({description:`The user ID associated with the account`}).optional()}),rn({useAccountCookie:Ut(!0).meta({description:`Select the current OAuth account from its signed cookie`}),userId:z().meta({description:`The user ID associated with the account`}).optional()})]);function IC(e,t,{resolvedUserId:n,selection:r}){return(!nr(e.context.options)||t.userId===n)&&(`accountId`in r?t.id===r.accountId:!0)}async function LC(e,{resolvedUserId:t,selection:n}){if(`accountId`in n){let r=(await e.context.internalAdapter.findAccounts(t)).find(e=>e.id===n.accountId);if(r)return{account:r,accountCookie:null}}else if(e.context.options.account?.storeAccountCookie){let r=await Bn(e);if(r&&IC(e,r,{resolvedUserId:t,selection:n}))return{account:r,accountCookie:r}}throw H.from(`BAD_REQUEST`,V.ACCOUNT_NOT_FOUND)}async function RC(e,{resolvedUserId:t,selection:n,account:r}){let i=r??(await LC(e,{resolvedUserId:t,selection:n})).account;if(!IC(e,i,{resolvedUserId:t,selection:n}))throw H.from(`BAD_REQUEST`,V.ACCOUNT_NOT_FOUND);let a=await nS(e.context.socialProviders,{value:i.providerId});if(!a)throw H.from(`BAD_REQUEST`,{message:`Provider ${i.providerId} is not supported.`,code:`PROVIDER_NOT_SUPPORTED`});try{let t=null,n=i.accessTokenExpiresAt&&new Date(i.accessTokenExpiresAt).getTime()-Date.now()<5e3;if(i.refreshToken&&n&&a.refreshAccessToken){let n=await fS(i.refreshToken,e.context);t=await a.refreshAccessToken(n,e);let r={accessToken:await pS(t?.accessToken,e.context),accessTokenExpiresAt:t?.accessTokenExpiresAt,refreshToken:t?.refreshToken?await pS(t.refreshToken,e.context):i.refreshToken,refreshTokenExpiresAt:t?.refreshTokenExpiresAt??i.refreshTokenExpiresAt,idToken:t?.idToken||i.idToken},o=null;i.id&&(o=await e.context.internalAdapter.updateAccount(i.id,r)),e.context.options.account?.storeAccountCookie&&await gi(e,{...i,...o??r})}let r=(()=>{if(t?.accessTokenExpiresAt)return typeof t.accessTokenExpiresAt==`string`?new Date(t.accessTokenExpiresAt):t.accessTokenExpiresAt;if(i.accessTokenExpiresAt)return typeof i.accessTokenExpiresAt==`string`?new Date(i.accessTokenExpiresAt):i.accessTokenExpiresAt})();return{accessToken:t?.accessToken??await fS(i.accessToken??``,e.context),accessTokenExpiresAt:r,scopes:AC(i.scope),idToken:t?.idToken??i.idToken??void 0}}catch{throw H.from(`BAD_REQUEST`,{message:`Failed to get a valid access token`,code:`FAILED_TO_GET_ACCESS_TOKEN`})}}var zC=hi(`/get-access-token`,{method:`POST`,body:FC,metadata:{openapi:{description:`Get a valid access token, doing a refresh if needed`,responses:{200:{description:`A Valid access token`,content:{"application/json":{schema:{type:`object`,properties:{tokenType:{type:`string`},idToken:{type:`string`},accessToken:{type:`string`},accessTokenExpiresAt:{type:`string`,format:`date-time`}}}}}},400:{description:`Invalid refresh token or provider configuration`}}}}},async e=>{let{userId:t}=e.body,n=await RC(e,{resolvedUserId:await PC(e,t),selection:e.body});return e.json(n)}),BC=hi(`/refresh-token`,{method:`POST`,body:FC,metadata:{openapi:{description:`Refresh the access token using a refresh token`,responses:{200:{description:`Access token refreshed successfully`,content:{"application/json":{schema:{type:`object`,properties:{tokenType:{type:`string`},idToken:{type:`string`},accessToken:{type:`string`},refreshToken:{type:`string`},accessTokenExpiresAt:{type:`string`,format:`date-time`},refreshTokenExpiresAt:{type:`string`,format:`date-time`}}}}}},400:{description:`Invalid refresh token or provider configuration`}}}}},async e=>{let{userId:t}=e.body,{account:n,accountCookie:r}=await LC(e,{resolvedUserId:await PC(e,t),selection:e.body}),i=await nS(e.context.socialProviders,{value:n.providerId});if(!i)throw H.from(`BAD_REQUEST`,{message:`Provider ${n.providerId} is not supported.`,code:`PROVIDER_NOT_SUPPORTED`});if(!i.refreshAccessToken)throw H.from(`BAD_REQUEST`,{message:`Provider ${n.providerId} does not support token refreshing.`,code:`TOKEN_REFRESH_NOT_SUPPORTED`});let a=n.refreshToken??void 0;if(!a)throw H.from(`BAD_REQUEST`,{message:`Refresh token not found`,code:`REFRESH_TOKEN_NOT_FOUND`});try{let t=await fS(a,e.context),o=await i.refreshAccessToken(t,e),s=o.refreshToken?await pS(o.refreshToken,e.context):a,c=o.refreshTokenExpiresAt??n.refreshTokenExpiresAt,l={accessToken:await pS(o.accessToken,e.context),refreshToken:s,accessTokenExpiresAt:o.accessTokenExpiresAt,refreshTokenExpiresAt:c,idToken:o.idToken||n.idToken},u=null;n.id&&(u=await e.context.internalAdapter.updateAccount(n.id,l)),r?.id===n.id&&e.context.options.account?.storeAccountCookie&&await gi(e,{...r,...u??l});let d=u?.scope??n.scope;return e.json({accessToken:o.accessToken,refreshToken:o.refreshToken??t,accessTokenExpiresAt:o.accessTokenExpiresAt,refreshTokenExpiresAt:c,scope:d,idToken:o.idToken||n.idToken,providerId:n.providerId,accountId:n.id})}catch{throw H.from(`BAD_REQUEST`,{message:`Failed to refresh access token`,code:`FAILED_TO_REFRESH_ACCESS_TOKEN`})}}),VC=hi(`/account-info`,{method:`GET`,metadata:{openapi:{description:`Get the account info provided by the provider`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{user:{type:`object`,properties:{name:{type:`string`},email:{type:`string`,nullable:!0},image:{type:`string`},emailVerified:{type:`boolean`}},required:[`emailVerified`]},account:{type:`object`,properties:{id:{type:`string`},providerId:{type:`string`},accountId:{type:`string`}},required:[`id`,`providerId`,`accountId`],additionalProperties:!1},data:{type:`object`,properties:{},additionalProperties:!0}},required:[`user`,`data`,`account`],additionalProperties:!1}}}}}}},query:FC},async e=>{let{userId:t}=e.query,n=await PC(e,t),{account:r}=await LC(e,{resolvedUserId:n,selection:e.query}),i=await nS(e.context.socialProviders,{value:r.providerId});if(!i)throw H.from(`BAD_REQUEST`,{message:`Account is not associated with a configured social provider.`,code:`PROVIDER_NOT_CONFIGURED`});let a=await RC(e,{resolvedUserId:n,selection:e.query,account:r});if(!a.accessToken)throw H.from(`BAD_REQUEST`,{message:`Access token not found`,code:`ACCESS_TOKEN_NOT_FOUND`});let o=await i.getUserInfo({...a,accessToken:a.accessToken});if(!o)throw H.from(`UNAUTHORIZED`,V.FAILED_TO_GET_USER_INFO);return e.json({...o,account:{id:r.id,providerId:r.providerId,accountId:r.accountId}})}),HC={scope:`server`},UC=B({code:z().optional(),error:z().optional(),device_id:z().optional(),error_description:z().optional(),state:z().optional(),user:z().optional(),iss:z().optional()}),WC=hi(`/callback/:id`,{method:[`GET`,`POST`],operationId:`handleOAuthCallback`,body:UC.optional(),query:UC.optional(),metadata:{...HC,allowedMediaTypes:[`application/x-www-form-urlencoded`,`application/json`]}},async e=>{let t,n=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;if(e.method===`POST`){let t=e.body?UC.parse(e.body):{},n=e.query?UC.parse(e.query):{},r=UC.parse({...t,...n}),i=new URLSearchParams;for(let[e,t]of Object.entries(r))t!=null&&i.set(e,String(t));let a=`${e.context.baseURL}/callback/${e.params.id}?${i.toString()}`;throw e.redirect(a)}try{if(e.method===`GET`)t=UC.parse(e.query);else if(e.method===`POST`)t=UC.parse(e.body);else throw Error(`Unsupported method`)}catch(t){e.context.logger.error(`INVALID_CALLBACK_REQUEST`,t);let r=Fr(n,new URLSearchParams({error:`invalid_callback_request`}));throw e.redirect(r)}let{code:r,error:i,state:a,error_description:o,device_id:s,user:c,iss:l}=t;if(a===void 0&&r){let t=await nS(e.context.socialProviders,{value:e.params.id});if(t?.allowIdpInitiated){let n=NS(t),{state:r,codeVerifier:i}=await PS(e,{idTokenNonce:n}),a=await t.createAuthorizationURL({state:r,codeVerifier:i,idTokenNonce:n,redirectURI:`${e.context.baseURL}${mS(t)}`});throw e.redirect(a.toString())}}if(!a){e.context.logger.error(`State not found`,i);let t=Fr(n,new URLSearchParams({error:`state_not_found`}));throw e.redirect(t)}let{codeVerifier:u,callbackURL:d,link:f,errorURL:p,newUserURL:m,requestSignUp:h,idTokenNonce:g}=await FS(e);function _(t,r){let i=p??n,a=new URLSearchParams({error:t});r&&a.set(`error_description`,r);let o=Fr(i,a);throw e.redirect(o)}if(i&&_(i,o),!r)throw e.context.logger.warn(`Code not found`),_(sS.NO_CODE);let v=await nS(e.context.socialProviders,{value:e.params.id});if(!v)throw e.context.logger.warn(`OAuth provider not found`,{providerId:e.params.id}),_(sS.PROVIDER_NOT_FOUND);if(l&&v.issuer&&l!==v.issuer)throw e.context.logger.error(`OAuth issuer mismatch`,{expected:v.issuer,received:l}),_(sS.ISSUER_MISMATCH);if(v.requiresIdTokenNonce&&!g)throw e.context.logger.error(`OAuth id_token nonce binding required but no expected nonce was found in state`,{providerId:v.id}),_(sS.NONCE_BINDING_MISSING);let y;try{y=await v.validateAuthorizationCode({code:r,codeVerifier:u,deviceId:s,redirectURI:`${e.context.baseURL}${mS(v)}`})}catch(t){throw e.context.logger.error(``,t),_(sS.INVALID_CODE)}if(!y)throw _(sS.INVALID_CODE);let b=c?Ai(c):null,x=await v.getUserInfo({...y,...g?{expectedIdTokenNonce:g}:{},user:b??void 0});if(!x?.user)return e.context.logger.error(`Unable to get user info`),_(sS.UNABLE_TO_GET_USER_INFO);let S=x.user,C=iS(x.data),w;try{w=await aS(v,y,x.data)}catch(t){return e.context.logger.error(`Unable to derive provider account identity`,{providerId:v.id,error:t}),_(sS.UNABLE_TO_GET_USER_INFO)}let{accountId:E}=w;if(!d)throw e.context.logger.error(`No callback URL found`),_(sS.NO_CALLBACK_URL);let D={...w,...y,scope:y.scopes?.join(`,`)};if(f){let t=await xS(e,{link:f,userInfo:S,account:D,profile:C,scopes:y.scopes});if(!t.linked)return _(t.error.code,t.error.message);throw e.redirect(d)}if(!S.email)return e.context.logger.error(uS(v.id)),_(sS.EMAIL_NOT_FOUND);let O;try{O=await SS(e,{userInfo:{...S,id:E,email:S.email,name:S.name||``},account:D,callbackURL:d,disableSignUp:v.disableImplicitSignUp&&!h||v.options?.disableSignUp,overrideUserInfo:v.options?.overrideUserInfoOnSignIn,source:{method:`oauth`,oauth:{providerId:v.id,profile:C}}})}catch(e){throw fn(e)&&e.body?.code&&_(e.body.code,e.body.message),e}if(O.error)return e.context.logger.error(O.error.split(` `).join(`_`)),_(O.error.split(` `).join(`_`));let{session:k,user:A}=O.data;await In(e,{session:k,user:A});let j;try{j=(O.isRegister&&m||d).toString()}catch{j=O.isRegister&&m||d}throw e.redirect(j)});function GC(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&(?!amp;|lt;|gt;|quot;|#39;|#x[0-9a-fA-F]+;|#[0-9]+;)/g,`&`)}var KC=(e,t=`Unknown`,n=null)=>{let r=e.onAPIError?.customizeDefaultErrorPage;return`<!DOCTYPE html>
|
|
90
|
+
<html lang="en">
|
|
91
|
+
<head>
|
|
92
|
+
<meta charset="UTF-8" />
|
|
93
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
94
|
+
<title>Error</title>
|
|
95
|
+
<style>
|
|
96
|
+
* {
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
}
|
|
99
|
+
body {
|
|
100
|
+
font-family: ${r?.font?.defaultFamily||`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`};
|
|
101
|
+
background: ${r?.colors?.background||`var(--background)`};
|
|
102
|
+
color: var(--foreground);
|
|
103
|
+
margin: 0;
|
|
104
|
+
}
|
|
105
|
+
:root,
|
|
106
|
+
:host {
|
|
107
|
+
--spacing: 0.25rem;
|
|
108
|
+
--container-md: 28rem;
|
|
109
|
+
--text-sm: ${r?.size?.textSm||`0.875rem`};
|
|
110
|
+
--text-sm--line-height: calc(1.25 / 0.875);
|
|
111
|
+
--text-2xl: ${r?.size?.text2xl||`1.5rem`};
|
|
112
|
+
--text-2xl--line-height: calc(2 / 1.5);
|
|
113
|
+
--text-4xl: ${r?.size?.text4xl||`2.25rem`};
|
|
114
|
+
--text-4xl--line-height: calc(2.5 / 2.25);
|
|
115
|
+
--text-6xl: ${r?.size?.text6xl||`3rem`};
|
|
116
|
+
--text-6xl--line-height: 1;
|
|
117
|
+
--font-weight-medium: 500;
|
|
118
|
+
--font-weight-semibold: 600;
|
|
119
|
+
--font-weight-bold: 700;
|
|
120
|
+
--default-transition-duration: 150ms;
|
|
121
|
+
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
122
|
+
--radius: ${r?.size?.radiusSm||`0.625rem`};
|
|
123
|
+
--default-mono-font-family: ${r?.font?.monoFamily||`var(--font-geist-mono)`};
|
|
124
|
+
--primary: ${r?.colors?.primary||`black`};
|
|
125
|
+
--primary-foreground: ${r?.colors?.primaryForeground||`white`};
|
|
126
|
+
--background: ${r?.colors?.background||`white`};
|
|
127
|
+
--foreground: ${r?.colors?.foreground||`oklch(0.271 0 0)`};
|
|
128
|
+
--border: ${r?.colors?.border||`oklch(0.89 0 0)`};
|
|
129
|
+
--destructive: ${r?.colors?.destructive||`oklch(0.55 0.15 25.723)`};
|
|
130
|
+
--muted-foreground: ${r?.colors?.mutedForeground||`oklch(0.545 0 0)`};
|
|
131
|
+
--corner-border: ${r?.colors?.cornerBorder||`#404040`};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
button, .btn {
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
background: none;
|
|
137
|
+
border: none;
|
|
138
|
+
color: inherit;
|
|
139
|
+
font: inherit;
|
|
140
|
+
transition: all var(--default-transition-duration)
|
|
141
|
+
var(--default-transition-timing-function);
|
|
142
|
+
}
|
|
143
|
+
button:hover, .btn:hover {
|
|
144
|
+
opacity: 0.8;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (prefers-color-scheme: dark) {
|
|
148
|
+
:root,
|
|
149
|
+
:host {
|
|
150
|
+
--primary: ${r?.colors?.primary||`white`};
|
|
151
|
+
--primary-foreground: ${r?.colors?.primaryForeground||`black`};
|
|
152
|
+
--background: ${r?.colors?.background||`oklch(0.15 0 0)`};
|
|
153
|
+
--foreground: ${r?.colors?.foreground||`oklch(0.98 0 0)`};
|
|
154
|
+
--border: ${r?.colors?.border||`oklch(0.27 0 0)`};
|
|
155
|
+
--destructive: ${r?.colors?.destructive||`oklch(0.65 0.15 25.723)`};
|
|
156
|
+
--muted-foreground: ${r?.colors?.mutedForeground||`oklch(0.65 0 0)`};
|
|
157
|
+
--corner-border: ${r?.colors?.cornerBorder||`#a0a0a0`};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
@media (max-width: 640px) {
|
|
161
|
+
:root, :host {
|
|
162
|
+
--text-6xl: 2.5rem;
|
|
163
|
+
--text-2xl: 1.25rem;
|
|
164
|
+
--text-sm: 0.8125rem;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
@media (max-width: 480px) {
|
|
168
|
+
:root, :host {
|
|
169
|
+
--text-6xl: 2rem;
|
|
170
|
+
--text-2xl: 1.125rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
174
|
+
</head>
|
|
175
|
+
<body style="width: 100vw; min-height: 100vh; overflow-x: hidden; overflow-y: auto;">
|
|
176
|
+
<div
|
|
177
|
+
style="
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
gap: 1.5rem;
|
|
183
|
+
position: relative;
|
|
184
|
+
width: 100%;
|
|
185
|
+
min-height: 100vh;
|
|
186
|
+
padding: 1rem;
|
|
187
|
+
"
|
|
188
|
+
>
|
|
189
|
+
${r?.disableBackgroundGrid?``:`
|
|
190
|
+
<div
|
|
191
|
+
style="
|
|
192
|
+
position: absolute;
|
|
193
|
+
inset: 0;
|
|
194
|
+
background-image: linear-gradient(to right, ${r?.colors?.gridColor||`var(--border)`} 1px, transparent 1px),
|
|
195
|
+
linear-gradient(to bottom, ${r?.colors?.gridColor||`var(--border)`} 1px, transparent 1px);
|
|
196
|
+
background-size: 40px 40px;
|
|
197
|
+
opacity: 0.6;
|
|
198
|
+
pointer-events: none;
|
|
199
|
+
width: 100vw;
|
|
200
|
+
height: 100vh;
|
|
201
|
+
"
|
|
202
|
+
></div>
|
|
203
|
+
<div
|
|
204
|
+
style="
|
|
205
|
+
position: absolute;
|
|
206
|
+
inset: 0;
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
background: ${r?.colors?.background||`var(--background)`};
|
|
211
|
+
mask-image: radial-gradient(ellipse at center, transparent 20%, black);
|
|
212
|
+
-webkit-mask-image: radial-gradient(ellipse at center, transparent 20%, black);
|
|
213
|
+
pointer-events: none;
|
|
214
|
+
"
|
|
215
|
+
></div>
|
|
216
|
+
`}
|
|
217
|
+
|
|
218
|
+
<div
|
|
219
|
+
style="
|
|
220
|
+
position: relative;
|
|
221
|
+
z-index: 10;
|
|
222
|
+
border: 2px solid var(--border);
|
|
223
|
+
background: ${r?.colors?.cardBackground||`var(--background)`};
|
|
224
|
+
padding: 1.5rem;
|
|
225
|
+
max-width: 42rem;
|
|
226
|
+
width: 100%;
|
|
227
|
+
"
|
|
228
|
+
>
|
|
229
|
+
${r?.disableCornerDecorations?``:`
|
|
230
|
+
<!-- Corner decorations -->
|
|
231
|
+
<div
|
|
232
|
+
style="
|
|
233
|
+
position: absolute;
|
|
234
|
+
top: -2px;
|
|
235
|
+
left: -2px;
|
|
236
|
+
width: 2rem;
|
|
237
|
+
height: 2rem;
|
|
238
|
+
border-top: 4px solid var(--corner-border);
|
|
239
|
+
border-left: 4px solid var(--corner-border);
|
|
240
|
+
"
|
|
241
|
+
></div>
|
|
242
|
+
<div
|
|
243
|
+
style="
|
|
244
|
+
position: absolute;
|
|
245
|
+
top: -2px;
|
|
246
|
+
right: -2px;
|
|
247
|
+
width: 2rem;
|
|
248
|
+
height: 2rem;
|
|
249
|
+
border-top: 4px solid var(--corner-border);
|
|
250
|
+
border-right: 4px solid var(--corner-border);
|
|
251
|
+
"
|
|
252
|
+
></div>
|
|
253
|
+
|
|
254
|
+
<div
|
|
255
|
+
style="
|
|
256
|
+
position: absolute;
|
|
257
|
+
bottom: -2px;
|
|
258
|
+
left: -2px;
|
|
259
|
+
width: 2rem;
|
|
260
|
+
height: 2rem;
|
|
261
|
+
border-bottom: 4px solid var(--corner-border);
|
|
262
|
+
border-left: 4px solid var(--corner-border);
|
|
263
|
+
"
|
|
264
|
+
></div>
|
|
265
|
+
<div
|
|
266
|
+
style="
|
|
267
|
+
position: absolute;
|
|
268
|
+
bottom: -2px;
|
|
269
|
+
right: -2px;
|
|
270
|
+
width: 2rem;
|
|
271
|
+
height: 2rem;
|
|
272
|
+
border-bottom: 4px solid var(--corner-border);
|
|
273
|
+
border-right: 4px solid var(--corner-border);
|
|
274
|
+
"
|
|
275
|
+
></div>`}
|
|
276
|
+
|
|
277
|
+
<div style="text-align: center; margin-bottom: 1.5rem;">
|
|
278
|
+
<div style="margin-bottom: 1.5rem;">
|
|
279
|
+
<div
|
|
280
|
+
style="
|
|
281
|
+
display: inline-block;
|
|
282
|
+
border: 2px solid ${r?.disableTitleBorder?`transparent`:r?.colors?.titleBorder||`var(--destructive)`};
|
|
283
|
+
padding: 0.375rem 1rem;
|
|
284
|
+
"
|
|
285
|
+
>
|
|
286
|
+
<h1
|
|
287
|
+
style="
|
|
288
|
+
font-size: var(--text-6xl);
|
|
289
|
+
font-weight: var(--font-weight-semibold);
|
|
290
|
+
color: ${r?.colors?.titleColor||`var(--foreground)`};
|
|
291
|
+
letter-spacing: -0.02em;
|
|
292
|
+
margin: 0;
|
|
293
|
+
"
|
|
294
|
+
>
|
|
295
|
+
ERROR
|
|
296
|
+
</h1>
|
|
297
|
+
</div>
|
|
298
|
+
<div
|
|
299
|
+
style="
|
|
300
|
+
height: 2px;
|
|
301
|
+
background-color: var(--border);
|
|
302
|
+
width: calc(100% + 3rem);
|
|
303
|
+
margin-left: -1.5rem;
|
|
304
|
+
margin-top: 1.5rem;
|
|
305
|
+
"
|
|
306
|
+
></div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<h2
|
|
310
|
+
style="
|
|
311
|
+
font-size: var(--text-2xl);
|
|
312
|
+
font-weight: var(--font-weight-semibold);
|
|
313
|
+
color: var(--foreground);
|
|
314
|
+
margin: 0 0 1rem;
|
|
315
|
+
"
|
|
316
|
+
>
|
|
317
|
+
Something went wrong
|
|
318
|
+
</h2>
|
|
319
|
+
|
|
320
|
+
<div
|
|
321
|
+
style="
|
|
322
|
+
display: inline-flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
gap: 0.5rem;
|
|
325
|
+
border: 2px solid var(--border);
|
|
326
|
+
background-color: var(--muted);
|
|
327
|
+
padding: 0.375rem 0.75rem;
|
|
328
|
+
margin: 0 0 1rem;
|
|
329
|
+
flex-wrap: wrap;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
"
|
|
332
|
+
>
|
|
333
|
+
<span
|
|
334
|
+
style="
|
|
335
|
+
font-size: 0.75rem;
|
|
336
|
+
color: var(--muted-foreground);
|
|
337
|
+
font-weight: var(--font-weight-semibold);
|
|
338
|
+
"
|
|
339
|
+
>
|
|
340
|
+
CODE:
|
|
341
|
+
</span>
|
|
342
|
+
<span
|
|
343
|
+
style="
|
|
344
|
+
font-size: var(--text-sm);
|
|
345
|
+
font-family: var(--default-mono-font-family, monospace);
|
|
346
|
+
color: var(--foreground);
|
|
347
|
+
word-break: break-all;
|
|
348
|
+
"
|
|
349
|
+
>
|
|
350
|
+
${GC(t)}
|
|
351
|
+
</span>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<p
|
|
355
|
+
style="
|
|
356
|
+
color: var(--muted-foreground);
|
|
357
|
+
max-width: 28rem;
|
|
358
|
+
margin: 0 auto;
|
|
359
|
+
font-size: var(--text-sm);
|
|
360
|
+
line-height: 1.5;
|
|
361
|
+
text-wrap: pretty;
|
|
362
|
+
"
|
|
363
|
+
>
|
|
364
|
+
${n||`We encountered an unexpected error. Please try again or return to the home page. If you're a developer, you can find <a href='https://better-auth.com/docs/reference/errors/${encodeURIComponent(t)}' target='_blank' rel="noopener noreferrer" style='color: var(--foreground); text-decoration: underline;'>more information about the error</a>.`}
|
|
365
|
+
</p>
|
|
366
|
+
</div>
|
|
367
|
+
|
|
368
|
+
<div
|
|
369
|
+
style="
|
|
370
|
+
display: flex;
|
|
371
|
+
gap: 0.75rem;
|
|
372
|
+
margin-top: 1.5rem;
|
|
373
|
+
justify-content: center;
|
|
374
|
+
flex-wrap: wrap;
|
|
375
|
+
"
|
|
376
|
+
>
|
|
377
|
+
<a
|
|
378
|
+
href="/"
|
|
379
|
+
style="
|
|
380
|
+
text-decoration: none;
|
|
381
|
+
"
|
|
382
|
+
>
|
|
383
|
+
<div
|
|
384
|
+
style="
|
|
385
|
+
border: 2px solid var(--border);
|
|
386
|
+
background: var(--primary);
|
|
387
|
+
color: var(--primary-foreground);
|
|
388
|
+
padding: 0.5rem 1rem;
|
|
389
|
+
border-radius: 0;
|
|
390
|
+
white-space: nowrap;
|
|
391
|
+
"
|
|
392
|
+
class="btn"
|
|
393
|
+
>
|
|
394
|
+
Go Home
|
|
395
|
+
</div>
|
|
396
|
+
</a>
|
|
397
|
+
<a
|
|
398
|
+
href="https://better-auth.com/docs/reference/errors/${encodeURIComponent(t)}?askai=${encodeURIComponent(`What does the error code ${t} mean?`)}"
|
|
399
|
+
target="_blank"
|
|
400
|
+
rel="noopener noreferrer"
|
|
401
|
+
style="
|
|
402
|
+
text-decoration: none;
|
|
403
|
+
"
|
|
404
|
+
>
|
|
405
|
+
<div
|
|
406
|
+
style="
|
|
407
|
+
border: 2px solid var(--border);
|
|
408
|
+
background: transparent;
|
|
409
|
+
color: var(--foreground);
|
|
410
|
+
padding: 0.5rem 1rem;
|
|
411
|
+
border-radius: 0;
|
|
412
|
+
white-space: nowrap;
|
|
413
|
+
"
|
|
414
|
+
class="btn"
|
|
415
|
+
>
|
|
416
|
+
Ask AI
|
|
417
|
+
</div>
|
|
418
|
+
</a>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
</body>
|
|
423
|
+
</html>`},qC=hi(`/error`,{method:`GET`,metadata:{...HC,openapi:{description:`Displays an error page`,responses:{200:{description:`Success`,content:{"text/html":{schema:{type:`string`,description:`The HTML content of the error page`}}}}}}}},async e=>{let t=new URL(e.request?.url||``),n=t.searchParams.get(`error`)||`UNKNOWN`,r=t.searchParams.get(`error_description`)||null,i=/^[\'A-Za-z0-9_-]+$/.test(n||``)?n:`UNKNOWN`,a=r?GC(r):null,o=new URLSearchParams;o.set(`error`,i),r&&o.set(`error_description`,r);let s=e.context.options,c=s.onAPIError?.errorURL;if(c){let e=Fr(c,o);return new Response(null,{status:302,headers:{Location:e}})}return xi&&!s.onAPIError?.customizeDefaultErrorPage?new Response(null,{status:302,headers:{Location:`/?${o.toString()}`}}):new Response(KC(e.context.options,i,a),{headers:{"Content-Type":`text/html`}})}),JC=hi(`/ok`,{method:`GET`,metadata:{...HC,openapi:{description:`Check if the API is working`,responses:{200:{description:`API is working`,content:{"application/json":{schema:{type:`object`,properties:{ok:{type:`boolean`,description:`Indicates if the API is working`}},required:[`ok`]}}}}}}}},async e=>e.json({ok:!0}));function YC(e,t){if(t.length<e.context.password.config.minPasswordLength)throw e.context.logger.warn(`Password is too short`),H.from(`BAD_REQUEST`,V.PASSWORD_TOO_SHORT)}function XC(e,t){if(t.length>e.context.password.config.maxPasswordLength)throw e.context.logger.warn(`Password is too long`),H.from(`BAD_REQUEST`,V.PASSWORD_TOO_LONG)}async function ZC(e,t,n,r){await Qr(e.context.adapter,async()=>{await r?.(),e.context.options.emailAndPassword?.revokeSessionsOnPasswordReset&&await e.context.internalAdapter.deleteUserSessions(t),await e.context.internalAdapter.findCredentialAccount(t)?await e.context.internalAdapter.updatePassword(t,n):await e.context.internalAdapter.createAccount({userId:t,providerId:`credential`,accountId:t,password:n})})}async function QC(e,t){XC(e,t.password);let n=await e.context.internalAdapter.findCredentialAccount(t.userId),r=n?.password;return!n||!r?!1:await e.context.password.verify({hash:r,password:t.password})}async function $C(e,t){let n=t.body.password;typeof n==`string`&&XC(t,n);let r=await t.context.internalAdapter.findCredentialAccount(e),i=r?.password;if(!r||!i||!n)throw n&&await t.context.password.hash(n),H.from(`BAD_REQUEST`,V.INVALID_PASSWORD);if(!await t.context.password.verify({hash:i,password:n}))throw H.from(`BAD_REQUEST`,V.INVALID_PASSWORD);return!0}function ew(e,t,n){let r=t?new URL(t,e.baseURL):new URL(`${e.baseURL}/error`);return n&&Object.entries(n).forEach(([e,t])=>r.searchParams.set(e,t)),r.href}function tw(e,t,n){let r=new URL(t,e.baseURL);return n&&Object.entries(n).forEach(([e,t])=>r.searchParams.set(e,t)),r.href}var nw=hi(`/request-password-reset`,{method:`POST`,body:B({email:Zt().meta({description:`The email address of the user to send a password reset email to`}),redirectTo:z().meta({description:"The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"}).optional()}),metadata:{openapi:{operationId:`requestPasswordReset`,description:`Send a password reset email to the user`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`},message:{type:`string`}}}}}}}}},use:[bx(e=>e.body.redirectTo)]},async e=>{if(!e.context.options.emailAndPassword?.sendResetPassword)throw e.context.logger.error(`Reset password isn't enabled.Please pass an emailAndPassword.sendResetPassword function in your auth config!`),H.from(`BAD_REQUEST`,{message:`Reset password isn't enabled`,code:`RESET_PASSWORD_DISABLED`});let{email:t,redirectTo:n}=e.body,r=await e.context.internalAdapter.findUserByEmail(t,{includeAccounts:!0});if(!r)return Pi(24),await e.context.internalAdapter.findVerificationValue(`dummy-verification-token`),e.context.logger.warn(`Reset Password: User not found`),e.json({status:!0,message:`If this email exists in our system, check your email for the reset link`});let i=ln(e.context.options.emailAndPassword.resetPasswordTokenExpiresIn||3600,`sec`),a=Pi(24);await e.context.internalAdapter.createVerificationValue({value:r.user.id,identifier:`reset-password:${a}`,expiresAt:i});let o=n?encodeURIComponent(n):``,s=`${e.context.baseURL}/reset-password/${a}?callbackURL=${o}`;return await e.context.runInBackgroundOrAwait(e.context.options.emailAndPassword.sendResetPassword({user:r.user,url:s,token:a},e.request)),e.json({status:!0,message:`If this email exists in our system, check your email for the reset link`})}),rw=hi(`/reset-password/:token`,{method:`GET`,operationId:`resetPasswordCallback`,query:B({callbackURL:z().meta({description:`The URL to redirect the user to reset their password`})}),use:[bx(e=>e.query.callbackURL)],metadata:{openapi:{operationId:`resetPasswordCallback`,description:`Redirects the user to the callback URL with the token`,parameters:[{name:`token`,in:`path`,required:!0,description:`The token to reset the password`,schema:{type:`string`}},{name:`callbackURL`,in:`query`,required:!0,description:`The URL to redirect the user to reset their password`,schema:{type:`string`}}],responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{token:{type:`string`}}}}}}}}}},async e=>{let{token:t}=e.params,{callbackURL:n}=e.query;if(!t||!n)throw e.redirect(ew(e.context,n,{error:`INVALID_TOKEN`}));let r=await e.context.internalAdapter.findVerificationValue(`reset-password:${t}`);throw!r||r.expiresAt<new Date?e.redirect(ew(e.context,n,{error:`INVALID_TOKEN`})):e.redirect(tw(e.context,n,{token:t}))}),iw=hi(`/reset-password`,{method:`POST`,operationId:`resetPassword`,query:B({token:z().optional()}).optional(),body:B({newPassword:z().meta({description:`The new password to set`}),token:z().meta({description:`The token to reset the password`}).optional()}),metadata:{openapi:{operationId:`resetPassword`,description:`Reset the password for a user`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`}}}}}}}}}},async e=>{let t=e.body.token||e.query?.token;if(!t)throw H.from(`BAD_REQUEST`,V.INVALID_TOKEN);let{newPassword:n}=e.body;YC(e,n),XC(e,n);let r=`reset-password:${t}`,i=await e.context.internalAdapter.findVerificationValue(r);if(!i||i.expiresAt<new Date)throw H.from(`BAD_REQUEST`,V.INVALID_TOKEN);let a=i.value,o=await e.context.internalAdapter.findUserById(a);if(!o)throw H.from(`BAD_REQUEST`,V.USER_NOT_FOUND);return await ZC(e,a,await e.context.password.hash(n),async()=>{if(!await e.context.internalAdapter.consumeVerificationValue(r))throw H.from(`BAD_REQUEST`,V.INVALID_TOKEN)}),e.context.options.emailAndPassword?.onPasswordReset&&await e.context.options.emailAndPassword.onPasswordReset({user:o},e.request),e.json({status:!0})}),aw=hi(`/verify-password`,{method:`POST`,body:B({password:z().meta({description:`The password to verify`})}),metadata:{scope:`server`,openapi:{operationId:`verifyPassword`,description:`Verify the current user's password`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`}}}}}}}}},use:[pn]},async e=>{let{password:t}=e.body,n=e.context.session;if(!await QC(e,{password:t,userId:n.user.id}))throw H.from(`BAD_REQUEST`,V.INVALID_PASSWORD);return e.json({status:!0})}),ow=B({callbackURL:z().meta({description:`Callback URL to redirect to after the user has signed in`}).optional(),newUserCallbackURL:z().optional(),errorCallbackURL:z().meta({description:`Callback URL to redirect to if an error happens`}).optional(),provider:kC,disableRedirect:Xt().meta({description:`Disable automatic redirection to the provider. Useful for handling the redirection yourself`}).optional(),idToken:Ht(B({token:z().meta({description:`ID token from the provider`}),nonce:z().meta({description:`Nonce used to generate the token`}).optional(),accessToken:z().meta({description:`Access token from the provider`}).optional(),refreshToken:z().meta({description:`Refresh token from the provider`}).optional(),expiresAt:Gt().meta({description:`Expiry date of the token`}).optional(),user:B({name:B({firstName:z().optional(),lastName:z().optional()}).optional(),email:z().optional()}).meta({description:`The user object from the provider. Only available for some providers like Apple.`}).optional()})),scopes:en(z()).meta({description:`Array of scopes to request from the provider. This will override the default scopes passed.`}).optional(),requestSignUp:Xt().meta({description:`Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider`}).optional(),loginHint:z().meta({description:`The login hint to use for the authorization code request`}).optional(),additionalParams:Bb,additionalData:Rt(z(),Qt()).optional().meta({description:`Additional data to be passed through the OAuth flow`})}),sw=()=>hi(`/sign-in/social`,{method:`POST`,operationId:`socialSignIn`,body:ow,metadata:{$Infer:{body:{},returned:{}},openapi:{description:`Sign in with a social provider`,operationId:`socialSignIn`,responses:{200:{description:`Success - Returns session details (idToken branch) or an authorize URL (redirect branch)`,content:{"application/json":{schema:{type:`object`,description:`Returns session details when idToken is provided, or an authorize URL otherwise`,properties:{token:{type:`string`},user:{type:`object`,$ref:`#/components/schemas/User`},url:{type:`string`},redirect:{type:`boolean`}},required:[`redirect`]}}}}}}}},async e=>{let t=await nS(e.context.socialProviders,{value:e.body.provider});if(!t)throw e.context.logger.error(`Provider not found. Make sure to add the provider in your auth config`,{provider:e.body.provider}),H.from(`NOT_FOUND`,V.PROVIDER_NOT_FOUND);if(e.body.idToken){if(!ox(t))throw e.context.logger.error(`Provider does not support id token verification`,{provider:e.body.provider}),H.from(`NOT_FOUND`,V.ID_TOKEN_NOT_SUPPORTED);let{token:n,nonce:r}=e.body.idToken;if(!await sx(t,n,r,e))throw e.context.logger.warn(`Invalid id token`,{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.INVALID_TOKEN);let i={idToken:n,accessToken:e.body.idToken.accessToken,refreshToken:e.body.idToken.refreshToken,user:e.body.idToken.user},a=await t.getUserInfo(i);if(!a||!a?.user)throw e.context.logger.error(`Failed to get user info`,{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.FAILED_TO_GET_USER_INFO);if(!a.user.email)throw e.context.logger.error(uS(e.body.provider,{source:`id_token`}),{provider:e.body.provider}),H.from(`UNAUTHORIZED`,V.USER_EMAIL_NOT_FOUND);let o=await oS(t,i,a.data),s=iS(a.data),c=await SS(e,{userInfo:{...a.user,email:a.user.email,id:o.accountId,name:a.user.name||``,image:a.user.image,emailVerified:a.user.emailVerified||!1},account:{...o,accessToken:e.body.idToken.accessToken,idToken:n},callbackURL:e.body.callbackURL,disableSignUp:t.disableImplicitSignUp&&!e.body.requestSignUp||t.options?.disableSignUp||t.disableSignUp,source:{method:`oauth`,oauth:{providerId:t.id,profile:s}}});if(c.error)throw c.error===sS.EMAIL_NOT_VERIFIED?H.from(`FORBIDDEN`,V.EMAIL_NOT_VERIFIED):H.from(`UNAUTHORIZED`,{message:c.error,code:`OAUTH_LINK_ERROR`});return await In(e,c.data),e.json({redirect:!1,token:c.data.session.token,url:void 0,user:er(e.context.options,c.data.user)})}let n=NS(t),{codeVerifier:r,state:i}=await PS(e,{additionalData:e.body.additionalData,idTokenNonce:n}),a=await t.createAuthorizationURL({state:i,codeVerifier:r,idTokenNonce:n,redirectURI:`${e.context.baseURL}${mS(t)}`,scopes:e.body.scopes,loginHint:e.body.loginHint,additionalParams:e.body.additionalParams});return e.body.disableRedirect||e.setHeader(`Location`,a.toString()),e.json({url:a.toString(),redirect:!e.body.disableRedirect})}),cw=()=>hi(`/sign-in/email`,{method:`POST`,operationId:`signInEmail`,use:[Sx],cloneRequest:!0,body:B({email:z().meta({description:`Email of the user`}),password:z().meta({description:`Password of the user`}),callbackURL:z().meta({description:`Callback URL to use as a redirect for email verification`}).optional(),rememberMe:Xt().meta({description:"If this is false, the session will not be remembered. Default is `true`."}).default(!0).optional()}),metadata:{allowedMediaTypes:[`application/x-www-form-urlencoded`,`application/json`],$Infer:{body:{},returned:{}},openapi:{operationId:`signInEmail`,description:`Sign in with email and password`,responses:{200:{description:`Success - Returns either session details or redirect URL`,content:{"application/json":{schema:{type:`object`,description:`Session response when idToken is provided`,properties:{redirect:{type:`boolean`,enum:[!1]},token:{type:`string`,description:`Session token`},url:{type:`string`,nullable:!0},user:{type:`object`,$ref:`#/components/schemas/User`}},required:[`redirect`,`token`,`user`]}}}}}}}},async e=>{if(!e.context.options?.emailAndPassword?.enabled)throw e.context.logger.error("Email and password is not enabled. Make sure to enable it in the options on you `auth.ts` file. Check `https://better-auth.com/docs/authentication/email-password` for more!"),H.from(`BAD_REQUEST`,{code:`EMAIL_PASSWORD_DISABLED`,message:`Email and password is not enabled`});let{email:t,password:n}=e.body;if(!Zt().safeParse(t).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);XC(e,n);let r=await e.context.internalAdapter.findUserByEmail(t.toLowerCase(),{includeAccounts:!0}),i=r?.accounts.find(e=>e.providerId===`credential`&&e.accountId===r.user.id);if(!r||!i)throw await e.context.password.hash(n),e.context.logger.warn(`User not found`),H.from(`UNAUTHORIZED`,V.INVALID_EMAIL_OR_PASSWORD);let a=r.user,o=i.password;if(!o)throw await e.context.password.hash(n),e.context.logger.warn(`Password not found`),H.from(`UNAUTHORIZED`,V.INVALID_EMAIL_OR_PASSWORD);if(!await e.context.password.verify({hash:o,password:n}))throw e.context.logger.warn(`Invalid password`),H.from(`UNAUTHORIZED`,V.INVALID_EMAIL_OR_PASSWORD);if(e.context.options?.emailAndPassword?.requireEmailVerification&&!a.emailVerified){if(!e.context.options?.emailVerification?.sendVerificationEmail)throw H.from(`FORBIDDEN`,V.EMAIL_NOT_VERIFIED);if(e.context.options?.emailVerification?.sendOnSignIn){let t=await gS(e.context.secret,a.email,void 0,e.context.options.emailVerification?.expiresIn),n=e.body.callbackURL?encodeURIComponent(e.body.callbackURL):`%2F`,r=`${e.context.baseURL}/verify-email?token=${t}&callbackURL=${n}`;await e.context.runInBackgroundOrAwait(e.context.options.emailVerification.sendVerificationEmail({user:a,url:r,token:t},hS(e.request)))}throw H.from(`FORBIDDEN`,V.EMAIL_NOT_VERIFIED)}let s=await e.context.internalAdapter.createSession(a.id,e.body.rememberMe===!1);if(!s)throw e.context.logger.error(`Failed to create session`),H.from(`UNAUTHORIZED`,V.FAILED_TO_CREATE_SESSION);return await In(e,{session:s,user:a},e.body.rememberMe===!1),e.body.callbackURL&&e.setHeader(`Location`,e.body.callbackURL),e.json({redirect:!!e.body.callbackURL,token:s.token,url:e.body.callbackURL,user:er(e.context.options,a)})}),lw=B({callbackURL:z().meta({description:`The URL to redirect to after provider logout`}).optional(),disableRedirect:Xt().meta({description:`Return the provider logout URL without redirecting`}).optional(),state:z().meta({description:`State to pass to the provider logout endpoint`}).optional()}).optional(),uw=e=>({success:!0,url:e?.url,redirect:e?.redirect}),dw=hi(`/sign-out`,{method:`POST`,body:lw,operationId:`signOut`,requireHeaders:!0,metadata:{openapi:{operationId:`signOut`,description:`Sign out the current user`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`},url:{type:`string`,description:`Provider logout URL when RP-initiated logout is available`},redirect:{type:`boolean`,description:`Whether the client should redirect to the provider logout URL`}}}}}}}}}},async e=>{let t=await e.getSignedCookie(e.context.authCookies.sessionToken.name,e.context.secret),n=null;if(t)try{n=await e.context.internalAdapter.findSession(t)}catch(t){e.context.logger.error(`Failed to read session from database`,t)}if(t)try{await e.context.internalAdapter.deleteSession(t)}catch(t){e.context.logger.error(`Failed to delete session from database`,t)}sn(e);let r=await(async()=>{try{if(!n)return null;let t=await e.context.internalAdapter.findAccounts(n.user.id),r=new Map(e.context.socialProviders.map(e=>[e.id,e])),i=t.filter(e=>!!r.get(e.providerId)?.createEndSessionURL).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());if(i.length===0)return null;let a=new Set,o=e.body?.callbackURL?new URL(e.body.callbackURL,e.context.baseURL).toString():void 0;for(let t of i){if(a.has(t.providerId))continue;a.add(t.providerId);let n=r.get(t.providerId);try{let r=await n?.createEndSessionURL?.({idToken:t.idToken,postLogoutRedirectURI:o,state:e.body?.state});if(r)return r.toString()}catch(n){e.context.logger.error(`Failed to create logout URL for provider "${t.providerId}"`,n)}}return null}catch(t){return e.context.logger.error(`Failed to create provider logout URL`,t),null}})();if(r){let t=!e.body?.disableRedirect;return t&&e.setHeader(`Location`,r),e.json(uw({url:r,redirect:t}))}return e.json(uw())}),fw=B({name:z(),email:Zt(),password:z().nonempty(),image:z().optional(),callbackURL:z().optional(),rememberMe:Xt().optional()}).and(Rt(z(),Qt())),pw=()=>hi(`/sign-up/email`,{method:`POST`,operationId:`signUpWithEmailAndPassword`,use:[Sx],body:fw,cloneRequest:!0,metadata:{allowedMediaTypes:[`application/x-www-form-urlencoded`,`application/json`],$Infer:{body:{},returned:{}},openapi:{operationId:`signUpWithEmailAndPassword`,description:`Sign up a user using email and password`,requestBody:{content:{"application/json":{schema:{type:`object`,properties:{name:{type:`string`,description:`The name of the user`},email:{type:`string`,description:`The email of the user`},password:{type:`string`,description:`The password of the user`},image:{type:`string`,description:`The profile image URL of the user`},callbackURL:{type:`string`,description:`The URL to use for email verification callback`},rememberMe:{type:`boolean`,description:"If this is false, the session will not be remembered. Default is `true`."}},required:[`name`,`email`,`password`]}}}},responses:{200:{description:`Successfully created user`,content:{"application/json":{schema:{type:`object`,properties:{token:{type:`string`,nullable:!0,description:`Authentication token for the session`},user:{type:`object`,properties:{id:{type:`string`,description:`The unique identifier of the user`},email:{type:`string`,format:`email`,description:`The email address of the user`},name:{type:`string`,description:`The name of the user`},image:{type:`string`,format:`uri`,nullable:!0,description:`The profile image URL of the user`},emailVerified:{type:`boolean`,description:`Whether the email has been verified`},createdAt:{type:`string`,format:`date-time`,description:`When the user was created`},updatedAt:{type:`string`,format:`date-time`,description:`When the user was last updated`}},required:[`id`,`email`,`name`,`emailVerified`,`createdAt`,`updatedAt`]}},required:[`user`]}}}},422:{description:`Unprocessable Entity. User already exists or failed to create user.`,content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}}}}}}}}}},async e=>Qr(e.context.adapter,async()=>{if(!e.context.options.emailAndPassword?.enabled||e.context.options.emailAndPassword?.disableSignUp)throw H.from(`BAD_REQUEST`,{message:`Email and password sign up is not enabled`,code:`EMAIL_PASSWORD_SIGN_UP_DISABLED`});let t=e.body,{name:n,email:r,password:i,image:a,callbackURL:o,rememberMe:s,...c}=t;if(!Zt().safeParse(r).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);if(!i||typeof i!=`string`)throw H.from(`BAD_REQUEST`,V.INVALID_PASSWORD);YC(e,i),XC(e,i);let l=e.context.options.emailAndPassword.requireEmailVerification||e.context.options.emailAndPassword.autoSignIn===!1,u=e.context.options.emailAndPassword.autoSignIn===!1||l,d=wn(e.context.options,c,`create`),f=r.toLowerCase(),p=()=>{let t=new Date,r=e.context.generateId({model:`user`})||Pi(),i={name:n,email:f,emailVerified:!1,image:a??null,createdAt:t,updatedAt:t},o=e.context.options.emailAndPassword?.customSyntheticUser,s;if(o){let t=Object.keys(e.context.options.user?.additionalFields??{}),n={};for(let e of t)e in d&&(n[e]=d[e]);let a=o({coreFields:i,additionalFields:n,id:r});s=Jn(e.context.options,a)}else s=Jn(e.context.options,{...i,...d,id:r});return e.json({token:null,user:er(e.context.options,s)})},m=await e.context.internalAdapter.findUserByEmail(f);if(m?.user){if(e.context.logger.info(`Sign-up attempt for existing email: ${r}`),l)return await e.context.password.hash(i),e.context.options.emailAndPassword?.onExistingUserSignUp&&await e.context.runInBackgroundOrAwait(e.context.options.emailAndPassword.onExistingUserSignUp({user:m.user},hS(e.request))),p();throw H.from(`UNPROCESSABLE_ENTITY`,V.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL)}let h=await e.context.password.hash(i),g;try{if(g=await e.context.internalAdapter.createUser({email:f,name:n,image:a,...d,emailVerified:!1},{method:`email-password`}),!g)throw H.from(`BAD_REQUEST`,V.FAILED_TO_CREATE_USER)}catch(t){if(fn(t)){if(t.statusCode===403&&l)return p();throw t}throw Fi()&&e.context.logger.error(`Failed to create user`,t),e.context.logger?.error(`Failed to create user`,t),H.from(`UNPROCESSABLE_ENTITY`,V.FAILED_TO_CREATE_USER)}if(!g)throw H.from(`UNPROCESSABLE_ENTITY`,V.FAILED_TO_CREATE_USER);if(await e.context.internalAdapter.linkAccount({userId:g.id,providerId:`credential`,accountId:g.id,password:h}),e.context.options.emailVerification?.sendOnSignUp??e.context.options.emailAndPassword.requireEmailVerification){let n=await gS(e.context.secret,g.email,void 0,e.context.options.emailVerification?.expiresIn),r=t.callbackURL?encodeURIComponent(t.callbackURL):`%2F`,i=`${e.context.baseURL}/verify-email?token=${n}&callbackURL=${r}`;e.context.options.emailVerification?.sendVerificationEmail&&await e.context.runInBackgroundOrAwait(e.context.options.emailVerification.sendVerificationEmail({user:g,url:i,token:n},hS(e.request)))}if(u)return e.json({token:null,user:er(e.context.options,g)});let _=await e.context.internalAdapter.createSession(g.id,s===!1,void 0,void 0,{deferSecondaryStorageWrites:!0});if(!_)throw H.from(`BAD_REQUEST`,V.FAILED_TO_CREATE_SESSION);return await In(e,{session:_,user:g},s===!1),e.json({token:_.token,user:er(e.context.options,g)})})),mw=Rt(z().meta({description:`Field name must be a string`}),Qt()),hw=()=>hi(`/update-session`,{method:`POST`,operationId:`updateSession`,body:mw,use:[Pn],metadata:{$Infer:{body:{}},openapi:{operationId:`updateSession`,description:`Update the current session`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{session:{type:`object`,$ref:`#/components/schemas/Session`}}}}}}}}}},async e=>{let t=e.body;if(typeof t!=`object`||Array.isArray(t))throw H.from(`BAD_REQUEST`,V.BODY_MUST_BE_AN_OBJECT);let n=e.context.session,r=En(e.context.options,t,`update`);if(Object.keys(r).length===0)throw H.fromStatus(`BAD_REQUEST`,{message:`No fields to update`});let i=await e.context.internalAdapter.updateSession(n.session.token,{...r,updatedAt:new Date});if(!i&&Hn(e))throw sn(e),H.from(`UNAUTHORIZED`,V.FAILED_TO_GET_SESSION);let a=i??{...n.session,...r,updatedAt:new Date};return await In(e,{session:a,user:n.user}),e.json({session:Jr(e.context.options,a)})}),gw=Rt(z().meta({description:`Field name must be a string`}),Qt()),_w=()=>hi(`/update-user`,{method:`POST`,operationId:`updateUser`,body:gw,use:[Pn],metadata:{$Infer:{body:{}},openapi:{operationId:`updateUser`,description:`Update the current user`,requestBody:{content:{"application/json":{schema:{type:`object`,properties:{name:{type:`string`,description:`The name of the user`},image:{type:`string`,description:`The image of the user`,nullable:!0}}}}}},responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{user:{type:`object`,$ref:`#/components/schemas/User`}}}}}}}}}},async e=>{let t=e.body;if(typeof t!=`object`||Array.isArray(t))throw H.from(`BAD_REQUEST`,V.BODY_MUST_BE_AN_OBJECT);if(t.email)throw H.from(`BAD_REQUEST`,V.EMAIL_CAN_NOT_BE_UPDATED);let{name:n,image:r,...i}=t,a=e.context.session,o=wn(e.context.options,i,`update`);if(r===void 0&&n===void 0&&Object.keys(o).length===0)throw H.fromStatus(`BAD_REQUEST`,{message:`No fields to update`});let s=await e.context.internalAdapter.updateUser(a.user.id,{name:n,image:r,...o})??{...a.user,...n!==void 0&&{name:n},...r!==void 0&&{image:r},...o};return await In(e,{session:a.session,user:s}),e.json({status:!0})}),vw=hi(`/change-password`,{method:`POST`,operationId:`changePassword`,body:B({newPassword:z().meta({description:`The new password to set`}),currentPassword:z().meta({description:`The current password is required`}),revokeOtherSessions:Xt().meta({description:`Must be a boolean value`}).optional()}),use:[pn],metadata:{openapi:{operationId:`changePassword`,description:`Change the password of the user`,responses:{200:{description:`Password successfully changed`,content:{"application/json":{schema:{type:`object`,properties:{token:{type:`string`,nullable:!0,description:`New session token if other sessions were revoked`},user:{type:`object`,properties:{id:{type:`string`,description:`The unique identifier of the user`},email:{type:`string`,format:`email`,description:`The email address of the user`},name:{type:`string`,description:`The name of the user`},image:{type:`string`,format:`uri`,nullable:!0,description:`The profile image URL of the user`},emailVerified:{type:`boolean`,description:`Whether the email has been verified`},createdAt:{type:`string`,format:`date-time`,description:`When the user was created`},updatedAt:{type:`string`,format:`date-time`,description:`When the user was last updated`}},required:[`id`,`email`,`name`,`emailVerified`,`createdAt`,`updatedAt`]}},required:[`user`]}}}}}}}},async e=>{let{newPassword:t,currentPassword:n,revokeOtherSessions:r}=e.body,i=e.context.session;YC(e,t),XC(e,t),XC(e,n);let a=await e.context.internalAdapter.findCredentialAccount(i.user.id);if(!a||!a.password)throw H.from(`BAD_REQUEST`,V.CREDENTIAL_ACCOUNT_NOT_FOUND);let o=await e.context.password.hash(t);if(!await e.context.password.verify({hash:a.password,password:n}))throw H.from(`BAD_REQUEST`,V.INVALID_PASSWORD);let s=await Qr(e.context.adapter,async()=>{if(r&&await e.context.internalAdapter.deleteUserSessions(i.user.id),await e.context.internalAdapter.updateAccount(a.id,{password:o}),!r)return null;let t=await e.context.internalAdapter.createSession(i.user.id,void 0,void 0,void 0,{deferSecondaryStorageWrites:!0});if(!t)throw H.from(`INTERNAL_SERVER_ERROR`,V.FAILED_TO_GET_SESSION);return t}),c=null;return s&&(await In(e,{session:s,user:i.user}),c=s.token),e.json({token:c,user:er(e.context.options,i.user)})}),yw=hi.serverOnly({method:`POST`,body:B({newPassword:z().meta({description:`The new password to set is required`})}),use:[pn]},async e=>{let{newPassword:t}=e.body,n=e.context.session;YC(e,t),XC(e,t);let r=await e.context.internalAdapter.findCredentialAccount(n.user.id),i=await e.context.password.hash(t);if(!r)return await e.context.internalAdapter.linkAccount({userId:n.user.id,providerId:`credential`,accountId:n.user.id,password:i}),e.json({status:!0});if(!r.password)return await e.context.internalAdapter.updateAccount(r.id,{password:i}),e.json({status:!0});throw H.from(`BAD_REQUEST`,V.PASSWORD_ALREADY_SET)}),bw=hi(`/delete-user`,{method:`POST`,use:[pn],body:B({callbackURL:z().meta({description:`The callback URL to redirect to after the user is deleted`}).optional(),password:z().meta({description:`The password of the user is required to delete the user`}).optional(),token:z().meta({description:`The token to delete the user is required`}).optional()}),metadata:{openapi:{operationId:`deleteUser`,description:`Delete the user`,requestBody:{content:{"application/json":{schema:{type:`object`,properties:{callbackURL:{type:`string`,description:`The callback URL to redirect to after the user is deleted`},password:{type:`string`,description:`The user's password. Required if session is not fresh`},token:{type:`string`,description:`The deletion verification token`}}}}}},responses:{200:{description:`User deletion processed successfully`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`,description:`Indicates if the operation was successful`},message:{type:`string`,enum:[`User deleted`,`Verification email sent`],description:`Status message of the deletion process`}},required:[`success`,`message`]}}}}}}}},async e=>{if(!e.context.options.user?.deleteUser?.enabled)throw e.context.logger.error(`Delete user is disabled. Enable it in the options`),H.fromStatus(`NOT_FOUND`);let t=e.context.session;if(e.body.password){XC(e,e.body.password);let n=await e.context.internalAdapter.findCredentialAccount(t.user.id);if(!n||!n.password)throw H.from(`BAD_REQUEST`,V.CREDENTIAL_ACCOUNT_NOT_FOUND);if(!await e.context.password.verify({hash:n.password,password:e.body.password}))throw H.from(`BAD_REQUEST`,V.INVALID_PASSWORD)}if(e.body.token)return await xw({...e,query:{token:e.body.token}}),e.json({success:!0,message:`User deleted`});if(e.context.options.user.deleteUser?.sendDeleteAccountVerification){let n=Tn(32,`0-9`,`a-z`);await e.context.internalAdapter.createVerificationValue({value:t.user.id,identifier:`delete-account-${n}`,expiresAt:new Date(Date.now()+(e.context.options.user.deleteUser?.deleteTokenExpiresIn||86400)*1e3)});let r=`${e.context.baseURL}/delete-user/callback?token=${n}&callbackURL=${encodeURIComponent(e.body.callbackURL||`/`)}`;return await e.context.runInBackgroundOrAwait(e.context.options.user.deleteUser.sendDeleteAccountVerification({user:t.user,url:r,token:n},e.request)),e.json({success:!0,message:`Verification email sent`})}if(!e.body.password&&e.context.sessionConfig.freshAge!==0){let n=new Date(t.session.createdAt).getTime(),r=e.context.sessionConfig.freshAge*1e3;if(Date.now()-n>=r)throw H.from(`BAD_REQUEST`,V.SESSION_EXPIRED)}let n=e.context.options.user.deleteUser?.beforeDelete;n&&await n(t.user,e.request),await e.context.internalAdapter.deleteUser(t.user.id),await e.context.internalAdapter.deleteUserSessions(t.user.id),sn(e);let r=e.context.options.user.deleteUser?.afterDelete;return r&&await r(t.user,e.request),e.json({success:!0,message:`User deleted`})}),xw=hi(`/delete-user/callback`,{method:`GET`,query:B({token:z().meta({description:`The token to verify the deletion request`}),callbackURL:z().meta({description:`The URL to redirect to after deletion`}).optional()}),use:[bx(e=>e.query.callbackURL)],metadata:{openapi:{description:`Callback to complete user deletion with verification token`,responses:{200:{description:`User successfully deleted`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`,description:`Indicates if the deletion was successful`},message:{type:`string`,enum:[`User deleted`],description:`Confirmation message`}},required:[`success`,`message`]}}}}}}}},async e=>{if(!e.context.options.user?.deleteUser?.enabled)throw e.context.logger.error(`Delete user is disabled. Enable it in the options`),H.from(`NOT_FOUND`,{message:`Not found`,code:`NOT_FOUND`});let t=await fi(e,{disableCookieCache:Hn(e)});if(!t)throw H.from(`NOT_FOUND`,V.FAILED_TO_GET_USER_INFO);let n=await e.context.internalAdapter.consumeVerificationValue(`delete-account-${e.query.token}`);if(!n||n.value!==t.user.id)throw H.from(`NOT_FOUND`,V.INVALID_TOKEN);let r=e.context.options.user.deleteUser?.beforeDelete;r&&await r(t.user,e.request),await e.context.internalAdapter.deleteUser(t.user.id),await e.context.internalAdapter.deleteUserSessions(t.user.id),await e.context.internalAdapter.deleteAccounts(t.user.id),sn(e);let i=e.context.options.user.deleteUser?.afterDelete;if(i&&await i(t.user,e.request),e.query.callbackURL)throw e.redirect(e.query.callbackURL||`/`);return e.json({success:!0,message:`User deleted`})}),Sw=hi(`/change-email`,{method:`POST`,body:B({newEmail:Zt().meta({description:`The new email address to set must be a valid email address`}),callbackURL:z().meta({description:`The URL to redirect to after email verification`}).optional()}),use:[pn],metadata:{openapi:{operationId:`changeEmail`,responses:{200:{description:`Email change request processed successfully`,content:{"application/json":{schema:{type:`object`,properties:{user:{type:`object`,$ref:`#/components/schemas/User`},status:{type:`boolean`,description:`Indicates if the request was successful`},message:{type:`string`,enum:[`Email updated`,`Verification email sent`],description:`Status message of the email change process`,nullable:!0}},required:[`status`]}}}}}}}},async e=>{if(!e.context.options.user?.changeEmail?.enabled)throw e.context.logger.error(`Change email is disabled.`),H.from(`BAD_REQUEST`,V.CHANGE_EMAIL_DISABLED);let t=e.body.newEmail.toLowerCase();if(t===e.context.session.user.email)throw e.context.logger.warn(`Email is the same`),H.fromStatus(`BAD_REQUEST`,{message:`Email is the same`});let n=e.context.session.user.emailVerified!==!0&&e.context.options.user.changeEmail.updateEmailWithoutVerification,r=e.context.options.emailVerification?.sendVerificationEmail,i=r&&e.context.session.user.emailVerified&&e.context.options.user.changeEmail.sendChangeEmailConfirmation;if(!n&&!i&&!r)throw e.context.logger.error(`Verification email isn't enabled.`),H.fromStatus(`BAD_REQUEST`,{message:`Verification email isn't enabled`});if(await e.context.internalAdapter.findUserByEmail(t))return await gS(e.context.secret,e.context.session.user.email,t,e.context.options.emailVerification?.expiresIn),e.context.logger.info(`Change email attempt for existing email`),e.json({status:!0});if(n){if(await e.context.internalAdapter.updateUser(e.context.session.user.id,{email:t}),await In(e,{session:e.context.session.session,user:{...e.context.session.user,email:t}}),r){let n=await gS(e.context.secret,t,void 0,e.context.options.emailVerification?.expiresIn),i=`${e.context.baseURL}/verify-email?token=${n}&callbackURL=${encodeURIComponent(e.body.callbackURL||`/`)}`;await e.context.runInBackgroundOrAwait(r({user:{...e.context.session.user,email:t},url:i,token:n},e.request))}return e.json({status:!0})}if(i){let n=await gS(e.context.secret,e.context.session.user.email,t,e.context.options.emailVerification?.expiresIn,{requestType:`change-email-confirmation`}),r=`${e.context.baseURL}/verify-email?token=${n}&callbackURL=${encodeURIComponent(e.body.callbackURL||`/`)}`;return await e.context.runInBackgroundOrAwait(i({user:e.context.session.user,newEmail:t,url:r,token:n},e.request)),e.json({status:!0})}if(!r)throw e.context.logger.error(`Verification email isn't enabled.`),H.fromStatus(`BAD_REQUEST`,{message:`Verification email isn't enabled`});let a=await gS(e.context.secret,e.context.session.user.email,t,e.context.options.emailVerification?.expiresIn,{requestType:`change-email-verification`}),o=`${e.context.baseURL}/verify-email?token=${a}&callbackURL=${encodeURIComponent(e.body.callbackURL||`/`)}`;return await e.context.runInBackgroundOrAwait(r({user:{...e.context.session.user,email:t},url:o,token:a},e.request)),e.json({status:!0})});async function Cw(e,t){if(e.baseURL)return e;let n=$x(t),r=e.options.baseURL,i=Tr(r)&&!!r.fallback;if(n===void 0&&!i)throw new H(`INTERNAL_SERVER_ERROR`,{message:"Dynamic baseURL could not be resolved for this direct auth.api call. Pass `headers: request.headers` (or `request`) to the call, or add `fallback` to your baseURL config."});try{return await tS(e,n,eS(e.options))}catch(e){throw e instanceof U?new H(`INTERNAL_SERVER_ERROR`,{message:e.message}):e}}function ww(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=async e=>{let n=Ir(i,r),a=async()=>{let r=await t,a=r.checkSchema?.();a&&await a;let o=Tr(r.options.baseURL)?await Cw(r,e):r;return Gr(i,{...e,context:o,operationId:n,asResponse:e?.asResponse??Cr(e?.request)})};return await Or()?a():cr(new WeakMap,a)},n[r].path=i.path,n[r].options=i.options;return n}function Tw(e,t){let n=new Map;e.plugins?.forEach(e=>{if(e.endpoints){for(let[t,r]of Object.entries(e.endpoints))if(r&&`path`in r&&typeof r.path==`string`){let i=r.path,a=[];r.options&&`method`in r.options&&(Array.isArray(r.options.method)?a=r.options.method:typeof r.options.method==`string`&&(a=[r.options.method])),a.length===0&&(a=[`*`]),n.has(i)||n.set(i,[]),n.get(i).push({pluginId:e.id,endpointKey:t,methods:a})}}});let r=[];for(let[e,t]of n.entries())if(t.length>1){let n=new Map,i=!1;for(let e of t)for(let r of e.methods)n.has(r)||n.set(r,[]),n.get(r).push(e.pluginId),n.get(r).length>1&&(i=!0),(r===`*`&&t.length>1||r!==`*`&&n.has(`*`))&&(i=!0);if(i){let i=[...new Set(t.map(e=>e.pluginId))],a=[];for(let[e,r]of n.entries())(r.length>1||e===`*`&&t.length>1||e!==`*`&&n.has(`*`))&&a.push(e);r.push({path:e,plugins:i,conflictingMethods:a})}}if(r.length>0){let e=r.map(e=>` - "${e.path}" [${e.conflictingMethods.join(`, `)}] used by plugins: ${e.plugins.join(`, `)}`).join(`
|
|
424
|
+
`);t.error(`Endpoint path conflicts detected! Multiple plugins are trying to use the same endpoint paths with conflicting HTTP methods:
|
|
425
|
+
${e}
|
|
426
|
+
|
|
427
|
+
To resolve this, you can:
|
|
428
|
+
1. Use only one of the conflicting plugins
|
|
429
|
+
2. Configure the plugins to use different paths (if supported)
|
|
430
|
+
3. Ensure plugins use different HTTP methods for the same path
|
|
431
|
+
`)}}function Ew(e,t){let n=Di(t),r=t.plugins?.reduce((e,t)=>({...e,...t.endpoints}),{})??{},i=t.plugins?.map(t=>t.middlewares?.map(r=>{let i=(async i=>{let a=await e;return n(`middleware ${r.path} ${t.id}`,{"better_auth.hook.type":`middleware`,"http.route":r.path,"better_auth.context":`plugin:${t.id}`},()=>r.middleware({...i,context:{...a,...i.context}}))});return i.options=r.middleware.options,{path:r.path,middleware:i}})).filter(e=>e!==void 0).flat()||[];return{api:ww({signInSocial:sw(),callbackOAuth:WC,getSession:lr(),signOut:dw,signUpEmail:pw(),signInEmail:cw(),resetPassword:iw,verifyPassword:aw,verifyEmail:yS,sendVerificationEmail:vS,changeEmail:Sw,changePassword:vw,setPassword:yw,updateSession:hw(),updateUser:_w(),deleteUser:bw,requestPasswordReset:nw,requestPasswordResetCallback:rw,listSessions:dn(),revokeSession:Wn,revokeSessions:hn,revokeOtherSessions:ui,linkSocialAccount:MC,listUserAccounts:jC,deleteUserCallback:xw,unlinkAccount:NC,refreshToken:BC,getAccessToken:zC,accountInfo:VC,...r,ok:JC,error:qC},e),middlewares:i}}var Dw=(e,t)=>{let n=Di(t),{api:r,middlewares:i}=Ew(e,t),a=new URL(e.baseURL).pathname;return Zn(r,{routerContext:e,openapi:{disabled:!0},basePath:a,routerMiddleware:[{path:`/**`,middleware:yx},...i],allowedMediaTypes:[`application/json`],skipTrailingSlashes:t.advanced?.skipTrailingSlashes??!1,async onRequest(t){let r=e.options.disabledPaths||[],i=si(t.url,a);if(r.includes(i))return new Response(`Not Found`,{status:404});let o=e.checkSchema?.();o&&await o;let s=t,c=await Ix(s,e);if(c)return c;for(let t of e.options.plugins||[])if(t.onRequest){let r=await n(`onRequest ${t.id}`,{[ci]:`onRequest`,[ir]:`plugin:${t.id}`},()=>t.onRequest(s,e));if(r&&`response`in r)return r.response;r&&`request`in r&&(s=r.request)}return s},async onResponse(t,r){for(let r of e.options.plugins||[])if(r.onResponse){let i=await n(`onResponse ${r.id}`,{[ci]:`onResponse`,[ir]:`plugin:${r.id}`,[ki]:t.status},()=>r.onResponse(t,e));if(i)return i.response}return t},onError(n){if(fn(n)&&n.status===`FOUND`)return;if(t.onAPIError?.throw)throw n;if(t.onAPIError?.onError){t.onAPIError.onError(n,e);return}let r=t.logger?.level,i=r===`error`||r===`warn`||r===`debug`?Hi:void 0;if(t.logger?.disabled!==!0){if(n&&typeof n==`object`&&`message`in n&&typeof n.message==`string`&&(n.message.includes(`no column`)||n.message.includes(`column`)||n.message.includes(`relation`)||n.message.includes(`table`)||n.message.includes(`does not exist`))){e.logger?.error(n.message);return}fn(n)?(n.status===`INTERNAL_SERVER_ERROR`&&e.logger.error(n.status,n),i?.error(n.message)):e.logger?.error(n&&typeof n==`object`&&`name`in n?n.name:``,n)}}})},Ow=`1.7.8`,kw=async e=>{let t=e.context.returned;return t?t instanceof Response?t.status===200?await t.clone().json():null:fn(t)?null:t:null},Aw=qn({INVALID_DEVICE_CODE:`Invalid device code`,EXPIRED_DEVICE_CODE:`Device code has expired`,EXPIRED_USER_CODE:`User code has expired`,AUTHORIZATION_PENDING:`Authorization pending`,ACCESS_DENIED:`Access denied`,INVALID_USER_CODE:`Invalid user code`,DEVICE_CODE_ALREADY_PROCESSED:`Device code already processed`,DEVICE_CODE_NOT_CLAIMED:"Device code has not been claimed by a verifying session; call `GET /device` with the `user_code` while signed in before approving or denying",POLLING_TOO_FREQUENTLY:`Polling too frequently`,USER_NOT_FOUND:`User not found`,FAILED_TO_CREATE_SESSION:`Failed to create session`,INVALID_DEVICE_CODE_STATUS:`Invalid device code status`,AUTHENTICATION_REQUIRED:`Authentication required`}),jw=`ABCDEFGHJKLMNPQRSTUVWXYZ23456789`,Mw=3,Nw=new Set([`11000`,`1062`,`2067`,`23505`,`2601`,`2627`,`ER_DUP_ENTRY`,`P2002`,`SQLITE_CONSTRAINT_UNIQUE`]);function Pw(e){if(typeof e!=`object`||!e)return!1;let t=e;if([t.code,t.errcode,t.errno,t.number].some(e=>Nw.has(String(e))))return!0;let n=t.message;return typeof n==`string`&&/unique(?: key)? constraint|duplicate (?:entry|key)|e11000/i.test(n)}var Fw=RegExp(`^[${jw}]+$`,`i`);function Iw(e,t){if(typeof e!=`string`)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:`Generated ${t} code must be a string`});if(Array.from(e).length>191)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:`Generated ${t} code must be at most 191 characters`});return e}function Lw(e){return e.replace(/[^a-zA-Z0-9]/g,``).toUpperCase()}async function Rw(e,t){let n=async t=>{let n=await e.context.adapter.findOne({model:`deviceCode`,where:[{field:`userCode`,value:t}]});return n?.userCode===t?n:null},r=await n(t);if(r)return r;let i=Lw(t);return i===t||!Fw.test(i)?r:n(i)}var zw=B({client_id:z().meta({description:`The client ID of the application`}),user_id:z().meta({description:`The user ID to which the device code should be pre-bound.`}).optional(),scope:z().meta({description:`Space-separated list of scopes`}).optional()}),Bw=[`invalid_request`,`invalid_client`,`unauthorized_client`,`invalid_scope`],Vw=[`client_id`,`user_id`,`scope`];async function Hw(e,t){for(let e of Vw)t[e]===``&&(t[e]=void 0);let n=e?.headers.get(`content-type`)?.toLowerCase()??``;if(!e||!n.includes(`application/x-www-form-urlencoded`))return;let r=new URLSearchParams(await e.clone().text());for(let e of Vw){let n=r.getAll(e).filter(e=>e.length>0);if(n.length>1)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:`${e} must not be repeated`});t[e]=n.length===0?void 0:n[0]}}var Uw=(e,t)=>{let n=async()=>Iw(e.generateDeviceCode?await e.generateDeviceCode():Qw(e.deviceCodeLength),`device`),r=async()=>Iw(e.generateUserCode?await e.generateUserCode():$w(e.userCodeLength),`user`),i=t?.requestSchemaFields??{},a=(t?zw.extend({client_id:z().optional()}):zw).extend(i),o=[...Bw,...t?.requestErrorCodes??[]],s=[...o,`server_error`];return hi(`/device/code`,{method:`POST`,cloneRequest:!0,body:a,error:B({error:Wt(s).meta({description:`Error code`}),error_description:z().meta({description:`Detailed error description`})}),onValidationError:({issues:e,message:n})=>{throw t?.onRequestValidationError?.(e),new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:n})},metadata:{noStore:!0,allowedMediaTypes:[`application/json`,`application/x-www-form-urlencoded`],openapi:{description:`Request a device and user code
|
|
432
|
+
|
|
433
|
+
Follow [rfc8628#section-3.2](https://datatracker.ietf.org/doc/html/rfc8628#section-3.2)`,responses:{...t?.requestOpenAPIResponses,200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{device_code:{type:`string`,description:`The device verification code`},user_code:{type:`string`,description:`The user code to display`},verification_uri:{type:`string`,format:`uri`,description:`The URL for user verification. Defaults to /device if not configured.`},verification_uri_complete:{type:`string`,format:`uri`,description:`The complete URL with user code as query parameter.`},expires_in:{type:`number`,description:`Lifetime in seconds of the device code`},interval:{type:`number`,description:`Minimum polling interval in seconds`}}}}}},400:{description:`Error response`,content:{"application/json":{schema:{type:`object`,properties:{error:{type:`string`,enum:o},error_description:{type:`string`}}}}}},500:{description:`Server error`,content:{"application/json":{schema:{type:`object`,properties:{error:{type:`string`,enum:[`server_error`]},error_description:{type:`string`}}}}}}}}}},async i=>{let a=i.body;await Hw(i.request,a);let o=t?await t.authorizeRequest({ctx:i,request:a}):void 0,s=o?.clientId??a.client_id;if(!o){if(!a.client_id)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:`client_id is required`});if(!e.validateClient){if(t)throw new H(`BAD_REQUEST`,{error:`invalid_client`,error_description:`Invalid client ID`})}else if(!await e.validateClient(a.client_id))throw new H(`BAD_REQUEST`,{error:`invalid_client`,error_description:`Invalid client ID`})}if(!s)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:`client_id is required`});e.onDeviceAuthRequest&&await e.onDeviceAuthRequest(s,a.scope);let c=Sn(e.expiresIn),l=new Date(Date.now()+c);for(let t=0;t<Mw;t++){let t=await n(),u=await r();try{await i.context.adapter.create({model:`deviceCode`,data:{...o?.deviceCodeFields,deviceCode:t,userCode:u,userId:a.user_id||null,expiresAt:l,status:`pending`,pollingInterval:Sn(e.interval),clientId:s,scope:a.scope}})}catch(e){if(!Pw(e))throw e;continue}let{verificationUri:d,verificationUriComplete:f}=Zw(e.verificationUri,i.context.baseURL,u);return i.setHeader(`Cache-Control`,`no-store`),i.setHeader(`Pragma`,`no-cache`),i.json({device_code:t,user_code:u,verification_uri:d,verification_uri_complete:f,expires_in:Math.floor(c/1e3),interval:Math.floor(Sn(e.interval)/1e3)})}throw new H(`INTERNAL_SERVER_ERROR`,{error:`server_error`,error_description:`Failed to generate a unique device code`})})},Ww=B({grant_type:Ut(`urn:ietf:params:oauth:grant-type:device_code`).meta({description:`The grant type for device flow`}),device_code:z().meta({description:`The device verification code`}),client_id:z().meta({description:`The client ID of the application`})}),Gw=B({error:Wt([`authorization_pending`,`slow_down`,`expired_token`,`access_denied`,`invalid_request`,`invalid_grant`]).meta({description:`Error code`}),error_description:z().meta({description:`Detailed error description`})});async function Kw(e){let t=await e.ctx.context.adapter.findOne({model:`deviceCode`,where:[{field:`deviceCode`,value:e.deviceCode}]});if(!t)throw new H(`BAD_REQUEST`,{error:`invalid_grant`,error_description:Aw.INVALID_DEVICE_CODE.message});let n=await e.authorizeRedemption(t);if(t.lastPolledAt&&t.pollingInterval&&Date.now()-new Date(t.lastPolledAt).getTime()<t.pollingInterval)throw new H(`BAD_REQUEST`,{error:`slow_down`,error_description:Aw.POLLING_TOO_FREQUENTLY.message});if(await e.ctx.context.adapter.update({model:`deviceCode`,where:[{field:`id`,value:t.id}],update:{lastPolledAt:new Date}}),t.expiresAt<new Date)throw await e.ctx.context.adapter.delete({model:`deviceCode`,where:[{field:`id`,value:t.id}]}),new H(`BAD_REQUEST`,{error:`expired_token`,error_description:Aw.EXPIRED_DEVICE_CODE.message});if(t.status===`pending`)throw new H(`BAD_REQUEST`,{error:`authorization_pending`,error_description:Aw.AUTHORIZATION_PENDING.message});if(t.status===`denied`)throw await e.ctx.context.adapter.delete({model:`deviceCode`,where:[{field:`id`,value:t.id}]}),new H(`BAD_REQUEST`,{error:`access_denied`,error_description:Aw.ACCESS_DENIED.message});if(t.status!==`approved`||!t.userId)throw new H(`INTERNAL_SERVER_ERROR`,{error:`server_error`,error_description:Aw.INVALID_DEVICE_CODE_STATUS.message});let r=await e.prepareRedemption(t,n.context),i=await e.ctx.context.internalAdapter.findUserById(t.userId);if(!i)throw new H(`INTERNAL_SERVER_ERROR`,{error:`server_error`,error_description:Aw.USER_NOT_FOUND.message});let a=await e.ctx.context.adapter.consumeOne({model:`deviceCode`,where:[{field:`id`,value:t.id},n.ownershipWhere,{field:`status`,value:`approved`}]});if(!a?.userId)throw new H(`BAD_REQUEST`,{error:`invalid_grant`,error_description:Aw.INVALID_DEVICE_CODE.message});return{claimedDeviceCode:a,authorizationContext:n.context,redemptionContext:r,user:i}}var qw=(e,t)=>hi(`/device/token`,{method:`POST`,body:Ww,error:Gw,metadata:{noStore:!0,openapi:{description:`Exchange device code for access token
|
|
434
|
+
|
|
435
|
+
Follow [rfc8628#section-3.4](https://datatracker.ietf.org/doc/html/rfc8628#section-3.4)`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{session:{$ref:`#/components/schemas/Session`},user:{$ref:`#/components/schemas/User`}}}}}},400:{description:`Error response`,content:{"application/json":{schema:{type:`object`,properties:{error:{type:`string`,enum:[`authorization_pending`,`slow_down`,`expired_token`,`access_denied`,`invalid_request`,`invalid_grant`]},error_description:{type:`string`}}}}}}}}}},async n=>{let{device_code:r,client_id:i}=n.body;if(e.validateClient&&!await e.validateClient(i))throw new H(`BAD_REQUEST`,{error:`invalid_grant`,error_description:`Invalid client ID`});let{claimedDeviceCode:a,user:o}=await Kw({ctx:n,deviceCode:r,authorizeRedemption:async e=>{if(e.clientId&&e.clientId!==i)throw new H(`BAD_REQUEST`,{error:`invalid_grant`,error_description:`Client ID mismatch`});return await t?.assertSessionRedemption({ctx:n,deviceCode:e}),{ownershipWhere:{field:`clientId`,value:i},context:void 0}},prepareRedemption:()=>void 0}),s=await n.context.internalAdapter.createSession(o.id);if(!s)throw new H(`INTERNAL_SERVER_ERROR`,{error:`server_error`,error_description:Aw.FAILED_TO_CREATE_SESSION.message});return n.context.setNewSession({session:s,user:o}),n.context.options.secondaryStorage&&await n.context.secondaryStorage?.set(s.token,JSON.stringify({user:o,session:s}),Math.floor((new Date(s.expiresAt).getTime()-Date.now())/1e3)),n.setHeader(`Cache-Control`,`no-store`),n.setHeader(`Pragma`,`no-cache`),n.json({access_token:s.token,token_type:`Bearer`,expires_in:Math.floor((new Date(s.expiresAt).getTime()-Date.now())/1e3),scope:a.scope||``})}),Jw=e=>hi(`/device`,{method:`GET`,query:B({user_code:z().meta({description:`The user code to verify`})}),error:B({error:Wt([`invalid_request`]).meta({description:`Error code`}),error_description:z().meta({description:`Detailed error description`})}),metadata:{openapi:{description:`Verify user code and get device authorization status`,responses:{200:{description:`Device authorization status`,content:{"application/json":{schema:{type:`object`,properties:{user_code:{type:`string`,description:`The user code to verify`},status:{type:`string`,enum:[`pending`,`approved`,`denied`],description:`Current status of the device authorization`},client_id:{type:`string`,description:`The client requesting authorization, returned only to the authenticated user who owns this request`},scope:{type:`string`,description:`The requested scopes, returned only to the authenticated user who owns this request`},...e?.verificationOpenAPIProperties}}}}}}}}},async t=>{let{user_code:n}=t.query,r=await Rw(t,n);if(!r)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.INVALID_USER_CODE.message});if(r.expiresAt<new Date)throw new H(`BAD_REQUEST`,{error:`expired_token`,error_description:Aw.EXPIRED_USER_CODE.message});let i=await fi(t);i?.user?.id&&!r.userId&&r.status===`pending`&&await t.context.adapter.incrementOne({model:`deviceCode`,where:[{field:`id`,value:r.id},{field:`status`,value:`pending`},{field:`userId`,operator:`eq`,value:null}],increment:{},set:{userId:i.user.id}})&&(r.userId=i.user.id);let a=i?.user.id!==void 0&&r.userId===i.user.id,o=a?e?.getVerificationContext(r):void 0,s={...a?o:void 0,user_code:n,status:r.status,...a?{client_id:r.clientId,scope:r.scope}:{}};return t.json(s)}),Yw=hi(`/device/approve`,{method:`POST`,body:B({userCode:z().meta({description:`The user code to approve`})}),error:B({error:Wt([`invalid_request`,`expired_token`,`device_code_already_processed`,`unauthorized`,`access_denied`]).meta({description:`Error code`}),error_description:z().meta({description:`Detailed error description`})}),requireHeaders:!0,metadata:{openapi:{description:`Approve device authorization`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async e=>{let t=await fi(e);if(!t)throw new H(`UNAUTHORIZED`,{error:`unauthorized`,error_description:Aw.AUTHENTICATION_REQUIRED.message});let{userCode:n}=e.body,r=await Rw(e,n);if(!r)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.INVALID_USER_CODE.message});if(r.expiresAt<new Date)throw new H(`BAD_REQUEST`,{error:`expired_token`,error_description:Aw.EXPIRED_USER_CODE.message});if(r.status!==`pending`)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.DEVICE_CODE_ALREADY_PROCESSED.message});if(!r.userId)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.DEVICE_CODE_NOT_CLAIMED.message});if(r.userId!==t.user.id)throw new H(`FORBIDDEN`,{error:`access_denied`,error_description:`You are not authorized to approve this device authorization`});return await e.context.adapter.update({model:`deviceCode`,where:[{field:`id`,value:r.id}],update:{status:`approved`,userId:t.user.id}}),e.json({success:!0})}),Xw=hi(`/device/deny`,{method:`POST`,body:B({userCode:z().meta({description:`The user code to deny`})}),error:B({error:Wt([`invalid_request`,`expired_token`,`unauthorized`,`access_denied`]).meta({description:`Error code`}),error_description:z().meta({description:`Detailed error description`})}),requireHeaders:!0,metadata:{openapi:{description:`Deny device authorization`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async e=>{let t=await fi(e);if(!t)throw new H(`UNAUTHORIZED`,{error:`unauthorized`,error_description:Aw.AUTHENTICATION_REQUIRED.message});let{userCode:n}=e.body,r=await Rw(e,n);if(!r)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.INVALID_USER_CODE.message});if(r.expiresAt<new Date)throw new H(`BAD_REQUEST`,{error:`expired_token`,error_description:Aw.EXPIRED_USER_CODE.message});if(r.status!==`pending`)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.DEVICE_CODE_ALREADY_PROCESSED.message});if(!r.userId)throw new H(`BAD_REQUEST`,{error:`invalid_request`,error_description:Aw.DEVICE_CODE_NOT_CLAIMED.message});if(r.userId!==t.user.id)throw new H(`FORBIDDEN`,{error:`access_denied`,error_description:`You are not authorized to deny this device authorization`});return await e.context.adapter.update({model:`deviceCode`,where:[{field:`id`,value:r.id}],update:{status:`denied`,userId:t.user.id}}),e.json({success:!0})}),Zw=(e,t,n)=>{let r=e||`/device`,i;try{i=new URL(r)}catch{i=new URL(r,t)}let a=new URL(i);return a.searchParams.set(`user_code`,n),{verificationUri:i.toString(),verificationUriComplete:a.toString()}},Qw=e=>Tn(e,`a-z`,`A-Z`,`0-9`),$w=e=>{let t=new Uint8Array(e);return Array.from(crypto.getRandomValues(t)).map(e=>jw[e%32]).join(``)},eT={deviceCode:{fields:{deviceCode:{type:`string`,required:!0},userCode:{type:`string`,required:!0},userId:{type:`string`,required:!1},expiresAt:{type:`date`,required:!0},status:{type:`string`,required:!0},lastPolledAt:{type:`date`,required:!1},pollingInterval:{type:`number`,required:!1},clientId:{type:`string`,required:!1},scope:{type:`string`,required:!1}},indexes:[{fields:[`deviceCode`],unique:!0},{fields:[`userCode`],unique:!0}]}};B({id:z(),deviceCode:z(),userCode:z(),userId:z().optional(),expiresAt:Jt(),status:z(),lastPolledAt:Jt().optional(),pollingInterval:Gt().optional(),clientId:z().optional(),scope:z().optional()});var tT=qt(e=>{if(typeof e!=`string`)return!1;try{return Sn(e),!0}catch{return!1}},{message:`Invalid time string format. Use formats like '30m', '5s', '1h', etc.`}),nT=B({expiresIn:tT.default(`30m`).describe(`Time in seconds until the device code expires. Use formats like '30m', '5s', '1h', etc.`),interval:tT.default(`5s`).describe(`Time in seconds between polling attempts. Use formats like '30m', '5s', '1h', etc.`),deviceCodeLength:Gt().int().positive().max(191).default(40).describe(`Length of the device code to be generated. Must be at most 191 characters. Default is 40 characters.`),userCodeLength:Gt().int().positive().max(191).default(8).describe(`Length of the user code to be generated. Must be at most 191 characters. Default is 8 characters.`),generateDeviceCode:qt(e=>typeof e==`function`,{message:`generateDeviceCode must be a function that returns a string or a promise that resolves to a string.`}).optional().describe(`Function to generate a device code. If not provided, a default random string generator will be used.`),generateUserCode:qt(e=>typeof e==`function`,{message:`generateUserCode must be a function that returns a string or a promise that resolves to a string.`}).optional().describe(`Function to generate a user code. If not provided, a default random string generator will be used.`),validateClient:qt(e=>typeof e==`function`,{message:`validateClient must be a function that returns a boolean or a promise that resolves to a boolean.`}).optional().describe(`Function to validate the client ID. If not provided, no validation will be performed.`),onDeviceAuthRequest:qt(e=>typeof e==`function`,{message:`onDeviceAuthRequest must be a function that returns void or a promise that resolves to void.`}).optional().describe(`Function to handle device authorization requests. If not provided, no additional actions will be taken.`),verificationUri:z().optional().describe(`The URI where users verify their device code. Can be an absolute URL (https://example.com/device) or relative path (/custom-path). This will be returned as verification_uri in the device code response. If not provided, defaults to /device.`),schema:qt(()=>!0).optional()}),rT=new Set([`client_id`,`user_id`,`scope`]),iT=new Set([`user_code`,`status`,`client_id`,`scope`]);function aT(e){let t=Object.keys(e?.deviceCodeSchemaFields??{}).filter(e=>e in eT.deviceCode.fields);if(t.length>0)throw new U(`Device authorization grant fields must be additional and cannot redefine deviceCode fields: ${t.join(`, `)}`);let n=Object.keys(e?.requestSchemaFields??{}).filter(e=>rT.has(e));if(n.length>0)throw new U(`Device authorization grant request fields must be additional and cannot redefine request fields: ${n.join(`, `)}`);let r=Object.keys(e?.verificationOpenAPIProperties??{}).filter(e=>iT.has(e));if(r.length>0)throw new U(`Device authorization grant verification fields must be additional and cannot redefine response fields: ${r.join(`, `)}`)}var oT=(e={})=>{let{grant:t,...n}=e,r=t,i=nT.parse(n);return aT(r),{id:`device-authorization`,version:Ow,schema:Kn({deviceCode:{...eT.deviceCode,fields:{...eT.deviceCode.fields,...r?.deviceCodeSchemaFields}}},e.schema),endpoints:{deviceCode:Uw(i,r),deviceToken:qw(i,r),deviceVerify:Jw(r),deviceApprove:Yw,deviceDeny:Xw},rateLimit:[{pathMatcher(e){return e===`/device`},window:Sn(i.expiresIn)/1e3,max:5}],$ERROR_CODES:Aw,options:{...i,grant:r}}},sT=qn({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`});function cT(e,t){return`${e}-otp-${t}`}var lT=async e=>{let t=await Yr(`SHA-256`).digest(new TextEncoder().encode(e));return Ui.encode(new Uint8Array(t),{padding:!1})};function uT(e){let t=e.lastIndexOf(`:`);return t===-1?[e,``]:[e.slice(0,t),e.slice(t+1)]}async function dT(e,t,n){return t.storeOTP===`encrypted`?await Dn({key:e.context.secretConfig,data:n}):t.storeOTP===`hashed`?await lT(n):typeof t.storeOTP==`object`&&`hash`in t.storeOTP?await t.storeOTP.hash(n):typeof t.storeOTP==`object`&&`encrypt`in t.storeOTP?await t.storeOTP.encrypt(n):n}async function fT(e,t,n,r){return t.storeOTP===`encrypted`?tr(await bn({key:e.context.secretConfig,data:n}),r):t.storeOTP===`hashed`?tr(await lT(r),n):typeof t.storeOTP==`object`&&`hash`in t.storeOTP?tr(await t.storeOTP.hash(r),n):typeof t.storeOTP==`object`&&`decrypt`in t.storeOTP?tr(await t.storeOTP.decrypt(n),r):tr(r,n)}async function pT(e,t,n){return t.storeOTP===`plain`||t.storeOTP===void 0?n:t.storeOTP===`encrypted`?await bn({key:e.context.secretConfig,data:n}):typeof t.storeOTP==`object`&&`decrypt`in t.storeOTP?await t.storeOTP.decrypt(n):null}async function mT(e,t,n){let r=await e.context.internalAdapter.findVerificationValue(n);if(!r||r.expiresAt<new Date)return null;let[i,a]=uT(r.value),o=t.allowedAttempts||3;if(a&&parseInt(a)>=o)return null;let s=await pT(e,t,i);return s?(await e.context.internalAdapter.updateVerificationByIdentifier(n,{expiresAt:ln(t.expiresIn,`sec`)}),s):null}var hT=5e3,gT=2e3,_T=250,vT=e=>`revoke-unproven-account-access:${e}`;async function yT(e,t){let n=Date.now()+gT;for(;Date.now()<n;){let n=await e.context.internalAdapter.findVerificationValue(t);if(!n)return;if(n.expiresAt<=new Date){await e.context.internalAdapter.deleteVerificationByIdentifier(t);return}await new Promise(e=>setTimeout(e,_T))}}async function bT(e,t){let n=vT(t);if(!await e.context.internalAdapter.reserveVerificationValue({identifier:n,value:t,expiresAt:new Date(Date.now()+hT)}).catch(e=>{if(e instanceof U&&e.message.includes(`requires database-backed verification storage`))return!0;throw e}))return await yT(e,n),e.context.internalAdapter.findUserById(t);try{let n=await e.context.internalAdapter.findUserById(t);if(!n||n.emailVerified)return n;let r=await e.context.internalAdapter.findAccounts(t);for(let t of r)await e.context.internalAdapter.deleteAccount(t.id);return await e.context.internalAdapter.deleteUserSessions(t),await e.context.internalAdapter.updateUser(t,{emailVerified:!0})}finally{await e.context.internalAdapter.deleteVerificationByIdentifier(n).catch(()=>{})}}var xT=[`email-verification`,`sign-in`,`forget-password`,`change-email`];async function ST(e,t,n,r){let i=cT(r,n);if(t.resendStrategy===`reuse`){let n=await mT(e,t,i);if(n)return n}let a=t.generateOTP({email:n,type:r},e)||GT(t),o=await dT(e,t,a);return await e.context.internalAdapter.createVerificationValue({value:`${o}:0`,identifier:i,expiresAt:ln(t.expiresIn,`sec`)}).catch(async()=>{await e.context.internalAdapter.deleteVerificationByIdentifier(i),await e.context.internalAdapter.createVerificationValue({value:`${o}:0`,identifier:i,expiresAt:ln(t.expiresIn,`sec`)})}),a}var CT=B({email:z({}).meta({description:`Email address to send the OTP`}),type:Wt(xT).meta({description:`Type of the OTP`})}),wT=e=>hi(`/email-otp/send-verification-otp`,{method:`POST`,use:[Sx],body:CT,metadata:{openapi:{operationId:`sendEmailVerificationOTP`,description:`Send a verification OTP to an email`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async t=>{if(!e?.sendVerificationOTP)throw t.context.logger.error(`send email verification is not implemented`),H.fromStatus(`BAD_REQUEST`,{message:`send email verification is not implemented`});let n=t.body.email.toLowerCase();if(!Zt().safeParse(n).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);if(t.body.type===`change-email`)throw t.context.logger.error(`Use the /email-otp/request-email-change endpoint to send OTP for changing email`),H.fromStatus(`BAD_REQUEST`,{message:`Invalid OTP type`});let r=cT(t.body.type,n),i=await ST(t,e,n,t.body.type),a=t.body.type===`sign-in`&&!e.disableSignUp;return!await t.context.internalAdapter.findUserByEmail(n)&&!a?(await t.context.internalAdapter.deleteVerificationByIdentifier(r),t.json({success:!0})):(await t.context.runInBackgroundOrAwait(e.sendVerificationOTP({email:n,otp:i,type:t.body.type},t)),t.json({success:!0}))}),TT=B({email:z({}).meta({description:`Email address to send the OTP`}),type:Wt(xT).meta({required:!0,description:`Type of the OTP`})}),ET=e=>hi.serverOnly({method:`POST`,body:TT,metadata:{openapi:{operationId:`createEmailVerificationOTP`,description:`Create a verification OTP for an email`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`string`}}}}}}}},async t=>{let n=t.body.email.toLowerCase(),r=e.generateOTP({email:n,type:t.body.type},t)||GT(e),i=await dT(t,e,r);return await t.context.internalAdapter.createVerificationValue({value:`${i}:0`,identifier:cT(t.body.type,n),expiresAt:ln(e.expiresIn,`sec`)}),r}),DT=B({email:z({}).meta({description:`Email address the OTP was sent to`}),type:Wt(xT).meta({required:!0,description:`Type of the OTP`})}),OT=e=>hi.serverOnly({method:`GET`,query:DT,metadata:{openapi:{operationId:`getEmailVerificationOTP`,description:`Get a verification OTP for an email`,responses:{200:{description:`OTP retrieved successfully or not found/expired`,content:{"application/json":{schema:{type:`object`,properties:{otp:{type:`string`,nullable:!0,description:`The stored OTP, or null if not found or expired`}},required:[`otp`]}}}}}}}},async t=>{let n=t.query.email.toLowerCase(),r=await t.context.internalAdapter.findVerificationValue(cT(t.query.type,n));if(!r||r.expiresAt<new Date)return t.json({otp:null});if(e.storeOTP===`hashed`||typeof e.storeOTP==`object`&&`hash`in e.storeOTP)throw H.fromStatus(`BAD_REQUEST`,{message:`OTP is hashed, cannot return the plain text OTP`});let[i,a]=uT(r.value),o=i;return e.storeOTP===`encrypted`&&(o=await bn({key:t.context.secretConfig,data:i})),typeof e.storeOTP==`object`&&`decrypt`in e.storeOTP&&(o=await e.storeOTP.decrypt(i)),t.json({otp:o})}),kT=B({email:z().meta({description:`Email address the OTP was sent to`}),type:Wt(xT).meta({required:!0,description:`Type of the OTP`}),otp:z().meta({required:!0,description:`OTP to verify`})}),AT=e=>hi(`/email-otp/check-verification-otp`,{method:`POST`,body:kT,metadata:{openapi:{operationId:`verifyEmailWithOTP`,description:`Verify an email with an OTP`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async t=>{let n=t.body.email.toLowerCase();if(!Zt().safeParse(n).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);let r=cT(t.body.type,n),i=await t.context.internalAdapter.findVerificationValue(r);if(!i)throw H.from(`BAD_REQUEST`,sT.INVALID_OTP);if(i.expiresAt<new Date)throw await t.context.internalAdapter.deleteVerificationByIdentifier(r),H.from(`BAD_REQUEST`,sT.OTP_EXPIRED);let[a,o]=uT(i.value),s=e?.allowedAttempts||3;if(o&&parseInt(o)>=s)throw await t.context.internalAdapter.deleteVerificationByIdentifier(r),H.from(`FORBIDDEN`,sT.TOO_MANY_ATTEMPTS);if(!await fT(t,e,a,t.body.otp))throw await t.context.internalAdapter.updateVerificationByIdentifier(r,{value:`${a}:${parseInt(o||`0`)+1}`}),H.from(`BAD_REQUEST`,sT.INVALID_OTP);if(!await t.context.internalAdapter.findUserByEmail(n))throw H.from(`BAD_REQUEST`,V.USER_NOT_FOUND);return t.json({success:!0})}),jT=B({email:z({}).meta({description:`Email address to verify`}),otp:z().meta({required:!0,description:`OTP to verify`})}),MT=e=>hi(`/email-otp/verify-email`,{method:`POST`,body:jT,metadata:{openapi:{description:`Verify email with OTP`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{status:{type:`boolean`,description:`Indicates if the verification was successful`,enum:[!0]},token:{type:`string`,nullable:!0,description:`Session token if autoSignInAfterVerification is enabled, otherwise null`},user:{$ref:`#/components/schemas/User`}},required:[`status`,`token`,`user`]}}}}}}}},async t=>{let n=t.body.email.toLowerCase();if(!Zt().safeParse(n).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);await qT(t,e,cT(`email-verification`,n),t.body.otp);let r=await t.context.internalAdapter.findUserByEmail(n);if(!r)throw H.from(`BAD_REQUEST`,V.USER_NOT_FOUND);t.context.options.emailVerification?.beforeEmailVerification&&await t.context.options.emailVerification.beforeEmailVerification(r.user,t.request);let i=await t.context.internalAdapter.updateUser(r.user.id,{email:n,emailVerified:!0});if(await t.context.options.emailVerification?.afterEmailVerification?.(i,t.request),t.context.options.emailVerification?.autoSignInAfterVerification){let e=await t.context.internalAdapter.createSession(i.id);return await In(t,{session:e,user:i}),t.json({status:!0,token:e.token,user:er(t.context.options,i)})}let a=await fi(t);if(a&&i.emailVerified&&a.user.id===i.id){let e=await t.getSignedCookie(t.context.authCookies.dontRememberToken.name,t.context.secret);await Mn(t,{session:a.session,user:{...a.user,emailVerified:!0}},!!e)}return t.json({status:!0,token:null,user:er(t.context.options,i)})}),NT=B({email:z({}).meta({description:`Email address to sign in`}),otp:z().meta({required:!0,description:`OTP sent to the email`}),name:z().meta({description:`User display name. Only used if the user is registering for the first time. Eg: "my-name"`}).optional(),image:z().meta({description:`User profile image URL. Only used if the user is registering for the first time.`}).optional()}).and(Rt(z(),Qt())),PT=e=>hi(`/sign-in/email-otp`,{method:`POST`,body:NT,metadata:{openapi:{operationId:`signInWithEmailOTP`,description:`Sign in with email and OTP`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{token:{type:`string`,description:`Session token for the authenticated session`},user:{$ref:`#/components/schemas/User`}},required:[`token`,`user`]}}}}}}}},async t=>{let{email:n,otp:r,name:i,image:a,...o}=t.body,s=n.toLowerCase();await qT(t,e,cT(`sign-in`,s),r);let c=await t.context.internalAdapter.findUserByEmail(s);if(!c){if(e.disableSignUp)throw H.from(`BAD_REQUEST`,sT.INVALID_OTP);let n=wn(t.context.options,o,`create`),r=await t.context.internalAdapter.createUser({...n,email:s,emailVerified:!0,name:i||``,image:a},{method:`email-otp`}),c=await t.context.internalAdapter.createSession(r.id);return await In(t,{session:c,user:r}),t.json({token:c.token,user:er(t.context.options,r)})}let l=c.user;if(!l.emailVerified){let e=await bT(t,l.id);if(!e)throw H.from(`BAD_REQUEST`,sT.INVALID_OTP);l=e}let u=await t.context.internalAdapter.createSession(l.id);return await In(t,{session:u,user:l}),t.json({token:u.token,user:er(t.context.options,l)})}),FT=B({email:z().meta({description:`Email address to send the OTP`})}),IT=e=>hi(`/email-otp/request-password-reset`,{method:`POST`,body:FT,metadata:{openapi:{operationId:`requestPasswordResetWithEmailOTP`,description:`Request password reset with email and OTP`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`,description:`Indicates if the OTP was sent successfully`}}}}}}}}}},async t=>{let n=t.body.email.toLowerCase(),r=cT(`forget-password`,n),i=await ST(t,e,n,`forget-password`);return await t.context.internalAdapter.findUserByEmail(n)?(await t.context.runInBackgroundOrAwait(e.sendVerificationOTP({email:n,otp:i,type:`forget-password`},t)),t.json({success:!0})):(await t.context.internalAdapter.deleteVerificationByIdentifier(r),t.json({success:!0}))}),LT=B({email:z().meta({description:`Email address to send the OTP`})}),RT=e=>{let t=hx(()=>{},`The "/forget-password/email-otp" endpoint is deprecated. Please use "/email-otp/request-password-reset" instead. This endpoint will be removed in the next major version.`);return hi(`/forget-password/email-otp`,{method:`POST`,body:LT,metadata:{openapi:{operationId:`forgetPasswordWithEmailOTP`,description:`Deprecated: Use /email-otp/request-password-reset instead.`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`,description:`Indicates if the OTP was sent successfully`}}}}}}}}}},async n=>{t();let r=n.body.email.toLowerCase(),i=cT(`forget-password`,r),a=await ST(n,e,r,`forget-password`);return await n.context.internalAdapter.findUserByEmail(r)?(await n.context.runInBackgroundOrAwait(e.sendVerificationOTP({email:r,otp:a,type:`forget-password`},n)),n.json({success:!0})):(await n.context.internalAdapter.deleteVerificationByIdentifier(i),n.json({success:!0}))})},zT=B({email:z().meta({description:`Email address to reset the password`}),otp:z().meta({description:`OTP sent to the email`}),password:z().meta({description:`New password`})}),BT=e=>hi(`/email-otp/reset-password`,{method:`POST`,body:zT,metadata:{openapi:{operationId:`resetPasswordWithEmailOTP`,description:`Reset password with email and OTP`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async t=>{let n=t.body.email.toLowerCase();YC(t,t.body.password),XC(t,t.body.password);let r=cT(`forget-password`,n),i=!1;await KT(t,e,r,t.body.otp)||(await qT(t,e,r,t.body.otp),i=!0);let a=await t.context.internalAdapter.findUserByEmail(n);if(!a)throw H.from(`BAD_REQUEST`,V.USER_NOT_FOUND);let o=await t.context.password.hash(t.body.password);return await ZC(t,a.user.id,o,i?void 0:()=>qT(t,e,r,t.body.otp)),t.context.options.emailAndPassword?.onPasswordReset&&await t.context.options.emailAndPassword.onPasswordReset({user:a.user},t.request),a.user.emailVerified||await t.context.internalAdapter.updateUser(a.user.id,{emailVerified:!0}),t.json({success:!0})}),VT=B({newEmail:z().meta({description:`New email address to send the OTP`}),otp:z().optional().meta({description:`OTP sent to the current email. This is required if changeEmail.verifyCurrentEmail option is set to true`})}),HT=e=>hi(`/email-otp/request-email-change`,{method:`POST`,body:VT,use:[pn],metadata:{openapi:{operationId:`requestEmailChangeWithEmailOTP`,description:`Request email change with verification OTP sent to the new email`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async t=>{if(!e.changeEmail?.enabled)throw t.context.logger.error(`Change email with OTP is disabled.`),H.fromStatus(`BAD_REQUEST`,{message:`Change email with OTP is disabled`});let n=t.context.session.user.email.toLowerCase(),r=t.body.newEmail.toLowerCase();if(!Zt().safeParse(r).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);if(r===n)throw t.context.logger.error(`Email is the same`),H.fromStatus(`BAD_REQUEST`,{message:`Email is the same`});if(e.changeEmail?.verifyCurrentEmail){if(!t.body.otp)throw H.fromStatus(`BAD_REQUEST`,{message:`OTP is required to verify current email`});await qT(t,e,cT(`email-verification`,n),t.body.otp)}else t.body.otp&&t.context.logger.warn(`OTP provided but not required for verifying current email. If you want to require OTP verification for current email, please set the changeEmail.verifyCurrentEmail option to true in the configuration`);let i=e.generateOTP({email:r,type:`change-email`},t)||GT(e),a=await dT(t,e,i);return await t.context.internalAdapter.createVerificationValue({value:`${a}:0`,identifier:cT(`change-email`,`${n}-${r}`),expiresAt:ln(e.expiresIn,`sec`)}),await t.context.internalAdapter.findUserByEmail(r)?(await t.context.internalAdapter.deleteVerificationByIdentifier(cT(`change-email`,`${n}-${r}`)),t.json({success:!0})):(await t.context.runInBackgroundOrAwait(e.sendVerificationOTP({email:r,otp:i,type:`change-email`},t)),t.json({success:!0}))}),UT=B({newEmail:z().meta({description:`New email address to verify and change to`}),otp:z().meta({description:`OTP sent to the new email`})}),WT=e=>hi(`/email-otp/change-email`,{method:`POST`,body:UT,use:[pn],metadata:{openapi:{operationId:`changeEmailWithEmailOTP`,description:`Verify new email with OTP and change the email if verification is successful`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`}}}}}}}}}},async t=>{if(!e.changeEmail?.enabled)throw t.context.logger.error(`Change email with OTP is disabled.`),H.fromStatus(`BAD_REQUEST`,{message:`Change email with OTP is disabled`});let n=t.context.session,r=n.user.email.toLowerCase(),i=t.body.newEmail.toLowerCase();if(!Zt().safeParse(i).success)throw H.from(`BAD_REQUEST`,V.INVALID_EMAIL);if(i===r)throw t.context.logger.error(`Email is the same`),H.fromStatus(`BAD_REQUEST`,{message:`Email is the same`});await qT(t,e,cT(`change-email`,`${r}-${i}`),t.body.otp);let a=await t.context.internalAdapter.findUserByEmail(r);if(!a)throw H.from(`BAD_REQUEST`,V.USER_NOT_FOUND);if(await t.context.internalAdapter.findUserByEmail(i))throw H.fromStatus(`BAD_REQUEST`,{message:`Email already in use`});t.context.options.emailVerification?.beforeEmailVerification&&await t.context.options.emailVerification.beforeEmailVerification(a.user,t.request);let o=await t.context.internalAdapter.updateUser(a.user.id,{email:i,emailVerified:!0});return t.context.options.emailVerification?.afterEmailVerification&&await t.context.options.emailVerification.afterEmailVerification(o,t.request),await In(t,{session:n.session,user:{...n.user,email:i,emailVerified:!0}}),t.json({success:!0})}),GT=e=>Tn(e.otpLength??6,`0-9`);async function KT(e,t,n,r){let i=await e.context.internalAdapter.findVerificationValue(n);if(!i||i.expiresAt<new Date)return!1;let[a,o]=uT(i.value);return parseInt(o||`0`)>=(t?.allowedAttempts||3)?!1:fT(e,t,a,r)}async function qT(e,t,n,r){let i=await e.context.internalAdapter.findVerificationValue(n);if(i&&i.expiresAt<new Date)throw await e.context.internalAdapter.deleteVerificationByIdentifier(n),H.from(`BAD_REQUEST`,sT.OTP_EXPIRED);let a=await e.context.internalAdapter.consumeVerificationValue(n);if(!a)throw H.from(`BAD_REQUEST`,sT.INVALID_OTP);let[o,s]=uT(a.value),c=t?.allowedAttempts||3,l=parseInt(s||`0`);if(l>=c)throw H.from(`FORBIDDEN`,sT.TOO_MANY_ATTEMPTS);if(!await fT(e,t,o,r))throw await e.context.internalAdapter.createVerificationValue({value:`${o}:${l+1}`,identifier:n,expiresAt:a.expiresAt}),H.from(`BAD_REQUEST`,sT.INVALID_OTP)}var JT=e=>Tn(e.otpLength??6,`0-9`),YT=e=>{let t={expiresIn:300,generateOTP:()=>JT(e),storeOTP:`plain`,...e},n=wT(t);return{id:`email-otp`,version:Ow,init(e){if(t.overrideDefaultEmailVerification)return{options:{emailVerification:{async sendVerificationEmail(t,r){await e.runInBackgroundOrAwait(n({context:e,request:r,body:{email:t.user.email,type:`email-verification`},ctx:e}))}}}}},endpoints:{sendVerificationOTP:n,createVerificationOTP:ET(t),getVerificationOTP:OT(t),checkVerificationOTP:AT(t),verifyEmailOTP:MT(t),signInEmailOTP:PT(t),requestPasswordResetEmailOTP:IT(t),forgetPasswordEmailOTP:RT(t),resetPasswordEmailOTP:BT(t),requestEmailChangeEmailOTP:HT(t),changeEmailEmailOTP:WT(t)},hooks:{after:[{matcher(e){return!!(e.path?.startsWith(`/sign-up`)&&t.sendVerificationOnSignUp&&!t.overrideDefaultEmailVerification)},handler:ur(async n=>{let r=(await kw(n))?.user.email;if(r){let i=t.generateOTP({email:r,type:`email-verification`},n)||JT(t),a=await dT(n,t,i);await n.context.internalAdapter.createVerificationValue({value:`${a}:0`,identifier:cT(`email-verification`,r),expiresAt:ln(t.expiresIn,`sec`)}),await n.context.runInBackgroundOrAwait(e.sendVerificationOTP({email:r,otp:i,type:`email-verification`},n))}})}]},rateLimit:[{pathMatcher(e){return e===`/email-otp/send-verification-otp`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/check-verification-otp`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/verify-email`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/sign-in/email-otp`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/request-password-reset`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/reset-password`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/forget-password/email-otp`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/request-email-change`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3},{pathMatcher(e){return e===`/email-otp/change-email`},window:t.rateLimit?.window||60,max:t.rateLimit?.max||3}],options:e,$ERROR_CODES:sT}};async function XT(e,t){let n=pi();try{let r=e.split(`.`);if(r.length!==3)return null;let i=new TextDecoder().decode(wi.decode(r[0])),a=JSON.parse(i).kid;if(!a)return n.context.logger.debug(`JWT missing kid in header`),null;let o=await mr(n.context.adapter,t).getAllKeys(n);if(!o||o.length===0)return n.context.logger.debug(`No JWKS keys available`),null;let s=o.find(e=>e.id===a);if(!s)return n.context.logger.debug(`No JWKS key found for kid: ${a}`),null;let c=await on(JSON.parse(s.publicKey),s.alg??t?.jwks?.keyPairConfig?.alg??`EdDSA`),l=typeof n.context.options.baseURL==`string`?n.context.options.baseURL:void 0,{payload:u}=await Zr(e,c,{issuer:t?.jwt?.issuer??l,audience:t?.jwt?.audience??l});return!u.sub||!u.aud?null:u}catch(e){return n.context.logger.debug(`JWT verification failed`,e),null}}function ZT(e){let t=e.context.options.baseURL;return typeof t==`string`?t||`better-auth:session-cache`:e.context.baseURL||`better-auth:session-cache`}async function QT(e,t,n){let r=zn(t),i=r.kid;if(!i)return e.context.logger.debug(`Cookie-cache JWT missing kid in header`),null;let a=await mr(e.context.adapter,n).getAllKeys(e);if(!a?.length)return e.context.logger.debug(`No JWKS keys available for cookie-cache JWT`),null;let o=a.find(e=>e.id===i);if(!o)return e.context.logger.debug(`No JWKS key found for cookie-cache JWT kid: ${i}`),null;let s=o.alg??n?.jwks?.keyPairConfig?.alg??r.alg;return s?{alg:s,publicKey:await on(JSON.parse(o.publicKey),s)}:(e.context.logger.debug(`No JWT algorithm available for cookie-cache JWT kid: ${i}`),null)}async function $T(e,t,n,r){let i=await dr(e,r);if(!i)throw new U("`jwt({ sessionCookieCache: true })` requires locally managed JWT plugin keys and does not support `jwt.sign`.");return await new Br({...t,sid:t.session.token}).setProtectedHeader({alg:i.alg,kid:i.kid,typ:Rx}).setIssuedAt().setExpirationTime(Math.floor(Date.now()/1e3)+n).setIssuer(ZT(e)).setAudience(zx).setSubject(t.user.id).sign(i.privateKey)}async function eE(e,t,n){try{if(zn(t).typ!==`better-auth.session-cache+jwt`)return null;let r=await QT(e,t,n);if(!r)return null;let{payload:i}=await Zr(t,r.publicKey,{...Bx({issuer:ZT(e)}),algorithms:[r.alg]}),a=Vx(i);return a?{payload:a,expiresAt:a.exp?a.exp*1e3:Date.now()}:null}catch(t){return e.context.logger.debug(`Cookie-cache JWT verification failed`,t),null}}function tE(e){return{sign:(t,n,r)=>$T(t,n,r,e),verify:(t,n)=>eE(t,n,e)}}var nE={jwks:{fields:{publicKey:{type:`string`,required:!0},privateKey:{type:`string`,required:!0},createdAt:{type:`date`,required:!0},expiresAt:{type:`date`,required:!1},alg:{type:`string`,required:!1},crv:{type:`string`,required:!1}}}},rE=B({payload:Rt(z(),Qt()),overrideOptions:Rt(z(),Qt()).optional()}),iE=B({token:z(),issuer:z().optional()}),aE=e=>{if(e?.jwt?.sign&&!e.jwks?.remoteUrl)throw new U(`options.jwks.remoteUrl must be set when using options.jwt.sign`);if(e?.jwks?.remoteUrl&&!e.jwks?.keyPairConfig?.alg)throw new U(`options.jwks.keyPairConfig.alg must be specified when options.jwks.remoteUrl is used for OpenID metadata`);let t=e?.jwks?.jwksPath??`/jwks`;if(typeof t!=`string`||t.length===0||!t.startsWith(`/`)||t.includes(`..`))throw new U(`options.jwks.jwksPath must be a non-empty string starting with '/' and not contain '..'`);return{id:`jwt`,version:Ow,options:e,init(t){if(!e?.sessionCookieCache)return;if(t.options.session?.cookieCache?.strategy!==`jwt`)throw new U('`jwt({ sessionCookieCache: true })` requires `session.cookieCache.strategy = "jwt"`.');if(e.jwt?.sign)throw new U("`jwt({ sessionCookieCache: true })` requires locally managed JWT plugin keys and does not support `jwt.sign`.");let n=e.jwks?.gracePeriod,r=t.options.session.cookieCache.maxAge||300;return n!==void 0&&r>n&&t.logger.warn(`[better-auth] \`session.cookieCache.maxAge\` (${r}s) exceeds the JWT plugin JWKS grace period (${n}s). Rotated keys may stop verifying cookie-cache JWTs before the cookie expires.`),{context:{sessionConfig:{...t.sessionConfig,cookieCacheSigner:tE(e)}}}},endpoints:{getJwks:hi(t,{method:`GET`,metadata:{openapi:{operationId:`getJSONWebKeySet`,description:`Get the JSON Web Key Set`,responses:{200:{description:`JSON Web Key Set retrieved successfully`,content:{"application/json":{schema:{type:`object`,properties:{keys:{type:`array`,description:`Array of public JSON Web Keys`,items:{type:`object`,properties:{kid:{type:`string`,description:`Key ID uniquely identifying the key, corresponds to the 'id' from the stored Jwk`},kty:{type:`string`,description:`Key type (e.g., 'RSA', 'EC', 'OKP')`},alg:{type:`string`,description:`Algorithm intended for use with the key (e.g., 'EdDSA', 'RS256')`},use:{type:`string`,description:`Intended use of the public key (e.g., 'sig' for signature)`,enum:[`sig`],nullable:!0},n:{type:`string`,description:`Modulus for RSA keys (base64url-encoded)`,nullable:!0},e:{type:`string`,description:`Exponent for RSA keys (base64url-encoded)`,nullable:!0},crv:{type:`string`,description:`Curve name for elliptic curve keys (e.g., 'Ed25519', 'P-256')`,nullable:!0},x:{type:`string`,description:`X coordinate for elliptic curve keys (base64url-encoded)`,nullable:!0},y:{type:`string`,description:`Y coordinate for elliptic curve keys (base64url-encoded)`,nullable:!0}},required:[`kid`,`kty`,`alg`]}}},required:[`keys`]}}}}}}}},async t=>{if(e?.jwks?.remoteUrl)throw new H(`NOT_FOUND`);let n=mr(t.context.adapter,e),r=await n.getAllKeys(t);if((!r||r?.length===0)&&(await ai(t,e),r=await n.getAllKeys(t)),!r?.length)throw new U(`No key sets found. Make sure you have a key in your database.`);let i=Date.now(),a=(e?.jwks?.gracePeriod??2592e3)*1e3,o=r.filter(e=>!e.expiresAt||e.expiresAt.getTime()+a>i),s=e?.jwks?.keyPairConfig,c=s&&`crv`in s?s.crv:void 0;return t.json({keys:o.map(t=>({alg:t.alg??e?.jwks?.keyPairConfig?.alg??`EdDSA`,crv:t.crv??c,...JSON.parse(t.publicKey),kid:t.id}))})}),getToken:hi(`/token`,{method:`GET`,requireHeaders:!0,use:[Pn],metadata:{openapi:{operationId:`getJSONWebToken`,description:`Get a JWT token`,responses:{200:{description:`Success`,content:{"application/json":{schema:{type:`object`,properties:{token:{type:`string`}}}}}}}}}},async t=>{let n=await $r(t,e);return t.json({token:n})}),signJWT:hi.serverOnly({method:`POST`,metadata:{$Infer:{body:{}}},body:rE},async t=>{let n=await Nr(t,{options:{...e,...t.body.overrideOptions},payload:t.body.payload});return t.json({token:n})}),verifyJWT:hi.serverOnly({method:`POST`,metadata:{$Infer:{body:{},response:{}}},body:iE},async t=>{let n=t.body.issuer?{...e,jwt:{...e?.jwt,issuer:t.body.issuer}}:e,r=await XT(t.body.token,n);return t.json({payload:r})})},hooks:{after:[{matcher(e){return e.path===`/get-session`},handler:ur(async t=>{if(e?.disableSettingJwtHeader)return;let n=t.context.session||t.context.newSession;if(n&&n.session){let n=await $r(t,e),r=t.context.responseHeaders?.get(`access-control-expose-headers`)||``,i=new Set(r.split(`,`).map(e=>e.trim()).filter(Boolean));i.add(`set-auth-jwt`),t.setHeader(`set-auth-jwt`,n),t.setHeader(`Access-Control-Expose-Headers`,Array.from(i).join(`, `))}})}]},schema:Kn(nE,e?.schema)}};function oE(e){let{indexesByTable:t,tables:n}=zi(e),r=new Map,i={};for(let e in n){let t=n[e],a=t.fields,o={};Object.entries(a).forEach(([e,t])=>{let i=t.references,a=i?n[i.model]:void 0,s=i&&a?{...t,references:{...i,model:a.modelName}}:t;o[t.fieldName||e]=s,i&&r.set(s,{modelKey:i.model,fieldKey:i.field})}),i[t.modelName]?(i[t.modelName].fields={...i[t.modelName].fields,...o},t.disableMigrations&&(i[t.modelName].disableMigrations=!0)):i[t.modelName]={fields:o,order:t.order||1/0,disableMigrations:t.disableMigrations}}for(let[e,n]of t)i[e]&&(i[e].indexes=n);return{schema:i,tables:n,referenceKeys:r}}var sE=`urn:ietf:params:oauth:grant-type:device_code`,cE=`/device/code`,lE=zt([Xr,en(Xr).min(1),Ut(``)]),uE={client_secret:z().meta({description:`OAuth client secret`}).optional(),client_assertion:z().meta({description:`OAuth client assertion`}).optional(),client_assertion_type:z().meta({description:`OAuth client assertion type`}).optional(),resource:lE.meta({description:`RFC 8707 resource indicator(s) to bind to this authorization request`}).optional()};function dE(e,t,n){throw new H(e,{error:t,error_description:n})}function fE(e){let t=e?.trim();return t?t.split(/\s+/):[]}async function pE(e){let{ctx:t,provider:n}=e,r=t.body,i=r?.device_code;i||dE(`BAD_REQUEST`,`invalid_request`,`device_code is required`);let{authorizationContext:{client:a,confirmation:o,scopes:s},redemptionContext:c,user:l}=await Kw({ctx:t,deviceCode:i,authorizeRedemption:async e=>{e.oauthClientId||dE(`BAD_REQUEST`,`invalid_grant`,`invalid device code`),r?.client_id&&e.oauthClientId!==r.client_id&&dE(`BAD_REQUEST`,`invalid_grant`,`Client ID mismatch`);let t=fE(e.scope),i=await n.authenticateClient({requireCredentials:!1});return e.oauthClientId!==i.client.clientId&&dE(`BAD_REQUEST`,`invalid_grant`,`Client ID mismatch`),cn(i.client,t),{ownershipWhere:{field:`oauthClientId`,value:i.client.clientId},context:{...i,scopes:t}}},prepareRedemption:async(n,i)=>{let a=Mr(r?.resource),o=n.resources??void 0;if(a){let e=new Set(o);(!o||a.some(t=>!e.has(t)))&&dE(`BAD_REQUEST`,`invalid_target`,`Requested resource was not authorized by the user`)}let s=a??o;return await Hr(t,e.opts,{resource:s,clientId:i.client.clientId,requestedScopes:i.scopes}),s}});return n.issueTokens({client:a,scopes:s,user:l,resources:c,confirmation:o})}function mE(){return{requestSchemaFields:uE,requestErrorCodes:[`invalid_target`],requestOpenAPIResponses:{401:{description:`Invalid Basic client authentication`,headers:{"WWW-Authenticate":{description:`Basic client authentication challenge`,schema:{type:`string`,example:`Basic`}}},content:{"application/json":{schema:{type:`object`,properties:{error:{type:`string`,enum:[`invalid_client`]},error_description:{type:`string`}},required:[`error`]}}}}},onRequestValidationError:e=>{e.length>0&&e.every(e=>e.path?.[0]===`resource`)&&dE(`BAD_REQUEST`,`invalid_target`,`Invalid resource indicator`)},deviceCodeSchemaFields:{resources:{type:`string[]`,required:!1},oauthClientId:{type:`string`,required:!1}},grants:{[sE]:pE},metadata:e=>({device_authorization_endpoint:`${e.ctx.context.baseURL}${cE}`}),authorizeRequest:async({ctx:e,request:t})=>{let{detected:n}=await mn(e.request,e.body??{}),r=e.request?await Er(e.request):void 0;if(r){let e=lE.safeParse(r.length===1?r[0]:r);e.success||dE(`BAD_REQUEST`,`invalid_target`,`Invalid resource indicator`),t.resource=e.data}let i=gn(e.context);if(!i)return;let a=fE(t.scope);t.scope!==void 0&&(t.scope=a.join(` `));let o=t.resource===``?void 0:t.resource,s=or(e,i.options,sE);!t.client_id&&!n&&dE(`BAD_REQUEST`,`invalid_request`,`client_id is required`);let c=t.client_id?await Gn(e,i.options,t.client_id):void 0;if(t.client_id&&!c&&!n)return;let l=await s.authenticateClient({scopes:a,requireCredentials:!1});return t.client_id&&l.clientId!==t.client_id&&dE(`BAD_REQUEST`,`invalid_client`,`Client ID mismatch`),await Hr(e,i.options,{resource:o,clientId:l.clientId,requestedScopes:a}),{clientId:l.clientId,deviceCodeFields:{oauthClientId:l.clientId,resources:Mr(o)??null}}},assertSessionRedemption:({deviceCode:e})=>{if(typeof e.oauthClientId==`string`)throw new H(`BAD_REQUEST`,{error:`invalid_grant`,error_description:`This device code must be exchanged at the OAuth token endpoint (/oauth2/token).`})},getVerificationContext:e=>{if(typeof e.oauthClientId!=`string`)return;let t=e.resources;if(Array.isArray(t)&&t.every(e=>typeof e==`string`))return{resource:Fn(t)}},verificationOpenAPIProperties:{resource:{oneOf:[{type:`string`},{type:`array`,items:{type:`string`}}],description:`The requested resource indicators, returned only to the authenticated user who owns this request`}}}}function hE(e={}){let t=mE();return{...oT({...e,grant:t}),init(e){if((e.options.plugins?.filter(e=>e.id===`device-authorization`).length??0)>1)throw new U(`oauthDeviceAuthorization() cannot be combined with another Device Authorization plugin.`);if(!e.getPlugin(`oauth-provider`))throw new U(`oauthDeviceAuthorization() requires oauthProvider() or mcp().`);di(e,t)}}}var W=Symbol.for(`drizzle:entityKind`);function G(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,W))throw Error(`Class "${t.name??`<unknown>`}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(W in n&&n[W]===t[W])return!0;n=Object.getPrototypeOf(n)}return!1}var gE=class{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[W]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},_E=class{static[W]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}},vE=Symbol.for(`drizzle:Name`),yE=class{static[W]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new bE(e,this)}},bE=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[W]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[vE],...r,n[0].table[vE],...i];return e??`${a.join(`_`)}_fk`}};function xE(e,...t){return e(...t)}function SE(e){return new TE(e)}function CE(e,t){return`${e[vE]}_${t.join(`_`)}_unique`}var wE=class{constructor(e,t){this.name=t,this.columns=e}static[W]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new EE(e,this.columns,this.nullsNotDistinctConfig,this.name)}},TE=class{static[W]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new wE(e,this.name)}},EE=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??CE(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[W]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function DE(e,t,n){for(let r=t;r<e.length;r++){let i=e[r];if(i===`\\`)r++;else{if(i===`"`)return[e.slice(t,r).replace(/\\/g,``),r+1];if(!n&&(i===`,`||i===`}`))return[e.slice(t,r).replace(/\\/g,``),r]}}return[e.slice(t).replace(/\\/g,``),e.length]}function OE(e,t=0){let n=[],r=t,i=!1;for(;r<e.length;){let a=e[r];if(a===`,`){(i||r===t)&&n.push(``),i=!0,r++;continue}if(i=!1,a===`\\`){r+=2;continue}if(a===`"`){let[t,i]=DE(e,r+1,!0);n.push(t),r=i;continue}if(a===`}`)return[n,r+1];if(a===`{`){let[t,i]=OE(e,r+1);n.push(t),r=i;continue}let[o,s]=DE(e,r,!1);n.push(o),r=s}return[n,r]}function kE(e){let[t]=OE(e,1);return t}function AE(e){return`{${e.map(e=>Array.isArray(e)?AE(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var jE=class extends _E{foreignKeyConfigs=[];static[W]=`PgColumnBuilder`;array(e){return new FE(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>xE((n,r)=>{let i=new yE(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new NE(e,this.config)}},ME=class extends gE{constructor(e,t){t.uniqueName||=CE(e,[t.name]),super(e,t),this.table=e}static[W]=`PgColumn`},NE=class extends ME{static[W]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},PE=class{static[W]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},FE=class extends jE{static[W]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new IE(e,this.config,t)}},IE=class e extends ME{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r,this.size=t.size}size;static[W]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=kE(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:G(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:AE(r)}},LE=Symbol.for(`drizzle:isPgEnum`);function RE(e){return!!e&&typeof e==`function`&&LE in e&&e[LE]===!0}var zE=class{static[W]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},BE=class extends zE{static[W]=`WithSubquery`},VE={startActiveSpan(e,t){return t()}},HE=Symbol.for(`drizzle:ViewBaseConfig`),UE=Symbol.for(`drizzle:Schema`),WE=Symbol.for(`drizzle:Columns`),GE=Symbol.for(`drizzle:ExtraConfigColumns`),KE=Symbol.for(`drizzle:OriginalName`),qE=Symbol.for(`drizzle:BaseName`),JE=Symbol.for(`drizzle:IsAlias`),YE=Symbol.for(`drizzle:ExtraConfigBuilder`),XE=Symbol.for(`drizzle:IsDrizzleTable`),K=class{static[W]=`Table`;static Symbol={Name:vE,Schema:UE,OriginalName:KE,Columns:WE,ExtraConfigColumns:GE,BaseName:qE,IsAlias:JE,ExtraConfigBuilder:YE};[vE];[KE];[UE];[WE];[GE];[qE];[JE]=!1;[XE]=!0;[YE]=void 0;constructor(e,t,n){this[vE]=this[KE]=e,this[UE]=t,this[qE]=n}};function ZE(e){return e[vE]}function QE(e){return`${e[UE]??`public`}.${e[vE]}`}function $E(e){return e!=null&&typeof e.getSQL==`function`}function eD(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var tD=class{static[W]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new nD([this])}},nD=class e{constructor(e){this.queryChunks=e;for(let t of e)if(G(t,K)){let e=t[K.Symbol.Schema];this.usedTables.push(e===void 0?t[K.Symbol.Name]:e+`.`+t[K.Symbol.Name])}}static[W]=`SQL`;decoder=aD;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return VE.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return eD(t.map(t=>{if(G(t,tD))return{sql:t.value.join(``),params:[]};if(G(t,rD))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new tD(`(`)];for(let[n,r]of t.entries())e.push(r),n<t.length-1&&e.push(new tD(`, `));return e.push(new tD(`)`)),this.buildQueryFromSourceParams(e,r)}if(G(t,e))return this.buildQueryFromSourceParams(t.queryChunks,{...r,inlineParams:c||t.shouldInlineParams});if(G(t,K)){let e=t[K.Symbol.Schema],n=t[K.Symbol.Name];return{sql:e===void 0||t[JE]?a(n):a(e)+`.`+a(n),params:[]}}if(G(t,gE)){let e=i.getColumnCasing(t);if(n.invokeSource===`indexes`)return{sql:a(e),params:[]};let r=t.table[K.Symbol.Schema];return{sql:t.table[JE]||r===void 0?a(t.table[K.Symbol.Name])+`.`+a(e):a(r)+`.`+a(t.table[K.Symbol.Name])+`.`+a(e),params:[]}}if(G(t,dD)){let e=t[HE].schema,n=t[HE].name;return{sql:e===void 0||t[HE].isAlias?a(n):a(e)+`.`+a(n),params:[]}}if(G(t,sD)){if(G(t.value,cD))return{sql:o(l.value++,t),params:[t],typings:[`none`]};let n=t.value===null?null:t.encoder.mapToDriverValue(t.value);if(G(n,e))return this.buildQueryFromSourceParams([n],r);if(c)return{sql:this.mapInlineParam(n,r),params:[]};let i=[`none`];return s&&(i=[s(t.encoder)]),{sql:o(l.value++,n),params:[n],typings:i}}return G(t,cD)?{sql:o(l.value++,t),params:[t],typings:[`none`]}:G(t,e.Aliased)&&t.fieldAlias!==void 0?{sql:a(t.fieldAlias),params:[]}:G(t,zE)?t._.isWith?{sql:a(t._.alias),params:[]}:this.buildQueryFromSourceParams([new tD(`(`),t._.sql,new tD(`) `),new rD(t._.alias)],r):RE(t)?t.schema?{sql:a(t.schema)+`.`+a(t.enumName),params:[]}:{sql:a(t.enumName),params:[]}:$E(t)?t.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([t.getSQL()],r):this.buildQueryFromSourceParams([new tD(`(`),t.getSQL(),new tD(`)`)],r):c?{sql:this.mapInlineParam(t,r),params:[]}:{sql:o(l.value++,t),params:[t],typings:[`none`]}}))}mapInlineParam(e,{escapeString:t}){if(e===null)return`null`;if(typeof e==`number`||typeof e==`boolean`)return e.toString();if(typeof e==`string`)return t(e);if(typeof e==`object`){let n=e.toString();return t(n===`[object Object]`?JSON.stringify(e):n)}throw Error(`Unexpected param value: `+e)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(e){return this.decoder=typeof e==`function`?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}},rD=class{constructor(e){this.value=e}static[W]=`Name`;brand;getSQL(){return new nD([this])}};function iD(e){return typeof e==`object`&&!!e&&`mapToDriverValue`in e&&typeof e.mapToDriverValue==`function`}var aD={mapFromDriverValue:e=>e},oD={mapToDriverValue:e=>e};({...aD,...oD});var sD=class{constructor(e,t=oD){this.value=e,this.encoder=t}static[W]=`Param`;brand;getSQL(){return new nD([this])}};function q(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new tD(e[0]));for(let[r,i]of t.entries())n.push(i,new tD(e[r+1]));return new nD(n)}(e=>{function t(){return new nD([])}e.empty=t;function n(e){return new nD(e)}e.fromList=n;function r(e){return new nD([new tD(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new nD(n)}e.join=i;function a(e){return new rD(e)}e.identifier=a;function o(e){return new cD(e)}e.placeholder=o;function s(e,t){return new sD(e,t)}e.param=s})(q||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[W]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(nD||={});var cD=class{constructor(e){this.name=e}static[W]=`Placeholder`;getSQL(){return new nD([this])}};function lD(e,t){return e.map(e=>{if(G(e,cD)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(G(e,sD)&&G(e.value,cD)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}var uD=Symbol.for(`drizzle:IsDrizzleView`),dD=class{static[W]=`View`;[HE];[uD]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[HE]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new nD([this])}};gE.prototype.getSQL=function(){return new nD([this])},K.prototype.getSQL=function(){return new nD([this])},zE.prototype.getSQL=function(){return new nD([this])};var fD=class{constructor(e){this.table=e}static[W]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},pD=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[W]=`TableAliasProxyHandler`;get(e,t){if(t===K.Symbol.IsAlias)return!0;if(t===K.Symbol.Name||this.replaceOriginalName&&t===K.Symbol.OriginalName)return this.alias;if(t===HE)return{...e[HE],name:this.alias,isAlias:!0};if(t===K.Symbol.Columns){let t=e[K.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new fD(new Proxy(e,this)))}),n}let n=e[t];return G(n,gE)?new Proxy(n,new fD(new Proxy(e,this))):n}};function mD(e,t){return new Proxy(e,new pD(t,!1))}function hD(e,t){return new Proxy(e,new fD(new Proxy(e.table,new pD(t,!1))))}function gD(e,t){return new nD.Aliased(_D(e.sql,t),e.fieldAlias)}function _D(e,t){return q.join(e.queryChunks.map(e=>G(e,gE)?hD(e,t):G(e,nD)?_D(e,t):G(e,nD.Aliased)?gD(e,t):e))}var vD=class extends Error{static[W]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},yD=class e extends Error{constructor(t,n,r){super(`Failed query: ${t}
|
|
436
|
+
params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},bD=class extends vD{static[W]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},xD=class{static[W]=`ConsoleLogWriter`;write(e){console.log(e)}},SD=class{static[W]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new xD}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},CD=class{static[W]=`NoopLogger`;logQuery(){}},wD=class{static[W]=`QueryPromise`;[Symbol.toStringTag]=`QueryPromise`;catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}};function TD(e,t,n){let r={},i=e.reduce((e,{path:i,field:a},o)=>{let s;s=G(a,gE)?a:G(a,nD)?a.decoder:G(a,zE)?a._.sql.decoder:a.sql.decoder;let c=e;for(let[e,l]of i.entries())if(e<i.length-1)l in c||(c[l]={}),c=c[l];else{let e=t[o],u=c[l]=e===null?null:s.mapFromDriverValue(e);if(n&&G(a,gE)&&i.length===2){let e=i[0];e in r?typeof r[e]==`string`&&r[e]!==ZE(a.table)&&(r[e]=!1):r[e]=u===null&&ZE(a.table)}}return e},{});if(n&&Object.keys(r).length>0)for(let[e,t]of Object.entries(r))typeof t==`string`&&!n[t]&&(i[e]=null);return i}function ED(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return G(r,gE)||G(r,nD)||G(r,nD.Aliased)||G(r,zE)?e.push({path:i,field:r}):G(r,K)?e.push(...ED(r[K.Symbol.Columns],i)):e.push(...ED(r,i)),e},[])}function DD(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function OD(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>G(n,nD)||G(n,gE)?[t,n]:[t,new sD(n,e[K.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function kD(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype))t!==`constructor`&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}function AD(e){return e[K.Symbol.Columns]}function jD(e){return G(e,zE)?e._.alias:G(e,dD)?e[HE].name:G(e,nD)?void 0:e[K.Symbol.IsAlias]?e[K.Symbol.Name]:e[K.Symbol.BaseName]}function MD(e,t){return{name:typeof e==`string`&&e.length>0?e:``,config:typeof e==`object`?e:t}}function ND(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return t===`boolean`||t===`object`&&typeof e.logger.logQuery==`function`||t===`undefined`}if(`schema`in e){let t=typeof e.schema;return t===`object`||t===`undefined`}if(`casing`in e){let t=typeof e.casing;return t===`string`||t===`undefined`}if(`mode`in e)return e.mode==="default"&&e.mode===`planetscale`&&e.mode===void 0;if(`connection`in e){let t=typeof e.connection;return t===`string`||t===`object`||t===`undefined`}if(`client`in e){let t=typeof e.client;return t===`object`||t===`function`||t===`undefined`}return Object.keys(e).length===0}typeof TextDecoder>`u`||new TextDecoder;var PD=class extends jE{static[W]=`PgIntColumnBaseBuilder`;generatedAlwaysAsIdentity(e){if(e){let{name:t,...n}=e;this.config.generatedIdentity={type:`always`,sequenceName:t,sequenceOptions:n}}else this.config.generatedIdentity={type:`always`};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(e){if(e){let{name:t,...n}=e;this.config.generatedIdentity={type:`byDefault`,sequenceName:t,sequenceOptions:n}}else this.config.generatedIdentity={type:`byDefault`};return this.config.hasDefault=!0,this.config.notNull=!0,this}},FD=class extends PD{static[W]=`PgBigInt53Builder`;constructor(e){super(e,`number`,`PgBigInt53`)}build(e){return new ID(e,this.config)}},ID=class extends ME{static[W]=`PgBigInt53`;getSQLType(){return`bigint`}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}},LD=class extends PD{static[W]=`PgBigInt64Builder`;constructor(e){super(e,`bigint`,`PgBigInt64`)}build(e){return new RD(e,this.config)}},RD=class extends ME{static[W]=`PgBigInt64`;getSQLType(){return`bigint`}mapFromDriverValue(e){return BigInt(e)}};function zD(e,t){let{name:n,config:r}=MD(e,t);return r.mode===`number`?new FD(n):new LD(n)}var BD=class extends jE{static[W]=`PgBigSerial53Builder`;constructor(e){super(e,`number`,`PgBigSerial53`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new VD(e,this.config)}},VD=class extends ME{static[W]=`PgBigSerial53`;getSQLType(){return`bigserial`}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}},HD=class extends jE{static[W]=`PgBigSerial64Builder`;constructor(e){super(e,`bigint`,`PgBigSerial64`),this.config.hasDefault=!0}build(e){return new UD(e,this.config)}},UD=class extends ME{static[W]=`PgBigSerial64`;getSQLType(){return`bigserial`}mapFromDriverValue(e){return BigInt(e)}};function WD(e,t){let{name:n,config:r}=MD(e,t);return r.mode===`number`?new BD(n):new HD(n)}var GD=class extends jE{static[W]=`PgBooleanBuilder`;constructor(e){super(e,`boolean`,`PgBoolean`)}build(e){return new KD(e,this.config)}},KD=class extends ME{static[W]=`PgBoolean`;getSQLType(){return`boolean`}};function qD(e){return new GD(e??``)}var JD=class extends jE{static[W]=`PgCharBuilder`;constructor(e,t){super(e,`string`,`PgChar`),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new YD(e,this.config)}},YD=class extends ME{static[W]=`PgChar`;length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?`char`:`char(${this.length})`}};function XD(e,t={}){let{name:n,config:r}=MD(e,t);return new JD(n,r)}var ZD=class extends jE{static[W]=`PgCidrBuilder`;constructor(e){super(e,`string`,`PgCidr`)}build(e){return new QD(e,this.config)}},QD=class extends ME{static[W]=`PgCidr`;getSQLType(){return`cidr`}};function $D(e){return new ZD(e??``)}var eO=class extends jE{static[W]=`PgCustomColumnBuilder`;constructor(e,t,n){super(e,`custom`,`PgCustomColumn`),this.config.fieldConfig=t,this.config.customTypeParams=n}build(e){return new tO(e,this.config)}},tO=class extends ME{static[W]=`PgCustomColumn`;sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom==`function`?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo==`function`?this.mapTo(e):e}};function nO(e){return(t,n)=>{let{name:r,config:i}=MD(t,n);return new eO(r,i,e)}}var rO=class extends jE{static[W]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default(q`now()`)}},iO=class extends rO{static[W]=`PgDateBuilder`;constructor(e){super(e,`date`,`PgDate`)}build(e){return new aO(e,this.config)}},aO=class extends ME{static[W]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return typeof e==`string`?new Date(e):e}mapToDriverValue(e){return e.toISOString()}},oO=class extends rO{static[W]=`PgDateStringBuilder`;constructor(e){super(e,`string`,`PgDateString`)}build(e){return new sO(e,this.config)}},sO=class extends ME{static[W]=`PgDateString`;getSQLType(){return`date`}mapFromDriverValue(e){return typeof e==`string`?e:e.toISOString().slice(0,-14)}};function cO(e,t){let{name:n,config:r}=MD(e,t);return r?.mode===`date`?new iO(n):new oO(n)}var lO=class extends jE{static[W]=`PgDoublePrecisionBuilder`;constructor(e){super(e,`number`,`PgDoublePrecision`)}build(e){return new uO(e,this.config)}},uO=class extends ME{static[W]=`PgDoublePrecision`;getSQLType(){return`double precision`}mapFromDriverValue(e){return typeof e==`string`?Number.parseFloat(e):e}};function dO(e){return new lO(e??``)}var fO=class extends jE{static[W]=`PgInetBuilder`;constructor(e){super(e,`string`,`PgInet`)}build(e){return new pO(e,this.config)}},pO=class extends ME{static[W]=`PgInet`;getSQLType(){return`inet`}};function mO(e){return new fO(e??``)}var hO=class extends PD{static[W]=`PgIntegerBuilder`;constructor(e){super(e,`number`,`PgInteger`)}build(e){return new gO(e,this.config)}},gO=class extends ME{static[W]=`PgInteger`;getSQLType(){return`integer`}mapFromDriverValue(e){return typeof e==`string`?Number.parseInt(e):e}};function _O(e){return new hO(e??``)}var vO=class extends jE{static[W]=`PgIntervalBuilder`;constructor(e,t){super(e,`string`,`PgInterval`),this.config.intervalConfig=t}build(e){return new yO(e,this.config)}},yO=class extends ME{static[W]=`PgInterval`;fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){return`interval${this.fields?` ${this.fields}`:``}${this.precision?`(${this.precision})`:``}`}};function bO(e,t={}){let{name:n,config:r}=MD(e,t);return new vO(n,r)}var xO=class extends jE{static[W]=`PgJsonBuilder`;constructor(e){super(e,`json`,`PgJson`)}build(e){return new SO(e,this.config)}},SO=class extends ME{static[W]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}};function CO(e){return new xO(e??``)}var wO=class extends jE{static[W]=`PgJsonbBuilder`;constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new TO(e,this.config)}},TO=class extends ME{static[W]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}};function EO(e){return new wO(e??``)}var DO=class extends jE{static[W]=`PgLineBuilder`;constructor(e){super(e,`array`,`PgLine`)}build(e){return new OO(e,this.config)}},OO=class extends ME{static[W]=`PgLine`;getSQLType(){return`line`}mapFromDriverValue(e){let[t,n,r]=e.slice(1,-1).split(`,`);return[Number.parseFloat(t),Number.parseFloat(n),Number.parseFloat(r)]}mapToDriverValue(e){return`{${e[0]},${e[1]},${e[2]}}`}},kO=class extends jE{static[W]=`PgLineABCBuilder`;constructor(e){super(e,`json`,`PgLineABC`)}build(e){return new AO(e,this.config)}},AO=class extends ME{static[W]=`PgLineABC`;getSQLType(){return`line`}mapFromDriverValue(e){let[t,n,r]=e.slice(1,-1).split(`,`);return{a:Number.parseFloat(t),b:Number.parseFloat(n),c:Number.parseFloat(r)}}mapToDriverValue(e){return`{${e.a},${e.b},${e.c}}`}};function jO(e,t){let{name:n,config:r}=MD(e,t);return!r?.mode||r.mode===`tuple`?new DO(n):new kO(n)}var MO=class extends jE{static[W]=`PgMacaddrBuilder`;constructor(e){super(e,`string`,`PgMacaddr`)}build(e){return new NO(e,this.config)}},NO=class extends ME{static[W]=`PgMacaddr`;getSQLType(){return`macaddr`}};function PO(e){return new MO(e??``)}var FO=class extends jE{static[W]=`PgMacaddr8Builder`;constructor(e){super(e,`string`,`PgMacaddr8`)}build(e){return new IO(e,this.config)}},IO=class extends ME{static[W]=`PgMacaddr8`;getSQLType(){return`macaddr8`}};function LO(e){return new FO(e??``)}var RO=class extends jE{static[W]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new zO(e,this.config)}},zO=class extends ME{static[W]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},BO=class extends jE{static[W]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new VO(e,this.config)}},VO=class extends ME{static[W]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},HO=class extends jE{static[W]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new UO(e,this.config)}},UO=class extends ME{static[W]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}};function WO(e,t){let{name:n,config:r}=MD(e,t),i=r?.mode;return i===`number`?new BO(n,r?.precision,r?.scale):i===`bigint`?new HO(n,r?.precision,r?.scale):new RO(n,r?.precision,r?.scale)}var GO=class extends jE{static[W]=`PgPointTupleBuilder`;constructor(e){super(e,`array`,`PgPointTuple`)}build(e){return new KO(e,this.config)}},KO=class extends ME{static[W]=`PgPointTuple`;getSQLType(){return`point`}mapFromDriverValue(e){if(typeof e==`string`){let[t,n]=e.slice(1,-1).split(`,`);return[Number.parseFloat(t),Number.parseFloat(n)]}return[e.x,e.y]}mapToDriverValue(e){return`(${e[0]},${e[1]})`}},qO=class extends jE{static[W]=`PgPointObjectBuilder`;constructor(e){super(e,`json`,`PgPointObject`)}build(e){return new JO(e,this.config)}},JO=class extends ME{static[W]=`PgPointObject`;getSQLType(){return`point`}mapFromDriverValue(e){if(typeof e==`string`){let[t,n]=e.slice(1,-1).split(`,`);return{x:Number.parseFloat(t),y:Number.parseFloat(n)}}return e}mapToDriverValue(e){return`(${e.x},${e.y})`}};function YO(e,t){let{name:n,config:r}=MD(e,t);return!r?.mode||r.mode===`tuple`?new GO(n):new qO(n)}function XO(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function ZO(e,t){let n=new DataView(new ArrayBuffer(8));for(let r=0;r<8;r++)n.setUint8(r,e[t+r]);return n.getFloat64(0,!0)}function QO(e){let t=XO(e),n=0,r=t[n];n+=1;let i=new DataView(t.buffer),a=i.getUint32(n,r===1);if(n+=4,a&536870912&&(i.getUint32(n,r===1),n+=4),(a&65535)==1){let e=ZO(t,n);n+=8;let r=ZO(t,n);return n+=8,[e,r]}throw Error(`Unsupported geometry type`)}var $O=class extends jE{static[W]=`PgGeometryBuilder`;constructor(e){super(e,`array`,`PgGeometry`)}build(e){return new ek(e,this.config)}},ek=class extends ME{static[W]=`PgGeometry`;getSQLType(){return`geometry(point)`}mapFromDriverValue(e){return QO(e)}mapToDriverValue(e){return`point(${e[0]} ${e[1]})`}},tk=class extends jE{static[W]=`PgGeometryObjectBuilder`;constructor(e){super(e,`json`,`PgGeometryObject`)}build(e){return new nk(e,this.config)}},nk=class extends ME{static[W]=`PgGeometryObject`;getSQLType(){return`geometry(point)`}mapFromDriverValue(e){let t=QO(e);return{x:t[0],y:t[1]}}mapToDriverValue(e){return`point(${e.x} ${e.y})`}};function rk(e,t){let{name:n,config:r}=MD(e,t);return!r?.mode||r.mode===`tuple`?new $O(n):new tk(n)}var ik=class extends jE{static[W]=`PgRealBuilder`;constructor(e,t){super(e,`number`,`PgReal`),this.config.length=t}build(e){return new ak(e,this.config)}},ak=class extends ME{static[W]=`PgReal`;constructor(e,t){super(e,t)}getSQLType(){return`real`}mapFromDriverValue=e=>typeof e==`string`?Number.parseFloat(e):e};function ok(e){return new ik(e??``)}var sk=class extends jE{static[W]=`PgSerialBuilder`;constructor(e){super(e,`number`,`PgSerial`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new ck(e,this.config)}},ck=class extends ME{static[W]=`PgSerial`;getSQLType(){return`serial`}};function lk(e){return new sk(e??``)}var uk=class extends PD{static[W]=`PgSmallIntBuilder`;constructor(e){super(e,`number`,`PgSmallInt`)}build(e){return new dk(e,this.config)}},dk=class extends ME{static[W]=`PgSmallInt`;getSQLType(){return`smallint`}mapFromDriverValue=e=>typeof e==`string`?Number(e):e};function fk(e){return new uk(e??``)}var pk=class extends jE{static[W]=`PgSmallSerialBuilder`;constructor(e){super(e,`number`,`PgSmallSerial`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new mk(e,this.config)}},mk=class extends ME{static[W]=`PgSmallSerial`;getSQLType(){return`smallserial`}};function hk(e){return new pk(e??``)}var gk=class extends jE{static[W]=`PgTextBuilder`;constructor(e,t){super(e,`string`,`PgText`),this.config.enumValues=t.enum}build(e){return new _k(e,this.config)}},_k=class extends ME{static[W]=`PgText`;enumValues=this.config.enumValues;getSQLType(){return`text`}};function J(e,t={}){let{name:n,config:r}=MD(e,t);return new gk(n,r)}var vk=class extends rO{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[W]=`PgTimeBuilder`;build(e){return new yk(e,this.config)}},yk=class extends ME{static[W]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`time${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}};function bk(e,t={}){let{name:n,config:r}=MD(e,t);return new vk(n,r.withTimezone??!1,r.precision)}var xk=class extends rO{static[W]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new Sk(e,this.config)}},Sk=class extends ME{static[W]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:` (${this.precision})`}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue(e){return typeof e==`string`?new Date(this.withTimezone?e:e+`+0000`):e}mapToDriverValue=e=>e.toISOString()},Ck=class extends rO{static[W]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new wk(e,this.config)}},wk=class extends ME{static[W]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue(e){if(typeof e==`string`)return e;let t=e.toISOString().slice(0,-1).replace(`T`,` `);if(this.withTimezone){let n=e.getTimezoneOffset();return`${t}${n<=0?`+`:`-`}${Math.floor(Math.abs(n)/60).toString().padStart(2,`0`)}`}return t}};function Tk(e,t={}){let{name:n,config:r}=MD(e,t);return r?.mode===`string`?new Ck(n,r.withTimezone??!1,r.precision):new xk(n,r?.withTimezone??!1,r?.precision)}var Ek=class extends jE{static[W]=`PgUUIDBuilder`;constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default(q`gen_random_uuid()`)}build(e){return new Dk(e,this.config)}},Dk=class extends ME{static[W]=`PgUUID`;getSQLType(){return`uuid`}};function Ok(e){return new Ek(e??``)}var kk=class extends jE{static[W]=`PgVarcharBuilder`;constructor(e,t){super(e,`string`,`PgVarchar`),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new Ak(e,this.config)}},Ak=class extends ME{static[W]=`PgVarchar`;length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?`varchar`:`varchar(${this.length})`}};function jk(e,t={}){let{name:n,config:r}=MD(e,t);return new kk(n,r)}var Mk=class extends jE{static[W]=`PgBinaryVectorBuilder`;constructor(e,t){super(e,`string`,`PgBinaryVector`),this.config.dimensions=t.dimensions}build(e){return new Nk(e,this.config)}},Nk=class extends ME{static[W]=`PgBinaryVector`;dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function Pk(e,t){let{name:n,config:r}=MD(e,t);return new Mk(n,r)}var Fk=class extends jE{static[W]=`PgHalfVectorBuilder`;constructor(e,t){super(e,`array`,`PgHalfVector`),this.config.dimensions=t.dimensions}build(e){return new Ik(e,this.config)}},Ik=class extends ME{static[W]=`PgHalfVector`;dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(`,`).map(e=>Number.parseFloat(e))}};function Lk(e,t){let{name:n,config:r}=MD(e,t);return new Fk(n,r)}var Rk=class extends jE{static[W]=`PgSparseVectorBuilder`;constructor(e,t){super(e,`string`,`PgSparseVector`),this.config.dimensions=t.dimensions}build(e){return new zk(e,this.config)}},zk=class extends ME{static[W]=`PgSparseVector`;dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function Bk(e,t){let{name:n,config:r}=MD(e,t);return new Rk(n,r)}var Vk=class extends jE{static[W]=`PgVectorBuilder`;constructor(e,t){super(e,`array`,`PgVector`),this.config.dimensions=t.dimensions}build(e){return new Hk(e,this.config)}},Hk=class extends ME{static[W]=`PgVector`;dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(`,`).map(e=>Number.parseFloat(e))}};function Uk(e,t){let{name:n,config:r}=MD(e,t);return new Vk(n,r)}function Wk(){return{bigint:zD,bigserial:WD,boolean:qD,char:XD,cidr:$D,customType:nO,date:cO,doublePrecision:dO,inet:mO,integer:_O,interval:bO,json:CO,jsonb:EO,line:jO,macaddr:PO,macaddr8:LO,numeric:WO,point:YO,geometry:rk,real:ok,serial:lk,smallint:fk,smallserial:hk,text:J,time:bk,timestamp:Tk,uuid:Ok,varchar:jk,bit:Pk,halfvec:Lk,sparsevec:Bk,vector:Uk}}var Gk=Symbol.for(`drizzle:PgInlineForeignKeys`),Kk=Symbol.for(`drizzle:EnableRLS`),qk=class extends K{static[W]=`PgTable`;static Symbol=Object.assign({},K.Symbol,{InlineForeignKeys:Gk,EnableRLS:Kk});[Gk]=[];[Kk]=!1;[K.Symbol.ExtraConfigBuilder]=void 0;[K.Symbol.ExtraConfigColumns]={}};function Jk(e,t,n,r,i=e){let a=new qk(e,r,i),o=typeof t==`function`?t(Wk()):t,s=Object.fromEntries(Object.entries(o).map(([e,t])=>{let n=t;n.setName(e);let r=n.build(a);return a[Gk].push(...n.buildForeignKeys(r,a)),[e,r]})),c=Object.fromEntries(Object.entries(o).map(([e,t])=>{let n=t;return n.setName(e),[e,n.buildExtraConfigColumn(a)]})),l=Object.assign(a,s);return l[K.Symbol.Columns]=s,l[K.Symbol.ExtraConfigColumns]=c,n&&(l[qk.Symbol.ExtraConfigBuilder]=n),Object.assign(l,{enableRLS:()=>(l[qk.Symbol.EnableRLS]=!0,l)})}var Yk=(e,t,n)=>Jk(e,t,n,void 0);function Xk(...e){return e[0].columns?new Zk(e[0].columns,e[0].name):new Zk(e)}var Zk=class{static[W]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new Qk(e,this.columns,this.name)}},Qk=class{constructor(e,t,n){this.table=e,this.columns=t,this.name=n}static[W]=`PgPrimaryKey`;columns;name;getName(){return this.name??`${this.table[qk.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function $k(e,t){return iD(t)&&!$E(e)&&!G(e,sD)&&!G(e,cD)&&!G(e,gE)&&!G(e,K)&&!G(e,dD)?new sD(e,t):e}var Y=(e,t)=>q`${e} = ${$k(t,e)}`,eA=(e,t)=>q`${e} <> ${$k(t,e)}`;function tA(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new nD(t):new nD([new tD(`(`),q.join(t,new tD(` and `)),new tD(`)`)])}function nA(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new nD(t):new nD([new tD(`(`),q.join(t,new tD(` or `)),new tD(`)`)])}function rA(e){return q`not ${e}`}var iA=(e,t)=>q`${e} > ${$k(t,e)}`,aA=(e,t)=>q`${e} >= ${$k(t,e)}`,oA=(e,t)=>q`${e} < ${$k(t,e)}`,sA=(e,t)=>q`${e} <= ${$k(t,e)}`;function cA(e,t){return Array.isArray(t)?t.length===0?q`false`:q`${e} in ${t.map(t=>$k(t,e))}`:q`${e} in ${$k(t,e)}`}function lA(e,t){return Array.isArray(t)?t.length===0?q`true`:q`${e} not in ${t.map(t=>$k(t,e))}`:q`${e} not in ${$k(t,e)}`}function uA(e){return q`${e} is null`}function dA(e){return q`${e} is not null`}function fA(e){return q`exists ${e}`}function pA(e){return q`not exists ${e}`}function mA(e,t,n){return q`${e} between ${$k(t,e)} and ${$k(n,e)}`}function hA(e,t,n){return q`${e} not between ${$k(t,e)} and ${$k(n,e)}`}function gA(e,t){return q`${e} like ${t}`}function _A(e,t){return q`${e} not like ${t}`}function vA(e,t){return q`${e} ilike ${t}`}function yA(e,t){return q`${e} not ilike ${t}`}function bA(e){return q`${e} asc`}function xA(e){return q`${e} desc`}var SA=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[K.Symbol.Name]}static[W]=`Relation`;referencedTableName;fieldName},CA=class{constructor(e,t){this.table=e,this.config=t}static[W]=`Relations`},wA=class e extends SA{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}static[W]=`One`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},TA=class e extends SA{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}static[W]=`Many`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}};function EA(){return{and:tA,between:mA,eq:Y,exists:fA,gt:iA,gte:aA,ilike:vA,inArray:cA,isNull:uA,isNotNull:dA,like:gA,lt:oA,lte:sA,ne:eA,not:rA,notBetween:hA,notExists:pA,notLike:_A,notIlike:yA,notInArray:lA,or:nA,sql:q}}function DA(){return{sql:q,asc:bA,desc:xA}}function OA(e,t){Object.keys(e).length===1&&`default`in e&&!G(e.default,K)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(G(o,K)){let e=QE(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[K.Symbol.Name],schema:o[K.Symbol.Schema],columns:o[K.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[K.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[K.Symbol.ExtraConfigBuilder]?.(o[K.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))G(e,Zk)&&i[a].primaryKey.push(...e.columns)}else if(G(o,CA)){let e=QE(o.table),a=n[e],s=o.config(t(o.table)),c;for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function kA(e,t){return new CA(e,e=>Object.fromEntries(Object.entries(t(e)).map(([e,t])=>[e,t.withFieldName(e)])))}function AA(e){return function(t,n){return new wA(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function jA(e){return function(t,n){return new TA(e,t,n)}}function MA(e,t,n){if(G(n,wA)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[QE(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[K.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[QE(a)];if(!o)throw Error(`Table "${a[K.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[K.Symbol.Name]}". Please specify relation name`);if(s[0]&&G(s[0],wA)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function NA(e){return{one:AA(e),many:jA(e)}}function PA(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=G(r,wA)?l&&PA(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>PA(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=G(t,gE)?t:G(t,nD)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}function FA(e){return q`count(${e||q.raw(`*`)})`.mapWith(Number)}function IA(e){let t=e?.dataType;return typeof t==`string`&&t.split(` `)[0]===`string`}function LA(e,t,n){if(!IA(t))return e;let r=e=>{if(!(e instanceof Date))return e;let t=e.toISOString();return n===`mysql`?t.replace(`T`,` `).replace(`Z`,``):t};return Array.isArray(e)?e.map(r):r(e)}var RA=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?$/;function zA(e){return typeof e==`string`&&RA.test(e)?new Date(`${e.replace(` `,`T`)}Z`):new Date(e)}function BA(e){let t=new Map;for(let[n,r]of Object.entries(e??{}))r.relations&&t.set(n,new Set(Object.keys(r.relations)));return t}function VA({baseModel:e,joinModel:t,baseModelKey:n,joinModelKey:r,relationKeys:i,schema:a,getDefaultModelName:o}){let s=n??o(e),c=r??o(t),l=a[c]?.fields??{},u=Object.values(l).some(e=>e.references&&o(e.references.model)===s)?t:a[c]?.modelName??c;return i?.size?i.has(u)?u:i.has(t)?t:u:t}function HA(e,t,n){return n===`pg`?vA(e,t):q`LOWER(${e}) LIKE LOWER(${t})`}function UA(e,t){return t.length===0?q`false`:q`LOWER(${e}) IN (${q.join(t.map(e=>q`LOWER(${e})`),q`, `)})`}function WA(e,t){return t.length===0?q`true`:q`LOWER(${e}) NOT IN (${q.join(t.map(e=>q`LOWER(${e})`),q`, `)})`}function GA(e,t){return q`LOWER(${e}) = LOWER(${t})`}function KA(e,t){return q`LOWER(${e}) <> LOWER(${t})`}function qA(e){let t=[];for(let[n,r]of Object.entries(e)){if(!G(r,K))continue;let e=Object.entries(AD(r)).map(([e,t])=>({name:e,nullable:!t.notNull,hasDefault:t.hasDefault||t.generated!==void 0||t.generatedIdentity!==void 0}));t.push({name:n,columns:e})}return t}function JA(e,t,n){return Gi($i(t,{usePlural:n}),qA(e))}function YA(e,t,n){let r=0;if(e&&typeof e==`object`&&`rowCount`in e?r=e.rowCount:e&&typeof e==`object`&&typeof e.count==`number`?r=e.count:Array.isArray(e)?r=e.length>0&&ZA(e[0])?XA(e[0]):e.length:ZA(e)&&(r=XA(e)),typeof r!=`number`||!Number.isFinite(r))throw Hi.error(`[Drizzle Adapter] The result of the ${t} operation is not a finite number. This is likely a bug in the adapter. Please report this issue to the Better Auth team.`,{result:e,...n}),new U(`Drizzle adapter ${t} returned an invalid affected row count`);return r}function XA(e){if(!e||typeof e!=`object`)return;let t=e;if(`affectedRows`in t)return t.affectedRows;if(`rowsAffected`in t)return t.rowsAffected;if(`changes`in t)return t.changes;if(`meta`in t){let e=t.meta;if(e&&typeof e==`object`&&`changes`in e)return e.changes}}function ZA(e){return XA(e)!==void 0}var QA=(e,t)=>{let n=null,r=!1,i,a=()=>i??=BA(e._?.schema),o=(e,n=!1)=>({getFieldName:i,getDefaultFieldName:o,getDefaultModelName:s,options:c,schema:l})=>{t.provider===`mysql`&&c.advanced?.database?.generateId===!1&&!r&&(r=!0,Hi.warn(`[Drizzle Adapter] MySQL does not support INSERT...RETURNING. With generateId set to false, the adapter uses best-effort fallback strategies (unique columns, full-field match) to retrieve inserted rows. For reliable behavior, use Better Auth's default ID generation, a custom generateId function, or generateId: "serial" for auto-increment.`));function u(n){let r=t.schema||e._.fullSchema;if(!r)throw new U(`Drizzle adapter failed to initialize. Schema not found. Please provide a schema object in the adapter options object.`);let i=r[n];if(!i)throw new U(`[# Drizzle Adapter]: The model "${n}" was not found in the schema object. Please pass the schema directly to the adapter options.`);return i}let d=async(r,a,o,s,d)=>{if(t.provider!==`mysql`)return(await o.returning())[0];await o.execute();let p=u(r),m=o.config?.values;if(d?.length){let t=f(d.map(e=>s[e.field]===void 0?e:{...e,value:s[e.field]}),r,a);return(await e.select().from(p).where(...t))[0]}let h=async e=>{let t=m?.[0]?.id?.value;if(t)return(await e.select().from(p).where(Y(p.id,t)).limit(1).execute())[0]??null;if(s.id)return(await e.select().from(p).where(Y(p.id,s.id)).limit(1).execute())[0]??null;if(c.advanced?.database?.generateId===`serial`&&p.id){let t=(await e.select({id:q`LAST_INSERT_ID()`}).from(p).limit(1).execute())[0]?.id;if(t)return(await e.select().from(p).where(Y(p.id,t)).limit(1).execute())[0]??null}let n=l[a]?.fields;if(n)for(let[t,r]of Object.entries(n)){if(!r.unique)continue;let n=i({model:a,field:t}),o=s[n];if(o==null||!p[n])continue;let c=await e.select().from(p).where(Y(p[n],o)).limit(1).execute();if(c[0])return c[0]}let o=[];for(let[e,t]of Object.entries(s))t!==void 0&&p[e]&&o.push(t===null?uA(p[e]):Y(p[e],t));if(o.length>0){let t=tA(...o);if(t){let n=await e.select().from(p).where(t).limit(2).execute();if(n.length===1)return n[0]}}return Hi.warn(`[Drizzle Adapter] Unable to safely identify the inserted "${r}" row on MySQL. Enable Better Auth ID generation or use generateId: "serial" for reliable behavior.`),null};return n?h(e):e.transaction(h)};function f(e,n,r){let a=u(n),o=e=>{let t=i({model:r,field:e.field});if(!G(a[t],gE))throw new U(`The field "${e.field}" does not exist in the schema for the model "${n}". Please update your schema.`);return t};if(!e)return[];if(e.length===1){let n=e[0];if(!n)return[];let r=o(n),i=(n.mode??`sensitive`)===`insensitive`&&(typeof n.value==`string`||Array.isArray(n.value)&&n.value.every(e=>typeof e==`string`));if(n.operator===`in`){if(!Array.isArray(n.value))throw new U(`The value for the field "${n.field}" must be an array when using the "in" operator.`);return i?[UA(a[r],n.value)]:[cA(a[r],n.value)]}if(n.operator===`not_in`){if(!Array.isArray(n.value))throw new U(`The value for the field "${n.field}" must be an array when using the "not_in" operator.`);return i?[WA(a[r],n.value)]:[lA(a[r],n.value)]}return n.operator===`contains`?i&&typeof n.value==`string`?[HA(a[r],`%${n.value}%`,t.provider)]:[gA(a[r],`%${n.value}%`)]:n.operator===`starts_with`?i&&typeof n.value==`string`?[HA(a[r],`${n.value}%`,t.provider)]:[gA(a[r],`${n.value}%`)]:n.operator===`ends_with`?i&&typeof n.value==`string`?[HA(a[r],`%${n.value}`,t.provider)]:[gA(a[r],`%${n.value}`)]:n.operator===`lt`?[oA(a[r],n.value)]:n.operator===`lte`?[sA(a[r],n.value)]:n.operator===`ne`?n.value===null?[dA(a[r])]:i&&typeof n.value==`string`?[KA(a[r],n.value)]:[eA(a[r],n.value)]:n.operator===`gt`?[iA(a[r],n.value)]:n.operator===`gte`?[aA(a[r],n.value)]:n.value===null?[uA(a[r])]:i&&typeof n.value==`string`?[GA(a[r],n.value)]:[Y(a[r],n.value)]}let s=e.filter(e=>e.connector===`AND`||!e.connector),c=e.filter(e=>e.connector===`OR`),l=tA(...s.map(e=>{let n=o(e),r=(e.mode??`sensitive`)===`insensitive`&&(typeof e.value==`string`||Array.isArray(e.value)&&e.value.every(e=>typeof e==`string`));if(e.operator===`in`){if(!Array.isArray(e.value))throw new U(`The value for the field "${e.field}" must be an array when using the "in" operator.`);return r?UA(a[n],e.value):cA(a[n],e.value)}if(e.operator===`not_in`){if(!Array.isArray(e.value))throw new U(`The value for the field "${e.field}" must be an array when using the "not_in" operator.`);return r?WA(a[n],e.value):lA(a[n],e.value)}return e.operator===`contains`?r&&typeof e.value==`string`?HA(a[n],`%${e.value}%`,t.provider):gA(a[n],`%${e.value}%`):e.operator===`starts_with`?r&&typeof e.value==`string`?HA(a[n],`${e.value}%`,t.provider):gA(a[n],`${e.value}%`):e.operator===`ends_with`?r&&typeof e.value==`string`?HA(a[n],`%${e.value}`,t.provider):gA(a[n],`%${e.value}`):e.operator===`lt`?oA(a[n],e.value):e.operator===`lte`?sA(a[n],e.value):e.operator===`gt`?iA(a[n],e.value):e.operator===`gte`?aA(a[n],e.value):e.operator===`ne`?e.value===null?dA(a[n]):r&&typeof e.value==`string`?KA(a[n],e.value):eA(a[n],e.value):e.value===null?uA(a[n]):r&&typeof e.value==`string`?GA(a[n],e.value):Y(a[n],e.value)})),d=nA(...c.map(e=>{let n=o(e),r=(e.mode??`sensitive`)===`insensitive`&&(typeof e.value==`string`||Array.isArray(e.value)&&e.value.every(e=>typeof e==`string`));if(e.operator===`in`){if(!Array.isArray(e.value))throw new U(`The value for the field "${e.field}" must be an array when using the "in" operator.`);return r?UA(a[n],e.value):cA(a[n],e.value)}if(e.operator===`not_in`){if(!Array.isArray(e.value))throw new U(`The value for the field "${e.field}" must be an array when using the "not_in" operator.`);return r?WA(a[n],e.value):lA(a[n],e.value)}return e.operator===`contains`?r&&typeof e.value==`string`?HA(a[n],`%${e.value}%`,t.provider):gA(a[n],`%${e.value}%`):e.operator===`starts_with`?r&&typeof e.value==`string`?HA(a[n],`${e.value}%`,t.provider):gA(a[n],`${e.value}%`):e.operator===`ends_with`?r&&typeof e.value==`string`?HA(a[n],`%${e.value}`,t.provider):gA(a[n],`%${e.value}`):e.operator===`lt`?oA(a[n],e.value):e.operator===`lte`?sA(a[n],e.value):e.operator===`gt`?iA(a[n],e.value):e.operator===`gte`?aA(a[n],e.value):e.operator===`ne`?e.value===null?dA(a[n]):r&&typeof e.value==`string`?KA(a[n],e.value):eA(a[n],e.value):e.value===null?uA(a[n]):r&&typeof e.value==`string`?GA(a[n],e.value):Y(a[n],e.value)}));return s.length&&c.length?[tA(l,d)]:s.length?[l]:c.length?[d]:[]}function p(e,t,n){if(!e)throw new U(`Drizzle adapter failed to initialize. Drizzle Schema not found. Please provide a schema object in the adapter options object.`);for(let r in n){let n;try{n=i({model:t,field:r})}catch{n=r}if(!e[n])throw new U(`The field "${r}" does not exist in the "${t}" Drizzle schema. Please update your drizzle schema or re-generate using "npx auth@latest generate".`)}}function m(n){if(!e.query)return null;if(e.query[n])return n;if(t.usePlural){let t=`${n}s`;if(e.query[t])return t}if(t.schema){let r=t.schema[n];if(r){let t=e._.fullSchema;if(t){for(let n of Object.keys(e.query))if(t[n]===r)return n}}}return null}function h(e,n,r,i,a,o){return o?VA({baseModel:e,joinModel:n,baseModelKey:r,joinModelKey:i,relationKeys:a,schema:l,getDefaultModelName:s}):t.usePlural?n:`${n}s`}return{async create({model:t,modelKey:n=t,data:r}){let i=u(t);return p(i,n,r),await d(t,n,e.insert(i).values(r),r)},async findOne({model:t,modelKey:n=t,where:r,select:o,join:s}){let l=u(t),d=f(r,t,n);if(s){let r=m(t);if(!e.query||!r)Hi.error(`[# Drizzle Adapter]: The model "${t}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx auth@latest generate".`),Hi.info(`Falling back to regular query`);else{let l,u=[],f=a().get(r);l={};let p=Object.entries(s);for(let[e,r]of p){let i=r.limit??c.advanced?.database?.defaultFindManyLimit??100,a=r.relation===`one-to-one`,o=h(t,e,n,r.modelKey??e,f,a);l[o]=a?!0:{limit:i},o!==e&&u.push({key:o,target:e})}let m=await e.query[r].findFirst({where:d[0],columns:o?.length&&o.length>0?o.reduce((e,t)=>(e[i({model:n,field:t})]=!0,e),{}):void 0,with:l});if(m)for(let{key:e,target:t}of u)m[t]=m[e],delete m[e];return m}}let p=await e.select(o?.length&&o.length>0?o.reduce((e,t)=>{let r=i({model:n,field:t});return{...e,[r]:l[r]}},{}):void 0).from(l).where(...d);return p.length?p[0]:null},async findMany({model:t,modelKey:n=t,where:r,sortBy:o,limit:s,select:l,offset:d,join:p}){let g=u(t),_=r?f(r,t,n):[],v=o?.direction===`desc`?xA:bA;if(p){let r=m(t);if(!e.query||!r)Hi.error(`[# Drizzle Adapter]: The model "${t}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx auth@latest generate".`),Hi.info(`Falling back to regular query`);else{let u,f=[],m=a().get(r);u={};let y=Object.entries(p);for(let[e,r]of y){let i=r.relation===`one-to-one`,a=r.limit??c.advanced?.database?.defaultFindManyLimit??100,o=h(t,e,n,r.modelKey??e,m,i);u[o]=i?!0:{limit:a},o!==e&&f.push({key:o,target:e})}let b;o?.field&&(b=[v(g[i({model:n,field:o?.field})])]);let x=await e.query[r].findMany({where:_[0],with:u,columns:l?.length&&l.length>0?l.reduce((e,t)=>(e[i({model:n,field:t})]=!0,e),{}):void 0,limit:s??100,offset:d??0,orderBy:b});if(x)for(let e of x)for(let{key:t,target:n}of f)e[n]=e[t],delete e[t];return x}}let y=e.select(l?.length&&l.length>0?l.reduce((e,t)=>{let r=i({model:n,field:t});return{...e,[r]:g[r]}},{}):void 0).from(g),b=s,x=d;return b!==void 0&&(y=y.limit(b)),x!==void 0&&(y=y.offset(x)),o?.field&&(y=y.orderBy(v(g[i({model:n,field:o?.field})]))),await y.where(..._)},async count({model:t,modelKey:n=t,where:r}){let i=u(t),a=r?f(r,t,n):[];return(await e.select({count:FA()}).from(i).where(...a))[0].count},async update({model:t,modelKey:n=t,where:r,update:i}){let a=u(t),o=f(r,t,n);return await d(t,n,e.update(a).set(i).where(...o),i,r)},async updateMany({model:t,modelKey:n=t,where:r,update:i}){let a=u(t),o=f(r,t,n);return YA(await e.update(a).set(i).where(...o),`updateMany`,{model:t,where:r})},async delete({model:t,modelKey:n=t,where:r}){let i=u(t),a=f(r,t,n);return await e.delete(i).where(...a)},async deleteMany({model:t,modelKey:n=t,where:r}){let i=u(t),a=f(r,t,n);return YA(await e.delete(i).where(...a),`deleteMany`,{model:t,where:r})},async consumeOne({model:r,modelKey:a=r,where:o}){let s=u(r),c=f(o,r,a),l=i({model:a,field:`id`}),d=s[l];if(t.provider===`mysql`){let t=async e=>{let t=(await e.select().from(s).where(...c).for(`update`).limit(1))[0];if(!t)return null;let n=t[l]??t.id;return n==null||!d?null:YA(await e.delete(s).where(Y(d,n)).execute(),`consumeOne`,{model:r,where:o})>0?t:null};return n?t(e):e.transaction(t)}if(!d)return null;let p=e.select({id:d}).from(s).where(...c).limit(1);return(await e.delete(s).where(cA(d,p)).returning())[0]??null},async incrementOne({model:r,modelKey:a=r,where:o,increment:s,set:c}){let l=u(r),d=f(o,r,a),p=i({model:a,field:`id`}),m=l[p],h={};for(let[e,t]of Object.entries(s)){let n=i({model:a,field:e}),o=l[n];if(!o)throw new U(`The field "${e}" does not exist in the schema for the model "${r}". Please update your schema.`);h[n]=q`${o} + ${q.param(t)}`}if(c)for(let[e,t]of Object.entries(c)){let n=i({model:a,field:e});if(!l[n])throw new U(`The field "${e}" does not exist in the schema for the model "${r}". Please update your schema.`);h[n]=t}if(t.provider===`mysql`){let t=async e=>{let t=(await e.select().from(l).where(...d).for(`update`).limit(1))[0];if(!t)return null;let n=t[p]??t.id;return n==null||!m?null:(await e.update(l).set(h).where(Y(m,n)).execute(),(await e.select().from(l).where(Y(m,n)).limit(1).execute())[0]??null)};return n?t(e):e.transaction(t)}if(!m)return null;let g=e.select({id:m}).from(l).where(...d).limit(1);return(await e.update(l).set(h).where(tA(...d,cA(m,g))).returning())[0]??null},options:t}},s=null;s={config:{adapterId:`drizzle`,adapterName:`Drizzle Adapter`,usePlural:t.usePlural??!1,debugLogs:t.debugLogs??!1,supportsUUIDs:t.provider===`pg`,supportsJSON:t.provider===`pg`,supportsArrays:t.provider===`pg`,customTransformInput:({data:n,fieldAttributes:r,model:i,field:a})=>r.type===`date`?LA(n,(t.schema||e._.fullSchema)?.[i]?.[a],t.provider):n,customTransformOutput:({data:e,fieldAttributes:t})=>t.type===`date`?e==null?e:zA(e):e,transaction:t.transaction??!1?t=>e.transaction(e=>t(na({config:{...s.config,transaction:!1},adapter:o(e,!0)})(n))):!1},adapter:o(e)};let c=na(s);return r=>{n=r;let i=c(r);return Ki(i,Ji(()=>JA(t.schema??e._?.fullSchema??{},r,t.usePlural),`drizzle`),{runtimeEnabled:Qi(r)}),i}},$A=class{constructor(e,t){this.name=e,this.value=t}static[W]=`PgCheckBuilder`;brand;build(e){return new ej(e,this)}},ej=class{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static[W]=`PgCheck`;name;value};function tj(e,t){return new $A(e,t)}var nj=class e{static[W]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===HE)return{...t[HE],selectedFields:new Proxy(t[HE].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=(G(t,zE)?t._.selectedFields:G(t,dD)?t[HE].selectedFields:t)[n];if(G(r,nD.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!r.isSelectionField)return r.sql;let e=r.clone();return e.isSelectionField=!0,e}if(G(r,nD)){if(this.config.sqlBehavior===`sql`)return r;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return G(r,gE)?this.config.alias?new Proxy(r,new fD(new Proxy(r.table,new pD(this.config.alias,this.config.replaceOriginalName??!1)))):r:typeof r!=`object`||!r?r:new Proxy(r,new e(this.config))}},rj=class{constructor(e,t){this.unique=e,this.name=t}static[W]=`PgIndexBuilderOn`;on(...e){return new ij(e.map(e=>{if(G(e,nD))return e;e=e;let t=new PE(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=JSON.parse(JSON.stringify(e.defaultConfig)),t}),this.unique,!1,this.name)}onOnly(...e){return new ij(e.map(e=>{if(G(e,nD))return e;e=e;let t=new PE(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=e.defaultConfig,t}),this.unique,!0,this.name)}using(e,...t){return new ij(t.map(e=>{if(G(e,nD))return e;e=e;let t=new PE(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=JSON.parse(JSON.stringify(e.defaultConfig)),t}),this.unique,!0,this.name,e)}},ij=class{static[W]=`PgIndexBuilder`;config;constructor(e,t,n,r,i=`btree`){this.config={name:r,columns:e,unique:t,only:n,method:i}}concurrently(){return this.config.concurrently=!0,this}with(e){return this.config.with=e,this}where(e){return this.config.where=e,this}build(e){return new aj(this.config,e)}},aj=class{static[W]=`PgIndex`;config;constructor(e,t){this.config={...e,table:t}}};function oj(e){return new rj(!1,e)}function sj(e){return new rj(!0,e)}function cj(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join(`_`)}function lj(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,t,n)=>e+(n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`),``)}function uj(e){return e}var dj=class{static[W]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?cj:e===`camelCase`?lj:uj}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=`${e.table[K.Symbol.Schema]??`public`}.${e.table[K.Symbol.OriginalName]}.${e.name}`;return this.cache[t]||this.cacheTable(e.table),this.cache[t]}cacheTable(e){let t=`${e[K.Symbol.Schema]??`public`}.${e[K.Symbol.OriginalName]}`;if(!this.cachedTables[t]){for(let n of Object.values(e[K.Symbol.Columns])){let e=`${t}.${n.name}`;this.cache[e]=this.convert(n.name)}this.cachedTables[t]=!0}}clearCache(){this.cache={},this.cachedTables={}}},fj=class extends dD{static[W]=`PgViewBase`},pj=class{static[W]=`PgDialect`;casing;constructor(e){this.casing=new dj(e?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=q`
|
|
437
|
+
CREATE TABLE IF NOT EXISTS ${q.identifier(i)}.${q.identifier(r)} (
|
|
438
|
+
id SERIAL PRIMARY KEY,
|
|
439
|
+
hash text NOT NULL,
|
|
440
|
+
created_at bigint
|
|
441
|
+
)
|
|
442
|
+
`;await t.execute(q`CREATE SCHEMA IF NOT EXISTS ${q.identifier(i)}`),await t.execute(a);let o=(await t.all(q`select id, hash, created_at from ${q.identifier(i)}.${q.identifier(r)} order by created_at desc limit 1`))[0];await t.transaction(async t=>{for await(let n of e)if(!o||Number(o.created_at)<n.folderMillis){for(let e of n.sql)await t.execute(q.raw(e));await t.execute(q`insert into ${q.identifier(i)}.${q.identifier(r)} ("hash", "created_at") values(${n.hash}, ${n.folderMillis})`)}})}escapeName(e){return`"${e.replace(/"/g,`""`)}"`}escapeParam(e){return`$${e+1}`}escapeString(e){return`'${e.replace(/'/g,`''`)}'`}buildWithCTE(e){if(!e?.length)return;let t=[q`with `];for(let[n,r]of e.entries())t.push(q`${q.identifier(r._.alias)} as (${r._.sql})`),n<e.length-1&&t.push(q`, `);return t.push(q` `),q.join(t)}buildDeleteQuery({table:e,where:t,returning:n,withList:r}){let i=this.buildWithCTE(r),a=n?q` returning ${this.buildSelection(n,{isSingleTable:!0})}`:void 0,o=t?q` where ${t}`:void 0;return q`${i}delete from ${e}${o}${a}`}buildUpdateSet(e,t){let n=e[K.Symbol.Columns],r=Object.keys(n).filter(e=>t[e]!==void 0||n[e]?.onUpdateFn!==void 0),i=r.length;return q.join(r.flatMap((e,r)=>{let a=n[e],o=a.onUpdateFn?.(),s=t[e]??(G(o,nD)?o:q.param(o,a)),c=q`${q.identifier(this.casing.getColumnCasing(a))} = ${s}`;return r<i-1?[c,q.raw(`, `)]:[c]}))}buildUpdateQuery({table:e,set:t,where:n,returning:r,withList:i,from:a,joins:o}){let s=this.buildWithCTE(i),c=e[qk.Symbol.Name],l=e[qk.Symbol.Schema],u=e[qk.Symbol.OriginalName],d=c===u?void 0:c,f=q`${l?q`${q.identifier(l)}.`:void 0}${q.identifier(u)}${d&&q` ${q.identifier(d)}`}`,p=this.buildUpdateSet(e,t),m=a&&q.join([q.raw(` from `),this.buildFromTable(a)]),h=this.buildJoins(o),g=r?q` returning ${this.buildSelection(r,{isSingleTable:!a})}`:void 0,_=n?q` where ${n}`:void 0;return q`${s}update ${f} set ${p}${m}${h}${_}${g}`}buildSelection(e,{isSingleTable:t=!1}={}){let n=e.length,r=e.flatMap(({field:e},r)=>{let i=[];if(G(e,nD.Aliased)&&e.isSelectionField)i.push(q.identifier(e.fieldAlias));else if(G(e,nD.Aliased)||G(e,nD)){let n=G(e,nD.Aliased)?e.sql:e;t?i.push(new nD(n.queryChunks.map(e=>G(e,ME)?q.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),G(e,nD.Aliased)&&i.push(q` as ${q.identifier(e.fieldAlias)}`)}else if(G(e,gE))t?i.push(q.identifier(this.casing.getColumnCasing(e))):i.push(e);else if(G(e,zE)){let t=Object.entries(e._.selectedFields);if(t.length===1){let n=t[0][1],r=G(n,nD)?n.decoder:G(n,gE)?{mapFromDriverValue:e=>n.mapFromDriverValue(e)}:n.sql.decoder;r&&(e._.sql.decoder=r)}i.push(e)}return r<n-1&&i.push(q`, `),i});return q.join(r)}buildJoins(e){if(!e||e.length===0)return;let t=[];for(let[n,r]of e.entries()){n===0&&t.push(q` `);let i=r.table,a=r.lateral?q` lateral`:void 0,o=r.on?q` on ${r.on}`:void 0;if(G(i,qk)){let e=i[qk.Symbol.Name],n=i[qk.Symbol.Schema],s=i[qk.Symbol.OriginalName],c=e===s?void 0:r.alias;t.push(q`${q.raw(r.joinType)} join${a} ${n?q`${q.identifier(n)}.`:void 0}${q.identifier(s)}${c&&q` ${q.identifier(c)}`}${o}`)}else if(G(i,dD)){let e=i[HE].name,n=i[HE].schema,s=i[HE].originalName,c=e===s?void 0:r.alias;t.push(q`${q.raw(r.joinType)} join${a} ${n?q`${q.identifier(n)}.`:void 0}${q.identifier(s)}${c&&q` ${q.identifier(c)}`}${o}`)}else t.push(q`${q.raw(r.joinType)} join${a} ${i}${o}`);n<e.length-1&&t.push(q` `)}return q.join(t)}buildFromTable(e){if(G(e,K)&&e[K.Symbol.IsAlias]){let t=q`${q.identifier(e[K.Symbol.OriginalName])}`;return e[K.Symbol.Schema]&&(t=q`${q.identifier(e[K.Symbol.Schema])}.${t}`),q`${t} ${q.identifier(e[K.Symbol.Name])}`}return e}buildSelectQuery({withList:e,fields:t,fieldsFlat:n,where:r,having:i,table:a,joins:o,orderBy:s,groupBy:c,limit:l,offset:u,lockingClause:d,distinct:f,setOperators:p}){let m=n??ED(t);for(let e of m)if(G(e.field,gE)&&ZE(e.field.table)!==(G(a,zE)?a._.alias:G(a,fj)?a[HE].name:G(a,nD)?void 0:ZE(a))&&!(e=>o?.some(({alias:t})=>t===(e[K.Symbol.IsAlias]?ZE(e):e[K.Symbol.BaseName])))(e.field.table)){let t=ZE(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let h=!o||o.length===0,g=this.buildWithCTE(e),_;f&&(_=f===!0?q` distinct`:q` distinct on (${q.join(f.on,q`, `)})`);let v=this.buildSelection(m,{isSingleTable:h}),y=this.buildFromTable(a),b=this.buildJoins(o),x=r?q` where ${r}`:void 0,S=i?q` having ${i}`:void 0,C;s&&s.length>0&&(C=q` order by ${q.join(s,q`, `)}`);let w;c&&c.length>0&&(w=q` group by ${q.join(c,q`, `)}`);let E=typeof l==`object`||typeof l==`number`&&l>=0?q` limit ${l}`:void 0,D=u?q` offset ${u}`:void 0,O=q.empty();if(d){let e=q` for ${q.raw(d.strength)}`;d.config.of&&e.append(q` of ${q.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],q`, `)}`),d.config.noWait?e.append(q` nowait`):d.config.skipLocked&&e.append(q` skip locked`),O.append(e)}let k=q`${g}select${_} ${v} from ${y}${b}${x}${w}${S}${C}${E}${D}${O}`;return p.length>0?this.buildSetOperations(k,p):k}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=q`(${e.getSQL()}) `,c=q`(${r.getSQL()})`,l;if(a&&a.length>0){let e=[];for(let t of a)if(G(t,ME))e.push(q.identifier(t.name));else if(G(t,nD)){for(let e=0;e<t.queryChunks.length;e++){let n=t.queryChunks[e];G(n,ME)&&(t.queryChunks[e]=q.identifier(n.name))}e.push(q`${t}`)}else e.push(q`${t}`);l=q` order by ${q.join(e,q`, `)} `}let u=typeof i==`object`||typeof i==`number`&&i>=0?q` limit ${i}`:void 0,d=q.raw(`${t} ${n?`all `:``}`),f=o?q` offset ${o}`:void 0;return q`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a,overridingSystemValue_:o}){let s=[],c=e[K.Symbol.Columns],l=Object.entries(c).filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>q.identifier(this.casing.getColumnCasing(e)));if(a){let e=t;G(e,nD)?s.push(e):s.push(e.getSQL())}else{let e=t;s.push(q.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||G(i,sD)&&i.value===void 0){if(t.defaultFn!==void 0){let e=t.defaultFn(),n=G(e,nD)?e:q.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=G(e,nD)?e:q.param(e,t);r.push(n)}else r.push(q`default`)}else r.push(i)}s.push(r),t<e.length-1&&s.push(q`, `)}}let d=this.buildWithCTE(i),f=q.join(s),p=r?q` returning ${this.buildSelection(r,{isSingleTable:!0})}`:void 0,m=n?q` on conflict ${n}`:void 0,h=o===!0?q`overriding system value `:void 0;return q`${d}insert into ${e} ${u} ${h}${f}${m}${p}`}buildRefreshMaterializedViewQuery({view:e,concurrently:t,withNoData:n}){let r=t?q` concurrently`:void 0,i=n?q` with no data`:void 0;return q`refresh materialized view${r} ${e}${i}`}prepareTyping(e){return G(e,TO)||G(e,SO)?`json`:G(e,zO)?`decimal`:G(e,yk)?`time`:G(e,Sk)||G(e,wk)?`timestamp`:G(e,aO)||G(e,sO)?`date`:G(e,Dk)?`uuid`:`none`}sqlToQuery(e,t){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:t})}buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:r,tableConfig:i,queryConfig:a,tableAlias:o,nestedQueryRelation:s,joinOn:c}){let l=[],u,d,f=[],p,m=[];if(a===!0)l=Object.entries(i.columns).map(([e,t])=>({dbKey:t.name,tsKey:e,field:hD(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,hD(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,EA()):a.where;p=e&&_D(e,o)}let s=[],c=[];if(a.columns){let e=!1;for(let[t,n]of Object.entries(a.columns))n!==void 0&&t in i.columns&&(!e&&n===!0&&(e=!0),c.push(t));c.length>0&&(c=e?c.filter(e=>a.columns?.[e]===!0):Object.keys(i.columns).filter(e=>!c.includes(e)))}else c=Object.keys(i.columns);for(let e of c){let t=i.columns[e];s.push({tsKey:e,value:t})}let h=[];a.with&&(h=Object.entries(a.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:i.relations[e]})));let g;if(a.extras){g=typeof a.extras==`function`?a.extras(r,{sql:q}):a.extras;for(let[e,t]of Object.entries(g))s.push({tsKey:e,value:gD(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:G(t,nD.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:G(t,gE)?hD(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,DA()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>G(e,gE)?hD(e,o):_D(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=MA(t,n,a),c=n[QE(a.referencedTable)],u=`${o}_${r}`,d=tA(...s.fields.map((e,t)=>Y(hD(s.references[t],u),hD(e,o)))),f=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[c],tableConfig:t[c],queryConfig:G(a,wA)?i===!0?{limit:1}:{...i,limit:1}:i,tableAlias:u,joinOn:d,nestedQueryRelation:a}),p=q`${q.identifier(u)}.${q.identifier(`data`)}`.as(r);m.push({on:q`true`,table:new zE(f.sql,{},u),alias:u,joinType:`left`,lateral:!0}),l.push({dbKey:r,tsKey:r,field:p,relationTableTsKey:c,isJson:!0,selection:f.selection})}}if(l.length===0)throw new vD({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=tA(c,p),s){let e=q`json_build_array(${q.join(l.map(({field:e,tsKey:t,isJson:n})=>n?q`${q.identifier(`${o}_${t}`)}.${q.identifier(`data`)}`:G(e,nD.Aliased)?e.sql:e),q`, `)})`;G(s,TA)&&(e=q`coalesce(json_agg(${e}${f.length>0?q` order by ${q.join(f,q`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:`data`,tsKey:`data`,field:e.as(`data`),isJson:!0,relationTableTsKey:i.tsName,selection:l}];u!==void 0||d!==void 0||f.length>0?(h=this.buildSelectQuery({table:mD(r,o),fields:{},fieldsFlat:[{path:[],field:q.raw(`*`)}],where:p,limit:u,offset:d,orderBy:f,setOperators:[]}),p=void 0,u=void 0,d=void 0,f=[]):h=mD(r,o),h=this.buildSelectQuery({table:G(h,qk)?h:new zE(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:G(e,gE)?hD(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:mD(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:G(e,gE)?hD(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},mj=class{static[W]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}},hj=class{static[W]=`PgSelectBuilder`;fields;session;dialect;withList=[];distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}authToken;setToken(e){return this.authToken=e,this}from(e){let t=!!this.fields,n=e,r;return r=this.fields?this.fields:G(n,zE)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):G(n,fj)?n[HE].selectedFields:G(n,nD)?{}:AD(n),new _j({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},gj=class extends mj{static[W]=`PgSelectQueryBuilder`;_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:n,session:r,dialect:i,withList:a,distinct:o}){super(),this.config={withList:a,table:e,fields:{...t},distinct:o,setOperators:[]},this.isPartialSelect=n,this.session=r,this.dialect=i,this._={selectedFields:t,config:this.config},this.tableName=jD(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of Dj(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{let i=this.tableName,a=jD(n);for(let e of Dj(n))this.usedTables.add(e);if(typeof a==`string`&&this.config.joins?.some(e=>e.alias===a))throw Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof i==`string`&&(this.config.fields={[i]:this.config.fields}),typeof a==`string`&&!G(n,nD))){let e=G(n,zE)?n._.selectedFields:G(n,dD)?n[HE].selectedFields:n[K.Symbol.Columns];this.config.fields[a]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new nj({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:n,joinType:e,alias:a,lateral:t}),typeof a==`string`)switch(e){case`left`:this.joinsNotNullableMap[a]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[a]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!1}return this}}leftJoin=this.createJoin(`left`,!1);leftJoinLateral=this.createJoin(`left`,!0);rightJoin=this.createJoin(`right`,!1);innerJoin=this.createJoin(`inner`,!1);innerJoinLateral=this.createJoin(`inner`,!0);fullJoin=this.createJoin(`full`,!1);crossJoin=this.createJoin(`cross`,!1);crossJoinLateral=this.createJoin(`cross`,!0);createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(yj()):n;if(!DD(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator(`union`,!1);unionAll=this.createSetOperator(`union`,!0);intersect=this.createSetOperator(`intersect`,!1);intersectAll=this.createSetOperator(`intersect`,!0);except=this.createSetOperator(`except`,!1);exceptAll=this.createSetOperator(`except`,!0);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new nj({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new nj({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new nj({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new nj({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...Dj(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...Dj(e.table));return new Proxy(new zE(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new nj({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new nj({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},_j=class extends gj{static[W]=`PgSelect`;_prepare(e){let{session:t,config:n,dialect:r,joinsNotNullableMap:i,authToken:a,cacheConfig:o,usedTables:s}=this;if(!t)throw Error(`Cannot execute a query on a query builder. Please use a database instance instead.`);let{fields:c}=n;return VE.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=ED(c),l=t.prepareQuery(r.sqlToQuery(this.getSQL()),n,e,!0,void 0,{type:`select`,tables:[...s]},o);return l.joinsNotNullableMap=i,l.setToken(a)})}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>VE.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))};kD(_j,[wD]);function vj(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!DD(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}var yj=()=>({union:bj,unionAll:xj,intersect:Sj,intersectAll:Cj,except:wj,exceptAll:Tj}),bj=vj(`union`,!1),xj=vj(`union`,!0),Sj=vj(`intersect`,!1),Cj=vj(`intersect`,!0),wj=vj(`except`,!1),Tj=vj(`except`,!0),Ej=class{static[W]=`PgQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=G(e,pj)?e:void 0,this.dialectConfig=G(e,pj)?void 0:e}$with=(e,t)=>{let n=this;return{as:r=>(typeof r==`function`&&(r=r(n)),new Proxy(new BE(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new nj({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})))}};with(...e){let t=this;function n(n){return new hj({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new hj({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new hj({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new hj({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new hj({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new hj({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new pj(this.dialectConfig),this.dialect}};function Dj(e){return G(e,qk)?[e[UE]?`${e[UE]}.${e[K.Symbol.BaseName]}`:e[K.Symbol.BaseName]]:G(e,zE)?e._.usedTables??[]:G(e,nD)?e.usedTables??[]:[]}var Oj=class extends wD{constructor(e,t,n,r){super(),this.session=t,this.dialect=n,this.config={table:e,withList:r}}static[W]=`PgDelete`;config;cacheConfig;where(e){return this.config.where=e,this}returning(e=this.config.table[K.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=ED(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VE.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:Dj(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>VE.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new nj({alias:ZE(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},kj=class{constructor(e,t,n,r,i){this.table=e,this.session=t,this.dialect=n,this.withList=r,this.overridingSystemValue_=i}static[W]=`PgInsertBuilder`;authToken;setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error(`values() must be called with at least one value`);let t=e.map(e=>{let t={},n=this.table[K.Symbol.Columns];for(let r of Object.keys(e)){let i=e[r];t[r]=G(i,nD)?i:new sD(i,n[r])}return t});return new Aj(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new Ej):e;if(!G(t,nD)&&!DD(this.table[WE],t._.selectedFields))throw Error(`Insert select error: selected fields are not the same or are in a different order compared to the table definition`);return new Aj(this.table,t,this.session,this.dialect,this.withList,!0)}},Aj=class extends wD{constructor(e,t,n,r,i,a,o){super(),this.session=n,this.dialect=r,this.config={table:e,values:t,withList:i,select:a,overridingSystemValue_:o}}static[W]=`PgInsert`;config;cacheConfig;returning(e=this.config.table[K.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=ED(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=q`do nothing`;else{let t=``;t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let n=e.where?q` where ${e.where}`:void 0;this.config.onConflict=q`(${q.raw(t)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error(`You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.`);let t=e.where?q` where ${e.where}`:void 0,n=e.targetWhere?q` where ${e.targetWhere}`:void 0,r=e.setWhere?q` where ${e.setWhere}`:void 0,i=this.dialect.buildUpdateSet(this.config.table,OD(this.config.table,e.set)),a=``;return a=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=q`(${q.raw(a)})${n} do update set ${i}${t}${r}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VE.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:Dj(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>VE.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new nj({alias:ZE(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},jj=class extends wD{constructor(e,t,n){super(),this.session=t,this.dialect=n,this.config={view:e}}static[W]=`PgRefreshMaterializedView`;config;concurrently(){if(this.config.withNoData!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VE.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>VE.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))},Mj=class{constructor(e,t,n,r){this.table=e,this.session=t,this.dialect=n,this.withList=r}static[W]=`PgUpdateBuilder`;authToken;setToken(e){return this.authToken=e,this}set(e){return new Nj(this.table,OD(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},Nj=class extends wD{constructor(e,t,n,r,i){super(),this.session=n,this.dialect=r,this.config={set:t,table:e,withList:i,joins:[]},this.tableName=jD(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}static[W]=`PgUpdate`;config;tableName;joinsNotNullableMap;cacheConfig;from(e){let t=e,n=jD(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return G(e,qk)?e[K.Symbol.Columns]:G(e,zE)?e._.selectedFields:e[HE].selectedFields}createJoin(e){return(t,n)=>{let r=jD(t);if(typeof r==`string`&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(typeof n==`function`){let e=this.config.from&&!G(this.config.from,nD)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[K.Symbol.Columns],new nj({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new nj({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))}if(this.config.joins.push({on:n,table:t,joinType:e,alias:r}),typeof r==`string`)switch(e){case`left`:this.joinsNotNullableMap[r]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case`inner`:this.joinsNotNullableMap[r]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1}return this}}leftJoin=this.createJoin(`left`);rightJoin=this.createJoin(`right`);innerJoin=this.createJoin(`inner`);fullJoin=this.createJoin(`full`);where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[K.Symbol.Columns]),this.config.from)){let t=jD(this.config.from);if(typeof t==`string`&&this.config.from&&!G(this.config.from,nD)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=jD(t.table);if(typeof n==`string`&&!G(t.table,nD)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=ED(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){let t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:Dj(this.config.table)},this.cacheConfig);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>this._prepare().execute(e,this.authToken);getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new nj({alias:ZE(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},Pj=class e extends nD{constructor(t){super(e.buildEmbeddedCount(t.source,t.filters).queryChunks),this.params=t,this.mapWith(Number),this.session=t.session,this.sql=e.buildCount(t.source,t.filters)}sql;token;static[W]=`PgCountBuilder`;[Symbol.toStringTag]=`PgCountBuilder`;session;static buildEmbeddedCount(e,t){return q`(select count(*) from ${e}${q.raw(` where `).if(t)}${t})`}static buildCount(e,t){return q`select count(*) as count from ${e}${q.raw(` where `).if(t)}${t};`}setToken(e){return this.token=e,this}then(e,t){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}},Fj=class{constructor(e,t,n,r,i,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o}static[W]=`PgRelationalQueryBuilder`;findMany(e){return new Ij(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new Ij(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},Ij=class extends wD{constructor(e,t,n,r,i,a,o,s,c){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o,this.config=s,this.mode=c}static[W]=`PgRelationalQuery`;_prepare(e){return VE.startActiveSpan(`drizzle.prepareQuery`,()=>{let{query:t,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(e,n)=>{let r=e.map(e=>PA(this.schema,this.tableConfig,e,t.selection,n));return this.mode===`first`?r[0]:r})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery();return{query:e,builtQuery:this.dialect.sqlToQuery(e.sql)}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(e){return this.authToken=e,this}execute(){return VE.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},Lj=class extends wD{constructor(e,t,n,r){super(),this.execute=e,this.sql=t,this.query=n,this.mapBatchResult=r}static[W]=`PgRaw`;getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}},Rj=class{constructor(e,t,n){if(this.dialect=e,this.session=t,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:t}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:t},this.query={},this._.schema)for(let[r,i]of Object.entries(this._.schema))this.query[r]=new Fj(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[r],i,e,t);this.$cache={invalidate:async e=>{}}}static[W]=`PgDatabase`;query;$with=(e,t)=>{let n=this;return{as:r=>(typeof r==`function`&&(r=r(new Ej(n.dialect))),new Proxy(new BE(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new nj({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})))}};$count(e,t){return new Pj({source:e,filters:t,session:this.session})}$cache;with(...e){let t=this;function n(n){return new hj({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new hj({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new hj({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new Mj(n,t.session,t.dialect,e)}function o(n){return new kj(n,t.session,t.dialect,e)}function s(n){return new Oj(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new hj({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new hj({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new hj({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new Mj(e,this.session,this.dialect)}insert(e){return new kj(e,this.session,this.dialect)}delete(e){return new Oj(e,this.session,this.dialect)}refreshMaterializedView(e){return new jj(e,this.session,this.dialect)}authToken;execute(e){let t=typeof e==`string`?q.raw(e):e.getSQL(),n=this.dialect.sqlToQuery(t),r=this.session.prepareQuery(n,void 0,void 0,!1);return new Lj(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},zj=class{static[W]=`Cache`},Bj=class extends zj{strategy(){return`all`}static[W]=`NoopCache`;async get(e){}async put(e,t,n,r){}async onMutate(e){}};async function Vj(e,t){let n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder().encode(n),i=await crypto.subtle.digest(`SHA-256`,r);return[...new Uint8Array(i)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Hj=class{constructor(e,t,n,r){this.query=e,this.cache=t,this.queryMetadata=n,this.cacheConfig=r,t&&t.strategy()===`all`&&r===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}static[W]=`PgPreparedQuery`;joinsNotNullableMap;async queryWithCache(e,t,n){if(this.cache===void 0||G(this.cache,Bj)||this.queryMetadata===void 0||this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new yD(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new yD(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new yD(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await Vj(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new yD(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await Vj(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new yD(e,t,n)}}},Uj=class{constructor(e){this.dialect=e}static[W]=`PgSession`;execute(e,t){return VE.startActiveSpan(`drizzle.operation`,()=>VE.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1)).setToken(t).execute(void 0,t))}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},Wj=class extends Rj{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[W]=`PgTransaction`;rollback(){throw new bD}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),q.raw(t.join(` `))}setTransaction(e){return this.session.execute(q`set transaction ${this.getTransactionConfigSQL(e)}`)}},Gj=Yk(`account`,{accessToken:J(`access_token`),accessTokenExpiresAt:Tk(`access_token_expires_at`),accountId:J(`account_id`).notNull(),createdAt:Tk(`created_at`).defaultNow().notNull(),id:J(`id`).primaryKey(),idToken:J(`id_token`),password:J(`password`),providerId:J(`provider_id`).notNull(),refreshToken:J(`refresh_token`),refreshTokenExpiresAt:Tk(`refresh_token_expires_at`),scope:J(`scope`),updatedAt:Tk(`updated_at`).$onUpdate(()=>new Date).notNull(),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`account_userId_idx`).on(e.userId)]),Kj=kA(Gj,({one:e})=>({user:e(uM,{fields:[Gj.userId],references:[uM.id]})})),qj=Yk(`device_code`,{clientId:J(`client_id`),deviceCode:J(`device_code`).notNull(),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),lastPolledAt:Tk(`last_polled_at`),oauthClientId:J(`oauth_client_id`),pollingInterval:_O(`polling_interval`),resources:J(`resources`).array(),scope:J(`scope`),status:J(`status`).notNull(),userCode:J(`user_code`).notNull(),userId:J(`user_id`)},e=>[sj(`deviceCode_deviceCode_uidx`).on(e.deviceCode),sj(`deviceCode_userCode_uidx`).on(e.userCode)]),Jj=Yk(`jwks`,{alg:J(`alg`),createdAt:Tk(`created_at`).notNull(),crv:J(`crv`),expiresAt:Tk(`expires_at`),id:J(`id`).primaryKey(),privateKey:J(`private_key`).notNull(),publicKey:J(`public_key`).notNull()}),Yj=Yk(`oauth_access_token`,{authorizationCodeId:J(`authorization_code_id`),clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),confirmation:EO(`confirmation`),createdAt:Tk(`created_at`).notNull(),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),referenceId:J(`reference_id`),refreshId:J(`refresh_id`).references(()=>iM.id,{onDelete:`cascade`}),requestedUserInfoClaims:J(`requested_user_info_claims`).array(),resources:J(`resources`).array(),revoked:Tk(`revoked`),scopes:J(`scopes`).array().notNull(),sessionId:J(`session_id`).references(()=>cM.id,{onDelete:`set null`}),token:J(`token`).notNull().unique(),userId:J(`user_id`).references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`oauthAccessToken_authorizationCodeId_idx`).on(e.authorizationCodeId),oj(`oauthAccessToken_clientId_idx`).on(e.clientId),oj(`oauthAccessToken_refreshId_idx`).on(e.refreshId),oj(`oauthAccessToken_sessionId_idx`).on(e.sessionId),oj(`oauthAccessToken_userId_idx`).on(e.userId)]),Xj=kA(Yj,({one:e})=>({oauthClient:e(Zj,{fields:[Yj.clientId],references:[Zj.clientId]}),oauthRefreshToken:e(iM,{fields:[Yj.refreshId],references:[iM.id]}),session:e(cM,{fields:[Yj.sessionId],references:[cM.id]}),user:e(uM,{fields:[Yj.userId],references:[uM.id]})})),Zj=Yk(`oauth_client`,{applicationType:J(`application_type`),backchannelLogoutSessionRequired:qD(`backchannel_logout_session_required`),backchannelLogoutUri:J(`backchannel_logout_uri`),clientCredentialsScopes:J(`client_credentials_scopes`).array().default([]),clientDiscoveryId:J(`client_discovery_id`),clientId:J(`client_id`).notNull().unique(),clientSecret:J(`client_secret`),contacts:J(`contacts`).array(),createdAt:Tk(`created_at`),disabled:qD(`disabled`).default(!1),dpopBoundAccessTokens:qD(`dpop_bound_access_tokens`).default(!1),enableEndSession:qD(`enable_end_session`),grantTypes:J(`grant_types`).array(),icon:J(`icon`),id:J(`id`).primaryKey(),jwks:J(`jwks`),jwksUri:J(`jwks_uri`),metadata:EO(`metadata`),name:J(`name`),policy:J(`policy`),postLogoutRedirectUris:J(`post_logout_redirect_uris`).array(),redirectUris:J(`redirect_uris`).array().notNull(),referenceId:J(`reference_id`),requirePKCE:qD(`require_pkce`),responseTypes:J(`response_types`).array(),scopes:J(`scopes`).array(),skipConsent:qD(`skip_consent`),softwareId:J(`software_id`),softwareStatement:J(`software_statement`),softwareVersion:J(`software_version`),subjectType:J(`subject_type`),tokenEndpointAuthMethod:J(`token_endpoint_auth_method`),tos:J(`tos`),updatedAt:Tk(`updated_at`),uri:J(`uri`),userId:J(`user_id`).references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`oauthClient_userId_idx`).on(e.userId)]),Qj=Yk(`oauth_client_assertion`,{expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey()}),$j=kA(Zj,({many:e,one:t})=>({oauthAccessTokens:e(Yj),oauthClientResources:e(eM),oauthConsents:e(nM),oauthRefreshTokens:e(iM),user:t(uM,{fields:[Zj.userId],references:[uM.id]})})),eM=Yk(`oauth_client_resource`,{clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),createdAt:Tk(`created_at`),id:J(`id`).primaryKey(),metadata:EO(`metadata`),resourceId:J(`resource_id`).notNull().references(()=>oM.identifier,{onDelete:`cascade`})},e=>[oj(`oauthClientResource_clientId_idx`).on(e.clientId),sj(`oauthClientResource_clientId_resourceId_uidx`).on(e.clientId,e.resourceId),oj(`oauthClientResource_resourceId_idx`).on(e.resourceId)]),tM=kA(eM,({one:e})=>({oauthClient:e(Zj,{fields:[eM.clientId],references:[Zj.clientId]}),oauthResource:e(oM,{fields:[eM.resourceId],references:[oM.identifier]})})),nM=Yk(`oauth_consent`,{clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),createdAt:Tk(`created_at`).notNull(),id:J(`id`).primaryKey(),referenceId:J(`reference_id`),requestedUserInfoClaims:J(`requested_user_info_claims`).array(),resources:J(`resources`).array(),scopes:J(`scopes`).array().notNull(),updatedAt:Tk(`updated_at`).notNull(),userId:J(`user_id`).references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`oauthConsent_clientId_idx`).on(e.clientId),oj(`oauthConsent_userId_idx`).on(e.userId)]),rM=kA(nM,({one:e})=>({oauthClient:e(Zj,{fields:[nM.clientId],references:[Zj.clientId]}),user:e(uM,{fields:[nM.userId],references:[uM.id]})})),iM=Yk(`oauth_refresh_token`,{authorizationCodeId:J(`authorization_code_id`),authTime:Tk(`auth_time`),clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),confirmation:EO(`confirmation`),createdAt:Tk(`created_at`).notNull(),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),referenceId:J(`reference_id`),requestedUserInfoClaims:J(`requested_user_info_claims`).array(),resources:J(`resources`).array(),revoked:Tk(`revoked`),rotatedAt:Tk(`rotated_at`),rotationReplayExpiresAt:Tk(`rotation_replay_expires_at`),rotationReplayResponse:J(`rotation_replay_response`),scopes:J(`scopes`).array().notNull(),sessionId:J(`session_id`).references(()=>cM.id,{onDelete:`set null`}),token:J(`token`).notNull().unique(),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`oauthRefreshToken_authorizationCodeId_idx`).on(e.authorizationCodeId),oj(`oauthRefreshToken_clientId_idx`).on(e.clientId),oj(`oauthRefreshToken_sessionId_idx`).on(e.sessionId),oj(`oauthRefreshToken_userId_idx`).on(e.userId)]),aM=kA(iM,({many:e,one:t})=>({oauthAccessTokens:e(Yj),oauthClient:t(Zj,{fields:[iM.clientId],references:[Zj.clientId]}),session:t(cM,{fields:[iM.sessionId],references:[cM.id]}),user:t(uM,{fields:[iM.userId],references:[uM.id]})})),oM=Yk(`oauth_resource`,{accessTokenTtl:_O(`access_token_ttl`),allowedScopes:J(`allowed_scopes`).array(),createdAt:Tk(`created_at`),customClaims:EO(`custom_claims`),disabled:qD(`disabled`).default(!1),dpopBoundAccessTokensRequired:qD(`dpop_bound_access_tokens_required`).default(!1),id:J(`id`).primaryKey(),identifier:J(`identifier`).notNull().unique(),metadata:EO(`metadata`),name:J(`name`).notNull(),policyVersion:_O(`policy_version`).default(1),refreshTokenTtl:_O(`refresh_token_ttl`),signingAlgorithm:J(`signing_algorithm`),signingKeyId:J(`signing_key_id`),updatedAt:Tk(`updated_at`)}),sM=kA(oM,({many:e})=>({oauthClientResources:e(eM)})),cM=Yk(`session`,{createdAt:Tk(`created_at`).defaultNow().notNull(),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),ipAddress:J(`ip_address`),token:J(`token`).notNull().unique(),updatedAt:Tk(`updated_at`).$onUpdate(()=>new Date).notNull(),userAgent:J(`user_agent`),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[oj(`session_userId_idx`).on(e.userId)]),lM=kA(cM,({many:e,one:t})=>({oauthAccessTokens:e(Yj),oauthRefreshTokens:e(iM),user:t(uM,{fields:[cM.userId],references:[uM.id]})})),uM=Yk(`user`,{createdAt:Tk(`created_at`).defaultNow().notNull(),email:J(`email`).notNull().unique(),emailVerified:qD(`email_verified`).default(!1).notNull(),id:J(`id`).primaryKey(),image:J(`image`),name:J(`name`).notNull(),updatedAt:Tk(`updated_at`).defaultNow().$onUpdate(()=>new Date).notNull()}),dM=kA(uM,({many:e})=>({accounts:e(Gj),oauthAccessTokens:e(Yj),oauthClients:e(Zj),oauthConsents:e(nM),oauthRefreshTokens:e(iM),sessions:e(cM)})),fM=Yk(`verification`,{createdAt:Tk(`created_at`).defaultNow().notNull(),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),identifier:J(`identifier`).notNull(),updatedAt:Tk(`updated_at`).defaultNow().$onUpdate(()=>new Date).notNull(),value:J(`value`).notNull()},e=>[oj(`verification_identifier_idx`).on(e.identifier)]),pM=r({account:()=>Gj,accountRelations:()=>Kj,appRealms:()=>mM,deviceCode:()=>qj,deviceRequests:()=>hM,firstAccounts:()=>gM,jwks:()=>Jj,keys:()=>_M,oauthAccessToken:()=>Yj,oauthAccessTokenRelations:()=>Xj,oauthClient:()=>Zj,oauthClientAssertion:()=>Qj,oauthClientRelations:()=>$j,oauthClientResource:()=>eM,oauthClientResourceRelations:()=>tM,oauthConsent:()=>nM,oauthConsentRelations:()=>rM,oauthRefreshToken:()=>iM,oauthRefreshTokenRelations:()=>aM,oauthResource:()=>oM,oauthResourceRelations:()=>sM,pendingKeys:()=>vM,realmPasskeys:()=>yM,realmPrivy:()=>bM,realmSecp256k1:()=>xM,realms:()=>SM,secp256k1Owners:()=>CM,session:()=>cM,sessionRelations:()=>lM,user:()=>uM,userRelations:()=>dM,verification:()=>fM}),mM=Yk(`app_realms`,{clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),position:_O(`position`).notNull(),realmId:J(`realm_id`).notNull().references(()=>SM.id)},e=>[tj(`app_realms_position_check`,q`${e.position} >= 0`),Xk({columns:[e.clientId,e.position]}),SE(`app_realms_client_id_realm_id_unique`).on(e.clientId,e.realmId)]),hM=Yk(`device_requests`,{account:J(`account`),challenge:J(`challenge`),createdAt:Tk(`created_at`).defaultNow().notNull(),device:J(`device`),expiresAt:Tk(`expires_at`).notNull(),id:J(`id`).primaryKey(),ip:J(`ip`),key:EO(`key`),keyAuthorization:EO(`key_authorization`),location:J(`location`)}),gM=Yk(`first_accounts`,{createdAt:Tk(`created_at`).defaultNow().notNull(),realmId:J(`realm_id`).notNull().references(()=>SM.id,{onDelete:`cascade`}),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[Xk({columns:[e.userId,e.realmId]})]),_M=Yk(`keys`,{address:J(`address`).notNull().unique(),createdAt:Tk(`created_at`).defaultNow().notNull(),id:J(`id`).primaryKey(),publicKey:J(`public_key`).notNull(),rpId:J(`rp_id`).notNull(),source:J(`source`).notNull(),type:J(`type`).notNull(),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[tj(`keys_source_check`,q`${e.source} in ('tempo-id', 'wallet')`),tj(`keys_type_check`,q`${e.type} = 'passkey'`),oj(`keys_user_id_idx`).on(e.userId)]),vM=Yk(`pending_keys`,{account:J(`account`).notNull(),clientId:J(`client_id`).notNull().references(()=>Zj.clientId,{onDelete:`cascade`}),codeChallenge:J(`code_challenge`).notNull(),createdAt:Tk(`created_at`).defaultNow().notNull(),expiresAt:Tk(`expires_at`).notNull(),keyAuthorization:EO(`key_authorization`).notNull(),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[Xk({columns:[e.clientId,e.codeChallenge]})]),yM=Yk(`realm_passkeys`,{createdAt:Tk(`created_at`).defaultNow().notNull(),realmId:J(`realm_id`).primaryKey().references(()=>SM.id,{onDelete:`cascade`}),rpId:J(`rp_id`).notNull().unique()}),bM=Yk(`realm_privy`,{appId:J(`app_id`).notNull().unique(),appSecret:J(`app_secret`).notNull(),createdAt:Tk(`created_at`).defaultNow().notNull(),realmId:J(`realm_id`).primaryKey().references(()=>SM.id,{onDelete:`cascade`})}),xM=Yk(`realm_secp256k1`,{createdAt:Tk(`created_at`).defaultNow().notNull(),realmId:J(`realm_id`).primaryKey().references(()=>SM.id,{onDelete:`cascade`})}),SM=Yk(`realms`,{createdAt:Tk(`created_at`).defaultNow().notNull(),id:J(`id`).primaryKey(),name:J(`name`).notNull()},e=>[tj(`realms_id_check`,q`${e.id} ~ '^[a-z0-9]+(-[a-z0-9]+)*$'`)]),CM=Yk(`secp256k1_owners`,{address:J(`address`).notNull().unique(),createdAt:Tk(`created_at`).defaultNow().notNull(),privateKey:J(`private_key`).notNull(),realmId:J(`realm_id`).notNull().references(()=>SM.id,{onDelete:`cascade`}),userId:J(`user_id`).notNull().references(()=>uM.id,{onDelete:`cascade`})},e=>[Xk({columns:[e.userId,e.realmId]})]);function wM(e){return L(e)}function TM(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function EM(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(e=>typeof e==`string`):t.every(e=>Number.isSafeInteger(e)):!1}function DM(e){if(typeof e!=`function`)throw Error(`function expected`);return!0}function OM(e,t){if(typeof t!=`string`)throw Error(`${e}: string expected`);return!0}function kM(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function AM(e){if(!Array.isArray(e))throw Error(`array expected`)}function jM(e,t){if(!EM(!0,t))throw Error(`${e}: array of strings expected`)}function MM(e,t){if(!EM(!1,t))throw Error(`${e}: array of numbers expected`)}function NM(...e){let t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function PM(e){let t=typeof e==`string`?e.split(``):e,n=t.length;jM(`alphabet`,t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(AM(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(AM(t),t.map(t=>{OM(`alphabet.decode`,t);let n=r.get(t);if(n===void 0)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function FM(e=``){return OM(`join`,e),{encode:t=>(jM(`join.decode`,t),t.join(e)),decode:t=>(OM(`join.decode`,t),t.split(e))}}function IM(e,t=`=`){return kM(e),OM(`padding`,t),{encode(n){for(jM(`padding.encode`,n);n.length*e%8;)n.push(t);return n},decode(n){jM(`padding.decode`,n);let r=n.length;if(r*e%8)throw Error(`padding: invalid, string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if((r-1)*e%8==0)throw Error(`padding: invalid, string has too much padding`);return n.slice(0,r)}}}function LM(e){return DM(e),{encode:e=>e,decode:t=>e(t)}}function RM(e,t,n){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(AM(e),!e.length)return[];let r=0,i=[],a=Array.from(e,e=>{if(kM(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),o=a.length;for(;;){let e=0,s=!0;for(let i=r;i<o;i++){let o=a[i],c=t*e,l=c+o;if(!Number.isSafeInteger(l)||c/t!==e||l-o!==c)throw Error(`convertRadix: carry overflow`);let u=l/n;e=l%n;let d=Math.floor(u);if(a[i]=d,!Number.isSafeInteger(d)||d*n+e!==l)throw Error(`convertRadix: carry overflow`);if(s)d?s=!1:r=i;else continue}if(i.push(e),s)break}for(let t=0;t<e.length-1&&e[t]===0;t++)i.push(0);return i.reverse()}var zM=(e,t)=>t===0?e:zM(t,e%t),BM=(e,t)=>e+(t-zM(e,t)),VM=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function HM(e,t,n,r){if(AM(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw Error(`convertRadix2: wrong to=${n}`);if(BM(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${BM(t,n)}`);let i=0,a=0,o=VM[t],s=VM[n]-1,c=[];for(let r of e){if(kM(r),r>=o)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((i>>a-n&s)>>>0);let e=VM[a];if(e===void 0)throw Error(`invalid carry`);i&=e-1}if(i=i<<n-a&s,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i>0)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function UM(e){return kM(e),{encode:t=>{if(!TM(t))throw Error(`radix.encode input should be Uint8Array`);return RM(Array.from(t),256,e)},decode:t=>(MM(`radix.decode`,t),Uint8Array.from(RM(t,e,256)))}}function WM(e,t=!1){if(kM(e),e<=0||e>32)throw Error(`radix2: bits should be in (0..32]`);if(BM(8,e)>32||BM(e,8)>32)throw Error(`radix2: carry overflow`);return{encode:n=>{if(!TM(n))throw Error(`radix2.encode input should be Uint8Array`);return HM(Array.from(n),8,e,!t)},decode:n=>(MM(`radix2.decode`,n),Uint8Array.from(HM(n,e,8,t)))}}function GM(e){return DM(e),function(...t){try{return e.apply(null,t)}catch{}}}NM(WM(4),PM(`0123456789ABCDEF`),FM(``));var KM=NM(WM(5),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),IM(5),FM(``));NM(WM(5),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),FM(``)),NM(WM(5),PM(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),IM(5),FM(``)),NM(WM(5),PM(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),FM(``)),NM(WM(5),PM(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),FM(``),LM(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var qM=typeof Uint8Array.from([]).toBase64==`function`&&typeof Uint8Array.fromBase64==`function`;qM||NM(WM(6),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),IM(6),FM(``)),NM(WM(6),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),FM(``)),qM||NM(WM(6),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),IM(6),FM(``)),NM(WM(6),PM(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),FM(``));var JM=(e=>NM(UM(58),PM(e),FM(``)))(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`),YM=NM(PM(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),FM(``)),XM=[996825010,642813549,513874426,1027748829,705979059];function ZM(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<XM.length;e++)(t>>e&1)==1&&(n^=XM[e]);return n}function QM(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=ZM(i)^n>>5}i=ZM(i);for(let t=0;t<r;t++)i=ZM(i)^e.charCodeAt(t)&31;for(let e of t)i=ZM(i)^e;for(let e=0;e<6;e++)i=ZM(i);return i^=n,YM.encode(HM([i%VM[30]],30,5,!1))}function $M(e){let t=e===`bech32`?1:734539939,n=WM(5),r=n.decode,i=n.encode,a=GM(r);function o(e,n,r=90){OM(`bech32.encode prefix`,e),TM(n)&&(n=Array.from(n)),MM(`bech32.encode`,n);let i=e.length;if(i===0)throw TypeError(`Invalid prefix length ${i}`);let a=i+7+n.length;if(r!==!1&&a>r)throw TypeError(`Length ${a} exceeds limit ${r}`);let o=e.toLowerCase(),s=QM(o,n,t);return`${o}1${YM.encode(n)}${s}`}function s(e,n=90){OM(`bech32.decode input`,e);let r=e.length;if(r<8||n!==!1&&r>n)throw TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);let a=i.lastIndexOf(`1`);if(a===0||a===-1)throw Error(`Letter "1" must be present between prefix and data only`);let o=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw Error(`Data must be at least 6 characters long`);let c=YM.decode(s).slice(0,-6),l=QM(o,c,t);if(!s.endsWith(l))throw Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:o,words:c}}let c=GM(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}function u(e,t){return o(e,i(t))}return{encode:o,decode:s,encodeFromBytes:u,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}$M(`bech32`),$M(`bech32m`),typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`||NM(WM(4),PM(`0123456789abcdef`),FM(``),LM(e=>{if(typeof e!=`string`||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var eN=2592e3,tN={gracePeriod:eN,jwksPath:`/oauth2/jwks`,keyPairConfig:{alg:`RS256`,modulusLength:2048}},nN={getJwks:async e=>await(await vr(e.context.adapter)).findMany({limit:100,model:`jwks`,sortBy:{direction:`desc`,field:`createdAt`},where:[{connector:`OR`,field:`expiresAt`,value:null},{connector:`OR`,field:`expiresAt`,operator:`gt`,value:new Date(Date.now()-eN*1e3)}]})};async function rN(e,t){let n=(()=>{try{return zn(t.hint).kid}catch{return}})();return n?{keys:(await e.select().from(Jj).where(Y(Jj.id,n)).limit(1)).map(e=>({...JSON.parse(e.publicKey),alg:e.alg??tN.keyPairConfig.alg,kid:e.id}))}:{keys:[]}}var iN=class extends Error{name=`Apps.NotFoundError`;constructor(e){super(`Unknown app ${e.clientId}. Name a registered OAuth app.`)}},aN=`urn:ietf:params:oauth:grant-type:device_code`,oN=`tempo-id:sign`,sN=[`openid`,`profile`,`email`,`offline_access`];async function cN(e,t){let[n]=await e.select({clientSecret:Zj.clientSecret,disabled:Zj.disabled}).from(Zj).where(Y(Zj.clientId,t.clientId)).limit(1);return!n?.clientSecret||n.disabled?!1:fN(await dN(t.clientSecret),n.clientSecret)}async function lN(e,t){return(await e.select({redirectUris:Zj.redirectUris}).from(Zj).where(tA(Y(Zj.skipConsent,!0),nA(uA(Zj.disabled),Y(Zj.disabled,!1))))).some(e=>e.redirectUris.some(e=>{let n=URL.parse(e);return(n?.protocol===`https:`||n?.protocol===`http:`)&&n.origin===t.origin}))}async function uN(e,t){let n=await mN(e,t);if(t.enabled&&n.disabled)throw new iN({clientId:t.clientId});return hN(n)}async function dN(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return d(new Uint8Array(t),{pad:!1,url:!0})}function fN(e,t){let n=fe(e),r=fe(t);if(n.length!==r.length)return!1;let i=0;for(let e=0;e<n.length;e++)i|=n[e]^r[e];return i===0}function pN(e){let{accountStep:t,baseURL:n,pendingKey:r}=e;return[aE({adapter:nN,jwks:tN,jwt:{issuer:n}}),zr({allowDynamicClientRegistration:!1,consentPage:`/authorize`,customIdTokenClaims:e=>e.scopes.includes(`email`)?{email:e.user.email,email_verified:e.user.emailVerified}:{},enforcePerClientResources:!1,loginPage:`/login`,...t?{postLogin:{consentReferenceId:()=>void 0,page:`/choose-account`,shouldRedirect:async e=>{let n=(await ni())?.query,r=n?new URLSearchParams(n).get(`client_id`):null;return r?await t({clientId:r,headers:e.headers,sessionId:e.session.id,userId:e.user.id}):!1}}}:{},...r?{customTokenResponseFields:async e=>{let t=e.verificationValue?.query;if(e.grantType!==`authorization_code`||!t?.code_challenge||t.key_authorization===void 0||!e.user)return{};let n=await r({clientId:t.client_id,codeChallenge:t.code_challenge,userId:e.user.id});return n?{account:n.account,key_authorization:n.keyAuthorization}:{}}}:{},resources:[{accessTokenTtl:300,identifier:n,name:`Tempo ID`}],scopes:[...sN],storeClientSecret:{hash:dN}})]}async function mN(e,t){let[n]=await e.select().from(Zj).where(Y(Zj.clientId,t.clientId));if(!n)throw new iN({clientId:t.clientId});return n}function hN(e){return{clientId:e.clientId,createdAt:e.createdAt,device:(e.grantTypes??[]).includes(aN),name:e.name,postLogoutRedirectUris:e.postLogoutRedirectUris??[],redirectUris:e.redirectUris,secret:!!e.clientSecret,sign:(e.scopes??[]).includes(oN),skipConsent:e.skipConsent??!1,type:e.applicationType===`native`?`native`:`web`}}var gN={error:{color:31,label:`ERROR`},info:{color:32,label:` INFO`},warn:{color:33,label:` WARN`}};function _N(e,t={prefix:``}){return Object.entries(e).flatMap(e=>{let n=`${t.prefix}${e[0]}`,r=e[1];return typeof r==`object`&&r&&!Array.isArray(r)?_N(r,{prefix:`${n}.`}):[[n,r]]})}function vN(e,t){let{message:n,...r}=e,i=gN[t.level],a=_N(r);return[[`\x1b[2m${new Date().toISOString().slice(11,23)}\x1b[0m`,`\x1b[1;${i.color}m${i.label}\x1b[0m`,`\x1b[1m${String(n)}\x1b[0m`,...a.filter(e=>!e[0].endsWith(`stack`)).map(e=>`\x1b[3m${e[0]}\x1b[0m\x1b[2m=\x1b[0m${yN(e[1])}`)].join(` `),...a.filter(e=>e[0].endsWith(`stack`)).flatMap(e=>String(e[1]).split(`
|
|
443
|
+
`)).map(e=>e.replace(/\/node_modules\/\.pnpm\/[^/]+\/node_modules\//,`/node_modules/`).replace(/\((?:\/[^()]*?)?\/((?:node_modules|src)\/[^()]*)\)/,`($1)`)).map(e=>`\x1b[2m ${e}\x1b[0m`)].join(`
|
|
444
|
+
`)}function yN(e){let t=String(e);return/[\s"=]/.test(t)||t===``?JSON.stringify(t):t}function bN(){return!1}function xN(...e){console.error(ON(DN(...e),{level:`error`}))}function SN(...e){console.info(ON(DN(...e),{level:`info`}))}function CN(e){return e.req.matchedRoutes.find(e=>!e.path.includes(`*`))?.path??`/*`}function wN(...e){console.warn(ON(DN(...e),{level:`warn`}))}function TN(e){return Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0))}function EN(e,t={depth:0}){if(!(e instanceof Error))return{name:`NonError`,type:typeof e};let n=(()=>{let t=kN(e,{key:`shortMessage`});if(typeof t==`string`)return t;let n=kN(e,{key:`query`});return typeof n==`string`&&Array.isArray(Reflect.get(e,`params`))?`Failed query: ${n}`:e.message})(),r=kN(e,{key:`status`});return TN({cause:e.cause!==void 0&&t.depth<3?EN(e.cause,{depth:t.depth+1}):void 0,code:kN(e,{key:`code`}),message:n,name:e.name,stack:e.stack?.split(`
|
|
445
|
+
`).filter(e=>/^\s+at /.test(e)).map(e=>e.trim()).join(`
|
|
446
|
+
`),status:typeof r==`number`?r:void 0})}function DN(...e){let[t,n]=e.length===2?e:[void 0,e[0]],{error:r,fields:i,message:a}=n;return TN({...i,error:r===void 0?void 0:EN(r),message:a,request:t?TN({id:t.get(`requestId`),method:t.req.method,path:CN(t)}):void 0})}function ON(e,t){return bN()?vN(e,t):e}function kN(e,t){let n=Reflect.get(e,t.key);return typeof n==`string`||typeof n==`number`?n:void 0}var AN=`https://github.com/tempoxyz/auth/blob/main/docs/errors.md`,jN={already_decided:{description:`The user code was already approved or denied.`,error:`invalid_request`,status:409},approval_pending:{description:`The user has not decided the device code yet.`,error:`authorization_pending`,status:400},authorization_expired:{description:`The app's authorization request that sign-in or the approval page continues is forged or expired.`,error:`invalid_request`,status:400},body_too_large:{description:`The request body exceeds 64 KiB.`,error:`invalid_request`,status:413},challenge_not_permitted:{description:"A request carries a challenge, and its app lacks the `tempo-id:sign` scope.",error:`unauthorized_client`,status:403},cross_site_request:{description:`A form or body-less write came from another site.`,error:`access_denied`,status:403},device_code_expired:{description:`The device code is unknown, expired, or already redeemed.`,error:`expired_token`,status:400},duplicate_limit:{description:`Two limits name the same token.`,error:`invalid_authorization_details`,status:400},duplicate_scope:{description:`Two scopes name the same call on one token.`,error:`invalid_authorization_details`,status:400},empty_limits:{description:"`limits` is an empty list.",error:`invalid_authorization_details`,status:400},empty_scopes:{description:"`scopes` is an empty list.",error:`invalid_authorization_details`,status:400},expiry_exceeds_maximum:{description:`A headless key lasts longer than a year.`,error:`invalid_authorization_details`,status:403},expiry_passed:{description:`The key expiry has passed.`,error:`invalid_authorization_details`,status:400},foreign_account:{description:`The request names a Tempo Account that is not the user's in the app's realms.`,error:`access_denied`,status:403},invalid_chain:{description:`The key chain ID is 0.`,error:`invalid_authorization_details`,status:400},invalid_code:{description:`The emailed code is wrong or expired.`,error:`invalid_grant`,status:401},invalid_expiry:{description:`The key expiry is 0, which never expires.`,error:`invalid_authorization_details`,status:400},invalid_field:{description:`A field is missing or malformed.`,error:`invalid_request`,status:400},invalid_id_token_hint:{description:`The ID token hint is not an ID token that Tempo ID signed for the app.`,error:`invalid_request`,status:400},invalid_origin:{description:`A headless request came from an origin its redirect URI does not allow.`,error:`unauthorized_client`,status:403},invalid_period:{description:"A limit's `period` is not a whole number of seconds.",error:`invalid_authorization_details`,status:400},invalid_public_key:{description:`The key public key is not a valid point.`,error:`invalid_authorization_details`,status:400},invalid_recipients:{description:"A scope's `recipients` names the zero address, or one address twice.",error:`invalid_authorization_details`,status:400},limit_exceeds_maximum:{description:`A headless key limit exceeds the token’s ceiling.`,error:`invalid_authorization_details`,status:403},logout_not_permitted:{description:`The app that the ID token hint names may not end the session at the end-session endpoint.`,error:`unauthorized_client`,status:403},malformed_body:{description:`The request body is not valid JSON.`,error:`invalid_request`,status:400},missing_key:{description:`The key authorization names no key.`,error:`invalid_authorization_details`,status:400},missing_recipients:{description:"An `approve` scope names no spenders.",error:`invalid_authorization_details`,status:400},passkey_link_expired:{description:`The email step's link to a wallet.tempo passkey expired, or the browser holds no link for it.`,error:`invalid_request`,status:400},passkey_not_permitted:{description:`A passkey sign-in names an app, or reaches a realm, that holds no passkeys for Tempo ID.`,error:`unauthorized_client`,status:403},polling_too_fast:{description:`The device polled before its interval passed.`,error:`slow_down`,status:400},post_logout_redirect_not_permitted:{description:`The post-logout redirect URI is not one of the post-logout redirect URIs the app registered.`,error:`invalid_request`,status:400},rate_limited:{description:`Tempo ID, or a service it depends on, is rate limiting the request.`,error:`temporarily_unavailable`,status:429},rejected:{description:`The issuer refused the authorization request.`,error:`invalid_request`,status:400},request_denied:{description:`The user denied the device code.`,error:`access_denied`,status:400},return_to_not_permitted:{description:`The page that a provider sign-in returns to is on neither Tempo ID's origin nor the app's.`,error:`invalid_request`,status:400},scope_without_limit:{description:`A scope calls a token no limit names.`,error:`invalid_authorization_details`,status:400},session_changed:{description:`The signed-in session differs from the one that the approval page showed.`,error:`invalid_request`,status:409},session_required:{description:`The request needs a signed-in session.`,error:`login_required`,status:401},unexpected:{description:`An unexpected failure.`,error:`server_error`,status:500},unknown_code:{description:`The user code is wrong or expired.`,error:`invalid_request`,status:404},unknown_endpoint:{description:`No API endpoint matches this method and path.`,error:`invalid_request`,status:404},unknown_provider:{description:`The sign-in names a provider that Tempo ID does not offer.`,error:`invalid_request`,status:404},unsupported_call:{description:`A scope calls a function a key may not call.`,error:`invalid_authorization_details`,status:400},unsupported_token:{description:`A limit names a token that is not supported on the chain.`,error:`invalid_authorization_details`,status:400},upstream_unavailable:{description:`A service Tempo ID depends on failed or did not respond.`,error:`temporarily_unavailable`,status:503},webauthn_rejected:{description:`A passkey ceremony failed: its challenge is unknown, spent, or expired, or its response does not verify.`,error:`access_denied`,status:401},webauthn_required:{description:`A request without a page names a Tempo Account whose passkey signs only on a Tempo ID page.`,error:`interaction_required`,status:403}},MN=class extends Xv{name=`ErrorResponse.ResponseError`;response;constructor(e){let t=jN[e.reason].status;super(t,{res:Response.json(e,{status:t})}),this.response=e}};function NN(e){return class extends MN{static reason=e;constructor(t){super(VN({...t,reason:e}))}}}var PN=class extends NN(`cross_site_request`){name=`ErrorResponse.CrossSiteRequestError`;constructor(){super({error_description:`Cross-site request refused. Send JSON from an allowed origin.`})}},FN=class extends NN(`malformed_body`){name=`ErrorResponse.MalformedBodyError`;constructor(){super({error_description:"Malformed request body. Send a JSON object with `Content-Type: application/json`."})}},IN=class extends NN(`rate_limited`){name=`ErrorResponse.RateLimitedError`;retryAfter;constructor(e={}){let{retryAfter:t}=e;super({error_description:`Rate limited by an upstream service. Retry ${t?`after ${t} seconds`:`later`}.`,...t?{meta:{retryAfter:t}}:{}}),this.retryAfter=t}},LN=class extends NN(`unexpected`){name=`ErrorResponse.UnexpectedError`;constructor(){super({error_description:`Unexpected error. Try again.`})}},RN=class extends NN(`unknown_endpoint`){name=`ErrorResponse.UnknownEndpointError`;constructor(){super({error_description:`Unknown endpoint. Check the method and path against the API reference at /openapi.json.`})}},zN=class extends NN(`upstream_unavailable`){name=`ErrorResponse.UpstreamUnavailableError`;constructor(){super({error_description:`An upstream service is unavailable. Retry later.`})}},BN;(function(e){let t=e.base=B({error:z().meta({description:"The OAuth error code (RFC 6749, OIDC Core, RFC 8628, RFC 9396), which `reason` determines."}),error_description:z().meta({description:`What went wrong and how to fix it, for people. Its wording may change.`}),error_uri:Yt().meta({description:"The errors page, at the refusal’s `reason`."}),field:z().optional().meta({description:`Extension: the request field at fault, as a dotted path.`}),meta:Rt(z(),zt([Gt(),z()])).readonly().optional().meta({description:`Extension: the values the refusal compared. Base units are decimal strings.`}),reason:z().meta({description:`Extension: a stable name for the refusal, to branch on.`}),request_id:z().optional().meta({description:"Extension: the request ID, which `X-Request-Id` also carries. The Worker adds it to every error response."})}),n={already_decided:{error_description:`Code already approved or denied.`,field:`code`},approval_pending:{error_description:"Approval pending. Poll again after `interval` seconds."},authorization_expired:{error_description:`Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.`,field:`oauth_query`},body_too_large:{error_description:`Invalid request body: exceeds the 65536-byte maximum. Send a body of 65536 bytes or fewer.`},challenge_not_permitted:{error_description:"Challenge not permitted: the app lacks the `tempo-id:sign` scope. Remove `challenge`, or grant the app the scope.",field:`challenge`},cross_site_request:{error_description:`Cross-site request refused. Send JSON from an allowed origin.`},device_code_expired:{error_description:`Device code expired. Request a new code.`},duplicate_limit:{error_description:`Duplicate limit for 0x20c0000000000000000000000000000000000001. Limit each token once.`,field:`key_authorization.limits.1.token`},duplicate_scope:{error_description:`Duplicate scope for 0xa9059cbb on OUSD. Name each call on a token once.`,field:`key_authorization.scopes.1.selector`},empty_limits:{error_description:"Empty `limits`. Name at least one token, or omit `limits`.",field:`key_authorization.limits`},empty_scopes:{error_description:"Empty `scopes`. Name at least one call, or omit `scopes`.",field:`key_authorization.scopes`},expiry_exceeds_maximum:{error_description:"Invalid `expiry`: Sat, 01 Jan 2028 00:00:00 GMT exceeds the one-year maximum. Use an earlier expiry, or authorize through a redirect or device grant.",field:`key_authorization.expiry`},expiry_passed:{error_description:"Invalid `expiry`: Wed, 01 Jan 2025 00:00:00 GMT has passed. Use a future Unix time.",field:`key_authorization.expiry`},foreign_account:{error_description:`Access denied to Tempo Account 0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c. Name one of the user's accounts in the app's realms.`,field:`account`},invalid_chain:{error_description:"Invalid `chainId`: 0. Use a Tempo chain ID, such as 4217.",field:`key_authorization.chainId`},invalid_code:{error_description:`Invalid or expired code. Request a new one.`,field:`code`},invalid_expiry:{error_description:"Invalid `expiry`: 0 never expires. Use a future Unix time.",field:`key_authorization.expiry`},invalid_field:{error_description:"Invalid request. `email`: Invalid email address.",field:`email`},invalid_id_token_hint:{error_description:`Invalid id_token_hint: it is not an ID token that this issuer signed for the app. Send the ID token that the app received at sign-in.`,field:`id_token_hint`},invalid_origin:{error_description:"Invalid `Origin`: https://other.example.com. Requests for this redirect URI must come from https://app.example.com.",field:`Origin`},invalid_period:{error_description:"Invalid `period` on the OUSD limit: 1.5. Use a whole number of seconds, or 0 for a one-time limit.",field:`key_authorization.limits.0.period`},invalid_public_key:{error_description:"Invalid `publicKey`. Provide an uncompressed public key, or `address`.",field:`key_authorization.publicKey`},invalid_recipients:{error_description:`Invalid recipient 0x0000000000000000000000000000000000000000 for 0x095ea7b3 on OUSD. Name each recipient once, and never the zero address.`,field:`key_authorization.scopes.0.recipients.0`},limit_exceeds_maximum:{error_description:`Invalid OUSD limit: 5000 exceeds the 1000 maximum. Lower the limit, or authorize through a redirect or device grant.`,field:`key_authorization.limits.0.limit`},logout_not_permitted:{error_description:`Logout not permitted: the app client_01JZ8Q6W3N1R5B4V7C2X9K0M3T may not end the session. Register the app for logout, then retry.`},malformed_body:{error_description:"Malformed request body. Send a JSON object with `Content-Type: application/json`."},missing_key:{error_description:"Missing `address` or `publicKey`. Provide the access key.",field:`key_authorization.address`},missing_recipients:{error_description:"Missing `recipients` for `approve` on OUSD. Name the allowed spenders.",field:`key_authorization.scopes.0.recipients`},passkey_link_expired:{error_description:`Expired passkey sign-in: the link from the passkey step is no longer valid. Enter the code again to sign in with email only, or sign in with the passkey again.`,field:`link`},passkey_not_permitted:{error_description:`Passkey not permitted: the app client_01JZ8Q6W3N1R5B4V7C2X9K0M3T holds no passkeys. Sign in with an emailed code.`},polling_too_fast:{error_description:"Polling too fast. Add 5 seconds to `interval`."},post_logout_redirect_not_permitted:{error_description:`Invalid post_logout_redirect_uri: https://app.example/elsewhere is not registered for the app. Use one of its post-logout redirect URIs, or leave it out.`,field:`post_logout_redirect_uri`},rate_limited:{error_description:`Too many requests. Retry after 30 seconds.`},rejected:{error_description:"Authorization request rejected. Check `client_id`, `redirect_uri`, and `scope` against the app's registration."},request_denied:{error_description:`The user denied the request.`},return_to_not_permitted:{error_description:`Invalid return_to: https://example.org is not an origin of the app's redirect URIs. Return to a page on one of them, and pass the app's client_id.`,field:`return_to`},scope_without_limit:{error_description:`Scope on 0x20c0000000000000000000000000000000000002 has no limit. Add a limit for it, or remove the scope.`,field:`key_authorization.scopes.0.address`},session_changed:{error_description:`Changed session: the signed-in account differs from the one that this page showed. Reload the page, and check the account before the decision.`,field:`session_id`},session_required:{error_description:`Sign in first.`},unexpected:{error_description:`Unexpected error. Try again.`},unknown_code:{error_description:`Invalid or expired code. Check the code in the terminal.`,field:`code`},unknown_endpoint:{error_description:`Unknown endpoint. Check the method and path against the API reference at /openapi.json.`},unknown_provider:{error_description:`Unknown provider: github is not offered. Request GET /v1/auth/providers for the providers offered.`,field:`provider`},unsupported_call:{error_description:"Unsupported call on OUSD: any function. Use `transfer`, `transferWithMemo`, or `approve`.",field:`key_authorization.scopes.0.selector`},unsupported_token:{error_description:`Unsupported token on chain 4217: 0x20c00000000000000000000000000000000000ff. Use a supported token, such as OUSD.`,field:`key_authorization.limits.0.token`},upstream_unavailable:{error_description:`An upstream service is unavailable. Retry later.`},webauthn_rejected:{error_description:`Passkey rejected. Request new options, then try again with the same passkey or another one.`},webauthn_required:{error_description:`Passkey required: Tempo Account 0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c signs key authorizations only with its passkey, on a Tempo ID page. Authorize through a redirect, popup, or device grant, or name another account.`,field:`key_authorization.account`}},r=new Map(Object.entries(jN).map(([e,r])=>{let i=n[e],a=t.extend({error:Ut(r.error).meta(t.shape.error.meta()),error_description:t.shape.error_description.meta({...t.shape.error_description.meta(),examples:[i.error_description]}),error_uri:t.shape.error_uri.meta({...t.shape.error_uri.meta(),examples:[`${AN}#${e}`]}),reason:Ut(e).meta(t.shape.reason.meta()),request_id:t.shape.request_id.meta({...t.shape.request_id.meta(),examples:[`8f1c2a3b4d5e6f70-SJC`]})});return[e,(i.field?a.extend({field:t.shape.field.meta({...t.shape.field.meta(),examples:[i.field]})}):a.omit({field:!0})).meta({description:`\`${r.error}\` (${r.status}): ${r.description}`,id:`ErrorResponse.${e}`})]}));function i(e){return r.get(e)}e.of=i})(BN||={});function VN(e){let{error_description:t,field:n,meta:r,reason:i}=e;return{error:jN[i].error,error_description:t,error_uri:`${AN}#${i}`,...n?{field:n}:{},...r?{meta:r}:{},reason:i}}function HN(e){if(e instanceof Xv)return;let t=`status`in e?e.status:void 0;if(t===429)return new IN({retryAfter:(()=>{if(e instanceof Response){let t=Number(e.headers.get(`retry-after`));return Number.isInteger(t)&&t>0?t:void 0}return`retryAfter`in e&&typeof e.retryAfter==`number`?e.retryAfter:void 0})()});let n=`status`in e&&t===void 0;if(typeof t==`number`&&(t===408||t>=500)||n||e instanceof Error&&e.name===`TimeoutError`)return new zN}(function(e){e.errors=[IN,zN]})(HN||={});function UN(e,t){if(e instanceof MN)return X(t,e);if(e instanceof Xv&&e.status===400)return X(t,new FN);if(e instanceof Xv&&e.status===403)return X(t,new PN);let n=HN(e);return n?(wN(t,{error:e,message:`An upstream service refused a request.`}),X(t,n)):(xN(t,{error:e,message:`The API failed a request.`}),X(t,new LN))}function X(e,t){let{response:n}=t;return t instanceof IN&&t.retryAfter&&e.header(`retry-after`,String(t.retryAfter)),e.json(n,jN[n.reason].status)}var WN={defaultAdmin:`DEFAULT_ADMIN_ROLE`,pause:`PAUSE_ROLE`,unpause:`UNPAUSE_ROLE`,issuer:`ISSUER_ROLE`,burnBlocked:`BURN_BLOCKED_ROLE`,burnAt:`BURN_AT_ROLE`};function GN(e){return e===`defaultAdmin`?`0x0000000000000000000000000000000000000000000000000000000000000000`:re(Pa(WN[e]??e))}async function KN(e,t){let{abi:n,address:r,args:i,functionName:a,dataSuffix:o=typeof e.dataSuffix==`string`?e.dataSuffix:e.dataSuffix?.value,...s}=t,c=Ca({abi:n,args:i,functionName:a});try{return await nt(e,P,`estimateGas`)({data:`${c}${o?o.replace(`0x`,``):``}`,to:r,...s})}catch(e){let t=s.account?Aa(s.account):void 0;throw _(e,{abi:n,address:r,args:i,docsPath:`/docs/contract/estimateContractGas`,functionName:a,sender:t?.address})}}async function qN(e,t){let{abi:n,address:r,args:i,functionName:a,dataSuffix:o=typeof e.dataSuffix==`string`?e.dataSuffix:e.dataSuffix?.value,...s}=t,c=s.account?Aa(s.account):e.account,l=Ca({abi:n,args:i,functionName:a});try{let{data:u}=await nt(e,Na,`call`)({batch:!1,data:`${l}${o?o.replace(`0x`,``):``}`,to:r,...s,account:c});return{result:ja({abi:n,args:i,functionName:a,data:u||`0x`}),request:{abi:n.filter(e=>`name`in e&&e.name===t.functionName),address:r,args:i,dataSuffix:o,functionName:a,...s,account:c}}}catch(e){throw _(e,{abi:n,address:r,args:i,docsPath:`/docs/contract/simulateContract`,functionName:a,sender:c?.address})}}async function JN(e,{signal:t}={}){return new Promise((n,r)=>{if(t?.aborted){r(da(t));return}let i=()=>t?.removeEventListener(`abort`,o),a=setTimeout(()=>{i(),n()},e),o=()=>{clearTimeout(a),i(),r(da(t))};t?.addEventListener(`abort`,o,{once:!0})})}function YN(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:i}={}){return new Promise((a,o)=>{let s=async({count:c=0}={})=>{if(i?.aborted){o(da(i));return}let l=async({error:e})=>{let n=typeof t==`function`?t({count:c,error:e}):t;if(n)try{await JN(n,{signal:i})}catch(e){o(e);return}return s({count:c+1})};try{a(await e())}catch(e){if(i?.aborted){o(da(i));return}if(va(e)){o(e);return}if(c<n&&await r({count:c,error:e}))return l({error:e});o(e)}};s().catch(o)})}var XN=256,ZN=XN,QN;function $N(e=11){if(!QN||ZN+e>XN*2){QN=``,ZN=0;for(let e=0;e<XN;e++)QN+=(256+Math.random()*256|0).toString(16).substring(1)}return QN.substring(ZN,ZN+++e)}function eP(e){let{batch:t,chain:n,ccipRead:r,dataSuffix:i,key:a=`base`,name:o=`Base Client`,tokens:s,type:c=`base`}=e,l=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime==`number`?`pending`:void 0),u=n?.blockTime??12e3,d=Math.min(Math.max(Math.floor(u/2),500),4e3),f=e.pollingInterval??d,p=e.cacheTime??f,m=e.account?Aa(e.account):void 0,{config:h,request:g,value:_}=e.transport({account:m,chain:n,pollingInterval:f}),v={account:m,batch:t,cacheTime:p,ccipRead:r,chain:n,dataSuffix:i,key:a,name:o,pollingInterval:f,request:g,tokens:s,transport:{...h,..._},type:c,uid:$N(),...l?{experimental_blockTag:l}:{}};function y(e){return t=>{let n=t(e);for(let e in v)delete n[e];let r={...e,...n};for(let t in n){let i=e[t],a=n[t];tP(i)&&tP(a)&&(r[t]={...i,...a})}return Object.assign(r,{extend:y(r)})}}return Object.assign(v,{extend:y(v)})}function tP(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}var nP=new Ia(8192);function rP(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(nP.get(n))return nP.get(n);let r=e().finally(()=>nP.delete(n));return nP.set(n,r),r}function iP(e,t={}){return async(n,r={})=>{let{dedupe:i=!1,methods:o,retryDelay:s=150,retryCount:l=3,signal:u,uid:d}={...t,...r},{method:f}=n;if(o?.exclude?.includes(f)||o?.include&&!o.include.includes(f))throw new O(Error(`method not supported`),{method:f});if(u?.aborted)throw da(u);return rP(()=>YN(async()=>{try{return await e(n,u?{signal:u}:void 0)}catch(e){if(u?.aborted)throw da(u);if(va(e))throw e;let t=e;switch(t.code){case Ce.code:throw new Ce(t);case ye.code:throw new ye(t);case pt.code:throw new pt(t,{method:n.method});case pe.code:throw new pe(t);case ge.code:throw new ge(t);case S.code:throw new S(t);case Te.code:throw new Te(t);case ie.code:throw new ie(t);case Ie.code:throw new Ie(t);case O.code:throw new O(t,{method:n.method});case A.code:throw new A(t);case y.code:throw new y(t);case bt.code:throw new bt(t);case St.code:throw new St(t);case lt.code:throw new lt(t);case Se.code:throw new Se(t);case Ft.code:throw new Ft(t);case a.code:throw new a(t);case Ae.code:throw new Ae(t);case Je.code:throw new Je(t);case c.code:throw new c(t);case ot.code:throw new ot(t);case ae.code:throw new ae(t);case w.code:throw new w(t);case M.code:throw new M(t);case 5e3:throw new bt(t);case Ne.code:throw new Ne(t);default:throw e instanceof Sa?e:new _t(t)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof ca){let e=t?.headers?.get(`Retry-After`);if(e?.match(/\d/))return Number.parseInt(e,10)*1e3}return~~(1<<e)*s},retryCount:l,signal:u,shouldRetry:({error:e})=>aP(e)}),{enabled:i,id:i?oP(`${d}.${ra(n)}`):void 0})}}function aP(e){return va(e)?!1:`code`in e&&typeof e.code==`number`?e.code===-1||e.code===A.code||e.code===ge.code||e.code===429||e.code===-32007:e instanceof ca&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function oP(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function sP(e,{errorInstance:t=Error(`timed out`),timeout:n,signal:r}){return new Promise((i,a)=>{(async()=>{let o,s=new AbortController;try{n>0&&(o=setTimeout(()=>{r?s.abort():a(t)},n)),i(await e({signal:s?.signal||null}))}catch(e){if(s?.signal.aborted&&va(e)){a(t);return}a(e)}finally{clearTimeout(o)}})()})}function cP(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var lP=cP(),uP=10485760;function dP(e,t={}){let{url:n,headers:r}=mP(e);return{async request(e){let{body:i,fetchFn:a=t.fetchFn??fetch,maxResponseBodySize:o=t.maxResponseBodySize??uP,onRequest:s=t.onRequest,onResponse:c=t.onResponse,timeout:l=t.timeout??1e4}=e,u={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:d,method:f,signal:p}=u;try{let{response:e,responseBody:t}=await sP(async({signal:e})=>{let{signal:t,cleanup:m}=fP([p,l>0?e:null]);try{let e={...u,body:ra(Array.isArray(i)?i.map(e=>({jsonrpc:`2.0`,id:e.id??lP.take(),...e})):{jsonrpc:`2.0`,id:i.id??lP.take(),...i}),headers:{...r,"Content-Type":`application/json`,...d},method:f||`POST`,signal:t},l=new Request(n,e),p=await s?.(l,e)??{...e,url:n},m=await a(p.url??n,p);return c&&await c(m),{response:m,responseBody:await pP(m,{maxResponseBodySize:o})}}finally{m()}},{errorInstance:new aa({body:i,url:n}),timeout:l,signal:!0}),m;if(e.headers.get(`Content-Type`)?.startsWith(`application/json`))m=JSON.parse(t);else{m=t;try{m=JSON.parse(m||`{}`)}catch(t){if(e.ok)throw t;m={error:m}}}if(!e.ok){if(typeof m.error?.code==`number`&&typeof m.error?.message==`string`)return m;throw new ca({body:i,details:ra(m.error)||e.statusText,headers:e.headers,status:e.status,url:n})}return m}catch(e){throw p?.aborted?da(p):va(e)||e instanceof ca||e instanceof ma||e instanceof aa?e:new ca({body:i,cause:e,url:n})}}}}function fP(e){let t=e.filter(e=>!!e);if(t.length<2)return{signal:t[0]??null,cleanup:()=>{}};let n=new AbortController,r=()=>{i(),n.abort(t.find(e=>e.aborted)?.reason)},i=()=>{for(let e of t)e.removeEventListener(`abort`,r)};for(let e of t){if(e.aborted){i(),n.abort(e.reason);break}e.addEventListener(`abort`,r)}return{signal:n.signal,cleanup:i}}async function pP(e,{maxResponseBodySize:t}){if(t===!1)return e.text();let n=e.headers.get(`Content-Length`);if(n){let e=Number(n);if(e>t)throw new ma({maxSize:t,size:e})}if(!e.body){let n=await e.text(),r=new TextEncoder().encode(n).length;if(r>t)throw new ma({maxSize:t,size:r});return n}let r=e.body.getReader(),i=new TextDecoder,a=``,o=0;try{for(;;){let{done:e,value:n}=await r.read();if(e)break;if(o+=n.byteLength,o>t)throw await r.cancel(),new ma({maxSize:t,size:o});a+=i.decode(n,{stream:!0})}return a+=i.decode(),a}finally{r.releaseLock()}}function mP(e){try{let t=new URL(e),n=(()=>{if(t.username){let e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username=``,t.password=``,{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}function hP(e,t){return xa(e,t)}function gP(e,t){return _a(e,t)}function _P(e,t){return{amount:e,decimals:t,formatted:hP(e,t)}}function vP(e,t){if(typeof e==`bigint`)return e;let n=e.decimals??t;return gP(e.formatted,yP(n))}function yP(e){if(e===void 0)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}function bP({key:e,methods:t,name:n,request:r,retryCount:i=3,retryDelay:a=150,timeout:o,type:s},c){let l=$N();return{config:{key:e,methods:t,name:n,request:r,retryCount:i,retryDelay:a,timeout:o,type:s},request:iP(r,{methods:t,retryCount:i,retryDelay:a,uid:l}),value:c}}var xP=class extends Sa{constructor(){super(`No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.`,{docsPath:`/docs/clients/intro`,name:`UrlRequiredError`})}},SP=0,CP=new WeakMap;function wP(e){if(!e)return`default`;let t=CP.get(e);if(t!==void 0)return t;let n=SP++;return CP.set(e,n),n}function TP(e,t={}){let{batch:n,fetchFn:r,fetchOptions:i,key:a=`http`,maxResponseBodySize:o,methods:s,name:c=`HTTP JSON-RPC`,onFetchRequest:l,onFetchResponse:u,retryDelay:d,raw:f}=t;return({chain:p,retryCount:m,timeout:h})=>{let{batchSize:g=1e3,wait:_=0}=typeof n==`object`?n:{},v=t.retryCount??m,y=h??t.timeout??1e4,b=e||p?.rpcUrls.default.http[0];if(!b)throw new xP;let x=dP(b,{fetchFn:r,fetchOptions:i,maxResponseBodySize:o,onRequest:l,onResponse:u,timeout:y});return bP({key:a,methods:s,name:c,async request({method:e,params:t},r){let i={method:e,params:t},a=r?.signal?{signal:r.signal}:void 0,{schedule:o}=ka({id:`${b}.${wP(r?.signal)}`,wait:_,shouldSplitBatch(e){return e.length>g},fn:e=>x.request({body:e,fetchOptions:a}),sort:(e,t)=>e.id-t.id}),[{error:s,result:c}]=await(async e=>n?o(e):[await x.request({body:e,fetchOptions:a})])(i);if(f)return{error:s,result:c};if(s)throw new Oa({body:i,error:s,url:b});return c},retryCount:v,retryDelay:d,timeout:y,type:`http`},{fetchOptions:i,url:b})}}async function EP(e,t){return EP.inner(f,e,t)}(function(e){async function t(t,n,r){return await t(n,{...r,...e.call(n,r)})}e.inner=t;function n(...e){let[t,n]=Ct(e),{amount:r,spender:i,token:a}=n,{address:o,decimals:s}=Pe(t,{token:a});return Me({address:o,abi:R,functionName:`approve`,args:[i,vP(r,s)]})}e.call=n;async function r(t,n){return KN(t,{...et(n),...e.call(t,n)})}e.estimateGas=r;async function i(t,n){return qN(t,{...et(n),...e.call(t,n)})}e.simulate=i;function a(e){let[t]=Ye({abi:R,logs:e,eventName:`Approval`});if(!t)throw Error("`Approval` event not found.");return t}e.extractEvent=a})(EP||={});async function DP(e,t){return DP.inner(f,e,t)}(function(e){async function t(t,n,r){let{amount:i,from:a,token:o,...s}=r,c=e.call(n,{amount:i,from:a,token:o});return await t(n,{...s,...c})}e.inner=t;function n(...e){let[t,n]=Ct(e),{from:r,amount:i,token:a}=n,{address:o,decimals:s}=Pe(t,{token:a});return Me({address:o,abi:R,functionName:`burnBlocked`,args:[r,vP(i,s)]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`BurnBlocked`});if(!t)throw Error("`BurnBlocked` event not found.");return t}e.extractEvent=r})(DP||={});async function OP(e,t){return OP.inner(f,e,t)}(function(e){async function t(t,n,r){let{amount:i,from:a,memo:o,token:s,...c}=r,l=e.call(n,{amount:i,from:a,memo:o,token:s});return await t(n,{...c,...l})}e.inner=t;function n(...e){let[t,n]=Ct(e),{amount:r,from:i,memo:a,token:o}=n,{address:s,decimals:c}=Pe(t,{token:o}),l=vP(r,c);if(i)return Me({address:s,abi:R,functionName:`burnAt`,args:[i,l]});let u=a?{functionName:`burnWithMemo`,args:[l,la(a,32)]}:{functionName:`burn`,args:[l]};return Me({address:s,abi:R,...u})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:[`Burn`,`BurnAt`]});if(!t)throw Error("`Burn` or `BurnAt` event not found.");return t}e.extractEvent=r})(OP||={});async function kP(e,t){return kP.inner(f,e,t)}(function(e){async function t(t,n,r){let{policyId:i,token:a,...o}=r,s=e.call(n,{policyId:i,token:a});return await t(n,{...o,...s})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,policyId:i}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`changeTransferPolicyId`,args:[i]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`TransferPolicyUpdate`});if(!t)throw Error("`TransferPolicyUpdate` event not found.");return t}e.extractEvent=r})(kP||={});async function AP(e,t){return AP.inner(f,e,t)}(function(e){async function t(t,n,r){let{account:i=n.account,admin:a=n.account,chain:o=n.chain,...s}=r,c=a?Aa(a):void 0;if(!c)throw Error(`admin is required.`);let l=e.call(n,{...s,admin:c.address});return await t(n,{...r,account:i,chain:o,...l})}e.inner=t;function n(...e){let[t,n]=Ct(e),{name:r,symbol:i,currency:a,logoURI:o,quoteToken:s=Et,admin:c,salt:l=ha(32)}=n;return Me({address:Pt,abi:jt,args:typeof o==`string`?[r,i,a,Pe(t,{token:s}).address,c,l,o]:[r,i,a,Pe(t,{token:s}).address,c,l],functionName:`createToken`})}e.call=n;function r(e){let[t]=Ye({abi:jt,logs:e,eventName:`TokenCreated`,strict:!0});if(!t)throw Error("`TokenCreated` event not found.");return t}e.extractEvent=r})(AP||={});async function jP(e,t){let{account:n,decimals:r,spender:i,token:a,...s}=t,[c,{decimals:l}]=await Promise.all([o(e,{...s,...jP.call(e,{account:n,spender:i,token:a})}),Le(e,{decimals:r,token:a})]);return _P(c,l)}(function(e){function t(...e){let[t,n]=Ct(e);return Me({address:Pe(t,n).address,abi:R,functionName:`allowance`,args:[n.account,n.spender]})}e.call=t})(jP||={});async function MP(e,t){let{account:n=e.account,decimals:r,token:i,...a}=t;if(!n)throw new Qe;let s=Aa(n).address,[c,{decimals:l}]=await Promise.all([o(e,{...a,...MP.call(e,{account:s,token:i})}),Le(e,{decimals:r,token:i})]);return _P(c,l)}(function(e){function t(...e){let[t,n]=Ct(e),r=n.account??t?.account;if(!r)throw new Qe;let i=Aa(r).address;return Me({address:Pe(t,n).address,abi:R,functionName:`balanceOf`,args:[i]})}e.call=t})(MP||={});async function NP(e,t){let{decimals:n,token:r,...i}=t,[a,{decimals:s}]=await Promise.all([o(e,{...i,...NP.call(e,{token:r})}),Le(e,{decimals:n,token:r})]);return _P(a,s)}(function(e){function t(...e){let[t,n]=Ct(e);return Me({address:Pe(t,n).address,abi:R,args:[],functionName:`totalSupply`})}e.call=t})(NP||={});async function PP(e,t){return o(e,{...t,...PP.call(e,t)})}(function(e){function t(...e){let[t,n]=Ct(e),{role:r,token:i}=n;return Me({address:Pe(t,{token:i}).address,abi:R,functionName:`getRoleAdmin`,args:[GN(r)]})}e.call=t})(PP||={});async function FP(e,t){let{account:n=e.account}=t,r=n?Aa(n).address:void 0;if(!r)throw Error(`account is required.`);return o(e,{...t,...FP.call(e,{...t,account:r})})}(function(e){function t(...e){let[t,n]=Ct(e),{account:r,role:i,token:a}=n;return Me({address:Pe(t,{token:a}).address,abi:R,functionName:`hasRole`,args:[r,GN(i)]})}e.call=t})(FP||={});async function IP(e,t){return IP.inner(I,e,t)}(function(e){async function t(t,n,r){return await t(n,{...r,calls:r.roles.map(t=>{let i=e.call(n,{...r,role:t});return{...i,data:Ca(i)}})})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,to:i,role:a}=n,o=GN(a);return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`grantRole`,args:[o,i]})}e.call=n;function r(e){let t=Ye({abi:R,logs:e,eventName:`RoleMembershipUpdated`});if(t.length===0)throw Error("`RoleMembershipUpdated` events not found.");return t}e.extractEvents=r})(IP||={});async function LP(e,t){return LP.inner(f,e,t)}(function(e){async function t(t,n,r){let{amount:i,memo:a,to:o,token:s,...c}=r,l=e.call(n,{amount:i,memo:a,to:o,token:s});return await t(n,{...c,...l})}e.inner=t;function n(...e){let[t,n]=Ct(e),{to:r,amount:i,memo:a,token:o}=n,{address:s,decimals:c}=Pe(t,{token:o}),l=vP(i,c),u=a?{functionName:`mintWithMemo`,args:[r,l,la(a,32)]}:{functionName:`mint`,args:[r,l]};return Me({address:s,abi:R,...u})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`Mint`});if(!t)throw Error("`Mint` event not found.");return t}e.extractEvent=r})(LP||={});async function RP(e,t){return RP.inner(f,e,t)}(function(e){async function t(t,n,r){let{token:i,...a}=r,o=e.call(n,{token:i});return await t(n,{...a,...o})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`pause`,args:[]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`PauseStateUpdate`});if(!t)throw Error("`PauseStateUpdate` event not found.");return t}e.extractEvent=r})(RP||={});async function zP(e,t){return zP.inner(I,e,t)}(function(e){async function t(t,n,r){return await t(n,{...r,calls:r.roles.map(t=>{let i=e.call(n,{...r,role:t});return{...i,data:Ca(i)}})})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,role:i}=n,a=GN(i);return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`renounceRole`,args:[a]})}e.call=n;function r(e){let t=Ye({abi:R,logs:e,eventName:`RoleMembershipUpdated`});if(t.length===0)throw Error("`RoleMembershipUpdated` events not found.");return t}e.extractEvents=r})(zP||={});async function BP(e,t){return BP.inner(I,e,t)}(function(e){async function t(t,n,r){let{from:i,...a}=r;return await t(n,{...a,calls:r.roles.map(t=>{let i=e.call(n,{...r,role:t});return{...i,data:Ca(i)}})})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,from:i,role:a}=n,o=GN(a);return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`revokeRole`,args:[o,i]})}e.call=n;function r(e){let t=Ye({abi:R,logs:e,eventName:`RoleMembershipUpdated`});if(t.length===0)throw Error("`RoleMembershipUpdated` events not found.");return t}e.extractEvents=r})(BP||={});async function VP(e,t){return VP.inner(f,e,t)}(function(e){async function t(t,n,r){let{supplyCap:i,token:a,...o}=r,s=e.call(n,{supplyCap:i,token:a});return await t(n,{...o,...s})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,supplyCap:i}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`setSupplyCap`,args:[i]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`SupplyCapUpdate`});if(!t)throw Error("`SupplyCapUpdate` event not found.");return t}e.extractEvent=r})(VP||={});async function HP(e,t){return HP.inner(f,e,t)}(function(e){async function t(t,n,r){let{adminRole:i,role:a,token:o,...s}=r,c=e.call(n,{adminRole:i,role:a,token:o});return await t(n,{...s,...c})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,role:i,adminRole:a}=n,o=GN(i),s=GN(a);return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`setRoleAdmin`,args:[o,s]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`RoleAdminUpdated`});if(!t)throw Error("`RoleAdminUpdated` event not found.");return t}e.extractEvent=r})(HP||={});async function UP(e,t){return UP.inner(f,e,t)}(function(e){async function t(t,n,r){return await t(n,{...r,...e.call(n,r)})}e.inner=t;function n(...e){let[t,n]=Ct(e),{from:r,memo:i,to:a,token:o}=n,{address:s,decimals:c}=Pe(t,{token:o}),l=vP(n.amount,c),u=i&&r?{functionName:`transferFromWithMemo`,args:[r,a,l,la(i,32)]}:i?{functionName:`transferWithMemo`,args:[a,l,la(i,32)]}:r?{functionName:`transferFrom`,args:[r,a,l]}:{functionName:`transfer`,args:[a,l]};return Me({address:s,abi:R,...u})}e.call=n;async function r(t,n){return KN(t,{...et(n),...e.call(t,n)})}e.estimateGas=r;async function i(t,n){return qN(t,{...et(n),...e.call(t,n)})}e.simulate=i;function a(e){let[t]=Ye({abi:R,logs:e,eventName:`Transfer`});if(!t)throw Error("`Transfer` event not found.");return t}e.extractEvent=a})(UP||={});async function WP(e,t){return WP.inner(f,e,t)}(function(e){async function t(t,n,r){let{token:i,...a}=r,o=e.call(n,{token:i});return await t(n,{...a,...o})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`unpause`,args:[]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`PauseStateUpdate`});if(!t)throw Error("`PauseStateUpdate` event not found.");return t}e.extractEvent=r})(WP||={});async function GP(e,t){return GP.inner(f,e,t)}(function(e){async function t(t,n,r){let{quoteToken:i,token:a,...o}=r,s=e.call(n,{quoteToken:i,token:a});return await t(n,{...o,...s})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r,quoteToken:i}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`setNextQuoteToken`,args:[Pe(t,{token:i}).address]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`NextQuoteTokenSet`});if(!t)throw Error("`NextQuoteTokenSet` event not found.");return t}e.extractEvent=r})(GP||={});async function KP(e,t){return KP.inner(f,e,t)}(function(e){async function t(t,n,r){let{token:i,...a}=r,o=e.call(n,{token:i});return await t(n,{...a,...o})}e.inner=t;function n(...e){let[t,n]=Ct(e),{token:r}=n;return Me({address:Pe(t,{token:r}).address,abi:R,functionName:`completeQuoteTokenUpdate`,args:[]})}e.call=n;function r(e){let[t]=Ye({abi:R,logs:e,eventName:`QuoteTokenUpdate`});if(!t)throw Error("`QuoteTokenUpdateCompleted` event not found.");return t}e.extractEvent=r})(KP||={});var qP=ue({...vt,id:31318,name:`Tempo Devnet`,hardfork:`t3`,blockExplorers:{default:{name:`Tempo Explorer`,url:`https://explore.devnet.tempo.xyz`}},nativeCurrency:{name:`USD`,symbol:`USD`,decimals:6},rpcUrls:{default:{http:[`https://rpc.devnet.tempoxyz.dev`],webSocket:[`wss://rpc.devnet.tempoxyz.dev`]}},testnet:!0}),JP=ue({...vt,id:1337,name:`Tempo`,hardfork:`t3`,nativeCurrency:{name:`USD`,symbol:`USD`,decimals:6},rpcUrls:{default:{http:[`http://localhost:8545`]}}});function YP(e){let{addresses:t,currency:n,decimals:r,name:i,popular:a,symbol:o}=e;function s(e){let s=t[e];if(!s)throw Error(`Token has no address for chain id "${e}".`);return{address:s,currency:n,decimals:r,name:i,popular:a,symbol:o}}return Object.defineProperties(s,{addresses:{enumerable:!0,value:t},currency:{enumerable:!0,value:n},decimals:{enumerable:!0,value:r},name:{enumerable:!0,value:i},popular:{enumerable:!0,value:a},symbol:{enumerable:!0,value:o}})}var XP=YP({addresses:{42431:`0x20c0000000000000000000000000000000000001`},currency:`USD`,decimals:6,name:`AlphaUSD`,symbol:`alphaUSD`}),ZP=YP({addresses:{42431:`0x20c0000000000000000000000000000000000002`},currency:`USD`,decimals:6,name:`BetaUSD`,symbol:`betaUSD`}),QP=YP({addresses:{4217:`0x20c000000000000000000000f047dd7018e50367`},currency:`BRL`,decimals:6,name:`BRLA Token`,symbol:`BRLA`}),$P=YP({addresses:{4217:`0x20c000000000000000000000c412ec89d0c08be5`},currency:`BTC`,decimals:6,name:`Coinbase Wrapped BTC`,symbol:`cbBTC`}),eF=YP({addresses:{4217:`0x20c00000000000000000000042109aef2f8b28e1`},currency:`CHF`,decimals:6,name:`AllUnity CHF`,symbol:`CHFAU`}),tF=YP({addresses:{1:`0x72DFB2E44f59C5AD2bAFE84314E5b99a7cd5075E`,5042:`0x171A4217b86A807A64eB94757Db6849fb4bDbAA0`,5042002:`0xf0C4a4CE82A5746AbAAd9425360Ab04fbBA432BF`,11155111:`0x3a3fe695F684Bf9b9e43CF43C2b895Ea5e392bB3`},currency:`BTC`,decimals:8,name:`Circle Wrapped Bitcoin`,symbol:`cirBTC`}),nF=YP({addresses:{4217:`0x20c0000000000000000000000520792dcccccccc`},currency:`USD`,decimals:6,name:`Cap USD`,symbol:`cUSD`}),rF=YP({addresses:{4217:`0x20c0000000000000000000006fd9a167923ba194`},currency:`USD`,decimals:6,name:`Deel USD`,symbol:`DLUSD`}),iF=YP({addresses:{4217:`0x20c0000000000000000000009a4a4b17e0dc6651`},currency:`EUR`,decimals:6,name:`AllUnity EUR`,symbol:`EURAU`}),aF=YP({addresses:{1:`0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c`,25:`0xA6dE01a2d62C6B5f3525d768f34d276652C554c8`,338:`0x31f7538adb53cF16350e6B0c89d03D91b7D12c46`,480:`0x1C60ba0A0eD1019e8Eb035E6daF4155A5cE2380B`,4801:`0xe479EcA5740Ac65d6E1823bea2f1C08Bc14e954F`,5042:`0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1`,8453:`0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42`,9745:`0x3EE196E78d4d4248b849B8E1C7F44C5457FAFD2C`,43113:`0x5E44db7996c682E92a960b65AC713a54AD815c6B`,43114:`0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD`,84532:`0x808456652fdb597867f38412077A9182bf77359F`,5042002:`0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a`,11155111:`0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4`},currency:`EUR`,decimals:6,name:`EURC`,symbol:`EURC`}),oF=YP({addresses:{4217:`0x20c0000000000000000000001621e21f71cf12fb`,42431:`0x20c000000000000000000000d72572838bbee59c`},currency:`EUR`,decimals:6,name:`Bridged EURC (Stargate)`,symbol:`EURC.e`}),sF=YP({addresses:{4217:`0x20c0000000000000000000003554d28269e0f3c2`},currency:`USD`,decimals:6,name:`Frax USD`,symbol:`frxUSD`}),cF=YP({addresses:{4217:`0x20c0000000000000000000000a6da882d075a4c3`},currency:`GBP`,decimals:6,name:`Agant GBP`,symbol:`GBPA`}),lF=YP({addresses:{4217:`0x20c0000000000000000000005c0bac7cef389a11`},currency:`USD`,decimals:6,name:`Generic USD`,symbol:`GUSD`}),uF=YP({addresses:{4217:`0x20c000000000000000000000ab02d39df30bd17e`},currency:`USD`,decimals:6,name:`InfiniFi USD`,symbol:`iUSD`}),dF=YP({addresses:{1:`0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436`,4217:`0x20c0000000000000000000006a37DA5C996874BE`,8453:`0xB2000000000000000000002fEb517dFeC7415344`},currency:`USD`,decimals:6,name:`OpenUSD`,popular:!0,symbol:`OUSD`}),fF=YP({addresses:{4217:`0x20c0000000000000000000000000000000000000`,42431:`0x20c0000000000000000000000000000000000000`},currency:`USD`,decimals:6,name:`PathUSD`,symbol:`pathUSD`}),pF=YP({addresses:{4217:`0x20c000000000000000000000383a23bacb546ab9`},currency:`USD`,decimals:6,name:`Re Protocol reUSD`,symbol:`reUSD`}),mF=YP({addresses:{4217:`0x20c0000000000000000000007f7ba549dd0251b9`},currency:`USD`,decimals:6,name:`Reservoir Stablecoin`,symbol:`rUSD`}),hF=YP({addresses:{4217:`0x20c000000000000000000000ae247a1130450f09`},currency:`USD`,decimals:6,name:`Stable Coin`,symbol:`SBC`}),gF=YP({addresses:{4217:`0x20c000000000000000000000048c8f36df1c9a4a`},currency:`siUSD`,decimals:6,name:`InfiniFi Staked USD`,symbol:`siUSD`}),_F=YP({addresses:{4217:`0x20c0000000000000000000008ee4fcff88888888`},currency:`stcUSD`,decimals:6,name:`Staked Cap USD`,symbol:`stcUSD`}),vF=YP({addresses:{4217:`0x20c000000000000000000000bd95bfb69fbe6ce3`},currency:`sUSDe`,decimals:6,name:`Staked USDe`,symbol:`sUSDe`}),yF=YP({addresses:{4217:`0x20c0000000000000000000008191667423f70e67`},currency:`syrupUSDC`,decimals:6,name:`Syrup USDC`,symbol:`syrupUSDC`}),bF=YP({addresses:{42431:`0x20c0000000000000000000000000000000000003`},currency:`USD`,decimals:6,name:`ThetaUSD`,symbol:`thetaUSD`}),xF=YP({addresses:{4217:`0x20c000000000000000000000111111111e910f0f`},currency:`USD`,decimals:6,name:`USD1`,symbol:`USD1`}),SF=YP({addresses:{4217:`0x20c0000000000000000000003158081efd85bfc2`},currency:`USD`,decimals:6,name:`USDBridge`,symbol:`USDB`}),CF=YP({addresses:{1:`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`,10:`0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85`,25:`0x3D7F2C478aAfdB65542BCB44bCeeC05849999d2D`,50:`0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1`,51:`0xb5AB69F7bBada22B28e79C8FFAECe55eF1c771D4`,130:`0x078D782b760474a361dDA0AF3839290b0EF57AD6`,137:`0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359`,143:`0x754704Bc059F8C67012fEd69BC8A327a5aafb603`,146:`0x29219dd400f2Bf60E5a23d13Be72B486D4038894`,196:`0xB6CEceAB302E2E4948951eE7843FC24E92933061`,300:`0xAe045DE5638162fa134807Cb558E15A3F5A7F853`,324:`0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4`,338:`0xEb33dc5fac03833e132593659e1dE7256aB59794`,480:`0x79A02482A880bCE3F13e09Da970dC34db4CD24d1`,998:`0x2B3370eE501B4a559b57D449569354196457D8Ab`,999:`0xb88339CB7199b77E23DB6E890353E22632Ba630f`,1301:`0x31d0220469e10c4E71834a79b1f276d740d3768F`,1328:`0x4fCF1784B31630811181f670Aea7A7bEF803eaED`,1329:`0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392`,1439:`0x0C382e685bbeeFE5d3d9C29e29E341fEE8E84C5d`,1672:`0xC879C018dB60520F4355C26eD1a6D572cdAC1815`,1776:`0xa00C59fF5a080D2b954d0c75e46E22a0c371235a`,1952:`0xDec90b78111Ba2fc6FC6d84d8B9ec159A2d4b9B3`,2818:`0xCfb1186F4e93D60E60a8bDd997427D1F33bc372B`,2910:`0x7433b41C6c5e1d58D4Da99483609520255ab661B`,3343:`0x98d2919b9A214E6Fa5384AC81E6864bA686Ad74c`,4801:`0x66145f38cBAC35Ca6F1Dfb4914dF98F1614aeA88`,5042:`0x3600000000000000000000000000000000000000`,8453:`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`,9745:`0x2d661C89D812261039AF9764eceaAee884f5F67F`,10143:`0x534b2f3A21130d7a60830c2Df862319e593943A3`,33431:`0x2d9F7CAD728051AA35Ecdc472a14cf8cDF5CFD6B`,42161:`0xaf88d065e77c8cC2239327C5EDb3A432268e5831`,42220:`0xcebA9300f2b948710d2653dD7B07f33A8B32118C`,43113:`0x5425890298aed601595a70AB815c96711a31Bc65`,43114:`0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E`,57054:`0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6`,57073:`0x2D270e6886d130D724215A266106e6832161EAEd`,59141:`0xFEce4462D57bD51A6A552365A011b95f0E16d9B7`,59144:`0x176211869cA2b568f2A7D4EE941E073a821EE1ff`,64165:`0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51`,80002:`0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582`,81224:`0xd996633a415985DBd7D6D12f4A4343E31f5037cf`,84532:`0x036CbD53842c5426634e7929541eC2318f3dCF7e`,98866:`0x222365EF19F7947e5484218551B56bb3965Aa7aF`,98867:`0xcB5f30e335672893c7eb944B374c196392C19D18`,421614:`0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d`,688689:`0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B`,763373:`0xFabab97dCE620294D2B0b0e46C68964e326300Ac`,812242:`0x6d7f141b6819C2c9CC2f818e6ad549E7Ca090F8f`,5042002:`0x3600000000000000000000000000000000000000`,11142220:`0x01C5C0122039549AD1493B8220cABEdD739BC44E`,11155111:`0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238`,11155420:`0x5fd84259d66Cd46123540766Be93DFE6D43130D7`},currency:`USD`,decimals:6,name:`USD Coin`,popular:!0,symbol:`USDC`}),wF=YP({addresses:{4217:`0x20c000000000000000000000b9537d11c60e8b50`,42431:`0x20c0000000000000000000009e8d7eb59b783726`},currency:`USD`,decimals:6,name:`Bridged USDC (Stargate)`,symbol:`USDC.e`}),TF=YP({addresses:{4217:`0x20c0000000000000000000002f52d5cc21a3207b`},currency:`USD`,decimals:6,name:`USDe`,symbol:`USDe`}),EF=YP({addresses:{4217:`0x20c00000000000000000000014f22ca97301eb73`},currency:`USD`,decimals:6,name:`USDT0`,symbol:`USDT0`}),DF=YP({addresses:{1:`0x136471a34f6ef19fE571EFFC1CA711fdb8E49f2b`,56:`0x8D0fA28f221eB5735BC71d3a0Da67EE5bC821311`,97:`0x109656Aba6F175c634c63C9874f29CeAAAB8E606`,5042002:`0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C`,11155111:`0x38D3A3f8717F4DB1CcB4Ad7D8C755919440848A3`},currency:`USD`,decimals:6,name:`US Yield Coin`,symbol:`USYC`}),OF=YP({addresses:{4217:`0x20c000000000000000000000aeed2ec36a54d0e5`},currency:`wsrUSD`,decimals:6,name:`Wrapped Savings rUSD`,symbol:`wsrUSD`}),kF={all:[XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF],popular:[dF,CF],tempo:[XP,ZP,QP,$P,eF,nF,rF,iF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,wF,TF,EF,OF]},AF=class extends NN(`challenge_not_permitted`){name=`KeyAuthorization.ChallengeNotPermittedError`;constructor(e){let{clientId:t}=e;super({error_description:`Challenge not permitted: the app lacks the \`${oN}\` scope. Remove \`challenge\`, or grant the app the scope.`,field:`challenge`,meta:{client_id:t,scope:oN}})}},jF=class extends NN(`duplicate_limit`){name=`KeyAuthorization.DuplicateLimitError`},MF=class extends NN(`duplicate_scope`){name=`KeyAuthorization.DuplicateScopeError`},NF=class extends NN(`empty_limits`){name=`KeyAuthorization.EmptyLimitsError`},PF=class extends NN(`empty_scopes`){name=`KeyAuthorization.EmptyScopesError`},FF=class extends NN(`expiry_exceeds_maximum`){name=`KeyAuthorization.ExpiryExceedsMaximumError`},IF=class extends NN(`expiry_passed`){name=`KeyAuthorization.ExpiryPassedError`},LF=class extends NN(`invalid_chain`){name=`KeyAuthorization.InvalidChainError`},RF=class extends NN(`invalid_expiry`){name=`KeyAuthorization.InvalidExpiryError`},zF=class extends NN(`invalid_period`){name=`KeyAuthorization.InvalidPeriodError`},BF=class extends NN(`invalid_public_key`){name=`KeyAuthorization.InvalidPublicKeyError`},VF=class extends NN(`invalid_recipients`){name=`KeyAuthorization.InvalidRecipientsError`},HF=class extends NN(`limit_exceeds_maximum`){name=`KeyAuthorization.LimitExceedsMaximumError`},UF=class extends NN(`missing_key`){name=`KeyAuthorization.MissingKeyError`},WF=class extends NN(`missing_recipients`){name=`KeyAuthorization.MissingRecipientsError`},GF=class extends NN(`scope_without_limit`){name=`KeyAuthorization.ScopeWithoutLimitError`},KF=class extends NN(`unsupported_call`){name=`KeyAuthorization.UnsupportedCallError`},qF=class extends NN(`unsupported_token`){name=`KeyAuthorization.UnsupportedTokenError`},JF=class extends NN(`webauthn_required`){name=`KeyAuthorization.WebAuthnRequiredError`;constructor(e){super({error_description:e.description??`Passkey required: Tempo Account ${e.account} signs key authorizations only with its passkey, on a Tempo ID page. Authorize through a redirect, popup, or device grant, or name another account.`,field:`key_authorization.account`,meta:{account:e.account}})}},YF=Bt([`0x`,z().regex(/^[0-9a-fA-F]*$/)]).meta({pattern:`^0x[0-9a-fA-F]*$`}),XF=Bt([`0x`,z().regex(/^[0-9a-fA-F]{40}$/)]).meta({pattern:`^0x[0-9a-fA-F]{40}$`}),ZF=Bt([`0x`,z().regex(/^[0-9a-fA-F]{0,64}$/)]).meta({pattern:`^0x[0-9a-fA-F]{0,64}$`}),QF=Bt([`0x`,z().regex(/^[0-9a-fA-F]{64}$/)]).meta({pattern:`^0x[0-9a-fA-F]{64}$`});function $F(e){return tn(zt([ZF.meta({examples:e.examples}),Kt()]),Kt(),{decode:e=>typeof e==`bigint`?e:e===`0x`?0n:Da(e),encode:e=>oa(e)})}var eI=B({account:Ht(XF).meta({description:`The Tempo Account the key acts for. Defaults to the account selected at sign-in, or else the oldest account.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),address:Ht(XF).meta({description:"The access key's address. Required unless `publicKey` is present.",examples:[`0x81c0f22bd173c115d18eeea0f6a38e935ecf52fb`]}),chainId:Ht($F({examples:[`0x1079`]})).meta({description:`The chain ID the key acts on, as a hex quantity. Defaults to Tempo mainnet.`}),expiry:Ht(Gt()).meta({description:`When the key expires, in Unix seconds. Defaults to one year after the request. A headless request allows at most one year.`,examples:[1893456e3]}),keyType:Ht(Wt([`p256`,`secp256k1`,`webAuthn`])).meta({description:"The signature scheme of the access key. Defaults to `secp256k1`.",examples:[`secp256k1`]}),limits:Ht(en(B({limit:$F({examples:[`0x989680`]}).meta({description:"The most of the token the key may spend, in base units, as a hex quantity. Applies per period when `period` is set."}),period:Ht(Gt()).meta({description:`Seconds after which the limit resets. Omitted or 0 for a one-time limit.`,examples:[86400]}),token:XF.meta({description:`The TIP-20 token the limit applies to.`,examples:[`0x20c0000000000000000000006a37DA5C996874BE`]})})).readonly()).meta({description:`The spending limit on each token. Defaults to the cap of each token the scopes call, or else of OUSD.`}),publicKey:Ht(YF).meta({description:"The access key's uncompressed public key, as hex. Tempo ID derives `address` from it when `address` is absent.",examples:[`0x0438ef39ed22456a6956f380ebc18c50bd18c0402658bc52903817cc8a1e8b2f7ed1da68afc7f343c1debc44c04ac60e62e96bbb261d2226e7a7b96e64fd0f0765`]}),scopes:Ht(en(B({address:XF.meta({description:`The TIP-20 token contract the key may call.`,examples:[`0x20c0000000000000000000006a37DA5C996874BE`]}),recipients:Ht(en(XF).readonly()).meta({description:"The only addresses the call may name as recipient or spender. Required for `approve`.",examples:[[`0xff5deded16eb46018387144ff8bf41f26afb41af`]]}),selector:Ht(zt([YF,z().max(256)])).meta({description:"The function the key may call, as a 4-byte selector or a function signature: `transfer`, `transferWithMemo`, or `approve`. A scope without a selector is refused.",examples:[`0xa9059cbb`,`transfer(address,uint256)`]})})).readonly()).meta({description:"The calls the key may make. Defaults to `transfer` and `transferWithMemo` on each token the key limits."})}),tI;(function(e){e.account=XF.meta({description:`The Tempo Account the key acts for.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),e.request=Ht(eI.transform(vI)).meta({description:"A key authorization for the app's own key: the shape of the Accounts SDK's `wallet_connect` `authorizeAccessKey` capability. Omitted fields default to the headless ceiling.",id:`KeyAuthorizationRequest`}),e.description=B({account:XF.optional().meta({description:`The Tempo Account the request names. Absent when the request names none.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),expiry:Gt().meta({description:`Unix seconds.`,examples:[1893456e3]}),limits:en(B({amount:z().meta({description:`In whole units.`,examples:[`1000`]}),currency:z().meta({description:"The tokens' currency, such as `USD`. A yield-bearing token names its own.",examples:[`USD`]}),period:Gt().optional().meta({description:`Seconds after which the amount resets. Omitted for a one-time limit.`,examples:[86400]}),tokens:en(B({amount:z().meta({description:`The token's own limit, in whole units.`,examples:[`1000`]}),symbol:z().meta({description:`The token's symbol, or its address when the token has no symbol.`,examples:[`OUSD`]})})).readonly().meta({description:`The tokens the amount spans.`})})).readonly().meta({description:`The spending limits, totaled for each currency and period.`})}).meta({description:`What a key authorization grants, for approval screens.`,id:`KeyAuthorizationDescription`});let t=$t(`type`,[B({r:YF.meta({description:"The signature's 32-byte `r` value.",examples:[`0x12fe6a88b99377b94d6a628a86b9df544202c7b03827f44b16ee1a266ab98e17`]}),s:YF.meta({description:"The signature's 32-byte `s` value.",examples:[`0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77`]}),type:Ut(`secp256k1`).meta({description:`A secp256k1 ECDSA signature.`}),v:YF.optional().meta({description:"The legacy recovery value, which `yParity` replaces. Absent in most envelopes.",examples:[`0x1c`]}),yParity:YF.meta({description:"The parity of the y-coordinate of the curve point, `0x0` or `0x1`.",examples:[`0x1`]})}).meta({description:`A secp256k1 signature.`}),B({preHash:Xt().meta({description:`Whether the signer hashed the digest with SHA-256 before signing it, as WebCrypto keys do.`,examples:[!0]}),pubKeyX:YF.meta({description:`The 32-byte x-coordinate of the signer's P256 public key.`,examples:[`0xdae3e3e5faba0a2aca73d4d2a4b84ad46460f3f23af8a60b17b8a13537cfd440`]}),pubKeyY:YF.meta({description:`The 32-byte y-coordinate of the signer's P256 public key.`,examples:[`0x816438c87ffd782cd0e37355eb83fbe1d4e5e905eaafa22fa27c32cc4abf7802`]}),r:YF.meta({description:"The signature's 32-byte `r` value.",examples:[`0x9da52cc71c005844434ce6996f7ea3b3262f84ec3a5d54f1d22d0bba9f2e5ea9`]}),s:YF.meta({description:"The signature's 32-byte `s` value.",examples:[`0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77`]}),type:Ut(`p256`).meta({description:`A P256 (secp256r1) signature.`})}).meta({description:`A P256 signature, with its public key.`}),B({pubKeyX:YF.meta({description:`The 32-byte x-coordinate of the passkey's P256 public key.`,examples:[`0xdae3e3e5faba0a2aca73d4d2a4b84ad46460f3f23af8a60b17b8a13537cfd440`]}),pubKeyY:YF.meta({description:`The 32-byte y-coordinate of the passkey's P256 public key.`,examples:[`0x816438c87ffd782cd0e37355eb83fbe1d4e5e905eaafa22fa27c32cc4abf7802`]}),r:YF.meta({description:"The signature's 32-byte `r` value.",examples:[`0x9da52cc71c005844434ce6996f7ea3b3262f84ec3a5d54f1d22d0bba9f2e5ea9`]}),s:YF.meta({description:"The signature's 32-byte `s` value.",examples:[`0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77`]}),type:Ut(`webAuthn`).meta({description:`A WebAuthn passkey signature.`}),webauthnData:YF.meta({description:"The assertion's authenticator data followed by its `clientDataJSON`, as hex.",examples:[`0xa7cb28053c8ee4e5394fc67a0018dc1c622dad5ce3591b8ca13094ae86d11ba605000000007b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2271334a306257467a6157356e6247567a6157647559585231636d566b6157646c633352765a6d746c65574631644767222c226f726967696e223a2268747470733a2f2f617574682e74656d706f2e78797a222c2263726f73734f726967696e223a66616c73657d`]})}).meta({description:`A WebAuthn signature, with its public key.`})]).meta({description:`A signature by one key, as secp256k1, P256, or WebAuthn.`});e.rpc=B({account:XF.nullable().optional().meta({description:`The Tempo Account the key is bound to (TIP-1049). Absent or null when the key has no account binding.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),allowedCalls:en(B({selectorRules:en(B({recipients:en(XF).readonly().optional().meta({description:`The only addresses the call may name as recipient or spender. Absent when any address may receive.`,examples:[[`0xff5deded16eb46018387144ff8bf41f26afb41af`]]}),selector:YF.meta({description:`The 4-byte selector of the function the key may call.`,examples:[`0xa9059cbb`]})})).readonly().optional().meta({description:`The functions the key may call on the target. Absent when the key may call any function on it.`}),target:XF.meta({description:`The contract the key may call.`,examples:[`0x20c0000000000000000000006a37DA5C996874BE`]})})).readonly().optional().meta({description:`The calls the key may make. Absent when the key may make any call.`}),chainId:YF.meta({description:`The chain ID the key acts on, as a hex quantity.`,examples:[`0xa5bf`]}),expiry:YF.nullable().optional().meta({description:`When the key expires, in Unix seconds, as a hex quantity. Absent or null when the key never expires.`,examples:[`0x6acdc1b4`]}),keyId:XF.meta({description:`The access key's address.`,examples:[`0x81c0f22bd173c115d18eeea0f6a38e935ecf52fb`]}),keyType:z().meta({description:"The signature scheme of the access key: `secp256k1`, `p256`, or `webAuthn`. The node names a configurable account key `multisig`.",examples:[`secp256k1`]}),limits:en(B({limit:YF.meta({description:"The most of the token the key may spend, in base units, as a hex quantity. Applies per period when `period` is set.",examples:[`0x989680`]}),period:YF.optional().meta({description:"Seconds after which the limit resets, as a hex quantity. Absent or `0x0` for a one-time limit.",examples:[`0x15180`]}),token:XF.meta({description:`The TIP-20 token the limit applies to.`,examples:[`0x20c0000000000000000000006a37DA5C996874BE`]})})).readonly().optional().meta({description:`The spending limit on each token. Absent when spending is unlimited. An empty list allows no spending.`}),signature:zt([YF.meta({description:`A configurable account's RLP-encoded signature, which carries its owner approvals.`,examples:[`0xf8a094ff5deded16eb46018387144ff8bf41f26afb41afc0f87cf87a80a012fe6a88b99377b94d6a628a86b9df544202c7b03827f44b16ee1a266ab98e17a04b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77`]}),t,B({keyId:XF.optional().meta({description:"The address of the access key that signed. Recovered from `signature` when absent.",examples:[`0x624f27c462b885a83c698cac444a106a8c519e25`]}),signature:t.meta({description:`The access key's own signature.`}),type:Ut(`keychain`).meta({description:`A signature by an access key for an account.`}),userAddress:XF.meta({description:`The Tempo Account the access key signs for.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),version:Wt([`v1`,`v2`]).optional().meta({description:"The keychain signature version. `v2` binds the signature to `userAddress`. Defaults to `v1`.",examples:[`v2`]})}).meta({description:`An access key signature that wraps a primitive signature.`})]).meta({description:`The owner's signature envelope, in the node's format.`}),witness:QF.optional().meta({description:`The witness the signature binds, when the request sent one.`,examples:[`0xf1e22f902be2546fe35d49388503ef7ea5c6c0e95a0f4b89d474e58793b64dec`]})}).meta({description:`A signed key authorization (TIP-1011), in the node's RPC format.`,id:`KeyAuthorization`})})(tI||={});var nI=31536e3,rI=dF(st.id).address,iI=[st,ke,qP,JP],aI=st.id,oI={BRL:`5000`,BTC:`0.01`,CHF:`800`,EUR:`850`,GBP:`750`,USD:`1000`},sI=new Map(kF.tempo.flatMap(e=>iI.flatMap(t=>{let n=e.addresses,r=n[t.id]??(t.id===JP.id?n[ke.id]:void 0)??(e.symbol===`OUSD`?n[st.id]:void 0);if(!r)return[];let i=oI[e.currency??``]??oI.USD;return[[`${t.id}:${r.toLowerCase()}`,{address:$e(r),cap:le(i,e.decimals),currency:e.currency,decimals:e.decimals,symbol:e.symbol??r}]]}))),cI={approve:wM(`approve(address,uint256)`),transfer:wM(`transfer(address,uint256)`),transferWithMemo:wM(`transferWithMemo(address,uint256,bytes32)`)};function lI(e,t){return t.challenge===void 0?e:{...e,witness:Ot(t.challenge)}}function uI(e){let t=Math.floor(Date.now()/1e3);if(!e.chainId)return new LF({error_description:"Invalid `chainId`: 0. Use a Tempo chain ID, such as 4217.",field:`key_authorization.chainId`,meta:{chain_id:0}});let n=Number(e.chainId);if(!e.address&&!e.publicKey)return new UF({error_description:"Missing `address` or `publicKey`. Provide the access key.",field:`key_authorization.address`});if(e.address===`0x0000000000000000000000000000000000000000`)return new UF({error_description:"Invalid `address`: the zero address holds no key. Provide the address of the access key.",field:`key_authorization.address`});if(e.publicKey&&!CI(e.publicKey))return new BF({error_description:"Invalid `publicKey`. Provide an uncompressed public key, or `address`.",field:`key_authorization.publicKey`});if(!Number.isSafeInteger(e.expiry))return new RF({error_description:`Invalid \`expiry\`: ${e.expiry} is not a whole number of seconds. Use a future Unix time in seconds.`,field:`key_authorization.expiry`,meta:{expiry:e.expiry}});if(e.expiry===0)return new RF({error_description:"Invalid `expiry`: 0 never expires. Use a future Unix time.",field:`key_authorization.expiry`,meta:{expiry:0}});if(e.expiry<=t)return new IF({error_description:`Invalid \`expiry\`: ${SI(e.expiry)} has passed. Use a future Unix time.`,field:`key_authorization.expiry`,meta:{expiry:e.expiry,now:t}});if(!e.limits.length)return new NF({error_description:"Empty `limits`. Name at least one token, or omit `limits`.",field:`key_authorization.limits`});if(!e.scopes.length)return new PF({error_description:"Empty `scopes`. Name at least one call, or omit `scopes`.",field:`key_authorization.scopes`});for(let[t,r]of e.scopes.entries())if(!yI(e,r.address))return new qF({error_description:`Unsupported token on chain ${n}: ${r.address}. Use a supported token, such as OUSD.`,field:`key_authorization.scopes.${t}.address`,meta:{chain_id:n,token:r.address}});let r=new Set;for(let[t,i]of e.limits.entries()){if(r.has(i.token.toLowerCase()))return new jF({error_description:`Duplicate limit for ${i.token}. Limit each token once.`,field:`key_authorization.limits.${t}.token`,meta:{token:i.token}});r.add(i.token.toLowerCase());let a=yI(e,i.token);if(!a)return new qF({error_description:`Unsupported token on chain ${n}: ${i.token}. Use a supported token, such as OUSD.`,field:`key_authorization.limits.${t}.token`,meta:{chain_id:n,token:i.token}});if(i.period!==void 0&&(!Number.isSafeInteger(i.period)||i.period<0))return new zF({error_description:`Invalid \`period\` on the ${a.symbol} limit: ${i.period}. Use a whole number of seconds, or 0 for a one-time limit.`,field:`key_authorization.limits.${t}.period`,meta:{period:i.period,symbol:a.symbol,token:a.address}})}let i=new Set;for(let[t,n]of e.scopes.entries()){let r=e.limits.some(e=>Ze(e.token,n.address))?yI(e,n.address):void 0;if(!r)return new GF({error_description:`Scope on ${n.address} has no limit. Add a limit for it, or remove the scope.`,field:`key_authorization.scopes.${t}.address`,meta:{token:n.address}});let a=n.selector?bI(n.selector):void 0,o=a||(n.selector?`an unknown function`:`any function`);if(a===cI.approve&&!n.recipients?.length)return new WF({error_description:`Missing \`recipients\` for \`approve\` on ${r.symbol}. Name the allowed spenders.`,field:`key_authorization.scopes.${t}.recipients`,meta:{symbol:r.symbol,token:r.address}});if(a!==cI.approve&&a!==cI.transfer&&a!==cI.transferWithMemo)return new KF({error_description:`Unsupported call on ${r.symbol}: ${o}. Use \`transfer\`, \`transferWithMemo\`, or \`approve\`.`,field:`key_authorization.scopes.${t}.selector`,meta:{...a?{selector:a}:{},symbol:r.symbol,token:r.address}});let s=`${r.address.toLowerCase()}:${a}`;if(i.has(s))return new MF({error_description:`Duplicate scope for ${a} on ${r.symbol}. Name each call on a token once.`,field:`key_authorization.scopes.${t}.selector`,meta:{selector:a,symbol:r.symbol,token:r.address}});i.add(s);let c=(n.recipients??[]).map(e=>e.toLowerCase()),l=new Set,u=c.findIndex(e=>e===`0x0000000000000000000000000000000000000000`||l.has(e)?!0:(l.add(e),!1)),d=n.recipients?.[u];if(d)return new VF({error_description:`Invalid recipient ${d} for ${a} on ${r.symbol}. Name each recipient once, and never the zero address.`,field:`key_authorization.scopes.${t}.recipients.${u}`,meta:{recipient:d,symbol:r.symbol,token:r.address}})}}(function(e){e.errors=[jF,MF,NF,PF,IF,LF,RF,zF,BF,VF,UF,WF,GF,KF,qF]})(uI||={});function dI(e){let{app:t,clientId:n,key:r}=e;if(r?.witness&&!t?.sign)return new AF({clientId:n})}(function(e){e.errors=[AF]})(dI||={});function fI(e){let t=uI(e);if(t)return t;let n=Math.floor(Date.now()/1e3),r=Number(e.chainId);if(e.expiry>n+31536e3)return new FF({error_description:`Invalid \`expiry\`: ${SI(e.expiry)} exceeds the one-year maximum. Use an earlier expiry, or authorize through a redirect or device grant.`,field:`key_authorization.expiry`,meta:{expiry:e.expiry,maximum:n+nI}});for(let[t,i]of e.limits.entries()){let a=yI(e,i.token),o=i.period?BigInt(Math.ceil((e.expiry-n)/i.period)):1n,s=i.limit*o;if(s>a.cap)return new HF({error_description:`Invalid ${a.symbol} limit: ${Nt(s,a.decimals)}${o>1n?` over ${o} periods before the key expires`:``} exceeds the ${Nt(a.cap,a.decimals)} maximum. ${o>1n?`Lower the limit or shorten the expiry`:`Lower the limit`}, or authorize through a redirect or device grant.`,field:`key_authorization.limits.${t}.limit`,meta:{chain_id:r,limit:s.toString(),maximum:a.cap.toString(),periods:Number(o),symbol:a.symbol,token:a.address}})}}(function(e){e.errors=[...uI.errors,FF,HF]})(fI||={});function pI(e){let t=new Map;for(let n of e.limits){let r=yI(e,n.token),i=n.period??0,a=`${r.currency}\0${i}`,o=t.get(a);if(!o){t.set(a,{amount:n.limit,currency:r.currency,decimals:r.decimals,period:i,tokens:[{amount:Nt(n.limit,r.decimals),symbol:r.symbol}]});continue}o.tokens.push({amount:Nt(n.limit,r.decimals),symbol:r.symbol});let s=Math.max(o.decimals,r.decimals);o.amount=o.amount*10n**BigInt(s-o.decimals)+n.limit*10n**BigInt(s-r.decimals),o.decimals=s}return{account:e.account,expiry:e.expiry,limits:[...t.values()].map(e=>({amount:Nt(e.amount,e.decimals),currency:e.currency,...e.period?{period:e.period}:{},tokens:e.tokens}))}}function mI(e){let{key:t,...n}=xI(e.key);return Tt({...n,address:t.address,type:t.type,...e.witness?{witness:e.witness}:{}})}function hI(e){let t=`${e.chainId}:`;return[...sI].flatMap(e=>e[0].startsWith(t)?[e[1]]:[])}async function gI(e,t){return Fe(await Be(e,xI(t.key)))}async function _I(e,t){let{metadata:n,signature:r}=Ge(e),i=mI({key:t.key}),a=te(t.publicKey);return await gI(ut({keyType:`webAuthn`,publicKey:a,sign(e){return e.hash===i?Promise.resolve(ze({metadata:{authenticatorData:n.authenticatorData,clientDataJSON:n.clientDataJSON},publicKey:a,signature:r,type:`webAuthn`})):Promise.reject(Error(`The assertion signs another key authorization.`))}}),{key:t.key})}function vI(e){let t=e.chainId??BigInt(aI),n=e.scopes?.length?[...new Set(e.scopes.map(e=>e.address.toLowerCase()))]:[rI.toLowerCase()],r=e.limits??n.map(e=>{let n=sI.get(`${t}:${e}`);return n?{limit:n.cap,token:n.address}:{limit:0n,token:$e(e)}}),i=e.scopes??r.flatMap(e=>[cI.transfer,cI.transferWithMemo].map(t=>({address:e.token,selector:t})));return{...e,chainId:t,expiry:e.expiry??Math.floor(Date.now()/1e3)+31536e3,limits:r,scopes:i}}function yI(e,t){return sI.get(`${Number(e.chainId)}:${t.toLowerCase()}`)}function bI(e){if(/^0x[0-9a-fA-F]{8}$/.test(e))return e.toLowerCase();try{return wM(e)}catch{return}}function xI(e){return{chainId:e.chainId,expiry:e.expiry,key:{address:e.address??CI(e.publicKey),type:e.keyType??`secp256k1`},limits:e.limits,scopes:e.scopes,...e.witness?{witness:e.witness}:{}}}function SI(e){return new Date(e*1e3).toUTCString()}function CI(e){try{return s(F(e))}catch{return}}var wI=class extends NN(`invalid_field`){name=`Validation.InvalidFieldError`;constructor(e){let{issues:t}=e;super({error_description:`Invalid request. ${t.map(e=>`${TI(e)?`\`${TI(e)}\``:`Body`}: ${e.message}.`).join(` `)}`,field:t[0]&&TI(t[0])?TI(t[0]):void 0})}};function TI(e){return(e.path??[]).map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}var EI=class extends NN(`invalid_origin`){name=`Authorize.InvalidOriginError`},DI=class extends NN(`rejected`){name=`Authorize.RejectedError`;constructor(e={}){super({error_description:e.description??"Authorization request rejected. Check `client_id`, `redirect_uri`, and `scope` against the app's registration."})}},OI;(function(e){let t=e.tokens=B({access_token:z().meta({description:`The access token, a JWT that Tempo ID signs. APIs verify it against Tempo ID's JSON Web Key Set.`,examples:[`eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ1c2VyIn0.c2lnbmF0dXJl`]}),expires_in:Gt().meta({description:`Seconds until the access token expires.`,examples:[300]}),id_token:z().optional().meta({description:"The OIDC ID token, a JWT about the user. Absent when the request did not ask for the `openid` scope.",examples:[`eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhcHAifQ.c2lnbmF0dXJl`]}),refresh_token:z().optional().meta({description:"The refresh token, which the app redeems at `/oauth2/token` for new tokens. Absent without the `offline_access` scope.",examples:[`yAjhKk7QnRZ3vD9pLm2Xc8Ws5Tf1Ub4N`]}),token_type:z().meta({description:`The type of the access token (RFC 6749 §7.1).`,examples:[`Bearer`]})}).meta({description:`OAuth tokens for a public app.`,id:`Tokens`}),n=e.challenge=z().min(1).max(1024).optional().meta({description:"A message, such as a sign-in challenge from the app's backend, whose EIP-191 hash becomes the key authorization's `witness` (TIP-1053). Requires `key_authorization`, and the app's `tempo-id:sign` scope.",examples:[`Sign in to app.example.com
|
|
447
|
+
Nonce: 7f3a9c2e5b1d4f60`]});e.request=B({challenge:n,client_id:z().min(1).max(255).meta({description:`The app's client ID.`,examples:[`Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK`]}),code_challenge:z().regex(/^[\w-]{43}$/).optional().meta({description:`The S256 PKCE challenge of a verifier that the app's backend holds (RFC 7636). With one, the app receives a code. Without one, a public app receives tokens.`,examples:[`E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`]}),key_authorization:tI.request,redirect_uri:Yt({protocol:/^(?!(?:blob|data|file|javascript|vbscript)$)[a-z][a-z\d+.-]*$/}).meta({description:`A registered redirect URI of a web app, whose origin the page calls from.`,examples:[`https://app.example.com/callback`]}),scope:z().regex(/^[\w:.-]+( [\w:.-]+)*$/).max(256).optional().meta({description:"Space-separated OAuth scopes. Defaults to `openid`.",examples:[`openid email offline_access`]}),state:z().min(1).max(256).optional().meta({description:`An opaque value that the response returns unchanged, to bind it to the request (RFC 6749 §4.1.1).`,examples:[`af0ifjsldkj`]})}).refine(e=>!e.challenge||e.key_authorization,{message:"A challenge requires `key_authorization`, whose witness binds it",path:[`challenge`]}).transform(e=>e.key_authorization?{...e,key_authorization:lI(e.key_authorization,{challenge:e.challenge})}:e).meta({description:`An app's headless authorization request.`,id:`AuthorizationRequest`}),e.redirect=B({challenge:n,key_authorization:tI.request}).refine(e=>!e.challenge||e.key_authorization,{message:"A challenge requires `key_authorization`, whose witness binds it",path:[`challenge`]}).transform(e=>e.key_authorization?lI(e.key_authorization,{challenge:e.challenge}):void 0),e.response=B({account:tI.account.optional(),code:z().optional().meta({description:"The authorization code, when the request sent a `code_challenge`. The app's backend redeems it at `/oauth2/token`.",examples:[`Vb7mQ2xLkP9sTzR4`]}),key_authorization:tI.rpc.optional(),state:z().optional().meta({description:"The request's `state`, unchanged. Absent when the request sent none.",examples:[`af0ifjsldkj`]}),tokens:t.optional().meta({description:"The tokens, when the request sent no `code_challenge`."})}).meta({description:`An authorization: a code or tokens, with the signed key authorization when the request asks for one.`,id:`Authorization`})})(OI||={});function kI(e,t){let{app:n,origin:r}=t;if(!n||!n.redirectUris.includes(e.redirect_uri))return new DI;if(!n.skipConsent)return new DI({description:"Headless authorization refused: the app is not a first-party app. Send the user to `/oauth2/authorize`, and receive the code at the redirect URI."});if(n.type===`native`)return new DI({description:"Headless authorization refused: a native app's request does not prove which app sends it. Open `/oauth2/authorize` in an authentication sheet, and receive the code at the redirect URI."});let i=new URL(e.redirect_uri);if(r!==i.origin)return new EI({error_description:`Invalid \`Origin\`: ${r??`none`}. Requests for this redirect URI must come from ${i.origin}.`,field:`Origin`,meta:{expected:i.origin,...r?{origin:r}:{}}});let a=e.key_authorization;if(a)return n.secret?new DI({description:`Key authorization refused: the app holds a client secret, which a headless request does not prove. Authorize the key through a redirect or the device grant.`}):fI(a)??dI({app:n,clientId:e.client_id,key:a})}(function(e){e.errors=[...fI.errors,...dI.errors,EI,DI]})(kI||={});function AI(e){let{app:t,clientId:n,codeChallenge:r,key:i}=e;return r?uI(i)??dI({app:t,clientId:n,key:i}):new DI({description:"Key authorization refused: the request names no `code_challenge`, whose verifier receives the key. Send an S256 `code_challenge`."})}(function(e){e.errors=[...uI.errors,...dI.errors,DI]})(AI||={});function jI(e){let t=PI.find(t=>e.getAll(t).length>1);if(t)return new wI({issues:[{message:`Repeated parameter. Send it once`,path:[t]}]});let n=e.get(`key_authorization`),r=OI.redirect.safeParse({challenge:e.get(`challenge`)??void 0,key_authorization:n===null?void 0:FI(n)});return r.success?r.data:new wI({issues:r.error.issues})}function MI(e){if(!e.has(`key_authorization`))return e;let t=new URLSearchParams(e),n=new Set((t.get(`prompt`)??``).split(` `).filter(Boolean));n.add(`consent`),t.set(`prompt`,[...n].join(` `));let[r,...i]=t.getAll(`key_authorization`),a=r&&!i.length?FI(r):void 0;return typeof a==`object`&&a&&!Array.isArray(a)&&!(`expiry`in a)&&t.set(`key_authorization`,At(JSON.stringify({...a,expiry:Math.floor(Date.now()/1e3)+nI}),NI)),t}var NI={pad:!1,url:!0},PI=[`challenge`,`key_authorization`];function FI(e){try{return JSON.parse(p(e))}catch{return null}}var II=class extends NN(`already_decided`){name=`Device.AlreadyDecidedError`;constructor(){super({error_description:`Code already approved or denied.`,field:`code`})}},LI=class extends NN(`approval_pending`){name=`Device.ApprovalPendingError`;constructor(){super({error_description:"Approval pending. Poll again after `interval` seconds."})}},RI=class extends NN(`device_code_expired`){name=`Device.DeviceCodeExpiredError`;constructor(){super({error_description:`Device code expired. Request a new code.`})}},zI=class extends NN(`polling_too_fast`){name=`Device.PollingTooFastError`;constructor(){super({error_description:"Polling too fast. Add 5 seconds to `interval`."})}},BI=class extends NN(`request_denied`){name=`Device.RequestDeniedError`;constructor(){super({error_description:`The user denied the request.`})}},VI=class extends NN(`unknown_code`){name=`Device.UnknownCodeError`;constructor(){super({error_description:`Invalid or expired code. Check the code in the terminal.`,field:`code`})}},HI=`tempo-cli`,UI=`openid email offline_access`,WI=`BCDFGHJKLMNPQRSTVWXZ`;async function GI(e,t){let n=await JI(e,t);if(n&&n.status===`pending`&&!n.userId)return n.clientId}async function KI(e,t){let{challenge:n,device:r,expiresAt:i,id:a,ip:o,location:s}=t,c=t.key?JSON.parse(JSON.stringify(t.key,(e,t)=>typeof t==`bigint`?oa(t):t)):null;await e.insert(hM).values({challenge:n,device:r,expiresAt:i,id:a,ip:o,key:c,location:s})}function qI(e){return`${e.slice(0,4)}-${e.slice(4)}`}async function JI(e,t){let[n]=await e.select({challenge:hM.challenge,clientId:qj.clientId,createdAt:hM.createdAt,device:hM.device,expiresAt:qj.expiresAt,id:qj.id,ip:hM.ip,key:hM.key,location:hM.location,status:qj.status,userCode:qj.userCode,userId:qj.userId}).from(qj).leftJoin(hM,Y(hM.id,qj.id)).where(tA(Y(qj.userCode,t.userCode),iA(qj.expiresAt,new Date)));if(!n?.clientId)return;let r=n.key?OI.redirect.parse({challenge:n.challenge??void 0,key_authorization:n.key}):void 0;return{...n.challenge?{challenge:n.challenge}:{},clientId:n.clientId,createdAt:n.createdAt??new Date(n.expiresAt.getTime()-6e5),...n.device?{device:n.device}:{},id:n.id,...n.ip?{ip:n.ip}:{},...r?{key:r}:{},...n.location?{location:n.location}:{},status:nL(n.status),userCode:qI(n.userCode),...n.userId?{userId:n.userId}:{}}}async function YI(e,t){let{id:n,key:r,userId:i}=t;return(await e.update(hM).set({account:r.account,keyAuthorization:r.keyAuthorization}).where(tA(Y(hM.id,n),uA(hM.keyAuthorization),fA(e.select({id:qj.id}).from(qj).where(tA(Y(qj.id,n),Y(qj.status,`pending`),Y(qj.userId,i),iA(qj.expiresAt,new Date)))))).returning({id:hM.id})).length>0}async function XI(e,t){let{id:n,key:r}=t;await e.update(hM).set({account:null,keyAuthorization:null}).where(tA(Y(hM.id,n),q`${hM.keyAuthorization} = ${JSON.stringify(r.keyAuthorization)}::jsonb`,fA(e.select({id:qj.id}).from(qj).where(tA(Y(qj.id,n),Y(qj.status,`pending`))))))}async function ZI(e,t){let[n]=await e.select({id:qj.id}).from(qj).where(Y(qj.deviceCode,t.deviceCode));return n?.id}function QI(e){let t=e.toUpperCase().replace(/[^A-Z]/g,``);if(!(t.length!==8||[...t].some(e=>!WI.includes(e))))return t}var $I=`/device`;function eL(e,t){if(!e||!e.startsWith(`/`)||/^\/[/\\]/.test(e))return;let n=new URL(t.origin),r=URL.parse(e,n);if(!r||r.origin!==n.origin||r.pathname!==`/device`||r.hash)return;let i=[...r.searchParams.keys()];if(i.length===0)return $I;let[a]=i;if(i.length>1||a!==`code`&&a!==`user_code`)return;let o=QI(r.searchParams.get(a)??``);if(o)return`${$I}?${new URLSearchParams({code:qI(o)})}`}async function tL(e,t){let[n]=await e.delete(hM).where(Y(hM.id,t.id)).returning({account:hM.account,keyAuthorization:hM.keyAuthorization});if(n?.account&&n.keyAuthorization)return{account:n.account,keyAuthorization:n.keyAuthorization}}function nL(e){return e===`approved`||e===`denied`?e:`pending`}var rL=`BCDFGHJKLMNPQRSTVWXZ`,iL=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`;function aL(){return`user_${sL()}`}function oL(){let e=[];for(;e.length<8;)for(let t of crypto.getRandomValues(new Uint8Array(16)))t<240&&e.length<8&&e.push(rL[t%20]);return e.join(``)}function sL(){let e=Date.now();return Array.from({length:10},(t,n)=>{let r=5*(9-n);return iL[Math.floor(e/2**r)%32]}).join(``)+Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>iL[e%32]).join(``)}function cL(e={}){let t=e.challenge??ha(32);return{challenge:t,options:Oe(He({...e,challenge:t}))}}function lL(e,t){let n=Ge(e);return je({...t,metadata:n.metadata,publicKey:F(t.publicKey),signature:n.signature})}function uL(e){return e}function dL(e){return e}function fL(e){let t=e=>Math.floor(e.getTime()/1e3),n=e.map(()=>0),r=[];for(;;){let i=e.reduce((r,i,a)=>{let o=i[n[a]];if(!o)return r;if(r===void 0)return a;let s=e[r][n[r]];return t(o.createdAt)<t(s.createdAt)?a:r},void 0);if(i===void 0)return r;r.push(e[i][n[i]]),n[i]=n[i]+1}}async function pL(e,t){await e.execute(q`select pg_advisory_xact_lock(hashtextextended(${`tempo-account:${t.userId}`}, 0))`)}var mL=class extends NN(`passkey_link_expired`){name=`Passkey.LinkExpiredError`;constructor(){super({error_description:`Expired passkey sign-in: the link from the passkey step is no longer valid. Enter the code again to sign in with email only, or sign in with the passkey again.`,field:`link`})}},hL=class extends NN(`passkey_not_permitted`){name=`Passkey.NotPermittedError`;constructor(e={}){let{clientId:t,origin:n}=e;super(t&&n?{error_description:`Passkey not permitted: no realm of the app ${t} holds passkeys for ${n}. Sign in with an emailed code.`,meta:{client_id:t,origin:n}}:t?{error_description:`Passkey not permitted: the app ${t} holds no passkeys. Sign in with an emailed code.`,meta:{client_id:t}}:{error_description:`Passkey not permitted: no realm holds passkeys for this sign-in. Sign in with an emailed code.`})}},gL=class extends NN(`webauthn_rejected`){name=`Passkey.WebAuthnRejectedError`;constructor(){super({error_description:`Passkey rejected. Request new options, then try again with the same passkey or another one.`})}},_L=`passkey-challenge:`,vL=`passkey-signature:`,yL=nI,bL=`passkey-signature-spent:`,xL;(function(e){let t=z().regex(/^[A-Za-z0-9_-]+$/),n=Bt([`0x`,z().regex(/^[0-9a-fA-F]*$/)]),r=e.credentialId=t.min(1).max(1364);e.assertion=B({id:r.meta({description:`The credential ID of the passkey that signed, base64url.`,examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),metadata:B({authenticatorData:n.meta({description:`The authenticator data the passkey signed, as hex: the relying party ID hash, flags, and signature counter.`,examples:[`0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000`]}),challengeIndex:Gt().int().nonnegative().optional().meta({description:'The character offset of `"challenge"` in `clientDataJSON`. Absent, verification searches for it.',examples:[23]}),clientDataJSON:z().max(4096).meta({description:`The client data the browser collected, as a JSON string, which holds the type, challenge, and origin.`,examples:[`{"type":"webauthn.get","challenge":"9jEFijuhEWrM4SOW-tChJbUEHEP44VcjcJ-Bqo1fTM8","origin":"https://id.tempo.xyz","crossOrigin":false}`]}),typeIndex:Gt().int().nonnegative().optional().meta({description:'The character offset of `"type"` in `clientDataJSON`. Absent, verification searches for it.',examples:[1]}),userVerificationRequired:Xt().optional().meta({description:`Whether the client required user verification. Verification ignores it and always requires user verification.`,examples:[!0]})}).meta({description:"The signed data that verification reads with `signature`, decoded from the browser response."}),raw:B({authenticatorAttachment:z().nullable().default(null).meta({description:"How the authenticator attaches to the client, such as `platform` or `cross-platform`. Defaults to `null` when the browser reports none.",examples:[`platform`]}),id:t.meta({description:`The credential ID, base64url, as the browser returns it.`,examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),rawId:t.meta({description:`The bytes of the credential ID, base64url.`,examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),response:B({clientDataJSON:t.meta({description:`The client data JSON, base64url.`,examples:[`eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiOWpFRmlqdWhFV3JNNFNPVy10Q2hKYlVFSEVQNDRWY2pjSi1CcW8xZlRNOCIsIm9yaWdpbiI6Imh0dHBzOi8vaWQudGVtcG8ueHl6IiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ`]})}).meta({description:"The authenticator's response. Verification keeps only `clientDataJSON` and drops other fields."}),type:z().meta({description:`The credential type.`,examples:[`public-key`]})}).meta({description:"The `PublicKeyCredential` that `navigator.credentials.get()` returns, serialized as JSON."}),signature:n.meta({description:"The P-256 signature over the authenticator data and the client data hash, as 64-byte hex: `r` then `s`.",examples:[`0x6c3f1e0a9b7d24f58e1c3a6b9d0f2e4a7c5b8d1e3f6a9c2b4d7e0f1a3c5b8d9e1f2a7c4b6d8e0f3a5c7b9d1e4f6a8c0b2d5e7f9a1c3b6d8e0f2a4c7b9d1e3f5a`]})}).meta({description:"The assertion, serialized as `webauthx/client` returns it.",id:`PasskeyAssertion`}),e.clientData=B({challenge:t,crossOrigin:Xt().optional()}),e.link=B({address:z(),createdAt:Gt().nullable(),expiresAt:Gt(),host:z(),id:z(),nonce:z(),publicKey:Bt([`0x`,z()]),rpId:z()}),e.signature=B({account:z(),clientId:z(),credential:B({id:z(),publicKey:n,rpId:z()})}),e.step=B({step:B({options:B({publicKey:B({allowCredentials:en(B({id:r.meta({description:`The credential ID of the account's passkey, base64url.`,examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),type:Ut(`public-key`).meta({description:`The credential type.`})}).meta({description:`The passkey that must sign.`})).meta({description:`The account's passkey, the only one the browser offers.`}),challenge:Bt([`0x`,z()]).meta({description:`The key authorization's digest, as hex. It is single-use, and expires after 5 minutes.`,examples:[`0xf6310589abb21116acc6e123967ed0a125b5041c43f8e157237093e07eaa354c`]}),rpId:z().meta({description:`The relying party ID of the account's passkey.`,examples:[`tempo.xyz`]}),userVerification:Ut(`required`).meta({description:`Every passkey signature requires user verification.`})}).meta({description:"The `PublicKeyCredentialRequestOptions`, serialized with the challenge as hex."})}).meta({description:"The options for `navigator.credentials.get()`."}),type:Ut(`passkey`).meta({description:"Sign the options with the passkey, then repeat the approval with `passkey: { assertion }`."})}).meta({description:`The next step: the passkey's signature over the key authorization's digest.`})}).meta({description:`An approval that continues when the passkey signs the key authorization.`,id:`PasskeyStep`}),e.value=B({clientId:z().nullable(),link:z().optional(),origin:z().optional(),realmId:z().optional(),rpId:z(),witness:Bt([`0x`,z()]).optional()})})(xL||={});async function SL(e,t){let n=(t.oneTap?.digest??ya(crypto.getRandomValues(new Uint8Array(32)))).toLowerCase();return await e.insert(fM).values({expiresAt:new Date(Date.now()+3e5),id:crypto.randomUUID(),identifier:_L+n,value:JSON.stringify(xL.value.parse({clientId:t.clientId,link:t.link,origin:t.origin,realmId:t.realmId,rpId:t.rpId,witness:t.oneTap?.witness}))}),n}function CL(e){let{app:t,clientId:n,origin:r}=e;if(!n)return new EI({error_description:`Invalid \`Origin\`: ${r??`none`}. A passkey sign-in from an app's page sends the app's \`client_id\`.`,field:`Origin`,...r?{meta:{origin:r}}:{}});if(!t||!t.skipConsent)return new DI({description:`Passkey sign-in refused: ${n} is not a first-party app. Send the user to \`/oauth2/authorize\`, which offers passkey sign-in.`});if(t.type===`native`)return new DI({description:"Passkey sign-in refused: a native app's request does not prove which app sends it. Open `/oauth2/authorize` in an authentication sheet."});let i=t.redirectUris.flatMap(e=>{let t=URL.parse(e);return t?.protocol===`https:`||t?.protocol===`http:`?[t.origin]:[]});if(!r||!i.includes(r))return new EI({error_description:`Invalid \`Origin\`: ${r??`none`}. Passkey sign-in for ${n} must come from the origin of one of its redirect URIs.`,field:`Origin`,...r?{meta:{origin:r}}:{}})}(function(e){e.errors=[EI,DI]})(CL||={});async function wL(e,t){let[n]=await e.select().from(_M).where(tA(Y(_M.id,t.id),Y(_M.rpId,t.rpId)));return n}async function TL(e,t){let{credential:n,id:r,rpId:i,userId:a}=t;return await e.transaction(async e=>{await pL(e,{userId:a}),await e.insert(yM).values({realmId:`default`,rpId:i}).onConflictDoNothing();let[t]=await e.insert(_M).values({address:n.address.toLowerCase(),...n.createdAt===null?{}:{createdAt:new Date(n.createdAt)},id:r,publicKey:n.publicKey,rpId:i,source:`wallet`,type:`passkey`,userId:a}).onConflictDoNothing().returning({userId:_M.userId});return t?t.userId:(await wL(e,{id:r,rpId:i}))?.userId})}async function EL(e){let t=new TextEncoder,n=await crypto.subtle.importKey(`raw`,t.encode(e),`HKDF`,!1,[`deriveBits`]),r=await crypto.subtle.deriveBits({hash:`SHA-256`,info:t.encode(`tempo-id:passkey-link:v1`),name:`HKDF`,salt:new Uint8Array},n,256);return ya(new Uint8Array(r))}function DL(){return{endpoints:{signInPasskey:hi.serverOnly({body:B({oauth_query:z().optional(),userId:z()}),method:`POST`},async e=>{let t=await e.context.internalAdapter.findUserById(e.body.userId);if(!t)throw Error(`The passkey user is missing.`);let n=await e.context.internalAdapter.createSession(t.id);return await In(e,{session:n,user:t}),e.json({user:{email:t.email,id:t.id}})})},id:`tempo-id-passkey`}}function OL(e,t){let n=[t.origin,t.page].flatMap(e=>e?[new URL(e).hostname]:[]);for(let t of e){let e=t.passkeys?.rpId;if(e!==void 0&&n.every(t=>t===e||t.endsWith(`.${e}`)))return{realmId:t.id,rpId:e}}}async function kL(e,t){let{account:n,clientId:r,credential:i,digest:a,userId:o}=t;await e.insert(fM).values({expiresAt:new Date(Date.now()+3e5),id:crypto.randomUUID(),identifier:NL({account:n,clientId:r,credentialId:i.id,digest:a,userId:o}),value:JSON.stringify(xL.signature.parse({account:n.toLowerCase(),clientId:r,credential:i}))})}async function AL(e,t){return await Dn({data:JSON.stringify(xL.link.parse(e)),key:await EL(t.secret)})}async function jL(e,t){let n=(()=>{try{let e=xL.clientData.parse(JSON.parse(t.clientDataJSON));return g(e.challenge)}catch{return}})();if(!n)return;let[r]=await e.delete(fM).where(tA(Y(fM.identifier,_L+n.toLowerCase()),iA(fM.expiresAt,new Date))).returning({value:fM.value});if(!r)return;let i=xL.value.parse(JSON.parse(r.value));return{challenge:n,clientId:i.clientId,link:i.link,origin:i.origin,realmId:i.realmId,rpId:i.rpId,witness:i.witness}}async function ML(e,t){let n=(()=>{try{let e=xL.clientData.parse(JSON.parse(t.clientDataJSON));return g(e.challenge)}catch{return}})();if(!n)return;let r=bL+v(Fa(t.authenticatorData,t.signature));return await e.transaction(async e=>{await e.execute(q`select pg_advisory_xact_lock(hashtextextended(${r}, 0))`);let[i]=await e.select({id:fM.id}).from(fM).where(tA(Y(fM.identifier,r),iA(fM.expiresAt,new Date))),[a]=await e.delete(fM).where(tA(Y(fM.identifier,NL({...t,digest:n})),iA(fM.expiresAt,new Date))).returning({value:fM.value});if(!a||i)return;let o={...xL.signature.parse(JSON.parse(a.value)),digest:n};if(t.verify(o))return await e.insert(fM).values({expiresAt:new Date(Math.min(Math.max(t.expiry*1e3,Date.now()+3e5),Date.now()+yL*1e3)),id:crypto.randomUUID(),identifier:r,value:`{}`}),o})}function NL(e){return vL+JSON.stringify([e.userId,e.clientId,e.account.toLowerCase(),e.credentialId,e.digest.toLowerCase()])}async function PL(e,t){let n=await bn({data:e,key:await EL(t.secret)}).then(e=>xL.link.safeParse(JSON.parse(e))).catch(()=>void 0);if(n?.success&&n.data.host===t.host&&!(n.data.expiresAt<=Date.now()/1e3))return n.data}function FL(e,t){try{return!xL.clientData.parse(JSON.parse(e.metadata.clientDataJSON)).crossOrigin&&lL({...e,metadata:{...e.metadata,userVerificationRequired:!0}},{challenge:t.challenge,origin:t.origin,publicKey:t.publicKey,rpId:t.rpId})}catch{return!1}}var IL=class extends NN(`authorization_expired`){name=`Auth.AuthorizationExpiredError`;constructor(){super({error_description:`Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.`,field:`oauth_query`})}},LL=class extends NN(`invalid_code`){name=`Auth.InvalidCodeError`;constructor(){super({error_description:`Invalid or expired code. Request a new one.`,field:`code`})}},RL=class extends NN(`session_changed`){name=`Auth.SessionChangedError`;constructor(){super({error_description:`Changed session: the signed-in account differs from the one that this page showed. Reload the page, and check the account before the decision.`,field:`session_id`})}},zL=class extends NN(`session_required`){name=`Auth.SessionRequiredError`;constructor(){super({error_description:`Sign in first.`})}},BL=`tempo-id-session`;function VL(e){let{accountStep:t,baseURL:n,db:r,google:i,pendingKey:a,secret:o,sendCode:s,waitUntil:c}=e;return{account:{updateAccountOnSignIn:!1},advanced:{backgroundTasks:{handler:c},cookies:{session_token:{name:BL}},database:{generateId:e=>e.model===`user`?aL():crypto.randomUUID()},ipAddress:{ipAddressHeaders:[`cf-connecting-ip`]}},basePath:`/`,baseURL:n,database:QA(r,{provider:`pg`,schema:pM}),databaseHooks:{account:{create:{before:()=>Promise.resolve({data:{accessToken:null,accessTokenExpiresAt:null,idToken:null,refreshToken:null,refreshTokenExpiresAt:null}})}},user:{create:{before:e=>Promise.resolve(e.emailVerified===!0)}}},onAPIError:{errorURL:`${n}/login`},plugins:[YT({allowedAttempts:3,expiresIn:600,otpLength:6,sendVerificationOTP:e=>s({code:e.otp,email:e.email}),storeOTP:`hashed`}),DL(),...pN({accountStep:t,baseURL:n,pendingKey:a}),hE({expiresIn:`600s`,generateUserCode:oL,interval:`5s`,verificationUri:$I})],rateLimit:{enabled:!1},secret:o,socialProviders:i?{google:{clientId:i.clientId,clientSecret:i.clientSecret,prompt:`select_account`}}:{}}}var HL=e=>e;async function Z(e,t,n,r){let i=e.var.timing,a=performance.now(),o={closed:1/0,...r?{description:r}:{},duration:0,name:n,opened:i.events++,start:a-i.start};i.spans.push(o);try{return await t}finally{o.closed=i.events++,o.duration=performance.now()-a}}var UL=HL(async(e,t)=>{let n={events:0,spans:[],start:performance.now()};e.set(`timing`,n),await t();let r=performance.now()-n.start,i=WL(n.spans);e.res.headers.append(`server-timing`,[`total;dur=${GL(r)}`,...i.map(KL)].join(`, `)),!bN()&&SN({fields:{duration:GL(r),errorCode:e.var.refusal?.error,method:e.req.method,reason:e.var.refusal?.reason,requestId:e.var.requestId,route:CN(e),spans:i.map(e=>`${e.name};dur=${GL(e.duration)};start=${GL(e.start)}`).join(`, `),status:e.res.status},message:`The Worker timed a request.`})});function WL(e){return e.map((e,t)=>({settles:e.opened-t,span:e})).toSorted((e,t)=>e.settles===t.settles?e.span.closed===t.span.closed?e.span.opened-t.span.opened:e.span.closed>t.span.closed?-1:1:e.settles-t.settles).map(e=>e.span)}function GL(e){return Math.round(e*10)/10}function KL(e){let t=`${e.name};dur=${GL(e.duration)}`;return e.description?`${t};desc="${e.description.replace(/["\\]/g,`\\$&`)}"`:t}var qL=class extends Error{name=`Balance.UnknownChainError`;constructor(e){super(`Unknown chain: ${e.chainId}.`)}},JL=3e3,YL;(function(e){e.balance=B({amount:z().meta({description:`The sum in USD, as a decimal string.`,examples:[`12.5`]}),currency:Ut(`USD`).meta({description:"The currency of `amount`."})}).meta({description:`An account's holdings of USD tokens.`,id:`Balance`})})(YL||={});async function XL(e){let{address:t,chainId:n}=e,r=iI.find(e=>e.id===n);if(!r)throw new qL({chainId:n});let i=eP({chain:r,transport:TP(e.rpcUrl,{batch:!0,retryCount:0,timeout:JL})}),a=hI({chainId:n}).filter(e=>e.currency===`USD`),s=await Promise.all(a.map(async e=>o(i,MP.call({account:t,token:e.address})).catch(e=>{if(ZL(e))return 0n;throw e}))),c=Math.max(0,...a.map(e=>e.decimals)),l=a.reduce((e,t,n)=>e+s[n]*10n**BigInt(c-t.decimals),0n);return{amount:Nt(l,c),currency:`USD`}}function ZL(e){if(!(e instanceof Sa))return!1;let t=e.walk(e=>e instanceof pa);return t instanceof pa&&t.data?.errorName===`Uninitialized`}function QL(e,t){let{accounts:n,chainId:r,rpcUrl:i}=t;return Promise.all(n.map(t=>Z(e,XL({address:t.address,chainId:r,rpcUrl:i}),`Balance.get`).catch(t=>(wN(e,{error:t,fields:{chainId:r},message:`A balance failed to load.`}),null))))}var $L=`Payload Too Large`,eR=e=>{let t=e.onError||(()=>{throw new Xv(413,{res:new Response($L,{status:413})})}),n=e.maxSize;return async function(e,r){if(!e.req.raw.body)return r();let i=e.req.raw.headers.has(`transfer-encoding`);if(e.req.raw.headers.has(`content-length`)&&!i)return parseInt(e.req.raw.headers.get(`content-length`)||`0`,10)>n?t(e):r();let a=0,o=[],s=e.req.raw.body.getReader();for(;;){let{done:r,value:i}=await s.read();if(r)break;if(a+=i.length,a>n)return t(e);o.push(i)}let c={body:new ReadableStream({start(e){for(let t of o)e.enqueue(t);e.close()}}),duplex:`half`};return e.req.raw=new Request(e.req.raw,c),r()}},tR=class extends NN(`body_too_large`){name=`BodyLimit.BodyTooLargeError`;constructor(){super({error_description:`Invalid request body: exceeds the ${rR}-byte maximum. Send a body of ${rR} bytes or fewer.`,meta:{maximum:rR}})}},nR=[tR],rR=65536,iR=eR({maxSize:rR,onError:e=>X(e,new tR)}),aR=e=>e.__COMPOSED_HANDLER?aR(e[yy]):e,oR=(e,t,n)=>{let r=e.req.raw.headers.get(`Cookie`);if(typeof t==`string`){if(!r)return;let e=t;return n===`secure`?e=`__Secure-`+t:n===`host`&&(e=`__Host-`+t),xt(r,e)[e]}return r?xt(r):{}},sR=(e,t,n)=>{let r;return r=n?.prefix===`secure`?at(`__Secure-`+e,t,{path:`/`,...n,secure:!0}):n?.prefix===`host`?at(`__Host-`+e,t,{...n,path:`/`,secure:!0,domain:void 0}):at(e,t,{path:`/`,...n}),r},cR=(e,t,n,r)=>{let i=sR(t,n,r);e.header(`Set-Cookie`,i,{append:!0})},lR=(e,t,n)=>{let r=oR(e,t,n?.prefix);return cR(e,t,``,{...n,maxAge:0}),r},uR=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,dR=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i,fR=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,pR=(e,t)=>async(n,r)=>{let i={},a=n.req.header(`Content-Type`);switch(e){case`json`:if(!a||!uR.test(a))break;try{i=await n.req.json()}catch{throw new Xv(400,{message:`Malformed JSON in request body`})}break;case`form`:{if(!a||!(dR.test(a)||fR.test(a)))break;let e;if(n.req.bodyCache.formData)e=await n.req.bodyCache.formData;else try{e=await Qv(await n.req.arrayBuffer(),a),n.req.bodyCache.formData=e}catch(e){let t=`Malformed FormData request.`;throw t+=e instanceof Error?` ${e.message}`:` ${String(e)}`,new Xv(400,{message:t})}let t=Object.create(null);e.forEach((e,n)=>{n.endsWith(`[]`)?(t[n]??=[]).push(e):Array.isArray(t[n])?t[n].push(e):Object.hasOwn(t,n)?t[n]=[t[n],e]:t[n]=e}),i=t;break}case`query`:i=Object.fromEntries(Object.entries(n.req.queries()).map(([e,t])=>t.length===1?[e,t[0]]:[e,t]));break;case`param`:i=n.req.param();break;case`header`:i=n.req.header();break;case`cookie`:i=oR(n)}let o=await t(i,n);return o instanceof Response?o:(n.req.addValidatedData(e,o),await r())},mR={header:[`cookie`]};function hR(e,t,n){if(!(n in mR))return e;let r=mR[n]||[];return t===`arktype`?gR(e,r):t===`valibot`?_R(e,r):e}function gR(e,t){return e.map(e=>{if(e&&typeof e==`object`&&`data`in e&&typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)){let n={...e.data};for(let e of t)delete n[e];let r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,{data:n}),r}return e})}function _R(e,t){return e.map(e=>{if(e&&typeof e==`object`&&`path`in e&&Array.isArray(e.path)){for(let n of e.path)if(typeof n==`object`&&`input`in n&&typeof n.input==`object`&&n.input!==null&&!Array.isArray(n.input))for(let e of t)delete n.input[e]}return e})}var vR=(e,t,n)=>pR(e,async(r,i)=>{let a=await t[`~standard`].validate(r);if(n){let t=await n(a.issues?{data:r,error:a.issues,success:!1,target:e}:{data:r,success:!0,target:e},i);if(t){if(t instanceof Response)return t;if(typeof t==`object`&&`response`in t)return t.response}}if(a.issues){let n=hR(a.issues,t[`~standard`].vendor,e);return i.json({data:r,error:n,success:!1},400)}return a.value}),yR=Symbol(`openapi`),bR=`__HonoOpenAPIValidator__`,xR=[`GET`,`PUT`,`POST`,`DELETE`,`OPTIONS`,`HEAD`,`PATCH`,`TRACE`],SR=e=>{let t=e;if(t.startsWith(`:`)){let e=t.match(/^:([^{?]+)(?:{(.+)})?(\?)?$/);e?t=`{${e[1]}}`:(t=t.slice(1,t.length),t.endsWith(`?`)&&(t=t.slice(0,-1)),t=`{${t}}`)}return t},CR=e=>e.split(`/`).map(SR).join(`/`),wR=e=>e.split(/[\W_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``),TR=e=>{let t=e.method.toLowerCase();if(e.path===`/`)return`${t}Index`;for(let n of e.path.split(`/`)){let e=SR(n);e.charCodeAt(0)===123?t+=`By${wR(e.slice(1,-1))}`:t+=wR(e)}return t},ER=e=>`$ref`in e?e.$ref:`${e.in} ${e.name}`;function DR(...e){let t=e.flatMap(e=>e??[]).reduce((e,t)=>(e.set(ER(t),t),e),new Map);return Array.from(t.values())}var OR=new Map;function kR(e,t){let n=[];for(let[r,i]of t){if(!i)continue;let t=r.endsWith(`/*`)?r.slice(0,-2):r;(e===t||e.startsWith(`${t}/`))&&n.push(i)}return n}function AR(e,t){return!e||!t||`$ref`in e||`$ref`in t?t:{...e,...t,content:{...e.content,...t.content}}}function jR(e,...t){return t.reduce((t,n)=>{if(!n||!t)return t;for(let[r,i]of Object.entries(n))if(i!=null){if(r in t&&(typeof i==`object`||typeof i==`function`&&r===`operationId`)){if(Array.isArray(i)){let e=[...t[r]??[],...i];t[r]=r===`tags`?Array.from(new Set(e)):r===`parameters`?DR(e):e}else typeof i==`function`?t[r]=i(e):r===`parameters`?t[r]=DR(t[r],i):r===`requestBody`?t.requestBody=AR(t.requestBody,i):t[r]={...t[r],...i}}else t[r]=i}return t},{operationId:TR(e)})}function MR({route:e,specs:t,paths:n},r=OR){let i=CR(e.path),a=e.method.toLowerCase();if(a===`all`){if(!t)return;if(r.has(i)){let n=r.get(i)??{};r.set(i,jR(e,n,t))}else r.set(i,t)}else{let o=kR(i,r);i in n||(n[i]={}),n[i]&&(n[i][a]=jR(e,...o,n[i]?.[a],t))}}function NR(e,t){let{exclude:n,excludeStaticFile:r}=t.options,i={},a=Array.isArray(n)?n:[n];for(let[n,o]of Object.entries(e)){if(o==null||a.some(e=>typeof e==`string`?n===e:e.test(n))||n.includes(`*`)&&!n.includes(`{`))continue;if(r){let e=n.includes(`{`),t=(n.split(`/`).pop()||``).includes(`.`);if(!e&&t)continue}for(let e of Object.keys(o)){let r=o[e];if(r==null)continue;let i=r[bR]===!0;if(delete r[bR],n.includes(`{`)){r.parameters=r.parameters?[...r.parameters]:[];let e=n.split(`/`).filter(e=>e.startsWith(`{`)&&!r.parameters.find(t=>t.in===`path`&&t.name===e.slice(1,e.length-1)));for(let n of e){let e=n.slice(1,n.length-1);r.parameters.findIndex(n=>{if(`$ref`in n){let r=n.$ref.split(`/`).pop();if(r){let n=t.components.parameters?.[r];if(n&&!(`$ref`in n))return n.in===`path`&&n.name===e}return!1}return n.in===`path`&&n.name===e})===-1&&r.parameters.push({schema:{type:`string`},in:`path`,name:e,required:!0})}}if(r.responses||={200:{}},i&&t.options.defaultValidationErrorResponse!==!1&&!r.responses[400]){let e=t.options.defaultValidationErrorResponse;typeof e==`object`?r.responses[400]=structuredClone(e):t.validationErrorResponse&&(r.responses[400]=structuredClone(t.validationErrorResponse))}}let e={};for(let t of Object.keys(o))o[t]!=null&&(e[t]=o[t]);Object.keys(e).length>0&&(i[n]=e)}return i}var PR={documentation:{},excludeStaticFile:!0,exclude:[],excludeMethods:[`OPTIONS`],excludeTags:[],defaultValidationErrorResponse:!0},FR={description:`Validation Error`,content:{"application/json":{schema:{type:`object`,properties:{success:{type:`boolean`,enum:[!1]},error:{type:`array`,items:{}},data:{}},required:[`success`,`error`,`data`]}}}};async function IR(e,t=PR,n){let r={components:{},options:{...PR,...t},validationErrorResponse:FR},i=r.options.documentation??{},a={...i,components:i.components&&{...i.components}},o=await LR(e,r);for(let e in o)for(let t in o[e])RR({valueOrFunc:o[e][t]?.hide,method:t,path:e,c:n})&&(o[e][t]=void 0);let s=a.components?.responses?await UR(a.components.responses):void 0;s&&a.components&&(a.components.responses=s.responses);let c=GR(a.components,s?.components,r.components);return{openapi:`3.1.0`,...a,tags:a.tags?.filter(e=>!r.options.excludeTags?.includes(e?.name)),info:{title:`Hono Documentation`,description:`Development documentation`,version:`0.0.0`,...a.info},paths:{...NR(o,r),...a.paths},components:c}}async function LR(e,t){let n={},r=new Map;for(let i of e.routes){let e=aR(i.handler)[yR];if(!e){t.options.includeEmptyPaths&&MR({route:i,paths:n},r);continue}let a=i.method;if(a!==`ALL`&&(t.options.excludeMethods?.includes(a)||!xR.includes(a)))continue;let{schema:o,components:s={}}=await zR(e,t.options.defaultOptions?.[a]&&{...t.options.defaultOptions[a]},t.components.parameters);t.components=GR(t.components,s),MR({route:i,specs:o,paths:n},r)}return n}function RR(e){let{valueOrFunc:t,c:n,method:r,path:i}=e;if(t!=null){if(typeof t==`boolean`)return t;if(typeof t==`function`)return t({c:n,method:r,path:i})}return!1}async function zR(e,t,n){if(`spec`in e){let n={...t,...e.spec,responses:{...t?.responses,...e.spec.responses}},r={};if(n.responses){let e=await UR(n.responses);n.responses=e.responses,r=e.components}if(n.requestBody&&`content`in n.requestBody){let e=await HR(n.requestBody.content);n.requestBody={...n.requestBody,content:e.content},r=GR(r,e.components)}return{schema:n,components:r}}let r=await e.toOpenAPISchema();WR(r);let i={...t,[bR]:!0};if(e.target===`form`||e.target===`json`){let t=e.options?.media??(e.target===`json`?`application/json`:`multipart/form-data`);!i.requestBody||!(`content`in i.requestBody)||!i.requestBody.content?i.requestBody={required:!0,content:{[t]:{schema:r.schema}}}:i.requestBody.content[t]={schema:r.schema}}else{let t=[];if(`$ref`in r.schema){let i=r.schema.$ref.split(`/`).pop();if(i&&r.components?.schemas?.[i]){let a=r.components.schemas[i],o=BR(e.target,a,r.components.schemas),s=o.length===1?o[0]:void 0,c=n?.[i];s&&(!c||`in`in c&&c.in===s.in&&c.name===s.name)?(r.components.parameters??={},r.components.parameters[i]=s,t.push({$ref:`#/components/parameters/${i}`}),delete r.components.schemas[i]):t=o}}else t=BR(e.target,r.schema,r.components?.schemas);i.parameters=t}return{schema:i,components:r.components}}function BR(e,t,n){let r=[];for(let[i,a]of VR(t,n)){let t={in:e===`param`?`path`:e,name:i,schema:a.schema};a.required&&(t.required=!0),t.schema&&`description`in t.schema&&t.schema.description&&(t.description=t.schema.description,t.schema={...t.schema,description:void 0}),r.push(t)}return r}function VR(e,t){let n=new Map,r=new Set,i=e=>{for(let[t,r]of Object.entries(e.properties??{})){let i=n.get(t);n.set(t,{schema:i?{allOf:[i.schema,r]}:r,required:!!e.required?.includes(t)||i?.required})}for(let n of e.allOf??[])if(`$ref`in n){if(!n.$ref.startsWith(`#/components/schemas/`))continue;let e=n.$ref.slice(21).replaceAll(`~1`,`/`).replaceAll(`~0`,`~`),a=t?.[e];a&&!r.has(e)&&(r.add(e),i(a),r.delete(e))}else i(n)};return i(e),n}async function HR(e){let t={},n={};for(let[r,i]of Object.entries(e))if(i){if(i.schema&&`toOpenAPISchema`in i.schema){let e=await i.schema.toOpenAPISchema();WR(e),n[r]={...i,schema:e.schema},e.components&&(t=GR(t,e.components))}else n[r]=i}return{content:n,components:t}}async function UR(e){let t={},n={};for(let[r,i]of Object.entries(e)){if(!i||!(`content`in i)||!i.content){n[r]=i;continue}let e=await HR(i.content);n[r]={...i,content:e.content},t=GR(t,e.components)}return{responses:n,components:t}}function WR(e){let t=e.schema.$defs;t&&typeof t==`object`&&(e.components??={},e.components.schemas={...t,...e.components.schemas},delete e.schema.$defs)}function GR(...e){return e.reduce((e,t,n)=>(t==null||n===0||((e.schemas&&Object.keys(e.schemas).length>0||t.schemas&&Object.keys(t.schemas).length>0)&&(e.schemas={...e.schemas,...t.schemas}),(e.parameters&&Object.keys(e.parameters).length>0||t.parameters&&Object.keys(t.parameters).length>0)&&(e.parameters={...e.parameters,...t.parameters})),e),e[0]??{})}var KR=e=>e.base,qR=e=>{e.zodSchema._zod.def.type===`date`&&(e.jsonSchema.type=`string`,e.jsonSchema.format=`date-time`)};function JR(e,t){let n=e[`~standard`].vendor;return{vendor:n,validate:e[`~standard`].validate,toJSONSchema:n=>Xa(e,{...t,...n}),toOpenAPISchema:r=>Za(e,{...t,...r,...n===`arktype`?YR(t,r):void 0,...n===`zod`?XR(e,t,r):void 0})}}function YR(e,t){let n=e?.options,r=t?.options;if(!(e?.fallback||n?.fallback||t?.fallback||r?.fallback))return{options:{fallback:KR,...n,...r}}}function XR(e,t,n){if(!(`_zod`in e))return;let r=t?.options,i=n?.options;if(!(t?.override||r?.override||n?.override||i?.override))return{options:{unrepresentable:`any`,override:qR,...r,...i}}}function ZR(e,t,n,r){let i=vR(e,t,n);return Object.defineProperty(i,"name",{value:`validator`,configurable:!0}),Object.assign(i,{[yR]:{target:e,...JR(t,r),options:r}})}function QR(e){let t=async(e,t)=>{await t()};return Object.defineProperty(t,"name",{value:`describeRoute`,configurable:!0}),Object.assign(t,{[yR]:{spec:e}})}var $R={options:{override:e=>{let{jsonSchema:t}=e;delete t.readOnly;let n=t.anyOf?.filter(e=>Object.keys(e).length>0);n&&n.length!==t.anyOf.length&&(n.length===1?(delete t.anyOf,Object.assign(t,n[0])):t.anyOf=n)},unrepresentable:`any`}},ez={integrity:`sha384-U11tb2XnKvmwt8RlTvnwUnYgrN+ur4Xyh9htLhjajWNR/Oyl5AX5DEz00qRmlrmK`,src:`https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.72.1/dist/browser/standalone.js`},tz={description:"Tempo ID signs users in to Tempo apps, authorizes apps for them, and signs key authorizations on their Tempo Accounts. Every refusal is an OAuth error response (RFC 6749 §5.2) whose `reason` determines its `error` and status.",title:`Tempo ID`,version:`0.0.0`};function nz(e){let t=lz.get(e);if(t)return t;let n=uz(e);return lz.set(e,n),n.catch(()=>lz.delete(e)),n}var rz=`<!doctype html>
|
|
448
|
+
<html lang="en">
|
|
449
|
+
<head>
|
|
450
|
+
<meta charset="utf-8" />
|
|
451
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
452
|
+
<title>Tempo ID API</title>
|
|
453
|
+
</head>
|
|
454
|
+
<body>
|
|
455
|
+
<script id="api-reference" type="application/json" data-url="/openapi.json"><\/script>
|
|
456
|
+
<script src="${ez.src}" integrity="${ez.integrity}" crossorigin="anonymous"><\/script>
|
|
457
|
+
</body>
|
|
458
|
+
</html>
|
|
459
|
+
`,iz=[`default-src 'self'`,`script-src ${ez.src}`,`style-src 'self' 'unsafe-inline' https://fonts.scalar.com`,`font-src https://fonts.scalar.com`,`img-src 'self' data:`,`connect-src 'self'`,`object-src 'none'`,`base-uri 'none'`,`form-action 'none'`,`frame-ancestors 'none'`].join(`; `);function az(e){let t=new Map;for(let n of new Set([...e,LN].map(e=>e.reason)).values()){let e=jN[n].status;t.set(e,[...t.get(e)??[],n])}return Object.fromEntries([...t].map(([e,t])=>[e,{content:{"application/json":{schema:{anyOf:t.map(e=>({$ref:`#/components/schemas/ErrorResponse.${e}`}))}}},description:t.map(e=>`\`${e}\``).join(`, `)}]))}function oz(e,t){let n=ZR(e,t,void 0,{...$R,...e===`form`?{media:`application/x-www-form-urlencoded`}:{}});return Object.assign((e,t)=>t(),{[yR]:n[yR]})}function sz(e){let{errors:t=[],success:n}=e;return{[n.status??200]:{content:{"application/json":{schema:JR(n.schema,$R)}},description:n.description},...az(t)}}function cz(e,t){return ZR(e,t,(e,t)=>{if(!e.success)return X(t,new wI({issues:e.error}))},$R)}(function(e){e.errors=[FN,wI]})(cz||={});var lz=new WeakMap;async function uz(e){let t=await Promise.all(Object.keys(jN).map(async e=>(await JR(BN.of(e),$R).toOpenAPISchema()).components?.schemas));return IR(e,{defaultValidationErrorResponse:!1,excludeStaticFile:!1,documentation:{components:{schemas:Object.assign({},...t),securitySchemes:{accessToken:{bearerFormat:`JWT`,description:"An access token from `/oauth2/token`, as `Authorization: Bearer <token>`.",scheme:`bearer`,type:`http`},clientBasic:{description:"An OAuth app's client ID and secret, as HTTP Basic `Authorization` (RFC 6749 §2.3.1).",scheme:`basic`,type:`http`},sessionCookie:{description:`The Tempo ID session, which sign-in sets as an HTTP-only cookie on Tempo ID's origin.`,in:`cookie`,name:BL,type:`apiKey`}}},info:tz,openapi:`3.1.0`}})}var dz={ACCOUNT_LIMIT:{limit:60,namespace:`1007`,period:60},AUTHORIZE_LIMIT:{limit:60,namespace:`1001`,period:60},DEVICE_LIMIT:{limit:10,namespace:`1002`,period:60},SIGN_IN_CODE_LIMIT:{limit:5,namespace:`1003`,period:60},SIGN_IN_IP_LIMIT:{limit:100,namespace:`1004`,period:60},TOKEN_APP_LIMIT:{limit:600,namespace:`1008`,period:60},TOKEN_LIMIT:{limit:300,namespace:`1006`,period:60}},fz=[`TOKEN_APP_LIMIT`],pz=class extends NN(`rate_limited`){name=`RateLimit.LimitedError`;constructor(e){super({error_description:`Too many requests. Retry after ${e.retryAfter} seconds.`})}},mz=`2a06:98c0:3600::103`,hz=[`RateLimit`,`RateLimit-Policy`,`Retry-After`];async function gz(e,t){let n=e.env,r=t.limits.flatMap(t=>t.key===void 0?[]:!n[t.binding]&&fz.includes(t.binding)?(wN(e,{fields:{binding:t.binding},message:`A rate limit has no binding, so the request is not counted.`}),[]):[{...t,key:t.key,policy:xz({binding:t.binding})}]);for(let t of r)_z(e,{policy:t.policy});for(let t of r)if(!(await Z(e,e.env[t.binding].limit({key:t.key}),`ratelimit.limit`)).success)return Sz(e,{policy:t.policy,retryAfter:t.policy.window})}(function(e){e.errors=[pz]})(gz||={});function _z(e,t){let{policy:n}=t;e.header(`ratelimit-policy`,`"${n.name}";q=${n.quota};w=${n.window}`,{append:!0})}function vz(e){return v(Ea(e.email),{as:`Hex`})}function yz(e){return e}function bz(e){let t=e.req.header(`cf-connecting-ip`);if(t===mz)return`worker:${e.req.header(`cf-worker`)??``}`;if(!t?.includes(`:`)||t.includes(`.`))return t;let[n,r]=t.toLowerCase().split(`::`),i=n?n.split(`:`):[],a=r?r.split(`:`):[];return`${(r===void 0?i:[...i,...Array(Math.max(0,8-i.length-a.length)).fill(`0`),...a]).slice(0,4).map(e=>e.replace(/^0+(?=.)/,``)).join(`:`)}::/64`}function xz(e){let{binding:t}=e,n=dz[t];return yz({name:t.replace(/_LIMIT$/,``).toLowerCase().replaceAll(`_`,`-`),quota:n.limit,window:n.period})}function Sz(e,t){let{policy:n,retryAfter:r}=t;return e.header(`ratelimit`,`"${n.name}";r=0;t=${r}`),e.header(`retry-after`,String(r)),X(e,new pz({retryAfter:r}))}function Cz(e,t){return e.endsWith(t)?e.length===t.length||e[e.length-t.length-1]===`.`:!1}function wz(e,t){let n=e.length-t.length-2,r=e.lastIndexOf(`.`,n);return r===-1?e:e.slice(r+1)}function Tz(e,t,n){if(n.validHosts!==null){let e=n.validHosts;for(let n of e)if(Cz(t,n))return n}let r=0;if(t.startsWith(`.`))for(;r<t.length&&t[r]===`.`;)r+=1;return e.length===t.length-r?null:wz(t,e)}function Ez(e,t){return e.slice(0,-t.length-1)}var Dz=/[\t\n\r]/g,Oz=!1;function kz(e){return e>=97&&e<=122||e>=48&&e<=57||e>127||e>=65&&e<=90||e===45||e===95}function Az(e,t,n){let r=n-t,i=e.charCodeAt(t)|32;if(r===2)return+(i===119&&(e.charCodeAt(t+1)|32)==115);if(r===3){let n=e.charCodeAt(t+1)|32,r=e.charCodeAt(t+2)|32;return+(i===119&&n===115&&r===115||i===102&&n===116&&r===112)}if(r===4){let n=e.charCodeAt(t+1)|32,r=e.charCodeAt(t+2)|32,a=e.charCodeAt(t+3)|32;return i===104&&n===116&&r===116&&a===112?1:i===102&&n===105&&r===108&&a===101?2:0}return r===5?+(i===104&&(e.charCodeAt(t+1)|32)==116&&(e.charCodeAt(t+2)|32)==116&&(e.charCodeAt(t+3)|32)==112&&(e.charCodeAt(t+4)|32)==115):0}function jz(e,t,n=!1){let r=0,i=e.length,a=!1,o=!1;if(Oz=!1,!t){if(e.startsWith(`data:`))return null;for(;r<e.length&&e.charCodeAt(r)<=32;)r+=1;for(;i>r+1&&e.charCodeAt(i-1)<=32;)--i;if(e.charCodeAt(r)===47&&e.charCodeAt(r+1)===47)r+=2;else{let a=e.indexOf(`:/`,r);if(a!==-1){let i=Az(e,r,a);if(i===1)for(o=!0,r=a+2;e.charCodeAt(r)===47||e.charCodeAt(r)===92;)r+=1;else if(i===2){o=!0,r=a+1;let t=0;for(;(e.charCodeAt(r)===47||e.charCodeAt(r)===92)&&t<2;)r+=1,t+=1;if(t<2)return null}else{for(let i=r;i<a;i+=1){let r=e.charCodeAt(i)|32;if(!(r>=97&&r<=122||r>=48&&r<=57||r===46||r===45||r===43)){let r=e.charCodeAt(i);return r===9||r===10||r===13?jz(e.replace(Dz,``),t,n):null}}if(e.charCodeAt(a+2)===47)r=a+3;else return null}}else if(e.charCodeAt(r)!==91){let a=-1;for(let o=r;o<i;o+=1){let r=e.charCodeAt(o);if(r===9||r===10||r===13)return jz(e.replace(Dz,``),t,n);if(r===58){a=o;break}if(r===47||r===92||r===63||r===35)break}if(a!==-1){let t=!1;for(let n=a+1;n<i;n+=1){let r=e.charCodeAt(n);if(r===47||r===92||r===63||r===35)break;if(r===64){t=!0;break}}if(!t){let t=!0,n=a+1;for(;n<i;n+=1){let r=e.charCodeAt(n);if(r===47||r===92||r===63||r===35)break;if(r<48||r>57){t=!1;break}}if(n===a+1&&(t=!1),!t){let t=Az(e,r,a);if(t===0){let t=!1;for(let n=a+1;n<i;n+=1){let r=e.charCodeAt(n);if(r===47||r===92||r===63||r===35)break;if(r===58){t=!0;break}}if(!t)return null}else if(o=!0,r=a+1,t===2){let t=0;for(;(e.charCodeAt(r)===47||e.charCodeAt(r)===92)&&t<2;)r+=1,t+=1;if(t<2)return null}else for(;e.charCodeAt(r)===47||e.charCodeAt(r)===92;)r+=1}}}}}let s=-1,c=-1,l=-1,u=-1,d=!1,f=n,p=r-1,m=-1;if(n&&r<i){let t=e.charCodeAt(r);(!(kz(t)||t===46||t===95)||t===45)&&(f=!1)}for(let t=r;t<i;t+=1){let r=e.charCodeAt(t);if(r<64){if(r===47||r===35||r===63){i=t;break}r===58?(u===-1&&(u=t),l=t):r===9||r===10||r===13?d=!0:n&&(r===46?((t-p>64||m===46||m===45)&&(f=!1),p=t):(r<48||r>57)&&(r!==45||m===46)&&(f=!1))}else if(o&&r===92){i=t;break}else r===64?(s=t,u=-1):r===93?c=t:r>=65&&r<=90?a=!0:n&&!kz(r)&&(f=!1);n&&(m=r)}if(d)return jz(e.replace(Dz,``),t,n);if(s!==-1&&s>=r&&s<i&&(r=s+1),e.charCodeAt(r)===91)return c===-1?null:e.slice(r+1,c).toLowerCase();if(l!==-1&&l>r&&l<i&&u===l&&(i=l),r>=i)return null;n&&f&&s===-1&&l===-1&&c===-1&&e.charCodeAt(i-1)!==46&&i-r<=255&&i-p-1<=63&&m!==45&&(Oz=!0)}for(;i>r+1&&e.charCodeAt(i-1)===46;)--i;let s=r!==0||i!==e.length?e.slice(r,i):e;return a?s.toLowerCase():s}function Mz(e){if(e.length<7||e.length>15)return!1;let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===46)t+=1;else if(r<48||r>57)return!1}return t===3&&e.charCodeAt(0)!==46&&e.charCodeAt(e.length-1)!==46}function Nz(e){if(e.length<3)return!1;let t=+!!e.startsWith(`[`),n=e.length;if(e[n-1]===`]`&&--n,n-t>39)return!1;let r=!1;for(;t<n;t+=1){let n=e.charCodeAt(t);if(n===58)r=!0;else if(!(n>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70))return!1}return r}function Pz(e){return Nz(e)||Mz(e)}var Fz=[`test`,`localhost`,`invalid`,`example`,`example.com`,`example.net`,`example.org`,`local`,`onion`,`alt`,`home.arpa`,`ipv4only.arpa`,`resolver.arpa`,`service.arpa`,`6tisch.arpa`,`eap.arpa`];function Iz(e){for(let t of Fz)if(e.endsWith(t)&&(e.length===t.length||e.charCodeAt(e.length-t.length-1)===46))return!0;return!1}function Lz(e){return e>=97&&e<=122||e>=48&&e<=57||e>127}function Rz(e){if(e.length>255||e.length===0||!Lz(e.charCodeAt(0))&&e.charCodeAt(0)!==46&&e.charCodeAt(0)!==95)return!1;let t=-1,n=-1,r=e.length;for(let i=0;i<r;i+=1){let r=e.charCodeAt(i);if(r===46){if(i-t>64||n===46||n===45)return!1;t=i}else if(!(Lz(r)||r===45||r===95)||r===45&&n===46)return!1;n=r}return r-t-1<=63&&n!==45}function zz({allowIcannDomains:e=!0,allowPrivateDomains:t=!1,detectIp:n=!0,detectSpecialUse:r=!1,extractHostname:i=!0,mixedInputs:a=!0,validHosts:o=null,validateHostname:s=!0}){return{allowIcannDomains:e,allowPrivateDomains:t,detectIp:n,detectSpecialUse:r,extractHostname:i,mixedInputs:a,validHosts:o,validateHostname:s}}var Bz=zz({});function Vz(e){return e===void 0?Bz:zz(e)}function Hz(e,t){return t.length===e.length?``:e.slice(0,-t.length-1)}function Uz(){return{domain:null,domainWithoutSuffix:null,hostname:null,isIcann:null,isIp:null,isPrivate:null,isSpecialUse:null,publicSuffix:null,subdomain:null}}function Wz(e,t,n,r,i){let a=Vz(r);if(typeof e!=`string`)return i;let o=!1;return a.extractHostname?a.mixedInputs?(o=Rz(e),i.hostname=jz(e,o,a.validateHostname)):i.hostname=jz(e,!1,a.validateHostname):i.hostname=e,a.detectIp&&i.hostname!==null&&(i.isIp=Pz(i.hostname),i.isIp)?i:a.validateHostname&&a.extractHostname&&i.hostname!==null&&!(o&&i.hostname===e)&&!Oz&&!Rz(i.hostname)?(i.hostname=null,i):(t===0||i.hostname===null||(t===5&&a.detectSpecialUse&&(i.isSpecialUse=Iz(i.hostname)),n(i.hostname,a,i),t===2||i.publicSuffix===null)||(i.domain=Tz(i.publicSuffix,i.hostname,a),t===3||i.domain===null)||(i.subdomain=Hz(i.hostname,i.domain),t===4)||(i.domainWithoutSuffix=Ez(i.domain,i.publicSuffix)),i)}function Gz(e,t,n){if(!t.allowPrivateDomains&&e.length>3){let t=e.length-1,r=e.charCodeAt(t),i=e.charCodeAt(t-1),a=e.charCodeAt(t-2),o=e.charCodeAt(t-3);if(r===109&&i===111&&a===99&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`com`,!0;if(r===103&&i===114&&a===111&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`org`,!0;if(r===117&&i===100&&a===101&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`edu`,!0;if(r===118&&i===111&&a===103&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`gov`,!0;if(r===116&&i===101&&a===110&&o===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`net`,!0;if(r===101&&i===100&&a===46)return n.isIcann=!0,n.isPrivate=!1,n.publicSuffix=`de`,!0}return!1}var Kz=new Uint8Array([1,2,1,1,1,1,1,1,1,1,1,1,0,2,2,2,0,2,2,0,2,0,0,1,0,0,2,1,1,1,1,1,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,2,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,2,0,0,0,0,0,0,0,2,0,2,2,0,0,2,2,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,2,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,1,0,2,2,0,0,0,2,0,1,1,0,2,0,2,2,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,2,2,0,2,2,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,2,2,0,2,2,2,2,0,0,0,0,2,0,0,0,0,0,0,0,2,2,0,0,0,2,2,1,1,1,1,1,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,2,2,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,2,1,2,1,1,1,2,1,1,1,1,1,0,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0]),qz=new Uint16Array([0,0,0,10,11,18,106,111,117,124,130,136,145,146,147,148,149,150,151,153,154,155,157,159,227,240,242,243,244,259,266,267,270,271,272,275,277,296,297,299,308,313,330,331,334,336,337,339,373,374,376,379,380,384,386,390,393,425,428,441,442,450,451,453,463,477,478,479,480,489,490,527,532,548,568,574,616,617,644,671,672,820,826,829,830,831,836,841,850,872,873,874,875,876,877,878,896,898,899,902,904,905,907,909,924,939,944,945,947,948,949,950,951,953,956,961,962,963,965,966,969,972,973,974,987,989,1001,1012,1020,1022,1063,1066,1070,1071,1073,1076,1087,1089,1099,1101,1107,1109,1110,1112,1115,1116,1117,1170,1172,1174,1194,1195,1196,1197,1199,1210,1241,1252,1264,1273,1280,1285,1298,1309,1322,1323,1334,1368,1369,1370,1385,1400,1472,1473,1475,1476,1510,1511,1512,1513,1516,1520,1523,1525,1554,1555,1563,1564,1565,1566,1568,1570,1571,1573,1574,1575,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1601,1602,1603,2057,2060,2061,2063,2070,2077,2087,2091,2102,2103,2104,2116,2117,2119,2121,2122,2129,2130,2132,2133,2135,2136,2137,2138,2139,2213,2215,2236,2237,2238,2240,2266,2267,2318,2319,2321,2328,2334,2344,2354,2407,2408,2409,2419,2433,2434,2437,2444,2445,2453,2454,2455,2456,2457,2468,2469,2470,2472,2473,2474,2483,2495,2501,2533,2537,2539,2540,2542,2543,2554,2555,2557,2565,2572,2578,2583,2584,2590,2593,2599,2606,2607,2614,2622,2623,2624,2662,2668,2683,2684,2689,2707,2738,2756,2758,2761,2769,2771,2778,2830,2854,2855,2856,2857,2858,2859,2860,2867,2868,2869,2870,2871,2872,2874,2875,2879,2959,2972,2973,3410,3414,3428,3480,3508,3530,3588,3610,3625,3688,3739,3777,3813,3838,3980,4026,4077,4096,4130,4145,4165,4195,4226,4249,4280,4310,4342,4369,4444,4466,4504,4514,4548,4567,4593,4635,4685,4711,4780,4781,4783,4806,4829,4865,4896,4913,4970,4983,5007,5036,5038,5072,5088,5116,5421,5430,5439,5446,5463,5467,5473,5512,5514,5521,5528,5537,5544,5545,5546,5558,5561,5576,5577,5586,5587,5596,5605,5611,5613,5614,5615,5652,5653,5655,5663,5670,5683,5687,5689,5690,5696,5703,5717,5727,5732,5740,5748,5754,5755,5759,5761,5762,5774,5846,5847,5848,5849,5851,5852,5855,5857,5860,5864,5865,5866,5872,5873,5874,5876,5878,5880,5881,5882,5885,5887,5890,5891,5893,6091,6098,6099,6100,6110,6115,6132,6146,6155,6156,6157,6161,6162,6164,6166,6172,6173,6176,6177,6179,6180,6181,7081,7084,7088,7106,7115,7118,7125,7126,7128,7129,7130,7132,7184,7185,7188,7189,7306,7307,7318,7329,7336,7339,7348,7349,7350,7365,7420,7612,7614,7615,7617,7622,7635,7650,7657,7666,7669,7672,7679,7687,7691,7692,7693,7707,7711,7720,7721,7722,7726,7761,7762,7780,7787,7795,7796,7801,7809,7853,7854,7860,7863,7875,7880,7881,7884,7886,7921,7922,7928,7935,7936,7945,7954,7969,7973,7974,8026,8027,8032,8034,8037,8039,8040,8041,8050,8064,8072,8086,8098,8099,8101,8103,8125,8136,8142,8143,8155,8167,8254,8266,8274,8277,8283,8308,8311,8312,8313,8314,8316,8319,8322,8333,8335,8337,8365,8440,8447,8451,8452,8461,8483,8484,8489,8490,8569,8571,8573,8582,8586,8592,8598,8604,8614,8619,8620,8638,8649,8654,8659,8669,8675,8679,8685,8691,10300,10301,10302,10309,10311]),Jz=new Uint8Array([3,3,3,3,3,3,3,3,5,8,8,2,2,3,3,3,3,3,8,5,5,5,5,5,3,3,5,5,9,12,19,8,19,8,11,9,9,8,7,7,6,8,9,16,10,7,7,11,8,6,6,9,7,11,7,14,4,4,4,4,4,4,10,7,6,6,6,6,10,10,6,10,10,22,11,9,10,10,10,9,10,8,7,7,7,8,21,13,11,11,9,10,9,13,10,8,8,9,12,9,7,10,7,7,13,7,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,8,6,3,3,3,3,3,3,2,5,3,3,3,7,2,2,2,2,2,2,3,3,3,1,1,7,8,5,2,2,7,2,2,1,4,1,11,9,9,5,5,8,5,5,5,5,5,5,5,3,3,3,3,3,5,11,9,9,13,7,14,7,6,6,6,7,6,6,6,6,6,10,7,11,9,4,4,4,4,4,6,6,6,6,13,6,8,7,10,9,9,7,9,8,9,8,7,10,6,9,8,10,10,7,8,1,9,10,12,12,12,10,9,9,10,10,9,9,1,1,5,3,3,3,3,3,3,3,3,3,3,3,3,6,6,6,4,3,3,3,7,4,4,4,3,3,6,7,3,4,1,2,2,2,6,1,2,2,2,2,2,12,5,3,8,9,13,4,4,13,9,9,11,7,3,12,9,2,2,2,3,3,3,3,3,8,2,2,3,3,3,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,4,3,7,10,15,7,15,15,20,15,9,10,10,12,14,14,14,12,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,13,13,9,9,9,9,9,9,7,8,6,8,8,6,8,13,8,8,6,13,8,11,13,8,6,13,8,6,9,10,10,12,14,14,14,12,12,12,12,14,14,10,10,10,10,9,9,9,10,14,14,11,13,13,9,9,9,9,9,9,2,6,9,2,2,3,3,3,3,3,3,3,3,3,4,4,4,2,3,3,3,3,3,3,7,7,2,3,2,2,5,3,3,3,3,3,3,4,2,2,2,2,2,2,3,3,3,3,3,3,3,4,5,7,4,2,2,12,8,10,8,10,7,18,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,2,2,3,3,3,5,5,3,8,8,6,8,6,6,4,6,7,7,7,10,11,2,5,5,3,3,3,3,3,3,5,5,6,11,10,7,7,7,4,4,4,2,3,3,3,3,3,2,2,7,5,5,3,3,3,3,3,3,3,3,7,7,7,11,7,6,9,6,6,8,10,8,6,8,13,4,4,4,4,4,10,8,11,8,8,8,10,10,7,10,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,5,5,5,5,5,5,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,7,10,13,7,8,7,11,8,8,6,9,8,8,6,6,6,8,8,6,6,6,6,6,9,7,6,4,4,4,4,4,4,4,6,6,6,9,7,8,10,8,8,2,3,3,3,3,3,2,8,9,9,2,2,2,3,3,3,2,3,3,3,9,2,2,3,3,3,3,3,3,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,12,5,5,3,5,4,2,3,2,4,3,9,2,2,2,2,2,5,5,3,8,8,13,6,10,9,4,7,9,11,2,3,7,3,3,4,1,3,4,2,9,3,3,12,5,3,7,10,10,7,4,4,6,14,7,9,7,13,2,2,2,2,2,2,3,3,3,3,3,8,15,4,4,2,3,3,3,7,4,9,9,2,3,3,3,5,3,2,2,7,2,7,6,6,7,2,4,2,2,2,2,2,2,8,8,8,9,5,2,3,3,3,3,3,3,10,7,4,4,4,4,3,4,2,3,3,3,3,3,10,7,4,4,4,4,2,3,3,3,3,10,7,4,4,4,4,3,9,6,6,6,9,13,9,2,2,2,8,7,9,5,3,3,3,5,5,13,12,9,10,7,8,7,6,8,6,11,12,7,9,10,4,4,7,8,11,6,7,9,8,7,10,8,9,15,7,8,5,4,7,2,3,3,3,2,14,10,2,14,10,2,14,3,9,13,13,10,14,16,17,11,2,14,2,14,3,9,13,10,14,16,17,11,14,10,14,2,7,3,10,7,14,10,2,14,10,9,9,17,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,10,10,10,12,9,4,10,10,11,8,8,8,7,9,5,3,3,3,3,3,3,3,3,5,8,4,4,4,4,4,4,6,16,3,3,14,3,14,2,14,9,13,10,10,14,16,17,11,6,9,10,10,12,14,14,14,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,9,9,9,9,9,9,2,14,9,13,10,10,14,16,17,11,6,2,14,9,17,13,10,10,14,16,17,11,6,2,14,9,13,10,14,16,17,11,2,14,9,13,10,16,11,2,14,10,19,7,2,14,9,13,10,19,10,7,14,16,17,11,6,2,14,9,13,10,19,7,14,16,17,11,2,14,9,13,17,13,10,10,14,16,17,11,6,3,2,14,9,13,10,10,14,16,17,11,6,9,10,12,14,14,14,12,12,12,12,12,14,14,14,10,10,10,14,9,9,9,9,14,14,14,13,13,14,9,9,9,9,9,9,4,11,2,14,9,13,17,13,10,19,10,7,14,16,17,11,6,2,14,9,13,17,13,10,19,10,7,14,16,17,11,6,2,9,10,10,7,17,3,3,12,12,16,15,15,12,14,14,14,20,20,13,12,12,12,12,12,12,20,25,14,14,12,12,10,10,10,10,9,9,9,25,4,9,17,10,7,14,16,21,13,13,14,20,14,13,17,24,9,12,13,25,13,21,20,17,9,9,9,9,9,9,12,17,4,4,9,9,9,10,10,12,14,14,14,12,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,13,13,9,9,9,9,9,9,1,5,8,7,11,11,1,3,3,3,5,3,3,4,8,9,10,14,14,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,13,13,9,9,9,9,9,7,4,4,4,4,4,4,4,4,4,7,4,9,12,6,14,4,12,7,2,2,1,2,7,6,4,4,4,6,8,8,7,4,5,6,3,3,3,3,4,16,8,5,4,3,3,3,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,11,12,7,7,13,9,10,17,12,8,9,7,8,5,12,10,13,14,5,5,5,13,5,5,5,3,3,3,5,16,5,5,5,5,7,12,14,8,12,8,10,12,9,11,7,9,7,10,7,13,9,7,12,8,17,7,7,16,10,13,13,8,10,10,14,17,7,16,16,15,8,10,10,12,17,17,7,17,14,7,10,17,8,7,7,7,8,15,15,7,14,10,10,10,11,11,7,7,13,8,10,7,16,7,8,7,14,17,12,10,11,21,8,9,7,13,9,8,13,6,12,7,6,13,10,10,10,8,18,9,17,13,10,12,6,13,6,11,8,13,10,13,18,13,11,13,8,16,7,10,8,16,12,10,8,8,14,11,8,15,8,8,7,7,12,7,8,9,14,15,8,9,10,9,15,7,8,8,12,13,9,10,15,13,7,10,10,20,7,6,9,6,6,14,11,14,11,12,9,10,16,16,12,7,11,28,8,11,10,7,21,8,7,9,4,4,4,17,7,8,6,9,6,6,13,6,6,6,6,18,20,14,8,11,12,9,10,13,15,15,19,8,9,12,7,10,16,12,9,9,9,14,12,11,9,12,11,18,9,9,9,10,7,7,16,8,9,7,13,12,10,14,18,7,8,11,7,7,8,8,13,7,7,7,11,15,13,11,7,8,15,11,7,8,18,14,13,18,15,10,12,12,9,7,11,11,8,7,10,8,14,12,10,18,7,10,9,7,8,13,10,14,10,8,8,23,7,7,11,12,12,17,7,7,11,11,17,16,16,7,8,11,14,14,8,10,7,7,16,16,13,9,11,9,15,15,11,11,7,7,14,7,9,7,7,16,10,13,10,11,14,7,11,10,11,7,11,10,11,15,11,15,10,12,10,14,13,11,11,12,13,10,7,13,10,16,12,21,9,10,10,7,11,14,17,7,7,8,11,12,8,15,14,14,8,17,12,10,10,7,9,11,7,10,7,11,18,7,11,7,12,11,8,8,14,12,7,8,15,3,7,7,5,2,9,2,2,2,2,2,2,2,3,3,3,3,3,3,3,2,5,3,3,3,3,3,3,4,4,3,3,3,3,3,3,5,11,6,4,7,10,7,7,11,1,10,2,2,3,3,3,3,3,3,3,3,5,7,3,5,6,3,3,5,2,2,5,3,4,13,11,3,3,6,3,5,14,2,2,3,8,2,2,12,5,18,5,3,3,3,16,5,5,5,10,7,13,12,13,9,12,14,19,9,9,21,9,9,10,6,9,6,15,10,6,12,8,6,10,15,4,4,6,6,9,9,12,16,14,23,7,7,7,14,9,7,7,11,14,10,7,10,10,10,12,6,11,10,13,11,15,11,7,12,10,3,7,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4,3,7,2,5,5,3,3,5,5,5,5,7,6,6,6,4,4,4,4,4,4,6,6,6,6,6,7,10,2,2,2,5,5,5,5,3,3,3,3,3,5,5,10,9,11,8,7,12,8,9,7,6,13,11,6,13,7,9,9,4,4,4,4,4,6,10,7,8,13,8,8,9,14,7,8,10,7,7,7,9,6,9,7,2,12,5,3,3,13,4,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,4,5,5,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,4,4,4,4,4,4,4,4,4,4,4,4,9,3,3,3,3,3,3,3,3,3,3,4,2,2,2,5,3,3,3,3,3,3,3,3,4,4,1,7,6,4,12,3,3,3,3,3,8,7,3,3,3,3,3,3,4,4,11,14,2,8,3,5,5,8,10,8,6,4,7,17,7,4,5,2,6,3,2,2,12,5,5,3,15,13,8,11,2,2,3,3,3,3,3,3,3,3,4,4,5,3,3,3,3,4,18,2,12,5,3,3,3,3,3,5,16,8,8,9,6,6,4,4,4,4,31,6,6,10,11,21,10,9,7,10,7,7,2,4,4,4,4,6,5,3,3,4,3,3,3,3,3,3,3,3,3,6,6,6,2,2,2,5,3,3,3,7,7,4,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,8,2,3,3,3,3,3,5,9,11,3,3,3,3,4,4,3,3,3,3,3,5,10,9,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,11,10,10,10,10,10,11,10,11,10,11,10,9,9,11,3,3,3,3,3,3,5,3,7,8,8,7,6,6,11,4,4,4,7,8,9,9,2,3,7,4,4,2,5,5,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,2,2,5,5,5,5,5,3,3,5,5,5,7,7,6,6,6,4,4,4,4,4,4,4,4,4,4,6,6,8,8,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,6,9,12,3,7,10,7,2,2,3,3,3,3,3,4,3,3,2,2,2,2,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,8,8,6,6,8,6,7,4,4,4,4,4,4,6,7,5,5,20,19,8,10,9,7,10,6,8,11,6,6,6,6,13,12,8,6,7,14,11,9,2,5,3,6,2,3,2,2,2,2,2,2,2,5,4,3,7,6,4,7,4,3,6,4,7,2,7,7,7,5,5,5,5,3,3,3,3,3,3,3,3,3,5,9,10,10,11,7,8,20,7,8,9,8,12,6,6,6,8,9,8,12,6,6,8,13,10,12,6,6,7,7,9,6,4,4,4,4,4,4,10,6,6,6,7,14,11,10,7,8,10,8,11,14,11,11,9,7,9,8,11,9,17,10,9,2,2,2,9,3,3,3,3,15,14,9,5,5,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,15,12,22,19,17,18,18,19,21,7,16,16,5,5,5,5,5,5,5,5,5,5,5,7,5,5,5,5,5,5,5,5,5,5,5,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,7,16,11,11,7,7,7,7,17,7,8,12,15,9,19,7,19,8,21,11,12,19,14,22,7,7,7,7,7,7,7,7,7,7,7,16,16,19,24,12,7,14,7,12,7,8,10,10,13,7,12,12,7,7,10,18,15,12,16,7,14,12,17,10,16,17,12,17,25,7,7,7,13,6,9,6,9,18,6,6,11,20,10,6,6,6,6,6,6,17,6,6,6,15,6,6,6,6,6,8,14,11,12,11,15,13,19,17,21,7,18,8,13,13,8,12,8,6,6,13,6,15,15,16,6,6,16,6,6,6,14,6,18,6,6,6,17,18,9,13,15,8,19,8,15,15,18,14,16,4,4,4,4,4,4,4,4,4,4,4,4,6,11,10,11,6,21,23,12,17,12,11,14,13,22,15,15,11,12,14,12,7,12,8,12,14,12,18,10,8,16,19,17,12,14,15,8,19,17,12,13,13,15,18,13,23,24,23,21,17,24,8,21,8,14,14,16,20,14,8,8,15,20,8,19,21,9,8,13,12,13,15,11,8,11,9,9,8,11,8,21,14,21,15,15,13,7,19,7,7,7,7,7,7,16,12,17,18,7,7,11,11,7,9,9,2,2,3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,3,3,10,10,7,9,7,7,7,6,8,6,6,6,6,6,6,6,7,6,8,6,6,9,7,7,7,4,4,4,4,4,4,4,4,8,9,8,7,8,7,8,10,7,5,5,5,5,5,5,3,9,7,7,8,6,6,6,6,6,6,6,6,9,6,6,9,11,13,7,8,9,9,5,5,5,7,8,6,6,6,6,6,6,6,7,8,9,7,10,9,10,7,8,5,5,5,5,5,5,7,7,9,8,7,7,6,6,6,6,6,6,10,6,6,6,6,6,6,6,6,6,6,6,9,10,4,4,4,4,8,7,7,10,10,9,8,8,15,9,8,8,8,8,8,9,10,9,10,7,8,13,5,5,5,5,5,3,3,7,7,8,6,6,6,4,4,11,9,7,8,9,10,7,5,5,5,5,5,3,3,7,6,6,13,7,9,8,7,5,5,5,5,5,5,5,5,3,3,3,3,7,8,7,8,13,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,6,6,6,6,7,6,7,6,6,9,7,4,4,4,4,4,4,4,7,8,7,8,9,8,8,8,7,10,7,8,5,5,5,5,5,5,5,5,3,7,7,7,7,9,7,10,9,6,6,6,6,6,8,8,6,6,6,7,6,6,6,9,9,4,4,13,7,10,9,9,12,7,8,8,10,8,8,8,8,8,8,5,5,5,5,3,7,7,11,7,9,8,8,6,6,10,6,8,8,8,6,7,6,6,12,4,4,4,4,4,4,4,4,4,9,8,8,16,8,9,8,7,5,5,5,5,5,3,3,7,7,7,10,15,8,9,8,9,9,6,6,6,6,6,6,7,4,8,7,8,8,7,8,11,8,5,5,5,5,5,3,7,7,6,11,16,7,6,4,4,4,4,9,9,8,8,8,13,12,8,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,7,8,8,9,13,7,7,7,9,8,8,9,12,7,12,7,12,8,7,10,12,9,9,6,6,8,8,6,6,6,6,6,6,6,9,8,9,11,8,6,6,6,6,6,12,7,6,6,6,9,7,7,6,6,6,6,6,11,9,6,6,6,6,6,7,9,4,4,4,4,4,4,4,4,9,9,9,9,7,7,7,7,7,11,7,7,8,8,8,8,8,8,9,8,9,9,7,7,11,11,7,12,8,8,8,8,8,7,8,8,8,8,8,13,12,8,8,8,8,7,7,7,9,5,5,5,5,5,5,5,3,3,7,7,11,7,8,8,8,6,6,6,6,6,6,6,6,6,6,6,10,11,6,7,9,4,4,4,4,4,4,9,9,8,9,8,8,8,7,7,5,5,5,5,5,5,5,5,5,5,3,3,11,7,7,7,9,6,6,11,8,10,6,6,6,12,8,8,7,6,6,8,7,4,4,4,4,4,4,4,4,9,10,9,9,8,10,9,11,8,5,5,5,7,6,6,8,7,4,4,4,4,8,7,7,8,7,8,8,5,5,5,5,7,7,8,8,8,6,6,6,6,6,10,8,9,13,6,7,6,6,8,7,8,4,4,4,4,11,8,8,8,10,5,5,8,7,8,13,8,7,6,8,6,9,7,8,7,5,5,5,5,5,5,3,3,7,8,9,6,4,8,10,10,8,12,9,13,2,7,5,5,5,5,5,7,7,10,6,6,6,6,6,6,6,8,4,4,9,8,8,8,14,8,8,8,9,8,5,5,5,5,5,3,3,9,6,6,6,6,10,12,6,6,6,6,6,6,6,4,4,4,4,11,8,7,8,8,8,5,5,3,3,3,3,7,7,6,8,6,8,11,7,6,6,6,7,4,8,11,9,10,5,5,5,3,3,3,7,7,8,9,8,15,9,6,6,6,6,6,6,11,11,4,4,4,4,4,7,9,9,10,8,7,5,5,5,5,5,5,3,3,8,6,6,6,6,6,6,6,6,6,9,7,4,4,4,4,4,9,9,8,8,10,13,5,5,5,3,17,7,7,7,7,7,8,6,8,13,6,6,6,6,6,6,6,6,4,4,4,9,10,8,8,8,5,5,5,5,3,7,7,7,8,8,6,6,6,8,8,8,9,10,8,4,8,10,9,8,8,8,9,13,10,5,5,5,5,5,5,5,5,5,5,3,3,7,8,9,9,7,7,7,10,9,9,8,9,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,6,8,12,6,6,6,6,6,6,6,6,6,12,4,4,4,4,4,4,4,4,4,4,4,11,8,8,9,9,10,8,9,7,7,5,5,5,5,5,5,3,7,8,7,6,6,8,6,6,10,4,7,8,9,12,8,7,7,5,5,5,5,5,5,3,3,7,14,7,9,8,8,6,6,8,12,12,6,6,7,7,10,4,4,4,4,4,9,9,14,9,13,8,7,5,5,5,6,6,6,7,4,8,7,5,5,5,5,5,5,5,5,3,3,7,7,7,8,6,6,6,6,6,6,12,6,6,6,6,4,4,9,9,8,8,11,7,7,7,5,5,5,3,9,8,6,6,7,4,4,4,4,4,4,8,8,11,5,5,5,7,7,7,9,6,6,6,6,6,6,9,8,4,4,4,4,7,12,9,8,8,8,7,10,10,5,5,5,5,5,5,5,3,11,14,8,7,8,8,6,6,6,6,6,8,7,6,6,6,7,6,8,9,4,4,4,7,8,9,7,9,7,7,9,8,5,5,5,5,5,5,5,5,5,11,3,9,7,7,12,14,8,6,6,12,11,8,6,6,6,6,6,6,6,6,6,15,7,4,4,4,16,9,9,9,8,9,9,9,9,9,8,8,8,13,11,8,5,5,5,5,3,7,6,6,8,8,8,6,6,7,10,7,4,4,4,4,9,7,8,7,7,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,7,7,7,9,6,6,6,6,6,8,8,7,7,9,6,6,6,7,6,6,6,6,6,15,4,4,4,4,4,8,8,7,8,12,9,8,8,8,8,8,9,8,8,10,8,8,8,8,16,9,10,2,5,5,5,5,5,5,5,9,7,6,8,9,4,4,4,4,4,7,8,8,8,9,8,11,10,5,5,5,5,3,7,8,6,6,6,6,6,8,6,6,6,6,4,12,10,12,7,7,7,7,7,7,7,5,5,5,5,3,3,7,7,10,8,9,7,6,10,7,6,6,4,4,8,9,7,9,9,9,9,8,8,8,8,10,5,5,5,5,5,5,8,7,6,6,6,10,6,7,10,7,4,4,4,4,4,4,4,12,9,10,7,7,10,8,10,5,12,9,6,6,6,6,6,7,6,4,4,4,10,9,9,8,7,7,5,5,5,5,5,5,3,3,13,7,7,9,7,7,7,8,9,9,7,8,6,6,6,6,6,6,6,6,6,6,6,6,6,7,13,9,15,15,4,4,4,4,4,10,10,9,8,9,8,8,9,7,8,7,8,5,5,7,6,6,6,4,4,4,7,8,11,8,5,5,5,5,5,5,5,7,6,6,6,6,6,6,9,11,10,7,4,4,4,9,8,8,5,5,5,5,5,9,9,6,6,6,6,6,6,6,9,9,4,4,4,4,8,8,8,9,9,8,8,8,13,2,4,2,7,5,5,5,5,5,5,9,9,6,6,6,6,10,8,8,8,6,6,6,4,4,9,8,10,8,9,8,8,8,9,8,8,5,3,3,3,11,6,6,6,7,6,6,6,4,4,9,8,5,5,5,5,5,3,11,8,6,6,6,6,6,9,7,4,4,14,10,9,8,12,8,8,8,11,15,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,11,11,11,10,10,7,7,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,5,5,5,3,3,3,7,11,7,7,11,11,7,8,9,10,7,7,9,9,9,9,7,7,10,8,13,8,8,8,8,11,10,6,6,8,10,11,14,14,6,6,6,6,6,6,9,11,7,7,6,8,12,11,11,6,6,10,6,6,6,6,6,10,7,7,6,6,11,6,6,6,11,8,9,7,6,10,11,9,10,11,7,11,8,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,6,6,8,9,10,9,6,6,6,10,6,6,6,6,11,10,11,10,9,8,7,7,7,7,11,14,8,10,9,9,8,8,7,11,8,8,8,11,11,10,10,9,10,8,11,10,8,11,9,12,8,10,8,11,8,9,9,11,11,10,11,13,8,7,8,8,9,7,8,8,8,8,7,8,2,2,2,2,2,2,2,4,4,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,2,3,3,3,3,3,3,3,3,8,6,4,4,4,11,7,11,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5,3,3,3,3,8,7,7,8,8,4,8,7,7,7,9,7,8,9,8,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,6,3,3,3,3,3,3,3,3,4,2,2,3,3,3,3,3,3,4,5,5,3,3,8,8,6,9,4,4,10,7,3,3,3,2,5,3,3,3,3,3,3,3,3,3,3,3,3,4,3,2,2,2,3,3,3,3,3,4,10,2,3,3,3,3,3,3,3,4,2,3,3,3,3,3,3,3,3,2,2,3,3,3,5,2,4,2,6,2,2,9,5,5,3,3,3,3,3,3,3,5,5,5,9,8,7,9,6,6,11,4,4,4,4,4,4,4,4,6,6,7,7,11,8,8,6,5,11,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,2,2,3,3,3,3,3,3,6,4,4,4,4,3,3,3,3,5,7,2,3,3,3,3,3,8,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,6,4,4,4,4,2,2,3,3,3,3,3,3,3,4,3,3,3,3,3,3,3,3,3,3,3,3,4,2,2,3,3,3,3,3,3,2,3,3,3,3,3,6,3,3,8,10,3,4,4,1,1,1,1,1,1,1,8,9,10,7,7,1,14,18,13,18,13,10,10,16,13,18,16,13,16,18,13,22,16,16,16,14,21,16,9,14,16,9,9,14,10,10,14,12,14,19,12,11,18,13,17,15,15,15,15,16,14,13,19,18,15,19,18,12,18,12,11,20,14,15,10,17,17,16,19,20,21,15,13,16,15,15,15,1,1,3,8,7,7,8,8,8,1,6,1,1,6,3,3,4,7,3,3,5,5,4,4,4,4,4,2,7,7,8,12,3,4,5,1,3,4,4,10,4,3,3,3,8,7,7,2,2,2,2,2,2,2,2,2,12,9,20,7,5,5,5,9,13,5,5,5,5,5,3,3,3,16,5,5,5,13,7,8,8,11,8,7,9,7,11,12,9,9,8,8,11,10,14,7,12,10,11,13,7,9,11,17,17,14,13,7,8,7,10,10,7,16,13,7,8,17,12,9,8,6,7,10,6,6,12,6,8,10,8,8,8,6,8,6,14,6,6,6,13,6,10,6,6,7,14,8,6,6,10,11,10,9,9,7,7,6,6,6,9,9,7,9,10,9,13,12,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,6,8,9,10,9,7,10,10,8,7,8,7,10,12,9,8,15,8,7,8,8,7,7,15,13,7,10,9,14,18,16,7,24,7,8,10,11,16,8,14,7,9,9,9,13,19,14,15,14,11,7,13,9,10,7,13,9,10,11,12,8,9,2,3,5,8,7,4,4,15,10,5,3,3,3,3,3,5,4,4,4,2,2,2,2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,2,2,2,3,3,3,3,3,3,3,3,3,3,4,2,12,5,3,8,10,15,6,7,2,3,2,5,5,12,2,5,5,5,5,2,2,5,5,12,9,5,2,2,9,5,5,12,12,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,9,12,5,8,8,9,5,5,5,8,19,7,16,15,14,9,9,9,9,7,11,11,11,7,14,10,10,5,5,5,5,5,5,5,5,5,15,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,14,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,15,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,12,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,9,9,12,9,9,12,12,12,15,7,11,7,14,11,18,13,8,18,15,18,12,14,12,8,8,8,8,9,9,9,12,7,10,10,8,8,12,12,12,7,12,12,9,7,7,7,7,7,8,15,12,9,10,10,7,10,10,13,11,10,9,22,11,9,8,8,8,8,8,13,18,13,9,15,19,9,7,7,10,7,7,7,11,8,13,17,7,7,10,10,10,7,20,16,7,7,7,7,7,7,11,21,12,12,13,11,14,16,8,8,13,11,7,7,13,7,7,14,15,15,6,6,6,6,6,6,6,6,6,6,13,10,18,6,6,6,6,6,6,6,6,6,11,8,8,12,12,11,11,8,12,9,9,9,13,13,9,9,9,9,9,9,6,10,12,6,6,6,6,17,11,7,7,7,7,14,14,12,6,7,7,6,6,15,10,13,10,6,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,13,9,9,15,13,6,12,12,6,19,11,10,7,7,16,8,19,17,9,9,9,9,9,6,6,6,10,8,16,8,6,6,9,6,6,6,6,6,6,6,6,8,8,8,6,7,6,6,6,6,6,6,6,6,6,6,6,14,6,6,6,6,20,6,9,6,14,9,9,9,6,9,8,8,12,9,8,8,8,8,7,8,12,7,8,8,8,6,8,6,6,6,6,6,6,6,9,8,8,6,6,13,9,12,13,12,14,13,12,11,11,6,8,8,8,6,13,12,11,11,12,6,11,12,11,13,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,15,6,6,6,6,6,6,6,13,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,8,6,18,6,12,13,13,13,9,10,15,9,12,6,6,6,6,6,6,6,6,9,15,10,9,10,13,9,19,8,18,17,10,10,8,8,6,6,6,6,6,6,10,14,8,16,16,9,8,15,8,8,10,12,14,7,7,8,8,7,7,7,7,8,13,13,11,9,9,9,12,10,17,8,11,9,7,7,14,8,14,14,7,7,7,7,7,7,14,7,7,7,7,7,10,10,8,14,7,7,7,7,8,8,8,8,8,17,9,7,15,7,8,12,7,9,14,7,7,7,9,13,8,14,7,16,18,13,15,14,12,13,10,15,9,7,7,7,10,13,15,15,9,9,9,9,19,11,7,11,11,13,8,8,8,8,7,12,19,17,9,9,13,7,7,7,9,7,7,7,12,13,15,10,8,8,14,15,12,13,13,8,12,14,7,11,7,14,15,13,12,8,8,8,8,11,13,15,15,8,13,12,8,8,8,13,10,16,14,11,8,8,12,12,9,15,15,12,12,13,8,8,9,12,13,9,8,8,8,8,8,8,8,8,8,8,8,11,12,11,7,14,7,13,13,13,12,18,16,7,12,11,10,10,15,9,9,9,21,7,7,7,11,16,8,8,11,11,7,7,7,7,7,19,7,7,7,7,7,7,7,7,7,12,8,9,12,14,11,9,9,9,22,12,3,3,4,8,8,15,4,2,2,5,5,3,3,3,3,3,3,6,6,4,4,4,12,7,10,2,3,3,3,3,3,3,3,6,7,3,7,5,14,4,4,7,8,10,4,1,3,3,6,2,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,4,2,2,5,3,4,2,2,2,2,2,2,11,5,5,5,11,5,5,3,5,5,5,5,11,14,13,9,11,9,12,8,11,11,8,11,16,9,9,7,10,9,12,8,15,6,7,6,6,13,10,8,11,8,6,6,6,12,16,6,11,7,8,9,18,6,6,9,4,4,6,13,6,6,6,6,8,8,9,16,7,7,14,7,8,8,8,7,7,7,7,7,7,15,13,7,10,7,7,10,12,16,15,7,9,9,14,11,11,10,9,10,8,12,7,8,7,7,10,12,7,12,8,7,2,3,3,3,3,3,3,3,3,3,3,5,3,3,5,5,5,10,4,8,7,10,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,7,4,5,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,6,6,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,8,2,2,2,8,12,7,7,5,5,5,5,5,5,5,5,5,5,5,5,8,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,7,11,9,8,8,8,7,8,9,7,7,9,7,7,7,10,7,7,10,9,10,6,6,6,6,6,6,15,7,8,9,9,8,6,6,10,9,6,8,13,9,7,6,6,6,6,6,6,12,6,6,7,6,7,6,6,6,10,10,7,6,6,6,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,14,6,6,7,7,9,6,6,6,6,9,9,8,9,10,9,8,9,12,7,7,7,8,7,10,12,11,9,10,7,7,7,9,10,10,8,12,9,7,7,9,8,8,8,10,7,7,8,9,9,7,7,7,8,2,4,6,3,4,2,3,3,3,3,2,3,3,3,3,3,3,3,3,4,4,4,4,5,5,3,3,3,3,3,3,3,3,5,8,6,4,7,3,3,3,3,3,3,3,12,3,3,3,3,3,3,4,4,2,3,5,3,4,7,3,3,3,3,3,3,4,3,3,3,3,3,3,3,4,3,3,6,4,3,4,2,2,2,5,3,3,3,3,3,5,4,4,4,4,7,6,8,9,2,2,2,2,3,3,3,5,7,2,3,3,8,7,7,2,2,8,5,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,8,8,7,7,6,10,6,9,7,11,4,6,8,8,7,8,4,5,5,5,5,3,3,11,8,9,6,6,8,7,4,4,7,8,7,2,2,3,3,3,3,4,3,3,3,3,3,3,3,3,7,2,2,5,3,3,2,3,3,3,3,3,3,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,12,5,5,3,3,3,5,10,12,6,15,4,6,6,7,14,9,3,3,3,3,3,8,2,2,3,5,5,3,3,3,3,3,3,8,8,8,7,5,8,4,6,11,2,2,6,7,3,3,2,9,8,5,5,3,3,3,5,5,7,7,6,6,10,6,8,6,8,9,7,4,4,4,4,7,6,6,7,7,10,9,8,11,8,3,3,3,3,3,4,4,2,3,3,3,3,3,7,6,2,5,6,7,6,4,8,9,11,2,2,3,3,3,3,3,3,3,2,2,5,3,3,3,3,3,9,9,6,4,8,7,7,5,9,8,6,2,8,7,8,5,5,5,5,5,3,3,3,16,8,7,7,7,8,7,7,7,7,9,6,9,6,10,7,7,7,6,10,8,9,11,11,8,4,4,10,8,8,6,9,6,11,8,8,8,15,7,8,9,5,3,3,3,3,3,5,11,2,2,3,8,9,10,3,2,2,2,2,2,2,3,6,4,2,2,3,3,3,3,3,3,3,3,3,3,4,4,2,3,3,3,3,3,3,3,11,5,3,3,3,3,3,3,3,3,6,7,4,4,2,3,3,3,3,3,3,3,3,12,7,4,12,4,6,5,4,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,2,3,3,3,3,3,3,3,3,4,4,11,10,6,4,6,10,8,3,3,3,3,3,3,3,3,5,4,4,4,2,2,2,2,2,2,2,2,5,3,4,4,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,10,5,5,5,5,5,5,3,3,3,3,3,3,3,3,7,8,8,7,13,12,10,10,8,8,7,7,9,12,11,6,6,8,8,9,7,7,7,10,15,10,4,4,4,4,4,11,8,8,9,7,9,14,14,12,2,2,2,2,2,2,2,3,3,3,3,3,12,5,5,5,11,10,7,9,3,8,7,3,15,13,11,4,4,2,2,2,19,7,5,5,3,3,3,3,3,3,3,5,22,18,6,14,17,4,4,19,16,18,2,3,3,7,2,3,2,3,3,6,4,2,3,3,2,5,3,3,3,3,3,3,3,9,9,2,3,2,2,2,3,3,3,5,7,14,7,7,12,9,13,6,11,6,10,9,7,7,8,12,12,8,8,8,10,7,7,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,5,8,10,7,8,11,8,12,9,4,14,7,7,9,13,2,3,3,3,3,3,3,2,3,3,3,1,2,2,3,3,3,3,3,3,5,2,2,5,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,4,4,4,3,2,3,3,3,3,5,2,2,2,2,5,5,5,5,3,3,3,3,3,3,3,3,3,7,7,7,7,7,8,8,8,8,8,12,9,8,8,9,8,6,17,6,6,6,8,8,6,6,6,6,6,6,6,6,6,6,6,7,4,4,8,8,9,9,9,7,7,7,7,7,7,7,9,9,9,7,8,8,8,10,7,13,10,8,9,3,3,5,13,3,3,3,3,3,7,7,6,6,10,13,11,11,8,8,9,8,9,9,10,10,10,11,10,10,13,13,16,15,11,12,9,9,10,9,11,10,9,9,14,7,8,3,10,7,7,3,2,2,2,5,3,3,3,3,3,3,3,3,3,3,3,3,6,7,2,2,3,3,3,3,3,3,3,3,4,11,6,7,4,6,2,2,3,3,3,1,3,3,3,3,3,3,6,4,4,2,2,2,3,3,3,3,4,4,6,6,6,6,5,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,9,11,6,10,9,12,7,7,11,14,9,7,12,3,3,7,12,11,12,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,3,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,5,5,5,5,11,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,3,3,3,5,5,5,5,5,5,5,5,5,5,5,3,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5,5,3,10,3,3,3,11,3,5,9,11,8,12,14,9,7,8,7,7,11,11,7,7,10,9,8,10,9,7,7,7,7,7,7,8,8,7,11,8,8,8,7,7,10,8,7,13,12,7,17,10,8,8,11,7,11,11,14,7,11,7,8,6,9,20,8,7,9,16,7,10,6,11,10,8,9,7,16,11,11,9,8,9,8,8,8,11,8,15,8,8,9,7,8,8,11,10,7,5,7,10,10,15,7,7,7,8,7,8,8,10,11,10,10,10,11,11,7,8,6,8,8,8,10,6,8,6,6,7,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,16,6,15,6,7,11,11,7,9,10,11,13,10,6,16,8,10,12,11,6,6,6,6,6,6,6,10,6,10,7,7,7,7,11,7,11,6,6,6,6,6,6,17,7,7,6,6,12,22,6,6,6,6,6,8,6,6,6,6,7,6,6,5,6,6,8,11,6,9,14,11,9,11,7,7,8,6,6,6,8,10,9,6,6,6,6,9,7,6,6,6,6,6,15,6,4,4,4,6,4,17,8,11,6,6,9,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,6,6,6,6,10,6,10,6,6,6,6,12,8,6,6,6,6,6,6,6,6,6,9,6,6,6,6,18,6,6,6,8,9,10,7,8,9,10,11,7,13,6,8,8,6,6,14,7,7,7,7,10,7,14,9,6,6,9,15,9,7,14,6,11,14,13,7,12,8,7,7,7,7,7,12,7,10,9,16,6,8,6,5,17,6,8,10,4,6,4,10,15,17,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,4,4,11,7,4,4,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,19,17,6,10,11,6,6,6,6,18,6,6,11,4,4,4,5,6,6,6,9,5,6,4,6,6,4,6,6,6,6,10,6,6,4,6,6,10,6,10,6,6,6,6,11,6,6,10,6,6,8,6,6,6,8,6,11,4,11,9,10,9,11,4,8,4,11,12,7,9,8,6,7,7,8,12,12,11,13,10,11,7,7,7,9,7,11,10,7,7,7,16,11,10,11,17,9,9,8,8,7,7,7,9,7,7,7,14,7,13,9,11,10,14,10,10,12,11,10,7,10,5,14,8,8,8,9,7,8,7,7,9,8,7,8,7,7,7,7,7,7,7,11,8,10,8,7,8,14,11,8,9,9,9,8,24,10,10,12,7,7,15,11,8,8,12,11,8,9,9,7,8,9,10,11,10,11,7,12,7,7,11,9,8,14,13,12,8,11,10,8,8,7,7,14,9,10,8,9,11,7,14,8,8,13,8,8,12,7,10,14,14,11,9,10,9,9,7,7,11,11,13,9,13,5,5,5,7,9,5,11,12,14,8,7,7,11,10,9,7,8,8,7,10,11,11,5,5,7,5,5,5,7,7,15,7,7,8,7,15,12,12,10,7,8,7,11,7,7,7,23,11,8,8,11,10,7,8,11,7,19,7,7,6,9,9,9,11,3,4,7,8,6,6,4,10,8,2,2]),Yz=new Uint16Array([0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,1,1,1,1,1,17,1,1,1,12,1,12,1,12,13,1,1,1,1,12,1,12,1,1,1,1,1,14,21,1,1,1,1,1,1,1,19,12,1,1,1,1,1,1,1,20,1,1,1,16,18,1,1,15,1,1,1,1,12,1,1,1,1,1,1,1,1,22,1,1,1,1,12,1,1,1,1,1,1,1,1,12,12,12,12,12,12,12,12,12,12,12,12,1,24,25,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,12,12,12,12,1,32,0,0,0,1,1,1,1,35,34,1,1,1,1,1,33,1,1,1,1,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,39,40,0,0,0,0,12,1,1,12,1,1,1,1,43,44,44,44,43,44,43,43,45,44,43,44,43,43,43,43,43,43,45,43,43,43,43,43,43,44,46,46,44,43,43,43,43,43,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,49,51,49,49,49,51,49,50,49,52,49,50,50,49,49,49,50,52,50,52,49,50,50,12,54,54,53,55,50,52,49,49,47,48,56,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,59,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,66,67,12,1,1,65,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,76,79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,12,1,1,1,1,89,1,91,1,1,1,1,1,1,1,1,94,1,1,1,1,1,1,1,1,1,1,1,1,0,1,97,97,1,1,12,1,100,1,1,1,1,1,1,1,98,1,99,1,101,1,1,1,1,1,102,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,110,111,1,1,1,1,1,1,113,113,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,121,122,1,1,1,1,1,1,1,1,1,1,1,1,1,122,1,1,1,1,1,1,1,1,1,1,122,1,1,1,1,1,1,1,1,1,126,123,125,120,1,124,1,1,114,1,1,1,1,117,1,127,1,1,1,1,1,1,119,1,108,1,109,1,12,128,106,1,112,1,1,1,1,1,107,115,1,12,12,12,118,116,1,1,1,1,1,1,0,0,0,0,1,12,12,1,1,1,1,1,12,134,1,1,1,1,1,1,1,1,1,1,1,12,136,1,1,1,1,1,1,1,1,137,138,12,12,135,133,44,44,140,49,49,139,142,141,1,1,0,0,0,0,0,0,0,0,0,0,0,0,145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143,0,0,0,0,1,0,144,132,1,0,1,1,12,12,1,1,1,1,1,0,0,0,0,0,0,0,1,148,147,20,1,1,12,12,1,20,12,12,1,1,1,1,1,134,1,1,152,1,1,1,1,153,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,1,136,1,1,152,1,1,1,1,153,1,1,134,1,1,1,152,1,1,1,1,153,1,1,134,1,1,1,1,1,1,1,1,134,1,1,1,1,1,1,1,1,1,1,1,160,1,1,1,152,1,1,1,1,1,153,1,1,160,1,1,1,1,1,1,1,1,1,1,134,1,1,1,1,152,1,1,1,1,153,1,1,1,134,1,1,152,1,1,1,1,164,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,167,1,1,160,1,1,1,1,1,152,1,1,1,1,1,153,1,1,160,1,1,1,1,1,152,1,1,1,1,1,153,1,154,158,158,12,1,12,166,1,1,1,1,1,158,158,158,154,1,1,1,157,158,161,165,1,1,1,1,157,157,1,1,156,154,154,157,170,156,170,1,1,168,1,156,155,157,1,1,1,1,157,1,159,1,1,1,12,1,162,1,162,1,1,1,162,161,163,169,156,154,1,1,1,1,1,1,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,173,172,173,172,172,172,172,174,174,172,173,172,173,172,172,12,1,12,12,12,12,1,12,12,12,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,196,1,1,1,1,12,202,203,204,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,151,1,1,1,1,1,1,1,1,1,1,1,199,1,1,1,186,1,1,1,1,210,1,1,207,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,12,1,1,1,1,1,1,1,1,177,193,1,1,1,189,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,184,1,1,1,1,1,1,1,194,1,1,1,1,198,1,1,1,1,171,1,1,192,1,1,1,195,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,182,1,12,1,1,12,1,1,1,1,185,1,1,1,191,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,211,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,197,1,1,1,1,1,12,1,1,1,1,1,1,1,1,176,12,1,1,1,179,12,1,1,1,1,1,1,1,201,1,1,1,1,1,1,1,1,1,1,178,1,1,1,1,1,1,1,206,1,1,1,183,1,1,1,190,1,12,1,187,12,1,1,1,1,1,1,1,1,1,1,194,1,1,1,1,181,1,1,1,1,1,1,1,1,1,1,1,1,1,1,175,1,1,1,1,1,1,1,1,1,1,188,1,1,1,1,1,1,1,1,1,1,1,208,1,1,1,1,1,1,1,1,1,1,12,1,209,1,1,12,1,1,1,1,180,1,1,1,188,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,200,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,12,1,1,1,1,1,1,1,1,1,205,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,221,0,0,0,0,0,222,0,0,0,0,0,0,1,12,1,1,1,226,1,1,1,0,227,224,225,1,1,1,1,1,1,232,1,234,1,1,1,1,1,1,1,1,1,1,1,230,1,1,1,1,1,236,1,1,12,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,235,1,1,1,12,1,1,1,1,231,1,1,1,229,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,233,1,1,1,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,242,13,1,1,1,12,12,239,240,1,1,1,1,241,1,1,12,1,1,1,1,1,1,1,243,1,1,12,16,1,1,1,1,1,1,244,1,1,1,12,12,1,1,1,1,1,1,244,12,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,253,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,257,257,1,0,0,0,0,0,1,12,0,0,0,0,0,0,0,0,172,262,263,1,12,1,1,1,1,12,265,1,1,264,1,1,267,1,1,1,1,1,1,0,1,1,1,271,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,12,1,0,1,0,0,0,0,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,12,0,282,0,0,283,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,12,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,59,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,1,0,307,0,0,0,0,0,0,0,0,0,309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,12,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,325,325,326,325,0,188,1,1,13,321,1,319,0,0,0,0,0,0,0,322,1,1,327,1,207,1,1,1,1,320,1,317,1,323,1,315,1,324,1,316,1,1,1,1,1,1,1,12,1,1,1,1,12,318,318,1,1,1,186,1,1,12,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,12,1,1,1,1,314,1,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,330,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,267,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,370,370,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,338,349,1,1,337,372,1,343,1,1,335,367,1,1,353,334,339,1,1,1,346,377,355,1,1,1,1,1,1,356,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,365,369,0,0,79,1,1,0,363,340,376,341,344,351,1,366,0,1,0,79,360,358,1,0,0,1,1,1,0,0,0,0,379,1,1,350,1,79,1,0,1,1,1,382,1,0,0,79,357,0,1,336,1,1,1,0,1,1,359,1,0,1,1,1,0,1,384,347,1,1,0,1,0,0,375,0,1,1,1,79,368,1,1,364,361,1,1,1,1,1,1,1,1,1,1,1,342,1,1,1,1,1,1,1,1,1,1,1,374,0,79,1,1,1,1,0,1,1,1,1,1,1,0,0,1,1,378,1,1,1,0,0,381,0,0,0,1,354,1,0,79,380,1,0,0,0,0,383,1,1,0,0,1,0,1,0,352,0,348,0,1,1,1,0,1,1,0,371,345,373,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,12,1,1,1,12,399,399,1,1,12,12,1,399,1,1,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,411,1,1,0,1,1,1,1,207,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,429,429,1,1,0,0,315,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,442,1,441,1,1,1,1,1,1,1,1,1,446,1,12,12,1,1,1,1,1,12,1,1,1,1,454,1,1,1,456,1,1,1,1,1,1,1,1,1,1,453,1,448,1,1,1,1,435,1,1,1,1,1,1,1,1,449,12,1,1,1,1,455,1,1,1,450,444,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,315,1,432,1,1,12,452,1,1,315,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,437,1,1,1,1,1,1,1,1,1,1,1,455,1,1,1,1,315,1,451,1,1,1,445,439,1,1,1,1,1,440,1,457,443,1,1,1,1,1,438,1,1,1,1,1,1,1,1,1,433,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,447,1,1,1,1,1,1,1,1,1,1,1,1,436,1,1,1,1,1,434,1,221,458,1,1,1,1,1,12,1,1,1,1,12,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,0,0,464,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,12,1,67,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,468,0,468,468,468,468,468,468,468,0,468,468,468,468,468,1,468,468,468,0,468,468,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,473,472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,477,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,470,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,471,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,469,0,0,480,475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,474,0,0,0,0,0,0,0,0,0,0,0,0,0,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,469,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,12,1,1,1,1,1,1,1,1,1,1,1,1,490,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,201,201,1,494,1,1,1,493,1,1,1,1,489,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,491,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,495,1,1,492,1,1,1,1,1,1,1,1,370,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,496,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,507,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,12,1,509,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,12,12,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,1,0,0,0,1,59,1,1,12,12,12,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,528,1,1,1,1,1,1,1,529,1,1,1,1,1,1,1,527,1,1,12,1,1,531,240,1,1,12,12,1,1,12,1,12,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,541,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,132,1,12,546,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,107,1,1,12,1,1,1,12,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,551,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,144,1,1,1,229,1,1,12,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,576,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,221,1,326,1,1,1,1,1,1,1,1,1,0,0,581,1,1,1,1,0,583,0,79,0,582,0,1,1,1,0,1,1,1,1,1,1,12,0,0,0,1,0,1,0,0,0,0,0,0,590,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,585,585,0,589,587,585,585,585,585,585,591,585,585,595,585,585,585,585,585,585,585,585,585,585,592,589,585,585,589,585,585,585,585,585,585,585,585,585,585,585,585,585,587,585,585,585,585,585,593,585,585,585,585,585,585,0,0,0,1,594,1,1,1,1,588,1,1,1,1,1,586,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,12,599,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,12,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,1,1,12,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,64,279,305,410,537,0,4,68,237,255,281,306,332,386,412,0,501,521,538,601,9,0,60,88,396,408,428,579,0,499,520,534,616,0,30,6,0,463,502,606,564,70,0,7,284,256,387,465,415,540,79,602,0,580,308,417,467,9,105,287,508,6,30,0,310,79,389,79,485,10,6,131,249,274,0,617,511,0,567,0,63,6,6,252,95,2,431,397,409,600,0,6,0,6,285,103,6,565,503,542,0,466,388,272,286,8,71,104,603,545,390,311,299,418,146,74,289,549,512,605,568,333,328,481,6,75,149,11,0,250,524,550,569,516,554,574,615,36,6,261,294,331,303,219,30,530,557,219,41,217,266,295,304,405,422,483,273,0,73,566,0,402,416,298,79,248,79,0,584,548,506,291,420,79,391,385,0,0,0,9,559,575,218,0,423,406,533,518,577,619,85,219,42,296,394,424,573,0,513,292,275,79,216,80,28,388,30,6,392,329,302,608,596,526,553,515,0,259,81,30,404,421,0,30,425,0,220,597,519,9,407,426,219,249,86,223,598,578,561,484,427,395,251,228,87,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,413,0,0,0,0,0,0,0,0,82,0,129,0,0,84,552,0,0,0,0,0,0,0,27,0,555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,413,0,0,0,0,505,0,258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,621,0,0,0,0,0,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,393,0,0,0,486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,497,0,0,0,0,0,0,403,0,0,0,0,0,0,0,0,0,0,0,0,0,212,0,0,0,0,0,0,0,0,0,0,0,517,0,0,0,0,0,0,0,0,0,0,0,0,498,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,280,0,0,0,0,0,532,276,0,0,0,0,0,0,0,0,0,0,0,0,0,514,0,0,0,0,0,0,0,0,0,0,0,459,0,0,0,313,0,0,0,0,0,0,254,0,0,0,0,0,0,23,0,0,0,0,572,0,0,0,0,604,523,0,0,0,0,245,0,0,0,0,0,0,461,0,0,482,0,0,0,0,0,61,0,0,0,268,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,0,0,0,0,0,278,614,0,72,0,0,0,0,0,0,0,0,0,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,0,277,0,0,0,0,0,0,571,0,0,0,0,0,0,525,0,0,0,0,0,0,0,0,0,570,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,214,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,0,504,0,0,0,0,0,558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,83,0,0,0,0,0,0,0,0,0,0,0,0,488,0,487,0,0,0,0,0,0,0,0,0,0,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,539,0,0,0,0,0,0,0,0,297,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,238,0,0,0,0,0,0,0,0,0,0,84,0,610,0,0,556,0,0,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,613,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,522,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500,0,618,0,0,430,0,0,0,0,0,0,0,0,0,0,0,0,401,0,0,0,547,0,93,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,29,92,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,0,215,0,0,0,0,0,0,562,0,0,0,0,130,0,0,0,0,0,563,0,0,0,0,0,0,0,413,419,0,0,0,0,0,0,0,0,0,0,0,0,0,0,398,0,312,0,0,0,0,0,5,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,0,0,0,0,0,0,536,0,0,0,414,0,0,400,0,0,0,0,0,0,607,0,0,0,543,0,0,90,0,544,0,0,0,0,0,0,0,0,0,0,510,462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,413,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,0,0,0,0,560,0,0,0,0,0,0,0,0,0,0,301,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,0,0,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,627,627,627,627,627,627,627,626,628]),Xz=`orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitglideossnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxysiteacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstorageedaccogoorusorgcomnetinteduaéroportxn--aroport-byaassogouvcomilgobgovcloudnses-1eu-west-1us-east-1euvipit1eurarubait1s3lbwebsites3websiteru-spbru-mskelasticcsrunstnukukcaukusnl-ams-1fr-par-1fr-par-2functionsnodess3ddlwhmrdbfnck8sifrs3-websitecockpitscblmgdbdtwhkafkpubprivs3ddlwhmrdbk8sifrs3-websitecockpitscblmgdbdtwhkafks3ddlrdbk8sifrs3-websitecockpitscblmgdbdtwhkafkk8sscalebookpl-wawfr-parnl-amsbaremetalsmartlabelinginstancesdechk2kuleuvenlaravelvoorloperurownoxazapscwhstgrvaporonline-serverobservablehqelementorantagonistreclaimjoteluluencowaydiademjelasticmatlabmagentositetrendhostingaxarnetperspectajenv-arubajelejoteravendbemergenttrafficplexconvexkeliwebserveboltbegetcdnstaticson-rancherprimetelonstackitunison-servicesdnshomelinkyardbarsyjelecloudnscocomnetgovmycn-northwest-1cn-north-1s3s3-accesspoints3-websites3s3-accesspointrdsdualstacks3-deprecatedemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspoints3s3-accesspointrdsdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicn-northwest-1cn-north-1cn-northwest-1ebcomputeelbcn-north-1airflowcn-northwest-1cn-north-1oncn-northwest-1cn-north-1amazonawssagemakeramazonwebservicesdirectasgdsdhehahljlnmhbacscahqhshhihnlnynsnmofjbjzjxjtjhkcqtwgsjssxnxjxgxxzgz網絡网络公司orgmilcomnetedugovxn--55qx5dcanva-appsxn--io0a7iquickconnectcanvasitekhsjxn--od0algcanva-codemyqnapcloudsrvrlessclustersrealtimestorageleadpagescarrdcrdorgmilcomnomnetedugovhidnssupabaserdpareplmypiumsoxmitotaplpagesfirewalledreplitowodevwebview-assetsvfswebview-assetss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecateds3-websites3-object-lambdaexecute-apis3s3-accesspoints3-websites3-accesspoint-fipss3-fipss3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipss3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9vfss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1us-northeast-1ap-southeast-1me-south-1af-south-1ap-south-1ap-southeast-7us-west-2eu-west-2ap-east-2us-east-2ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ap-southeast-6ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1mrapaccesspoints3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3eu-west-3ap-south-2eu-south-2computes3-ap-northeast-2elbrdss3-ap-east-1s3-sa-east-1s3-us-gov-west-1s3-eu-central-1s3-ca-central-1eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3s3-website-us-west-2s3-website-eu-west-1s3-external-1eu-central-1me-central-1ca-central-1il-central-1s3-us-west-1s3-eu-west-1s3-website-sa-east-1s3-website-ap-southeast-2ap-northeast-1ap-southeast-1s3-us-west-2s3-eu-west-2me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2s3-website-ap-southeast-1s3-1s3-globals3-ap-northeast-3eu-north-1airflowap-southeast-2s3-us-gov-east-1s3-fips-us-gov-east-1s3-me-south-1s3-ap-south-1ap-northeast-2s3-website-us-west-1ap-southeast-5s3-eu-north-1s3-ap-southeast-1s3-website-us-gov-west-1compute-1s3-eu-west-3us-gov-west-1s3-website-ap-northeast-1us-gov-east-1s3-fips-us-gov-west-1s3-website-us-east-1s3-ap-southeast-2ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3-us-east-2s3-ap-northeast-1authauthauth-fipsauth-fipseu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1rframeservicesbuilderstg-builderdev-builder*ociocpocsazuregcpawsdemoinstanceeu-west-3eu-south-2ap-southeast-3ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1previeweu-4us-4us-1eu-1us-2eu-2us-3eu-3appscomputepaasrag-cloudrag-cloud-chjcloudjcloud-ver-jpcdemonodebalancermembersipeuxvsoncillaocelotonzayalilynxsphinxfentigercustomercaracalo365cloudstaticxendevapp001testcode-builder-stgplatformmediasiteprojedrydpagesjsx0desazacncoitrueu4uhkukgrbrushatenadiarymyspreadshopfrom-flfrom-wvwebspace-hosttheworkpchatenablogcursorusercontentservesarcasmapplinzisakuratanwixsiteappchizigiizeis-into-carsdnsiskinkyadobeaemcloudis-a-therapistpgfogmyvncdojinis-an-actress1kappfldrvkozowqa2jpnmexprgmrfirewall-gatewaydynnscafjsfbsbxooguyfrom-gawoltlab-demois-a-anarchistwiardwebteaches-yogadattowebtb-hostinglive-websiteservegamegotpantheonfrom-nhsubsc-payfrom-ohvipsinaappfrom-cadyndns-officehomelinuxfrom-mahercules-appservebbsstreakusercontentfrom-okfrom-wyfastly-terrariumis-a-llamaqualyhqportalserveexchangeon-vaporvivenushopciscofreakgrayjayleaguesmetaaiusercontentfrom-iais-a-libertariansaves-the-whalestaveusercontentyolasiteoperaunitepoint2thisis-a-catererclaudeusercontentlinodeusercontentfrom-vagithubusercontentsells-for-lesshosteurcanva-appsplaystation-cloudddnsfreefrom-pafrom-prfrom-waddnskingoutsystemscloudhotelwithflightmydattois-a-nascarfanmydbserverminiserverdamnserverservehumouris-a-playerfrom-nvfrom-nmemergentagentgentappsamplifyappfrom-kyis-an-accountantnfshostserveircfrom-akpythonanywherestackhero-networkpostman-echolikescandydyndns-mailobservableusercontentserveftpfreeboxosfrom-utcdn77-storageamazonawsneat-urldyndns-serverlinodeis-a-teacherfrom-vtgleezemythic-beastsus1-pleniteu1-plenitla1-plenitpaywhirlservecounterstrikejdevcloudhealth-carereformis-into-animegoogleapisis-a-painterafricaisa-hockeynutatmetais-an-actora2hostedis-a-democratdatadetectest-le-patrondigitaloceanspacesis-a-designeris-a-hunterlinodeobjectstemp-dnsissmarterthanyoufrom-arsimplesiteevennodetownnews-stagingis-a-liberalgooglecodejelasticservemp3qualyhqpartnerdyndns-free1cooldnsest-a-la-masiondrayddnsdynuddnsfrom-orfrom-miis-a-bloggerfrom-himydobisscanvacodeis-an-engineerest-a-la-maisonupsunappdevinappswafflecellmyasustorwpenginepoweredfrom-ctservep2psame-appmyshopblocksthingdustdatalikes-piediscordsezis-with-thebandlpusercontentis-leetshopitsite3utilitiesis-a-personaltrainersinaappladeskis-a-cheflogoipselfipbase44-sandboxnospamproxyalibabacloudcsmesswithdnsauthgearappsiamallamawithgooglelutrausercontentmochausercontentframercanvasmytabitdyndns-homew-credentialless-staticblitzcpserverdiscordsaysis-a-nurseappspotatlassian-isolated-3premotewdfrom-mtwixstudiocode0emm180rmyactivedirectoryawsappsmytuleapdnsabrpolyspaceqbuserrenderbuiltwithdarkboutirgotdnsabrdnsdopaascanva-hosted-embedawsglobalacceleratorhomesecuritypcmyiphostditchyouripclever-clouddyndns-ipon-aptibleis-a-musicianhosted-by-filessecuritytacticsappspaceusercontenthomeunixstrapiappsame-previewcf-ipfsmycloudnaselasticbeanstalkis-certifieddontexistkasserverik-serverdrive-platformatlassian-3pfirebaseappherokuappawsapprunnerbarsycenteris-a-cubicle-slaveservehttpmyshopifyis-a-guruquicksytessiiitesorsitesmagicpatternsappis-a-cpameteorappfrom-wiis-a-rockstarbumbleshrimpdattolocaldatabricksappsreadthedocs-hostedfrom-rifamilydsdyndns-picsplesknsbplaceddnsaliasdynaliasdyndns-remotedoomdnsip-ddnsblogdnsis-a-doctorroutingthecloudamazoncognitobarsyonlinedsmynasddnsgurucloudflare-ipfsdeus-canvasfrom-idsmushcdnpagespeedmobilizerdyndns-at-homeunusualpersonhosted-by-previderis-a-republicandyn-o-saurstreamlitappworkisboringonthewificprapidqualifioappis-uberleetis-slickgetmyipwpdevcloudtypeformdyndns-at-workgentlentapismynascloudw-corp-staticblitzfrom-ingeekgalaxyservebeerfrom-mdonrenderspace-to-rentaivencloudappspacehostedwafaicloudcodespotblogspotatlassian-3p-us-gov-modfrom-ndfrom-msis-a-techieis-a-studentcustomer-ociis-a-photographerdurumisfrom-ksmassivegriddyndns-wikiis-an-entertaineris-a-hard-workermysecuritycamerafrom-mnrackmazedyndns-blogis-a-bulls-fanwritesthisblogfreemyipsimple-urlfrom-sdreservdauthgear-stagingest-mon-blogueuris-into-gamesrice-labsxtooldevicesakurawebis-an-anarchistoraclecloudappsdyndns-worksells-for-urhcloudfrom-dcfastvps-serverwpmucdnis-a-geekscrysecfrom-txis-into-cartoonsmodelscapetrycloudflarelocaltonetstreak-linkbalena-devicesfrom-njforgeblocksfreebox-oswebadorsitefrom-ncdoesntexisthobby-sitestreaklinkshomesecuritymacownprovidertuleap-partnersdattorelaywphostedmailservequakeis-a-socialistservehalflifepivohostingdynuhostingquipelementsw-staticblitzdyndns-webfrom-deproject-studyaliases121is-not-certifiedhercules-devis-a-financialadvisorservepicsis-a-greenloseyouripfrom-ilwithyoutubemwcloudnonprodwiredbladehostingdnsdojofrom-tnpixolinomyqnapcloudis-an-artisthostedpiis-a-landscaperauiusercontentoaiusercontenton-forgeis-a-conservativedreamhostersnet-freaksapps-1and1is-goneencoreapifastly-edgefrom-nesalesforcefrom-scdeployagentoraclegovcloudappsfrom-alis-a-lawyercechirevultrobjectsstufftoreadisa-geekddnsgeeklovableprojecttry-snowplowfrom-moblogsyteis-a-bookkeepernogmyforumravendbmyboxdeelementoredsaacficogoorinforgcomgobnatneteduidstoreorgcomnetintedudevnomepublorgcomneteduathgovtestscalculatorspaynowinfoquizzesresearchedcloudnsfunnelsassessmentsjscaleforcetmacltdorgmilcompronetgovbizpresseklogesrsccloudcustomfltusrcloude4corealmgovmunicontentproxy9metacentrumdyndyndyndnsdynpagespages-researchitionoccustomercomymyspreadshopipv64diskussionsbereich4limacomrub2ixfirewall-gatewayddnssspdnsbarsykeymachinesquare7myhome-serverspeedpartnercommunity-proschuldockxenonconnectgünstigliefernbwcloud-os-instancedyndnssecmy-routerxn--gnstigliefern-wobin-butterl-o-g-i-nisteingeekin-dslin-berlinin-brbfuettertdasnetzleitungsenin-vpnlcube-serverdyn-ip24logoipdyn-berlinruhr-uni-bochum12hpgoipsrvdnsfruskygit-repossvn-reposinternet-dnsgünstigbestellenhome-webserverxn--gnstigbestellen-zvbbplacedheimdnscosidnswebspaceconfiglima-citydyndns1istmeinvirtualuserschulplattformmy-gatewayddnsseclebtimnetztest-iservmein-iservvirtual-userhome64iservschuletaifun-dnstraeumtgeradeschulserverdynamisches-dns123webseitednshomehs-heilbronndnsupdaterbssgraphicdwadpdwdaepeweaawapaafpfwfabwbpbacwcpcciwebuserapiobjectsidsiskospockkimodorikerbonesteamsparisjanewaypicardglobaltarpitreedpikekiraworfsulukirkarchertuckerhackercanarywesleystagingprereleaset3r2lpbravepanelngrokiservstglclcrmerpflypagesbarsyvivenushoplocalcertlocalplayerbearbloggatewaydeno-stagingis-not-ais-a-goodbotdashvercelmocha-sandboxplatter-appreplitgithubpreviewworkersinbrowserevervaultis-ahrsndenoxmitmodxmyaddrstorageapipayloadgrebedocruncontainersstgstagelclstageloginlineis-a-fullstackcodepenleapcellngrok-freeis-coolstoragewebharemediatechlibp2pdiscourseimaginecomyspreadshopstoreregbiz123hjemmesidefirmcoorgcomnetedugovsldorgmilcomwebgobartnetedugovtmorgpolcomsocartnetedugovassoagrondiscoodontk12medcuegyecpaabgengorgmilgalsaltulcomadmesmgobpubdocmonfindgnriouioproartlatvetnetfotedulojgovntrturibrbarxxxofficialbasechefprofmktgpsictechinfoarqtcontdentrrpppsiqgit-pagesritmedfieorgcomlibprieduaipgovriikmeactvsportorgmilcomscieunnetedugovnameinfopintouchtawktotawkmyspreadshoporgcomnomgobedu123miwebcomputeorgcomnetedugovbiznameinfocognito-idpeusc-de-east-1onjelasticnxaspdnsbarsydirectwpdeuxfleurstransurldogadoprvwcloudnsamazonwebservicesdnshomeuserpartycokoobinmkmfidymyspreadshopalandkapsiikixn--hkkinen-5wacloudplatformhäkkinen123kotisivuidacorgmilcompronetedugovbiznameinforadioorgcomneteduuserexperts-comptablestmmyspreadshopgretaprdcomnomynhccifbxoshuissier-justicenotairesaeroportfreeboxoson-webavocatassoportgouvkdnschirurgiens-dentistes-en-franceavouesfbx-os123sitewebveterinairechirurgiens-dentistespharmacienchambagrimedecinfreebox-osdediboxgoupilemszicpyicpvicppleysheezypagesedugovcnpyorgcomcybllcpvtnetedugovtnxonlineschooldaemond6atcopanelorgnetplybotdashstackitkaasorgmilcomnetedugovbizmodltdorgcomedugovcoorgcomneteduappwriteacorgcomnetedugovcloudtranslateusercontentorgcomnetedumobiassoorgcomnetedugovbarsysimplesitediscourseindorgmilcomgobneteduorgcomwebnetedugovguaminfonxhra教育敎育網絡网絡组織組織网络網络组织組织公司政府個人个人箇人ltdorgcomincneteduidvgovxn--uc0ay4axn--55qx5dxn--mk0axixn--io0a7ixn--uc0atvxn--zf0avxxn--lcvr32dxn--od0algxn--wcvs22dxn--gmqw5axn--od0aq3bxn--mxtq1mxn--ciqpnxn--tn0agxn--gmq050iorgmilcomgobneteduiservwp2tempurlmircloudfreesitewpmudevmyfastgadgetcloudaccessjelehalfboltfastvpsemergenteasypanelopencraftizcombrendlynamefromrtpersoadultmedorgpolrelcomproartnetedufirminfoassoshopcoopgouvtmcomediahotelforumvideosportorgsexagrargameslakaseroticaerotikatozsdereklamcasino2000filmsuliinfoboltshopprivnewsszexcityutazasjogaszkonyveloingatlaneacaicogoormyᬩᬮᬶmilwebschnetkopbizzonedesaponpesxn--9tfkymyspreadshopgovmytabittabitorderravpageaccok12idforgnetgovmuniltdplcaccotttvorgcomnetmeca6g5gpgamubacaicniocoukuptverdruscsdelhiindorgmilcomwebnicfingenpronetintedugovresbizbiharbarsyinternetbusinessschooltravelsupabasealumnigujaratfirminfoaeropostbankcoopindevscloudnsno-ipbarsybarrell-of-knowledgebarrel-of-knowledgensupdategroks-thisdnsupdatefor-ourknowsitalldvrcammittwalddynamic-dnsv-infowebhopselfipdyndnshere-for-moreilovecollegemayfirstforumzcloudnsmittwaldservertypo3servergroks-theeusekd1cdndyndnsidrawsainaueuapjpusstagemocksysdevicesclientcustreservdcustdevdisrecprodtestingcobeebyteutwenteboxfusebravepstmndedynngrokorgmilcomnomnetedugovqcxqzzbarsythingdustmo-siemensrb-hostingfh-muenstergitbookbluebitecloudbeesusercontentnodeartkiloappsforgerockdarklangresinstagingapigeebubbleb-datascryptedhypernodedappnodepantheonsitegitlabgithubkeeneticvirtualservercleverappshostyhostingon-rioedugitticketstelebitwixstudioon-k3sicp0icp12038jeleqotolairbubbleappsmyaddrstolosmyrdbxwebflowdrive-platformbeagleboardhasura-applolipopdefinimavaporcloudmusicianwebflowtestazurecontainerresindevicereadthedocsloginlineeditorxmoonscalesandcatsbasicserverwebthingsbrowsersafetymarkbeebyteappbitbucketidaccovistablogorgschnetgovxn--mgba3a4f16axn--mgba3a4fraarvanedgeايرانایرانjclaspeziapdudcefegelemeperetevebacanatavaparasabgagfgogrgpgalclblimfmrmcbmbvbfclcmcvcrcpcchlimifibicivipirisimncnbnanenrnpntnnolomobocoaogorosopotoptvtatctbtmtltotpusulunutpspapaqsvpvvvtvavvrtrsrprgrfrcrbrarorkrvstsssbscsmsispzczbzbozen-suedtirolmyspreadshopxn--bulsan-sdtirol-nsbxn--valledaoste-ebbtrentinoaltoadigetrentin-sued-tirolxn--forlcesena-c8axn--forl-cesena-fcbxn--bozen-sdtirol-2obtriestetrentinsuedtiroltrentino-s-tirollecceudineaostesienaparmaluccapaviagenoapaduaaostamonzaabruzzoternirietiturinmilanbozenlaziofermoleccocuneonuoropratola-speziavdataaligfvgpugmolcalcamlomumbsicpmnvenvaoedugovabrsarmaremrbastoslazibxosfirenzetrentinosüdtirolval-d-aostavalle-aostamessinacremonaravennatoscanatrentin-suedtirolbolognacalabriaurbinopesarofriuli-v-giuliaogliastraxn--valle-aoste-ebblaquilaandriatranibarlettasyncloudxn--valle-d-aoste-ehbaostavalleyvalled-aostatrentino-alto-adigevallee-d-aostexn--balsan-sdtirol-nsbpistoiasicilialucaniacataniaiserniaperugiabresciaveneziagorizialiguriaimperiabulsan-suedtirolbalsan-suedtirolbarlettatraniandriaxn--trentino-sdtirol-szbforlì-cesenatuscanyvallée-d-aostemantovavallée-aostecasertapiemontevalleaostaval-daostafriulivgiuliatrevisoforli-cesenavalléedaosteferrarapescaravald-aostatrentino-altoadigefriuli-vegiuliavallee-aostecarboniaiglesiastarantomediocampidanovalleedaostetrentinosud-tirolcampobassotrentinsüd-tiroltrentinosüd-tirolmonzabrianzatrentino-südtirolxn--trentino-sd-tirol-c3bpotenzacosenzavicenzaemiliaromagnavenicefrosinonemarchepordenonetrentinosued-tirolvaresemolisevalléeaostefriuli-veneziagiuliabasilicatalatinaanconasavonaveronamodenabiellabolzano-altoadigepugliafoggiaumbriatrentino-stirolgenovapadovamateranovararagusapiacenzatrentinostirolvalleeaostetempio-olbiasudsardegnatrentinsudtirolmassa-carrarafriuliveneziagiuliatrentinosuedtirolandria-barletta-tranitrapanixn--cesenaforl-i8amaceratacaltanissettaascoli-picenobrindisicarraramassacagliaririmininapolivibo-valentiachietibulsan-sudtirolbalsan-sudtiroltrentino-a-adigebulsanbalsaniglesiascarboniamilanotorinoteramodell-ogliastraarezzotrentinoalto-adigerovigotrentovenetoiglesias-carboniatrentino-sud-tirolaltoadigereggio-emiliareggio-calabriasardegnatranibarlettaandriapiedmontxn--sdtirol-n2amedio-campidanotrentino-süd-tirolfriuli-vgiuliafriuli-ve-giuliaromeennaromapisa32-b16-b64-blodiastibarineencomonaplesforlicesenailiadboxosalessandriasicilytrani-barletta-andriaxn--trentin-sdtirol-7vbpesarourbinotrentinsued-tirolcesena-forliforlìcesenaemilia-romagnamonzaebrianzaxn--trentinsdtirol-nsbtrentinos-tiroltrentinsüdtirolvalledaostaolbia-tempiocampidanomediovibovalentiasassarivalle-daostalombardysud-sardegnafriulivegiuliareggioemiliamonzaedellabrianzaalto-adigevercellitrentin-sudtiroltraniandriabarlettatrentino-sudtirolascolipicenobozen-südtirolfriulive-giuliaflorencexn--cesena-forl-mcbcarbonia-iglesiasaosta-valleycarrara-massadellogliastratrentinoa-adigexn--valleaoste-e7apesaro-urbinoxn--trentinosdtirol-7vbxn--trentin-sd-tirol-rzbxn--trentinsd-tirol-6vbtrani-andria-barlettatrentin-süd-tirolxn--trentinosd-tirol-rzbgrossetomonza-e-della-brianzasüdtirolreggiocalabriatrentinoaadigetrentin-südtirolverbano-cusio-ossolafriuliv-giuliaverbaniacampaniatrentino-aadigefriulivenezia-giuliasardiniaandriabarlettatranibarletta-trani-andriacatanzarooristanourbino-pesarocesena-forlìvalle-d-aostacampidano-medio123homepagesiracusatempioolbiasuedtirollombardiaavellinocesenaforlìtrentinofriuli-venezia-giuliabozen-sudtirolandria-trani-barlettabulsan-südtirolbalsan-südtirolmonza-brianzabolzanotrentino-sued-tirolbellunosalernolivornocrotonesondriodnshometrentinsud-tirolmassacarraratrentin-sud-tiroltrentino-suedtirolviterbobergamocesenaforliolbiatempiopalermobeneventoagrigentoofcoorgnetfmaitvphdengorgmilcomschnetedugovperagrikanieasukehandachitatokaiaisaikonanoharuamaobuhigashiuraowariasahiinuyamatobishimaiwakurashitarainazawatoyonegamagorimihamatoyotataharakariyayatomioguchikomakimiyoshinishiotokonamekiyosuchiryutoyohashiokazakiisshikikasugaikotakiratoeianjotogofusosetohazutsushimashinshirotakahamanisshinshikatsuhekinantoyokawaichinomiyatoyoakeodateogataakitaikawakyowahonjoogayurihonjonoshirokamiokakatagamimitanegojomeyokotekosakadaisenkazunonikahohonjyomoriyoshimisatohappoukamikoanihachirogatahigashinarusesembokufujisatokitaakitaitayanagiowanitakkomutsutsurutahirosakigonoheoirasetowadamisawanohejiaomorishingohiranairokunohehashikamitsugarushichinohehachinohenakadomarisannohekuroishisakaeisumiasahiotakiinzaiabikomatsudoyachiyomutsuzawakujukuriomigawakashiwatoganemihamanaritasakuranagaramobarahanamigawachoshishiroichoseikozakishisuikatorimidorichonankyonanfuttsuonjukufunabashinagareyamanodasosatakochuotohnoshourayasukimitsuyokaichibayotsukaidosodegauratateyamakamagayayokoshibahikariyachimatakatsuuratomisatokisarazukamogawaichikawanarashinoichinomiyashimofusaminamibososhirakoichiharaoamishirasatoikatahonaiainansaijoseiyoiyoozuuwajimaniihamanamikatamasakiuchikokihokutobetoonshikokuchuomatsuyamaimabarikamijimakumakogenyawatahamamatsunosabaeikedaobamasakaifukuiohionotsurugamihamawakasaminamiechizeneiheijikatsuyamatakahamaechizensoedaukihaomutaokawanishiogoribuzenonojosueumiokiotochikugosasagurisaigawamizumakishinyoshitomikurumekurateyamadakasuganakamamiyamanogatatakatahakataiizukakawaratagawakasuyaashiyainatsukimunakataminamitsuikishonaikurogifukuchikeisenhigashimiyakoshinguyukuhashiokagakiyamekogaongausuikahotohochuotoyotsumiyawakadazaifuhisayamatachiaraiyanagawanakagawahirokawachikujochikushinochikuhochikuzennamieotamaokumashowateneiiwakikoorinangoononishigoshimogoomotegomishimafukushimaasakawakagamiishishirakawaiitatefutabahiratayugawahanawakitakatakawamatakunimiyabukibandaihigashihironoyamatomiharuyamatsuriaizubangedatesomaaizuwakamatsuyanaizuaizumisatonishiaizuizumizakikitashiobarataishinkaneyamakoriyamainawashirotanagurafurudonosamegawasukagawaishikawatamakawaikedaogakitaruiginanenahashimahichisonakatsugawaibigawashirakawamizunamiminokamomitakekawauesekigaharatomikasakahogikitagatayamagatatajimianpachimotosuyaotsukakamigaharahidakanisekitokigujominogodoyorogifukasamatsutakayamawanouchihigashishirakawakasaharashimonitatsumagoichiyodakannakanrashowameiwakiryuotaoratomiokafujiokaitakuranaganoharahigashiagatsumatakasakishibukawaminakamikatashinatsukiyonokawabanumataannakaoizumimidorishintoisesakiuenoyoshiokakusatsutakayamanakanojonanmokutamamuratatebayashimaebashiotakekaitadaiwahongofuchukuietajimashobaramiharahatsukaichihigashihiroshimamiyoshikumanokurenakasakaseraseranishiasaminamifukuyamashinichionomichiosakikamijimajinsekikogentakeharaotobenanaeikedatohmaozoraobiraabirakyowaeniwataikibibaisharirebunerimohiroooketootarupippunishiokoppechitosefurubirahakodateshiranukakitahiroshimakushiroobihironanporoiwamizawaniikappukunneppufukushimanakasatsunaitoyourakuromatsunaiakabirakamisunagawashibechaurakawakamifuranonakatombetsuasahikawashimokawakayabeokoppebiratoriabashirisaromaatsumanumatahidakabifukamukawamikasahorokanaitoyotomisarufutsuhigashikawaishikarikitamiyoichiesashiiwanaitomariminamifuranoakkeshifuranotoyakoyakumootoineppushikaoishiraoinemuronayorohaboroashorobihororishirifujiutashinaihokutotakasuebetsuurausuassabukikonaishimamakinaiedatetoyabieinikiesanuryuoumuteshikagarikubetsuashibetsukimobetsuaibetsutobetsusobetsuembetsushimizuchippubetsurishirihokuryuhoronobeshintokutsubetsushibetsuhonbetsumombetsutsukigatakuriyamakoshimizushiriuchikutchanmurorannoboribetsukamishihorowassamushinshinotsukembuchiwakkanaikamoenaikiyosatotakinoueshikabesunagawafukagawanakagawatakikawakamikawahigashikagurahamatonbetsumatsumaemoseushirankoshishakotanimakanemashikeotofuketomakomaisandatambaitamiawajikasaiasagoshisoonoakoyashirotoyookaminamiawajiinagawafukusakitakasagokamigorikasugaharimayokawaashiyahimejiakashitaishiaogakisannantakinosumototakarazukanishinomiyashingugoshikinishiwakiyokatakaaioimikisayoyabukawanishiamagasakisasayamashinonsenkakogawaichikawakamikawatatsunotsukubaiwamaogawaasahisakaitokaioaraiitakobandodaigosuifuinaamikasumigaurakashimaomitamayachiyoshimodatetomobetoridehitachinakainashikisakuragawakasamayawaramoriyahitachiomiyanamegatayamagatahitachikamisuushikutakahagiibarakitonekoganakasowayukimihojosomitoryugasakishimotsumafujishirotsuchiurachikuseihitachiotashirosatotamatsukuriuchiharashikahakuinanaotsubatawajimakahokukawakitatsurugikaganominotosuzuuchinadakomatsuanamizunakanotohakusannonoichikanazawaiwateshiwafudaikawaimoriokaofunatohanamakikuzumakikitakamininohekunoheyamadayahabasumitaichinosekitanohatahiraizumirikuzentakatajobojiotsuchihironomiyakoiwaizumikarumaiichinohenodakujitonooshushizukuishifujisawamizusawakamaishikanegasakimannoutazukotohiraayagawazentsujihigashikagawauchinomikanonjisanukimarugamemitoyotakamatsutadotsunaoshimatonoshoakuneamamiizumihiokiyusuikinkoisasookouyamanakatanekagoshimakanoyaisenkawanabeminamitanemakurazakitarumizunishinoomotematsumotosatsumasendaioimatsudaayaseebinamiurazushinakaiodawaraiseharasagamiharahakoneaikawakaiseiatsugitsukuihadanoyamatoyamakitazamaoisochigasakininomiyayokosukakamakuraminamiashigarafujisawasamukawakiyokawahiratsukayugawaraokawaumajikochitsunootoyoakiinonishitosayasudahidakamiharasakawaniyodogawahigashitsunokagamigeiseisusakiotsukinaharisukumomurototosakamiochitoyotosashimizumotoyamanankokunakamurakitagawayusuharaogunichoyoukiasoutoozugyokutoamakusamifunetakamoriyamagaminamataminamiogunikikuchisumotoyamatonagasumashikiaraokumamotokamiamakusanishiharayatsushiroayabeseikasakyoideineujinakagyokameokakyotangokyotanabekyotambaminamiyamashiroyamashinatanabeyawatawazukaminaminantanmiyazuhigashiyamafukuchiyamakitamukokamojoyokizumaizuruujitawaraoyamazakinagaokakyokumiyamakawagoeinabeshimameiwaasahitaikiudonoisetsukisosakikuwanamihamamiyamasuzukatamakimisuginabarikumanokomonominamiisewataraitobakiwatakikihotadomatsusakayokkaichikameyamaureshinoishinomakishichikashukuohirataiwaosakizaohigashimatsushimashikamaiwanumashibataogawaraonagawakawasakiseminemarumoriminamisanrikukakudamuratawakuyatomiyanatoriwataritagajomisatotomekamirifushiroishimatsushimayamamotoshiogamafurukawahyugaebinotsunosaitoayakushimanobeokakitauramiyazakitakazakigokaseshiibamimatashintomikunitomikitakatakobayashikawaminamitakaharukijotakanabemiyakonojonishimeranichinankitagawakadogawamorotsukakisofukushimaminamimakisakaeobuseikedaogawamiasaokayaasahiotakiotarichinoinaomichikumakomaganechikuhokukaruizawayasuokaooshikaikusakaminamiaikitogakushimatsukawakawakamitateshinatakamorikitaaikishiojirimiyadahakubaiizunaiijimaiiyamamiyotasuzakayasakatoguraookuwanagawaminowahirayayamagataminamiminowafujimiomachisakakitakaginaganonakanosakuhokomoronagisoshinanomachiwadauedaiidaharasuwatomiachiaokianankisosakunozawaonsenagematsutakayamashimosuwamatsumotoyamanouchinakagawamochizukiazuminotatsunoobamaomuraseihiunzenosetofutsuikichijiwanagasakiisahayahasamisaikaikawatanasasebohiradokuchinotsugototogitsutsushimashimabarashinkamigotomatsuurayamazoekashibaikomakawaitenrioyodosangokoryoudaojiikarugayamatokoriyamatenkawakatsuragikurotakikawakamimiyakemitsuetakatorikamikitayamayamatotakadahegurishinjokanmakisakuraitawaramotogoseoudanarasoniandokawanishishimoichihigashiyoshinokashiharashimokitayamanosegawayoshinomintsivorytopazsakuragehirnsumomoaseinetopalmail-boxmokurenyoitamuikaojiyagosensanjoaganomyokoseiroagaomishibataniigatanagaokamurakamiuonumayuzawakariwatagamitainaitsunanminamiuonumatochioyahikojoetsuseiroukamosadoizumozakitokamachiitoigawasekikawakashiwazakitsubamemitsukekokonoesaikiusukibeppuusahimeshimakunisakihasamataketatsukumihitaoitahijikusuyufukujukamitsuebungoonobungotakadaibaraniimibizentsuyamaokayamakasaokahayashimayakagemaniwaakaiwamisakishinjotamanotakahashikibichuowakesojanagishookumenannishiawakurakurashikiasakuchisetouchikagaminosatoshotomigusukunakagusukuyaeseizenaurumaiheyaaguniogiminanjokinminamidaitokitanakagusukuyonaguniokinawaishigakikunigamiurasoekadenataramahiraraginozataketomishimojizamamitonakiitomanhigashimotobuyonabarugushikamionnanahanagohaebarukumejimakitadaitonakijinnishiharayomitanginowantokashikiishikawaikedasuitaminohizuminishisakaikananabenodaitoosakasayamayaokishiwadatadaokakaizukatondabayashichihayaakasakakumatorikadomasayamahigashiosakashijonawatehirakatataishimisakitajirihannansennankatanotoyonominatosettsuhigashiyodogawaibarakinosekitachuohigashisumiyoshifujiiderakashiwaraizumiotsutoyonakamatsubaramoriguchiizumisanoshimamototakatsukineyagawahabikinotakaishikawachinaganoyoshinogarikamiminearitaouchiimarihizenogikashimaariakekiyamafukudomikitagatakitahataomachigenkaikanzakinishiaritakyuragisagataratosutakushiroishikaratsuhamatamakouhokukawagoeyoshidasatteogoseirumaasakaurawaogawaniizaomiyayoriiotakishikihonjooganohannohanyuinasaitamaokegawaarakawayoshikawayokozehasudasayamahidakafukayachichibuiwatsukiryokamiyoshimikamiizumifujimiwarabiranzanmiyoshiminanoyashiosakadosugitomisatohigashichichibutodasokakukiyonokazoshiraokakasukabekounosukawajimatsurugashimamiyashirokitamotohatoyamamoroyamahatogayakumagayakawaguchinagatorokamisatomatsubushinamegawatokigawakamikawafujiminohigashimatsuyamakoshigayatokorozawas3isk01isk02ryuohkoseikonanaishorittotakashimamaibarahikonetorahimenishiazaikokagamokotoyasuotsukusatsunagahamamoriyamatoyosatotakatsukinotogawaomihachimanhigashiomiakagiunnanizumogotsuamayatsukakakinokimatsuehamadamasudahikawahikimiokuizumoyasugiyakumomisatotamayuohdahigashiizumookinoshimanishinoshimatsuwanoshimaneshimadafujiedayoshidashimodagotembaiwataatamikosaiyaizuitoizumishimahaibaramakinoharaomaezakikawanehonkannamisusonohigashiizufukuroinumazukawazufujiaraishizuokahamamatsushimizuizunokunimatsuzakimorimachiminamiizunishiizukikugawakakegawafujikawafujinomiyaujiietsugaoyamayaitaohiranikkoashikagakuroisokanumasakurashioyakarasuyamamotegiichikaikaminokawatochigihagamokanogisanobatonasumibunasushiobaranishikatautsunomiyaiwafunemashikoshimotsukeohtawaratakanezawaitanokomatsushimatokushimaichibaminamiaizumiwajikikainanmiyoshinarutomimamugiananmatsushigesanagochishishikuinakagawamachidachiyodakomaefussainagitaitochofufuchuomeotahigashiyamatotoshimaokutamaaogashimakodairaedogawaarakawahachiojishinagawatachikawashibuyasuginamihinodekiyosesumidaoshimanerimamitakahamuraadachinakanomizuhobunkyomegurominatokoganeihigashikurumekokubunjihigashimurayamamusashimurayamatamakitahinochuokotokatsushikakouzushimaogasawaraakishimakunitachishinjukusetagayamusashinohachijoitabashiakirunohinoharachizunanbukotouramisasawakasayonagokogehinoyazutottorinichinansakaiminatokawaharaoyabetairainamiasahinantoimizufuchutakaokakurobeyamadajohanatoyamatonaminyuzenfunahashinakaniikawanamerikawaunazukitogahimiuozufukumitsutateyamakamiichiiwadearidayuasainamitaijikatsuragiaridagawatanabemihamahidakakainankiminomisatoshingushirahamakamitondayurakozakoyagobokitayamawakayamakudoyamahashimotokushimotokozagawahirogawakinokawanachikatsuurarsuseroeoishidasagaeoguniasahinagaitendonanyoobanazawanishikawasakataohkuratozawamikawamamurogawayamagatafunagatatakahatashonaishinjokahokuiideyuzakawanishitsuruokakaminoyamayamanobeshiratakamurayamanakayamakaneyamahigashineyonezawasakegawamitouubeyuuabushimonosekitabuseoshimatoyotaiwakunihikarishunannagatohagihofukudamatsutokuyamashowadoshitsurunanbukoshukaiminami-alpsnirasakikosugeotsukioshinohokutominobuyamanashifuefukichuokofuichikawamisatoyamanakakonakamichitabayamanishikatsuranarusawafujikawahayakawafujiyoshidafujikawaguchikouenohara長野京都岐阜大阪三重群馬千葉滋賀佐賀奈良adednelgaccogogror秋田愛知高知埼玉沖縄栃木熊本岩手青森山梨新潟島根鳥取長崎香川宮城石川大分宮崎茨城山口兵庫山形徳島広島福島福岡岡山富山静岡愛媛福井東京xn--4it168dhatenadiaryxn--vgu402ckawaiishophatenablogcocottenamaste北海道penneehimeiwateversestabachibashigagonnagunmapermahaccaakitaosakauh-ohblushkochiaichifukuikuroncapooitigohyogotokyokyotopunyuthickcheap0t00g00j0mie2-ddaapyawjg0amfemsubxiiboomoobutchueekpgwrgrherskrboyrdyupperunderflierchipsmydnsheavyangryhippygirlyrulez神奈川鹿児島和歌山bambinaxn--nit225kokayamasaitamaxn--k7yn95exn--1lqs03nsapporoparasitelolipopmcxn--efvn9sniigatafukuokatokushimafukushimahiroshimakagoshimafakefurokinawaxn--8pvr4ucoolblogxn--0trq7p7nnkawasakinagasakimiyazakichilloutxn--8ltr62kxn--klty5xpeeweezombiecutegirlxn--rny31hxn--uuwu58axn--ntso0iqx3axn--djrs72d6uytoyamanikitanyantakagawamimozanagoyaboyfriendxn--2m4a15egreaterchowderegoismyamagatafashionstorexn--elqq16hxn--pssu33lsendaimiyagixn--rht27zpecoriaomorisaloonwatsonvivianxn--djty4knobushipigboatnaganopinokoxn--f6qx53asadistvelvetsecretxn--5js045dchicappayamanashiibarakidigickgirlfriendxn--1lqs71dmongolianxn--c3s14mxn--qqqt11mtochigixn--5rtq34kparallelo0o0mondkobesagabonadecaoitanarafoolkilldecimainhiholomosblokilociaoundopupugifutankcrapflopnooroopsmodsholyjeezstripperpepperbittershizuokaxn--rht3dkitakyushureadymadeicurusversusmatrixxn--rht61ehungryfloppygloomycrankyhandcraftedlittlestarxn--klt787dxn--kltx9awhitesnowsunnydaytottorilovepoptheshopbuyshopxn--5rtp49cxn--d5qv7z876cwebaccelxn--kbrq7oxn--4pvxsxn--1ctwolovesickkumamotocatfoodxn--tor131oyokohamawakayamatonkotsuxn--ehqz56nxn--uist22hxn--6btw5axn--kltp7dyamaguchifrenchkisspussycatxn--4it797kxn--uisz3gbabybluexn--zbx025dnetgamersxn--7t0a264ckanagawaxn--6orx2rishikawaxn--ntsq17ghalfmoonschoolbusjellybeanxn--mkru45iusercontentlolitapunkxn--32vp30hsakurastoragehokkaidoshimanecandypopbabymilksupersaleweblikeraindropbackdropwebsozaikikirarahateblodaynightmeneacsccogoormobiinfoaeusxxorgmilcomnetedugovorgcomnetedugovbizinfotmprdorgmilcomnomedugovassnotairespresseassocoopgouvveterinairemedecinpharmaciensorgnetedugovtraorgcomedurepgovmeneperekgacscaiiocogoitoresmshsseoulbusanulsandaeguc01milvkimmvchungnamjeonnamjeonbukeliv-dnsgyeonggijejueliv-cdnincheondaejeongangwongyeongbukgwangjuchungbukgyeongnameliv-apicoeduindorgcomembnetedugovorgmilcomnetedugovjcloudorgcomnetintedugovperbnrinfocooyorgcomnetedugovethipfscanvamypepethw3sstorachakeeneticjoinmcinbrowserdwebcyonnftstoragemyfritzaemewphlxachotelltdorgcomwebsocschngonetintedugrpgovassnomgacsccoorgnetedugovbizinfo123websiteidorgmilcomasnnetedugovconfidmedorgcomplcschnetedugovaccoorgnetgovpresstmassoirseproxaccosoundcasthoptocraftvp4c66orgnetedugovitsmcdirmyboxbarsyedgestacksynologylogintoopencloudnohostwebhopdiskstationi234tcp4hoocgroknoipprivmydsddnsdnsforlohmustransipdscloudfilegear-sgbrasiliafilegearframerbarsybarsyonlinecoprdorgmilcomnomedugovinforgcomnetedugovnameacprorgcomartnetedugovpresseinfoassoinstgouvorgnycedugovbarsydscloudjuorgcomnetedugovminisiteaccoororgcomnetgovorgmilcompronetintedugovbizmuseumnameinfoaerocoopaccoorgcomnetintedugovbizcooporgcomgobneteduorgmilcomnetedugovbiznameaccoorgmilneteduadvgovcoorgcomnetaltgovforgotherhiskeeneticispmanagernomassoprod5476132eastasiacentraluswesteuropewestus2eastus2pnortheurope-01newzealandnorth-01southindia-01southcentralus2-01norwaywest-01eastus2-01westus2-01australiaeast-01italynorth-01israelnorthwest-01swedencentral-01westeurope-01centraluseuap-01taiwannorthwest-01uaecentral-01northcentralusstage-01israelcentral-01mexicocentral-01canadacentral-01austriaeast-01germanywestcentral-01francecentral-01ukwest-01denmarkeast-01polandcentral-01eastus-01westus-01swedensouth-01eastus3-01westus3-01brazilsouth-01centralus-01francesouth-01australiacentral-01westindia-01uaenorth-01jioindiacentral-01canadaeast-01belgiumcentral-01spaincentral-01koreacentral-01chilecentral-01qatarcentral-01westcentralus-01eastus2euap-01norwayeast-01southafricanorth-01brazilsoutheast-01germanynorth-01switzerlandnorth-01switzerlandwest-01japanwest-01southafricawest-01japaneast-01eastasia-01indiasouthcentral-01taiwannorth-01centralindia-01uksouth-01southcentralus-01northcentralus-01eastasiastage-01indonesiacentral-01australiacentral2-01australiasoutheast-01malaysiawest-01koreasouth-01southeastasia-01southeastus5-01northeastus5-01jioindiawest-01rucdnwest1-usfra1-desandboxjls-sto1jls-sto3jls-sto2aglobalabglobalsslmapprodfreetlsmapvpslon-1lon-2ny-1fr-1sg-1ny-2paassnwebpaashostingjelasticnordeste-idcsocuserpagescwebfileblobservicebuscoreatlricnjsjelasticwebsitestoragesezagbinruhuukjptsmyspreadshopmynetnameakamaiorigin-stagingfrom-coipv64dynv6cdn77serveblogadobeaemcloudhicamsprytdnsupno-ipownipde5ovhicpfirewall-gatewaysytesmypsxbarsyusgovcloudapimyamazemyradwebakamaihdsaveincloudfastlylbfrom-lasubsc-paysquare7in-the-bandblackbaudcdnhomelinuxoninfernoctfcloudservebbsdns-dynamiccloudfrontakamai-stagingipifonyham-radio-opsenseeringclickrisingcommunity-profrom-nylocalcertgrafana-devedgesuite-stagingcloudflareanycasteating-organicatlassian-devmydattofeste-iplocaltotorprojectknx-serveredgekeycloudflareglobalcloudyclustercasacamserveftpakamaized-stagingakamaiorigindns-cloudmyeffectboomlabotdashbuyshousestwmailhetemlazure-mobilein-dslthruhereredirectmedynuddnsbouncemesupabaseluyanicloudappakamaicloudfunctionsdebiannhlfanpgafanstatic-accessin-vpnmysynologymafeloappudohomeftptrafficmanagersiteleafseidatmemsetcloudflarecloudaccesskeyword-onazure-apiis-a-chefdoes-itgets-itwebhopselfiphomeipkicks-assedgesuitewindowsserver-ontunnelmolemydissentscrapper-sitecloudflarecnuni5srcfggffiobbzabchrsndenodynuopikddnsvpndnsakadnselastxkinghostvps-hostfastlyhomeunixazureedgeshopselectdontexistmyfritzcloudjiffyalwaysdatasells-itsquaresbroke-itazurefddattolocalat-band-campmeinforumfamilydsazurestaticappsdefinimabplaceddnsaliasdynaliasnow-dnsblogdnsroutingthecloudendofinternetdsmynasakamaiedgemymediapcadobeio-staticakamaiedge-stagingakamaihd-stagingddns-ipprivatizehealthinsurancelive-onkrellianschokokeksmassivegridmysecuritycamerarackmazeserveminecraftfrom-azis-a-geekakamaizedmoonscaleoffice-on-theusgovtrafficmanageradobeioruntimeedgekey-stagingreserve-onlinechannelsdvrdnsdojousgovcloudappcdn77-sslapps-1and1podzoneazurewebsitesdynathomescaleforceyandexcloudvusercontentisa-geekcdn-edgescoaemalcesappwriteazimuthtlonarvobuiltwithrocketnoticeablestorecomwebrecnetperotherfirminfoartslgdloncogoiltdorgmilcolcomplcschgenngonetedugovbiznamefirmmobiacincoorgmilcomnomwebgobnetintedubizinfocomyspreadshopdemongovtransurl123websitehosting-clusterkhplaycistrongsnesosvalervålerxn--vler-qoaossandeheroysandeherøybøboheroyherøyxn--hery-iraxn--b-5gavalerbøboxn--b-5gasandesandexn--hery-iraxn--vler-qoavålerhåreålaahavaofsfvfhlolnlalrlhmfmtmahcostntbuåstrmreigersundmyspreadshopgálsáeidsvolltingvollgildeskalflorøvadsøvardøvanylvenxn--bhccavuotna-k7astrandaxn--kvnangen-k0axn--sknland-fxaxn--mosjen-eyarakkestadhyllestadnannestadvevelstadvaapstenordre-landsondre-landsøndre-landtjieltexn--vrggt-xqadsør-aurdalsor-aurdalheradstordmoldefordeførdeseljefedjeryggehemnexn--krehamn-dxasognegranesøgnebrynetjomevallebykletokkegiskedovretjømehobølvoldasaudatolgasømnaviknadønnasomnadonnatranafrananesnaraumasmolatrænafrænalesjasmølaørstaorstahitrafloraaukraloppafrøyarissasnasahalsagalsaromsaraisaráisafroyasnåsagronghobolfjelltydalårdalardalaskimharamkraanghkekråanghkesorumbarumhurumbærumsørummodumsálátbálátfrognbjugnvåganvagangulenskienløtenlotenstrynvefsnxn--merker-kuaskaunsveiobømlobomloskjåkvardoflorovadsosalatbalatsálatklæbuklabuselbubarduulvikskjakklepprisørxn--nttery-byaeflåeidflahofmilgolholsellomskifetvikdepvgsfhsaskerrisorhamarasnesåsnesrørosrorosxn--slat-5namasoynaroyvaroyluroydyroyaskoyradoyandoyrodoymeloyradøyandøyrødøymeløyaskøylurøydyrøymåsøyværøynærøyhoylandethøylandetdivtasvuodnalørenskoglorenskognesoddtangenxn--tjme-hraxn--smla-hraxn--stjrdal-s1aunjargalillehammerunjárgaxn--hamary-fyadavvenjargaxn--bearalvhki-y4a123hjemmesidegjerdrumxn--brnnysund-m8acxn--tnsberg-q1axn--mlatvuopmi-s4axn--snsa-roaxn--skierv-utaxn--brum-voatysfjordkvafjordeidfjordkvæfjordsongdalenmjondalenmjøndalenxn--gls-elackragerogáŋgaviikagangaviikasørreisasorreisasør-varangersor-varangerxn--risr-iraskiervaxn--frna-woaxn--trna-woakvinesdalleksvikleirvikrøyrvikroyrviksvelvikvenneslaevje-og-hornnessandnessjøenmarnardalvindafjordsandefjordenebakksnillfjordullensvangxn--trany-yuabrønnøysundnamsskoganaustevollxn--stjrdalshalsen-sqbnord-aurdalnord-frontrøgstadtrogstadgrimstadflakstadgjerstadxn--sandy-yuaxn--leagaviika-52bnore-og-uvdalvegarsheixn--rlingen-mxaxn--ggaviika-8ya47hvegårsheikarlsoykvitsoymasfjordenhamaroyinderoyosteroydavvenjárgasauheradguovdageaidnuxn--vre-eiker-k8abronnoysiellakkrødsheradkrodsheradkvinnheradbrønnøyxn--mtta-vrjjat-k7afxn--lrenskog-54akvitsøyvárggátkarlsøyosterøyinderøyhamarøybronnoysundxn--aurskog-hland-jnbbahccavuotnabáhccavuotnagiehtavuoatnastor-elvdalmidtre-gauldalxn--gildeskl-g0akarasjokevenassixn--bievt-0qaxn--yer-znalebesbynessebyxn--hbmer-xqamalselvmålselvxn--unjrga-rtamøre-og-romsdalmore-og-romsdalhareidmelandørlandorlandstrandålgårdsolundalgardafjordåfjorddielddanuorrikautokeinoxn--stre-toten-zcbskodjeaejriestangeliernebamblestokkefauskesnåasesnaasekongsvingerlangevagberlevagxn--flor-jrahattfjelldalostre-totenøstre-totenvestfoldxn--mely-iraálaheadjualaheadjunordreisaxn--troms-zuaxn--lgrd-poacporsangerflatangerstavangerleikangerbremangersamnangergieldakarasjohkaxn--rdy-0nabfrostautsirasnoasatromsaxn--sr-aurdal-l8aflekkefjordjølsterjolsteraremarkhedmarknååmesjevuemienaamesjevuemiexn--vard-jrarollagmeråkermerakerorskogørskogxn--bdddj-mrabdákŋoluoktaxn--osyro-wuaaknoluoktatrysilskjervøymandaljondalbindalrindalmeldalsuldalorkdalsigdalalvdallærdalhurdalsirdalverdallerdallardaloppdalåseralaseralhadselkragerødivttasvuotnaoverhallasteinkjerxn--hnefoss-q1askedsmokorsettromsøxn--dyry-iravestre-totenmuseumxn--sandnessjen-ogbrahkkeravjufylkesbiblbájddarbajddarxn--laheadju-7yarennesøyxn--koluokta-7ya57hxn--hgebostad-g3aleirfjordstorfjordbalsfjordbåtsfjordbatsfjordmuosátbievátloabátkárášjohkanøtterøyxn--mjndalen-64anordkappláhppilahppialstahaugsiljanverranrøykenroykenhaldenlyngenbergenhortenhønefosshonefosstroandinbeiarnvarggatosoyroosøyrotromsoidrettmuosatbievatruovatloabatvoagattynsetnessetxn--indery-fyaskánitskanitraholtråholtxn--ystre-slidre-ujbandebusarpsborgbearduxn--karlsy-fyahordalandjorpelandjørpelanddeatnuringsakersør-odalsor-odalxn--slt-elabringerikeaudnedalnittedalnissedalhemsedalslattumsurnadalxn--blt-elabelverumstjørdalnaustdalhjartdalgjøvikfyresdalhasviknarviklarvikgjovikmalvikgamviklenvikporsgrunnstjordalengerdaldrobakdrøbakxn--msy-ula0hvestvagoyxn--vgan-qoaxn--ryken-vuaxn--lten-graxn--stfold-9xaxn--hpmir-xqaxn--lury-iramálatvuopmimalatvuopmitysværkirkenesbirkenesmoskenesbáidárxn--fjord-lraxn--rdal-poabahcavuotnabáhcavuotnaxn--frde-gralindåsbearalvahkixn--hobl-iraráhkkerávjuxn--loabt-0qavågåáltábodøsundlundraderådeetnetimeholeauregrueoddavagavegaranatanaarnasolasulaaltalekafusavangbergkvamåmliamlibokntinnroangranosenoslobodorøstroststatåmotamotivguprivøyeroyerliermossvossxn--nvuotna-hwalusterlunnermarkerhábmerhabmerhvalerfjalerxn--rholt-mratysvarbaidarfitjargaularhápmirhapmirmelhusfosnesøksnesoksnestysneshemnesevenesflesbergeidsbergtonsbergtønsberglindasxn--sndre-land-0cbnamsosxn--srum-graøystre-slidreoystre-slidrevestre-slidretrondheimbalestrandxn--langevg-jxaaustrheimxn--skjk-soavagsoyaveroysandoykarmoyfinnoytranoyvestbytranbysykkylvenxn--hyanger-q1aspjelkavikandasuoloxn--fl-ziaxn--drbak-wuastathellexn--sr-varanger-ggbtelemarkxn--bhcavuotna-s4axn--porsgu-sta26fčáhcesuolocahcesuoloakrehamnåkrehamnsandøykarmøyfinnøytranøyvågsøyaverøynamdalseidxn--lesund-huabadaddjaxn--vegrshei-c0axn--btsfjord-9zagildeskålporsanguxn--trgstad-r1anávuotnanavuotnahammerfestxn--sgne-graxn--brnny-wuacibestadharstadnarviikaevenáššivestnesgjemnessandnesagdenesrennesoyxn--avery-yuaxn--tysvr-vrabearalváhkikongsbergspydebergrandabergxn--andy-iradavvesiidaxn--krdsherad-m8aporsáŋgufredrikstadbjerkreimringeburennebuaurskog-holandnotteroyxn--vgsy-qoa0jxn--rmskog-byaskierváivelandbyglandfrolandaurlandforsandxn--bjddar-ptamidsundålesundalesundfetsundfarsundovre-eikerøvre-eikerakershusxn--moreke-juasørfoldøstfoldostfoldsorfoldhøyangerhoyangerlevangerorkangertanangerxn--vestvgy-ixa6olillesandulsteinxn--rennesy-v1agranvinskjervoyxn--klbu-woalavagisxn--h-2faxn--ryrvik-byakafjordkåfjordseljordfolkebiblxn--gjvik-wuajevnakerxn--kfjord-iuabudejjuxn--kranghke-b0axn--davvenjrga-y4axn--rland-uuaxn--ldingen-q1axn--mlselv-iuaxn--rady-iraxn--linds-prabrumunddalxn--ygarden-p1amo-i-ranaeidskogrømskogromskoghjelmelandxn--finny-yuaxn--sr-odal-q1axn--skjervy-v1aballangenkvanangenkvænangengratangenxn--hmmrfeasta-s4acvossevangensuohkanxn--rde-ulaxn--mli-tlaxn--ksnes-uuanordlandskanlandskånlandsortlandfuoiskuxn--rros-graxn--hcesuolo-7ya35bxn--eveni-0qa01gagaivuotnagáivuotnaxn--seral-lradrammenmodalenmosjoenjan-mayentorskensteigengloppenxn--snes-poamatta-varjjatxn--sr-fron-q1aomasvuotnajessheimbådåddjåxn--krager-gyaxn--kvfjord-nxaxn--asky-iraxn--snase-nraxn--bidr-5nacholtålenxn--vads-jraxn--jlster-byamosjøenxn--rst-0nastavernxn--ostery-fyaxn--oppegrd-ixaxn--sknit-yqaxn--risa-5naoppegårdskiptvetrendalenholtalenxn--mot-tlaxn--lhppi-xqaxn--holtlen-hxaxn--srreisa-q1akopervikxn--muost-0qaxn--bmlo-grahokksundkvalsundegersundxn--karmy-yuaullensakerxn--hylandet-54axn--kvitsy-fyaxn--bod-2nalangevågberlevågkristiansandxn--rsta-frahornindalstjørdalshalsenstjordalshalsensandnessjoenhámmárfeastaxn--lrdal-srasør-fronsor-fronnord-odalkristiansundmátta-várjjatvestvågøynesoddennotoddenbuskerudøygardenoygardensalangenlavangenralingenrælingenlodingenlødingenleaŋgaviikalaakesvuemieleangaviikauenorgexn--srfold-byaaskvollxn--rskog-uuaxn--nry-yla5gxn--vry-yla5ghammarfeastaxn--rhkkervju-01afxn--givuotna-8yakommunekrokstadelvanedre-eikerhagebostadhægebostadxn--berlevg-jxakviteseidxn--s-1faxn--l-1faxn--nmesjevuemie-tcbafuosskomoårekemoarekexn--lt-liacxn--jrpeland-54asvalbardoppegardholmestrandtvedestrandsogndalsokndalarendalsunndalfolldalxn--krjohka-hwab49jlyngdaletnedalnorddalsaltdalgausdalskedsmovaksdalgjesdalstordalxn--frya-hraaarbortedrangedalxn--smna-graaurskog-hølandxn--vg-yiabtjeldsundhaugesundlindesnesxn--mre-og-romsdal-qqbxn--dnna-gradyntmpheremerseineshacknetenterprisecloudmineaccomaorimāoriorgmilcriiwigennetschoolhealthkiwigovtgeekxn--mori-qsacloudnsparliamentcomedorgcompronetedugovmuseumwebsitekinservicebarsywebsitebuildereerobookheimdnsleapcelleero-stagetechcrscsslorigingohomecdbedeeeiemesecabgngilnlalplchfisiincnnoroptatitmtltruauhulumkdkukskjplvtrgrfrkrhrusesismycynzcznetinteduassoososcloudstgbetaaezaeuhkusjshatenadiarycdn77hoptozaptois-a-knightmyftpno-ipjpnddnssdpdnsspdnsbarsysweetpepperis-a-bruinsfanis-very-sweetservegameis-a-soxfanhomelinuxcdn77-secureservebbsmisconfusedwebredirectblogsitefreedesktopcouchpotatofriestoolforgeaccesscamis-lostreadmyblogsmall-webfedorapeopleserveftpis-a-celticsfanmywirepotagertwmailin-dslsellsyourhomeread-booksfreeddnscable-modemis-savednflfanufcfanmlbfanstuff-4-saleendoftheinternetin-vpnmy-firewallhomeftpis-localis-a-chefboldlygoingnowherewebhopselfipkicks-assroxatunkcamdvrfedoraprojectgotdnsdvrdnsdyndnspubtlspimientahomeunixdontexistfedorainfracloudwmflabsfspagesbmoattachmentsteckidsfamilydsdnsaliasdynaliasnow-dnscloudnsdoomdnsduckdnsblogdnshomednsroutingthecloudendofinternetdsmynasip-dynamicpoivronhttpbinmyfirewallis-very-evilmysecuritycamerais-a-linux-userwmcloudis-a-geektuxfamilyis-a-candidatedoesntexistis-very-badhobby-sitegame-hostaltervistais-foundis-a-patsfandnsdojohepforgepodzonedynservcollegefanis-very-goodfrom-meis-very-niceisa-geeknerdpolacmedsldingorgcomnomgobabonetedupleskaemhlxmyboxrockyprvcydeuxfleurspdnscodebergheyflowstatichostorgmilcomnomgobneteduorgcomeduiorgmilcomngonetedugovcloudns1337ngrokacorggogfamcomwebgobnetedugokgopgkpgovgosbizpasaugumicsopozpapuwmwsrprusiskwpspkppspkmpspokeoiawsawifoumsdnskokwpmuppuppsppiwwiwoowuzswkzoschrzpisdnwzmiuwwitdpssewsseumigugimoirmpinbwinbwiihupporzgwgriwupowwskrwioswuozstarostwokonsulattmpccopruszkowmyspreadshopostrodakartuzyopolegminamediaustkazgorajgoraolawailawalomzawloclradombytomjaworznotargilubinkoninzagantorunkutnokepnonakloczestsopotsanokturekplockslasksklepzarowlukowmedaidgdaorgmilrelcomnomatmgsmartneteduelkgovwawsossexbiztgorysejnytychypomorzeboleslawiechomesklepsdscloudunicloudzakopanelegnicarawa-mazbydgoszczswidnikkrasnikwloclawekbielawamragowograjeworealestatebeskidykaszubymalopolskaprzeworskswiebodzinlecznadfirmaszkolawarmiagdyniamiastakazimierz-dolnymalborkswidnicadlugolekaostrolekapodlasieelblagtravelsimplesitezachpomormielecszczecinnieruchomosciwalbrzychlezajsklublinbedzinpoznanwielunmielnooleckostarachowicedkontopowiatwroclawrybniksuwalkileborkslupskgdanskostrowwlkptarnobrzegtourismwegrowkrakowglogowyou2pilanysamailwrocinfoagroautobeepshoppriviqhslapypiszlodzcfolksecommerce-shopmazurypulawyskoczowrzeszowpomorskiezgierzkaliszolkuszlowiczostrowiecsosnowiecmazowszewodzislawbialowiezazgorzeleckatowicepabianicejelenia-gorawolominkarpaczsieradznowarudaczeladzkonskowolaskierniewiceswinoujscieturystykabieszczadycieszynketrzynolsztynbialystokbabia-goraprochowicewarszawastalowa-wolapolkowicegorlicegliwiceponiatowalimanowalubartowaugustowkobierzyceopocznognieznoszczytnokolobrzegshoparenapodhalebielskoklodzkostargardatwithplayitownnamecoorgnetedugovacorgcomproestnetedugovbiznameislaprofinforechtngrokmedaaaacacpaenglawjurbarbarsykeeneticavocatacctcloudnsorgcomsecplonetedugov123paginaweborgcomnetintedugovnomepublidkinbarsygovx443cloudnsorgmilcomnetedugovcooporgmilcomschnetedugovnamecomcannetlibassoaemclantmcontstoreorgcomnomrecwwwbarsyfirminfoshopartsstackitmyddnswebspacelima-cityacincooxorgedugovbarsybrendlyhbvpsvpsspectrumlandinghostingacppmordoviamcprecbgorgmilcomspbnetintedumsknovgovbirrasmcdirmytismircloudvladimirnalchikadygeyamarinepyatigorskmyjinobashkiriaeurodirvladikavkazna4ugroznykustanaikalmykiacldmaildagestaniranbuildcloudcanvaliaravalwixdevelopmentappwritemigrationneedleverceldatabasestackitcodereplravendbonporterlovableaccoorgmilnetgovcoopmedorgcompubschnetedugovservicemecomygovorggovtvmedorgcomnetedugovinfoedgfacbmlonihkutwpsryxzbdtmacfhppmyspreadshopbrandpartiorgcomfhvpress123minsidaitcouldbeworlanbibkommunalforbundfhskiopsyskomvuxkomforbnaturbruksgymnloginlineorgcomnetedugovenscaledeuusentsurgebotdaorgmilcomnetgovnowteleporthashbangplatformlovablebarsyshopwarebasehoplixbarsyonlinemsf5gitappgitpagewawamscofigma-govcaffeinefigmacanvasoltstscwputerbarsysupportchatgptsquareomniweopensocialcpanelplaycodenotionnovecorewpsquaredpreviewjelecyonbyensrhtfastvpspieboxconvexjouwwebheyflowplatformshloginlinemadethissourcecraftclouderaorgorgcomartedugouvunivmeorgcomnetedugovsurveysstatichfheiyuxs4allprojectmyfastubervibehostapp-ionosdeployagentmecoorgcomschnetedugovbizcncostoreorgmilcomneteduembaixadaconsuladokiraranohoprincipesaotomeheliohobarsystorebaseshopwaresellfyaiabkhaziavologdamordoviapenzalenugsochinavoiexnetspbmsknovnorth-kazakhstanashgabadkareliaarmeniageorgiavladimirnalchikivanovobukharaadygeyakhakassiakalugakrasnodarjambylaktyubinsktroitskbryanskobninskkurganazerbaijanpokrovskbashkiriatselinogradvladikavkazmurmansktulatuvamangyshlaktashkentchimkentgroznykaragandatermezarkhangelskkustanaikalmykiabalashoveast-kazakhstankaracoldagestantogliattibarsyredorgcomgobedumirenknightpointaccoorgjelasticdiscoursecleverappsschacmiincogoornetonlineshopcogoorgmilcomwebnicnetintedugovbiznametestcoorgmilcomnomnetedugovorangecloudpersoindorgcomfinnatnetgovensmincomtourismintlinfox0611oyaorgmilcomnetedugovquickconnectvpnplusnettprequalifymeaddrmyaddrntdllwadlnctvavdrk12orgmilpolbeltelcomwebgennetedutskkepgovbbsbiznameinfocoorgmilcompronetedugovbiznameinfobetter-thanworse-thansakurafromdyndnson-the-webmymailerorgmilurlcomneteduidvgovmydnsgameclubebizmeneacsccogotvorhotelmilmobiinfovodteiflgplkmsmsbcckhincndnvncoztltmkckppzpdprvcvkvlvcrkrkscxuzchernovtsyrivneyaltaodesavolynrovnolutskltdinforgcomnetedugovbizvinnicazhitomirternopilpoltavakropyvnytskyizaporizhzhiasevastopolsebastopoluzhgoroduzhhorodkharkovkharkivvinnytsiakhmelnytskyizaporizhzhecrimeaodessazhytomyrnikolaevcherkassydonetskluganskluhanskkirovogradivano-frankivskchernivtsikrymkievkyivlvivsumyzakarpattiamykolaivcherkasychernigovkhersonchernihivdnipropetrovskdnepropetrovskkhmelnitskiyneacsccogoorusorgmilcomedugovmyspreadshopadimono-ipbarsybarsyonlinelayershiftnh-servretrosnubapicampaignservicelugaffinitylotteryweeklylotteryraffleentrygluglugsmeaccoindependent-inquestnimsitecopropymntltdorgplcschnetgovnhsbarsyindependent-commissionindependent-reviewpolicepublic-inquiryindependent-panelconnhospindependent-inquiryroyal-commissionoraclegovcloudappscck12libaws-govccphxcclibpvtparochchtrcck12libcceatonk12coglibtecgendstmusann-arborwashtenawcck12glghcck12sealibforksolympiabainbridge-islkeyporthoquiamyarrow-pointcentraliaport-townsendsequimport-ludlowrentonsilverdalebremertonredmondsheltonbellevueport-orchardport-angeleskingstonchehalisaberdeengig-harborseattlepoulsboidmdndsddemenegacalamaiavawapailalflnmdcncscohnhmihiviwiriinmntnmocoutvtctmtgunjokakwvnvprarorasmskstxwynykyazisadninsnngosrvis-bymircloudservernamepointtoenscaledland-4-salefreeddnsstuff-4-saleazure-apinoipdatabricksappscloudnsgolffanheliohostazurewebsitesgvorgmilcomgubneteducoorgcomnetd0egvorgmilcomnetedugovmydnsiacostoree12orgmilcomnomwebgobbibrectecnetintedugovraremprendefirminfoartseducok12orgcomnethidnsidacaiiosonlahanamhanoicamauhueorgcompronetintedugovbizbacninhtayninhhoabinhnamdinhtravinhhaiphongvinhlonghaiduongquangnamquangtrithuathienhuequangninhbacgianghaugiangquangbinhsoctrangbentrethanhphohochiminhdanangkontumhatinhkhanhhoathanhhoahealthgialailaocaiyenbaibackanngheanlonganphuyenphuthocanthodaklakdongnainameinfovinhphucdongthapkiengiangtiengiangquangngailaichaulangsonlamdongdaknonghagiangangiangcaobangbinhduongninhthuanbinhthuanbaclieuthaibinhninhbinhbinhdinhtuyenquanghungyenbaria-vungtauthainguyendienbienbinhphuocschbizputerimagine-proxyorgcomnetedugovcloud66advisormypetsdyndnsxn--8dbq2axn--4dbgdty6cxn--5dbhl8dxn--hebda8bxn--80auxn--d1atxn--c1avgxn--o1acxn--o1achxn--90azhxn--55qx5dxn--uc0atvxn--od0algxn--wcvs22dxn--gmqw5axn--mxtq1mxn--12c1fe0brxn--h3cuzk1dixn--12co0c3b4evaxn--12cfi8ixb8lxn--o3cyx2axn--m3ch0j3axn--j1adpxn--90amcxn--90a1afxn--h1ahnxn--j1ael8bxn--h1alizxn--c1avgxn--j1aefxn--80aaa0cvacxn--41acaffeineexeopentunnelbotdashtelebitorgtmaccoagricorgmilnomwebnicngonetaltedugovlawnisschoolgrondaraccoorgmilcomschnetedugovbizinfoprg1-zeropstritonstackitlimazeropsaccoorgmilgovяспборгкоммскбизмирсамаракрымсочиакодпроргобрупрצהלממשלישובאקדמיהองค์กรธุรกิจรัฐบาลศึกษาทหารเน็ต教育網絡組織公司政府個人닷넷한국澳门新闻澳門联通家電嘉里招聘通販닷컴삼성コムგეбгрфеюadcdbdgdidmdsdtdaebedeeegeiejekemenepereseveyegabacalamanauavapaqasazacfbfafgfnfpfwftfbgcgagggegkgngmgsgpgvgtgugilmlnlalclglplsltlhmimjmkmmmomambmcmdmfmgmzmpmsmtmgbbblbsbecccacnclcmcvctcscmhkhghchbhthphshlinikifigiaibicivisikninhnmncnbngnsnpnvntnjoionomobocoaofodorosotoptstttytatbtetgtithtmtltrusuvuaucueuguhulumunufjdjbjtjsjlkmkhkfkdkcktkukskpkgpmpnpkpjpgqaqmqiqsvtvcvbvmvlvrwpwtwzwbwcwawgwkwmwtrsrprgrfrercrbrarnrmrlrkrirhrwsusrssspsgsesbsaslsmsissxmxaxcxuypysylymykygybycyuztzsznzmzkzdzczbzazελευ世界台灣购物公益点看臺灣网络書籍在线网站手机机构大拿游戏信息台湾谷歌慈善商标香港中国餐厅网址中國商城食品微博政务移动集团公司八卦商店健康网店政府时尚佛山中信娱乐广东企业homedepotengineeringاماراتrepublicankuokgroupversicherungchannelcitadelxn--pgbs0dhxn--b4w605ferdstatebankwebsitexn--mgb9awbf亚马逊淡马锡alibabaxn--ngbc5azdxn--mgbbh1axn--45br5cyltoshibabuildworldcloudtradeguideplacespacedancemoviephoneprimesmilebiblestyleappleazurestoreskypegripexn--l1accdrivelottehorsehouseleasechasereisestadahondaomegaaetnaamicaninjanokiamediadeltavodkaedekaosakapizzaslingemailgmailtirolshelltmallfinallegaltotalhotelamfamforumrehabmusicciticricohcoachwatchboschearthfaithirishmiamiarchidubaiguccipraxiみんなストアセールcanonsalononionnikonepsonkoelngreensevencrownikanoradioaudioweiboglobopromogalloyahoociscorodeovideomangobingotokyovolvolottokyotophotosmartsportquesttrusthyattjetztadultcymrubaidutushuxn--kprw13dubankclickblackmerckgroupsharpcheapnowtvxn--h2brj9cקוםհայоргсрбмонкомбелмкдқазрусукрمصرقطرعربكومdadcfdmedwedredphdthdbidpidkrdmsdltdiceonewmeglemoerwecfageacbanbambaaaammakianraspacpaaxawtfbcgaegongingaigvigorgdogdhlmilrilonlaolloluoljllcalgalnflafltelsrlfrllplkimibmcamcombommomifmabbjcbscbwebcabnabtabmlbpubabcbbcnecincpncllcstcwtcpwcnyckfhbzhovhmoiskiobisbitcifyituipinvinwinxincbnbcnmanfangdnmenrenkpnmtnyunrunfununobiojioriohbogmofooboooooacoecoceongoproartistottnttbbtcateatlatvetpetbetnethktmitfitintjothotgotdotbotprueduicujnjyouinknhktdkappsapgapmapdnptopgopllpjmpzipvipripesqtrvdtvitvdevmovgovhivnrwlawsewnewbmwwownowhowdvrftrmtrsfrbarcartvscrseusawsupsubssbsadsddsldssasbmsmlsxxxboxfoxgmxtjxsextaxbuyflydiysoyjoyskypaydaygayxyzanzbizwebersenerpokerlameractortatarsolarລາວคอมไทยtourslocusnexuslexusgiftsbeatsboatspartspressglassswissकॉमनेटtiresgivescodeshomesgamestunesshoescardswalesloansvegastoolsdealsautosparisファッションworkssucksrocksxeroxforexfedexpartylillymoneystudyrugbytoraytoday中文网xn--unup4y天主教飞利浦新加坡enterprises我爱你嘉里大酒店christmasxn--fct429kholdingsxn--8y0a063axn--mgbx4cd0ablifestyleabogadoallstatenetbankكاثوليكxn--s9brj9cxn--gk3at1ebestbuycharityxn--55qx5dmicrosoftpropertybasketballhomegoodscorsicajewelrygallerygrocerysurgerycountrybrusselsverisignferreroxn--czr694bhdfcbankcommbanksoftbankپاكستانپاکستانnextdirectالسعوديهالعليانxn--h2brj9c8cxn--80adxhksshikshaxn--mgbai9azgqp6jcuisinellabarclayscatholicxn--kpry57dcompanyxn--xhq521bblackfridayxn--mgba3a3ejtsandvikxn--d1acj3bacademydownloadمليسياxn--j1amhxn--w4r85el8fhu5dnraipirangaathletaxn--fhbeixn--mgbqly7cvafrzuerichxn--c2br7gஇலங்கைcontractorsxn--io0a7igraphicsinsurancetemasekxn--xkc2al3hye2amotorcyclesphotographydirectoryplumbingxn--vhquvclothingtrainingcleaningwilliamhilllightingxn--mgba3a4f16ashoppingcateringeducationokinawapicturesventuresproductionsxn--9et52uwalmartഭാരതംsupportrealestatecapitalonexn--nqv7fs00emaauspostfloristdentistxn--qxamgodaddybradescobargainsmitsubishikerryhotelsxn--9dbq2axn--3pxu8kimmobilienxn--fjq720axn--mgbtx2bholidaymckinseymadridbusinessbuildershelsinkixn--4gbrimмоскваالسعودیةcoffeedegreelacaixapartnersalsaceofficeabbvievoyageorangegeorgeonlinechromemobilekindlegoogleoraclecircleschulesecureinsurexn--mgba7c0bbn0aestatexn--mgbc0a9azcgcruisehangoutxn--vuq861bxn--42c2d9arexrothfirestoneuniversityxn--nnx388alifeinsuranceextraspaceонлайнvermögensberatersoftwarexn--fiqs8sxn--mgbab2bdxn--w4rs40ltiendaभारतम्africatoyotaotsukasakuracameracreditcardnagoyaconsultingnetworkjunipertheatermonsterprogressivepioneerxn--55qw42gracingdatingvotingvikinglivinggivingxn--bck1b9a5dre4cbrotherweatherjoburgفلسطينlplfinancialxn--clchc0ea0b2g2a9gcdfutbolschoolsocialglobaldentalwoodsidechanelairtelmatteltravelrealtorwebcamstreamభారత్unicomalstomxn--nodexn--6frz82gmuseumfurniturexn--rvc1e0am3exn--mix891faccenturexn--11b4c3dismailineustardiscountquebeccomsecclinicservicesxn--y9a3aqxn--c1avgswatchchurchsearchالاردنmarketingcontacthealthmonashshoujisanofitaipeiamericanexpresssuzukiアマゾンクラウドポイントbhartiグーグルxn--mgberp4a5d4armemorialxn--1qqw23alondonmormoninstitutevisionbostonnortoncouponmaisonamazonvirginberlindesigndurbanolayannissananquanxihuanhitachikaufengardenreisenbayerntechnologydatsunxn--90a3aclatinocasinostudiophysioxn--ngbe9e0apharmacytattootaobaoaramcoexpertreportabbottdirectselectimamatfairwindspictettargetmarketintuittravelersinsurancecreditdupontryukyusuppliesxn--tckwebnpparibasschmidtmerckmsdyodobashirestaurantbridgestonecricketxn--fpcrj9c3dbostikbroadwayattorneylefrakemerckxn--fiq228c5hscareersfarmerswinnersflowersxn--wgbh1cguitarsxn--54b7fta0ccxn--p1acfmakeupgalluplandroverxn--kcrx77d1x4agoldpointbauhausxn--mgbayh7gpahiphopplaystationxn--mgba3a4fraxn--eckvdtc9dhyundaixn--gckr3f0fistanbulticketsmarketsflightschintaireviewsxn--3e0b707ewindowsxn--fiqz9sfinancialxn--fzys8d69uvgmابوظبيdiscoverreviewবাংলাxn--5su34j936bgsgmoscowobserverapartmentsдетиارامكوсайтeurovisionxn--i1b6b1a6a2exn--xkc2dl3a5ee0hتونسموقعبارتڀارتشبكةعمانبيتكعراقreadkredbondlandbandfundfoodprodgoldfordtubecafesafelifeggeeieeefreefagepagegugezonewinememenamegamesaleablebikenikelikecarecbreherefiresaveloveliveblueartedatesitevotecaseluxebofamodaltdaasdatiaayogasinavanashiaasiajavabbvatevavivadatazaraarpacasavisasncfprofmaifsurfgolfdvagsongbingpingwangkpmggoogblogpohlfailcooldellcalldeallidlsarlfilmteamroomfarmimdbarabclubhdfcicbchsbcgmbhrichtechfishdishcashminiernikddiaudiwikimobitaxicitikiwidesiqponskinloanakdnwienopenporncerntownimmolimoolloinfonicofidolegosaxozeroaerovivoautovotomotofastbestresthostpostnextlgbtchatseatgiftmeetdietreitmintrentgentspotscotguruitausohumenucyoubanklinkpinkdclktalksilkbookseekworkrsvpaarpjeepshopcoophelpcamppccwshowbeerstarruhrflirweirhaircarsparsjprshausplusnewstipstoysjobskidsfanspicsdocsxboxamexsexynavycitysonyarmyallybabyplaydeliverybuzzgbizlamborghiniphilipsලංකාಭಾರತfitnessexpresslanxesspfizercenterwalterlawyersoccercareerkosherbrokerlockerdealerdoctorauthorxn--mgbqly7c0a67fbcvermögensberatungjaguarxn--pssy2uxn--hxt814eflickrrepairrogersairbusxn--mgbai9a5eva00beventsyachtsxn--t60b56aভাৰতভারতभारतभारोतviajeshermeshughesxn--j1aefसंगठनvillasଭାରତclaimshotelsભારતzapposphotosjuegoscondostatamotorsgratistennisਭਾਰਤtkmaxxtjmaxxschaeffleryandexxn--80aswgrealtysafetybeautyluxuryxn--3ds443gsupplyfamilyxn--o3cw4hhockeysydneyxn--90aenissayalipayenergycomputeragencyxn--rovu88b電訊盈科xn--gecrj9cstatefarmaccountantaquarelleolayangroup香格里拉xn--p1ai组织机构xn--1ck2e1bxn--mgbt3dhdschwarzموريتانياabudhabinowruzkomatsufujitsuhospitalxn--80asehdbxn--mgbtf8flxn--j6w193gxn--yfro4i67oprudentialxn--flw351ecruisescoursesrecipesxn--e1a4cferrarixn--ses554gxn--wgbl6awatchesstaplessinglesxn--mgbcpq6gpa1axn--otu796dpropertiescreditunionxn--mgbah1a3hjkrdstockholmhisamitsuالسعوديةstcgroupdomainsoriginscouponsbloombergclubmedfroganslimitedxn--80aqecdr1aexposedinternationalequipmentbarclaycardxn--q7ce6axn--mgbi4ecexpprotectionassociatesconstructionxn--cck2b3bxn--45q11candroidfoundationישראלxn--mgbca7dzdocliniqueboutiqueengineerxn--qxa6asystemsfirmdalefashionauctionxn--nqv7finfinitirentalsreliancetradingweddingfishinghostinggentingbookingcookingxn--3hcrj9cgraingerxn--czrs0tdemocratsamsungyokohamaxn--h2breg3evexn--nyqy26alundbeckmelbournevacationssolutionsfrontierxn--vermgensberatung-pwbmanagementxn--cg4bkixn--mgb2ddeslincolnhamburgsandvikcoromantblockbusterairforcebarefootxn--4dbrk0ceinvestmentsfeedbackcommunityxn--ngbrxالبحرينdiamondsamsterdamhealthcareredumbrellaxn--mxtq1mxn--2scrj9cagakhanxn--mgbpl2fhкатоликcaravanசிங்கப்பூர்richardlimortgageamericanfamilyxn--fzc2c9e2cscholarshipssaarlandxn--imr513nvlaanderensamsclubgoodyearkitchenஇந்தியாweatherchannelallfinanzxn--kput3iالسعودیۃxn--90aisxn--efvy88hالجزائرxn--mgbaam7a8hexchangejpmorganxn--tiq49xqyjfidelitysecurityxn--mk1bu44cwanggouxn--fiq64bxn--6qq986b3xlxn--mgbbh1a71exn--80ao21amarshallsxn--5tzm5gtravelerspanasoniclatrobeyoutubeaccountantsxn--rhqv96gxn--cckwcxetdanalyticsxn--ygbi2ammxبازاربھارتسوريةorganicfreseniusسورياxn--9krt00axn--qcka1pmcxn--jlq480n2rgdeloittesciencefinancexn--jvr189mxn--30rr7yhomesensehotmailbaseballfootballleclercboehringerxn--q9jyb4cxn--mix082fاليمنهمراهpolitieسودانايرانایرانnetflixyamaxunxn--lgbbat1ad8jcollegestoragecapetowncolognekerrypropertiesxn--mgbgu82axn--ogbpf8flxn--czru2dwhoswhociprianilasallexn--g2xx48cforsalebanamexaudiblexn--vermgensberater-ctbxn--zfr164bericssonvanguardxn--45brj9cindustriestheatremarriottxn--3bst00mcomparexn--mgberp4a5d4a87gcapitaldigitalالمغربbarcelonashangrilaxn--d1alfcalvinkleinwwwcitysapporokawasakinagoyasendaikobekitakyushuyokohamackjp`,Zz=Kz.length,Qz=Jz.length,$z=new Uint32Array(Qz),eB=new Uint32Array(Qz),tB=new Int32Array(Zz).fill(-1);for(let e=0,t=0;e<Zz;e+=1)for(let n=qz[e];n<qz[e+1];n+=1){$z[n]=t;let r=t+Jz[n],i=5381;for(let e=r-1;e>=t;--e)i=i*33^Xz.charCodeAt(e);eB[n]=i>>>0,Jz[n]===1&&`orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitglideossnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxysiteacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstorageedaccogoorusorgcomnetinteduaéroportxn--aroport-byaassogouvcomilgobgovcloudnses-1eu-west-1us-east-1euvipit1eurarubait1s3lbwebsites3websiteru-spbru-mskelasticcsrunstnukukcaukusnl-ams-1fr-par-1fr-par-2functionsnodess3ddlwhmrdbfnck8sifrs3-websitecockpitscblmgdbdtwhkafkpubprivs3ddlwhmrdbk8sifrs3-websitecockpitscblmgdbdtwhkafks3ddlrdbk8sifrs3-websitecockpitscblmgdbdtwhkafkk8sscalebookpl-wawfr-parnl-amsbaremetalsmartlabelinginstancesdechk2kuleuvenlaravelvoorloperurownoxazapscwhstgrvaporonline-serverobservablehqelementorantagonistreclaimjoteluluencowaydiademjelasticmatlabmagentositetrendhostingaxarnetperspectajenv-arubajelejoteravendbemergenttrafficplexconvexkeliwebserveboltbegetcdnstaticson-rancherprimetelonstackitunison-servicesdnshomelinkyardbarsyjelecloudnscocomnetgovmycn-northwest-1cn-north-1s3s3-accesspoints3-websites3s3-accesspointrdsdualstacks3-deprecatedemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspoints3s3-accesspointrdsdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicn-northwest-1cn-north-1cn-northwest-1ebcomputeelbcn-north-1airflowcn-northwest-1cn-north-1oncn-northwest-1cn-north-1amazonawssagemakeramazonwebservicesdirectasgdsdhehahljlnmhbacscahqhshhihnlnynsnmofjbjzjxjtjhkcqtwgsjssxnxjxgxxzgz網絡网络公司orgmilcomnetedugovxn--55qx5dcanva-appsxn--io0a7iquickconnectcanvasitekhsjxn--od0algcanva-codemyqnapcloudsrvrlessclustersrealtimestorageleadpagescarrdcrdorgmilcomnomnetedugovhidnssupabaserdpareplmypiumsoxmitotaplpagesfirewalledreplitowodevwebview-assetsvfswebview-assetss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecateds3-websites3-object-lambdaexecute-apis3s3-accesspoints3-websites3-accesspoint-fipss3-fipss3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipss3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9vfss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1us-northeast-1ap-southeast-1me-south-1af-south-1ap-south-1ap-southeast-7us-west-2eu-west-2ap-east-2us-east-2ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ap-southeast-6ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1mrapaccesspoints3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3eu-west-3ap-south-2eu-south-2computes3-ap-northeast-2elbrdss3-ap-east-1s3-sa-east-1s3-us-gov-west-1s3-eu-central-1s3-ca-central-1eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3s3-website-us-west-2s3-website-eu-west-1s3-external-1eu-central-1me-central-1ca-central-1il-central-1s3-us-west-1s3-eu-west-1s3-website-sa-east-1s3-website-ap-southeast-2ap-northeast-1ap-southeast-1s3-us-west-2s3-eu-west-2me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2s3-website-ap-southeast-1s3-1s3-globals3-ap-northeast-3eu-north-1airflowap-southeast-2s3-us-gov-east-1s3-fips-us-gov-east-1s3-me-south-1s3-ap-south-1ap-northeast-2s3-website-us-west-1ap-southeast-5s3-eu-north-1s3-ap-southeast-1s3-website-us-gov-west-1compute-1s3-eu-west-3us-gov-west-1s3-website-ap-northeast-1us-gov-east-1s3-fips-us-gov-west-1s3-website-us-east-1s3-ap-southeast-2ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3-us-east-2s3-ap-northeast-1authauthauth-fipsauth-fipseu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1rframeservicesbuilderstg-builderdev-builder*ociocpocsazuregcpawsdemoinstanceeu-west-3eu-south-2ap-southeast-3ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1previeweu-4us-4us-1eu-1us-2eu-2us-3eu-3appscomputepaasrag-cloudrag-cloud-chjcloudjcloud-ver-jpcdemonodebalancermembersipeuxvsoncillaocelotonzayalilynxsphinxfentigercustomercaracalo365cloudstaticxendevapp001testcode-builder-stgplatformmediasiteprojedrydpagesjsx0desazacncoitrueu4uhkukgrbrushatenadiarymyspreadshopfrom-flfrom-wvwebspace-hosttheworkpchatenablogcursorusercontentservesarcasmapplinzisakuratanwixsiteappchizigiizeis-into-carsdnsiskinkyadobeaemcloudis-a-therapistpgfogmyvncdojinis-an-actress1kappfldrvkozowqa2jpnmexprgmrfirewall-gatewaydynnscafjsfbsbxooguyfrom-gawoltlab-demois-a-anarchistwiardwebteaches-yogadattowebtb-hostinglive-websiteservegamegotpantheonfrom-nhsubsc-payfrom-ohvipsinaappfrom-cadyndns-officehomelinuxfrom-mahercules-appservebbsstreakusercontentfrom-okfrom-wyfastly-terrariumis-a-llamaqualyhqportalserveexchangeon-vaporvivenushopciscofreakgrayjayleaguesmetaaiusercontentfrom-iais-a-libertariansaves-the-whalestaveusercontentyolasiteoperaunitepoint2thisis-a-catererclaudeusercontentlinodeusercontentfrom-vagithubusercontentsells-for-lesshosteurcanva-appsplaystation-cloudddnsfreefrom-pafrom-prfrom-waddnskingoutsystemscloudhotelwithflightmydattois-a-nascarfanmydbserverminiserverdamnserverservehumouris-a-playerfrom-nvfrom-nmemergentagentgentappsamplifyappfrom-kyis-an-accountantnfshostserveircfrom-akpythonanywherestackhero-networkpostman-echolikescandydyndns-mailobservableusercontentserveftpfreeboxosfrom-utcdn77-storageamazonawsneat-urldyndns-serverlinodeis-a-teacherfrom-vtgleezemythic-beastsus1-pleniteu1-plenitla1-plenitpaywhirlservecounterstrikejdevcloudhealth-carereformis-into-animegoogleapisis-a-painterafricaisa-hockeynutatmetais-an-actora2hostedis-a-democratdatadetectest-le-patrondigitaloceanspacesis-a-designeris-a-hunterlinodeobjectstemp-dnsissmarterthanyoufrom-arsimplesiteevennodetownnews-stagingis-a-liberalgooglecodejelasticservemp3qualyhqpartnerdyndns-free1cooldnsest-a-la-masiondrayddnsdynuddnsfrom-orfrom-miis-a-bloggerfrom-himydobisscanvacodeis-an-engineerest-a-la-maisonupsunappdevinappswafflecellmyasustorwpenginepoweredfrom-ctservep2psame-appmyshopblocksthingdustdatalikes-piediscordsezis-with-thebandlpusercontentis-leetshopitsite3utilitiesis-a-personaltrainersinaappladeskis-a-cheflogoipselfipbase44-sandboxnospamproxyalibabacloudcsmesswithdnsauthgearappsiamallamawithgooglelutrausercontentmochausercontentframercanvasmytabitdyndns-homew-credentialless-staticblitzcpserverdiscordsaysis-a-nurseappspotatlassian-isolated-3premotewdfrom-mtwixstudiocode0emm180rmyactivedirectoryawsappsmytuleapdnsabrpolyspaceqbuserrenderbuiltwithdarkboutirgotdnsabrdnsdopaascanva-hosted-embedawsglobalacceleratorhomesecuritypcmyiphostditchyouripclever-clouddyndns-ipon-aptibleis-a-musicianhosted-by-filessecuritytacticsappspaceusercontenthomeunixstrapiappsame-previewcf-ipfsmycloudnaselasticbeanstalkis-certifieddontexistkasserverik-serverdrive-platformatlassian-3pfirebaseappherokuappawsapprunnerbarsycenteris-a-cubicle-slaveservehttpmyshopifyis-a-guruquicksytessiiitesorsitesmagicpatternsappis-a-cpameteorappfrom-wiis-a-rockstarbumbleshrimpdattolocaldatabricksappsreadthedocs-hostedfrom-rifamilydsdyndns-picsplesknsbplaceddnsaliasdynaliasdyndns-remotedoomdnsip-ddnsblogdnsis-a-doctorroutingthecloudamazoncognitobarsyonlinedsmynasddnsgurucloudflare-ipfsdeus-canvasfrom-idsmushcdnpagespeedmobilizerdyndns-at-homeunusualpersonhosted-by-previderis-a-republicandyn-o-saurstreamlitappworkisboringonthewificprapidqualifioappis-uberleetis-slickgetmyipwpdevcloudtypeformdyndns-at-workgentlentapismynascloudw-corp-staticblitzfrom-ingeekgalaxyservebeerfrom-mdonrenderspace-to-rentaivencloudappspacehostedwafaicloudcodespotblogspotatlassian-3p-us-gov-modfrom-ndfrom-msis-a-techieis-a-studentcustomer-ociis-a-photographerdurumisfrom-ksmassivegriddyndns-wikiis-an-entertaineris-a-hard-workermysecuritycamerafrom-mnrackmazedyndns-blogis-a-bulls-fanwritesthisblogfreemyipsimple-urlfrom-sdreservdauthgear-stagingest-mon-blogueuris-into-gamesrice-labsxtooldevicesakurawebis-an-anarchistoraclecloudappsdyndns-worksells-for-urhcloudfrom-dcfastvps-serverwpmucdnis-a-geekscrysecfrom-txis-into-cartoonsmodelscapetrycloudflarelocaltonetstreak-linkbalena-devicesfrom-njforgeblocksfreebox-oswebadorsitefrom-ncdoesntexisthobby-sitestreaklinkshomesecuritymacownprovidertuleap-partnersdattorelaywphostedmailservequakeis-a-socialistservehalflifepivohostingdynuhostingquipelementsw-staticblitzdyndns-webfrom-deproject-studyaliases121is-not-certifiedhercules-devis-a-financialadvisorservepicsis-a-greenloseyouripfrom-ilwithyoutubemwcloudnonprodwiredbladehostingdnsdojofrom-tnpixolinomyqnapcloudis-an-artisthostedpiis-a-landscaperauiusercontentoaiusercontenton-forgeis-a-conservativedreamhostersnet-freaksapps-1and1is-goneencoreapifastly-edgefrom-nesalesforcefrom-scdeployagentoraclegovcloudappsfrom-alis-a-lawyercechirevultrobjectsstufftoreadisa-geekddnsgeeklovableprojecttry-snowplowfrom-moblogsyteis-a-bookkeepernogmyforumravendbmyboxdeelementoredsaacficogoorinforgcomgobnatneteduidstoreorgcomnetintedudevnomepublorgcomneteduathgovtestscalculatorspaynowinfoquizzesresearchedcloudnsfunnelsassessmentsjscaleforcetmacltdorgmilcompronetgovbizpresseklogesrsccloudcustomfltusrcloude4corealmgovmunicontentproxy9metacentrumdyndyndyndnsdynpagespages-researchitionoccustomercomymyspreadshopipv64diskussionsbereich4limacomrub2ixfirewall-gatewayddnssspdnsbarsykeymachinesquare7myhome-serverspeedpartnercommunity-proschuldockxenonconnectgünstigliefernbwcloud-os-instancedyndnssecmy-routerxn--gnstigliefern-wobin-butterl-o-g-i-nisteingeekin-dslin-berlinin-brbfuettertdasnetzleitungsenin-vpnlcube-serverdyn-ip24logoipdyn-berlinruhr-uni-bochum12hpgoipsrvdnsfruskygit-repossvn-reposinternet-dnsgünstigbestellenhome-webserverxn--gnstigbestellen-zvbbplacedheimdnscosidnswebspaceconfiglima-citydyndns1istmeinvirtualuserschulplattformmy-gatewayddnsseclebtimnetztest-iservmein-iservvirtual-userhome64iservschuletaifun-dnstraeumtgeradeschulserverdynamisches-dns123webseitednshomehs-heilbronndnsupdaterbssgraphicdwadpdwdaepeweaawapaafpfwfabwbpbacwcpcciwebuserapiobjectsidsiskospockkimodorikerbonesteamsparisjanewaypicardglobaltarpitreedpikekiraworfsulukirkarchertuckerhackercanarywesleystagingprereleaset3r2lpbravepanelngrokiservstglclcrmerpflypagesbarsyvivenushoplocalcertlocalplayerbearbloggatewaydeno-stagingis-not-ais-a-goodbotdashvercelmocha-sandboxplatter-appreplitgithubpreviewworkersinbrowserevervaultis-ahrsndenoxmitmodxmyaddrstorageapipayloadgrebedocruncontainersstgstagelclstageloginlineis-a-fullstackcodepenleapcellngrok-freeis-coolstoragewebharemediatechlibp2pdiscourseimaginecomyspreadshopstoreregbiz123hjemmesidefirmcoorgcomnetedugovsldorgmilcomwebgobartnetedugovtmorgpolcomsocartnetedugovassoagrondiscoodontk12medcuegyecpaabgengorgmilgalsaltulcomadmesmgobpubdocmonfindgnriouioproartlatvetnetfotedulojgovntrturibrbarxxxofficialbasechefprofmktgpsictechinfoarqtcontdentrrpppsiqgit-pagesritmedfieorgcomlibprieduaipgovriikmeactvsportorgmilcomscieunnetedugovnameinfopintouchtawktotawkmyspreadshoporgcomnomgobedu123miwebcomputeorgcomnetedugovbiznameinfocognito-idpeusc-de-east-1onjelasticnxaspdnsbarsydirectwpdeuxfleurstransurldogadoprvwcloudnsamazonwebservicesdnshomeuserpartycokoobinmkmfidymyspreadshopalandkapsiikixn--hkkinen-5wacloudplatformhäkkinen123kotisivuidacorgmilcompronetedugovbiznameinforadioorgcomneteduuserexperts-comptablestmmyspreadshopgretaprdcomnomynhccifbxoshuissier-justicenotairesaeroportfreeboxoson-webavocatassoportgouvkdnschirurgiens-dentistes-en-franceavouesfbx-os123sitewebveterinairechirurgiens-dentistespharmacienchambagrimedecinfreebox-osdediboxgoupilemszicpyicpvicppleysheezypagesedugovcnpyorgcomcybllcpvtnetedugovtnxonlineschooldaemond6atcopanelorgnetplybotdashstackitkaasorgmilcomnetedugovbizmodltdorgcomedugovcoorgcomneteduappwriteacorgcomnetedugovcloudtranslateusercontentorgcomnetedumobiassoorgcomnetedugovbarsysimplesitediscourseindorgmilcomgobneteduorgcomwebnetedugovguaminfonxhra教育敎育網絡网絡组織組織网络網络组织組织公司政府個人个人箇人ltdorgcomincneteduidvgovxn--uc0ay4axn--55qx5dxn--mk0axixn--io0a7ixn--uc0atvxn--zf0avxxn--lcvr32dxn--od0algxn--wcvs22dxn--gmqw5axn--od0aq3bxn--mxtq1mxn--ciqpnxn--tn0agxn--gmq050iorgmilcomgobneteduiservwp2tempurlmircloudfreesitewpmudevmyfastgadgetcloudaccessjelehalfboltfastvpsemergenteasypanelopencraftizcombrendlynamefromrtpersoadultmedorgpolrelcomproartnetedufirminfoassoshopcoopgouvtmcomediahotelforumvideosportorgsexagrargameslakaseroticaerotikatozsdereklamcasino2000filmsuliinfoboltshopprivnewsszexcityutazasjogaszkonyveloingatlaneacaicogoormyᬩᬮᬶmilwebschnetkopbizzonedesaponpesxn--9tfkymyspreadshopgovmytabittabitorderravpageaccok12idforgnetgovmuniltdplcaccotttvorgcomnetmeca6g5gpgamubacaicniocoukuptverdruscsdelhiindorgmilcomwebnicfingenpronetintedugovresbizbiharbarsyinternetbusinessschooltravelsupabasealumnigujaratfirminfoaeropostbankcoopindevscloudnsno-ipbarsybarrell-of-knowledgebarrel-of-knowledgensupdategroks-thisdnsupdatefor-ourknowsitalldvrcammittwalddynamic-dnsv-infowebhopselfipdyndnshere-for-moreilovecollegemayfirstforumzcloudnsmittwaldservertypo3servergroks-theeusekd1cdndyndnsidrawsainaueuapjpusstagemocksysdevicesclientcustreservdcustdevdisrecprodtestingcobeebyteutwenteboxfusebravepstmndedynngrokorgmilcomnomnetedugovqcxqzzbarsythingdustmo-siemensrb-hostingfh-muenstergitbookbluebitecloudbeesusercontentnodeartkiloappsforgerockdarklangresinstagingapigeebubbleb-datascryptedhypernodedappnodepantheonsitegitlabgithubkeeneticvirtualservercleverappshostyhostingon-rioedugitticketstelebitwixstudioon-k3sicp0icp12038jeleqotolairbubbleappsmyaddrstolosmyrdbxwebflowdrive-platformbeagleboardhasura-applolipopdefinimavaporcloudmusicianwebflowtestazurecontainerresindevicereadthedocsloginlineeditorxmoonscalesandcatsbasicserverwebthingsbrowsersafetymarkbeebyteappbitbucketidaccovistablogorgschnetgovxn--mgba3a4f16axn--mgba3a4fraarvanedgeايرانایرانjclaspeziapdudcefegelemeperetevebacanatavaparasabgagfgogrgpgalclblimfmrmcbmbvbfclcmcvcrcpcchlimifibicivipirisimncnbnanenrnpntnnolomobocoaogorosopotoptvtatctbtmtltotpusulunutpspapaqsvpvvvtvavvrtrsrprgrfrcrbrarorkrvstsssbscsmsispzczbzbozen-suedtirolmyspreadshopxn--bulsan-sdtirol-nsbxn--valledaoste-ebbtrentinoaltoadigetrentin-sued-tirolxn--forlcesena-c8axn--forl-cesena-fcbxn--bozen-sdtirol-2obtriestetrentinsuedtiroltrentino-s-tirollecceudineaostesienaparmaluccapaviagenoapaduaaostamonzaabruzzoternirietiturinmilanbozenlaziofermoleccocuneonuoropratola-speziavdataaligfvgpugmolcalcamlomumbsicpmnvenvaoedugovabrsarmaremrbastoslazibxosfirenzetrentinosüdtirolval-d-aostavalle-aostamessinacremonaravennatoscanatrentin-suedtirolbolognacalabriaurbinopesarofriuli-v-giuliaogliastraxn--valle-aoste-ebblaquilaandriatranibarlettasyncloudxn--valle-d-aoste-ehbaostavalleyvalled-aostatrentino-alto-adigevallee-d-aostexn--balsan-sdtirol-nsbpistoiasicilialucaniacataniaiserniaperugiabresciaveneziagorizialiguriaimperiabulsan-suedtirolbalsan-suedtirolbarlettatraniandriaxn--trentino-sdtirol-szbforlì-cesenatuscanyvallée-d-aostemantovavallée-aostecasertapiemontevalleaostaval-daostafriulivgiuliatrevisoforli-cesenavalléedaosteferrarapescaravald-aostatrentino-altoadigefriuli-vegiuliavallee-aostecarboniaiglesiastarantomediocampidanovalleedaostetrentinosud-tirolcampobassotrentinsüd-tiroltrentinosüd-tirolmonzabrianzatrentino-südtirolxn--trentino-sd-tirol-c3bpotenzacosenzavicenzaemiliaromagnavenicefrosinonemarchepordenonetrentinosued-tirolvaresemolisevalléeaostefriuli-veneziagiuliabasilicatalatinaanconasavonaveronamodenabiellabolzano-altoadigepugliafoggiaumbriatrentino-stirolgenovapadovamateranovararagusapiacenzatrentinostirolvalleeaostetempio-olbiasudsardegnatrentinsudtirolmassa-carrarafriuliveneziagiuliatrentinosuedtirolandria-barletta-tranitrapanixn--cesenaforl-i8amaceratacaltanissettaascoli-picenobrindisicarraramassacagliaririmininapolivibo-valentiachietibulsan-sudtirolbalsan-sudtiroltrentino-a-adigebulsanbalsaniglesiascarboniamilanotorinoteramodell-ogliastraarezzotrentinoalto-adigerovigotrentovenetoiglesias-carboniatrentino-sud-tirolaltoadigereggio-emiliareggio-calabriasardegnatranibarlettaandriapiedmontxn--sdtirol-n2amedio-campidanotrentino-süd-tirolfriuli-vgiuliafriuli-ve-giuliaromeennaromapisa32-b16-b64-blodiastibarineencomonaplesforlicesenailiadboxosalessandriasicilytrani-barletta-andriaxn--trentin-sdtirol-7vbpesarourbinotrentinsued-tirolcesena-forliforlìcesenaemilia-romagnamonzaebrianzaxn--trentinsdtirol-nsbtrentinos-tiroltrentinsüdtirolvalledaostaolbia-tempiocampidanomediovibovalentiasassarivalle-daostalombardysud-sardegnafriulivegiuliareggioemiliamonzaedellabrianzaalto-adigevercellitrentin-sudtiroltraniandriabarlettatrentino-sudtirolascolipicenobozen-südtirolfriulive-giuliaflorencexn--cesena-forl-mcbcarbonia-iglesiasaosta-valleycarrara-massadellogliastratrentinoa-adigexn--valleaoste-e7apesaro-urbinoxn--trentinosdtirol-7vbxn--trentin-sd-tirol-rzbxn--trentinsd-tirol-6vbtrani-andria-barlettatrentin-süd-tirolxn--trentinosd-tirol-rzbgrossetomonza-e-della-brianzasüdtirolreggiocalabriatrentinoaadigetrentin-südtirolverbano-cusio-ossolafriuliv-giuliaverbaniacampaniatrentino-aadigefriulivenezia-giuliasardiniaandriabarlettatranibarletta-trani-andriacatanzarooristanourbino-pesarocesena-forlìvalle-d-aostacampidano-medio123homepagesiracusatempioolbiasuedtirollombardiaavellinocesenaforlìtrentinofriuli-venezia-giuliabozen-sudtirolandria-trani-barlettabulsan-südtirolbalsan-südtirolmonza-brianzabolzanotrentino-sued-tirolbellunosalernolivornocrotonesondriodnshometrentinsud-tirolmassacarraratrentin-sud-tiroltrentino-suedtirolviterbobergamocesenaforliolbiatempiopalermobeneventoagrigentoofcoorgnetfmaitvphdengorgmilcomschnetedugovperagrikanieasukehandachitatokaiaisaikonanoharuamaobuhigashiuraowariasahiinuyamatobishimaiwakurashitarainazawatoyonegamagorimihamatoyotataharakariyayatomioguchikomakimiyoshinishiotokonamekiyosuchiryutoyohashiokazakiisshikikasugaikotakiratoeianjotogofusosetohazutsushimashinshirotakahamanisshinshikatsuhekinantoyokawaichinomiyatoyoakeodateogataakitaikawakyowahonjoogayurihonjonoshirokamiokakatagamimitanegojomeyokotekosakadaisenkazunonikahohonjyomoriyoshimisatohappoukamikoanihachirogatahigashinarusesembokufujisatokitaakitaitayanagiowanitakkomutsutsurutahirosakigonoheoirasetowadamisawanohejiaomorishingohiranairokunohehashikamitsugarushichinohehachinohenakadomarisannohekuroishisakaeisumiasahiotakiinzaiabikomatsudoyachiyomutsuzawakujukuriomigawakashiwatoganemihamanaritasakuranagaramobarahanamigawachoshishiroichoseikozakishisuikatorimidorichonankyonanfuttsuonjukufunabashinagareyamanodasosatakochuotohnoshourayasukimitsuyokaichibayotsukaidosodegauratateyamakamagayayokoshibahikariyachimatakatsuuratomisatokisarazukamogawaichikawanarashinoichinomiyashimofusaminamibososhirakoichiharaoamishirasatoikatahonaiainansaijoseiyoiyoozuuwajimaniihamanamikatamasakiuchikokihokutobetoonshikokuchuomatsuyamaimabarikamijimakumakogenyawatahamamatsunosabaeikedaobamasakaifukuiohionotsurugamihamawakasaminamiechizeneiheijikatsuyamatakahamaechizensoedaukihaomutaokawanishiogoribuzenonojosueumiokiotochikugosasagurisaigawamizumakishinyoshitomikurumekurateyamadakasuganakamamiyamanogatatakatahakataiizukakawaratagawakasuyaashiyainatsukimunakataminamitsuikishonaikurogifukuchikeisenhigashimiyakoshinguyukuhashiokagakiyamekogaongausuikahotohochuotoyotsumiyawakadazaifuhisayamatachiaraiyanagawanakagawahirokawachikujochikushinochikuhochikuzennamieotamaokumashowateneiiwakikoorinangoononishigoshimogoomotegomishimafukushimaasakawakagamiishishirakawaiitatefutabahiratayugawahanawakitakatakawamatakunimiyabukibandaihigashihironoyamatomiharuyamatsuriaizubangedatesomaaizuwakamatsuyanaizuaizumisatonishiaizuizumizakikitashiobarataishinkaneyamakoriyamainawashirotanagurafurudonosamegawasukagawaishikawatamakawaikedaogakitaruiginanenahashimahichisonakatsugawaibigawashirakawamizunamiminokamomitakekawauesekigaharatomikasakahogikitagatayamagatatajimianpachimotosuyaotsukakamigaharahidakanisekitokigujominogodoyorogifukasamatsutakayamawanouchihigashishirakawakasaharashimonitatsumagoichiyodakannakanrashowameiwakiryuotaoratomiokafujiokaitakuranaganoharahigashiagatsumatakasakishibukawaminakamikatashinatsukiyonokawabanumataannakaoizumimidorishintoisesakiuenoyoshiokakusatsutakayamanakanojonanmokutamamuratatebayashimaebashiotakekaitadaiwahongofuchukuietajimashobaramiharahatsukaichihigashihiroshimamiyoshikumanokurenakasakaseraseranishiasaminamifukuyamashinichionomichiosakikamijimajinsekikogentakeharaotobenanaeikedatohmaozoraobiraabirakyowaeniwataikibibaisharirebunerimohiroooketootarupippunishiokoppechitosefurubirahakodateshiranukakitahiroshimakushiroobihironanporoiwamizawaniikappukunneppufukushimanakasatsunaitoyourakuromatsunaiakabirakamisunagawashibechaurakawakamifuranonakatombetsuasahikawashimokawakayabeokoppebiratoriabashirisaromaatsumanumatahidakabifukamukawamikasahorokanaitoyotomisarufutsuhigashikawaishikarikitamiyoichiesashiiwanaitomariminamifuranoakkeshifuranotoyakoyakumootoineppushikaoishiraoinemuronayorohaboroashorobihororishirifujiutashinaihokutotakasuebetsuurausuassabukikonaishimamakinaiedatetoyabieinikiesanuryuoumuteshikagarikubetsuashibetsukimobetsuaibetsutobetsusobetsuembetsushimizuchippubetsurishirihokuryuhoronobeshintokutsubetsushibetsuhonbetsumombetsutsukigatakuriyamakoshimizushiriuchikutchanmurorannoboribetsukamishihorowassamushinshinotsukembuchiwakkanaikamoenaikiyosatotakinoueshikabesunagawafukagawanakagawatakikawakamikawahigashikagurahamatonbetsumatsumaemoseushirankoshishakotanimakanemashikeotofuketomakomaisandatambaitamiawajikasaiasagoshisoonoakoyashirotoyookaminamiawajiinagawafukusakitakasagokamigorikasugaharimayokawaashiyahimejiakashitaishiaogakisannantakinosumototakarazukanishinomiyashingugoshikinishiwakiyokatakaaioimikisayoyabukawanishiamagasakisasayamashinonsenkakogawaichikawakamikawatatsunotsukubaiwamaogawaasahisakaitokaioaraiitakobandodaigosuifuinaamikasumigaurakashimaomitamayachiyoshimodatetomobetoridehitachinakainashikisakuragawakasamayawaramoriyahitachiomiyanamegatayamagatahitachikamisuushikutakahagiibarakitonekoganakasowayukimihojosomitoryugasakishimotsumafujishirotsuchiurachikuseihitachiotashirosatotamatsukuriuchiharashikahakuinanaotsubatawajimakahokukawakitatsurugikaganominotosuzuuchinadakomatsuanamizunakanotohakusannonoichikanazawaiwateshiwafudaikawaimoriokaofunatohanamakikuzumakikitakamininohekunoheyamadayahabasumitaichinosekitanohatahiraizumirikuzentakatajobojiotsuchihironomiyakoiwaizumikarumaiichinohenodakujitonooshushizukuishifujisawamizusawakamaishikanegasakimannoutazukotohiraayagawazentsujihigashikagawauchinomikanonjisanukimarugamemitoyotakamatsutadotsunaoshimatonoshoakuneamamiizumihiokiyusuikinkoisasookouyamanakatanekagoshimakanoyaisenkawanabeminamitanemakurazakitarumizunishinoomotematsumotosatsumasendaioimatsudaayaseebinamiurazushinakaiodawaraiseharasagamiharahakoneaikawakaiseiatsugitsukuihadanoyamatoyamakitazamaoisochigasakininomiyayokosukakamakuraminamiashigarafujisawasamukawakiyokawahiratsukayugawaraokawaumajikochitsunootoyoakiinonishitosayasudahidakamiharasakawaniyodogawahigashitsunokagamigeiseisusakiotsukinaharisukumomurototosakamiochitoyotosashimizumotoyamanankokunakamurakitagawayusuharaogunichoyoukiasoutoozugyokutoamakusamifunetakamoriyamagaminamataminamiogunikikuchisumotoyamatonagasumashikiaraokumamotokamiamakusanishiharayatsushiroayabeseikasakyoideineujinakagyokameokakyotangokyotanabekyotambaminamiyamashiroyamashinatanabeyawatawazukaminaminantanmiyazuhigashiyamafukuchiyamakitamukokamojoyokizumaizuruujitawaraoyamazakinagaokakyokumiyamakawagoeinabeshimameiwaasahitaikiudonoisetsukisosakikuwanamihamamiyamasuzukatamakimisuginabarikumanokomonominamiisewataraitobakiwatakikihotadomatsusakayokkaichikameyamaureshinoishinomakishichikashukuohirataiwaosakizaohigashimatsushimashikamaiwanumashibataogawaraonagawakawasakiseminemarumoriminamisanrikukakudamuratawakuyatomiyanatoriwataritagajomisatotomekamirifushiroishimatsushimayamamotoshiogamafurukawahyugaebinotsunosaitoayakushimanobeokakitauramiyazakitakazakigokaseshiibamimatashintomikunitomikitakatakobayashikawaminamitakaharukijotakanabemiyakonojonishimeranichinankitagawakadogawamorotsukakisofukushimaminamimakisakaeobuseikedaogawamiasaokayaasahiotakiotarichinoinaomichikumakomaganechikuhokukaruizawayasuokaooshikaikusakaminamiaikitogakushimatsukawakawakamitateshinatakamorikitaaikishiojirimiyadahakubaiizunaiijimaiiyamamiyotasuzakayasakatoguraookuwanagawaminowahirayayamagataminamiminowafujimiomachisakakitakaginaganonakanosakuhokomoronagisoshinanomachiwadauedaiidaharasuwatomiachiaokianankisosakunozawaonsenagematsutakayamashimosuwamatsumotoyamanouchinakagawamochizukiazuminotatsunoobamaomuraseihiunzenosetofutsuikichijiwanagasakiisahayahasamisaikaikawatanasasebohiradokuchinotsugototogitsutsushimashimabarashinkamigotomatsuurayamazoekashibaikomakawaitenrioyodosangokoryoudaojiikarugayamatokoriyamatenkawakatsuragikurotakikawakamimiyakemitsuetakatorikamikitayamayamatotakadahegurishinjokanmakisakuraitawaramotogoseoudanarasoniandokawanishishimoichihigashiyoshinokashiharashimokitayamanosegawayoshinomintsivorytopazsakuragehirnsumomoaseinetopalmail-boxmokurenyoitamuikaojiyagosensanjoaganomyokoseiroagaomishibataniigatanagaokamurakamiuonumayuzawakariwatagamitainaitsunanminamiuonumatochioyahikojoetsuseiroukamosadoizumozakitokamachiitoigawasekikawakashiwazakitsubamemitsukekokonoesaikiusukibeppuusahimeshimakunisakihasamataketatsukumihitaoitahijikusuyufukujukamitsuebungoonobungotakadaibaraniimibizentsuyamaokayamakasaokahayashimayakagemaniwaakaiwamisakishinjotamanotakahashikibichuowakesojanagishookumenannishiawakurakurashikiasakuchisetouchikagaminosatoshotomigusukunakagusukuyaeseizenaurumaiheyaaguniogiminanjokinminamidaitokitanakagusukuyonaguniokinawaishigakikunigamiurasoekadenataramahiraraginozataketomishimojizamamitonakiitomanhigashimotobuyonabarugushikamionnanahanagohaebarukumejimakitadaitonakijinnishiharayomitanginowantokashikiishikawaikedasuitaminohizuminishisakaikananabenodaitoosakasayamayaokishiwadatadaokakaizukatondabayashichihayaakasakakumatorikadomasayamahigashiosakashijonawatehirakatataishimisakitajirihannansennankatanotoyonominatosettsuhigashiyodogawaibarakinosekitachuohigashisumiyoshifujiiderakashiwaraizumiotsutoyonakamatsubaramoriguchiizumisanoshimamototakatsukineyagawahabikinotakaishikawachinaganoyoshinogarikamiminearitaouchiimarihizenogikashimaariakekiyamafukudomikitagatakitahataomachigenkaikanzakinishiaritakyuragisagataratosutakushiroishikaratsuhamatamakouhokukawagoeyoshidasatteogoseirumaasakaurawaogawaniizaomiyayoriiotakishikihonjooganohannohanyuinasaitamaokegawaarakawayoshikawayokozehasudasayamahidakafukayachichibuiwatsukiryokamiyoshimikamiizumifujimiwarabiranzanmiyoshiminanoyashiosakadosugitomisatohigashichichibutodasokakukiyonokazoshiraokakasukabekounosukawajimatsurugashimamiyashirokitamotohatoyamamoroyamahatogayakumagayakawaguchinagatorokamisatomatsubushinamegawatokigawakamikawafujiminohigashimatsuyamakoshigayatokorozawas3isk01isk02ryuohkoseikonanaishorittotakashimamaibarahikonetorahimenishiazaikokagamokotoyasuotsukusatsunagahamamoriyamatoyosatotakatsukinotogawaomihachimanhigashiomiakagiunnanizumogotsuamayatsukakakinokimatsuehamadamasudahikawahikimiokuizumoyasugiyakumomisatotamayuohdahigashiizumookinoshimanishinoshimatsuwanoshimaneshimadafujiedayoshidashimodagotembaiwataatamikosaiyaizuitoizumishimahaibaramakinoharaomaezakikawanehonkannamisusonohigashiizufukuroinumazukawazufujiaraishizuokahamamatsushimizuizunokunimatsuzakimorimachiminamiizunishiizukikugawakakegawafujikawafujinomiyaujiietsugaoyamayaitaohiranikkoashikagakuroisokanumasakurashioyakarasuyamamotegiichikaikaminokawatochigihagamokanogisanobatonasumibunasushiobaranishikatautsunomiyaiwafunemashikoshimotsukeohtawaratakanezawaitanokomatsushimatokushimaichibaminamiaizumiwajikikainanmiyoshinarutomimamugiananmatsushigesanagochishishikuinakagawamachidachiyodakomaefussainagitaitochofufuchuomeotahigashiyamatotoshimaokutamaaogashimakodairaedogawaarakawahachiojishinagawatachikawashibuyasuginamihinodekiyosesumidaoshimanerimamitakahamuraadachinakanomizuhobunkyomegurominatokoganeihigashikurumekokubunjihigashimurayamamusashimurayamatamakitahinochuokotokatsushikakouzushimaogasawaraakishimakunitachishinjukusetagayamusashinohachijoitabashiakirunohinoharachizunanbukotouramisasawakasayonagokogehinoyazutottorinichinansakaiminatokawaharaoyabetairainamiasahinantoimizufuchutakaokakurobeyamadajohanatoyamatonaminyuzenfunahashinakaniikawanamerikawaunazukitogahimiuozufukumitsutateyamakamiichiiwadearidayuasainamitaijikatsuragiaridagawatanabemihamahidakakainankiminomisatoshingushirahamakamitondayurakozakoyagobokitayamawakayamakudoyamahashimotokushimotokozagawahirogawakinokawanachikatsuurarsuseroeoishidasagaeoguniasahinagaitendonanyoobanazawanishikawasakataohkuratozawamikawamamurogawayamagatafunagatatakahatashonaishinjokahokuiideyuzakawanishitsuruokakaminoyamayamanobeshiratakamurayamanakayamakaneyamahigashineyonezawasakegawamitouubeyuuabushimonosekitabuseoshimatoyotaiwakunihikarishunannagatohagihofukudamatsutokuyamashowadoshitsurunanbukoshukaiminami-alpsnirasakikosugeotsukioshinohokutominobuyamanashifuefukichuokofuichikawamisatoyamanakakonakamichitabayamanishikatsuranarusawafujikawahayakawafujiyoshidafujikawaguchikouenohara長野京都岐阜大阪三重群馬千葉滋賀佐賀奈良adednelgaccogogror秋田愛知高知埼玉沖縄栃木熊本岩手青森山梨新潟島根鳥取長崎香川宮城石川大分宮崎茨城山口兵庫山形徳島広島福島福岡岡山富山静岡愛媛福井東京xn--4it168dhatenadiaryxn--vgu402ckawaiishophatenablogcocottenamaste北海道penneehimeiwateversestabachibashigagonnagunmapermahaccaakitaosakauh-ohblushkochiaichifukuikuroncapooitigohyogotokyokyotopunyuthickcheap0t00g00j0mie2-ddaapyawjg0amfemsubxiiboomoobutchueekpgwrgrherskrboyrdyupperunderflierchipsmydnsheavyangryhippygirlyrulez神奈川鹿児島和歌山bambinaxn--nit225kokayamasaitamaxn--k7yn95exn--1lqs03nsapporoparasitelolipopmcxn--efvn9sniigatafukuokatokushimafukushimahiroshimakagoshimafakefurokinawaxn--8pvr4ucoolblogxn--0trq7p7nnkawasakinagasakimiyazakichilloutxn--8ltr62kxn--klty5xpeeweezombiecutegirlxn--rny31hxn--uuwu58axn--ntso0iqx3axn--djrs72d6uytoyamanikitanyantakagawamimozanagoyaboyfriendxn--2m4a15egreaterchowderegoismyamagatafashionstorexn--elqq16hxn--pssu33lsendaimiyagixn--rht27zpecoriaomorisaloonwatsonvivianxn--djty4knobushipigboatnaganopinokoxn--f6qx53asadistvelvetsecretxn--5js045dchicappayamanashiibarakidigickgirlfriendxn--1lqs71dmongolianxn--c3s14mxn--qqqt11mtochigixn--5rtq34kparallelo0o0mondkobesagabonadecaoitanarafoolkilldecimainhiholomosblokilociaoundopupugifutankcrapflopnooroopsmodsholyjeezstripperpepperbittershizuokaxn--rht3dkitakyushureadymadeicurusversusmatrixxn--rht61ehungryfloppygloomycrankyhandcraftedlittlestarxn--klt787dxn--kltx9awhitesnowsunnydaytottorilovepoptheshopbuyshopxn--5rtp49cxn--d5qv7z876cwebaccelxn--kbrq7oxn--4pvxsxn--1ctwolovesickkumamotocatfoodxn--tor131oyokohamawakayamatonkotsuxn--ehqz56nxn--uist22hxn--6btw5axn--kltp7dyamaguchifrenchkisspussycatxn--4it797kxn--uisz3gbabybluexn--zbx025dnetgamersxn--7t0a264ckanagawaxn--6orx2rishikawaxn--ntsq17ghalfmoonschoolbusjellybeanxn--mkru45iusercontentlolitapunkxn--32vp30hsakurastoragehokkaidoshimanecandypopbabymilksupersaleweblikeraindropbackdropwebsozaikikirarahateblodaynightmeneacsccogoormobiinfoaeusxxorgmilcomnetedugovorgcomnetedugovbizinfotmprdorgmilcomnomedugovassnotairespresseassocoopgouvveterinairemedecinpharmaciensorgnetedugovtraorgcomedurepgovmeneperekgacscaiiocogoitoresmshsseoulbusanulsandaeguc01milvkimmvchungnamjeonnamjeonbukeliv-dnsgyeonggijejueliv-cdnincheondaejeongangwongyeongbukgwangjuchungbukgyeongnameliv-apicoeduindorgcomembnetedugovorgmilcomnetedugovjcloudorgcomnetintedugovperbnrinfocooyorgcomnetedugovethipfscanvamypepethw3sstorachakeeneticjoinmcinbrowserdwebcyonnftstoragemyfritzaemewphlxachotelltdorgcomwebsocschngonetintedugrpgovassnomgacsccoorgnetedugovbizinfo123websiteidorgmilcomasnnetedugovconfidmedorgcomplcschnetedugovaccoorgnetgovpresstmassoirseproxaccosoundcasthoptocraftvp4c66orgnetedugovitsmcdirmyboxbarsyedgestacksynologylogintoopencloudnohostwebhopdiskstationi234tcp4hoocgroknoipprivmydsddnsdnsforlohmustransipdscloudfilegear-sgbrasiliafilegearframerbarsybarsyonlinecoprdorgmilcomnomedugovinforgcomnetedugovnameacprorgcomartnetedugovpresseinfoassoinstgouvorgnycedugovbarsydscloudjuorgcomnetedugovminisiteaccoororgcomnetgovorgmilcompronetintedugovbizmuseumnameinfoaerocoopaccoorgcomnetintedugovbizcooporgcomgobneteduorgmilcomnetedugovbiznameaccoorgmilneteduadvgovcoorgcomnetaltgovforgotherhiskeeneticispmanagernomassoprod5476132eastasiacentraluswesteuropewestus2eastus2pnortheurope-01newzealandnorth-01southindia-01southcentralus2-01norwaywest-01eastus2-01westus2-01australiaeast-01italynorth-01israelnorthwest-01swedencentral-01westeurope-01centraluseuap-01taiwannorthwest-01uaecentral-01northcentralusstage-01israelcentral-01mexicocentral-01canadacentral-01austriaeast-01germanywestcentral-01francecentral-01ukwest-01denmarkeast-01polandcentral-01eastus-01westus-01swedensouth-01eastus3-01westus3-01brazilsouth-01centralus-01francesouth-01australiacentral-01westindia-01uaenorth-01jioindiacentral-01canadaeast-01belgiumcentral-01spaincentral-01koreacentral-01chilecentral-01qatarcentral-01westcentralus-01eastus2euap-01norwayeast-01southafricanorth-01brazilsoutheast-01germanynorth-01switzerlandnorth-01switzerlandwest-01japanwest-01southafricawest-01japaneast-01eastasia-01indiasouthcentral-01taiwannorth-01centralindia-01uksouth-01southcentralus-01northcentralus-01eastasiastage-01indonesiacentral-01australiacentral2-01australiasoutheast-01malaysiawest-01koreasouth-01southeastasia-01southeastus5-01northeastus5-01jioindiawest-01rucdnwest1-usfra1-desandboxjls-sto1jls-sto3jls-sto2aglobalabglobalsslmapprodfreetlsmapvpslon-1lon-2ny-1fr-1sg-1ny-2paassnwebpaashostingjelasticnordeste-idcsocuserpagescwebfileblobservicebuscoreatlricnjsjelasticwebsitestoragesezagbinruhuukjptsmyspreadshopmynetnameakamaiorigin-stagingfrom-coipv64dynv6cdn77serveblogadobeaemcloudhicamsprytdnsupno-ipownipde5ovhicpfirewall-gatewaysytesmypsxbarsyusgovcloudapimyamazemyradwebakamaihdsaveincloudfastlylbfrom-lasubsc-paysquare7in-the-bandblackbaudcdnhomelinuxoninfernoctfcloudservebbsdns-dynamiccloudfrontakamai-stagingipifonyham-radio-opsenseeringclickrisingcommunity-profrom-nylocalcertgrafana-devedgesuite-stagingcloudflareanycasteating-organicatlassian-devmydattofeste-iplocaltotorprojectknx-serveredgekeycloudflareglobalcloudyclustercasacamserveftpakamaized-stagingakamaiorigindns-cloudmyeffectboomlabotdashbuyshousestwmailhetemlazure-mobilein-dslthruhereredirectmedynuddnsbouncemesupabaseluyanicloudappakamaicloudfunctionsdebiannhlfanpgafanstatic-accessin-vpnmysynologymafeloappudohomeftptrafficmanagersiteleafseidatmemsetcloudflarecloudaccesskeyword-onazure-apiis-a-chefdoes-itgets-itwebhopselfiphomeipkicks-assedgesuitewindowsserver-ontunnelmolemydissentscrapper-sitecloudflarecnuni5srcfggffiobbzabchrsndenodynuopikddnsvpndnsakadnselastxkinghostvps-hostfastlyhomeunixazureedgeshopselectdontexistmyfritzcloudjiffyalwaysdatasells-itsquaresbroke-itazurefddattolocalat-band-campmeinforumfamilydsazurestaticappsdefinimabplaceddnsaliasdynaliasnow-dnsblogdnsroutingthecloudendofinternetdsmynasakamaiedgemymediapcadobeio-staticakamaiedge-stagingakamaihd-stagingddns-ipprivatizehealthinsurancelive-onkrellianschokokeksmassivegridmysecuritycamerarackmazeserveminecraftfrom-azis-a-geekakamaizedmoonscaleoffice-on-theusgovtrafficmanageradobeioruntimeedgekey-stagingreserve-onlinechannelsdvrdnsdojousgovcloudappcdn77-sslapps-1and1podzoneazurewebsitesdynathomescaleforceyandexcloudvusercontentisa-geekcdn-edgescoaemalcesappwriteazimuthtlonarvobuiltwithrocketnoticeablestorecomwebrecnetperotherfirminfoartslgdloncogoiltdorgmilcolcomplcschgenngonetedugovbiznamefirmmobiacincoorgmilcomnomwebgobnetintedubizinfocomyspreadshopdemongovtransurl123websitehosting-clusterkhplaycistrongsnesosvalervålerxn--vler-qoaossandeheroysandeherøybøboheroyherøyxn--hery-iraxn--b-5gavalerbøboxn--b-5gasandesandexn--hery-iraxn--vler-qoavålerhåreålaahavaofsfvfhlolnlalrlhmfmtmahcostntbuåstrmreigersundmyspreadshopgálsáeidsvolltingvollgildeskalflorøvadsøvardøvanylvenxn--bhccavuotna-k7astrandaxn--kvnangen-k0axn--sknland-fxaxn--mosjen-eyarakkestadhyllestadnannestadvevelstadvaapstenordre-landsondre-landsøndre-landtjieltexn--vrggt-xqadsør-aurdalsor-aurdalheradstordmoldefordeførdeseljefedjeryggehemnexn--krehamn-dxasognegranesøgnebrynetjomevallebykletokkegiskedovretjømehobølvoldasaudatolgasømnaviknadønnasomnadonnatranafrananesnaraumasmolatrænafrænalesjasmølaørstaorstahitrafloraaukraloppafrøyarissasnasahalsagalsaromsaraisaráisafroyasnåsagronghobolfjelltydalårdalardalaskimharamkraanghkekråanghkesorumbarumhurumbærumsørummodumsálátbálátfrognbjugnvåganvagangulenskienløtenlotenstrynvefsnxn--merker-kuaskaunsveiobømlobomloskjåkvardoflorovadsosalatbalatsálatklæbuklabuselbubarduulvikskjakklepprisørxn--nttery-byaeflåeidflahofmilgolholsellomskifetvikdepvgsfhsaskerrisorhamarasnesåsnesrørosrorosxn--slat-5namasoynaroyvaroyluroydyroyaskoyradoyandoyrodoymeloyradøyandøyrødøymeløyaskøylurøydyrøymåsøyværøynærøyhoylandethøylandetdivtasvuodnalørenskoglorenskognesoddtangenxn--tjme-hraxn--smla-hraxn--stjrdal-s1aunjargalillehammerunjárgaxn--hamary-fyadavvenjargaxn--bearalvhki-y4a123hjemmesidegjerdrumxn--brnnysund-m8acxn--tnsberg-q1axn--mlatvuopmi-s4axn--snsa-roaxn--skierv-utaxn--brum-voatysfjordkvafjordeidfjordkvæfjordsongdalenmjondalenmjøndalenxn--gls-elackragerogáŋgaviikagangaviikasørreisasorreisasør-varangersor-varangerxn--risr-iraskiervaxn--frna-woaxn--trna-woakvinesdalleksvikleirvikrøyrvikroyrviksvelvikvenneslaevje-og-hornnessandnessjøenmarnardalvindafjordsandefjordenebakksnillfjordullensvangxn--trany-yuabrønnøysundnamsskoganaustevollxn--stjrdalshalsen-sqbnord-aurdalnord-frontrøgstadtrogstadgrimstadflakstadgjerstadxn--sandy-yuaxn--leagaviika-52bnore-og-uvdalvegarsheixn--rlingen-mxaxn--ggaviika-8ya47hvegårsheikarlsoykvitsoymasfjordenhamaroyinderoyosteroydavvenjárgasauheradguovdageaidnuxn--vre-eiker-k8abronnoysiellakkrødsheradkrodsheradkvinnheradbrønnøyxn--mtta-vrjjat-k7afxn--lrenskog-54akvitsøyvárggátkarlsøyosterøyinderøyhamarøybronnoysundxn--aurskog-hland-jnbbahccavuotnabáhccavuotnagiehtavuoatnastor-elvdalmidtre-gauldalxn--gildeskl-g0akarasjokevenassixn--bievt-0qaxn--yer-znalebesbynessebyxn--hbmer-xqamalselvmålselvxn--unjrga-rtamøre-og-romsdalmore-og-romsdalhareidmelandørlandorlandstrandålgårdsolundalgardafjordåfjorddielddanuorrikautokeinoxn--stre-toten-zcbskodjeaejriestangeliernebamblestokkefauskesnåasesnaasekongsvingerlangevagberlevagxn--flor-jrahattfjelldalostre-totenøstre-totenvestfoldxn--mely-iraálaheadjualaheadjunordreisaxn--troms-zuaxn--lgrd-poacporsangerflatangerstavangerleikangerbremangersamnangergieldakarasjohkaxn--rdy-0nabfrostautsirasnoasatromsaxn--sr-aurdal-l8aflekkefjordjølsterjolsteraremarkhedmarknååmesjevuemienaamesjevuemiexn--vard-jrarollagmeråkermerakerorskogørskogxn--bdddj-mrabdákŋoluoktaxn--osyro-wuaaknoluoktatrysilskjervøymandaljondalbindalrindalmeldalsuldalorkdalsigdalalvdallærdalhurdalsirdalverdallerdallardaloppdalåseralaseralhadselkragerødivttasvuotnaoverhallasteinkjerxn--hnefoss-q1askedsmokorsettromsøxn--dyry-iravestre-totenmuseumxn--sandnessjen-ogbrahkkeravjufylkesbiblbájddarbajddarxn--laheadju-7yarennesøyxn--koluokta-7ya57hxn--hgebostad-g3aleirfjordstorfjordbalsfjordbåtsfjordbatsfjordmuosátbievátloabátkárášjohkanøtterøyxn--mjndalen-64anordkappláhppilahppialstahaugsiljanverranrøykenroykenhaldenlyngenbergenhortenhønefosshonefosstroandinbeiarnvarggatosoyroosøyrotromsoidrettmuosatbievatruovatloabatvoagattynsetnessetxn--indery-fyaskánitskanitraholtråholtxn--ystre-slidre-ujbandebusarpsborgbearduxn--karlsy-fyahordalandjorpelandjørpelanddeatnuringsakersør-odalsor-odalxn--slt-elabringerikeaudnedalnittedalnissedalhemsedalslattumsurnadalxn--blt-elabelverumstjørdalnaustdalhjartdalgjøvikfyresdalhasviknarviklarvikgjovikmalvikgamviklenvikporsgrunnstjordalengerdaldrobakdrøbakxn--msy-ula0hvestvagoyxn--vgan-qoaxn--ryken-vuaxn--lten-graxn--stfold-9xaxn--hpmir-xqaxn--lury-iramálatvuopmimalatvuopmitysværkirkenesbirkenesmoskenesbáidárxn--fjord-lraxn--rdal-poabahcavuotnabáhcavuotnaxn--frde-gralindåsbearalvahkixn--hobl-iraráhkkerávjuxn--loabt-0qavågåáltábodøsundlundraderådeetnetimeholeauregrueoddavagavegaranatanaarnasolasulaaltalekafusavangbergkvamåmliamlibokntinnroangranosenoslobodorøstroststatåmotamotivguprivøyeroyerliermossvossxn--nvuotna-hwalusterlunnermarkerhábmerhabmerhvalerfjalerxn--rholt-mratysvarbaidarfitjargaularhápmirhapmirmelhusfosnesøksnesoksnestysneshemnesevenesflesbergeidsbergtonsbergtønsberglindasxn--sndre-land-0cbnamsosxn--srum-graøystre-slidreoystre-slidrevestre-slidretrondheimbalestrandxn--langevg-jxaaustrheimxn--skjk-soavagsoyaveroysandoykarmoyfinnoytranoyvestbytranbysykkylvenxn--hyanger-q1aspjelkavikandasuoloxn--fl-ziaxn--drbak-wuastathellexn--sr-varanger-ggbtelemarkxn--bhcavuotna-s4axn--porsgu-sta26fčáhcesuolocahcesuoloakrehamnåkrehamnsandøykarmøyfinnøytranøyvågsøyaverøynamdalseidxn--lesund-huabadaddjaxn--vegrshei-c0axn--btsfjord-9zagildeskålporsanguxn--trgstad-r1anávuotnanavuotnahammerfestxn--sgne-graxn--brnny-wuacibestadharstadnarviikaevenáššivestnesgjemnessandnesagdenesrennesoyxn--avery-yuaxn--tysvr-vrabearalváhkikongsbergspydebergrandabergxn--andy-iradavvesiidaxn--krdsherad-m8aporsáŋgufredrikstadbjerkreimringeburennebuaurskog-holandnotteroyxn--vgsy-qoa0jxn--rmskog-byaskierváivelandbyglandfrolandaurlandforsandxn--bjddar-ptamidsundålesundalesundfetsundfarsundovre-eikerøvre-eikerakershusxn--moreke-juasørfoldøstfoldostfoldsorfoldhøyangerhoyangerlevangerorkangertanangerxn--vestvgy-ixa6olillesandulsteinxn--rennesy-v1agranvinskjervoyxn--klbu-woalavagisxn--h-2faxn--ryrvik-byakafjordkåfjordseljordfolkebiblxn--gjvik-wuajevnakerxn--kfjord-iuabudejjuxn--kranghke-b0axn--davvenjrga-y4axn--rland-uuaxn--ldingen-q1axn--mlselv-iuaxn--rady-iraxn--linds-prabrumunddalxn--ygarden-p1amo-i-ranaeidskogrømskogromskoghjelmelandxn--finny-yuaxn--sr-odal-q1axn--skjervy-v1aballangenkvanangenkvænangengratangenxn--hmmrfeasta-s4acvossevangensuohkanxn--rde-ulaxn--mli-tlaxn--ksnes-uuanordlandskanlandskånlandsortlandfuoiskuxn--rros-graxn--hcesuolo-7ya35bxn--eveni-0qa01gagaivuotnagáivuotnaxn--seral-lradrammenmodalenmosjoenjan-mayentorskensteigengloppenxn--snes-poamatta-varjjatxn--sr-fron-q1aomasvuotnajessheimbådåddjåxn--krager-gyaxn--kvfjord-nxaxn--asky-iraxn--snase-nraxn--bidr-5nacholtålenxn--vads-jraxn--jlster-byamosjøenxn--rst-0nastavernxn--ostery-fyaxn--oppegrd-ixaxn--sknit-yqaxn--risa-5naoppegårdskiptvetrendalenholtalenxn--mot-tlaxn--lhppi-xqaxn--holtlen-hxaxn--srreisa-q1akopervikxn--muost-0qaxn--bmlo-grahokksundkvalsundegersundxn--karmy-yuaullensakerxn--hylandet-54axn--kvitsy-fyaxn--bod-2nalangevågberlevågkristiansandxn--rsta-frahornindalstjørdalshalsenstjordalshalsensandnessjoenhámmárfeastaxn--lrdal-srasør-fronsor-fronnord-odalkristiansundmátta-várjjatvestvågøynesoddennotoddenbuskerudøygardenoygardensalangenlavangenralingenrælingenlodingenlødingenleaŋgaviikalaakesvuemieleangaviikauenorgexn--srfold-byaaskvollxn--rskog-uuaxn--nry-yla5gxn--vry-yla5ghammarfeastaxn--rhkkervju-01afxn--givuotna-8yakommunekrokstadelvanedre-eikerhagebostadhægebostadxn--berlevg-jxakviteseidxn--s-1faxn--l-1faxn--nmesjevuemie-tcbafuosskomoårekemoarekexn--lt-liacxn--jrpeland-54asvalbardoppegardholmestrandtvedestrandsogndalsokndalarendalsunndalfolldalxn--krjohka-hwab49jlyngdaletnedalnorddalsaltdalgausdalskedsmovaksdalgjesdalstordalxn--frya-hraaarbortedrangedalxn--smna-graaurskog-hølandxn--vg-yiabtjeldsundhaugesundlindesnesxn--mre-og-romsdal-qqbxn--dnna-gradyntmpheremerseineshacknetenterprisecloudmineaccomaorimāoriorgmilcriiwigennetschoolhealthkiwigovtgeekxn--mori-qsacloudnsparliamentcomedorgcompronetedugovmuseumwebsitekinservicebarsywebsitebuildereerobookheimdnsleapcelleero-stagetechcrscsslorigingohomecdbedeeeiemesecabgngilnlalplchfisiincnnoroptatitmtltruauhulumkdkukskjplvtrgrfrkrhrusesismycynzcznetinteduassoososcloudstgbetaaezaeuhkusjshatenadiarycdn77hoptozaptois-a-knightmyftpno-ipjpnddnssdpdnsspdnsbarsysweetpepperis-a-bruinsfanis-very-sweetservegameis-a-soxfanhomelinuxcdn77-secureservebbsmisconfusedwebredirectblogsitefreedesktopcouchpotatofriestoolforgeaccesscamis-lostreadmyblogsmall-webfedorapeopleserveftpis-a-celticsfanmywirepotagertwmailin-dslsellsyourhomeread-booksfreeddnscable-modemis-savednflfanufcfanmlbfanstuff-4-saleendoftheinternetin-vpnmy-firewallhomeftpis-localis-a-chefboldlygoingnowherewebhopselfipkicks-assroxatunkcamdvrfedoraprojectgotdnsdvrdnsdyndnspubtlspimientahomeunixdontexistfedorainfracloudwmflabsfspagesbmoattachmentsteckidsfamilydsdnsaliasdynaliasnow-dnscloudnsdoomdnsduckdnsblogdnshomednsroutingthecloudendofinternetdsmynasip-dynamicpoivronhttpbinmyfirewallis-very-evilmysecuritycamerais-a-linux-userwmcloudis-a-geektuxfamilyis-a-candidatedoesntexistis-very-badhobby-sitegame-hostaltervistais-foundis-a-patsfandnsdojohepforgepodzonedynservcollegefanis-very-goodfrom-meis-very-niceisa-geeknerdpolacmedsldingorgcomnomgobabonetedupleskaemhlxmyboxrockyprvcydeuxfleurspdnscodebergheyflowstatichostorgmilcomnomgobneteduorgcomeduiorgmilcomngonetedugovcloudns1337ngrokacorggogfamcomwebgobnetedugokgopgkpgovgosbizpasaugumicsopozpapuwmwsrprusiskwpspkppspkmpspokeoiawsawifoumsdnskokwpmuppuppsppiwwiwoowuzswkzoschrzpisdnwzmiuwwitdpssewsseumigugimoirmpinbwinbwiihupporzgwgriwupowwskrwioswuozstarostwokonsulattmpccopruszkowmyspreadshopostrodakartuzyopolegminamediaustkazgorajgoraolawailawalomzawloclradombytomjaworznotargilubinkoninzagantorunkutnokepnonakloczestsopotsanokturekplockslasksklepzarowlukowmedaidgdaorgmilrelcomnomatmgsmartneteduelkgovwawsossexbiztgorysejnytychypomorzeboleslawiechomesklepsdscloudunicloudzakopanelegnicarawa-mazbydgoszczswidnikkrasnikwloclawekbielawamragowograjeworealestatebeskidykaszubymalopolskaprzeworskswiebodzinlecznadfirmaszkolawarmiagdyniamiastakazimierz-dolnymalborkswidnicadlugolekaostrolekapodlasieelblagtravelsimplesitezachpomormielecszczecinnieruchomosciwalbrzychlezajsklublinbedzinpoznanwielunmielnooleckostarachowicedkontopowiatwroclawrybniksuwalkileborkslupskgdanskostrowwlkptarnobrzegtourismwegrowkrakowglogowyou2pilanysamailwrocinfoagroautobeepshoppriviqhslapypiszlodzcfolksecommerce-shopmazurypulawyskoczowrzeszowpomorskiezgierzkaliszolkuszlowiczostrowiecsosnowiecmazowszewodzislawbialowiezazgorzeleckatowicepabianicejelenia-gorawolominkarpaczsieradznowarudaczeladzkonskowolaskierniewiceswinoujscieturystykabieszczadycieszynketrzynolsztynbialystokbabia-goraprochowicewarszawastalowa-wolapolkowicegorlicegliwiceponiatowalimanowalubartowaugustowkobierzyceopocznognieznoszczytnokolobrzegshoparenapodhalebielskoklodzkostargardatwithplayitownnamecoorgnetedugovacorgcomproestnetedugovbiznameislaprofinforechtngrokmedaaaacacpaenglawjurbarbarsykeeneticavocatacctcloudnsorgcomsecplonetedugov123paginaweborgcomnetintedugovnomepublidkinbarsygovx443cloudnsorgmilcomnetedugovcooporgmilcomschnetedugovnamecomcannetlibassoaemclantmcontstoreorgcomnomrecwwwbarsyfirminfoshopartsstackitmyddnswebspacelima-cityacincooxorgedugovbarsybrendlyhbvpsvpsspectrumlandinghostingacppmordoviamcprecbgorgmilcomspbnetintedumsknovgovbirrasmcdirmytismircloudvladimirnalchikadygeyamarinepyatigorskmyjinobashkiriaeurodirvladikavkazna4ugroznykustanaikalmykiacldmaildagestaniranbuildcloudcanvaliaravalwixdevelopmentappwritemigrationneedleverceldatabasestackitcodereplravendbonporterlovableaccoorgmilnetgovcoopmedorgcompubschnetedugovservicemecomygovorggovtvmedorgcomnetedugovinfoedgfacbmlonihkutwpsryxzbdtmacfhppmyspreadshopbrandpartiorgcomfhvpress123minsidaitcouldbeworlanbibkommunalforbundfhskiopsyskomvuxkomforbnaturbruksgymnloginlineorgcomnetedugovenscaledeuusentsurgebotdaorgmilcomnetgovnowteleporthashbangplatformlovablebarsyshopwarebasehoplixbarsyonlinemsf5gitappgitpagewawamscofigma-govcaffeinefigmacanvasoltstscwputerbarsysupportchatgptsquareomniweopensocialcpanelplaycodenotionnovecorewpsquaredpreviewjelecyonbyensrhtfastvpspieboxconvexjouwwebheyflowplatformshloginlinemadethissourcecraftclouderaorgorgcomartedugouvunivmeorgcomnetedugovsurveysstatichfheiyuxs4allprojectmyfastubervibehostapp-ionosdeployagentmecoorgcomschnetedugovbizcncostoreorgmilcomneteduembaixadaconsuladokiraranohoprincipesaotomeheliohobarsystorebaseshopwaresellfyaiabkhaziavologdamordoviapenzalenugsochinavoiexnetspbmsknovnorth-kazakhstanashgabadkareliaarmeniageorgiavladimirnalchikivanovobukharaadygeyakhakassiakalugakrasnodarjambylaktyubinsktroitskbryanskobninskkurganazerbaijanpokrovskbashkiriatselinogradvladikavkazmurmansktulatuvamangyshlaktashkentchimkentgroznykaragandatermezarkhangelskkustanaikalmykiabalashoveast-kazakhstankaracoldagestantogliattibarsyredorgcomgobedumirenknightpointaccoorgjelasticdiscoursecleverappsschacmiincogoornetonlineshopcogoorgmilcomwebnicnetintedugovbiznametestcoorgmilcomnomnetedugovorangecloudpersoindorgcomfinnatnetgovensmincomtourismintlinfox0611oyaorgmilcomnetedugovquickconnectvpnplusnettprequalifymeaddrmyaddrntdllwadlnctvavdrk12orgmilpolbeltelcomwebgennetedutskkepgovbbsbiznameinfocoorgmilcompronetedugovbiznameinfobetter-thanworse-thansakurafromdyndnson-the-webmymailerorgmilurlcomneteduidvgovmydnsgameclubebizmeneacsccogotvorhotelmilmobiinfovodteiflgplkmsmsbcckhincndnvncoztltmkckppzpdprvcvkvlvcrkrkscxuzchernovtsyrivneyaltaodesavolynrovnolutskltdinforgcomnetedugovbizvinnicazhitomirternopilpoltavakropyvnytskyizaporizhzhiasevastopolsebastopoluzhgoroduzhhorodkharkovkharkivvinnytsiakhmelnytskyizaporizhzhecrimeaodessazhytomyrnikolaevcherkassydonetskluganskluhanskkirovogradivano-frankivskchernivtsikrymkievkyivlvivsumyzakarpattiamykolaivcherkasychernigovkhersonchernihivdnipropetrovskdnepropetrovskkhmelnitskiyneacsccogoorusorgmilcomedugovmyspreadshopadimono-ipbarsybarsyonlinelayershiftnh-servretrosnubapicampaignservicelugaffinitylotteryweeklylotteryraffleentrygluglugsmeaccoindependent-inquestnimsitecopropymntltdorgplcschnetgovnhsbarsyindependent-commissionindependent-reviewpolicepublic-inquiryindependent-panelconnhospindependent-inquiryroyal-commissionoraclegovcloudappscck12libaws-govccphxcclibpvtparochchtrcck12libcceatonk12coglibtecgendstmusann-arborwashtenawcck12glghcck12sealibforksolympiabainbridge-islkeyporthoquiamyarrow-pointcentraliaport-townsendsequimport-ludlowrentonsilverdalebremertonredmondsheltonbellevueport-orchardport-angeleskingstonchehalisaberdeengig-harborseattlepoulsboidmdndsddemenegacalamaiavawapailalflnmdcncscohnhmihiviwiriinmntnmocoutvtctmtgunjokakwvnvprarorasmskstxwynykyazisadninsnngosrvis-bymircloudservernamepointtoenscaledland-4-salefreeddnsstuff-4-saleazure-apinoipdatabricksappscloudnsgolffanheliohostazurewebsitesgvorgmilcomgubneteducoorgcomnetd0egvorgmilcomnetedugovmydnsiacostoree12orgmilcomnomwebgobbibrectecnetintedugovraremprendefirminfoartseducok12orgcomnethidnsidacaiiosonlahanamhanoicamauhueorgcompronetintedugovbizbacninhtayninhhoabinhnamdinhtravinhhaiphongvinhlonghaiduongquangnamquangtrithuathienhuequangninhbacgianghaugiangquangbinhsoctrangbentrethanhphohochiminhdanangkontumhatinhkhanhhoathanhhoahealthgialailaocaiyenbaibackanngheanlonganphuyenphuthocanthodaklakdongnainameinfovinhphucdongthapkiengiangtiengiangquangngailaichaulangsonlamdongdaknonghagiangangiangcaobangbinhduongninhthuanbinhthuanbaclieuthaibinhninhbinhbinhdinhtuyenquanghungyenbaria-vungtauthainguyendienbienbinhphuocschbizputerimagine-proxyorgcomnetedugovcloud66advisormypetsdyndnsxn--8dbq2axn--4dbgdty6cxn--5dbhl8dxn--hebda8bxn--80auxn--d1atxn--c1avgxn--o1acxn--o1achxn--90azhxn--55qx5dxn--uc0atvxn--od0algxn--wcvs22dxn--gmqw5axn--mxtq1mxn--12c1fe0brxn--h3cuzk1dixn--12co0c3b4evaxn--12cfi8ixb8lxn--o3cyx2axn--m3ch0j3axn--j1adpxn--90amcxn--90a1afxn--h1ahnxn--j1ael8bxn--h1alizxn--c1avgxn--j1aefxn--80aaa0cvacxn--41acaffeineexeopentunnelbotdashtelebitorgtmaccoagricorgmilnomwebnicngonetaltedugovlawnisschoolgrondaraccoorgmilcomschnetedugovbizinfoprg1-zeropstritonstackitlimazeropsaccoorgmilgovяспборгкоммскбизмирсамаракрымсочиакодпроргобрупрצהלממשלישובאקדמיהองค์กรธุรกิจรัฐบาลศึกษาทหารเน็ต教育網絡組織公司政府個人닷넷한국澳门新闻澳門联通家電嘉里招聘通販닷컴삼성コムგეбгрфеюadcdbdgdidmdsdtdaebedeeegeiejekemenepereseveyegabacalamanauavapaqasazacfbfafgfnfpfwftfbgcgagggegkgngmgsgpgvgtgugilmlnlalclglplsltlhmimjmkmmmomambmcmdmfmgmzmpmsmtmgbbblbsbecccacnclcmcvctcscmhkhghchbhthphshlinikifigiaibicivisikninhnmncnbngnsnpnvntnjoionomobocoaofodorosotoptstttytatbtetgtithtmtltrusuvuaucueuguhulumunufjdjbjtjsjlkmkhkfkdkcktkukskpkgpmpnpkpjpgqaqmqiqsvtvcvbvmvlvrwpwtwzwbwcwawgwkwmwtrsrprgrfrercrbrarnrmrlrkrirhrwsusrssspsgsesbsaslsmsissxmxaxcxuypysylymykygybycyuztzsznzmzkzdzczbzazελευ世界台灣购物公益点看臺灣网络書籍在线网站手机机构大拿游戏信息台湾谷歌慈善商标香港中国餐厅网址中國商城食品微博政务移动集团公司八卦商店健康网店政府时尚佛山中信娱乐广东企业homedepotengineeringاماراتrepublicankuokgroupversicherungchannelcitadelxn--pgbs0dhxn--b4w605ferdstatebankwebsitexn--mgb9awbf亚马逊淡马锡alibabaxn--ngbc5azdxn--mgbbh1axn--45br5cyltoshibabuildworldcloudtradeguideplacespacedancemoviephoneprimesmilebiblestyleappleazurestoreskypegripexn--l1accdrivelottehorsehouseleasechasereisestadahondaomegaaetnaamicaninjanokiamediadeltavodkaedekaosakapizzaslingemailgmailtirolshelltmallfinallegaltotalhotelamfamforumrehabmusicciticricohcoachwatchboschearthfaithirishmiamiarchidubaiguccipraxiみんなストアセールcanonsalononionnikonepsonkoelngreensevencrownikanoradioaudioweiboglobopromogalloyahoociscorodeovideomangobingotokyovolvolottokyotophotosmartsportquesttrusthyattjetztadultcymrubaidutushuxn--kprw13dubankclickblackmerckgroupsharpcheapnowtvxn--h2brj9cקוםհայоргсрбмонкомбелмкдқазрусукрمصرقطرعربكومdadcfdmedwedredphdthdbidpidkrdmsdltdiceonewmeglemoerwecfageacbanbambaaaammakianraspacpaaxawtfbcgaegongingaigvigorgdogdhlmilrilonlaolloluoljllcalgalnflafltelsrlfrllplkimibmcamcombommomifmabbjcbscbwebcabnabtabmlbpubabcbbcnecincpncllcstcwtcpwcnyckfhbzhovhmoiskiobisbitcifyituipinvinwinxincbnbcnmanfangdnmenrenkpnmtnyunrunfununobiojioriohbogmofooboooooacoecoceongoproartistottnttbbtcateatlatvetpetbetnethktmitfitintjothotgotdotbotprueduicujnjyouinknhktdkappsapgapmapdnptopgopllpjmpzipvipripesqtrvdtvitvdevmovgovhivnrwlawsewnewbmwwownowhowdvrftrmtrsfrbarcartvscrseusawsupsubssbsadsddsldssasbmsmlsxxxboxfoxgmxtjxsextaxbuyflydiysoyjoyskypaydaygayxyzanzbizwebersenerpokerlameractortatarsolarລາວคอมไทยtourslocusnexuslexusgiftsbeatsboatspartspressglassswissकॉमनेटtiresgivescodeshomesgamestunesshoescardswalesloansvegastoolsdealsautosparisファッションworkssucksrocksxeroxforexfedexpartylillymoneystudyrugbytoraytoday中文网xn--unup4y天主教飞利浦新加坡enterprises我爱你嘉里大酒店christmasxn--fct429kholdingsxn--8y0a063axn--mgbx4cd0ablifestyleabogadoallstatenetbankكاثوليكxn--s9brj9cxn--gk3at1ebestbuycharityxn--55qx5dmicrosoftpropertybasketballhomegoodscorsicajewelrygallerygrocerysurgerycountrybrusselsverisignferreroxn--czr694bhdfcbankcommbanksoftbankپاكستانپاکستانnextdirectالسعوديهالعليانxn--h2brj9c8cxn--80adxhksshikshaxn--mgbai9azgqp6jcuisinellabarclayscatholicxn--kpry57dcompanyxn--xhq521bblackfridayxn--mgba3a3ejtsandvikxn--d1acj3bacademydownloadمليسياxn--j1amhxn--w4r85el8fhu5dnraipirangaathletaxn--fhbeixn--mgbqly7cvafrzuerichxn--c2br7gஇலங்கைcontractorsxn--io0a7igraphicsinsurancetemasekxn--xkc2al3hye2amotorcyclesphotographydirectoryplumbingxn--vhquvclothingtrainingcleaningwilliamhilllightingxn--mgba3a4f16ashoppingcateringeducationokinawapicturesventuresproductionsxn--9et52uwalmartഭാരതംsupportrealestatecapitalonexn--nqv7fs00emaauspostfloristdentistxn--qxamgodaddybradescobargainsmitsubishikerryhotelsxn--9dbq2axn--3pxu8kimmobilienxn--fjq720axn--mgbtx2bholidaymckinseymadridbusinessbuildershelsinkixn--4gbrimмоскваالسعودیةcoffeedegreelacaixapartnersalsaceofficeabbvievoyageorangegeorgeonlinechromemobilekindlegoogleoraclecircleschulesecureinsurexn--mgba7c0bbn0aestatexn--mgbc0a9azcgcruisehangoutxn--vuq861bxn--42c2d9arexrothfirestoneuniversityxn--nnx388alifeinsuranceextraspaceонлайнvermögensberatersoftwarexn--fiqs8sxn--mgbab2bdxn--w4rs40ltiendaभारतम्africatoyotaotsukasakuracameracreditcardnagoyaconsultingnetworkjunipertheatermonsterprogressivepioneerxn--55qw42gracingdatingvotingvikinglivinggivingxn--bck1b9a5dre4cbrotherweatherjoburgفلسطينlplfinancialxn--clchc0ea0b2g2a9gcdfutbolschoolsocialglobaldentalwoodsidechanelairtelmatteltravelrealtorwebcamstreamభారత్unicomalstomxn--nodexn--6frz82gmuseumfurniturexn--rvc1e0am3exn--mix891faccenturexn--11b4c3dismailineustardiscountquebeccomsecclinicservicesxn--y9a3aqxn--c1avgswatchchurchsearchالاردنmarketingcontacthealthmonashshoujisanofitaipeiamericanexpresssuzukiアマゾンクラウドポイントbhartiグーグルxn--mgberp4a5d4armemorialxn--1qqw23alondonmormoninstitutevisionbostonnortoncouponmaisonamazonvirginberlindesigndurbanolayannissananquanxihuanhitachikaufengardenreisenbayerntechnologydatsunxn--90a3aclatinocasinostudiophysioxn--ngbe9e0apharmacytattootaobaoaramcoexpertreportabbottdirectselectimamatfairwindspictettargetmarketintuittravelersinsurancecreditdupontryukyusuppliesxn--tckwebnpparibasschmidtmerckmsdyodobashirestaurantbridgestonecricketxn--fpcrj9c3dbostikbroadwayattorneylefrakemerckxn--fiq228c5hscareersfarmerswinnersflowersxn--wgbh1cguitarsxn--54b7fta0ccxn--p1acfmakeupgalluplandroverxn--kcrx77d1x4agoldpointbauhausxn--mgbayh7gpahiphopplaystationxn--mgba3a4fraxn--eckvdtc9dhyundaixn--gckr3f0fistanbulticketsmarketsflightschintaireviewsxn--3e0b707ewindowsxn--fiqz9sfinancialxn--fzys8d69uvgmابوظبيdiscoverreviewবাংলাxn--5su34j936bgsgmoscowobserverapartmentsдетиارامكوсайтeurovisionxn--i1b6b1a6a2exn--xkc2dl3a5ee0hتونسموقعبارتڀارتشبكةعمانبيتكعراقreadkredbondlandbandfundfoodprodgoldfordtubecafesafelifeggeeieeefreefagepagegugezonewinememenamegamesaleablebikenikelikecarecbreherefiresaveloveliveblueartedatesitevotecaseluxebofamodaltdaasdatiaayogasinavanashiaasiajavabbvatevavivadatazaraarpacasavisasncfprofmaifsurfgolfdvagsongbingpingwangkpmggoogblogpohlfailcooldellcalldeallidlsarlfilmteamroomfarmimdbarabclubhdfcicbchsbcgmbhrichtechfishdishcashminiernikddiaudiwikimobitaxicitikiwidesiqponskinloanakdnwienopenporncerntownimmolimoolloinfonicofidolegosaxozeroaerovivoautovotomotofastbestresthostpostnextlgbtchatseatgiftmeetdietreitmintrentgentspotscotguruitausohumenucyoubanklinkpinkdclktalksilkbookseekworkrsvpaarpjeepshopcoophelpcamppccwshowbeerstarruhrflirweirhaircarsparsjprshausplusnewstipstoysjobskidsfanspicsdocsxboxamexsexynavycitysonyarmyallybabyplaydeliverybuzzgbizlamborghiniphilipsලංකාಭಾರತfitnessexpresslanxesspfizercenterwalterlawyersoccercareerkosherbrokerlockerdealerdoctorauthorxn--mgbqly7c0a67fbcvermögensberatungjaguarxn--pssy2uxn--hxt814eflickrrepairrogersairbusxn--mgbai9a5eva00beventsyachtsxn--t60b56aভাৰতভারতभारतभारोतviajeshermeshughesxn--j1aefसंगठनvillasଭାରତclaimshotelsભારતzapposphotosjuegoscondostatamotorsgratistennisਭਾਰਤtkmaxxtjmaxxschaeffleryandexxn--80aswgrealtysafetybeautyluxuryxn--3ds443gsupplyfamilyxn--o3cw4hhockeysydneyxn--90aenissayalipayenergycomputeragencyxn--rovu88b電訊盈科xn--gecrj9cstatefarmaccountantaquarelleolayangroup香格里拉xn--p1ai组织机构xn--1ck2e1bxn--mgbt3dhdschwarzموريتانياabudhabinowruzkomatsufujitsuhospitalxn--80asehdbxn--mgbtf8flxn--j6w193gxn--yfro4i67oprudentialxn--flw351ecruisescoursesrecipesxn--e1a4cferrarixn--ses554gxn--wgbl6awatchesstaplessinglesxn--mgbcpq6gpa1axn--otu796dpropertiescreditunionxn--mgbah1a3hjkrdstockholmhisamitsuالسعوديةstcgroupdomainsoriginscouponsbloombergclubmedfroganslimitedxn--80aqecdr1aexposedinternationalequipmentbarclaycardxn--q7ce6axn--mgbi4ecexpprotectionassociatesconstructionxn--cck2b3bxn--45q11candroidfoundationישראלxn--mgbca7dzdocliniqueboutiqueengineerxn--qxa6asystemsfirmdalefashionauctionxn--nqv7finfinitirentalsreliancetradingweddingfishinghostinggentingbookingcookingxn--3hcrj9cgraingerxn--czrs0tdemocratsamsungyokohamaxn--h2breg3evexn--nyqy26alundbeckmelbournevacationssolutionsfrontierxn--vermgensberatung-pwbmanagementxn--cg4bkixn--mgb2ddeslincolnhamburgsandvikcoromantblockbusterairforcebarefootxn--4dbrk0ceinvestmentsfeedbackcommunityxn--ngbrxالبحرينdiamondsamsterdamhealthcareredumbrellaxn--mxtq1mxn--2scrj9cagakhanxn--mgbpl2fhкатоликcaravanசிங்கப்பூர்richardlimortgageamericanfamilyxn--fzc2c9e2cscholarshipssaarlandxn--imr513nvlaanderensamsclubgoodyearkitchenஇந்தியாweatherchannelallfinanzxn--kput3iالسعودیۃxn--90aisxn--efvy88hالجزائرxn--mgbaam7a8hexchangejpmorganxn--tiq49xqyjfidelitysecurityxn--mk1bu44cwanggouxn--fiq64bxn--6qq986b3xlxn--mgbbh1a71exn--80ao21amarshallsxn--5tzm5gtravelerspanasoniclatrobeyoutubeaccountantsxn--rhqv96gxn--cckwcxetdanalyticsxn--ygbi2ammxبازاربھارتسوريةorganicfreseniusسورياxn--9krt00axn--qcka1pmcxn--jlq480n2rgdeloittesciencefinancexn--jvr189mxn--30rr7yhomesensehotmailbaseballfootballleclercboehringerxn--q9jyb4cxn--mix082fاليمنهمراهpolitieسودانايرانایرانnetflixyamaxunxn--lgbbat1ad8jcollegestoragecapetowncolognekerrypropertiesxn--mgbgu82axn--ogbpf8flxn--czru2dwhoswhociprianilasallexn--g2xx48cforsalebanamexaudiblexn--vermgensberater-ctbxn--zfr164bericssonvanguardxn--45brj9cindustriestheatremarriottxn--3bst00mcomparexn--mgberp4a5d4a87gcapitaldigitalالمغربbarcelonashangrilaxn--d1alfcalvinkleinwwwcitysapporokawasakinagoyasendaikobekitakyushuyokohamackjp`.charCodeAt(t)===42&&(tB[e]=n),t=r}var nB=-1,rB=0,iB=0;function aB(e,t,n,r){if(Jz[e]!==r)return!1;let i=$z[e];for(let e=0;e<r;e+=1)if(`orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitglideossnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxysiteacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstorageedaccogoorusorgcomnetinteduaéroportxn--aroport-byaassogouvcomilgobgovcloudnses-1eu-west-1us-east-1euvipit1eurarubait1s3lbwebsites3websiteru-spbru-mskelasticcsrunstnukukcaukusnl-ams-1fr-par-1fr-par-2functionsnodess3ddlwhmrdbfnck8sifrs3-websitecockpitscblmgdbdtwhkafkpubprivs3ddlwhmrdbk8sifrs3-websitecockpitscblmgdbdtwhkafks3ddlrdbk8sifrs3-websitecockpitscblmgdbdtwhkafkk8sscalebookpl-wawfr-parnl-amsbaremetalsmartlabelinginstancesdechk2kuleuvenlaravelvoorloperurownoxazapscwhstgrvaporonline-serverobservablehqelementorantagonistreclaimjoteluluencowaydiademjelasticmatlabmagentositetrendhostingaxarnetperspectajenv-arubajelejoteravendbemergenttrafficplexconvexkeliwebserveboltbegetcdnstaticson-rancherprimetelonstackitunison-servicesdnshomelinkyardbarsyjelecloudnscocomnetgovmycn-northwest-1cn-north-1s3s3-accesspoints3-websites3s3-accesspointrdsdualstacks3-deprecatedemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspoints3s3-accesspointrdsdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicn-northwest-1cn-north-1cn-northwest-1ebcomputeelbcn-north-1airflowcn-northwest-1cn-north-1oncn-northwest-1cn-north-1amazonawssagemakeramazonwebservicesdirectasgdsdhehahljlnmhbacscahqhshhihnlnynsnmofjbjzjxjtjhkcqtwgsjssxnxjxgxxzgz網絡网络公司orgmilcomnetedugovxn--55qx5dcanva-appsxn--io0a7iquickconnectcanvasitekhsjxn--od0algcanva-codemyqnapcloudsrvrlessclustersrealtimestorageleadpagescarrdcrdorgmilcomnomnetedugovhidnssupabaserdpareplmypiumsoxmitotaplpagesfirewalledreplitowodevwebview-assetsvfswebview-assetss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websiteemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecateds3-websites3-object-lambdaexecute-apis3s3-accesspoints3-websites3-accesspoint-fipss3-fipss3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstackemrappui-prods3-websites3-accesspoint-fipss3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apis3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9vfss3s3-accesspointdualstackemrappui-prods3-websiteaws-cloud9emrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9eu-west-3ap-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1us-northeast-1ap-southeast-1me-south-1af-south-1ap-south-1ap-southeast-7us-west-2eu-west-2ap-east-2us-east-2ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ap-southeast-6ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1mrapaccesspoints3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3s3-accesspointdualstacks3-deprecatedanalytics-gatewayemrappui-prods3-websites3-accesspoint-fipsaws-cloud9s3-fipsemrstudio-prods3-object-lambdaemrnotebooks-prodexecute-apicloud9s3eu-west-3ap-south-2eu-south-2computes3-ap-northeast-2elbrdss3-ap-east-1s3-sa-east-1s3-us-gov-west-1s3-eu-central-1s3-ca-central-1eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3s3-website-us-west-2s3-website-eu-west-1s3-external-1eu-central-1me-central-1ca-central-1il-central-1s3-us-west-1s3-eu-west-1s3-website-sa-east-1s3-website-ap-southeast-2ap-northeast-1ap-southeast-1s3-us-west-2s3-eu-west-2me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2s3-website-ap-southeast-1s3-1s3-globals3-ap-northeast-3eu-north-1airflowap-southeast-2s3-us-gov-east-1s3-fips-us-gov-east-1s3-me-south-1s3-ap-south-1ap-northeast-2s3-website-us-west-1ap-southeast-5s3-eu-north-1s3-ap-southeast-1s3-website-us-gov-west-1compute-1s3-eu-west-3us-gov-west-1s3-website-ap-northeast-1us-gov-east-1s3-fips-us-gov-west-1s3-website-us-east-1s3-ap-southeast-2ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1s3-us-east-2s3-ap-northeast-1authauthauth-fipsauth-fipseu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1rframeservicesbuilderstg-builderdev-builder*ociocpocsazuregcpawsdemoinstanceeu-west-3eu-south-2ap-southeast-3ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1previeweu-4us-4us-1eu-1us-2eu-2us-3eu-3appscomputepaasrag-cloudrag-cloud-chjcloudjcloud-ver-jpcdemonodebalancermembersipeuxvsoncillaocelotonzayalilynxsphinxfentigercustomercaracalo365cloudstaticxendevapp001testcode-builder-stgplatformmediasiteprojedrydpagesjsx0desazacncoitrueu4uhkukgrbrushatenadiarymyspreadshopfrom-flfrom-wvwebspace-hosttheworkpchatenablogcursorusercontentservesarcasmapplinzisakuratanwixsiteappchizigiizeis-into-carsdnsiskinkyadobeaemcloudis-a-therapistpgfogmyvncdojinis-an-actress1kappfldrvkozowqa2jpnmexprgmrfirewall-gatewaydynnscafjsfbsbxooguyfrom-gawoltlab-demois-a-anarchistwiardwebteaches-yogadattowebtb-hostinglive-websiteservegamegotpantheonfrom-nhsubsc-payfrom-ohvipsinaappfrom-cadyndns-officehomelinuxfrom-mahercules-appservebbsstreakusercontentfrom-okfrom-wyfastly-terrariumis-a-llamaqualyhqportalserveexchangeon-vaporvivenushopciscofreakgrayjayleaguesmetaaiusercontentfrom-iais-a-libertariansaves-the-whalestaveusercontentyolasiteoperaunitepoint2thisis-a-catererclaudeusercontentlinodeusercontentfrom-vagithubusercontentsells-for-lesshosteurcanva-appsplaystation-cloudddnsfreefrom-pafrom-prfrom-waddnskingoutsystemscloudhotelwithflightmydattois-a-nascarfanmydbserverminiserverdamnserverservehumouris-a-playerfrom-nvfrom-nmemergentagentgentappsamplifyappfrom-kyis-an-accountantnfshostserveircfrom-akpythonanywherestackhero-networkpostman-echolikescandydyndns-mailobservableusercontentserveftpfreeboxosfrom-utcdn77-storageamazonawsneat-urldyndns-serverlinodeis-a-teacherfrom-vtgleezemythic-beastsus1-pleniteu1-plenitla1-plenitpaywhirlservecounterstrikejdevcloudhealth-carereformis-into-animegoogleapisis-a-painterafricaisa-hockeynutatmetais-an-actora2hostedis-a-democratdatadetectest-le-patrondigitaloceanspacesis-a-designeris-a-hunterlinodeobjectstemp-dnsissmarterthanyoufrom-arsimplesiteevennodetownnews-stagingis-a-liberalgooglecodejelasticservemp3qualyhqpartnerdyndns-free1cooldnsest-a-la-masiondrayddnsdynuddnsfrom-orfrom-miis-a-bloggerfrom-himydobisscanvacodeis-an-engineerest-a-la-maisonupsunappdevinappswafflecellmyasustorwpenginepoweredfrom-ctservep2psame-appmyshopblocksthingdustdatalikes-piediscordsezis-with-thebandlpusercontentis-leetshopitsite3utilitiesis-a-personaltrainersinaappladeskis-a-cheflogoipselfipbase44-sandboxnospamproxyalibabacloudcsmesswithdnsauthgearappsiamallamawithgooglelutrausercontentmochausercontentframercanvasmytabitdyndns-homew-credentialless-staticblitzcpserverdiscordsaysis-a-nurseappspotatlassian-isolated-3premotewdfrom-mtwixstudiocode0emm180rmyactivedirectoryawsappsmytuleapdnsabrpolyspaceqbuserrenderbuiltwithdarkboutirgotdnsabrdnsdopaascanva-hosted-embedawsglobalacceleratorhomesecuritypcmyiphostditchyouripclever-clouddyndns-ipon-aptibleis-a-musicianhosted-by-filessecuritytacticsappspaceusercontenthomeunixstrapiappsame-previewcf-ipfsmycloudnaselasticbeanstalkis-certifieddontexistkasserverik-serverdrive-platformatlassian-3pfirebaseappherokuappawsapprunnerbarsycenteris-a-cubicle-slaveservehttpmyshopifyis-a-guruquicksytessiiitesorsitesmagicpatternsappis-a-cpameteorappfrom-wiis-a-rockstarbumbleshrimpdattolocaldatabricksappsreadthedocs-hostedfrom-rifamilydsdyndns-picsplesknsbplaceddnsaliasdynaliasdyndns-remotedoomdnsip-ddnsblogdnsis-a-doctorroutingthecloudamazoncognitobarsyonlinedsmynasddnsgurucloudflare-ipfsdeus-canvasfrom-idsmushcdnpagespeedmobilizerdyndns-at-homeunusualpersonhosted-by-previderis-a-republicandyn-o-saurstreamlitappworkisboringonthewificprapidqualifioappis-uberleetis-slickgetmyipwpdevcloudtypeformdyndns-at-workgentlentapismynascloudw-corp-staticblitzfrom-ingeekgalaxyservebeerfrom-mdonrenderspace-to-rentaivencloudappspacehostedwafaicloudcodespotblogspotatlassian-3p-us-gov-modfrom-ndfrom-msis-a-techieis-a-studentcustomer-ociis-a-photographerdurumisfrom-ksmassivegriddyndns-wikiis-an-entertaineris-a-hard-workermysecuritycamerafrom-mnrackmazedyndns-blogis-a-bulls-fanwritesthisblogfreemyipsimple-urlfrom-sdreservdauthgear-stagingest-mon-blogueuris-into-gamesrice-labsxtooldevicesakurawebis-an-anarchistoraclecloudappsdyndns-worksells-for-urhcloudfrom-dcfastvps-serverwpmucdnis-a-geekscrysecfrom-txis-into-cartoonsmodelscapetrycloudflarelocaltonetstreak-linkbalena-devicesfrom-njforgeblocksfreebox-oswebadorsitefrom-ncdoesntexisthobby-sitestreaklinkshomesecuritymacownprovidertuleap-partnersdattorelaywphostedmailservequakeis-a-socialistservehalflifepivohostingdynuhostingquipelementsw-staticblitzdyndns-webfrom-deproject-studyaliases121is-not-certifiedhercules-devis-a-financialadvisorservepicsis-a-greenloseyouripfrom-ilwithyoutubemwcloudnonprodwiredbladehostingdnsdojofrom-tnpixolinomyqnapcloudis-an-artisthostedpiis-a-landscaperauiusercontentoaiusercontenton-forgeis-a-conservativedreamhostersnet-freaksapps-1and1is-goneencoreapifastly-edgefrom-nesalesforcefrom-scdeployagentoraclegovcloudappsfrom-alis-a-lawyercechirevultrobjectsstufftoreadisa-geekddnsgeeklovableprojecttry-snowplowfrom-moblogsyteis-a-bookkeepernogmyforumravendbmyboxdeelementoredsaacficogoorinforgcomgobnatneteduidstoreorgcomnetintedudevnomepublorgcomneteduathgovtestscalculatorspaynowinfoquizzesresearchedcloudnsfunnelsassessmentsjscaleforcetmacltdorgmilcompronetgovbizpresseklogesrsccloudcustomfltusrcloude4corealmgovmunicontentproxy9metacentrumdyndyndyndnsdynpagespages-researchitionoccustomercomymyspreadshopipv64diskussionsbereich4limacomrub2ixfirewall-gatewayddnssspdnsbarsykeymachinesquare7myhome-serverspeedpartnercommunity-proschuldockxenonconnectgünstigliefernbwcloud-os-instancedyndnssecmy-routerxn--gnstigliefern-wobin-butterl-o-g-i-nisteingeekin-dslin-berlinin-brbfuettertdasnetzleitungsenin-vpnlcube-serverdyn-ip24logoipdyn-berlinruhr-uni-bochum12hpgoipsrvdnsfruskygit-repossvn-reposinternet-dnsgünstigbestellenhome-webserverxn--gnstigbestellen-zvbbplacedheimdnscosidnswebspaceconfiglima-citydyndns1istmeinvirtualuserschulplattformmy-gatewayddnsseclebtimnetztest-iservmein-iservvirtual-userhome64iservschuletaifun-dnstraeumtgeradeschulserverdynamisches-dns123webseitednshomehs-heilbronndnsupdaterbssgraphicdwadpdwdaepeweaawapaafpfwfabwbpbacwcpcciwebuserapiobjectsidsiskospockkimodorikerbonesteamsparisjanewaypicardglobaltarpitreedpikekiraworfsulukirkarchertuckerhackercanarywesleystagingprereleaset3r2lpbravepanelngrokiservstglclcrmerpflypagesbarsyvivenushoplocalcertlocalplayerbearbloggatewaydeno-stagingis-not-ais-a-goodbotdashvercelmocha-sandboxplatter-appreplitgithubpreviewworkersinbrowserevervaultis-ahrsndenoxmitmodxmyaddrstorageapipayloadgrebedocruncontainersstgstagelclstageloginlineis-a-fullstackcodepenleapcellngrok-freeis-coolstoragewebharemediatechlibp2pdiscourseimaginecomyspreadshopstoreregbiz123hjemmesidefirmcoorgcomnetedugovsldorgmilcomwebgobartnetedugovtmorgpolcomsocartnetedugovassoagrondiscoodontk12medcuegyecpaabgengorgmilgalsaltulcomadmesmgobpubdocmonfindgnriouioproartlatvetnetfotedulojgovntrturibrbarxxxofficialbasechefprofmktgpsictechinfoarqtcontdentrrpppsiqgit-pagesritmedfieorgcomlibprieduaipgovriikmeactvsportorgmilcomscieunnetedugovnameinfopintouchtawktotawkmyspreadshoporgcomnomgobedu123miwebcomputeorgcomnetedugovbiznameinfocognito-idpeusc-de-east-1onjelasticnxaspdnsbarsydirectwpdeuxfleurstransurldogadoprvwcloudnsamazonwebservicesdnshomeuserpartycokoobinmkmfidymyspreadshopalandkapsiikixn--hkkinen-5wacloudplatformhäkkinen123kotisivuidacorgmilcompronetedugovbiznameinforadioorgcomneteduuserexperts-comptablestmmyspreadshopgretaprdcomnomynhccifbxoshuissier-justicenotairesaeroportfreeboxoson-webavocatassoportgouvkdnschirurgiens-dentistes-en-franceavouesfbx-os123sitewebveterinairechirurgiens-dentistespharmacienchambagrimedecinfreebox-osdediboxgoupilemszicpyicpvicppleysheezypagesedugovcnpyorgcomcybllcpvtnetedugovtnxonlineschooldaemond6atcopanelorgnetplybotdashstackitkaasorgmilcomnetedugovbizmodltdorgcomedugovcoorgcomneteduappwriteacorgcomnetedugovcloudtranslateusercontentorgcomnetedumobiassoorgcomnetedugovbarsysimplesitediscourseindorgmilcomgobneteduorgcomwebnetedugovguaminfonxhra教育敎育網絡网絡组織組織网络網络组织組织公司政府個人个人箇人ltdorgcomincneteduidvgovxn--uc0ay4axn--55qx5dxn--mk0axixn--io0a7ixn--uc0atvxn--zf0avxxn--lcvr32dxn--od0algxn--wcvs22dxn--gmqw5axn--od0aq3bxn--mxtq1mxn--ciqpnxn--tn0agxn--gmq050iorgmilcomgobneteduiservwp2tempurlmircloudfreesitewpmudevmyfastgadgetcloudaccessjelehalfboltfastvpsemergenteasypanelopencraftizcombrendlynamefromrtpersoadultmedorgpolrelcomproartnetedufirminfoassoshopcoopgouvtmcomediahotelforumvideosportorgsexagrargameslakaseroticaerotikatozsdereklamcasino2000filmsuliinfoboltshopprivnewsszexcityutazasjogaszkonyveloingatlaneacaicogoormyᬩᬮᬶmilwebschnetkopbizzonedesaponpesxn--9tfkymyspreadshopgovmytabittabitorderravpageaccok12idforgnetgovmuniltdplcaccotttvorgcomnetmeca6g5gpgamubacaicniocoukuptverdruscsdelhiindorgmilcomwebnicfingenpronetintedugovresbizbiharbarsyinternetbusinessschooltravelsupabasealumnigujaratfirminfoaeropostbankcoopindevscloudnsno-ipbarsybarrell-of-knowledgebarrel-of-knowledgensupdategroks-thisdnsupdatefor-ourknowsitalldvrcammittwalddynamic-dnsv-infowebhopselfipdyndnshere-for-moreilovecollegemayfirstforumzcloudnsmittwaldservertypo3servergroks-theeusekd1cdndyndnsidrawsainaueuapjpusstagemocksysdevicesclientcustreservdcustdevdisrecprodtestingcobeebyteutwenteboxfusebravepstmndedynngrokorgmilcomnomnetedugovqcxqzzbarsythingdustmo-siemensrb-hostingfh-muenstergitbookbluebitecloudbeesusercontentnodeartkiloappsforgerockdarklangresinstagingapigeebubbleb-datascryptedhypernodedappnodepantheonsitegitlabgithubkeeneticvirtualservercleverappshostyhostingon-rioedugitticketstelebitwixstudioon-k3sicp0icp12038jeleqotolairbubbleappsmyaddrstolosmyrdbxwebflowdrive-platformbeagleboardhasura-applolipopdefinimavaporcloudmusicianwebflowtestazurecontainerresindevicereadthedocsloginlineeditorxmoonscalesandcatsbasicserverwebthingsbrowsersafetymarkbeebyteappbitbucketidaccovistablogorgschnetgovxn--mgba3a4f16axn--mgba3a4fraarvanedgeايرانایرانjclaspeziapdudcefegelemeperetevebacanatavaparasabgagfgogrgpgalclblimfmrmcbmbvbfclcmcvcrcpcchlimifibicivipirisimncnbnanenrnpntnnolomobocoaogorosopotoptvtatctbtmtltotpusulunutpspapaqsvpvvvtvavvrtrsrprgrfrcrbrarorkrvstsssbscsmsispzczbzbozen-suedtirolmyspreadshopxn--bulsan-sdtirol-nsbxn--valledaoste-ebbtrentinoaltoadigetrentin-sued-tirolxn--forlcesena-c8axn--forl-cesena-fcbxn--bozen-sdtirol-2obtriestetrentinsuedtiroltrentino-s-tirollecceudineaostesienaparmaluccapaviagenoapaduaaostamonzaabruzzoternirietiturinmilanbozenlaziofermoleccocuneonuoropratola-speziavdataaligfvgpugmolcalcamlomumbsicpmnvenvaoedugovabrsarmaremrbastoslazibxosfirenzetrentinosüdtirolval-d-aostavalle-aostamessinacremonaravennatoscanatrentin-suedtirolbolognacalabriaurbinopesarofriuli-v-giuliaogliastraxn--valle-aoste-ebblaquilaandriatranibarlettasyncloudxn--valle-d-aoste-ehbaostavalleyvalled-aostatrentino-alto-adigevallee-d-aostexn--balsan-sdtirol-nsbpistoiasicilialucaniacataniaiserniaperugiabresciaveneziagorizialiguriaimperiabulsan-suedtirolbalsan-suedtirolbarlettatraniandriaxn--trentino-sdtirol-szbforlì-cesenatuscanyvallée-d-aostemantovavallée-aostecasertapiemontevalleaostaval-daostafriulivgiuliatrevisoforli-cesenavalléedaosteferrarapescaravald-aostatrentino-altoadigefriuli-vegiuliavallee-aostecarboniaiglesiastarantomediocampidanovalleedaostetrentinosud-tirolcampobassotrentinsüd-tiroltrentinosüd-tirolmonzabrianzatrentino-südtirolxn--trentino-sd-tirol-c3bpotenzacosenzavicenzaemiliaromagnavenicefrosinonemarchepordenonetrentinosued-tirolvaresemolisevalléeaostefriuli-veneziagiuliabasilicatalatinaanconasavonaveronamodenabiellabolzano-altoadigepugliafoggiaumbriatrentino-stirolgenovapadovamateranovararagusapiacenzatrentinostirolvalleeaostetempio-olbiasudsardegnatrentinsudtirolmassa-carrarafriuliveneziagiuliatrentinosuedtirolandria-barletta-tranitrapanixn--cesenaforl-i8amaceratacaltanissettaascoli-picenobrindisicarraramassacagliaririmininapolivibo-valentiachietibulsan-sudtirolbalsan-sudtiroltrentino-a-adigebulsanbalsaniglesiascarboniamilanotorinoteramodell-ogliastraarezzotrentinoalto-adigerovigotrentovenetoiglesias-carboniatrentino-sud-tirolaltoadigereggio-emiliareggio-calabriasardegnatranibarlettaandriapiedmontxn--sdtirol-n2amedio-campidanotrentino-süd-tirolfriuli-vgiuliafriuli-ve-giuliaromeennaromapisa32-b16-b64-blodiastibarineencomonaplesforlicesenailiadboxosalessandriasicilytrani-barletta-andriaxn--trentin-sdtirol-7vbpesarourbinotrentinsued-tirolcesena-forliforlìcesenaemilia-romagnamonzaebrianzaxn--trentinsdtirol-nsbtrentinos-tiroltrentinsüdtirolvalledaostaolbia-tempiocampidanomediovibovalentiasassarivalle-daostalombardysud-sardegnafriulivegiuliareggioemiliamonzaedellabrianzaalto-adigevercellitrentin-sudtiroltraniandriabarlettatrentino-sudtirolascolipicenobozen-südtirolfriulive-giuliaflorencexn--cesena-forl-mcbcarbonia-iglesiasaosta-valleycarrara-massadellogliastratrentinoa-adigexn--valleaoste-e7apesaro-urbinoxn--trentinosdtirol-7vbxn--trentin-sd-tirol-rzbxn--trentinsd-tirol-6vbtrani-andria-barlettatrentin-süd-tirolxn--trentinosd-tirol-rzbgrossetomonza-e-della-brianzasüdtirolreggiocalabriatrentinoaadigetrentin-südtirolverbano-cusio-ossolafriuliv-giuliaverbaniacampaniatrentino-aadigefriulivenezia-giuliasardiniaandriabarlettatranibarletta-trani-andriacatanzarooristanourbino-pesarocesena-forlìvalle-d-aostacampidano-medio123homepagesiracusatempioolbiasuedtirollombardiaavellinocesenaforlìtrentinofriuli-venezia-giuliabozen-sudtirolandria-trani-barlettabulsan-südtirolbalsan-südtirolmonza-brianzabolzanotrentino-sued-tirolbellunosalernolivornocrotonesondriodnshometrentinsud-tirolmassacarraratrentin-sud-tiroltrentino-suedtirolviterbobergamocesenaforliolbiatempiopalermobeneventoagrigentoofcoorgnetfmaitvphdengorgmilcomschnetedugovperagrikanieasukehandachitatokaiaisaikonanoharuamaobuhigashiuraowariasahiinuyamatobishimaiwakurashitarainazawatoyonegamagorimihamatoyotataharakariyayatomioguchikomakimiyoshinishiotokonamekiyosuchiryutoyohashiokazakiisshikikasugaikotakiratoeianjotogofusosetohazutsushimashinshirotakahamanisshinshikatsuhekinantoyokawaichinomiyatoyoakeodateogataakitaikawakyowahonjoogayurihonjonoshirokamiokakatagamimitanegojomeyokotekosakadaisenkazunonikahohonjyomoriyoshimisatohappoukamikoanihachirogatahigashinarusesembokufujisatokitaakitaitayanagiowanitakkomutsutsurutahirosakigonoheoirasetowadamisawanohejiaomorishingohiranairokunohehashikamitsugarushichinohehachinohenakadomarisannohekuroishisakaeisumiasahiotakiinzaiabikomatsudoyachiyomutsuzawakujukuriomigawakashiwatoganemihamanaritasakuranagaramobarahanamigawachoshishiroichoseikozakishisuikatorimidorichonankyonanfuttsuonjukufunabashinagareyamanodasosatakochuotohnoshourayasukimitsuyokaichibayotsukaidosodegauratateyamakamagayayokoshibahikariyachimatakatsuuratomisatokisarazukamogawaichikawanarashinoichinomiyashimofusaminamibososhirakoichiharaoamishirasatoikatahonaiainansaijoseiyoiyoozuuwajimaniihamanamikatamasakiuchikokihokutobetoonshikokuchuomatsuyamaimabarikamijimakumakogenyawatahamamatsunosabaeikedaobamasakaifukuiohionotsurugamihamawakasaminamiechizeneiheijikatsuyamatakahamaechizensoedaukihaomutaokawanishiogoribuzenonojosueumiokiotochikugosasagurisaigawamizumakishinyoshitomikurumekurateyamadakasuganakamamiyamanogatatakatahakataiizukakawaratagawakasuyaashiyainatsukimunakataminamitsuikishonaikurogifukuchikeisenhigashimiyakoshinguyukuhashiokagakiyamekogaongausuikahotohochuotoyotsumiyawakadazaifuhisayamatachiaraiyanagawanakagawahirokawachikujochikushinochikuhochikuzennamieotamaokumashowateneiiwakikoorinangoononishigoshimogoomotegomishimafukushimaasakawakagamiishishirakawaiitatefutabahiratayugawahanawakitakatakawamatakunimiyabukibandaihigashihironoyamatomiharuyamatsuriaizubangedatesomaaizuwakamatsuyanaizuaizumisatonishiaizuizumizakikitashiobarataishinkaneyamakoriyamainawashirotanagurafurudonosamegawasukagawaishikawatamakawaikedaogakitaruiginanenahashimahichisonakatsugawaibigawashirakawamizunamiminokamomitakekawauesekigaharatomikasakahogikitagatayamagatatajimianpachimotosuyaotsukakamigaharahidakanisekitokigujominogodoyorogifukasamatsutakayamawanouchihigashishirakawakasaharashimonitatsumagoichiyodakannakanrashowameiwakiryuotaoratomiokafujiokaitakuranaganoharahigashiagatsumatakasakishibukawaminakamikatashinatsukiyonokawabanumataannakaoizumimidorishintoisesakiuenoyoshiokakusatsutakayamanakanojonanmokutamamuratatebayashimaebashiotakekaitadaiwahongofuchukuietajimashobaramiharahatsukaichihigashihiroshimamiyoshikumanokurenakasakaseraseranishiasaminamifukuyamashinichionomichiosakikamijimajinsekikogentakeharaotobenanaeikedatohmaozoraobiraabirakyowaeniwataikibibaisharirebunerimohiroooketootarupippunishiokoppechitosefurubirahakodateshiranukakitahiroshimakushiroobihironanporoiwamizawaniikappukunneppufukushimanakasatsunaitoyourakuromatsunaiakabirakamisunagawashibechaurakawakamifuranonakatombetsuasahikawashimokawakayabeokoppebiratoriabashirisaromaatsumanumatahidakabifukamukawamikasahorokanaitoyotomisarufutsuhigashikawaishikarikitamiyoichiesashiiwanaitomariminamifuranoakkeshifuranotoyakoyakumootoineppushikaoishiraoinemuronayorohaboroashorobihororishirifujiutashinaihokutotakasuebetsuurausuassabukikonaishimamakinaiedatetoyabieinikiesanuryuoumuteshikagarikubetsuashibetsukimobetsuaibetsutobetsusobetsuembetsushimizuchippubetsurishirihokuryuhoronobeshintokutsubetsushibetsuhonbetsumombetsutsukigatakuriyamakoshimizushiriuchikutchanmurorannoboribetsukamishihorowassamushinshinotsukembuchiwakkanaikamoenaikiyosatotakinoueshikabesunagawafukagawanakagawatakikawakamikawahigashikagurahamatonbetsumatsumaemoseushirankoshishakotanimakanemashikeotofuketomakomaisandatambaitamiawajikasaiasagoshisoonoakoyashirotoyookaminamiawajiinagawafukusakitakasagokamigorikasugaharimayokawaashiyahimejiakashitaishiaogakisannantakinosumototakarazukanishinomiyashingugoshikinishiwakiyokatakaaioimikisayoyabukawanishiamagasakisasayamashinonsenkakogawaichikawakamikawatatsunotsukubaiwamaogawaasahisakaitokaioaraiitakobandodaigosuifuinaamikasumigaurakashimaomitamayachiyoshimodatetomobetoridehitachinakainashikisakuragawakasamayawaramoriyahitachiomiyanamegatayamagatahitachikamisuushikutakahagiibarakitonekoganakasowayukimihojosomitoryugasakishimotsumafujishirotsuchiurachikuseihitachiotashirosatotamatsukuriuchiharashikahakuinanaotsubatawajimakahokukawakitatsurugikaganominotosuzuuchinadakomatsuanamizunakanotohakusannonoichikanazawaiwateshiwafudaikawaimoriokaofunatohanamakikuzumakikitakamininohekunoheyamadayahabasumitaichinosekitanohatahiraizumirikuzentakatajobojiotsuchihironomiyakoiwaizumikarumaiichinohenodakujitonooshushizukuishifujisawamizusawakamaishikanegasakimannoutazukotohiraayagawazentsujihigashikagawauchinomikanonjisanukimarugamemitoyotakamatsutadotsunaoshimatonoshoakuneamamiizumihiokiyusuikinkoisasookouyamanakatanekagoshimakanoyaisenkawanabeminamitanemakurazakitarumizunishinoomotematsumotosatsumasendaioimatsudaayaseebinamiurazushinakaiodawaraiseharasagamiharahakoneaikawakaiseiatsugitsukuihadanoyamatoyamakitazamaoisochigasakininomiyayokosukakamakuraminamiashigarafujisawasamukawakiyokawahiratsukayugawaraokawaumajikochitsunootoyoakiinonishitosayasudahidakamiharasakawaniyodogawahigashitsunokagamigeiseisusakiotsukinaharisukumomurototosakamiochitoyotosashimizumotoyamanankokunakamurakitagawayusuharaogunichoyoukiasoutoozugyokutoamakusamifunetakamoriyamagaminamataminamiogunikikuchisumotoyamatonagasumashikiaraokumamotokamiamakusanishiharayatsushiroayabeseikasakyoideineujinakagyokameokakyotangokyotanabekyotambaminamiyamashiroyamashinatanabeyawatawazukaminaminantanmiyazuhigashiyamafukuchiyamakitamukokamojoyokizumaizuruujitawaraoyamazakinagaokakyokumiyamakawagoeinabeshimameiwaasahitaikiudonoisetsukisosakikuwanamihamamiyamasuzukatamakimisuginabarikumanokomonominamiisewataraitobakiwatakikihotadomatsusakayokkaichikameyamaureshinoishinomakishichikashukuohirataiwaosakizaohigashimatsushimashikamaiwanumashibataogawaraonagawakawasakiseminemarumoriminamisanrikukakudamuratawakuyatomiyanatoriwataritagajomisatotomekamirifushiroishimatsushimayamamotoshiogamafurukawahyugaebinotsunosaitoayakushimanobeokakitauramiyazakitakazakigokaseshiibamimatashintomikunitomikitakatakobayashikawaminamitakaharukijotakanabemiyakonojonishimeranichinankitagawakadogawamorotsukakisofukushimaminamimakisakaeobuseikedaogawamiasaokayaasahiotakiotarichinoinaomichikumakomaganechikuhokukaruizawayasuokaooshikaikusakaminamiaikitogakushimatsukawakawakamitateshinatakamorikitaaikishiojirimiyadahakubaiizunaiijimaiiyamamiyotasuzakayasakatoguraookuwanagawaminowahirayayamagataminamiminowafujimiomachisakakitakaginaganonakanosakuhokomoronagisoshinanomachiwadauedaiidaharasuwatomiachiaokianankisosakunozawaonsenagematsutakayamashimosuwamatsumotoyamanouchinakagawamochizukiazuminotatsunoobamaomuraseihiunzenosetofutsuikichijiwanagasakiisahayahasamisaikaikawatanasasebohiradokuchinotsugototogitsutsushimashimabarashinkamigotomatsuurayamazoekashibaikomakawaitenrioyodosangokoryoudaojiikarugayamatokoriyamatenkawakatsuragikurotakikawakamimiyakemitsuetakatorikamikitayamayamatotakadahegurishinjokanmakisakuraitawaramotogoseoudanarasoniandokawanishishimoichihigashiyoshinokashiharashimokitayamanosegawayoshinomintsivorytopazsakuragehirnsumomoaseinetopalmail-boxmokurenyoitamuikaojiyagosensanjoaganomyokoseiroagaomishibataniigatanagaokamurakamiuonumayuzawakariwatagamitainaitsunanminamiuonumatochioyahikojoetsuseiroukamosadoizumozakitokamachiitoigawasekikawakashiwazakitsubamemitsukekokonoesaikiusukibeppuusahimeshimakunisakihasamataketatsukumihitaoitahijikusuyufukujukamitsuebungoonobungotakadaibaraniimibizentsuyamaokayamakasaokahayashimayakagemaniwaakaiwamisakishinjotamanotakahashikibichuowakesojanagishookumenannishiawakurakurashikiasakuchisetouchikagaminosatoshotomigusukunakagusukuyaeseizenaurumaiheyaaguniogiminanjokinminamidaitokitanakagusukuyonaguniokinawaishigakikunigamiurasoekadenataramahiraraginozataketomishimojizamamitonakiitomanhigashimotobuyonabarugushikamionnanahanagohaebarukumejimakitadaitonakijinnishiharayomitanginowantokashikiishikawaikedasuitaminohizuminishisakaikananabenodaitoosakasayamayaokishiwadatadaokakaizukatondabayashichihayaakasakakumatorikadomasayamahigashiosakashijonawatehirakatataishimisakitajirihannansennankatanotoyonominatosettsuhigashiyodogawaibarakinosekitachuohigashisumiyoshifujiiderakashiwaraizumiotsutoyonakamatsubaramoriguchiizumisanoshimamototakatsukineyagawahabikinotakaishikawachinaganoyoshinogarikamiminearitaouchiimarihizenogikashimaariakekiyamafukudomikitagatakitahataomachigenkaikanzakinishiaritakyuragisagataratosutakushiroishikaratsuhamatamakouhokukawagoeyoshidasatteogoseirumaasakaurawaogawaniizaomiyayoriiotakishikihonjooganohannohanyuinasaitamaokegawaarakawayoshikawayokozehasudasayamahidakafukayachichibuiwatsukiryokamiyoshimikamiizumifujimiwarabiranzanmiyoshiminanoyashiosakadosugitomisatohigashichichibutodasokakukiyonokazoshiraokakasukabekounosukawajimatsurugashimamiyashirokitamotohatoyamamoroyamahatogayakumagayakawaguchinagatorokamisatomatsubushinamegawatokigawakamikawafujiminohigashimatsuyamakoshigayatokorozawas3isk01isk02ryuohkoseikonanaishorittotakashimamaibarahikonetorahimenishiazaikokagamokotoyasuotsukusatsunagahamamoriyamatoyosatotakatsukinotogawaomihachimanhigashiomiakagiunnanizumogotsuamayatsukakakinokimatsuehamadamasudahikawahikimiokuizumoyasugiyakumomisatotamayuohdahigashiizumookinoshimanishinoshimatsuwanoshimaneshimadafujiedayoshidashimodagotembaiwataatamikosaiyaizuitoizumishimahaibaramakinoharaomaezakikawanehonkannamisusonohigashiizufukuroinumazukawazufujiaraishizuokahamamatsushimizuizunokunimatsuzakimorimachiminamiizunishiizukikugawakakegawafujikawafujinomiyaujiietsugaoyamayaitaohiranikkoashikagakuroisokanumasakurashioyakarasuyamamotegiichikaikaminokawatochigihagamokanogisanobatonasumibunasushiobaranishikatautsunomiyaiwafunemashikoshimotsukeohtawaratakanezawaitanokomatsushimatokushimaichibaminamiaizumiwajikikainanmiyoshinarutomimamugiananmatsushigesanagochishishikuinakagawamachidachiyodakomaefussainagitaitochofufuchuomeotahigashiyamatotoshimaokutamaaogashimakodairaedogawaarakawahachiojishinagawatachikawashibuyasuginamihinodekiyosesumidaoshimanerimamitakahamuraadachinakanomizuhobunkyomegurominatokoganeihigashikurumekokubunjihigashimurayamamusashimurayamatamakitahinochuokotokatsushikakouzushimaogasawaraakishimakunitachishinjukusetagayamusashinohachijoitabashiakirunohinoharachizunanbukotouramisasawakasayonagokogehinoyazutottorinichinansakaiminatokawaharaoyabetairainamiasahinantoimizufuchutakaokakurobeyamadajohanatoyamatonaminyuzenfunahashinakaniikawanamerikawaunazukitogahimiuozufukumitsutateyamakamiichiiwadearidayuasainamitaijikatsuragiaridagawatanabemihamahidakakainankiminomisatoshingushirahamakamitondayurakozakoyagobokitayamawakayamakudoyamahashimotokushimotokozagawahirogawakinokawanachikatsuurarsuseroeoishidasagaeoguniasahinagaitendonanyoobanazawanishikawasakataohkuratozawamikawamamurogawayamagatafunagatatakahatashonaishinjokahokuiideyuzakawanishitsuruokakaminoyamayamanobeshiratakamurayamanakayamakaneyamahigashineyonezawasakegawamitouubeyuuabushimonosekitabuseoshimatoyotaiwakunihikarishunannagatohagihofukudamatsutokuyamashowadoshitsurunanbukoshukaiminami-alpsnirasakikosugeotsukioshinohokutominobuyamanashifuefukichuokofuichikawamisatoyamanakakonakamichitabayamanishikatsuranarusawafujikawahayakawafujiyoshidafujikawaguchikouenohara長野京都岐阜大阪三重群馬千葉滋賀佐賀奈良adednelgaccogogror秋田愛知高知埼玉沖縄栃木熊本岩手青森山梨新潟島根鳥取長崎香川宮城石川大分宮崎茨城山口兵庫山形徳島広島福島福岡岡山富山静岡愛媛福井東京xn--4it168dhatenadiaryxn--vgu402ckawaiishophatenablogcocottenamaste北海道penneehimeiwateversestabachibashigagonnagunmapermahaccaakitaosakauh-ohblushkochiaichifukuikuroncapooitigohyogotokyokyotopunyuthickcheap0t00g00j0mie2-ddaapyawjg0amfemsubxiiboomoobutchueekpgwrgrherskrboyrdyupperunderflierchipsmydnsheavyangryhippygirlyrulez神奈川鹿児島和歌山bambinaxn--nit225kokayamasaitamaxn--k7yn95exn--1lqs03nsapporoparasitelolipopmcxn--efvn9sniigatafukuokatokushimafukushimahiroshimakagoshimafakefurokinawaxn--8pvr4ucoolblogxn--0trq7p7nnkawasakinagasakimiyazakichilloutxn--8ltr62kxn--klty5xpeeweezombiecutegirlxn--rny31hxn--uuwu58axn--ntso0iqx3axn--djrs72d6uytoyamanikitanyantakagawamimozanagoyaboyfriendxn--2m4a15egreaterchowderegoismyamagatafashionstorexn--elqq16hxn--pssu33lsendaimiyagixn--rht27zpecoriaomorisaloonwatsonvivianxn--djty4knobushipigboatnaganopinokoxn--f6qx53asadistvelvetsecretxn--5js045dchicappayamanashiibarakidigickgirlfriendxn--1lqs71dmongolianxn--c3s14mxn--qqqt11mtochigixn--5rtq34kparallelo0o0mondkobesagabonadecaoitanarafoolkilldecimainhiholomosblokilociaoundopupugifutankcrapflopnooroopsmodsholyjeezstripperpepperbittershizuokaxn--rht3dkitakyushureadymadeicurusversusmatrixxn--rht61ehungryfloppygloomycrankyhandcraftedlittlestarxn--klt787dxn--kltx9awhitesnowsunnydaytottorilovepoptheshopbuyshopxn--5rtp49cxn--d5qv7z876cwebaccelxn--kbrq7oxn--4pvxsxn--1ctwolovesickkumamotocatfoodxn--tor131oyokohamawakayamatonkotsuxn--ehqz56nxn--uist22hxn--6btw5axn--kltp7dyamaguchifrenchkisspussycatxn--4it797kxn--uisz3gbabybluexn--zbx025dnetgamersxn--7t0a264ckanagawaxn--6orx2rishikawaxn--ntsq17ghalfmoonschoolbusjellybeanxn--mkru45iusercontentlolitapunkxn--32vp30hsakurastoragehokkaidoshimanecandypopbabymilksupersaleweblikeraindropbackdropwebsozaikikirarahateblodaynightmeneacsccogoormobiinfoaeusxxorgmilcomnetedugovorgcomnetedugovbizinfotmprdorgmilcomnomedugovassnotairespresseassocoopgouvveterinairemedecinpharmaciensorgnetedugovtraorgcomedurepgovmeneperekgacscaiiocogoitoresmshsseoulbusanulsandaeguc01milvkimmvchungnamjeonnamjeonbukeliv-dnsgyeonggijejueliv-cdnincheondaejeongangwongyeongbukgwangjuchungbukgyeongnameliv-apicoeduindorgcomembnetedugovorgmilcomnetedugovjcloudorgcomnetintedugovperbnrinfocooyorgcomnetedugovethipfscanvamypepethw3sstorachakeeneticjoinmcinbrowserdwebcyonnftstoragemyfritzaemewphlxachotelltdorgcomwebsocschngonetintedugrpgovassnomgacsccoorgnetedugovbizinfo123websiteidorgmilcomasnnetedugovconfidmedorgcomplcschnetedugovaccoorgnetgovpresstmassoirseproxaccosoundcasthoptocraftvp4c66orgnetedugovitsmcdirmyboxbarsyedgestacksynologylogintoopencloudnohostwebhopdiskstationi234tcp4hoocgroknoipprivmydsddnsdnsforlohmustransipdscloudfilegear-sgbrasiliafilegearframerbarsybarsyonlinecoprdorgmilcomnomedugovinforgcomnetedugovnameacprorgcomartnetedugovpresseinfoassoinstgouvorgnycedugovbarsydscloudjuorgcomnetedugovminisiteaccoororgcomnetgovorgmilcompronetintedugovbizmuseumnameinfoaerocoopaccoorgcomnetintedugovbizcooporgcomgobneteduorgmilcomnetedugovbiznameaccoorgmilneteduadvgovcoorgcomnetaltgovforgotherhiskeeneticispmanagernomassoprod5476132eastasiacentraluswesteuropewestus2eastus2pnortheurope-01newzealandnorth-01southindia-01southcentralus2-01norwaywest-01eastus2-01westus2-01australiaeast-01italynorth-01israelnorthwest-01swedencentral-01westeurope-01centraluseuap-01taiwannorthwest-01uaecentral-01northcentralusstage-01israelcentral-01mexicocentral-01canadacentral-01austriaeast-01germanywestcentral-01francecentral-01ukwest-01denmarkeast-01polandcentral-01eastus-01westus-01swedensouth-01eastus3-01westus3-01brazilsouth-01centralus-01francesouth-01australiacentral-01westindia-01uaenorth-01jioindiacentral-01canadaeast-01belgiumcentral-01spaincentral-01koreacentral-01chilecentral-01qatarcentral-01westcentralus-01eastus2euap-01norwayeast-01southafricanorth-01brazilsoutheast-01germanynorth-01switzerlandnorth-01switzerlandwest-01japanwest-01southafricawest-01japaneast-01eastasia-01indiasouthcentral-01taiwannorth-01centralindia-01uksouth-01southcentralus-01northcentralus-01eastasiastage-01indonesiacentral-01australiacentral2-01australiasoutheast-01malaysiawest-01koreasouth-01southeastasia-01southeastus5-01northeastus5-01jioindiawest-01rucdnwest1-usfra1-desandboxjls-sto1jls-sto3jls-sto2aglobalabglobalsslmapprodfreetlsmapvpslon-1lon-2ny-1fr-1sg-1ny-2paassnwebpaashostingjelasticnordeste-idcsocuserpagescwebfileblobservicebuscoreatlricnjsjelasticwebsitestoragesezagbinruhuukjptsmyspreadshopmynetnameakamaiorigin-stagingfrom-coipv64dynv6cdn77serveblogadobeaemcloudhicamsprytdnsupno-ipownipde5ovhicpfirewall-gatewaysytesmypsxbarsyusgovcloudapimyamazemyradwebakamaihdsaveincloudfastlylbfrom-lasubsc-paysquare7in-the-bandblackbaudcdnhomelinuxoninfernoctfcloudservebbsdns-dynamiccloudfrontakamai-stagingipifonyham-radio-opsenseeringclickrisingcommunity-profrom-nylocalcertgrafana-devedgesuite-stagingcloudflareanycasteating-organicatlassian-devmydattofeste-iplocaltotorprojectknx-serveredgekeycloudflareglobalcloudyclustercasacamserveftpakamaized-stagingakamaiorigindns-cloudmyeffectboomlabotdashbuyshousestwmailhetemlazure-mobilein-dslthruhereredirectmedynuddnsbouncemesupabaseluyanicloudappakamaicloudfunctionsdebiannhlfanpgafanstatic-accessin-vpnmysynologymafeloappudohomeftptrafficmanagersiteleafseidatmemsetcloudflarecloudaccesskeyword-onazure-apiis-a-chefdoes-itgets-itwebhopselfiphomeipkicks-assedgesuitewindowsserver-ontunnelmolemydissentscrapper-sitecloudflarecnuni5srcfggffiobbzabchrsndenodynuopikddnsvpndnsakadnselastxkinghostvps-hostfastlyhomeunixazureedgeshopselectdontexistmyfritzcloudjiffyalwaysdatasells-itsquaresbroke-itazurefddattolocalat-band-campmeinforumfamilydsazurestaticappsdefinimabplaceddnsaliasdynaliasnow-dnsblogdnsroutingthecloudendofinternetdsmynasakamaiedgemymediapcadobeio-staticakamaiedge-stagingakamaihd-stagingddns-ipprivatizehealthinsurancelive-onkrellianschokokeksmassivegridmysecuritycamerarackmazeserveminecraftfrom-azis-a-geekakamaizedmoonscaleoffice-on-theusgovtrafficmanageradobeioruntimeedgekey-stagingreserve-onlinechannelsdvrdnsdojousgovcloudappcdn77-sslapps-1and1podzoneazurewebsitesdynathomescaleforceyandexcloudvusercontentisa-geekcdn-edgescoaemalcesappwriteazimuthtlonarvobuiltwithrocketnoticeablestorecomwebrecnetperotherfirminfoartslgdloncogoiltdorgmilcolcomplcschgenngonetedugovbiznamefirmmobiacincoorgmilcomnomwebgobnetintedubizinfocomyspreadshopdemongovtransurl123websitehosting-clusterkhplaycistrongsnesosvalervålerxn--vler-qoaossandeheroysandeherøybøboheroyherøyxn--hery-iraxn--b-5gavalerbøboxn--b-5gasandesandexn--hery-iraxn--vler-qoavålerhåreålaahavaofsfvfhlolnlalrlhmfmtmahcostntbuåstrmreigersundmyspreadshopgálsáeidsvolltingvollgildeskalflorøvadsøvardøvanylvenxn--bhccavuotna-k7astrandaxn--kvnangen-k0axn--sknland-fxaxn--mosjen-eyarakkestadhyllestadnannestadvevelstadvaapstenordre-landsondre-landsøndre-landtjieltexn--vrggt-xqadsør-aurdalsor-aurdalheradstordmoldefordeførdeseljefedjeryggehemnexn--krehamn-dxasognegranesøgnebrynetjomevallebykletokkegiskedovretjømehobølvoldasaudatolgasømnaviknadønnasomnadonnatranafrananesnaraumasmolatrænafrænalesjasmølaørstaorstahitrafloraaukraloppafrøyarissasnasahalsagalsaromsaraisaráisafroyasnåsagronghobolfjelltydalårdalardalaskimharamkraanghkekråanghkesorumbarumhurumbærumsørummodumsálátbálátfrognbjugnvåganvagangulenskienløtenlotenstrynvefsnxn--merker-kuaskaunsveiobømlobomloskjåkvardoflorovadsosalatbalatsálatklæbuklabuselbubarduulvikskjakklepprisørxn--nttery-byaeflåeidflahofmilgolholsellomskifetvikdepvgsfhsaskerrisorhamarasnesåsnesrørosrorosxn--slat-5namasoynaroyvaroyluroydyroyaskoyradoyandoyrodoymeloyradøyandøyrødøymeløyaskøylurøydyrøymåsøyværøynærøyhoylandethøylandetdivtasvuodnalørenskoglorenskognesoddtangenxn--tjme-hraxn--smla-hraxn--stjrdal-s1aunjargalillehammerunjárgaxn--hamary-fyadavvenjargaxn--bearalvhki-y4a123hjemmesidegjerdrumxn--brnnysund-m8acxn--tnsberg-q1axn--mlatvuopmi-s4axn--snsa-roaxn--skierv-utaxn--brum-voatysfjordkvafjordeidfjordkvæfjordsongdalenmjondalenmjøndalenxn--gls-elackragerogáŋgaviikagangaviikasørreisasorreisasør-varangersor-varangerxn--risr-iraskiervaxn--frna-woaxn--trna-woakvinesdalleksvikleirvikrøyrvikroyrviksvelvikvenneslaevje-og-hornnessandnessjøenmarnardalvindafjordsandefjordenebakksnillfjordullensvangxn--trany-yuabrønnøysundnamsskoganaustevollxn--stjrdalshalsen-sqbnord-aurdalnord-frontrøgstadtrogstadgrimstadflakstadgjerstadxn--sandy-yuaxn--leagaviika-52bnore-og-uvdalvegarsheixn--rlingen-mxaxn--ggaviika-8ya47hvegårsheikarlsoykvitsoymasfjordenhamaroyinderoyosteroydavvenjárgasauheradguovdageaidnuxn--vre-eiker-k8abronnoysiellakkrødsheradkrodsheradkvinnheradbrønnøyxn--mtta-vrjjat-k7afxn--lrenskog-54akvitsøyvárggátkarlsøyosterøyinderøyhamarøybronnoysundxn--aurskog-hland-jnbbahccavuotnabáhccavuotnagiehtavuoatnastor-elvdalmidtre-gauldalxn--gildeskl-g0akarasjokevenassixn--bievt-0qaxn--yer-znalebesbynessebyxn--hbmer-xqamalselvmålselvxn--unjrga-rtamøre-og-romsdalmore-og-romsdalhareidmelandørlandorlandstrandålgårdsolundalgardafjordåfjorddielddanuorrikautokeinoxn--stre-toten-zcbskodjeaejriestangeliernebamblestokkefauskesnåasesnaasekongsvingerlangevagberlevagxn--flor-jrahattfjelldalostre-totenøstre-totenvestfoldxn--mely-iraálaheadjualaheadjunordreisaxn--troms-zuaxn--lgrd-poacporsangerflatangerstavangerleikangerbremangersamnangergieldakarasjohkaxn--rdy-0nabfrostautsirasnoasatromsaxn--sr-aurdal-l8aflekkefjordjølsterjolsteraremarkhedmarknååmesjevuemienaamesjevuemiexn--vard-jrarollagmeråkermerakerorskogørskogxn--bdddj-mrabdákŋoluoktaxn--osyro-wuaaknoluoktatrysilskjervøymandaljondalbindalrindalmeldalsuldalorkdalsigdalalvdallærdalhurdalsirdalverdallerdallardaloppdalåseralaseralhadselkragerødivttasvuotnaoverhallasteinkjerxn--hnefoss-q1askedsmokorsettromsøxn--dyry-iravestre-totenmuseumxn--sandnessjen-ogbrahkkeravjufylkesbiblbájddarbajddarxn--laheadju-7yarennesøyxn--koluokta-7ya57hxn--hgebostad-g3aleirfjordstorfjordbalsfjordbåtsfjordbatsfjordmuosátbievátloabátkárášjohkanøtterøyxn--mjndalen-64anordkappláhppilahppialstahaugsiljanverranrøykenroykenhaldenlyngenbergenhortenhønefosshonefosstroandinbeiarnvarggatosoyroosøyrotromsoidrettmuosatbievatruovatloabatvoagattynsetnessetxn--indery-fyaskánitskanitraholtråholtxn--ystre-slidre-ujbandebusarpsborgbearduxn--karlsy-fyahordalandjorpelandjørpelanddeatnuringsakersør-odalsor-odalxn--slt-elabringerikeaudnedalnittedalnissedalhemsedalslattumsurnadalxn--blt-elabelverumstjørdalnaustdalhjartdalgjøvikfyresdalhasviknarviklarvikgjovikmalvikgamviklenvikporsgrunnstjordalengerdaldrobakdrøbakxn--msy-ula0hvestvagoyxn--vgan-qoaxn--ryken-vuaxn--lten-graxn--stfold-9xaxn--hpmir-xqaxn--lury-iramálatvuopmimalatvuopmitysværkirkenesbirkenesmoskenesbáidárxn--fjord-lraxn--rdal-poabahcavuotnabáhcavuotnaxn--frde-gralindåsbearalvahkixn--hobl-iraráhkkerávjuxn--loabt-0qavågåáltábodøsundlundraderådeetnetimeholeauregrueoddavagavegaranatanaarnasolasulaaltalekafusavangbergkvamåmliamlibokntinnroangranosenoslobodorøstroststatåmotamotivguprivøyeroyerliermossvossxn--nvuotna-hwalusterlunnermarkerhábmerhabmerhvalerfjalerxn--rholt-mratysvarbaidarfitjargaularhápmirhapmirmelhusfosnesøksnesoksnestysneshemnesevenesflesbergeidsbergtonsbergtønsberglindasxn--sndre-land-0cbnamsosxn--srum-graøystre-slidreoystre-slidrevestre-slidretrondheimbalestrandxn--langevg-jxaaustrheimxn--skjk-soavagsoyaveroysandoykarmoyfinnoytranoyvestbytranbysykkylvenxn--hyanger-q1aspjelkavikandasuoloxn--fl-ziaxn--drbak-wuastathellexn--sr-varanger-ggbtelemarkxn--bhcavuotna-s4axn--porsgu-sta26fčáhcesuolocahcesuoloakrehamnåkrehamnsandøykarmøyfinnøytranøyvågsøyaverøynamdalseidxn--lesund-huabadaddjaxn--vegrshei-c0axn--btsfjord-9zagildeskålporsanguxn--trgstad-r1anávuotnanavuotnahammerfestxn--sgne-graxn--brnny-wuacibestadharstadnarviikaevenáššivestnesgjemnessandnesagdenesrennesoyxn--avery-yuaxn--tysvr-vrabearalváhkikongsbergspydebergrandabergxn--andy-iradavvesiidaxn--krdsherad-m8aporsáŋgufredrikstadbjerkreimringeburennebuaurskog-holandnotteroyxn--vgsy-qoa0jxn--rmskog-byaskierváivelandbyglandfrolandaurlandforsandxn--bjddar-ptamidsundålesundalesundfetsundfarsundovre-eikerøvre-eikerakershusxn--moreke-juasørfoldøstfoldostfoldsorfoldhøyangerhoyangerlevangerorkangertanangerxn--vestvgy-ixa6olillesandulsteinxn--rennesy-v1agranvinskjervoyxn--klbu-woalavagisxn--h-2faxn--ryrvik-byakafjordkåfjordseljordfolkebiblxn--gjvik-wuajevnakerxn--kfjord-iuabudejjuxn--kranghke-b0axn--davvenjrga-y4axn--rland-uuaxn--ldingen-q1axn--mlselv-iuaxn--rady-iraxn--linds-prabrumunddalxn--ygarden-p1amo-i-ranaeidskogrømskogromskoghjelmelandxn--finny-yuaxn--sr-odal-q1axn--skjervy-v1aballangenkvanangenkvænangengratangenxn--hmmrfeasta-s4acvossevangensuohkanxn--rde-ulaxn--mli-tlaxn--ksnes-uuanordlandskanlandskånlandsortlandfuoiskuxn--rros-graxn--hcesuolo-7ya35bxn--eveni-0qa01gagaivuotnagáivuotnaxn--seral-lradrammenmodalenmosjoenjan-mayentorskensteigengloppenxn--snes-poamatta-varjjatxn--sr-fron-q1aomasvuotnajessheimbådåddjåxn--krager-gyaxn--kvfjord-nxaxn--asky-iraxn--snase-nraxn--bidr-5nacholtålenxn--vads-jraxn--jlster-byamosjøenxn--rst-0nastavernxn--ostery-fyaxn--oppegrd-ixaxn--sknit-yqaxn--risa-5naoppegårdskiptvetrendalenholtalenxn--mot-tlaxn--lhppi-xqaxn--holtlen-hxaxn--srreisa-q1akopervikxn--muost-0qaxn--bmlo-grahokksundkvalsundegersundxn--karmy-yuaullensakerxn--hylandet-54axn--kvitsy-fyaxn--bod-2nalangevågberlevågkristiansandxn--rsta-frahornindalstjørdalshalsenstjordalshalsensandnessjoenhámmárfeastaxn--lrdal-srasør-fronsor-fronnord-odalkristiansundmátta-várjjatvestvågøynesoddennotoddenbuskerudøygardenoygardensalangenlavangenralingenrælingenlodingenlødingenleaŋgaviikalaakesvuemieleangaviikauenorgexn--srfold-byaaskvollxn--rskog-uuaxn--nry-yla5gxn--vry-yla5ghammarfeastaxn--rhkkervju-01afxn--givuotna-8yakommunekrokstadelvanedre-eikerhagebostadhægebostadxn--berlevg-jxakviteseidxn--s-1faxn--l-1faxn--nmesjevuemie-tcbafuosskomoårekemoarekexn--lt-liacxn--jrpeland-54asvalbardoppegardholmestrandtvedestrandsogndalsokndalarendalsunndalfolldalxn--krjohka-hwab49jlyngdaletnedalnorddalsaltdalgausdalskedsmovaksdalgjesdalstordalxn--frya-hraaarbortedrangedalxn--smna-graaurskog-hølandxn--vg-yiabtjeldsundhaugesundlindesnesxn--mre-og-romsdal-qqbxn--dnna-gradyntmpheremerseineshacknetenterprisecloudmineaccomaorimāoriorgmilcriiwigennetschoolhealthkiwigovtgeekxn--mori-qsacloudnsparliamentcomedorgcompronetedugovmuseumwebsitekinservicebarsywebsitebuildereerobookheimdnsleapcelleero-stagetechcrscsslorigingohomecdbedeeeiemesecabgngilnlalplchfisiincnnoroptatitmtltruauhulumkdkukskjplvtrgrfrkrhrusesismycynzcznetinteduassoososcloudstgbetaaezaeuhkusjshatenadiarycdn77hoptozaptois-a-knightmyftpno-ipjpnddnssdpdnsspdnsbarsysweetpepperis-a-bruinsfanis-very-sweetservegameis-a-soxfanhomelinuxcdn77-secureservebbsmisconfusedwebredirectblogsitefreedesktopcouchpotatofriestoolforgeaccesscamis-lostreadmyblogsmall-webfedorapeopleserveftpis-a-celticsfanmywirepotagertwmailin-dslsellsyourhomeread-booksfreeddnscable-modemis-savednflfanufcfanmlbfanstuff-4-saleendoftheinternetin-vpnmy-firewallhomeftpis-localis-a-chefboldlygoingnowherewebhopselfipkicks-assroxatunkcamdvrfedoraprojectgotdnsdvrdnsdyndnspubtlspimientahomeunixdontexistfedorainfracloudwmflabsfspagesbmoattachmentsteckidsfamilydsdnsaliasdynaliasnow-dnscloudnsdoomdnsduckdnsblogdnshomednsroutingthecloudendofinternetdsmynasip-dynamicpoivronhttpbinmyfirewallis-very-evilmysecuritycamerais-a-linux-userwmcloudis-a-geektuxfamilyis-a-candidatedoesntexistis-very-badhobby-sitegame-hostaltervistais-foundis-a-patsfandnsdojohepforgepodzonedynservcollegefanis-very-goodfrom-meis-very-niceisa-geeknerdpolacmedsldingorgcomnomgobabonetedupleskaemhlxmyboxrockyprvcydeuxfleurspdnscodebergheyflowstatichostorgmilcomnomgobneteduorgcomeduiorgmilcomngonetedugovcloudns1337ngrokacorggogfamcomwebgobnetedugokgopgkpgovgosbizpasaugumicsopozpapuwmwsrprusiskwpspkppspkmpspokeoiawsawifoumsdnskokwpmuppuppsppiwwiwoowuzswkzoschrzpisdnwzmiuwwitdpssewsseumigugimoirmpinbwinbwiihupporzgwgriwupowwskrwioswuozstarostwokonsulattmpccopruszkowmyspreadshopostrodakartuzyopolegminamediaustkazgorajgoraolawailawalomzawloclradombytomjaworznotargilubinkoninzagantorunkutnokepnonakloczestsopotsanokturekplockslasksklepzarowlukowmedaidgdaorgmilrelcomnomatmgsmartneteduelkgovwawsossexbiztgorysejnytychypomorzeboleslawiechomesklepsdscloudunicloudzakopanelegnicarawa-mazbydgoszczswidnikkrasnikwloclawekbielawamragowograjeworealestatebeskidykaszubymalopolskaprzeworskswiebodzinlecznadfirmaszkolawarmiagdyniamiastakazimierz-dolnymalborkswidnicadlugolekaostrolekapodlasieelblagtravelsimplesitezachpomormielecszczecinnieruchomosciwalbrzychlezajsklublinbedzinpoznanwielunmielnooleckostarachowicedkontopowiatwroclawrybniksuwalkileborkslupskgdanskostrowwlkptarnobrzegtourismwegrowkrakowglogowyou2pilanysamailwrocinfoagroautobeepshoppriviqhslapypiszlodzcfolksecommerce-shopmazurypulawyskoczowrzeszowpomorskiezgierzkaliszolkuszlowiczostrowiecsosnowiecmazowszewodzislawbialowiezazgorzeleckatowicepabianicejelenia-gorawolominkarpaczsieradznowarudaczeladzkonskowolaskierniewiceswinoujscieturystykabieszczadycieszynketrzynolsztynbialystokbabia-goraprochowicewarszawastalowa-wolapolkowicegorlicegliwiceponiatowalimanowalubartowaugustowkobierzyceopocznognieznoszczytnokolobrzegshoparenapodhalebielskoklodzkostargardatwithplayitownnamecoorgnetedugovacorgcomproestnetedugovbiznameislaprofinforechtngrokmedaaaacacpaenglawjurbarbarsykeeneticavocatacctcloudnsorgcomsecplonetedugov123paginaweborgcomnetintedugovnomepublidkinbarsygovx443cloudnsorgmilcomnetedugovcooporgmilcomschnetedugovnamecomcannetlibassoaemclantmcontstoreorgcomnomrecwwwbarsyfirminfoshopartsstackitmyddnswebspacelima-cityacincooxorgedugovbarsybrendlyhbvpsvpsspectrumlandinghostingacppmordoviamcprecbgorgmilcomspbnetintedumsknovgovbirrasmcdirmytismircloudvladimirnalchikadygeyamarinepyatigorskmyjinobashkiriaeurodirvladikavkazna4ugroznykustanaikalmykiacldmaildagestaniranbuildcloudcanvaliaravalwixdevelopmentappwritemigrationneedleverceldatabasestackitcodereplravendbonporterlovableaccoorgmilnetgovcoopmedorgcompubschnetedugovservicemecomygovorggovtvmedorgcomnetedugovinfoedgfacbmlonihkutwpsryxzbdtmacfhppmyspreadshopbrandpartiorgcomfhvpress123minsidaitcouldbeworlanbibkommunalforbundfhskiopsyskomvuxkomforbnaturbruksgymnloginlineorgcomnetedugovenscaledeuusentsurgebotdaorgmilcomnetgovnowteleporthashbangplatformlovablebarsyshopwarebasehoplixbarsyonlinemsf5gitappgitpagewawamscofigma-govcaffeinefigmacanvasoltstscwputerbarsysupportchatgptsquareomniweopensocialcpanelplaycodenotionnovecorewpsquaredpreviewjelecyonbyensrhtfastvpspieboxconvexjouwwebheyflowplatformshloginlinemadethissourcecraftclouderaorgorgcomartedugouvunivmeorgcomnetedugovsurveysstatichfheiyuxs4allprojectmyfastubervibehostapp-ionosdeployagentmecoorgcomschnetedugovbizcncostoreorgmilcomneteduembaixadaconsuladokiraranohoprincipesaotomeheliohobarsystorebaseshopwaresellfyaiabkhaziavologdamordoviapenzalenugsochinavoiexnetspbmsknovnorth-kazakhstanashgabadkareliaarmeniageorgiavladimirnalchikivanovobukharaadygeyakhakassiakalugakrasnodarjambylaktyubinsktroitskbryanskobninskkurganazerbaijanpokrovskbashkiriatselinogradvladikavkazmurmansktulatuvamangyshlaktashkentchimkentgroznykaragandatermezarkhangelskkustanaikalmykiabalashoveast-kazakhstankaracoldagestantogliattibarsyredorgcomgobedumirenknightpointaccoorgjelasticdiscoursecleverappsschacmiincogoornetonlineshopcogoorgmilcomwebnicnetintedugovbiznametestcoorgmilcomnomnetedugovorangecloudpersoindorgcomfinnatnetgovensmincomtourismintlinfox0611oyaorgmilcomnetedugovquickconnectvpnplusnettprequalifymeaddrmyaddrntdllwadlnctvavdrk12orgmilpolbeltelcomwebgennetedutskkepgovbbsbiznameinfocoorgmilcompronetedugovbiznameinfobetter-thanworse-thansakurafromdyndnson-the-webmymailerorgmilurlcomneteduidvgovmydnsgameclubebizmeneacsccogotvorhotelmilmobiinfovodteiflgplkmsmsbcckhincndnvncoztltmkckppzpdprvcvkvlvcrkrkscxuzchernovtsyrivneyaltaodesavolynrovnolutskltdinforgcomnetedugovbizvinnicazhitomirternopilpoltavakropyvnytskyizaporizhzhiasevastopolsebastopoluzhgoroduzhhorodkharkovkharkivvinnytsiakhmelnytskyizaporizhzhecrimeaodessazhytomyrnikolaevcherkassydonetskluganskluhanskkirovogradivano-frankivskchernivtsikrymkievkyivlvivsumyzakarpattiamykolaivcherkasychernigovkhersonchernihivdnipropetrovskdnepropetrovskkhmelnitskiyneacsccogoorusorgmilcomedugovmyspreadshopadimono-ipbarsybarsyonlinelayershiftnh-servretrosnubapicampaignservicelugaffinitylotteryweeklylotteryraffleentrygluglugsmeaccoindependent-inquestnimsitecopropymntltdorgplcschnetgovnhsbarsyindependent-commissionindependent-reviewpolicepublic-inquiryindependent-panelconnhospindependent-inquiryroyal-commissionoraclegovcloudappscck12libaws-govccphxcclibpvtparochchtrcck12libcceatonk12coglibtecgendstmusann-arborwashtenawcck12glghcck12sealibforksolympiabainbridge-islkeyporthoquiamyarrow-pointcentraliaport-townsendsequimport-ludlowrentonsilverdalebremertonredmondsheltonbellevueport-orchardport-angeleskingstonchehalisaberdeengig-harborseattlepoulsboidmdndsddemenegacalamaiavawapailalflnmdcncscohnhmihiviwiriinmntnmocoutvtctmtgunjokakwvnvprarorasmskstxwynykyazisadninsnngosrvis-bymircloudservernamepointtoenscaledland-4-salefreeddnsstuff-4-saleazure-apinoipdatabricksappscloudnsgolffanheliohostazurewebsitesgvorgmilcomgubneteducoorgcomnetd0egvorgmilcomnetedugovmydnsiacostoree12orgmilcomnomwebgobbibrectecnetintedugovraremprendefirminfoartseducok12orgcomnethidnsidacaiiosonlahanamhanoicamauhueorgcompronetintedugovbizbacninhtayninhhoabinhnamdinhtravinhhaiphongvinhlonghaiduongquangnamquangtrithuathienhuequangninhbacgianghaugiangquangbinhsoctrangbentrethanhphohochiminhdanangkontumhatinhkhanhhoathanhhoahealthgialailaocaiyenbaibackanngheanlonganphuyenphuthocanthodaklakdongnainameinfovinhphucdongthapkiengiangtiengiangquangngailaichaulangsonlamdongdaknonghagiangangiangcaobangbinhduongninhthuanbinhthuanbaclieuthaibinhninhbinhbinhdinhtuyenquanghungyenbaria-vungtauthainguyendienbienbinhphuocschbizputerimagine-proxyorgcomnetedugovcloud66advisormypetsdyndnsxn--8dbq2axn--4dbgdty6cxn--5dbhl8dxn--hebda8bxn--80auxn--d1atxn--c1avgxn--o1acxn--o1achxn--90azhxn--55qx5dxn--uc0atvxn--od0algxn--wcvs22dxn--gmqw5axn--mxtq1mxn--12c1fe0brxn--h3cuzk1dixn--12co0c3b4evaxn--12cfi8ixb8lxn--o3cyx2axn--m3ch0j3axn--j1adpxn--90amcxn--90a1afxn--h1ahnxn--j1ael8bxn--h1alizxn--c1avgxn--j1aefxn--80aaa0cvacxn--41acaffeineexeopentunnelbotdashtelebitorgtmaccoagricorgmilnomwebnicngonetaltedugovlawnisschoolgrondaraccoorgmilcomschnetedugovbizinfoprg1-zeropstritonstackitlimazeropsaccoorgmilgovяспборгкоммскбизмирсамаракрымсочиакодпроргобрупрצהלממשלישובאקדמיהองค์กรธุรกิจรัฐบาลศึกษาทหารเน็ต教育網絡組織公司政府個人닷넷한국澳门新闻澳門联通家電嘉里招聘通販닷컴삼성コムგეбгрфеюadcdbdgdidmdsdtdaebedeeegeiejekemenepereseveyegabacalamanauavapaqasazacfbfafgfnfpfwftfbgcgagggegkgngmgsgpgvgtgugilmlnlalclglplsltlhmimjmkmmmomambmcmdmfmgmzmpmsmtmgbbblbsbecccacnclcmcvctcscmhkhghchbhthphshlinikifigiaibicivisikninhnmncnbngnsnpnvntnjoionomobocoaofodorosotoptstttytatbtetgtithtmtltrusuvuaucueuguhulumunufjdjbjtjsjlkmkhkfkdkcktkukskpkgpmpnpkpjpgqaqmqiqsvtvcvbvmvlvrwpwtwzwbwcwawgwkwmwtrsrprgrfrercrbrarnrmrlrkrirhrwsusrssspsgsesbsaslsmsissxmxaxcxuypysylymykygybycyuztzsznzmzkzdzczbzazελευ世界台灣购物公益点看臺灣网络書籍在线网站手机机构大拿游戏信息台湾谷歌慈善商标香港中国餐厅网址中國商城食品微博政务移动集团公司八卦商店健康网店政府时尚佛山中信娱乐广东企业homedepotengineeringاماراتrepublicankuokgroupversicherungchannelcitadelxn--pgbs0dhxn--b4w605ferdstatebankwebsitexn--mgb9awbf亚马逊淡马锡alibabaxn--ngbc5azdxn--mgbbh1axn--45br5cyltoshibabuildworldcloudtradeguideplacespacedancemoviephoneprimesmilebiblestyleappleazurestoreskypegripexn--l1accdrivelottehorsehouseleasechasereisestadahondaomegaaetnaamicaninjanokiamediadeltavodkaedekaosakapizzaslingemailgmailtirolshelltmallfinallegaltotalhotelamfamforumrehabmusicciticricohcoachwatchboschearthfaithirishmiamiarchidubaiguccipraxiみんなストアセールcanonsalononionnikonepsonkoelngreensevencrownikanoradioaudioweiboglobopromogalloyahoociscorodeovideomangobingotokyovolvolottokyotophotosmartsportquesttrusthyattjetztadultcymrubaidutushuxn--kprw13dubankclickblackmerckgroupsharpcheapnowtvxn--h2brj9cקוםհայоргсрбмонкомбелмкдқазрусукрمصرقطرعربكومdadcfdmedwedredphdthdbidpidkrdmsdltdiceonewmeglemoerwecfageacbanbambaaaammakianraspacpaaxawtfbcgaegongingaigvigorgdogdhlmilrilonlaolloluoljllcalgalnflafltelsrlfrllplkimibmcamcombommomifmabbjcbscbwebcabnabtabmlbpubabcbbcnecincpncllcstcwtcpwcnyckfhbzhovhmoiskiobisbitcifyituipinvinwinxincbnbcnmanfangdnmenrenkpnmtnyunrunfununobiojioriohbogmofooboooooacoecoceongoproartistottnttbbtcateatlatvetpetbetnethktmitfitintjothotgotdotbotprueduicujnjyouinknhktdkappsapgapmapdnptopgopllpjmpzipvipripesqtrvdtvitvdevmovgovhivnrwlawsewnewbmwwownowhowdvrftrmtrsfrbarcartvscrseusawsupsubssbsadsddsldssasbmsmlsxxxboxfoxgmxtjxsextaxbuyflydiysoyjoyskypaydaygayxyzanzbizwebersenerpokerlameractortatarsolarລາວคอมไทยtourslocusnexuslexusgiftsbeatsboatspartspressglassswissकॉमनेटtiresgivescodeshomesgamestunesshoescardswalesloansvegastoolsdealsautosparisファッションworkssucksrocksxeroxforexfedexpartylillymoneystudyrugbytoraytoday中文网xn--unup4y天主教飞利浦新加坡enterprises我爱你嘉里大酒店christmasxn--fct429kholdingsxn--8y0a063axn--mgbx4cd0ablifestyleabogadoallstatenetbankكاثوليكxn--s9brj9cxn--gk3at1ebestbuycharityxn--55qx5dmicrosoftpropertybasketballhomegoodscorsicajewelrygallerygrocerysurgerycountrybrusselsverisignferreroxn--czr694bhdfcbankcommbanksoftbankپاكستانپاکستانnextdirectالسعوديهالعليانxn--h2brj9c8cxn--80adxhksshikshaxn--mgbai9azgqp6jcuisinellabarclayscatholicxn--kpry57dcompanyxn--xhq521bblackfridayxn--mgba3a3ejtsandvikxn--d1acj3bacademydownloadمليسياxn--j1amhxn--w4r85el8fhu5dnraipirangaathletaxn--fhbeixn--mgbqly7cvafrzuerichxn--c2br7gஇலங்கைcontractorsxn--io0a7igraphicsinsurancetemasekxn--xkc2al3hye2amotorcyclesphotographydirectoryplumbingxn--vhquvclothingtrainingcleaningwilliamhilllightingxn--mgba3a4f16ashoppingcateringeducationokinawapicturesventuresproductionsxn--9et52uwalmartഭാരതംsupportrealestatecapitalonexn--nqv7fs00emaauspostfloristdentistxn--qxamgodaddybradescobargainsmitsubishikerryhotelsxn--9dbq2axn--3pxu8kimmobilienxn--fjq720axn--mgbtx2bholidaymckinseymadridbusinessbuildershelsinkixn--4gbrimмоскваالسعودیةcoffeedegreelacaixapartnersalsaceofficeabbvievoyageorangegeorgeonlinechromemobilekindlegoogleoraclecircleschulesecureinsurexn--mgba7c0bbn0aestatexn--mgbc0a9azcgcruisehangoutxn--vuq861bxn--42c2d9arexrothfirestoneuniversityxn--nnx388alifeinsuranceextraspaceонлайнvermögensberatersoftwarexn--fiqs8sxn--mgbab2bdxn--w4rs40ltiendaभारतम्africatoyotaotsukasakuracameracreditcardnagoyaconsultingnetworkjunipertheatermonsterprogressivepioneerxn--55qw42gracingdatingvotingvikinglivinggivingxn--bck1b9a5dre4cbrotherweatherjoburgفلسطينlplfinancialxn--clchc0ea0b2g2a9gcdfutbolschoolsocialglobaldentalwoodsidechanelairtelmatteltravelrealtorwebcamstreamభారత్unicomalstomxn--nodexn--6frz82gmuseumfurniturexn--rvc1e0am3exn--mix891faccenturexn--11b4c3dismailineustardiscountquebeccomsecclinicservicesxn--y9a3aqxn--c1avgswatchchurchsearchالاردنmarketingcontacthealthmonashshoujisanofitaipeiamericanexpresssuzukiアマゾンクラウドポイントbhartiグーグルxn--mgberp4a5d4armemorialxn--1qqw23alondonmormoninstitutevisionbostonnortoncouponmaisonamazonvirginberlindesigndurbanolayannissananquanxihuanhitachikaufengardenreisenbayerntechnologydatsunxn--90a3aclatinocasinostudiophysioxn--ngbe9e0apharmacytattootaobaoaramcoexpertreportabbottdirectselectimamatfairwindspictettargetmarketintuittravelersinsurancecreditdupontryukyusuppliesxn--tckwebnpparibasschmidtmerckmsdyodobashirestaurantbridgestonecricketxn--fpcrj9c3dbostikbroadwayattorneylefrakemerckxn--fiq228c5hscareersfarmerswinnersflowersxn--wgbh1cguitarsxn--54b7fta0ccxn--p1acfmakeupgalluplandroverxn--kcrx77d1x4agoldpointbauhausxn--mgbayh7gpahiphopplaystationxn--mgba3a4fraxn--eckvdtc9dhyundaixn--gckr3f0fistanbulticketsmarketsflightschintaireviewsxn--3e0b707ewindowsxn--fiqz9sfinancialxn--fzys8d69uvgmابوظبيdiscoverreviewবাংলাxn--5su34j936bgsgmoscowobserverapartmentsдетиارامكوсайтeurovisionxn--i1b6b1a6a2exn--xkc2dl3a5ee0hتونسموقعبارتڀارتشبكةعمانبيتكعراقreadkredbondlandbandfundfoodprodgoldfordtubecafesafelifeggeeieeefreefagepagegugezonewinememenamegamesaleablebikenikelikecarecbreherefiresaveloveliveblueartedatesitevotecaseluxebofamodaltdaasdatiaayogasinavanashiaasiajavabbvatevavivadatazaraarpacasavisasncfprofmaifsurfgolfdvagsongbingpingwangkpmggoogblogpohlfailcooldellcalldeallidlsarlfilmteamroomfarmimdbarabclubhdfcicbchsbcgmbhrichtechfishdishcashminiernikddiaudiwikimobitaxicitikiwidesiqponskinloanakdnwienopenporncerntownimmolimoolloinfonicofidolegosaxozeroaerovivoautovotomotofastbestresthostpostnextlgbtchatseatgiftmeetdietreitmintrentgentspotscotguruitausohumenucyoubanklinkpinkdclktalksilkbookseekworkrsvpaarpjeepshopcoophelpcamppccwshowbeerstarruhrflirweirhaircarsparsjprshausplusnewstipstoysjobskidsfanspicsdocsxboxamexsexynavycitysonyarmyallybabyplaydeliverybuzzgbizlamborghiniphilipsලංකාಭಾರತfitnessexpresslanxesspfizercenterwalterlawyersoccercareerkosherbrokerlockerdealerdoctorauthorxn--mgbqly7c0a67fbcvermögensberatungjaguarxn--pssy2uxn--hxt814eflickrrepairrogersairbusxn--mgbai9a5eva00beventsyachtsxn--t60b56aভাৰতভারতभारतभारोतviajeshermeshughesxn--j1aefसंगठनvillasଭାରତclaimshotelsભારતzapposphotosjuegoscondostatamotorsgratistennisਭਾਰਤtkmaxxtjmaxxschaeffleryandexxn--80aswgrealtysafetybeautyluxuryxn--3ds443gsupplyfamilyxn--o3cw4hhockeysydneyxn--90aenissayalipayenergycomputeragencyxn--rovu88b電訊盈科xn--gecrj9cstatefarmaccountantaquarelleolayangroup香格里拉xn--p1ai组织机构xn--1ck2e1bxn--mgbt3dhdschwarzموريتانياabudhabinowruzkomatsufujitsuhospitalxn--80asehdbxn--mgbtf8flxn--j6w193gxn--yfro4i67oprudentialxn--flw351ecruisescoursesrecipesxn--e1a4cferrarixn--ses554gxn--wgbl6awatchesstaplessinglesxn--mgbcpq6gpa1axn--otu796dpropertiescreditunionxn--mgbah1a3hjkrdstockholmhisamitsuالسعوديةstcgroupdomainsoriginscouponsbloombergclubmedfroganslimitedxn--80aqecdr1aexposedinternationalequipmentbarclaycardxn--q7ce6axn--mgbi4ecexpprotectionassociatesconstructionxn--cck2b3bxn--45q11candroidfoundationישראלxn--mgbca7dzdocliniqueboutiqueengineerxn--qxa6asystemsfirmdalefashionauctionxn--nqv7finfinitirentalsreliancetradingweddingfishinghostinggentingbookingcookingxn--3hcrj9cgraingerxn--czrs0tdemocratsamsungyokohamaxn--h2breg3evexn--nyqy26alundbeckmelbournevacationssolutionsfrontierxn--vermgensberatung-pwbmanagementxn--cg4bkixn--mgb2ddeslincolnhamburgsandvikcoromantblockbusterairforcebarefootxn--4dbrk0ceinvestmentsfeedbackcommunityxn--ngbrxالبحرينdiamondsamsterdamhealthcareredumbrellaxn--mxtq1mxn--2scrj9cagakhanxn--mgbpl2fhкатоликcaravanசிங்கப்பூர்richardlimortgageamericanfamilyxn--fzc2c9e2cscholarshipssaarlandxn--imr513nvlaanderensamsclubgoodyearkitchenஇந்தியாweatherchannelallfinanzxn--kput3iالسعودیۃxn--90aisxn--efvy88hالجزائرxn--mgbaam7a8hexchangejpmorganxn--tiq49xqyjfidelitysecurityxn--mk1bu44cwanggouxn--fiq64bxn--6qq986b3xlxn--mgbbh1a71exn--80ao21amarshallsxn--5tzm5gtravelerspanasoniclatrobeyoutubeaccountantsxn--rhqv96gxn--cckwcxetdanalyticsxn--ygbi2ammxبازاربھارتسوريةorganicfreseniusسورياxn--9krt00axn--qcka1pmcxn--jlq480n2rgdeloittesciencefinancexn--jvr189mxn--30rr7yhomesensehotmailbaseballfootballleclercboehringerxn--q9jyb4cxn--mix082fاليمنهمراهpolitieسودانايرانایرانnetflixyamaxunxn--lgbbat1ad8jcollegestoragecapetowncolognekerrypropertiesxn--mgbgu82axn--ogbpf8flxn--czru2dwhoswhociprianilasallexn--g2xx48cforsalebanamexaudiblexn--vermgensberater-ctbxn--zfr164bericssonvanguardxn--45brj9cindustriestheatremarriottxn--3bst00mcomparexn--mgberp4a5d4a87gcapitaldigitalالمغربbarcelonashangrilaxn--d1alfcalvinkleinwwwcitysapporokawasakinagoyasendaikobekitakyushuyokohamackjp`.charCodeAt(i+e)!==t.charCodeAt(n+e))return!1;return!0}function oB(e,t,n,r,i){let a=qz[e],o=qz[e+1];for(;a<o;){let e=a+o>>>1,s=eB[e];if(s<t)a=e+1;else if(s>t)o=e;else{for(let o=e;o>=a&&eB[o]===t;--o)if(aB(o,n,r,i))return o;for(let a=e+1;a<o&&eB[a]===t;a+=1)if(aB(a,n,r,i))return a;return-1}}return-1}function sB(e,t,n){let r=t,i=e.length,a=5381;nB=-1;for(let t=e.length-1;t>=0;--t){let o=e.charCodeAt(t);if(o===46){let o=t+1,s=oB(r,a>>>0,e,o,i-o);if(s===-1&&(s=tB[r]),s===-1)return nB!==-1;r=Yz[s],(Kz[r]&n)!==0&&(nB=r,rB=o,iB=i),i=t,a=5381}else a=a*33^o}let o=oB(r,a>>>0,e,0,i);return o===-1&&(o=tB[r]),o!==-1&&(r=Yz[o],(Kz[r]&n)!==0&&(nB=r,rB=0,iB=i)),nB!==-1}function cB(e,t,n){if(Gz(e,t,n))return;let r=(t.allowPrivateDomains?2:0)|!!t.allowIcannDomains;if(sB(e,629,r)){n.isIcann=!!(Kz[nB]&1),n.isPrivate=!!(Kz[nB]&2),n.publicSuffix=e.slice(iB+1);return}if(sB(e,625,r)){n.isIcann=!!(Kz[nB]&1),n.isPrivate=!!(Kz[nB]&2),n.publicSuffix=e.slice(rB);return}n.isIcann=!1,n.isPrivate=!1;let i=e.lastIndexOf(`.`);n.publicSuffix=i===-1?e:e.slice(i+1)}function lB(e,t){return Wz(e,5,cB,t,Uz())}var uB=class extends Error{name=`Realm.NotFoundError`;constructor(e){super(`Unknown realm ${e.id}. Add it first.`)}},dB=`default`,fB;(function(e){let t=e.id=z().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:`Use lowercase kebab case, such as tempo-cash.`});e.realm=B({id:t,name:z().trim().min(1,{message:`Set a name.`})}),e.passkeys=B({realmId:t,rpId:z().regex(/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/,{message:`Use a lowercase domain, such as tempo.xyz.`})}),e.privy=B({appId:z().trim().min(1,{message:`Set a Privy app ID.`}),appSecret:z().min(1,{message:`Set a Privy app secret.`}),realmId:t}),e.realms=en(t).refine(e=>new Set(e).size===e.length,{message:`Name each realm once.`})})(fB||={});async function pB(e,t){let n=await e.select({appId:bM.appId,id:SM.id,name:SM.name,position:mM.position,rpId:yM.rpId,secp256k1:xM.realmId}).from(SM).leftJoin(mM,tA(Y(mM.realmId,SM.id),Y(mM.clientId,t.clientId))).leftJoin(yM,Y(yM.realmId,SM.id)).leftJoin(bM,Y(bM.realmId,SM.id)).leftJoin(xM,Y(xM.realmId,SM.id)).where(nA(Y(mM.clientId,t.clientId),Y(SM.id,dB))).orderBy(bA(mM.position)),r=n.filter(e=>e.position!==null);return(r.length>0?r:n).map(yB)}async function mB(e,t){let{clientId:n,origin:r,own:i}=t;if(!n)return[await gB(e,{id:dB})];if(r&&r!==i){let[t]=await e.select({redirectUris:Zj.redirectUris}).from(Zj).where(Y(Zj.clientId,n));if(!(t?.redirectUris??[]).flatMap(e=>{let t=URL.parse(e);return t&&(t.protocol===`https:`||t.protocol===`http:`)?[t.origin]:[]}).includes(r))return[await gB(e,{id:dB})]}return await pB(e,{clientId:n})}function hB(e){return e}async function gB(e,t){let[n]=await e.select({appId:bM.appId,id:SM.id,name:SM.name,rpId:yM.rpId,secp256k1:xM.realmId}).from(SM).leftJoin(yM,Y(yM.realmId,SM.id)).leftJoin(bM,Y(bM.realmId,SM.id)).leftJoin(xM,Y(xM.realmId,SM.id)).where(Y(SM.id,t.id));if(!n)throw new uB({id:t.id});return yB(n)}async function _B(e,t){let n=t.realms.flatMap(e=>e.privy?[e.id]:[]);if(n.length===0)return new Map;let r=await e.select().from(bM).where(cA(bM.realmId,n));return new Map(await Promise.all(r.map(async e=>[e.realmId,{appId:e.appId,appSecret:await bn({data:e.appSecret,key:t.secret})}])))}async function vB(e,t){let{realms:n}=t;if(!n.some(e=>e.id==="default"&&!e.passkeys))return n;let r=new URL(t.origin).hostname,i=lB(r,{allowPrivateDomains:!0});if(i.isIp)return n;let a=i.domain??r,o=r.split(`.`),s=o.map((e,t)=>o.slice(t).join(`.`)).filter(e=>e===a||e.endsWith(`.${a}`));if(n.some(e=>e.passkeys&&s.includes(e.passkeys.rpId)))return n;let[c]=await e.select({realmId:yM.realmId}).from(yM).where(cA(yM.rpId,s));return c?n:n.map(e=>e.id==="default"&&!e.passkeys?hB({...e,passkeys:{rpId:a}}):e)}function yB(e){return hB({id:e.id,name:e.name,passkeys:e.rpId===null?void 0:{rpId:e.rpId},privy:e.appId===null?void 0:{appId:e.appId},secp256k1:e.secp256k1!==null})}var bB=dL({errors:[],load(e,t){let{userId:n}=t,r=t.realms.filter(e=>e.passkeys);return Promise.resolve({async list(e,t){return r.length===0?[]:(await t.db.select().from(_M).where(tA(Y(_M.userId,n),Y(_M.source,`wallet`),cA(_M.rpId,r.map(e=>e.passkeys.rpId)))).orderBy(bA(_M.createdAt),bA(_M.id))).flatMap(e=>r.filter(t=>t.passkeys.rpId===e.rpId).map(t=>uL({account:rt({owners:[Ue({id:e.id,publicKey:e.publicKey},{rpId:e.rpId})]}),createdAt:e.createdAt,credential:{id:e.id,publicKey:e.publicKey,rpId:e.rpId},realm:t,signer:void 0,type:`webAuthn`})))}})},type:`webAuthn`});function xB(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function SB(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var CB=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return CB=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(+e^n()&15>>e/4).toString(16))};function wB(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var TB=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},EB=class extends Error{},DB=class e extends EB{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.error=n}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new kB({message:r,cause:TB(n)});let a=n;return t===400?new jB(t,a,r,i):t===401?new MB(t,a,r,i):t===403?new NB(t,a,r,i):t===404?new PB(t,a,r,i):t===409?new FB(t,a,r,i):t===422?new IB(t,a,r,i):t===429?new LB(t,a,r,i):t>=500?new RB(t,a,r,i):new e(t,a,r,i)}},OB=class extends DB{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},kB=class extends DB{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},AB=class extends kB{constructor({message:e}={}){super({message:e??`Request timed out.`})}},jB=class extends DB{},MB=class extends DB{},NB=class extends DB{},PB=class extends DB{},FB=class extends DB{},IB=class extends DB{},LB=class extends DB{},RB=class extends DB{},zB=/^[a-z][a-z0-9+.-]*:/i,BB=e=>zB.test(e),VB=e=>(VB=Array.isArray,VB(e)),HB=VB;function UB(e){return typeof e==`object`?e??{}:{}}function WB(e){if(!e)return!0;for(let t in e)return!1;return!0}function GB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var KB=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new EB(`${e} must be an integer`);if(t<0)throw new EB(`${e} must be a positive integer`);return t},qB=e=>{try{return JSON.parse(e)}catch{return}},JB=e=>new Promise(t=>setTimeout(t,e)),YB=`0.35.0`,XB=()=>typeof window<`u`&&window.document!==void 0&&typeof navigator<`u`;function ZB(){return typeof Deno<`u`&&Deno.build!=null?`deno`:typeof EdgeRuntime<`u`?`edge`:Object.prototype.toString.call(globalThis.process===void 0?0:globalThis.process)===`[object process]`?`node`:`unknown`}var QB=()=>{let e=ZB();if(e===`deno`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":YB,"X-Stainless-OS":tV(Deno.build.os),"X-Stainless-Arch":eV(Deno.build.arch),"X-Stainless-Runtime":`deno`,"X-Stainless-Runtime-Version":typeof Deno.version==`string`?Deno.version:Deno.version?.deno??`unknown`};if(typeof EdgeRuntime<`u`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":YB,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":`edge`,"X-Stainless-Runtime-Version":globalThis.process.version};if(e===`node`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":YB,"X-Stainless-OS":tV(globalThis.process.platform??`unknown`),"X-Stainless-Arch":eV(globalThis.process.arch??`unknown`),"X-Stainless-Runtime":`node`,"X-Stainless-Runtime-Version":globalThis.process.version??`unknown`};let t=$B();return t?{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":YB,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":YB,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`unknown`,"X-Stainless-Runtime-Version":`unknown`}};function $B(){if(typeof navigator>`u`||!navigator)return null;for(let{key:e,pattern:t}of[{key:`edge`,pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`chrome`,pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`firefox`,pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`safari`,pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n)return{browser:e,version:`${n[1]||0}.${n[2]||0}.${n[3]||0}`}}return null}var eV=e=>e===`x32`?`x32`:e===`x86_64`||e===`x64`?`x64`:e===`arm`?`arm`:e===`aarch64`||e===`arm64`?`arm64`:e?`other:${e}`:`unknown`,tV=e=>(e=e.toLowerCase(),e.includes(`ios`)?`iOS`:e===`android`?`Android`:e===`darwin`?`MacOS`:e===`win32`?`Windows`:e===`freebsd`?`FreeBSD`:e===`openbsd`?`OpenBSD`:e===`linux`?`Linux`:e?`Other:${e}`:`Unknown`),nV,rV=()=>nV??=QB();function iV(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new PrivyAPI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function aV(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function oV(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return aV({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}async function sV(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var cV=({headers:e,body:t})=>({bodyHeaders:{"content-type":`application/json`},body:JSON.stringify(t)}),lV=`RFC3986`,uV=e=>String(e),dV={RFC1738:e=>String(e).replace(/%20/g,`+`),RFC3986:uV},fV=(e,t)=>(fV=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),fV(e,t)),pV=(()=>{let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),mV=1024,hV=(e,t,n,r,i)=>{if(e.length===0)return e;let a=e;if(typeof e==`symbol`?a=Symbol.prototype.toString.call(e):typeof e!=`string`&&(a=String(e)),n===`iso-8859-1`)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});let o=``;for(let e=0;e<a.length;e+=mV){let t=a.length>=mV?a.slice(e,e+mV):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);r===45||r===46||r===95||r===126||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||i===`RFC1738`&&(r===40||r===41)?n[n.length]=t.charAt(e):r<128?n[n.length]=pV[r]:r<2048?n[n.length]=pV[192|r>>6]+pV[128|r&63]:r<55296||r>=57344?n[n.length]=pV[224|r>>12]+pV[128|r>>6&63]+pV[128|r&63]:(e+=1,r=65536+((r&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=pV[240|r>>18]+pV[128|r>>12&63]+pV[128|r>>6&63]+pV[128|r&63])}o+=n.join(``)}return o};function gV(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function _V(e,t){if(VB(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var vV={brackets(e){return String(e)+`[]`},comma:`comma`,indices(e,t){return String(e)+`[`+t+`]`},repeat(e){return String(e)}},yV=function(e,t){Array.prototype.push.apply(e,VB(t)?t:[t])},bV,xV={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:hV,encodeValuesOnly:!1,format:lV,formatter:uV,indices:!1,serializeDate(e){return(bV??=Function.prototype.call.bind(Date.prototype.toISOString))(e)},skipNulls:!1,strictNullHandling:!1};function SV(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`}var CV={};function wV(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=e,y=_,b=0,x=!1;for(;(y=y.get(CV))!==void 0&&!x;){let t=y.get(e);if(b+=1,t!==void 0){if(t===b)throw RangeError(`Cyclic object value`);x=!0}y.get(CV)===void 0&&(b=0)}if(typeof l==`function`?v=l(t,v):v instanceof Date?v=f?.(v):n===`comma`&&VB(v)&&(v=_V(v,function(e){return e instanceof Date?f?.(e):e})),v===null){if(a)return c&&!h?c(t,xV.encoder,g,`key`,p):t;v=``}if(SV(v)||gV(v)){if(c){let e=h?t:c(t,xV.encoder,g,`key`,p);return[m?.(e)+`=`+m?.(c(v,xV.encoder,g,`value`,p))]}return[m?.(t)+`=`+m?.(String(v))]}let S=[];if(v===void 0)return S;let C;if(n===`comma`&&VB(v))h&&c&&(v=_V(v,c)),C=[{value:v.length>0?v.join(`,`)||null:void 0}];else if(VB(l))C=l;else{let e=Object.keys(v);C=u?e.sort(u):e}let w=s?String(t).replace(/\./g,`%2E`):String(t),E=r&&VB(v)&&v.length===1?w+`[]`:w;if(i&&VB(v)&&v.length===0)return E+`[]`;for(let t=0;t<C.length;++t){let y=C[t],x=typeof y==`object`&&y.value!==void 0?y.value:v[y];if(o&&x===null)continue;let w=d&&s?y.replace(/\./g,`%2E`):y,D=VB(v)?typeof n==`function`?n(E,w):E:E+(d?`.`+w:`[`+w+`]`);_.set(e,b);let O=new WeakMap;O.set(CV,_),yV(S,wV(x,D,n,r,i,a,o,s,n===`comma`&&h&&VB(v)?null:c,l,u,d,f,p,m,h,g,O))}return S}function TV(e=xV){if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);let t=e.charset||xV.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);let n=lV;if(e.format!==void 0){if(!fV(dV,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}let r=dV[n],i=xV.filter;(typeof e.filter==`function`||VB(e.filter))&&(i=e.filter);let a;if(a=e.arrayFormat&&e.arrayFormat in vV?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:xV.arrayFormat,`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=e.allowDots===void 0?e.encodeDotInKeys?!0:xV.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:xV.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:xV.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:xV.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?xV.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:xV.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:xV.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:xV.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:xV.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:xV.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:xV.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:xV.strictNullHandling}}function EV(e,t={}){let n=e,r=TV(t),i,a;typeof r.filter==`function`?(a=r.filter,n=a(``,n)):VB(r.filter)&&(a=r.filter,i=a);let o=[];if(typeof n!=`object`||!n)return``;let s=vV[r.arrayFormat],c=s===`comma`&&r.commaRoundTrip;i||=Object.keys(n),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let e=0;e<i.length;++e){let t=i[e];r.skipNulls&&n[t]===null||yV(o,wV(n[t],t,s,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=o.join(r.delimiter),d=r.addQueryPrefix===!0?`?`:``;return r.charsetSentinel&&(r.charset===`iso-8859-1`?d+=`utf8=%26%2310003%3B&`:d+=`utf8=%E2%9C%93&`),u.length>0?d+u:``}function DV(e){return EV(e,{arrayFormat:`comma`})}var OV={off:0,error:200,warn:300,info:400,debug:500},kV=(e,t,n)=>{if(e){if(GB(OV,e))return e;PV(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(OV))}`)}};function AV(){}function jV(e,t,n){return!t||OV[e]>OV[n]?AV:t[e].bind(t)}var MV={error:AV,warn:AV,info:AV,debug:AV},NV=new WeakMap;function PV(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return MV;let r=NV.get(t);if(r&&r[0]===n)return r[1];let i={error:jV(`error`,t,n),warn:jV(`warn`,t,n),info:jV(`info`,t,n),debug:jV(`debug`,t,n)};return NV.set(t,[n,i]),i}var FV=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);async function IV(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:a}=t,o=await(async()=>{if(n.status===204)return null;if(t.options.__binaryResponse)return n;let e=n.headers.get(`content-type`)?.split(`;`)[0]?.trim();return e?.includes(`application/json`)||e?.endsWith(`+json`)?n.headers.get(`content-length`)===`0`?void 0:await n.json():await n.text()})();return PV(e).debug(`[${r}] response parsed`,FV({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-a})),o}var LV,RV=class e extends Promise{constructor(e,t,n=IV){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,LV.set(this,void 0),xB(this,LV,e,`f`)}_thenUnwrap(t){return new e(SB(this,LV,`f`),this.responsePromise,async(e,n)=>t(await this.parseResponse(e,n),n))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t}}parse(){return this.parsedPromise||=this.responsePromise.then(e=>this.parseResponse(SB(this,LV,`f`),e)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};LV=new WeakMap;var zV,BV=class{constructor(e,t,n,r){zV.set(this,void 0),xB(this,zV,e,`f`),this.options=r,this.response=t,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new EB("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await SB(this,zV,`f`).requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(zV=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}},VV=class extends RV{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await IV(e,t),t.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}},HV=class extends BV{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.next_cursor=n.next_cursor||``}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_cursor;return e?{...this.options,query:{...UB(this.options.query),cursor:e}}:null}},UV=()=>{if(typeof File>`u`){let{process:e}=globalThis,t=typeof e?.versions?.node==`string`&&parseInt(e.versions.node.split(`.`))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":``))}};function WV(e,t,n){return UV(),new File(e,t??`unknown_file`,n)}function GV(e){return(typeof e==`object`&&!!e&&(`name`in e&&e.name&&String(e.name)||`url`in e&&e.url&&String(e.url)||`filename`in e&&e.filename&&String(e.filename)||`path`in e&&e.path&&String(e.path))||``).split(/[\\/]/).pop()||void 0}var KV=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,qV=e=>typeof e==`object`&&!!e&&typeof e.size==`number`&&typeof e.type==`string`&&typeof e.text==`function`&&typeof e.slice==`function`&&typeof e.arrayBuffer==`function`,JV=e=>typeof e==`object`&&!!e&&typeof e.name==`string`&&typeof e.lastModified==`number`&&qV(e),YV=e=>typeof e==`object`&&!!e&&typeof e.url==`string`&&typeof e.blob==`function`;async function XV(e,t,n){if(UV(),e=await e,JV(e))return e instanceof File?e:WV([await e.arrayBuffer()],e.name);if(YV(e)){let r=await e.blob();return t||=new URL(e.url).pathname.split(/[\\/]/).pop(),WV(await ZV(r),t,n)}let r=await ZV(e);if(t||=GV(e),!n?.type){let e=r.find(e=>typeof e==`object`&&`type`in e&&e.type);typeof e==`string`&&(n={...n,type:e})}return WV(r,t,n)}async function ZV(e){let t=[];if(typeof e==`string`||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(qV(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(KV(e))for await(let n of e)t.push(...await ZV(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:``}${QV(e)}`)}return t}function QV(e){return typeof e!=`object`||!e?``:`; props: [${Object.getOwnPropertyNames(e).map(e=>`"${e}"`).join(`, `)}]`}var $V=class{constructor(e){this._client=e}},eH=class extends $V{},tH=class extends $V{},nH=class extends $V{},rH=class extends $V{};function iH(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var aH=Object.freeze(Object.create(null)),Q=((e=iH)=>function(t,...n){if(t.length===1)return t[0];let r=!1,i=[],a=t.reduce((t,a,o)=>{/[?#]/.test(a)&&(r=!0);let s=n[o],c=(r?encodeURIComponent:e)(``+s);return o!==n.length&&(s==null||typeof s==`object`&&s.toString===Object.getPrototypeOf(Object.getPrototypeOf(s.hasOwnProperty??aH)??aH)?.toString)&&(c=s+``,i.push({start:t.length+a.length,length:c.length,error:`Value of type ${Object.prototype.toString.call(s).slice(8,-1)} is not a valid path parameter`})),t+a+(o===n.length?``:c)},``),o=a.split(/[?#]/,1)[0],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,c;for(;(c=s.exec(o))!==null;)i.push({start:c.index,length:c[0].length,error:`Value "${c[0]}" can\'t be safely passed as a path parameter`});if(i.sort((e,t)=>e.start-t.start),i.length>0){let e=0,t=i.reduce((t,n)=>{let r=` `.repeat(n.start-e),i=`^`.repeat(n.length);return e=n.start+n.length,t+r+i},``);throw new EB(`Path parameters result in path with invalid segments:\n${i.map(e=>e.error).join(`
|
|
460
|
+
`)}\n${a}\n${t}`)}return a})(iH),oH=class extends $V{create(e,t,n){return this._client.post(Q`/v1/apps/${e}/allowlist`,{body:t,...n})}list(e,t){return this._client.get(Q`/v1/apps/${e}/allowlist`,t)}delete(e,t,n){return this._client.delete(Q`/v1/apps/${e}/allowlist`,{body:t,...n})}},sH=class extends $V{constructor(){super(...arguments),this.allowlist=new oH(this._client)}get(e,t){if(e===``)throw Error(`appID must not be an empty string`);return this._client.get(Q`/v1/apps/${e}`,t)}getGasSpend(e,t){return this._client.get(`/v1/apps/gas_spend`,{query:e,...t})}getTestCredentials(e,t){return this._client.get(Q`/v1/apps/${e}/test_credentials`,t)}};sH.Allowlist=oH;var cH=class extends $V{},lH=class extends $V{},uH=class extends $V{},dH=class extends $V{},fH=class extends $V{},pH=class extends $V{},mH=Symbol(`brand.privateNullableHeaders`);function*hH(e){if(!e)return;if(mH in e){let{values:t,nulls:n}=e;yield*t.entries();for(let e of n)yield[e,null];return}let t=!1,n;e instanceof Headers?n=e.entries():HB(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let e of n){let n=e[0];if(typeof n!=`string`)throw TypeError(`expected header name to be a string`);let r=HB(e[1])?e[1]:[e[1]],i=!1;for(let e of r)e!==void 0&&(t&&!i&&(i=!0,yield[n,null]),yield[n,e])}}var gH=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[i,a]of hH(r)){let r=i.toLowerCase();e.has(r)||(t.delete(i),e.add(r)),a===null?(t.delete(i),n.add(r)):(t.append(i,a),n.delete(r))}}return{[mH]:!0,values:t,nulls:n}},_H=class extends $V{list(e={},t){return this._client.getAPIList(`/v1/intents`,HV,{query:e,...t})}createPolicyRule(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.post(Q`/v1/intents/policies/${e}/rules`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}deletePolicyRule(e,t,n){let{policy_id:r,"privy-request-expiry":i}=t;return this._client.delete(Q`/v1/intents/policies/${r}/rules/${e}`,{...n,headers:gH([{...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}get(e,t){if(e===``)throw Error(`intentID must not be an empty string`);return this._client.get(Q`/v1/intents/${e}`,t)}reject(e,t){return this._client.post(Q`/v1/intents/${e}/reject`,t)}rpc(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.post(Q`/v1/intents/wallets/${e}/rpc`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}transfer(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.post(Q`/v1/intents/wallets/${e}/transfer`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}updateKeyQuorum(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.patch(Q`/v1/intents/key_quorums/${e}`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}updatePolicy(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.patch(Q`/v1/intents/policies/${e}`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}updatePolicyRule(e,t,n){let{policy_id:r,"privy-request-expiry":i,...a}=t;return this._client.patch(Q`/v1/intents/policies/${r}/rules/${e}`,{body:a,...n,headers:gH([{...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}updateWallet(e,t,n){let{"privy-request-expiry":r,...i}=t;return this._client.patch(Q`/v1/intents/wallets/${e}`,{body:i,...n,headers:gH([{...r==null?void 0:{"privy-request-expiry":r}},n?.headers])})}},vH=class extends $V{create(e,t){return this._client.post(`/v1/key_quorums`,{body:e,...t})}_delete(e,t={},n){let{"privy-authorization-signature":r,"privy-request-expiry":i}=t??{};return this._client.delete(Q`/v1/key_quorums/${e}`,{...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_update(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.patch(Q`/v1/key_quorums/${e}`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}get(e,t){if(e===``)throw Error(`keyQuorumID must not be an empty string`);return this._client.get(Q`/v1/key_quorums/${e}`,t)}},yH=class extends $V{},bH=class extends $V{},xH=class extends $V{},SH=class extends $V{create(e,t,n){return this._client.post(Q`/v1/organizations/${e}/external_fiat_accounts`,{body:t,...n})}list(e,t,n){return this._client.get(Q`/v1/organizations/${e}/external_fiat_accounts`,{query:t,...n})}delete(e,t,n){let{organization_id:r}=t;return this._client.delete(Q`/v1/organizations/${r}/external_fiat_accounts/${e}`,n)}get(e,t,n){let{organization_id:r}=t;return this._client.get(Q`/v1/organizations/${r}/external_fiat_accounts/${e}`,n)}},CH=class extends $V{list(e,t){return this._client.get(Q`/v1/organizations/${e}/kyb`,t)}initiateLinks(e,t,n){return this._client.post(Q`/v1/organizations/${e}/kyb/links`,{body:t,...n})}initiateTos(e,t,n){return this._client.post(Q`/v1/organizations/${e}/kyb/tos`,{body:t,...n})}submit(e,t,n){return this._client.post(Q`/v1/organizations/${e}/kyb/submit`,{body:t,...n})}},wH=class extends $V{constructor(){super(...arguments),this.externalFiatAccounts=new SH(this._client),this.kyb=new CH(this._client)}create(e,t){return this._client.post(`/v1/organizations`,{body:e,...t})}update(e,t,n){return this._client.patch(Q`/v1/organizations/${e}`,{body:t,...n})}list(e={},t){return this._client.getAPIList(`/v1/organizations`,HV,{query:e,...t})}delete(e,t){return this._client.delete(Q`/v1/organizations/${e}`,{...t,headers:gH([{Accept:`*/*`},t?.headers])})}get(e,t){return this._client.get(Q`/v1/organizations/${e}`,t)}};wH.ExternalFiatAccounts=SH,wH.KYB=CH;var TH=class extends $V{create(e,t){let{"privy-idempotency-key":n,...r}=e;return this._client.post(`/v1/policies`,{body:r,...t,headers:gH([{...n==null?void 0:{"privy-idempotency-key":n}},t?.headers])})}_createRule(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.post(Q`/v1/policies/${e}/rules`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_delete(e,t={},n){let{"privy-authorization-signature":r,"privy-request-expiry":i}=t??{};return this._client.delete(Q`/v1/policies/${e}`,{...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_deleteRule(e,t,n){let{policy_id:r,"privy-authorization-signature":i,"privy-request-expiry":a}=t;return this._client.delete(Q`/v1/policies/${r}/rules/${e}`,{...n,headers:gH([{...i==null?void 0:{"privy-authorization-signature":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}_update(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.patch(Q`/v1/policies/${e}`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_updateRule(e,t,n){let{policy_id:r,"privy-authorization-signature":i,"privy-request-expiry":a,...o}=t;return this._client.patch(Q`/v1/policies/${r}/rules/${e}`,{body:o,...n,headers:gH([{...i==null?void 0:{"privy-authorization-signature":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}get(e,t){if(e===``)throw Error(`policyID must not be an empty string`);return this._client.get(Q`/v1/policies/${e}`,t)}getRule(e,t,n){if(e===``)throw Error(`ruleID must not be an empty string`);let{policy_id:r}=t;if(r===``)throw Error(`policy_id must not be an empty string`);return this._client.get(Q`/v1/policies/${r}/rules/${e}`,n)}},EH=class extends $V{},DH=class extends $V{},OH=class extends $V{get(e,t){if(e===``)throw Error(`transactionID must not be an empty string`);return this._client.get(Q`/v1/transactions/${e}`,t)}},kH=class extends $V{create(e,t,n){return this._client.post(Q`/v1/users/${e}/external_fiat_accounts`,{body:t,...n})}list(e,t,n){return this._client.get(Q`/v1/users/${e}/external_fiat_accounts`,{query:t,...n})}delete(e,t,n){let{user_id:r}=t;return this._client.delete(Q`/v1/users/${r}/external_fiat_accounts/${e}`,n)}get(e,t,n){let{user_id:r}=t;return this._client.get(Q`/v1/users/${r}/external_fiat_accounts/${e}`,n)}},AH=class extends $V{list(e,t){return this._client.get(Q`/v1/users/${e}/kyc`,t)}initiateLinks(e,t,n){return this._client.post(Q`/v1/users/${e}/kyc/links`,{body:t,...n})}initiateTos(e,t,n){return this._client.post(Q`/v1/users/${e}/kyc/tos`,{body:t,...n})}submit(e,t,n){return this._client.post(Q`/v1/users/${e}/kyc/submit`,{body:t,...n})}},jH=class extends $V{constructor(){super(...arguments),this.externalFiatAccounts=new kH(this._client),this.kyc=new AH(this._client)}create(e,t){return this._client.post(`/v1/users`,{body:e,...t})}list(e={},t){return this._client.getAPIList(`/v1/users`,HV,{query:e,...t})}delete(e,t){return this._client.delete(Q`/v1/users/${e}`,{...t,headers:gH([{Accept:`*/*`},t?.headers])})}_get(e,t){if(e===``)throw Error(`userID must not be an empty string`);return this._client.get(Q`/v1/users/${e}`,t)}getByCustomAuthID(e,t){return this._client.post(`/v1/users/custom_auth/id`,{body:e,...t})}getByDiscordUsername(e,t){return this._client.post(`/v1/users/discord/username`,{body:e,...t})}getByEmailAddress(e,t){return this._client.post(`/v1/users/email/address`,{body:e,...t})}getByFarcasterID(e,t){return this._client.post(`/v1/users/farcaster/fid`,{body:e,...t})}getByGitHubUsername(e,t){return this._client.post(`/v1/users/github/username`,{body:e,...t})}getByPhoneNumber(e,t){return this._client.post(`/v1/users/phone/number`,{body:e,...t})}getBySmartWalletAddress(e,t){return this._client.post(`/v1/users/smart_wallet/address`,{body:e,...t})}getByTelegramUserID(e,t){return this._client.post(`/v1/users/telegram/telegram_user_id`,{body:e,...t})}getByTelegramUsername(e,t){return this._client.post(`/v1/users/telegram/username`,{body:e,...t})}getByTwitterSubject(e,t){return this._client.post(`/v1/users/twitter/subject`,{body:e,...t})}getByTwitterUsername(e,t){return this._client.post(`/v1/users/twitter/username`,{body:e,...t})}getByWalletAddress(e,t){return this._client.post(`/v1/users/wallet/address`,{body:e,...t})}pregenerateWallets(e,t,n){return this._client.post(Q`/v1/users/${e}/wallets`,{body:t,...n})}search(e,t){return this._client.post(`/v1/users/search`,{body:e,...t})}setCustomMetadata(e,t,n){return this._client.post(Q`/v1/users/${e}/custom_metadata`,{body:t,...n})}unlinkLinkedAccount(e,t,n){return this._client.post(Q`/v1/users/${e}/accounts/unlink`,{body:t,...n})}};jH.ExternalFiatAccounts=kH,jH.KYC=AH;var MH=class extends $V{create(e,t){return this._client.post(`/v1/wallet_automations`,{body:e,...t})}update(e,t,n){return this._client.patch(Q`/v1/wallet_automations/${e}`,{body:t,...n})}list(e={},t){return this._client.getAPIList(`/v1/wallet_automations`,HV,{query:e,...t})}delete(e,t){return this._client.delete(Q`/v1/wallet_automations/${e}`,t)}get(e,t){return this._client.get(Q`/v1/wallet_automations/${e}`,t)}listExecutions(e={},t){return this._client.getAPIList(`/v1/wallet_automations/executions`,HV,{query:e,...t})}reindex(e,t){return this._client.post(`/v1/wallet_automations/reindex`,{body:e,...t})}},NH=class extends $V{get(e,t,n){let{wallet_id:r,"privy-authorization-signature":i,...a}=t;return this._client.get(Q`/v1/wallets/${r}/actions/${e}`,{query:a,...n,headers:gH([{...i==null?void 0:{"privy-authorization-signature":i}},n?.headers])})}},PH=class extends $V{get(e,t={},n){if(e===``)throw Error(`walletID must not be an empty string`);return this._client.get(Q`/v1/wallets/${e}/balance`,{query:t,...n})}},FH=class extends $V{execute(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/swap`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}quote(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.post(Q`/v1/wallets/${e}/swap/quote`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}},IH=class extends $V{get(e,t,n){if(e===``)throw Error(`walletID must not be an empty string`);return this._client.get(Q`/v1/wallets/${e}/transactions`,{query:t,...n})}},LH=class extends $V{create(e,t,n){return this._client.post(Q`/v1/wallets/${e}/deposit_accounts/fiat`,{body:t,...n})}list(e,t,n){return this._client.get(Q`/v1/wallets/${e}/deposit_accounts/fiat`,{query:t,...n})}get(e,t,n){let{wallet_id:r}=t;return this._client.get(Q`/v1/wallets/${r}/deposit_accounts/fiat/${e}`,n)}},RH=class extends $V{get(e,t,n){let{wallet_id:r}=t;return this._client.get(Q`/v1/wallets/${r}/deposit_accounts/crypto/orders/${e}`,n)}},zH=class extends $V{constructor(){super(...arguments),this.orders=new RH(this._client)}list(e,t={},n){return this._client.getAPIList(Q`/v1/wallets/${e}/deposit_accounts/crypto`,HV,{query:t,...n})}_create(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/deposit_accounts/crypto`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}getConfig(e){return this._client.get(`/v1/deposit_accounts/crypto/config`,e)}getNextOrder(e,t,n){return this._client.get(Q`/v1/wallets/${e}/deposit_accounts/crypto/next_order`,{query:t,...n})}quote(e,t){return this._client.post(`/v1/deposit_accounts/crypto/quote`,{body:e,...t})}};zH.Orders=RH;var BH=class extends $V{constructor(){super(...arguments),this.crypto=new zH(this._client),this.fiat=new LH(this._client)}};BH.Crypto=zH,BH.Fiat=LH;var VH=class extends $V{_claim(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/earn/ethereum/incentive/claim`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}},HH=class extends $V{constructor(){super(...arguments),this._incentive=new VH(this._client)}_deposit(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/earn/ethereum/deposit`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}_withdraw(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/earn/ethereum/withdraw`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}vaultDetails(e,t){return this._client.get(Q`/v1/earn/ethereum/vaults/${e}`,t)}vaultPosition(e,t,n){return this._client.get(Q`/v1/wallets/${e}/earn/ethereum/vaults`,{query:t,...n})}};HH.Incentive=VH;var UH=class extends $V{constructor(){super(...arguments),this._ethereum=new HH(this._client)}};UH.Ethereum=HH;var WH=class extends $V{_create(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/payout/fiat`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}},GH=class extends $V{constructor(){super(...arguments),this._fiat=new WH(this._client)}};GH.Fiat=WH;var KH=class extends $V{constructor(){super(...arguments),this.actions=new NH(this._client),this.balance=new PH(this._client),this.depositAccounts=new BH(this._client),this._earn=new UH(this._client),this._payout=new GH(this._client),this.swap=new FH(this._client),this.transactions=new IH(this._client)}create(e,t){let{"privy-idempotency-key":n,...r}=e;return this._client.post(`/v1/wallets`,{body:r,...t,headers:gH([{...n==null?void 0:{"privy-idempotency-key":n}},t?.headers])})}list(e={},t){return this._client.getAPIList(`/v1/wallets`,HV,{query:e,...t})}_attachAutomations(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.post(Q`/v1/wallets/${e}/automations/attach`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_detachAutomations(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.post(Q`/v1/wallets/${e}/automations/detach`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_export(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.post(Q`/v1/wallets/${e}/export`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}_initImport(e,t){return this._client.post(`/v1/wallets/import/init`,{body:e,...t})}_rawSign(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/raw_sign`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}_rpc(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/rpc`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}_submitImport(e,t){return this._client.post(`/v1/wallets/import/submit`,{body:e,...t})}_transfer(e,t,n){let{"privy-authorization-signature":r,"privy-idempotency-key":i,"privy-request-expiry":a,...o}=t;return this._client.post(Q`/v1/wallets/${e}/transfer`,{body:o,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-idempotency-key":i},...a==null?void 0:{"privy-request-expiry":a}},n?.headers])})}_update(e,t,n){let{"privy-authorization-signature":r,"privy-request-expiry":i,...a}=t;return this._client.patch(Q`/v1/wallets/${e}`,{body:a,...n,headers:gH([{...r==null?void 0:{"privy-authorization-signature":r},...i==null?void 0:{"privy-request-expiry":i}},n?.headers])})}archive(e,t){return this._client.post(Q`/v1/wallets/${e}/archive`,t)}assignEntity(e,t,n){return this._client.post(Q`/v1/wallets/${e}/entity`,{body:t,...n})}authenticateWithJwt(e,t){return this._client.post(`/v1/wallets/authenticate`,{body:e,...t})}createBatch(e,t){return this._client.post(`/v1/wallets/batch`,{body:e,...t})}createWalletsWithRecovery(e,t){return this._client.post(`/v1/wallets_with_recovery`,{body:e,...t})}get(e,t={},n){if(e===``)throw Error(`walletID must not be an empty string`);return this._client.get(Q`/v1/wallets/${e}`,{query:t,...n})}getWalletByAddress(e,t){return this._client.post(`/v1/wallets/address`,{body:e,...t})}};KH.Actions=NH,KH.Balance=PH,KH.DepositAccounts=BH,KH.Earn=UH,KH.Payout=GH,KH.Swap=FH,KH.Transactions=IH;var qH=class extends $V{unsafeUnwrap(e){return JSON.parse(e)}},JH=class extends $V{},YH;function XH(e){let t;return(YH??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var ZH=e=>{if(!e)return``;if(globalThis.Buffer!==void 0)return globalThis.Buffer.from(e).toString(`base64`);if(typeof e==`string`&&(e=XH(e)),typeof btoa<`u`)return btoa(String.fromCharCode.apply(null,e));throw new EB("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")},QH=e=>{if(globalThis.process!==void 0)return globalThis.process.env?.[e]?.trim()||void 0;if(globalThis.Deno!==void 0)return globalThis.Deno.env?.get?.(e)?.trim()||void 0},$H,eU,tU,nU,rU={production:`https://api.privy.io`,staging:`https://api.staging.privy.io`},iU=class{constructor({baseURL:e=QH(`PRIVY_API_BASE_URL`),appID:t=QH(`PRIVY_APP_ID`),appSecret:n=QH(`PRIVY_APP_SECRET`),...r}={}){if($H.add(this),tU.set(this,void 0),this.apps=new sH(this),this.cards=new cH(this),this.intents=new _H(this),this.keyQuorums=new vH(this),this.organizations=new wH(this),this.policies=new TH(this),this.transactions=new OH(this),this.users=new jH(this),this.walletAutomations=new MH(this),this.wallets=new KH(this),this.webhooks=new qH(this),this.accounts=new eH(this),this.aggregations=new nH(this),this.embeddedWallets=new dH(this),this.analytics=new rH(this),this.clientAuth=new lH(this),this.shared=new EH(this),this.fiat=new fH(this),this.onramps=new xH(this),this.funding=new pH(this),this.crossApp=new uH(this),this.oAuth=new bH(this),this.yield=new JH(this),this.krakenEmbed=new yH(this),this.actions=new tH(this),this.swaps=new DH(this),t===void 0)throw new EB(`The PRIVY_APP_ID environment variable is missing or empty; either provide it, or instantiate the PrivyAPI client with an appID option, like new PrivyAPI({ appID: 'My App ID' }).`);if(n===void 0)throw new EB(`The PRIVY_APP_SECRET environment variable is missing or empty; either provide it, or instantiate the PrivyAPI client with an appSecret option, like new PrivyAPI({ appSecret: 'My App Secret' }).`);let i={appID:t,appSecret:n,...r,baseURL:e,environment:r.environment??`production`};if(XB())throw new EB(`It looks like you're running in a browser-like environment, which is disabled to protect your secret API credentials from attackers. If you have a strong business need for client-side use of this API, please open a GitHub issue with your use-case and security mitigations.`);if(e&&r.environment)throw new EB("Ambiguous URL; The `baseURL` option (or PRIVY_API_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null");this.baseURL=i.baseURL||rU[i.environment||`production`],this.timeout=i.timeout??eU.DEFAULT_TIMEOUT,this.logger=i.logger??console;let a=`warn`;this.logLevel=a,this.logLevel=kV(i.logLevel,`ClientOptions.logLevel`,this)??kV(QH(`PRIVY_API_LOG`),`process.env['PRIVY_API_LOG']`,this)??a,this.fetchOptions=i.fetchOptions,this.maxRetries=i.maxRetries??2,this.fetch=i.fetch??iV(),xB(this,tU,cV,`f`);let o=QH(`PRIVY_API_CUSTOM_HEADERS`);if(o){let e={};for(let t of o.split(`
|
|
461
|
+
`)){let n=t.indexOf(`:`);n>=0&&(e[t.substring(0,n).trim()]=t.substring(n+1).trim())}i.defaultHeaders={...e,...i.defaultHeaders}}this._options=i,this.appID=t,this.appSecret=n}withOptions(e){return new this.constructor({...this._options,environment:e.environment?e.environment:void 0,baseURL:e.environment?void 0:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,appID:this.appID,appSecret:this.appSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){return!this.appID||!this.appSecret?void 0:gH([{Authorization:`Basic ${ZH(`${this.appID}:${this.appSecret}`)}`}])}stringifyQuery(e){return DV(e)}getUserAgent(){return`${this.constructor.name}/JS ${YB}`}defaultIdempotencyKey(){return`stainless-node-retry-${CB()}`}makeStatusError(e,t,n,r){return DB.generate(e,t,n,r)}buildURL(e,t,n){let r=!SB(this,$H,`m`,nU).call(this)&&n||this.baseURL,i=BB(e)?new URL(e):new URL(r+(r.endsWith(`/`)&&e.startsWith(`/`)?e.slice(1):e)),a=this.defaultQuery(),o=Object.fromEntries(i.searchParams);return(!WB(a)||!WB(o))&&(t={...o,...a,...t}),typeof t==`object`&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest(`get`,e,t)}post(e,t){return this.methodRequest(`post`,e,t)}patch(e,t){return this.methodRequest(`patch`,e,t)}put(e,t){return this.methodRequest(`put`,e,t)}delete(e,t){return this.methodRequest(`delete`,e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new RV(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,i=r.maxRetries??this.maxRetries;t??=i,await this.prepareOptions(r);let{req:a,url:o,timeout:s}=await this.buildRequest(r,{retryCount:i-t});await this.prepareRequest(a,{url:o,options:r});let c=`log_`+(Math.random()*(1<<24)|0).toString(16).padStart(6,`0`),l=n===void 0?``:`, retryOf: ${n}`,u=Date.now();if(PV(this).debug(`[${c}] sending request`,FV({retryOfRequestLogID:n,method:r.method,url:o,options:r,headers:a.headers})),r.signal?.aborted)throw new OB;let d=new AbortController,f=await this.fetchWithTimeout(o,a,s,d).catch(TB),p=Date.now();if(f instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new OB;let i=wB(f)||/timed? ?out/i.test(String(f)+(`cause`in f?String(f.cause):``));if(t)return PV(this).info(`[${c}] connection ${i?`timed out`:`failed`} - ${e}`),PV(this).debug(`[${c}] connection ${i?`timed out`:`failed`} (${e})`,FV({retryOfRequestLogID:n,url:o,durationMs:p-u,message:f.message})),this.retryRequest(r,t,n??c);throw PV(this).info(`[${c}] connection ${i?`timed out`:`failed`} - error; no more retries left`),PV(this).debug(`[${c}] connection ${i?`timed out`:`failed`} (error; no more retries left)`,FV({retryOfRequestLogID:n,url:o,durationMs:p-u,message:f.message})),i?new AB:new kB({cause:f})}let m=`[${c}${l}] ${a.method} ${o} ${f.ok?`succeeded`:`failed`} with status ${f.status} in ${p-u}ms`;if(!f.ok){let e=await this.shouldRetry(f);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await sV(f.body),PV(this).info(`${m} - ${e}`),PV(this).debug(`[${c}] response error (${e})`,FV({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),this.retryRequest(r,t,n??c,f.headers)}let i=e?`error; no more retries left`:`error; not retryable`;PV(this).info(`${m} - ${i}`);let a=await f.text().catch(e=>TB(e).message),o=qB(a),s=o?void 0:a;throw PV(this).debug(`[${c}] response error (${i})`,FV({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:s,durationMs:Date.now()-u})),this.makeStatusError(f.status,o,s,f.headers)}return PV(this).info(m),PV(this).debug(`[${c}] response start`,FV({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),{response:f,options:r,controller:d,requestLogID:c,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,n&&`then`in n?n.then(t=>({method:`get`,path:e,...t})):{method:`get`,path:e,...n})}requestAPIList(e,t){let n=this.makeRequest(t,null,void 0);return new VV(this,n,e)}async fetchWithTimeout(e,t,n,r){let{signal:i,method:a,...o}=t||{},s=this._makeAbort(r);i&&i.addEventListener(`abort`,s,{once:!0});let c=setTimeout(s,n),l=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||typeof o.body==`object`&&o.body!==null&&Symbol.asyncIterator in o.body,u={signal:r.signal,...l?{duplex:`half`}:{},method:`GET`,...o};a&&(u.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,u)}finally{clearTimeout(c)}}async shouldRetry(e){let t=e.headers.get(`x-should-retry`);return t===`true`?!0:t===`false`?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,n,r){let i,a=r?.get(`retry-after-ms`);if(a){let e=parseFloat(a);Number.isNaN(e)||(i=e)}let o=r?.get(`retry-after`);if(o&&!i){let e=parseFloat(o);i=Number.isNaN(e)?Date.parse(o)-Date.now():e*1e3}let s=r?.get(`x-ratelimit-reset`);if(s&&!i){let e=parseFloat(s);Number.isNaN(e)||(i=e*1e3-Date.now())}if(i===void 0){let n=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(t,n)}return await JB(i),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e;return Math.min(.5*2**n,8)*(1-Math.random()*.25)*1e3}async buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:i,query:a,defaultBaseURL:o}=n,s=this.buildURL(i,a,o);`timeout`in n&&KB(`timeout`,n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:c,body:l}=this.buildBody({options:n});return{req:{method:r,headers:await this.buildHeaders({options:e,method:r,bodyHeaders:c,retryCount:t}),...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:`half`},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:s,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let i={};this.idempotencyHeader&&t!==`get`&&(e.idempotencyKey||=this.defaultIdempotencyKey(),i[this.idempotencyHeader]=e.idempotencyKey);let a=gH([i,{Accept:`application/json`,"User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...rV(),"privy-app-id":this.appID},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}_makeAbort(e){return()=>e.abort()}buildBody({options:e}){let{body:t,headers:n}=e;if(!t)return t==null&&`body`in e?SB(this,tU,`f`).call(this,{body:t,headers:gH([n])}):{bodyHeaders:void 0,body:void 0};let r=gH([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t==`string`&&r.values.has(`content-type`)||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t==`object`&&(Symbol.asyncIterator in t||Symbol.iterator in t&&`next`in t&&typeof t.next==`function`)?{bodyHeaders:void 0,body:oV(t)}:typeof t==`object`&&r.values.get(`content-type`)===`application/x-www-form-urlencoded`?{bodyHeaders:{"content-type":`application/x-www-form-urlencoded`},body:this.stringifyQuery(t)}:SB(this,tU,`f`).call(this,{body:t,headers:r})}};eU=iU,tU=new WeakMap,$H=new WeakSet,nU=function(){return this.baseURL!==rU[this._options.environment||`production`]},iU.PrivyAPI=eU,iU.DEFAULT_TIMEOUT=6e4,iU.PrivyAPIError=EB,iU.APIError=DB,iU.APIConnectionError=kB,iU.APIConnectionTimeoutError=AB,iU.APIUserAbortError=OB,iU.NotFoundError=PB,iU.ConflictError=FB,iU.RateLimitError=LB,iU.BadRequestError=jB,iU.AuthenticationError=MB,iU.InternalServerError=RB,iU.PermissionDeniedError=NB,iU.UnprocessableEntityError=IB,iU.toFile=XV,iU.Apps=sH,iU.Cards=cH,iU.Intents=_H,iU.KeyQuorums=vH,iU.Organizations=wH,iU.Policies=TH,iU.Transactions=OH,iU.Users=jH,iU.WalletAutomations=MH,iU.Wallets=KH,iU.Webhooks=qH,iU.Accounts=eH,iU.Aggregations=nH,iU.EmbeddedWallets=dH,iU.Analytics=rH,iU.ClientAuth=lH,iU.Shared=EH,iU.Fiat=fH,iU.Onramps=xH,iU.Funding=pH,iU.CrossApp=uH,iU.OAuth=bH,iU.Yield=JH,iU.KrakenEmbed=yH,iU.Actions=tH,iU.Swaps=DH;var aU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationInSerializer=void 0,e.ApplicationInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}}}})),oU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationOutSerializer=void 0,e.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt}}}})),sU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationPatchSerializer=void 0,e.ApplicationPatchSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}}}})),cU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseApplicationOutSerializer=void 0;var t=oU();e.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.ApplicationOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.ApplicationOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),lU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApiException=void 0,e.ApiException=class extends Error{constructor(e,t,n){super(`HTTP-Code: ${e}\nHeaders: ${JSON.stringify(n)}`),this.code=e,this.body=t,this.headers={},n.forEach((e,t)=>{this.headers[t]=e})}}})),uU=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.SvixRequest=e.HttpMethod=e.LIB_VERSION=void 0;var n=lU();e.LIB_VERSION=`1.99.1`;function r(){var t=[`svix-libs/${e.LIB_VERSION}/javascript`];return process===void 0?(navigator==null?void 0:navigator.userAgent)!==void 0&&t.push(navigator.userAgent):(process.version!==void 0&&t.push(`node/${process.version}`),process.platform!==void 0&&process.arch!==void 0&&t.push(`${process.platform}/${process.arch}`)),t.join(` `)}(function(e){e.GET=`GET`,e.HEAD=`HEAD`,e.POST=`POST`,e.PUT=`PUT`,e.DELETE=`DELETE`,e.CONNECT=`CONNECT`,e.OPTIONS=`OPTIONS`,e.TRACE=`TRACE`,e.PATCH=`PATCH`})(e.HttpMethod||={}),e.SvixRequest=class{constructor(e,t){this.method=e,this.path=t,this.queryParams={},this.headerParams={}}setPathParam(e,t){let n=this.path.replace(`{${e}}`,encodeURIComponent(t));if(this.path===n)throw Error(`path parameter ${e} not found`);this.path=n}setQueryParams(e){for(let[t,n]of Object.entries(e))this.setQueryParam(t,n)}setQueryParam(e,t){if(t!=null){if(typeof t==`string`)this.queryParams[e]=t;else if(typeof t==`boolean`||typeof t==`number`)this.queryParams[e]=t.toString();else if(t instanceof Date)this.queryParams[e]=t.toISOString();else if(Array.isArray(t))t.length>0&&(this.queryParams[e]=t.join(`,`));else throw Error(`query parameter ${e} has unsupported type`)}}setHeaderParam(e,t){t!==void 0&&(this.headerParams[e]=t)}setBody(e){this.body=JSON.stringify(e)}send(e,n){return t(this,void 0,void 0,function*(){let t=yield this.sendInner(e);if(t.status===204)return null;let r=yield t.text();return n(JSON.parse(r))})}sendNoResponseBody(e){return t(this,void 0,void 0,function*(){yield this.sendInner(e)})}sendInner(e){return t(this,void 0,void 0,function*(){let t=new URL(e.baseUrl+this.path);for(let[e,n]of Object.entries(this.queryParams))t.searchParams.set(e,n);this.headerParams[`idempotency-key`]===void 0&&this.method.toUpperCase()===`POST`&&(this.headerParams[`idempotency-key`]=`auto_${crypto.randomUUID()}`);let n=Math.floor(Math.random()*(2**53-1));this.body!=null&&(this.headerParams[`content-type`]=`application/json`);let o=`credentials`in Request.prototype;return i(yield a(t,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:`application/json, */*;q=0.8`,authorization:`Bearer ${e.token}`,"user-agent":r(),"svix-req-id":n.toString()},this.headerParams),credentials:o?`same-origin`:void 0,signal:e.timeout===void 0?void 0:AbortSignal.timeout(e.timeout)},e.retryScheduleInMs,e.retryScheduleInMs?.[0],e.retryScheduleInMs?.length??e.numRetries,e.fetch))})}};function i(e){return t(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422||e.status>=400&&e.status<=499?new n.ApiException(e.status,JSON.parse(t),e.headers):new n.ApiException(e.status,t,e.headers)})}function a(e,n,r,i=50,o=2,s=fetch,c=1){return t(this,void 0,void 0,function*(){let t=e=>new Promise(t=>setTimeout(t,e));try{let t=yield s(e,n);if(o<=0||t.status<500)return t}catch(e){if(o<=0)throw e}return yield t(i),n.headers[`svix-retry-count`]=c.toString(),i=r?.[c]??i*2,yield a(e,n,r,i,--o,s,++c)})}})),dU=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Application=void 0;var n=aU(),r=oU(),i=sU(),a=cU(),o=uU();e.Application=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/app`);return t.setQueryParams({exclude_apps_with_no_endpoints:e?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:e?.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:e?.excludeAppsWithSvixPlayEndpoints,limit:e?.limit,iterator:e?.iterator,order:e?.order}),yield t.send(this.requestCtx,a.ListResponseApplicationOutSerializer._fromJsonObject)})}create(e,i){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/api/v1/app`);return t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(n.ApplicationInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,r.ApplicationOutSerializer._fromJsonObject)})}getOrCreate(e,t){let i=new o.SvixRequest(o.HttpMethod.POST,`/api/v1/app`);return i.setQueryParam(`get_if_exists`,!0),i.setHeaderParam(`idempotency-key`,t?.idempotencyKey),i.setBody(n.ApplicationInSerializer._toJsonObject(e)),i.send(this.requestCtx,r.ApplicationOutSerializer._fromJsonObject)}get(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/app/{app_id}`);return t.setPathParam(`app_id`,e),yield t.send(this.requestCtx,r.ApplicationOutSerializer._fromJsonObject)})}update(e,i){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PUT,`/api/v1/app/{app_id}`);return t.setPathParam(`app_id`,e),t.setBody(n.ApplicationInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,r.ApplicationOutSerializer._fromJsonObject)})}delete(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.DELETE,`/api/v1/app/{app_id}`);return t.setPathParam(`app_id`,e),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PATCH,`/api/v1/app/{app_id}`);return t.setPathParam(`app_id`,e),t.setBody(i.ApplicationPatchSerializer._toJsonObject(n)),yield t.send(this.requestCtx,r.ApplicationOutSerializer._fromJsonObject)})}}})),fU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApiTokenOutSerializer=void 0,e.ApiTokenOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),expiresAt:e.expiresAt?new Date(e.expiresAt):null,id:e.id,name:e.name,scopes:e.scopes,token:e.token}},_toJsonObject(e){return{createdAt:e.createdAt,expiresAt:e.expiresAt,id:e.id,name:e.name,scopes:e.scopes,token:e.token}}}})),pU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AppPortalCapabilitySerializer=e.AppPortalCapability=void 0,(function(e){e.ViewBase=`ViewBase`,e.ViewEndpointSecret=`ViewEndpointSecret`,e.ManageEndpointSecret=`ManageEndpointSecret`,e.ManageTransformations=`ManageTransformations`,e.CreateAttempts=`CreateAttempts`,e.ManageEndpoint=`ManageEndpoint`})(e.AppPortalCapability||={}),e.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),mU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AppPortalAccessInSerializer=void 0;var t=pU(),n=aU();e.AppPortalAccessInSerializer={_fromJsonObject(e){return{application:e.application==null?void 0:n.ApplicationInSerializer._fromJsonObject(e.application),capabilities:e.capabilities?.map(e=>t.AppPortalCapabilitySerializer._fromJsonObject(e)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){return{application:e.application==null?void 0:n.ApplicationInSerializer._toJsonObject(e.application),capabilities:e.capabilities?.map(e=>t.AppPortalCapabilitySerializer._toJsonObject(e)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}})),hU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AppPortalAccessOutSerializer=void 0,e.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}})),gU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationTokenExpireInSerializer=void 0,e.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}})),_U=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RotatePollerTokenInSerializer=void 0,e.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}})),vU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamPortalAccessInSerializer=void 0,e.StreamPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}},_toJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}}}})),yU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamTokenExpireInSerializer=void 0,e.StreamTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}})),bU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DashboardAccessOutSerializer=void 0,e.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}})),xU=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Authentication=void 0;var n=fU(),r=mU(),i=hU(),a=gU(),o=_U(),s=vU(),c=yU(),l=bU(),u=uU();e.Authentication=class{constructor(e){this.requestCtx=e}appPortalAccess(e,n={},a){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/app-portal-access/{app_id}`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),t.setBody(r.AppPortalAccessInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.AppPortalAccessOutSerializer._fromJsonObject)})}logout(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/logout`);return t.setHeaderParam(`idempotency-key`,e?.idempotencyKey),yield t.sendNoResponseBody(this.requestCtx)})}expireAll(e,n={},r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/app/{app_id}/expire-all`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(a.ApplicationTokenExpireInSerializer._toJsonObject(n)),yield t.sendNoResponseBody(this.requestCtx)})}dashboardAccess(e,t){let n=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/dashboard-access/{app_id}`);return n.setPathParam(`app_id`,e),n.setHeaderParam(`idempotency-key`,t?.idempotencyKey),n.send(this.requestCtx,l.DashboardAccessOutSerializer._fromJsonObject)}streamPortalAccess(e,n={},r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/stream-portal-access/{stream_id}`);return t.setPathParam(`stream_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(s.StreamPortalAccessInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.AppPortalAccessOutSerializer._fromJsonObject)})}streamLogout(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/stream-logout`);return t.setHeaderParam(`idempotency-key`,e?.idempotencyKey),yield t.sendNoResponseBody(this.requestCtx)})}streamExpireAll(e,n={},r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/stream/{stream_id}/expire-all`);return t.setPathParam(`stream_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(c.StreamTokenExpireInSerializer._toJsonObject(n)),yield t.sendNoResponseBody(this.requestCtx)})}rotateStreamPollerToken(e,r,i={},a){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,r),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),t.setBody(o.RotatePollerTokenInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,n.ApiTokenOutSerializer._fromJsonObject)})}getStreamPollerToken(e,r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,r),yield t.send(this.requestCtx,n.ApiTokenOutSerializer._fromJsonObject)})}}})),SU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundTaskStatusSerializer=e.BackgroundTaskStatus=void 0,(function(e){e.Running=`running`,e.Finished=`finished`,e.Failed=`failed`})(e.BackgroundTaskStatus||={}),e.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),CU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundTaskTypeSerializer=e.BackgroundTaskType=void 0,(function(e){e.EndpointReplay=`endpoint.replay`,e.EndpointRecover=`endpoint.recover`,e.ApplicationStats=`application.stats`,e.MessageBroadcast=`message.broadcast`,e.SdkGenerate=`sdk.generate`,e.EventTypeAggregate=`event-type.aggregate`,e.ApplicationPurgeContent=`application.purge_content`,e.EndpointBulkReplay=`endpoint.bulk-replay`})(e.BackgroundTaskType||={}),e.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),wU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundTaskOutSerializer=void 0;var t=SU(),n=CU();e.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{data:e.data,id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}})),TU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseBackgroundTaskOutSerializer=void 0;var t=wU();e.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.BackgroundTaskOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.BackgroundTaskOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),EU=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundTask=void 0;var n=wU(),r=TU(),i=uU();e.BackgroundTask=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.GET,`/api/v1/background-task`);return t.setQueryParams({status:e?.status,task:e?.task,limit:e?.limit,iterator:e?.iterator,order:e?.order}),yield t.send(this.requestCtx,r.ListResponseBackgroundTaskOutSerializer._fromJsonObject)})}listByEndpoint(e){return this.list(e)}get(e){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.GET,`/api/v1/background-task/{task_id}`);return t.setPathParam(`task_id`,e),yield t.send(this.requestCtx,n.BackgroundTaskOutSerializer._fromJsonObject)})}}})),DU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorKindSerializer=e.ConnectorKind=void 0,(function(e){e.Custom=`Custom`,e.AgenticCommerceProtocol=`AgenticCommerceProtocol`,e.CloseCrm=`CloseCRM`,e.CustomerIo=`CustomerIO`,e.Discord=`Discord`,e.Hubspot=`Hubspot`,e.Inngest=`Inngest`,e.Loops=`Loops`,e.Otel=`Otel`,e.Resend=`Resend`,e.Salesforce=`Salesforce`,e.Segment=`Segment`,e.Sendgrid=`Sendgrid`,e.Slack=`Slack`,e.Teams=`Teams`,e.TriggerDev=`TriggerDev`,e.Windmill=`Windmill`,e.Zapier=`Zapier`})(e.ConnectorKind||={}),e.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),OU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorProductSerializer=e.ConnectorProduct=void 0,(function(e){e.Dispatch=`Dispatch`,e.Stream=`Stream`})(e.ConnectorProduct||={}),e.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),kU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorInSerializer=void 0;var t=DU(),n=OU();e.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,productType:e.productType==null?void 0:n.ConnectorProductSerializer._fromJsonObject(e.productType),transformation:e.transformation,uid:e.uid}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,productType:e.productType==null?void 0:n.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,uid:e.uid}}}})),AU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorOutSerializer=void 0;var t=DU(),n=OU();e.ConnectorOutSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:new Date(e.createdAt),description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:t.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:n.ConnectorProductSerializer._fromJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:new Date(e.transformationUpdatedAt),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:e.createdAt,description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:t.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:n.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}})),jU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorPatchSerializer=void 0;var t=DU();e.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,transformation:e.transformation}}}})),MU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorUpdateSerializer=void 0;var t=DU();e.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind==null?void 0:t.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,transformation:e.transformation}}}})),NU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseConnectorOutSerializer=void 0;var t=AU();e.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.ConnectorOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.ConnectorOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),PU=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Connector=void 0;var n=kU(),r=AU(),i=jU(),a=MU(),o=NU(),s=uU();e.Connector=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/connector`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order,product_type:e?.productType}),yield t.send(this.requestCtx,o.ListResponseConnectorOutSerializer._fromJsonObject)})}create(e,i){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.POST,`/api/v1/connector`);return t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(n.ConnectorInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,r.ConnectorOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/connector/{connector_id}`);return t.setPathParam(`connector_id`,e),yield t.send(this.requestCtx,r.ConnectorOutSerializer._fromJsonObject)})}update(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.PUT,`/api/v1/connector/{connector_id}`);return t.setPathParam(`connector_id`,e),t.setBody(a.ConnectorUpdateSerializer._toJsonObject(n)),yield t.send(this.requestCtx,r.ConnectorOutSerializer._fromJsonObject)})}delete(e){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.DELETE,`/api/v1/connector/{connector_id}`);return t.setPathParam(`connector_id`,e),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.PATCH,`/api/v1/connector/{connector_id}`);return t.setPathParam(`connector_id`,e),t.setBody(i.ConnectorPatchSerializer._toJsonObject(n)),yield t.send(this.requestCtx,r.ConnectorOutSerializer._fromJsonObject)})}}})),FU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageStatusSerializer=e.MessageStatus=void 0,(function(e){e[e.Success=0]=`Success`,e[e.Pending=1]=`Pending`,e[e.Fail=2]=`Fail`,e[e.Sending=3]=`Sending`,e[e.Canceled=4]=`Canceled`})(e.MessageStatus||={}),e.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),IU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatusCodeClassSerializer=e.StatusCodeClass=void 0,(function(e){e[e.CodeNone=0]=`CodeNone`,e[e.Code1xx=100]=`Code1xx`,e[e.Code2xx=200]=`Code2xx`,e[e.Code3xx=300]=`Code3xx`,e[e.Code4xx=400]=`Code4xx`,e[e.Code5xx=500]=`Code5xx`})(e.StatusCodeClass||={}),e.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),LU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BulkReplayInSerializer=void 0;var t=FU(),n=IU();e.BulkReplayInSerializer={_fromJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:new Date(e.since),status:e.status==null?void 0:t.MessageStatusSerializer._fromJsonObject(e.status),statusCodeClass:e.statusCodeClass==null?void 0:n.StatusCodeClassSerializer._fromJsonObject(e.statusCodeClass),tag:e.tag,until:e.until?new Date(e.until):null}},_toJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:e.since,status:e.status==null?void 0:t.MessageStatusSerializer._toJsonObject(e.status),statusCodeClass:e.statusCodeClass==null?void 0:n.StatusCodeClassSerializer._toJsonObject(e.statusCodeClass),tag:e.tag,until:e.until}}}})),RU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointHeadersInSerializer=void 0,e.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}})),zU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointHeadersOutSerializer=void 0,e.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}})),BU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointHeadersPatchInSerializer=void 0,e.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}})),VU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointInSerializer=void 0,e.EndpointInSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}})),HU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointOutSerializer=void 0,e.EndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}})),UU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointPatchSerializer=void 0,e.EndpointPatchSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}})),WU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointSecretOutSerializer=void 0,e.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),GU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointSecretRotateInSerializer=void 0,e.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{gracePeriodSeconds:e.gracePeriodSeconds,key:e.key}},_toJsonObject(e){return{gracePeriodSeconds:e.gracePeriodSeconds,key:e.key}}}})),KU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointStatsSerializer=void 0,e.EndpointStatsSerializer={_fromJsonObject(e){return{canceled:e.canceled,fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}},_toJsonObject(e){return{canceled:e.canceled,fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}}}})),qU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointTransformationInSerializer=void 0,e.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}})),JU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointTransformationOutSerializer=void 0,e.EndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt?new Date(e.updatedAt):null,variables:e.variables}},_toJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt,variables:e.variables}}}})),YU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointTransformationPatchSerializer=void 0,e.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled,variables:e.variables}},_toJsonObject(e){return{code:e.code,enabled:e.enabled,variables:e.variables}}}})),XU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointUpdateSerializer=void 0,e.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}})),ZU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventExampleInSerializer=void 0,e.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}})),QU=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseEndpointOutSerializer=void 0;var t=HU();e.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.EndpointOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.EndpointOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),$U=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageOutSerializer=void 0,e.MessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}})),eW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RecoverInSerializer=void 0,e.RecoverInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}})),tW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RecoverOutSerializer=void 0;var t=SU(),n=CU();e.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}})),nW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReplayInSerializer=void 0,e.ReplayInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}})),rW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReplayOutSerializer=void 0;var t=SU(),n=CU();e.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}})),iW=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Endpoint=void 0;var n=LU(),r=RU(),i=zU(),a=BU(),o=VU(),s=HU(),c=UU(),l=WU(),u=GU(),d=KU(),f=qU(),p=JU(),m=YU(),h=XU(),g=ZU(),_=QU(),v=$U(),y=eW(),b=tW(),x=nW(),S=rW(),C=uU();e.Endpoint=class{constructor(e){this.requestCtx=e}list(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint`);return t.setPathParam(`app_id`,e),t.setQueryParams({limit:n?.limit,iterator:n?.iterator,order:n?.order}),yield t.send(this.requestCtx,_.ListResponseEndpointOutSerializer._fromJsonObject)})}create(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(o.EndpointInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,s.EndpointOutSerializer._fromJsonObject)})}get(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,s.EndpointOutSerializer._fromJsonObject)})}update(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PUT,`/api/v1/app/{app_id}/endpoint/{endpoint_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(h.EndpointUpdateSerializer._toJsonObject(r)),yield t.send(this.requestCtx,s.EndpointOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.DELETE,`/api/v1/app/{app_id}/endpoint/{endpoint_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PATCH,`/api/v1/app/{app_id}/endpoint/{endpoint_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(c.EndpointPatchSerializer._toJsonObject(r)),yield t.send(this.requestCtx,s.EndpointOutSerializer._fromJsonObject)})}getSecret(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,l.EndpointSecretOutSerializer._fromJsonObject)})}rotateSecret(e,n,r={},i){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(u.EndpointSecretRotateInSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}getHeaders(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,i.EndpointHeadersOutSerializer._fromJsonObject)})}updateHeaders(e,n,i){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PUT,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(r.EndpointHeadersInSerializer._toJsonObject(i)),yield t.sendNoResponseBody(this.requestCtx)})}headersUpdate(e,t,n){return this.updateHeaders(e,t,n)}patchHeaders(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PATCH,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(a.EndpointHeadersPatchInSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}headersPatch(e,t,n){return this.patchHeaders(e,t,n)}transformationGet(e,n){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,p.EndpointTransformationOutSerializer._fromJsonObject)})}patchTransformation(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PATCH,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(m.EndpointTransformationPatchSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}replayMissing(e,n,r,i){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(x.ReplayInSerializer._toJsonObject(r)),yield t.send(this.requestCtx,S.ReplayOutSerializer._fromJsonObject)})}bulkReplay(e,r,i,a){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,r),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),t.setBody(n.BulkReplayInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,S.ReplayOutSerializer._fromJsonObject)})}getStats(e,n,r){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setQueryParams({since:r?.since,until:r?.until}),yield t.send(this.requestCtx,d.EndpointStatsSerializer._fromJsonObject)})}recover(e,n,r,i){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(y.RecoverInSerializer._toJsonObject(r)),yield t.send(this.requestCtx,b.RecoverOutSerializer._fromJsonObject)})}sendExample(e,n,r,i){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.POST,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(g.EventExampleInSerializer._toJsonObject(r)),yield t.send(this.requestCtx,v.MessageOutSerializer._fromJsonObject)})}transformationPartialUpdate(e,n,r={}){return t(this,void 0,void 0,function*(){let t=new C.SvixRequest(C.HttpMethod.PATCH,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(f.EndpointTransformationInSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}}})),aW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeInSerializer=void 0,e.EventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}})),oW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EnvironmentInSerializer=void 0;var t=kU(),n=aW();e.EnvironmentInSerializer={_fromJsonObject(e){return{connectors:e.connectors?.map(e=>t.ConnectorInSerializer._fromJsonObject(e)),eventTypes:e.eventTypes?.map(e=>n.EventTypeInSerializer._fromJsonObject(e)),settings:e.settings}},_toJsonObject(e){return{connectors:e.connectors?.map(e=>t.ConnectorInSerializer._toJsonObject(e)),eventTypes:e.eventTypes?.map(e=>n.EventTypeInSerializer._toJsonObject(e)),settings:e.settings}}}})),sW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeOutSerializer=void 0,e.EventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:e.updatedAt}}}})),cW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EnvironmentOutSerializer=void 0;var t=AU(),n=sW();e.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(e=>t.ConnectorOutSerializer._fromJsonObject(e)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(e=>n.EventTypeOutSerializer._fromJsonObject(e)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(e=>t.ConnectorOutSerializer._toJsonObject(e)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(e=>n.EventTypeOutSerializer._toJsonObject(e)),settings:e.settings,version:e.version}}}})),lW=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Environment=void 0;var n=oW(),r=cW(),i=uU();e.Environment=class{constructor(e){this.requestCtx=e}export(e){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.POST,`/api/v1/environment/export`);return t.setHeaderParam(`idempotency-key`,e?.idempotencyKey),yield t.send(this.requestCtx,r.EnvironmentOutSerializer._fromJsonObject)})}import(e={},r){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.POST,`/api/v1/environment/import`);return t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(n.EnvironmentInSerializer._toJsonObject(e)),yield t.sendNoResponseBody(this.requestCtx)})}}})),uW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeImportOpenApiInSerializer=void 0,e.EventTypeImportOpenApiInSerializer={_fromJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}},_toJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}}}})),dW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeFromOpenApiSerializer=void 0,e.EventTypeFromOpenApiSerializer={_fromJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}})),fW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeImportOpenApiOutDataSerializer=void 0;var t=dW();e.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){return{modified:e.modified,toModify:e.to_modify?.map(e=>t.EventTypeFromOpenApiSerializer._fromJsonObject(e))}},_toJsonObject(e){return{modified:e.modified,to_modify:e.toModify?.map(e=>t.EventTypeFromOpenApiSerializer._toJsonObject(e))}}}})),pW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeImportOpenApiOutSerializer=void 0;var t=fW();e.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:t.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:t.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}})),mW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypePatchSerializer=void 0,e.EventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}})),hW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTypeUpdateSerializer=void 0,e.EventTypeUpdateSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}})),gW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseEventTypeOutSerializer=void 0;var t=sW();e.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.EventTypeOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.EventTypeOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),_W=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EventType=void 0;var n=uW(),r=pW(),i=aW(),a=sW(),o=mW(),s=hW(),c=gW(),l=uU();e.EventType=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.GET,`/api/v1/event-type`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order,include_archived:e?.includeArchived,with_content:e?.withContent}),yield t.send(this.requestCtx,c.ListResponseEventTypeOutSerializer._fromJsonObject)})}create(e,n){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.POST,`/api/v1/event-type`);return t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),t.setBody(i.EventTypeInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,a.EventTypeOutSerializer._fromJsonObject)})}importOpenapi(e={},i){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.POST,`/api/v1/event-type/import/openapi`);return t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(n.EventTypeImportOpenApiInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,r.EventTypeImportOpenApiOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.GET,`/api/v1/event-type/{event_type_name}`);return t.setPathParam(`event_type_name`,e),yield t.send(this.requestCtx,a.EventTypeOutSerializer._fromJsonObject)})}update(e,n){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.PUT,`/api/v1/event-type/{event_type_name}`);return t.setPathParam(`event_type_name`,e),t.setBody(s.EventTypeUpdateSerializer._toJsonObject(n)),yield t.send(this.requestCtx,a.EventTypeOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.DELETE,`/api/v1/event-type/{event_type_name}`);return t.setPathParam(`event_type_name`,e),t.setQueryParams({expunge:n?.expunge}),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.PATCH,`/api/v1/event-type/{event_type_name}`);return t.setPathParam(`event_type_name`,e),t.setBody(o.EventTypePatchSerializer._toJsonObject(n)),yield t.send(this.requestCtx,a.EventTypeOutSerializer._fromJsonObject)})}}})),vW=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Health=void 0;var n=uU();e.Health=class{constructor(e){this.requestCtx=e}get(){return t(this,void 0,void 0,function*(){return yield new n.SvixRequest(n.HttpMethod.GET,`/api/v1/health`).sendNoResponseBody(this.requestCtx)})}}})),yW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestSourceConsumerPortalAccessInSerializer=void 0,e.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}})),bW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointHeadersInSerializer=void 0,e.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}})),xW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointHeadersOutSerializer=void 0,e.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}})),SW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointInSerializer=void 0,e.IngestEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url}}}})),CW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointOutSerializer=void 0,e.IngestEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}})),wW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointSecretInSerializer=void 0,e.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),TW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointSecretOutSerializer=void 0,e.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),EW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointTransformationOutSerializer=void 0,e.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}})),DW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointTransformationPatchSerializer=void 0,e.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}})),OW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpointUpdateSerializer=void 0,e.IngestEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url}}}})),kW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseIngestEndpointOutSerializer=void 0;var t=CW();e.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.IngestEndpointOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.IngestEndpointOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),AW=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.IngestEndpoint=void 0;var n=bW(),r=xW(),i=SW(),a=CW(),o=wW(),s=TW(),c=EW(),l=DW(),u=OW(),d=kW(),f=uU();e.IngestEndpoint=class{constructor(e){this.requestCtx=e}list(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.GET,`/ingest/api/v1/source/{source_id}/endpoint`);return t.setPathParam(`source_id`,e),t.setQueryParams({limit:n?.limit,iterator:n?.iterator,order:n?.order}),yield t.send(this.requestCtx,d.ListResponseIngestEndpointOutSerializer._fromJsonObject)})}create(e,n,r){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.POST,`/ingest/api/v1/source/{source_id}/endpoint`);return t.setPathParam(`source_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(i.IngestEndpointInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,a.IngestEndpointOutSerializer._fromJsonObject)})}get(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.GET,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,a.IngestEndpointOutSerializer._fromJsonObject)})}update(e,n,r){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.PUT,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(u.IngestEndpointUpdateSerializer._toJsonObject(r)),yield t.send(this.requestCtx,a.IngestEndpointOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.DELETE,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),yield t.sendNoResponseBody(this.requestCtx)})}getSecret(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.GET,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,s.IngestEndpointSecretOutSerializer._fromJsonObject)})}rotateSecret(e,n,r={},i){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.POST,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(o.IngestEndpointSecretInSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}getHeaders(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.GET,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,r.IngestEndpointHeadersOutSerializer._fromJsonObject)})}updateHeaders(e,r,i){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.PUT,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,r),t.setBody(n.IngestEndpointHeadersInSerializer._toJsonObject(i)),yield t.sendNoResponseBody(this.requestCtx)})}getTransformation(e,n){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.GET,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),yield t.send(this.requestCtx,c.IngestEndpointTransformationOutSerializer._fromJsonObject)})}setTransformation(e,n,r){return t(this,void 0,void 0,function*(){let t=new f.SvixRequest(f.HttpMethod.PATCH,`/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`source_id`,e),t.setPathParam(`endpoint_id`,n),t.setBody(l.IngestEndpointTransformationPatchSerializer._toJsonObject(r)),yield t.sendNoResponseBody(this.requestCtx)})}}})),jW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AdobeSignConfigSerializer=void 0,e.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}})),MW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AirwallexConfigSerializer=void 0,e.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),NW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CheckbookConfigSerializer=void 0,e.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),PW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronConfigSerializer=void 0,e.CronConfigSerializer={_fromJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}},_toJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}}}})),FW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DocusignConfigSerializer=void 0,e.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),IW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EasypostConfigSerializer=void 0,e.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),LW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GithubConfigSerializer=void 0,e.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),RW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HubspotConfigSerializer=void 0,e.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),zW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetaConfigSerializer=void 0,e.MetaConfigSerializer={_fromJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}},_toJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}}}})),BW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NangoConfigSerializer=void 0,e.NangoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),VW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OpenClawConfigSerializer=void 0,e.OpenClawConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),HW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrumIoConfigSerializer=void 0,e.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}})),UW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PandaDocConfigSerializer=void 0,e.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),WW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PortIoConfigSerializer=void 0,e.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),GW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RutterConfigSerializer=void 0,e.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),KW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentConfigSerializer=void 0,e.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),qW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShopifyConfigSerializer=void 0,e.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),JW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SlackConfigSerializer=void 0,e.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),YW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StripeConfigSerializer=void 0,e.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),XW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SvixConfigSerializer=void 0,e.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),ZW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TailscaleConfigSerializer=void 0,e.TailscaleConfigSerializer={_fromJsonObject(e){return{secret:e.secret,timestampGraceSeconds:e.timestampGraceSeconds}},_toJsonObject(e){return{secret:e.secret,timestampGraceSeconds:e.timestampGraceSeconds}}}})),QW=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TelnyxConfigSerializer=void 0,e.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}})),$W=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VapiConfigSerializer=void 0,e.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),eG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VeriffConfigSerializer=void 0,e.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),tG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VgsConfigSerializer=void 0,e.VgsConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),nG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ZoomConfigSerializer=void 0,e.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}})),rG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestSourceInSerializer=void 0;var t=jW(),n=MW(),r=NW(),i=PW(),a=FW(),o=IW(),s=LW(),c=RW(),l=zW(),u=BW(),d=VW(),f=HW(),p=UW(),m=WW(),h=GW(),g=KW(),_=qW(),v=JW(),y=YW(),b=XW(),x=ZW(),S=QW(),C=$W(),w=eG(),E=tG(),D=nG();e.IngestSourceInSerializer={_fromJsonObject(e){let O=e.type;function k(O){switch(O){case`generic-webhook`:return{};case`cron`:return i.CronConfigSerializer._fromJsonObject(e.config);case`adobe-sign`:return t.AdobeSignConfigSerializer._fromJsonObject(e.config);case`beehiiv`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`brex`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`checkbook`:return r.CheckbookConfigSerializer._fromJsonObject(e.config);case`clerk`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`docusign`:return a.DocusignConfigSerializer._fromJsonObject(e.config);case`easypost`:return o.EasypostConfigSerializer._fromJsonObject(e.config);case`github`:return s.GithubConfigSerializer._fromJsonObject(e.config);case`guesty`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`hubspot`:return c.HubspotConfigSerializer._fromJsonObject(e.config);case`incident-io`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`lithic`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`meta`:return l.MetaConfigSerializer._fromJsonObject(e.config);case`nango`:return u.NangoConfigSerializer._fromJsonObject(e.config);case`nash`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`openclaw`:return d.OpenClawConfigSerializer._fromJsonObject(e.config);case`orum-io`:return f.OrumIoConfigSerializer._fromJsonObject(e.config);case`panda-doc`:return p.PandaDocConfigSerializer._fromJsonObject(e.config);case`port-io`:return m.PortIoConfigSerializer._fromJsonObject(e.config);case`pleo`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`psi-fi`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`replicate`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`resend`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`rutter`:return h.RutterConfigSerializer._fromJsonObject(e.config);case`safebase`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`sardine`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`segment`:return g.SegmentConfigSerializer._fromJsonObject(e.config);case`shopify`:return _.ShopifyConfigSerializer._fromJsonObject(e.config);case`slack`:return v.SlackConfigSerializer._fromJsonObject(e.config);case`stripe`:return y.StripeConfigSerializer._fromJsonObject(e.config);case`stych`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`svix`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`zoom`:return D.ZoomConfigSerializer._fromJsonObject(e.config);case`tailscale`:return x.TailscaleConfigSerializer._fromJsonObject(e.config);case`telnyx`:return S.TelnyxConfigSerializer._fromJsonObject(e.config);case`vapi`:return C.VapiConfigSerializer._fromJsonObject(e.config);case`open-ai`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`render`:return b.SvixConfigSerializer._fromJsonObject(e.config);case`veriff`:return w.VeriffConfigSerializer._fromJsonObject(e.config);case`airwallex`:return n.AirwallexConfigSerializer._fromJsonObject(e.config);case`vgs`:return E.VgsConfigSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${O}`)}}return{type:O,config:k(O),metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){let O;switch(e.type){case`generic-webhook`:O={};break;case`cron`:O=i.CronConfigSerializer._toJsonObject(e.config);break;case`adobe-sign`:O=t.AdobeSignConfigSerializer._toJsonObject(e.config);break;case`beehiiv`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`brex`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`checkbook`:O=r.CheckbookConfigSerializer._toJsonObject(e.config);break;case`clerk`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`docusign`:O=a.DocusignConfigSerializer._toJsonObject(e.config);break;case`easypost`:O=o.EasypostConfigSerializer._toJsonObject(e.config);break;case`github`:O=s.GithubConfigSerializer._toJsonObject(e.config);break;case`guesty`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`hubspot`:O=c.HubspotConfigSerializer._toJsonObject(e.config);break;case`incident-io`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`lithic`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`meta`:O=l.MetaConfigSerializer._toJsonObject(e.config);break;case`nango`:O=u.NangoConfigSerializer._toJsonObject(e.config);break;case`nash`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`openclaw`:O=d.OpenClawConfigSerializer._toJsonObject(e.config);break;case`orum-io`:O=f.OrumIoConfigSerializer._toJsonObject(e.config);break;case`panda-doc`:O=p.PandaDocConfigSerializer._toJsonObject(e.config);break;case`port-io`:O=m.PortIoConfigSerializer._toJsonObject(e.config);break;case`pleo`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`psi-fi`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`replicate`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`resend`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`rutter`:O=h.RutterConfigSerializer._toJsonObject(e.config);break;case`safebase`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`sardine`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`segment`:O=g.SegmentConfigSerializer._toJsonObject(e.config);break;case`shopify`:O=_.ShopifyConfigSerializer._toJsonObject(e.config);break;case`slack`:O=v.SlackConfigSerializer._toJsonObject(e.config);break;case`stripe`:O=y.StripeConfigSerializer._toJsonObject(e.config);break;case`stych`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`svix`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`zoom`:O=D.ZoomConfigSerializer._toJsonObject(e.config);break;case`tailscale`:O=x.TailscaleConfigSerializer._toJsonObject(e.config);break;case`telnyx`:O=S.TelnyxConfigSerializer._toJsonObject(e.config);break;case`vapi`:O=C.VapiConfigSerializer._toJsonObject(e.config);break;case`open-ai`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`render`:O=b.SvixConfigSerializer._toJsonObject(e.config);break;case`veriff`:O=w.VeriffConfigSerializer._toJsonObject(e.config);break;case`airwallex`:O=n.AirwallexConfigSerializer._toJsonObject(e.config);break;case`vgs`:O=E.VgsConfigSerializer._toJsonObject(e.config)}return{type:e.type,config:O,metadata:e.metadata,name:e.name,uid:e.uid}}}})),iG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AdobeSignConfigOutSerializer=void 0,e.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),aG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AirwallexConfigOutSerializer=void 0,e.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),oG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CheckbookConfigOutSerializer=void 0,e.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),sG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DocusignConfigOutSerializer=void 0,e.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),cG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EasypostConfigOutSerializer=void 0,e.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),lG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GithubConfigOutSerializer=void 0,e.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),uG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HubspotConfigOutSerializer=void 0,e.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),dG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetaConfigOutSerializer=void 0,e.MetaConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),fG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NangoConfigOutSerializer=void 0,e.NangoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),pG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OpenClawConfigOutSerializer=void 0,e.OpenClawConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),mG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrumIoConfigOutSerializer=void 0,e.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}})),hG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PandaDocConfigOutSerializer=void 0,e.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),gG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PortIoConfigOutSerializer=void 0,e.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),_G=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RutterConfigOutSerializer=void 0,e.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),vG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentConfigOutSerializer=void 0,e.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),yG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShopifyConfigOutSerializer=void 0,e.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),bG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SlackConfigOutSerializer=void 0,e.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),xG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StripeConfigOutSerializer=void 0,e.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),SG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SvixConfigOutSerializer=void 0,e.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),CG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TailscaleConfigOutSerializer=void 0,e.TailscaleConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),wG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TelnyxConfigOutSerializer=void 0,e.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}})),TG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VapiConfigOutSerializer=void 0,e.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),EG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VeriffConfigOutSerializer=void 0,e.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),DG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VgsConfigOutSerializer=void 0,e.VgsConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),OG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ZoomConfigOutSerializer=void 0,e.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),kG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IngestSourceOutSerializer=void 0;var t=iG(),n=aG(),r=oG(),i=PW(),a=sG(),o=cG(),s=lG(),c=uG(),l=dG(),u=fG(),d=pG(),f=mG(),p=hG(),m=gG(),h=_G(),g=vG(),_=yG(),v=bG(),y=xG(),b=SG(),x=CG(),S=wG(),C=TG(),w=EG(),E=DG(),D=OG();e.IngestSourceOutSerializer={_fromJsonObject(e){let O=e.type;function k(O){switch(O){case`generic-webhook`:return{};case`cron`:return i.CronConfigSerializer._fromJsonObject(e.config);case`adobe-sign`:return t.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case`beehiiv`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`brex`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`checkbook`:return r.CheckbookConfigOutSerializer._fromJsonObject(e.config);case`clerk`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`docusign`:return a.DocusignConfigOutSerializer._fromJsonObject(e.config);case`easypost`:return o.EasypostConfigOutSerializer._fromJsonObject(e.config);case`github`:return s.GithubConfigOutSerializer._fromJsonObject(e.config);case`guesty`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`hubspot`:return c.HubspotConfigOutSerializer._fromJsonObject(e.config);case`incident-io`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`lithic`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`meta`:return l.MetaConfigOutSerializer._fromJsonObject(e.config);case`nango`:return u.NangoConfigOutSerializer._fromJsonObject(e.config);case`nash`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`openclaw`:return d.OpenClawConfigOutSerializer._fromJsonObject(e.config);case`orum-io`:return f.OrumIoConfigOutSerializer._fromJsonObject(e.config);case`panda-doc`:return p.PandaDocConfigOutSerializer._fromJsonObject(e.config);case`port-io`:return m.PortIoConfigOutSerializer._fromJsonObject(e.config);case`psi-fi`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`pleo`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`replicate`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`resend`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`rutter`:return h.RutterConfigOutSerializer._fromJsonObject(e.config);case`safebase`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`sardine`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`segment`:return g.SegmentConfigOutSerializer._fromJsonObject(e.config);case`shopify`:return _.ShopifyConfigOutSerializer._fromJsonObject(e.config);case`slack`:return v.SlackConfigOutSerializer._fromJsonObject(e.config);case`stripe`:return y.StripeConfigOutSerializer._fromJsonObject(e.config);case`stych`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`svix`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`zoom`:return D.ZoomConfigOutSerializer._fromJsonObject(e.config);case`tailscale`:return x.TailscaleConfigOutSerializer._fromJsonObject(e.config);case`telnyx`:return S.TelnyxConfigOutSerializer._fromJsonObject(e.config);case`vapi`:return C.VapiConfigOutSerializer._fromJsonObject(e.config);case`open-ai`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`render`:return b.SvixConfigOutSerializer._fromJsonObject(e.config);case`veriff`:return w.VeriffConfigOutSerializer._fromJsonObject(e.config);case`airwallex`:return n.AirwallexConfigOutSerializer._fromJsonObject(e.config);case`vgs`:return E.VgsConfigOutSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${O}`)}}return{type:O,config:k(O),createdAt:new Date(e.createdAt),id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let O;switch(e.type){case`generic-webhook`:O={};break;case`cron`:O=i.CronConfigSerializer._toJsonObject(e.config);break;case`adobe-sign`:O=t.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case`beehiiv`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`brex`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`checkbook`:O=r.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case`clerk`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`docusign`:O=a.DocusignConfigOutSerializer._toJsonObject(e.config);break;case`easypost`:O=o.EasypostConfigOutSerializer._toJsonObject(e.config);break;case`github`:O=s.GithubConfigOutSerializer._toJsonObject(e.config);break;case`guesty`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`hubspot`:O=c.HubspotConfigOutSerializer._toJsonObject(e.config);break;case`incident-io`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`lithic`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`meta`:O=l.MetaConfigOutSerializer._toJsonObject(e.config);break;case`nango`:O=u.NangoConfigOutSerializer._toJsonObject(e.config);break;case`nash`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`openclaw`:O=d.OpenClawConfigOutSerializer._toJsonObject(e.config);break;case`orum-io`:O=f.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case`panda-doc`:O=p.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case`port-io`:O=m.PortIoConfigOutSerializer._toJsonObject(e.config);break;case`psi-fi`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`pleo`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`replicate`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`resend`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`rutter`:O=h.RutterConfigOutSerializer._toJsonObject(e.config);break;case`safebase`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`sardine`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`segment`:O=g.SegmentConfigOutSerializer._toJsonObject(e.config);break;case`shopify`:O=_.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case`slack`:O=v.SlackConfigOutSerializer._toJsonObject(e.config);break;case`stripe`:O=y.StripeConfigOutSerializer._toJsonObject(e.config);break;case`stych`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`svix`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`zoom`:O=D.ZoomConfigOutSerializer._toJsonObject(e.config);break;case`tailscale`:O=x.TailscaleConfigOutSerializer._toJsonObject(e.config);break;case`telnyx`:O=S.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case`vapi`:O=C.VapiConfigOutSerializer._toJsonObject(e.config);break;case`open-ai`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`render`:O=b.SvixConfigOutSerializer._toJsonObject(e.config);break;case`veriff`:O=w.VeriffConfigOutSerializer._toJsonObject(e.config);break;case`airwallex`:O=n.AirwallexConfigOutSerializer._toJsonObject(e.config);break;case`vgs`:O=E.VgsConfigOutSerializer._toJsonObject(e.config)}return{type:e.type,config:O,createdAt:e.createdAt,id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}})),AG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseIngestSourceOutSerializer=void 0;var t=kG();e.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.IngestSourceOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.IngestSourceOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),jG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RotateTokenOutSerializer=void 0,e.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}})),MG=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.IngestSource=void 0;var n=rG(),r=kG(),i=AG(),a=jG(),o=uU();e.IngestSource=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/ingest/api/v1/source`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order}),yield t.send(this.requestCtx,i.ListResponseIngestSourceOutSerializer._fromJsonObject)})}create(e,i){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/ingest/api/v1/source`);return t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),t.setBody(n.IngestSourceInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,r.IngestSourceOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/ingest/api/v1/source/{source_id}`);return t.setPathParam(`source_id`,e),yield t.send(this.requestCtx,r.IngestSourceOutSerializer._fromJsonObject)})}update(e,i){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PUT,`/ingest/api/v1/source/{source_id}`);return t.setPathParam(`source_id`,e),t.setBody(n.IngestSourceInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,r.IngestSourceOutSerializer._fromJsonObject)})}delete(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.DELETE,`/ingest/api/v1/source/{source_id}`);return t.setPathParam(`source_id`,e),yield t.sendNoResponseBody(this.requestCtx)})}rotateToken(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/ingest/api/v1/source/{source_id}/token/rotate`);return t.setPathParam(`source_id`,e),t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),yield t.send(this.requestCtx,a.RotateTokenOutSerializer._fromJsonObject)})}}})),NG=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Ingest=void 0;var n=bU(),r=yW(),i=AW(),a=MG(),o=uU();e.Ingest=class{constructor(e){this.requestCtx=e}get endpoint(){return new i.IngestEndpoint(this.requestCtx)}get source(){return new a.IngestSource(this.requestCtx)}dashboard(e,i={},a){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/ingest/api/v1/source/{source_id}/dashboard`);return t.setPathParam(`source_id`,e),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),t.setBody(r.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,n.DashboardAccessOutSerializer._fromJsonObject)})}}})),PG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationInSerializer=void 0,e.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}})),FG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationKeyOutSerializer=void 0,e.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),IG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationOutSerializer=void 0,e.IntegrationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:e.updatedAt}}}})),LG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationUpdateSerializer=void 0,e.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}})),RG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseIntegrationOutSerializer=void 0;var t=IG();e.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.IntegrationOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.IntegrationOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),zG=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Integration=void 0;var n=PG(),r=FG(),i=IG(),a=LG(),o=RG(),s=uU();e.Integration=class{constructor(e){this.requestCtx=e}list(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/integration`);return t.setPathParam(`app_id`,e),t.setQueryParams({limit:n?.limit,iterator:n?.iterator,order:n?.order}),yield t.send(this.requestCtx,o.ListResponseIntegrationOutSerializer._fromJsonObject)})}create(e,r,a){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.POST,`/api/v1/app/{app_id}/integration`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),t.setBody(n.IntegrationInSerializer._toJsonObject(r)),yield t.send(this.requestCtx,i.IntegrationOutSerializer._fromJsonObject)})}get(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/integration/{integ_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`integ_id`,n),yield t.send(this.requestCtx,i.IntegrationOutSerializer._fromJsonObject)})}update(e,n,r){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.PUT,`/api/v1/app/{app_id}/integration/{integ_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`integ_id`,n),t.setBody(a.IntegrationUpdateSerializer._toJsonObject(r)),yield t.send(this.requestCtx,i.IntegrationOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.DELETE,`/api/v1/app/{app_id}/integration/{integ_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`integ_id`,n),yield t.sendNoResponseBody(this.requestCtx)})}rotateKey(e,n,i){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.POST,`/api/v1/app/{app_id}/integration/{integ_id}/key/rotate`);return t.setPathParam(`app_id`,e),t.setPathParam(`integ_id`,n),t.setHeaderParam(`idempotency-key`,i?.idempotencyKey),yield t.send(this.requestCtx,r.IntegrationKeyOutSerializer._fromJsonObject)})}getKey(e,n){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/integration/{integ_id}/key`);return t.setPathParam(`app_id`,e),t.setPathParam(`integ_id`,n),yield t.send(this.requestCtx,r.IntegrationKeyOutSerializer._fromJsonObject)})}}})),BG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExpungeAllContentsOutSerializer=void 0;var t=SU(),n=CU();e.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}})),VG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseMessageOutSerializer=void 0;var t=$U();e.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.MessageOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.MessageOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),HG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessagePrecheckInSerializer=void 0,e.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}})),UG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessagePrecheckOutSerializer=void 0,e.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}})),WG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollingEndpointConsumerSeekInSerializer=void 0,e.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}})),GG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollingEndpointConsumerSeekOutSerializer=void 0,e.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}})),KG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollingEndpointMessageOutSerializer=void 0,e.PollingEndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}})),qG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollingEndpointOutSerializer=void 0;var t=KG();e.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.PollingEndpointMessageOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(e=>t.PollingEndpointMessageOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator}}}})),JG=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.MessagePoller=void 0;var n=WG(),r=GG(),i=qG(),a=uU();e.MessagePoller=class{constructor(e){this.requestCtx=e}poll(e,n,r){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.GET,`/api/v1/app/{app_id}/poller/{sink_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`sink_id`,n),t.setQueryParams({limit:r?.limit,iterator:r?.iterator,event_type:r?.eventType,channel:r?.channel,after:r?.after}),yield t.send(this.requestCtx,i.PollingEndpointOutSerializer._fromJsonObject)})}consumerSeek(e,i,o,s,c){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.POST,`/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek`);return t.setPathParam(`app_id`,e),t.setPathParam(`sink_id`,i),t.setPathParam(`consumer_id`,o),t.setHeaderParam(`idempotency-key`,c?.idempotencyKey),t.setBody(n.PollingEndpointConsumerSeekInSerializer._toJsonObject(s)),yield t.send(this.requestCtx,r.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)})}consumerPoll(e,n,r,o){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.GET,`/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`sink_id`,n),t.setPathParam(`consumer_id`,r),t.setQueryParams({limit:o?.limit,iterator:o?.iterator}),yield t.send(this.requestCtx,i.PollingEndpointOutSerializer._fromJsonObject)})}}})),YG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageInSerializer=void 0;var t=aU();e.MessageInSerializer={_fromJsonObject(e){return{application:e.application==null?void 0:t.ApplicationInSerializer._fromJsonObject(e.application),channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}},_toJsonObject(e){return{application:e.application==null?void 0:t.ApplicationInSerializer._toJsonObject(e.application),channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}}}})),XG=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.messageInRaw=e.Message=void 0;var n=BG(),r=VG(),i=$U(),a=HG(),o=UG(),s=JG(),c=uU(),l=YG();e.Message=class{constructor(e){this.requestCtx=e}get poller(){return new s.MessagePoller(this.requestCtx)}list(e,n){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.GET,`/api/v1/app/{app_id}/msg`);return t.setPathParam(`app_id`,e),t.setQueryParams({limit:n?.limit,iterator:n?.iterator,channel:n?.channel,before:n?.before,after:n?.after,with_content:n?.withContent,tag:n?.tag,event_types:n?.eventTypes}),yield t.send(this.requestCtx,r.ListResponseMessageOutSerializer._fromJsonObject)})}create(e,n,r){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.POST,`/api/v1/app/{app_id}/msg`);t.setPathParam(`app_id`,e),t.setQueryParams({with_content:!1}),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(l.MessageInSerializer._toJsonObject(n));let a=yield t.send(this.requestCtx,i.MessageOutSerializer._fromJsonObject);return(r?.withContent??!0)&&(a.payload=n.payload),a})}precheck(e,n,r){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.POST,`/api/v1/app/{app_id}/msg/precheck/active`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(a.MessagePrecheckInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,o.MessagePrecheckOutSerializer._fromJsonObject)})}get(e,n,r){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.GET,`/api/v1/app/{app_id}/msg/{msg_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),t.setQueryParams({with_content:r?.withContent}),yield t.send(this.requestCtx,i.MessageOutSerializer._fromJsonObject)})}expungeContent(e,n){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.DELETE,`/api/v1/app/{app_id}/msg/{msg_id}/content`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),yield t.sendNoResponseBody(this.requestCtx)})}expungeAllContents(e,r){return t(this,void 0,void 0,function*(){let t=new c.SvixRequest(c.HttpMethod.POST,`/api/v1/app/{app_id}/msg/expunge-all-contents`);return t.setPathParam(`app_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),yield t.send(this.requestCtx,n.ExpungeAllContentsOutSerializer._fromJsonObject)})}};function u(e,t,n){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:n?{"content-type":n}:void 0}}}e.messageInRaw=u})),ZG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyResponseSerializer=void 0,e.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),QG=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageStatusTextSerializer=e.MessageStatusText=void 0,(function(e){e.Success=`success`,e.Pending=`pending`,e.Fail=`fail`,e.Sending=`sending`,e.Canceled=`canceled`})(e.MessageStatusText||={}),e.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),$G=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointMessageOutSerializer=void 0;var t=FU(),n=QG();e.EndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,payload:e.payload,status:t.MessageStatusSerializer._fromJsonObject(e.status),statusText:n.MessageStatusTextSerializer._fromJsonObject(e.statusText),tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt,payload:e.payload,status:t.MessageStatusSerializer._toJsonObject(e.status),statusText:n.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}})),eK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseEndpointMessageOutSerializer=void 0;var t=$G();e.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.EndpointMessageOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.EndpointMessageOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),tK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageAttemptTriggerTypeSerializer=e.MessageAttemptTriggerType=void 0,(function(e){e[e.Scheduled=0]=`Scheduled`,e[e.Manual=1]=`Manual`})(e.MessageAttemptTriggerType||={}),e.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),nK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageAttemptOutSerializer=void 0;var t=tK(),n=$U(),r=FU(),i=QG();e.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg==null?void 0:n.MessageOutSerializer._fromJsonObject(e.msg),msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:r.MessageStatusSerializer._fromJsonObject(e.status),statusText:i.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:t.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg==null?void 0:n.MessageOutSerializer._toJsonObject(e.msg),msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:r.MessageStatusSerializer._toJsonObject(e.status),statusText:i.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:t.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}})),rK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseMessageAttemptOutSerializer=void 0;var t=nK();e.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.MessageAttemptOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.MessageAttemptOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),iK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageEndpointOutSerializer=void 0;var t=FU(),n=QG();e.MessageEndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,rateLimit:e.rateLimit,status:t.MessageStatusSerializer._fromJsonObject(e.status),statusText:n.MessageStatusTextSerializer._fromJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt,rateLimit:e.rateLimit,status:t.MessageStatusSerializer._toJsonObject(e.status),statusText:n.MessageStatusTextSerializer._toJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}})),aK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseMessageEndpointOutSerializer=void 0;var t=iK();e.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.MessageEndpointOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.MessageEndpointOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),oK=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.MessageAttempt=void 0;var n=ZG(),r=eK(),i=rK(),a=aK(),o=nK(),s=uU();e.MessageAttempt=class{constructor(e){this.requestCtx=e}listByEndpoint(e,n,r){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setQueryParams({limit:r?.limit,iterator:r?.iterator,status:r?.status,status_code_class:r?.statusCodeClass,channel:r?.channel,tag:r?.tag,before:r?.before,after:r?.after,with_content:r?.withContent,with_msg:r?.withMsg,expanded_statuses:r?.expandedStatuses??!0,event_types:r?.eventTypes}),yield t.send(this.requestCtx,i.ListResponseMessageAttemptOutSerializer._fromJsonObject)})}listByMsg(e,n,r){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/attempt/msg/{msg_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),t.setQueryParams({limit:r?.limit,iterator:r?.iterator,status:r?.status,status_code_class:r?.statusCodeClass,channel:r?.channel,tag:r?.tag,endpoint_id:r?.endpointId,before:r?.before,after:r?.after,with_content:r?.withContent,expanded_statuses:r?.expandedStatuses??!0,event_types:r?.eventTypes}),yield t.send(this.requestCtx,i.ListResponseMessageAttemptOutSerializer._fromJsonObject)})}listAttemptedMessages(e,n,i){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,n),t.setQueryParams({limit:i?.limit,iterator:i?.iterator,channel:i?.channel,tag:i?.tag,status:i?.status,before:i?.before,after:i?.after,with_content:i?.withContent,expanded_statuses:i?.expandedStatuses??!0,event_types:i?.eventTypes}),yield t.send(this.requestCtx,r.ListResponseEndpointMessageOutSerializer._fromJsonObject)})}listAttemptedDestinations(e,n,r){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/msg/{msg_id}/endpoint`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),t.setQueryParams({limit:r?.limit,iterator:r?.iterator}),yield t.send(this.requestCtx,a.ListResponseMessageEndpointOutSerializer._fromJsonObject)})}get(e,n,r,i){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.GET,`/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),t.setPathParam(`attempt_id`,r),t.setQueryParams({expanded_statuses:i?.expandedStatuses??!0}),yield t.send(this.requestCtx,o.MessageAttemptOutSerializer._fromJsonObject)})}expungeContent(e,n,r){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.DELETE,`/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,n),t.setPathParam(`attempt_id`,r),yield t.sendNoResponseBody(this.requestCtx)})}resend(e,r,i,a){return t(this,void 0,void 0,function*(){let t=new s.SvixRequest(s.HttpMethod.POST,`/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend`);return t.setPathParam(`app_id`,e),t.setPathParam(`msg_id`,r),t.setPathParam(`endpoint_id`,i),t.setHeaderParam(`idempotency-key`,a?.idempotencyKey),yield t.send(this.requestCtx,n.EmptyResponseSerializer._fromJsonObject)})}}})),sK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointOutSerializer=void 0,e.OperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}})),cK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var t=sK();e.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.OperationalWebhookEndpointOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.OperationalWebhookEndpointOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),lK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointHeadersInSerializer=void 0,e.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}})),uK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointHeadersOutSerializer=void 0,e.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}})),dK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointInSerializer=void 0,e.OperationalWebhookEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url}}}})),fK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointSecretInSerializer=void 0,e.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),pK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointSecretOutSerializer=void 0,e.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),mK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpointUpdateSerializer=void 0,e.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url}}}})),hK=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhookEndpoint=void 0;var n=cK(),r=lK(),i=uK(),a=dK(),o=sK(),s=fK(),c=pK(),l=mK(),u=uU();e.OperationalWebhookEndpoint=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/operational-webhook/endpoint`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order}),yield t.send(this.requestCtx,n.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)})}create(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/operational-webhook/endpoint`);return t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),t.setBody(a.OperationalWebhookEndpointInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,o.OperationalWebhookEndpointOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/operational-webhook/endpoint/{endpoint_id}`);return t.setPathParam(`endpoint_id`,e),yield t.send(this.requestCtx,o.OperationalWebhookEndpointOutSerializer._fromJsonObject)})}update(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.PUT,`/api/v1/operational-webhook/endpoint/{endpoint_id}`);return t.setPathParam(`endpoint_id`,e),t.setBody(l.OperationalWebhookEndpointUpdateSerializer._toJsonObject(n)),yield t.send(this.requestCtx,o.OperationalWebhookEndpointOutSerializer._fromJsonObject)})}delete(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.DELETE,`/api/v1/operational-webhook/endpoint/{endpoint_id}`);return t.setPathParam(`endpoint_id`,e),yield t.sendNoResponseBody(this.requestCtx)})}getSecret(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/operational-webhook/endpoint/{endpoint_id}/secret`);return t.setPathParam(`endpoint_id`,e),yield t.send(this.requestCtx,c.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)})}rotateSecret(e,n={},r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate`);return t.setPathParam(`endpoint_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(s.OperationalWebhookEndpointSecretInSerializer._toJsonObject(n)),yield t.sendNoResponseBody(this.requestCtx)})}getHeaders(e){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/operational-webhook/endpoint/{endpoint_id}/headers`);return t.setPathParam(`endpoint_id`,e),yield t.send(this.requestCtx,i.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)})}updateHeaders(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.PUT,`/api/v1/operational-webhook/endpoint/{endpoint_id}/headers`);return t.setPathParam(`endpoint_id`,e),t.setBody(r.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(n)),yield t.sendNoResponseBody(this.requestCtx)})}}})),gK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OperationalWebhook=void 0;var t=hK();e.OperationalWebhook=class{constructor(e){this.requestCtx=e}get endpoint(){return new t.OperationalWebhookEndpoint(this.requestCtx)}}})),_K=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregateEventTypesOutSerializer=void 0;var t=SU(),n=CU();e.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}})),vK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AppUsageStatsInSerializer=void 0,e.AppUsageStatsInSerializer={_fromJsonObject(e){return{appIds:e.appIds,since:new Date(e.since),until:new Date(e.until)}},_toJsonObject(e){return{appIds:e.appIds,since:e.since,until:e.until}}}})),yK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AppUsageStatsOutSerializer=void 0;var t=SU(),n=CU();e.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:t.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:n.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:e.updatedAt}}}})),bK=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Statistics=void 0;var n=_K(),r=vK(),i=yK(),a=uU();e.Statistics=class{constructor(e){this.requestCtx=e}aggregateEventTypes(){return t(this,void 0,void 0,function*(){return yield new a.SvixRequest(a.HttpMethod.PUT,`/api/v1/stats/usage/event-types`).send(this.requestCtx,n.AggregateEventTypesOutSerializer._fromJsonObject)})}aggregateAppStats(e,n){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.POST,`/api/v1/stats/usage/app`);return t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),t.setBody(r.AppUsageStatsInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,i.AppUsageStatsOutSerializer._fromJsonObject)})}}})),xK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HttpSinkHeadersPatchInSerializer=void 0,e.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}})),SK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkTransformationOutSerializer=void 0,e.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}})),CK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamEventTypeOutSerializer=void 0,e.StreamEventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:e.updatedAt}}}})),wK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseStreamEventTypeOutSerializer=void 0;var t=CK();e.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.StreamEventTypeOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.StreamEventTypeOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),TK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamEventTypeInSerializer=void 0,e.StreamEventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}})),EK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamEventTypePatchSerializer=void 0,e.StreamEventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags}}}})),DK=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingEventType=void 0;var n=wK(),r=TK(),i=CK(),a=EK(),o=uU();e.StreamingEventType=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/stream/event-type`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order,include_archived:e?.includeArchived}),yield t.send(this.requestCtx,n.ListResponseStreamEventTypeOutSerializer._fromJsonObject)})}create(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/api/v1/stream/event-type`);return t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),t.setBody(r.StreamEventTypeInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,i.StreamEventTypeOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/stream/event-type/{name}`);return t.setPathParam(`name`,e),yield t.send(this.requestCtx,i.StreamEventTypeOutSerializer._fromJsonObject)})}update(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PUT,`/api/v1/stream/event-type/{name}`);return t.setPathParam(`name`,e),t.setBody(r.StreamEventTypeInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.StreamEventTypeOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.DELETE,`/api/v1/stream/event-type/{name}`);return t.setPathParam(`name`,e),t.setQueryParams({expunge:n?.expunge}),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PATCH,`/api/v1/stream/event-type/{name}`);return t.setPathParam(`name`,e),t.setBody(a.StreamEventTypePatchSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.StreamEventTypeOutSerializer._fromJsonObject)})}}})),OK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventInSerializer=void 0,e.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}})),kK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamInSerializer=void 0,e.StreamInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}}}})),AK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CreateStreamEventsInSerializer=void 0;var t=OK(),n=kK();e.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(e=>t.EventInSerializer._fromJsonObject(e)),stream:e.stream==null?void 0:n.StreamInSerializer._fromJsonObject(e.stream)}},_toJsonObject(e){return{events:e.events.map(e=>t.EventInSerializer._toJsonObject(e)),stream:e.stream==null?void 0:n.StreamInSerializer._toJsonObject(e.stream)}}}})),jK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CreateStreamEventsOutSerializer=void 0,e.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}})),MK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventOutSerializer=void 0,e.EventOutSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:e.timestamp}}}})),NK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventStreamOutSerializer=void 0;var t=MK();e.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.EventOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(e=>t.EventOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator}}}})),PK=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingEvents=void 0;var n=AK(),r=jK(),i=NK(),a=uU();e.StreamingEvents=class{constructor(e){this.requestCtx=e}get(e,n,r){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink/{sink_id}/events`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),t.setQueryParams({limit:r?.limit,iterator:r?.iterator,after:r?.after}),yield t.send(this.requestCtx,i.EventStreamOutSerializer._fromJsonObject)})}create(e,i,o){return t(this,void 0,void 0,function*(){let t=new a.SvixRequest(a.HttpMethod.POST,`/api/v1/stream/{stream_id}/events`);return t.setPathParam(`stream_id`,e),t.setHeaderParam(`idempotency-key`,o?.idempotencyKey),t.setBody(n.CreateStreamEventsInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,r.CreateStreamEventsOutSerializer._fromJsonObject)})}}})),FK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AzureBlobStorageConfigSerializer=void 0,e.AzureBlobStorageConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}})),IK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BigQueryConfigSerializer=void 0,e.BigQueryConfigSerializer={_fromJsonObject(e){return{credentials:e.credentials,datasetId:e.datasetId,projectId:e.projectId,tableId:e.tableId}},_toJsonObject(e){return{credentials:e.credentials,datasetId:e.datasetId,projectId:e.projectId,tableId:e.tableId}}}})),LK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ClickhouseConfigSerializer=void 0,e.ClickhouseConfigSerializer={_fromJsonObject(e){return{database:e.database,password:e.password,tableName:e.tableName,url:e.url,username:e.username}},_toJsonObject(e){return{database:e.database,password:e.password,tableName:e.tableName,url:e.url,username:e.username}}}})),RK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventBridgeConfigSerializer=void 0,e.EventBridgeConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,detailType:e.detailType,eventBusName:e.eventBusName,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,detailType:e.detailType,eventBusName:e.eventBusName,region:e.region,secretAccessKey:e.secretAccessKey}}}})),zK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleCloudPubSubConfigSerializer=void 0,e.GoogleCloudPubSubConfigSerializer={_fromJsonObject(e){return{credentials:e.credentials,projectId:e.projectId,topicId:e.topicId}},_toJsonObject(e){return{credentials:e.credentials,projectId:e.projectId,topicId:e.topicId}}}})),BK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleCloudStorageConfigSerializer=void 0,e.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}})),VK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RabbitMqConfigSerializer=void 0,e.RabbitMqConfigSerializer={_fromJsonObject(e){return{routingKey:e.routingKey,uri:e.uri}},_toJsonObject(e){return{routingKey:e.routingKey,uri:e.uri}}}})),HK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RedshiftConfigSerializer=void 0,e.RedshiftConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,clusterIdentifier:e.clusterIdentifier,dbName:e.dbName,dbUser:e.dbUser,region:e.region,schemaName:e.schemaName,secretAccessKey:e.secretAccessKey,tableName:e.tableName,workgroupName:e.workgroupName}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,clusterIdentifier:e.clusterIdentifier,dbName:e.dbName,dbUser:e.dbUser,region:e.region,schemaName:e.schemaName,secretAccessKey:e.secretAccessKey,tableName:e.tableName,workgroupName:e.workgroupName}}}})),UK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.S3ConfigSerializer=void 0,e.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}})),WK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkHttpConfigSerializer=void 0,e.SinkHttpConfigSerializer={_fromJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}},_toJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}}}})),GK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkOtelV1ConfigSerializer=void 0,e.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}})),KK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkStatusSerializer=e.SinkStatus=void 0,(function(e){e.Enabled=`enabled`,e.Paused=`paused`,e.Disabled=`disabled`,e.Retrying=`retrying`})(e.SinkStatus||={}),e.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),qK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SnowflakeConfigSerializer=void 0,e.SnowflakeConfigSerializer={_fromJsonObject(e){return{accountIdentifier:e.accountIdentifier,dbName:e.dbName,privateKey:e.privateKey,schemaName:e.schemaName,tableName:e.tableName,userId:e.userId}},_toJsonObject(e){return{accountIdentifier:e.accountIdentifier,dbName:e.dbName,privateKey:e.privateKey,schemaName:e.schemaName,tableName:e.tableName,userId:e.userId}}}})),JK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SnsConfigSerializer=void 0,e.SnsConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey,topicArn:e.topicArn}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey,topicArn:e.topicArn}}}})),YK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SqsConfigSerializer=void 0,e.SqsConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,queueUrl:e.queueUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,queueUrl:e.queueUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}})),XK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamSinkOutSerializer=void 0;var t=FK(),n=IK(),r=LK(),i=RK(),a=zK(),o=BK(),s=VK(),c=HK(),l=UK(),u=WK(),d=GK(),f=KK(),p=qK(),m=JK(),h=YK();e.StreamSinkOutSerializer={_fromJsonObject(e){let g=e.type;function _(f){switch(f){case`poller`:return{};case`azureBlobStorage`:return t.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case`otelTracing`:return d.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case`http`:return u.SinkHttpConfigSerializer._fromJsonObject(e.config);case`amazonS3`:return l.S3ConfigSerializer._fromJsonObject(e.config);case`googleCloudStorage`:return o.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);case`googleCloudPubSub`:return a.GoogleCloudPubSubConfigSerializer._fromJsonObject(e.config);case`sqs`:return h.SqsConfigSerializer._fromJsonObject(e.config);case`sns`:return m.SnsConfigSerializer._fromJsonObject(e.config);case`bigQuery`:return n.BigQueryConfigSerializer._fromJsonObject(e.config);case`clickhouse`:return r.ClickhouseConfigSerializer._fromJsonObject(e.config);case`eventBridge`:return i.EventBridgeConfigSerializer._fromJsonObject(e.config);case`snowflake`:return p.SnowflakeConfigSerializer._fromJsonObject(e.config);case`rabbitMq`:return s.RabbitMqConfigSerializer._fromJsonObject(e.config);case`redshift`:return c.RedshiftConfigSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${f}`)}}return{type:g,config:_(g),batchSize:e.batchSize,createdAt:new Date(e.createdAt),currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt?new Date(e.nextRetryAt):null,status:f.SinkStatusSerializer._fromJsonObject(e.status),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let g;switch(e.type){case`poller`:g={};break;case`azureBlobStorage`:g=t.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case`otelTracing`:g=d.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case`http`:g=u.SinkHttpConfigSerializer._toJsonObject(e.config);break;case`amazonS3`:g=l.S3ConfigSerializer._toJsonObject(e.config);break;case`googleCloudStorage`:g=o.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break;case`googleCloudPubSub`:g=a.GoogleCloudPubSubConfigSerializer._toJsonObject(e.config);break;case`sqs`:g=h.SqsConfigSerializer._toJsonObject(e.config);break;case`sns`:g=m.SnsConfigSerializer._toJsonObject(e.config);break;case`bigQuery`:g=n.BigQueryConfigSerializer._toJsonObject(e.config);break;case`clickhouse`:g=r.ClickhouseConfigSerializer._toJsonObject(e.config);break;case`eventBridge`:g=i.EventBridgeConfigSerializer._toJsonObject(e.config);break;case`snowflake`:g=p.SnowflakeConfigSerializer._toJsonObject(e.config);break;case`rabbitMq`:g=s.RabbitMqConfigSerializer._toJsonObject(e.config);break;case`redshift`:g=c.RedshiftConfigSerializer._toJsonObject(e.config)}return{type:e.type,config:g,batchSize:e.batchSize,createdAt:e.createdAt,currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt,status:f.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}})),ZK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseStreamSinkOutSerializer=void 0;var t=XK();e.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.StreamSinkOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.StreamSinkOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),QK=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkSecretOutSerializer=void 0,e.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}})),$K=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkTransformInSerializer=void 0,e.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}})),eq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkStatusInSerializer=e.SinkStatusIn=void 0,(function(e){e.Enabled=`enabled`,e.Disabled=`disabled`})(e.SinkStatusIn||={}),e.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),tq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamSinkInSerializer=void 0;var t=FK(),n=IK(),r=LK(),i=RK(),a=zK(),o=BK(),s=VK(),c=HK(),l=UK(),u=WK(),d=GK(),f=eq(),p=qK(),m=JK(),h=YK();e.StreamSinkInSerializer={_fromJsonObject(e){let g=e.type;function _(f){switch(f){case`poller`:return{};case`azureBlobStorage`:return t.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case`otelTracing`:return d.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case`http`:return u.SinkHttpConfigSerializer._fromJsonObject(e.config);case`amazonS3`:return l.S3ConfigSerializer._fromJsonObject(e.config);case`googleCloudStorage`:return o.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);case`googleCloudPubSub`:return a.GoogleCloudPubSubConfigSerializer._fromJsonObject(e.config);case`sqs`:return h.SqsConfigSerializer._fromJsonObject(e.config);case`sns`:return m.SnsConfigSerializer._fromJsonObject(e.config);case`bigQuery`:return n.BigQueryConfigSerializer._fromJsonObject(e.config);case`clickhouse`:return r.ClickhouseConfigSerializer._fromJsonObject(e.config);case`eventBridge`:return i.EventBridgeConfigSerializer._fromJsonObject(e.config);case`snowflake`:return p.SnowflakeConfigSerializer._fromJsonObject(e.config);case`rabbitMq`:return s.RabbitMqConfigSerializer._fromJsonObject(e.config);case`redshift`:return c.RedshiftConfigSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${f}`)}}return{type:g,config:_(g),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status==null?void 0:f.SinkStatusInSerializer._fromJsonObject(e.status),uid:e.uid}},_toJsonObject(e){let g;switch(e.type){case`poller`:g={};break;case`azureBlobStorage`:g=t.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case`otelTracing`:g=d.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case`http`:g=u.SinkHttpConfigSerializer._toJsonObject(e.config);break;case`amazonS3`:g=l.S3ConfigSerializer._toJsonObject(e.config);break;case`googleCloudStorage`:g=o.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break;case`googleCloudPubSub`:g=a.GoogleCloudPubSubConfigSerializer._toJsonObject(e.config);break;case`sqs`:g=h.SqsConfigSerializer._toJsonObject(e.config);break;case`sns`:g=m.SnsConfigSerializer._toJsonObject(e.config);break;case`bigQuery`:g=n.BigQueryConfigSerializer._toJsonObject(e.config);break;case`clickhouse`:g=r.ClickhouseConfigSerializer._toJsonObject(e.config);break;case`eventBridge`:g=i.EventBridgeConfigSerializer._toJsonObject(e.config);break;case`snowflake`:g=p.SnowflakeConfigSerializer._toJsonObject(e.config);break;case`rabbitMq`:g=s.RabbitMqConfigSerializer._toJsonObject(e.config);break;case`redshift`:g=c.RedshiftConfigSerializer._toJsonObject(e.config)}return{type:e.type,config:g,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status==null?void 0:f.SinkStatusInSerializer._toJsonObject(e.status),uid:e.uid}}}})),nq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AmazonS3PatchConfigSerializer=void 0,e.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}})),rq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AzureBlobStoragePatchConfigSerializer=void 0,e.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}})),iq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BigQueryPatchConfigSerializer=void 0,e.BigQueryPatchConfigSerializer={_fromJsonObject(e){return{credentials:e.credentials,datasetId:e.datasetId,projectId:e.projectId,tableId:e.tableId}},_toJsonObject(e){return{credentials:e.credentials,datasetId:e.datasetId,projectId:e.projectId,tableId:e.tableId}}}})),aq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ClickhousePatchConfigSerializer=void 0,e.ClickhousePatchConfigSerializer={_fromJsonObject(e){return{database:e.database,password:e.password,tableName:e.tableName,url:e.url,username:e.username}},_toJsonObject(e){return{database:e.database,password:e.password,tableName:e.tableName,url:e.url,username:e.username}}}})),oq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventBridgePatchConfigSerializer=void 0,e.EventBridgePatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,detailType:e.detailType,eventBusName:e.eventBusName,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,detailType:e.detailType,eventBusName:e.eventBusName,region:e.region,secretAccessKey:e.secretAccessKey}}}})),sq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleCloudPubSubPatchConfigSerializer=void 0,e.GoogleCloudPubSubPatchConfigSerializer={_fromJsonObject(e){return{credentials:e.credentials,projectId:e.projectId,topicId:e.topicId}},_toJsonObject(e){return{credentials:e.credentials,projectId:e.projectId,topicId:e.topicId}}}})),cq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleCloudStoragePatchConfigSerializer=void 0,e.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}})),lq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HttpPatchConfigSerializer=void 0,e.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}})),uq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OtelTracingPatchConfigSerializer=void 0,e.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}})),dq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RabbitMqPatchConfigSerializer=void 0,e.RabbitMqPatchConfigSerializer={_fromJsonObject(e){return{routingKey:e.routingKey,uri:e.uri}},_toJsonObject(e){return{routingKey:e.routingKey,uri:e.uri}}}})),fq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RedshiftPatchConfigSerializer=void 0,e.RedshiftPatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,dbName:e.dbName,region:e.region,schemaName:e.schemaName,secretAccessKey:e.secretAccessKey,tableName:e.tableName}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,dbName:e.dbName,region:e.region,schemaName:e.schemaName,secretAccessKey:e.secretAccessKey,tableName:e.tableName}}}})),pq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SnowflakePatchConfigSerializer=void 0,e.SnowflakePatchConfigSerializer={_fromJsonObject(e){return{accountIdentifier:e.accountIdentifier,dbName:e.dbName,privateKey:e.privateKey,schemaName:e.schemaName,tableName:e.tableName,userId:e.userId}},_toJsonObject(e){return{accountIdentifier:e.accountIdentifier,dbName:e.dbName,privateKey:e.privateKey,schemaName:e.schemaName,tableName:e.tableName,userId:e.userId}}}})),mq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SnsPatchConfigSerializer=void 0,e.SnsPatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey,topicArn:e.topicArn}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey,topicArn:e.topicArn}}}})),hq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SqsPatchConfigSerializer=void 0,e.SqsPatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,queueUrl:e.queueUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,endpointUrl:e.endpointUrl,queueUrl:e.queueUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}})),gq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamSinkPatchSerializer=void 0;var t=nq(),n=rq(),r=iq(),i=aq(),a=oq(),o=sq(),s=cq(),c=lq(),l=uq(),u=dq(),d=fq(),f=eq(),p=pq(),m=mq(),h=hq();e.StreamSinkPatchSerializer={_fromJsonObject(e){let g=e.type;function _(f){switch(f){case`poller`:return{};case`azureBlobStorage`:return n.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case`otelTracing`:return l.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case`http`:return c.HttpPatchConfigSerializer._fromJsonObject(e.config);case`amazonS3`:return t.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case`googleCloudStorage`:return s.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(e.config);case`googleCloudPubSub`:return o.GoogleCloudPubSubPatchConfigSerializer._fromJsonObject(e.config);case`sqs`:return h.SqsPatchConfigSerializer._fromJsonObject(e.config);case`sns`:return m.SnsPatchConfigSerializer._fromJsonObject(e.config);case`bigQuery`:return r.BigQueryPatchConfigSerializer._fromJsonObject(e.config);case`clickhouse`:return i.ClickhousePatchConfigSerializer._fromJsonObject(e.config);case`eventBridge`:return a.EventBridgePatchConfigSerializer._fromJsonObject(e.config);case`snowflake`:return p.SnowflakePatchConfigSerializer._fromJsonObject(e.config);case`rabbitMq`:return u.RabbitMqPatchConfigSerializer._fromJsonObject(e.config);case`redshift`:return d.RedshiftPatchConfigSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${f}`)}}return{type:g,config:_(g),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status==null?void 0:f.SinkStatusInSerializer._fromJsonObject(e.status),uid:e.uid}},_toJsonObject(e){let g;switch(e.type){case`poller`:g={};break;case`azureBlobStorage`:g=n.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case`otelTracing`:g=l.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case`http`:g=c.HttpPatchConfigSerializer._toJsonObject(e.config);break;case`amazonS3`:g=t.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case`googleCloudStorage`:g=s.GoogleCloudStoragePatchConfigSerializer._toJsonObject(e.config);break;case`googleCloudPubSub`:g=o.GoogleCloudPubSubPatchConfigSerializer._toJsonObject(e.config);break;case`sqs`:g=h.SqsPatchConfigSerializer._toJsonObject(e.config);break;case`sns`:g=m.SnsPatchConfigSerializer._toJsonObject(e.config);break;case`bigQuery`:g=r.BigQueryPatchConfigSerializer._toJsonObject(e.config);break;case`clickhouse`:g=i.ClickhousePatchConfigSerializer._toJsonObject(e.config);break;case`eventBridge`:g=a.EventBridgePatchConfigSerializer._toJsonObject(e.config);break;case`snowflake`:g=p.SnowflakePatchConfigSerializer._toJsonObject(e.config);break;case`rabbitMq`:g=u.RabbitMqPatchConfigSerializer._toJsonObject(e.config);break;case`redshift`:g=d.RedshiftPatchConfigSerializer._toJsonObject(e.config)}return{type:e.type,config:g,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status==null?void 0:f.SinkStatusInSerializer._toJsonObject(e.status),uid:e.uid}}}})),_q=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingSink=void 0;var n=ZG(),r=GU(),i=ZK(),a=QK(),o=$K(),s=tq(),c=XK(),l=gq(),u=uU();e.StreamingSink=class{constructor(e){this.requestCtx=e}list(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink`);return t.setPathParam(`stream_id`,e),t.setQueryParams({limit:n?.limit,iterator:n?.iterator,order:n?.order}),yield t.send(this.requestCtx,i.ListResponseStreamSinkOutSerializer._fromJsonObject)})}create(e,n,r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/stream/{stream_id}/sink`);return t.setPathParam(`stream_id`,e),t.setHeaderParam(`idempotency-key`,r?.idempotencyKey),t.setBody(s.StreamSinkInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,c.StreamSinkOutSerializer._fromJsonObject)})}get(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink/{sink_id}`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),yield t.send(this.requestCtx,c.StreamSinkOutSerializer._fromJsonObject)})}update(e,n,r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.PUT,`/api/v1/stream/{stream_id}/sink/{sink_id}`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),t.setBody(s.StreamSinkInSerializer._toJsonObject(r)),yield t.send(this.requestCtx,c.StreamSinkOutSerializer._fromJsonObject)})}delete(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.DELETE,`/api/v1/stream/{stream_id}/sink/{sink_id}`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n,r){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.PATCH,`/api/v1/stream/{stream_id}/sink/{sink_id}`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),t.setBody(l.StreamSinkPatchSerializer._toJsonObject(r)),yield t.send(this.requestCtx,c.StreamSinkOutSerializer._fromJsonObject)})}transformationPartialUpdate(e,r,i={}){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.PATCH,`/api/v1/stream/{stream_id}/sink/{sink_id}/transformation`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,r),t.setBody(o.SinkTransformInSerializer._toJsonObject(i)),yield t.send(this.requestCtx,n.EmptyResponseSerializer._fromJsonObject)})}getSecret(e,n){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink/{sink_id}/secret`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),yield t.send(this.requestCtx,a.SinkSecretOutSerializer._fromJsonObject)})}rotateSecret(e,i,a={},o){return t(this,void 0,void 0,function*(){let t=new u.SvixRequest(u.HttpMethod.POST,`/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,i),t.setHeaderParam(`idempotency-key`,o?.idempotencyKey),t.setBody(r.EndpointSecretRotateInSerializer._toJsonObject(a)),yield t.send(this.requestCtx,n.EmptyResponseSerializer._fromJsonObject)})}}})),vq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamOutSerializer=void 0,e.StreamOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}})),yq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ListResponseStreamOutSerializer=void 0;var t=vq();e.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.StreamOutSerializer._fromJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(e=>t.StreamOutSerializer._toJsonObject(e)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}})),bq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamPatchSerializer=void 0,e.StreamPatchSerializer={_fromJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}},_toJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}}}})),xq=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingStream=void 0;var n=yq(),r=kK(),i=vq(),a=bq(),o=uU();e.StreamingStream=class{constructor(e){this.requestCtx=e}list(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/stream`);return t.setQueryParams({limit:e?.limit,iterator:e?.iterator,order:e?.order}),yield t.send(this.requestCtx,n.ListResponseStreamOutSerializer._fromJsonObject)})}create(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.POST,`/api/v1/stream`);return t.setHeaderParam(`idempotency-key`,n?.idempotencyKey),t.setBody(r.StreamInSerializer._toJsonObject(e)),yield t.send(this.requestCtx,i.StreamOutSerializer._fromJsonObject)})}get(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.GET,`/api/v1/stream/{stream_id}`);return t.setPathParam(`stream_id`,e),yield t.send(this.requestCtx,i.StreamOutSerializer._fromJsonObject)})}update(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PUT,`/api/v1/stream/{stream_id}`);return t.setPathParam(`stream_id`,e),t.setBody(r.StreamInSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.StreamOutSerializer._fromJsonObject)})}delete(e){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.DELETE,`/api/v1/stream/{stream_id}`);return t.setPathParam(`stream_id`,e),yield t.sendNoResponseBody(this.requestCtx)})}patch(e,n){return t(this,void 0,void 0,function*(){let t=new o.SvixRequest(o.HttpMethod.PATCH,`/api/v1/stream/{stream_id}`);return t.setPathParam(`stream_id`,e),t.setBody(a.StreamPatchSerializer._toJsonObject(n)),yield t.send(this.requestCtx,i.StreamOutSerializer._fromJsonObject)})}}})),Sq=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Streaming=void 0;var n=zU(),r=xK(),i=SK(),a=DK(),o=PK(),s=_q(),c=xq(),l=uU();e.Streaming=class{constructor(e){this.requestCtx=e}get event_type(){return new a.StreamingEventType(this.requestCtx)}get events(){return new o.StreamingEvents(this.requestCtx)}get sink(){return new s.StreamingSink(this.requestCtx)}get stream(){return new c.StreamingStream(this.requestCtx)}sinkTransformationGet(e,n){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink/{sink_id}/transformation`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,n),yield t.send(this.requestCtx,i.SinkTransformationOutSerializer._fromJsonObject)})}sinkHeadersGet(e,r){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.GET,`/api/v1/stream/{stream_id}/sink/{sink_id}/headers`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,r),yield t.send(this.requestCtx,n.EndpointHeadersOutSerializer._fromJsonObject)})}sinkHeadersPatch(e,i,a){return t(this,void 0,void 0,function*(){let t=new l.SvixRequest(l.HttpMethod.PATCH,`/api/v1/stream/{stream_id}/sink/{sink_id}/headers`);return t.setPathParam(`stream_id`,e),t.setPathParam(`sink_id`,i),t.setBody(r.HttpSinkHeadersPatchInSerializer._toJsonObject(a)),yield t.send(this.requestCtx,n.EndpointHeadersOutSerializer._fromJsonObject)})}}})),Cq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPValidationError=e.ValidationError=e.HttpErrorOut=void 0;var t=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};e.HttpErrorOut=t,t.discriminator=void 0,t.mapping=void 0,t.attributeTypeMap=[{name:`code`,baseName:`code`,type:`string`,format:``},{name:`detail`,baseName:`detail`,type:`string`,format:``}];var n=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};e.ValidationError=n,n.discriminator=void 0,n.mapping=void 0,n.attributeTypeMap=[{name:`loc`,baseName:`loc`,type:`Array<string>`,format:``},{name:`msg`,baseName:`msg`,type:`string`,format:``},{name:`type`,baseName:`type`,type:`string`,format:``}];var r=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};e.HTTPValidationError=r,r.discriminator=void 0,r.mapping=void 0,r.attributeTypeMap=[{name:`detail`,baseName:`detail`,type:`Array<ValidationError>`,format:``}]})),wq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.timingSafeEqual=void 0;function t(e,t=``){if(!e)throw Error(t)}function n(e,n){if(e.byteLength!==n.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),n instanceof DataView||(n=new DataView(ArrayBuffer.isView(n)?n.buffer:n)),t(e instanceof DataView),t(n instanceof DataView);let r=e.byteLength,i=0,a=-1;for(;++a<r;)i|=e.getUint8(a)^n.getUint8(a);return i===0}e.timingSafeEqual=n})),Tq=i((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0});var n=256,r=function(){function e(e){e===void 0&&(e=`=`),this._paddingCharacter=e}return e.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},e.prototype.encode=function(e){for(var t=``,n=0;n<e.length-2;n+=3){var r=e[n]<<16|e[n+1]<<8|e[n+2];t+=this._encodeByte(r>>>18&63),t+=this._encodeByte(r>>>12&63),t+=this._encodeByte(r>>>6&63),t+=this._encodeByte(r>>>0&63)}var i=e.length-n;if(i>0){var r=e[n]<<16|(i===2?e[n+1]<<8:0);t+=this._encodeByte(r>>>18&63),t+=this._encodeByte(r>>>12&63),t+=i===2?this._encodeByte(r>>>6&63):this._paddingCharacter||``,t+=this._paddingCharacter||``}return t},e.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},e.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},e.prototype.decode=function(e){if(e.length===0)return new Uint8Array;for(var t=this._getPaddingLength(e),r=e.length-t,i=new Uint8Array(this.maxDecodedLength(r)),a=0,o=0,s=0,c=0,l=0,u=0,d=0;o<r-4;o+=4)c=this._decodeChar(e.charCodeAt(o+0)),l=this._decodeChar(e.charCodeAt(o+1)),u=this._decodeChar(e.charCodeAt(o+2)),d=this._decodeChar(e.charCodeAt(o+3)),i[a++]=c<<2|l>>>4,i[a++]=l<<4|u>>>2,i[a++]=u<<6|d,s|=c&n,s|=l&n,s|=u&n,s|=d&n;if(o<r-1&&(c=this._decodeChar(e.charCodeAt(o)),l=this._decodeChar(e.charCodeAt(o+1)),i[a++]=c<<2|l>>>4,s|=c&n,s|=l&n),o<r-2&&(u=this._decodeChar(e.charCodeAt(o+2)),i[a++]=l<<4|u>>>2,s|=u&n),o<r-3&&(d=this._decodeChar(e.charCodeAt(o+3)),i[a++]=u<<6|d,s|=d&n),s!==0)throw Error(`Base64Coder: incorrect characters for decoding`);return i},e.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-15,t+=62-e>>>8&3,String.fromCharCode(t)},e.prototype._decodeChar=function(e){var t=n;return t+=(42-e&e-44)>>>8&-n+e-43+62,t+=(46-e&e-48)>>>8&-n+e-47+63,t+=(47-e&e-58)>>>8&-n+e-48+52,t+=(64-e&e-91)>>>8&-n+e-65+0,t+=(96-e&e-123)>>>8&-n+e-97+26,t},e.prototype._getPaddingLength=function(e){var t=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)t++;if(e.length<4||t>2)throw Error(`Base64Coder: incorrect padding`)}return t},e}();e.Coder=r;var i=new r;function a(e){return i.encode(e)}e.encode=a;function o(e){return i.decode(e)}e.decode=o;var s=function(e){t(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-13,t+=62-e>>>8&49,String.fromCharCode(t)},r.prototype._decodeChar=function(e){var t=n;return t+=(44-e&e-46)>>>8&-n+e-45+62,t+=(94-e&e-96)>>>8&-n+e-95+63,t+=(47-e&e-58)>>>8&-n+e-48+52,t+=(64-e&e-91)>>>8&-n+e-65+0,t+=(96-e&e-123)>>>8&-n+e-97+26,t},r}(r);e.URLSafeCoder=s;var c=new s;function l(e){return c.encode(e)}e.encodeURLSafe=l;function u(e){return c.decode(e)}e.decodeURLSafe=u,e.encodedLength=function(e){return i.encodedLength(e)},e.maxDecodedLength=function(e){return i.maxDecodedLength(e)},e.decodedLength=function(e){return i.decodedLength(e)}})),Eq=i(((e,t)=>{(function(e,n){var r={};n(r);var i=r.default;for(var a in r)i[a]=r[a];typeof t==`object`&&typeof t.exports==`object`?t.exports=i:typeof define==`function`&&define.amd?define(function(){return i}):e.sha256=i})(e,function(e){e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(e,n,r,i,a){for(var o,s,c,l,u,d,f,p,m,h,g,_,v;a>=64;){for(o=n[0],s=n[1],c=n[2],l=n[3],u=n[4],d=n[5],f=n[6],p=n[7],h=0;h<16;h++)g=i+h*4,e[h]=(r[g]&255)<<24|(r[g+1]&255)<<16|(r[g+2]&255)<<8|r[g+3]&255;for(h=16;h<64;h++)m=e[h-2],_=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,m=e[h-15],v=(m>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,e[h]=(_+e[h-7]|0)+(v+e[h-16]|0);for(h=0;h<64;h++)_=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&f)|0)+(p+(t[h]+e[h]|0)|0)|0,v=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&s^o&c^s&c)|0,p=f,f=d,d=u,u=l+_|0,l=c,c=s,s=o,o=_+v|0;n[0]+=o,n[1]+=s,n[2]+=c,n[3]+=l,n[4]+=u,n[5]+=d,n[6]+=f,n[7]+=p,i+=64,a-=64}return i}var r=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return t.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(var e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this.finished)throw Error(`SHA256: can't update because hash was finished.`);var r=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[r++],t--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(r=n(this.temp,this.state,e,r,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[r++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,r=this.bufferLength,i=t/536870912|0,a=t<<3,o=t%64<56?64:128;this.buffer[r]=128;for(var s=r+1;s<o-8;s++)this.buffer[s]=0;this.buffer[o-8]=i>>>24&255,this.buffer[o-7]=i>>>16&255,this.buffer[o-6]=i>>>8&255,this.buffer[o-5]=i>>>0&255,this.buffer[o-4]=a>>>24&255,this.buffer[o-3]=a>>>16&255,this.buffer[o-2]=a>>>8&255,this.buffer[o-1]=a>>>0&255,n(this.temp,this.state,this.buffer,0,o),this.finished=!0}for(var s=0;s<8;s++)e[s*4+0]=this.state[s]>>>24&255,e[s*4+1]=this.state[s]>>>16&255,e[s*4+2]=this.state[s]>>>8&255,e[s*4+3]=this.state[s]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=r;var i=function(){function e(e){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)new r().update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(var n=0;n<t.length;n++)t[n]^=54;this.inner.update(t);for(var n=0;n<t.length;n++)t[n]^=106;this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();e.HMAC=i;function a(e){var t=new r().update(e),n=t.digest();return t.clean(),n}e.hash=a,e.default=a;function o(e,t){var n=new i(e).update(t),r=n.digest();return n.clean(),r}e.hmac=o;function s(e,t,n,r){var i=r[0];if(i===0)throw Error(`hkdf: cannot expand more`);t.reset(),i>1&&t.update(e),n&&t.update(n),t.update(r),t.finish(e),r[0]++}var c=new Uint8Array(e.digestLength);function l(e,t,n,r){t===void 0&&(t=c),r===void 0&&(r=32);for(var a=new Uint8Array([1]),l=new i(o(t,e)),u=new Uint8Array(l.digestLength),d=u.length,f=new Uint8Array(r),p=0;p<r;p++)d===u.length&&(s(u,l,n,a),d=0),f[p]=u[d++];return l.clean(),u.fill(0),a.fill(0),f}e.hkdf=l;function u(e,t,n,r){for(var a=new i(e),o=a.digestLength,s=new Uint8Array(4),c=new Uint8Array(o),l=new Uint8Array(o),u=new Uint8Array(r),d=0;d*o<r;d++){var f=d+1;s[0]=f>>>24&255,s[1]=f>>>16&255,s[2]=f>>>8&255,s[3]=f>>>0&255,a.reset(),a.update(t),a.update(s),a.finish(l);for(var p=0;p<o;p++)c[p]=l[p];for(var p=2;p<=n;p++){a.reset(),a.update(l).finish(l);for(var m=0;m<o;m++)c[m]^=l[m]}for(var p=0;p<o&&d*o+p<r;p++)u[d*o+p]=c[p]}for(var d=0;d<o;d++)c[d]=l[d]=0;for(var d=0;d<4;d++)s[d]=0;return a.clean(),u}e.pbkdf2=u})})),Dq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Webhook=e.WebhookVerificationError=void 0;var t=wq(),n=Tq(),r=Eq(),i=300,a=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name=`ExtendableError`,this.stack=Error(t).stack}},o=class e extends a{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name=`WebhookVerificationError`}};e.WebhookVerificationError=o;var s=class e{constructor(t,r){if(!t)throw Error(`Secret can't be empty.`);if(r?.format===`raw`)this.key=t instanceof Uint8Array?t:Uint8Array.from(t,e=>e.charCodeAt(0));else{if(typeof t!=`string`)throw Error(`Expected secret to be of type string`);t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=n.decode(t)}}verify(e,n){let r={};for(let e of Object.keys(n))r[e.toLowerCase()]=n[e];let i=r[`webhook-id`],a=r[`webhook-signature`],s=r[`webhook-timestamp`];if(!a||!i||!s)throw new o(`Missing required headers`);let c=this.verifyTimestamp(s),l=this.sign(i,c,e).split(`,`)[1],u=a.split(` `),d=new globalThis.TextEncoder;for(let n of u){let[r,i]=n.split(`,`);if(r===`v1`&&(0,t.timingSafeEqual)(d.encode(i),d.encode(l)))return JSON.parse(e.toString())}throw new o(`No matching signature found`)}sign(e,t,i){if(typeof i!=`string`){if(i.constructor.name===`Buffer`)i=i.toString();else throw Error(`Expected payload to be of type string or Buffer.`)}let a=new TextEncoder,o=Math.floor(t.getTime()/1e3),s=a.encode(`${e}.${o}.${i}`);return`v1,${n.encode(r.hmac(this.key,s))}`}verifyTimestamp(e){let t=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new o(`Invalid Signature Headers`);if(t-n>i)throw new o(`Message timestamp too old`);if(n>t+i)throw new o(`Message timestamp too new`);return new Date(n*1e3)}};e.Webhook=s,s.prefix=`whsec_`})),Oq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Webhook=e.WebhookVerificationError=void 0;var t=Dq(),n=Dq();Object.defineProperty(e,"WebhookVerificationError",{enumerable:!0,get:function(){return n.WebhookVerificationError}}),e.Webhook=class{constructor(e,n){this.inner=new t.Webhook(e,n)}verify(e,t){let n={};for(let e of Object.keys(t))n[e.toLowerCase()]=t[e];return n[`webhook-id`]=n[`svix-id`]??n[`webhook-id`]??``,n[`webhook-signature`]=n[`svix-signature`]??n[`webhook-signature`]??``,n[`webhook-timestamp`]=n[`svix-timestamp`]??n[`webhook-timestamp`]??``,this.inner.verify(e,n)}sign(e,t,n){return this.inner.sign(e,t,n)}}})),kq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointDisabledTriggerSerializer=e.EndpointDisabledTrigger=void 0,(function(e){e.Manual=`manual`,e.Automatic=`automatic`})(e.EndpointDisabledTrigger||={}),e.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),Aq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrderingSerializer=e.Ordering=void 0,(function(e){e.Ascending=`ascending`,e.Descending=`descending`})(e.Ordering||={}),e.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}})),jq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatusCodeClass=e.SinkStatusIn=e.SinkStatus=e.Ordering=e.MessageStatusText=e.MessageStatus=e.MessageAttemptTriggerType=e.EndpointDisabledTrigger=e.ConnectorProduct=e.ConnectorKind=e.BackgroundTaskType=e.BackgroundTaskStatus=e.AppPortalCapability=void 0;var t=pU();Object.defineProperty(e,"AppPortalCapability",{enumerable:!0,get:function(){return t.AppPortalCapability}});var n=SU();Object.defineProperty(e,"BackgroundTaskStatus",{enumerable:!0,get:function(){return n.BackgroundTaskStatus}});var r=CU();Object.defineProperty(e,"BackgroundTaskType",{enumerable:!0,get:function(){return r.BackgroundTaskType}});var i=DU();Object.defineProperty(e,"ConnectorKind",{enumerable:!0,get:function(){return i.ConnectorKind}});var a=OU();Object.defineProperty(e,"ConnectorProduct",{enumerable:!0,get:function(){return a.ConnectorProduct}});var o=kq();Object.defineProperty(e,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return o.EndpointDisabledTrigger}});var s=tK();Object.defineProperty(e,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return s.MessageAttemptTriggerType}});var c=FU();Object.defineProperty(e,"MessageStatus",{enumerable:!0,get:function(){return c.MessageStatus}});var l=QG();Object.defineProperty(e,"MessageStatusText",{enumerable:!0,get:function(){return l.MessageStatusText}});var u=Aq();Object.defineProperty(e,"Ordering",{enumerable:!0,get:function(){return u.Ordering}});var d=KK();Object.defineProperty(e,"SinkStatus",{enumerable:!0,get:function(){return d.SinkStatus}});var f=eq();Object.defineProperty(e,"SinkStatusIn",{enumerable:!0,get:function(){return f.SinkStatusIn}});var p=IU();Object.defineProperty(e,"StatusCodeClass",{enumerable:!0,get:function(){return p.StatusCodeClass}})})),Mq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SvixInternal=void 0;var t=Wq();e.SvixInternal=class extends t.Svix{getRequestCtx(){return this.requestCtx}}})),Nq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinkInCommonSerializer=void 0,e.SinkInCommonSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid}}}})),Pq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AutoConfigSinkTypeSerializer=void 0;var t=VU(),n=Nq();e.AutoConfigSinkTypeSerializer={_fromJsonObject(e){let r=e.type;function i(r){switch(r){case`poller`:return n.SinkInCommonSerializer._fromJsonObject(e.config);case`http`:return t.EndpointInSerializer._fromJsonObject(e.config);default:throw Error(`Unexpected type: ${r}`)}}return{type:r,config:i(r)}},_toJsonObject(e){let r;switch(e.type){case`poller`:r=n.SinkInCommonSerializer._toJsonObject(e.config);break;case`http`:r=t.EndpointInSerializer._toJsonObject(e.config)}return{type:e.type,config:r}}}})),Fq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SubscribeInSerializer=void 0;var t=Pq(),n=VU();e.SubscribeInSerializer={_fromJsonObject(e){return{endpoint:e.endpoint==null?void 0:n.EndpointInSerializer._fromJsonObject(e.endpoint),sink:e.sink==null?void 0:t.AutoConfigSinkTypeSerializer._fromJsonObject(e.sink)}},_toJsonObject(e){return{endpoint:e.endpoint==null?void 0:n.EndpointInSerializer._toJsonObject(e.endpoint),sink:e.sink==null?void 0:t.AutoConfigSinkTypeSerializer._toJsonObject(e.sink)}}}})),Iq=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointAutoConfig=void 0;var n=HU(),r=Fq(),i=uU();e.EndpointAutoConfig=class{constructor(e){this.requestCtx=e}update(e,a,o={}){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.PUT,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/auto-config`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,a),t.setBody(r.SubscribeInSerializer._toJsonObject(o)),yield t.send(this.requestCtx,n.EndpointOutSerializer._fromJsonObject)})}}})),Lq=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Endpoint=void 0;var n=qU(),r=Iq(),i=uU();e.Endpoint=class{constructor(e){this.requestCtx=e}get auto_config(){return new r.EndpointAutoConfig(this.requestCtx)}transformationPartialUpdate(e,r,a={}){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.PATCH,`/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation`);return t.setPathParam(`app_id`,e),t.setPathParam(`endpoint_id`,r),t.setBody(n.EndpointTransformationInSerializer._toJsonObject(a)),yield t.sendNoResponseBody(this.requestCtx)})}}})),Rq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AutoConfig=e.decodeAutoconfigTokenV1=e.isAutoConfigTokenContentV1=e.AutoConfigError=void 0;var t=Mq(),n=Lq(),r=Oq(),i=`auto_v1_`,a=class extends Error{constructor(e=`invalid token`){super(e),this.name=`AutoConfigError`}};e.AutoConfigError=a;function o(e){if(typeof e!=`object`||!e)return!1;let{aid:t,eid:n,surl:r,esec:i,tok:a}=e;return typeof t==`string`&&typeof n==`string`&&typeof r==`string`&&typeof i==`string`&&typeof a==`string`}e.isAutoConfigTokenContentV1=o;function s(e){if(!e.startsWith(i))throw new a;let t=e.slice(8),n;try{n=Buffer.from(t,`base64`).toString(`utf8`)}catch{throw new a}let r;try{r=JSON.parse(n)}catch{throw new a}if(!o(r))throw new a;return r}e.decodeAutoconfigTokenV1=s,e.AutoConfig=class{constructor(e,n){let i=s(e),o;try{o=new r.Webhook(i.esec)}catch{throw new a}this.appId=i.aid,this.endpointId=i.eid,this.endpointIn=n,this.webhook=o;let c=new t.SvixInternal(i.tok,{serverUrl:i.surl});this.requestCtx=c.getRequestCtx()}subscribe(){return new n.Endpoint(this.requestCtx).auto_config.update(this.appId,this.endpointId,{endpoint:this.endpointIn})}verify(e,t){return this.webhook.verify(e,t)}}})),zq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollerV2CommitInSerializer=void 0,e.PollerV2CommitInSerializer={_fromJsonObject(e){return{offset:e.offset}},_toJsonObject(e){return{offset:e.offset}}}})),Bq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollerV2MessageOutSerializer=void 0,e.PollerV2MessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,offset:e.offset,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,offset:e.offset,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}})),Vq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PollerV2PollOutSerializer=void 0;var t=Bq();e.PollerV2PollOutSerializer={_fromJsonObject(e){return{data:e.data.map(e=>t.PollerV2MessageOutSerializer._fromJsonObject(e)),done:e.done}},_toJsonObject(e){return{data:e.data.map(e=>t.PollerV2MessageOutSerializer._toJsonObject(e)),done:e.done}}}})),Hq=i((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.MessagePollerv2=void 0;var n=zq(),r=Vq(),i=uU();e.MessagePollerv2=class{constructor(e){this.requestCtx=e}consumerPoll(e,n,a,o){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.GET,`/api/v1/app/{app_id}/polling-endpoint/{sink_id}/consumer/{consumer_id}`);return t.setPathParam(`app_id`,e),t.setPathParam(`sink_id`,n),t.setPathParam(`consumer_id`,a),t.setQueryParams({limit:o?.limit,lease_duration_ms:o?.leaseDurationMs,starting_position:o?.startingPosition}),yield t.send(this.requestCtx,r.PollerV2PollOutSerializer._fromJsonObject)})}consumerCommit(e,r,a,o,s){return t(this,void 0,void 0,function*(){let t=new i.SvixRequest(i.HttpMethod.POST,`/api/v1/app/{app_id}/polling-endpoint/{sink_id}/consumer/{consumer_id}/commit`);return t.setPathParam(`app_id`,e),t.setPathParam(`sink_id`,r),t.setPathParam(`consumer_id`,a),t.setHeaderParam(`idempotency-key`,s?.idempotencyKey),t.setBody(n.PollerV2CommitInSerializer._toJsonObject(o)),yield t.sendNoResponseBody(this.requestCtx)})}}})),Uq=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AutoConfigConsumer=void 0;var t=Mq(),n=Lq(),r=Hq(),i=Rq();e.AutoConfigConsumer=class{constructor(e,n){let r=(0,i.decodeAutoconfigTokenV1)(e);this.appId=r.aid,this.sinkId=r.eid,this.sinkIn=n;let a=new t.SvixInternal(r.tok,{serverUrl:r.surl});this.requestCtx=a.getRequestCtx()}subscribe(){return new n.Endpoint(this.requestCtx).auto_config.update(this.appId,this.sinkId,{sink:{type:`poller`,config:this.sinkIn}})}receive(e,t){return new r.MessagePollerv2(this.requestCtx).consumerPoll(this.appId,this.sinkId,e,t)}commit(e,t,n){return new r.MessagePollerv2(this.requestCtx).consumerCommit(this.appId,this.sinkId,e,{offset:t},n)}}})),Wq=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AutoConfigConsumer=e.AutoConfigError=e.AutoConfig=e.Svix=e.messageInRaw=e.ValidationError=e.HttpErrorOut=e.HTTPValidationError=e.ApiException=void 0;var r=dU(),i=xU(),a=EU(),o=PU(),s=iW(),c=lW(),l=_W(),u=vW(),d=NG(),f=zG(),p=XG(),m=oK(),h=gK(),g=bK(),_=Sq(),v=hK(),y=lU();Object.defineProperty(e,"ApiException",{enumerable:!0,get:function(){return y.ApiException}});var b=Cq();Object.defineProperty(e,"HTTPValidationError",{enumerable:!0,get:function(){return b.HTTPValidationError}}),Object.defineProperty(e,"HttpErrorOut",{enumerable:!0,get:function(){return b.HttpErrorOut}}),Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return b.ValidationError}}),n(Oq(),e),n(jq(),e);var x=XG();Object.defineProperty(e,"messageInRaw",{enumerable:!0,get:function(){return x.messageInRaw}});var S=[{region:`us`,url:`https://api.us.svix.com`},{region:`eu`,url:`https://api.eu.svix.com`},{region:`in`,url:`https://api.in.svix.com`},{region:`ca`,url:`https://api.ca.svix.com`},{region:`au`,url:`https://api.au.svix.com`}];e.Svix=class{constructor(e,t={}){let n=S.find(t=>t.region===e.split(`.`)[1])?.url,r=t.serverUrl??n??`https://api.svix.com`;this.requestCtx=t.retryScheduleInMs?{baseUrl:r,token:e,timeout:t.requestTimeout,retryScheduleInMs:t.retryScheduleInMs,fetch:t.fetch}:t.numRetries?{baseUrl:r,token:e,timeout:t.requestTimeout,numRetries:t.numRetries,fetch:t.fetch}:{baseUrl:r,token:e,timeout:t.requestTimeout,fetch:t.fetch}}get application(){return new r.Application(this.requestCtx)}get authentication(){return new i.Authentication(this.requestCtx)}get backgroundTask(){return new a.BackgroundTask(this.requestCtx)}get connector(){return new o.Connector(this.requestCtx)}get endpoint(){return new s.Endpoint(this.requestCtx)}get environment(){return new c.Environment(this.requestCtx)}get eventType(){return new l.EventType(this.requestCtx)}get health(){return new u.Health(this.requestCtx)}get ingest(){return new d.Ingest(this.requestCtx)}get integration(){return new f.Integration(this.requestCtx)}get message(){return new p.Message(this.requestCtx)}get messageAttempt(){return new m.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new h.OperationalWebhook(this.requestCtx)}get statistics(){return new g.Statistics(this.requestCtx)}get streaming(){return new _.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new v.OperationalWebhookEndpoint(this.requestCtx)}};var C=Rq();Object.defineProperty(e,"AutoConfig",{enumerable:!0,get:function(){return C.AutoConfig}}),Object.defineProperty(e,"AutoConfigError",{enumerable:!0,get:function(){return C.AutoConfigError}});var w=Uq();Object.defineProperty(e,"AutoConfigConsumer",{enumerable:!0,get:function(){return w.AutoConfigConsumer}})})),Gq=Wq(),Kq=class{constructor(e,t){this.webhooksResource=e,this.webhookSigningSecret=t}verify({payload:e,headers:t,svix:n,signing_secret:r}){let i=r??this.webhookSigningSecret;if(!i)throw new qq(`Webhook signing secret is required. Pass it to PrivyClient constructor or to verify().`);let a=typeof e==`string`?e:JSON.stringify(e),o;if(t)o={"svix-id":t[`svix-id`],"svix-timestamp":t[`svix-timestamp`],"svix-signature":t[`svix-signature`]};else if(n)o={"svix-id":n.id,"svix-timestamp":n.timestamp,"svix-signature":n.signature};else throw new qq(`Webhook headers are required (svix-id, svix-timestamp, svix-signature).`);try{new Gq.Webhook(i).verify(a,o)}catch(e){throw e instanceof Error?new qq(`Webhook verification failed: ${e.message}`):new qq(`Webhook verification failed`)}return this.webhooksResource.unsafeUnwrap(a)}},qq=class extends EB{},Jq=BigInt(0),Yq=BigInt(1);function Xq(e,t=``){if(typeof e!=`boolean`){let n=t&&`"${t}"`;throw Error(n+`expected boolean, got type=`+typeof e)}return e}function Zq(e,t,n=``){let r=Va(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function Qq(e){let t=e.toString(16);return t.length&1?`0`+t:t}function $q(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?Jq:BigInt(`0x`+e)}function eJ(e){return $q(Ba(e))}function tJ(e){return Wa(e),$q(Ba(Uint8Array.from(e).reverse()))}function nJ(e,t){return Ha(e.toString(16).padStart(t*2,`0`))}function rJ(e,t){return nJ(e,t).reverse()}function iJ(e,t,n){let r;if(typeof t==`string`)try{r=Ha(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(Va(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}var aJ=e=>typeof e==`bigint`&&Jq<=e;function oJ(e,t,n){return aJ(e)&&aJ(t)&&aJ(n)&&t<=e&&e<n}function sJ(e,t,n,r){if(!oJ(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function cJ(e){let t=0;for(;e>Jq;e>>=Yq,t+=1);return t}var lJ=e=>(Yq<<BigInt(e))-Yq;function uJ(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),a=r(e),o=r(e),s=0,c=()=>{a.fill(1),o.fill(0),s=0},l=(...e)=>n(o,a,...e),u=(e=r(0))=>{o=l(i(0),e),a=l(),e.length!==0&&(o=l(i(1),e),a=l())},d=()=>{if(s++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){a=l();let t=a.slice();n.push(t),e+=a.length}return Ra(...n)};return(e,t)=>{c(),u(e);let n;for(;!(n=t(d()));)u();return c(),n}}function dJ(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param "${t}" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function fJ(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}var pJ=BigInt(0),mJ=BigInt(1),hJ=BigInt(2),gJ=BigInt(3),_J=BigInt(4),vJ=BigInt(5),yJ=BigInt(7),bJ=BigInt(8),xJ=BigInt(9),SJ=BigInt(16);function CJ(e,t){let n=e%t;return n>=pJ?n:t+n}function wJ(e,t){if(e===pJ)throw Error(`invert: expected non-zero number`);if(t<=pJ)throw Error(`invert: expected positive modulus, got `+t);let n=CJ(e,t),r=t,i=pJ,a=mJ,o=mJ,s=pJ;for(;n!==pJ;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==mJ)throw Error(`invert: does not exist`);return CJ(i,t)}function TJ(e,t,n){if(!e.eql(e.sqr(t),n))throw Error(`Cannot find square root`)}function EJ(e,t){let n=(e.ORDER+mJ)/_J,r=e.pow(t,n);return TJ(e,r,t),r}function DJ(e,t){let n=(e.ORDER-vJ)/bJ,r=e.mul(t,hJ),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,hJ),i),s=e.mul(a,e.sub(o,e.ONE));return TJ(e,s,t),s}function OJ(e){let t=LJ(e),n=kJ(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+yJ)/SJ;return(e,t)=>{let n=e.pow(t,o),s=e.mul(n,r),c=e.mul(n,i),l=e.mul(n,a),u=e.eql(e.sqr(s),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,s,u),s=e.cmov(l,c,d);let f=e.eql(e.sqr(s),t),p=e.cmov(n,s,f);return TJ(e,p,t),p}}function kJ(e){if(e<gJ)throw Error(`sqrt is not defined for small field`);let t=e-mJ,n=0;for(;t%hJ===pJ;)t/=hJ,n++;let r=hJ,i=LJ(e);for(;FJ(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return EJ;let a=i.pow(r,t),o=(t+mJ)/hJ;return function(e,r){if(e.is0(r))return r;if(FJ(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=mJ<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function AJ(e){return e%_J===gJ?EJ:e%bJ===vJ?DJ:e%SJ===xJ?OJ(e):kJ(e)}var jJ=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function MJ(e){return dJ(e,jJ.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`number`,BITS:`number`})),e}function NJ(e,t,n){if(n<pJ)throw Error(`invalid exponent, negatives unsupported`);if(n===pJ)return e.ONE;if(n===mJ)return t;let r=e.ONE,i=t;for(;n>pJ;)n&mJ&&(r=e.mul(r,i)),i=e.sqr(i),n>>=mJ;return r}function PJ(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function FJ(e,t){let n=(e.ORDER-mJ)/hJ,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function IJ(e,t){t!==void 0&&La(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function LJ(e,t,n=!1,r={}){if(e<=pJ)throw Error(`invalid field: expected ORDER > 0, got `+e);let i,a,o=!1,s;if(typeof t==`object`&&t){if(r.sqrt||n)throw Error(`cannot specify opts in two arguments`);let e=t;e.BITS&&(i=e.BITS),e.sqrt&&(a=e.sqrt),typeof e.isLE==`boolean`&&(n=e.isLE),typeof e.modFromBytes==`boolean`&&(o=e.modFromBytes),s=e.allowedLengths}else typeof t==`number`&&(i=t),r.sqrt&&(a=r.sqrt);let{nBitLength:c,nByteLength:l}=IJ(e,i);if(l>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let u,d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:lJ(c),ZERO:pJ,ONE:mJ,allowedLengths:s,create:t=>CJ(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return pJ<=t&&t<e},is0:e=>e===pJ,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&mJ)===mJ,neg:t=>CJ(-t,e),eql:(e,t)=>e===t,sqr:t=>CJ(t*t,e),add:(t,n)=>CJ(t+n,e),sub:(t,n)=>CJ(t-n,e),mul:(t,n)=>CJ(t*n,e),pow:(e,t)=>NJ(d,e,t),div:(t,n)=>CJ(t*wJ(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>wJ(t,e),sqrt:a||(t=>(u||=AJ(e),u(d,t))),toBytes:e=>n?rJ(e,l):nJ(e,l),fromBytes:(t,r=!0)=>{if(s){if(!s.includes(t.length)||t.length>l)throw Error(`Field.fromBytes: expected `+s+` bytes, got `+t.length);let e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw Error(`Field.fromBytes: expected `+l+` bytes, got `+t.length);let i=n?tJ(t):eJ(t);if(o&&(i=CJ(i,e)),!r&&!d.isValid(i))throw Error(`invalid field element: outside of range 0..ORDER`);return i},invertBatch:e=>PJ(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function RJ(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function zJ(e){let t=RJ(e);return t+Math.ceil(t/2)}function BJ(e,t,n=!1){let r=e.length,i=RJ(t),a=zJ(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=CJ(n?tJ(e):eJ(e),t-mJ)+mJ;return n?rJ(o,i):nJ(o,i)}var VJ=BigInt(0),HJ=BigInt(1);function UJ(e,t){let n=t.negate();return e?n:t}function WJ(e,t){let n=PJ(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function GJ(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function KJ(e,t){GJ(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:lJ(e),maxNumber:i,shiftBy:BigInt(e)}}function qJ(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=HJ);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function JJ(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function YJ(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var XJ=new WeakMap,ZJ=new WeakMap;function QJ(e){return ZJ.get(e)||1}function $J(e){if(e!==VJ)throw Error(`invalid wNAF`)}var eY=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>VJ;)t&HJ&&(n=n.add(r)),r=r.double(),t>>=HJ;return n}precomputeWindow(e,t){let{windows:n,windowSize:r}=KJ(t,this.bits),i=[],a=e,o=a;for(let e=0;e<n;e++){o=a,i.push(o);for(let e=1;e<r;e++)o=o.add(a),i.push(o);a=o.double()}return i}wNAF(e,t,n){if(!this.Fn.isValid(n))throw Error(`invalid scalar`);let r=this.ZERO,i=this.BASE,a=KJ(e,this.bits);for(let e=0;e<a.windows;e++){let{nextN:o,offset:s,isZero:c,isNeg:l,isNegF:u,offsetF:d}=qJ(n,e,a);n=o,c?i=i.add(UJ(u,t[d])):r=r.add(UJ(l,t[s]))}return $J(n),{p:r,f:i}}wNAFUnsafe(e,t,n,r=this.ZERO){let i=KJ(e,this.bits);for(let e=0;e<i.windows&&n!==VJ;e++){let{nextN:a,offset:o,isZero:s,isNeg:c}=qJ(n,e,i);if(n=a,!s){let e=t[o];r=r.add(c?e.negate():e)}}return $J(n),r}getPrecomputes(e,t,n){let r=XJ.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&(typeof n==`function`&&(r=n(r)),XJ.set(t,r))),r}cached(e,t,n){let r=QJ(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){let i=QJ(e);return i===1?this._unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)}createCache(e,t){GJ(t,this.bits),ZJ.set(e,t),XJ.delete(e)}hasCache(e){return QJ(e)!==1}};function tY(e,t,n,r){let i=t,a=e.ZERO,o=e.ZERO;for(;n>VJ||r>VJ;)n&HJ&&(a=a.add(i)),r&HJ&&(o=o.add(i)),i=i.double(),n>>=HJ,r>>=HJ;return{p1:a,p2:o}}function nY(e,t,n,r){JJ(n,e),YJ(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=cJ(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=lJ(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function rY(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return MJ(t),t}return LJ(e,{isLE:n})}function iY(e,t,n={},r){if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(typeof n==`bigint`&&n>VJ))throw Error(`CURVE.${e} must be positive bigint`)}let i=rY(t.p,n.Fp,r),a=rY(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}var aY=(e,t)=>(e+(e>=0?t:-t)/fY)/t;function oY(e,t,n){let[[r,i],[a,o]]=t,s=aY(o*e,n),c=aY(-i*e,n),l=e-s*r-c*a,u=-s*i-c*o,d=l<uY,f=u<uY;d&&(l=-l),f&&(u=-u);let p=lJ(Math.ceil(cJ(n)/2))+dY;if(l<uY||l>=p||u<uY||u>=p)throw Error(`splitScalar (endomorphism): failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}function sY(e){if(![`compact`,`recovered`,`der`].includes(e))throw Error(`Signature format must be "compact", "recovered", or "der"`);return e}function cY(e,t){let n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return Xq(n.lowS,`lowS`),Xq(n.prehash,`prehash`),n.format!==void 0&&sY(n.format),n}var lY={Err:class extends Error{constructor(e=``){super(e)}},_tlv:{encode:(e,t)=>{let{Err:n}=lY;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=Qq(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?Qq(i.length/2|128):``;return Qq(e)+a+i+t},decode(e,t){let{Err:n}=lY,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=lY;if(e<uY)throw new t(`integer: negative integers are not allowed`);let n=Qq(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=lY;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return eJ(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=lY,i=iJ(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=lY,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},uY=BigInt(0),dY=BigInt(1),fY=BigInt(2),pY=BigInt(3),mY=BigInt(4);function hY(e,t){let{BYTES:n}=e,r;if(typeof t==`bigint`)r=t;else{let i=iJ(`private key`,t);try{r=e.fromBytes(i)}catch{throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw Error(`invalid private key: out of range [1..N-1]`);return r}function gY(e,t={}){let n=iY(`weierstrass`,e,t),{Fp:r,Fn:i}=n,a=n.CURVE,{h:o,n:s}=a;dJ(t,{},{allowInfinityPoint:`boolean`,clearCofactor:`function`,isTorsionFree:`function`,fromBytes:`function`,toBytes:`function`,endo:`object`,wrapPrivateKey:`boolean`});let{endo:c}=t;if(c&&(!r.is0(a.a)||typeof c.beta!=`bigint`||!Array.isArray(c.basises)))throw Error(`invalid endo: expected "beta": bigint and "basises": array`);let l=vY(r,i);function u(){if(!r.isOdd)throw Error(`compression is not supported: Field does not have .isOdd()`)}function d(e,t,n){let{x:i,y:a}=t.toAffine(),o=r.toBytes(i);if(Xq(n,`isCompressed`),n){u();let e=!r.isOdd(a);return Ra(_Y(e),o)}return Ra(Uint8Array.of(4),o,r.toBytes(a))}function f(e){Zq(e,void 0,`Point`);let{publicKey:t,publicKeyUncompressed:n}=l,i=e.length,a=e[0],o=e.subarray(1);if(i===t&&(a===2||a===3)){let e=r.fromBytes(o);if(!r.isValid(e))throw Error(`bad point: is not on curve, wrong x`);let t=h(e),n;try{n=r.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`bad point: is not on curve, sqrt error`+t)}u();let i=r.isOdd(n);return(a&1)==1!==i&&(n=r.neg(n)),{x:e,y:n}}if(i===n&&a===4){let e=r.BYTES,t=r.fromBytes(o.subarray(0,e)),n=r.fromBytes(o.subarray(e,e*2));if(!g(t,n))throw Error(`bad point: is not on curve`);return{x:t,y:n}}throw Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${n}`)}let p=t.toBytes||d,m=t.fromBytes||f;function h(e){let t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function g(e,t){let n=r.sqr(t),i=h(e);return r.eql(n,i)}if(!g(a.Gx,a.Gy))throw Error(`bad curve params: generator point`);let _=r.mul(r.pow(a.a,pY),mY),v=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(_,v)))throw Error(`bad curve params: a or b`);function y(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw Error(`ProjectivePoint expected`)}function x(e){if(!c||!c.basises)throw Error(`no endo`);return oY(e,c.basises,i.ORDER)}let S=fJ((e,t)=>{let{X:n,Y:i,Z:a}=e;if(r.eql(a,r.ONE))return{x:n,y:i};let o=e.is0();t??=o?r.ONE:r.inv(a);let s=r.mul(n,t),c=r.mul(i,t),l=r.mul(a,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),C=fJ(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw Error(`bad point: ZERO`)}let{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error(`bad point: x or y not field elements`);if(!g(n,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});function w(e,t,n,i,a){return n=new E(r.mul(n.X,e),n.Y,n.Z),t=UJ(i,t),n=UJ(a,n),t.add(n)}class E{constructor(e,t,n){this.X=y(`x`,e),this.Y=y(`y`,t,!0),this.Z=y(`z`,n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error(`invalid affine point`);if(e instanceof E)throw Error(`projective point not allowed`);return r.is0(t)&&r.is0(n)?E.ZERO:new E(t,n,r.ONE)}static fromBytes(e){let t=E.fromAffine(m(Zq(e,void 0,`point`)));return t.assertValidity(),t}static fromHex(e){return E.fromBytes(iJ(`pointHex`,e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return O.createCache(this,e),t||this.multiply(pY),this}assertValidity(){C(this)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error(`Field doesn't support isOdd`);return!r.isOdd(e)}equals(e){b(e);let{X:t,Y:n,Z:i}=this,{X:a,Y:o,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(a,i)),l=r.eql(r.mul(n,s),r.mul(o,i));return c&&l}negate(){return new E(this.X,r.neg(this.Y),this.Z)}double(){let{a:e,b:t}=a,n=r.mul(t,pY),{X:i,Y:o,Z:s}=this,c=r.ZERO,l=r.ZERO,u=r.ZERO,d=r.mul(i,i),f=r.mul(o,o),p=r.mul(s,s),m=r.mul(i,o);return m=r.add(m,m),u=r.mul(i,s),u=r.add(u,u),c=r.mul(e,u),l=r.mul(n,p),l=r.add(c,l),c=r.sub(f,l),l=r.add(f,l),l=r.mul(c,l),c=r.mul(m,c),u=r.mul(n,u),p=r.mul(e,p),m=r.sub(d,p),m=r.mul(e,m),m=r.add(m,u),u=r.add(d,d),d=r.add(u,d),d=r.add(d,p),d=r.mul(d,m),l=r.add(l,d),p=r.mul(o,s),p=r.add(p,p),d=r.mul(p,m),c=r.sub(c,d),u=r.mul(p,f),u=r.add(u,u),u=r.add(u,u),new E(c,l,u)}add(e){b(e);let{X:t,Y:n,Z:i}=this,{X:o,Y:s,Z:c}=e,l=r.ZERO,u=r.ZERO,d=r.ZERO,f=a.a,p=r.mul(a.b,pY),m=r.mul(t,o),h=r.mul(n,s),g=r.mul(i,c),_=r.add(t,n),v=r.add(o,s);_=r.mul(_,v),v=r.add(m,h),_=r.sub(_,v),v=r.add(t,i);let y=r.add(o,c);return v=r.mul(v,y),y=r.add(m,g),v=r.sub(v,y),y=r.add(n,i),l=r.add(s,c),y=r.mul(y,l),l=r.add(h,g),y=r.sub(y,l),d=r.mul(f,v),l=r.mul(p,g),d=r.add(l,d),l=r.sub(h,d),d=r.add(h,d),u=r.mul(l,d),h=r.add(m,m),h=r.add(h,m),g=r.mul(f,g),v=r.mul(p,v),h=r.add(h,g),g=r.sub(m,g),g=r.mul(f,g),v=r.add(v,g),m=r.mul(h,v),u=r.add(u,m),m=r.mul(y,v),l=r.mul(_,l),l=r.sub(l,m),m=r.mul(_,h),d=r.mul(y,d),d=r.add(d,m),new E(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){let{endo:n}=t;if(!i.isValidNot0(e))throw Error(`invalid scalar: out of range`);let r,a,o=e=>O.cached(this,e,e=>WJ(E,e));if(n){let{k1neg:t,k1:i,k2neg:s,k2:c}=x(e),{p:l,f:u}=o(i),{p:d,f}=o(c);a=u.add(f),r=w(n.beta,l,d,t,s)}else{let{p:t,f:n}=o(e);r=t,a=n}return WJ(E,[r,a])[0]}multiplyUnsafe(e){let{endo:n}=t,r=this;if(!i.isValid(e))throw Error(`invalid scalar: out of range`);if(e===uY||r.is0())return E.ZERO;if(e===dY)return r;if(O.hasCache(this))return this.multiply(e);if(n){let{k1neg:t,k1:i,k2neg:a,k2:o}=x(e),{p1:s,p2:c}=tY(E,r,i,o);return w(n.beta,s,c,t,a)}return O.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){let r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return S(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return o===dY?!0:e?e(E,this):O.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:e}=t;return o===dY?this:e?e(E,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(e=!0){return Xq(e,`isCompressed`),this.assertValidity(),p(E,this,e)}toHex(e=!0){return Ba(this.toBytes(e))}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return WJ(E,e)}static msm(e,t){return nY(E,i,e,t)}static fromPrivateKey(e){return E.BASE.multiply(hY(i,e))}}E.BASE=new E(a.Gx,a.Gy,r.ONE),E.ZERO=new E(r.ZERO,r.ONE,r.ZERO),E.Fp=r,E.Fn=i;let D=i.BITS,O=new eY(E,t.endo?Math.ceil(D/2):D);return E.BASE.precompute(8),E}function _Y(e){return Uint8Array.of(e?2:3)}function vY(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function yY(e,t={}){let{Fn:n}=e,r=t.randomBytes||Ua,i=Object.assign(vY(e.Fp,n),{seed:zJ(n.ORDER)});function a(e){try{return!!hY(n,e)}catch{return!1}}function o(t,n){let{publicKey:r,publicKeyUncompressed:a}=i;try{let i=t.length;return n===!0&&i!==r||n===!1&&i!==a?!1:!!e.fromBytes(t)}catch{return!1}}function s(e=r(i.seed)){return BJ(Zq(e,i.seed,`seed`),n.ORDER)}function c(t,r=!0){return e.BASE.multiply(hY(n,t)).toBytes(r)}function l(e){let t=s(e);return{secretKey:t,publicKey:c(t)}}function u(t){if(typeof t==`bigint`)return!1;if(t instanceof e)return!0;let{secretKey:r,publicKey:a,publicKeyUncompressed:o}=i;if(n.allowedLengths||r===a)return;let s=iJ(`key`,t).length;return s===a||s===o}function d(t,r,i=!0){if(u(t)===!0)throw Error(`first arg must be private key`);if(u(r)===!1)throw Error(`second arg must be public key`);let a=hY(n,t);return e.fromHex(r).multiply(a).toBytes(i)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:{isValidSecretKey:a,isValidPublicKey:o,randomSecretKey:s,isValidPrivateKey:a,randomPrivateKey:s,normPrivateKeyToScalar:e=>hY(n,e),precompute(t=8,n=e.BASE){return n.precompute(t,!1)}},lengths:i})}function bY(e,t,n={}){za(t),dJ(n,{},{hmac:`function`,lowS:`boolean`,randomBytes:`function`,bits2int:`function`,bits2int_modN:`function`});let r=n.randomBytes||Ua,i=n.hmac||((e,...n)=>Ka(t,e,Ra(...n))),{Fp:a,Fn:o}=e,{ORDER:s,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p}=yY(e,n),m={prehash:!1,lowS:typeof n.lowS==`boolean`&&n.lowS,format:void 0,extraEntropy:!1},h=`compact`;function g(e){return e>s>>dY}function _(e,t){if(!o.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function v(e,t){sY(t);let n=p.signature;return Zq(e,t===`compact`?n:t===`recovered`?n+1:void 0,`${t} signature`)}class y{constructor(e,t,n){this.r=_(`r`,e),this.s=_(`s`,t),n!=null&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=h){v(e,t);let n;if(t===`der`){let{r:t,s:n}=lY.toSig(Zq(e));return new y(t,n)}t===`recovered`&&(n=e[0],t=`compact`,e=e.subarray(1));let r=o.BYTES,i=e.subarray(0,r),a=e.subarray(r,r*2);return new y(o.fromBytes(i),o.fromBytes(a),n)}static fromHex(e,t){return this.fromBytes(Ha(e),t)}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(t){let n=a.ORDER,{r,s:i,recovery:c}=this;if(c==null||![0,1,2,3].includes(c))throw Error(`recovery id invalid`);if(s*fY<n&&c>1)throw Error(`recovery id is ambiguous for h>1 curve`);let l=c===2||c===3?r+s:r;if(!a.isValid(l))throw Error(`recovery id 2 or 3 invalid`);let u=a.toBytes(l),d=e.fromBytes(Ra(_Y(!(c&1)),u)),f=o.inv(l),p=x(iJ(`msgHash`,t)),m=o.create(-p*f),h=o.create(i*f),g=e.BASE.multiplyUnsafe(m).add(d.multiplyUnsafe(h));if(g.is0())throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=h){if(sY(e),e===`der`)return Ha(lY.hexFromSig(this));let t=o.toBytes(this.r),n=o.toBytes(this.s);if(e===`recovered`){if(this.recovery==null)throw Error(`recovery bit must be present`);return Ra(Uint8Array.of(this.recovery),t,n)}return Ra(t,n)}toHex(e){return Ba(this.toBytes(e))}assertValidity(){}static fromCompact(e){return y.fromBytes(iJ(`sig`,e),`compact`)}static fromDER(e){return y.fromBytes(iJ(`sig`,e),`der`)}normalizeS(){return this.hasHighS()?new y(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes(`der`)}toDERHex(){return Ba(this.toBytes(`der`))}toCompactRawBytes(){return this.toBytes(`compact`)}toCompactHex(){return Ba(this.toBytes(`compact`))}}let b=n.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=eJ(e),n=e.length*8-c;return n>0?t>>BigInt(n):t},x=n.bits2int_modN||function(e){return o.create(b(e))},S=lJ(c);function C(e){return sJ(`num < 2^`+c,e,uY,S),o.toBytes(e)}function w(e,n){return Zq(e,void 0,`message`),n?Zq(t(e),void 0,`prehashed message`):e}function E(t,n,i){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{lowS:a,prehash:s,extraEntropy:c}=cY(i,m);t=w(t,s);let l=x(t),u=hY(o,n),d=[C(u),C(l)];if(c!=null&&c!==!1){let e=c===!0?r(p.secretKey):c;d.push(iJ(`extraEntropy`,e))}let f=Ra(...d),h=l;function _(t){let n=b(t);if(!o.isValidNot0(n))return;let r=o.inv(n),i=e.BASE.multiply(n).toAffine(),s=o.create(i.x);if(s===uY)return;let c=o.create(r*o.create(h+s*u));if(c===uY)return;let l=(i.x===s?0:2)|Number(i.y&dY),d=c;return a&&g(c)&&(d=o.neg(c),l^=1),new y(s,d,l)}return{seed:f,k2sig:_}}function D(e,n,r={}){e=iJ(`message`,e);let{seed:a,k2sig:s}=E(e,n,r);return uJ(t.outputLen,o.BYTES,i)(a,s)}function O(e){let t,n=typeof e==`string`||Va(e),r=!n&&typeof e==`object`&&!!e&&typeof e.r==`bigint`&&typeof e.s==`bigint`;if(!n&&!r)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);if(r)t=new y(e.r,e.s);else if(n){try{t=y.fromBytes(iJ(`sig`,e),`der`)}catch(e){if(!(e instanceof lY.Err))throw e}if(!t)try{t=y.fromBytes(iJ(`sig`,e),`compact`)}catch{return!1}}return t||!1}function k(t,n,r,i={}){let{lowS:a,prehash:s,format:c}=cY(i,m);if(r=iJ(`publicKey`,r),n=w(iJ(`message`,n),s),`strict`in i)throw Error(`options.strict was renamed to lowS`);let l=c===void 0?O(t):y.fromBytes(iJ(`sig`,t),c);if(l===!1)return!1;try{let t=e.fromBytes(r);if(a&&l.hasHighS())return!1;let{r:i,s}=l,c=x(n),u=o.inv(s),d=o.create(c*u),f=o.create(i*u),p=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(f));return!p.is0()&&o.create(p.x)===i}catch{return!1}}function A(e,t,n={}){let{prehash:r}=cY(n,m);return t=w(t,r),y.fromBytes(e,`recovered`).recoverPublicKey(t).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p,Point:e,sign:D,verify:k,recoverPublicKey:A,Signature:y,hash:t})}function xY(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:LJ(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function SY(e){let{CURVE:t,curveOpts:n}=xY(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function CY(e,t){let n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,IJ(n.Fn.ORDER,n.Fn.BITS))})}function wY(e){let{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:i}=SY(e);return CY(e,bY(gY(t,n),r,i))}function TY(e,t){let n=t=>wY({...e,hash:t});return{...n(t),create:n}}var EY={p:BigInt(`0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff`),n:BigInt(`0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551`),h:BigInt(1),a:BigInt(`0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc`),b:BigInt(`0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b`),Gx:BigInt(`0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296`),Gy:BigInt(`0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5`)},DY={p:BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff`),n:BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973`),h:BigInt(1),a:BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc`),b:BigInt(`0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef`),Gx:BigInt(`0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7`),Gy:BigInt(`0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f`)},OY={p:BigInt(`0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),n:BigInt(`0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409`),h:BigInt(1),a:BigInt(`0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc`),b:BigInt(`0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00`),Gx:BigInt(`0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66`),Gy:BigInt(`0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650`)},kY=LJ(EY.p),AY=LJ(DY.p),jY=LJ(OY.p),MY=TY({...EY,Fp:kY,lowS:!1},Ga);TY({...DY,Fp:AY,lowS:!1},qa),TY({...OY,Fp:jY,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},Ja);var NY=i(((e,t)=>{t.exports=function e(t){if(typeof t==`number`&&isNaN(t))throw Error(`NaN is not allowed`);if(typeof t==`number`&&!isFinite(t))throw Error(`Infinity is not allowed`);return typeof t!=`object`||!t?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((t,n,r)=>`${t}${r===0?``:`,`}${e(n===void 0||typeof n==`symbol`?null:n)}`,``)}]`:`{${Object.keys(t).sort().reduce((n,r)=>t[r]===void 0||typeof t[r]==`symbol`?n:`${n}${n.length===0?``:`,`}${e(r)}:${e(t[r])}`,``)}}`}})),PY=class extends Error{constructor(e){let t;t=e instanceof Error?e.message:typeof e==`string`?e:``,super(t),this.name=this.constructor.name}},FY=class extends PY{},IY=class extends PY{},LY=class extends PY{},RY=class extends PY{},zY=class extends PY{},BY=class extends PY{},VY=class extends PY{},HY=class extends PY{},UY=class extends PY{},WY=class extends PY{},GY=class extends PY{},KY=qY(globalThis,{});function qY(e,t){return new Proxy(e,{get(n,r,i){return r in t?t[r]:e[r]},set(n,r,i){return r in t&&delete t[r],e[r]=i,!0},deleteProperty(n,r){let i=!1;return r in t&&(delete t[r],i=!0),r in e&&(delete e[r],i=!0),i},ownKeys(n){let r=Reflect.ownKeys(e),i=Reflect.ownKeys(t),a=new Set(i);return[...r.filter(e=>!a.has(e)),...i]},defineProperty(n,r,i){return r in t&&delete t[r],Reflect.defineProperty(e,r,i),!0},getOwnPropertyDescriptor(n,r){return r in t?Reflect.getOwnPropertyDescriptor(t,r):Reflect.getOwnPropertyDescriptor(e,r)},has(n,r){return r in t||r in e}})}async function JY(){if(KY!==void 0&&globalThis.crypto!==void 0)return globalThis.crypto.subtle;try{let{webcrypto:e}=await import(`crypto`);return e.subtle}catch(e){throw new GY(e)}}var YY=class{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){this._api===void 0&&(this._api=await JY())}},XY={Base:0,Psk:1,Auth:2,AuthPsk:3},ZY={NotAssigned:0,DhkemP256HkdfSha256:16,DhkemP384HkdfSha384:17,DhkemP521HkdfSha512:18,DhkemSecp256k1HkdfSha256:19,DhkemX25519HkdfSha256:32,DhkemX448HkdfSha512:33,HybridkemX25519Kyber768:48,MlKem512:64,MlKem768:65,MlKem1024:66,XWing:25722},QY={HkdfSha256:1,HkdfSha384:2,HkdfSha512:3,Sha3256:4,Sha3384:5,Sha3512:6,Shake128:16,Shake256:17,TurboShake128:18,TurboShake256:19},$Y={Aes128Gcm:1,Aes256Gcm:2,Chacha20Poly1305:3,ExportOnly:65535},eX=new Uint8Array,tX=0n,nX=(()=>{let e=Array(256),t=0,n=0n;for(;t<256;)e[t]=n,t++,n+=1n;return e})(),rX=new Uint8Array([75,69,77,0,0]),iX=new Uint8Array([72,80,75,69,45,118,49]);function aX(e){return new Uint8Array(oX(e))}function oX(e){return e instanceof ArrayBuffer?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice().buffer:new Uint8Array(e).slice().buffer}var sX=class extends YY{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:QY.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:eX}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:`HMAC`,hash:`SHA-256`,length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,t){this._checkInit();let n=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+t.byteLength);return n.set(iX,0),n.set(this._suiteId,7),n.set(e,7+this._suiteId.byteLength),n.set(t,7+this._suiteId.byteLength+e.byteLength),n}buildLabeledInfo(e,t,n){this._checkInit();let r=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+t.byteLength);return r.set(new Uint8Array([0,n]),0),r.set(iX,2),r.set(this._suiteId,9),r.set(e,9+this._suiteId.byteLength),r.set(t,9+this._suiteId.byteLength+e.byteLength),r}async extract(e,t){await this._setup();let n=e.byteLength===0?new ArrayBuffer(this.hashSize):oX(e);if(n.byteLength!==this.hashSize)throw new FY(`The salt length must be the same as the hashSize`);let r=oX(t),i=await this._api.importKey(`raw`,n,this.algHash,!1,[`sign`]);return await this._api.sign(`HMAC`,i,r)}async expand(e,t,n){await this._setup();let r=oX(e),i=await this._api.importKey(`raw`,r,this.algHash,!1,[`sign`]),a=new ArrayBuffer(n),o=new Uint8Array(a),s=eX,c=aX(t),l=new Uint8Array(1);if(n>255*this.hashSize)throw Error(`Entropy limit reached`);let u=new Uint8Array(this.hashSize+c.length+1);for(let e=1,t=0;t<o.length;e++)l[0]=e,u.set(s,0),u.set(c,s.length),u.set(l,s.length+c.length),s=new Uint8Array(await this._api.sign(`HMAC`,i,u.slice(0,s.length+c.length+1))),o.length-t>=s.length?(o.set(s,t),t+=s.length):(o.set(s.slice(0,o.length-t),t),t+=o.length-t);return a}async extractAndExpand(e,t,n,r){await this._setup();let i=oX(t),a=await this._api.importKey(`raw`,i,`HKDF`,!1,[`deriveBits`]);return await this._api.deriveBits({name:`HKDF`,hash:this.algHash.hash,salt:oX(e),info:oX(n)},a,r*8)}async labeledExtract(e,t,n){return await this.extract(e,this.buildLabeledIkm(t,n))}async labeledExpand(e,t,n,r){return await this.expand(e,this.buildLabeledInfo(t,n,r),r)}_checkInit(){if(this._suiteId===eX)throw Error(`Not initialized. Call init()`)}},cX=class extends sX{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:QY.HkdfSha256}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:`HMAC`,hash:`SHA-256`,length:256}})}},lX=e=>typeof e==`object`&&!!e&&typeof e.privateKey==`object`&&typeof e.publicKey==`object`;function uX(e,t){if(t<=0)throw Error(`i2Osp: too small size`);if(e>=256**t)throw Error(`i2Osp: too large integer`);let n=new Uint8Array(t);for(let r=0;r<t&&e;r++)n[t-(r+1)]=e%256,e=Math.floor(e/256);return n}function dX(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function fX(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function pX(e,t){if(e.byteLength!==t.byteLength)throw Error(`xor: different length inputs`);let n=new Uint8Array(e.byteLength);for(let r=0;r<e.byteLength;r++)n[r]=e[r]^t[r];return n}var mX=new Uint8Array([101,97,101,95,112,114,107]),hX=new Uint8Array([115,104,97,114,101,100,95,115,101,99,114,101,116]);function gX(e,t,n){let r=new Uint8Array(e.length+t.length+n.length);return r.set(e,0),r.set(t,e.length),r.set(n,e.length+t.length),r}var _X=class{constructor(e,t,n){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e,this._prim=t,this._kdf=n;let r=new Uint8Array(rX);r.set(uX(this.id,2),3),this._kdf.init(r)}async serializePublicKey(e){return await this._prim.serializePublicKey(e)}async deserializePublicKey(e){return await this._prim.deserializePublicKey(oX(e))}async serializePrivateKey(e){return await this._prim.serializePrivateKey(e)}async deserializePrivateKey(e){return await this._prim.deserializePrivateKey(oX(e))}async importKey(e,t,n=!0){return await this._prim.importKey(e,t,n)}async generateKeyPair(){return await this._prim.generateKeyPair()}async deriveKeyPair(e){let t=oX(e);if(t.byteLength>8192)throw new FY(`Too long ikm`);return await this._prim.deriveKeyPair(t)}async encap(e){let t;t=e.ekm===void 0?await this.generateKeyPair():lX(e.ekm)?e.ekm:await this.deriveKeyPair(e.ekm);let n=await this._prim.serializePublicKey(t.publicKey),r=await this._prim.serializePublicKey(e.recipientPublicKey);try{let i;if(e.senderKey===void 0)i=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey));else{let n=lX(e.senderKey)?e.senderKey.privateKey:e.senderKey;i=dX(new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey)),new Uint8Array(await this._prim.dh(n,e.recipientPublicKey)))}let a;if(e.senderKey===void 0)a=dX(new Uint8Array(n),new Uint8Array(r));else{let t=lX(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),i=await this._prim.serializePublicKey(t);a=gX(new Uint8Array(n),new Uint8Array(r),new Uint8Array(i))}return{enc:n,sharedSecret:await this._generateSharedSecret(i,a)}}catch(e){throw new RY(e)}}async decap(e){let t=oX(e.enc),n=await this._prim.deserializePublicKey(t),r=lX(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=lX(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),a=await this._prim.serializePublicKey(i);try{let i;i=e.senderPublicKey===void 0?new Uint8Array(await this._prim.dh(r,n)):dX(new Uint8Array(await this._prim.dh(r,n)),new Uint8Array(await this._prim.dh(r,e.senderPublicKey)));let o;if(e.senderPublicKey===void 0)o=dX(new Uint8Array(t),new Uint8Array(a));else{let n=await this._prim.serializePublicKey(e.senderPublicKey);o=new Uint8Array(t.byteLength+a.byteLength+n.byteLength),o.set(new Uint8Array(t),0),o.set(new Uint8Array(a),t.byteLength),o.set(new Uint8Array(n),t.byteLength+a.byteLength)}return await this._generateSharedSecret(i,o)}catch(e){throw new zY(e)}}async _generateSharedSecret(e,t){let n=this._kdf.buildLabeledIkm(mX,e),r=this._kdf.buildLabeledInfo(hX,t,this.secretSize);return await this._kdf.extractAndExpand(eX,n,r,this.secretSize)}},vX=[`deriveBits`],yX=new Uint8Array([100,107,112,95,112,114,107]),bX=class{constructor(e){Object.defineProperty(this,"_num",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._num=new Uint8Array(e)}val(){return this._num}reset(){this._num.fill(0)}set(e){if(e.length!==this._num.length)throw Error(`Bignum.set: invalid argument`);this._num.set(e)}isZero(){for(let e=0;e<this._num.length;e++)if(this._num[e]!==0)return!1;return!0}lessThan(e){if(e.length!==this._num.length)throw Error(`Bignum.lessThan: invalid argument`);for(let t=0;t<this._num.length;t++){if(this._num[t]<e[t])return!0;if(this._num[t]>e[t])return!1}return!1}},xX=new Uint8Array([99,97,110,100,105,100,97,116,101]),SX=new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,188,230,250,173,167,23,158,132,243,185,202,194,252,99,37,81]),CX=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,199,99,77,129,244,55,45,223,88,26,13,178,72,176,167,122,236,236,25,106,204,197,41,115]),wX=new Uint8Array([1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,81,134,135,131,191,47,150,107,127,204,1,72,247,9,165,208,59,181,201,184,137,156,71,174,187,111,183,30,145,56,100,9]),TX=new Uint8Array([48,65,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,39,48,37,2,1,1,4,32]),EX=new Uint8Array([48,78,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,55,48,53,2,1,1,4,48]),DX=new Uint8Array([48,96,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,73,48,71,2,1,1,4,66]),OX={p:115792089210356248762697446949407573530086143415290314195533631308867097853951n,b:41058363725152142129326129780047268409114441015993725554835256314039467401291n,gx:48439561293906451759052585252797914202762949526041747995844080717082404635286n,gy:36134250956749795798585127919587881956611106672985015071877198253568414405109n,coordinateSize:32},kX={p:39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319n,b:27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,gx:26247035095799689268623156744566981891852923491109213387815615900925518854738050089022388053975719786650872476732087n,gy:8325710961489029985546751289520108179287853048861315594709205902480503199884419224438643760392947333078086511627871n,coordinateSize:48},AX={p:(1n<<521n)-1n,b:1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,gx:2661740802050217063228768716723360960729859168756973147706671368418802944996427808491545080627771902352094241225065558662157113545570916814161637315895999846n,gy:3757180025770020463545507224491183603594455134769762486694567779615544477440556316691234405012945539562144444537289428522585666729196580810124344277578376784n,coordinateSize:66};function jX(e,t){let n=e%t;return n>=0n?n:n+t}function MX(e,t,n){let r=1n,i=jX(e,n),a=t;for(;a>0n;)(a&1n)==1n&&(r=jX(r*i,n)),i=jX(i*i,n),a>>=1n;return r}function NX(e,t){let n=MX(e,t+1n>>2n,t);if(jX(n*n,t)!==jX(e,t))throw Error(`Invalid ECDH point`);return n}function PX(e){let t=0n;for(let n of e)t=t<<8n|nX[n];return t}function FX(e,t){let n=new Uint8Array(t),r=e;for(let e=t-1;e>=0;e--)n[e]=Number(r&255n),r>>=8n;if(r!==0n)throw Error(`Invalid coordinate length`);return n}function IX(e,t,n){let r=new Uint8Array(1+n*2);return r[0]=4,r.set(FX(e,n),1),r.set(FX(t,n),1+n),r}var LX=class extends YY{constructor(e,t){switch(super(),Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_alg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nDh",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bitmask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pkcs8AlgId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_curveParams",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,e){case ZY.DhkemP256HkdfSha256:this._alg={name:`ECDH`,namedCurve:`P-256`},this._nPk=65,this._nSk=32,this._nDh=32,this._order=SX,this._bitmask=255,this._pkcs8AlgId=TX,this._curveParams=OX;break;case ZY.DhkemP384HkdfSha384:this._alg={name:`ECDH`,namedCurve:`P-384`},this._nPk=97,this._nSk=48,this._nDh=48,this._order=CX,this._bitmask=255,this._pkcs8AlgId=EX,this._curveParams=kX;break;default:this._alg={name:`ECDH`,namedCurve:`P-521`},this._nPk=133,this._nSk=66,this._nDh=66,this._order=wX,this._bitmask=1,this._pkcs8AlgId=DX,this._curveParams=AX}}async serializePublicKey(e){await this._setup();try{return await this._api.exportKey(`raw`,e)}catch(e){throw new IY(e)}}async deserializePublicKey(e){await this._setup();try{return await this._importRawKey(oX(e),!0)}catch(e){throw new LY(e)}}async serializePrivateKey(e){await this._setup();try{let t=await this._api.exportKey(`jwk`,e);if(!(`d`in t))throw Error(`Not private key`);return fX(t.d).buffer}catch(e){throw new IY(e)}}async deserializePrivateKey(e){await this._setup();try{return await this._importRawKey(oX(e),!1)}catch(e){throw new LY(e)}}async importKey(e,t,n){await this._setup();try{if(e===`raw`)return await this._importRawKey(t,n);if(t instanceof ArrayBuffer)throw Error(`Invalid jwk key format`);return await this._importJWK(t,n)}catch(e){throw new LY(e)}}async generateKeyPair(){await this._setup();try{return await this._api.generateKey(this._alg,!0,vX)}catch(e){throw new GY(e)}}async deriveKeyPair(e){await this._setup();try{let t=oX(e),n=await this._hkdf.labeledExtract(eX,yX,new Uint8Array(t)),r=new bX(this._nSk);for(let e=0;r.isZero()||!r.lessThan(this._order);e++){if(e>255)throw Error(`Faild to derive a key pair`);let t=new Uint8Array(await this._hkdf.labeledExpand(n,xX,uX(e,1),this._nSk));t[0]&=this._bitmask,r.set(t)}let i=await this._deserializePkcs8Key(r.val());return r.reset(),{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(e){throw new WY(e)}}async derivePublicKey(e){await this._setup();try{let t=await this._api.exportKey(`jwk`,e);return delete t.d,delete t.key_ops,await this._api.importKey(`jwk`,t,this._alg,!0,[])}catch{try{return await this._derivePublicKeyWithoutJwkExport(e)}catch(e){throw new LY(e)}}}async dh(e,t){try{return await this._setup(),await this._api.deriveBits({name:`ECDH`,public:t},e,this._nDh*8)}catch(e){throw new IY(e)}}async _importRawKey(e,t){if(t&&e.byteLength!==this._nPk)throw Error(`Invalid public key for the ciphersuite`);if(!t&&e.byteLength!==this._nSk)throw Error(`Invalid private key for the ciphersuite`);return t?await this._api.importKey(`raw`,e,this._alg,!0,[]):await this._deserializePkcs8Key(new Uint8Array(e))}async _importJWK(e,t){if(e.crv===void 0||e.crv!==this._alg.namedCurve)throw Error(`Invalid crv: ${e.crv}`);if(t){if(e.d!==void 0)throw Error("Invalid key: `d` should not be set");return await this._api.importKey(`jwk`,e,this._alg,!0,[])}if(e.d===void 0)throw Error("Invalid key: `d` not found");return await this._api.importKey(`jwk`,e,this._alg,!0,vX)}async _deserializePkcs8Key(e){let t=new Uint8Array(this._pkcs8AlgId.length+e.length);return t.set(this._pkcs8AlgId,0),t.set(e,this._pkcs8AlgId.length),await this._api.importKey(`pkcs8`,t,this._alg,!0,vX)}async _derivePublicKeyWithoutJwkExport(e){let t=IX(this._curveParams.gx,this._curveParams.gy,this._curveParams.coordinateSize),n=await this._api.importKey(`raw`,t.buffer,this._alg,!0,[]),r=new Uint8Array(await this._api.deriveBits({name:`ECDH`,public:n},e,this._nDh*8)),i=this._curveParams.p,a=PX(r),o=NX(jX(MX(a,3n,i)-3n*a+this._curveParams.b,i),i);(o&1n)==1n&&(o=i-o);let s=IX(a,o,this._curveParams.coordinateSize);return await this._api.importKey(`raw`,s.buffer,this._alg,!0,[])}};function RX(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function zX(e,t=``){if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw Error(`${n}expected integer >0, got ${e}`)}}function BX(e,t,n=``){let r=RX(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function VX(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function HX(e,t){BX(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw Error(`"digestInto() output" expected to be of length >=`+n)}function UX(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function WX(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}var GX=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function KX(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function qX(e){zX(e,`numberToBigint`);let t=e,n=tX,r=1n;for(;t>0;)t%2==1&&(n+=r),t=Math.floor(t/2),r<<=1n;return n}function JX(e){return Uint8Array.from(e)}function YX(e){if(typeof e!=`boolean`)throw Error(`boolean expected, not ${e}`)}var XX=(e,t)=>{function n(n,...r){if(BX(n,void 0,`key`),!GX)throw Error(`Non little-endian hardware is not yet supported`);if(e.nonceLength!==void 0){let t=r[0];BX(t,e.varSizeNonce?void 0:e.nonceLength,`nonce`)}let i=e.tagLength;i&&r[1]!==void 0&&BX(r[1],void 0,`AAD`);let a=t(n,...r),o=(e,t)=>{if(t!==void 0){if(e!==2)throw Error(`cipher output not supported`);BX(t,void 0,`output`)}},s=!1;return{encrypt(e,t){if(s)throw Error(`cannot encrypt() twice with same key + nonce`);return s=!0,BX(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(BX(e),i&&e.length<i)throw Error(`"ciphertext" expected length bigger than tagLength=`+i);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n};function ZX(e,t){if(typeof t!=`object`||!t)throw Error(`options must be defined`);return Object.assign(e,t)}function QX(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function $X(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw Error(`"output" expected Uint8Array of length `+e+`, got: `+t.length);if(n&&!tZ(t))throw Error(`invalid output, must be aligned`);return t}function eZ(e,t,n){YX(n);let r=new Uint8Array(16),i=KX(r);return i.setBigUint64(0,qX(t),n),i.setBigUint64(8,qX(e),n),r}function tZ(e){return e.byteOffset%4==0}var nZ=e=>Uint8Array.from(e.split(``).map(e=>e.charCodeAt(0))),rZ=nZ(`expand 16-byte k`),iZ=nZ(`expand 32-byte k`),aZ=UX(rZ),oZ=UX(iZ);function sZ(e,t){return e<<t|e>>>32-t}function cZ(e){return e.byteOffset%4==0}var lZ=64,uZ=16,dZ=2**32-1,fZ=Uint32Array.of();function pZ(e,t,n,r,i,a,o,s){let c=i.length,l=new Uint8Array(lZ),u=UX(l),d=cZ(i)&&cZ(a),f=d?UX(i):fZ,p=d?UX(a):fZ;for(let m=0;m<c;o++){if(e(t,n,r,u,o,s),o>=dZ)throw Error(`arx: counter overflow`);let h=Math.min(lZ,c-m);if(d&&h===lZ){let e=m/4;if(m%4!=0)throw Error(`arx: invalid block position`);for(let t=0,n;t<uZ;t++)n=e+t,p[n]=f[n]^u[t];m+=lZ}else{for(let e=0,t;e<h;e++)t=m+e,a[t]=i[t]^l[e];m+=h}}}function mZ(e,t){let{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:a,rounds:o}=ZX({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!=`function`)throw Error(`core must be a function`);return zX(i),zX(o),YX(a),YX(n),(t,s,c,l,u=0)=>{BX(t,void 0,`key`),BX(s,void 0,`nonce`),BX(c,void 0,`data`);let d=c.length;if(l===void 0&&(l=new Uint8Array(d)),BX(l,void 0,`output`),zX(u),u<0||u>=dZ)throw Error(`arx: counter overflow`);if(l.length<d)throw Error(`arx: output (${l.length}) is shorter than data (${d})`);let f=[],p=t.length,m,h;if(p===32)f.push(m=JX(t)),h=oZ;else if(p===16&&n)m=new Uint8Array(32),m.set(t),m.set(t,16),h=aZ,f.push(m);else throw BX(t,32,`arx key`),Error(`invalid key size`);cZ(s)||f.push(s=JX(s));let g=UX(m);if(r){if(s.length!==24)throw Error(`arx: extended nonce must be 24 bytes`);r(h,g,UX(s.subarray(0,16)),g),s=s.subarray(16)}let _=16-i;if(_!==s.length)throw Error(`arx: nonce must be ${_} or 16 bytes`);if(_!==12){let e=new Uint8Array(12);e.set(s,a?0:12-s.length),s=e,f.push(s)}let v=UX(s);return pZ(e,h,g,v,c,l,u,o),WX(...f),l}}function hZ(e,t){return e[t++]&255|(e[t++]&255)<<8}var gZ=class{constructor(e){Object.defineProperty(this,"blockLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"outputLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:new Uint8Array(16)}),Object.defineProperty(this,"r",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"h",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"pad",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(8)}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"finished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),e=JX(BX(e,32,`key`));let t=hZ(e,0),n=hZ(e,2),r=hZ(e,4),i=hZ(e,6),a=hZ(e,8),o=hZ(e,10),s=hZ(e,12),c=hZ(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|n<<3)&8191,this.r[2]=(n>>>10|r<<6)&7939,this.r[3]=(r>>>7|i<<9)&8191,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|o<<2)&8191,this.r[7]=(o>>>11|s<<5)&8065,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=hZ(e,16+2*t)}process(e,t,n=!1){let r=n?0:2048,{h:i,r:a}=this,o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],f=a[6],p=a[7],m=a[8],h=a[9],g=hZ(e,t+0),_=hZ(e,t+2),v=hZ(e,t+4),y=hZ(e,t+6),b=hZ(e,t+8),x=hZ(e,t+10),S=hZ(e,t+12),C=hZ(e,t+14),w=i[0]+(g&8191),E=i[1]+((g>>>13|_<<3)&8191),D=i[2]+((_>>>10|v<<6)&8191),O=i[3]+((v>>>7|y<<9)&8191),k=i[4]+((y>>>4|b<<12)&8191),A=i[5]+(b>>>1&8191),j=i[6]+((b>>>14|x<<2)&8191),M=i[7]+((x>>>11|S<<5)&8191),N=i[8]+((S>>>8|C<<8)&8191),P=i[9]+(C>>>5|r),F=0,ee=F+w*o+5*h*E+5*m*D+5*p*O+5*f*k;F=ee>>>13,ee&=8191,ee+=5*d*A+5*u*j+5*l*M+5*c*N+5*s*P,F+=ee>>>13,ee&=8191;let te=F+w*s+E*o+5*h*D+5*m*O+5*p*k;F=te>>>13,te&=8191,te+=5*f*A+5*d*j+5*u*M+5*l*N+5*c*P,F+=te>>>13,te&=8191;let I=F+w*c+E*s+D*o+5*h*O+5*m*k;F=I>>>13,I&=8191,I+=5*p*A+5*f*j+5*d*M+5*u*N+5*l*P,F+=I>>>13,I&=8191;let L=F+w*l+E*c+D*s+O*o+5*h*k;F=L>>>13,L&=8191,L+=5*m*A+5*p*j+5*f*M+5*d*N+5*u*P,F+=L>>>13,L&=8191;let ne=F+w*u+E*l+D*c+O*s+k*o;F=ne>>>13,ne&=8191,ne+=5*h*A+5*m*j+5*p*M+5*f*N+5*d*P,F+=ne>>>13,ne&=8191;let re=F+w*d+E*u+D*l+O*c+k*s;F=re>>>13,re&=8191,re+=A*o+5*h*j+5*m*M+5*p*N+5*f*P,F+=re>>>13,re&=8191;let ie=F+w*f+E*d+D*u+O*l+k*c;F=ie>>>13,ie&=8191,ie+=A*s+j*o+5*h*M+5*m*N+5*p*P,F+=ie>>>13,ie&=8191;let ae=F+w*p+E*f+D*d+O*u+k*l;F=ae>>>13,ae&=8191,ae+=A*c+j*s+M*o+5*h*N+5*m*P,F+=ae>>>13,ae&=8191;let oe=F+w*m+E*p+D*f+O*d+k*u;F=oe>>>13,oe&=8191,oe+=A*l+j*c+M*s+N*o+5*h*P,F+=oe>>>13,oe&=8191;let se=F+w*h+E*m+D*p+O*f+k*d;F=se>>>13,se&=8191,se+=A*u+j*l+M*c+N*s+P*o,F+=se>>>13,se&=8191,F=(F<<2)+F|0,F=F+ee|0,ee=F&8191,F>>>=13,te+=F,i[0]=ee,i[1]=te,i[2]=I,i[3]=L,i[4]=ne,i[5]=re,i[6]=ie,i[7]=ae,i[8]=oe,i[9]=se}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=r*5,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let t=1;t<10;t++)n[t]=e[t]+r,r=n[t]>>>13,n[t]&=8191;n[9]-=8192;let i=(r^1)-1;for(let e=0;e<10;e++)n[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|n[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let a=e[0]+t[0];e[0]=a&65535;for(let n=1;n<8;n++)a=(e[n]+t[n]|0)+(a>>>16)|0,e[n]=a&65535;WX(n)}update(e){VX(this),BX(e),e=JX(e);let{buffer:t,blockLen:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(n-this.pos,r-i);if(a===n)for(;n<=r-i;i+=n)this.process(e,i);else t.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){WX(this.h,this.r,this.buffer,this.pad)}digestInto(e){VX(this),HX(e,this),this.finished=!0;let{buffer:t,h:n}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=n[t]>>>0,e[i++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}};function _Z(e){let t=(t,n)=>e(n).update(t).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}var vZ=_Z(e=>new gZ(e));function yZ(e,t,n,r,i,a=20){let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=t[2],p=t[3],m=t[4],h=t[5],g=t[6],_=t[7],v=i,y=n[0],b=n[1],x=n[2],S=o,C=s,w=c,E=l,D=u,O=d,k=f,A=p,j=m,M=h,N=g,P=_,F=v,ee=y,te=b,I=x;for(let e=0;e<a;e+=2)S=S+D|0,F=sZ(F^S,16),j=j+F|0,D=sZ(D^j,12),S=S+D|0,F=sZ(F^S,8),j=j+F|0,D=sZ(D^j,7),C=C+O|0,ee=sZ(ee^C,16),M=M+ee|0,O=sZ(O^M,12),C=C+O|0,ee=sZ(ee^C,8),M=M+ee|0,O=sZ(O^M,7),w=w+k|0,te=sZ(te^w,16),N=N+te|0,k=sZ(k^N,12),w=w+k|0,te=sZ(te^w,8),N=N+te|0,k=sZ(k^N,7),E=E+A|0,I=sZ(I^E,16),P=P+I|0,A=sZ(A^P,12),E=E+A|0,I=sZ(I^E,8),P=P+I|0,A=sZ(A^P,7),S=S+O|0,I=sZ(I^S,16),N=N+I|0,O=sZ(O^N,12),S=S+O|0,I=sZ(I^S,8),N=N+I|0,O=sZ(O^N,7),C=C+k|0,F=sZ(F^C,16),P=P+F|0,k=sZ(k^P,12),C=C+k|0,F=sZ(F^C,8),P=P+F|0,k=sZ(k^P,7),w=w+A|0,ee=sZ(ee^w,16),j=j+ee|0,A=sZ(A^j,12),w=w+A|0,ee=sZ(ee^w,8),j=j+ee|0,A=sZ(A^j,7),E=E+D|0,te=sZ(te^E,16),M=M+te|0,D=sZ(D^M,12),E=E+D|0,te=sZ(te^E,8),M=M+te|0,D=sZ(D^M,7);let L=0;r[L++]=o+S|0,r[L++]=s+C|0,r[L++]=c+w|0,r[L++]=l+E|0,r[L++]=u+D|0,r[L++]=d+O|0,r[L++]=f+k|0,r[L++]=p+A|0,r[L++]=m+j|0,r[L++]=h+M|0,r[L++]=g+N|0,r[L++]=_+P|0,r[L++]=v+F|0,r[L++]=y+ee|0,r[L++]=b+te|0,r[L++]=x+I|0}var bZ=mZ(yZ,{counterRight:!1,counterLength:4,allowShortKeys:!1}),xZ=new Uint8Array(16),SZ=(e,t)=>{e.update(t);let n=t.length%16;n&&e.update(xZ.subarray(n))},CZ=new Uint8Array(32);function wZ(e,t,n,r,i){i!==void 0&&BX(i,void 0,`AAD`);let a=e(t,n,CZ),o=eZ(r.length,i?i.length:0,!0),s=vZ.create(a);i&&SZ(s,i),SZ(s,r),s.update(o);let c=s.digest();return WX(a,o),c}var TZ=XX({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,n,r)=>({encrypt(i,a){let o=i.length;a=$X(o+16,a,!1),a.set(i);let s=a.subarray(0,-16);e(t,n,s,s,1);let c=wZ(e,t,n,s,r);return a.set(c,o),WX(c),a},decrypt(i,a){a=$X(i.length-16,a,!1);let o=i.subarray(0,-16),s=i.subarray(-16),c=wZ(e,t,n,o,r);if(!QX(s,c))throw Error(`invalid tag`);return a.set(i.subarray(0,-16)),e(t,n,a,a,1),WX(c),a}}))(bZ)),EZ=class{constructor(e){Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._key=new Uint8Array(oX(e))}async seal(e,t,n){return await this._seal(oX(e),oX(t),oX(n))}async open(e,t,n){return await this._open(oX(e),oX(t),oX(n))}_seal(e,t,n){return new Promise(r=>{r(TZ(this._key,new Uint8Array(e),new Uint8Array(n)).encrypt(new Uint8Array(t)).buffer)})}_open(e,t,n){return new Promise(r=>{r(TZ(this._key,new Uint8Array(e),new Uint8Array(n)).decrypt(new Uint8Array(t)).buffer)})}},DZ=class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:$Y.Chacha20Poly1305}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new EZ(e)}};function OZ(){return new Promise((e,t)=>{t(new GY(`Not supported`))})}var kZ=new Uint8Array([115,101,99]),AZ=class{constructor(e,t,n){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exporterSecret",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._api=e,this._kdf=t,this.exporterSecret=n}async seal(e,t){return await OZ()}async open(e,t){return await OZ()}async export(e,t){let n=oX(e);if(n.byteLength>8192)throw new FY(`Too long exporter context`);try{return await this._kdf.labeledExpand(this.exporterSecret,kZ,new Uint8Array(n),t)}catch(e){throw new BY(e)}}},jZ=class extends AZ{},MZ=class extends AZ{constructor(e,t,n,r){super(e,t,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=r}},NZ=class extends AZ{constructor(e,t,n){if(super(e,t,n.exporterSecret),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nN",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nT",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n.key===void 0||n.baseNonce===void 0||n.seq===void 0)throw Error(`Required parameters are missing`);this._aead=n.aead,this._nK=this._aead.keySize,this._nN=this._aead.nonceSize,this._nT=this._aead.tagSize;let r=this._aead.createEncryptionContext(n.key);this._ctx={key:r,baseNonce:n.baseNonce,seq:n.seq}}computeNonce(e){let t=uX(e.seq,e.baseNonce.byteLength);return pX(e.baseNonce,t).buffer}incrementSeq(e){if(e.seq>2**53-1)throw new UY(`Message limit reached`);e.seq+=1}},PZ=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},FZ=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},IZ,LZ=class{constructor(){IZ.set(this,Promise.resolve())}async lock(){let e,t=new Promise(t=>{e=t}),n=PZ(this,IZ,`f`);return FZ(this,IZ,t,`f`),await n,e}};IZ=new WeakMap;var RZ=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},zZ=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},BZ,VZ=class extends NZ{constructor(){super(...arguments),BZ.set(this,void 0)}async open(e,t=eX.buffer){zZ(this,BZ,RZ(this,BZ,`f`)??new LZ,`f`);let n=await RZ(this,BZ,`f`).lock(),r;try{r=await this._ctx.key.open(this.computeNonce(this._ctx),oX(e),oX(t))}catch(e){throw new HY(e)}finally{n()}return this.incrementSeq(this._ctx),r}};BZ=new WeakMap;var HZ=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},UZ=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},WZ,GZ=class extends NZ{constructor(e,t,n,r){super(e,t,n),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),WZ.set(this,void 0),this.enc=r}async seal(e,t=eX.buffer){UZ(this,WZ,HZ(this,WZ,`f`)??new LZ,`f`);let n=await HZ(this,WZ,`f`).lock(),r;try{r=await this._ctx.key.seal(this.computeNonce(this._ctx),oX(e),oX(t))}catch(e){throw new VY(e)}finally{n()}return this.incrementSeq(this._ctx),r}};WZ=new WeakMap;var KZ=new Uint8Array([98,97,115,101,95,110,111,110,99,101]),qZ=new Uint8Array([101,120,112]),JZ=new Uint8Array([105,110,102,111,95,104,97,115,104]),YZ=new Uint8Array([107,101,121]),XZ=new Uint8Array([112,115,107,95,105,100,95,104,97,115,104]),ZZ=new Uint8Array([115,101,99,114,101,116]),QZ=new Uint8Array([72,80,75,69,0,0,0,0,0,0]),$Z=class extends YY{constructor(e){if(super(),Object.defineProperty(this,"_kem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof e.kem==`number`)throw new FY(`KemId cannot be used`);if(this._kem=e.kem,typeof e.kdf==`number`)throw new FY(`KdfId cannot be used`);if(this._kdf=e.kdf,typeof e.aead==`number`)throw new FY(`AeadId cannot be used`);this._aead=e.aead,this._suiteId=new Uint8Array(QZ),this._suiteId.set(uX(this._kem.id,2),4),this._suiteId.set(uX(this._kdf.id,2),6),this._suiteId.set(uX(this._aead.id,2),8),this._kdf.init(this._suiteId)}get kem(){return this._kem}get kdf(){return this._kdf}get aead(){return this._aead}async createSenderContext(e){this._validateInputLength(e),await this._setup();let t=await this._kem.encap(e),n;return n=e.psk===void 0?e.senderKey===void 0?XY.Base:XY.Auth:e.senderKey===void 0?XY.Psk:XY.AuthPsk,await this._keyScheduleS(n,t.sharedSecret,t.enc,e)}async createRecipientContext(e){this._validateInputLength(e),await this._setup();let t=await this._kem.decap(e),n;return n=e.psk===void 0?e.senderPublicKey===void 0?XY.Base:XY.Auth:e.senderPublicKey===void 0?XY.Psk:XY.AuthPsk,await this._keyScheduleR(n,t,e)}async seal(e,t,n=eX.buffer){let r=await this.createSenderContext(e);return{ct:await r.seal(t,n),enc:r.enc}}async open(e,t,n=eX.buffer){return await(await this.createRecipientContext(e)).open(t,n)}async _keySchedule(e,t,n){let r=n.psk===void 0?eX:aX(n.psk.id),i=await this._kdf.labeledExtract(eX,XZ,r),a=n.info===void 0?eX:aX(n.info),o=await this._kdf.labeledExtract(eX,JZ,a),s=new Uint8Array(1+i.byteLength+o.byteLength);s.set(new Uint8Array([e]),0),s.set(new Uint8Array(i),1),s.set(new Uint8Array(o),1+i.byteLength);let c=n.psk===void 0?eX:aX(n.psk.key),l=this._kdf.buildLabeledIkm(ZZ,c),u=this._kdf.buildLabeledInfo(qZ,s,this._kdf.hashSize),d=await this._kdf.extractAndExpand(t,l,u,this._kdf.hashSize);if(this._aead.id===$Y.ExportOnly)return{aead:this._aead,exporterSecret:d};let f=this._kdf.buildLabeledInfo(YZ,s,this._aead.keySize),p=await this._kdf.extractAndExpand(t,l,f,this._aead.keySize),m=this._kdf.buildLabeledInfo(KZ,s,this._aead.nonceSize),h=await this._kdf.extractAndExpand(t,l,m,this._aead.nonceSize);return{aead:this._aead,exporterSecret:d,key:p,baseNonce:new Uint8Array(h),seq:0}}async _keyScheduleS(e,t,n,r){let i=await this._keySchedule(e,t,r);return i.key===void 0?new MZ(this._api,this._kdf,i.exporterSecret,n):new GZ(this._api,this._kdf,i,n)}async _keyScheduleR(e,t,n){let r=await this._keySchedule(e,t,n);return r.key===void 0?new jZ(this._api,this._kdf,r.exporterSecret):new VZ(this._api,this._kdf,r)}_validateInputLength(e){if(e.info!==void 0&&e.info.byteLength>268435456)throw new FY(`Too long info`);if(e.psk!==void 0){if(e.psk.key.byteLength<32)throw new FY(`PSK must have at least 32 bytes`);if(e.psk.key.byteLength>8192)throw new FY(`Too long psk.key`);if(e.psk.id.byteLength>8192)throw new FY(`Too long psk.id`)}}},eQ=class extends _X{constructor(){let e=new cX,t=new LX(ZY.DhkemP256HkdfSha256,e);super(ZY.DhkemP256HkdfSha256,t,e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ZY.DhkemP256HkdfSha256}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}},tQ=class extends $Z{},nQ=class extends eQ{},rQ=class extends cX{},iQ=e(NY(),1);function aQ(){let e=globalThis.crypto?.subtle;if(!e)throw Error("`crypto.subtle` is not defined as a global; Either run in a runtime that provides WebCrypto, or polyfill `globalThis.crypto`");return e}function oQ(e){let t=e.replace(uQ,``).replace(lQ,``),n=Buffer.from(t,`base64`),r=n.indexOf(Buffer.from([4,32]));if(r===-1)throw Error(`Invalid wallet authorization private key`);let i=n.subarray(r+2,r+34);return MY.Point.Fn.fromBytes(i)}async function sQ(){let e=new tQ({kem:new nQ,kdf:new rQ,aead:new DZ}),t=await e.kem.generateKeyPair(),n=await aQ().exportKey(`spki`,t.publicKey);return{publicKeySpki:new Uint8Array(n),decryptPayload:async(n,r)=>{let i=await(await e.createRecipientContext({recipientKey:t.privateKey,enc:n})).open(r);return new Uint8Array(i)}}}async function cQ(){let e=new tQ({kem:new nQ,kdf:new rQ,aead:new DZ});return{encryptPayload:async(t,n)=>{let r=await e.kem.deserializePublicKey(t),i=await e.createSenderContext({recipientPublicKey:r}),a=await i.seal(n);return{ciphertext:new Uint8Array(a),encapsulatedKey:new Uint8Array(i.enc)}}}}var lQ=`wallet-api:`,uQ=`wallet-auth:`;function dQ(e){let t=e.body;typeof t==`object`&&t&&Object.keys(t).length===0&&(e.body=``);let n=(0,iQ.default)(e);if(!n)throw new EB(`Failed to serialize request for authorization signature`);return new TextEncoder().encode(n)}async function fQ(e,{authorizationContext:t,input:n}){let r=dQ(n),i=t.user_jwts??[],a=[];i.length>0&&(a=await Promise.all(i.map(t=>e._jwtExchange().exchangeJwtForAuthorizationKey(t))));let o=[...t.authorization_private_keys??[],...a].map(e=>mQ({authorizationPrivateKey:e,input:r})),s=await Promise.all((t.sign_fns??[]).map(e=>e(r)));return[...t.signatures??[],...o,...s]}async function pQ(e,t,{authorizationContext:n={},idempotencyKey:r,requestExpiry:i,method:a,url:o,body:s}){let c=String(i);return{headers:{"privy-authorization-signature":(await fQ(e,{authorizationContext:n,input:{version:1,method:a,url:o,body:s,headers:{"privy-app-id":t,...r&&{"privy-idempotency-key":r},...i&&{"privy-request-expiry":c}}}})).join(`,`),...r&&{"privy-idempotency-key":r},...i&&{"privy-request-expiry":c}}}}function mQ({authorizationPrivateKey:e,input:t}){let n=t instanceof Uint8Array?t:dQ(t),r=oQ(e),i=MY.sign(Ga(n),r).toBytes(`der`);return Buffer.from(i).toString(`base64`)}function hQ(e){let{entropy:t,entropyType:n,chainType:r}=e;if(typeof t!=`string`)return t;switch(n){case`hd`:return new TextEncoder().encode(t);case`private-key`:if(r===`ethereum`||r===`tron`||r===`sui`||r===`aptos`||r===`xrpl`)try{let e=t.startsWith(`0x`)?t.slice(2):t;return new Uint8Array(Buffer.from(e,`hex`))}catch{throw new EB(`Invalid private key: ${r} entropy must be hex encoded`)}if(r===`solana`)try{return JM.decode(t)}catch{throw new EB(`Invalid private key: Solana entropy must be base58 encoded`)}if(r===`stellar`)return KM.decode(t).slice(1,33);throw new EB(`Invalid chain type for imports: ${r}`);default:throw new EB(`Invalid entropy type: ${n}`)}}var gQ=class extends zH{constructor(e,t){super(e),this.privyClient=t}async create(e,{authorization_context:t={},idempotency_key:n,request_expiry:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:r??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/deposit_accounts/crypto`,body:i});return await this._create(e,{...i,...a})}},_Q=class extends BH{constructor(e,t){super(e),this.crypto=new gQ(e,t)}},vQ=class extends VH{constructor(e,t){super(e),this.privyClient=t}async claim(e,{authorization_context:t={},idempotency_key:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/earn/ethereum/incentive/claim`,body:r});return await this._claim(e,{...r,...i})}},yQ=class extends HH{constructor(e,t){super(e),this.privyClient=t,this.incentiveService=new vQ(e,t)}incentive(){return this.incentiveService}async deposit(e,{authorization_context:t={},idempotency_key:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/earn/ethereum/deposit`,body:r});return await this._deposit(e,{...r,...i})}async withdraw(e,{authorization_context:t={},idempotency_key:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/earn/ethereum/withdraw`,body:r});return await this._withdraw(e,{...r,...i})}},bQ=class extends UH{constructor(e,t){super(e),this.ethereumService=new yQ(e,t)}ethereum(){return this.ethereumService}},xQ=class{constructor(e){this.privyWalletsService=e}async signMessage(e,{message:t,...n}){let r;return r=t instanceof Uint8Array?{message:Buffer.from(t).toString(`hex`),encoding:`hex`}:t.startsWith(`0x`)?{message:t.slice(2),encoding:`hex`}:{message:t,encoding:`utf-8`},(await this.privyWalletsService.rpc(e,{...n,params:r,method:`personal_sign`,chain_type:`ethereum`})).data}async signSecp256k1(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`secp256k1_sign`,chain_type:`ethereum`})).data}async sign7702Authorization(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`eth_sign7702Authorization`,chain_type:`ethereum`})).data}async signTransaction(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`eth_signTransaction`,chain_type:`ethereum`})).data}async signTypedData(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`eth_signTypedData_v4`,chain_type:`ethereum`})).data}async signUserOperation(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`eth_signUserOperation`,chain_type:`ethereum`})).data}async sendTransaction(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`eth_sendTransaction`,chain_type:`ethereum`})).data}async sendCalls(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`wallet_sendCalls`,chain_type:`ethereum`})).data}},SQ=class{constructor(e){this.privyWalletsService=e}async signMessage(e,{message:t,...n}){let r;return r=t instanceof Uint8Array?{message:Buffer.from(t).toString(`base64`),encoding:`base64`}:{message:t,encoding:`base64`},(await this.privyWalletsService.rpc(e,{...n,method:`signMessage`,chain_type:`solana`,params:r})).data}async signTransaction(e,{transaction:t,...n}){let r;return r=t instanceof Uint8Array?{transaction:Buffer.from(t).toString(`base64`),encoding:`base64`}:{transaction:t,encoding:`base64`},(await this.privyWalletsService.rpc(e,{...n,method:`signTransaction`,chain_type:`solana`,params:r})).data}async signAndSendTransaction(e,{transaction:t,...n}){let r;return r=t instanceof Uint8Array?{transaction:Buffer.from(t).toString(`base64`),encoding:`base64`}:{transaction:t,encoding:`base64`},(await this.privyWalletsService.rpc(e,{...n,method:`signAndSendTransaction`,chain_type:`solana`,params:r})).data}},CQ=class{constructor(e){this.privyWalletsService=e}async signTransaction(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`tron_signTransaction`})).data}async sendTransaction(e,t){return(await this.privyWalletsService.rpc(e,{...t,method:`tron_sendTransaction`})).data}},wQ=class extends WH{constructor(e,t){super(e),this.privyClient=t}async create(e,{authorization_context:t={},idempotency_key:n,request_expiry:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:r??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/payout/fiat`,body:i});return await this._create(e,{...i,...a})}},TQ=class extends GH{constructor(e,t){super(e),this.fiatService=new wQ(e,t)}fiat(){return this.fiatService}},EQ=class{constructor(e,t){this.swapResource=new FH(e),this.privyClient=t,this.appID=e.appID,this.baseURL=e.baseURL}async execute(e,{authorization_context:t={},idempotency_key:n,...r}){let{headers:i}=await pQ(this.privyClient,this.appID,{authorizationContext:t,idempotencyKey:n,method:`POST`,url:`${this.baseURL}/v1/wallets/${e}/swap`,body:r});return await this.swapResource.execute(e,{...r,...i})}async quote(e,{authorization_context:t={},...n}){let{headers:r}=await pQ(this.privyClient,this.appID,{authorizationContext:t,method:`POST`,url:`${this.baseURL}/v1/wallets/${e}/swap/quote`,body:n});return await this.swapResource.quote(e,{...n,...r})}},DQ=class extends KH{constructor(e,t){super(e),this.privyClient=t,this.depositAccounts=new _Q(e,t),this.payoutService=new TQ(e,t),this.ethereumService=new xQ(this),this.solanaService=new SQ(this),this.tronService=new CQ(this),this.earnService=new bQ(e,t),this.swapsService=new EQ(e,t)}earn(){return this.earnService}payout(){return this.payoutService}ethereum(){return this.ethereumService}solana(){return this.solanaService}tron(){return this.tronService}swaps(){return this.swapsService}create({idempotency_key:e,...t}){return super.create({...t,...e&&{"privy-idempotency-key":e}})}async rpc(e,{authorization_context:t={},idempotency_key:n,request_expiry:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:r??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/rpc`,body:i});return await this._rpc(e,{...i,...a})}async rawSign(e,{authorization_context:t={},idempotency_key:n,request_expiry:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,idempotencyKey:n,requestExpiry:r??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/raw_sign`,body:i});return(await this._rawSign(e,{...i,...a})).data}async update(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`PATCH`,url:`${this._client.baseURL}/v1/wallets/${e}`,body:r});return await this._update(e,{...r,...i})}async transfer(e,{authorization_context:t={},...n}){let{headers:r}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/transfer`,body:n});return await this._transfer(e,{...n,...r})}async export(e,{authorization_context:t={},request_expiry:n,...r}){let{publicKeySpki:i,decryptPayload:a}=await sQ(),o={...r,encryption_type:`HPKE`,recipient_public_key:Buffer.from(i).toString(`base64`)},{headers:s}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/wallets/${e}/export`,body:o}),c=await this._export(e,{...o,...s}),l=await a(Buffer.from(c.encapsulated_key,`base64`),Buffer.from(c.ciphertext,`base64`));return{private_key:new TextDecoder().decode(l)}}async exportPrivateKey(e,t){return this.export(e,{...t,export_seed_phrase:!1})}async exportSeedPhrase(e,t){let{private_key:n}=await this.export(e,{...t,export_seed_phrase:!0});return{seed_phrase:n}}async import({wallet:{private_key:e,...t},...n}){let r=await cQ(),i=hQ({entropy:e,entropyType:t.entropy_type,chainType:t.chain_type}),a=await this._initImport({...t,encryption_type:`HPKE`});if(a.encryption_type!==`HPKE`)throw new EB(`Invalid encryption type: ${a.encryption_type}`);let o=Buffer.from(a.encryption_public_key,`base64`),{encapsulatedKey:s,ciphertext:c}=await r.encryptPayload(o,i);return await this._submitImport({...n,wallet:{...t,encryption_type:`HPKE`,encapsulated_key:Buffer.from(s).toString(`base64`),ciphertext:Buffer.from(c).toString(`base64`)}})}},OQ=class extends TH{constructor(e,t){super(e),this.privyClient=t}create({idempotency_key:e,...t}){return super.create({...t,...e&&{"privy-idempotency-key":e}})}async update(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`PATCH`,url:`${this._client.baseURL}/v1/policies/${e}`,body:r});return await this._update(e,{...r,...i})}async delete(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`DELETE`,url:`${this._client.baseURL}/v1/policies/${e}`,body:r});return await this._delete(e,{...r,...i})}async createRule(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`POST`,url:`${this._client.baseURL}/v1/policies/${e}/rules`,body:r});return await this._createRule(e,{...r,...i})}async updateRule(e,{authorization_context:t={},request_expiry:n,policy_id:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`PATCH`,url:`${this._client.baseURL}/v1/policies/${r}/rules/${e}`,body:i});return await this._updateRule(e,{...i,policy_id:r,...a})}async deleteRule(e,{authorization_context:t={},request_expiry:n,policy_id:r,...i}){let{headers:a}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`DELETE`,url:`${this._client.baseURL}/v1/policies/${r}/rules/${e}`,body:i});return await this._deleteRule(e,{...i,policy_id:r,...a})}},kQ=class extends OH{},AQ=class extends vH{constructor(e,t){super(e),this.privyClient=t}async update(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`PATCH`,url:`${this._client.baseURL}/v1/key_quorums/${e}`,body:r});return await this._update(e,{...r,...i})}async delete(e,{authorization_context:t={},request_expiry:n,...r}){let{headers:i}=await pQ(this.privyClient,this._client.appID,{authorizationContext:t,requestExpiry:n??this.privyClient.getRequestExpiry(),method:`DELETE`,url:`${this._client.baseURL}/v1/key_quorums/${e}`,body:r});return await this._delete(e,{...r,...i})}};function jQ(e){let t=PQ(e);return{id:e.sub,created_at:parseInt(e.cr),is_guest:e.guest===`t`,linked_accounts:MQ(e),...t?{custom_metadata:t}:{},has_accepted_terms:!1,mfa_methods:[]}}function MQ(e){let t=e.linked_accounts;if(typeof t!=`string`)throw new FQ(`Unable to parse identity token`);let n=JSON.parse(t);if(!Array.isArray(n))throw new FQ(`Unable to parse identity token`);return n.map(NQ).filter(e=>e!==null)}function NQ(e){if(e.type===`email`)return{type:`email`,address:e.address,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv};if(e.type===`phone`)return{type:`phone`,phoneNumber:e.phone_number,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv};if(e.type===`wallet`)return e.wallet_client_type===`privy`?{type:`wallet`,wallet_client_type:`privy`,wallet_client:`privy`,connector_type:`embedded`,id:e.id,address:e.address,chain_type:e.chain_type,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv,chain_id:``,delegated:!1,imported:!1,public_key:``,wallet_index:0,recovery_method:e.id?`privy-v2`:`privy`}:{type:`wallet`,wallet_client:`unknown`,address:e.address,chain_type:e.chain_type,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv};if(e.type===`smart_wallet`)return{type:`smart_wallet`,address:e.address,smart_wallet_type:e.smart_wallet_type,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv};if(e.type===`farcaster`)return{type:`farcaster`,fid:e.fid,username:e.username,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv,owner_address:e.oa};if(e.type===`google_oauth`)return{type:`google_oauth`,subject:e.subject,email:e.email,name:e.name,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv};if(e.type===`twitter_oauth`){let t=e.pfp?e.pfp:null;return t?.startsWith(`default`)?t=`https://abs.twimg.com/sticky/default_profile_images/${t}`:t?.startsWith(`https://`)||(t=`https://pbs.twimg.com/profile_images/${t}`),{type:`twitter_oauth`,subject:e.subject,username:e.username,name:e.name?e.name:null,profile_picture_url:t,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}}return e.type===`discord_oauth`?{type:`discord_oauth`,subject:e.subject,username:e.username,email:null,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`github_oauth`?{type:`github_oauth`,subject:e.subject,username:e.username,email:null,name:null,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`spotify_oauth`?{type:`spotify_oauth`,subject:e.subject,email:null,name:null,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`instagram_oauth`?{type:`instagram_oauth`,subject:e.subject,username:e.username,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`tiktok_oauth`?{type:`tiktok_oauth`,subject:e.subject,username:e.username,name:null,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`linkedin_oauth`?{type:`linkedin_oauth`,subject:e.subject,email:e.email,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`apple_oauth`?{type:`apple_oauth`,subject:e.subject,email:e.email,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`cross_app`?{type:`cross_app`,subject:e.subject,provider_app_id:e.provider_app_id,embedded_wallets:e.embedded_wallets,smart_wallets:e.smart_wallets,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`custom_auth`?{type:`custom_auth`,custom_user_id:e.custom_user_id,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`telegram`?{type:`telegram`,telegram_user_id:e.telegram_user_id,username:e.username,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv}:e.type===`passkey`?{type:`passkey`,credential_id:e.credential_id,first_verified_at:null,verified_at:e.lv,latest_verified_at:e.lv,enrolled_in_mfa:!1}:null}function PQ(e){let t=e.custom_metadata;if(t===void 0)return;if(typeof t!=`string`)throw new FQ(`Unable to parse identity token`);let n=JSON.parse(t);if(!n||typeof n!=`object`)throw new FQ(`Unable to parse identity token`);return n}var FQ=class extends EB{},IQ=`ES256`,LQ=`privy.io`;async function RQ(e,t,n){let r;return r=await Zr(e,n,{typ:`JWT`,algorithms:[IQ],issuer:LQ,audience:t}).catch(WQ),r}async function zQ({access_token:e,app_id:t,verification_key:n}){let r=await RQ(e,t,typeof n==`string`?await _r(n,IQ):n);return{app_id:HQ(r.payload.aud),issuer:HQ(r.payload.iss),issued_at:UQ(r.payload.iat),expiration:UQ(r.payload.exp),session_id:HQ(r.payload.sid),user_id:HQ(r.payload.sub)}}async function BQ({identity_token:e,app_id:t,verification_key:n}){let r=await RQ(e,t,typeof n==`string`?await _r(n,IQ):n);if(!r.payload)throw new VQ(`Unable to parse identity token`);return jQ(r.payload)}var VQ=class extends EB{};function HQ(e){if(!e||typeof e!=`string`)throw new VQ(`Token's payload is invalid`);return e}function UQ(e){if(!e||typeof e!=`number`)throw new VQ(`Token's payload is invalid`);return e}function WQ(e){throw e instanceof oi?new VQ(`Authentication token expired`):e instanceof Pr||e instanceof hr?new VQ(`Authentication token is invalid`):new VQ(`Failed to verify authentication token`)}function GQ({appId:e,apiUrl:t,headers:n,verificationKeyOverride:r}){if(r!==void 0){let e;return async()=>{if(e===void 0)try{e=await _r(r,IQ)}catch{throw new VQ(`Failed to import the provided verification key override`)}return e}}return Ab(new URL(`${t}/v1/apps/${e}/jwks.json`),{cacheMaxAge:36e5,cooldownDuration:6e5,headers:n})}var KQ=class extends jH{constructor(e,t){super(e),this.appJwks=t}async get({id_token:e}){return BQ({identity_token:e,app_id:this._client.appID,verification_key:this.appJwks})}},qQ=class extends sH{constructor(e){super(e)}async getAllowlist(){return this.allowlist.list(this._client.appID)}async inviteToAllowlist(e){return this.allowlist.create(this._client.appID,e)}async removeFromAllowlist(e){return this.allowlist.delete(this._client.appID,e)}async getSettings(){return this.get(this._client.appID)}async getTestAccessToken(e){let{data:t}=await this.getTestCredentials(this._client.appID);if(!t||t.length===0)throw Error(`No test accounts found for this app. Create test accounts in the Privy dashboard.`);let n;if(e&&`email`in e){if(n=t.find(t=>t.email===e.email),!n)throw Error(`No test account found with email "${e.email}". Available: ${t.map(e=>e.email).join(`, `)}`)}else if(e&&`phone_number`in e){if(n=t.find(t=>t.phone_number===e.phone_number),!n)throw Error(`No test account found with phone number "${e.phone_number}". Available: ${t.map(e=>e.phone_number).join(`, `)}`)}else n=t[0];let r=await this._client.post(`/v1/passwordless/authenticate`,{body:{email:n.email,code:n.otp_code}});if(!r.token)throw Error(`Unable to authenticate with the test account.`);return{access_token:r.token}}},JQ=class extends _H{constructor(e,t){super(e),this.privyClient=t}rpc(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.rpc(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}createPolicyRule(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.createPolicyRule(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}deletePolicyRule(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.deletePolicyRule(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}updatePolicy(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.updatePolicy(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}updatePolicyRule(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.updatePolicyRule(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}updateWallet(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.updateWallet(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}updateKeyQuorum(e,{request_expiry:t,...n}){let r=t??this.privyClient.getIntentRequestExpiry();return super.updateKeyQuorum(e,{...n,...r!=null&&{"privy-request-expiry":String(r)}})}},YQ=class extends wH{constructor(e){super(e)}},XQ=class{constructor(e,t){this.appJwks=t,this.privyAppID=e.appID}async verifyAccessToken(e){return zQ({access_token:e,app_id:this.privyAppID,verification_key:this.appJwks})}async verifyAuthToken(e){return this.verifyAccessToken(e)}async verifyIdentityToken(e){return BQ({identity_token:e,app_id:this.privyAppID,verification_key:this.appJwks})}},ZQ=class{constructor(){this.formatRequestForAuthorizationSignature=dQ}},QQ=class{constructor(e){this.generateAuthorizationSignature=mQ,this.privyClient=e}generateAuthorizationSignatures(...e){return fQ(this.privyClient,...e)}},$Q=class{constructor(e,t,n){this._requestSigner=new QQ(t),this._requestFormatter=new ZQ,this._auth=new XQ(e,n)}requestSigner(){return this._requestSigner}requestFormatter(){return this._requestFormatter}auth(){return this._auth}},e$={hasSubscribers:!1},t$=e$,n$=e$,r$=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,i$=()=>t$.hasSubscribers||n$.hasSubscribers,a$=new Set,o$=typeof process==`object`&&process?process:{},s$=(e,t,n,r)=>{typeof o$.emitWarning==`function`?o$.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},c$=e=>!a$.has(e),l$=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),u$=e=>l$(e)?e<=256?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?d$:null:null,d$=class extends Array{constructor(e){super(e),this.fill(0)}},f$=class e{heap;length;static#e=!1;static create(t){let n=u$(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},p$=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,n,r,i)=>e.#U(t,n,r,i),moveToTail:t=>e.#X(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:h=0,sizeCalculation:g,fetchMethod:_,memoMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:S,ignoreFetchAbort:C,backgroundFetchSize:w=1,perf:E}=t;if(this.backgroundFetchSize=w,E!==void 0&&typeof E?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=E??r$,n!==0&&!l$(n))throw TypeError(`max option must be a nonnegative integer`);let D=n?u$(n):Array;if(!D)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=m,this.maxEntrySize=h||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(v!==void 0&&typeof v!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=v,_!==void 0&&typeof _!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=_,this.#w=!!_,this.#u=new Map,this.#d=Array.from({length:n}).fill(void 0),this.#f=Array.from({length:n}).fill(void 0),this.#p=new D(n),this.#m=new D(n),this.#h=0,this.#g=0,this.#_=f$.create(n),this.#c=0,this.#l=0,typeof l==`function`&&(this.#n=l),typeof u==`function`&&(this.#r=u),typeof d==`function`?(this.#i=d,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.#t!==0&&!l$(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!l$(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=l$(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!l$(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;c$(t)&&(a$.add(t),s$(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new d$(this.#e),t=new d$(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=n,this.#A=(n,i,a=this.#s.now())=>{t[n]=i===0?0:a,e[n]=i,r(n,i)},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now(),r(n,e[n])};let r=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let i=setTimeout(()=>{this.#j(e)?(this.#Z(this.#d[e],`expire`),n[e]=void 0):r(e,o(e))},t+1);i.unref&&i.unref(),n[e]=i}}:()=>{};this.#k=(n,r)=>{if(e[r]){let o=e[r],s=t[r];if(!o||!s)return;n.ttl=o,n.start=s,n.now=i||a(),n.remainingTTL=o-(n.now-s)}};let i=0,a=()=>{let e=this.#s.now();if(this.ttlResolution>0){i=e;let t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#u.get(e);return t===void 0?0:o(t)};let o=n=>{let r=e[n],o=t[n];return!r||!o?1/0:r-((i||a())-o)};this.#j=n=>{let r=t[n],o=e[n];return!!o&&!!r&&(i||a())-r>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new d$(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(!l$(n)){if(this.#W(t))return this.backgroundFetchSize;if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!l$(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#B(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#h);)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#g);)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.#J(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#Z(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#W(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#W(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.#z(t,n.value,n)}}set(e,t,n={}){let{status:r=t$.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op=`set`,r.key=e,t!==void 0&&(r.value=t),r.cache=this);let i=this.#z(e,t,n);return r&&t$.hasSubscribers&&t$.publish(r),i}#z(e,t,n,r){let{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:c}=n,l=this.#W(t);if(t===void 0)return c&&(c.set=`deleted`),this.delete(e),this;let{noUpdateTTL:u=this.noUpdateTTL}=n;c&&!l&&(c.value=t);let d=this.#F(e,t,n.size||0,s,c);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#Z(e,`set`),c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this;let f=this.#c===0?void 0:this.#u.get(e);if(f===void 0)f=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#B(!1):this.#c:this.#_.pop(),this.#d[f]=e,this.#f[f]=t,this.#u.set(e,f),this.#p[this.#g]=f,this.#m[f]=this.#g,this.#g=f,this.#c++,this.#P(f,d,c),c&&(c.set=`add`),u=!1,this.#E&&!l&&this.#r?.(t,e,`add`);else{this.#X(f);let n=this.#f[f];if(t!==n){if(!o){if(this.#W(n)){n!==r&&n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:i}=n;i!==void 0&&i!==t&&(this.#C&&this.#n?.(i,e,`set`),this.#T&&this.#v?.push([i,e,`set`]))}else this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`])}if(this.#N(f),this.#P(f,d,c),this.#f[f]=t,!l){let r=n&&this.#W(n)?n.__staleWhileFetching:n,i=r===void 0?`add`:t===r?`update`:`replace`;c&&(c.set=i,r!==void 0&&(c.oldValue=r)),this.#E&&this.onInsert?.(t,e,i)}}else l||(c&&(c.set=`update`),this.#E&&this.onInsert?.(t,e,`update`))}if(i!==0&&!this.#x&&this.#D(),this.#x&&(u||this.#A(f,i,a),c&&this.#k(c,f)),!o&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#B(!0),this.#W(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#B(e){let t=this.#h,n=this.#d[t],r=this.#f[t],i=this.#W(r);i&&r.__abortController.abort(Error(`evicted`));let a=i?r.__staleWhileFetching:r;return(this.#C||this.#T)&&a!==void 0&&(this.#C&&this.#n?.(a,n,`evict`),this.#T&&this.#v?.push([a,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{status:n=t$.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`has`,n.key=e,n.cache=this);let r=this.#V(e,t);return t$.hasSubscribers&&t$.publish(n),r}#V(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#W(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{status:n=i$()?{}:void 0}=t;n&&(n.op=`peek`,n.key=e,n.cache=this),t.status=n;let r=this.#H(e,t);return t$.hasSubscribers&&t$.publish(n),r}#H(e,t){let{status:n,allowStale:r=this.allowStale}=t,i=this.#u.get(e);if(i===void 0||!r&&this.#j(i)){n&&(n.peek=i===void 0?`miss`:`stale`);return}let a=this.#f[i],o=this.#W(a)?a.__staleWhileFetching:a;return n&&(o===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=o)),o}#U(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#W(i))return i;let a=new AbortController,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason,l);let d=f,p=this.#f[t];return(p===f||p===void 0&&c&&i)&&(r===void 0?d.__staleWhileFetching===void 0?this.#Z(e,`fetch`):this.#f[t]=d.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.#z(e,r,s.options,d))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e,!1)),u=(r,i)=>{let{aborted:o}=a.signal,s=o&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=f;if(this.#f[t]===f&&(!l||!i&&u.__staleWhileFetching===void 0?this.#Z(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}),o&&o instanceof Promise?o.then(e=>t(e===void 0?void 0:e),r):o!==void 0&&t(o)};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.#z(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#W(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=n$.hasSubscribers,{status:r=i$()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#G(e,t);return r&&n&&(r.trace=!0,n$.tracePromise(()=>i,r).catch(()=>{})),i}async#G(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(g&&(g.op=`fetch`,g.key=e,h&&(g.forceRefresh=!0),g.cache=this),!this.#w)return g&&(g.fetch=`get`),this.#J(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#U(e,y,v,m);return t.__returned=t}{let t=this.#f[y];if(this.#W(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#X(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#U(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let n=n$.hasSubscribers,{status:r=i$()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#K(e,t);return r&&n&&(r.trace=!0,n$.tracePromise(()=>i,r).catch(()=>{})),i}async#K(e,t={}){let n=await this.#G(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let{status:n=t$.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`memo`,n.key=e,t.context&&(n.context=t.context),n.cache=this);let r=this.#q(e,t);return n&&(n.value=r),t$.hasSubscribers&&t$.publish(n),r}#q(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,status:i,forceRefresh:a,...o}=t;i&&a&&(i.forceRefresh=!0);let s=this.#J(e,o),c=a||s===void 0;if(i&&(i.memo=c?`miss`:`hit`,c||(i.value=s)),!c)return s;let l=n(e,s,{options:o,context:r});return i&&(i.value=l),this.#z(e,l,o),l}get(e,t={}){let{status:n=t$.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`get`,n.key=e,n.cache=this);let r=this.#J(e,t);return n&&(r!==void 0&&(n.value=r),t$.hasSubscribers&&t$.publish(n)),r}#J(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o===void 0){a&&(a.get=`miss`);return}let s=this.#f[o],c=this.#W(s);return a&&this.#k(a,o),this.#j(o)?c?(a&&(a.get=`stale-fetching`),n&&s.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#Z(e,`expire`),a&&(a.get=`stale`),n?(a&&(a.returnedStale=!0),s):void 0):(a&&(a.get=c?`fetching`:`hit`),this.#X(o),r&&this.#O(o),c?s.__staleWhileFetching:s)}#Y(e,t){this.#m[t]=e,this.#p[e]=t}#X(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#Y(this.#m[e],this.#p[e]),this.#Y(this.#g,e),this.#g=e)}delete(e){return this.#Z(e,`delete`)}#Z(e,t){t$.hasSubscribers&&t$.publish({op:`delete`,delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0){if(this.#S?.[r]&&(clearTimeout(this.#S[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(r);let n=this.#f[r];if(this.#W(n)?n.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#Q(`delete`)}#Q(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#W(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}},m$=class{constructor(e,t){this._hpkeRecipient=null,this.walletsService=e,this.jwtCache=new p$({max:t})}async getHpkeRecipient(){return this._hpkeRecipient||=await sQ(),this._hpkeRecipient}async exchangeJwtForAuthorizationKey(e){let t=this.jwtCache.get(e);if(t)return t;let{publicKeySpki:n,decryptPayload:r}=await this.getHpkeRecipient(),i=await this.walletsService.authenticateWithJwt({user_jwt:e,encryption_type:`HPKE`,recipient_public_key:Buffer.from(n).toString(`base64`)});if(`encrypted_authorization_key`in i&&i.encrypted_authorization_key.encryption_type===`HPKE`){let t=i.encrypted_authorization_key,n=await r(Buffer.from(t.encapsulated_key,`base64`),Buffer.from(t.ciphertext,`base64`)),a=new TextDecoder().decode(n);return this.jwtCache.set(e,a,{ttl:i.expires_at-Date.now()}),a}throw new EB(`JWT exchange failed: unsupported encryption type`)}},h$=1e3,g$=9e5,_$=2592e5,v$=class{_jwtExchange(){return this.jwtExchangeService}constructor({appId:e,appSecret:t,apiUrl:n,authorizationKeyCacheMaxCapacity:r=h$,defaultRequestExpiryMs:i,disableRequestExpiry:a,requestExpiry:o,defaultHeaders:s,jwtVerificationKey:c,webhookSigningSecret:l,...u}){this.privyApiClient=new iU({...u,appID:e,appSecret:t,baseURL:n,defaultHeaders:{...s,"privy-client":`node:${YB}`}});let d=GQ({appId:this.privyApiClient.appID,apiUrl:this.privyApiClient.baseURL,headers:{"privy-client":`node:${YB}`},verificationKeyOverride:c});this._disableRequestExpiry=o?.disabled??a??!1,this._defaultRequestExpiryMs=o?.defaultMs??i??g$,this._defaultIntentRequestExpiryMs=o?.defaultIntentMs??_$,this.jwtExchangeService=new m$(this.privyApiClient.wallets,r),this.walletsService=new DQ(this.privyApiClient,this),this.policiesService=new OQ(this.privyApiClient,this),this.transactionsService=new kQ(this.privyApiClient),this.keyQuorumsService=new AQ(this.privyApiClient,this),this.intentsService=new JQ(this.privyApiClient,this),this.usersService=new KQ(this.privyApiClient,d),this.organizationsService=new YQ(this.privyApiClient),this.appsService=new qQ(this.privyApiClient),this.utilsService=new $Q(this.privyApiClient,this,d),this.webhooksService=new Kq(this.privyApiClient.webhooks,l)}webhooks(){return this.webhooksService}wallets(){return this.walletsService}policies(){return this.policiesService}transactions(){return this.transactionsService}keyQuorums(){return this.keyQuorumsService}intents(){return this.intentsService}users(){return this.usersService}organizations(){return this.organizationsService}apps(){return this.appsService}utils(){return this.utilsService}getRequestExpiry(e){if(!this._disableRequestExpiry)return Date.now()+(e??this._defaultRequestExpiryMs)}getIntentRequestExpiry(e){if(!this._disableRequestExpiry)return Date.now()+(e??this._defaultIntentRequestExpiryMs)}};function y$(){return ga(Ya.utils.randomPrivateKey())}function b$(e){if(typeof e==`string`){if(!Ta(e,{strict:!1}))throw new wa({address:e});return{address:e,type:`json-rpc`}}if(!Ta(e.address,{strict:!1}))throw new wa({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:`custom`,type:`local`}}var x$=!1;async function S$({hash:e,privateKey:t,to:n=`object`}){let{r,s:i,recovery:a}=Ya.sign(e.slice(2),t.slice(2),{lowS:!0,extraEntropy:ia(x$,{strict:!1})?sa(x$):x$}),o={r:ua(r,{size:32}),s:ua(i,{size:32}),v:a?28n:27n,yParity:a};return n===`bytes`||n===`hex`?ce({...o,to:n}):o}async function C$(e){let{chainId:t,nonce:n,privateKey:r,to:i=`object`}=e,a=e.contractAddress??e.address,o=await S$({hash:ee({address:a,chainId:t,nonce:n}),privateKey:r,to:i});return i===`object`?{address:a,chainId:t,nonce:n,...o}:o}async function w$({message:e,privateKey:t}){return await S$({hash:Ot(e),privateKey:t,to:`hex`})}async function T$(e){let{privateKey:t,transaction:n,serializer:r=m}=e,i=n.type===`eip4844`?{...n,sidecars:!1}:n;return await r(n,await S$({hash:ba(await r(i)),privateKey:t}))}async function E$(e){let{privateKey:t,...n}=e;return await S$({hash:u(n),privateKey:t,to:`hex`})}function D$(e,t={}){let{nonceManager:n}=t,r=ga(Ya.getPublicKey(e.slice(2),!1));return{...b$({address:ne(r),nonceManager:n,async sign({hash:t}){return S$({hash:t,privateKey:e,to:`hex`})},async signAuthorization(t){return C$({...t,privateKey:e})},async signMessage({message:t}){return w$({message:t,privateKey:e})},async signTransaction(t,{serializer:n}={}){return T$({privateKey:e,transaction:t,serializer:n})},async signTypedData(t){return E$({...t,privateKey:e})}}),publicKey:r,source:`privateKey`}}var O$=e=>`0x${e.toString(16)}`,k$=e=>typeof e==`bigint`?O$(e):e;function A$(e,t){let n=e.account,r=t??n;return r?.source===`accessKey`||De({...e,...r?{account:r}:{}})}function j$(e){let t={type:118,calls:(e.calls?.length?e.calls:[{to:e.to,data:e.data,value:e.value}]).map(e=>{if(!e.to)throw new EB("Tempo transaction calls require a `to` address.");return{to:e.to,...e.data===void 0?{}:{data:e.data},...e.value===void 0?{}:{value:k$(e.value)}}})};return e.chainId!==void 0&&(t.chain_id=e.chainId),e.nonce!==void 0&&(t.nonce=e.nonce),e.nonceKey!==void 0&&e.nonceKey!==`random`&&(t.nonce_key=k$(e.nonceKey)),e.validAfter!==void 0&&(t.valid_after=k$(e.validAfter)),e.validBefore!==void 0&&(t.valid_before=k$(e.validBefore)),e.feeToken!==void 0&&(t.fee_token=M$(e.feeToken)),e.from!==void 0&&(t.from=e.from),e.gas!==void 0&&(t.gas_limit=k$(e.gas)),e.maxFeePerGas!==void 0&&(t.max_fee_per_gas=k$(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.max_priority_fee_per_gas=k$(e.maxPriorityFeePerGas)),e.accessList&&(t.access_list=e.accessList.map(e=>({address:e.address,storage_keys:[...e.storageKeys]}))),e.feePayerSignature&&(t.fee_payer_signature=N$(e.feePayerSignature)),t}var M$=e=>typeof e==`string`?e:`0x20c0${e.toString(16).padStart(36,`0`)}`,N$=e=>{let t=e.yParity===void 0?e.v===void 0?void 0:Number(e.v)-27:e.yParity;if(t!==0&&t!==1)throw new EB(`Tempo signatures require a valid yParity value.`);return{r:e.r,s:e.s,y_parity:t}};function P$(e,{walletId:t,address:n,authorizationContext:r,signatureOptions:i}){return b$({address:n,sign:async({hash:n})=>(await e.wallets().ethereum().signSecp256k1(t,{params:{hash:n},...r?{authorization_context:r}:{}})).signature,signMessage:async({message:n})=>(await e.wallets().ethereum().signMessage(t,{message:I$(n),...r?{authorization_context:r}:{}})).signature,signTypedData:async n=>{let{message:a,domain:o,types:s,primaryType:c}=R$(n,ga);if(!o)throw new EB(`typedData.domain must be defined`);if(!a||!s)throw new EB(`typedData.message must be defined`);let l=o.chainId,u=i?.type===`erc1271`&&l?`eip155:${l}`:void 0,{signature:d}=await e.wallets().ethereum().signTypedData(t,{params:{typed_data:{domain:o,message:a,primary_type:c,types:s}},...i?{signature_options:i}:{},...u?{caip2:u}:{},...r?{authorization_context:r}:{}});return d},signTransaction:async n=>{let{signed_transaction:i}=await e.wallets().ethereum().signTransaction(t,{params:{transaction:L$(n)},...r?{authorization_context:r}:{}});return i},signAuthorization:async n=>{let{authorization:i}=await e.wallets().ethereum().sign7702Authorization(t,{params:{contract:n.contractAddress??n.address,chain_id:n.chainId,nonce:n.nonce},...r?{authorization_context:r}:{}});return{address:i.contract,nonce:Number(i.nonce),chainId:Number(i.chain_id),yParity:i.y_parity,r:i.r,s:i.s}}})}function F$(e){if(e===`legacy`)return 0;if(e===`eip2930`)return 1;if(e==`eip1559`||e===void 0)return 2;if(e===`tempo`)return 118;throw new EB(`EIP4844 and EIP7702 transaction types are not yet supported.`)}var I$=e=>typeof e==`string`?e:typeof e.raw==`string`?Uint8Array.from(Buffer.from(e.raw.slice(2),`hex`)):e.raw,L$=e=>{if(A$(e))return j$(e);let t=e;return{type:F$(t.type),...t.to?{to:t.to}:{},...t.nonce?{nonce:t.nonce}:{},...t.chainId?{chain_id:t.chainId}:{},...t.data?{data:t.data}:{},...t.value?{value:O$(t.value)}:{},...t.gas?{gas_limit:O$(t.gas)}:{},...t.gasPrice?{gas_price:O$(t.gasPrice)}:{},...t.maxFeePerGas?{max_fee_per_gas:O$(t.maxFeePerGas)}:{},...t.maxPriorityFeePerGas?{max_priority_fee_per_gas:O$(t.maxPriorityFeePerGas)}:{}}},R$=(e,t)=>typeof e==`bigint`?t(e):Array.isArray(e)?e.map(e=>R$(e,t)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,R$(n,t)])):e,z$=class extends Error{name=`Privy.SigningKeyMissingError`;constructor(){super(`Missing PRIVY_JWT_PRIVATE_KEY. Set the RS256 private key whose public half each Privy app trusts.`)}},B$=60;async function V$(e,t){let{app:n,userId:r}=t,i=await Z(e,J$(e,{app:n,userId:r}),`Privy.findUser`)??await Z(e,q$(e,{app:n,userId:r}),`Privy.createUser`);return X$(i)[0]??await Z(e,G$(e,{app:n,privyUserId:i.id}),`Privy.addWallet`)}(function(e){e.errors=HN.errors})(V$||={});async function H$(e,t){let n=await Z(e,J$(e,t),`Privy.findUser`);return n?X$(n):[]}(function(e){e.errors=HN.errors})(H$||={});async function U$(e,t){let{app:n,privateKey:r,userId:i}=t;if(!r)throw new z$;let a=await crypto.subtle.importKey(`pkcs8`,new Uint8Array(fe(r.replace(/-----[^-]+-----|\s/g,``))),{hash:`SHA-256`,name:`RSASSA-PKCS1-v1_5`},!0,[`sign`]),o=await crypto.subtle.exportKey(`jwk`,a),s=Math.floor(Date.now()/1e3);return(await e.api.signJWT({body:{overrideOptions:{adapter:{getJwks:()=>[{alg:`RS256`,createdAt:new Date(0),id:`privy`,privateKey:JSON.stringify(o),publicKey:JSON.stringify({e:o.e,kty:o.kty,n:o.n})}]},jwks:{disablePrivateKeyEncryption:!0,keyPairConfig:{alg:`RS256`}}},payload:{aud:n.appId,exp:s+B$,iat:s,sub:i}}})).token}function W$(e){let{app:t,token:n,wallet:r}=e;return rt({owners:[P$(K$(t),{address:r.address,...n?{authorizationContext:{user_jwts:[n]}}:{},walletId:r.id})]})}async function G$(e,t){for(let n=1;;n++){let r=await Z(e,K$(t.app).wallets().create({chain_type:`ethereum`,idempotency_key:`tempo-id:first-wallet:${t.privyUserId}`,owner:{user_id:t.privyUserId}}),`privy.wallets.create`).catch(e=>{if(!(n<G$.attempts&&Y$(e)))throw e});if(r)return{address:r.address,createdAt:new Date(r.created_at),id:r.id};await Z(e,new Promise(e=>setTimeout(e,G$.interval)),`Privy.addWallet.wait`)}}(function(e){e.attempts=10,e.interval=250})(G$||={});function K$(e){return new v$({appId:e.appId,appSecret:e.appSecret,maxRetries:1,timeout:8e3})}async function q$(e,t){return await Z(e,K$(t.app).users().create({linked_accounts:[{custom_user_id:t.userId,type:`custom_auth`}]}),`privy.users.create`).catch(async n=>{let r=await Z(e,J$(e,t),`Privy.findUser`);if(!r)throw n;return r})}async function J$(e,t){return await Z(e,K$(t.app).users().getByCustomAuthID({custom_user_id:t.userId}),`privy.users.get`).catch(e=>{if(!(e instanceof Error&&`status`in e&&e.status===404))throw e})}function Y$(e){return e instanceof Error&&`status`in e&&e.status===400&&e.message.includes(`idempotency key is still in progress`)}function X$(e){return e.linked_accounts.flatMap(e=>e.type===`wallet`&&`chain_type`in e&&e.chain_type===`ethereum`&&`connector_type`in e&&e.connector_type===`embedded`&&`id`in e&&e.id?[{...e,id:e.id}]:[]).sort((e,t)=>(e.wallet_index??0)-(t.wallet_index??0)).reduce((t,n)=>{let r=typeof n.first_verified_at==`number`?new Date(n.first_verified_at*1e3):t.at(-1)?.createdAt??new Date(e.created_at*1e3);return[...t,{address:n.address,createdAt:r,id:n.id}]},[])}var Z$=dL({errors:HN.errors,async load(e,t){let{db:n,env:r,realms:i,userId:a}=t,o=await Z(e,_B(n,{realms:i,secret:r.SECRET}),`Realm.privyApps`),s=(e,t,n)=>uL({account:W$({app:e,wallet:n}),createdAt:n.createdAt,realm:t,async signer(t,i){return W$({app:e,token:await Z(t,U$(i.auth,{app:e,privateKey:r.PRIVY_JWT_PRIVATE_KEY,userId:a}),`Privy.token`),wallet:n}).owners[0]},type:`privy`});return{create(e){let t=o.get(e.id);if(t)return async n=>{let r=await Z(n,V$(n,{app:t,userId:a}),`Privy.firstWallet`);return s(t,e,r)}},async list(e){return fL(await Promise.all(i.map(async t=>{let n=o.get(t.id);return n?(await Z(e,H$(e,{app:n,userId:a}),`Privy.listWallets`)).map(e=>s(n,t,e)):[]})))}}},type:`privy`}),Q$=class extends Error{name=`Secp256k1.SignerRequiredError`;constructor(){super(`The account of a secp256k1 owner signs nothing. Sign with the owner's signer.`)}},$$=dL({errors:[],load(e,t){let{env:n,userId:r}=t,i=t.realms.filter(e=>e.secp256k1),a=(e,t)=>uL({account:rt({owners:[e1(e.address)]}),createdAt:e.createdAt,realm:t,async signer(){return D$(await bn({data:e.privateKey,key:n.SECRET}))},type:`secp256k1`});return Promise.resolve({create(e){if(i.some(t=>t.id===e.id))return async i=>{let o=y$();await Z(i,t.db.insert(CM).values({address:D$(o).address,privateKey:await Dn({data:o,key:n.SECRET}),realmId:e.id,userId:r}).onConflictDoNothing(),`db.secp256k1Owner.insert`);let[s]=await Z(i,t.db.select().from(CM).where(tA(Y(CM.userId,r),Y(CM.realmId,e.id))),`db.secp256k1Owner.get`);return a(s,e)}},async list(e,t){return i.length===0?[]:(await Z(e,t.db.select().from(CM).where(tA(Y(CM.userId,r),cA(CM.realmId,i.map(e=>e.id)))).orderBy(bA(CM.createdAt),bA(CM.realmId)),`db.secp256k1Owner.list`)).map(e=>a(e,i.find(t=>t.id===e.realmId)))}})},type:`secp256k1`});function e1(e){let t=()=>Promise.reject(new Q$);return b$({address:e,signMessage:t,signTransaction:t,signTypedData:t})}var t1=class extends NN(`foreign_account`){name=`TempoAccount.ForeignAccountError`;constructor(e){super({error_description:`Access denied to Tempo Account ${e.account}. Name one of the user's accounts in the app's realms.`,field:e.field??`account`,meta:{account:e.account}})}},n1=[bB,Z$,$$],r1;(function(e){let t=Bt([`0x`,z().regex(/^[0-9a-fA-F]{40}$/)]).meta({description:`A 20-byte address.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),n=e.realm=B({id:z().meta({description:"The realm ID, such as `default` or `tempo-cash`.",examples:[`tempo-cash`]}),name:z().meta({description:"The realm display name, such as `Tempo Cash`.",examples:[`Tempo Cash`]})}).meta({description:`A realm, which holds Tempo Accounts. An app reaches only the accounts of its realms.`,id:`Realm`});e.tempoAccount=B({address:t.meta({description:`The account address. Until configurable accounts ship, the owner acts as the account.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),config:B({owners:en(B({owner:t.meta({description:`The address of the owner key.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),type:Wt(n1.map(e=>e.type)).meta({description:"Who holds the owner key: a Privy wallet (`privy`), a key that Tempo ID holds in development (`secp256k1`), or a passkey (`webAuthn`), which signs only in the browser.",examples:[`webAuthn`]}),weight:Gt().meta({description:"The owner's signing weight, which counts toward `threshold`.",examples:[1]})}).meta({description:`One key that signs for the account.`})).readonly().meta({description:`The keys that sign for the account.`}),salt:Bt([`0x`,z()]).meta({description:`The 32-byte salt that the account address derives from, as hex.`,examples:[`0x${`0`.repeat(64)}`]}),threshold:Gt().meta({description:`The total owner weight that a signature needs to act for the account.`,examples:[1]}),version:Bt([`0x`,z()]).meta({description:`The configuration version, as a hex quantity.`,examples:[`0x0`]})}).meta({description:`The account configuration (TIP-1107): its owners, salt, threshold, and version.`}),realm:n}).meta({description:`A configurable Tempo Account (TIP-1107) and its configuration.`,id:`TempoAccount`})})(r1||={});async function i1(e,t){let{db:n,realms:r,userId:i}=t,a=await Z(e,s1(e,t),`TempoAccount.load`),o=await Z(e,c1(e,{db:n,loaded:a}),`TempoAccount.owners`);if(o.length>0)return o;let s=e=>{for(let t of a){let n=t.create?.(e);if(n)return n}},c=r[0];if(!c||!s(c))return[];let l=await n.transaction(async t=>{await Z(e,pL(t,{userId:i}),`db.account.lock`);let n=await Z(e,t.select({realmId:gM.realmId}).from(gM).where(tA(Y(gM.userId,i),cA(gM.realmId,r.map(e=>e.id)))),`db.account.claims`),o=r.find(e=>n.some(t=>t.realmId===e.id)&&s(e));if(o)return{realm:o};let l=await Z(e,c1(e,{db:t,loaded:a.filter(e=>!e.create)}),`TempoAccount.linked`);return l.length>0?{linked:l}:(await Z(e,t.insert(gM).values({realmId:c.id,userId:i}).onConflictDoNothing(),`db.account.claim`),{realm:c})});return`linked`in l?l.linked:[await Z(e,s(l.realm)(e),`TempoAccount.createOwner`)]}(function(e){e.errors=[...bB.errors,...Z$.errors,...$$.errors]})(i1||={});async function a1(e,t){let n=await Z(e,s1(e,t),`TempoAccount.load`);return await Z(e,c1(e,{db:t.db,loaded:n}),`TempoAccount.owners`)}(function(e){e.errors=i1.errors})(a1||={});async function o1(e,t){return(await Z(e,a1(e,t),`TempoAccount.held`)).map(l1)}(function(e){e.errors=i1.errors})(o1||={});async function s1(e,t){return await Promise.all(n1.map(n=>n.load(e,t)))}async function c1(e,t){let{db:n}=t;return fL(await Promise.all(t.loaded.map(t=>t.list(e,{db:n}))))}function l1(e){let t=ft(e.account.config);return r1.tempoAccount.parse({address:e.account.owners[0].address,config:{...t,owners:t.owners.map(t=>({...t,type:e.type}))},realm:{id:e.realm.id,name:e.realm.name}})}var u1=r({"module.exports":()=>po}),d1=n(()=>{}),f1=i((e=>{e.parse=function(e,n){return new t(e,n).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e===`\\`?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded.join(``),t===`NULL`&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if(this.source[0]===`[`)for(;!this.isEof()&&this.nextCharacter().value!==`=`;);}parse(t){var n,r,i;for(this.consumeDimensions();!this.isEof();)if(n=this.nextCharacter(),n.value===`{`&&!i)this.dimension++,this.dimension>1&&(r=new e(this.source.substr(this.position-1),this.transform),this.entries.push(r.parse(!0)),this.position+=r.position-2);else if(n.value===`}`&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else n.value===`"`&&!n.escaped?(i&&this.newEntry(!0),i=!i):n.value===`,`&&!i?this.newEntry():this.record(n.value);if(this.dimension!==0)throw Error(`array dimension not balanced`);return this.entries}};function n(e){return e}})),p1=i(((e,t)=>{var n=f1();t.exports={create:function(e,t){return{parse:function(){return n.parse(e,t)}}}}})),m1=i(((e,t)=>{var n=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,r=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,a=/^-?infinity$/;t.exports=function(e){if(a.test(e))return Number(e.replace(`i`,`I`));var t=n.exec(e);if(!t)return o(e)||null;var r=!!t[8],i=parseInt(t[1],10);r&&(i=c(i));var u=parseInt(t[2],10)-1,d=t[3],f=parseInt(t[4],10),p=parseInt(t[5],10),m=parseInt(t[6],10),h=t[7];h=h?1e3*parseFloat(h):0;var g,_=s(e);return _==null?(g=new Date(i,u,d,f,p,m,h),l(i)&&g.setFullYear(i)):(g=new Date(Date.UTC(i,u,d,f,p,m,h)),l(i)&&g.setUTCFullYear(i),_!==0&&g.setTime(g.getTime()-_)),g};function o(e){var t=r.exec(e);if(t){var n=parseInt(t[1],10);t[4]&&(n=c(n));var i=parseInt(t[2],10)-1,a=t[3],o=new Date(n,i,a);return l(n)&&o.setFullYear(n),o}}function s(e){if(e.endsWith(`+00`))return 0;var t=i.exec(e.split(` `)[1]);if(t){var n=t[1];if(n===`Z`)return 0;var r=n===`-`?-1:1;return(parseInt(t[2],10)*3600+parseInt(t[3]||0,10)*60+parseInt(t[4]||0,10))*r*1e3}}function c(e){return-(e-1)}function l(e){return e>=0&&e<100}})),h1=i(((e,t)=>{t.exports=r;var n=Object.prototype.hasOwnProperty;function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e}})),g1=i(((e,t)=>{var n=h1();t.exports=r;function r(e){if(!(this instanceof r))return new r(e);n(this,g(e))}var i=[`seconds`,`minutes`,`hours`,`days`,`months`,`years`];r.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&e.indexOf(`seconds`)<0&&e.push(`seconds`),e.length===0?`0`:e.map(function(e){var t=this[e]||0;return e===`seconds`&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,``)),t+` `+e},this).join(` `)};var a={years:`Y`,months:`M`,days:`D`,hours:`H`,minutes:`M`,seconds:`S`},o=[`years`,`months`,`days`],s=[`hours`,`minutes`,`seconds`];r.prototype.toISOString=r.prototype.toISO=function(){var e=o.map(n,this).join(``),t=s.map(n,this).join(``);return`P`+e+`T`+t;function n(e){var t=this[e]||0;return e===`seconds`&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,``)),t+a[e]}};var c=`([+-]?\\d+)`,l=c+`\\s+years?`,u=c+`\\s+mons?`,d=c+`\\s+days?`,f=new RegExp([l,u,d,`([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?`].map(function(e){return`(`+e+`)?`}).join(`\\s*`)),p={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},m=[`hours`,`minutes`,`seconds`,`milliseconds`];function h(e){var t=e+`000000`.slice(e.length);return parseInt(t,10)/1e3}function g(e){if(!e)return{};var t=f.exec(e),n=t[8]===`-`;return Object.keys(p).reduce(function(e,r){var i=t[p[r]];return!i||(i=r===`milliseconds`?h(i):parseInt(i,10),!i)||(n&&~m.indexOf(r)&&(i*=-1),e[r]=i),e},{})}})),_1=i(((e,t)=>{var n=Buffer.from||Buffer;t.exports=function(e){if(/^\\x/.test(e))return n(e.substr(2),`hex`);for(var t=``,r=0;r<e.length;)if(e[r]!==`\\`)t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var i=1;r+i<e.length&&e[r+i]===`\\`;)i++;for(var a=0;a<Math.floor(i/2);++a)t+=`\\`;r+=Math.floor(i/2)*2}return n(t,`binary`)}})),v1=i(((e,t)=>{var n=f1(),r=p1(),i=m1(),a=g1(),o=_1();function s(e){return function(t){return t===null?t:e(t)}}function c(e){return e===null?e:e===`TRUE`||e===`t`||e===`true`||e===`y`||e===`yes`||e===`on`||e===`1`}function l(e){return e?n.parse(e,c):null}function u(e){return parseInt(e,10)}function d(e){return e?n.parse(e,s(u)):null}function f(e){return e?n.parse(e,s(function(e){return b(e).trim()})):null}var p=function(e){return e?r.create(e,function(e){return e!==null&&(e=S(e)),e}).parse():null},m=function(e){return e?r.create(e,function(e){return e!==null&&(e=parseFloat(e)),e}).parse():null},h=function(e){return e?r.create(e).parse():null},g=function(e){return e?r.create(e,function(e){return e!==null&&(e=i(e)),e}).parse():null},_=function(e){return e?r.create(e,function(e){return e!==null&&(e=a(e)),e}).parse():null},v=function(e){return e?n.parse(e,s(o)):null},y=function(e){return parseInt(e,10)},b=function(e){var t=String(e);return/^\d+$/.test(t)?t:e},x=function(e){return e?n.parse(e,s(JSON.parse)):null},S=function(e){return e[0]===`(`?(e=e.substring(1,e.length-1).split(`,`),{x:parseFloat(e[0]),y:parseFloat(e[1])}):null},C=function(e){if(e[0]!==`<`&&e[1]!==`(`)return null;for(var t=`(`,n=``,r=!1,i=2;i<e.length-1;i++)r||(t+=e[i]),e[i]===`)`?r=!0:r&&e[i]!==`,`&&(n+=e[i]);var a=S(t);return a.radius=parseFloat(n),a};t.exports={init:function(e){e(20,b),e(21,y),e(23,y),e(26,y),e(700,parseFloat),e(701,parseFloat),e(16,c),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,h),e(718,C),e(1e3,l),e(1001,v),e(1005,d),e(1007,d),e(1028,d),e(1016,f),e(1017,p),e(1021,m),e(1022,m),e(1231,m),e(1014,h),e(1015,h),e(1008,h),e(1009,h),e(1040,h),e(1041,h),e(1115,g),e(1182,g),e(1185,g),e(1186,a),e(1187,_),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,x),e(3807,x),e(3907,h),e(2951,h),e(791,h),e(1183,h),e(1270,h)}}})),y1=i(((e,t)=>{var n=1e6;function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),i=``;t<0&&(t=~t+(r===0),r=~r+1>>>0,i=`-`);var a=``,o=t%n,s,c,l,u,d;if(t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;if(a=l+c+a,o=t%n,t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;if(a=l+c+a,o=t%n,t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;return a=l+c+a,o=t%n,s=4294967296*o+r,c=``+s%n,i+c+a}t.exports=r})),b1=i(((e,t)=>{var n=y1(),r=function(e,t,n,r,i){n||=0,r||=!1,i||=function(e,t,n){return e*2**n+t};var a=n>>3,o=function(e){return r?~e&255:e},s=255,c=8-n%8;t<c&&(s=255<<8-t&255,c=t),n&&(s>>=n%8);var l=0;n%8+t>=8&&(l=i(0,o(e[a])&s,c));for(var u=t+n>>3,d=a+1;d<u;d++)l=i(l,o(e[d]),8);var f=(t+n)%8;return f>0&&(l=i(l,o(e[u])>>8-f,f)),l},i=function(e,t,n){var i=2**(n-1)-1,a=r(e,1),o=r(e,n,1);if(o===0)return 0;var s=1,c=r(e,t,n+1,!1,function(e,t,n){e===0&&(e=1);for(var r=1;r<=n;r++)s/=2,(t&1<<n-r)>0&&(e+=s);return e});return o==2**(n+1)-1?c===0?a===0?1/0:-1/0:NaN:(a===0?1:-1)*2**(o-i)*c},a=function(e){return r(e,1)==1?-1*(r(e,15,1,!0)+1):r(e,15,1)},o=function(e){return r(e,1)==1?-1*(r(e,31,1,!0)+1):r(e,31,1)},s=function(e){return i(e,23,8)},c=function(e){return i(e,52,11)},l=function(e){var t=r(e,16,32);if(t==49152)return NaN;for(var n=1e4**r(e,16,16),i=0,a=r(e,16),o=0;o<a;o++)i+=r(e,16,64+16*o)*n,n/=1e4;var s=10**r(e,16,48);return(t===0?1:-1)*Math.round(i*s)/s},u=function(e,t){var n=r(t,1),i=r(t,63,1),a=new Date((n===0?1:-1)*i/1e3+9466848e5);return e||a.setTime(a.getTime()+a.getTimezoneOffset()*6e4),a.usec=i%1e3,a.getMicroSeconds=function(){return this.usec},a.setMicroSeconds=function(e){this.usec=e},a.getUTCMicroSeconds=function(){return this.usec},a},d=function(e){var t=r(e,32);r(e,32,32);for(var n=r(e,32,64),i=96,a=[],o=0;o<t;o++)a[o]=r(e,32,i),i+=32,i+=32;var s=function(t){var n=r(e,32,i);if(i+=32,n==4294967295)return null;var a;if(t==23||t==20)return a=r(e,n*8,i),i+=n*8,a;if(t==25)return a=e.toString(this.encoding,i>>3,(i+=n<<3)>>3),a;console.log(`ERROR: ElementType not implemented: `+t)},c=function(e,t){var n=[],r;if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=c(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=s(t);return n};return c(a,n)},f=function(e){return e.toString(`utf8`)},p=function(e){return e===null?null:r(e,8)>0};t.exports={init:function(e){e(20,n),e(21,a),e(23,o),e(26,o),e(1700,l),e(700,s),e(701,c),e(16,p),e(1114,u.bind(null,!1)),e(1184,u.bind(null,!0)),e(1e3,d),e(1007,d),e(1016,d),e(1008,d),e(1009,d),e(25,f)}}})),x1=i(((e,t)=>{t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}})),S1=i((e=>{var t=v1(),n=b1(),r=p1(),i=x1();e.getTypeParser=s,e.setTypeParser=c,e.arrayParser=r,e.builtins=i;var a={text:{},binary:{}};function o(e){return String(e)}function s(e,t){return t||=`text`,a[t]&&a[t][e]||o}function c(e,t,n){typeof t==`function`&&(n=t,t=`text`),a[t][e]=n}t.init(function(e,t){a.text[e]=t}),n.init(function(e,t){a.binary[e]=t})})),C1=i(((e,t)=>{var n;try{n=process.platform===`win32`?process.env.USERNAME:process.env.USER}catch{}t.exports={host:`localhost`,user:n,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:``,ssl:!1,sslnegotiation:void 0,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=S1(),i=r.getTypeParser(20,`text`),a=r.getTypeParser(1016,`text`);t.exports.__defineSetter__(`parseInt8`,function(e){r.setTypeParser(20,`text`,e?r.getTypeParser(23,`text`):i),r.setTypeParser(1016,`text`,e?r.getTypeParser(1007,`text`):a)})})),w1=r({"module.exports":()=>mo}),T1=n(()=>{}),E1=r({"module.exports":()=>ho}),D1=n(()=>{}),O1=i(((e,n)=>{var r=C1(),i=(T1(),t(w1)),{isDate:a}=(D1(),t(E1)),o=i.deprecate(()=>{},`Sending an invalid date to Postgres is deprecated and will throw an error in the next major version of pg. Ensure any Date object passed as a query parameter is valid.`,`PG_INVALID_DATE`);function s(e){return`"`+e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)+`"`}function c(e){let t=`{`;for(let n=0;n<e.length;n++){n>0&&(t+=`,`);let r=e[n];r==null?t+=`NULL`:Array.isArray(r)?t+=c(r):ArrayBuffer.isView(r)?(r instanceof Buffer||(r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)),t+=`\\\\x`+r.toString(`hex`)):t+=s(l(r))}return t+=`}`,t}var l=function(e,t){return e==null?null:typeof e==`object`?e instanceof Buffer?e:ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):a(e)?(isNaN(e.getTime())&&o(),r.parseInputDatesAsUTC?f(e):d(e)):Array.isArray(e)?c(e):u(e,t):e.toString()};function u(e,t){if(e&&typeof e.toPostgres==`function`){if(t||=[],t.indexOf(e)!==-1)throw Error(`circular reference detected while preparing "`+e+`" for query`);return t.push(e),l(e.toPostgres(l),t)}return JSON.stringify(e)}function d(e){let t=-e.getTimezoneOffset(),n=e.getFullYear(),r=n<1;r&&(n=Math.abs(n)+1);let i=String(n).padStart(4,`0`)+`-`+String(e.getMonth()+1).padStart(2,`0`)+`-`+String(e.getDate()).padStart(2,`0`)+`T`+String(e.getHours()).padStart(2,`0`)+`:`+String(e.getMinutes()).padStart(2,`0`)+`:`+String(e.getSeconds()).padStart(2,`0`)+`.`+String(e.getMilliseconds()).padStart(3,`0`);return t<0?(i+=`-`,t*=-1):i+=`+`,i+=String(Math.floor(t/60)).padStart(2,`0`)+`:`+String(t%60).padStart(2,`0`),r&&(i+=` BC`),i}function f(e){let t=e.getUTCFullYear(),n=t<1;n&&(t=Math.abs(t)+1);let r=String(t).padStart(4,`0`)+`-`+String(e.getUTCMonth()+1).padStart(2,`0`)+`-`+String(e.getUTCDate()).padStart(2,`0`)+`T`+String(e.getUTCHours()).padStart(2,`0`)+`:`+String(e.getUTCMinutes()).padStart(2,`0`)+`:`+String(e.getUTCSeconds()).padStart(2,`0`)+`.`+String(e.getUTCMilliseconds()).padStart(3,`0`);return r+=`+00:00`,n&&(r+=` BC`),r}function p(e,t,n){return e=typeof e==`string`?{text:e}:m(e),t&&(typeof t==`function`?e.callback=t:e.values=t),n&&(e.callback=n),e}function m(e){return e==null?e:Object.defineProperties(Object.create(Object.getPrototypeOf(e)),Object.getOwnPropertyDescriptors(e))}n.exports={prepareValue:function(e){return l(e)},normalizeQueryConfig:p,escapeIdentifier:function(e){return`"`+e.replace(/"/g,`""`)+`"`},escapeLiteral:function(e){let t=!1,n=`'`;if(e==null||typeof e!=`string`)return`''`;for(let r=0;r<e.length;r++){let i=e[r];i===`'`?n+=i+i:i===`\\`?(n+=i+i,t=!0):n+=i}return n+=`'`,t===!0&&(n=` E`+n),n}}})),k1=r({"module.exports":()=>lo}),A1=n(()=>{}),j1=i(((e,n)=>{var r=(A1(),t(k1));n.exports={postgresMd5PasswordHash:l,randomBytes:s,deriveKey:p,sha256:u,hashByName:d,hmacSha256:f,md5:c};var i=r.webcrypto||globalThis.crypto,a=i.subtle,o=new TextEncoder;function s(e){return i.getRandomValues(Buffer.alloc(e))}async function c(e){try{return r.createHash(`md5`).update(e,`utf-8`).digest(`hex`)}catch{let t=typeof e==`string`?o.encode(e):e,n=await a.digest(`MD5`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}}async function l(e,t,n){let r=await c(t+e);return`md5`+await c(Buffer.concat([Buffer.from(r),n]))}async function u(e){return await a.digest(`SHA-256`,e)}async function d(e,t){return await a.digest(e,t)}async function f(e,t){let n=await a.importKey(`raw`,e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]);return await a.sign(`HMAC`,n,o.encode(t))}async function p(e,t,n){let r=await a.importKey(`raw`,o.encode(e),`PBKDF2`,!1,[`deriveBits`]),i={name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:n};return await a.deriveBits(i,r,256,[`deriveBits`])}})),M1=i(((e,t)=>{function n(e,t){return Error(`SASL channel binding: `+e+` when parsing public certificate `+t.toString(`base64`))}function r(e,t){let r=e[t++];if(r<128)return{length:r,index:t};let i=r&127;if(i>4)throw n(`bad length`,e);r=0;for(let n=0;n<i;n++)r=r<<8|e[t++];return{length:r,index:t}}function i(e,t){if(e[t++]!==6)throw n(`non-OID data`,e);let{length:i,index:a}=r(e,t);t=a;let o=t+i,s=e[t++],c=(s/40|0)+`.`+s%40;for(;t<o;){let n=0;for(;t<o;){let r=e[t++];if(n=n<<7|r&127,r<128)break}c+=`.`+n}return{oid:c,index:t}}function a(e,t){if(e[t++]!==48)throw n(`non-sequence data`,e);return r(e,t)}function o(e,t){t===void 0&&(t=0),t=a(e,t).index;let{length:o,index:s}=a(e,t);t=s+o,t=a(e,t).index;let{oid:c,index:l}=i(e,t);switch(c){case`1.2.840.113549.1.1.4`:return`MD5`;case`1.2.840.113549.1.1.5`:return`SHA-1`;case`1.2.840.113549.1.1.11`:return`SHA-256`;case`1.2.840.113549.1.1.12`:return`SHA-384`;case`1.2.840.113549.1.1.13`:return`SHA-512`;case`1.2.840.113549.1.1.14`:return`SHA-224`;case`1.2.840.113549.1.1.15`:return`SHA512-224`;case`1.2.840.113549.1.1.16`:return`SHA512-256`;case`1.2.840.10045.4.1`:return`SHA-1`;case`1.2.840.10045.4.3.1`:return`SHA-224`;case`1.2.840.10045.4.3.2`:return`SHA-256`;case`1.2.840.10045.4.3.3`:return`SHA-384`;case`1.2.840.10045.4.3.4`:return`SHA-512`;case`1.2.840.113549.1.1.10`:{if(t=l,t=a(e,t).index,e[t++]!==160)throw n(`non-tag data`,e);t=r(e,t).index,t=a(e,t).index;let{oid:o}=i(e,t);switch(o){case`1.2.840.113549.2.5`:return`MD5`;case`1.3.14.3.2.26`:return`SHA-1`;case`2.16.840.1.101.3.4.2.1`:return`SHA-256`;case`2.16.840.1.101.3.4.2.2`:return`SHA-384`;case`2.16.840.1.101.3.4.2.3`:return`SHA-512`}throw n(`unknown hash OID `+o,e)}case`1.3.101.110`:case`1.3.101.112`:return`SHA-512`;case`1.3.101.111`:case`1.3.101.113`:throw n(`Ed448 certificate channel binding is not currently supported by Postgres`)}throw n(`unknown OID `+c,e)}t.exports={signatureAlgorithmHashFromCertificate:o}})),N1=i(((e,t)=>{var n=j1(),{signatureAlgorithmHashFromCertificate:r}=M1();function i(e){return e.replace(/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,` `).replace(/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g,``).normalize(`NFKC`)}var a=1e5;function o(e,t,r=a){let i=[`SCRAM-SHA-256`];t&&i.unshift(`SCRAM-SHA-256-PLUS`);let o=i.find(t=>e.includes(t));if(!o)throw Error(`SASL: Only mechanism(s) `+i.join(` and `)+` are supported`);if(o===`SCRAM-SHA-256-PLUS`&&typeof t.getPeerCertificate!=`function`)throw Error(`SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate`);let s=n.randomBytes(18).toString(`base64`);return{mechanism:o,clientNonce:s,response:(o===`SCRAM-SHA-256-PLUS`?`p=tls-server-end-point`:t?`y`:`n`)+`,,n=*,r=`+s,message:`SASLInitialResponse`,scramMaxIterations:r}}async function s(e,t,o,s){if(e.message!==`SASLInitialResponse`)throw Error(`SASL: Last message was not SASLInitialResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string`);if(t===``)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string`);if(typeof o!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string`);let c=f(o);if(!c.nonce.startsWith(e.clientNonce))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce`);if(c.nonce.length===e.clientNonce.length)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short`);let l=typeof e.scramMaxIterations==`number`?e.scramMaxIterations:a;if(l!==0&&c.iteration>l)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count `+c.iteration+` exceeds scramMaxIterations of `+l);let u=`n=*,r=`+e.clientNonce,d=`r=`+c.nonce+`,s=`+c.salt+`,i=`+c.iteration,p=s?`eSws`:`biws`;if(e.mechanism===`SCRAM-SHA-256-PLUS`){let e=s.getPeerCertificate().raw,t=r(e);(t===`MD5`||t===`SHA-1`)&&(t=`SHA-256`);let i=await n.hashByName(t,e);p=Buffer.concat([Buffer.from(`p=tls-server-end-point,,`),Buffer.from(i)]).toString(`base64`)}let h=`c=`+p+`,r=`+c.nonce,g=u+`,`+d+`,`+h,_=Buffer.from(c.salt,`base64`),v=await n.deriveKey(i(t),_,c.iteration),y=await n.hmacSha256(v,`Client Key`),b=await n.sha256(y),x=await n.hmacSha256(b,g),S=m(Buffer.from(y),Buffer.from(x)).toString(`base64`),C=await n.hmacSha256(v,`Server Key`),w=await n.hmacSha256(C,g);e.message=`SASLResponse`,e.serverSignature=Buffer.from(w).toString(`base64`),e.response=h+`,p=`+S}function c(e,t){if(e.message!==`SASLResponse`)throw Error(`SASL: Last message was not SASLResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string`);let{serverSignature:n}=p(t);if(n!==e.serverSignature)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match`)}function l(e){if(typeof e!=`string`)throw TypeError(`SASL: text must be a string`);return e.split(``).map((t,n)=>e.charCodeAt(n)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function u(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function d(e){if(typeof e!=`string`)throw TypeError(`SASL: attribute pairs text must be a string`);return new Map(e.split(`,`).map(e=>{if(!/^.=/.test(e))throw Error(`SASL: Invalid attribute pair entry`);return[e[0],e.substring(2)]}))}function f(e){let t=d(e),n=t.get(`r`);if(!n)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing`);if(!l(n))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters`);let r=t.get(`s`);if(!r)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing`);if(!u(r))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64`);let i=t.get(`i`);if(!i)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing`);if(!/^[1-9][0-9]*$/.test(i))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count`);return{nonce:n,salt:r,iteration:parseInt(i,10)}}function p(e){let t=d(e),n=t.get(`e`),r=t.get(`v`);if(n)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${n}"`);if(!r)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing`);if(!u(r))throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64`);return{serverSignature:r}}function m(e,t){if(!Buffer.isBuffer(e))throw TypeError(`first argument must be a Buffer`);if(!Buffer.isBuffer(t))throw TypeError(`second argument must be a Buffer`);if(e.length!==t.length)throw Error(`Buffer lengths must match`);if(e.length===0)throw Error(`Buffers cannot be empty`);return Buffer.from(e.map((n,r)=>e[r]^t[r]))}t.exports={startSession:o,continueSession:s,finalizeSession:c,DEFAULT_MAX_SCRAM_ITERATIONS:a}})),P1=i(((e,t)=>{var n=S1();function r(e){this._types=e||n,this.text={},this.binary={}}r.prototype.getOverrides=function(e){switch(e){case`text`:return this.text;case`binary`:return this.binary;default:return{}}},r.prototype.setTypeParser=function(e,t,n){typeof t==`function`&&(n=t,t=`text`),this.getOverrides(t)[e]=n},r.prototype.getTypeParser=function(e,t){return t||=`text`,this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=r})),F1=r({"module.exports":()=>go}),I1=n(()=>{}),L1=r({"module.exports":()=>_o}),R1=n(()=>{}),z1=i(((e,n)=>{function r(e,n={}){if(e.charAt(0)===`/`){let t=e.split(` `);return{host:t[0],database:t[1]}}let r=Object.create(null),i,a=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)&&(e=encodeURI(e).replace(/%25(\d\d)/g,`%$1`));try{try{i=new URL(e,`postgres://base`)}catch{i=new URL(e.replace(`@/`,`@___DUMMY___/`),`postgres://base`),a=!0}}catch(e){throw e.input&&=`*****REDACTED*****`,e}for(let e of i.searchParams.entries())r[e[0]]=e[1];if(r.user=r.user||decodeURIComponent(i.username),r.password=r.password||decodeURIComponent(i.password),i.protocol==`socket:`)return r.host=decodeURI(i.pathname),r.database=i.searchParams.get(`db`),r.client_encoding=i.searchParams.get(`encoding`),r;let o=(a?``:i.hostname).replace(/^\[(.+)\]$/,`$1`);r.host?o&&/^%2f/i.test(o)&&(i.pathname=o+i.pathname):r.host=decodeURIComponent(o),r.port||=i.port;let c=i.pathname.slice(1)||null;r.database=c?decodeURI(c):null,(r.ssl===`true`||r.ssl===`1`)&&(r.ssl=!0),r.ssl===`0`&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={}),r.sslnegotiation===`direct`&&r.ssl===void 0&&(r.ssl=!0);let l=r.sslcert||r.sslkey||r.sslrootcert?(R1(),t(L1)):null;if(r.sslcert&&(r.ssl.cert=l.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=l.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=l.readFileSync(r.sslrootcert).toString()),n.useLibpqCompat&&r.uselibpqcompat)throw Error(`Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.`);if(r.uselibpqcompat===`true`||n.useLibpqCompat)switch(r.sslmode){case`disable`:r.ssl=!1;break;case`prefer`:r.ssl.rejectUnauthorized=!1;break;case`require`:r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break;case`verify-ca`:if(!r.ssl.ca)throw Error(`SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.`);r.ssl.checkServerIdentity=function(){}}else switch(r.sslmode){case`disable`:r.ssl=!1;break;case`prefer`:case`require`:case`verify-ca`:case`verify-full`:r.sslmode!==`verify-full`&&s(r.sslmode);break;case`no-verify`:r.ssl.rejectUnauthorized=!1}return r}function i(e){return Object.entries(e).reduce((e,[t,n])=>(n!=null&&(e[t]=n),e),Object.create(null))}function a(e){return Object.entries(e).reduce((e,[t,n])=>{if(t===`ssl`){let r=n;typeof r==`boolean`&&(e[t]=r),typeof r==`object`&&(e[t]=i(r))}else if(n!=null){if(t===`port`){if(n!==``){let r=parseInt(n,10);if(isNaN(r))throw Error(`Invalid ${t}: ${n}`);e[t]=r}}else e[t]=n}return e},Object.create(null))}function o(e){return a(r(e))}function s(e){!s.warned&&typeof process<`u`&&process.emitWarning&&(s.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
462
|
+
In the next major version (pg-connection-string v3.0.0 and pg v9.0.0), these modes will adopt standard libpq semantics, which have weaker security guarantees.
|
|
463
|
+
|
|
464
|
+
To prepare for this change:
|
|
465
|
+
- If you want the current behavior, explicitly use 'sslmode=verify-full'
|
|
466
|
+
- If you want libpq compatibility now, use 'uselibpqcompat=true&sslmode=${e}'
|
|
467
|
+
|
|
468
|
+
See https://www.postgresql.org/docs/current/libpq-ssl.html for libpq SSL mode definitions.`))}n.exports=r,r.parse=r,r.toClientConfig=a,r.parseIntoClientConfig=o})),B1=i(((e,n)=>{var r=(I1(),t(F1)),i=C1(),a=z1().parse,o=function(e,t,n){return t[e]?t[e]:(n===void 0?n=process.env[`PG`+e.toUpperCase()]:n===!1||(n=process.env[n]),n||i[e])},s=function(){switch(process.env.PGSSLMODE){case`disable`:return!1;case`prefer`:case`require`:case`verify-ca`:case`verify-full`:return!0;case`no-verify`:return{rejectUnauthorized:!1}}return i.ssl},c=function(e){return`'`+(``+e).replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)+`'`},l=function(e,t,n){let r=t[n];r!=null&&e.push(n+`=`+c(r))};n.exports=class{constructor(e){if(e=typeof e==`string`?a(e):e||{},e.connectionString&&(e=Object.assign({},e,a(e.connectionString))),this.user=o(`user`,e),this.database=o(`database`,e),this.database===void 0&&(this.database=this.user),this.port=parseInt(o(`port`,e),10),this.host=o(`host`,e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:o(`password`,e)}),this.binary=o(`binary`,e),this.options=o(`options`,e),this.ssl=e.ssl===void 0?s():e.ssl,typeof this.ssl==`string`&&this.ssl===`true`&&(this.ssl=!0),this.ssl===`no-verify`&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.sslnegotiation=o(`sslnegotiation`,e,`PGSSLNEGOTIATION`),this.sslnegotiation!==void 0&&this.sslnegotiation!==`postgres`&&this.sslnegotiation!==`direct`)throw Error(`Invalid sslnegotiation value: "${this.sslnegotiation}". Valid values are "postgres" and "direct".`);if(this.sslnegotiation===`direct`&&!this.ssl)throw Error(`sslnegotiation=direct requires SSL to be enabled`);this.client_encoding=o(`client_encoding`,e),this.replication=o(`replication`,e),this.isDomainSocket=!(this.host||``).indexOf(`/`),this.application_name=o(`application_name`,e,`PGAPPNAME`),this.fallback_application_name=o(`fallback_application_name`,e,!1),this.statement_timeout=o(`statement_timeout`,e,!1),this.lock_timeout=o(`lock_timeout`,e,!1),this.idle_in_transaction_session_timeout=o(`idle_in_transaction_session_timeout`,e,!1),this.query_timeout=o(`query_timeout`,e,!1),this.connect_timeout=e.connectionTimeoutMillis===void 0?process.env.PGCONNECT_TIMEOUT||0:Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis==`number`&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){let t=[];l(t,this,`user`),l(t,this,`password`),l(t,this,`port`),l(t,this,`application_name`),l(t,this,`fallback_application_name`),l(t,this,`connect_timeout`),l(t,this,`options`);let n=typeof this.ssl==`object`?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(l(t,n,`sslmode`),l(t,n,`sslca`),l(t,n,`sslkey`),l(t,n,`sslcert`),l(t,n,`sslrootcert`),l(t,this,`sslnegotiation`),this.database&&t.push(`dbname=`+c(this.database)),this.replication&&t.push(`replication=`+c(this.replication)),this.host&&t.push(`host=`+c(this.host)),this.isDomainSocket)return e(null,t.join(` `));this.client_encoding&&t.push(`client_encoding=`+c(this.client_encoding)),r.lookup(this.host,function(n,r){return n?e(n,null):(t.push(`hostaddr=`+c(r)),e(null,t.join(` `)))})}}})),V1=i(((e,t)=>{var n=S1(),r=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;t.exports=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray=e===`array`,this.rowAsArray&&(this.parseRow=this._parseRowAsArray),this._prebuiltEmptyResultObject=null}addCommandComplete(e){let t;t=e.text?r.exec(e.text):r.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){let t=Array(e.length);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===null?t[n]=null:t[n]=this._parsers[n](r)}return t}parseRow(e){let t={...this._prebuiltEmptyResultObject};for(let n=0,r=e.length;n<r;n++){let r=e[n],i=this.fields[n].name;if(r!==null){let e=this.fields[n].format===`binary`?Buffer.from(r):r;t[i]=this._parsers[n](e)}else t[i]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));let t=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r];t[i.name]=null,this._types?this._parsers[r]=this._types.getTypeParser(i.dataTypeID,i.format||`text`):this._parsers[r]=n.getTypeParser(i.dataTypeID,i.format||`text`)}this._prebuiltEmptyResultObject={...t}}}})),H1=i(((e,n)=>{var{EventEmitter:r}=(d1(),t(u1)),i=V1(),a=O1();n.exports=class extends r{constructor(e,t,n){super(),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.queryMode=e.queryMode,this.binary=e.binary,this.portal=e.portal||``,this.callback=e.callback,this._rowMode=e.rowMode,process.domain&&e.callback&&(this.callback=process.domain.bind(e.callback)),this._result=new i(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){return this.queryMode===`extended`||this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new i(this._rowMode,this._result._types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners(`row`).length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit(`row`,t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&=(e=this._canceledDueToError,!1),this.callback)return this.callback(e);this.emit(`error`,e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){process.nextTick(()=>{throw e})}this.emit(`end`,this._results)}submit(e){if(typeof this.text!=`string`&&typeof this.name!=`string`)return Error(`A query must have either text or a name. Supplying neither is unsupported.`);let t=e.parsedStatements[this.name]||e.submittedNamedStatements[this.name];if(this.text&&t&&this.text!==t)return Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return Error(`Query values must be an array`);if(this.requiresPreparation()){e.stream.cork&&e.stream.cork();try{this.prepare(e)}finally{e.stream.uncork&&e.stream.uncork()}}else e.query(this.text);return null}hasBeenParsed(e){return this.name&&(e.parsedStatements[this.name]!==void 0||e.submittedNamedStatements[this.name]!==void 0)}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.hasBeenParsed(e)||(e.parse({text:this.text,name:this.name,types:this.types}),this.name&&(e.submittedNamedStatements[this.name]=this.text));try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:a.prepareValue})}catch(t){e.close({type:`S`,name:this.name}),e.sync(),this.handleError(t,e);return}e.describe({type:`P`,name:this.portal||``}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail(`No source stream defined`)}handleCopyData(e,t){}}})),U1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:`parseComplete`,length:5},e.bindComplete={name:`bindComplete`,length:5},e.closeComplete={name:`closeComplete`,length:5},e.noData={name:`noData`,length:5},e.portalSuspended={name:`portalSuspended`,length:5},e.replicationStart={name:`replicationStart`,length:4},e.emptyQuery={name:`emptyQuery`,length:4},e.copyDone={name:`copyDone`,length:4},e.DatabaseError=class extends Error{constructor(e,t,n){super(e),this.length=t,this.name=n}},e.CopyDataMessage=class{constructor(e,t){this.length=e,this.chunk=t,this.name=`copyData`}},e.CopyResponse=class{constructor(e,t,n,r){this.length=e,this.name=t,this.binary=n,this.columnTypes=Array(r)}},e.Field=class{constructor(e,t,n,r,i,a,o){this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=r,this.dataTypeSize=i,this.dataTypeModifier=a,this.format=o}},e.RowDescriptionMessage=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name=`rowDescription`,this.fields=Array(this.fieldCount)}},e.ParameterDescriptionMessage=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name=`parameterDescription`,this.dataTypeIDs=Array(this.parameterCount)}},e.ParameterStatusMessage=class{constructor(e,t,n){this.length=e,this.parameterName=t,this.parameterValue=n,this.name=`parameterStatus`}},e.AuthenticationMD5Password=class{constructor(e,t){this.length=e,this.salt=t,this.name=`authenticationMD5Password`}},e.BackendKeyDataMessage=class{constructor(e,t,n){this.length=e,this.processID=t,this.secretKey=n,this.name=`backendKeyData`}},e.NotificationResponseMessage=class{constructor(e,t,n,r){this.length=e,this.processId=t,this.channel=n,this.payload=r,this.name=`notification`}},e.ReadyForQueryMessage=class{constructor(e,t){this.length=e,this.status=t,this.name=`readyForQuery`}},e.CommandCompleteMessage=class{constructor(e,t){this.length=e,this.text=t,this.name=`commandComplete`}},e.DataRowMessage=class{constructor(e,t){this.length=e,this.fields=t,this.name=`dataRow`,this.fieldCount=t.length}},e.NoticeMessage=class{constructor(e,t){this.length=e,this.message=t,this.name=`notice`}}})),W1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0,e.Writer=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,n=t.length+(t.length>>1)+e;this.buffer=Buffer.allocUnsafe(n),t.copy(this.buffer,0,0,this.offset)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(!e)this.ensure(1);else{let t=Buffer.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,`utf-8`),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=``){let t=Buffer.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}addInt32PrefixedString(e){let t=Buffer.byteLength(e);this.ensure(4+t);let n=this.buffer,r=this.offset;return n[r++]=t>>>24&255,n[r++]=t>>>16&255,n[r++]=t>>>8&255,n[r++]=t>>>0&255,n.write(e,r,`utf-8`),this.offset=r+t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}reserveUnsafe(e){let t=this.offset;return this.ensure(e),this.offset+=e,t}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),t}clear(){this.offset=5,this.headerPosition=0}}})),G1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=W1(),n=new t.Writer,r=e=>{n.addInt16(3).addInt16(0);for(let t of Object.keys(e))n.addCString(t).addCString(e[t]);n.addCString(`client_encoding`).addCString(`UTF8`);let r=n.addCString(``).flush(),i=r.length+4;return new t.Writer().addInt32(i).add(r).flush()},i=()=>{let e=Buffer.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(80877103,4),e},a=e=>n.addCString(e).flush(112),o=function(e,t){return n.addCString(e).addInt32PrefixedString(t),n.flush(112)},s=function(e){return n.addString(e).flush(112)},c=e=>n.addCString(e).flush(81),l=[],u=e=>{let t=e.name||``;t.length>63&&(console.error(`Warning! Postgres only supports 63 characters for query names.`),console.error(`You supplied %s (%s)`,t,t.length),console.error(`This can cause conflicts and silent errors executing queries`));let r=e.types||l,i=r.length,a=n.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)a.addInt32(r[e]);return n.flush(80)},d=function(e,t,r){let i=e.length;for(let a=0;a<i;a++){let i=t?t(e[a],a):e[a],o=0;i==null?n.addInt32(-1):i instanceof Buffer?(o=1,n.addInt32(i.length),n.add(i)):n.addInt32PrefixedString(i);let s=n.buffer;s[r++]=0,s[r++]=o}},f=(e={})=>{let t=e.portal||``,r=e.statement||``,i=e.binary||!1,a=e.values||l,o=a.length;n.addCString(t).addCString(r),n.addInt16(o);let s=n.reserveUnsafe(o*2);n.addInt16(o);try{d(a,e.valueMapper,s)}catch(e){throw n.clear(),e}return n.addInt16(1),n.addInt16(+!!i),n.flush(66)},p=Buffer.from([69,0,0,0,9,0,0,0,0,0]),m=e=>{if(!e||!e.portal&&!e.rows)return p;let t=e.portal||``,n=e.rows||0,r=Buffer.byteLength(t),i=4+r+1+4,a=Buffer.allocUnsafe(1+i);return a[0]=69,a.writeInt32BE(i,1),a.write(t,5,`utf-8`),a[r+5]=0,a.writeUInt32BE(n,a.length-4),a},h=(e,t)=>{let n=Buffer.allocUnsafe(16);return n.writeInt32BE(16,0),n.writeInt16BE(1234,4),n.writeInt16BE(5678,6),n.writeInt32BE(e,8),n.writeInt32BE(t,12),n},g=(e,t)=>{let n=4+Buffer.byteLength(t)+1,r=Buffer.allocUnsafe(1+n);return r[0]=e,r.writeInt32BE(n,1),r.write(t,5,`utf-8`),r[n]=0,r},_=n.addCString(`P`).flush(68),v=n.addCString(`S`).flush(68),y=e=>e.name?g(68,`${e.type}${e.name||``}`):e.type===`P`?_:v,b=e=>g(67,`${e.type}${e.name||``}`),x=e=>n.add(e).flush(100),S=e=>g(102,e),C=e=>Buffer.from([e,0,0,0,4]),w=C(72),E=C(83),D=C(88),O=C(99);e.serialize={startup:r,password:a,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:s,query:c,parse:u,bind:f,execute:m,describe:y,close:b,flush:()=>w,sync:()=>E,end:()=>D,copyData:x,copyDone:()=>O,copyFail:S,cancel:h}})),K1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0,e.BufferReader=class{constructor(e=0){this.offset=e,this.buffer=Buffer.allocUnsafe(0),this.encoding=`utf-8`}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;this.buffer[t++];);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}}})),q1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=U1(),n=K1(),r=1,i=5,a=-1,o=Buffer.allocUnsafe(0);e.Parser=class{constructor(e){if(this.buffer=o,this.bufferLength=0,this.bufferOffset=0,this.reader=new n.BufferReader,e?.mode===`binary`)throw Error(`Binary mode not supported yet`);this.mode=e?.mode||`text`}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength,a=this.bufferOffset;for(;a+i<=n;){let e=this.buffer[a],o=this.buffer.readUInt32BE(a+r),s=r+o;if(s+a<=n)t(this.handlePacket(a+i,e,o,this.buffer)),a+=s;else break}a===n?(this.buffer=o,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-a,this.bufferOffset=a)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let n=this.buffer.byteLength*2;for(;t>=n;)n*=2;e=Buffer.allocUnsafe(n)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,n,r,i){let{reader:a}=this;a.setBuffer(e,i);let f;switch(n){case 50:f=t.bindComplete;break;case 49:f=t.parseComplete;break;case 51:f=t.closeComplete;break;case 110:f=t.noData;break;case 115:f=t.portalSuspended;break;case 99:f=t.copyDone;break;case 87:f=t.replicationStart;break;case 73:f=t.emptyQuery;break;case 68:f=_(a);break;case 67:f=c(a);break;case 90:f=s(a);break;case 65:f=p(a);break;case 82:f=b(a,r);break;case 83:f=v(a);break;case 75:f=y(a);break;case 69:f=x(a,`error`);break;case 78:f=x(a,`notice`);break;case 84:f=m(a);break;case 116:f=g(a);break;case 71:f=u(a);break;case 72:f=d(a);break;case 100:f=l(a,r);break;default:return new t.DatabaseError(`received invalid response: `+n.toString(16),r,`error`)}return a.setBuffer(0,o),f.length=r,f}};var s=e=>{let n=e.string(1);return new t.ReadyForQueryMessage(a,n)},c=e=>{let n=e.cstring();return new t.CommandCompleteMessage(a,n)},l=(e,n)=>{let r=e.bytes(n-4);return new t.CopyDataMessage(a,r)},u=e=>f(e,`copyInResponse`),d=e=>f(e,`copyOutResponse`),f=(e,n)=>{let r=e.byte()!==0,i=e.int16(),o=new t.CopyResponse(a,n,r,i);for(let t=0;t<i;t++)o.columnTypes[t]=e.int16();return o},p=e=>{let n=e.int32(),r=e.cstring(),i=e.cstring();return new t.NotificationResponseMessage(a,n,r,i)},m=e=>{let n=e.int16(),r=new t.RowDescriptionMessage(a,n);for(let t=0;t<n;t++)r.fields[t]=h(e);return r},h=e=>{let n=e.cstring(),r=e.uint32(),i=e.int16(),a=e.uint32(),o=e.int16(),s=e.int32(),c=e.int16()===0?`text`:`binary`;return new t.Field(n,r,i,a,o,s,c)},g=e=>{let n=e.int16(),r=new t.ParameterDescriptionMessage(a,n);for(let t=0;t<n;t++)r.dataTypeIDs[t]=e.uint32();return r},_=e=>{let n=e.int16(),r=Array(n);for(let t=0;t<n;t++){let n=e.int32();r[t]=n===-1?null:e.string(n)}return new t.DataRowMessage(a,r)},v=e=>{let n=e.cstring(),r=e.cstring();return new t.ParameterStatusMessage(a,n,r)},y=e=>{let n=e.int32(),r=e.int32();return new t.BackendKeyDataMessage(a,n,r)},b=(e,n)=>{let r=e.int32(),i={name:`authenticationOk`,length:n};switch(r){case 0:break;case 3:i.length===8&&(i.name=`authenticationCleartextPassword`);break;case 5:if(i.length===12){i.name=`authenticationMD5Password`;let n=e.bytes(4);return new t.AuthenticationMD5Password(a,n)}break;case 10:{i.name=`authenticationSASL`,i.mechanisms=[];let t;do t=e.cstring(),t&&i.mechanisms.push(t);while(t)}break;case 11:i.name=`authenticationSASLContinue`,i.data=e.string(n-8);break;case 12:i.name=`authenticationSASLFinal`,i.data=e.string(n-8);break;default:throw Error(`Unknown authenticationOk message type `+r)}return i},x=(e,n)=>{let r={},i=e.string(1);for(;i!==`\0`;)r[i]=e.cstring(),i=e.string(1);let o=r.M,s=n===`notice`?new t.NoticeMessage(a,o):new t.DatabaseError(o,a,n);return s.severity=r.S,s.code=r.C,s.detail=r.D,s.hint=r.H,s.position=r.P,s.internalPosition=r.p,s.internalQuery=r.q,s.where=r.W,s.schema=r.s,s.table=r.t,s.column=r.c,s.dataType=r.d,s.constraint=r.n,s.file=r.F,s.line=r.L,s.routine=r.R,s}})),J1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=void 0,e.parse=i;var t=U1();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:function(){return t.DatabaseError}});var n=G1();Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return n.serialize}});var r=q1();function i(e,t){let n=new r.Parser;return e.on(`data`,e=>n.parse(e,t)),new Promise(t=>e.on(`end`,()=>t()))}})),Y1=r({"module.exports":()=>vo}),X1=n(()=>{}),Z1=r({"module.exports":()=>yo}),Q1=n(()=>{}),$1=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CloudflareSocket=void 0;var n=(d1(),t(u1));e.CloudflareSocket=class extends n.EventEmitter{constructor(e){super(),this.ssl=e,this.writable=!1,this.destroyed=!1,this._upgrading=!1,this._upgraded=!1,this._cfSocket=null,this._cfWriter=null,this._cfReader=null}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}async connect(e,t,n){try{n&&this.once(`connect`,n);let r=this.ssl?{secureTransport:`starttls`}:{},i=(await import(`cloudflare:sockets`)).connect;return this._cfSocket=i(`${t}:${e}`,r),this._cfWriter=this._cfSocket.writable.getWriter(),this._addClosedHandler(),this._cfReader=this._cfSocket.readable.getReader(),this.ssl?this._listenOnce().catch(e=>this.emit(`error`,e)):this._listen().catch(e=>this.emit(`error`,e)),await this._cfWriter.ready,this.writable=!0,this.emit(`connect`),this}catch(e){this.emit(`error`,e)}}async _listen(){for(;;){let{done:e,value:t}=await this._cfReader.read();if(e)break;this.emit(`data`,Buffer.from(t))}}async _listenOnce(){let{done:e,value:t}=await this._cfReader.read();this.emit(`data`,Buffer.from(t))}write(e,t=`utf8`,n=()=>{}){let r=typeof t==`function`?`utf8`:t;return typeof t==`function`&&(n=t),e.length===0?n():(typeof e==`string`&&(e=Buffer.from(e,r)),this._cfWriter.write(e).then(()=>{n()},e=>{n(e)}),!0)}end(e=Buffer.alloc(0),t=`utf8`,n=()=>{}){return this.write(e,t,e=>{let t=this._cfSocket;(t?.close())?.then(()=>{this._cfSocket===t&&(this._cfSocket=null,this.emit(`close`))}).catch(e=>this.emit(`error`,e)),n&&n(e)}),this}destroy(e){return this.destroyed=!0,this.end()}startTls(e){this._upgraded?this.emit(`error`,"Cannot call `startTls()` more than once on a socket"):(this._cfWriter.releaseLock(),this._cfReader.releaseLock(),this._upgrading=!0,this._cfSocket=this._cfSocket.startTls(e),this._cfWriter=this._cfSocket.writable.getWriter(),this._cfReader=this._cfSocket.readable.getReader(),this._addClosedHandler(),this._listen().catch(e=>this.emit(`error`,e)))}_addClosedHandler(){let e=this._cfSocket;e.closed.then(()=>{this._upgrading?(this._upgrading=!1,this._upgraded=!0):this._cfSocket===e&&(this._cfSocket=null,this.emit(`close`))}).catch(e=>this.emit(`error`,e))}}})),e0=i(((e,n)=>{var{getStream:r,getSecureStream:i}=c();n.exports={getStream:r,getSecureStream:i};function a(){function e(e){return new(X1(),t(Y1)).Socket}function n(e){return(Q1(),t(Z1)).connect(e)}return{getStream:e,getSecureStream:n}}function o(){function e(e){let{CloudflareSocket:t}=$1();return new t(e)}function t(e){return e.socket.startTls(e),e.socket}return{getStream:e,getSecureStream:t}}function s(){if(typeof navigator==`object`&&navigator!==null&&typeof navigator.userAgent==`string`)return navigator.userAgent===`Cloudflare-Workers`;if(typeof Response==`function`){let e=new Response(null,{cf:{thing:!0}});if(typeof e.cf==`object`&&e.cf!==null&&e.cf.thing)return!0}return!1}function c(){return s()?o():a()}})),t0=i(((e,n)=>{var r=(d1(),t(u1)).EventEmitter,{parse:i,serialize:a}=J1(),o=e0(),{getStream:s}=o,c=a.flush(),l=a.sync(),u=a.end();n.exports=class extends r{constructor(e){super(),e||={},this.stream=e.stream||s(e.ssl),typeof this.stream==`function`&&(this.stream=this.stream(e)),this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.parsedStatements={},this.submittedNamedStatements={},this.ssl=e.ssl||!1,this.sslNegotiation=e.sslNegotiation||`postgres`,this._ending=!1,this._emitMessage=!1;let t=this;this.on(`newListener`,function(e){e===`message`&&(t._emitMessage=!0)})}connect(e,t){let n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once(`connect`,function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit(`connect`)});let r=function(e){(!n._ending||e.code!==`ECONNRESET`&&e.code!==`EPIPE`)&&n.emit(`error`,e)};if(this.stream.on(`error`,r),this.stream.on(`close`,function(){n.emit(`end`)}),!this.ssl)return this.attachListeners(this.stream);if(this.sslNegotiation===`direct`)return this.stream.once(`connect`,function(){n.upgradeToSSL(t,r)});this.stream.once(`data`,function(e){switch(e.toString(`utf8`)){case`S`:break;case`N`:return n.stream.end(),n.emit(`error`,Error(`The server does not support SSL connections`));default:return n.stream.end(),n.emit(`error`,Error(`There was an error establishing an SSL connection`))}n.upgradeToSSL(t,r)})}upgradeToSSL(e,n){let r=this,i={socket:r.stream,host:e};r.ssl!==!0&&(Object.assign(i,r.ssl),`key`in r.ssl&&(i.key=r.ssl.key)),r.sslNegotiation===`direct`&&(i.ALPNProtocols=[`postgresql`]);let a=(X1(),t(Y1));a.isIP&&a.isIP(e)===0&&(i.servername=e);try{r.stream=o.getSecureStream(i)}catch(e){return r.emit(`error`,e)}r.attachListeners(r.stream),r.stream.on(`error`,n),r.emit(`sslconnect`)}attachListeners(e){i(e,e=>{let t=e.name===`error`?`errorMessage`:e.name;this._emitMessage&&this.emit(`message`,e),this.emit(t,e)})}requestSsl(){this.stream.write(a.requestSsl())}startup(e){this.stream.write(a.startup(e))}cancel(e,t){this._send(a.cancel(e,t))}password(e){this._send(a.password(e))}sendSASLInitialResponseMessage(e,t){this._send(a.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(a.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(a.query(e))}parse(e){this._send(a.parse(e))}bind(e){this._send(a.bind(e))}execute(e){this._send(a.execute(e))}flush(){this.stream.writable&&this.stream.write(c)}sync(){this._send(l)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable)this.stream.end();else return this.stream.write(u,()=>{this.stream.end()})}close(e){this._send(a.close(e))}describe(e){this._send(a.describe(e))}sendCopyFromChunk(e){this._send(a.copyData(e))}endCopyFrom(){this._send(a.copyDone())}sendCopyFail(e){this._send(a.copyFail(e))}}})),n0=r({"module.exports":()=>bo}),r0=n(()=>{}),i0=r({"module.exports":()=>ao}),a0=n(()=>{}),o0=r({"module.exports":()=>xo}),s0=n(()=>{}),c0=i(((e,n)=>{var{Transform:r}=(a0(),t(i0)),{StringDecoder:i}=(s0(),t(o0)),a=Symbol(`last`),o=Symbol(`decoder`);function s(e,t,n){let r;if(this.overflow){if(r=this[o].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[a]+=this[o].write(e),r=this[a].split(this.matcher);this[a]=r.pop();for(let e=0;e<r.length;e++)try{l(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[a].length>this.maxLength,this.overflow&&!this.skipOverflow?n(Error(`maximum buffer reached`)):n()}function c(e){if(this[a]+=this[o].end(),this[a])try{l(this,this.mapper(this[a]))}catch(t){return e(t)}e()}function l(e,t){t!==void 0&&e.push(t)}function u(e){return e}function d(e,t,n){switch(e||=/\r?\n/,t||=u,n||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(n=e,e=/\r?\n/);break;case 2:typeof e==`function`?(n=t,t=e,e=/\r?\n/):typeof t==`object`&&(n=t,t=u)}n=Object.assign({},n),n.autoDestroy=!0,n.transform=s,n.flush=c,n.readableObjectMode=!0;let l=new r(n);return l[a]=``,l[o]=new i(`utf8`),l.matcher=e,l.mapper=t,l.maxLength=n.maxLength,l.skipOverflow=n.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}n.exports=d})),l0=i(((e,n)=>{var r=(r0(),t(n0)),i=(a0(),t(i0)).Stream,a=c0(),o=(T1(),t(w1)),s=5432,c=process.platform===`win32`,l=process.stderr,u=56,d=7,f=61440,p=32768;function m(e){return(e&f)==p}var h=[`host`,`port`,`database`,`user`,`password`],g=h.length,_=h[g-1];function v(){if(l instanceof i&&!0===l.writable){var e=Array.prototype.slice.call(arguments).concat(`
|
|
469
|
+
`);l.write(o.format.apply(o,e))}}Object.defineProperty(n.exports,"isWin",{get:function(){return c},set:function(e){c=e}}),n.exports.warnTo=function(e){var t=l;return l=e,t},n.exports.getFileName=function(e){var t=e||process.env;return t.PGPASSFILE||(c?r.join(t.APPDATA||`./`,`postgresql`,`pgpass.conf`):r.join(t.HOME||`./`,`.pgpass`))},n.exports.usePgPass=function(e,t){return Object.prototype.hasOwnProperty.call(process.env,`PGPASSWORD`)?!1:c?!0:(t||=`<unkn>`,m(e.mode)?e.mode&(u|d)?(v(`WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less`,t),!1):!0:(v(`WARNING: password file "%s" is not a plain file`,t),!1))};var y=n.exports.match=function(e,t){return h.slice(0,-1).reduce(function(n,r,i){return i==1&&Number(e[r]||s)===Number(t[r])?n&&!0:n&&(t[r]===`*`||t[r]===e[r])},!0)};n.exports.getPassword=function(e,t,n){var r,i=t.pipe(a());function o(t){var n=b(t);n&&x(n)&&y(e,n)&&(r=n[_],i.end())}var s=function(){t.destroy(),n(r)},c=function(e){t.destroy(),v(`WARNING: error on reading file: %s`,e),n(void 0)};t.on(`error`,c),i.on(`data`,o).on(`end`,s).on(`error`,c)};var b=n.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t=``,n=``,r=0,i=0,a={},o=!1,s=function(t,n,r){var i=e.substring(n,r);Object.hasOwnProperty.call(process.env,`PGPASS_NO_DEESCAPE`)||(i=i.replace(/\\([:\\])/g,`$1`)),a[h[t]]=i},c=0;c<e.length-1;c+=1){if(t=e.charAt(c+1),n=e.charAt(c),o=r==g-1,o){s(r,i);break}c>=0&&t==`:`&&n!==`\\`&&(s(r,i,c+1),i=c+2,r+=1)}return a=Object.keys(a).length===g?a:null,a},x=n.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return e===`*`||(e=Number(e),isFinite(e)&&e>0&&e<9007199254740992&&Math.floor(e)===e)},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},n=0;n<h.length;n+=1){var r=t[n];if(!r(e[h[n]]||``))return!1}return!0}})),u0=i(((e,n)=>{r0();var r=(R1(),t(L1)),i=l0();n.exports=function(e,t){var n=i.getFileName();r.stat(n,function(a,o){if(a||!i.usePgPass(o,n))return t(void 0);var s=r.createReadStream(n);i.getPassword(e,s,t)})},n.exports.warnTo=i.warnTo})),d0=i(((e,n)=>{var r=(d1(),t(u1)).EventEmitter,i=O1(),a=(T1(),t(w1)),o=N1(),s=P1(),c=B1(),l=H1(),u=C1(),d=t0(),f=j1(),p=a.deprecate(()=>{},`Client.activeQuery is deprecated and will be removed in pg@9.0`),m=a.deprecate(()=>{},`Client.queryQueue is deprecated and will be removed in pg@9.0.`),h=a.deprecate(()=>{},`pgpass support is deprecated and will be removed in pg@9.0. You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code.`),g=a.deprecate(()=>{},`Passing a custom Promise implementation to the Client/Pool constructor is deprecated and will be removed in pg@9.0.`),_=a.deprecate(()=>{},`Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.`);function v(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e==`string`&&e.trim()!==``){let n=Number(e);return Number.isFinite(n)?n:t}return t}var y=class extends r{constructor(e){super(),this.connectionParameters=new c(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let t=e||{};t.Promise&&g(),this._Promise=t.Promise||global.Promise,this._types=new s(t.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this._activeQuery=null,this._txStatus=null,this.enableChannelBinding=!!t.enableChannelBinding,this.scramMaxIterations=v(t.scramMaxIterations,o.DEFAULT_MAX_SCRAM_ITERATIONS),this.connection=t.connection||new d({stream:t.stream,ssl:this.connectionParameters.ssl,sslNegotiation:this.connectionParameters.sslnegotiation,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||`utf8`}),this._queryQueue=[],this._sentQueryQueue=[],this.pipeline=!!t.pipeline,this.binary=t.binary||u.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.sslNegotiation=this.connectionParameters.sslnegotiation||`postgres`,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}get activeQuery(){return p(),this._activeQuery}set activeQuery(e){p(),this._activeQuery=e}_getActiveQuery(){return this._activeQuery}_errorAllQueries(e){let t=t=>{process.nextTick(()=>{t.handleError(e,this.connection)})},n=this._getActiveQuery();n&&(t(n),this._activeQuery=null),this._sentQueryQueue.forEach(t),this._sentQueryQueue.length=0,this._queryQueue.forEach(t),this._queryQueue.length=0}_connect(e){let t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error(`Client has already been connected. You cannot reuse a client.`);process.nextTick(()=>{e(t)})}else this._connecting=!0,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(Error(`timeout expired`))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref&&this.connectionTimeoutHandle.unref()),this.host&&this.host.indexOf(`/`)===0?n.connect(this.host+`/.s.PGSQL.`+this.port):n.connect(this.port,this.host),n.on(`connect`,function(){t.ssl?t.sslNegotiation!==`direct`&&n.requestSsl():n.startup(t.getStartupConf())}),n.on(`sslconnect`,function(){n.startup(t.getStartupConf())}),this._attachListeners(n),n.once(`end`,()=>{let e=this._ending?Error(`Connection terminated`):Error(`Connection terminated unexpectedly`);clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),process.nextTick(()=>{this.emit(`end`)})})}connect(e){if(e)this._connect(e);else return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e(this)})})}_attachListeners(e){e.on(`authenticationCleartextPassword`,this._handleAuthCleartextPassword.bind(this)),e.on(`authenticationMD5Password`,this._handleAuthMD5Password.bind(this)),e.on(`authenticationSASL`,this._handleAuthSASL.bind(this)),e.on(`authenticationSASLContinue`,this._handleAuthSASLContinue.bind(this)),e.on(`authenticationSASLFinal`,this._handleAuthSASLFinal.bind(this)),e.on(`backendKeyData`,this._handleBackendKeyData.bind(this)),e.on(`error`,this._handleErrorEvent.bind(this)),e.on(`errorMessage`,this._handleErrorMessage.bind(this)),e.on(`readyForQuery`,this._handleReadyForQuery.bind(this)),e.on(`notice`,this._handleNotice.bind(this)),e.on(`rowDescription`,this._handleRowDescription.bind(this)),e.on(`dataRow`,this._handleDataRow.bind(this)),e.on(`portalSuspended`,this._handlePortalSuspended.bind(this)),e.on(`emptyQuery`,this._handleEmptyQuery.bind(this)),e.on(`commandComplete`,this._handleCommandComplete.bind(this)),e.on(`parseComplete`,this._handleParseComplete.bind(this)),e.on(`copyInResponse`,this._handleCopyInResponse.bind(this)),e.on(`copyData`,this._handleCopyData.bind(this)),e.on(`notification`,this._handleNotification.bind(this))}_getPassword(e){let t=this.connection;if(typeof this.password==`function`)this._Promise.resolve().then(()=>this.password(this.connectionParameters)).then(n=>{if(n!==void 0){if(typeof n!=`string`){t.emit(`error`,TypeError(`Password must be a string`));return}this.connectionParameters.password=this.password=n}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit(`error`,e)});else if(this.password!==null)e();else try{u0()(this.connectionParameters,t=>{t!==void 0&&(h(),this.connectionParameters.password=this.password=t),e()})}catch(e){this.emit(`error`,e)}}_handleAuthCleartextPassword(e){this._getPassword(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._getPassword(async()=>{try{let t=await f.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)}catch(e){this.emit(`error`,e)}})}_handleAuthSASL(e){this._getPassword(()=>{try{this.saslSession=o.startSession(e.mechanisms,this.enableChannelBinding&&this.connection.stream,this.scramMaxIterations),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}})}async _handleAuthSASLContinue(e){try{await o.continueSession(this.saslSession,this.password,e.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}}_handleAuthSASLFinal(e){try{o.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(e){this.connection.emit(`error`,e)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&=(this._connectionCallback(null,this),null),this.emit(`connect`));let t=this._getActiveQuery();this._activeQuery=null,this._txStatus=e?.status??null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit(`error`,e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit(`error`,e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this._getActiveQuery();t?(this._activeQuery=null,t.name&&delete this.connection.submittedNamedStatements[t.name],t.handleError(e,this.connection)):this._handleErrorEvent(e)}_handleRowDescription(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected rowDescription message from backend.`);this._handleErrorEvent(e)}else t.handleRowDescription(e)}_handleDataRow(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected dataRow message from backend.`);this._handleErrorEvent(e)}else t.handleDataRow(e)}_handlePortalSuspended(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected portalSuspended message from backend.`);this._handleErrorEvent(e)}else t.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected emptyQuery message from backend.`);this._handleErrorEvent(e)}else t.handleEmptyQuery(this.connection)}_handleCommandComplete(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected commandComplete message from backend.`);this._handleErrorEvent(e)}else t.handleCommandComplete(e,this.connection)}_handleParseComplete(){let e=this._getActiveQuery();if(e==null){let e=Error(`Received unexpected parseComplete message from backend.`);this._handleErrorEvent(e)}else e.name&&(this.connection.parsedStatements[e.name]=e.text,delete this.connection.submittedNamedStatements[e.name])}_handleCopyInResponse(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected copyInResponse message from backend.`);this._handleErrorEvent(e)}else t.handleCopyInResponse(this.connection)}_handleCopyData(e){let t=this._getActiveQuery();if(t==null){let e=Error(`Received unexpected copyData message from backend.`);this._handleErrorEvent(e)}else t.handleCopyData(e,this.connection)}_handleNotification(e){this.emit(`notification`,e)}_handleNotice(e){this.emit(`notice`,e)}getStartupConf(){let e=this.connectionParameters,t={user:e.user,database:e.database},n=e.application_name||e.fallback_application_name;return n&&(t.application_name=n),e.replication&&(t.replication=``+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){let t=this.connection;this.host&&this.host.indexOf(`/`)===0?t.connect(this.host+`/.s.PGSQL.`+this.port):t.connect(this.port,this.host),t.on(`connect`,function(){t.cancel(e.processID,e.secretKey)})}else e._queryQueue.indexOf(t)===-1?e._sentQueryQueue.indexOf(t)!==-1&&(t.callback=()=>{}):e._queryQueue.splice(e._queryQueue.indexOf(t),1)}setTypeParser(e,t,n){return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return i.escapeIdentifier(e)}escapeLiteral(e){return i.escapeLiteral(e)}_pulseQueryQueue(){if(this.pipeline)this._pulsePipelinedQueryQueue();else if(this.readyForQuery===!0){this._activeQuery=this._queryQueue.shift();let e=this._getActiveQuery();if(e){this.readyForQuery=!1,this.hasExecuted=!0;let t=e.submit(this.connection);t&&process.nextTick(()=>{e.handleError(t,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this._activeQuery=null,this.emit(`drain`))}}_pulsePipelinedQueryQueue(){if(this._connected&&this._queryable){for(;this._queryQueue.length>0;){let e=this._queryQueue.shift();this.hasExecuted=!0;let t=e.submit(this.connection);t?process.nextTick(()=>{e.handleError(t,this.connection)}):this._sentQueryQueue.push(e)}this.readyForQuery&&!this._activeQuery&&this._sentQueryQueue.length>0&&(this._activeQuery=this._sentQueryQueue.shift(),this.readyForQuery=!1),!this._activeQuery&&this._sentQueryQueue.length===0&&this._queryQueue.length===0&&this.hasExecuted&&this.emit(`drain`)}}query(e,t,n){let r,i;if(e==null)throw TypeError(`Client was passed a null or undefined query`);if(typeof e.submit==`function`)i=r=e,r.callback||(typeof t==`function`?r.callback=t:n&&(r.callback=n));else if(r=new l(e,t,n),!r.callback)i=new this._Promise((e,t)=>{r.callback=(n,r)=>n?t(n):e(r)}).catch(e=>{throw Error.captureStackTrace(e),e});else if(typeof r.callback!=`function`)throw TypeError(`callback is not a function`);let a=e.query_timeout||this.connectionParameters.query_timeout;if(a){let e=r.callback||(()=>{}),t=setTimeout(()=>{let t=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(t,this.connection)}),e(t),r.callback=()=>{};let n=this._queryQueue.indexOf(r);if(n>-1)this._queryQueue.splice(n,1);else if(this.pipeline){this.connection.stream.destroy();return}this._pulseQueryQueue()},a);r.callback=(n,r)=>{clearTimeout(t),e(n,r)}}if(this.binary&&!r.binary&&(r.binary=!0),r._result&&!r._result._types&&(r._result._types=this._types),this.pipeline){let t=typeof e.submit==`function`&&!(r instanceof l)?`Custom query classes such as pg-cursor and pg-query-stream are`:r.rows?"The `rows` option is":null;if(t)return process.nextTick(()=>{r.handleError(Error(`${t} not supported in pipeline mode`),this.connection)}),i}return this._queryable?this._ending?(process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`),this.connection)}),i):(this._queryQueue.length>0&&!this.pipeline&&_(),this._queryQueue.push(r),this._pulseQueryQueue(),i):(process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`),this.connection)}),i)}ref(){this.connection.ref()}unref(){this.connection.unref()}getTransactionStatus(){return this._txStatus}end(e){if(this._ending=!0,!this.connection._connecting||this._ended){if(e){e();return}return this._Promise.resolve()}if(this._queryable?this.pipeline&&(this._getActiveQuery()||this._sentQueryQueue.length>0||this._queryQueue.length>0)?this.once(`drain`,()=>this.connection.end()):this._getActiveQuery()?this.connection.stream.destroy():this.connection.end():this.connection.stream.destroy(),e)this.connection.once(`end`,e);else return new this._Promise(e=>{this.connection.once(`end`,e)})}get queryQueue(){return m(),this._queryQueue}};y.Query=l,n.exports=y})),f0=i(((e,n)=>{var r=(d1(),t(u1)).EventEmitter,i=function(){},a=(e,t)=>{let n=e.findIndex(t);return n===-1?void 0:e.splice(n,1)[0]},o=class{constructor(e,t,n){this.client=e,this.idleListener=t,this.timeoutId=n}},s=class{constructor(e){this.callback=e}};function c(){throw Error(`Release called on client which has already been released to the pool.`)}function l(e,t){if(t)return{callback:t,result:void 0};let n,r;return{callback:function(e,t){e?n(e):r(t)},result:new e(function(e,t){r=e,n=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function u(e,t){return function n(r){r.client=t,t.removeListener(`error`,n),t.on(`error`,()=>{e.log(`additional client error after disconnection due to error`,r)}),e._remove(t),e.emit(`error`,r,t)}}n.exports=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),e!=null&&`password`in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||y0().Client,this.Promise=this.options.Promise||global.Promise,this.options.idleTimeoutMillis===void 0&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_promiseTry(e){let t=this.Promise;return typeof t.try==`function`?t.try(e):new t(t=>t(e()))}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log(`pulse queue`),this.ended){this.log(`pulse queue ended`);return}if(this.ending){this.log(`pulse queue on ending`),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log(`no queued requests`);return}if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let r=t.idleListener;return this._acquireClient(n,e,r,!1)}if(!this._isFull())return this.newClient(e);throw Error(`unexpected condition`)}_remove(e,t){let n=a(this._idle,t=>t.client===e);n!==void 0&&clearTimeout(n.timeoutId),this._clients=this._clients.filter(t=>t!==e);let r=this;e.end(()=>{r.emit(`remove`,e),typeof t==`function`&&t()})}connect(e){if(this.ending){let t=Error(`Cannot use a pool after calling end on the pool`);return e?e(t):this.Promise.reject(t)}let t=l(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new s(t.callback)),n;let e=(e,n,r)=>{clearTimeout(i),t.callback(e,n,r)},r=new s(e),i=setTimeout(()=>{a(this._pendingQueue,t=>t.callback===e),r.timedOut=!0,t.callback(Error(`timeout exceeded when trying to connect`))},this.options.connectionTimeoutMillis);return i.unref&&i.unref(),this._pendingQueue.push(r),n}return this.newClient(new s(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let n=u(this,t);this.log(`checking client timeout`);let r,a=!1;this.options.connectionTimeoutMillis&&(r=setTimeout(()=>{t.connection?(this.log(`ending client due to timeout`),a=!0,t.connection.stream.destroy()):t.isConnected()||(this.log(`ending client due to timeout`),a=!0,t.end())},this.options.connectionTimeoutMillis)),this.log(`connecting new client`),t.connect(o=>{if(r&&clearTimeout(r),t.on(`error`,n),o)this.log(`client failed to connect`,o),this._clients=this._clients.filter(e=>e!==t),a&&(o=Error(`Connection terminated due to connection timeout`,{cause:o})),this._pulseQueue(),e.timedOut||e.callback(o,void 0,i);else{if(this.log(`new client connected`),this.options.onConnect){this._promiseTry(()=>this.options.onConnect(t)).then(()=>{this._afterConnect(t,e,n)},n=>{this._clients=this._clients.filter(e=>e!==t),t.end(()=>{this._pulseQueue(),e.timedOut||e.callback(n,void 0,i)})});return}return this._afterConnect(t,e,n)}})}_afterConnect(e,t,n){if(this.options.maxLifetimeSeconds!==0){let t=setTimeout(()=>{this.log(`ending client due to expired lifetime`),this._expired.add(e),this._idle.findIndex(t=>t.client===e)!==-1&&this._acquireClient(e,new s((e,t,n)=>n()),n,!1)},this.options.maxLifetimeSeconds*1e3);t.unref(),e.once(`end`,()=>clearTimeout(t))}return this._acquireClient(e,t,n,!0)}_acquireClient(e,t,n,r){r&&this.emit(`connect`,e),this.emit(`acquire`,e),e.release=this._releaseOnce(e,n),e.removeListener(`error`,n),t.timedOut?r&&this.options.verify?this.options.verify(e,e.release):e.release():r&&this.options.verify?this.options.verify(e,n=>{if(n)return e.release(n),t.callback(n,void 0,i);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let n=!1;return r=>{n&&c(),n=!0,this._release(e,t,r)}}_release(e,t,n){if(e.on(`error`,t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit(`release`,n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses)return e._poolUseCount>=this.options.maxUses&&this.log(`remove expended client`),this._remove(e,this._pulseQueue.bind(this));if(this._expired.has(e))return this.log(`remove expired client`),this._expired.delete(e),this._remove(e,this._pulseQueue.bind(this));let r;this.options.idleTimeoutMillis&&this._isAboveMin()&&(r=setTimeout(()=>{this._isAboveMin()&&(this.log(`remove idle client`),this._remove(e,this._pulseQueue.bind(this)))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&r.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new o(e,t,r)),this._pulseQueue()}query(e,t,n){if(typeof e==`function`){let t=l(this.Promise,e);return setImmediate(function(){return t.callback(Error(`Passing a function as the first parameter to pool.query is not supported`))}),t.result}typeof t==`function`&&(n=t,t=void 0);let r=l(this.Promise,n);return n=r.callback,this.connect((r,i)=>{if(r)return n(r);let a=!1,o=e=>{a||(a=!0,i.release(e),n(e))};i.once(`error`,o),this.log(`dispatching query`);try{i.query(e,t,(e,t)=>{if(this.log(`query dispatched`),i.removeListener(`error`,o),!a)return a=!0,i.release(e),e?n(e):n(void 0,t)})}catch(e){return i.release(e),n(e)}}),r.result}end(e){if(this.log(`ending`),this.ending){let t=Error(`Called end on pool more than once`);return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=l(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+ +!!this._expired.has(t),0)}get totalCount(){return this._clients.length}}})),p0=r({default:()=>m0}),m0,h0=n(()=>{throw m0={},Error(`Could not resolve "pg-native" imported by "pg". Is it installed?`)}),g0=i(((e,n)=>{var r=(d1(),t(u1)).EventEmitter,i=(T1(),t(w1)),a=O1(),o=n.exports=function(e,t,n){r.call(this),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.queryMode=e.queryMode,this.callback=e.callback,this.state=`new`,this._arrayMode=e.rowMode===`array`,this._emitRowEvents=!1,this.on(`newListener`,function(e){e===`row`&&(this._emitRowEvents=!0)}.bind(this))};i.inherits(o,r);var s={sqlState:`code`,statementPosition:`position`,messagePrimary:`message`,messageDetail:`detail`,messageHint:`hint`,context:`where`,schemaName:`schema`,tableName:`table`,columnName:`column`,dataTypeName:`dataType`,constraintName:`constraint`,sourceFile:`file`,sourceLine:`line`,sourceFunction:`routine`};o.prototype.handleError=function(e){let t=this.native&&this.native.pq.resultErrorFields();if(t)for(let n in t){let r=s[n]||n;e[r]=t[n]}this.callback?this.callback(e):this.emit(`error`,e),this.state=`error`},o.prototype.then=function(e,t){return this._getPromise().then(e,t)},o.prototype.catch=function(e){return this._getPromise().catch(e)},o.prototype._getPromise=function(){return this._promise||=new Promise(function(e,t){this._once(`end`,e),this._once(`error`,t)}.bind(this)),this._promise},o.prototype.submit=function(e){this.state=`running`;let t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;let n=function(n,r,i){if(e.native.arrayMode=!1,setImmediate(function(){t.emit(`_done`)}),n)return t.handleError(n);t._emitRowEvents&&(i.length>1?r.forEach((e,n)=>{e.forEach(e=>{t.emit(`row`,e,i[n])})}):r.forEach(function(e){t.emit(`row`,e,i)})),t.state=`end`,t.emit(`end`,i),t.callback&&t.callback(null,i)};if(process.domain&&(n=process.domain.bind(n)),this.name){this.name.length>63&&(console.error(`Warning! Postgres only supports 63 characters for query names.`),console.error(`You supplied %s (%s)`,this.name,this.name.length),console.error(`This can cause conflicts and silent errors executing queries`));let r=(this.values||[]).map(a.prepareValue);if(e.namedQueries[this.name]!==void 0){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return n(e)}return e.native.execute(this.name,r,n)}return e.native.prepare(this.name,this.text,r.length,function(i){return i?n(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,r,n))})}if(this.values){if(!Array.isArray(this.values))return n(Error(`Query values must be an array`));let t=this.values.map(a.prepareValue);e.native.query(this.text,t,n)}else this.queryMode===`extended`?e.native.query(this.text,[],n):e.native.query(this.text,n)}})),_0=i(((e,n)=>{var r=(T1(),t(w1)),i;try{i=(h0(),t(p0))}catch(e){throw e}var a=P1(),o=(d1(),t(u1)).EventEmitter,s=(T1(),t(w1)),c=B1(),l=g0(),u=r.deprecate(()=>{},`Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.`),d=n.exports=function(e){o.call(this),e||={},this._Promise=e.Promise||global.Promise,this._types=new a(e.types),this.native=new i({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0,this.pipeline=!!e.pipeline,this._pipelineInFlight=!1;let t=this.connectionParameters=new c(e);e.nativeConnectionString&&(t.nativeConnectionString=e.nativeConnectionString),this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};d.Query=l,s.inherits(d,o),d.prototype._errorAllQueries=function(e){let t=t=>{process.nextTick(()=>{t.native=this.native,t.handleError(e)})};this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},d.prototype._connect=function(e){let t=this;this._connecting?process.nextTick(()=>e(Error(`Client has already been connected. You cannot reuse a client.`))):(this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(n,r){if(t.connectionParameters.nativeConnectionString&&(r=t.connectionParameters.nativeConnectionString),n)return e(n);t.native.connect(r,function(n){if(n)return t.native.end(),e(n);t._connected=!0,t.native.on(`error`,function(e){t._queryable=!1,t._errorAllQueries(e),t.emit(`error`,e)}),t.native.on(`notification`,function(e){t.emit(`notification`,{channel:e.relname,payload:e.extra})}),t.emit(`connect`),t._pulseQueryQueue(!0),e(null,this)})}))},d.prototype.connect=function(e){if(e)this._connect(e);else return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e(this)})})},d.prototype.query=function(e,t,n){let r,i,a,o,s;if(e==null)throw TypeError(`Client was passed a null or undefined query`);if(typeof e.submit==`function`)a=e.query_timeout||this.connectionParameters.query_timeout,i=r=e,typeof t==`function`&&(e.callback=t);else if(a=e.query_timeout||this.connectionParameters.query_timeout,r=new l(e,t,n),!r.callback){let e,t;i=new this._Promise((n,r)=>{e=n,t=r}).catch(e=>{throw Error.captureStackTrace(e),e}),r.callback=(n,r)=>n?t(n):e(r)}return a&&(s=r.callback||(()=>{}),o=setTimeout(()=>{let e=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(e,this.connection)}),s(e),r.callback=()=>{};let t=this._queryQueue.indexOf(r);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},a),r.callback=(e,t)=>{clearTimeout(o),s(e,t)}),this._queryable?this._ending?(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`))}),i):(this._queryQueue.length>0&&!this.pipeline&&u(),this._queryQueue.push(r),this._pulseQueryQueue(),i):(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`))}),i)},d.prototype.end=function(e){let t=this;this._ending=!0,this._connecting&&!this._connected&&this.once(`connect`,()=>{this.end(()=>{})});let n;e||(n=new this._Promise(function(t,n){e=e=>e?n(e):t()}));let r=function(){t.native.end(function(){t._connected=!1,t._errorAllQueries(Error(`Connection terminated`)),process.nextTick(()=>{t.emit(`end`),e&&e()})})};return this.pipeline&&(this._pipelineInFlight||this._queryQueue.length>0)?this.once(`drain`,r):r(),n},d.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!==`error`&&this._activeQuery.state!==`end`},d.prototype._pulseQueryQueue=function(e){if(!this._connected)return;if(this.pipeline&&!e)return this._pulsePipelinedQueryQueue();if(this._hasActiveQuery())return;let t=this._queryQueue.shift();if(!t){e||this.emit(`drain`);return}this._activeQuery=t,t.submit(this);let n=this;t.once(`_done`,function(){n._pulseQueryQueue()})},d.prototype._pulsePipelinedQueryQueue=function(){if(!this._connected||this._pipelineInFlight)return;if(this._queryQueue.length===0){this.hasExecuted&&this.emit(`drain`);return}this._pipelineInFlight=!0;let e=this,t=[],n=[],r=O1();for(;this._queryQueue.length>0;){let e=this._queryQueue.shift();this.hasExecuted=!0,n.push(e);let i=e.values?e.values.map(r.prepareValue):null,a={text:e.text,name:e.name,arrayMode:e._arrayMode};i&&(a.values=i),e.name&&this.namedQueries[e.name]&&(a._alreadyPrepared=!0),t.push(a)}this.native.pipeline(t,function(t,r){if(e._pipelineInFlight=!1,t){e._connected=!1,e._queryable=!1;for(let r=0;r<n.length;r++){let i=n[r];i.native=e.native,i.handleError(t)}e._errorAllQueries(t),e.emit(`error`,t),e.emit(`end`)}else{for(let t=0;t<n.length;t++){let i=n[t],a=r[t];i.native=e.native,a.err?i.handleError(a.err):(i.name&&(e.namedQueries[i.name]=i.text),i.state=`end`,i.emit(`end`,a.result),i.callback&&i.callback(null,a.result)),setImmediate(function(){i.emit(`_done`)})}e._pulsePipelinedQueryQueue()}})},d.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):this._queryQueue.indexOf(e)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},d.prototype.ref=function(){},d.prototype.unref=function(){},d.prototype.setTypeParser=function(e,t,n){return this._types.setTypeParser(e,t,n)},d.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)},d.prototype.isConnected=function(){return this._connected},d.prototype.getTransactionStatus=function(){return this.native.getTransactionStatus()}})),v0=i(((e,t)=>{t.exports=_0()})),y0=i(((e,t)=>{var n=d0(),r=C1(),i=t0(),a=V1(),o=O1(),s=f0(),c=P1(),{DatabaseError:l}=J1(),{escapeIdentifier:u,escapeLiteral:d}=O1(),f=e=>class extends s{constructor(t){super(t,e)}},p=function(e){this.defaults=r,this.Client=e,this.Query=this.Client.Query,this.Pool=f(this.Client),this._pools=[],this.Connection=i,this.types=S1(),this.DatabaseError=l,this.TypeOverrides=c,this.escapeIdentifier=u,this.escapeLiteral=d,this.Result=a,this.utils=o},m=n,h=!1;try{h=!!process.env.NODE_PG_FORCE_NATIVE}catch{}h&&(m=v0()),t.exports=new p(m),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){let e=null;try{e=new p(v0())}catch(e){if(e.code!==`MODULE_NOT_FOUND`)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}})})),b0=e(y0(),1);b0.default.Client,b0.default.Pool,b0.default.Connection,b0.default.types,b0.default.Query,b0.default.DatabaseError,b0.default.escapeIdentifier,b0.default.escapeLiteral,b0.default.Result,b0.default.TypeOverrides,b0.default.defaults;var x0=b0.default,{Pool:S0,types:C0}=x0,w0=class extends Hj{constructor(e,t,n,r,i,a,o,s,c,l,u){super({sql:t,params:n},i,a,o),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=s,this._isResponseInArrayMode=l,this.customResultMapper=u,this.rawQueryConfig={name:c,text:t,types:{getTypeParser:(e,t)=>e===C0.builtins.TIMESTAMPTZ||e===C0.builtins.TIMESTAMP||e===C0.builtins.DATE||e===C0.builtins.INTERVAL||e===1231||e===1115||e===1185||e===1187||e===1182?e=>e:C0.getTypeParser(e,t)}},this.queryConfig={name:c,text:t,rowMode:`array`,types:{getTypeParser:(e,t)=>e===C0.builtins.TIMESTAMPTZ||e===C0.builtins.TIMESTAMP||e===C0.builtins.DATE||e===C0.builtins.INTERVAL||e===1231||e===1115||e===1185||e===1187||e===1182?e=>e:C0.getTypeParser(e,t)}}}static[W]=`NodePgPreparedQuery`;rawQueryConfig;queryConfig;async execute(e={}){return VE.startActiveSpan(`drizzle.execute`,async()=>{let t=lD(this.params,e);this.logger.logQuery(this.rawQueryConfig.text,t);let{fields:n,rawQueryConfig:r,client:i,queryConfig:a,joinsNotNullableMap:o,customResultMapper:s}=this;if(!n&&!s)return VE.startActiveSpan(`drizzle.driver.execute`,async e=>(e?.setAttributes({"drizzle.query.name":r.name,"drizzle.query.text":r.text,"drizzle.query.params":JSON.stringify(t)}),this.queryWithCache(r.text,t,async()=>await i.query(r,t))));let c=await VE.startActiveSpan(`drizzle.driver.execute`,e=>(e?.setAttributes({"drizzle.query.name":a.name,"drizzle.query.text":a.text,"drizzle.query.params":JSON.stringify(t)}),this.queryWithCache(a.text,t,async()=>await i.query(a,t))));return VE.startActiveSpan(`drizzle.mapResponse`,()=>s?s(c.rows):c.rows.map(e=>TD(n,e,o)))})}all(e={}){return VE.startActiveSpan(`drizzle.execute`,()=>{let t=lD(this.params,e);return this.logger.logQuery(this.rawQueryConfig.text,t),VE.startActiveSpan(`drizzle.driver.execute`,e=>(e?.setAttributes({"drizzle.query.name":this.rawQueryConfig.name,"drizzle.query.text":this.rawQueryConfig.text,"drizzle.query.params":JSON.stringify(t)}),this.queryWithCache(this.rawQueryConfig.text,t,async()=>this.client.query(this.rawQueryConfig,t)).then(e=>e.rows)))})}isResponseInArrayMode(){return this._isResponseInArrayMode}},T0=class e extends Uj{constructor(e,t,n,r={}){super(t),this.client=e,this.schema=n,this.options=r,this.logger=r.logger??new CD,this.cache=r.cache??new Bj}static[W]=`NodePgSession`;logger;cache;prepareQuery(e,t,n,r,i,a,o){return new w0(this.client,e.sql,e.params,this.logger,this.cache,a,o,t,n,r,i)}async transaction(t,n){let r=this.client instanceof S0||Object.getPrototypeOf(this.client).constructor.name.includes(`Pool`),i=r?new e(await this.client.connect(),this.dialect,this.schema,this.options):this,a=new E0(this.dialect,i,this.schema);await a.execute(q`begin${n?q` ${a.getTransactionConfigSQL(n)}`:void 0}`);try{let e=await t(a);return await a.execute(q`commit`),e}catch(e){throw await a.execute(q`rollback`),e}finally{r&&i.client.release()}}async count(e){let t=await this.execute(e);return Number(t.rows[0].count)}},E0=class e extends Wj{static[W]=`NodePgTransaction`;async transaction(t){let n=`sp${this.nestedIndex+1}`,r=new e(this.dialect,this.session,this.schema,this.nestedIndex+1);await r.execute(q.raw(`savepoint ${n}`));try{let e=await t(r);return await r.execute(q.raw(`release savepoint ${n}`)),e}catch(e){throw await r.execute(q.raw(`rollback to savepoint ${n}`)),e}}},D0=class{constructor(e,t,n={}){this.client=e,this.dialect=t,this.options=n}static[W]=`NodePgDriver`;createSession(e){return new T0(this.client,this.dialect,e,{logger:this.options.logger,cache:this.options.cache})}},O0=class extends Rj{static[W]=`NodePgDatabase`};function k0(e,t={}){let n=new pj({casing:t.casing}),r;t.logger===!0?r=new SD:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=OA(t.schema,NA);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new O0(n,new D0(e,n,{logger:r,cache:t.cache}).createSession(i),i);return a.$client=e,a.$cache=t.cache,a.$cache&&(a.$cache.invalidate=t.cache?.onMutate),a}function A0(...e){if(typeof e[0]==`string`)return k0(new x0.Pool({connectionString:e[0]}),e[1]);if(ND(e[0])){let{connection:t,client:n,...r}=e[0];return k0(n||(typeof t==`string`?new x0.Pool({connectionString:t}):new x0.Pool(t)),r)}return k0(e[0],e[1])}(e=>{function t(e){return k0({},e)}e.mock=t})(A0||={});var j0={};function M0(){let e=Yv(`DATABASE_URL`);if(e)return e;let t=Yv(`HYPERDRIVE`);if(t?.connectionString)return t.connectionString;throw Error(`db: PostgreSQL is not configured. Add DATABASE_URL to .env for local dev, or configure Hyperdrive for production.`)}function N0(){return A0({connection:{connectionString:M0(),max:1,idleTimeoutMillis:1e3}}).$client}function P0(){return Wv(j0,N0,N0)}function F0(e,t={}){let n=new Map,r;return new Proxy({},{get(n,r){if(Object.hasOwn(t,r))return t[r];let i=e(),a=Reflect.get(i,r);return typeof a==`function`?a.bind(i):a},has(r,i){return Object.hasOwn(t,i)?!0:(n.has(i)||n.set(i,Reflect.has(e(),i)),n.get(i))},getPrototypeOf:()=>r??=Object.getPrototypeOf(e())})}var I0,L0=new Proxy({},{get(e,t){Wv(j0,N0,()=>void 0),I0??=A0({client:F0(P0),schema:pM});let n=Reflect.get(I0,t);return typeof n==`function`?n.bind(I0):n}}),$=L0,R0=`__Host-tempo-id-account`,z0=3456e4,B0;(function(e){e.value=B({apps:Rt(z(),z()),session:z()})})(B0||={});async function V0(e,t){return(await Z(e,q0(e,t),`AccountStep.held`)).map(l1)}(function(e){e.errors=a1.errors})(V0||={});function H0(){return at(R0,``,{httpOnly:!0,maxAge:0,path:`/`,sameSite:`Lax`,secure:!0})}async function U0(e,t){let n=await Z(e,Q0(e,t),`AccountStep.realms`);return await Z(e,i1(e,{db:$,env:Sb,realms:n,userId:t.userId}),`TempoAccount.create`)}(function(e){e.errors=i1.errors})(U0||={});async function W0(e,t){let n=(await Z(e,Q0(e,t),`AccountStep.realms`))[0];return n!==void 0&&(n.privy!==void 0||n.secp256k1)}async function G0(e,t){if(!(await Z(e,e.env.ACCOUNT_LIMIT.limit({key:t.userId}),`ratelimit.limit`)).success)return!1;let n=await Z(e,V0(e,t),`AccountStep.accounts`).catch(n=>(wN(e,{error:n,fields:{clientId:t.clientId},message:`The account step skipped an authorization whose accounts failed to load.`}),[]));return n.length<=1?!1:!K0(n,X0(t))}function K0(e,t){if(t)return e.find(e=>e.address.toLowerCase()===t.toLowerCase())}async function q0(e,t){let n=await Z(e,Q0(e,t),`AccountStep.realms`);return await Z(e,a1(e,{db:$,env:Sb,realms:n,userId:t.userId}),`TempoAccount.held`)}(function(e){e.errors=a1.errors})(q0||={});function J0(e,t){let n=K0(e,X0(t));return n?[n,...e.filter(e=>e!==n)]:e}function Y0(e){let t=(e.cookie??``).split(`;`).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`__Host-tempo-id-account=`)),{[e.clientId]:n,...r}=Z0(e),i=JSON.stringify({apps:{...Object.fromEntries(Object.entries(r).slice(-15)),[e.clientId]:e.account},session:e.sessionId});return{header:[...t,`${R0}=${encodeURIComponent(i)}`].join(`; `),setCookie:at(R0,i,{httpOnly:!0,maxAge:z0,path:`/`,sameSite:`Lax`,secure:!0})}}function X0(e){let t=Z0(e);return Object.hasOwn(t,e.clientId)?t[e.clientId]:void 0}function Z0(e){let t=xt(e.cookie??``,R0)[R0];if(!t)return{};try{let n=B0.value.safeParse(JSON.parse(t));return!n.success||n.data.session!==e.sessionId?{}:n.data.apps}catch{return{}}}async function Q0(e,t){let n=await Z(e,pB($,{clientId:t.clientId}),`Realm.forApp`);return await Z(e,vB($,{origin:Sb.URL,realms:n}),`Realm.withDefaults`)}async function $0(e){let t=await Z(e,e.var.auth.api.getSession({headers:e.req.raw.headers,returnHeaders:!0}),`auth.getSession`);for(let n of t.headers.getSetCookie())e.header(`set-cookie`,n,{append:!0});return t.response}var e2;(function(e){let t;(function(e){e.query=B({chain:Ke.optional().meta({description:"The chain whose balance each account carries, `mainnet` or `testnet`. Without it, the accounts carry no balance.",examples:[`testnet`]}),client_id:z().min(1).max(255).optional().meta({description:"The app's client ID, whose realms select the accounts. A browser page from an origin that none of the app's redirect URIs has receives the `default` realm, as does a request without one.",examples:[`client_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]})}),e.response=B({email:Zt().meta({description:`The user's email address.`,examples:[`ada@example.com`]}),id:z().meta({description:"The user's ID, which is the `sub` of every token Tempo ID issues for the user.",examples:[`user_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]}),tempo:en(r1.tempoAccount.extend({balance:YL.balance.nullable().optional().meta({description:"The account's holdings of USD tokens on the chain that `chain` names, or `null` when the read fails or takes longer than 3 seconds. Absent without `chain`."})})).readonly().meta({description:`The user's Tempo Accounts in the realms the request reaches: the account that the user selected for the app first, then oldest first.`})}).meta({id:`Account`})})(t||=e.account||={});let n;(function(e){e.json=t.query.omit({chain:!0}),e.response=t.response})(n||=e.create||={});let r;(function(e){e.query=n.json,e.response=B({realms:en(r1.realm).readonly().meta({description:`The realms the app reaches, never empty. The first holds a user's first account.`})})})(r||=e.realms||={})})(e2||={});var t2=new Hy().get(`/v1/account`,QR({description:"Reads the signed-in user and their Tempo Accounts in the realms of the app that `client_id` names: the account that the user selected for the app first, then oldest first. Without `client_id`, the `default` realm's. With `chain`, each account carries its balance on that chain. Creates no account: `POST /v1/account` creates the first one.",responses:sz({errors:[...cz.errors,...gz.errors,...o1.errors,zL,PN],success:{description:`The user and their Tempo Accounts.`,schema:e2.account.response}}),security:[{sessionCookie:[]}],tags:[`Account`]}),cz(`query`,e2.account.query),async e=>{if(e.req.header(`sec-fetch-site`)===`cross-site`)return X(e,new PN);let t=await Z(e,$0(e),`Session.get`);if(!t)return X(e,new zL);let n=await Z(e,gz(e,{limits:[{binding:`ACCOUNT_LIMIT`,key:t.user.id}]}),`RateLimit.check`);if(n)return n;let r=await Z(e,mB($,{clientId:e.req.valid(`query`).client_id,origin:e.req.header(`origin`),own:new URL(Sb.URL).origin}),`Realm.forRequest`),i=await Z(e,vB($,{origin:Sb.URL,realms:r}),`Realm.withDefaults`),a=await Z(e,o1(e,{db:$,env:Sb,realms:i,userId:t.user.id}),`TempoAccount.list`),{chain:o,client_id:s}=e.req.valid(`query`),c=s?J0(a,{clientId:s,cookie:e.req.header(`cookie`),sessionId:t.session.id}):a,l=o?await Z(e,QL(e,{accounts:c,chainId:ht[o],rpcUrl:Sb.TEMPO_RPC_URL}),`Balance.list`):void 0;return e.header(`cache-control`,`private, no-store`),e.json({email:t.user.email,id:t.user.id,tempo:c.map((e,t)=>l?{...e,balance:l[t]??null}:e)},200)}).post(`/v1/account`,QR({description:"Returns the signed-in user and their Tempo Accounts, as `GET /v1/account` does, and creates a Privy-owned account in the first realm for a user with none, when that realm has a Privy app. A user with a linked wallet.tempo passkey in the realms receives none. The JSON body needs a CORS preflight, which Tempo ID grants only to the origins of first-party apps, so another app's page cannot send the request.",responses:sz({errors:[...nR,...cz.errors,...gz.errors,...i1.errors,zL,PN],success:{description:`The user and their Tempo Accounts.`,schema:e2.create.response}}),security:[{sessionCookie:[]}],tags:[`Account`]}),cz(`json`,e2.create.json),async e=>{let t=await Z(e,$0(e),`Session.get`);if(!t)return X(e,new zL);let n=await Z(e,gz(e,{limits:[{binding:`ACCOUNT_LIMIT`,key:t.user.id}]}),`RateLimit.check`);if(n)return n;let r=await Z(e,mB($,{clientId:e.req.valid(`json`).client_id,origin:e.req.header(`origin`),own:new URL(Sb.URL).origin}),`Realm.forRequest`),i=await Z(e,vB($,{origin:Sb.URL,realms:r}),`Realm.withDefaults`),a=(await Z(e,i1(e,{db:$,env:Sb,realms:i,userId:t.user.id}),`TempoAccount.create`)).map(l1),o=e.req.valid(`json`).client_id;return e.header(`cache-control`,`private, no-store`),e.json({email:t.user.email,id:t.user.id,tempo:o?J0(a,{clientId:o,cookie:e.req.header(`cookie`),sessionId:t.session.id}):a},200)}).get(`/v1/realms`,QR({description:"Lists the realms that the app `client_id` names reaches, in order. An app without realms reaches the `default` realm alone.",responses:sz({errors:[...cz.errors],success:{description:`The realms.`,schema:e2.realms.response}}),tags:[`Account`]}),cz(`query`,e2.realms.query),async e=>{let t=await Z(e,mB($,{clientId:e.req.valid(`query`).client_id,origin:e.req.header(`origin`),own:new URL(Sb.URL).origin}),`Realm.forRequest`);return e.header(`cache-control`,`private, no-store`),e.json({realms:t.map(e=>({id:e.id,name:e.name}))},200)}),n2;(function(e){e.credential=B({address:z().regex(/^0x[0-9a-fA-F]{40}$/),createdAt:Gt().int().min(0).max(864e13).nullable(),email:Zt().nullable(),publicKey:Bt([`0x04`,z().regex(/^[0-9a-fA-F]{128}$/)])})})(n2||={});async function r2(e,t){let n=n2.credential.safeParse(await e.credential({credentialId:t.id}));if(!n.success)return;let r=(()=>{try{return s(te(n.data.publicKey))}catch{return}})();if(r&&Ze(r,n.data.address))return n.data}async function i2(e,t){let n;if(e.database)n=typeof e.database==`function`?e.database(e):await t(e);else{let t=ji(e),r=Object.keys(t).reduce((e,t)=>(e[t]=[],e),{}),{memoryAdapter:i}=await import(`./assets/dist-CZGFhmQd.js`);n=i(r)(e)}return n.transaction||(Hi.warn(`Adapter does not correctly implement transaction function, patching it automatically. Please update your adapter implementation.`),n.transaction=async e=>e(n)),n}async function a2(e){return i2(e,async e=>{let{createKyselyAdapter:t,kyselyAdapter:n}=await import(`./assets/kysely-adapter-MkHAI9Jk.js`),{kysely:r,databaseType:i,transaction:a}=await t(e);if(!r)throw new U(`Failed to initialize database adapter`);return n(r,{type:i||`sqlite`,debugLogs:e.database&&`debugLogs`in e.database?e.database.debugLogs:!1,transaction:a})(e)})}var o2={postgres:{string:[`character varying`,`varchar`,`text`,`uuid`],number:[`int4`,`integer`,`bigint`,`smallint`,`numeric`,`real`,`double precision`],boolean:[`bool`,`boolean`],date:[`timestamptz`,`timestamp`,`date`],json:[`json`,`jsonb`]},mysql:{string:[`varchar`,`text`,`uuid`],number:[`integer`,`int`,`bigint`,`smallint`,`decimal`,`float`,`double`],boolean:[`boolean`,`tinyint`],date:[`timestamp`,`datetime`,`date`],json:[`json`]},sqlite:{string:[`TEXT`],number:[`INTEGER`,`REAL`,`BIGINT`],boolean:[`INTEGER`,`BOOLEAN`],date:[`DATE`,`INTEGER`],json:[`TEXT`]},mssql:{string:[`varchar`,`nvarchar`,`uniqueidentifier`],number:[`int`,`bigint`,`smallint`,`decimal`,`float`,`double`],boolean:[`bit`,`smallint`],date:[`datetime2`,`date`,`datetime`],json:[`varchar`,`nvarchar`]}};function s2(e,t){return`${Mi(e)}\u0000${Mi(t)}`}function c2(e,t){return`${e}\u0000${t}`}function l2(e,t){return e.unique===(t.unique??!1)&&e.validFullColumns&&e.columns.length===t.columns.length&&e.columns.every((e,n)=>e===t.columns[n])}function u2(e){return typeof e==`boolean`?e:typeof e==`number`?e!==0:e===`1`||e?.toLowerCase()===`true`||e===`t`}function d2(e){return new Map(e.map(e=>{let t=[...e.columns].sort((e,t)=>e.position-t.position);return[s2(e.table,e.name),{columns:t.flatMap(e=>e.name===null?[]:[e.name]),name:e.name,table:e.table,unique:e.unique,validFullColumns:e.valid&&!e.partial&&t.length>0&&t.every(e=>e.name!==null&&e.fullLength)}]}))}async function f2(e,t,n,r){if(r)return d2(await r(n));let i;switch(t.type){case`sqlite`:i=(await Qa`
|
|
470
|
+
SELECT
|
|
471
|
+
tables.name AS "tableName",
|
|
472
|
+
index_list.name AS "indexName",
|
|
473
|
+
index_info.name AS "columnName",
|
|
474
|
+
index_list."unique" AS "isUnique",
|
|
475
|
+
index_list.partial AS "isPartial",
|
|
476
|
+
index_info.seqno AS "columnPosition"
|
|
477
|
+
FROM sqlite_master AS tables
|
|
478
|
+
INNER JOIN pragma_index_list(tables.name) AS index_list
|
|
479
|
+
INNER JOIN pragma_index_info(index_list.name) AS index_info
|
|
480
|
+
WHERE tables.type = 'table'
|
|
481
|
+
`.execute(e)).rows;break;case`postgres`:i=(await Qa`
|
|
482
|
+
SELECT
|
|
483
|
+
table_class.relname AS "tableName",
|
|
484
|
+
index_class.relname AS "indexName",
|
|
485
|
+
index_attribute.attname AS "columnName",
|
|
486
|
+
index_data.indisunique AS "isUnique",
|
|
487
|
+
index_data.indisvalid AS "isValid",
|
|
488
|
+
(index_data.indpred IS NOT NULL) AS "isPartial",
|
|
489
|
+
index_column.ordinality AS "columnPosition"
|
|
490
|
+
FROM pg_class AS table_class
|
|
491
|
+
INNER JOIN pg_namespace AS table_namespace
|
|
492
|
+
ON table_namespace.oid = table_class.relnamespace
|
|
493
|
+
INNER JOIN pg_index AS index_data
|
|
494
|
+
ON index_data.indrelid = table_class.oid
|
|
495
|
+
INNER JOIN pg_class AS index_class
|
|
496
|
+
ON index_class.oid = index_data.indexrelid
|
|
497
|
+
INNER JOIN LATERAL unnest(index_data.indkey)
|
|
498
|
+
WITH ORDINALITY AS index_column(attribute_number, ordinality)
|
|
499
|
+
ON TRUE
|
|
500
|
+
LEFT JOIN pg_attribute AS index_attribute
|
|
501
|
+
ON index_attribute.attrelid = table_class.oid
|
|
502
|
+
AND index_attribute.attnum = index_column.attribute_number
|
|
503
|
+
WHERE table_namespace.nspname = ${t.schema}
|
|
504
|
+
AND table_class.relkind = 'r'
|
|
505
|
+
AND index_column.ordinality <= index_data.indnkeyatts
|
|
506
|
+
`.execute(e)).rows;break;case`mysql`:i=(await Qa`
|
|
507
|
+
SELECT
|
|
508
|
+
table_name AS tableName,
|
|
509
|
+
index_name AS indexName,
|
|
510
|
+
column_name AS columnName,
|
|
511
|
+
non_unique AS nonUnique,
|
|
512
|
+
seq_in_index AS columnPosition,
|
|
513
|
+
sub_part AS prefixLength,
|
|
514
|
+
COALESCE(LOWER(comment) = 'disabled', FALSE) AS isDisabled
|
|
515
|
+
FROM information_schema.statistics
|
|
516
|
+
WHERE table_schema = DATABASE()
|
|
517
|
+
`.execute(e)).rows;break;case`mssql`:i=(await Qa`
|
|
518
|
+
SELECT
|
|
519
|
+
tables.name AS "tableName",
|
|
520
|
+
indexes.name AS "indexName",
|
|
521
|
+
columns.name AS "columnName",
|
|
522
|
+
indexes.is_unique AS "isUnique",
|
|
523
|
+
indexes.is_disabled AS "isDisabled",
|
|
524
|
+
indexes.is_hypothetical AS "isHypothetical",
|
|
525
|
+
indexes.has_filter AS "isPartial",
|
|
526
|
+
index_columns.key_ordinal AS "columnPosition"
|
|
527
|
+
FROM sys.indexes AS indexes
|
|
528
|
+
INNER JOIN sys.tables AS tables
|
|
529
|
+
ON indexes.object_id = tables.object_id
|
|
530
|
+
INNER JOIN sys.schemas AS table_schemas
|
|
531
|
+
ON table_schemas.schema_id = tables.schema_id
|
|
532
|
+
INNER JOIN sys.index_columns AS index_columns
|
|
533
|
+
ON index_columns.object_id = indexes.object_id
|
|
534
|
+
AND index_columns.index_id = indexes.index_id
|
|
535
|
+
INNER JOIN sys.columns AS columns
|
|
536
|
+
ON columns.object_id = index_columns.object_id
|
|
537
|
+
AND columns.column_id = index_columns.column_id
|
|
538
|
+
WHERE table_schemas.name = ${t.schema}
|
|
539
|
+
AND indexes.name IS NOT NULL
|
|
540
|
+
AND index_columns.key_ordinal > 0
|
|
541
|
+
`.execute(e)).rows}let a=new Map;for(let e of i){let t=e.tableName??e.table_name??e.TABLE_NAME??e.tablename??e.tbl_name,n=e.indexName??e.index_name??e.INDEX_NAME??e.name,r=e.columnName??e.column_name??e.COLUMN_NAME;if(!t||!n)continue;let i=s2(t,n),o=e.nonUnique??e.non_unique??e.NON_UNIQUE,s=o===void 0?u2(e.isUnique??e.is_unique):!u2(o),c=Number(e.columnPosition??e.column_position??e.keyOrdinal??e.key_ordinal??e.ordinality??e.seqInIndex??e.seq_in_index??e.SEQ_IN_INDEX??e.seqno??0),l={fullLength:r!=null&&(e.prefixLength===void 0||e.prefixLength===null),name:r??null,position:c},u=u2(e.isPartial),d=!u2(e.isDisabled)&&!u2(e.isHypothetical)&&(e.isValid===void 0||u2(e.isValid)),f=a.get(i);a.set(i,f?{...f,columns:[...f.columns,l],partial:f.partial||u,valid:f.valid&&d}:{columns:[l],name:n,partial:u,table:t,unique:s,valid:d})}return d2([...a.values()])}async function p2(e,t){let n;switch(t.type){case`postgres`:case`sqlite`:return new Map;case`mysql`:n=(await Qa`
|
|
542
|
+
SELECT
|
|
543
|
+
table_name AS tableName,
|
|
544
|
+
column_name AS columnName,
|
|
545
|
+
character_octet_length AS maxIndexBytes
|
|
546
|
+
FROM information_schema.columns
|
|
547
|
+
WHERE table_schema = DATABASE()
|
|
548
|
+
`.execute(e)).rows;break;case`mssql`:n=(await Qa`
|
|
549
|
+
SELECT
|
|
550
|
+
tables.name AS "tableName",
|
|
551
|
+
columns.name AS "columnName",
|
|
552
|
+
columns.max_length AS "maxIndexBytes"
|
|
553
|
+
FROM sys.columns AS columns
|
|
554
|
+
INNER JOIN sys.tables AS tables
|
|
555
|
+
ON tables.object_id = columns.object_id
|
|
556
|
+
INNER JOIN sys.schemas AS table_schemas
|
|
557
|
+
ON table_schemas.schema_id = tables.schema_id
|
|
558
|
+
WHERE table_schemas.name = ${t.schema}
|
|
559
|
+
`.execute(e)).rows}let r=new Map;for(let e of n){let t=e.tableName??e.TABLE_NAME,n=e.columnName??e.COLUMN_NAME;if(!t||!n)continue;let i=Number(e.maxIndexBytes??e.MAX_INDEX_BYTES??-1);r.set(c2(t,n),{maxIndexBytes:i<0?null:i})}return r}function m2({columnBounds:e,dbType:t,existingColumns:n,fields:r,indexes:i,index:a,table:o}){let s=t===`mysql`?3072:1700,c=0;for(let s of a.columns){let l=r[s];if(l){if(l.type===`string`||Array.isArray(l.type)){if(!n.has(s)){let e=Ni({columnName:s,dialect:t,fields:r,indexes:i});c+=(e??0)*(t===`mysql`?4:1);continue}let l=e.get(c2(o,s));if(!l?.maxIndexBytes)throw new U(`Cannot create database index "${a.name}" on existing table "${o}" because column "${s}" is not bounded for ${t===`mysql`?`MySQL`:`SQL Server`}. Change it to a bounded string column, resolve oversized values, then run the migration again.`);c+=l.maxIndexBytes}else c+=16}}if(c>s)throw new U(`Cannot create database index "${a.name}" on existing table "${o}" because its columns can exceed ${t===`mysql`?`MySQL`:`SQL Server`}'s ${s}-byte index-key limit. Bound the indexed string columns to the generated schema lengths, resolve oversized values, then run the migration again.`)}var h2=class extends U{};function g2(e,t){return e.type===`date`&&typeof e.defaultValue==`function`&&(t===`postgres`||t===`mysql`||t===`mssql`)}function _2(e){return!(e.unique&&e.required===!1)&&(e.type===`string`||e.type===`number`||e.type===`boolean`)&&e.defaultValue!==void 0&&e.defaultValue!==null&&typeof e.defaultValue!=`function`}async function v2(e,t,n){let r=e.selectFrom(n).select(Qa`1`.as(`present`));return(await(t===`mssql`?r.top(1):r.limit(1)).execute()).length>0}function y2(e,t,n){function r(e){return e.toLowerCase().split(`(`)[0].trim()}if(t===`string[]`||t===`number[]`)return e.toLowerCase().includes(`json`);let i=o2[n];return(Array.isArray(t)?i.string.map(e=>e.toLowerCase()):i[t].map(e=>e.toLowerCase())).includes(r(e))}async function b2(e,{throwOnUnsafe:t=!0}={}){let{schema:n,tables:r,referenceKeys:i}=oE(e),a=Oi(e.logger),o=[],s=e=>{if(t)throw new h2(e);o.push(e)},{kysely:c,databaseType:l,introspectIndexes:u,schemaName:d}=await io(e);l||=(a.warn(`Could not determine database type, defaulting to sqlite. Please provide a type in the database options to avoid this.`),`sqlite`),c||(a.error("Only kysely adapter is supported for migrations. You can use `generate` command to generate the schema, if you're using a different adapter."),process.exit(1));let f=await c.introspection.getTables(),p,m=f;switch(l){case`postgres`:{let e=d??await $a(c);p={type:`postgres`,schema:e},a.debug(`PostgreSQL migration: Using schema '${e}' (${d?`from database.schemaName`:`from search_path`})`);try{(await c.introspection.getSchemas()).some(({name:t})=>t===e)||(d?a.debug(`Schema '${e}' does not exist yet. The migration creates it before creating tables.`):a.warn(`Schema '${e}' does not exist. Create it before running migrations or check your database configuration.`))}catch(e){a.debug(`Could not verify schema existence: ${e instanceof Error?e.message:String(e)}`)}m=f.filter(t=>t.schema===e&&!t.isView&&!(`isForeign`in t&&t.isForeign)),a.debug(`Found ${m.length} table(s) in schema '${e}': ${m.map(e=>e.name).join(`, `)||`(none)`}`);break}case`mssql`:{let e=await no(c);p={type:`mssql`,schema:e},a.debug(`SQL Server migration: Using schema '${e}' (from the current user's default schema)`),m=f.filter(t=>t.schema===e);break}case`mysql`:p={type:`mysql`};break;case`sqlite`:p={type:`sqlite`}}let h=await f2(c,p,f.map(e=>e.name),u),g=await p2(c,p),_=Gi(ro(c,n),to(m)).filter(e=>e.kind===`unexpected-required-column`).map(e=>qi(e,`database`)),v=[],y=[],b=[],x=new Map;for(let[e,t]of Object.entries(n)){if(t.disableMigrations)continue;let n=m.find(t=>t.name===e);for(let r of t.indexes??[]){let i=r.name,a=s2(e,i),o=h.get(a);if(o){if(!l2(o,r))throw new U(`Database index "${i}" on table "${e}" does not match the configured fields and uniqueness. Rename or replace the existing index, then run the migration again.`);continue}if(l===`sqlite`||l===`postgres`){let t=[...h.values()].find(t=>Mi(t.name)===Mi(i)&&Mi(t.table)!==Mi(e));if(t)throw new U(`Database index name "${i}" is already used by table "${t.table}". Index names must be unique across the schema.`)}let s=x.get(a);if(s){if(!l2({columns:s.columns,name:s.name,table:e,unique:s.unique??!1,validFullColumns:!0},r))throw new U(`Database index name "${i}" identifies more than one index on table "${e}".`)}else n&&(l===`mysql`||l===`mssql`)&&m2({columnBounds:g,dbType:l,existingColumns:new Set(n.columns.map(e=>e.name)),fields:t.fields,index:r,indexes:t.indexes??[],table:e}),x.set(a,r),b.push({table:e,index:r,name:i})}if(!n){let n=v.findIndex(t=>t.table===e),r={table:e,fields:t.fields,order:t.order||1/0},i=v.findIndex(e=>(e.order||1/0)>r.order);i===-1?n===-1?v.push(r):v[n].fields={...v[n].fields,...t.fields}:v.splice(i,0,r);continue}let r={};for(let[i,o]of Object.entries(t.fields)){let t=n.columns.find(e=>e.name===i);t?(o.required!==!1&&t.isNullable&&a.warn(`Column "${i}" on table "${e}" stays nullable while the schema declares the field required, so existing rows can still hold null. Backfill every row for this column and enforce NOT NULL to remove the drift.`),!y2(t.dataType,o.type,l)&&a.warn(`Field ${i} in table ${e} has a different type in the database. Expected ${o.type} but got ${t.dataType}.`)):r[i]=o}Object.keys(r).length>0&&y.push({table:e,fields:r,order:t.order||1/0})}let S=[];d&&v.length>0&&S.push(c.schema.createSchema(d).ifNotExists());let C=e.advanced?.database?.generateId===`uuid`,w=e.advanced?.database?.generateId===`serial`;function E(e,t,n){let r=e.type,i=l||`sqlite`,a={string:{sqlite:`text`,postgres:`text`,mysql:n?`varchar(${n})`:e.unique?`varchar(255)`:e.references?`varchar(36)`:e.sortable||e.index?`varchar(255)`:`text`,mssql:n?`varchar(${n})`:e.unique||e.sortable?`varchar(255)`:e.references?`varchar(36)`:`varchar(8000)`},boolean:{sqlite:`integer`,postgres:`boolean`,mysql:`boolean`,mssql:`smallint`},number:{sqlite:e.bigint?`bigint`:`integer`,postgres:e.bigint?`bigint`:`integer`,mysql:e.bigint?`bigint`:`integer`,mssql:e.bigint?`bigint`:`integer`},date:{sqlite:`date`,postgres:`timestamptz`,mysql:`timestamp(3)`,mssql:Qa`datetime2(3)`},json:{sqlite:`text`,postgres:`jsonb`,mysql:`json`,mssql:`varchar(8000)`},id:{postgres:w?Qa`integer GENERATED BY DEFAULT AS IDENTITY`:C?`uuid`:`text`,mysql:w?`integer`:`varchar(36)`,mssql:w?`integer`:`varchar(36)`,sqlite:w?`integer`:`text`},foreignKeyId:{postgres:w?`integer`:C?`uuid`:`text`,mysql:w?`integer`:`varchar(36)`,mssql:w?`integer`:`varchar(36)`,sqlite:w?`integer`:`text`},"string[]":{sqlite:`text`,postgres:`jsonb`,mysql:`json`,mssql:`varchar(8000)`},"number[]":{sqlite:`text`,postgres:`jsonb`,mysql:`json`,mssql:`varchar(8000)`}};if(t===`id`||e.references?.field===`id`)return t===`id`?a.id[i]:a.foreignKeyId[i];if(Array.isArray(r))return`text`;if(!(r in a))throw Error(`Unsupported field type '${String(r)}' for field '${t}'. Allowed types are: string, number, boolean, date, string[], number[]. If you need to store structured data, store it as a JSON string (type: "string") or split it into primitive fields. See https://better-auth.com/docs/advanced/schema#additional-fields`);return a[r][i]}let D=ea({schema:r,usePlural:!1}),O=ta({schema:r,usePlural:!1});function k(e){let t=e.references;if(!t)throw new U(`Cannot resolve a field without references.`);let n=i.get(e);if(!n)throw new U(`Missing migration reference metadata for "${t.model}.${t.field}".`);try{return`${D(n.modelKey)}.${O({model:n.modelKey,field:n.fieldKey})}`}catch{return`${t.model}.${t.field}`}}let A=[],j=(e,t)=>{if(l!==`mysql`&&l!==`mssql`)return;let r=n[e];if(r)return Ni({columnName:t,dialect:l,fields:r.fields,indexes:r.indexes??[]})};if(y.length){let e=new Map;for(let t of y)for(let[n,r]of Object.entries(t.fields)){let i=g2(r,l),o=_2(r);if(r.required!==!1&&!i&&!o){let i=e.get(t.table);if(i===void 0&&(i=await v2(c,l,t.table),e.set(t.table,i)),i){let e=r.type===`string`?` For a text column, every existing row ends up with the same empty string.`:``;s(`Cannot add required column "${n}" to populated table "${t.table}": the schema declares no default value, so existing rows have no value to backfill. MySQL accepts this statement instead of rejecting it and fills every existing row with an implicit default for the column type, reporting a successful migration over corrupted data.${e} Add the column as nullable, backfill a correct value for every row, then make it NOT NULL.`)}}let u=E(r,n,j(t.table,n)),d=c.schema.alterTable(t.table);if(r.index||r.unique){let e=Li(t.table,n,r.unique??!1),i=c.schema.createIndex(e).on(t.table).columns([n]);r.unique&&(i=i.unique(),r.required===!1&&l===`mssql`&&(i=i.where(n,`is not`,null)),r.required!==!1&&r.defaultValue!==void 0&&r.defaultValue!==null&&typeof r.defaultValue!=`function`&&a.warn(`Adding unique column "${n}" to existing table "${t.table}" backfills every existing row with its default value. If the table has more than one row, creating the unique index "${e}" will fail; backfill distinct values manually, then re-run the migration or create the index yourself.`)),A.push(i)}let f=d.addColumn(n,u,e=>(e=r.required===!1?e:e.notNull(),r.references&&(e=e.references(k(r)).onDelete(r.references.onDelete||`cascade`)),i?e=l===`mysql`?e.defaultTo(Qa`CURRENT_TIMESTAMP(3)`):e.defaultTo(Qa`CURRENT_TIMESTAMP`):o&&(e=e.defaultTo(typeof r.defaultValue==`boolean`&&(l===`sqlite`||l===`mssql`)?+!!r.defaultValue:r.defaultValue)),e));S.push(f)}}if(v.length)for(let e of v){let t=E({type:w?`number`:`string`},`id`),n=c.schema.createTable(e.table).addColumn(`id`,t,e=>w?l===`postgres`||l===`sqlite`?e.primaryKey().notNull():l===`mssql`?e.identity().primaryKey().notNull():e.autoIncrement().primaryKey().notNull():C&&l===`postgres`?e.primaryKey().defaultTo(Qa`pg_catalog.gen_random_uuid()`).notNull():e.primaryKey().notNull());for(let[t,r]of Object.entries(e.fields)){let i=E(r,t,j(e.table,t));if(n=n.addColumn(t,i,e=>(e=r.required===!1?e:e.notNull(),r.references&&(e=e.references(k(r)).onDelete(r.references.onDelete||`cascade`)),r.unique&&(e=e.unique()),r.type===`date`&&typeof r.defaultValue==`function`&&(l===`postgres`||l===`mysql`||l===`mssql`)&&(e=l===`mysql`?e.defaultTo(Qa`CURRENT_TIMESTAMP(3)`):e.defaultTo(Qa`CURRENT_TIMESTAMP`)),e)),r.index&&!r.unique){let n=c.schema.createIndex(Li(e.table,t,!1)).on(e.table).columns([t]);A.push(n)}}S.push(n)}for(let{table:e,index:t,name:n}of b){let r=c.schema.createIndex(n).on(e).columns([...t.columns]);t.unique&&(r=r.unique()),A.push(r)}for(let e of A)S.push(e);async function M(){try{for(let e of S)await e.execute()}finally{S.length&&e.database&&Xi(e.database)}}async function N(){return S.map(e=>e.compile().sql).join(`;
|
|
560
|
+
|
|
561
|
+
`)+`;`}return{toBeCreated:v,toBeAdded:y,toBeAddedIndexes:b,unsafeChanges:o,schemaProblems:_,runMigrations:M,compileMigrations:N}}var x2=`better-auth-secret-12345678901234567890`;function S2(e){let t=new Set(e).size;return t===0?0:Math.log2(t**+e.length)}function C2(e){return e?e.split(`,`).map(e=>{e=e.trim();let t=e.indexOf(`:`);if(t===-1)throw new U(`Invalid BETTER_AUTH_SECRETS entry: "${e}". Expected format: "<version>:<secret>"`);let n=parseInt(e.slice(0,t),10);if(!Number.isInteger(n)||n<0)throw new U(`Invalid version in BETTER_AUTH_SECRETS: "${e.slice(0,t)}". Version must be a non-negative integer.`);let r=e.slice(t+1).trim();if(!r)throw new U(`Empty secret value for version ${n} in BETTER_AUTH_SECRETS.`);return{version:n,value:r}}):null}function w2(e,t){if(e.length===0)throw new U("`secrets` array must contain at least one entry.");let n=new Set;for(let t of e){let e=parseInt(String(t.version),10);if(!Number.isInteger(e)||e<0||String(e)!==String(t.version).trim())throw new U(`Invalid version ${t.version} in \`secrets\`. Version must be a non-negative integer.`);if(!t.value)throw new U(`Empty secret value for version ${e} in \`secrets\`.`);if(n.has(e))throw new U(`Duplicate version ${e} in \`secrets\`. Each version must be unique.`);n.add(e)}let r=e[0];r.value.length<32&&t.warn(`[better-auth] Warning: the current secret (version ${r.version}) should be at least 32 characters long for adequate security.`),S2(r.value)<120&&t.warn(`[better-auth] Warning: the current secret appears low-entropy. Use a randomly generated secret for production.`)}function T2(e,t){let n=new Map;for(let t of e)n.set(parseInt(String(t.version),10),t.value);return{keys:n,currentVersion:parseInt(String(e[0].version),10),legacySecret:t&&t!==`better-auth-secret-12345678901234567890`?t:void 0}}async function E2(e,t){return{database:t?.database,adapter:t?.adapter,emailVerification:{sendVerificationEmail:!!e.emailVerification?.sendVerificationEmail,sendOnSignUp:!!e.emailVerification?.sendOnSignUp,sendOnSignIn:!!e.emailVerification?.sendOnSignIn,autoSignInAfterVerification:!!e.emailVerification?.autoSignInAfterVerification,expiresIn:e.emailVerification?.expiresIn,beforeEmailVerification:!!e.emailVerification?.beforeEmailVerification,afterEmailVerification:!!e.emailVerification?.afterEmailVerification},emailAndPassword:{enabled:!!e.emailAndPassword?.enabled,disableSignUp:!!e.emailAndPassword?.disableSignUp,requireEmailVerification:!!e.emailAndPassword?.requireEmailVerification,maxPasswordLength:e.emailAndPassword?.maxPasswordLength,minPasswordLength:e.emailAndPassword?.minPasswordLength,sendResetPassword:!!e.emailAndPassword?.sendResetPassword,resetPasswordTokenExpiresIn:e.emailAndPassword?.resetPasswordTokenExpiresIn,onPasswordReset:!!e.emailAndPassword?.onPasswordReset,password:{hash:!!e.emailAndPassword?.password?.hash,verify:!!e.emailAndPassword?.password?.verify},autoSignIn:!!e.emailAndPassword?.autoSignIn,revokeSessionsOnPasswordReset:!!e.emailAndPassword?.revokeSessionsOnPasswordReset},socialProviders:await Promise.all(Object.keys(e.socialProviders||{}).map(async t=>{let n=e.socialProviders?.[t];if(!n)return{};let r=typeof n==`function`?await n():n;return{id:t,mapProfileToUser:!!r.mapProfileToUser,disableDefaultScope:!!r.disableDefaultScope,disableIdTokenSignIn:!!r.disableIdTokenSignIn,disableImplicitSignUp:r.disableImplicitSignUp,disableSignUp:r.disableSignUp,getUserInfo:!!r.getUserInfo,overrideUserInfoOnSignIn:!!r.overrideUserInfoOnSignIn,prompt:r.prompt,verifyIdToken:!!r.verifyIdToken,scope:r.scope,refreshAccessToken:!!r.refreshAccessToken}})),plugins:e.plugins?.map(e=>e.id.toString()),user:{modelName:e.user?.modelName,fields:e.user?.fields,additionalFields:e.user?.additionalFields,changeEmail:{enabled:e.user?.changeEmail?.enabled,sendChangeEmailConfirmation:!!e.user?.changeEmail?.sendChangeEmailConfirmation}},verification:{modelName:e.verification?.modelName,disableCleanup:e.verification?.disableCleanup,fields:e.verification?.fields},session:{modelName:e.session?.modelName,additionalFields:e.session?.additionalFields,cookieCache:{enabled:e.session?.cookieCache?.enabled,maxAge:e.session?.cookieCache?.maxAge,strategy:e.session?.cookieCache?.strategy},disableSessionRefresh:e.session?.disableSessionRefresh,expiresIn:e.session?.expiresIn,fields:e.session?.fields,freshAge:e.session?.freshAge,preserveSessionInDatabase:e.session?.preserveSessionInDatabase,storeSessionInDatabase:e.session?.storeSessionInDatabase,updateAge:e.session?.updateAge},account:{modelName:e.account?.modelName,fields:e.account?.fields,encryptOAuthTokens:e.account?.encryptOAuthTokens,updateAccountOnSignIn:e.account?.updateAccountOnSignIn,accountLinking:{enabled:e.account?.accountLinking?.enabled,trustedProviders:e.account?.accountLinking?.trustedProviders,updateUserInfoOnLink:e.account?.accountLinking?.updateUserInfoOnLink,allowUnlinkingAll:e.account?.accountLinking?.allowUnlinkingAll}},hooks:{after:!!e.hooks?.after,before:!!e.hooks?.before},secondaryStorage:!!e.secondaryStorage,advanced:{cookiePrefix:!!e.advanced?.cookiePrefix,cookies:!!e.advanced?.cookies,crossSubDomainCookies:{domain:!!e.advanced?.crossSubDomainCookies?.domain,enabled:e.advanced?.crossSubDomainCookies?.enabled,additionalCookies:e.advanced?.crossSubDomainCookies?.additionalCookies},database:{generateId:e.advanced?.database?.generateId,defaultFindManyLimit:e.advanced?.database?.defaultFindManyLimit},useSecureCookies:e.advanced?.useSecureCookies,ipAddress:{disableIpTracking:e.advanced?.ipAddress?.disableIpTracking,ipAddressHeaders:e.advanced?.ipAddress?.ipAddressHeaders},disableCSRFCheck:e.advanced?.disableCSRFCheck,cookieAttributes:{expires:e.advanced?.defaultCookieAttributes?.expires,secure:e.advanced?.defaultCookieAttributes?.secure,sameSite:e.advanced?.defaultCookieAttributes?.sameSite,domain:!!e.advanced?.defaultCookieAttributes?.domain,path:e.advanced?.defaultCookieAttributes?.path,httpOnly:e.advanced?.defaultCookieAttributes?.httpOnly}},trustedOrigins:e.trustedOrigins?.length,rateLimit:{storage:e.rateLimit?.storage,modelName:e.rateLimit?.modelName,window:e.rateLimit?.window,customStorage:!!e.rateLimit?.customStorage,enabled:e.rateLimit?.enabled,max:e.rateLimit?.max},onAPIError:{errorURL:e.onAPIError?.errorURL,onError:!!e.onAPIError?.onError,throw:e.onAPIError?.throw},logger:{disabled:e.logger?.disabled,level:e.logger?.level,log:!!e.logger?.log},databaseHooks:{user:{create:{after:!!e.databaseHooks?.user?.create?.after,before:!!e.databaseHooks?.user?.create?.before},update:{after:!!e.databaseHooks?.user?.update?.after,before:!!e.databaseHooks?.user?.update?.before}},session:{create:{after:!!e.databaseHooks?.session?.create?.after,before:!!e.databaseHooks?.session?.create?.before},update:{after:!!e.databaseHooks?.session?.update?.after,before:!!e.databaseHooks?.session?.update?.before}},account:{create:{after:!!e.databaseHooks?.account?.create?.after,before:!!e.databaseHooks?.account?.create?.before},update:{after:!!e.databaseHooks?.account?.update?.after,before:!!e.databaseHooks?.account?.update?.before}},verification:{create:{after:!!e.databaseHooks?.verification?.create?.after,before:!!e.databaseHooks?.verification?.create?.before},update:{after:!!e.databaseHooks?.verification?.update?.after,before:!!e.databaseHooks?.verification?.update?.before}}}}}async function D2(e){}async function O2(){}var k2={pg:`postgresql`,mysql:`mysql`,mariadb:`mariadb`,sqlite3:`sqlite`,"better-sqlite3":`sqlite`,"@prisma/client":`prisma`,mongoose:`mongodb`,mongodb:`mongodb`,"drizzle-orm":`drizzle`};async function A2(){for(let[e,t]of Object.entries(k2)){let n=await D2(e);if(n)return{name:t,version:n}}}var j2={next:`next`,nuxt:`nuxt`,"react-router":`react-router`,astro:`astro`,"@sveltejs/kit":`sveltekit`,"solid-start":`solid-start`,"tanstack-start":`tanstack-start`,hono:`hono`,express:`express`,elysia:`elysia`,expo:`expo`};async function M2(){for(let[e,t]of Object.entries(j2)){let n=await D2(e);if(n)return{name:t,version:n}}}function N2(){let e=Ci.npm_config_user_agent;if(!e)return;let t=e.split(` `)[0],n=t.lastIndexOf(`/`),r=t.substring(0,n);return{name:r===`npminstall`?`cnpm`:r,version:t.substring(n+1)}}function P2(){let e=(...e)=>e.some(e=>!!Ci[e]);return e(`CF_PAGES`,`CF_PAGES_URL`,`CF_ACCOUNT_ID`)||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`?`cloudflare`:e(`VERCEL`,`VERCEL_URL`,`VERCEL_ENV`)?`vercel`:e(`NETLIFY`,`NETLIFY_URL`)?`netlify`:e(`RENDER`,`RENDER_URL`,`RENDER_INTERNAL_HOSTNAME`,`RENDER_SERVICE_ID`)?`render`:e(`AWS_LAMBDA_FUNCTION_NAME`,`AWS_EXECUTION_ENV`,`LAMBDA_TASK_ROOT`)?`aws`:e(`GOOGLE_CLOUD_FUNCTION_NAME`,`GOOGLE_CLOUD_PROJECT`,`GCP_PROJECT`,`K_SERVICE`)?`gcp`:e(`AZURE_FUNCTION_NAME`,`FUNCTIONS_WORKER_RUNTIME`,`WEBSITE_INSTANCE_ID`,`WEBSITE_SITE_NAME`)?`azure`:e(`DENO_DEPLOYMENT_ID`,`DENO_REGION`)?`deno-deploy`:e(`FLY_APP_NAME`,`FLY_REGION`,`FLY_ALLOC_ID`)?`fly-io`:e(`RAILWAY_STATIC_URL`,`RAILWAY_ENVIRONMENT_NAME`)?`railway`:e(`DYNO`,`HEROKU_APP_NAME`)?`heroku`:e(`DO_DEPLOYMENT_ID`,`DO_APP_NAME`,`DIGITALOCEAN`)?`digitalocean`:e(`KOYEB`,`KOYEB_DEPLOYMENT_ID`,`KOYEB_APP_NAME`)?`koyeb`:null}async function F2(){return{deploymentVendor:P2(),systemPlatform:null,systemRelease:null,systemArchitecture:null,cpuCount:null,cpuModel:null,cpuSpeed:null,memory:null,isWSL:null,isDocker:null,isTTY:null}}function I2(){return Ci.CI!==`false`&&(`BUILD_ID`in Ci||`BUILD_NUMBER`in Ci||`CI`in Ci||`CI_APP_ID`in Ci||`CI_BUILD_ID`in Ci||`CI_BUILD_NUMBER`in Ci||`CI_NAME`in Ci||`CONTINUOUS_INTEGRATION`in Ci||`RUN_ID`in Ci)}function L2(){return typeof Deno<`u`?{name:`deno`,version:Deno?.version?.deno??null}:typeof Bun<`u`?{name:`bun`,version:Bun?.version??null}:typeof process<`u`&&process?.versions?.node?{name:`node`,version:process.versions.node??null}:{name:`edge`,version:null}}function R2(){return yi(`NODE_ENV`)===`production`?`production`:I2()?`ci`:Si()?`test`:`development`}async function z2(e){let t=await Yr(`SHA-256`).digest(e);return wi.encode(t)}var B2=e=>Ei(`a-z`,`A-Z`,`0-9`)(e||32),V2=null;async function H2(e){if(V2)return V2;let t=await O2();return t?(V2=await z2(e?e+t:t),V2):e?(V2=await z2(e),V2):(V2=B2(32),V2)}var U2=async function(){};async function W2(e,t){let n=e.telemetry?.debug||Ii(`BETTER_AUTH_TELEMETRY_DEBUG`,!1),r=bi.BETTER_AUTH_TELEMETRY_ENDPOINT;if(!r&&!t?.customTrack)return{publish:U2};let i=async e=>{t?.customTrack?await t.customTrack(e).catch(Hi.error):r&&(n?Hi.info(`telemetry event`,JSON.stringify(e,null,2)):await Nn(r,{method:`POST`,body:e}).catch(Hi.error))},a=await(async()=>{let n=e.telemetry?.enabled!==void 0&&e.telemetry.enabled;return(Ii(`BETTER_AUTH_TELEMETRY`,!1)||n)&&(t?.skipTestCheck||!Si())})(),o;return a&&(o=await H2(typeof e.baseURL==`string`?e.baseURL:void 0),i({type:`init`,payload:{config:await E2(e,t),runtime:L2(),database:await A2(),framework:await M2(),environment:R2(),systemInfo:await F2(),packageManager:N2()},anonymousId:o})),{publish:async t=>{a&&(o||=await H2(typeof e.baseURL==`string`?e.baseURL:void 0),await i({type:t.type,payload:t.payload,anonymousId:o}))}}}function G2(e){let t=new Set(e).size;return t===0?0:Math.log2(t**+e.length)}function K2(e,t){let n=e===x2;if(!Si()){if(n&&xi)throw new U("You are using the default secret. Please set `BETTER_AUTH_SECRET` in your environment variables or pass `secret` in your auth config.");if(!e)throw new U("BETTER_AUTH_SECRET is missing. Set it in your environment or pass `secret` to betterAuth({ secret }).");e.length<32&&t.warn("[better-auth] Warning: your BETTER_AUTH_SECRET should be at least 32 characters long for adequate security. Generate one with `npx auth secret` or `openssl rand -base64 32`."),G2(e)<120&&t.warn(`[better-auth] Warning: your BETTER_AUTH_SECRET appears low-entropy. Use a randomly generated secret for production.`)}}async function q2(e,t,n){let r=Qn(t);r||(t=Sr(t,{session:{cookieCache:{enabled:!0,strategy:`jwe`,refreshCache:!0,maxAge:t.session?.expiresIn||604800}}})),t.database||(t=Sr(t,{account:{storeAccountCookie:!0}}));let i=t.plugins||[],a=Zx(t),o=Oi(t.logger),s=Tr(t.baseURL);if(Tr(t.baseURL)){let{allowedHosts:e}=t.baseURL;if(!e||e.length===0)throw new U(`baseURL.allowedHosts cannot be empty. Provide at least one allowed host pattern (e.g., ["myapp.com", "*.vercel.app"]).`)}let c=s?void 0:gr(typeof t.baseURL==`string`?t.baseURL:void 0,t.basePath);!c&&!s&&o.warn(`[better-auth] Base URL is not set. Set the baseURL option or BETTER_AUTH_URL env, or use a dynamic baseURL with allowedHosts for multi-host setups. Without it the origin is derived from the incoming request, and callbacks and redirects may not work correctly.`),e.id===`memory`&&t.advanced?.database?.generateId===!1&&o.error(`[better-auth] Misconfiguration detected.
|
|
562
|
+
You are using the memory DB with generateId: false.
|
|
563
|
+
This will cause no id to be generated for any model.
|
|
564
|
+
Most of the features of Better Auth will not work correctly.`);let l=t.secrets??C2(Ci.BETTER_AUTH_SECRETS),u=t.secret||Ci.BETTER_AUTH_SECRET||Ci.AUTH_SECRET||``,d,f;l?(w2(l,o),d=l[0].value,f=T2(l,u)):(d=u||`better-auth-secret-12345678901234567890`,K2(d,o),f=d),t={...t,secret:d,baseURL:s?t.baseURL:c?new URL(c).origin:``,basePath:t.basePath||`/api/auth`,plugins:i.concat(a)},Tw(t,o);let p=t.advanced?.ipAddress?.trustedProxies;if(p&&p.length>0){let e=ti(p);e.length>0&&o.warn(`Ignoring invalid \`advanced.ipAddress.trustedProxies\` entries: ${e.join(`, `)}. Each entry must be an IP address or CIDR range.`)}let m=An(t),h=ji(t),g=(await Promise.all(Object.entries(t.socialProviders||{}).map(async([e,t])=>{let n=typeof t==`function`?await t():t;if(n==null||n.enabled===!1)return null;n.clientId||o.warn(`Social provider ${e} is missing clientId or clientSecret`);let r=DC[e](n);return r.disableImplicitSignUp=n.disableImplicitSignUp,r}))).filter(e=>e!==null),_=({model:e,size:n})=>{if(typeof t.advanced?.generateId==`function`)return t.advanced.generateId({model:e,size:n});let r=t?.advanced?.database?.generateId;return typeof r==`function`?r({model:e,size:n}):r===`uuid`?crypto.randomUUID():r===`serial`||r===!1?!1:Pi(n)},{publish:v}=await W2(t,{adapter:e.id,database:typeof t.database==`function`?`adapter`:n(t.database)}),y=new Set(t.plugins.map(e=>e.id)),b=e=>t.plugins.find(t=>t.id===e)??null,x=e=>y.has(e),S=await Qx(t),C=await rS(t),w={appName:t.appName||`Better Auth`,baseURL:c||``,version:Ti(),socialProviders:g,options:t,oauthConfig:{storeStateStrategy:t.account?.storeStateStrategy||(r?`database`:`cookie`),skipStateCookieCheck:!!t.account?.skipStateCookieCheck},tables:h,trustedOrigins:S,trustedProviders:C,isTrustedOrigin(e,t){return this.trustedOrigins.some(n=>mx(e,n,t))},sessionConfig:{updateAge:t.session?.updateAge===void 0?86400:t.session.updateAge,expiresIn:t.session?.expiresIn||604800,freshAge:t.session?.freshAge===void 0?86400:t.session.freshAge,cookieRefreshCache:(()=>{let e=t.session?.cookieCache?.refreshCache,n=t.session?.cookieCache?.maxAge||300;return r&&e?(o.warn("[better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` — remove it from your config to silence this warning."),!1):e===!1||e===void 0?!1:e===!0?{enabled:!0,updateAge:Math.floor(n*.2)}:{enabled:!0,updateAge:e.updateAge===void 0?Math.floor(n*.2):e.updateAge}})()},secret:d,secretConfig:f,rateLimit:{...t.rateLimit,enabled:t.rateLimit?.enabled??xi,window:t.rateLimit?.window||10,max:t.rateLimit?.max||100,storage:t.rateLimit?.storage||(t.secondaryStorage?`secondary-storage`:`memory`)},authCookies:m,logger:o,generateId:_,session:null,secondaryStorage:t.secondaryStorage,password:{hash:t.emailAndPassword?.password?.hash||Fb,verify:t.emailAndPassword?.password?.verify||Ib,config:{minPasswordLength:t.emailAndPassword?.minPasswordLength||8,maxPasswordLength:t.emailAndPassword?.maxPasswordLength||128},checkPassword:$C},setNewSession(e){this.newSession=e},newSession:null,adapter:e,internalAdapter:Yx(e,{options:t,logger:o,hooks:t.databaseHooks?[{source:`user`,hooks:t.databaseHooks}]:[],generateId:_}),createAuthCookie:jr(t),async runMigrations(){throw new U(`runMigrations will be set by the specific init implementation`)},publishTelemetry:v,skipCSRFCheck:!!t.advanced?.disableCSRFCheck,skipOriginCheck:t.advanced?.disableOriginCheck===void 0?!!Si():t.advanced.disableOriginCheck,runInBackground:t.advanced?.backgroundTasks?.handler??(e=>{e.catch(()=>{})}),async runInBackgroundOrAwait(e){try{t.advanced?.backgroundTasks?.handler?e instanceof Promise&&t.advanced.backgroundTasks.handler(e.catch(e=>{o.error(`Failed to run background task:`,e)})):await e}catch(e){o.error(`Failed to run background task:`,e)}},getPlugin:b,hasPlugin:x},E=Xx(w);return On(E)&&await E,w.checkSchema=Wi(w.adapter),w.explicitSchemaCheck=Yi(w.adapter),w}var J2=async e=>{let t=await q2(await a2(e),e,e=>eo(e)||`unknown`);return t.runMigrations=async function(){if(!e.database||`updateMany`in e.database)throw new U(`Database is not provided or it's an adapter. Migrations are only supported with a database instance.`);let{runMigrations:t}=await b2(e);await t()},t},Y2=(e,t)=>{let n=t(e).then(e=>{let t=e.options.advanced?.database?.validateSchema;if(!e.checkSchema&&t!==!1){let n=t===!0?`warn`:`debug`;e.logger[n](`Schema validation is not available for adapter "${e.adapter.id}". Skipping schema validation. Database operations will proceed normally.`)}let n=e.checkSchema?.();return n&&n.catch(t=>{e.logger.error(t instanceof Zi?t.message:`Could not validate the database schema. Check your database connection.`)}),e}),{api:r}=Ew(n,e),i=e.plugins?.reduce((e,t)=>t.$ERROR_CODES?{...e,...t.$ERROR_CODES}:e,{}),a=async t=>{let r=await n,i=r.options.basePath||`/api/auth`,a;if(Tr(e.baseURL))a=await tS(r,t,eS(r.options));else{a=Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r));let e=r.options;if(!r.options.baseURL){let n=gr(void 0,i,t,void 0,r.options.advanced?.trustedProxyHeaders);if(!n)throw new U(`Could not get base URL from request. Please provide a valid base URL.`);a.baseURL=n,a.options={...r.options,baseURL:qr(n)||void 0},e=a.options}a.trustedOrigins=await Qx(e,t),a.trustedProviders=await rS(e,t)}let{handler:o}=Dw(a,e);return Vr(a.adapter,()=>o(t))};return{handler:a,fetch:a,api:r,options:e,$context:n,$ERROR_CODES:{...i,...V}}},X2=e=>Y2(e,J2);function Z2(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}var Q2=i((e=>{var t=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;e.validate=function(e){if(!e||e.length>254||!t.test(e))return!1;var n=e.split(`@`);return!(n[0].length>64||n[1].split(`.`).some(function(e){return e.length>63}))}}))(),$2=5242880,e4=Math.floor($2*3/4),t4=16384,n4=`\r
|
|
565
|
+
`,r4=/^[\x20-\x7e]*$/,i4=/^[!-9;-~]+$/;function a4(e,t){for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(r===13||r===10||r===0)throw new g4(`MIME_ERROR`,`${e}: must not contain CR, LF, or NUL.`)}}function o4(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32&&n!==9||n===127)return t}return-1}function s4(e,t){let n=o4(t);if(n!==-1)throw new g4(`MIME_ERROR`,`${e} contains a control character (U+${t.charCodeAt(n).toString(16).toUpperCase().padStart(4,`0`)}).`)}var c4=`()<>@,;:\\"/[]?=`;function l4(e){return e>32&&e<127&&!c4.includes(String.fromCharCode(e))}function u4(e,t){let n=()=>new g4(`MIME_ERROR`,`${e} is not a valid media type (RFC 2045 §5.1: type/subtype, then ; attribute=value parameters).`),r=t.length,i=0,a=()=>{let e=i;for(;i<r&&l4(t.charCodeAt(i));)i++;return i-e},o=()=>{for(;i<r&&(t[i]===` `||t[i]===` `);)i++};if(a()===0||t[i]!==`/`||(i++,a()===0))throw n();let s=new Set;for(;i<r;){if(o(),t[i]!==`;`)throw n();i++,o();let c=i;if(a()===0||t[i]!==`=`)throw n();let l=t.slice(c,i).toLowerCase();if(i++,t[i]===`"`)for(i++;;){if(i>=r)throw n();let e=t[i++];if(e===`"`)break;if(e===`\\`){if(i>=r)throw n();i++}}else if(a()===0)throw n();if(l===`name`)throw new g4(`MIME_ERROR`,`${e} must not carry a name= parameter; the builder adds name="<filename>" itself.`);if(s.has(l))throw new g4(`MIME_ERROR`,`${e} gives the same parameter twice; attribute names are case-insensitive and each may appear once (RFC 6838 §4.3).`);s.add(l)}}var d4="!#$%&'*+-/=?^_`{|}~";function f4(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||d4.includes(String.fromCharCode(e))}function p4(e,t){let n=()=>new g4(`MIME_ERROR`,`${e} is not a valid Content-ID (RFC 5322 §3.6.4 msg-id: an identifier of atext, "." and "@", optionally in one pair of angle brackets).`),r=0,i=t.length;if(t[0]===`<`){if(i<2||t[i-1]!==`>`)throw n();r=1,i--}let a=()=>{let e=0;for(;r<i;r++){let n=t.charCodeAt(r);if(f4(n))e++;else if(n===46&&e>0)e=0;else break}return e>0};if(!a()||r<i&&(t[r]!==`@`||(r++,!a()))||r!==i)throw n()}var m4={txt:`text/plain`,html:`text/html`,htm:`text/html`,css:`text/css`,csv:`text/csv`,pdf:`application/pdf`,json:`application/json`,xml:`application/xml`,zip:`application/zip`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,ico:`image/x-icon`,ics:`text/calendar`,eml:`message/rfc822`};function h4(e){return m4[e.split(`.`).pop()?.toLowerCase()??``]??`application/octet-stream`}var g4=class extends Error{code;constructor(e,t){super(t),this.name=`MimeError`,this.code=e}};function _4(e){return e===`from`?`INVALID_FROM`:e===`to`?`INVALID_TO`:`MIME_ERROR`}function v4(e,t,n){if(t.length>320)throw new g4(_4(e),`${e}: address is ${t.length} characters, over the 320-character limit.`);if(!(0,Q2.validate)(t))throw new g4(_4(e),`${e}: address is not a valid email address (ASCII local part and dotted domain, RFC 5322 dot-atom; at most 64 characters before the '@' and 254 in total).`);if(n!==void 0){if(a4(`${e} display name`,n),r4.test(n)&&A4.test(n)&&n.length+R4>P4)throw new g4(_4(e),`${e}: display name is ${n.length} characters and must be quoted, which cannot be folded, so its line would exceed the ${P4}-octet limit in RFC 5322 §2.1.1. Shorten it.`);if(n.includes(`@`))throw new g4(_4(e),`${e}: display name '${n}' must not contain '@' (likely a malformed address).`)}}function y4(e){let t=e.indexOf(`\\`);if(t===-1)return e;let n=0;for(let r=t;r<e.length;r++)e.charCodeAt(r)===92&&(n++,r++);let r=new Uint16Array(e.length-n),i=0;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n===92&&(n=e.charCodeAt(++t)),r[i++]=n}return G4(r)}function b4(e,t){if(typeof e==`string`){a4(`${t} address`,e);let n=e.match(/^\s*"((?:[^"\\]|\\.)*)"\s*<\s*([^>\s]+)\s*>\s*$/),r=n??e.match(/^\s*(?:([^"<\s](?:[^"<]*[^"<\s])?)\s*)?<\s*([^>\s]+)\s*>\s*$/);if(r){let e=(n?y4(r[1]??``):r[1])?.trim(),i=r[2];return v4(t,i,e),e?{email:i,name:e}:{email:i}}let i=e.trim();return v4(t,i),{email:i}}return v4(t,e.email??``,e.name),e.name?{email:e.email,name:e.name}:{email:e.email}}function x4(e,t){return(Array.isArray(e)?e:[e]).map(e=>b4(e,t))}function S4(e){return e?Array.isArray(e)?e.length:1:0}function C4(e){return new g4(`MIME_ERROR`,`email: attachment size ${e} bytes exceeds Cloudflare limit of ${e4} bytes.`)}function w4(e){return e instanceof Uint8Array||e instanceof ArrayBuffer?e.byteLength:typeof Blob<`u`&&e instanceof Blob?e.size:typeof e==`string`?e.length:0}async function T4(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof Blob<`u`&&e instanceof Blob)return new Uint8Array(await e.arrayBuffer());if(typeof e==`string`)return new TextEncoder().encode(e);throw new g4(`MIME_ERROR`,`attachment content must be string, Uint8Array, ArrayBuffer, or Blob.`)}async function E4(e){if(!e.filename)throw new g4(`MIME_ERROR`,`attachment: missing filename.`);if(a4(`attachment filename`,e.filename),e.filename.length+F4>P4)throw new g4(`MIME_ERROR`,`attachment filename is ${e.filename.length} characters; a quoted \`filename=\` parameter cannot be folded, so its line would exceed the ${P4}-octet limit in RFC 5322 §2.1.1. Shorten the filename.`);if(s4(`attachment filename`,e.filename),e.contentType!==void 0){if(a4(`attachment contentType`,e.contentType),e.contentType.length+I4>P4)throw new g4(`MIME_ERROR`,`attachment contentType is ${e.contentType.length} characters; at most ${P4-I4} fit on the Content-Type line under the ${P4}-octet limit in RFC 5322 §2.1.1. Shorten it.`);s4(`attachment contentType`,e.contentType),u4(`attachment contentType`,e.contentType)}if(e.contentId!==void 0){a4(`attachment contentId`,e.contentId);let t=e.contentId.startsWith(`<`)?0:2;if(e.contentId.length+t+L4>P4)throw new g4(`MIME_ERROR`,`attachment contentId is ${e.contentId.length} characters; at most ${P4-L4-t} fit on the Content-ID line under the ${P4}-octet limit in RFC 5322 §2.1.1. Shorten it.`);s4(`attachment contentId`,e.contentId),p4(`attachment contentId`,e.contentId)}if(e.disposition!==void 0&&e.disposition!==`attachment`&&e.disposition!==`inline`)throw new g4(`MIME_ERROR`,`attachment disposition must be 'attachment' or 'inline'.`);let t=await T4(e.content);return{filename:e.filename,contentType:e.contentType??h4(e.filename),bytes:t,contentId:e.contentId,disposition:e.disposition??(e.contentId?`inline`:`attachment`)}}async function D4(e){if(!e.text&&!e.html)throw new g4(`MIME_ERROR`,`email: at least one of 'text' or 'html' is required.`);if(e.subject!==void 0&&a4(`subject`,e.subject),e.headers){let t=0,n=0,r=new TextEncoder;for(let[i,a]of Object.entries(e.headers)){if(!i4.test(i))throw new g4(`MIME_ERROR`,`headers: '${i}' is not a valid RFC 5322 header name.`);if(i.length+z4>P4)throw new g4(`MIME_ERROR`,`headers: a header name is ${i.length} characters; a field name cannot be folded, so its line would exceed the ${P4}-octet limit in RFC 5322 §2.1.1. Shorten the name.`);if(t+i.length+a.length+4>t4||(t+=i.length+r.encode(a).byteLength+4,t>t4)||(a4(`header '${i}'`,a),!t3.has(i.toLowerCase())&&(n+i.length+s3+n3(a)>t4||(n+=N4(i,k4(a)).length+2,n>t4))))throw new g4(`MIME_ERROR`,`email: custom headers exceed the 16 KiB limit.`)}}let t=S4(e.to)+S4(e.cc)+S4(e.bcc);if(t>50)throw new g4(`INVALID_TO`,`email: too many recipients (max 50, got ${t}) across 'to', 'cc' and 'bcc'.`);let n=b4(e.from,`from`),r=x4(e.to,`to`);if(r.length===0)throw new g4(`INVALID_TO`,`email: 'to' must include at least one recipient.`);let i=e.cc?x4(e.cc,`cc`):[],a=e.bcc?x4(e.bcc,`bcc`):[],o=e.replyTo?b4(e.replyTo,`replyTo`):void 0,s=e.attachments??[];if(!Array.isArray(s))throw new g4(`MIME_ERROR`,`email: attachments must be an array.`);if(s.length>o3)throw new g4(`MIME_ERROR`,`email: too many attachments (max ${o3}, got ${s.length}).`);let c=[],l=0;for(let e of s){let t=w4(e.content);if(l+t>e4)throw C4(l+t);let n=await E4(e);if(l+=n.bytes.byteLength,l>e4)throw C4(l);c.push(n)}return e.threading?.inReplyTo&&a4(`threading.inReplyTo`,e.threading.inReplyTo),e.threading?.references&&a4(`threading.references`,e.threading.references),{from:n,to:r,cc:i,bcc:a,replyTo:o,subject:e.subject??``,text:e.text,html:e.html,headers:e.headers?{...e.headers}:{},attachments:c,threading:e.threading}}var O4=45;function k4(e){if(r4.test(e))return e;let t=new TextEncoder,n=new Uint8Array(49),r=0,i=[],a=()=>{r>0&&(i.push(`=?UTF-8?B?${Z2(n.subarray(0,r))}?=`),r=0)};for(let i of e){let e=t.encode(i);r>0&&r+e.length>O4&&a(),n.set(e,r),r+=e.length}return a(),i.join(` `)}var A4=/[()<>[\]:;@\\,."]/;function j4(e){return e.name?r4.test(e.name)?A4.test(e.name)?`"${V4(e.name)}" <${e.email}>`:`${e.name} <${e.email}>`:`${k4(e.name)} <${e.email}>`:e.email}function M4(e){return e.map(j4).join(`, `)}function N4(e,t){let n=`${e}: ${t}`;if(n.length<=78)return n;let r=[],i=[`${e}:`],a=e.length+1,o=0,s=(e,t)=>{o++;let n=t?`${e},`:e;n.length>0&&a+1+n.length>76?(r.push(i.join(` `)),i=[``,n],a=1+n.length):(i.push(n),a+=1+n.length)},c=-1,l=-1,u=-1,d=e=>{c<0||(l>=0&&s(t.slice(l,u),!1),l=c,u=e,c=-1)},f=e=>{l>=0?(s(t.slice(l,u),!e),l=-1):s(``,!e)},p=!1,m=!1;for(let e=0;e<t.length;e++){let n=t[e];m?(m=!1,c<0&&(c=e)):n===`\\`&&p?(m=!0,c<0&&(c=e)):n===`"`?(p=!p,c<0&&(c=e)):!p&&n===`,`&&t[e+1]===` `?(d(e),f(!1),e++):!p&&(n===` `||n===` `)?d(e):c<0&&(c=e)}return d(t.length),f(!0),o<=1?n:(r.push(i.join(` `)),r.join(n4))}var P4=998,F4=12,I4=2,L4=12,R4=3,z4=1;function B4(e){let t=0,n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===13&&e.charCodeAt(r+1)===10){if(n>P4)return{index:t,octets:n};t++,n=0,r++}else if(i<128)n+=1;else if(i<2048)n+=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(n+=4,r++):n+=3}else n+=3}return n>P4?{index:t,octets:n}:void 0}function V4(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function H4(e){let t=new Uint8Array(8);crypto.getRandomValues(t);let n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return`${e}_${Date.now().toString(36)}${n}`}function U4(e){let t=Z2(e),n=[];for(let e=0;e<t.length;e+=76)n.push(t.slice(e,e+76));return n.join(n4)}function W4(e){let t=new TextEncoder().encode(e),n=new Uint8Array(Math.ceil(t.length*3*(76/73))+8),r=0,i=0,a=`0123456789ABCDEF`,o=e=>{n[r++]=e},s=(e,t,n)=>{let r=n===void 0?t===void 0?1:2:3;i+r>75&&(o(61),o(13),o(10),i=0),o(e),t!==void 0&&o(t),n!==void 0&&o(n),i+=r},c=e=>s(61,a.charCodeAt(e>>4),a.charCodeAt(e&15));for(let e=0;e<t.length;e++){let n=t[e];if(n===10)o(13),o(10),i=0;else if(n===13){if(t[e+1]===10)continue;o(13),o(10),i=0}else n===32||n===9?e===t.length-1||t[e+1]===10||t[e+1]===13?c(n):s(n):n===61||n<32||n>126?c(n):s(n)}return G4(n.subarray(0,r))}function G4(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return t}function K4(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===10)t=0;else{if(r===13){if(e.charCodeAt(n+1)===10)continue;return!0}if(r<32||r>126||(t++,t>990))return!0}}return!1}function q4(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&(n===0||e.charCodeAt(n-1)!==13)&&t++;if(t===0)return e;let n=new Uint8Array(e.length+t),r=0;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i===10&&(t===0||e.charCodeAt(t-1)!==13)&&(n[r++]=13),n[r++]=i}return G4(n)}function J4(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<128)t+=1;else if(r<2048)t+=6;else if(r>=55296&&r<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){t+=12,n++;continue}t+=9}else t+=9}return t}function Y4(e){return Math.ceil(e/3)*4}function X4(e){return e.headers.map(([e,t])=>N4(e,t)).join(n4)+`\r
|
|
566
|
+
\r
|
|
567
|
+
`+e.body}function Z4(e,t){let n=K4(t);return{headers:[[`Content-Type`,`${e}; charset=UTF-8`],[`Content-Transfer-Encoding`,n?`quoted-printable`:`7bit`]],body:n?W4(t):q4(t)}}function Q4(e){let t=[[`Content-Type`,`${e.contentType}; name="${V4(e.filename)}"`],[`Content-Transfer-Encoding`,`base64`],[`Content-Disposition`,`${e.disposition}; filename="${V4(e.filename)}"`]];if(e.contentId){let n=e.contentId.startsWith(`<`)?e.contentId:`<${e.contentId}>`;t.push([`Content-ID`,n])}return{headers:t,body:U4(e.bytes)}}function $4(e){let t=new Uint8Array(16);return crypto.getRandomValues(t),`=_void_${e}_${Z2(t).replace(/[+/=]/g,``)}`}function e3(e,t){let n=$4(e);return{headers:[[`Content-Type`,`multipart/${e}; boundary="${n}"`]],body:t.map(e=>`--${n}${n4}${X4(e)}`).join(n4)+`${n4}--${n}--${n4}`}}var t3=new Set([`from`,`to`,`cc`,`bcc`,`subject`,`reply-to`,`date`,`message-id`,`in-reply-to`,`references`,`mime-version`,`content-type`,`content-transfer-encoding`,`content-disposition`]);function n3(e){let t=0,n=0,r=!1;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a<128){if(t+=1,a===32||a===9)continue;(a<32||a===127)&&(r=!0),n+=1}else if(r=!0,a<2048)t+=2;else if(a>=55296&&a<=56319&&i+1<e.length){let n=e.charCodeAt(i+1);if(n>=56320&&n<=57343){t+=4,i++;continue}t+=3}else t+=3}return r?Math.floor(t*4/3)+12*Math.floor(t/O4):n}function r3(e){return e.email.length+(e.name?n3(e.name):0)}function i3(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r!==32&&r!==9&&(t+=1)}return t}var a3=117,o3=Math.floor($2/119),s3=4;function c3(e){let t=n3(e.subject);for(let[n,r]of Object.entries(e.headers))t3.has(n.toLowerCase())||(t+=n.length+s3+n3(r));t+=r3(e.from);for(let n of e.to)t+=r3(n);for(let n of e.cc)t+=r3(n);e.replyTo&&(t+=r3(e.replyTo)),e.threading?.inReplyTo&&(t+=i3(e.threading.inReplyTo)),e.threading?.references&&(t+=i3(e.threading.references));for(let n of e.attachments)t+=a3+2*n.filename.length,t+=i3(n.contentType),n.contentId&&(t+=i3(n.contentId));return t}function l3(e){let t=e.split(`@`)[1]??`localhost`,n=new Uint8Array(12);return crypto.getRandomValues(n),`<${Z2(n).replace(/[+/=]/g,``)}@${t}>`}function u3(e){let t=c3(e)+(e.text?J4(e.text):0)+(e.html?J4(e.html):0)+e.attachments.reduce((e,t)=>e+Y4(t.bytes.byteLength),0);if(t>5242880)throw new g4(`MIME_ERROR`,`email: message is at least ${t} bytes once encoded, which exceeds Cloudflare limit of ${$2} bytes.`);let n=l3(e.from.email),r=[[`Date`,new Date().toUTCString().replace(`GMT`,`+0000`)],[`From`,j4(e.from)],[`To`,M4(e.to)]];e.cc.length>0&&r.push([`Cc`,M4(e.cc)]),e.replyTo&&r.push([`Reply-To`,j4(e.replyTo)]),r.push([`Subject`,k4(e.subject)]),r.push([`Message-ID`,n]),e.threading?.inReplyTo&&r.push([`In-Reply-To`,e.threading.inReplyTo]),e.threading?.references&&r.push([`References`,e.threading.references]),r.push([`MIME-Version`,`1.0`]);for(let[t,n]of Object.entries(e.headers))t3.has(t.toLowerCase())||r.push([t,k4(n)]);let i=e.text?Z4(`text/plain`,e.text):void 0,a=e.html?Z4(`text/html`,e.html):void 0,o;if(o=i&&a?e3(`alternative`,[i,a]):i??a,e.attachments.length>0){let t=e.attachments.filter(e=>e.disposition===`inline`),n=e.attachments.filter(e=>e.disposition!==`inline`);t.length>0&&a?o=e3(`related`,[o,...t.map(Q4)]):n.push(...t),n.length>0&&(o=e3(`mixed`,[o,...n.map(Q4)]))}for(let[e,t]of o.headers)r.push([e,t]);let s=r.map(([e,t])=>N4(e,t)).join(n4)+`\r
|
|
568
|
+
\r
|
|
569
|
+
`+o.body,c=new TextEncoder().encode(s),l=B4(s);if(l!==void 0)throw new g4(`MIME_ERROR`,`email: header line ${l.index+1} is ${l.octets} octets, over the ${P4}-octet limit in RFC 5322 §2.1.1. A value with no whitespace cannot be folded — shorten it, or move it into the body.`);if(c.byteLength>5242880)throw new g4(`MIME_ERROR`,`email: message size ${c.byteLength} bytes exceeds Cloudflare limit of ${$2} bytes.`);return{raw:c,messageId:n}}var d3=`/__void/inbox/_capture`,f3=`__VOID_EMAIL_DEV_INBOX`,p3=`__VOID_EMAIL_DEV_INBOX_TOKEN`;6*$2;function m3(e){return JSON.stringify({...e,raw:Z2(e.raw)})}var h3=`__voidEmailSinks__`,g3=globalThis;function _3(){let e=g3[h3];return e||(e={sinks:new Set},g3[h3]=e),e}function v3(e){for(let t of _3().sinks)try{t(e)}catch(e){console.warn(`[email-dev-inbox] sink error:`,e)}}function y3(){return _3().sinks.size>0}function b3(e,t,n){return{id:H4(`dev`),capturedAt:Date.now(),raw:t,messageId:n,from:e.from,to:e.to,cc:e.cc,bcc:e.bcc,replyTo:e.replyTo,subject:e.subject,text:e.text,html:e.html,headers:{...e.headers},attachments:e.attachments.map(e=>({filename:e.filename,contentType:e.contentType,size:e.bytes.byteLength,contentId:e.contentId,disposition:e.disposition}))}}new TextEncoder,new TextDecoder(`utf-8`,{fatal:!0});var x3=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!1});async function S3(e,t,n){if(e<=0)throw n();let r;try{return await Promise.race([t(),new Promise((t,i)=>{r=setTimeout(()=>i(n()),e)})])}finally{r!==void 0&&clearTimeout(r)}}async function C3(e,t,n,{rejectEncoding:r=!1}={}){let i=e.headers.get(`content-length`);if(r&&e.headers.has(`content-encoding`)||i!==null&&(!/^\d+$/.test(i)||Number(i)>t))throw e.body?.cancel().catch(()=>{}),Error(`email response refused before reading`);let a=e.body?.getReader();if(!a)throw Error(`email response is empty`);let o=new Uint8Array(t),s=0;try{for(;;){let e=await n(()=>a.read());if(e.done)break;if(s+e.value.byteLength>t)throw Error(`email response too large`);o.set(e.value,s),s+=e.value.byteLength}}finally{a.cancel().catch(()=>{});try{a.releaseLock()}catch{}}if(i!==null&&s!==Number(i))throw Error(`email response length mismatch`);return JSON.parse(x3.decode(o.subarray(0,s)))}new TextEncoder;function w3(){try{return Bv()}catch{return}}function T3(e){let t=w3()?.[e];return typeof t==`string`&&t.length>0?t:void 0}var E3=/^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$/;function D3(){let e=T3(`__VOID_PROJECT_SLUG`);return e!==void 0&&E3.test(e)?e:void 0}function O3(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}function k3(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A3(e,t,n){return n===void 0?{code:e,message:t}:{code:e,message:t,cause:n}}var j3=`SEND_EMAIL`,M3=3e4,N3=6e4,P3=class extends Error{constructor(){super(`email binding outcome unknown after timeout`),this.name=`EmailBindingTimeoutError`}};function F3(e){let t=e?.[j3];if(typeof t==`object`&&t)return typeof t.send==`function`?t:void 0}function I3(e){let t=e instanceof Error?e.message:String(e);switch(typeof e?.code==`string`?e.code:``){case`E_RECIPIENT_NOT_ALLOWED`:return A3(`UNVERIFIED_DESTINATION`,t,e);case`E_SENDER_NOT_VERIFIED`:case`E_SENDER_DOMAIN_NOT_AVAILABLE`:return A3(`INVALID_FROM`,t,e);case`E_RATE_LIMIT_EXCEEDED`:case`E_DAILY_LIMIT_EXCEEDED`:return A3(`QUOTA_EXCEEDED`,t,e)}return L3.test(t)?A3(`UNVERIFIED_DESTINATION`,t,e):A3(`OUTCOME_UNKNOWN`,t,e)}var L3=/^[^\n]{0,200}destination address[^\n]{0,200}not (?:yet )?verified/i;async function R3(e,t,n,r,i){let a;try{({EmailMessage:a}=await import(`cloudflare:email`))}catch(e){return V3(`UPSTREAM_ERROR`,`email: SEND_EMAIL is bound but cloudflare:email could not be loaded: ${e instanceof Error?e.message:String(e)}`,e)}let o=[],s=Date.now()+N3,c=()=>Math.min(M3,s-Date.now());for(let s=0;s<n.length;s++){let l=n[s];if(c()<=0){for(let e of n.slice(s))o.push({recipient:e,ok:!1,state:`cancelled`,error:A3(`UPSTREAM_ERROR`,`email: batch deadline elapsed before provider submission`)});break}try{let n=await S3(c(),()=>e.send(new a(t,l,O3(r))),()=>new P3),s=typeof n?.messageId==`string`?n.messageId:``;o.push({recipient:l,ok:!0,messageId:s||i})}catch(e){let t=e instanceof P3?A3(`OUTCOME_UNKNOWN`,`email: binding submission timed out; inspect provider logs before retrying`,e):I3(e);o.push({recipient:l,ok:!1,...t.code===`OUTCOME_UNKNOWN`?{state:`outcome_unknown`}:{},error:t})}}return o.some(e=>!e.ok)?{ok:!1,deliveries:o}:{ok:!0,ids:o.map(e=>({recipient:e.recipient,messageId:e.messageId}))}}function z3(e){let t=new Set,n=[];for(let r of[...e.to,...e.cc,...e.bcc]){let e=r.email.toLowerCase();t.has(e)||(t.add(e),n.push(e))}return n}function B3(e){let t=e.from;if(!(t==null||typeof t==`string`&&t.trim()===``||typeof t==`object`&&t&&!(`email`in t)))return e;let n=T3(`__VOID_EMAIL_FROM`);if(n)return{...e,from:n};let r=D3(),i=T3(`__VOID_EMAIL_DOMAIN`);if(!r||!i){if(t===null){let t={...e};return delete t.from,t}return e}return{...e,from:`${r}+noreply@${i}`}}function V3(e,t,n){return{ok:!1,error:A3(e,t,n)}}function H3(e){return[`BINDING_MISSING`,`INVALID_FROM`,`INVALID_TO`,`UNVERIFIED_DESTINATION`,`MIME_ERROR`,`QUOTA_EXCEEDED`,`IDEMPOTENCY_CONFLICT`,`OUTCOME_UNKNOWN`,`UPSTREAM_ERROR`].find(t=>t===e)??`UPSTREAM_ERROR`}function U3(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let{error:t,message:n}=e;return typeof t!=`string`||t===``?null:typeof n==`string`&&n!==``?n:t}function W3(e){if(!k3(e))return null;let t=e.operationId;if(e.ok===!0&&Array.isArray(e.ids))return{ok:!0,ids:e.ids,operationId:t};if(e.ok!==!1)return null;if(Array.isArray(e.deliveries))return{ok:!1,deliveries:e.deliveries,operationId:t};let n=e.error;return typeof n==`object`&&n?{ok:!1,error:{code:`code`in n?n.code:void 0,message:`message`in n?n.message:void 0},operationId:t}:null}function G3(e,t,n,r){if(e.length!==t.length)return{ok:!1,reason:`expected ${t.length} deliveries, got ${e.length}`};let i=new Set(t),a=new Set,o=[];for(let[t,s]of e.entries()){let e=typeof s==`object`&&s?s:null,c=e?.recipient;if(e===null||typeof c!=`string`)return{ok:!1,reason:`entry ${t} is not ${n}`};let l=r(e,c);if(l===void 0)return{ok:!1,reason:`entry ${t} is not ${n}`};if(!i.has(c))return{ok:!1,reason:`entry ${t} names a recipient that was not requested`};if(a.has(c))return{ok:!1,reason:`entry ${t} repeats a recipient`};a.add(c),o.push(l)}return{ok:!0,entries:o}}function K3(e,t,n){return G3(e,t,`{ recipient: string, messageId: string }`,(e,t)=>typeof e.messageId==`string`?{recipient:t,messageId:e.messageId||n,...e.state===`provider_accepted`?{state:`provider_accepted`}:{}}:void 0)}function q3(e,t,n){return G3(e,t,`{ recipient: string, ok: true, messageId: string } | { recipient: string, ok: false, error: { message: string } }`,(e,t)=>{if(e.ok===!0)return typeof e.messageId==`string`?{recipient:t,ok:!0,messageId:e.messageId||n,...e.state===`provider_accepted`?{state:`provider_accepted`}:{}}:void 0;if(e.ok===!1){let n=J3(e.state),r=e.error;return typeof r==`object`&&r&&typeof r.message==`string`?{recipient:t,ok:!1,error:A3(H3(r.code),r.message),...n?{state:n}:{}}:void 0}})}function J3(e){return[`rejected`,`reserved`,`attempt_started`,`provider_accepted`,`failed`,`outcome_unknown`,`cancelled`].find(t=>t===e)}var Y3=65536;async function X3(e,t,n,r){let i;try{i=await C3(e,Y3,r)}catch{return V3(`OUTCOME_UNKNOWN`,`email: could not establish the send outcome (status ${e.status}); check email logs or repeat the same idempotency key`)}let a=W3(i);if(a===null){let t=U3(i);return!e.ok&&t!==null?V3(`UPSTREAM_ERROR`,`email: proxy returned ${e.status}: ${t}`,i):V3(`OUTCOME_UNKNOWN`,`email: proxy returned malformed response (status ${e.status})`,i)}let o=e=>V3(`OUTCOME_UNKNOWN`,`email: proxy returned a malformed delivery list (${e}); do not retry with a new idempotency key`,i),s=typeof a.operationId==`string`&&a.operationId.length<=128?{operationId:a.operationId}:{};if(a.ok===!0){let e=K3(a.ids,t,n);return e.ok?{ok:!0,ids:e.entries,...s}:o(e.reason)}if(`deliveries`in a){let e=q3(a.deliveries,t,n);return e.ok?{ok:!1,deliveries:e.entries,...s}:o(e.reason)}let c=a.error;return{...V3(H3(c.code),typeof c.message==`string`?c.message:`email: upstream send failed`),...s}}function Z3(e){let t=e?.[f3];if(typeof t!=`string`||t.length===0)return;let n=e?.[t];if(typeof n!=`object`||!n||typeof n.fetch!=`function`)return;let r=e?.[p3];return{fetcher:n,token:typeof r==`string`&&r.length>0?r:void 0}}var Q3=5e3,$3=200,e6=1e3;async function t6(e){let t;try{let n=e.body?.getReader();if(!n)return``;let r=await Promise.race([n.read().then(({value:e})=>e),new Promise(e=>{t=setTimeout(()=>e(void 0),e6)})]);return n.cancel().catch(()=>{}),r?new TextDecoder().decode(r).trim().split(`
|
|
570
|
+
`)[0].slice(0,$3):``}catch{return``}finally{t!==void 0&&clearTimeout(t)}}async function n6(e,t){let n;try{let r=Promise.resolve(e.fetcher.fetch(`http://localhost${d3}`,{method:`POST`,headers:{"content-type":`application/json`,...e.token!==void 0&&{"x-void-dev-trigger":e.token}},body:m3(t)})).then(e=>({kind:`response`,res:e}),e=>({kind:`error`,cause:e})),i=await Promise.race([r,new Promise(e=>{n=setTimeout(()=>e({kind:`timeout`}),Q3)})]);if(i.kind===`timeout`)return{ok:!1,reason:`no response within ${Q3}ms`};if(i.kind===`error`){let e=i.cause;return{ok:!1,reason:e instanceof Error?e.message:String(e)}}let{res:a}=i;if(!a.ok){let e=await t6(a);return{ok:!1,reason:`dev server responded ${a.status}${e?`: ${e}`:``}`}}return a.headers.get(`x-void-email-inbox`)===`captured`?{ok:!0}:{ok:!1,reason:`response did not come from the dev inbox`}}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}finally{n!==void 0&&clearTimeout(n)}}function r6(e,t){return{ok:!0,ids:z3(e).map(e=>({recipient:e,messageId:t}))}}async function i6(e){if(e.idempotencyKey!==void 0&&(typeof e.idempotencyKey!=`string`||!/^[\x21-\x7e]{1,128}$/.test(e.idempotencyKey)))return V3(`MIME_ERROR`,`email: idempotencyKey must contain 1–128 printable non-space ASCII characters.`);let t=B3(e);if(t.from===void 0)return V3(`INVALID_FROM`,`email: 'from' is required. Set it explicitly or deploy via Void so the platform-injected __VOID_PROJECT_SLUG and __VOID_EMAIL_DOMAIN can default it to <slug>+noreply@<domain>.`);let n=t,r,i,a;try{r=await D4(n),{raw:i,messageId:a}=u3(r)}catch(e){return e instanceof g4?V3(e.code,e.message,e):V3(`MIME_ERROR`,e instanceof Error?e.message:String(e),e)}let o=w3();if(!e.sendInDev&&y3()){let e=b3(r,i,a);return v3(e),r6(r,e.id)}let s=e.sendInDev?void 0:Z3(o);if(s){let e=b3(r,i,a),t=await n6(s,e);if(t.ok)return r6(r,e.id);let n=`email: the void dev inbox at ${d3} is unreachable (${t.reason}), so nothing was captured and nothing was sent.`;return console.warn(`[void/email] ${n}`),V3(`UPSTREAM_ERROR`,n)}let c=z3(r),l=F3(o);if(l)return e.idempotencyKey===void 0?R3(l,r.from.email,c,i,a):V3(`MIME_ERROR`,`email: idempotencyKey requires a Void platform; the native Cloudflare binding cannot deduplicate sends.`);let u=o,d=u?.__VOID_PROXY,f=u?.__PROJECT_ID,p=u?.__VOID_PROXY_TOKEN;if(!d||!f||!p)return V3(`BINDING_MISSING`,"email: neither SEND_EMAIL nor __VOID_PROXY is available, so nothing was sent. Deploy via Void to bind the platform proxy, or set `email.from` in void.config.ts so `void deploy --platform cloudflare` provisions the SEND_EMAIL binding. Under `void dev` messages are captured by the local inbox at /__void/inbox instead — reaching this error there means that path was bypassed by the deprecated `sendInDev: true` (it never delivers) or unavailable (the worker has no assets binding to reach the dev server through).");let m={projectId:f,aiToken:p,from:r.from.email,recipients:c,mimeBase64:Z2(i),requestId:H4(`req`),...e.idempotencyKey===void 0?{}:{idempotencyKey:e.idempotencyKey}},h=JSON.stringify(m),g=new AbortController,_=Date.now()+N3,v=e=>S3(_-Date.now(),e,()=>(g.abort(),Error(`email platform send timed out`))),y;try{y=await v(()=>d.fetch(`https://email-proxy/email/send`,{method:`POST`,headers:{"content-type":`application/json`},body:h,signal:g.signal}))}catch(e){return V3(`OUTCOME_UNKNOWN`,`email: send outcome is unknown: ${e instanceof Error?e.message:String(e)}. Check email logs or repeat the same idempotency key; do not create a new send.`,e)}return X3(y,c,a,v)}async function a6(e,t){let{clientId:n,codeChallenge:r,expiry:i,key:a,userId:o}=t,s={account:a.account,expiresAt:new Date(Math.min(Date.now()+6e5,i*1e3)),keyAuthorization:a.keyAuthorization,userId:o};await e.insert(vM).values({...s,clientId:n,codeChallenge:r}).onConflictDoUpdate({set:{...s,createdAt:new Date},setWhere:Y(vM.userId,o),target:[vM.clientId,vM.codeChallenge]})}async function o6(e,t){let{clientId:n,codeChallenge:r,userId:i}=t,[a]=await e.delete(vM).where(tA(Y(vM.clientId,n),Y(vM.codeChallenge,r),iA(vM.expiresAt,new Date),Y(vM.userId,i))).returning({account:vM.account,keyAuthorization:vM.keyAuthorization});if(a)return{account:a.account,keyAuthorization:a.keyAuthorization}}var s6=[`example.com`,`example.net`,`example.org`];function c6(e){let{domain:t,email:n}=e;return!t||!s6.some(e=>e===t)?!1:n.toLowerCase().endsWith(`@${t}`)}var l6=class extends Error{name=`Auth.UndeliverableError`},u6=HL(async(e,t)=>{e.set(`auth`,d6(e)),await t()});function d6(e){return X2(VL({accountStep:t=>e.var.accountChosen?Promise.resolve(!1):Z(e,G0(e,{clientId:t.clientId,cookie:t.headers.get(`cookie`),sessionId:t.sessionId,userId:t.userId}),`AccountStep.due`),baseURL:Sb.URL,db:L0,google:f6(),pendingKey:t=>Z(e,o6($,t),`PendingKey.take`),secret:Sb.SECRET,sendCode:t=>p6(e,t),waitUntil:t=>e.executionCtx.waitUntil(t)}))}function f6(){let{GOOGLE_CLIENT_ID:e,GOOGLE_CLIENT_SECRET:t}=Sb;if(e&&t)return{clientId:e,clientSecret:t}}async function p6(e,t){let n={subject:`Your Tempo ID sign-in code`,text:`Your sign-in code is ${t.code}. It expires in 10 minutes.`},r=e.env.TEST_INBOX;if(r&&c6({domain:Sb.TEST_EMAIL_DOMAIN,email:t.email})){await Z(e,r.capture({...n,to:[{email:t.email}]}),`inbox.capture`);return}let i=await Z(e,i6({...n,to:t.email}),`email.send`);if(i.ok)return;let a=`error`in i?i.error.code:void 0;throw a===`QUOTA_EXCEEDED`?new IN:a===`UNVERIFIED_DESTINATION`?new l6(`The email service does not deliver to the address.`):Error(`Sending the sign-in code failed: ${a??`delivery`}.`)}(function(e){e.errors=[IN]})(p6||={});var m6=e=>{let t={origin:`*`,allowMethods:[`GET`,`HEAD`,`PUT`,`POST`,`DELETE`,`PATCH`,`QUERY`],allowHeaders:[],exposeHeaders:[],...e},n=t.exposeHeaders?.length?t.exposeHeaders.join(`,`):void 0,r=t.allowHeaders?.length?t.allowHeaders.join(`,`):void 0,i=(e=>typeof e==`string`?e===`*`?()=>e:t=>e===t?t:null:typeof e==`function`?e:t=>e.includes(t)?t:null)(t.origin),a=(e=>{if(typeof e==`function`)return async(t,n)=>(await e(t,n)).join(`,`);if(Array.isArray(e)){let t=e.join(`,`);return()=>t}return()=>``})(t.allowMethods);return async function(e,o){function s(t,n){e.res.headers.set(t,n)}let c=await i(e.req.header(`origin`)||``,e);if(c&&s(`Access-Control-Allow-Origin`,c),t.credentials&&s(`Access-Control-Allow-Credentials`,`true`),n&&s(`Access-Control-Expose-Headers`,n),e.req.method===`OPTIONS`){t.origin!==`*`&&e.res.headers.append(`Vary`,`Origin`),t.maxAge!=null&&s(`Access-Control-Max-Age`,t.maxAge.toString());let n=await a(e.req.header(`origin`)||``,e);n&&s(`Access-Control-Allow-Methods`,n);let i=r;if(!i){let t=e.req.header(`Access-Control-Request-Headers`);t&&(i=t.split(`,`).map(e=>e.trim()).join(`,`))}return i&&(s(`Access-Control-Allow-Headers`,i),e.res.headers.append(`Vary`,`Access-Control-Request-Headers`)),e.res.headers.delete(`Content-Length`),e.res.headers.delete(`Content-Type`),new Response(null,{headers:e.res.headers,status:204,statusText:`No Content`})}await o(),t.origin!==`*`&&e.header(`Vary`,`Origin`,{append:!0})}},h6=({limitLength:e=255,headerName:t=`X-Request-Id`,generator:n=()=>crypto.randomUUID()}={})=>async function(r,i){let a=t?r.req.header(t):void 0;(!a||a.length>e||/[^\w\-=]/.test(a))&&(a=n(r)),r.set(`requestId`,a),t&&r.header(t,a),await i()},g6=`X-Request-Id`;function _6(){let e=h6({generator:x6,headerName:``});return HL(async(t,n)=>{await e(t,n);let r=t.var.requestId,i=t.res,a=b6(i)?await Z(t,C6(i),`response.json`):void 0;a&&t.set(`refusal`,v6(t,{body:a,id:r})),t.header(g6,r)})}function v6(e,t){let n=e.res;return e.res=new Response(JSON.stringify({...t.body,request_id:t.id}),{headers:n.headers,status:n.status,statusText:n.statusText}),e.header(`content-length`,void 0),{error:y6(t.body.error),reason:y6(t.body.reason)}}function y6(e){return typeof e==`string`&&/^[a-z_]{1,64}$/.test(e)?e:void 0}function b6(e){return e.status>=400&&!!e.headers.get(`content-type`)?.startsWith(`application/json`)}function x6(e){let t=e.req.header(`cf-ray`);return t&&/^[\da-f]{16}(?:-[A-Z]{3})?$/.test(t)?t:crypto.randomUUID()}function S6(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function C6(e){let t=await e.clone().json().catch(()=>void 0);return S6(t)&&typeof t.error==`string`?t:void 0}var w6=[...hz,g6],T6=new Set([`/v1/account`,`/v1/auth/code`,`/v1/auth/code/verify`,`/v1/auth/logout`,`/v1/auth/passkey/options`,`/v1/auth/passkey/verify`,`/v1/auth/providers`,`/v1/auth/session`,`/v1/authorize`,`/v1/realms`]);function E6(e){let t=e.req.header(`origin`);if(t&&![new URL(Sb.URL).origin,new URL(e.req.url).origin].includes(t))return t}var D6=HL((e,t)=>T6.has(e.req.path)?m6({credentials:!0,exposeHeaders:w6,origin:async t=>!t||t===new URL(Sb.URL).origin?null:await Z(e,lN($,{origin:t}),`Apps.firstPartyOrigin`)?t:null})(e,t):t()),O6=m6({exposeHeaders:w6});function k6(e,t){if(t.oauth_query&&E6(e))return new PN}(function(e){e.errors=[PN]})(k6||={});var A6=2e3;async function j6(e,t){let{clientId:n,userId:r}=t;if(E6(e))return;let i=(async()=>{try{if(!(await Z(e,e.env.ACCOUNT_LIMIT.limit({key:r}),`ratelimit.limit`)).success)return;let t=await Z(e,mB($,{clientId:n??void 0,own:new URL(Sb.URL).origin}),`Realm.forRequest`),i=await Z(e,vB($,{origin:Sb.URL,realms:t}),`Realm.withDefaults`);await Z(e,i1(e,{db:$,env:Sb,realms:i,userId:r}),`TempoAccount.create`)}catch(t){wN(e,{error:t,fields:{clientId:n??void 0},message:`The sign-in created no first account, since its creation failed.`})}})();e.executionCtx.waitUntil(i),await Promise.race([i,new Promise(e=>setTimeout(e,A6))])}var M6=`tempo-id-passkey-link`,N6=`host`;async function P6(e,t){let n=oR(e,M6,N6);if(!n)return;let r=await Z(e,PL(n,{host:new URL(e.req.url).host,secret:Sb.SECRET}),`Passkey.unseal`);if(!r)return;let[i,a]=await Z(e,Promise.all([r.nonce,t.nonce].map(e=>crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e)))),`crypto.digest`);return crypto.subtle.timingSafeEqual(i,a)?r:void 0}async function F6(e,t){let n=d(crypto.getRandomValues(new Uint8Array(32)),{pad:!1,url:!0});return cR(e,M6,await Z(e,AL({address:t.credential.address,createdAt:t.credential.createdAt,expiresAt:Math.floor(Date.now()/1e3)+300,host:new URL(e.req.url).host,id:t.id,nonce:n,publicKey:t.credential.publicKey,rpId:t.rpId},{secret:Sb.SECRET}),`Passkey.seal`),{httpOnly:!0,maxAge:300,path:`/`,prefix:N6,sameSite:`Lax`,secure:!0}),n}async function I6(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e.nonce));return ya(new Uint8Array(t))}async function L6(e){if(!e.expected)return!1;let t=await I6({nonce:e.nonce});return t.length===e.expected.length&&crypto.subtle.timingSafeEqual(fa(t).buffer,fa(e.expected).buffer)}function R6(e){lR(e,M6,{path:`/`,prefix:N6,secure:!0})}var z6=600,B6=`sign-in-grant-held:`,V6=3600,H6=`sign-in-grant-spent:`,U6;(function(e){e.held=B({assertion:Vt().optional(),witness:Bt([`0x`,z()]).optional()})})(U6||={});async function W6(e,t){await e.insert(fM).values({expiresAt:new Date(Date.now()+z6*1e3),id:crypto.randomUUID(),identifier:J6(t),value:JSON.stringify(U6.held.parse({assertion:t.oneTap?.assertion,witness:t.oneTap?.witness}))})}function G6(e){let t=[`client_id`,`redirect_uri`,`state`,`code_challenge`,`key_authorization`,`challenge`,`scope`].map(t=>e.get(t)??``);return ya(v(Ea(JSON.stringify(t))))}async function K6(e,t){let n=H6+G6(t.query),r=Number(t.query.get(`exp`)),i=new Date(Number.isSafeInteger(r)&&r>0?r*1e3:Date.now()+V6*1e3);return await e.transaction(async e=>{await e.execute(q`select pg_advisory_xact_lock(hashtextextended(${n}, 0))`);let[t]=await e.select({id:fM.id}).from(fM).where(tA(Y(fM.identifier,n),iA(fM.expiresAt,new Date)));return!t&&(await e.insert(fM).values({expiresAt:i,id:crypto.randomUUID(),identifier:n,value:`{}`}),!0)})}async function q6(e,t){let[n]=await e.delete(fM).where(tA(Y(fM.identifier,J6(t)),iA(fM.expiresAt,new Date))).returning({value:fM.value});if(n)return U6.held.parse(JSON.parse(n.value))}function J6(e){return`${B6}${G6(e.query)}:${e.sessionId}`}var Y6;(function(e){e.refusal=Wt([`foreign_account`,`no_account`,`passkey`,`unavailable`]).meta({description:"Why approval cannot sign the key: the key names an account that is not the user's (`foreign_account`), the user holds no account and none can be created (`no_account`), a passkey that this page cannot use owns the account (`passkey`), or the accounts could not be read (`unavailable`). Absent when approval can sign it.",examples:[`passkey`]})})(Y6||={});async function X6(e,t){let{account:n,clientId:r,key:i,owner:a,userId:o}=t,s=a.credential,c=mI({key:i});return await Z(e,kL($,{account:n,clientId:r,credential:s,digest:c,userId:o}),`Passkey.requestSignature`),cL({challenge:c,credentialId:s.id,rpId:s.rpId,userVerification:`required`}).options}async function Z6(e,t){let{clientId:n,sessionId:r,userId:i}=t,a=await(async()=>{if((await Z(e,e.env.ACCOUNT_LIMIT.limit({key:i}),`ratelimit.limit`)).success)return await Z(e,Q6(e,{account:t.account,clientId:n,cookie:e.req.header(`cookie`),passkey:!0,sessionId:r,userId:i}),`KeySigner.resolve`).catch(t=>{wN(e,{error:t,fields:{clientId:n},message:`An approval held a key whose account owners failed to load.`})})})(),o=a instanceof DI&&await Z(e,W0(e,{clientId:n}),`AccountStep.creates`),s=a?a instanceof JF?a.response.meta?.account:a instanceof MN?t.account:a.account:t.account,c=(()=>{if(!a)return`unavailable`;if(a instanceof t1)return`foreign_account`;if(a instanceof JF)return`passkey`;if(a instanceof DI&&!o)return`no_account`})();return{account:s,foreign:a instanceof t1?a:void 0,refusal:c}}async function Q6(e,t){let{clientId:n,cookie:r,sessionId:i,userId:a}=t,o=t.create&&!t.account?await Z(e,U0(e,{clientId:n,userId:a}),`AccountStep.create`):await Z(e,q0(e,{clientId:n,userId:a}),`AccountStep.held`),s=o.map(l1),c=t.account,l=c?void 0:K0(s,X0({clientId:n,cookie:r,sessionId:i}))?.address;if(t.single&&!c&&!l&&s.length>1)return new DI({description:"Several Tempo Accounts: the user holds more than one account in the app's realms and chose none. Choose the account on the account step, or name it in `key_authorization.account`."});let u=c?K0(s,c)?.address:l??s[0]?.address;if(c&&!u)return new t1({account:c,field:`key_authorization.account`});let d=u?o.find(e=>l1(e).address.toLowerCase()===u.toLowerCase()):void 0;return!u||!d?new DI({description:t.create?"No Tempo Account: the user holds no account in the app's realms, and the app's first realm has no Privy app to create one. Authorize without `key_authorization`.":"No Tempo Account: the user holds no account in the app's realms, so no owner signs the key. Create the account with `POST /v1/account`, or authorize without `key_authorization`."}):!d.signer&&!(t.passkey&&e8(d))?new JF({account:u}):{account:u,owner:d}}(function(e){e.errors=[...U0.errors,...q0.errors,DI,JF,t1]})(Q6||={});async function $6(e,t){let{account:n,assertion:r,key:i,owner:a}=t;if(!a.signer){if(!r||!a.credential)return new JF({account:n});let o=a.credential;return await Z(e,ML($,{account:n,authenticatorData:r.metadata.authenticatorData,clientId:t.clientId,clientDataJSON:r.metadata.clientDataJSON,credentialId:r.id,expiry:i.expiry,signature:r.signature,userId:t.userId,verify:e=>e.account===n.toLowerCase()&&e.clientId===t.clientId&&e.credential.id===o.id&&e.credential.publicKey===o.publicKey&&r.id===o.id&&e.digest===mI({key:i})&&FL(r,{challenge:e.digest,origin:new URL(Sb.URL).origin,publicKey:o.publicKey,rpId:o.rpId})}),`Passkey.takeSignature`)?await Z(e,_I(r,{key:i,publicKey:o.publicKey}),`KeyAuthorization.signWithAssertion`):new gL}return await Z(e,gI(await Z(e,a.signer(e,{auth:e.var.auth}),`Owner.signer`),{key:i}),`KeyAuthorization.sign`)}(function(e){e.errors=[JF,gL]})($6||={});function e8(e){return e.credential?OL([e.realm],{origin:Sb.URL})?.rpId===e.credential.rpId:!1}var t8=B({url:z().min(1)});async function n8(e,t){let{headers:n,oauthQuery:r,session:i}=t,a=await Z(e,e.var.auth.$context,`auth.context`);if(!await Z(e,Ar(r,a.secret),`auth.verifyOAuthQueryParams`))return new IL;let o=new URLSearchParams(r);i8(o);let s=r8(o)?await Z(e,a8(e,{account:t.account,assertion:t.assertion,oneTap:t.oneTap,query:o,session:i,single:t.single}),`Consent.approveKey`):void 0;if(s instanceof MN)return s;if(s&&`options`in s)return{options:s.options};let c=await Z(e,e.var.auth.api.oauth2Consent({asResponse:!1,body:{accept:!0,oauth_query:r},headers:n,request:new Request(e.req.url,{headers:n,method:`POST`})}),`auth.oauth2Consent`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;throw e});if(c instanceof MN)return c;let l=t8.parse(c).url,u=URL.parse(l)?.searchParams.get(`code`);return s&&u&&await Z(e,a6($,{clientId:s.clientId,codeChallenge:s.codeChallenge,expiry:s.expiry,key:{account:s.account,keyAuthorization:s.signed},userId:i.user.id}),`PendingKey.put`),{redirect:l}}(function(e){e.errors=[...AI.errors,...Q6.errors,...$6.errors,IL,DI,JF,gL,wI]})(n8||={});function r8(e){return e.has(`key_authorization`)||e.has(`challenge`)}function i8(e){let t=URL.parse(e.get(`redirect_uri`)??``);if(!t||t.protocol!==`http:`&&t.protocol!==`https:`&&!yr(t))throw Error(`The app's redirect URI uses a refused scheme.`)}async function a8(e,t){let{oneTap:n,query:r,session:i}=t,a=jI(r);if(!a||a instanceof MN)return a;let o=r.get(`client_id`),s=r.get(`code_challenge`),c=await Z(e,uN($,{clientId:o}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`),l=AI({app:c,clientId:o,codeChallenge:s,key:a});if(l)return l;let u=await Z(e,Q6(e,{account:a.account??t.account,clientId:o,cookie:e.req.header(`cookie`),create:!0,passkey:!0,sessionId:i.session.id,single:t.single,userId:i.user.id}),`KeySigner.resolve`);if(u instanceof JF){let e=u.response.meta?.account;return new JF({account:e,description:`Passkey required: the passkey of Tempo Account ${e} signs only at its own relying party, which the approval page is not part of. Name another account, or deny the request.`})}if(u instanceof MN)return u;let d=n&&u.owner.credential?.id===n.assertion.id?n:void 0,f=d?{...a,witness:d.witness}:a,p=d?.assertion??t.assertion;if(t.assertion&&u.owner.signer)return new gL;if(!p&&!u.owner.signer)return{options:await Z(e,X6(e,{account:u.account,clientId:o,key:f,owner:u.owner,userId:i.user.id}),`KeySigner.challenge`)};d&&await Z(e,kL($,{account:u.account,clientId:o,credential:u.owner.credential,digest:mI({key:f}),userId:i.user.id}),`Passkey.requestSignature`);let m=await Z(e,$6(e,{account:u.account,assertion:u.owner.signer?void 0:p,clientId:o,key:f,owner:u.owner,userId:i.user.id}),`KeySigner.sign`);return m instanceof MN?m:{account:u.account,clientId:o,codeChallenge:s,expiry:f.expiry,signed:m}}async function o8(e,t){return await Z(e,l8(e,t),`SignInConsent.accountStep`).catch(n=>(wN(e,{error:n,message:`An account step kept its redirect, since its grant failed.`}),t.redirect))}async function s8(e,t){return await Z(e,f8(e,t),`SignInConsent.signIn`).catch(n=>(wN(e,{error:n,message:`A sign-in kept its redirect, since its grant failed.`}),t.redirect))}async function c8(e,t){let n=new URLSearchParams(t.oauthQuery);if(!n.has(`key_authorization`)||n.has(`challenge`))return;let r=await Z(e,e.var.auth.$context,`auth.context`);if(!await Z(e,Ar(t.oauthQuery,r.secret),`auth.verifyOAuthQueryParams`))return;let i=jI(n);if(!i||i instanceof MN)return;let a=ya(crypto.getRandomValues(new Uint8Array(32)));return{digest:mI({key:{...i,witness:a}}),witness:a}}async function l8(e,t){let{account:n,headers:r,redirect:i,session:a}=t,o=URL.parse(i,Sb.URL);if(!o||o.origin!==new URL(Sb.URL).origin||o.pathname!==`/authorize`||o.searchParams.has(`challenge`))return i;let s=await Z(e,q6($,{query:o.searchParams,sessionId:a.session.id}),`SignInGrant.take`);return s?await u8(e,{account:n,headers:r,oneTap:(()=>{let e=xL.assertion.safeParse(s.assertion);if(e.success&&s.witness)return{assertion:e.data,witness:s.witness}})(),redirect:i,session:a,url:o}):i}async function u8(e,t){let{headers:n,redirect:r,session:i,url:a}=t;if(await Z(e,gz(e,{limits:[{binding:`AUTHORIZE_LIMIT`,key:i.user.id}]}),`RateLimit.check`))return r;let o=await Z(e,n8(e,{account:t.account,headers:n,oauthQuery:a.search.slice(1),oneTap:t.oneTap,session:i,single:!0}),`Consent.approve`).catch(t=>{wN(e,{error:t,message:`A sign-in could not grant the key that the sign-in page showed.`})});return!o||o instanceof MN||`options`in o?r:o.redirect}function d8(e,t){let n=new Map((e.req.header(`cookie`)??``).split(`;`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.indexOf(`=`);return[e.slice(0,t),e.slice(t+1)]}));for(let e of t.setCookie){let[t=``]=e.split(`;`),r=t.indexOf(`=`);r>0&&n.set(t.slice(0,r).trim(),t.slice(r+1))}let r=new Headers(e.req.raw.headers);return r.set(`cookie`,[...n].map(([e,t])=>`${e}=${t}`).join(`; `)),r}async function f8(e,t){let{oneTap:n,redirect:r,setCookie:i}=t,a=URL.parse(r,Sb.URL);if(!a||a.origin!==new URL(Sb.URL).origin||a.pathname!==`/authorize`&&a.pathname!==`/choose-account`)return r;let o=a.searchParams;if(!o.has(`key_authorization`)||o.has(`challenge`))return r;let s=d8(e,{setCookie:i}),c=await Z(e,e.var.auth.api.getSession({headers:s}),`auth.getSession`);return!c||!await Z(e,K6($,{query:o}),`SignInGrant.spend`)?r:a.pathname===`/choose-account`?(await Z(e,W6($,{oneTap:n,query:o,sessionId:c.session.id}),`SignInGrant.hold`),r):await u8(e,{headers:s,oneTap:n,redirect:r,session:c,url:a})}var p8=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,m8;(function(e){let t;(function(e){e.json=B({email:z().trim().toLowerCase().pipe(Zt({abort:!0}).max(254,{abort:!0,error:`Invalid email address`}).refine(e=>{let[t=``,n=``]=e.split(`@`);return t.length<=64&&n.split(`.`).every(e=>p8.test(e))},`Invalid email address`)).meta({description:`The user's email address.`,examples:[`ada@example.com`]})}),e.response=B({sent:Ut(!0).meta({description:`The request is accepted. The value is the same for every address.`})})})(t||=e.code||={});let n;(function(e){e.json=B({assertion:xL.assertion.optional().meta({description:"The assertion of the email step's passkey, over a challenge from `POST /v1/auth/passkey/options` with `link`. Required with `link`, since only the person who holds the passkey can link it."}),code:z().trim().regex(/^\d{6}$/).meta({description:`The six-digit emailed code.`,examples:[`123456`]}),email:t.json.shape.email,link:z().max(64).optional().meta({description:"The email step's `link`, which links the wallet.tempo passkey that asked for it to this user, with that passkey's `assertion`. An expired link refuses the sign-in with `passkey_link_expired`, and the code stays valid.",examples:[`dGhlIG5vbmNlIHRoYXQgdGhlIHN0ZXAgY2Fycmllcw`]}),oauth_query:z().max(8192).optional().meta({description:`The sign-in page's query string when an app's authorization request sent the browser there, which the sign-in continues. Better Auth signs it. At most 8,192 characters.`,examples:[`client_id=client_01JZ8Q6W3N1R5B4V7C2X9K0M3T&response_type=code&exp=1760000000&sig=Gx3kB0`]})}).refine(e=>!e.link||e.assertion,{message:"Required with `link`.",path:[`assertion`]});let n=e.user=B({email:Zt().meta({description:`The user's email address.`,examples:[`ada@example.com`]}),id:z().meta({description:"The user's ID, which is the `sub` of every token Tempo ID issues for the user.",examples:[`user_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]})}).meta({description:`The signed-in user.`,id:`User`});e.response=B({redirect:Yt().nullable().meta({description:"Where the browser continues: the app's `redirect_uri` with an authorization code, or `null` for a sign-in that no app waits on.",examples:[`https://app.example.com/callback?code=SplxlOBeZQQYbYS6WxSbIA`]}),user:n}),e.signedIn=zt([B({url:z()}),B({user:B({email:z(),id:z()})})])})(n||=e.verify||={});let r;(function(e){e.json=B({client_id:z().min(1).max(64).optional().meta({description:"The client ID of the first-party app whose page runs the ceremony. It selects the app's realms, and the request's `Origin` must be the origin of one of the app's redirect URIs. Required from an app's page.",examples:[`client_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]}),credentialId:zt([xL.credentialId,en(xL.credentialId).max(16)]).optional().meta({description:"The credential ID, or up to 16 IDs, that the browser offers as `allowCredentials`, base64url. Defaults to every discoverable passkey of the relying party, as an empty list does.",examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),link:n.json.shape.link.meta({description:"The email step's `link`. The options then name only that step's passkey, at its relying party, in place of `credentialId`. The emailed-code sign-in sends the passkey's assertion with the `link`.",examples:[`dGhlIG5vbmNlIHRoYXQgdGhlIHN0ZXAgY2Fycmllcw`]}),mediation:Wt([`conditional`,`optional`,`required`,`silent`]).optional().meta({description:"Returned in the options for `navigator.credentials.get()`, such as `conditional` for passkey autofill.",examples:[`conditional`]}),oauth_query:n.json.shape.oauth_query,user_code:z().max(32).optional().meta({description:"The user code of the device grant that the sign-in returns to. While the code is pending and bound to no user, it selects the realms of the app that requested it. Any other code selects the `default` realm. Ignored with `oauth_query` or `client_id`.",examples:[`WDJB-MJHT`]})}),e.response=B({options:B({mediation:r.json.shape.mediation,publicKey:B({allowCredentials:en(B({id:z().meta({description:`A credential ID, base64url.`,examples:[`KEbWNCc7NgaYnUyrNeFGX9_3Y-8`]}),type:Ut(`public-key`).meta({description:`The credential type.`})}).meta({description:`A passkey the browser offers.`})).optional().meta({description:"The passkeys the browser offers, from `credentialId`. Absent, it offers every discoverable passkey of the relying party."}),challenge:Bt([`0x`,z()]).meta({description:`The single-use challenge, as hex. It expires after 5 minutes.`,examples:[`0xf6310589abb21116acc6e123967ed0a125b5041c43f8e157237093e07eaa354c`]}),rpId:z().meta({description:`The relying party ID of the passkeys.`,examples:[`tempo.xyz`]}),userVerification:Ut(`required`).meta({description:`Every passkey sign-in requires user verification.`})}).meta({description:"The `PublicKeyCredentialRequestOptions`, serialized with the challenge as hex."})}).meta({description:"The options for `navigator.credentials.get()`."})})})(r||=e.passkeyOptions||={});let i;(function(e){e.json=B({assertion:xL.assertion,oauth_query:n.json.shape.oauth_query}),e.response=zt([n.response.meta({description:`The signed-in user.`}),B({step:B({link:z().meta({description:"Send as `link` with the emailed-code sign-in, which links the passkey to that user.",examples:[`dGhlIG5vbmNlIHRoYXQgdGhlIHN0ZXAgY2Fycmllcw`]}),signed:Ut(!1).meta({description:`Whether the assertion already signed a key authorization. This route signs none.`}),type:Ut(`email`).meta({description:`Sign in with an emailed code, which links the passkey to that user.`})}).meta({description:`The email step, for a wallet.tempo passkey whose account has no email.`})}).meta({description:`A passkey sign-in that continues when the user verifies an email address.`})])})(i||=e.passkeyVerify||={});let a;(function(e){e.response=B({signed_out:Ut(!0).meta({description:`The session is over, or there was none.`})})})(a||=e.logout||={});let o;(function(e){e.response=B({user:n.user.extend({name:z().nullable().meta({description:"The user's name, or `null` for a user who signed up without one.",examples:[`Ada Lovelace`]})}).nullable().meta({description:"The signed-in user, or `null` without a session.",id:`SessionUser`})})})(o||=e.session||={});let s;(function(e){e.query=B({oauth_query:n.json.shape.oauth_query,return_to:z().max(2048).optional().meta({description:`The page that sign-in returns to, from the sign-in page's query. Only a path on the device page passes, and any other value reads as absent.`,examples:[`/device?code=WDJB-MJHT`]})}),e.response=B({google:Xt().meta({description:`Whether Tempo ID offers Google sign-in, which the deployment configures.`,examples:[!0]}),passkeys:Xt().meta({description:"Whether Tempo ID offers passkey sign-in: one of the realms of the app that `oauth_query` or the device code of `return_to` names, or the `default` realm without one, holds passkeys that sign in at Tempo ID's origin.",examples:[!0]}),request:B({app:z().meta({description:`The app's display name, or its client ID without one.`,examples:[`Tempo Cash`]}),key:tI.description}).nullable().meta({description:"The app and the key of the signed authorization request in `oauth_query`, which the sign-in grants, or `null` for a forged or expired query, an unknown app, a request without a key, or a key with a `challenge`, which the approval page shows instead."}),return_to:z().nullable().meta({description:"The page that sign-in returns to, a path on the device page, or `null` for the account.",examples:[`/device?code=WDJB-MJHT`]}),user_code:z().nullable().meta({description:"The user code of the device page that sign-in returns to, or `null` without one.",examples:[`WDJBMJHT`]})})})(s||=e.methods||={})})(m8||={});var h8=new Hy().post(`/v1/auth/code`,QR({description:`Emails a sign-in code. The response is the same for every address, so it reveals no account.`,responses:sz({errors:[...nR,...p6.errors,...cz.errors,...gz.errors,PN,zN],success:{description:`The response for every address: the email service accepted the code, or does not deliver to the address.`,schema:m8.code.response}}),tags:[`Authenticate`]}),cz(`json`,m8.code.json),async e=>{let{email:t}=e.req.valid(`json`),n=await Z(e,gz(e,{limits:[{binding:`SIGN_IN_IP_LIMIT`,key:bz(e)},{binding:`SIGN_IN_CODE_LIMIT`,key:vz({email:t})}]}),`RateLimit.check`);if(n)return n;let r=await Z(e,e.var.auth.api.createVerificationOTP({body:{email:t,type:`sign-in`}}),`auth.createVerificationOTP`),i=await Z(e,p6(e,{code:r,email:t.toLowerCase()}),`Auth.sendCode`).catch(e=>e);return i&&(wN(e,{error:i,message:`The email service refused a sign-in code.`}),!(i instanceof l6))?X(e,i instanceof IN?i:new zN):e.json({sent:!0},200)}).post(`/v1/auth/code/verify`,QR({description:"Signs in with an emailed code, and sets the session cookie. For a user with no Tempo Account in the realm of the sign-in, the first realm of the app that `oauth_query` names or the `default` realm, it creates one when the realm creates accounts. A failed creation leaves the sign-in signed in, and the next sign-in or `POST /v1/account` creates the account.",responses:sz({errors:[...nR,...k6.errors,...cz.errors,...gz.errors,IL,LL,mL,gL],success:{description:`The signed-in user.`,schema:m8.verify.response}}),tags:[`Authenticate`]}),cz(`json`,m8.verify.json),async e=>{let{assertion:t,code:n,email:r,link:i,oauth_query:a}=e.req.valid(`json`),o=k6(e,{oauth_query:a});if(o)return X(e,o);let s=await Z(e,gz(e,{limits:[{binding:`SIGN_IN_IP_LIMIT`,key:bz(e)}]}),`RateLimit.check`);if(s)return s;let c=i?await Z(e,P6(e,{nonce:i}),`PasskeyLink.claim`):void 0;if(i&&!c)return X(e,new mL);if(c){let n=t?await Z(e,jL($,{clientDataJSON:t.metadata.clientDataJSON}),`Passkey.take`):void 0,r=n&&i?await Z(e,L6({expected:n.link,nonce:i}),`PasskeyLink.matches`):!1;if(!t||!n||!r||n.clientId!==g8({oauth_query:a})||n.origin!==E6(e)||n.rpId!==c.rpId||t.id!==c.id||!FL(t,{challenge:n.challenge,origin:n.origin??new URL(Sb.URL).origin,publicKey:c.publicKey,rpId:c.rpId}))return X(e,new gL)}let l=await Z(e,e.var.auth.api.signInEmailOTP({asResponse:!1,body:{email:r,otp:n,...a?{oauth_query:a}:{}},headers:new Headers(e.req.raw.headers),request:e.req.raw,returnHeaders:!0}),`auth.signInEmailOTP`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;if(fn(e))return new LL;throw e});if(l instanceof MN)return X(e,l);for(let t of l.headers.getSetCookie())e.header(`set-cookie`,t,{append:!0});e.header(`cache-control`,`private, no-store`);let u=m8.verify.signedIn.parse(l.response),d=await(async()=>{if(`user`in u)return{email:u.user.email,id:u.user.id};let t=await Z(e,(await Z(e,e.var.auth.$context,`auth.context`)).internalAdapter.findUserByEmail(r),`db.user.findByEmail`);if(!t)throw Error(`The signed-in user is missing.`);return{email:t.user.email,id:t.user.id}})();c&&await Z(e,TL($,{credential:c,id:c.id,rpId:c.rpId,userId:d.id}),`Passkey.link`)===d.id&&R6(e),await Z(e,j6(e,{clientId:g8({oauth_query:a}),userId:d.id}),`FirstAccount.create`);let f=`user`in u?null:await Z(e,s8(e,{redirect:u.url,setCookie:l.headers.getSetCookie()}),`SignInConsent.afterSignIn`);return e.json({redirect:f,user:d},200)}).post(`/v1/auth/passkey/options`,QR({description:"Issues a single-use challenge, and returns request options for the passkeys of the relying party that the sign-in reaches. Without `oauth_query` or `client_id`, that is the relying party of the `default` realm. With either, it is the first of the app's realms that holds passkeys. From a first-party app's page, with `client_id`, the relying party must cover the page's origin and Tempo ID's, and only that page's assertion spends the challenge. With `link`, the options name only the email step's passkey.",responses:sz({errors:[...nR,...k6.errors,...cz.errors,...CL.errors,...gz.errors,mL,hL],success:{description:`The request options.`,schema:m8.passkeyOptions.response}}),tags:[`Authenticate`]}),cz(`json`,m8.passkeyOptions.json),async e=>{let{client_id:t,credentialId:n,link:r,mediation:i,oauth_query:a,user_code:o}=e.req.valid(`json`),s=k6(e,{oauth_query:a});if(s)return X(e,s);let c=bz(e),l=await Z(e,gz(e,{limits:[{binding:`SIGN_IN_IP_LIMIT`,key:c?`passkey-options:${c}`:void 0}]}),`RateLimit.check`);if(l)return l;let u=r?await Z(e,P6(e,{nonce:r}),`PasskeyLink.claim`):void 0;if(r&&!u)return X(e,new mL);let d=E6(e);if(d||t){let n=t?await Z(e,uN($,{clientId:t,enabled:!0}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`):void 0,r=CL({app:n,clientId:t,origin:e.req.header(`origin`)});if(r)return X(e,r)}let f=g8({oauth_query:a}),p=o?QI(o):void 0,m=!f&&!t&&p?await Z(e,GI($,{userCode:p}),`Device.client`):void 0,h=f??t??m,g=h?await Z(e,pB($,{clientId:h}),`Realm.forApp`):[await Z(e,gB($,{id:dB}),`Realm.get`)],_=OL(await Z(e,vB($,{origin:Sb.URL,realms:g}),`Realm.withDefaults`),{origin:Sb.URL,page:d}),v=u&&(_?.realmId!=="default"||_.rpId!==u.rpId);if(!_||v)return X(e,new hL({clientId:(f??t)||void 0,origin:d}));let y=await Z(e,SL($,{clientId:f,link:r?await Z(e,I6({nonce:r}),`PasskeyLink.digest`):void 0,oneTap:a&&!r&&!d?await Z(e,c8(e,{oauthQuery:a}),`SignInConsent.oneTap`):void 0,origin:d,..._}),`Passkey.challenge`),b=u?[u.id]:n===void 0?[]:[n].flat(),x=m8.passkeyOptions.response.shape.options.parse({...cL({challenge:y,...b.length>0?{credentialId:b}:{},rpId:_.rpId,userVerification:`required`}).options,...i?{mediation:i}:{}});return e.header(`cache-control`,`private, no-store`),e.json({options:x},200)}).post(`/v1/auth/passkey/verify`,QR({description:"Signs in with a passkey assertion over a challenge from the options, sent from the page that requested them, and sets the session cookie. For a user with no Tempo Account in the realm of the sign-in, the first realm of the app that `oauth_query` names or the `default` realm, it creates one when the realm creates accounts. A failed creation leaves the sign-in signed in, and the next sign-in or `POST /v1/account` creates the account.",responses:sz({errors:[...nR,...k6.errors,...cz.errors,...HN.errors,...gz.errors,IL,gL],success:{description:`The signed-in user, or the email step for a wallet.tempo passkey without an email.`,schema:m8.passkeyVerify.response}}),tags:[`Authenticate`]}),cz(`json`,m8.passkeyVerify.json),async e=>{let{assertion:t,oauth_query:n}=e.req.valid(`json`),r=k6(e,{oauth_query:n});if(r)return X(e,r);let i=await Z(e,gz(e,{limits:[{binding:`SIGN_IN_IP_LIMIT`,key:bz(e)}]}),`RateLimit.check`);if(i)return i;let a=await Z(e,jL($,{clientDataJSON:t.metadata.clientDataJSON}),`Passkey.take`);if(!a||a.link!==void 0||a.clientId!==g8({oauth_query:n})||a.origin!==E6(e))return X(e,new gL);let{id:o}=t,s=await Z(e,wL($,{id:o,rpId:a.rpId}),`Passkey.get`),c=await(async()=>{if(!s&&e.env.WALLET&&a.realmId==="default")try{return await Z(e,r2(e.env.WALLET,{id:o}),`Wallet.credential`)}catch(t){return wN(e,{error:t,message:`The wallet service failed a passkey lookup.`}),t instanceof Error&&HN(t)||new zN}})();if(c instanceof MN)return X(e,c);let l=s?.publicKey??c?.publicKey;if(!l||!FL(t,{challenge:a.challenge,origin:a.origin??new URL(Sb.URL).origin,publicKey:l,rpId:a.rpId}))return X(e,new gL);if(c&&!c.email){let t=await Z(e,F6(e,{credential:c,id:o,rpId:a.rpId}),`PasskeyLink.defer`);return e.header(`cache-control`,`private, no-store`),e.json({step:{link:t,signed:!1,type:`email`}},200)}let u=await(async()=>{if(s)return s.userId;let t=await Z(e,_8(e,{email:c.email}),`authenticate.emailUser`);return Z(e,TL($,{credential:c,id:o,rpId:a.rpId,userId:t}),`Passkey.link`)})();if(!u)return X(e,new gL);let d=await Z(e,e.var.auth.api.signInPasskey({asResponse:!1,body:{userId:u,...n?{oauth_query:n}:{}},headers:new Headers(e.req.raw.headers),request:e.req.raw,returnHeaders:!0}),`auth.signInPasskey`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;throw e});if(d instanceof MN)return X(e,d);for(let t of d.headers.getSetCookie())e.header(`set-cookie`,t,{append:!0});e.header(`cache-control`,`private, no-store`);let f=m8.verify.signedIn.parse(d.response);if(await Z(e,j6(e,{clientId:g8({oauth_query:n}),userId:u}),`FirstAccount.create`),`user`in f){let{user:t}=f;return e.json({redirect:null,user:{email:t.email,id:t.id}},200)}let[p]=await Z(e,$.select({email:uM.email,id:uM.id}).from(uM).where(Y(uM.id,u)),`db.user.get`);if(!p)throw Error(`The signed-in user is missing.`);let m=await Z(e,s8(e,{oneTap:a.witness?{assertion:t,witness:a.witness}:void 0,redirect:f.url,setCookie:d.headers.getSetCookie()}),`SignInConsent.afterSignIn`);return e.json({redirect:m,user:p},200)}).post(`/v1/auth/logout`,QR({description:`Signs out: ends the session, revokes the refresh tokens that apps received through it, and clears its cookie.`,responses:sz({errors:[...nR,PN],success:{description:`The session is over.`,schema:m8.logout.response}}),tags:[`Authenticate`]}),async e=>{let t=e.req.raw.headers,n=await Z(e,e.var.auth.api.getSession({headers:t}),`auth.getSession`);n&&await Z(e,$.update(iM).set({revoked:new Date}).where(tA(Y(iM.sessionId,n.session.id),uA(iM.revoked))),`db.oauthRefreshToken.revoke`);let r=await Z(e,e.var.auth.api.signOut({headers:t,returnHeaders:!0}),`auth.signOut`);for(let t of r.headers.getSetCookie())e.header(`set-cookie`,t,{append:!0});return e.header(`set-cookie`,H0(),{append:!0}),e.header(`cache-control`,`private, no-store`),e.json({signed_out:!0},200)}).get(`/v1/auth/session`,QR({description:"Reads the signed-in user, or `null` without a session.",responses:sz({success:{description:`The session.`,schema:m8.session.response}}),tags:[`Authenticate`]}),async e=>{let t=await Z(e,$0(e),`Session.get`);return e.header(`cache-control`,`private, no-store`),t?e.json({user:{email:t.user.email,id:t.user.id,name:t.user.name||null}},200):e.json({user:null},200)}).get(`/v1/auth/methods`,QR({description:"Reads the sign-in methods that the sign-in page offers, the key that a signed authorization request in `oauth_query` grants, and the page that sign-in returns to. A device code in `return_to` names the app that requested it, while the code is pending and bound to no user. The read binds nothing, and counts against the IP address's sign-in limit. Without `oauth_query`, a client ID reads the `default` realm, as the other sign-in routes do.",responses:sz({errors:[...cz.errors],success:{description:`The sign-in methods.`,schema:m8.methods.response}}),tags:[`Authenticate`]}),cz(`query`,m8.methods.query),async e=>{let t=e.req.valid(`query`),n=eL(t.return_to,{origin:Sb.URL}),r=(()=>{if(!t.oauth_query)return;let e=new URLSearchParams(t.oauth_query);return e.delete(`error`),e.has(`sig`)?e:void 0})(),i=n?QI(new URL(n,Sb.URL).searchParams.get(`code`)??``):void 0,a=await(async()=>{if(r)return r.get(`client_id`)??void 0;if(!i)return;let t=bz(e);if(t&&(await Z(e,e.env.SIGN_IN_IP_LIMIT.limit({key:`device-lookup:${t}`}),`ratelimit.limit`)).success)return await Z(e,GI($,{userCode:i}),`Device.client`)})(),o=a?await Z(e,pB($,{clientId:a}),`Realm.forApp`):[await Z(e,gB($,{id:dB}),`Realm.get`)],s=await Z(e,vB($,{origin:Sb.URL,realms:o}),`Realm.withDefaults`),c=r?await Z(e,v8(e,{query:r}),`authenticate.granted`):null;return e.json({google:!!f6(),passkeys:!!OL(s,{origin:Sb.URL}),request:c,return_to:n??null,user_code:i||null},200)});function g8(e){return e.oauth_query?new URLSearchParams(e.oauth_query).get(`client_id`):null}async function _8(e,t){let n=t.email.trim().toLowerCase(),r=await Z(e,e.var.auth.$context,`auth.context`),i=await Z(e,r.internalAdapter.findUserByEmail(n),`db.user.findByEmail`);if(i)return i.user.id;try{return(await Z(e,r.internalAdapter.createUser({email:n,emailVerified:!0,name:``},{method:`passkey`}),`db.user.create`)).id}catch(t){let i=await Z(e,r.internalAdapter.findUserByEmail(n),`db.user.findByEmail`);if(i)return i.user.id;throw t}}async function v8(e,t){let{query:n}=t;if(!n.has(`key_authorization`)||n.has(`challenge`))return null;let r=await Z(e,e.var.auth.$context,`auth.context`),i=await Z(e,Ar(n.toString(),r.secret),`auth.verifyOAuthQueryParams`),a=n.get(`client_id`);if(!i||!a)return null;let o=await Z(e,uN($,{clientId:a}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`),s=jI(n);return!o||!s||s instanceof MN?null:{app:o.name??a,key:pI(s)}}var y8;(function(e){let t;(function(e){e.json=OI.request,e.response=OI.response,e.redirect=B({url:z().min(1)})})(t||=e.authorize||={});let n;(function(e){e.json=B({account:r1.tempoAccount.shape.address.meta({description:`The address of the account that the user selects, one of the user's accounts in the app's realms.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),oauth_query:z().min(1).max(8192).meta({description:`The account step's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.`,examples:[`client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0`]})}),e.response=B({redirect:z().meta({description:"Where the browser continues: the approval page's path on Tempo ID, or the app's `redirect_uri` with an authorization code and `state`.",examples:[`https://app.example.com/callback?code=Vb7mQ2xLkP9sTzR4&state=af0ifjsldkj`]})}),e.result=B({url:z().min(1)})})(n||=e.account||={});let r;(function(e){e.json=B({accept:Xt().meta({description:"Whether the user approves the request. `false` denies it, and the app receives `access_denied`.",examples:[!0]}),account:r1.tempoAccount.shape.address.optional().meta({description:`The Tempo Account that the approval page showed for the request's key authorization, one of the user's accounts in the app's realms. Ignored when the key names its account, and absent for a request without a key.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),oauth_query:z().min(1).max(8192).meta({description:`The approval page's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.`,examples:[`client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0`]}),passkey:B({assertion:xL.assertion}).optional().meta({description:`The passkey's assertion over the options of the passkey step, which a passkey-owned account's approval returns. The repeated approval signs the key with it.`}),session_id:z().min(1).max(256).meta({description:`The ID of the session that the approval page showed. The decision applies only while that session is the signed-in one.`,examples:[`8nVq3kZ0bT5wXy2mLp7sR4dA`]})});let t=e.step=xL.step;e.response=zt([B({redirect:Yt().meta({description:"The app's `redirect_uri`, with an authorization code and `state`, or with `error=access_denied` when the user denied the request.",examples:[`https://app.example.com/callback?code=Vb7mQ2xLkP9sTzR4&state=af0ifjsldkj`]})}).meta({description:`A decision that returns to the app.`}),t])})(r||=e.consent||={});let i;(function(e){e.query=B({oauth_query:z().min(1).max(8192).meta({description:`The approval page's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.`,examples:[`client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0`]})}),e.response=zt([B({redirect:Yt().meta({description:"The app's `redirect_uri`, with the refusal of the request's key as `error` and `error_description`, `state`, and `iss`.",examples:[`https://app.example.com/callback?error=invalid_request&state=af0ifjsldkj`]})}).meta({description:`A key that Tempo ID refuses, which returns the browser to the app.`}),B({request:B({app:z().meta({description:`The app's display name, or the host of its redirect URI without one.`,examples:[`Tempo Cash`]}),destination:z().meta({description:`The host of the app's redirect URI, or its scheme for a native app.`,examples:[`cash.tempo.xyz`]}),email:Zt().meta({description:`The signed-in user's email address.`,examples:[`ada@example.com`]}),key:tI.description.extend({challenge:z().optional().meta({description:`The message that the key's witness binds, such as a sign-in challenge from the app. Absent when the request carries none.`,examples:[`Sign in to app.example.com
|
|
571
|
+
Nonce: 7f3a9c2e5b1d4f60`]}),refusal:Y6.refusal.exclude([`foreign_account`]).optional().meta({description:"Why approval cannot sign the key: the user holds no account and none can be created (`no_account`), a passkey that this page cannot use owns the account (`passkey`), or the accounts could not be read (`unavailable`). Absent when approval can sign it.",examples:[`passkey`]})}).optional().meta({description:`What the key that the request carries may do, and the account that approval signs for. Absent for a request without a key.`}),session:z().meta({description:"The ID of the signed-in session, which `POST /v1/authorize/consent` names.",examples:[`8nVq3kZ0bT5wXy2mLp7sR4dA`]})}).nullable().meta({description:"The request that the approval page shows, or `null` for a forged or expired query, or a request without a known app."})}).meta({description:`The request that the approval page shows.`})])})(i||=e.request||={});let a;(function(e){e.query=i.query,e.response=B({request:B({accounts:en(B({address:r1.tempoAccount.shape.address.meta({description:`The account address.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),balance:YL.balance.nullable().meta({description:"The account's holdings of USD tokens on the chain of the request's key, or of Tempo mainnet without one. `null` when the read fails or takes longer than 3 seconds."}),owner:r1.tempoAccount.shape.config.shape.owners.unwrap().element.shape.type,realm:z().nullable().meta({description:"The name of the account's realm, or `null` for the `default` realm.",examples:[`Tempo Cash`]})})).readonly().meta({description:`The user's accounts in the app's realms, oldest first.`}),app:z().meta({description:`The app's display name.`,examples:[`Tempo Cash`]})}).nullable().meta({description:"The account step, or `null` for a forged or expired query, or a request without a known app."})})})(a||=e.accounts||={})})(y8||={});var b8=new Hy().post(`/v1/authorize`,QR({description:"Authorizes the app for the signed-in user without a redirect. Only a first-party app's page on the redirect URI's origin calls it. A native app authorizes through `/oauth2/authorize` instead. With `code_challenge`, the app's backend receives a code. Without one, a public app receives tokens. A key authorization is signed by the account's owner, and must fit the headless ceiling. The account becomes the app's account for its later requests.",responses:sz({errors:[...kI.errors,...q0.errors,...nR,...cz.errors,...gz.errors,zL,PN,JF,t1],success:{description:`The authorization.`,schema:y8.authorize.response}}),security:[{sessionCookie:[]}],tags:[`Authorization`]}),cz(`json`,y8.authorize.json),async e=>{let t=e.req.valid(`json`),n=t.client_id,r=await Z(e,uN($,{clientId:n}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`),i=kI(t,{app:r,origin:e.req.header(`origin`)});if(i)return X(e,i);let a=await Z(e,$0(e),`Session.get`);if(!a)return X(e,new zL);if(!t.code_challenge&&r.secret)return X(e,new DI({description:"Tokens refused: the app holds a client secret, so its backend redeems a code. Send `code_challenge`, then redeem the code with the secret."}));let o=await Z(e,gz(e,{limits:[{binding:`AUTHORIZE_LIMIT`,key:a.user.id}]}),`RateLimit.check`);if(o)return o;let s=t.key_authorization,c=s?await Z(e,Q6(e,{account:s.account,clientId:n,cookie:e.req.header(`cookie`),sessionId:a.session.id,userId:a.user.id}),`KeySigner.resolve`):void 0;if(c instanceof MN)return X(e,c);let l=await(async()=>{if(c)return c.account;let t=await Z(e,V0(e,{clientId:n,userId:a.user.id}),`AccountStep.accounts`).catch(t=>(wN(e,{error:t,fields:{clientId:n},message:`The headless authorization skipped an account selection whose accounts failed to load.`}),[]));return K0(t,X0({clientId:n,cookie:e.req.header(`cookie`),sessionId:a.session.id}))?.address??t[0]?.address})(),u=l?Y0({account:l.toLowerCase(),clientId:n,cookie:e.req.header(`cookie`),sessionId:a.session.id}):void 0,f=new Headers(e.req.raw.headers);u&&f.set(`cookie`,u.header),e.set(`accountChosen`,!0);let p=t.code_challenge?void 0:d(Ma(32),x8),m={client_id:n,code_challenge:t.code_challenge??d(v(Ea(p)),x8),code_challenge_method:`S256`,redirect_uri:t.redirect_uri,resource:Sb.URL,response_type:`code`,scope:t.scope??`openid`,...t.state?{state:t.state}:{}},h=new URL(`/oauth2/authorize`,Sb.URL);h.search=new URLSearchParams(m).toString(),f.set(`accept`,`application/json`);let g=await Z(e,e.var.auth.api.oauth2Authorize({asResponse:!1,body:{},headers:f,query:m,request:new Request(h,{headers:f})}),`auth.oauth2Authorize`),_=y8.authorize.redirect.safeParse(g),y=_.success?URL.parse(_.data.url,Sb.URL):null,b=new URL(t.redirect_uri).searchParams,x=y?.searchParams.get(`code`);if(!y||!x||y.searchParams.getAll(`error`).length>b.getAll(`error`).length||!`${y.origin}${y.pathname}`.startsWith(new URL(t.redirect_uri).origin))return X(e,new DI({description:`Authorization refused: the app's request needs the user's approval, which no page shows here. Authorize through a redirect, or register the app to skip consent.`}));let S=s&&c?await Z(e,$6(e,{account:c.account,clientId:n,key:s,owner:c.owner,userId:a.user.id}),`KeySigner.sign`):void 0;if(S instanceof MN)return X(e,S);let C={...l&&S?{account:l,key_authorization:S}:{},...t.state?{state:t.state}:{}};if(u&&s?.account&&e.header(`set-cookie`,u.setCookie,{append:!0}),e.header(`cache-control`,`no-store`),!p)return e.json({...C,code:x},200);let w=await Z(e,e.var.auth.api.oauth2Token({body:{client_id:n,code:x,code_verifier:p,grant_type:`authorization_code`,redirect_uri:t.redirect_uri,resource:Sb.URL},headers:new Headers({"content-type":`application/x-www-form-urlencoded`})}),`auth.oauth2Token`);return e.json({...C,tokens:OI.tokens.parse(w)},200)}).post(`/v1/authorize/account`,QR({description:"Selects the account that the app of `oauth_query` uses, then continues its authorization, and returns the next redirect. The selection holds for the app's later authorizations in the same session, and `GET /v1/account` lists it first.",responses:sz({errors:[...nR,...k6.errors,...cz.errors,...V0.errors,...gz.errors,IL,zL,t1],success:{description:`The next redirect.`,schema:y8.account.response}}),security:[{sessionCookie:[]}],tags:[`Authorization`]}),cz(`json`,y8.account.json),async e=>{let{account:t,oauth_query:n}=e.req.valid(`json`),r=k6(e,{oauth_query:n});if(r)return X(e,r);let i=await Z(e,$0(e),`Session.get`);if(!i)return X(e,new zL);let a=await Z(e,gz(e,{limits:[{binding:`ACCOUNT_LIMIT`,key:i.user.id}]}),`RateLimit.check`);if(a)return a;let o=await Z(e,e.var.auth.$context,`auth.context`),s=await Z(e,Ar(n,o.secret),`auth.verifyOAuthQueryParams`),c=new URLSearchParams(n),l=c.get(`client_id`);if(!s||!l)return X(e,new IL);if(i8(c),!K0(await Z(e,V0(e,{clientId:l,userId:i.user.id}),`AccountStep.accounts`),t))return X(e,new t1({account:t}));let u=Y0({account:t.toLowerCase(),clientId:l,cookie:e.req.header(`cookie`),sessionId:i.session.id}),d=new Headers(e.req.raw.headers);d.set(`cookie`,u.header);let f=await Z(e,e.var.auth.api.oauth2Continue({asResponse:!1,body:{oauth_query:n,postLogin:!0},headers:d,request:new Request(e.req.url,{headers:d,method:`POST`})}),`auth.oauth2Continue`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;throw e});if(f instanceof MN)return X(e,f);let p=await Z(e,o8(e,{account:t,headers:d,redirect:y8.account.result.parse(f).url,session:i}),`SignInConsent.afterAccountStep`);return e.header(`set-cookie`,u.setCookie,{append:!0}),e.header(`cache-control`,`private, no-store`),e.json({redirect:p},200)}).post(`/v1/authorize/consent`,QR({description:"Records the signed-in user's decision on the app's authorization request that `oauth_query` carries, and returns the app's redirect. The decision applies only while `session_id` names the signed-in session. An approval stores the consent, so the app's next request with the same scopes skips the approval page. An approval of a request with a key authorization signs the key as the account's owner, and the first redemption of the code returns it from `/oauth2/token`. For a passkey-owned account, the approval first returns the passkey step, and the repeated approval with `passkey` signs the key. A user who holds no account in the app's realms, and whose key names none, first receives a Privy-owned account, as `POST /v1/account` creates it.",responses:sz({errors:[...AI.errors,...nR,...k6.errors,...Q6.errors,...$6.errors,...cz.errors,...gz.errors,DI,IL,RL,zL,wI],success:{description:`The app's redirect, or the passkey step.`,schema:y8.consent.response}}),security:[{sessionCookie:[]}],tags:[`Authorization`]}),cz(`json`,y8.consent.json),async e=>{let{accept:t,account:n,oauth_query:r,passkey:i,session_id:a}=e.req.valid(`json`),o=k6(e,{oauth_query:r});if(o)return X(e,o);let s=await Z(e,$0(e),`Session.get`);if(!s)return X(e,new zL);if(s.session.id!==a)return X(e,new RL);let c=await Z(e,e.var.auth.$context,`auth.context`);if(!await Z(e,Ar(r,c.secret),`auth.verifyOAuthQueryParams`))return X(e,new IL);let l=new URLSearchParams(r);i8(l);let u=t&&(l.has(`key_authorization`)||l.has(`challenge`))?await Z(e,gz(e,{limits:[{binding:`AUTHORIZE_LIMIT`,key:s.user.id}]}),`RateLimit.check`):void 0;if(u)return u;if(t){let t=await Z(e,n8(e,{account:n,assertion:i?.assertion,headers:new Headers(e.req.raw.headers),oauthQuery:r,session:s}),`Consent.approve`);return t instanceof MN?X(e,t):(e.header(`cache-control`,`private, no-store`),`options`in t?e.json(y8.consent.step.parse({step:{options:t.options,type:`passkey`}}),200):e.json({redirect:t.redirect},200))}let d=await Z(e,e.var.auth.api.oauth2Consent({asResponse:!1,body:{accept:t,oauth_query:r},headers:new Headers(e.req.raw.headers),request:e.req.raw}),`auth.oauth2Consent`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;throw e});return d instanceof MN?X(e,d):(e.header(`cache-control`,`private, no-store`),e.json({redirect:y8.account.result.parse(d).url},200))}).get(`/v1/authorize/request`,QR({description:"Reads the app's authorization request that `oauth_query` carries, as the approval page shows it: the app, where the browser returns, and any key, with the account that approval signs for and why approval cannot sign it, if it cannot. A user who holds no account shows no account, and approval creates the first one. Creates no account. Returns the app's redirect with the refusal for a key that Tempo ID refuses.",responses:sz({errors:[...cz.errors,zL,PN],success:{description:`The request, or the app's redirect with a refusal.`,schema:y8.request.response}}),security:[{sessionCookie:[]}],tags:[`Authorization`]}),cz(`query`,y8.request.query),async e=>{if(e.req.header(`sec-fetch-site`)===`cross-site`)return X(e,new PN);let t=await Z(e,$0(e),`Session.get`);if(!t)return X(e,new zL);e.header(`cache-control`,`private, no-store`);let{oauth_query:n}=e.req.valid(`query`),r=new URLSearchParams(n),i=await Z(e,e.var.auth.$context,`auth.context`);if(!await Z(e,Ar(n,i.secret),`auth.verifyOAuthQueryParams`))return e.json({request:null},200);let a=r.get(`client_id`),o=r.get(`redirect_uri`),s=URL.parse(o??``);if(!a||!o||!s)return e.json({request:null},200);let c=await Z(e,uN($,{clientId:a}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);if(!c||!c.redirectUris.includes(o))return e.json({request:null},200);let l=t=>{let n=new URL(o);n.searchParams.append(`error`,t.response.error),n.searchParams.append(`error_description`,t.response.error_description);let i=r.get(`state`);return i&&n.searchParams.append(`state`,i),n.searchParams.append(`iss`,Sb.URL),e.json({redirect:n.href},200)},u=jI(r);if(u instanceof MN)return l(u);let d=u&&AI({app:c,clientId:a,codeChallenge:r.get(`code_challenge`),key:u});if(d)return l(d);let f=[`http:`,`https:`].includes(s.protocol)?s.host:s.protocol.slice(0,-1),p=u?await Z(e,Z6(e,{account:u.account,clientId:a,sessionId:t.session.id,userId:t.user.id}),`KeySigner.preview`):void 0;if(p?.foreign)return l(p.foreign);let m=(()=>{if(!u||!p)return;let e=r.get(`challenge`);return{...pI(u),...p.account?{account:p.account}:{},...e?{challenge:e}:{},...p.refusal&&p.refusal!==`foreign_account`?{refusal:p.refusal}:{}}})();return e.json({request:{app:c.name??f,destination:f,email:t.user.email,...m?{key:m}:{},session:t.session.id}},200)}).get(`/v1/authorize/accounts`,QR({description:"Reads the account step of the app's authorization request that `oauth_query` carries: the app, and the user's accounts in its realms, oldest first, each with its balance on the chain of the request's key, or of Tempo mainnet without one. The read counts against the user's `ACCOUNT_LIMIT`, as `GET /v1/account` does.",responses:sz({errors:[...V0.errors,...cz.errors,...gz.errors,zL,PN],success:{description:`The account step.`,schema:y8.accounts.response}}),security:[{sessionCookie:[]}],tags:[`Authorization`]}),cz(`query`,y8.accounts.query),async e=>{if(e.req.header(`sec-fetch-site`)===`cross-site`)return X(e,new PN);let t=await Z(e,$0(e),`Session.get`);if(!t)return X(e,new zL);e.header(`cache-control`,`private, no-store`);let{oauth_query:n}=e.req.valid(`query`),r=new URLSearchParams(n),i=await Z(e,e.var.auth.$context,`auth.context`),a=await Z(e,Ar(n,i.secret),`auth.verifyOAuthQueryParams`),o=r.get(`client_id`);if(!a||!o)return e.json({request:null},200);let s=await Z(e,uN($,{clientId:o}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);if(!s)return e.json({request:null},200);let c=await Z(e,gz(e,{limits:[{binding:`ACCOUNT_LIMIT`,key:t.user.id}]}),`RateLimit.check`);if(c)return c;let l=await Z(e,V0(e,{clientId:o,userId:t.user.id}),`AccountStep.accounts`),u=jI(r),d=u&&!(u instanceof MN)?Number(u.chainId):aI,f=l.flatMap(e=>{let t=e.config.owners[0];return t?[{address:e.address,owner:t.type,realm:e.realm.id==="default"?null:e.realm.name}]:[]}),p=await Z(e,QL(e,{accounts:f,chainId:d,rpcUrl:Sb.TEMPO_RPC_URL}),`Balance.list`);return e.json({request:{accounts:f.map((e,t)=>({...e,balance:p[t]??null})),app:s.name??`The app`}},200)}),x8={pad:!1,url:!0};async function S8(e,t){let n=await Z(e,ZI($,{deviceCode:t.deviceCode}),`Device.id`);if(!n)throw Error(`The device code has no row.`);let r=e.req.raw.cf,i=[r?.city,r?.country].filter(Boolean).join(`, `);await Z(e,KI($,{challenge:t.challenge??null,device:t.device,expiresAt:new Date(Date.now()+t.expiresIn*1e3),id:n,ip:e.req.header(`cf-connecting-ip`)??null,key:t.key??null,location:i||null}),`Device.create`)}async function C8(e,t){let n=QI(t.code),r=n?await Z(e,JI($,{userCode:n}),`Device.get`):void 0;if(!n||!r)return new VI;let i=await(async()=>{if(r.status!==`pending`||r.userId)return r;try{await Z(e,e.var.auth.api.deviceVerify({headers:e.req.raw.headers,query:{user_code:n}}),`auth.deviceVerify`)}catch(e){if(fn(e))return;throw e}return await Z(e,JI($,{userCode:n}),`Device.get`)})();if(!i||i.userId&&i.userId!==t.userId)return new VI;let a=await Z(e,uN($,{clientId:r.clientId}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);return{clientId:r.clientId,request:{...a?.name?{app:{name:a.name}}:{},...r.challenge?{challenge:r.challenge}:{},created_at:Math.floor(r.createdAt.getTime()/1e3),...r.device?{device:r.device}:{},...r.ip?{ip:r.ip}:{},...r.key?{key_authorization:pI(r.key)}:{},...r.location?{location:r.location}:{},status:i.status,user_code:i.userCode}}}(function(e){e.errors=[VI]})(C8||={});async function w8(e,t){let{request:n,session:r}=t,i=n.key,a=await Z(e,uN($,{clientId:n.clientId,enabled:!0}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);if(!a?.device||a.secret)return new DI({description:`Approval refused: \`client_id\` ${n.clientId} names no enabled public device app. Deny the request, and start the sign-in again.`});let o=uI(i)??dI({app:a,clientId:n.clientId,key:i});if(o)return o;let s=await Z(e,Q6(e,{account:i.account??t.account,clientId:n.clientId,cookie:e.req.header(`cookie`),create:!0,passkey:!0,sessionId:r.session.id,userId:r.user.id}),`KeySigner.resolve`);if(s instanceof JF){let e=s.response.meta?.account;return new JF({account:e,description:`Passkey required: the passkey of Tempo Account ${e} signs only at its own relying party, which the device page is not part of. Name another account, or deny the request.`})}if(s instanceof MN)return s;if(t.assertion&&s.owner.signer)return new gL;if(!t.assertion&&!s.owner.signer)return{options:await Z(e,X6(e,{account:s.account,clientId:n.clientId,key:i,owner:s.owner,userId:r.user.id}),`KeySigner.challenge`)};let c=await Z(e,$6(e,{account:s.account,assertion:t.assertion,clientId:n.clientId,key:i,owner:s.owner,userId:r.user.id}),`KeySigner.sign`);return c instanceof MN?c:{account:s.account,keyAuthorization:c}}(function(e){e.errors=[...uI.errors,DI,...dI.errors,...Q6.errors,...$6.errors,JF,gL]})(w8||={});var T8;(function(e){let t;(function(e){e.json=rn({challenge:OI.challenge.refine(e=>e===void 0||/^(?:[\t\n]|[^\p{Cc}\p{Cf}])*$/u.test(e),{message:`Remove control and format characters, such as bidi overrides`}),client_id:z().min(1).max(255).optional().meta({description:"The client ID of the device app that the CLI signs in to, whose realms the sign-in and the device page use. Defaults to `tempo-cli`.",examples:[`tempo-cli`]}),device:z().trim().min(1).max(64).regex(/^[^\p{Cc}\p{Cf}]*$/u,{message:`Remove control and format characters, such as bidi overrides`}).meta({description:`The name that the device page shows, such as the machine's hostname. It holds no control or format characters.`,examples:[`ada-macbook`]}),key_authorization:tI.request}).refine(e=>!e.challenge||e.key_authorization,{message:"A challenge requires `key_authorization`, whose witness binds it",path:[`challenge`]}),e.response=B({device_code:z().meta({description:"The secret code that the CLI polls `/v1/device/token` with (RFC 8628 §3.2). The CLI keeps it private.",examples:[`GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS`]}),expires_in:Gt().meta({description:`Seconds until the device code and user code expire.`,examples:[600]}),interval:Gt().meta({description:`Seconds between polls.`,examples:[5]}),user_code:z().meta({description:`The code that the user enters on the device page: eight consonants in two groups of four.`,examples:[`WDJB-MJHT`]}),verification_uri:Yt().meta({description:`The page where the user enters the user code.`,examples:[`https://id.tempo.xyz/device`]}),verification_uri_complete:Yt().meta({description:`The device page with the user code filled in, for a link or QR code.`,examples:[`https://id.tempo.xyz/device?code=WDJB-MJHT`]})})})(t||=e.authorize||={});let n;(function(e){e.json=B({client_id:t.json.shape.client_id.meta({description:"The client ID that `/v1/device/authorize` named. Defaults to `tempo-cli`.",examples:[`tempo-cli`]}),device_code:z().min(1).max(128).meta({description:"The device code that `/v1/device/authorize` returned.",examples:[`GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS`]})}),e.response=OI.tokens.extend({account:tI.account.optional(),key_authorization:tI.rpc.optional().meta({description:`The signed key authorization, in the node's RPC format, when the CLI requested a key. Only the first redemption returns it.`})}).meta({description:`The tokens, with the signed key authorization when the CLI requested a key.`,id:`DeviceTokens`}),e.issued=B({access_token:z(),expires_in:Gt(),id_token:z().optional(),refresh_token:z().optional(),token_type:z()})})(n||=e.token||={});let r;(function(e){e.param=B({code:z().meta({description:`The user code.`,examples:[`WDJB-MJHT`]})}),e.response=B({request:B({app:B({name:z().meta({description:`The app's display name.`,examples:[`Tempo CLI`]})}).optional().meta({description:`The app that requested the code. Absent when the app has no display name.`}),challenge:z().optional().meta({description:`The message whose EIP-191 hash is the key's witness, which approval signs. Absent when the CLI sent none.`,examples:[`Sign in to app.example.com
|
|
572
|
+
Nonce: 7f3a9c2e5b1d4f60`]}),created_at:Gt().meta({description:`When the CLI requested the code, in Unix seconds.`,examples:[1792075800]}),device:z().optional().meta({description:"The name that the CLI reported, such as its hostname. Absent for a code from `POST /device/code`.",examples:[`ada-macbook`]}),ip:z().optional().meta({description:`The CLI's IP address. Absent when it is unknown.`,examples:[`203.0.113.7`]}),key_authorization:tI.description.extend({account:tI.description.shape.account.meta({description:`The Tempo Account that approval signs for: the one the request names, else the one the user selected for the app, else the oldest. Absent when the request names none and the accounts cannot be read, or the user holds none.`,examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),refusal:Y6.refusal.optional()}).optional().meta({description:`What the key that the CLI requested may do. Absent when the CLI requested no key.`}),location:z().optional().meta({description:`The CLI's city and country, from its IP address. Absent when they are unknown.`,examples:[`Berlin, DE`]}),status:Wt([`approved`,`denied`,`pending`]).meta({description:"Whether the user approved or denied the code. `pending` until the user decides.",examples:[`pending`]}),user_code:z().meta({description:`The user code.`,examples:[`WDJB-MJHT`]})}).meta({description:`The request that the CLI made with the code.`})})})(r||=e.requests||={});let i;(function(e){e.json=B({account:r1.tempoAccount.shape.address.optional().meta({description:`The Tempo Account that the device page showed for the request's key authorization, one of the user's accounts in the app's realms. Ignored when the key names its account, and absent for a request without a key.`,examples:[`0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c`]}),code:z().max(32).meta({description:`The user code.`,examples:[`WDJB-MJHT`]}),passkey:B({assertion:xL.assertion}).optional().meta({description:`The passkey's assertion over the options of the passkey step, which a passkey-owned account's approval returns. The repeated approval signs the key with it.`})});let t=e.step=xL.step;e.response=zt([B({status:Ut(`approved`).meta({description:`The user approved the code. The CLI receives its tokens, and any signed key, on its next poll.`})}).meta({description:`A stored approval.`}),t])})(i||=e.approve||={});let a;(function(e){e.json=B({code:i.json.shape.code}),e.response=B({status:Ut(`denied`).meta({description:"The user denied the code. The next poll returns `access_denied`."})})})(a||=e.deny||={})})(T8||={});async function E8(e,t){if(E6(e))return new PN;let n=await Z(e,$0(e),`Session.get`);if(!n)return new zL;let r=await Z(e,gz(e,{limits:[{binding:`AUTHORIZE_LIMIT`,key:n.user.id}]}),`RateLimit.check`);if(r)return r;let i=QI(t.code),a=i?await Z(e,JI($,{userCode:i}),`Device.get`):void 0;if(!i||!a||a.userId&&a.userId!==n.user.id)return new VI;if(a.status!==`pending`)return new II;let o=e.req.raw.headers,s=await(async()=>{if(a.userId)return a;try{await Z(e,e.var.auth.api.deviceVerify({headers:o,query:{user_code:i}}),`auth.deviceVerify`)}catch(e){if(!fn(e))throw e}return await Z(e,JI($,{userCode:i}),`Device.get`)})();if(!s||s.userId!==n.user.id)return new VI;if(s.status!==`pending`)return new II;let c=await(async()=>{if(t.decision!==`approve`||!s.key)return;let r=await Z(e,w8(e,{account:t.account,assertion:t.assertion,request:s,session:n}),`DeviceRequest.sign`);if(r instanceof MN)return r;if(r.options)return{options:r.options};let i={account:r.account,keyAuthorization:r.keyAuthorization};return await Z(e,YI($,{id:s.id,key:i,userId:n.user.id}),`Device.hold`)?{key:i}:await l()})();if(c instanceof MN)return c;if(c&&`options`in c)return{options:c.options};try{await Z(e,t.decision===`approve`?e.var.auth.api.deviceApprove({body:{userCode:i},headers:o}):e.var.auth.api.deviceDeny({body:{userCode:i},headers:o}),t.decision===`approve`?`auth.deviceApprove`:`auth.deviceDeny`);return}catch(t){if(c&&await Z(e,XI($,{id:s.id,key:c.key}),`Device.release`),!fn(t))throw t;return await l()}async function l(){return await Z(e,JI($,{userCode:i}),`Device.get`)?new II:new VI}}(function(e){e.errors=[...w8.errors,zL,II,VI,PN]})(E8||={});async function D8(e,t){let n=await Z(e,e.var.auth.handler(new Request(new URL(`/oauth2/token`,Sb.URL),{body:new URLSearchParams({client_id:t.clientId,device_code:t.deviceCode,grant_type:aN,resource:Sb.URL}),headers:{"content-type":`application/x-www-form-urlencoded`},method:`POST`})),`auth.handler`),r=await Z(e,n.json(),`response.json`);if(n.ok)return T8.token.issued.parse(r);let i=B({error:z()}).safeParse(r).data?.error;if(i===`authorization_pending`)return new LI;if(i===`slow_down`)return new zI;if(i===`access_denied`)return new BI;if(i===`expired_token`||i===`invalid_grant`)return new RI;throw Error(`The token endpoint refused a device code with ${i??n.status}.`)}(function(e){e.errors=[LI,RI,zI,BI]})(D8||={});var O8=new Hy().post(`/v1/device/authorize`,QR({description:"Starts the device grant (RFC 8628) for a CLI, as the device app that `client_id` names, or `tempo-cli`. The user approves the user code on the device page, and the CLI polls `/v1/device/token`. A request with `key_authorization` asks for a key, which the device page shows and approval signs. The key follows the rules of the redirect's approval page, without the headless ceiling, and a `challenge` requires the app's `tempo-id:sign` scope.",responses:sz({errors:[...nR,...uI.errors,...dI.errors,...cz.errors,...gz.errors,DI,PN],success:{description:`The device code.`,schema:T8.authorize.response}}),tags:[`Device grant`]}),cz(`json`,T8.authorize.json),async e=>{let t=await Z(e,gz(e,{limits:[{binding:`DEVICE_LIMIT`,key:bz(e)}]}),`RateLimit.check`);if(t)return t;let{challenge:n,client_id:r=HI,device:i,key_authorization:a}=e.req.valid(`json`),o=await Z(e,uN($,{clientId:r,enabled:!0}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);if(!o?.device||o.secret)return X(e,new DI({description:`Device grant refused: \`client_id\` ${r} names no enabled public device app. Send the client ID of a device app, or leave out \`client_id\`.`}));if(a){let t=lI(a,{challenge:n}),i=uI(t)??dI({app:o,clientId:r,key:t});if(i)return X(e,i)}let s=await Z(e,e.var.auth.api.deviceCode({body:{client_id:r,resource:Sb.URL,scope:UI}}),`auth.deviceCode`);await Z(e,S8(e,{challenge:n,device:i,deviceCode:s.device_code,expiresIn:s.expires_in,key:a}),`DeviceRequest.create`);let c=qI(s.user_code),l=new URL($I,Sb.URL);return e.header(`cache-control`,`no-store`),e.json({device_code:s.device_code,expires_in:s.expires_in,interval:s.interval,user_code:c,verification_uri:l.href,verification_uri_complete:`${l.href}?${new URLSearchParams({code:c})}`},200)}).post(`/v1/device/token`,QR({description:`Polls for the device grant's tokens (RFC 8628 §3.4). The tokens of an approved code, and the key authorization that approval signed, are returned once.`,responses:sz({errors:[...nR,...cz.errors,...gz.errors,...D8.errors,PN],success:{description:`The tokens.`,schema:T8.token.response}}),tags:[`Device grant`]}),cz(`json`,T8.token.json),async e=>{let t=await Z(e,gz(e,{limits:[{binding:`TOKEN_LIMIT`,key:bz(e)}]}),`RateLimit.check`);if(t)return t;let n=e.req.valid(`json`).device_code,r=await Z(e,ZI($,{deviceCode:n}),`Device.id`),i=await Z(e,D8(e,{clientId:e.req.valid(`json`).client_id??`tempo-cli`,deviceCode:n}),`device.poll`);if(e.header(`cache-control`,`no-store`),i instanceof MN)return X(e,i);let a=r?await Z(e,tL($,{id:r}),`Device.take`).catch(t=>{xN(e,{error:t,message:`The device token poll failed to take the held key.`})}):void 0,{access_token:o,expires_in:s,id_token:c,refresh_token:l,token_type:u}=i;return e.json({access_token:o,...a?{account:a.account,key_authorization:a.keyAuthorization}:{},expires_in:s,...c?{id_token:c}:{},...l?{refresh_token:l}:{},token_type:u},200)}).get(`/v1/device/requests/:code`,QR({description:"Reads a device code's request for the device page, by its user code. The first signed-in user to read a pending code binds it, so no other user decides it. A pending request's key carries the account that approval signs for, and why approval cannot sign it, if it cannot. That lookup counts against the user's `ACCOUNT_LIMIT`, as `GET /v1/account` does. Creates no account.",responses:sz({errors:[...cz.errors,...C8.errors,...gz.errors,zL,PN],success:{description:`What the CLI requested.`,schema:T8.requests.response}}),security:[{sessionCookie:[]}],tags:[`Device grant`]}),cz(`param`,T8.requests.param),async e=>{if(e.req.header(`sec-fetch-site`)===`cross-site`)return X(e,new PN);let t=await Z(e,$0(e),`Session.get`);if(!t)return X(e,new zL);let n=await Z(e,gz(e,{limits:[{binding:`AUTHORIZE_LIMIT`,key:`${t.user.id}:device`}]}),`RateLimit.check`);if(n)return n;let r=await Z(e,C8(e,{code:e.req.valid(`param`).code,userId:t.user.id}),`DeviceRequest.read`);if(e.header(`cache-control`,`private, no-store`),r instanceof MN)return X(e,r);let{clientId:i,request:a}=r,{key_authorization:o,...s}=a;if(!o||a.status!==`pending`)return e.json({request:a},200);let c=await Z(e,Z6(e,{account:o.account,clientId:i,sessionId:t.session.id,userId:t.user.id}),`KeySigner.preview`);return e.json({request:{...s,key_authorization:{...o,...c.account?{account:c.account}:{},...c.refusal?{refusal:c.refusal}:{}}}},200)}).post(`/v1/device/approve`,QR({description:"Approves a device code for the signed-in user. Only Tempo ID's device page may call it. The CLI receives its tokens on its next poll. An approval of a request with a key authorization signs the key as the account's owner, and the poll returns it beside the tokens. For a passkey-owned account, the approval first returns the passkey step, and the repeated approval with `passkey` signs the key. A user who holds no account in the app's realms, and whose key names none, first receives a Privy-owned account, as `POST /v1/account` creates it.",responses:sz({errors:[...nR,...cz.errors,...gz.errors,...E8.errors],success:{description:`The code is approved, or the passkey step.`,schema:T8.approve.response}}),security:[{sessionCookie:[]}],tags:[`Device grant`]}),cz(`json`,T8.approve.json),async e=>{let{account:t,code:n,passkey:r}=e.req.valid(`json`),i=await Z(e,E8(e,{account:t,assertion:r?.assertion,code:n,decision:`approve`}),`device.decide`);return i instanceof Response?i:i instanceof MN?X(e,i):i?(e.header(`cache-control`,`private, no-store`),e.json(T8.approve.step.parse({step:{options:i.options,type:`passkey`}}),200)):e.json({status:`approved`},200)}).post(`/v1/device/deny`,QR({description:"Denies a device code for the signed-in user. Only Tempo ID's device page may call it. The CLI's next poll returns `access_denied`.",responses:sz({errors:[...nR,...cz.errors,...gz.errors,...E8.errors],success:{description:`The code is denied.`,schema:T8.deny.response}}),security:[{sessionCookie:[]}],tags:[`Device grant`]}),cz(`json`,T8.deny.json),async e=>{let t=await Z(e,E8(e,{code:e.req.valid(`json`).code,decision:`deny`}),`device.decide`);return t instanceof Response?t:t instanceof MN?X(e,t):e.json({status:`denied`},200)}),k8;(function(e){let t;(function(e){e.response=B({ok:Ut(!0).meta({description:"Always `true`."}),version:B({id:z().meta({description:"The version's ID, as `wrangler deploy` prints it.",examples:[`a5f3c2e1-7b4d-4e8a-9c6f-2d1b0e3a4c5f`]}),tag:z().meta({description:`The version's tag, or empty when it has none.`,examples:[`v1.4.0`]})}).meta({description:`The deployed Worker version that served the request.`})})})(t||=e.health||={})})(k8||={});var A8=new Hy().get(`/health`,QR({description:`Responds while the Worker is up, with the version that served the request.`,responses:sz({success:{description:`The Worker is up.`,schema:k8.health.response}}),tags:[`Health`]}),e=>{let{id:t,tag:n}=e.env.CF_VERSION_METADATA;return e.header(`cache-control`,`no-store`),e.json({ok:!0,version:{id:t,tag:n}},200)}),j8=60,M8;(function(e){e.continuation=B({client_id:z().optional(),expiresAt:Gt(),id_token_hint:z(),post_logout_redirect_uri:z().optional(),state:z().optional()})})(M8||={});var N8=class extends NN(`invalid_id_token_hint`){name=`Logout.HintInvalidError`;constructor(){super({error_description:`Invalid id_token_hint: it is not an ID token that this issuer signed for the app. Send the ID token that the app received at sign-in.`,field:`id_token_hint`})}},P8=class extends NN(`logout_not_permitted`){name=`Logout.NotPermittedError`;constructor(e){super({error_description:`Logout not permitted: the app ${e.clientId} may not end the session. Register the app for logout, then retry.`,meta:{client_id:e.clientId}})}},F8=class extends NN(`post_logout_redirect_not_permitted`){name=`Logout.RedirectNotPermittedError`;constructor(e){super({error_description:`Invalid post_logout_redirect_uri: ${e.uri} is not registered for the app. Use one of its post-logout redirect URIs, or leave it out.`,field:`post_logout_redirect_uri`,meta:{post_logout_redirect_uri:e.uri}})}};async function I8(e,t){let n=await V8(t);if(n instanceof N8)return n;let[r]=await e.select({disabled:Zj.disabled,enableEndSession:Zj.enableEndSession,postLogoutRedirectUris:Zj.postLogoutRedirectUris}).from(Zj).where(Y(Zj.clientId,n.clientId));if(!r||r.disabled||!r.enableEndSession)return new P8({clientId:n.clientId});let i=(()=>{let e=t.postLogoutRedirectUri;if(e===void 0)return;if(!(r.postLogoutRedirectUris??[]).includes(e))return new F8({uri:e});let n=new URL(e);return t.state!==void 0&&n.searchParams.set(`state`,t.state),n.href})();return i instanceof F8?i:{redirect:i,sessionId:n.sessionId}}(function(e){e.errors=[N8,P8,F8]})(I8||={});async function L8(e,t){let[n]=await e.select({id:cM.id}).from(cM).where(Y(cM.id,t.sessionId));if(n)throw Error(`The session still exists after sign-out.`)}async function R8(e,t){return await Dn({data:JSON.stringify(M8.continuation.parse({...e,expiresAt:Math.floor(Date.now()/1e3)+j8})),key:await H8(t.secret)})}async function z8(e,t){let n=await bn({data:e,key:await H8(t.secret)}).then(e=>M8.continuation.safeParse(JSON.parse(e))).catch(()=>void 0);if(n?.success&&!(n.data.expiresAt<=Date.now()/1e3))return n.data}async function B8(e,t){await e.update(iM).set({revoked:new Date}).where(tA(Y(iM.sessionId,t.sessionId),uA(iM.revoked)))}async function V8(e){let{clientId:t,issuer:n,jwks:r}=e,i=await(async()=>{try{let t=await Dr(e.hint,ri(r),{algorithms:[`RS256`]});return JSON.parse(new TextDecoder().decode(t.payload))}catch{return}})();if(!i||typeof i!=`object`)return new N8;let a=i,o=typeof a.aud==`string`?[a.aud]:Array.isArray(a.aud)?a.aud.filter(e=>typeof e==`string`):[],s=t??(o.length===1?o[0]:void 0);return a.iss!==n||!s||!o.includes(s)||typeof a.sid!=`string`||!a.sid||typeof a.sub!=`string`||!a.sub?new N8:{clientId:s,sessionId:a.sid,userId:a.sub}}async function H8(e){let t=new TextEncoder,n=await crypto.subtle.importKey(`raw`,t.encode(e),`HKDF`,!1,[`deriveBits`]),r=await crypto.subtle.deriveBits({hash:`SHA-256`,info:t.encode(`tempo-id:logout-continuation:v1`),name:`HKDF`,salt:new Uint8Array},n,256);return ya(new Uint8Array(r))}var U8;(function(e){let t;(function(e){e.response=nn({authorization_endpoint:Yt().meta({description:`The authorization endpoint.`,examples:[`https://id.tempo.xyz/oauth2/authorize`]}),issuer:Yt().meta({description:"The issuer's identifier, every token's `iss`.",examples:[`https://id.tempo.xyz`]}),jwks_uri:Yt().meta({description:`The issuer's signing keys.`,examples:[`https://id.tempo.xyz/oauth2/jwks`]}),token_endpoint:Yt().meta({description:`The token endpoint.`,examples:[`https://id.tempo.xyz/oauth2/token`]})}).meta({description:`The issuer's metadata (RFC 8414 §2, OpenID Connect Discovery §3), with the members that RFC 8414 defines.`,id:`AuthorizationServerMetadata`})})(t||=e.openidConfiguration||={});let n;(function(e){e.response=t.response})(n||=e.oauthAuthorizationServer||={});let r;(function(e){e.query=B({challenge:z().optional().meta({description:"A message, such as a sign-in challenge from the app's backend, whose EIP-191 hash becomes the key authorization's `witness` (TIP-1053). Requires `key_authorization`, and the app's `tempo-id:sign` scope.",examples:[`Sign in to app.example.com
|
|
573
|
+
Nonce: 7f3a9c2e5b1d4f60`]}),client_id:z().meta({description:`The app's client ID.`,examples:[`tempo-cli`]}),code_challenge:z().meta({description:`The PKCE challenge: the base64url SHA-256 hash of the code verifier (RFC 7636 §4.2).`,examples:[`E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`]}),code_challenge_method:Ut(`S256`).meta({description:`The PKCE challenge method.`}),key_authorization:z().optional().meta({description:"A key authorization for the app's own key, as base64url JSON in the shape of `KeyAuthorizationRequest`. The request always shows the approval page, which signs the key, and `/oauth2/token` returns it beside the tokens. A key that breaks a rule returns to the redirect URI with the refusal.",examples:[`eyJhZGRyZXNzIjoiMHg4MWMwZjIyYmQxNzNjMTE1ZDE4ZWVlYTBmNmEzOGU5MzVlY2Y1MmZiIn0`]}),prompt:Wt([`consent`,`login`,`none`,`select_account`]).optional().meta({description:`Whether the user signs in or consents again (OIDC Core §3.1.2.1). Absent to reuse the session and stored consent.`,examples:[`consent`]}),redirect_uri:Yt().meta({description:`One of the app's registered redirect URIs.`,examples:[`https://app.example/callback`]}),resource:Yt().optional().meta({description:`The API the access token is for (RFC 8707). Absent for Tempo ID's own origin.`,examples:[`https://id.tempo.xyz`]}),response_type:Ut(`code`).meta({description:`The authorization code flow.`}),scope:z().meta({description:`Space-separated OAuth scopes.`,examples:[`openid profile email`]}),state:z().optional().meta({description:`An opaque value that the redirect returns to the app unchanged.`,examples:[`af0ifjsldkj`]})}),e.response=B({redirect:Xt().meta({description:"Whether the app sends the browser to `url`.",examples:[!0]}),url:z().meta({description:`Where the browser goes next: the sign-in page, the consent page, or the redirect URI with a code.`,examples:[`https://app.example/callback?code=SplxlOBeZQQYbYS6WxSbIA`]})}).meta({description:`The next step of the authorization, for a request that a script sends.`})})(r||=e.authorize||={});let i;(function(e){e.error=B({error:z().meta({description:"The RFC 6749 error code, such as `invalid_grant` or `invalid_client`.",examples:[`invalid_grant`]}),error_description:z().optional().meta({description:`The issuer's description of the error. Absent when the issuer sends none.`,examples:[`invalid code`]}),error_uri:Yt().optional().meta({description:`A page about the error. Absent when the issuer sends none.`,examples:[`https://example.com/docs/errors#invalid_grant`]}),request_id:z().optional().meta({description:"The request ID, which Tempo ID adds and `X-Request-Id` also carries.",examples:[`5b3e1f2a-8c4d-4e6f-9a0b-7c2d1e3f4a5b`]})}).meta({description:`The issuer's OAuth error response (RFC 6749 §5.2), passed through.`,id:`OAuthErrorResponse`}),e.form=B({client_id:z().optional().meta({description:"The app's client ID. Absent when the app authenticates with HTTP Basic `Authorization`.",examples:[`tempo-cli`]}),client_secret:z().optional().meta({description:`A confidential app's secret.`,examples:[`3bTm9qXc2Lr7WvN5kYp8Hs4Df6Ga1Je0`]}),code:z().optional().meta({description:"The authorization code to redeem, for the `authorization_code` grant.",examples:[`SplxlOBeZQQYbYS6WxSbIA`]}),code_verifier:z().optional().meta({description:"The PKCE verifier whose S256 hash is the authorization request's `code_challenge` (RFC 7636 §4.5).",examples:[`dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk`]}),device_code:z().optional().meta({description:`The device code, for the device code grant (RFC 8628 §3.4).`,examples:[`GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS`]}),grant_type:Wt([`authorization_code`,`client_credentials`,`refresh_token`,`urn:ietf:params:oauth:grant-type:device_code`]).meta({description:`The OAuth grant that the request redeems.`,examples:[`authorization_code`]}),redirect_uri:z().optional().meta({description:"The redirect URI of the authorization request, for the `authorization_code` grant.",examples:[`https://app.example/callback`]}),refresh_token:z().optional().meta({description:"The refresh token to redeem, for the `refresh_token` grant.",examples:[`yAjhKk7QnRZ3vD9pLm2Xc8Ws5Tf1Ub4N`]}),resource:Yt().optional().meta({description:`The API the access token is for (RFC 8707). Absent for Tempo ID's own origin.`,examples:[`https://id.tempo.xyz`]}),scope:z().optional().meta({description:`Space-separated OAuth scopes to request. Absent to keep the scopes of the grant.`,examples:[`openid profile email`]})}),e.response=nn({access_token:z().meta({description:`The access token, an RS256 JWT for the requested resource.`,examples:[`eyJhbGciOiJSUzI1NiIsInR5cCI6ImF0K2p3dCJ9.e30.c2lnbmF0dXJl`]}),account:tI.account.optional().meta({description:"The Tempo Account that the key acts for. Present beside `key_authorization`.",examples:[`0x9a073914db0d149375ac2b7fbb72c68c0780fb5f`]}),expires_in:Gt().meta({description:`How long the access token lasts, in seconds.`,examples:[300]}),id_token:z().optional().meta({description:"The ID token, an RS256 JWT. Absent without the `openid` scope.",examples:[`eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.e30.c2lnbmF0dXJl`]}),key_authorization:tI.rpc.optional().meta({description:"The key authorization that the approval page signed, for the first redemption of a code whose request carried `key_authorization`. Absent for every other code, a refresh, and a key that expired."}),refresh_token:z().optional().meta({description:"The refresh token. Absent without the `offline_access` scope.",examples:[`yAjhKk7QnRZ3vD9pLm2Xc8Ws5Tf1Ub4N`]}),scope:z().optional().meta({description:`Space-separated OAuth scopes of the tokens.`,examples:[`openid profile email`]}),token_type:z().meta({description:`The type of the access token (RFC 6749 §7.1).`,examples:[`Bearer`]})}).meta({description:`The issuer's token response (RFC 6749 §5.1).`,id:`TokenResponse`})})(i||=e.token||={});let a;(function(e){e.form=B({client_id:z().optional().meta({description:"The app's client ID. The app holds the device grant. Absent when the app authenticates with HTTP Basic `Authorization`.",examples:[`tempo-cli`]}),client_secret:z().optional().meta({description:`A confidential app's secret.`,examples:[`3bTm9qXc2Lr7WvN5kYp8Hs4Df6Ga1Je0`]}),resource:Yt().optional().meta({description:`The API the access token is for (RFC 8707). Absent for Tempo ID's own origin.`,examples:[`https://id.tempo.xyz`]}),scope:z().optional().meta({description:`Space-separated OAuth scopes.`,examples:[`openid email offline_access`]})}),e.response=B({device_code:z().meta({description:"The secret code that the device polls `/oauth2/token` with (RFC 8628 §3.2). The device keeps it private.",examples:[`GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS`]}),expires_in:Gt().meta({description:`Seconds until the device code and user code expire.`,examples:[600]}),interval:Gt().meta({description:`Seconds between polls.`,examples:[5]}),user_code:z().meta({description:`The code that the user enters on the verification page: eight consonants.`,examples:[`WDJBMJHT`]}),verification_uri:Yt().meta({description:`The page where the user enters the user code.`,examples:[`https://id.tempo.xyz/device`]}),verification_uri_complete:Yt().meta({description:`The verification page with the user code filled in, for a link or QR code.`,examples:[`https://id.tempo.xyz/device?user_code=WDJBMJHT`]})}).meta({description:`The issuer's device authorization response (RFC 8628 §3.2).`}),e.issued=B({device_code:z(),expires_in:Gt()})})(a||=e.deviceCode||={});let o;(function(e){e.form=B({client_id:i.form.shape.client_id,client_secret:i.form.shape.client_secret,token:z().meta({description:`The token to introspect.`,examples:[`yAjhKk7QnRZ3vD9pLm2Xc8Ws5Tf1Ub4N`]}),token_type_hint:Wt([`access_token`,`refresh_token`]).optional().meta({description:"The type of `token`, which helps the issuer find it (RFC 7662 §2.1).",examples:[`refresh_token`]})}),e.response=nn({active:Xt().meta({description:`Whether the token is active. An inactive token has no other members.`,examples:[!0]}),client_id:z().optional().meta({description:`The client ID of the app that the token belongs to.`,examples:[`tempo-cli`]}),exp:Gt().optional().meta({description:`When the token expires, in Unix seconds.`,examples:[1792076100]}),iat:Gt().optional().meta({description:`When the issuer issued the token, in Unix seconds.`,examples:[1792075800]}),iss:z().optional().meta({description:`The issuer's identifier.`,examples:[`https://id.tempo.xyz`]}),scope:z().optional().meta({description:`Space-separated OAuth scopes of the token.`,examples:[`openid profile email`]}),sub:z().optional().meta({description:`The user ID of the token's subject.`,examples:[`user_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]})}).meta({description:`The issuer's introspection response (RFC 7662 §2.2).`,id:`IntrospectionResponse`})})(o||=e.introspect||={});let s;(function(e){e.form=B({client_id:i.form.shape.client_id,client_secret:i.form.shape.client_secret,token:z().meta({description:`The access or refresh token to revoke.`,examples:[`yAjhKk7QnRZ3vD9pLm2Xc8Ws5Tf1Ub4N`]}),token_type_hint:o.form.shape.token_type_hint})})(s||=e.revoke||={});let c;(function(e){e.response=nn({email:z().optional().meta({description:"The user's email address. Absent without the `email` scope.",examples:[`ada@example.com`]}),email_verified:Xt().optional().meta({description:"Whether the issuer verified the email address. Absent without the `email` scope.",examples:[!0]}),sub:z().meta({description:`The user ID.`,examples:[`user_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]})}).meta({description:`The issuer's UserInfo response (OIDC Core §5.3.2).`,id:`UserInfoResponse`})})(c||=e.userinfo||={});let l;(function(e){e.form=(e.query=B({client_id:z().optional().meta({description:"The app's client ID. Absent when `id_token_hint` names the app.",examples:[`tempo-cli`]}),continuation:z().optional().meta({description:`The sealed parameters of a form POST that carried no session cookie, which its 303 sends here. Absent otherwise.`,examples:[`a3f1c2…`]}),id_token_hint:z().optional().meta({description:"An ID token that Tempo ID issued to the app, which names the session to end. It may be expired. Required without `continuation`.",examples:[`eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.e30.c2lnbmF0dXJl`]}),post_logout_redirect_uri:Yt().optional().meta({description:`Where the browser goes after sign-out: one of the app's registered post-logout redirect URIs.`,examples:[`https://app.example/signed-out`]}),state:r.query.shape.state})).omit({continuation:!0}).extend({id_token_hint:z().meta({description:`An ID token that Tempo ID issued to the app, which names the session to end. It may be expired.`,examples:[`eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.e30.c2lnbmF0dXJl`]})}),e.response=B({signed_out:Ut(!0).meta({description:`The browser holds no session that the hint names, since it ended or never held one.`})})})(l||=e.endSession||={});let u;(function(e){e.response=B({keys:en(nn({alg:z().optional().meta({description:`The algorithm that the key signs with.`,examples:[`RS256`]}),kid:z().optional().meta({description:"The key ID, which matches the `kid` header of a token that the key signs.",examples:[`Qq0BN2lPx8VzTRsaGgMjc5HbEFKY4Wty`]}),kty:z().meta({description:`The key family (RFC 7518 §6.1).`,examples:[`RSA`]})})).meta({description:`The issuer's public signing keys, with the members of each key that RFC 7517 defines.`})}).meta({description:`The issuer's JSON Web Key Set (RFC 7517 §5).`,id:`JsonWebKeySet`})})(u||=e.jwks||={})})(U8||={});var W8={...az([]),400:{content:{"application/json":{schema:JR(U8.token.error)}},description:`The issuer's refusal, passed through.`},401:{content:{"application/json":{schema:JR(U8.token.error)}},description:`The issuer's refusal of the client or token, passed through.`}},G8={responses:{200:{content:{"application/json":{schema:JR(U8.introspect.response)}},description:`The issuer's introspection response.`},...W8,...az(nR)},security:[{},{clientBasic:[]}],tags:[`OAuth`]},K8={description:`Signs the browser out (OpenID Connect RP-Initiated Logout) when it holds the session that the app's ID token names: revokes the refresh tokens that apps received through that session, ends it, and clears its cookie and the account step's selections. Any other session stays signed in. Redirects the browser to the app's post-logout redirect URI.`,responses:{302:{description:"Redirects the browser to the app's post-logout redirect URI, with `state`."},...sz({errors:[...cz.errors,...I8.errors],success:{description:"The browser is signed out of the session that the hint names, for a request without `post_logout_redirect_uri`.",schema:U8.endSession.response}})},tags:[`OAuth`]},q8=[`/.well-known/oauth-authorization-server`,`/.well-known/openid-configuration`,`/oauth2/authorize`,`/oauth2/introspect`,`/oauth2/jwks`,`/oauth2/revoke`,`/oauth2/token`,`/oauth2/userinfo`],J8=new Hy().get(`/.well-known/openid-configuration`,QR({description:`Reads the issuer's OpenID Connect discovery document.`,responses:sz({success:{description:`The discovery document.`,schema:U8.openidConfiguration.response}}),tags:[`OAuth`]}),e=>Z8(e)).get(`/.well-known/oauth-authorization-server`,QR({description:`Reads the issuer's authorization server metadata.`,responses:sz({success:{description:`The metadata.`,schema:U8.oauthAuthorizationServer.response}}),tags:[`OAuth`]}),e=>Z8(e)).get(`/oauth2/authorize`,QR({description:`Starts an authorization. A signed-out browser goes to the sign-in page, and a signed-in one to the consent page or to the redirect URI with a code.`,responses:{200:{content:{"application/json":{schema:JR(U8.authorize.response)}},description:`The next step, for a request that a script sends.`},302:{description:"Redirects the browser to the sign-in page, the consent page, or the redirect URI. A refused `key_authorization` returns to the redirect URI with `error` and `error_description`."},...W8},tags:[`OAuth`]}),oz(`query`,U8.authorize.query),e=>Z8(e)).post(`/oauth2/token`,QR({description:`Redeems an authorization code, a refresh token, a device code, or client credentials for tokens.`,responses:{200:{content:{"application/json":{schema:JR(U8.token.response)}},description:`The tokens.`},...W8,...az([...nR,...gz.errors])},security:[{},{clientBasic:[]}],tags:[`OAuth`]}),oz(`form`,U8.token.form),async e=>{let t=await Z(e,gz(e,{limits:[{binding:`TOKEN_LIMIT`,key:bz(e)}]}),`RateLimit.check`);if(t)return t;let n=new URLSearchParams(await Z(e,e.req.text(),`request.text`)),r=Y8({authorization:e.req.header(`authorization`),form:n}),i=r?await Z(e,cN($,r),`Apps.authenticate`):!1;return await Z(e,gz(e,{limits:[{binding:`TOKEN_APP_LIMIT`,key:i?r?.clientId:void 0}]}),`RateLimit.check`)||Z8(e)}).post(`/device/code`,QR({description:"Starts the device grant (RFC 8628 §3.1) for an app that holds it. The user approves the user code on the verification page, and the device redeems the device code at `/oauth2/token`. The device code binds to the user who approves it.",responses:{200:{content:{"application/json":{schema:JR(U8.deviceCode.response)}},description:`The device code.`},...W8,...az([...nR,...gz.errors])},security:[{},{clientBasic:[]}],tags:[`OAuth`]}),oz(`form`,U8.deviceCode.form),async e=>{let t=bz(e),n=await Z(e,gz(e,{limits:[{binding:`DEVICE_LIMIT`,key:t===void 0?void 0:`${t}:form`}]}),`RateLimit.check`);if(n)return n;let r=await Z(e,Z8(e),`oauth2.forward`);if(!r.ok)return r;let i=U8.deviceCode.issued.parse(await Z(e,r.clone().json(),`response.json`));return await Z(e,S8(e,{device:null,deviceCode:i.device_code,expiresIn:i.expires_in}),`DeviceRequest.create`),r}).post(`/oauth2/introspect`,QR({description:"Introspects a token (RFC 7662). The app authenticates with its client credentials, in the body or as HTTP Basic `Authorization`.",...G8}),oz(`form`,U8.introspect.form),e=>Z8(e)).post(`/oauth2/introspection`,QR({deprecated:!0,description:"Introspects a token, as `POST /oauth2/introspect` does. Clients of the older package call this path.",...G8}),oz(`form`,U8.introspect.form),e=>{let t=new URL(e.req.url);return t.pathname=`/oauth2/introspect`,Z(e,e.var.auth.handler(new Request(t,e.req.raw)),`auth.handler`)}).post(`/oauth2/revoke`,QR({description:"Revokes an access or refresh token (RFC 7009). The app authenticates with its client credentials, in the body or as HTTP Basic `Authorization`.",responses:{200:{content:{"application/json":{schema:{description:`Empty: the token is revoked, or was already invalid (RFC 7009 §2.2).`}}},description:`The token is revoked.`},...W8,...az(nR)},security:[{},{clientBasic:[]}],tags:[`OAuth`]}),oz(`form`,U8.revoke.form),e=>Z8(e)).get(`/oauth2/userinfo`,QR({description:`Reads the token subject's claims (OIDC Core §5.3).`,responses:{200:{content:{"application/json":{schema:JR(U8.userinfo.response)}},description:`The issuer's UserInfo response.`},...W8},security:[{accessToken:[]}],tags:[`OAuth`]}),e=>Z8(e)).get(`/oauth2/end-session`,QR(K8),cz(`query`,U8.endSession.query),async e=>X8(e,e.req.valid(`query`))).post(`/oauth2/end-session`,QR({...K8,responses:{...K8.responses,...az(nR),303:{description:"Continues a form POST without the session cookie as `GET /oauth2/end-session` with the sealed parameters in `continuation`, which the browser sends with the cookie."}}}),cz(`form`,U8.endSession.form),async e=>X8(e,e.req.valid(`form`))).get(`/oauth2/jwks`,QR({description:`Reads the issuer's signing keys.`,responses:sz({success:{description:`The JSON Web Key Set.`,schema:U8.jwks.response}}),tags:[`OAuth`]}),e=>Z8(e)).on([`GET`,`POST`],[...q8],e=>Z8(e));function Y8(e){let{authorization:t,form:n}=e;if(t&&/^Basic +/i.test(t))try{return vn(t)}catch{return}let[r,...i]=n.getAll(`client_id`).filter(e=>e.length>0),[a,...o]=n.getAll(`client_secret`).filter(e=>e.length>0);if(r&&a&&!i.length&&!o.length)return{clientId:r,clientSecret:a}}async function X8(e,t){let n=t.continuation===void 0?t:await Z(e,z8(t.continuation,{secret:Sb.SECRET}),`Logout.unseal`);if(!n)return X(e,new wI({issues:[{message:`Expired or invalid continuation. Send the logout request again`,path:[`continuation`]}]}));let r=n.id_token_hint;if(!r)return X(e,new wI({issues:[{message:`Required`,path:[`id_token_hint`]}]}));let i=await Z(e,rN($,{hint:r}),`SigningKey.hintKeys`),a=await Z(e,I8($,{clientId:n.client_id,hint:r,issuer:Sb.URL,jwks:i,postLogoutRedirectUri:n.post_logout_redirect_uri,state:n.state}),`Logout.check`);if(a instanceof MN)return X(e,a);let o=e.req.raw.headers,s=(await Z(e,e.var.auth.api.getSession({headers:o}),`auth.getSession`))?.session.id===a.sessionId;if(!s&&e.req.method===`POST`){let t=await Z(e,R8({client_id:n.client_id,id_token_hint:r,post_logout_redirect_uri:n.post_logout_redirect_uri,state:n.state},{secret:Sb.SECRET}),`Logout.seal`),i=new URL(`/oauth2/end-session`,Sb.URL);return i.searchParams.set(`continuation`,t),e.header(`cache-control`,`no-store`),e.redirect(i.href,303)}if(s){await Z(e,B8($,{sessionId:a.sessionId}),`Logout.revoke`);let t=await Z(e,e.var.auth.api.signOut({headers:o,returnHeaders:!0}),`auth.signOut`);await Z(e,L8($,{sessionId:a.sessionId}),`Logout.assertEnded`);for(let n of t.headers.getSetCookie())e.header(`set-cookie`,n,{append:!0});e.header(`set-cookie`,H0(),{append:!0})}return e.header(`cache-control`,`no-store`),a.redirect?e.redirect(a.redirect,302):e.json({signed_out:!0},200)}async function Z8(e){let t=await Z(e,$8(e),`oauth2.withResource`);return(e.req.path===`/oauth2/authorize`?await Z(e,Q8(e,t),`oauth2.refuseKey`):void 0)||Z(e,e.var.auth.handler(t),`auth.handler`)}async function Q8(e,t){let n=t.method===`POST`?new URLSearchParams(await Z(e,t.clone().text(),`request.text`)):new URL(t.url).searchParams;if(!n.has(`key_authorization`)&&!n.has(`challenge`))return;let r=n.get(`client_id`),i=n.get(`redirect_uri`);if(!r||!i)return;let a=await Z(e,uN($,{clientId:r}).catch(e=>{if(!(e instanceof iN))throw e}),`Apps.get`);if(!a||!a.redirectUris.includes(i))return;let o=jI(n),s=o instanceof MN?o:o&&AI({app:a,clientId:r,codeChallenge:n.get(`code_challenge`),key:o});if(!s)return;let c=new URL(i);c.searchParams.append(`error`,s.response.error),c.searchParams.append(`error_description`,s.response.error_description);let l=n.get(`state`);return l&&c.searchParams.append(`state`,l),c.searchParams.append(`iss`,Sb.URL),e.header(`cache-control`,`no-store`),e.redirect(c.href,302)}async function $8(e){let t=e.req.raw;if(e.req.path===`/oauth2/authorize`&&e.req.method===`GET`){let e=new URL(t.url);return e.searchParams.has(`resource`)||e.searchParams.set(`resource`,Sb.URL),e.search=MI(e.searchParams).toString(),new Request(e,t)}if(e.req.path===`/oauth2/authorize`&&e.req.method===`POST`&&e.req.header(`content-type`)?.split(`;`)[0]?.toLowerCase().includes(`application/x-www-form-urlencoded`)){let n=new URLSearchParams(await Z(e,e.req.text(),`request.text`));n.has(`resource`)||n.set(`resource`,Sb.URL);let r=new Headers(t.headers);return r.delete(`content-length`),r.set(`content-type`,`application/x-www-form-urlencoded`),new Request(t.url,{body:MI(n),headers:r,method:`POST`})}if(e.req.path===`/oauth2/token`&&e.req.method===`POST`){let n=new URLSearchParams(await Z(e,e.req.text(),`request.text`));n.has(`resource`)||n.set(`resource`,Sb.URL);let r=new Headers(t.headers);return r.delete(`content-length`),new Request(t.url,{body:n,headers:r,method:`POST`})}if(e.req.path===`/device/code`&&e.req.method===`POST`){let n=new URLSearchParams(await Z(e,e.req.text(),`request.text`));n.has(`resource`)||n.set(`resource`,Sb.URL),n.delete(`user_id`);let r=new Headers(t.headers);return r.delete(`content-length`),r.set(`content-type`,`application/x-www-form-urlencoded`),new Request(t.url,{body:n,headers:r,method:`POST`})}return t}var e5=class extends NN(`return_to_not_permitted`){name=`Provider.ReturnToNotPermittedError`;constructor(e){super({error_description:`Invalid return_to: ${e.origin} is not an origin of the app's redirect URIs. Return to a page on one of them, and pass the app's client_id.`,field:`return_to`,meta:{origin:e.origin}})}},t5=class extends NN(`unknown_provider`){name=`Provider.UnknownError`;constructor(e){super({error_description:`Unknown provider: ${e.provider} is not offered. Request GET /v1/auth/providers for the providers offered.`,field:`provider`,meta:{provider:e.provider}})}},n5={google:`Google`};function r5(e){return e.google?[{id:`google`,name:n5.google}]:[]}async function i5(e,t){let{clientId:n,own:r}=t,i=new URL(t.returnTo,r);if(i.protocol!==`https:`&&i.protocol!==`http:`)return new e5({origin:i.origin});if(i.origin===r)return i.href;let[a]=n?await e.select({redirectUris:Zj.redirectUris}).from(Zj).where(Y(Zj.clientId,n)):[];return(a?.redirectUris??[]).flatMap(e=>{let t=URL.parse(e);return t&&(t.protocol===`https:`||t.protocol===`http:`)?[t.origin]:[]}).includes(i.origin)?i.href:new e5({origin:i.origin})}(function(e){e.errors=[e5]})(i5||={});var a5=`tempo-id-grant`,o5=`tempo-id-sign-in-app`,s5=600,c5;(function(e){let t;(function(e){e.response=B({providers:en(B({id:Wt([`google`]).meta({description:"The provider's ID, which `GET /v1/auth/oauth/{provider}` takes.",examples:[`google`]}),name:z().meta({description:"The name to show, such as `Google`.",examples:[`Google`]})}).meta({description:`One provider Tempo ID offers.`})).readonly().meta({description:`The providers Tempo ID offers, in the order a page shows them. Empty when the deployment configures none.`})})})(t||=e.providers||={});let n;(function(e){e.param=B({provider:z().min(1).max(64).meta({description:"The ID of the provider, from `GET /v1/auth/providers`.",examples:[`google`]})}),e.query=B({client_id:z().min(1).max(255).optional().meta({description:"The app's client ID. A `return_to` on an origin of the app's redirect URIs requires it.",examples:[`client_01JZ8Q6W3N1R5B4V7C2X9K0M3T`]}),oauth_query:z().min(1).max(8192).optional().meta({description:`The signed authorization request in the sign-in page's query. The callback continues it, and redirects to the app.`,examples:[`client_id=tempo-cli&response_type=code&exp=1767225600&sig=4mLx2Wq9cH8t`]}),return_to:z().min(1).max(8448).refine(e=>URL.canParse(e,`https://id.invalid`),{message:`Set an absolute URL, or a path on Tempo ID`}).optional().meta({description:"The page that the browser returns to, signed in, on Tempo ID's origin or an origin of the app's redirect URIs. Defaults to the account page. A failed sign-in returns there with `error=access_denied`.",examples:[`https://app.example.com/welcome`]})})})(n||=e.signIn||={});let r;(function(e){e.param=n.param,e.query=n.query.pick({client_id:!0,return_to:!0})})(r||=e.failed||={});let i;(function(e){e.param=n.param,e.query=B({code:z().optional().meta({description:`The provider's authorization code.`,examples:[`4/0AVMBsJh7c2X9K0M3T`]}),error:z().optional().meta({description:`The provider's error code, for a refused sign-in.`,examples:[`access_denied`]}),state:z().optional().meta({description:`The state that the redirect to the provider sent.`,examples:[`Qm7rXcJ2bWv9Tk4LsN8pHd3F`]})})})(i||=e.callback||={})})(c5||={});var l5=new Hy().get(`/v1/auth/providers`,QR({description:`Lists the OAuth providers Tempo ID offers, for an app that shows its own sign-in buttons.`,responses:sz({success:{description:`The providers.`,schema:c5.providers.response}}),tags:[`Authenticate`]}),e=>e.json({providers:r5({google:f6()})},200)).get(`/v1/auth/oauth/:provider`,QR({description:"Redirects the browser to the provider. The provider returns it to `/callback/{provider}`, which sets the session cookie, then continues `oauth_query` or redirects to `return_to`. The callback grants the key of `oauth_query` only when Tempo ID's own sign-in page sent the browser here.",responses:{302:{description:`Redirects the browser to the provider.`},...az([...cz.errors,...i5.errors,...gz.errors,IL,t5])},tags:[`Authenticate`]}),cz(`param`,c5.signIn.param),cz(`query`,c5.signIn.query),async e=>{let t=e.req.valid(`query`),n=r5({google:f6()}).find(t=>t.id===e.req.valid(`param`).provider);if(!n)return X(e,new t5({provider:e.req.valid(`param`).provider}));let r=bz(e),i=await Z(e,gz(e,{limits:[{binding:`SIGN_IN_IP_LIMIT`,key:r?`provider:${r}`:void 0}]}),`RateLimit.check`);if(i)return i;let a=await Z(e,i5($,{clientId:t.client_id,own:new URL(Sb.URL).origin,returnTo:t.return_to??`/`}),`Provider.returnTo`);if(a instanceof MN)return X(e,a);let o=new URL(`/v1/auth/oauth/${n.id}/failed`,Sb.URL);o.searchParams.set(`return_to`,t.return_to??`/`),t.client_id&&o.searchParams.set(`client_id`,t.client_id);let s=await Z(e,e.var.auth.api.signInSocial({body:{callbackURL:a,disableRedirect:!0,errorCallbackURL:o.href,provider:n.id,...t.oauth_query?{oauth_query:t.oauth_query}:{}},headers:new Headers(e.req.raw.headers),returnHeaders:!0}),`auth.signInSocial`).catch(e=>{if(fn(e)&&e.body?.error===`invalid_signature`)return new IL;throw e});if(s instanceof MN)return X(e,s);for(let t of s.headers.getSetCookie())e.header(`set-cookie`,t,{append:!0});t.oauth_query&&e.req.header(`sec-fetch-site`)===`same-origin`?cR(e,a5,G6(new URLSearchParams(t.oauth_query)),{httpOnly:!0,maxAge:s5,path:`/`,prefix:`host`,sameSite:`Lax`,secure:!0}):lR(e,a5,{path:`/`,prefix:`host`,secure:!0});let c=t.oauth_query?new URLSearchParams(t.oauth_query).get(`client_id`):null;return c?cR(e,o5,c,{httpOnly:!0,maxAge:s5,path:`/`,prefix:`host`,sameSite:`Lax`,secure:!0}):lR(e,o5,{path:`/`,prefix:`host`,secure:!0}),e.header(`cache-control`,`private, no-store`),e.redirect(s.response.url??`/`,302)}).get(`/v1/auth/oauth/:provider/failed`,QR({description:"Redirects the browser from a failed provider sign-in to `return_to`, with `error=access_denied`. The code is the same for every cause, so it reveals neither the cause nor whether an account exists.",responses:{302:{description:"Redirects the browser to `return_to`."},...az([...cz.errors,...i5.errors])},tags:[`Authenticate`]}),cz(`param`,c5.failed.param),cz(`query`,c5.failed.query),async e=>{let t=e.req.valid(`query`),n=await Z(e,i5($,{clientId:t.client_id,own:new URL(Sb.URL).origin,returnTo:t.return_to??`/login`}),`Provider.returnTo`);if(n instanceof MN)return X(e,n);let r=new URL(n);return r.searchParams.set(`error`,`access_denied`),e.redirect(r.href,302)}).get(`/callback/:provider`,QR({description:"Receives the provider's redirect, sets the session cookie, and redirects the browser to `return_to`, or continues the app's authorization. For a user with no Tempo Account in the realm of the sign-in, it creates one, as `POST /v1/auth/code/verify` does. Every failure redirects to the failed route or to the sign-in page.",responses:{302:{description:"Redirects the browser to `return_to`, to the app's redirect URI, or to the failed route."},...az([])},tags:[`Authenticate`]}),oz(`param`,c5.callback.param),oz(`query`,c5.callback.query),async e=>{let t=await Z(e,e.var.auth.handler(e.req.raw),`auth.handler`),n=t.headers.get(`location`);if(t.status!==302||!n)return t;let r=t.headers.getSetCookie().map(e=>e.split(`;`,1)[0]).join(`; `),i=r?await Z(e,e.var.auth.api.getSession({headers:new Headers({cookie:r})}),`auth.getSession`).catch(t=>(wN(e,{error:t,message:`The provider sign-in created no first account, since its session failed to load.`}),null)):null;i&&await Z(e,j6(e,{clientId:oR(e,o5,`host`)??null,userId:i.user.id}),`FirstAccount.create`);let a=oR(e,a5,`host`),o=URL.parse(n,Sb.URL),s=a&&o&&G6(o.searchParams)===a?await Z(e,s8(e,{redirect:n,setCookie:t.headers.getSetCookie()}),`SignInConsent.afterSignIn`):n;if(!a&&s===n)return t;let c=new Headers(t.headers);return c.set(`location`,s),a&&c.append(`set-cookie`,at(`__Host-${a5}`,``,{httpOnly:!0,maxAge:0,path:`/`,sameSite:`Lax`,secure:!0})),new Response(null,{headers:c,status:302})}),u5=new Hy().route(`/`,A8).route(`/`,t2).route(`/`,h8).route(`/`,b8).route(`/`,O8).route(`/`,J8).route(`/`,l5),d5=new Hy().use(UL).use(_6()).use($y({referrerPolicy:`same-origin`})).use(sb()).use(`/.well-known/oauth-authorization-server`,O6).use(`/.well-known/openid-configuration`,O6).use(`/device/code`,O6).use(`/oauth2/introspect`,O6).use(`/oauth2/introspection`,O6).use(`/oauth2/jwks`,O6).use(`/oauth2/revoke`,O6).use(`/oauth2/token`,O6).use(`/oauth2/userinfo`,O6).use(`/v1/*`,D6).use(Gy([`/device/code`,`/oauth2/*`],Xy())).use(`/device/code`,iR).use(`/oauth2/*`,iR).use(`/v1/*`,iR).use(u6).route(`/`,u5).get(`/openapi.json`,QR({description:`Returns this OpenAPI document.`,responses:{200:{content:{"application/json":{schema:{type:`object`}}},description:`The OpenAPI 3.1 document.`},...az([])},tags:[`Reference`]}),async e=>e.json(await Z(e,nz(d5),`OpenApi.document`),200)).get(`/docs`,QR({description:`Renders this OpenAPI document as an API reference.`,responses:{200:{content:{"text/html":{schema:{type:`string`}}},description:`The API reference page.`},...az([])},tags:[`Reference`]}),e=>(e.header(`content-security-policy`,iz),e.html(rz))).all(`/:version{v\\d+}/*`,e=>X(e,new RN)).notFound(async e=>f5(e.req.path)?X(e,new RN):Z(e,e.env.pages(e),`page.render`)).onError(UN);function f5(e){if(p5.has(e))return!1;let t=e.split(`/`)[1]??``;return m5.has(t)||/^v\d+$/.test(t)}var p5=new Set([`/device`]),m5=new Set(d5.routes.flatMap(e=>{let t=e.path.split(`/`)[1]??``;return t&&t!==`*`&&!t.startsWith(`:`)?[t]:[]})),h5=new WeakSet;function g5(e){if(e instanceof Response)return e;let t;return t=e==null?new Response(null,{status:204}):typeof e==`string`?new Response(e,{headers:{"Content-Type":`text/html; charset=utf-8`}}):Response.json(e),h5.add(t),t}function _5(e){return Array.from(e,e=>({message:e.message,path:e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`)}))}async function v5(e,t){let n=await e[`~standard`].validate(t);return n.issues?{ok:!1,issues:n.issues}:{ok:!0,value:n.value}}async function y5(e,t){let n={},r=[];if(e.params){let i=t.req.param(),a=await v5(e.params,i);a.ok?n.params=a.value:r.push({slot:`params`,issues:_5(a.issues)})}if(e.query){let i=new URL(t.req.url),a={};for(let[e,t]of i.searchParams)a[e]=t;let o=await v5(e.query,a);o.ok?n.query=o.value:r.push({slot:`query`,issues:_5(o.issues)})}if(e.body){let i;try{i=await t.req.json()}catch{return{ok:!1,response:Response.json({error:`Invalid JSON body`},{status:400})}}let a=await v5(e.body,i);a.ok?n.body=a.value:r.push({slot:`body`,issues:_5(a.issues)})}return r.length>0?{ok:!1,response:Response.json({error:`Validation failed`,issues:r},{status:400})}:{ok:!0,input:n}}function b5(...e){if(e.length===1)return e[0];let t=e.slice(0,-1),n=e[e.length-1];return(async e=>{let r=0,i=async()=>{if(r<t.length){let n=t[r++],a=await n(e,i);a instanceof Response&&(e.res=a)}else e.res=g5(await n(e))};return await i(),e.res})}(function(e){function t(e){return t=>(async n=>{let r=await y5(e,n);return r.ok?g5(await t(n,r.input)):r.response})}e.withValidator=t})(b5||={}),new TextEncoder,new TextDecoder(`utf-8`,{fatal:!0});function x5(e){return e}var S5=x5(async e=>{let t=new Date;try{await L0.delete(fM).where(oA(fM.expiresAt,t)),await L0.delete(qj).where(oA(qj.expiresAt,t)),await L0.delete(hM).where(oA(hM.expiresAt,t)),await L0.delete(vM).where(oA(vM.expiresAt,t))}catch(t){throw xN({error:t,fields:{cron:e.cron},message:`The cleanup cron failed.`}),t}}),C5=[`ratelimit`,`ratelimit-policy`,`retry-after`],w5=[`cf-connecting-ip`,`cf-ray`,`cf-worker`,`user-agent`],T5=Ev(Fh),E5={fetch:(e,t,n)=>d5.fetch(e,{...t,pages:e=>D5(e,{env:t,ctx:n})},n),scheduled:(...e)=>Gv(e[1],()=>S5(...e))};async function D5(e,t){let{ctx:n,env:r}=t,i=A5(e.req.header(`cookie`)),a=new URL(e.req.url).origin,o,s,c=!1,l=async(t,o)=>{let l=new Request(t,o),u=new URL(l.url);if(u.origin!==a||!u.pathname.startsWith(`/v1/`))throw Error(`A page called a path outside the JSON API.`);i.size>0&&l.headers.set(`cookie`,j5(i));for(let t of w5){let n=e.req.header(t);n&&l.headers.set(t,n)}let d=await Z(e,Promise.resolve(d5.fetch(l,{...r,pages:()=>k5()},n)),`api`,`${l.method} ${new URL(l.url).pathname}`);for(let t of d.headers.getSetCookie())O5(i,{setCookie:t}),c?wN(e,{message:`A page set a cookie after its headers were sent.`}):e.header(`set-cookie`,t,{append:!0});return d.status===429&&(s??=d),d},u=await T5(e.req.raw,{context:{fetch:async(t,n)=>{o&&await Z(e,o.catch(()=>void 0),`api.wait`);let r=l(t,n);return o??=r,r},origin:a}});if(c=!0,e.header(`cache-control`,`private, no-store`),s&&u.status===200){for(let t of C5){let n=s.headers.get(t);n&&e.header(t,n)}return e.newResponse(u.body,{headers:u.headers,status:429})}return e.newResponse(u.body,u)}function O5(e,t){let[n,...r]=t.setCookie.split(`;`),i=n.indexOf(`=`),a=n.slice(0,i).trim(),o=n.slice(i+1).trim();r.some(e=>/^max-age=0$/i.test(e.trim()))||!o?e.delete(a):e.set(a,o)}function k5(){return Promise.resolve(new Response(null,{status:404}))}function A5(e){let t=new Map;for(let n of e?.split(`;`)??[]){let e=n.indexOf(`=`);e>0&&t.set(n.slice(0,e).trim(),n.slice(e+1).trim())}return t}function j5(e){return[...e].map(([e,t])=>`${e}=${t}`).join(`; `)}function M5(){let e=null;return async(t,n)=>{if(e)return e;let r=globalThis.__VITE_MANIFEST__;if(typeof r==`object`&&r)return e=r,e;let i=n?.ASSETS;if(!i||typeof i.fetch!=`function`)return null;let a=await i.fetch(new Request(new URL(`/.vite/manifest.json`,t.url).toString()));return a.ok?(e=await a.json(),e):null}}var N5={".avif":`image/avif`,".css":`text/css; charset=utf-8`,".gif":`image/gif`,".html":`text/html; charset=utf-8`,".ico":`image/x-icon`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".js":`text/javascript; charset=utf-8`,".json":`application/json; charset=utf-8`,".mjs":`text/javascript; charset=utf-8`,".png":`image/png`,".svg":`image/svg+xml`,".txt":`text/plain; charset=utf-8`,".wasm":`application/wasm`,".webp":`image/webp`,".woff":`font/woff`,".woff2":`font/woff2`};function P5(e,t,n=`assets`,r=!1){if(![`GET`,`HEAD`].includes(e.method)||![200,206,304].includes(t.status))return t;let i=new URL(e.url).pathname,a=i.slice(i.lastIndexOf(`/`)+1),o=a.slice(a.lastIndexOf(`.`)).toLowerCase(),s=new Headers(t.headers);!s.has(`Content-Type`)&&N5[o]&&s.set(`Content-Type`,N5[o]);let c=s.get(`Cache-Control`),l=(c??``).toLowerCase().split(`,`).map(e=>e.trim()).sort().join(`,`)===`max-age=0,must-revalidate,public`,u=r&&i.startsWith(`/`+n.replace(/^\/+|\/+$/g,``)+`/`)&&o!==`.html`&&!(s.get(`Content-Type`)??``).toLowerCase().includes(`text/html`);return!s.has(`Set-Cookie`)&&u&&(!c||l)?s.set(`Cache-Control`,`public, max-age=31536000, immutable`):c||s.set(`Cache-Control`,`no-store`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:s})}function F5(e,t=M5()){let n;return async(r,i,a)=>{let o=new URL(r.url).pathname;return![`GET`,`HEAD`].includes(r.method)||![200,206,304].includes(a.status)||!o.startsWith(`/`+(e??`assets`).replace(/^\/+|\/+$/g,``)+`/`)?P5(r,a,e):(n||=t(r,i).then(e=>new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.immutableFiles)?e.immutableFiles:[])),()=>new Set),P5(r,a,e,(await n).has(o.slice(1))))}}function I5(e={}){let t=F5(e.assetsDir);return async(n,r,i)=>{if(i.status!==404||!r.ASSETS||n.method!==`GET`&&n.method!==`HEAD`)return i;let a=await r.ASSETS.fetch(new Request(n.url,{method:n.method,headers:n.headers}));if(a.status!==404)return t(n,r,a);let o=n.headers.get(`accept`)??``;if(e.serveSpaFallback&&o.includes(`text/html`)){let e=new URL(`/index.html`,n.url),t=await r.ASSETS.fetch(new Request(e,{method:n.method}));if(t.status===200){let e=new Response(t.body,{status:200,headers:t.headers});return e.headers.set(`Cache-Control`,`no-store`),e.headers.set(`Content-Type`,`text/html; charset=utf-8`),e}}else if(!e.serveSpaFallback&&e.notFound===`404-page`&&o.includes(`text/html`)&&(a.headers.get(`content-type`)??``).includes(`text/html`)){let e=new Response(a.body,a);return e.headers.set(`Cache-Control`,`no-store`),e}return i}}var L5={...E5,fetch(e,t,n){return Gv(t,async()=>R5(e,t,await E5.fetch(e,t,n)))}},R5=I5({assetsDir:`assets`,serveSpaFallback:!1,notFound:`none`}),z5=L5??{};export{z5 as default};
|
|
574
|
+
//# sourceMappingURL=index.js.map
|