decocms 4.42.1 → 4.43.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/dist/client/assets/{AlertCircle-BUV1aaBB.js → AlertCircle-DvtRQCYv.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C5PTEkeN.js → ArrowUpRight-Ccucgaz_.js} +1 -1
- package/dist/client/assets/{Check-B16xJXjE.js → Check-1AhbfopT.js} +1 -1
- package/dist/client/assets/{CheckCircle-BcsYRx5f.js → CheckCircle-CQW-GNuy.js} +1 -1
- package/dist/client/assets/{ChevronDown-CcTWKRPg.js → ChevronDown-thhgCV2E.js} +1 -1
- package/dist/client/assets/{ChevronRight-CcgcZsYL.js → ChevronRight-DZPJaIEX.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCHrnAh6.js → ChevronUp-Dc62-eRv.js} +1 -1
- package/dist/client/assets/{Circle-CP3BX1rw.js → Circle-Dn2vS2a-.js} +1 -1
- package/dist/client/assets/{Copy01-BTdPDBN9.js → Copy01-BG-rBcpl.js} +1 -1
- package/dist/client/assets/{DotsVertical-DdWpUKpz.js → DotsVertical-fUZJiy5i.js} +1 -1
- package/dist/client/assets/{Eye-8fr_Pgxa.js → Eye-D49SR62-.js} +1 -1
- package/dist/client/assets/{FilterLines-BhagGFYG.js → FilterLines-CCeo4hC-.js} +1 -1
- package/dist/client/assets/{Globe01-Dvg2vd2p.js → Globe01-C7l6eoUR.js} +1 -1
- package/dist/client/assets/{Globe04-BSzzSQ4p.js → Globe04-CmxKHfOA.js} +1 -1
- package/dist/client/assets/{HardDrive-COFBbxS6.js → HardDrive-SmTw7Pbw.js} +1 -1
- package/dist/client/assets/{Key01-DFriydhl.js → Key01-CFM5AlUK.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bu4UzHdK.js → LayoutLeft-B1yO3vzD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-NA15RRaa.js → LinkExternal01-DI77PwBZ.js} +1 -1
- package/dist/client/assets/{List-BP287K_j.js → List-D4c5ohoR.js} +1 -1
- package/dist/client/assets/{Loading02-DXvcKtoc.js → Loading02-v_iGbleD.js} +1 -1
- package/dist/client/assets/{Monitor01-Td-GdAGC.js → Monitor01-CfeQQZB_.js} +1 -1
- package/dist/client/assets/{Palette-CUdoQUk3.js → Palette-DmE8bDGJ.js} +1 -1
- package/dist/client/assets/{Play-BhgmI7co.js → Play-s_rmfN6Y.js} +1 -1
- package/dist/client/assets/{Plus-DLawdkEq.js → Plus-BFGrEShV.js} +1 -1
- package/dist/client/assets/{SearchLg-CbQnZnSn.js → SearchLg-DUGp_z4X.js} +1 -1
- package/dist/client/assets/{SearchMd-CbuoT2qj.js → SearchMd-C-PZKjAP.js} +1 -1
- package/dist/client/assets/{Settings02-CQQdXaww.js → Settings02-DWwnscYM.js} +1 -1
- package/dist/client/assets/{Shield01-DtZY81u0.js → Shield01-BW7kVFPn.js} +1 -1
- package/dist/client/assets/{Star01-BnYY23Ra.js → Star01-BFRBJFSn.js} +1 -1
- package/dist/client/assets/{Stars01-dYe3LXjT.js → Stars01-DgTzFcHt.js} +1 -1
- package/dist/client/assets/{Stars02-DfpBD2GB.js → Stars02-BNbSygv0.js} +1 -1
- package/dist/client/assets/{Sun-z8YeD1S4.js → Sun-DGHtNKDi.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D2ejF96b.js → SwitchHorizontal01-BtMpZq59.js} +1 -1
- package/dist/client/assets/{Tool01-BEyDyPOp.js → Tool01-BpOHuROs.js} +1 -1
- package/dist/client/assets/{Trash01-BLVHcRAt.js → Trash01-C0JxJCpP.js} +1 -1
- package/dist/client/assets/{Upload01-B8-U1BRh.js → Upload01-D47KB4QK.js} +1 -1
- package/dist/client/assets/{User01-C3sDptA-.js → User01-BgQjYeSI.js} +1 -1
- package/dist/client/assets/{Users01-CuUXC1Ci.js → Users01-DUlUk8ny.js} +1 -1
- package/dist/client/assets/{Users03-R5e8a-ic.js → Users03-MbxrBFlH.js} +1 -1
- package/dist/client/assets/{X-BZoqOmD2.js → X-C-rdl5TG.js} +1 -1
- package/dist/client/assets/{XCircle-DPRLMCT4.js → XCircle-7RBaaQos.js} +1 -1
- package/dist/client/assets/{XClose-C_JaNpS1.js → XClose-Dev5QQio.js} +1 -1
- package/dist/client/assets/{Zap-xFZJwGEw.js → Zap-Bg5nCq9x.js} +1 -1
- package/dist/client/assets/{ZapSquare-CtbS5__E.js → ZapSquare-gvKqhmZF.js} +1 -1
- package/dist/client/assets/{ZoomOut-CfwWeUWz.js → ZoomOut-P-LJ4V-F.js} +1 -1
- package/dist/client/assets/{access-gate-CKAc3MI3.js → access-gate-DOOkCQ74.js} +1 -1
- package/dist/client/assets/add-section-modal-DEUc2HPl.js +1 -0
- package/dist/client/assets/{agent-capabilities-C8FAf02H.js → agent-capabilities-4BsjRrX4.js} +1 -1
- package/dist/client/assets/{agent-icon-CxboDRSz.js → agent-icon-9OkAFP-r.js} +1 -1
- package/dist/client/assets/{agents-list-jvSb6xVs.js → agents-list-DUwHIebf.js} +1 -1
- package/dist/client/assets/{ai-providers-C59nw8WL.js → ai-providers-B3lTreJE.js} +1 -1
- package/dist/client/assets/{alert-DNTB_hZa.js → alert-CYm29H7J.js} +1 -1
- package/dist/client/assets/{alert-dialog-DztyyUi4.js → alert-dialog-DgIyOOIV.js} +1 -1
- package/dist/client/assets/app-editor-COChoqx4.js +1 -0
- package/dist/client/assets/{auth-B49_gEpl.js → auth-DDpveqBA.js} +1 -1
- package/dist/client/assets/{auth-catchall-DCcZhJ5p.js → auth-catchall-BGvnUEtF.js} +1 -1
- package/dist/client/assets/{auth-entry-BvlziyC8.js → auth-entry-DMJ0N4as.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BYs9kt-I.js → auth-split-layout-BudAVVo5.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C-vgMxhR.js → authenticate-and-persist-oauth-wR_cG2Um.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cf-bRsMO.js → automation-list-row-D0Em5uIa.js} +1 -1
- package/dist/client/assets/{automation-runs-DBVJ_kj9.js → automation-runs-CO8Pymiw.js} +2 -2
- package/dist/client/assets/{automations-BmlQyKZJ.js → automations-BIqBOxuS.js} +1 -1
- package/dist/client/assets/{autosend-PPQPd6hx.js → autosend-BtAvBaan.js} +1 -1
- package/dist/client/assets/{avatar-ANBinthd.js → avatar-D-gV4XRl.js} +1 -1
- package/dist/client/assets/{badge-BuGvx5wO.js → badge-CjY3jPRV.js} +1 -1
- package/dist/client/assets/{block-document-CKRnkLuF.js → block-document-CMPA5U-p.js} +3 -3
- package/dist/client/assets/{brand-context-D0e9ClrU.js → brand-context-BOgXJUxE.js} +1 -1
- package/dist/client/assets/{breadcrumb-B3Z_-uKL.js → breadcrumb-DwCp48rX.js} +1 -1
- package/dist/client/assets/{buckets-4KVSvyFr.js → buckets-Bb1TNWab.js} +1 -1
- package/dist/client/assets/bulk-category-panel-0RIaIAgN.js +1 -0
- package/dist/client/assets/{calendar-DnSwKPIN.js → calendar-DUsUCbpl.js} +1 -1
- package/dist/client/assets/{capability-load-error-sYOaQ0g0.js → capability-load-error-TVdGYk4G.js} +1 -1
- package/dist/client/assets/{card-DJqFWzIJ.js → card-BmzrxW9c.js} +1 -1
- package/dist/client/assets/category-editor-Df206pkU.js +1 -0
- package/dist/client/assets/{chat-context-DCZGSOx8.js → chat-context-EjY1qL0Z.js} +1 -1
- package/dist/client/assets/{checkbox-COswPEj2.js → checkbox-G4phjz2b.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bv-I3_Gx.js → cli-auth-success-CIXoobY3.js} +1 -1
- package/dist/client/assets/collection-detail-CeFAWnjG.js +1 -0
- package/dist/client/assets/{collection-display-button-oD6CYYEi.js → collection-display-button-D5e3cL6o.js} +1 -1
- package/dist/client/assets/{collection-search-CcVZ5PBf.js → collection-search-DQrvKQn1.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dge6GrJC.js → collection-table-wrapper-CquBmnlD.js} +1 -1
- package/dist/client/assets/{collection-tabs-DWNEk1Al.js → collection-tabs-CbZk9u9l.js} +1 -1
- package/dist/client/assets/{command-XRq6AHU5.js → command-COWoojzJ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BCHKuTrr.js → commerce-onboarding-BeTqoPNV.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CdGFPNIo.js → connect-desktop-dialog-BeNCXFWj.js} +1 -1
- package/dist/client/assets/{connection-card-CTO6rag4.js → connection-card-BxXvJIXZ.js} +1 -1
- package/dist/client/assets/connection-detail-Dfja2B2f.js +1 -0
- package/dist/client/assets/{connection-form-helpers-OplPjIR_.js → connection-form-helpers-DARuXHFZ.js} +1 -1
- package/dist/client/assets/connections-CSkEKBZR.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-DP8aNAOD.js → decopilot-sse-pool-B7f_KiC8.js} +1 -1
- package/dist/client/assets/{dialog-DApjYcGg.js → dialog-CFHN8WR8.js} +1 -1
- package/dist/client/assets/{domain-settings-CiG1vjfL.js → domain-settings-Cw9VS-jM.js} +1 -1
- package/dist/client/assets/{drawer-CTO2hLFc.js → drawer-BMpESqTZ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C1VpDy3z.js → dropdown-menu-ClxjNYGP.js} +1 -1
- package/dist/client/assets/{empty-state-_kCTiI7J.js → empty-state-CTye-AXb.js} +1 -1
- package/dist/client/assets/{extract-connection-data-q9aI-svo.js → extract-connection-data-B-Dk4FlV.js} +1 -1
- package/dist/client/assets/file-explorer-CIMwo7jr.js +2 -0
- package/dist/client/assets/{file-type-icon-BwLjGPIE.js → file-type-icon-BlsKdJw9.js} +1 -1
- package/dist/client/assets/{files-DbPQpdYj.js → files-ss-TYfgu.js} +1 -1
- package/dist/client/assets/{form-FihqRwG5.js → form-CT2aN6XY.js} +1 -1
- package/dist/client/assets/{general-WssWwsmi.js → general--I5KqlRQ.js} +1 -1
- package/dist/client/assets/github-repo-picker-DusApox9.js +1 -0
- package/dist/client/assets/{hooks-DBr0m9c1.js → hooks-CdCG-7wg.js} +1 -1
- package/dist/client/assets/{index-N9_ZF8cE.js → index-AiNMImXi.js} +10 -10
- package/dist/client/assets/{index-IrvmnvcP.js → index-B1p4L7xy.js} +3 -3
- package/dist/client/assets/{index-CbmxR1uM.js → index-B44kz-nC.js} +1 -1
- package/dist/client/assets/{index-BvrYnHg7.js → index-Bey8F132.js} +1 -1
- package/dist/client/assets/{index-87jGW96_.js → index-Bm_EZj8m.js} +1 -1
- package/dist/client/assets/{index-DZfqLgYu.js → index-D35mOyMV.js} +1 -1
- package/dist/client/assets/{index-D23suRTi.js → index-DBcAf61g.js} +1 -1
- package/dist/client/assets/{index-zDs19lPZ.js → index-DILe9AMB.js} +1 -1
- package/dist/client/assets/{index-D-LnlVR-.js → index-DQdKjxkd.js} +1 -1
- package/dist/client/assets/index-DhHJ9QL9.css +1 -0
- package/dist/client/assets/{index-C_QjJ53G.js → index-DoTvTLuW.js} +8 -8
- package/dist/client/assets/{index-V6HPX6V9.js → index-O3o1D8on.js} +1 -1
- package/dist/client/assets/{index-Dx7DdQRD.js → index-mNvg-Lqv.js} +1 -1
- package/dist/client/assets/{index-redirect-DZROBaZp.js → index-redirect-BMGbap1t.js} +1 -1
- package/dist/client/assets/{index-BIkrNFxo.js → index-rztj0Nqs.js} +1 -1
- package/dist/client/assets/index-wIKKJbMn.js +217 -0
- package/dist/client/assets/{input-D0zl9pbZ.js → input-COfOcTfg.js} +1 -1
- package/dist/client/assets/{integration-icon-CidjOFvm.js → integration-icon-olCk4RU0.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-B2Y_TvJZ.js → invite-member-dialog-B178fzsZ.js} +1 -1
- package/dist/client/assets/{label-rMO70OLY.js → label-Q32tAJ1R.js} +1 -1
- package/dist/client/assets/{login-DOZHO9E2.js → login-2XaS9hkp.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B2qTVLOE.js → mcp-oauth-Dv1nblU3.js} +1 -1
- package/dist/client/assets/{members-CSK3868z.js → members-B0G6c1op.js} +1 -1
- package/dist/client/assets/{monaco-editor-BOuR6H_P.js → monaco-editor-DyrWXRI-.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-BmSEk4JX.js → monitoring-stats-row-B3GS5Cpm.js} +1 -1
- package/dist/client/assets/{oauth-callback-OQFjwRKe.js → oauth-callback-DYLJAZCI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DrTpi1tG.js → oauth-callback-ai-provider-rdUL0BWX.js} +1 -1
- package/dist/client/assets/{onboarding-nIzVSXob.js → onboarding-B_o-kvWj.js} +1 -1
- package/dist/client/assets/{org-install-BMP-9_b6.js → org-install-C9o_3Ac4.js} +1 -1
- package/dist/client/assets/{org-layout-8bhX7pQC.js → org-layout-BdKBHC6w.js} +1 -1
- package/dist/client/assets/{organization-choice-DiABJQkd.js → organization-choice-BLPTZh5G.js} +1 -1
- package/dist/client/assets/page-seo-form-D8WzQOSZ.js +1 -0
- package/dist/client/assets/page-seo-sheet-CH-a7ZNx.js +1 -0
- package/dist/client/assets/{popover-QyTTRoCY.js → popover-DrQdMWbL.js} +1 -1
- package/dist/client/assets/post-editor-BTTkowtR.js +1 -0
- package/dist/client/assets/{primitives-Gory5Wuu.js → primitives-RRgnUbmE.js} +1 -1
- package/dist/client/assets/{profile-DR-6zBTk.js → profile-CoDoWWWA.js} +1 -1
- package/dist/client/assets/project-app-view-DQACBpg8.js +1 -0
- package/dist/client/assets/record-editor-BlgkyopG.js +1 -0
- package/dist/client/assets/registry-IyO3mLgs.js +2 -0
- package/dist/client/assets/{registry-layout-ChE1SgAD.js → registry-layout-Di9a1VSl.js} +1 -1
- package/dist/client/assets/{require-capability-tPA0YjZg.js → require-capability-L8woHi8L.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BibPmRFP.js → required-auth-layout-D_UmgVgj.js} +1 -1
- package/dist/client/assets/{reset-password-Ml42vC8p.js → reset-password-DuQNc2ea.js} +1 -1
- package/dist/client/assets/{roles-zoLqZoaX.js → roles-CpNKG1bi.js} +1 -1
- package/dist/client/assets/{search-input-CtOw9M3F.js → search-input-DuFOeaoc.js} +1 -1
- package/dist/client/assets/{secrets-D0zh91De.js → secrets-DndEjy4g.js} +1 -1
- package/dist/client/assets/{sections-editor-BobRAdzx.js → sections-editor-BAggpkFj.js} +2 -2
- package/dist/client/assets/{select-model-DXWN98pQ.js → select-model-CsEgQX1h.js} +1 -1
- package/dist/client/assets/{select-CArP3-Qg.js → select-nj39Xl9g.js} +1 -1
- package/dist/client/assets/{seo-editor-DAC90b40.js → seo-editor-RoAVYvz1.js} +1 -1
- package/dist/client/assets/{settings-layout-B3ALc5wh.js → settings-layout-Cb3KTyHO.js} +1 -1
- package/dist/client/assets/{settings-section-C-Mqos9P.js → settings-section-CoXgvyiy.js} +1 -1
- package/dist/client/assets/{shell-controls-CR5QuGOk.js → shell-controls-DY5qDpI-.js} +1 -1
- package/dist/client/assets/shell-layout-D5Tkk5tH.js +1 -0
- package/dist/client/assets/{sidebar-CmadAIxp.js → sidebar-txtWH5St.js} +1 -1
- package/dist/client/assets/{skeleton-B1XTWwJr.js → skeleton-8jupCkd8.js} +1 -1
- package/dist/client/assets/{sso-DTTEgRnf.js → sso-DLS5LHNj.js} +1 -1
- package/dist/client/assets/{store-CqpUz5qD.js → store-C53RYCQG.js} +1 -1
- package/dist/client/assets/store-registry-BmEMUup4.js +2 -0
- package/dist/client/assets/{studio-tools-CMklO0EH.js → studio-tools-CfkRZ1YM.js} +1 -1
- package/dist/client/assets/{switch-CS3osMxV.js → switch-aRWnverE.js} +1 -1
- package/dist/client/assets/{tab-id-C4S0EPFu.js → tab-id-DAJ8K7VA.js} +1 -1
- package/dist/client/assets/{table-DzJIbaR4.js → table-BU2BnAWS.js} +1 -1
- package/dist/client/assets/{tabs-C0qUbd04.js → tabs-BLFqUOCt.js} +1 -1
- package/dist/client/assets/{textarea-RkaMNWZ5.js → textarea-DvF5tXEe.js} +1 -1
- package/dist/client/assets/{toggle-group-DlYKy-SR.js → toggle-group-g0pWvTbE.js} +1 -1
- package/dist/client/assets/{toolbar-JOUseasH.js → toolbar-DXR73YRd.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DRxYzGI_.js → toolbar-icon-button-BVcQ5Dey.js} +1 -1
- package/dist/client/assets/{tools-list-C9bngZEZ.js → tools-list-Z9fMoQl1.js} +1 -1
- package/dist/client/assets/{tooltip-DyTNjtAQ.js → tooltip-DQcMLwk8.js} +1 -1
- package/dist/client/assets/{types-DqPYg5H4.js → types-zSS23HiR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CwEQhJ2W.js → use-ai-providers-Clr7IIHN.js} +1 -1
- package/dist/client/assets/{use-automations-24HA54lb.js → use-automations-CppOqeUX.js} +1 -1
- package/dist/client/assets/{use-capability-Bu7oVEGz.js → use-capability-BIxpyEPE.js} +1 -1
- package/dist/client/assets/{use-clock-tick-GChsORgt.js → use-clock-tick-Bvm-R4_W.js} +1 -1
- package/dist/client/assets/{use-collections-Div5qFbc.js → use-collections-B77ZVF9z.js} +1 -1
- package/dist/client/assets/{use-connection-BKUxTste.js → use-connection-DdehZbfu.js} +1 -1
- package/dist/client/assets/{use-copy-BHeV6ukd.js → use-copy-D3hc40gU.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B-E2mnFx.js → use-create-virtual-mcp-DCTv12m8.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BVvoOyoc.js → use-debounced-autosave-_JUOpNMN.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C8XEyKzu.js → use-debounced-value-Ct0yrZgF.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-OBFeu75Z.js → use-decopilot-events-uFkDOpvm.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B3dSyaRN.js → use-delete-connection-BmsZp-X6.js} +1 -1
- package/dist/client/assets/{use-file-configs-DxlPDMzg.js → use-file-configs-CBiIz_tv.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C4LN8_oB.js → use-infinite-scroll-DAud6nnU.js} +1 -1
- package/dist/client/assets/{use-join-requests-BOWtWdxW.js → use-join-requests-v4ci6ZCc.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DQUOeFco.js → use-mcp-client-Ce65LHLZ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Bk99_Vhn.js → use-mcp-prompts-EzO_H1D0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B-jAiNbN.js → use-mcp-tools-wyWoseD8.js} +1 -1
- package/dist/client/assets/{use-members-Bo1aF7BX.js → use-members-CDSIRcpO.js} +1 -1
- package/dist/client/assets/{use-mobile-Cd7zsr90.js → use-mobile-aJeg83By.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DSHaKE7a.js → use-navigate-to-agent-Bkjan7LI.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DFUm7cjy.js → use-org-auth-client-BbjUQVqh.js} +1 -1
- package/dist/client/assets/{use-org-sso-DbVvgjNR.js → use-org-sso-C5O7PVDL.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BkZ-PQ8-.js → use-organization-roles-29uutxC_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DjQ8N7Gc.js → use-organization-settings-_Mqt5tk-.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B-fnx9yk.js → use-registry-connections-DSLsZHiz.js} +1 -1
- package/dist/client/assets/{use-secrets-DxDpkkMJ.js → use-secrets-NraGdmVS.js} +1 -1
- package/dist/client/assets/{use-status-sounds-IgpOZOBg.js → use-status-sounds-DXE25Zbf.js} +1 -1
- package/dist/client/assets/{use-view-mode-DuI_cKCa.js → use-view-mode-2GDY74X0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CU2FdJRv.js → use-virtual-mcp-kMy2a8D0.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DyWbJCvb.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-C0MuKke7.js +1 -0
- package/dist/client/assets/{variant-calendar-9xplS-lW.js → variant-calendar-Dn7m-P38.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CYgQfD6c.js → view-mode-toggle-BdVAl9Cq.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-Cg4oWrNi.js +0 -1
- package/dist/client/assets/app-editor-BX4EZ6KL.js +0 -1
- package/dist/client/assets/bulk-category-panel-C44iHroM.js +0 -1
- package/dist/client/assets/category-editor-BP7qnK1m.js +0 -1
- package/dist/client/assets/collection-detail-6gCqNuEz.js +0 -1
- package/dist/client/assets/connection-detail-YTipj66f.js +0 -1
- package/dist/client/assets/connections-CwAnq_cV.js +0 -1
- package/dist/client/assets/file-explorer-CjideV3r.js +0 -2
- package/dist/client/assets/github-repo-picker-eJFRPx1Y.js +0 -1
- package/dist/client/assets/index-C2ybUFaX.css +0 -1
- package/dist/client/assets/index-_2thZC-g.js +0 -217
- package/dist/client/assets/page-seo-form-C6zuc-ks.js +0 -1
- package/dist/client/assets/page-seo-sheet-BSKIhvTU.js +0 -1
- package/dist/client/assets/post-editor-CSOkNCi2.js +0 -1
- package/dist/client/assets/project-app-view-DO8B8CEU.js +0 -1
- package/dist/client/assets/record-editor-Uf0eMG9E.js +0 -1
- package/dist/client/assets/registry-BDxKgIex.js +0 -2
- package/dist/client/assets/shell-layout-CMtQD7SX.js +0 -1
- package/dist/client/assets/store-registry-BI075YdI.js +0 -2
- package/dist/client/assets/useInfiniteQuery-F3NAb6sv.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-z5EP-RbA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-2XaS9hkp.js","assets/auth-entry-DMJ0N4as.js","assets/input-COfOcTfg.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/auth-split-layout-BudAVVo5.js","assets/cli-auth-success-CIXoobY3.js","assets/reset-password-DuQNc2ea.js","assets/oauth-callback-DYLJAZCI.js","assets/mcp-oauth-Dv1nblU3.js","assets/auth-DDpveqBA.js","assets/shell-layout-D5Tkk5tH.js","assets/avatar-D-gV4XRl.js","assets/User01-BgQjYeSI.js","assets/Users03-MbxrBFlH.js","assets/SearchLg-DUGp_z4X.js","assets/Stars02-BNbSygv0.js","assets/XClose-Dev5QQio.js","assets/CheckCircle-CQW-GNuy.js","assets/FilterLines-CCeo4hC-.js","assets/Zap-Bg5nCq9x.js","assets/dialog-CFHN8WR8.js","assets/X-C-rdl5TG.js","assets/alert-dialog-DgIyOOIV.js","assets/required-auth-layout-D_UmgVgj.js","assets/autosend-BtAvBaan.js","assets/use-mcp-client-Ce65LHLZ.js","assets/constants-B72Xmt_K.js","assets/hooks-CdCG-7wg.js","assets/decopilot-sse-pool-B7f_KiC8.js","assets/tab-id-DAJ8K7VA.js","assets/use-organization-settings-_Mqt5tk-.js","assets/studio-tools-CfkRZ1YM.js","assets/use-org-sso-C5O7PVDL.js","assets/onboarding-B_o-kvWj.js","assets/organization-choice-BLPTZh5G.js","assets/label-Q32tAJ1R.js","assets/switch-aRWnverE.js","assets/Globe04-CmxKHfOA.js","assets/Palette-DmE8bDGJ.js","assets/Upload01-D47KB4QK.js","assets/commerce-onboarding-BeTqoPNV.js","assets/XCircle-7RBaaQos.js","assets/integration-icon-olCk4RU0.js","assets/agent-icon-9OkAFP-r.js","assets/AlertCircle-DvtRQCYv.js","assets/Tool01-BpOHuROs.js","assets/SwitchHorizontal01-BtMpZq59.js","assets/Settings02-DWwnscYM.js","assets/ArrowUpRight-Ccucgaz_.js","assets/ZapSquare-gvKqhmZF.js","assets/Loading02-v_iGbleD.js","assets/Check-1AhbfopT.js","assets/ChevronDown-thhgCV2E.js","assets/ChevronRight-DZPJaIEX.js","assets/ChevronUp-Dc62-eRv.js","assets/Circle-Dn2vS2a-.js","assets/Copy01-BG-rBcpl.js","assets/ZoomOut-P-LJ4V-F.js","assets/DotsVertical-fUZJiy5i.js","assets/Globe01-C7l6eoUR.js","assets/Eye-D49SR62-.js","assets/Star01-BFRBJFSn.js","assets/HardDrive-SmTw7Pbw.js","assets/Key01-CFM5AlUK.js","assets/LayoutLeft-B1yO3vzD.js","assets/LinkExternal01-DI77PwBZ.js","assets/List-D4c5ohoR.js","assets/Monitor01-CfeQQZB_.js","assets/Sun-DGHtNKDi.js","assets/Play-s_rmfN6Y.js","assets/Plus-BFGrEShV.js","assets/SearchMd-C-PZKjAP.js","assets/Shield01-BW7kVFPn.js","assets/Stars01-DgTzFcHt.js","assets/Trash01-C0JxJCpP.js","assets/Users01-DUlUk8ny.js","assets/tooltip-DQcMLwk8.js","assets/extract-connection-data-B-Dk4FlV.js","assets/form-CT2aN6XY.js","assets/use-debounced-value-Ct0yrZgF.js","assets/github-installations-DzN1UQ4x.js","assets/authenticate-and-persist-oauth-wR_cG2Um.js","assets/index-DBcAf61g.js","assets/sidebar-txtWH5St.js","assets/use-mobile-aJeg83By.js","assets/skeleton-8jupCkd8.js","assets/toolbar-icon-button-BVcQ5Dey.js","assets/popover-DrQdMWbL.js","assets/drawer-BMpESqTZ.js","assets/index-B44kz-nC.js","assets/invite-member-dialog-B178fzsZ.js","assets/select-nj39Xl9g.js","assets/textarea-DvF5tXEe.js","assets/use-org-auth-client-BbjUQVqh.js","assets/use-organization-roles-29uutxC_.js","assets/agent-capabilities-4BsjRrX4.js","assets/connection-slug-eyAPH6o3.js","assets/connection-card-BxXvJIXZ.js","assets/use-registry-connections-DSLsZHiz.js","assets/use-connection-DdehZbfu.js","assets/use-collections-B77ZVF9z.js","assets/useInfiniteQuery-DyWbJCvb.js","assets/use-infinite-scroll-DAud6nnU.js","assets/card-BmzrxW9c.js","assets/collection-search-DQrvKQn1.js","assets/collection-tabs-CbZk9u9l.js","assets/badge-CjY3jPRV.js","assets/connection-form-helpers-DARuXHFZ.js","assets/useSuspenseInfiniteQuery-C0MuKke7.js","assets/use-ai-providers-Clr7IIHN.js","assets/connect-desktop-dialog-BeNCXFWj.js","assets/chat-context-EjY1qL0Z.js","assets/use-virtual-mcp-kMy2a8D0.js","assets/use-decopilot-events-uFkDOpvm.js","assets/toggle-group-g0pWvTbE.js","assets/command-COWoojzJ.js","assets/index-Bey8F132.js","assets/shell-controls-DY5qDpI-.js","assets/use-clock-tick-Bvm-R4_W.js","assets/format-time-Cy7tTmZp.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-navigate-to-agent-Bkjan7LI.js","assets/reusable-new-chat-qqWu133U.js","assets/breadcrumb-DwCp48rX.js","assets/github-repo-picker-DusApox9.js","assets/use-mcp-tools-wyWoseD8.js","assets/toolbar-DXR73YRd.js","assets/index-wIKKJbMn.js","assets/automation-runs-CO8Pymiw.js","assets/table-BU2BnAWS.js","assets/empty-state-CTye-AXb.js","assets/use-members-CDSIRcpO.js","assets/use-automations-CppOqeUX.js","assets/checkbox-G4phjz2b.js","assets/use-copy-D3hc40gU.js","assets/file-type-icon-BlsKdJw9.js","assets/monaco-editor-DyrWXRI-.js","assets/index-B1p4L7xy.js","assets/types-zSS23HiR.js","assets/use-mcp-prompts-EzO_H1D0.js","assets/tabs-BLFqUOCt.js","assets/select-model-CsEgQX1h.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-CoXgvyiy.js","assets/dropdown-menu-ClxjNYGP.js","assets/index-DoTvTLuW.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-DXE25Zbf.js","assets/use-capability-BIxpyEPE.js","assets/tools-list-Z9fMoQl1.js","assets/use-debounced-autosave-_JUOpNMN.js","assets/index-rztj0Nqs.js","assets/search-input-DuFOeaoc.js","assets/use-secrets-NraGdmVS.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/index-Bm_EZj8m.js","assets/get-initials-D-f_fDFw.js","assets/calendar-DUsUCbpl.js","assets/use-file-configs-CBiIz_tv.js","assets/automation-list-row-D0Em5uIa.js","assets/index-DDGTF8rc.css","assets/index-DQdKjxkd.js","assets/settings-layout-Cb3KTyHO.js","assets/use-join-requests-v4ci6ZCc.js","assets/index-redirect-BMGbap1t.js","assets/capability-load-error-TVdGYk4G.js","assets/connections-CSkEKBZR.js","assets/collection-display-button-D5e3cL6o.js","assets/view-mode-toggle-BdVAl9Cq.js","assets/use-delete-connection-BmsZp-X6.js","assets/use-view-mode-2GDY74X0.js","assets/connection-detail-Dfja2B2f.js","assets/index-DILe9AMB.js","assets/index-D35mOyMV.js","assets/index-O3o1D8on.js","assets/use-create-virtual-mcp-DCTv12m8.js","assets/monitoring-stats-row-B3GS5Cpm.js","assets/collection-detail-CeFAWnjG.js","assets/alert-CYm29H7J.js","assets/index-mNvg-Lqv.js","assets/require-capability-L8woHi8L.js","assets/access-gate-DOOkCQ74.js","assets/general--I5KqlRQ.js","assets/domain-settings-Cw9VS-jM.js","assets/brand-context-BOgXJUxE.js","assets/ai-providers-B3lTreJE.js","assets/secrets-DndEjy4g.js","assets/buckets-Bb1TNWab.js","assets/members-B0G6c1op.js","assets/collection-table-wrapper-CquBmnlD.js","assets/roles-CpNKG1bi.js","assets/sso-DLS5LHNj.js","assets/profile-CoDoWWWA.js","assets/store-C53RYCQG.js","assets/registry-IyO3mLgs.js","assets/store-registry-BmEMUup4.js","assets/agents-list-DUwHIebf.js","assets/automations-BIqBOxuS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function Oj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const Tj="modulepreload",Cj=function(e){return"/"+e},g2={},Et=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");o=l(n.map(f=>{if(f=Cj(f),f in g2)return;g2[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":Tj,p||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),p)return new Promise((v,_)=>{g.addEventListener("load",v),g.addEventListener("error",()=>_(Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var vce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ay={exports:{}},Wu={};var v2;function Aj(){if(v2)return Wu;v2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Wu.Fragment=t,Wu.jsx=n,Wu.jsxs=n,Wu}var y2;function Ij(){return y2||(y2=1,Ay.exports=Aj()),Ay.exports}var C=Ij(),Iy={exports:{}},Qu={},My={exports:{}},Py={};var _2;function Mj(){return _2||(_2=1,(function(e){function t(H,W){var te=H.length;H.push(W);e:for(;0<te;){var le=te-1>>>1,Q=H[le];if(0<o(Q,W))H[le]=W,H[te]=Q,te=le;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var W=H[0],te=H.pop();if(te!==W){H[0]=te;e:for(var le=0,Q=H.length,k=Q>>>1;le<k;){var G=2*(le+1)-1,V=H[G],D=G+1,U=H[D];if(0>o(V,te))D<Q&&0>o(U,V)?(H[le]=U,H[D]=te,le=D):(H[le]=V,H[G]=te,le=G);else if(D<Q&&0>o(U,te))H[le]=U,H[D]=te,le=D;else break e}}return W}function o(H,W){var te=H.sortIndex-W.sortIndex;return te!==0?te:H.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,h=null,g=3,v=!1,_=!1,b=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(H){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=H)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function O(H){if(b=!1,R(H),!_)if(n(d)!==null)_=!0,A||(A=!0,B());else{var W=n(f);W!==null&&ie(O,W.startTime-H)}}var A=!1,I=-1,P=5,L=-1;function q(){return x?!0:!(e.unstable_now()-L<P)}function j(){if(x=!1,A){var H=e.unstable_now();L=H;var W=!0;try{e:{_=!1,b&&(b=!1,E(I),I=-1),v=!0;var te=g;try{t:{for(R(H),h=n(d);h!==null&&!(h.expirationTime>H&&q());){var le=h.callback;if(typeof le=="function"){h.callback=null,g=h.priorityLevel;var Q=le(h.expirationTime<=H);if(H=e.unstable_now(),typeof Q=="function"){h.callback=Q,R(H),W=!0;break t}h===n(d)&&r(d),R(H)}else r(d);h=n(d)}if(h!==null)W=!0;else{var k=n(f);k!==null&&ie(O,k.startTime-H),W=!1}}break e}finally{h=null,g=te,v=!1}W=void 0}}finally{W?B():A=!1}}}var B;if(typeof T=="function")B=function(){T(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,Z=F.port2;F.port1.onmessage=j,B=function(){Z.postMessage(null)}}else B=function(){S(j,0)};function ie(H,W){I=S(function(){H(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var te=g;g=W;try{return H()}finally{g=te}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(H,W){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var te=g;g=H;try{return W()}finally{g=te}},e.unstable_scheduleCallback=function(H,W,te){var le=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?le+te:le):te=le,H){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=te+Q,H={id:p++,callback:W,priorityLevel:H,startTime:te,expirationTime:Q,sortIndex:-1},te>le?(H.sortIndex=te,t(f,H),n(d)===null&&H===n(f)&&(b?(E(I),I=-1):b=!0,ie(O,te-le))):(H.sortIndex=Q,t(d,H),_||v||(_=!0,A||(A=!0,B()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var W=g;return function(){var te=g;g=W;try{return H.apply(this,arguments)}finally{g=te}}}})(Py)),Py}var b2;function Pj(){return b2||(b2=1,My.exports=Mj()),My.exports}var Ny={exports:{}},ot={};var w2;function Nj(){if(w2)return ot;w2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=g&&k[g]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function S(k,G,V){this.props=k,this.context=G,this.refs=x,this.updater=V||_}S.prototype.isReactComponent={},S.prototype.setState=function(k,G){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,G,"setState")},S.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function E(){}E.prototype=S.prototype;function T(k,G,V){this.props=k,this.context=G,this.refs=x,this.updater=V||_}var R=T.prototype=new E;R.constructor=T,b(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function A(){}var I={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function L(k,G,V){var D=V.ref;return{$$typeof:e,type:k,key:G,ref:D!==void 0?D:null,props:V}}function q(k,G){return L(k.type,G,k.props)}function j(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function B(k){var G={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(V){return G[V]})}var F=/\/+/g;function Z(k,G){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):G.toString(36)}function ie(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(A,A):(k.status="pending",k.then(function(G){k.status==="pending"&&(k.status="fulfilled",k.value=G)},function(G){k.status==="pending"&&(k.status="rejected",k.reason=G)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function H(k,G,V,D,U){var X=typeof k;(X==="undefined"||X==="boolean")&&(k=null);var fe=!1;if(k===null)fe=!0;else switch(X){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(k.$$typeof){case e:case t:fe=!0;break;case p:return fe=k._init,H(fe(k._payload),G,V,D,U)}}if(fe)return U=U(k),fe=D===""?"."+Z(k,0):D,O(U)?(V="",fe!=null&&(V=fe.replace(F,"$&/")+"/"),H(U,G,V,"",function(je){return je})):U!=null&&(j(U)&&(U=q(U,V+(U.key==null||k&&k.key===U.key?"":(""+U.key).replace(F,"$&/")+"/")+fe)),G.push(U)),1;fe=0;var pe=D===""?".":D+":";if(O(k))for(var xe=0;xe<k.length;xe++)D=k[xe],X=pe+Z(D,xe),fe+=H(D,G,V,X,U);else if(xe=v(k),typeof xe=="function")for(k=xe.call(k),xe=0;!(D=k.next()).done;)D=D.value,X=pe+Z(D,xe++),fe+=H(D,G,V,X,U);else if(X==="object"){if(typeof k.then=="function")return H(ie(k),G,V,D,U);throw G=String(k),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return fe}function W(k,G,V){if(k==null)return k;var D=[],U=0;return H(k,D,"","",function(X){return G.call(V,X,U++)}),D}function te(k){if(k._status===-1){var G=k._result;G=G(),G.then(function(V){(k._status===0||k._status===-1)&&(k._status=1,k._result=V)},function(V){(k._status===0||k._status===-1)&&(k._status=2,k._result=V)}),k._status===-1&&(k._status=0,k._result=G)}if(k._status===1)return k._result.default;throw k._result}var le=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Q={map:W,forEach:function(k,G,V){W(k,function(){G.apply(this,arguments)},V)},count:function(k){var G=0;return W(k,function(){G++}),G},toArray:function(k){return W(k,function(G){return G})||[]},only:function(k){if(!j(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return ot.Activity=h,ot.Children=Q,ot.Component=S,ot.Fragment=n,ot.Profiler=o,ot.PureComponent=T,ot.StrictMode=r,ot.Suspense=d,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ot.__COMPILER_RUNTIME={__proto__:null,c:function(k){return I.H.useMemoCache(k)}},ot.cache=function(k){return function(){return k.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(k,G,V){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var D=b({},k.props),U=k.key;if(G!=null)for(X in G.key!==void 0&&(U=""+G.key),G)!P.call(G,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&G.ref===void 0||(D[X]=G[X]);var X=arguments.length-2;if(X===1)D.children=V;else if(1<X){for(var fe=Array(X),pe=0;pe<X;pe++)fe[pe]=arguments[pe+2];D.children=fe}return L(k.type,U,D)},ot.createContext=function(k){return k={$$typeof:l,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:s,_context:k},k},ot.createElement=function(k,G,V){var D,U={},X=null;if(G!=null)for(D in G.key!==void 0&&(X=""+G.key),G)P.call(G,D)&&D!=="key"&&D!=="__self"&&D!=="__source"&&(U[D]=G[D]);var fe=arguments.length-2;if(fe===1)U.children=V;else if(1<fe){for(var pe=Array(fe),xe=0;xe<fe;xe++)pe[xe]=arguments[xe+2];U.children=pe}if(k&&k.defaultProps)for(D in fe=k.defaultProps,fe)U[D]===void 0&&(U[D]=fe[D]);return L(k,X,U)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(k){return{$$typeof:c,render:k}},ot.isValidElement=j,ot.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:te}},ot.memo=function(k,G){return{$$typeof:f,type:k,compare:G===void 0?null:G}},ot.startTransition=function(k){var G=I.T,V={};I.T=V;try{var D=k(),U=I.S;U!==null&&U(V,D),typeof D=="object"&&D!==null&&typeof D.then=="function"&&D.then(A,le)}catch(X){le(X)}finally{G!==null&&V.types!==null&&(G.types=V.types),I.T=G}},ot.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ot.use=function(k){return I.H.use(k)},ot.useActionState=function(k,G,V){return I.H.useActionState(k,G,V)},ot.useCallback=function(k,G){return I.H.useCallback(k,G)},ot.useContext=function(k){return I.H.useContext(k)},ot.useDebugValue=function(){},ot.useDeferredValue=function(k,G){return I.H.useDeferredValue(k,G)},ot.useEffect=function(k,G){return I.H.useEffect(k,G)},ot.useEffectEvent=function(k){return I.H.useEffectEvent(k)},ot.useId=function(){return I.H.useId()},ot.useImperativeHandle=function(k,G,V){return I.H.useImperativeHandle(k,G,V)},ot.useInsertionEffect=function(k,G){return I.H.useInsertionEffect(k,G)},ot.useLayoutEffect=function(k,G){return I.H.useLayoutEffect(k,G)},ot.useMemo=function(k,G){return I.H.useMemo(k,G)},ot.useOptimistic=function(k,G){return I.H.useOptimistic(k,G)},ot.useReducer=function(k,G,V){return I.H.useReducer(k,G,V)},ot.useRef=function(k){return I.H.useRef(k)},ot.useState=function(k){return I.H.useState(k)},ot.useSyncExternalStore=function(k,G,V){return I.H.useSyncExternalStore(k,G,V)},ot.useTransition=function(){return I.H.useTransition()},ot.version="19.2.6",ot}var S2;function ma(){return S2||(S2=1,Ny.exports=Nj()),Ny.exports}var ky={exports:{}},Er={};var E2;function kj(){if(E2)return Er;E2=1;var e=ma();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(d,f,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Er.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,p)},Er.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},Er.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Er.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Er.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:h,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Er.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Er.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Er.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Er.requestFormReset=function(d){r.d.r(d)},Er.unstable_batchedUpdates=function(d,f){return d(f)},Er.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},Er.useFormStatus=function(){return l.H.useHostTransitionStatus()},Er.version="19.2.6",Er}var x2;function eP(){if(x2)return ky.exports;x2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ky.exports=kj(),ky.exports}var R2;function Dj(){if(R2)return Qu;R2=1;var e=Pj(),t=ma(),n=eP();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var a=i,u=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(u=a.return),i=a.return;while(i)}return a.tag===3?u:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function c(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function d(i){if(s(i)!==i)throw Error(r(188))}function f(i){var a=i.alternate;if(!a){if(a=s(i),a===null)throw Error(r(188));return a!==i?null:i}for(var u=i,m=a;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(m=y.return,m!==null){u=m;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return d(y),i;if(w===m)return d(y),a;w=w.sibling}throw Error(r(188))}if(u.return!==m.return)u=y,m=w;else{for(var N=!1,z=y.child;z;){if(z===u){N=!0,u=y,m=w;break}if(z===m){N=!0,m=y,u=w;break}z=z.sibling}if(!N){for(z=w.child;z;){if(z===u){N=!0,u=w,m=y;break}if(z===m){N=!0,m=w,u=y;break}z=z.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==m)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:a}function p(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=p(i),a!==null)return a;i=i.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function B(i){return i===null||typeof i!="object"?null:(i=j&&i[j]||i["@@iterator"],typeof i=="function"?i:null)}var F=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===F?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case b:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case _:return"Portal";case T:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case R:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return a=i.displayName||null,a!==null?a:Z(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return Z(i(a))}catch{}}return null}var ie=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},le=[],Q=-1;function k(i){return{current:i}}function G(i){0>Q||(i.current=le[Q],le[Q]=null,Q--)}function V(i,a){Q++,le[Q]=i.current,i.current=a}var D=k(null),U=k(null),X=k(null),fe=k(null);function pe(i,a){switch(V(X,a),V(U,i),V(D,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?zO(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=zO(a),i=UO(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(D),V(D,i)}function xe(){G(D),G(U),G(X)}function je(i){i.memoizedState!==null&&V(fe,i);var a=D.current,u=UO(a,i.type);a!==u&&(V(U,i),V(D,u))}function Y(i){U.current===i&&(G(D),G(U)),fe.current===i&&(G(fe),Gu._currentValue=te)}var re,ve;function se(i){if(re===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);re=a&&a[1]||"",ve=-1<u.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+re+i+ve}var Se=!1;function Te(i,a){if(!i||Se)return"";Se=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(a){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ge){var he=ge}Reflect.construct(i,[],Ee)}else{try{Ee.call()}catch(ge){he=ge}i.call(Ee.prototype)}}else{try{throw Error()}catch(ge){he=ge}(Ee=i())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ge){if(ge&&he&&typeof ge.stack=="string")return[ge.stack,he.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),N=w[0],z=w[1];if(N&&z){var J=N.split(`
|
|
@@ -43,9 +43,9 @@ Error generating stack: `+m.message+`
|
|
|
43
43
|
newResult[${O}] = ${R}.value;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(T,R)=>E(g,T,R)};let s;const l=Zd,c=!QP.jitless,f=c&&M9.value,p=t.catchall;let h;e._zod.parse=(g,v)=>{h??(h=r.value);const _=g.value;return l(_)?c&&f&&v?.async===!1&&v.jitless!==!0?(s||(s=o(t.shape)),g=s(g,v),p?h3([],_,g,v,h,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function yT(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Tc(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>fa(l,r,da())))}),t)}const p3=ye("$ZodUnion",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Lw(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let l=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:o.value,issues:[]},s);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>yT(d,o,e,s)):yT(c,o,e,s)}}),TU=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,p3.init(e,t);const n=e._zod.parse;It(e._zod,"propValues",()=>{const o={};for(const s of t.options){const l=s._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(l)){o[c]||(o[c]=new Set);for(const f of d)o[c].add(f)}}return o});const r=Lg(()=>{const o=t.options,s=new Map;for(const l of o){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,l)}}return s});e._zod.parse=(o,s)=>{const l=o.value;if(!Zd(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),CU=ye("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),l=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([d,f])=>_T(n,d,f)):_T(n,s,l)}});function Ub(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qc(e)&&qc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const l=Ub(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};o[s]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],l=Ub(o,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _T(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Tc(e))return e;const l=Ub(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const AU=ye("$ZodTuple",(e,t)=>{Bt.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const l=[],c=[...n].reverse().findIndex(p=>p._zod.optin!=="optional"),d=c===-1?0:n.length-c;if(!t.rest){const p=s.length>n.length,h=s.length<d-1;if(p||h)return r.issues.push({...p?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let f=-1;for(const p of n){if(f++,f>=s.length&&f>=d)continue;const h=p._zod.run({value:s[f],issues:[]},o);h instanceof Promise?l.push(h.then(g=>Xh(g,r,f))):Xh(h,r,f)}if(t.rest){const p=s.slice(n.length);for(const h of p){f++;const g=t.rest._zod.run({value:h,issues:[]},o);g instanceof Promise?l.push(g.then(v=>Xh(v,r,f))):Xh(g,r,f)}}return l.length?Promise.all(l).then(()=>r):r}});function Xh(e,t,n){e.issues.length&&t.issues.push(...tl(n,e.issues)),t.value[n]=e.value}const IU=ye("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!qc(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:o[f],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...tl(f,h.issues)),n.value[f]=h.value})):(p.issues.length&&n.issues.push(...tl(f,p.issues)),n.value[f]=p.value)}let d;for(const f in o)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&s3.test(c)&&d.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[c]=o[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>fa(h,r,da())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...tl(c,h.issues)),n.value[d.value]=h.value})):(p.issues.length&&n.issues.push(...tl(c,p.issues)),n.value[d.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),MU=ye("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=XP(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>P9.has(typeof o)).map(o=>typeof o=="string"?Hc(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const l=o.value;return r.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),PU=ye("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hc(r):r?Hc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),NU=ye("$ZodFile",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),kU=ye("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WP(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new kc;return n.value=o,n}});function bT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const m3=ye("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lw(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>bT(s,n.value)):bT(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),DU=ye("$ZodExactOptional",(e,t)=>{m3.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),LU=ye("$ZodNullable",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lw(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$U=ye("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>wT(s,t)):wT(o,t)}});function wT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const jU=ye("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),zU=ye("$ZodNonOptional",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ST(s,e)):ST(o,e)}});function ST(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const UU=ye("$ZodCatch",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>fa(l,r,da()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>fa(s,r,da()))},input:n.value}),n.issues=[]),n)}}),FU=ye("$ZodPipe",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>Jh(l,t.in,r)):Jh(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Jh(s,t.out,r)):Jh(o,t.out,r)}});function Jh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const BU=ye("$ZodReadonly",(e,t)=>{Bt.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ET):ET(o)}});function ET(e){return e.value=Object.freeze(e.value),e}const VU=ye("$ZodLazy",(e,t)=>{Bt.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),It(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),It(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),It(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),qU=ye("$ZodCustom",(e,t)=>{yr.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>xT(s,n,r,e));xT(o,n,r,e)}});function xT(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Yd(o))}}var RT;class HU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GU(){return new HU}(RT=globalThis).__zod_globalRegistry??(RT.__zod_globalRegistry=GU());const wd=globalThis.__zod_globalRegistry;function KU(e,t){return new e({type:"string",...Fe(t)})}function ZU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function OT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function YU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function g3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function JU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function eF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function tF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function nF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function rF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function oF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function iF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function sF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function aF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function lF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function cF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function uF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function dF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function fF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function hF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function pF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function mF(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function gF(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function vF(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function yF(e,t){return new e({type:"number",checks:[],...Fe(t)})}function _F(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function bF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function wF(e,t){return new e({type:"boolean",...Fe(t)})}function SF(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function EF(e,t){return new e({type:"undefined",...Fe(t)})}function xF(e,t){return new e({type:"null",...Fe(t)})}function RF(e){return new e({type:"any"})}function OF(e){return new e({type:"unknown"})}function TF(e,t){return new e({type:"never",...Fe(t)})}function TT(e,t){return new l3({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Yy(e,t){return new l3({check:"less_than",...Fe(t),value:e,inclusive:!0})}function CT(e,t){return new c3({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Wy(e,t){return new c3({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function AT(e,t){return new Az({check:"multiple_of",...Fe(t),value:e})}function CF(e,t){return new Mz({check:"max_size",...Fe(t),maximum:e})}function AF(e,t){return new Pz({check:"min_size",...Fe(t),minimum:e})}function v3(e,t){return new Nz({check:"max_length",...Fe(t),maximum:e})}function jm(e,t){return new kz({check:"min_length",...Fe(t),minimum:e})}function y3(e,t){return new Dz({check:"length_equals",...Fe(t),length:e})}function IF(e,t){return new Lz({check:"string_format",format:"regex",...Fe(t),pattern:e})}function MF(e){return new $z({check:"string_format",format:"lowercase",...Fe(e)})}function PF(e){return new jz({check:"string_format",format:"uppercase",...Fe(e)})}function NF(e,t){return new zz({check:"string_format",format:"includes",...Fe(t),includes:e})}function kF(e,t){return new Uz({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function DF(e,t){return new Fz({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function LF(e,t){return new Bz({check:"mime_type",mime:e,...Fe(t)})}function nu(e){return new Vz({check:"overwrite",tx:e})}function $F(e){return nu(t=>t.normalize(e))}function jF(){return nu(e=>e.trim())}function zF(){return nu(e=>e.toLowerCase())}function UF(){return nu(e=>e.toUpperCase())}function FF(){return nu(e=>I9(e))}function BF(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function VF(e,t){return new e({type:"file",...Fe(t)})}function qF(e,t,n){const r=Fe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function HF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function GF(e){const t=KF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Yd(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Yd(o))}},e(n.value,n)));return t}function KF(e,t){const n=new yr({check:"custom",...Fe(t)});return n._zod.check=e,n}function zm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function an(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,g,p)}const h=e._zod.parent;h&&(l.ref||(l.ref=h),an(h,t,p),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&Dr(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Um(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const o=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(l[0])?.id,g=e.external.uri??(_=>_);if(h)return{ref:g(h)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=o(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(T,R)=>E(g,T,R)};let s;const l=Zd,c=!QP.jitless,f=c&&M9.value,p=t.catchall;let h;e._zod.parse=(g,v)=>{h??(h=r.value);const _=g.value;return l(_)?c&&f&&v?.async===!1&&v.jitless!==!0?(s||(s=o(t.shape)),g=s(g,v),p?h3([],_,g,v,h,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function yT(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Tc(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>fa(l,r,da())))}),t)}const p3=ye("$ZodUnion",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Lw(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let l=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:o.value,issues:[]},s);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>yT(d,o,e,s)):yT(c,o,e,s)}}),TU=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,p3.init(e,t);const n=e._zod.parse;It(e._zod,"propValues",()=>{const o={};for(const s of t.options){const l=s._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(l)){o[c]||(o[c]=new Set);for(const f of d)o[c].add(f)}}return o});const r=Lg(()=>{const o=t.options,s=new Map;for(const l of o){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,l)}}return s});e._zod.parse=(o,s)=>{const l=o.value;if(!Zd(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),CU=ye("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),l=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([d,f])=>_T(n,d,f)):_T(n,s,l)}});function Ub(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qc(e)&&qc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const l=Ub(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};o[s]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],l=Ub(o,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _T(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Tc(e))return e;const l=Ub(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const AU=ye("$ZodTuple",(e,t)=>{Bt.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const l=[],c=[...n].reverse().findIndex(p=>p._zod.optin!=="optional"),d=c===-1?0:n.length-c;if(!t.rest){const p=s.length>n.length,h=s.length<d-1;if(p||h)return r.issues.push({...p?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let f=-1;for(const p of n){if(f++,f>=s.length&&f>=d)continue;const h=p._zod.run({value:s[f],issues:[]},o);h instanceof Promise?l.push(h.then(g=>Xh(g,r,f))):Xh(h,r,f)}if(t.rest){const p=s.slice(n.length);for(const h of p){f++;const g=t.rest._zod.run({value:h,issues:[]},o);g instanceof Promise?l.push(g.then(v=>Xh(v,r,f))):Xh(g,r,f)}}return l.length?Promise.all(l).then(()=>r):r}});function Xh(e,t,n){e.issues.length&&t.issues.push(...tl(n,e.issues)),t.value[n]=e.value}const IU=ye("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!qc(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:o[f],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...tl(f,h.issues)),n.value[f]=h.value})):(p.issues.length&&n.issues.push(...tl(f,p.issues)),n.value[f]=p.value)}let d;for(const f in o)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&s3.test(c)&&d.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[c]=o[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>fa(h,r,da())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...tl(c,h.issues)),n.value[d.value]=h.value})):(p.issues.length&&n.issues.push(...tl(c,p.issues)),n.value[d.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),MU=ye("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=XP(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>P9.has(typeof o)).map(o=>typeof o=="string"?Hc(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const l=o.value;return r.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),PU=ye("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hc(r):r?Hc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),NU=ye("$ZodFile",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),kU=ye("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WP(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new kc;return n.value=o,n}});function bT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const m3=ye("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lw(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>bT(s,n.value)):bT(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),DU=ye("$ZodExactOptional",(e,t)=>{m3.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),LU=ye("$ZodNullable",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lw(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$U=ye("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>wT(s,t)):wT(o,t)}});function wT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const jU=ye("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),zU=ye("$ZodNonOptional",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ST(s,e)):ST(o,e)}});function ST(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const UU=ye("$ZodCatch",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>fa(l,r,da()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>fa(s,r,da()))},input:n.value}),n.issues=[]),n)}}),FU=ye("$ZodPipe",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>Jh(l,t.in,r)):Jh(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Jh(s,t.out,r)):Jh(o,t.out,r)}});function Jh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const BU=ye("$ZodReadonly",(e,t)=>{Bt.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ET):ET(o)}});function ET(e){return e.value=Object.freeze(e.value),e}const VU=ye("$ZodLazy",(e,t)=>{Bt.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),It(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),It(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),It(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),qU=ye("$ZodCustom",(e,t)=>{yr.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>xT(s,n,r,e));xT(o,n,r,e)}});function xT(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Yd(o))}}var RT;class HU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GU(){return new HU}(RT=globalThis).__zod_globalRegistry??(RT.__zod_globalRegistry=GU());const wd=globalThis.__zod_globalRegistry;function KU(e,t){return new e({type:"string",...Fe(t)})}function ZU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function OT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function YU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function g3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function JU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function eF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function tF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function nF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function rF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function oF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function iF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function sF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function aF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function lF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function cF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function uF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function dF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function fF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function hF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function pF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function mF(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function gF(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function vF(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function yF(e,t){return new e({type:"number",checks:[],...Fe(t)})}function _F(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function bF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function wF(e,t){return new e({type:"boolean",...Fe(t)})}function SF(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function EF(e,t){return new e({type:"undefined",...Fe(t)})}function xF(e,t){return new e({type:"null",...Fe(t)})}function RF(e){return new e({type:"any"})}function OF(e){return new e({type:"unknown"})}function TF(e,t){return new e({type:"never",...Fe(t)})}function TT(e,t){return new l3({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Yy(e,t){return new l3({check:"less_than",...Fe(t),value:e,inclusive:!0})}function CT(e,t){return new c3({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Wy(e,t){return new c3({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function AT(e,t){return new Az({check:"multiple_of",...Fe(t),value:e})}function CF(e,t){return new Mz({check:"max_size",...Fe(t),maximum:e})}function AF(e,t){return new Pz({check:"min_size",...Fe(t),minimum:e})}function v3(e,t){return new Nz({check:"max_length",...Fe(t),maximum:e})}function jm(e,t){return new kz({check:"min_length",...Fe(t),minimum:e})}function y3(e,t){return new Dz({check:"length_equals",...Fe(t),length:e})}function IF(e,t){return new Lz({check:"string_format",format:"regex",...Fe(t),pattern:e})}function MF(e){return new $z({check:"string_format",format:"lowercase",...Fe(e)})}function PF(e){return new jz({check:"string_format",format:"uppercase",...Fe(e)})}function NF(e,t){return new zz({check:"string_format",format:"includes",...Fe(t),includes:e})}function kF(e,t){return new Uz({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function DF(e,t){return new Fz({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function LF(e,t){return new Bz({check:"mime_type",mime:e,...Fe(t)})}function nu(e){return new Vz({check:"overwrite",tx:e})}function $F(e){return nu(t=>t.normalize(e))}function jF(){return nu(e=>e.trim())}function zF(){return nu(e=>e.toLowerCase())}function UF(){return nu(e=>e.toUpperCase())}function FF(){return nu(e=>I9(e))}function BF(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function VF(e,t){return new e({type:"file",...Fe(t)})}function qF(e,t,n){const r=Fe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function HF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function GF(e){const t=KF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Yd(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Yd(o))}},e(n.value,n)));return t}function KF(e,t){const n=new yr({check:"custom",...Fe(t)});return n._zod.check=e,n}function zm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function on(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,g,p)}const h=e._zod.parent;h&&(l.ref||(l.ref=h),on(h,t,p),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&Dr(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Um(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const o=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(l[0])?.id,g=e.external.uri??(_=>_);if(h)return{ref:g(h)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=o(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
47
47
|
|
|
48
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function Fm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const h=l._zod.parent;if(h&&h!==p){r(h);const g=e.seen.get(h);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bm(t,"input",e.processors),output:Bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Dr(r.element,n);if(r.type==="set")return Dr(r.valueType,n);if(r.type==="lazy")return Dr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Dr(r.innerType,n);if(r.type==="intersection")return Dr(r.left,n)||Dr(r.right,n);if(r.type==="record"||r.type==="map")return Dr(r.keyType,n)||Dr(r.valueType,n);if(r.type==="pipe")return Dr(r.in,n)||Dr(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Dr(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Dr(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Dr(o,n))return!0;return!!(r.rest&&Dr(r.rest,n))}return!1}const ZF=(e,t={})=>n=>{const r=zm({...n,processors:t});return an(e,r),Um(r,e),Fm(r,e)},Bm=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},l=zm({...o??{},target:s,io:t,processors:n});return an(e,l),Um(l,e),Fm(l,e)},YF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_3=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof l=="number"&&(o.maxLength=l),c&&(o.format=YF[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),f&&(o.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},b3=(e,t,n,r)=>{const o=n,{minimum:s,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=p,o.exclusiveMinimum=!0):o.exclusiveMinimum=p),typeof s=="number"&&(o.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=f,o.exclusiveMaximum=!0):o.exclusiveMaximum=f),typeof l=="number"&&(o.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof d=="number"&&(o.multipleOf=d)},w3=(e,t,n,r)=>{n.type="boolean"},WF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},QF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},S3=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},E3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},x3=(e,t,n,r)=>{n.not={}},R3=(e,t,n,r)=>{},O3=(e,t,n,r)=>{},JF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},T3=(e,t,n,r)=>{const o=e._zod.def,s=XP(o.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},C3=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},eB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},tB=(e,t,n,r)=>{const o=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},A3=(e,t,n,r)=>{const o=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:c,mime:d}=e._zod.bag;l!==void 0&&(s.minLength=l),c!==void 0&&(s.maxLength=c),d?d.length===1?(s.contentMediaType=d[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(o,s)},nB=(e,t,n,r)=>{n.type="boolean"},I3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},M3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},P3=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=an(s.element,t,{...r,path:[...r.path,"items"]})},N3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const l=s.shape;for(const f in l)o.properties[f]=an(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].filter(f=>{const p=s.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(o.required=Array.from(d)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=an(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},k3=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,l=o.options.map((c,d)=>an(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",d]}));s?n.oneOf=l:n.anyOf=l},D3=(e,t,n,r)=>{const o=e._zod.def,s=an(o.left,t,{...r,path:[...r.path,"allOf",0]}),l=an(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=d},L3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((g,v)=>an(g,t,{...r,path:[...r.path,l,v]})),f=s.rest?an(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=d,f&&(o.items=f)):t.target==="openapi-3.0"?(o.items={anyOf:d},f&&o.items.anyOf.push(f),o.minItems=d.length,f||(o.maxItems=d.length)):(o.items=d,f&&(o.additionalItems=f));const{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)},$3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const l=s.keyType,d=l._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const p=an(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of d)o.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=an(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=an(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(o.required=p)}},j3=(e,t,n,r)=>{const o=e._zod.def,s=an(o.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},z3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},U3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},F3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},B3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},V3=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;an(s,t,r);const l=t.seen.get(e);l.ref=s},q3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},sB=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Uw=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},H3=(e,t,n,r)=>{const o=e._zod.innerType;an(o,t,r);const s=t.seen.get(e);s.ref=o},IT={string:_3,number:b3,boolean:w3,bigint:WF,symbol:QF,null:S3,undefined:E3,void:XF,never:x3,any:R3,unknown:O3,date:JF,enum:T3,literal:C3,nan:eB,template_literal:tB,file:A3,success:nB,custom:I3,function:rB,transform:M3,map:oB,set:iB,array:P3,object:N3,union:k3,intersection:D3,tuple:L3,record:$3,nullable:j3,nonoptional:z3,default:U3,prefault:F3,catch:B3,pipe:V3,readonly:q3,promise:sB,optional:Uw,lazy:H3};function Cce(e,t){if("_idmap"in e){const r=e,o=zm({...t,processors:IT}),s={};for(const d of r._idmap.entries()){const[f,p]=d;an(p,o)}const l={},c={registry:r,uri:t?.uri,defs:s};o.external=c;for(const d of r._idmap.entries()){const[f,p]=d;Um(o,p),l[f]=Fm(o,p)}if(Object.keys(s).length>0){const d=o.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:s}}return{schemas:l}}const n=zm({...t,processors:IT});return an(e,n),Um(n,e),Fm(n,e)}const aB=ye("ZodISODateTime",(e,t)=>{rU.init(e,t),wn.init(e,t)});function G3(e){return pF(aB,e)}const lB=ye("ZodISODate",(e,t)=>{oU.init(e,t),wn.init(e,t)});function cB(e){return mF(lB,e)}const uB=ye("ZodISOTime",(e,t)=>{iU.init(e,t),wn.init(e,t)});function dB(e){return gF(uB,e)}const fB=ye("ZodISODuration",(e,t)=>{sU.init(e,t),wn.init(e,t)});function hB(e){return vF(fB,e)}const pB=(e,t)=>{jw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>V9(e,n)},flatten:{value:n=>B9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zb,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zb,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bo=ye("ZodError",pB,{Parent:Error}),mB=jg(Bo),gB=zg(Bo),vB=Ug(Bo),yB=Fg(Bo),_B=Z9(Bo),bB=Y9(Bo),wB=W9(Bo),SB=Q9(Bo),EB=X9(Bo),xB=J9(Bo),RB=ez(Bo),OB=tz(Bo),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bm(e,"input"),output:Bm(e,"output")}}),e.toJSONSchema=ZF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ga(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>va(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>mB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>vB(e,n,r),e.parseAsync=async(n,r)=>gB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>yB(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>_B(e,n,r),e.decode=(n,r)=>bB(e,n,r),e.encodeAsync=async(n,r)=>wB(e,n,r),e.decodeAsync=async(n,r)=>SB(e,n,r),e.safeEncode=(n,r)=>EB(e,n,r),e.safeDecode=(n,r)=>xB(e,n,r),e.safeEncodeAsync=async(n,r)=>RB(e,n,r),e.safeDecodeAsync=async(n,r)=>OB(e,n,r),e.refine=(n,r)=>e.check(SV(n,r)),e.superRefine=n=>e.check(EV(n)),e.overwrite=n=>e.check(nu(n)),e.optional=()=>bn(e),e.exactOptional=()=>lV(e),e.nullable=()=>NT(e),e.nullish=()=>bn(NT(e)),e.nonoptional=n=>pV(e,n),e.array=()=>Re(e),e.or=n=>nn([e,n]),e.and=n=>qw(e,n),e.transform=n=>Bb(e,X3(n)),e.default=n=>dV(e,n),e.prefault=n=>hV(e,n),e.catch=n=>gV(e,n),e.pipe=n=>Bb(e,n),e.readonly=()=>_V(e),e.describe=n=>{const r=e.clone();return wd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wd.get(e);const r=e.clone();return wd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),K3=ye("_ZodString",(e,t)=>{zw.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>_3(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(IF(...r)),e.includes=(...r)=>e.check(NF(...r)),e.startsWith=(...r)=>e.check(kF(...r)),e.endsWith=(...r)=>e.check(DF(...r)),e.min=(...r)=>e.check(jm(...r)),e.max=(...r)=>e.check(v3(...r)),e.length=(...r)=>e.check(y3(...r)),e.nonempty=(...r)=>e.check(jm(1,...r)),e.lowercase=r=>e.check(MF(r)),e.uppercase=r=>e.check(PF(r)),e.trim=()=>e.check(jF()),e.normalize=(...r)=>e.check($F(...r)),e.toLowerCase=()=>e.check(zF()),e.toUpperCase=()=>e.check(UF()),e.slugify=()=>e.check(FF())}),TB=ye("ZodString",(e,t)=>{zw.init(e,t),K3.init(e,t),e.email=n=>e.check(ZU(CB,n)),e.url=n=>e.check(g3(Z3,n)),e.jwt=n=>e.check(hF(qB,n)),e.emoji=n=>e.check(JU(IB,n)),e.guid=n=>e.check(OT(MT,n)),e.uuid=n=>e.check(YU(ep,n)),e.uuidv4=n=>e.check(WU(ep,n)),e.uuidv6=n=>e.check(QU(ep,n)),e.uuidv7=n=>e.check(XU(ep,n)),e.nanoid=n=>e.check(eF(MB,n)),e.guid=n=>e.check(OT(MT,n)),e.cuid=n=>e.check(tF(PB,n)),e.cuid2=n=>e.check(nF(NB,n)),e.ulid=n=>e.check(rF(kB,n)),e.base64=n=>e.check(uF(FB,n)),e.base64url=n=>e.check(dF(BB,n)),e.xid=n=>e.check(oF(DB,n)),e.ksuid=n=>e.check(iF(LB,n)),e.ipv4=n=>e.check(sF($B,n)),e.ipv6=n=>e.check(aF(jB,n)),e.cidrv4=n=>e.check(lF(zB,n)),e.cidrv6=n=>e.check(cF(UB,n)),e.e164=n=>e.check(fF(VB,n)),e.datetime=n=>e.check(G3(n)),e.date=n=>e.check(cB(n)),e.time=n=>e.check(dB(n)),e.duration=n=>e.check(hB(n))});function $(e){return KU(TB,e)}const wn=ye("ZodStringFormat",(e,t)=>{gn.init(e,t),K3.init(e,t)}),CB=ye("ZodEmail",(e,t)=>{Zz.init(e,t),wn.init(e,t)}),MT=ye("ZodGUID",(e,t)=>{Gz.init(e,t),wn.init(e,t)}),ep=ye("ZodUUID",(e,t)=>{Kz.init(e,t),wn.init(e,t)}),Z3=ye("ZodURL",(e,t)=>{Yz.init(e,t),wn.init(e,t)});function AB(e){return g3(Z3,e)}const IB=ye("ZodEmoji",(e,t)=>{Wz.init(e,t),wn.init(e,t)}),MB=ye("ZodNanoID",(e,t)=>{Qz.init(e,t),wn.init(e,t)}),PB=ye("ZodCUID",(e,t)=>{Xz.init(e,t),wn.init(e,t)}),NB=ye("ZodCUID2",(e,t)=>{Jz.init(e,t),wn.init(e,t)}),kB=ye("ZodULID",(e,t)=>{eU.init(e,t),wn.init(e,t)}),DB=ye("ZodXID",(e,t)=>{tU.init(e,t),wn.init(e,t)}),LB=ye("ZodKSUID",(e,t)=>{nU.init(e,t),wn.init(e,t)}),$B=ye("ZodIPv4",(e,t)=>{aU.init(e,t),wn.init(e,t)}),jB=ye("ZodIPv6",(e,t)=>{lU.init(e,t),wn.init(e,t)}),zB=ye("ZodCIDRv4",(e,t)=>{cU.init(e,t),wn.init(e,t)}),UB=ye("ZodCIDRv6",(e,t)=>{uU.init(e,t),wn.init(e,t)}),FB=ye("ZodBase64",(e,t)=>{dU.init(e,t),wn.init(e,t)}),BB=ye("ZodBase64URL",(e,t)=>{hU.init(e,t),wn.init(e,t)}),VB=ye("ZodE164",(e,t)=>{pU.init(e,t),wn.init(e,t)}),qB=ye("ZodJWT",(e,t)=>{gU.init(e,t),wn.init(e,t)}),Fw=ye("ZodNumber",(e,t)=>{d3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>b3(e,r,o),e.gt=(r,o)=>e.check(CT(r,o)),e.gte=(r,o)=>e.check(Wy(r,o)),e.min=(r,o)=>e.check(Wy(r,o)),e.lt=(r,o)=>e.check(TT(r,o)),e.lte=(r,o)=>e.check(Yy(r,o)),e.max=(r,o)=>e.check(Yy(r,o)),e.int=r=>e.check(PT(r)),e.safe=r=>e.check(PT(r)),e.positive=r=>e.check(CT(0,r)),e.nonnegative=r=>e.check(Wy(0,r)),e.negative=r=>e.check(TT(0,r)),e.nonpositive=r=>e.check(Yy(0,r)),e.multipleOf=(r,o)=>e.check(AT(r,o)),e.step=(r,o)=>e.check(AT(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function at(e){return yF(Fw,e)}const HB=ye("ZodNumberFormat",(e,t)=>{vU.init(e,t),Fw.init(e,t)});function PT(e){return bF(HB,e)}const Y3=ye("ZodBoolean",(e,t)=>{yU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>w3(e,n,r)});function Nt(e){return wF(Y3,e)}const GB=ye("ZodUndefined",(e,t)=>{_U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>E3(e,n)});function Ace(e){return EF(GB,e)}const KB=ye("ZodNull",(e,t)=>{bU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>S3(e,n,r)});function ZB(e){return xF(KB,e)}const YB=ye("ZodAny",(e,t)=>{wU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>R3()});function WB(){return RF(YB)}const QB=ye("ZodUnknown",(e,t)=>{SU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>O3()});function Gt(){return OF(QB)}const XB=ye("ZodNever",(e,t)=>{EU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x3(e,n,r)});function W3(e){return TF(XB,e)}const JB=ye("ZodArray",(e,t)=>{xU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>P3(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(jm(n,r)),e.nonempty=n=>e.check(jm(1,n)),e.max=(n,r)=>e.check(v3(n,r)),e.length=(n,r)=>e.check(y3(n,r)),e.unwrap=()=>e.element});function Re(e,t){return BF(JB,e,t)}const Bw=ye("ZodObject",(e,t)=>{OU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>N3(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>rn(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gt()}),e.strict=()=>e.clone({...e._zod.def,catchall:W3()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>$9(e,n),e.safeExtend=n=>j9(e,n),e.merge=n=>z9(e,n),e.pick=n=>D9(e,n),e.omit=n=>L9(e,n),e.partial=(...n)=>U9(J3,e,n[0]),e.required=(...n)=>F9(eN,e,n[0])});function be(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new Bw(n)}function Ice(e,t){return new Bw({type:"object",shape:e,catchall:W3(),...Fe(t)})}function vr(e,t){return new Bw({type:"object",shape:e,catchall:Gt(),...Fe(t)})}const Q3=ye("ZodUnion",(e,t)=>{p3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k3(e,n,r,o),e.options=t.options});function nn(e,t){return new Q3({type:"union",options:e,...Fe(t)})}const eV=ye("ZodDiscriminatedUnion",(e,t)=>{Q3.init(e,t),TU.init(e,t)});function Vw(e,t,n){return new eV({type:"union",options:t,discriminator:e,...Fe(n)})}const tV=ye("ZodIntersection",(e,t)=>{CU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>D3(e,n,r,o)});function qw(e,t){return new tV({type:"intersection",left:e,right:t})}const nV=ye("ZodTuple",(e,t)=>{AU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>L3(e,n,r,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Mce(e,t,n){const r=t instanceof Bt,o=r?n:t,s=r?t:null;return new nV({type:"tuple",items:e,rest:s,...Fe(o)})}const rV=ye("ZodRecord",(e,t)=>{IU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$3(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Mt(e,t,n){return new rV({type:"record",keyType:e,valueType:t,...Fe(n)})}const Fb=ye("ZodEnum",(e,t)=>{MU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>T3(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Fb({...t,checks:[],...Fe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Fb({...t,checks:[],...Fe(o),entries:s})}});function rn(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Fb({type:"enum",entries:n,...Fe(t)})}const oV=ye("ZodLiteral",(e,t)=>{PU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>C3(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ge(e,t){return new oV({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const iV=ye("ZodFile",(e,t)=>{NU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>A3(e,n,r),e.min=(n,r)=>e.check(AF(n,r)),e.max=(n,r)=>e.check(CF(n,r)),e.mime=(n,r)=>e.check(LF(Array.isArray(n)?n:[n],r))});function Pce(e){return VF(iV,e)}const sV=ye("ZodTransform",(e,t)=>{kU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>M3(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WP(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Yd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Yd(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function X3(e){return new sV({type:"transform",transform:e})}const J3=ye("ZodOptional",(e,t)=>{m3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bn(e){return new J3({type:"optional",innerType:e})}const aV=ye("ZodExactOptional",(e,t)=>{DU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function lV(e){return new aV({type:"optional",innerType:e})}const cV=ye("ZodNullable",(e,t)=>{LU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function NT(e){return new cV({type:"nullable",innerType:e})}const uV=ye("ZodDefault",(e,t)=>{$U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>U3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dV(e,t){return new uV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():e3(t)}})}const fV=ye("ZodPrefault",(e,t)=>{jU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>F3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function hV(e,t){return new fV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():e3(t)}})}const eN=ye("ZodNonOptional",(e,t)=>{zU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pV(e,t){return new eN({type:"nonoptional",innerType:e,...Fe(t)})}const mV=ye("ZodCatch",(e,t)=>{UU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gV(e,t){return new mV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vV=ye("ZodPipe",(e,t)=>{FU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V3(e,n,r,o),e.in=t.in,e.out=t.out});function Bb(e,t){return new vV({type:"pipe",in:e,out:t})}const yV=ye("ZodReadonly",(e,t)=>{BU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>q3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _V(e){return new yV({type:"readonly",innerType:e})}const bV=ye("ZodLazy",(e,t)=>{VU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H3(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function ya(e){return new bV({type:"lazy",getter:e})}const Hw=ye("ZodCustom",(e,t)=>{qU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>I3(e,n)});function wV(e,t){return qF(Hw,e??(()=>!0),t)}function SV(e,t={}){return HF(Hw,e,t)}function EV(e){return GF(e)}function Nce(e,t={}){const n=new Hw({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Fe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Gw(e,t){return Bb(X3(e),t)}const xV={custom:"custom"};function tN(e){return _F(Fw,e)}function kT(e){return SF(Y3,e)}function RV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var kd=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function OV(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function TV(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new kd(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kd?t:new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Qy(e,t="/api/auth"){if(TV(e),OV(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function CV(e,t,n,r,o){if(e)return Qy(e,t);{const s=Do.BETTER_AUTH_URL||Do.NEXT_PUBLIC_BETTER_AUTH_URL||Do.PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_AUTH_URL||(Do.BASE_URL!=="/"?Do.BASE_URL:void 0);if(s)return Qy(s,t)}if(typeof window<"u"&&window.location)return Qy(window.location.origin,t)}const AV={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},IV={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},MV=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,DT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},PV=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function NV(e){return e instanceof Date&&!isNaN(e.getTime())}function kV(e){const t=PV.exec(e);if(!t)return null;const[,n,r,o,s,l,c,d,f,p,h]=t,g=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(l,10),parseInt(c,10),d?parseInt(d.padEnd(3,"0"),10):0));if(f){const v=(parseInt(p,10)*60+parseInt(h,10))*(f==="+"?-1:1);g.setUTCMinutes(g.getUTCMinutes()+v)}return NV(g)?g:null}function DV(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const l=e.trim();if(l.length>0&&l[0]==='"'&&l.endsWith('"')&&!l.slice(1,-1).includes('"'))return l.slice(1,-1);const c=l.toLowerCase();if(c.length<=9&&c in DT)return DT[c];if(!MV.test(l)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(IV).some(([d,f])=>{const p=f.test(l);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${d} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(l,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof p=="string"){const h=kV(p);if(h)return h}return o?o(f,p):p})}catch(d){if(n)throw d;return e}}function LV(e,t={strict:!0}){return DV(e,t)}let Wo=[],Vs=0;const tp=4,$V=globalThis.nanostoresGlobal||={epoch:0},Cc=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=Vs+tp;s<Wo.length;)Wo[s]===r?Wo.splice(s,tp):s+=tp;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){$V.epoch++;let s=!Wo.length;for(let l of t)Wo.push(l,n.value,r,o);if(s){for(Vs=0;Vs<Wo.length;Vs+=tp)Wo[Vs](Wo[Vs+1],Wo[Vs+2],Wo[Vs+3]);Wo.length=0}},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},jV=5,np=6,rp=10;let zV=(e,t,n,r)=>(e.events=e.events||{},e.events[n+rp]||(e.events[n+rp]=r(o=>{e.events[n].reduceRight((s,l)=>(l(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+rp](),delete e.events[n+rp])});const UV=1e3;let nN=(e,t)=>zV(e,r=>{let o=t(r);o&&e.events[np].push(o)},jV,r=>{let o=e.listen;e.listen=(...l)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...l));let s=e.off;return e.events[np]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let l of e.events[np])l();e.events[np]=[]}},UV)},()=>{e.listen=o,e.off=s}});function FV(e,t,n){let r=new Set(t).add(void 0);return e.listen((o,s,l)=>{r.has(l)&&n(o,s,l)})}const BV=()=>typeof window>"u",Sd=(e,t,n,r)=>{const o=Cc({data:null,error:null,isPending:!0,isRefetching:!1,refetch:c=>s(c)}),s=async c=>new Promise(d=>{const f=typeof r=="function"?r({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):r;n(t,{...f,query:{...f?.query,...c?.query},async onSuccess(p){o.set({data:p.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onSuccess?.(p)},async onError(p){const{request:h}=p,g=typeof h.retry=="number"?h.retry:h.retry?.attempts,v=h.retryAttempt||0;g&&v<g||(o.set({error:p.error,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onError?.(p))},async onRequest(p){const h=o.get();o.set({isPending:h.data===null,data:h.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await f?.onRequest?.(p)}}).catch(p=>{o.set({error:p,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{d(void 0)})});e=Array.isArray(e)?e:[e];let l=!1;for(const c of e)c.subscribe(async()=>{BV()||(l?await s():nN(o,()=>{const d=setTimeout(async()=>{l||(await s(),l=!0)},0);return()=>{o.off(),c.off(),clearTimeout(d)}}))});return o},Xy=Symbol.for("better-auth:broadcast-channel"),VV=()=>Math.floor(Date.now()/1e3);var qV=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:VV()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function Jy(e="better-auth.message"){return globalThis[Xy]||(globalThis[Xy]=new qV(e)),globalThis[Xy]}const e_=Symbol.for("better-auth:focus-manager");var HV=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function LT(){return globalThis[e_]||(globalThis[e_]=new HV),globalThis[e_]}const t_=Symbol.for("better-auth:online-manager");var GV=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function n_(){return globalThis[t_]||(globalThis[t_]=new GV),globalThis[t_]}const ic=()=>Math.floor(Date.now()/1e3),KV=5;function ZV(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,l=o.sessionOptions?.refetchOnWindowFocus??!0,c=o.sessionOptions?.refetchWhenOffline??!1,d={lastSync:0,lastSessionRequest:0,cachedSession:void 0},f=()=>c||n_().isOnline,p=E=>{if(!f())return;if(E?.event==="storage"){d.lastSync=ic(),n.set(!n.get());return}const T=t.get();if(E?.event==="poll"){d.lastSessionRequest=ic(),r("/get-session").then(R=>{R.error?t.set({...T,data:null,error:R.error}):t.set({...T,data:R.data,error:null}),d.lastSync=ic(),n.set(!n.get())}).catch(()=>{});return}if(E?.event==="visibilitychange"){if(ic()-d.lastSessionRequest<KV)return;d.lastSessionRequest=ic()}(T?.data===null||T?.data===void 0||E?.event==="visibilitychange")&&(d.lastSync=ic(),n.set(!n.get()))},h=E=>{Jy().post({event:"session",data:{trigger:E},clientId:Math.random().toString(36).substring(7)})},g=()=>{s&&s>0&&(d.pollInterval=setInterval(()=>{t.get()?.data&&p({event:"poll"})},s*1e3))},v=()=>{d.unsubscribeBroadcast=Jy().subscribe(()=>{p({event:"storage"})})},_=()=>{l&&(d.unsubscribeFocus=LT().subscribe(()=>{p({event:"visibilitychange"})}))},b=()=>{d.unsubscribeOnline=n_().subscribe(E=>{E&&p({event:"visibilitychange"})})};return{init:()=>{g(),v(),_(),b(),Jy().setup(),LT().setup(),n_().setup()},cleanup:()=>{d.pollInterval&&(clearInterval(d.pollInterval),d.pollInterval=void 0),d.unsubscribeBroadcast&&(d.unsubscribeBroadcast(),d.unsubscribeBroadcast=void 0),d.unsubscribeFocus&&(d.unsubscribeFocus(),d.unsubscribeFocus=void 0),d.unsubscribeOnline&&(d.unsubscribeOnline(),d.unsubscribeOnline=void 0),d.lastSync=0,d.lastSessionRequest=0,d.cachedSession=void 0},triggerRefetch:p,broadcastSessionUpdate:h}}function YV(e,t){const n=Cc(!1),r=Sd(n,"/get-session",e,{method:"GET"});return nN(r,()=>{const o=ZV({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return o.init(),()=>{o.cleanup()}}),{session:r,$sessionSignal:n}}function r_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Vb(e,t,n=".",r){if(!r_(t))return Vb(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const l=e[s];l!=null&&(r&&r(o,s,l,n)||(Array.isArray(l)&&Array.isArray(o[s])?o[s]=[...l,...o[s]]:r_(l)&&r_(o[s])?o[s]=Vb(l,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=l))}return o}function WV(e){return(...t)=>t.reduce((n,r)=>Vb(n,r,"",e),{})}const QV=WV();var XV=Object.defineProperty,JV=Object.defineProperties,eq=Object.getOwnPropertyDescriptors,$T=Object.getOwnPropertySymbols,tq=Object.prototype.hasOwnProperty,nq=Object.prototype.propertyIsEnumerable,jT=(e,t,n)=>t in e?XV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ti=(e,t)=>{for(var n in t||(t={}))tq.call(t,n)&&jT(e,n,t[n]);if($T)for(var n of $T(t))nq.call(t,n)&&jT(e,n,t[n]);return e},vi=(e,t)=>JV(e,eq(t)),rq=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},oq=async(e,t)=>{var n,r,o,s,l,c;let d=t||{};const f={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:d,hooks:f};for(const p of t?.plugins||[]){if(p.init){const h=await((n=p.init)==null?void 0:n.call(p,e.toString(),t));d=h.options||d,e=h.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((o=p.hooks)==null?void 0:o.onResponse),f.onSuccess.push((s=p.hooks)==null?void 0:s.onSuccess),f.onError.push((l=p.hooks)==null?void 0:l.onError),f.onRetry.push((c=p.hooks)==null?void 0:c.onRetry)}return{url:e,options:d,hooks:f}},zT=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},iq=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function sq(e){if(typeof e=="number")return new zT({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new zT(e);case"exponential":return new iq(e);default:throw new Error("Invalid retry strategy")}}var aq=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},lq=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function cq(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return lq.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function uq(e){try{return JSON.parse(e),!0}catch{return!1}}function qb(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function UT(e){try{return JSON.parse(e)}catch{return e}}function FT(e){return typeof e=="function"}function dq(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&FT(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&FT(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function fq(e){const t=new Headers(e?.headers),n=await aq(e);for(const[r,o]of Object.entries(n||{}))t.set(r,o);if(!t.has("content-type")){const r=hq(e?.body);r&&t.set("content-type",r)}return t}function hq(e){return qb(e)?"application/json":null}function pq(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(qb(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&qb(e.body)?new URLSearchParams(e.body).toString():e.body}function mq(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return oN.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function gq(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var vq=class rN extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,rN.prototype)}};async function _m(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new vq(n.issues);return n.value}var oN=["get","post","put","patch","delete"],yq=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,o,s,l;const c=((o=(r=e.plugins)==null?void 0:r.find(d=>{var f;return(f=d.schema)!=null&&f.config?t.startsWith(d.schema.config.baseURL||"")||t.startsWith(d.schema.config.prefix||""):!1}))==null?void 0:o.schema)||e.schema;if(c){let d=t;(s=c.config)!=null&&s.prefix&&d.startsWith(c.config.prefix)&&(d=d.replace(c.config.prefix,""),c.config.baseURL&&(t=t.replace(c.config.prefix,c.config.baseURL))),(l=c.config)!=null&&l.baseURL&&d.startsWith(c.config.baseURL)&&(d=d.replace(c.config.baseURL,""));const f=c.schema[d];if(f){let p=vi(ti({},n),{method:f.method,output:f.output});return n?.disableValidation||(p=vi(ti({},p),{body:f.input?await _m(f.input,n?.body):n?.body,params:f.params?await _m(f.params,n?.params):n?.params,query:f.query?await _m(f.query,n?.query):n?.query})),{url:t,options:p}}}return{url:t,options:n}}}),_q=e=>{async function t(n,r){const o=vi(ti(ti({},e),r),{plugins:[...e?.plugins||[],yq(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await Hb(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await Hb(n,o)}return t};function bq(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const h=e.toString().split("@")[1].split("/")[0];oN.includes(h)&&(e=e.replace(`@${h}/`,"/"))}s.endsWith("/")||(s+="/");let[l,c]=e.replace(s,"").split("?");const d=new URLSearchParams(c);for(const[h,g]of Object.entries(o||{})){if(g==null)continue;let v;if(typeof g=="string")v=g;else if(Array.isArray(g)){for(const _ of g)d.append(h,_);continue}else v=JSON.stringify(g);d.set(h,v)}if(r)if(Array.isArray(r)){const h=l.split("/").filter(g=>g.startsWith(":"));for(const[g,v]of h.entries()){const _=r[g];l=l.replace(v,_)}}else for(const[h,g]of Object.entries(r))l=l.replace(`:${h}`,String(g));l=l.split("/").map(encodeURIComponent).join("/"),l.startsWith("/")&&(l=l.slice(1));let f=d.toString();return f=f.length>0?`?${f}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${l}${f}`,s):`${s}${l}${f}`}var Hb=async(e,t)=>{var n,r,o,s,l,c,d,f;const{hooks:p,url:h,options:g}=await oq(e,t),v=dq(g),_=new AbortController,b=(n=g.signal)!=null?n:_.signal,x=bq(h,g),S=pq(g),E=await fq(g),T=mq(h,g);let R=vi(ti({},g),{url:x,headers:E,body:S,method:T,signal:b});for(const F of p.onRequest)if(F){const Z=await F(R);typeof Z=="object"&&Z!==null&&(R=Z)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:O}=gq(g,_);let A=await v(R.url,R);O();const I={response:A,request:R};for(const F of p.onResponse)if(F){const Z=await F(vi(ti({},I),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?A.clone():A}));Z instanceof Response?A=Z:typeof Z=="object"&&Z!==null&&(A=Z.response)}if(A.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Z=cq(A),ie={data:null,response:A,request:R};if(Z==="json"||Z==="text"){const H=await A.text(),W=(s=R.jsonParser)!=null?s:UT;ie.data=await W(H)}else ie.data=await A[Z]();R?.output&&R.output&&!R.disableValidation&&(ie.data=await _m(R.output,ie.data));for(const H of p.onSuccess)H&&await H(vi(ti({},ie),{response:(l=t?.hookOptions)!=null&&l.cloneResponse?A.clone():A}));return t?.throw?ie.data:{data:ie.data,error:null}}const P=(c=t?.jsonParser)!=null?c:UT,L=await A.text(),q=uq(L),j=q?await P(L):null,B={response:A,responseText:L,request:R,error:vi(ti({},j),{status:A.status,statusText:A.statusText})};for(const F of p.onError)F&&await F(vi(ti({},B),{response:(d=t?.hookOptions)!=null&&d.cloneResponse?A.clone():A}));if(t?.retry){const F=sq(t.retry),Z=(f=t.retryAttempt)!=null?f:0;if(await F.shouldAttemptRetry(Z,A)){for(const H of p.onRetry)H&&await H(I);const ie=F.getDelay(Z);return await new Promise(H=>setTimeout(H,ie)),await Hb(e,vi(ti({},t),{retryAttempt:Z+1}))}}if(t?.throw)throw new rq(A.status,A.statusText,q?j:L);return{data:null,error:vi(ti({},j),{status:A.status,statusText:A.statusText})}};const wq=(e,t)=>{const n="credentials"in Request.prototype,r=CV(e?.baseURL,e?.basePath)??"/api/auth",o=e?.plugins?.flatMap(R=>R.fetchPlugins).filter(R=>R!==void 0)||[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:l,onError:c,onRequest:d,onResponse:f,...p}=e?.fetchOptions||{},h=_q({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?LV(R,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[s,...p.plugins||[],...e?.disableDefaultFetchPlugins?[]:[AV],...o]}),{$sessionSignal:g,session:v}=YV(h,e),_=e?.plugins||[];let b={};const x={$sessionSignal:g,session:v},S={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},E=[{signal:"$sessionSignal",matcher(R){return R==="/sign-out"||R==="/update-user"||R==="/sign-up/email"||R==="/sign-in/email"||R==="/delete-user"||R==="/verify-email"||R==="/revoke-sessions"||R==="/revoke-session"||R==="/change-email"}}];for(const R of _)R.getAtoms&&Object.assign(x,R.getAtoms?.(h)),R.pathMethods&&Object.assign(S,R.pathMethods),R.atomListeners&&E.push(...R.atomListeners);const T={notify:R=>{x[R].set(!x[R].get())},listen:(R,O)=>{x[R].subscribe(O)},atoms:x};for(const R of _)R.getActions&&(b=QV(R.getActions?.(h,T,e)??{},b));return{get baseURL(){return r},pluginsActions:b,pluginsAtoms:x,pluginPathMethods:S,atomListeners:E,$fetch:h,$store:T}};function Sq(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Eq(e,t,n){const r=t[e],{fetchOptions:o,query:s,...l}=n||{};return r||(o?.method?o.method:l&&Object.keys(l).length>0?"POST":"GET")}function xq(e,t,n,r,o){function s(l=[]){return new Proxy(function(){},{get(c,d){if(typeof d!="string"||d==="then"||d==="catch"||d==="finally")return;const f=[...l,d];let p=e;for(const h of f)if(p&&typeof p=="object"&&h in p)p=p[h];else{p=void 0;break}return typeof p=="function"||Sq(p)?p:s(f)},apply:async(c,d,f)=>{const p="/"+l.map(E=>E.replace(/[A-Z]/g,T=>`-${T.toLowerCase()}`)).join("/"),h=f[0]||{},g=f[1]||{},{query:v,fetchOptions:_,...b}=h,x={...g,..._},S=Eq(p,n,h);return await t(p,{...x,body:S==="GET"?void 0:{...b,...x?.body||{}},query:v||x?.query,method:S,async onSuccess(E){if(await x?.onSuccess?.(E),!o||x.disableSignal)return;const T=o.filter(O=>O.matcher(p));if(!T.length)return;const R=new Set;for(const O of T){const A=r[O.signal];if(!A)return;if(R.has(O.signal))continue;R.add(O.signal);const I=A.get();setTimeout(()=>{A.set(!I)},10)}}})}})}return s()}function Rq(e,t={}){const n=M.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=M.useCallback(c=>{const d=f=>{n.current!==f&&(n.current=f,c())};return d(e.value),r?.length?FV(e,r,d):e.listen(d)},o),l=()=>n.current;return M.useSyncExternalStore(s,l,l)}function Oq(e){return`use${RV(e)}`}function Tq(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:o,$store:s,atomListeners:l}=wq(e),c={};for(const[d,f]of Object.entries(r))c[Oq(d)]=()=>Rq(f);return xq({...n,...c,$fetch:o,$store:s},o,t,r,l)}function Cq(e){return{authorize(t,n="AND"){let r=!1;for(const[o,s]of Object.entries(t)){const l=e[o];if(!l)return{success:!1,error:`You are not allowed to access resource: ${o}`};if(Array.isArray(s))r=s.every(c=>l.includes(c));else if(typeof s=="object"){const c=s;c.connector==="OR"?r=c.actions.some(d=>l.includes(d)):r=c.actions.every(d=>l.includes(d))}else throw new kd("Invalid access control request");if(r&&n==="OR")return{success:r};if(!r&&n==="AND")return{success:!1,error:`unauthorized to access resource "${o}"`}}return r?{success:r}:{success:!1,error:"Not authorized"}},statements:e}}function iN(e){return{newRole(t){return Cq(t)},statements:e}}const Aq={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},sN=iN(Aq),aN=sN.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),lN=sN.newRole({user:[],session:[]}),Iq={admin:aN,user:lN},Mq=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions&&!e.permission)return!1;const t=(e.role||e.options?.defaultRole||"user").split(","),n=e.options?.roles||Iq;for(const r of t)if(n[r]?.authorize(e.permission??e.permissions)?.success)return!0;return!1},Pq=e=>{const t={admin:aN,user:lN,...e?.roles};return{id:"admin-client",$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>Mq({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions??n.permission})}}),pathMethods:{"/admin/list-users":"GET","/admin/stop-impersonating":"POST"}}},Nq=()=>({id:"email-otp",$InferServerPlugin:{},atomListeners:[{matcher:e=>e==="/email-otp/verify-email"||e==="/sign-in/email-otp",signal:"$sessionSignal"}]}),kq=()=>({id:"magic-link",$InferServerPlugin:{}}),Dq={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},Kw=iN(Dq),cN=Kw.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),uN=Kw.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),dN=Kw.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),Lq={admin:cN,owner:uN,member:dN},$q=(e,t)=>{if(!e.permissions&&!e.permission)return!1;const n=e.role.split(","),r=e.options.creatorRole||"owner",o=n.includes(r),s=e.allowCreatorAllPermissions||!1;if(o&&s)return!0;for(const l of n)if(t[l]?.authorize(e.permissions??e.permission)?.success)return!0;return!1},jq=e=>$q(e,e.options.roles||Lq),zq=e=>{const t=Cc(!1),n=Cc(!1),r=Cc(!1),o=Cc(!1),s={admin:cN,member:dN,owner:uN,...e?.roles};return{id:"organization",$InferServerPlugin:{},getActions:(l,c,d)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:f=>jq({role:f.role,options:{ac:e?.ac,roles:s},permissions:f.permissions??f.permission})}}),getAtoms:l=>{const c=Sd(t,"/organization/list",l,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:o,activeOrganization:Sd([n],"/organization/get-full-organization",l,()=>({method:"GET"})),listOrganizations:c,activeMember:Sd([r],"/organization/get-active-member",l,{method:"GET"}),activeMemberRole:Sd([o],"/organization/get-active-member-role",l,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher(l){return l==="/organization/create"||l==="/organization/delete"||l==="/organization/update"},signal:"$listOrg"},{matcher(l){return l.startsWith("/organization")},signal:"$activeOrgSignal"},{matcher(l){return l.startsWith("/organization/set-active")},signal:"$sessionSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberRoleSignal"}]}},Uq=e=>({id:"sso-client",$InferServerPlugin:{}});function fN(e){const t=e?.metadata;if(!t)return!1;try{return(typeof t=="string"?JSON.parse(t):t).archived===!0}catch{return!1}}const Vg=Tq({plugins:[zq({}),Pq(),Uq(),kq(),Nq()]}),Fq=3e4;let Ed=null,op=null;function hN(){if(Ed&&Ed.expiresAt>Date.now())return Promise.resolve(Ed.result);if(op)return op;const e=Vg.organization.list().then(t=>{const n=t.data?{...t,data:t.data.filter(r=>!fN(r))}:t;return n.data&&(Ed={result:n,expiresAt:Date.now()+Fq}),n}).finally(()=>{op=null});return op=e,e}function kce(){const e=Vg.useListOrganizations(),t=e.data?.filter(n=>!fN(n));return{...e,data:t}}function Dce(){Ed=null}function pN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pN(e))&&(r&&(r+=" "),r+=t);return r}const Bq=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vq=(e,t)=>({classGroupId:e,validator:t}),mN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vm="-",BT=[],qq="arbitrary..",Hq=e=>{const t=Kq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Gq(l);const c=l.split(Vm),d=c[0]===""&&c.length>1?1:0;return gN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?Bq(f,d):d:f||BT}return n[l]||BT}}},gN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=gN(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Vm):e.slice(t).join(Vm),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},Gq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?qq+r:void 0})(),Kq=e=>{const{theme:t,classGroups:n}=e;return Zq(n,t)},Zq=(e,t)=>{const n=mN();for(const r in e){const o=e[r];Yw(o,n,r,t)}return n},Yw=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];Yq(l,t,n,r)}},Yq=(e,t,n,r)=>{if(typeof e=="string"){Wq(e,t,n);return}if(typeof e=="function"){Qq(e,t,n,r);return}Xq(e,t,n,r)},Wq=(e,t,n)=>{const r=e===""?t:vN(t,e);r.classGroupId=n},Qq=(e,t,n,r)=>{if(Jq(e)){Yw(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vq(n,e))},Xq=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[c,d]=o[l];Yw(d,vN(t,c),n,r)}},vN=(e,t)=>{let n=e;const r=t.split(Vm),o=r.length;for(let s=0;s<o;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=mN(),n.nextPart.set(l,c)),n=c}return n},Jq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},Gb="!",VT=":",tH=[],qT=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),nH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let l=0,c=0,d=0,f;const p=o.length;for(let b=0;b<p;b++){const x=o[b];if(l===0&&c===0){if(x===VT){s.push(o.slice(d,b)),d=b+1;continue}if(x==="/"){f=b;continue}}x==="["?l++:x==="]"?l--:x==="("?c++:x===")"&&c--}const h=s.length===0?o:o.slice(d);let g=h,v=!1;h.endsWith(Gb)?(g=h.slice(0,-1),v=!0):h.startsWith(Gb)&&(g=h.slice(1),v=!0);const _=f&&f>d?f-d:void 0;return qT(s,v,g,_)};if(t){const o=t+VT,s=r;r=l=>l.startsWith(o)?s(l.slice(o.length)):qT(tH,!1,l,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},rH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",d=t.has(l);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(l)):o.push(l)}return o.length>0&&(o.sort(),r.push(...o)),r}},oH=e=>({cache:eH(e.cacheSize),parseClassName:nH(e),sortModifiers:rH(e),postfixLookupClassGroupIds:iH(e),...Hq(e)}),iH=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},sH=/\s+/,aH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(sH);let f="";for(let p=d.length-1;p>=0;p-=1){const h=d[p],{isExternal:g,modifiers:v,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:x}=n(h);if(g){f=h+(f.length>0?" "+f:f);continue}let S=!!x,E;if(S){const I=b.substring(0,x);E=r(I);const P=E&&l[E]?r(b):void 0;P&&P!==E&&(E=P,S=!1)}else E=r(b);if(!E){if(!S){f=h+(f.length>0?" "+f:f);continue}if(E=r(b),!E){f=h+(f.length>0?" "+f:f);continue}S=!1}const T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=_?T+Gb:T,O=R+E;if(c.indexOf(O)>-1)continue;c.push(O);const A=o(E,S);for(let I=0;I<A.length;++I){const P=A[I];c.push(R+P)}f=h+(f.length>0?" "+f:f)}return f},lH=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=yN(n))&&(o&&(o+=" "),o+=r);return o},yN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=yN(e[r]))&&(n&&(n+=" "),n+=t);return n},cH=(e,...t)=>{let n,r,o,s;const l=d=>{const f=t.reduce((p,h)=>h(p),e());return n=oH(f),r=n.cache.get,o=n.cache.set,s=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=aH(d,n);return o(d,p),p};return s=l,(...d)=>s(lH(...d))},uH=[],Gn=e=>{const t=n=>n[e]||uH;return t.isThemeGetter=!0,t},_N=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>dH.test(e),ht=e=>!!e&&!Number.isNaN(Number(e)),hi=e=>!!e&&Number.isInteger(Number(e)),o_=e=>e.endsWith("%")&&ht(e.slice(0,-1)),Xi=e=>fH.test(e),wN=()=>!0,vH=e=>hH.test(e)&&!pH.test(e),Ww=()=>!1,yH=e=>mH.test(e),_H=e=>gH.test(e),bH=e=>!Ve(e)&&!qe(e),wH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),SH=e=>_a(e,xN,Ww),Ve=e=>_N.test(e),Ua=e=>_a(e,RN,vH),HT=e=>_a(e,IH,ht),EH=e=>_a(e,TN,wN),xH=e=>_a(e,ON,Ww),GT=e=>_a(e,SN,Ww),RH=e=>_a(e,EN,_H),ip=e=>_a(e,CN,yH),qe=e=>bN.test(e),od=e=>pl(e,RN),OH=e=>pl(e,ON),KT=e=>pl(e,SN),TH=e=>pl(e,xN),CH=e=>pl(e,EN),sp=e=>pl(e,CN,!0),AH=e=>pl(e,TN,!0),_a=(e,t,n)=>{const r=_N.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pl=(e,t,n=!1)=>{const r=bN.exec(e);return r?r[1]?t(r[1]):n:!1},SN=e=>e==="position"||e==="percentage",EN=e=>e==="image"||e==="url",xN=e=>e==="length"||e==="size"||e==="bg-size",RN=e=>e==="length",IH=e=>e==="number",ON=e=>e==="family-name",TN=e=>e==="number"||e==="weight",CN=e=>e==="shadow",MH=()=>{const e=Gn("color"),t=Gn("font"),n=Gn("text"),r=Gn("font-weight"),o=Gn("tracking"),s=Gn("leading"),l=Gn("breakpoint"),c=Gn("container"),d=Gn("spacing"),f=Gn("radius"),p=Gn("shadow"),h=Gn("inset-shadow"),g=Gn("text-shadow"),v=Gn("drop-shadow"),_=Gn("blur"),b=Gn("perspective"),x=Gn("aspect"),S=Gn("ease"),E=Gn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...R(),qe,Ve],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[qe,Ve,d],L=()=>[qs,"full","auto",...P()],q=()=>[hi,"none","subgrid",qe,Ve],j=()=>["auto",{span:["full",hi,qe,Ve]},hi,qe,Ve],B=()=>[hi,"auto",qe,Ve],F=()=>["auto","min","max","fr",qe,Ve],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...P()],W=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],te=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],le=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],Q=()=>[e,qe,Ve],k=()=>[...R(),KT,GT,{position:[qe,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",TH,SH,{size:[qe,Ve]}],D=()=>[o_,od,Ua],U=()=>["","none","full",f,qe,Ve],X=()=>["",ht,od,Ua],fe=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[ht,o_,KT,GT],je=()=>["","none",_,qe,Ve],Y=()=>["none",ht,qe,Ve],re=()=>["none",ht,qe,Ve],ve=()=>[ht,qe,Ve],se=()=>[qs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xi],breakpoint:[Xi],color:[wN],container:[Xi],"drop-shadow":[Xi],ease:["in","out","in-out"],font:[bH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xi],shadow:[Xi],spacing:["px",ht],text:[Xi],"text-shadow":[Xi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Ve,qe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",qe,Ve]}],"container-named":[wH],columns:[{columns:[ht,Ve,qe,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[hi,"auto",qe,Ve]}],basis:[{basis:[qs,"full","auto",c,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ht,qs,"auto","initial","none",Ve]}],grow:[{grow:["",ht,qe,Ve]}],shrink:[{shrink:["",ht,qe,Ve]}],order:[{order:[hi,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,od,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,AH,EH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o_,Ve]}],"font-family":[{font:[OH,xH,t]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,qe,Ve]}],"line-clamp":[{"line-clamp":[ht,"none",qe,HT]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ht,"from-font","auto",qe,Ua]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[ht,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[hi,qe,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hi,qe,Ve],radial:["",qe,Ve],conic:[hi,qe,Ve]},CH,RH]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ht,qe,Ve]}],"outline-w":[{outline:["",ht,od,Ua]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",p,sp,ip]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",h,sp,ip]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[ht,Ua]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",g,sp,ip]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[ht,qe,Ve]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ht]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[ht]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:je()}],brightness:[{brightness:[ht,qe,Ve]}],contrast:[{contrast:[ht,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,sp,ip]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",ht,qe,Ve]}],"hue-rotate":[{"hue-rotate":[ht,qe,Ve]}],invert:[{invert:["",ht,qe,Ve]}],saturate:[{saturate:[ht,qe,Ve]}],sepia:[{sepia:["",ht,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[ht,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[ht,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ht,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ht,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",ht,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[ht,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[ht,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",ht,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ht,"initial",qe,Ve]}],ease:[{ease:["linear","initial",S,qe,Ve]}],delay:[{delay:[ht,qe,Ve]}],animate:[{animate:["none",E,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,qe,Ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],zoom:[{zoom:[hi,qe,Ve]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,Ve]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[ht,od,Ua,HT]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},AN=cH(MH);function Ce(...e){return AN(Zw(e))}function PH(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function kn({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const s=e.error.code;if(t?.[s])return t[s]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function ml(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function Kb(e,t){for(const n in e)if(e[n]===t)return n}function Wd(e,t){let n=$().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var NH={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},kH={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},DH={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},LH={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},$H={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},jH={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},zH={...$H,...jH},UH={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},FH={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},BH={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},VH={INVALID_SESSION_TOKEN:"Invalid session token"},qH={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},HH={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},GH={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},KH={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},ZH={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},YH={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},WH={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},QH={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...LH,...NH,...kH,...DH,...zH,...UH,...FH,...BH,...VH,...qH,...HH,...GH,...KH,...ZH,...YH,...WH},XH={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},ZT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},YT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function JH(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const eG=e=>{switch(e){case"success":return rG;case"info":return iG;case"warning":return oG;case"error":return sG;default:return null}},tG=Array(12).fill(0),nG=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},tG.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),oG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),iG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),aG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),lG=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Zb=1;class cG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Zb++,l=this.toasts.find(d=>d.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:r}),{...d,...t,id:s,dismissible:c,title:r}):d):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,l;const c=o.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(dG(f)&&!f.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(f instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,..._})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,v=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>l[0]==="reject"?p(l[1]):f(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Zb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wr=new cG,uG=(e,t)=>{const n=t?.id||Zb++;return Wr.addToast({title:e,...t,id:n}),n},dG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fG=uG,hG=()=>Wr.toasts,pG=()=>Wr.getActiveToasts(),WT=Object.assign(fG,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:hG,getToasts:pG});JH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ap(e){return e.label!==void 0}const mG=3,gG="24px",vG="16px",QT=4e3,yG=356,_G=14,bG=45,wG=200;function pi(...e){return e.filter(Boolean).join(" ")}function SG(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const EG=e=>{var t,n,r,o,s,l,c,d,f;const{invert:p,toast:h,unstyled:g,interacting:v,setHeights:_,visibleToasts:b,heights:x,index:S,toasts:E,expanded:T,removeToast:R,defaultRichColors:O,closeButton:A,style:I,cancelButtonStyle:P,actionButtonStyle:L,className:q="",descriptionClassName:j="",duration:B,position:F,gap:Z,expandByDefault:ie,classNames:H,icons:W,closeButtonAriaLabel:te="Close toast"}=e,[le,Q]=ee.useState(null),[k,G]=ee.useState(null),[V,D]=ee.useState(!1),[U,X]=ee.useState(!1),[fe,pe]=ee.useState(!1),[xe,je]=ee.useState(!1),[Y,re]=ee.useState(!1),[ve,se]=ee.useState(0),[Se,Te]=ee.useState(0),tt=ee.useRef(h.duration||B||QT),rt=ee.useRef(null),Be=ee.useRef(null),Qe=S===0,Pe=S+1<=b,Me=h.type,Ue=h.dismissible!==!1,K=h.className||"",ne=h.descriptionClassName||"",ae=ee.useMemo(()=>x.findIndex(Ke=>Ke.toastId===h.id)||0,[x,h.id]),Oe=ee.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:A},[h.closeButton,A]),Ae=ee.useMemo(()=>h.duration||B||QT,[h.duration,B]),Ie=ee.useRef(0),ke=ee.useRef(0),Je=ee.useRef(0),et=ee.useRef(null),[vt,Tt]=F.split("-"),yt=ee.useMemo(()=>x.reduce((Ke,ut,Jt)=>Jt>=ae?Ke:Ke+ut.height,0),[x,ae]),Ln=lG(),Ni=h.invert||p,Ho=Me==="loading";ke.current=ee.useMemo(()=>ae*Z+yt,[ae,yt]),ee.useEffect(()=>{tt.current=Ae},[Ae]),ee.useEffect(()=>{D(!0)},[]),ee.useEffect(()=>{const Ke=Be.current;if(Ke){const ut=Ke.getBoundingClientRect().height;return Te(ut),_(Jt=>[{toastId:h.id,height:ut,position:h.position},...Jt]),()=>_(Jt=>Jt.filter(Zt=>Zt.toastId!==h.id))}},[_,h.id]),ee.useLayoutEffect(()=>{if(!V)return;const Ke=Be.current,ut=Ke.style.height;Ke.style.height="auto";const Jt=Ke.getBoundingClientRect().height;Ke.style.height=ut,Te(Jt),_(Zt=>Zt.find(Lt=>Lt.toastId===h.id)?Zt.map(Lt=>Lt.toastId===h.id?{...Lt,height:Jt}:Lt):[{toastId:h.id,height:Jt,position:h.position},...Zt])},[V,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const Ye=ee.useCallback(()=>{X(!0),se(ke.current),_(Ke=>Ke.filter(ut=>ut.toastId!==h.id)),setTimeout(()=>{R(h)},wG)},[h,R,_,ke]);ee.useEffect(()=>{if(h.promise&&Me==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return T||v||Ln?(()=>{if(Je.current<Ie.current){const Zt=new Date().getTime()-Ie.current;tt.current=tt.current-Zt}Je.current=new Date().getTime()})():tt.current!==1/0&&(Ie.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Ye()},tt.current)),()=>clearTimeout(Ke)},[T,v,h,Me,Ln,Ye]),ee.useEffect(()=>{h.delete&&(Ye(),h.onDismiss==null||h.onDismiss.call(h,h))},[Ye,h.delete]);function dt(){var Ke;if(W?.loading){var ut;return ee.createElement("div",{className:pi(H?.loader,h==null||(ut=h.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Me==="loading"},W.loading)}return ee.createElement(nG,{className:pi(H?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Me==="loading"})}const Ct=h.icon||W?.[Me]||eG(Me);var it,Dt;return ee.createElement("li",{tabIndex:0,ref:Be,className:pi(q,K,H?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,H?.default,H?.[Me],h==null||(n=h.classNames)==null?void 0:n[Me]),"data-sonner-toast":"","data-rich-colors":(it=h.richColors)!=null?it:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Y,"data-removed":U,"data-visible":Pe,"data-y-position":vt,"data-x-position":Tt,"data-index":S,"data-front":Qe,"data-swiping":fe,"data-dismissible":Ue,"data-type":Me,"data-invert":Ni,"data-swipe-out":xe,"data-swipe-direction":k,"data-expanded":!!(T||ie&&V),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${U?ve:ke.current}px`,"--initial-height":ie?"auto":`${Se}px`,...I,...h.style},onDragEnd:()=>{pe(!1),Q(null),et.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Ho||!Ue||(rt.current=new Date,se(ke.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(pe(!0),et.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,ut,Jt;if(xe||!Ue)return;et.current=null;const Zt=Number(((Ke=Be.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sr=Number(((ut=Be.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Jt=rt.current)==null?void 0:Jt.getTime()),ln=le==="x"?Zt:Sr,So=Math.abs(ln)/Lt;if(Math.abs(ln)>=bG||So>.11){se(ke.current),h.onDismiss==null||h.onDismiss.call(h,h),G(le==="x"?Zt>0?"right":"left":Sr>0?"down":"up"),Ye(),je(!0);return}else{var sr,zr;(sr=Be.current)==null||sr.style.setProperty("--swipe-amount-x","0px"),(zr=Be.current)==null||zr.style.setProperty("--swipe-amount-y","0px")}re(!1),pe(!1),Q(null)},onPointerMove:Ke=>{var ut,Jt,Zt;if(!et.current||!Ue||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Lt=Ke.clientY-et.current.y,ln=Ke.clientX-et.current.x;var So;const sr=(So=e.swipeDirections)!=null?So:SG(F);!le&&(Math.abs(ln)>1||Math.abs(Lt)>1)&&Q(Math.abs(ln)>Math.abs(Lt)?"x":"y");let zr={x:0,y:0};const _l=Go=>1/(1.5+Math.abs(Go)/20);if(le==="y"){if(sr.includes("top")||sr.includes("bottom"))if(sr.includes("top")&&Lt<0||sr.includes("bottom")&&Lt>0)zr.y=Lt;else{const Go=Lt*_l(Lt);zr.y=Math.abs(Go)<Math.abs(Lt)?Go:Lt}}else if(le==="x"&&(sr.includes("left")||sr.includes("right")))if(sr.includes("left")&&ln<0||sr.includes("right")&&ln>0)zr.x=ln;else{const Go=ln*_l(ln);zr.x=Math.abs(Go)<Math.abs(ln)?Go:ln}(Math.abs(zr.x)>0||Math.abs(zr.y)>0)&&re(!0),(Jt=Be.current)==null||Jt.style.setProperty("--swipe-amount-x",`${zr.x}px`),(Zt=Be.current)==null||Zt.style.setProperty("--swipe-amount-y",`${zr.y}px`)}},Oe&&!h.jsx&&Me!=="loading"?ee.createElement("button",{"aria-label":te,"data-disabled":Ho,"data-close-button":!0,onClick:Ho||!Ue?()=>{}:()=>{Ye(),h.onDismiss==null||h.onDismiss.call(h,h)},className:pi(H?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Dt=W?.close)!=null?Dt:aG):null,(Me||h.icon||h.promise)&&h.icon!==null&&(W?.[Me]!==null||h.icon)?ee.createElement("div",{"data-icon":"",className:pi(H?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||dt():null,h.type!=="loading"?Ct:null):null,ee.createElement("div",{"data-content":"",className:pi(H?.content,h==null||(s=h.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:pi(H?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ee.createElement("div",{"data-description":"",className:pi(j,ne,H?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ee.isValidElement(h.cancel)?h.cancel:h.cancel&&ap(h.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:Ke=>{ap(h.cancel)&&Ue&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),Ye())},className:pi(H?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ee.isValidElement(h.action)?h.action:h.action&&ap(h.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ke=>{ap(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&Ye())},className:pi(H?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function XT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xG(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,l=s?"--mobile-offset":"--offset",c=s?vG:gG;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const RG=ee.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:v,duration:_,style:b,visibleToasts:x=mG,toastOptions:S,dir:E=XT(),gap:T=_G,icons:R,containerAriaLabel:O="Notifications"}=t,[A,I]=ee.useState([]),P=ee.useMemo(()=>r?A.filter(V=>V.toasterId===r):A.filter(V=>!V.toasterId),[A,r]),L=ee.useMemo(()=>Array.from(new Set([s].concat(P.filter(V=>V.position).map(V=>V.position)))),[P,s]),[q,j]=ee.useState([]),[B,F]=ee.useState(!1),[Z,ie]=ee.useState(!1),[H,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ee.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=ee.useRef(null),k=ee.useRef(!1),G=ee.useCallback(V=>{I(D=>{var U;return(U=D.find(X=>X.id===V.id))!=null&&U.delete||Wr.dismiss(V.id),D.filter(({id:X})=>X!==V.id)})},[]);return ee.useEffect(()=>Wr.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{I(D=>D.map(U=>U.id===V.id?{...U,delete:!0}:U))});return}setTimeout(()=>{GP.flushSync(()=>{I(D=>{const U=D.findIndex(X=>X.id===V.id);return U!==-1?[...D.slice(0,U),{...D[U],...V},...D.slice(U+1)]:[V,...D]})})})}),[A]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{W(D?"dark":"light")})}catch{V.addListener(({matches:U})=>{try{W(U?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{A.length<=1&&F(!1)},[A]),ee.useEffect(()=>{const V=D=>{var U;if(l.every(pe=>D[pe]||D.code===pe)){var fe;F(!0),(fe=te.current)==null||fe.focus()}D.code==="Escape"&&(document.activeElement===te.current||(U=te.current)!=null&&U.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[l]),ee.useEffect(()=>{if(te.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,k.current=!1)}},[te.current]),ee.createElement("section",{ref:n,"aria-label":`${O} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((V,D)=>{var U;const[X,fe]=V.split("-");return P.length?ee.createElement("ol",{key:V,dir:E==="auto"?XT():E,tabIndex:-1,ref:te,className:f,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":X,"data-x-position":fe,style:{"--front-toast-height":`${((U=q[0])==null?void 0:U.height)||0}px`,"--width":`${yG}px`,"--gap":`${T}px`,...b,...xG(p,h)},onBlur:pe=>{k.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(k.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||k.current||(k.current=!0,Q.current=pe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Z||F(!1)},onDragEnd:()=>F(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},P.filter(pe=>!pe.position&&D===0||pe.position===V).map((pe,xe)=>{var je,Y;return ee.createElement(EG,{key:pe.id,icons:R,index:xe,toast:pe,defaultRichColors:v,duration:(je=S?.duration)!=null?je:_,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(Y=S?.closeButton)!=null?Y:d,interacting:Z,position:V,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:G,toasts:P.filter(re=>re.position==pe.position),heights:q.filter(re=>re.position==pe.position),setHeights:j,expandByDefault:c,gap:T,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),IN=M.createContext({});function MN(){return M.useContext(IN)}var i_,JT;function OG(){if(JT)return i_;JT=1;var e=function(){};return i_=e,i_}var TG=OG();const CG=dl(TG);function AG({async:e,appendTo:t,defer:n,id:r,nonce:o,src:s}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),o&&l.setAttribute("nonce",o),l.src=s,(t==="head"?document.head:document.body).appendChild(l)}var IG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Dd=null,Qd=!1;const qm=new Set,Hm=new Set,MG=typeof window<"u",Dc="___grecaptcha_cfg",PN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function PG(){if(!MG)return;function e(n){if(Qd)n();else{window[Dc]||(window[Dc]={});const r=window[Dc];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){Qd=!0;for(const n of Hm)n();Hm.clear()}window[PN]=t}function NG({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const s=o?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",c=new URLSearchParams({render:n});return t&&c.set("onload",t),e&&c.set("hl",e),`https://www.${s}/recaptcha/${l}?${c.toString()}`}function kG({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const s={id:"google-recaptcha-v3"},l=NG({language:e,onLoadCallbackName:PN,render:t,useEnterprise:r,useRecaptchaNet:o});if(Dd){if(Dd!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Dd=l,AG(Object.assign(Object.assign(Object.assign({},s),n),{src:l}))}function DG(e){if(!window[Dc])return;const t=window[Dc];t.clients&&delete t.clients[e]}function LG(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=IG(t,["onLoadCallback","onLoadCallbackName"]);if(qm.size===0&&PG(),kG(o),qm.add(e),n&&(Qd?n():Hm.add(n)),r){let s=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};Qd?s():Hm.add(s)}}function $G(e){var t,n,r;qm.delete(e),qm.size===0&&(window.grecaptcha=void 0,window[Dc]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Dd}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Dd=null,Qd=!1)}let eC=!1;function jG({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:s,useRecaptchaNet:l}){var c,d,f,p,h,g,v;const _=M.useId(),[b,x]=M.useState(null),[S,E]=M.useState(null),T=M.useRef(!1);M.useEffect(()=>{function I(){var P;const L=s?(P=window.grecaptcha)===null||P===void 0?void 0:P.enterprise:window.grecaptcha;if(!L)throw new Error("reCAPTCHA not found");if(!L.ready)throw new Error("reCAPTCHA ready callback not found");L.ready(()=>{x(L)})}return LG(_,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:s,useRecaptchaNet:l}),()=>{$G(_),x(null)}},[e?.element,_,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,s,l]),M.useEffect(()=>{var I,P,L;if(!e?.element||!b?.render)return;const q={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},j=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!j)throw new Error("reCAPTCHA container element not found");const B=b.render(j,q);return!((P=e?.parameters)===null||P===void 0)&&P.hidden&&(eC||(CG(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),eC=!0),(L=j.querySelector(".grecaptcha-badge"))===null||L===void 0||L.style.setProperty("display","none")),E(B),T.current=!0,()=>{E(null),T.current=!1,DG(B),j.innerHTML=""}},[e?.element,(c=e?.parameters)===null||c===void 0?void 0:c.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(p=e?.parameters)===null||p===void 0?void 0:p.errorCallback,(h=e?.parameters)===null||h===void 0?void 0:h.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(v=e?.parameters)===null||v===void 0?void 0:v.theme,b,r]);const R=!!e?.element,O=R?S:r,A=M.useMemo(()=>O!==null&&b?.execute?I=>{if(O===null||!b?.execute)throw new Error("reCAPTCHA has not been loaded");return R&&!T.current?(console.warn("Client ID not mounted"),null):b.execute(O,{action:I})}:void 0,[O,b,R]);return C.jsx(IN.Provider,{value:{container:e?.element,executeRecaptcha:A,reCaptchaInstance:b},children:t})}var zG=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},No=new zG;function UG(){return()=>{}}function ms(){return M.useSyncExternalStore(UG,()=>!0,()=>!1)}function NN(){const[e,t]=M.useState();return M.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const s of o)s.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Qw(){const[e,t]=M.useState("light");return M.useEffect(()=>{const n=()=>{var o;const s=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(s?"dark":"light")};n();const r=new MutationObserver(o=>{for(const s of o)(s.attributeName==="style"||s.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function FG({children:e}){const t=ms(),{captcha:n}=M.useContext(pt);return n?.provider!=="google-recaptcha-v3"?e:C.jsxs(jG,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&C.jsx("style",{children:`
|
|
48
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function Fm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const h=l._zod.parent;if(h&&h!==p){r(h);const g=e.seen.get(h);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bm(t,"input",e.processors),output:Bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Dr(r.element,n);if(r.type==="set")return Dr(r.valueType,n);if(r.type==="lazy")return Dr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Dr(r.innerType,n);if(r.type==="intersection")return Dr(r.left,n)||Dr(r.right,n);if(r.type==="record"||r.type==="map")return Dr(r.keyType,n)||Dr(r.valueType,n);if(r.type==="pipe")return Dr(r.in,n)||Dr(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Dr(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Dr(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Dr(o,n))return!0;return!!(r.rest&&Dr(r.rest,n))}return!1}const ZF=(e,t={})=>n=>{const r=zm({...n,processors:t});return on(e,r),Um(r,e),Fm(r,e)},Bm=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},l=zm({...o??{},target:s,io:t,processors:n});return on(e,l),Um(l,e),Fm(l,e)},YF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_3=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof l=="number"&&(o.maxLength=l),c&&(o.format=YF[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),f&&(o.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},b3=(e,t,n,r)=>{const o=n,{minimum:s,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=p,o.exclusiveMinimum=!0):o.exclusiveMinimum=p),typeof s=="number"&&(o.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=f,o.exclusiveMaximum=!0):o.exclusiveMaximum=f),typeof l=="number"&&(o.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof d=="number"&&(o.multipleOf=d)},w3=(e,t,n,r)=>{n.type="boolean"},WF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},QF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},S3=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},E3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},x3=(e,t,n,r)=>{n.not={}},R3=(e,t,n,r)=>{},O3=(e,t,n,r)=>{},JF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},T3=(e,t,n,r)=>{const o=e._zod.def,s=XP(o.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},C3=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},eB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},tB=(e,t,n,r)=>{const o=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},A3=(e,t,n,r)=>{const o=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:c,mime:d}=e._zod.bag;l!==void 0&&(s.minLength=l),c!==void 0&&(s.maxLength=c),d?d.length===1?(s.contentMediaType=d[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(o,s)},nB=(e,t,n,r)=>{n.type="boolean"},I3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},M3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},P3=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=on(s.element,t,{...r,path:[...r.path,"items"]})},N3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const l=s.shape;for(const f in l)o.properties[f]=on(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].filter(f=>{const p=s.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(o.required=Array.from(d)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=on(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},k3=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,l=o.options.map((c,d)=>on(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",d]}));s?n.oneOf=l:n.anyOf=l},D3=(e,t,n,r)=>{const o=e._zod.def,s=on(o.left,t,{...r,path:[...r.path,"allOf",0]}),l=on(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=d},L3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((g,v)=>on(g,t,{...r,path:[...r.path,l,v]})),f=s.rest?on(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=d,f&&(o.items=f)):t.target==="openapi-3.0"?(o.items={anyOf:d},f&&o.items.anyOf.push(f),o.minItems=d.length,f||(o.maxItems=d.length)):(o.items=d,f&&(o.additionalItems=f));const{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)},$3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const l=s.keyType,d=l._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const p=on(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of d)o.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=on(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=on(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(o.required=p)}},j3=(e,t,n,r)=>{const o=e._zod.def,s=on(o.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},z3=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},U3=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},F3=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},B3=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},V3=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;on(s,t,r);const l=t.seen.get(e);l.ref=s},q3=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},sB=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Uw=(e,t,n,r)=>{const o=e._zod.def;on(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},H3=(e,t,n,r)=>{const o=e._zod.innerType;on(o,t,r);const s=t.seen.get(e);s.ref=o},IT={string:_3,number:b3,boolean:w3,bigint:WF,symbol:QF,null:S3,undefined:E3,void:XF,never:x3,any:R3,unknown:O3,date:JF,enum:T3,literal:C3,nan:eB,template_literal:tB,file:A3,success:nB,custom:I3,function:rB,transform:M3,map:oB,set:iB,array:P3,object:N3,union:k3,intersection:D3,tuple:L3,record:$3,nullable:j3,nonoptional:z3,default:U3,prefault:F3,catch:B3,pipe:V3,readonly:q3,promise:sB,optional:Uw,lazy:H3};function Cce(e,t){if("_idmap"in e){const r=e,o=zm({...t,processors:IT}),s={};for(const d of r._idmap.entries()){const[f,p]=d;on(p,o)}const l={},c={registry:r,uri:t?.uri,defs:s};o.external=c;for(const d of r._idmap.entries()){const[f,p]=d;Um(o,p),l[f]=Fm(o,p)}if(Object.keys(s).length>0){const d=o.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:s}}return{schemas:l}}const n=zm({...t,processors:IT});return on(e,n),Um(n,e),Fm(n,e)}const aB=ye("ZodISODateTime",(e,t)=>{rU.init(e,t),wn.init(e,t)});function G3(e){return pF(aB,e)}const lB=ye("ZodISODate",(e,t)=>{oU.init(e,t),wn.init(e,t)});function cB(e){return mF(lB,e)}const uB=ye("ZodISOTime",(e,t)=>{iU.init(e,t),wn.init(e,t)});function dB(e){return gF(uB,e)}const fB=ye("ZodISODuration",(e,t)=>{sU.init(e,t),wn.init(e,t)});function hB(e){return vF(fB,e)}const pB=(e,t)=>{jw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>V9(e,n)},flatten:{value:n=>B9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zb,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zb,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bo=ye("ZodError",pB,{Parent:Error}),mB=jg(Bo),gB=zg(Bo),vB=Ug(Bo),yB=Fg(Bo),_B=Z9(Bo),bB=Y9(Bo),wB=W9(Bo),SB=Q9(Bo),EB=X9(Bo),xB=J9(Bo),RB=ez(Bo),OB=tz(Bo),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bm(e,"input"),output:Bm(e,"output")}}),e.toJSONSchema=ZF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ga(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>va(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>mB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>vB(e,n,r),e.parseAsync=async(n,r)=>gB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>yB(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>_B(e,n,r),e.decode=(n,r)=>bB(e,n,r),e.encodeAsync=async(n,r)=>wB(e,n,r),e.decodeAsync=async(n,r)=>SB(e,n,r),e.safeEncode=(n,r)=>EB(e,n,r),e.safeDecode=(n,r)=>xB(e,n,r),e.safeEncodeAsync=async(n,r)=>RB(e,n,r),e.safeDecodeAsync=async(n,r)=>OB(e,n,r),e.refine=(n,r)=>e.check(SV(n,r)),e.superRefine=n=>e.check(EV(n)),e.overwrite=n=>e.check(nu(n)),e.optional=()=>bn(e),e.exactOptional=()=>lV(e),e.nullable=()=>NT(e),e.nullish=()=>bn(NT(e)),e.nonoptional=n=>pV(e,n),e.array=()=>Re(e),e.or=n=>an([e,n]),e.and=n=>qw(e,n),e.transform=n=>Bb(e,X3(n)),e.default=n=>dV(e,n),e.prefault=n=>hV(e,n),e.catch=n=>gV(e,n),e.pipe=n=>Bb(e,n),e.readonly=()=>_V(e),e.describe=n=>{const r=e.clone();return wd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wd.get(e);const r=e.clone();return wd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),K3=ye("_ZodString",(e,t)=>{zw.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>_3(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(IF(...r)),e.includes=(...r)=>e.check(NF(...r)),e.startsWith=(...r)=>e.check(kF(...r)),e.endsWith=(...r)=>e.check(DF(...r)),e.min=(...r)=>e.check(jm(...r)),e.max=(...r)=>e.check(v3(...r)),e.length=(...r)=>e.check(y3(...r)),e.nonempty=(...r)=>e.check(jm(1,...r)),e.lowercase=r=>e.check(MF(r)),e.uppercase=r=>e.check(PF(r)),e.trim=()=>e.check(jF()),e.normalize=(...r)=>e.check($F(...r)),e.toLowerCase=()=>e.check(zF()),e.toUpperCase=()=>e.check(UF()),e.slugify=()=>e.check(FF())}),TB=ye("ZodString",(e,t)=>{zw.init(e,t),K3.init(e,t),e.email=n=>e.check(ZU(CB,n)),e.url=n=>e.check(g3(Z3,n)),e.jwt=n=>e.check(hF(qB,n)),e.emoji=n=>e.check(JU(IB,n)),e.guid=n=>e.check(OT(MT,n)),e.uuid=n=>e.check(YU(ep,n)),e.uuidv4=n=>e.check(WU(ep,n)),e.uuidv6=n=>e.check(QU(ep,n)),e.uuidv7=n=>e.check(XU(ep,n)),e.nanoid=n=>e.check(eF(MB,n)),e.guid=n=>e.check(OT(MT,n)),e.cuid=n=>e.check(tF(PB,n)),e.cuid2=n=>e.check(nF(NB,n)),e.ulid=n=>e.check(rF(kB,n)),e.base64=n=>e.check(uF(FB,n)),e.base64url=n=>e.check(dF(BB,n)),e.xid=n=>e.check(oF(DB,n)),e.ksuid=n=>e.check(iF(LB,n)),e.ipv4=n=>e.check(sF($B,n)),e.ipv6=n=>e.check(aF(jB,n)),e.cidrv4=n=>e.check(lF(zB,n)),e.cidrv6=n=>e.check(cF(UB,n)),e.e164=n=>e.check(fF(VB,n)),e.datetime=n=>e.check(G3(n)),e.date=n=>e.check(cB(n)),e.time=n=>e.check(dB(n)),e.duration=n=>e.check(hB(n))});function $(e){return KU(TB,e)}const wn=ye("ZodStringFormat",(e,t)=>{gn.init(e,t),K3.init(e,t)}),CB=ye("ZodEmail",(e,t)=>{Zz.init(e,t),wn.init(e,t)}),MT=ye("ZodGUID",(e,t)=>{Gz.init(e,t),wn.init(e,t)}),ep=ye("ZodUUID",(e,t)=>{Kz.init(e,t),wn.init(e,t)}),Z3=ye("ZodURL",(e,t)=>{Yz.init(e,t),wn.init(e,t)});function AB(e){return g3(Z3,e)}const IB=ye("ZodEmoji",(e,t)=>{Wz.init(e,t),wn.init(e,t)}),MB=ye("ZodNanoID",(e,t)=>{Qz.init(e,t),wn.init(e,t)}),PB=ye("ZodCUID",(e,t)=>{Xz.init(e,t),wn.init(e,t)}),NB=ye("ZodCUID2",(e,t)=>{Jz.init(e,t),wn.init(e,t)}),kB=ye("ZodULID",(e,t)=>{eU.init(e,t),wn.init(e,t)}),DB=ye("ZodXID",(e,t)=>{tU.init(e,t),wn.init(e,t)}),LB=ye("ZodKSUID",(e,t)=>{nU.init(e,t),wn.init(e,t)}),$B=ye("ZodIPv4",(e,t)=>{aU.init(e,t),wn.init(e,t)}),jB=ye("ZodIPv6",(e,t)=>{lU.init(e,t),wn.init(e,t)}),zB=ye("ZodCIDRv4",(e,t)=>{cU.init(e,t),wn.init(e,t)}),UB=ye("ZodCIDRv6",(e,t)=>{uU.init(e,t),wn.init(e,t)}),FB=ye("ZodBase64",(e,t)=>{dU.init(e,t),wn.init(e,t)}),BB=ye("ZodBase64URL",(e,t)=>{hU.init(e,t),wn.init(e,t)}),VB=ye("ZodE164",(e,t)=>{pU.init(e,t),wn.init(e,t)}),qB=ye("ZodJWT",(e,t)=>{gU.init(e,t),wn.init(e,t)}),Fw=ye("ZodNumber",(e,t)=>{d3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>b3(e,r,o),e.gt=(r,o)=>e.check(CT(r,o)),e.gte=(r,o)=>e.check(Wy(r,o)),e.min=(r,o)=>e.check(Wy(r,o)),e.lt=(r,o)=>e.check(TT(r,o)),e.lte=(r,o)=>e.check(Yy(r,o)),e.max=(r,o)=>e.check(Yy(r,o)),e.int=r=>e.check(PT(r)),e.safe=r=>e.check(PT(r)),e.positive=r=>e.check(CT(0,r)),e.nonnegative=r=>e.check(Wy(0,r)),e.negative=r=>e.check(TT(0,r)),e.nonpositive=r=>e.check(Yy(0,r)),e.multipleOf=(r,o)=>e.check(AT(r,o)),e.step=(r,o)=>e.check(AT(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function at(e){return yF(Fw,e)}const HB=ye("ZodNumberFormat",(e,t)=>{vU.init(e,t),Fw.init(e,t)});function PT(e){return bF(HB,e)}const Y3=ye("ZodBoolean",(e,t)=>{yU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>w3(e,n,r)});function Nt(e){return wF(Y3,e)}const GB=ye("ZodUndefined",(e,t)=>{_U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>E3(e,n)});function Ace(e){return EF(GB,e)}const KB=ye("ZodNull",(e,t)=>{bU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>S3(e,n,r)});function ZB(e){return xF(KB,e)}const YB=ye("ZodAny",(e,t)=>{wU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>R3()});function WB(){return RF(YB)}const QB=ye("ZodUnknown",(e,t)=>{SU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>O3()});function Gt(){return OF(QB)}const XB=ye("ZodNever",(e,t)=>{EU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x3(e,n,r)});function W3(e){return TF(XB,e)}const JB=ye("ZodArray",(e,t)=>{xU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>P3(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(jm(n,r)),e.nonempty=n=>e.check(jm(1,n)),e.max=(n,r)=>e.check(v3(n,r)),e.length=(n,r)=>e.check(y3(n,r)),e.unwrap=()=>e.element});function Re(e,t){return BF(JB,e,t)}const Bw=ye("ZodObject",(e,t)=>{OU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>N3(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>sn(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gt()}),e.strict=()=>e.clone({...e._zod.def,catchall:W3()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>$9(e,n),e.safeExtend=n=>j9(e,n),e.merge=n=>z9(e,n),e.pick=n=>D9(e,n),e.omit=n=>L9(e,n),e.partial=(...n)=>U9(J3,e,n[0]),e.required=(...n)=>F9(eN,e,n[0])});function be(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new Bw(n)}function Ice(e,t){return new Bw({type:"object",shape:e,catchall:W3(),...Fe(t)})}function vr(e,t){return new Bw({type:"object",shape:e,catchall:Gt(),...Fe(t)})}const Q3=ye("ZodUnion",(e,t)=>{p3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k3(e,n,r,o),e.options=t.options});function an(e,t){return new Q3({type:"union",options:e,...Fe(t)})}const eV=ye("ZodDiscriminatedUnion",(e,t)=>{Q3.init(e,t),TU.init(e,t)});function Vw(e,t,n){return new eV({type:"union",options:t,discriminator:e,...Fe(n)})}const tV=ye("ZodIntersection",(e,t)=>{CU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>D3(e,n,r,o)});function qw(e,t){return new tV({type:"intersection",left:e,right:t})}const nV=ye("ZodTuple",(e,t)=>{AU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>L3(e,n,r,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Mce(e,t,n){const r=t instanceof Bt,o=r?n:t,s=r?t:null;return new nV({type:"tuple",items:e,rest:s,...Fe(o)})}const rV=ye("ZodRecord",(e,t)=>{IU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$3(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Mt(e,t,n){return new rV({type:"record",keyType:e,valueType:t,...Fe(n)})}const Fb=ye("ZodEnum",(e,t)=>{MU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>T3(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Fb({...t,checks:[],...Fe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Fb({...t,checks:[],...Fe(o),entries:s})}});function sn(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Fb({type:"enum",entries:n,...Fe(t)})}const oV=ye("ZodLiteral",(e,t)=>{PU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>C3(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ge(e,t){return new oV({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const iV=ye("ZodFile",(e,t)=>{NU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>A3(e,n,r),e.min=(n,r)=>e.check(AF(n,r)),e.max=(n,r)=>e.check(CF(n,r)),e.mime=(n,r)=>e.check(LF(Array.isArray(n)?n:[n],r))});function Pce(e){return VF(iV,e)}const sV=ye("ZodTransform",(e,t)=>{kU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>M3(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WP(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Yd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Yd(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function X3(e){return new sV({type:"transform",transform:e})}const J3=ye("ZodOptional",(e,t)=>{m3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bn(e){return new J3({type:"optional",innerType:e})}const aV=ye("ZodExactOptional",(e,t)=>{DU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function lV(e){return new aV({type:"optional",innerType:e})}const cV=ye("ZodNullable",(e,t)=>{LU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function NT(e){return new cV({type:"nullable",innerType:e})}const uV=ye("ZodDefault",(e,t)=>{$U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>U3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dV(e,t){return new uV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():e3(t)}})}const fV=ye("ZodPrefault",(e,t)=>{jU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>F3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function hV(e,t){return new fV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():e3(t)}})}const eN=ye("ZodNonOptional",(e,t)=>{zU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pV(e,t){return new eN({type:"nonoptional",innerType:e,...Fe(t)})}const mV=ye("ZodCatch",(e,t)=>{UU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gV(e,t){return new mV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vV=ye("ZodPipe",(e,t)=>{FU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V3(e,n,r,o),e.in=t.in,e.out=t.out});function Bb(e,t){return new vV({type:"pipe",in:e,out:t})}const yV=ye("ZodReadonly",(e,t)=>{BU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>q3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _V(e){return new yV({type:"readonly",innerType:e})}const bV=ye("ZodLazy",(e,t)=>{VU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H3(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function ya(e){return new bV({type:"lazy",getter:e})}const Hw=ye("ZodCustom",(e,t)=>{qU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>I3(e,n)});function wV(e,t){return qF(Hw,e??(()=>!0),t)}function SV(e,t={}){return HF(Hw,e,t)}function EV(e){return GF(e)}function Nce(e,t={}){const n=new Hw({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Fe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Gw(e,t){return Bb(X3(e),t)}const xV={custom:"custom"};function tN(e){return _F(Fw,e)}function kT(e){return SF(Y3,e)}function RV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var kd=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function OV(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function TV(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new kd(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kd?t:new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Qy(e,t="/api/auth"){if(TV(e),OV(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function CV(e,t,n,r,o){if(e)return Qy(e,t);{const s=Do.BETTER_AUTH_URL||Do.NEXT_PUBLIC_BETTER_AUTH_URL||Do.PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_AUTH_URL||(Do.BASE_URL!=="/"?Do.BASE_URL:void 0);if(s)return Qy(s,t)}if(typeof window<"u"&&window.location)return Qy(window.location.origin,t)}const AV={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},IV={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},MV=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,DT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},PV=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function NV(e){return e instanceof Date&&!isNaN(e.getTime())}function kV(e){const t=PV.exec(e);if(!t)return null;const[,n,r,o,s,l,c,d,f,p,h]=t,g=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(l,10),parseInt(c,10),d?parseInt(d.padEnd(3,"0"),10):0));if(f){const v=(parseInt(p,10)*60+parseInt(h,10))*(f==="+"?-1:1);g.setUTCMinutes(g.getUTCMinutes()+v)}return NV(g)?g:null}function DV(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const l=e.trim();if(l.length>0&&l[0]==='"'&&l.endsWith('"')&&!l.slice(1,-1).includes('"'))return l.slice(1,-1);const c=l.toLowerCase();if(c.length<=9&&c in DT)return DT[c];if(!MV.test(l)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(IV).some(([d,f])=>{const p=f.test(l);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${d} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(l,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof p=="string"){const h=kV(p);if(h)return h}return o?o(f,p):p})}catch(d){if(n)throw d;return e}}function LV(e,t={strict:!0}){return DV(e,t)}let Wo=[],Vs=0;const tp=4,$V=globalThis.nanostoresGlobal||={epoch:0},Cc=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=Vs+tp;s<Wo.length;)Wo[s]===r?Wo.splice(s,tp):s+=tp;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){$V.epoch++;let s=!Wo.length;for(let l of t)Wo.push(l,n.value,r,o);if(s){for(Vs=0;Vs<Wo.length;Vs+=tp)Wo[Vs](Wo[Vs+1],Wo[Vs+2],Wo[Vs+3]);Wo.length=0}},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},jV=5,np=6,rp=10;let zV=(e,t,n,r)=>(e.events=e.events||{},e.events[n+rp]||(e.events[n+rp]=r(o=>{e.events[n].reduceRight((s,l)=>(l(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+rp](),delete e.events[n+rp])});const UV=1e3;let nN=(e,t)=>zV(e,r=>{let o=t(r);o&&e.events[np].push(o)},jV,r=>{let o=e.listen;e.listen=(...l)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...l));let s=e.off;return e.events[np]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let l of e.events[np])l();e.events[np]=[]}},UV)},()=>{e.listen=o,e.off=s}});function FV(e,t,n){let r=new Set(t).add(void 0);return e.listen((o,s,l)=>{r.has(l)&&n(o,s,l)})}const BV=()=>typeof window>"u",Sd=(e,t,n,r)=>{const o=Cc({data:null,error:null,isPending:!0,isRefetching:!1,refetch:c=>s(c)}),s=async c=>new Promise(d=>{const f=typeof r=="function"?r({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):r;n(t,{...f,query:{...f?.query,...c?.query},async onSuccess(p){o.set({data:p.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onSuccess?.(p)},async onError(p){const{request:h}=p,g=typeof h.retry=="number"?h.retry:h.retry?.attempts,v=h.retryAttempt||0;g&&v<g||(o.set({error:p.error,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onError?.(p))},async onRequest(p){const h=o.get();o.set({isPending:h.data===null,data:h.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await f?.onRequest?.(p)}}).catch(p=>{o.set({error:p,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{d(void 0)})});e=Array.isArray(e)?e:[e];let l=!1;for(const c of e)c.subscribe(async()=>{BV()||(l?await s():nN(o,()=>{const d=setTimeout(async()=>{l||(await s(),l=!0)},0);return()=>{o.off(),c.off(),clearTimeout(d)}}))});return o},Xy=Symbol.for("better-auth:broadcast-channel"),VV=()=>Math.floor(Date.now()/1e3);var qV=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:VV()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function Jy(e="better-auth.message"){return globalThis[Xy]||(globalThis[Xy]=new qV(e)),globalThis[Xy]}const e_=Symbol.for("better-auth:focus-manager");var HV=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function LT(){return globalThis[e_]||(globalThis[e_]=new HV),globalThis[e_]}const t_=Symbol.for("better-auth:online-manager");var GV=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function n_(){return globalThis[t_]||(globalThis[t_]=new GV),globalThis[t_]}const ic=()=>Math.floor(Date.now()/1e3),KV=5;function ZV(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,l=o.sessionOptions?.refetchOnWindowFocus??!0,c=o.sessionOptions?.refetchWhenOffline??!1,d={lastSync:0,lastSessionRequest:0,cachedSession:void 0},f=()=>c||n_().isOnline,p=E=>{if(!f())return;if(E?.event==="storage"){d.lastSync=ic(),n.set(!n.get());return}const T=t.get();if(E?.event==="poll"){d.lastSessionRequest=ic(),r("/get-session").then(R=>{R.error?t.set({...T,data:null,error:R.error}):t.set({...T,data:R.data,error:null}),d.lastSync=ic(),n.set(!n.get())}).catch(()=>{});return}if(E?.event==="visibilitychange"){if(ic()-d.lastSessionRequest<KV)return;d.lastSessionRequest=ic()}(T?.data===null||T?.data===void 0||E?.event==="visibilitychange")&&(d.lastSync=ic(),n.set(!n.get()))},h=E=>{Jy().post({event:"session",data:{trigger:E},clientId:Math.random().toString(36).substring(7)})},g=()=>{s&&s>0&&(d.pollInterval=setInterval(()=>{t.get()?.data&&p({event:"poll"})},s*1e3))},v=()=>{d.unsubscribeBroadcast=Jy().subscribe(()=>{p({event:"storage"})})},_=()=>{l&&(d.unsubscribeFocus=LT().subscribe(()=>{p({event:"visibilitychange"})}))},b=()=>{d.unsubscribeOnline=n_().subscribe(E=>{E&&p({event:"visibilitychange"})})};return{init:()=>{g(),v(),_(),b(),Jy().setup(),LT().setup(),n_().setup()},cleanup:()=>{d.pollInterval&&(clearInterval(d.pollInterval),d.pollInterval=void 0),d.unsubscribeBroadcast&&(d.unsubscribeBroadcast(),d.unsubscribeBroadcast=void 0),d.unsubscribeFocus&&(d.unsubscribeFocus(),d.unsubscribeFocus=void 0),d.unsubscribeOnline&&(d.unsubscribeOnline(),d.unsubscribeOnline=void 0),d.lastSync=0,d.lastSessionRequest=0,d.cachedSession=void 0},triggerRefetch:p,broadcastSessionUpdate:h}}function YV(e,t){const n=Cc(!1),r=Sd(n,"/get-session",e,{method:"GET"});return nN(r,()=>{const o=ZV({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return o.init(),()=>{o.cleanup()}}),{session:r,$sessionSignal:n}}function r_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Vb(e,t,n=".",r){if(!r_(t))return Vb(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const l=e[s];l!=null&&(r&&r(o,s,l,n)||(Array.isArray(l)&&Array.isArray(o[s])?o[s]=[...l,...o[s]]:r_(l)&&r_(o[s])?o[s]=Vb(l,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=l))}return o}function WV(e){return(...t)=>t.reduce((n,r)=>Vb(n,r,"",e),{})}const QV=WV();var XV=Object.defineProperty,JV=Object.defineProperties,eq=Object.getOwnPropertyDescriptors,$T=Object.getOwnPropertySymbols,tq=Object.prototype.hasOwnProperty,nq=Object.prototype.propertyIsEnumerable,jT=(e,t,n)=>t in e?XV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ti=(e,t)=>{for(var n in t||(t={}))tq.call(t,n)&&jT(e,n,t[n]);if($T)for(var n of $T(t))nq.call(t,n)&&jT(e,n,t[n]);return e},vi=(e,t)=>JV(e,eq(t)),rq=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},oq=async(e,t)=>{var n,r,o,s,l,c;let d=t||{};const f={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:d,hooks:f};for(const p of t?.plugins||[]){if(p.init){const h=await((n=p.init)==null?void 0:n.call(p,e.toString(),t));d=h.options||d,e=h.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((o=p.hooks)==null?void 0:o.onResponse),f.onSuccess.push((s=p.hooks)==null?void 0:s.onSuccess),f.onError.push((l=p.hooks)==null?void 0:l.onError),f.onRetry.push((c=p.hooks)==null?void 0:c.onRetry)}return{url:e,options:d,hooks:f}},zT=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},iq=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function sq(e){if(typeof e=="number")return new zT({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new zT(e);case"exponential":return new iq(e);default:throw new Error("Invalid retry strategy")}}var aq=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},lq=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function cq(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return lq.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function uq(e){try{return JSON.parse(e),!0}catch{return!1}}function qb(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function UT(e){try{return JSON.parse(e)}catch{return e}}function FT(e){return typeof e=="function"}function dq(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&FT(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&FT(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function fq(e){const t=new Headers(e?.headers),n=await aq(e);for(const[r,o]of Object.entries(n||{}))t.set(r,o);if(!t.has("content-type")){const r=hq(e?.body);r&&t.set("content-type",r)}return t}function hq(e){return qb(e)?"application/json":null}function pq(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(qb(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&qb(e.body)?new URLSearchParams(e.body).toString():e.body}function mq(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return oN.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function gq(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var vq=class rN extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,rN.prototype)}};async function _m(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new vq(n.issues);return n.value}var oN=["get","post","put","patch","delete"],yq=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,o,s,l;const c=((o=(r=e.plugins)==null?void 0:r.find(d=>{var f;return(f=d.schema)!=null&&f.config?t.startsWith(d.schema.config.baseURL||"")||t.startsWith(d.schema.config.prefix||""):!1}))==null?void 0:o.schema)||e.schema;if(c){let d=t;(s=c.config)!=null&&s.prefix&&d.startsWith(c.config.prefix)&&(d=d.replace(c.config.prefix,""),c.config.baseURL&&(t=t.replace(c.config.prefix,c.config.baseURL))),(l=c.config)!=null&&l.baseURL&&d.startsWith(c.config.baseURL)&&(d=d.replace(c.config.baseURL,""));const f=c.schema[d];if(f){let p=vi(ti({},n),{method:f.method,output:f.output});return n?.disableValidation||(p=vi(ti({},p),{body:f.input?await _m(f.input,n?.body):n?.body,params:f.params?await _m(f.params,n?.params):n?.params,query:f.query?await _m(f.query,n?.query):n?.query})),{url:t,options:p}}}return{url:t,options:n}}}),_q=e=>{async function t(n,r){const o=vi(ti(ti({},e),r),{plugins:[...e?.plugins||[],yq(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await Hb(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await Hb(n,o)}return t};function bq(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const h=e.toString().split("@")[1].split("/")[0];oN.includes(h)&&(e=e.replace(`@${h}/`,"/"))}s.endsWith("/")||(s+="/");let[l,c]=e.replace(s,"").split("?");const d=new URLSearchParams(c);for(const[h,g]of Object.entries(o||{})){if(g==null)continue;let v;if(typeof g=="string")v=g;else if(Array.isArray(g)){for(const _ of g)d.append(h,_);continue}else v=JSON.stringify(g);d.set(h,v)}if(r)if(Array.isArray(r)){const h=l.split("/").filter(g=>g.startsWith(":"));for(const[g,v]of h.entries()){const _=r[g];l=l.replace(v,_)}}else for(const[h,g]of Object.entries(r))l=l.replace(`:${h}`,String(g));l=l.split("/").map(encodeURIComponent).join("/"),l.startsWith("/")&&(l=l.slice(1));let f=d.toString();return f=f.length>0?`?${f}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${l}${f}`,s):`${s}${l}${f}`}var Hb=async(e,t)=>{var n,r,o,s,l,c,d,f;const{hooks:p,url:h,options:g}=await oq(e,t),v=dq(g),_=new AbortController,b=(n=g.signal)!=null?n:_.signal,x=bq(h,g),S=pq(g),E=await fq(g),T=mq(h,g);let R=vi(ti({},g),{url:x,headers:E,body:S,method:T,signal:b});for(const F of p.onRequest)if(F){const Z=await F(R);typeof Z=="object"&&Z!==null&&(R=Z)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:O}=gq(g,_);let A=await v(R.url,R);O();const I={response:A,request:R};for(const F of p.onResponse)if(F){const Z=await F(vi(ti({},I),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?A.clone():A}));Z instanceof Response?A=Z:typeof Z=="object"&&Z!==null&&(A=Z.response)}if(A.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Z=cq(A),ie={data:null,response:A,request:R};if(Z==="json"||Z==="text"){const H=await A.text(),W=(s=R.jsonParser)!=null?s:UT;ie.data=await W(H)}else ie.data=await A[Z]();R?.output&&R.output&&!R.disableValidation&&(ie.data=await _m(R.output,ie.data));for(const H of p.onSuccess)H&&await H(vi(ti({},ie),{response:(l=t?.hookOptions)!=null&&l.cloneResponse?A.clone():A}));return t?.throw?ie.data:{data:ie.data,error:null}}const P=(c=t?.jsonParser)!=null?c:UT,L=await A.text(),q=uq(L),j=q?await P(L):null,B={response:A,responseText:L,request:R,error:vi(ti({},j),{status:A.status,statusText:A.statusText})};for(const F of p.onError)F&&await F(vi(ti({},B),{response:(d=t?.hookOptions)!=null&&d.cloneResponse?A.clone():A}));if(t?.retry){const F=sq(t.retry),Z=(f=t.retryAttempt)!=null?f:0;if(await F.shouldAttemptRetry(Z,A)){for(const H of p.onRetry)H&&await H(I);const ie=F.getDelay(Z);return await new Promise(H=>setTimeout(H,ie)),await Hb(e,vi(ti({},t),{retryAttempt:Z+1}))}}if(t?.throw)throw new rq(A.status,A.statusText,q?j:L);return{data:null,error:vi(ti({},j),{status:A.status,statusText:A.statusText})}};const wq=(e,t)=>{const n="credentials"in Request.prototype,r=CV(e?.baseURL,e?.basePath)??"/api/auth",o=e?.plugins?.flatMap(R=>R.fetchPlugins).filter(R=>R!==void 0)||[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:l,onError:c,onRequest:d,onResponse:f,...p}=e?.fetchOptions||{},h=_q({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?LV(R,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[s,...p.plugins||[],...e?.disableDefaultFetchPlugins?[]:[AV],...o]}),{$sessionSignal:g,session:v}=YV(h,e),_=e?.plugins||[];let b={};const x={$sessionSignal:g,session:v},S={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},E=[{signal:"$sessionSignal",matcher(R){return R==="/sign-out"||R==="/update-user"||R==="/sign-up/email"||R==="/sign-in/email"||R==="/delete-user"||R==="/verify-email"||R==="/revoke-sessions"||R==="/revoke-session"||R==="/change-email"}}];for(const R of _)R.getAtoms&&Object.assign(x,R.getAtoms?.(h)),R.pathMethods&&Object.assign(S,R.pathMethods),R.atomListeners&&E.push(...R.atomListeners);const T={notify:R=>{x[R].set(!x[R].get())},listen:(R,O)=>{x[R].subscribe(O)},atoms:x};for(const R of _)R.getActions&&(b=QV(R.getActions?.(h,T,e)??{},b));return{get baseURL(){return r},pluginsActions:b,pluginsAtoms:x,pluginPathMethods:S,atomListeners:E,$fetch:h,$store:T}};function Sq(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Eq(e,t,n){const r=t[e],{fetchOptions:o,query:s,...l}=n||{};return r||(o?.method?o.method:l&&Object.keys(l).length>0?"POST":"GET")}function xq(e,t,n,r,o){function s(l=[]){return new Proxy(function(){},{get(c,d){if(typeof d!="string"||d==="then"||d==="catch"||d==="finally")return;const f=[...l,d];let p=e;for(const h of f)if(p&&typeof p=="object"&&h in p)p=p[h];else{p=void 0;break}return typeof p=="function"||Sq(p)?p:s(f)},apply:async(c,d,f)=>{const p="/"+l.map(E=>E.replace(/[A-Z]/g,T=>`-${T.toLowerCase()}`)).join("/"),h=f[0]||{},g=f[1]||{},{query:v,fetchOptions:_,...b}=h,x={...g,..._},S=Eq(p,n,h);return await t(p,{...x,body:S==="GET"?void 0:{...b,...x?.body||{}},query:v||x?.query,method:S,async onSuccess(E){if(await x?.onSuccess?.(E),!o||x.disableSignal)return;const T=o.filter(O=>O.matcher(p));if(!T.length)return;const R=new Set;for(const O of T){const A=r[O.signal];if(!A)return;if(R.has(O.signal))continue;R.add(O.signal);const I=A.get();setTimeout(()=>{A.set(!I)},10)}}})}})}return s()}function Rq(e,t={}){const n=M.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=M.useCallback(c=>{const d=f=>{n.current!==f&&(n.current=f,c())};return d(e.value),r?.length?FV(e,r,d):e.listen(d)},o),l=()=>n.current;return M.useSyncExternalStore(s,l,l)}function Oq(e){return`use${RV(e)}`}function Tq(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:o,$store:s,atomListeners:l}=wq(e),c={};for(const[d,f]of Object.entries(r))c[Oq(d)]=()=>Rq(f);return xq({...n,...c,$fetch:o,$store:s},o,t,r,l)}function Cq(e){return{authorize(t,n="AND"){let r=!1;for(const[o,s]of Object.entries(t)){const l=e[o];if(!l)return{success:!1,error:`You are not allowed to access resource: ${o}`};if(Array.isArray(s))r=s.every(c=>l.includes(c));else if(typeof s=="object"){const c=s;c.connector==="OR"?r=c.actions.some(d=>l.includes(d)):r=c.actions.every(d=>l.includes(d))}else throw new kd("Invalid access control request");if(r&&n==="OR")return{success:r};if(!r&&n==="AND")return{success:!1,error:`unauthorized to access resource "${o}"`}}return r?{success:r}:{success:!1,error:"Not authorized"}},statements:e}}function iN(e){return{newRole(t){return Cq(t)},statements:e}}const Aq={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},sN=iN(Aq),aN=sN.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),lN=sN.newRole({user:[],session:[]}),Iq={admin:aN,user:lN},Mq=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions&&!e.permission)return!1;const t=(e.role||e.options?.defaultRole||"user").split(","),n=e.options?.roles||Iq;for(const r of t)if(n[r]?.authorize(e.permission??e.permissions)?.success)return!0;return!1},Pq=e=>{const t={admin:aN,user:lN,...e?.roles};return{id:"admin-client",$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>Mq({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions??n.permission})}}),pathMethods:{"/admin/list-users":"GET","/admin/stop-impersonating":"POST"}}},Nq=()=>({id:"email-otp",$InferServerPlugin:{},atomListeners:[{matcher:e=>e==="/email-otp/verify-email"||e==="/sign-in/email-otp",signal:"$sessionSignal"}]}),kq=()=>({id:"magic-link",$InferServerPlugin:{}}),Dq={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},Kw=iN(Dq),cN=Kw.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),uN=Kw.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),dN=Kw.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),Lq={admin:cN,owner:uN,member:dN},$q=(e,t)=>{if(!e.permissions&&!e.permission)return!1;const n=e.role.split(","),r=e.options.creatorRole||"owner",o=n.includes(r),s=e.allowCreatorAllPermissions||!1;if(o&&s)return!0;for(const l of n)if(t[l]?.authorize(e.permissions??e.permission)?.success)return!0;return!1},jq=e=>$q(e,e.options.roles||Lq),zq=e=>{const t=Cc(!1),n=Cc(!1),r=Cc(!1),o=Cc(!1),s={admin:cN,member:dN,owner:uN,...e?.roles};return{id:"organization",$InferServerPlugin:{},getActions:(l,c,d)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:f=>jq({role:f.role,options:{ac:e?.ac,roles:s},permissions:f.permissions??f.permission})}}),getAtoms:l=>{const c=Sd(t,"/organization/list",l,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:o,activeOrganization:Sd([n],"/organization/get-full-organization",l,()=>({method:"GET"})),listOrganizations:c,activeMember:Sd([r],"/organization/get-active-member",l,{method:"GET"}),activeMemberRole:Sd([o],"/organization/get-active-member-role",l,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher(l){return l==="/organization/create"||l==="/organization/delete"||l==="/organization/update"},signal:"$listOrg"},{matcher(l){return l.startsWith("/organization")},signal:"$activeOrgSignal"},{matcher(l){return l.startsWith("/organization/set-active")},signal:"$sessionSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberRoleSignal"}]}},Uq=e=>({id:"sso-client",$InferServerPlugin:{}});function fN(e){const t=e?.metadata;if(!t)return!1;try{return(typeof t=="string"?JSON.parse(t):t).archived===!0}catch{return!1}}const Vg=Tq({plugins:[zq({}),Pq(),Uq(),kq(),Nq()]}),Fq=3e4;let Ed=null,op=null;function hN(){if(Ed&&Ed.expiresAt>Date.now())return Promise.resolve(Ed.result);if(op)return op;const e=Vg.organization.list().then(t=>{const n=t.data?{...t,data:t.data.filter(r=>!fN(r))}:t;return n.data&&(Ed={result:n,expiresAt:Date.now()+Fq}),n}).finally(()=>{op=null});return op=e,e}function kce(){const e=Vg.useListOrganizations(),t=e.data?.filter(n=>!fN(n));return{...e,data:t}}function Dce(){Ed=null}function pN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pN(e))&&(r&&(r+=" "),r+=t);return r}const Bq=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vq=(e,t)=>({classGroupId:e,validator:t}),mN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vm="-",BT=[],qq="arbitrary..",Hq=e=>{const t=Kq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Gq(l);const c=l.split(Vm),d=c[0]===""&&c.length>1?1:0;return gN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?Bq(f,d):d:f||BT}return n[l]||BT}}},gN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=gN(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Vm):e.slice(t).join(Vm),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},Gq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?qq+r:void 0})(),Kq=e=>{const{theme:t,classGroups:n}=e;return Zq(n,t)},Zq=(e,t)=>{const n=mN();for(const r in e){const o=e[r];Yw(o,n,r,t)}return n},Yw=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];Yq(l,t,n,r)}},Yq=(e,t,n,r)=>{if(typeof e=="string"){Wq(e,t,n);return}if(typeof e=="function"){Qq(e,t,n,r);return}Xq(e,t,n,r)},Wq=(e,t,n)=>{const r=e===""?t:vN(t,e);r.classGroupId=n},Qq=(e,t,n,r)=>{if(Jq(e)){Yw(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vq(n,e))},Xq=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[c,d]=o[l];Yw(d,vN(t,c),n,r)}},vN=(e,t)=>{let n=e;const r=t.split(Vm),o=r.length;for(let s=0;s<o;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=mN(),n.nextPart.set(l,c)),n=c}return n},Jq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},Gb="!",VT=":",tH=[],qT=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),nH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let l=0,c=0,d=0,f;const p=o.length;for(let b=0;b<p;b++){const x=o[b];if(l===0&&c===0){if(x===VT){s.push(o.slice(d,b)),d=b+1;continue}if(x==="/"){f=b;continue}}x==="["?l++:x==="]"?l--:x==="("?c++:x===")"&&c--}const h=s.length===0?o:o.slice(d);let g=h,v=!1;h.endsWith(Gb)?(g=h.slice(0,-1),v=!0):h.startsWith(Gb)&&(g=h.slice(1),v=!0);const _=f&&f>d?f-d:void 0;return qT(s,v,g,_)};if(t){const o=t+VT,s=r;r=l=>l.startsWith(o)?s(l.slice(o.length)):qT(tH,!1,l,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},rH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",d=t.has(l);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(l)):o.push(l)}return o.length>0&&(o.sort(),r.push(...o)),r}},oH=e=>({cache:eH(e.cacheSize),parseClassName:nH(e),sortModifiers:rH(e),postfixLookupClassGroupIds:iH(e),...Hq(e)}),iH=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},sH=/\s+/,aH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(sH);let f="";for(let p=d.length-1;p>=0;p-=1){const h=d[p],{isExternal:g,modifiers:v,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:x}=n(h);if(g){f=h+(f.length>0?" "+f:f);continue}let S=!!x,E;if(S){const I=b.substring(0,x);E=r(I);const P=E&&l[E]?r(b):void 0;P&&P!==E&&(E=P,S=!1)}else E=r(b);if(!E){if(!S){f=h+(f.length>0?" "+f:f);continue}if(E=r(b),!E){f=h+(f.length>0?" "+f:f);continue}S=!1}const T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=_?T+Gb:T,O=R+E;if(c.indexOf(O)>-1)continue;c.push(O);const A=o(E,S);for(let I=0;I<A.length;++I){const P=A[I];c.push(R+P)}f=h+(f.length>0?" "+f:f)}return f},lH=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=yN(n))&&(o&&(o+=" "),o+=r);return o},yN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=yN(e[r]))&&(n&&(n+=" "),n+=t);return n},cH=(e,...t)=>{let n,r,o,s;const l=d=>{const f=t.reduce((p,h)=>h(p),e());return n=oH(f),r=n.cache.get,o=n.cache.set,s=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=aH(d,n);return o(d,p),p};return s=l,(...d)=>s(lH(...d))},uH=[],Gn=e=>{const t=n=>n[e]||uH;return t.isThemeGetter=!0,t},_N=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>dH.test(e),ht=e=>!!e&&!Number.isNaN(Number(e)),hi=e=>!!e&&Number.isInteger(Number(e)),o_=e=>e.endsWith("%")&&ht(e.slice(0,-1)),Xi=e=>fH.test(e),wN=()=>!0,vH=e=>hH.test(e)&&!pH.test(e),Ww=()=>!1,yH=e=>mH.test(e),_H=e=>gH.test(e),bH=e=>!Ve(e)&&!qe(e),wH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),SH=e=>_a(e,xN,Ww),Ve=e=>_N.test(e),Ua=e=>_a(e,RN,vH),HT=e=>_a(e,IH,ht),EH=e=>_a(e,TN,wN),xH=e=>_a(e,ON,Ww),GT=e=>_a(e,SN,Ww),RH=e=>_a(e,EN,_H),ip=e=>_a(e,CN,yH),qe=e=>bN.test(e),od=e=>pl(e,RN),OH=e=>pl(e,ON),KT=e=>pl(e,SN),TH=e=>pl(e,xN),CH=e=>pl(e,EN),sp=e=>pl(e,CN,!0),AH=e=>pl(e,TN,!0),_a=(e,t,n)=>{const r=_N.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pl=(e,t,n=!1)=>{const r=bN.exec(e);return r?r[1]?t(r[1]):n:!1},SN=e=>e==="position"||e==="percentage",EN=e=>e==="image"||e==="url",xN=e=>e==="length"||e==="size"||e==="bg-size",RN=e=>e==="length",IH=e=>e==="number",ON=e=>e==="family-name",TN=e=>e==="number"||e==="weight",CN=e=>e==="shadow",MH=()=>{const e=Gn("color"),t=Gn("font"),n=Gn("text"),r=Gn("font-weight"),o=Gn("tracking"),s=Gn("leading"),l=Gn("breakpoint"),c=Gn("container"),d=Gn("spacing"),f=Gn("radius"),p=Gn("shadow"),h=Gn("inset-shadow"),g=Gn("text-shadow"),v=Gn("drop-shadow"),_=Gn("blur"),b=Gn("perspective"),x=Gn("aspect"),S=Gn("ease"),E=Gn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...R(),qe,Ve],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[qe,Ve,d],L=()=>[qs,"full","auto",...P()],q=()=>[hi,"none","subgrid",qe,Ve],j=()=>["auto",{span:["full",hi,qe,Ve]},hi,qe,Ve],B=()=>[hi,"auto",qe,Ve],F=()=>["auto","min","max","fr",qe,Ve],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...P()],W=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],te=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],le=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],Q=()=>[e,qe,Ve],k=()=>[...R(),KT,GT,{position:[qe,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",TH,SH,{size:[qe,Ve]}],D=()=>[o_,od,Ua],U=()=>["","none","full",f,qe,Ve],X=()=>["",ht,od,Ua],fe=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[ht,o_,KT,GT],je=()=>["","none",_,qe,Ve],Y=()=>["none",ht,qe,Ve],re=()=>["none",ht,qe,Ve],ve=()=>[ht,qe,Ve],se=()=>[qs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xi],breakpoint:[Xi],color:[wN],container:[Xi],"drop-shadow":[Xi],ease:["in","out","in-out"],font:[bH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xi],shadow:[Xi],spacing:["px",ht],text:[Xi],"text-shadow":[Xi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Ve,qe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",qe,Ve]}],"container-named":[wH],columns:[{columns:[ht,Ve,qe,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[hi,"auto",qe,Ve]}],basis:[{basis:[qs,"full","auto",c,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ht,qs,"auto","initial","none",Ve]}],grow:[{grow:["",ht,qe,Ve]}],shrink:[{shrink:["",ht,qe,Ve]}],order:[{order:[hi,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,od,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,AH,EH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o_,Ve]}],"font-family":[{font:[OH,xH,t]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,qe,Ve]}],"line-clamp":[{"line-clamp":[ht,"none",qe,HT]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ht,"from-font","auto",qe,Ua]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[ht,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[hi,qe,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hi,qe,Ve],radial:["",qe,Ve],conic:[hi,qe,Ve]},CH,RH]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ht,qe,Ve]}],"outline-w":[{outline:["",ht,od,Ua]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",p,sp,ip]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",h,sp,ip]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[ht,Ua]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",g,sp,ip]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[ht,qe,Ve]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ht]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[ht]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:je()}],brightness:[{brightness:[ht,qe,Ve]}],contrast:[{contrast:[ht,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,sp,ip]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",ht,qe,Ve]}],"hue-rotate":[{"hue-rotate":[ht,qe,Ve]}],invert:[{invert:["",ht,qe,Ve]}],saturate:[{saturate:[ht,qe,Ve]}],sepia:[{sepia:["",ht,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[ht,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[ht,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ht,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ht,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",ht,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[ht,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[ht,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",ht,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ht,"initial",qe,Ve]}],ease:[{ease:["linear","initial",S,qe,Ve]}],delay:[{delay:[ht,qe,Ve]}],animate:[{animate:["none",E,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,qe,Ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],zoom:[{zoom:[hi,qe,Ve]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,Ve]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[ht,od,Ua,HT]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},AN=cH(MH);function Ce(...e){return AN(Zw(e))}function PH(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function kn({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const s=e.error.code;if(t?.[s])return t[s]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function ml(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function Kb(e,t){for(const n in e)if(e[n]===t)return n}function Wd(e,t){let n=$().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var NH={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},kH={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},DH={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},LH={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},$H={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},jH={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},zH={...$H,...jH},UH={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},FH={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},BH={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},VH={INVALID_SESSION_TOKEN:"Invalid session token"},qH={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},HH={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},GH={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},KH={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},ZH={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},YH={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},WH={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},QH={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...LH,...NH,...kH,...DH,...zH,...UH,...FH,...BH,...VH,...qH,...HH,...GH,...KH,...ZH,...YH,...WH},XH={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},ZT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},YT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function JH(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const eG=e=>{switch(e){case"success":return rG;case"info":return iG;case"warning":return oG;case"error":return sG;default:return null}},tG=Array(12).fill(0),nG=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},tG.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),oG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),iG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),aG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),lG=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Zb=1;class cG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Zb++,l=this.toasts.find(d=>d.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:r}),{...d,...t,id:s,dismissible:c,title:r}):d):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,l;const c=o.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(dG(f)&&!f.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(f instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,..._})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,v=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>l[0]==="reject"?p(l[1]):f(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Zb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wr=new cG,uG=(e,t)=>{const n=t?.id||Zb++;return Wr.addToast({title:e,...t,id:n}),n},dG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fG=uG,hG=()=>Wr.toasts,pG=()=>Wr.getActiveToasts(),WT=Object.assign(fG,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:hG,getToasts:pG});JH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ap(e){return e.label!==void 0}const mG=3,gG="24px",vG="16px",QT=4e3,yG=356,_G=14,bG=45,wG=200;function pi(...e){return e.filter(Boolean).join(" ")}function SG(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const EG=e=>{var t,n,r,o,s,l,c,d,f;const{invert:p,toast:h,unstyled:g,interacting:v,setHeights:_,visibleToasts:b,heights:x,index:S,toasts:E,expanded:T,removeToast:R,defaultRichColors:O,closeButton:A,style:I,cancelButtonStyle:P,actionButtonStyle:L,className:q="",descriptionClassName:j="",duration:B,position:F,gap:Z,expandByDefault:ie,classNames:H,icons:W,closeButtonAriaLabel:te="Close toast"}=e,[le,Q]=ee.useState(null),[k,G]=ee.useState(null),[V,D]=ee.useState(!1),[U,X]=ee.useState(!1),[fe,pe]=ee.useState(!1),[xe,je]=ee.useState(!1),[Y,re]=ee.useState(!1),[ve,se]=ee.useState(0),[Se,Te]=ee.useState(0),tt=ee.useRef(h.duration||B||QT),rt=ee.useRef(null),Be=ee.useRef(null),Qe=S===0,Pe=S+1<=b,Me=h.type,Ue=h.dismissible!==!1,K=h.className||"",ne=h.descriptionClassName||"",ae=ee.useMemo(()=>x.findIndex(Ke=>Ke.toastId===h.id)||0,[x,h.id]),Oe=ee.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:A},[h.closeButton,A]),Ae=ee.useMemo(()=>h.duration||B||QT,[h.duration,B]),Ie=ee.useRef(0),ke=ee.useRef(0),Je=ee.useRef(0),et=ee.useRef(null),[vt,Tt]=F.split("-"),yt=ee.useMemo(()=>x.reduce((Ke,ut,Jt)=>Jt>=ae?Ke:Ke+ut.height,0),[x,ae]),Ln=lG(),Ni=h.invert||p,Ho=Me==="loading";ke.current=ee.useMemo(()=>ae*Z+yt,[ae,yt]),ee.useEffect(()=>{tt.current=Ae},[Ae]),ee.useEffect(()=>{D(!0)},[]),ee.useEffect(()=>{const Ke=Be.current;if(Ke){const ut=Ke.getBoundingClientRect().height;return Te(ut),_(Jt=>[{toastId:h.id,height:ut,position:h.position},...Jt]),()=>_(Jt=>Jt.filter(Zt=>Zt.toastId!==h.id))}},[_,h.id]),ee.useLayoutEffect(()=>{if(!V)return;const Ke=Be.current,ut=Ke.style.height;Ke.style.height="auto";const Jt=Ke.getBoundingClientRect().height;Ke.style.height=ut,Te(Jt),_(Zt=>Zt.find(Lt=>Lt.toastId===h.id)?Zt.map(Lt=>Lt.toastId===h.id?{...Lt,height:Jt}:Lt):[{toastId:h.id,height:Jt,position:h.position},...Zt])},[V,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const Ye=ee.useCallback(()=>{X(!0),se(ke.current),_(Ke=>Ke.filter(ut=>ut.toastId!==h.id)),setTimeout(()=>{R(h)},wG)},[h,R,_,ke]);ee.useEffect(()=>{if(h.promise&&Me==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return T||v||Ln?(()=>{if(Je.current<Ie.current){const Zt=new Date().getTime()-Ie.current;tt.current=tt.current-Zt}Je.current=new Date().getTime()})():tt.current!==1/0&&(Ie.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Ye()},tt.current)),()=>clearTimeout(Ke)},[T,v,h,Me,Ln,Ye]),ee.useEffect(()=>{h.delete&&(Ye(),h.onDismiss==null||h.onDismiss.call(h,h))},[Ye,h.delete]);function dt(){var Ke;if(W?.loading){var ut;return ee.createElement("div",{className:pi(H?.loader,h==null||(ut=h.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Me==="loading"},W.loading)}return ee.createElement(nG,{className:pi(H?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Me==="loading"})}const Ct=h.icon||W?.[Me]||eG(Me);var it,Dt;return ee.createElement("li",{tabIndex:0,ref:Be,className:pi(q,K,H?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,H?.default,H?.[Me],h==null||(n=h.classNames)==null?void 0:n[Me]),"data-sonner-toast":"","data-rich-colors":(it=h.richColors)!=null?it:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Y,"data-removed":U,"data-visible":Pe,"data-y-position":vt,"data-x-position":Tt,"data-index":S,"data-front":Qe,"data-swiping":fe,"data-dismissible":Ue,"data-type":Me,"data-invert":Ni,"data-swipe-out":xe,"data-swipe-direction":k,"data-expanded":!!(T||ie&&V),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${U?ve:ke.current}px`,"--initial-height":ie?"auto":`${Se}px`,...I,...h.style},onDragEnd:()=>{pe(!1),Q(null),et.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Ho||!Ue||(rt.current=new Date,se(ke.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(pe(!0),et.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,ut,Jt;if(xe||!Ue)return;et.current=null;const Zt=Number(((Ke=Be.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sr=Number(((ut=Be.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Jt=rt.current)==null?void 0:Jt.getTime()),ln=le==="x"?Zt:Sr,So=Math.abs(ln)/Lt;if(Math.abs(ln)>=bG||So>.11){se(ke.current),h.onDismiss==null||h.onDismiss.call(h,h),G(le==="x"?Zt>0?"right":"left":Sr>0?"down":"up"),Ye(),je(!0);return}else{var sr,zr;(sr=Be.current)==null||sr.style.setProperty("--swipe-amount-x","0px"),(zr=Be.current)==null||zr.style.setProperty("--swipe-amount-y","0px")}re(!1),pe(!1),Q(null)},onPointerMove:Ke=>{var ut,Jt,Zt;if(!et.current||!Ue||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Lt=Ke.clientY-et.current.y,ln=Ke.clientX-et.current.x;var So;const sr=(So=e.swipeDirections)!=null?So:SG(F);!le&&(Math.abs(ln)>1||Math.abs(Lt)>1)&&Q(Math.abs(ln)>Math.abs(Lt)?"x":"y");let zr={x:0,y:0};const _l=Go=>1/(1.5+Math.abs(Go)/20);if(le==="y"){if(sr.includes("top")||sr.includes("bottom"))if(sr.includes("top")&&Lt<0||sr.includes("bottom")&&Lt>0)zr.y=Lt;else{const Go=Lt*_l(Lt);zr.y=Math.abs(Go)<Math.abs(Lt)?Go:Lt}}else if(le==="x"&&(sr.includes("left")||sr.includes("right")))if(sr.includes("left")&&ln<0||sr.includes("right")&&ln>0)zr.x=ln;else{const Go=ln*_l(ln);zr.x=Math.abs(Go)<Math.abs(ln)?Go:ln}(Math.abs(zr.x)>0||Math.abs(zr.y)>0)&&re(!0),(Jt=Be.current)==null||Jt.style.setProperty("--swipe-amount-x",`${zr.x}px`),(Zt=Be.current)==null||Zt.style.setProperty("--swipe-amount-y",`${zr.y}px`)}},Oe&&!h.jsx&&Me!=="loading"?ee.createElement("button",{"aria-label":te,"data-disabled":Ho,"data-close-button":!0,onClick:Ho||!Ue?()=>{}:()=>{Ye(),h.onDismiss==null||h.onDismiss.call(h,h)},className:pi(H?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Dt=W?.close)!=null?Dt:aG):null,(Me||h.icon||h.promise)&&h.icon!==null&&(W?.[Me]!==null||h.icon)?ee.createElement("div",{"data-icon":"",className:pi(H?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||dt():null,h.type!=="loading"?Ct:null):null,ee.createElement("div",{"data-content":"",className:pi(H?.content,h==null||(s=h.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:pi(H?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ee.createElement("div",{"data-description":"",className:pi(j,ne,H?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ee.isValidElement(h.cancel)?h.cancel:h.cancel&&ap(h.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:Ke=>{ap(h.cancel)&&Ue&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),Ye())},className:pi(H?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ee.isValidElement(h.action)?h.action:h.action&&ap(h.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ke=>{ap(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&Ye())},className:pi(H?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function XT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xG(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,l=s?"--mobile-offset":"--offset",c=s?vG:gG;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const RG=ee.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:v,duration:_,style:b,visibleToasts:x=mG,toastOptions:S,dir:E=XT(),gap:T=_G,icons:R,containerAriaLabel:O="Notifications"}=t,[A,I]=ee.useState([]),P=ee.useMemo(()=>r?A.filter(V=>V.toasterId===r):A.filter(V=>!V.toasterId),[A,r]),L=ee.useMemo(()=>Array.from(new Set([s].concat(P.filter(V=>V.position).map(V=>V.position)))),[P,s]),[q,j]=ee.useState([]),[B,F]=ee.useState(!1),[Z,ie]=ee.useState(!1),[H,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ee.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=ee.useRef(null),k=ee.useRef(!1),G=ee.useCallback(V=>{I(D=>{var U;return(U=D.find(X=>X.id===V.id))!=null&&U.delete||Wr.dismiss(V.id),D.filter(({id:X})=>X!==V.id)})},[]);return ee.useEffect(()=>Wr.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{I(D=>D.map(U=>U.id===V.id?{...U,delete:!0}:U))});return}setTimeout(()=>{GP.flushSync(()=>{I(D=>{const U=D.findIndex(X=>X.id===V.id);return U!==-1?[...D.slice(0,U),{...D[U],...V},...D.slice(U+1)]:[V,...D]})})})}),[A]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{W(D?"dark":"light")})}catch{V.addListener(({matches:U})=>{try{W(U?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{A.length<=1&&F(!1)},[A]),ee.useEffect(()=>{const V=D=>{var U;if(l.every(pe=>D[pe]||D.code===pe)){var fe;F(!0),(fe=te.current)==null||fe.focus()}D.code==="Escape"&&(document.activeElement===te.current||(U=te.current)!=null&&U.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[l]),ee.useEffect(()=>{if(te.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,k.current=!1)}},[te.current]),ee.createElement("section",{ref:n,"aria-label":`${O} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((V,D)=>{var U;const[X,fe]=V.split("-");return P.length?ee.createElement("ol",{key:V,dir:E==="auto"?XT():E,tabIndex:-1,ref:te,className:f,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":X,"data-x-position":fe,style:{"--front-toast-height":`${((U=q[0])==null?void 0:U.height)||0}px`,"--width":`${yG}px`,"--gap":`${T}px`,...b,...xG(p,h)},onBlur:pe=>{k.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(k.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||k.current||(k.current=!0,Q.current=pe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Z||F(!1)},onDragEnd:()=>F(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},P.filter(pe=>!pe.position&&D===0||pe.position===V).map((pe,xe)=>{var je,Y;return ee.createElement(EG,{key:pe.id,icons:R,index:xe,toast:pe,defaultRichColors:v,duration:(je=S?.duration)!=null?je:_,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(Y=S?.closeButton)!=null?Y:d,interacting:Z,position:V,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:G,toasts:P.filter(re=>re.position==pe.position),heights:q.filter(re=>re.position==pe.position),setHeights:j,expandByDefault:c,gap:T,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),IN=M.createContext({});function MN(){return M.useContext(IN)}var i_,JT;function OG(){if(JT)return i_;JT=1;var e=function(){};return i_=e,i_}var TG=OG();const CG=dl(TG);function AG({async:e,appendTo:t,defer:n,id:r,nonce:o,src:s}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),o&&l.setAttribute("nonce",o),l.src=s,(t==="head"?document.head:document.body).appendChild(l)}var IG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Dd=null,Qd=!1;const qm=new Set,Hm=new Set,MG=typeof window<"u",Dc="___grecaptcha_cfg",PN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function PG(){if(!MG)return;function e(n){if(Qd)n();else{window[Dc]||(window[Dc]={});const r=window[Dc];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){Qd=!0;for(const n of Hm)n();Hm.clear()}window[PN]=t}function NG({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const s=o?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",c=new URLSearchParams({render:n});return t&&c.set("onload",t),e&&c.set("hl",e),`https://www.${s}/recaptcha/${l}?${c.toString()}`}function kG({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const s={id:"google-recaptcha-v3"},l=NG({language:e,onLoadCallbackName:PN,render:t,useEnterprise:r,useRecaptchaNet:o});if(Dd){if(Dd!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Dd=l,AG(Object.assign(Object.assign(Object.assign({},s),n),{src:l}))}function DG(e){if(!window[Dc])return;const t=window[Dc];t.clients&&delete t.clients[e]}function LG(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=IG(t,["onLoadCallback","onLoadCallbackName"]);if(qm.size===0&&PG(),kG(o),qm.add(e),n&&(Qd?n():Hm.add(n)),r){let s=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};Qd?s():Hm.add(s)}}function $G(e){var t,n,r;qm.delete(e),qm.size===0&&(window.grecaptcha=void 0,window[Dc]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Dd}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Dd=null,Qd=!1)}let eC=!1;function jG({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:s,useRecaptchaNet:l}){var c,d,f,p,h,g,v;const _=M.useId(),[b,x]=M.useState(null),[S,E]=M.useState(null),T=M.useRef(!1);M.useEffect(()=>{function I(){var P;const L=s?(P=window.grecaptcha)===null||P===void 0?void 0:P.enterprise:window.grecaptcha;if(!L)throw new Error("reCAPTCHA not found");if(!L.ready)throw new Error("reCAPTCHA ready callback not found");L.ready(()=>{x(L)})}return LG(_,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:s,useRecaptchaNet:l}),()=>{$G(_),x(null)}},[e?.element,_,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,s,l]),M.useEffect(()=>{var I,P,L;if(!e?.element||!b?.render)return;const q={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},j=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!j)throw new Error("reCAPTCHA container element not found");const B=b.render(j,q);return!((P=e?.parameters)===null||P===void 0)&&P.hidden&&(eC||(CG(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),eC=!0),(L=j.querySelector(".grecaptcha-badge"))===null||L===void 0||L.style.setProperty("display","none")),E(B),T.current=!0,()=>{E(null),T.current=!1,DG(B),j.innerHTML=""}},[e?.element,(c=e?.parameters)===null||c===void 0?void 0:c.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(p=e?.parameters)===null||p===void 0?void 0:p.errorCallback,(h=e?.parameters)===null||h===void 0?void 0:h.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(v=e?.parameters)===null||v===void 0?void 0:v.theme,b,r]);const R=!!e?.element,O=R?S:r,A=M.useMemo(()=>O!==null&&b?.execute?I=>{if(O===null||!b?.execute)throw new Error("reCAPTCHA has not been loaded");return R&&!T.current?(console.warn("Client ID not mounted"),null):b.execute(O,{action:I})}:void 0,[O,b,R]);return C.jsx(IN.Provider,{value:{container:e?.element,executeRecaptcha:A,reCaptchaInstance:b},children:t})}var zG=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},No=new zG;function UG(){return()=>{}}function ms(){return M.useSyncExternalStore(UG,()=>!0,()=>!1)}function NN(){const[e,t]=M.useState();return M.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const s of o)s.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Qw(){const[e,t]=M.useState("light");return M.useEffect(()=>{const n=()=>{var o;const s=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(s?"dark":"light")};n();const r=new MutationObserver(o=>{for(const s of o)(s.attributeName==="style"||s.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function FG({children:e}){const t=ms(),{captcha:n}=M.useContext(pt);return n?.provider!=="google-recaptcha-v3"?e:C.jsxs(jG,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&C.jsx("style",{children:`
|
|
49
49
|
.grecaptcha-badge {
|
|
50
50
|
visibility: hidden;
|
|
51
51
|
border-radius: var(--radius) !important;
|
|
@@ -58,7 +58,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
58
58
|
.dark .grecaptcha-badge {
|
|
59
59
|
border-color: var(--input) !important;
|
|
60
60
|
}
|
|
61
|
-
`}),C.jsx(BG,{}),e]})}function BG(){const{executeRecaptcha:e}=MN(),{theme:t}=Qw(),{lang:n}=NN();return M.useEffect(()=>{if(!e)return;(async()=>{const o=document.querySelector("iframe[title='reCAPTCHA']");if(o){const s=new URL(o.src);s.searchParams.set("theme",t),n&&s.searchParams.set("hl",n),o.src=s.toString()}})()},[e,t,n]),null}function VG({slug:e}={}){const{organization:t,hooks:{useActiveOrganization:n,useListOrganizations:r}}=M.useContext(pt),{pathMode:o,slug:s}=t||{};let l,c,d,f;const{data:p,isPending:h,isRefetching:g}=r();if(o==="slug"){const v=e||s;l=p?.find(_=>_.slug===v),c=h,d=g}else{const{data:v,isPending:_,isRefetching:b,refetch:x}=n();f=x,l=v,c=_,d=b}return M.useMemo(()=>({data:l,isPending:c,isRefetching:d,refetch:f}),[l,c,d,f])}var qG=()=>{const{hooks:{useListOrganizations:e,useSession:t},organization:n,navigate:r,redirectTo:o}=M.useContext(pt),{slug:s,pathMode:l,personalPath:c}=n||{},{data:d}=t(),{data:f,isPending:p,isRefetching:h,refetch:g}=VG(),{refetch:v}=e(),{data:_}=e();return M.useEffect(()=>{d?.user.id&&(f||_)&&(g?.(),v?.())},[d?.user.id]),M.useEffect(()=>{h||p||s&&l==="slug"&&!f&&r(c||o)},[f,h,p,s,l,c,r,o]),null},HG=({href:e,className:t,children:n})=>C.jsx("a",{className:t,href:e,children:n}),GG=e=>{window.location.href=e},KG=e=>{window.location.replace(e)},ZG=({variant:e="default",message:t})=>{e==="default"?WT(t):WT[e](t)},pt=M.createContext({}),YG=({children:e,authClient:t,account:n,avatar:r,deleteUser:o,social:s,genericOAuth:l,basePath:c="/auth",baseURL:d="",captcha:f,redirectTo:p="/",credentials:h,changeEmail:g=!0,freshAge:v=3600*24,hooks:_,mutators:b,localization:x,localizeErrors:S=!0,nameRequired:E=!0,organization:T,teams:R,signUp:O=!0,toast:A=ZG,viewPaths:I,navigate:P,replace:L,Link:q=HG,emailVerification:j,...B})=>{const F=t,Z=M.useMemo(()=>{if(r)return r===!0?{extension:"png",size:128}:{upload:r.upload,delete:r.delete,extension:r.extension||"png",size:r.size||(r.upload?256:128),Image:r.Image}},[r]),ie=M.useMemo(()=>{if(j)return j===!0?{otp:!1}:{otp:j.otp??!1}},[j]),H=M.useMemo(()=>{var Y;return n===!1?void 0:n===!0||n===void 0?{basePath:"/account",fields:["image","name"],viewPaths:ZT}:{basePath:((Y=n.basePath)!=null&&Y.endsWith("/")?n.basePath.slice(0,-1):n.basePath)??"/account",fields:n.fields||["image","name"],viewPaths:{...ZT,...n.viewPaths}}},[n]),W=M.useMemo(()=>{if(o)return o===!0?{}:o},[o]),te=M.useMemo(()=>{if(s)return s},[s]),le=M.useMemo(()=>{if(l)return l},[l]),Q=M.useMemo(()=>{if(h!==!1)return h===!0?{forgotPassword:!0,usernameRequired:!0}:{...h,forgotPassword:h?.forgotPassword??!0,usernameRequired:h?.usernameRequired??!0}},[h]),k=M.useMemo(()=>{if(O!==!1)return O===!0||O===void 0?{fields:["name"]}:{fields:O.fields||["name"]}},[O]),G=M.useMemo(()=>{var Y;if(!T)return;if(T===!0)return{basePath:"/organization",viewPaths:YT,customRoles:[]};let re;T.logo===!0?re={extension:"png",size:128}:T.logo&&(re={upload:T.logo.upload,delete:T.logo.delete,extension:T.logo.extension||"png",size:T.logo.size||(T.logo.upload?256:128)});const ve=(Y=T.basePath)!=null&&Y.endsWith("/")?T.basePath.slice(0,-1):T.basePath;return{...T,logo:re,basePath:ve??"/organization",customRoles:T.customRoles||[],viewPaths:{...YT,...T.viewPaths}}},[T]),V=M.useMemo(()=>{var Y,re;if(!(!R||!G))return R===!0?{enabled:!0,customRoles:[],colors:{count:5,prefix:"team"}}:{enabled:R.enabled??!0,customRoles:R.customRoles||[],colors:{count:((Y=R.colors)==null?void 0:Y.count)??5,prefix:((re=R.colors)==null?void 0:re.prefix)??"team"}}},[R,G]),D=M.useMemo(()=>({deleteApiKey:Y=>F.apiKey.delete({...Y,fetchOptions:{throw:!0}}),deletePasskey:Y=>F.passkey.deletePasskey({...Y,fetchOptions:{throw:!0}}),revokeDeviceSession:Y=>F.multiSession.revoke({...Y,fetchOptions:{throw:!0}}),revokeSession:Y=>F.revokeSession({...Y,fetchOptions:{throw:!0}}),setActiveSession:Y=>F.multiSession.setActive({...Y,fetchOptions:{throw:!0}}),updateOrganization:Y=>F.organization.update({...Y,fetchOptions:{throw:!0}}),updateTeam:Y=>F.$fetch("/organization/update-team",{method:"POST",body:Y,throw:!0}),updateUser:Y=>F.updateUser({...Y,fetchOptions:{throw:!0}}),unlinkAccount:Y=>F.unlinkAccount({...Y,fetchOptions:{throw:!0}})}),[F]),U=M.useMemo(()=>({useSession:F.useSession,useListAccounts:()=>ao({queryFn:F.listAccounts,cacheKey:"listAccounts"}),useAccountInfo:Y=>ao({queryFn:()=>F.accountInfo(Y),cacheKey:`accountInfo:${JSON.stringify(Y)}`}),useListDeviceSessions:()=>ao({queryFn:F.multiSession.listDeviceSessions,cacheKey:"listDeviceSessions"}),useListSessions:()=>ao({queryFn:F.listSessions,cacheKey:"listSessions"}),useListPasskeys:F.useListPasskeys,useListApiKeys:()=>ao({queryFn:F.apiKey.list,cacheKey:"listApiKeys"}),useActiveOrganization:F.useActiveOrganization,useListOrganizations:F.useListOrganizations,useHasPermission:Y=>ao({queryFn:()=>F.$fetch("/organization/has-permission",{method:"POST",body:Y}),cacheKey:`hasPermission:${JSON.stringify(Y)}`}),useInvitation:Y=>ao({queryFn:()=>F.organization.getInvitation(Y),cacheKey:`invitation:${JSON.stringify(Y)}`}),useListInvitations:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-invitations?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listInvitations:${JSON.stringify(Y)}`}),useListUserInvitations:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-invitations"),cacheKey:"listUserInvitations"}),useListMembers:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-members?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listMembers:${JSON.stringify(Y)}`}),useListTeams:Y=>ao({queryFn:()=>F.$fetch(`/organization/list-teams?organizationId=${Y?.organizationId||""}`),cacheKey:`listTeams:${JSON.stringify(Y)}`}),useListTeamMembers:Y=>ao({queryFn:()=>F.$fetch("/organization/list-team-members",{method:"POST",body:Y?.teamId?{query:{teamId:Y.teamId}}:void 0}),cacheKey:`listTeamMembers:${JSON.stringify(Y)}`}),useListUserTeams:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-teams"),cacheKey:"listUserTeams"})}),[F]),X=M.useMemo(()=>({...XH,...I}),[I]),fe=M.useMemo(()=>({...QH,...x}),[x]),pe=M.useMemo(()=>({...U,..._}),[U,_]),xe=M.useMemo(()=>({...D,...b}),[D,b]);d=d.endsWith("/")?d.slice(0,-1):d,c=c.endsWith("/")?c.slice(0,-1):c;const{data:je}=pe.useSession();return C.jsxs(pt.Provider,{value:{authClient:F,avatar:Z,basePath:c==="/"?"":c,baseURL:d,captcha:f,redirectTo:p,changeEmail:g,credentials:Q,deleteUser:W,emailVerification:ie,freshAge:v,genericOAuth:le,hooks:pe,mutators:xe,localization:fe,localizeErrors:S,nameRequired:E,organization:G,teams:V,account:H,signUp:k,social:te,toast:A,navigate:P||GG,replace:L||P||KG,viewPaths:X,Link:q,...B},children:[je&&G&&C.jsx(qG,{}),f?.provider==="google-recaptcha-v3"?C.jsx(FG,{children:e}):e]})};function ao({queryFn:e,cacheKey:t,staleTime:n=1e4}){var r;const{hooks:{useSession:o},toast:s,localization:l,localizeErrors:c}=M.useContext(pt),{data:d,isPending:f}=o(),p=M.useRef(e);p.current=e;const h=t||e.toString(),g=M.useSyncExternalStore(M.useCallback(T=>No.subscribe(h,T),[h]),M.useCallback(()=>No.get(h),[h]),M.useCallback(()=>No.get(h),[h])),v=M.useRef(!1),_=M.useRef(void 0),[b,x]=M.useState(null),S=M.useCallback(async()=>{const T=No.getInFlightRequest(h);if(T){try{const O=await T;O.error?x(O.error):x(null)}catch(O){x(O)}return}g?.data!==void 0&&No.setRefetching(h,!0);const R=p.current();No.setInFlightRequest(h,R);try{const{data:O,error:A}=await R;A?(x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})):x(null),No.set(h,O)}catch(O){const A=O;x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})}finally{No.setRefetching(h,!1),No.removeInFlightRequest(h)}},[h,s,l,c,g]);M.useEffect(()=>{var T;const R=(T=d?.user)==null?void 0:T.id;if(!d){No.setRefetching(h,!1),No.clear(h),v.current=!1,_.current=void 0;return}const O=_.current!==void 0&&_.current!==R;O&&No.clear(h);const A=g?.data!==void 0,I=!g||Date.now()-g.timestamp>n;(!v.current||!A||O||A&&I)&&(!A||I)&&(v.current=!0,S()),_.current=R},[d,(r=d?.user)==null?void 0:r.id,h,S,g,n]);const E=f||g?.data===void 0&&!b;return{data:g?.data??null,isPending:E,isRefetching:g?.isRefetching??!1,error:b,refetch:S}}const WG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var QG={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const XG=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},d)=>M.createElement("svg",{ref:d,...QG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kN("lucide",o),...c},[...l.map(([f,p])=>M.createElement(f,p)),...Array.isArray(s)?s:[s]]));const Ir=(e,t)=>{const n=M.forwardRef(({className:r,...o},s)=>M.createElement(XG,{ref:s,iconNode:t,className:kN(`lucide-${WG(e)}`,r),...o}));return n.displayName=`${e}`,n};const JG=Ir("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const eK=Ir("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);const DN=Ir("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const tK=Ir("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const nK=Ir("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const rK=Ir("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const oK=Ir("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);const Ar=Ir("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const LN=Ir("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const $N=Ir("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const iK=Ir("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const sK=Ir("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);const tC=Ir("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const aK=Ir("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const lK=Ir("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const cK=Ir("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var pf=e=>e.type==="checkbox",nl=e=>e instanceof Date,jr=e=>e==null;const jN=e=>typeof e=="object";var Nn=e=>!jr(e)&&!Array.isArray(e)&&jN(e)&&!nl(e),zN=e=>Nn(e)&&e.target?pf(e.target)?e.target.checked:e.target.value:e,UN=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),uK=e=>{const t=e.constructor&&e.constructor.prototype;return Nn(t)&&t.hasOwnProperty("isPrototypeOf")},Xw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function on(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Xw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Nn(e)&&uK(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=on(e[o]));return r}var qg=e=>/^\w*$/.test(e),tn=e=>e===void 0,Hg=e=>Array.isArray(e)?e.filter(Boolean):[],Jw=e=>Hg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Nn(e))return n;const o=(qg(t)?[t]:Jw(t)).reduce((s,l)=>jr(s)?void 0:s[l],e);return tn(o)||o===e?tn(e[t])?n:e[t]:o},fo=e=>typeof e=="boolean",Or=e=>typeof e=="function",zt=(e,t,n)=>{let r=-1;const o=qg(t)?[t]:Jw(t),s=o.length,l=s-1;for(;++r<s;){const c=o[r];let d=n;if(r!==l){const f=e[c];d=Nn(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const ea={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},jo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},s_="form",FN="root",eS=ee.createContext(null);eS.displayName="HookFormControlContext";const Gg=()=>ee.useContext(eS);var BN=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const l=s;return t._proxyFormState[l]!==jo.all&&(t._proxyFormState[l]=!r||jo.all),n&&(n[l]=!0),e[l]}});return o};const Kg=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function VN(e){const t=Gg(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[l,c]=ee.useState(n._formState),d=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Kg(()=>n._subscribe({name:o,formState:d.current,exact:s,callback:f=>{!r&&c({...n._formState,...f})}}),[o,r,s]),ee.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ee.useMemo(()=>BN(l,n,d.current,!1),[l,n])}var Tr=e=>typeof e=="string",Yb=(e,t,n,r,o)=>Tr(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),De(n,s))):(r&&(t.watchAll=!0),n),Wb=e=>jr(e)||!jN(e);function ho(e,t,n=new WeakSet){if(e===t)return!0;if(Wb(e)||Wb(t))return Object.is(e,t);if(nl(e)&&nl(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const l=e[s];if(!(s in t))return!1;if(s!=="ref"){const c=t[s];if(nl(l)&&nl(c)||(Nn(l)||Array.isArray(l))&&(Nn(c)||Array.isArray(c))?!ho(l,c,n):!Object.is(l,c))return!1}}return!0}function dK(e){const t=Gg(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:l,compute:c}=e||{},d=ee.useRef(o),f=ee.useRef(c),p=ee.useRef(void 0),h=ee.useRef(n),g=ee.useRef(r);f.current=c;const[v,_]=ee.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),b=ee.useCallback(R=>{const O=Yb(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(O):O},[n._formValues,n._names,r]),x=ee.useCallback(R=>{if(!s){const O=Yb(r,n._names,R||n._formValues,!1,d.current);if(f.current){const A=f.current(O);ho(A,p.current)||(_(A),p.current=A)}else _(O)}},[n._formValues,n._names,s,r]);Kg(()=>((h.current!==n||!ho(g.current,r))&&(h.current=n,g.current=r,x()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:R=>{x(R.values)}})),[n,l,r,x]),ee.useEffect(()=>n._removeUnmounted());const S=h.current!==n,E=g.current,T=ee.useMemo(()=>{if(s)return null;const R=!S&&!ho(E,r);return S||R?b():null},[s,S,r,E,b]);return T!==null?T:v}function fK(e){const t=Gg(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:l,exact:c=!0}=e,d=UN(o._names.array,n),f=ee.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,l)),[o,n,l]),p=dK({control:o,name:n,defaultValue:f,exact:c}),h=VN({control:o,name:n,exact:c}),g=ee.useRef(e),v=ee.useRef(o.register(n,{...e.rules,value:p,...fo(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const _=ee.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(h.validatingFields,n)},error:{enumerable:!0,get:()=>De(h.errors,n)}}),[h,n]),b=ee.useCallback(T=>v.current.onChange({target:{value:zN(T),name:n},type:ea.CHANGE}),[n]),x=ee.useCallback(()=>v.current.onBlur({target:{value:De(o._formValues,n),name:n},type:ea.BLUR}),[n,o._formValues]),S=ee.useCallback(T=>{const R=De(o._fields,n);R&&R._f&&T&&(R._f.ref={focus:()=>Or(T.focus)&&T.focus(),select:()=>Or(T.select)&&T.select(),setCustomValidity:O=>Or(T.setCustomValidity)&&T.setCustomValidity(O),reportValidity:()=>Or(T.reportValidity)&&T.reportValidity()})},[o._fields,n]),E=ee.useMemo(()=>({name:n,value:p,...fo(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:b,onBlur:x,ref:S}),[n,r,h.disabled,b,x,S,p]);return ee.useEffect(()=>{const T=o._options.shouldUnregister||s;o.register(n,{...g.current.rules,...fo(g.current.disabled)?{disabled:g.current.disabled}:{}});const R=(O,A)=>{const I=De(o._fields,O);I&&I._f&&(I._f.mount=A)};if(R(n,!0),T){const O=on(De(o._options.defaultValues,n,g.current.defaultValue));zt(o._defaultValues,n,O),tn(De(o._formValues,n))&&zt(o._formValues,n,O)}return!d&&o.register(n),()=>{(d?T&&!o._state.action:T)?o.unregister(n):R(n,!1)}},[n,o,d,s]),ee.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ee.useMemo(()=>({field:E,formState:h,fieldState:_}),[E,h,_])}const hK=e=>e.render(fK(e)),tS=ee.createContext(null);tS.displayName="HookFormContext";const pK=()=>ee.useContext(tS),mK=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}=e,E=ee.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}),[l,_,f,o,r,g,b,h,p,s,x,c,S,d,v,n]);return ee.createElement(tS.Provider,{value:E},ee.createElement(eS.Provider,{value:E.control},t))};var nS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Xr=e=>Array.isArray(e)?e:[e],nC=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function qN(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Nn(o)&&s){const l=qN(o,s);Nn(l)&&(n[r]=l)}else e[r]&&(n[r]=s)}return n}var hr=e=>Nn(e)&&!Object.keys(e).length,rS=e=>e.type==="file",Gm=e=>{if(!Xw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},HN=e=>e.type==="select-multiple",oS=e=>e.type==="radio",gK=e=>oS(e)||pf(e),a_=e=>Gm(e)&&e.isConnected;function vK(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;){if(jr(e)){e=void 0;break}e=e[t[r]],r++}return e}function yK(e){for(const t in e)if(e.hasOwnProperty(t)&&!tn(e[t]))return!1;return!0}function Cn(e,t){if(Tr(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:qg(t)?[t]:Jw(t),r=n.length===1?e:vK(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Nn(r)&&hr(r)||Array.isArray(r)&&yK(r))&&Cn(e,n.slice(0,-1)),e}var _K=e=>{for(const t in e)if(Or(e[t]))return!0;return!1};function GN(e){return Array.isArray(e)||Nn(e)&&!_K(e)}function Qb(e,t={}){for(const n in e){const r=e[n];GN(r)?(t[n]=Array.isArray(r)?[]:{},Qb(r,t[n])):tn(r)||(t[n]=!0)}return t}function xd(e,t,n){n||(n=Qb(t));for(const r in e){const o=e[r];if(GN(o))tn(t)||Wb(n[r])?n[r]=Qb(o,Array.isArray(o)?[]:{}):xd(o,jr(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!ho(o,s)}}return n}const rC={value:!1,isValid:!1},oC={value:!0,isValid:!0};var KN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?oC:{value:e[0].value,isValid:!0}:oC:rC}return rC},ZN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>tn(e)?e:t?e===""?NaN:e&&+e:n&&Tr(e)?new Date(e):r?r(e):e;const iC={isValid:!1,value:null};var YN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,iC):iC;function sC(e){const t=e.ref;return rS(t)?t.files:oS(t)?YN(e.refs).value:HN(t)?[...t.selectedOptions].map(({value:n})=>n):pf(t)?KN(e.refs).value:ZN(tn(t.value)?e.ref.value:t.value,e)}var bK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wK=(e,t,n,r)=>{const o={};for(const s of e){const l=De(t,s);l&&zt(o,s,l._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Km=e=>e instanceof RegExp,id=e=>tn(e)?e:Km(e)?e.source:Nn(e)?Km(e.value)?e.value.source:e.value:e,Ac=e=>({isOnSubmit:!e||e===jo.onSubmit,isOnBlur:e===jo.onBlur,isOnChange:e===jo.onChange,isOnAll:e===jo.all,isOnTouch:e===jo.onTouched});const aC="AsyncFunction";var SK=e=>!!e&&!!e.validate&&!!(Or(e.validate)&&e.validate.constructor.name===aC||Nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aC)),EK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Xb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Lc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=De(e,o);if(s){const{_f:l,...c}=s;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],o)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Lc(c,t))break}else if(Nn(c)&&Lc(c,t))break}}};function lC(e,t,n){const r=De(e,n);if(r||qg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),l=De(t,s),c=De(e,s);if(l&&!Array.isArray(l)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var xK=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return hr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!r||jo.all))},RK=(e,t,n)=>!e||!t||e===t||Xr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),OK=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,TK=(e,t)=>!Hg(De(e,t)).length&&Cn(e,t),WN=(e,t,n)=>{const r=Xr(De(e,n));return zt(r,FN,t[n]),zt(e,n,r),e};function cC(e,t,n="validate"){if(Tr(e)||Array.isArray(e)&&e.every(Tr)||fo(e)&&!e)return{type:n,message:Tr(e)?e:"",ref:t}}var sc=e=>Nn(e)&&!Km(e)?e:{value:e,message:""},Jb=async(e,t,n,r,o,s)=>{const{ref:l,refs:c,required:d,maxLength:f,minLength:p,min:h,max:g,pattern:v,validate:_,name:b,valueAsNumber:x,mount:S}=e._f,E=De(n,b);if(!S||t.has(b))return{};const T=c?c[0]:l,R=B=>{o&&T.reportValidity&&(T.setCustomValidity(fo(B)?"":B||""),T.reportValidity())},O={},A=oS(l),I=pf(l),P=A||I,L=(x||rS(l))&&tn(l.value)&&tn(E)||Gm(l)&&l.value===""||E===""||Array.isArray(E)&&!E.length||x&&typeof E=="number"&&isNaN(E),q=nS.bind(null,b,r,O),j=(B,F,Z,ie=Jo.maxLength,H=Jo.minLength)=>{const W=B?F:Z;O[b]={type:B?ie:H,message:W,ref:l,...q(B?ie:H,W)}};if(s?!Array.isArray(E)||!E.length:d&&(!P&&(L||jr(E))||fo(E)&&!E||I&&!KN(c).isValid||A&&!YN(c).isValid)){const{value:B,message:F}=Tr(d)?{value:!!d,message:d}:sc(d);if(B&&(O[b]={type:Jo.required,message:F,ref:T,...q(Jo.required,F)},!r))return R(F),O}if(!L&&(!jr(h)||!jr(g))){let B,F;const Z=sc(g),ie=sc(h);if(!jr(E)&&!isNaN(E)){const H=l.valueAsNumber||E&&+E;jr(Z.value)||(B=H>Z.value),jr(ie.value)||(F=H<ie.value)}else{const H=l.valueAsDate||new Date(E),W=Q=>new Date(new Date().toDateString()+" "+Q),te=l.type=="time",le=l.type=="week";Tr(Z.value)&&E&&(B=te?W(E)>W(Z.value):le?E>Z.value:H>new Date(Z.value)),Tr(ie.value)&&E&&(F=te?W(E)<W(ie.value):le?E<ie.value:H<new Date(ie.value))}if((B||F)&&(j(!!B,Z.message,ie.message,Jo.max,Jo.min),!r))return R(O[b].message),O}if((f||p)&&!L&&(Tr(E)||s&&Array.isArray(E))){const B=sc(f),F=sc(p),Z=!jr(B.value)&&E.length>+B.value,ie=!jr(F.value)&&E.length<+F.value;if((Z||ie)&&(j(Z,B.message,F.message),!r))return R(O[b].message),O}if(v&&!L&&Tr(E)){const{value:B,message:F}=sc(v);if(Km(B)&&!E.match(B)&&(O[b]={type:Jo.pattern,message:F,ref:l,...q(Jo.pattern,F)},!r))return R(F),O}if(_){if(Or(_)){const B=await _(E,n),F=cC(B,T);if(F&&(O[b]={...F,...q(Jo.validate,F.message)},!r))return R(F.message),O}else if(Nn(_)){let B={};for(const F in _){if(!hr(B)&&!r)break;const Z=cC(await _[F](E,n),T,F);Z&&(B={...Z,...q(F,Z.message)},R(Z.message),r&&(O[b]=B))}if(!hr(B)&&(O[b]={ref:T,...B},!r))return O}}return R(!0),O};const CK={mode:jo.onSubmit,reValidateMode:jo.onChange,shouldFocusError:!0};function AK(e={}){let t={...CK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Or(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Nn(t.defaultValues)||Nn(t.values)?on(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:on(o),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...p};let g={...h};const v={array:nC(),state:nC()},_=t.criteriaMode===jo.all,b=K=>ne=>{clearTimeout(f),f=setTimeout(K,ne)},x=async K=>{if(!l.keepIsValid&&!t.disabled&&(h.isValid||g.isValid||K)){let ne;t.resolver?(ne=hr((await L()).errors),S()):ne=await B({fields:r,onlyCheckValid:!0,eventType:ea.VALID}),ne!==n.isValid&&v.state.next({isValid:ne})}},S=(K,ne)=>{!t.disabled&&(h.isValidating||h.validatingFields||g.isValidating||g.validatingFields)&&((K||Array.from(c.mount)).forEach(ae=>{ae&&(ne?zt(n.validatingFields,ae,ne):Cn(n.validatingFields,ae))}),v.state.next({validatingFields:n.validatingFields,isValidating:!hr(n.validatingFields)}))},E=K=>{const ne=xd(o,s),ae=bK(K);zt(n.dirtyFields,ae,De(ne,ae))},T=(K,ne=[],ae,Oe,Ae=!0,Ie=!0)=>{if(Oe&&ae&&!t.disabled){if(l.action=!0,Ie&&Array.isArray(De(r,K))){const ke=ae(De(r,K),Oe.argA,Oe.argB);Ae&&zt(r,K,ke)}if(Ie&&Array.isArray(De(n.errors,K))){const ke=ae(De(n.errors,K),Oe.argA,Oe.argB);Ae&&zt(n.errors,K,ke),TK(n.errors,K)}if((h.touchedFields||g.touchedFields)&&Ie&&Array.isArray(De(n.touchedFields,K))){const ke=ae(De(n.touchedFields,K),Oe.argA,Oe.argB);Ae&&zt(n.touchedFields,K,ke)}(h.dirtyFields||g.dirtyFields)&&E(K),v.state.next({name:K,isDirty:Z(K,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(s,K,ne)},R=(K,ne)=>{zt(n.errors,K,ne),v.state.next({errors:n.errors})},O=K=>{n.errors=K,v.state.next({errors:n.errors,isValid:!1})},A=(K,ne,ae,Oe)=>{const Ae=De(r,K);if(Ae){const Ie=De(s,K,tn(ae)?De(o,K):ae);tn(Ie)||Oe&&Oe.defaultChecked||ne?zt(s,K,ne?Ie:sC(Ae._f)):W(K,Ie),l.mount&&!l.action&&x()}},I=(K,ne,ae,Oe,Ae)=>{let Ie=!1,ke=!1;const Je={name:K};if(!t.disabled){if(!ae||Oe){(h.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=Je.isDirty=Z(),Ie=ke!==Je.isDirty);const et=ho(De(o,K),ne);ke=!!De(n.dirtyFields,K),et?Cn(n.dirtyFields,K):zt(n.dirtyFields,K,!0),Je.dirtyFields=n.dirtyFields,Ie=Ie||(h.dirtyFields||g.dirtyFields)&&ke!==!et}if(ae){const et=De(n.touchedFields,K);et||(zt(n.touchedFields,K,ae),Je.touchedFields=n.touchedFields,Ie=Ie||(h.touchedFields||g.touchedFields)&&et!==ae)}Ie&&Ae&&v.state.next(Je)}return Ie?Je:{}},P=(K,ne,ae,Oe)=>{const Ae=De(n.errors,K),Ie=(h.isValid||g.isValid)&&fo(ne)&&n.isValid!==ne;if(t.delayError&&ae?(d=b(()=>R(K,ae)),d(t.delayError)):(clearTimeout(f),d=null,ae?zt(n.errors,K,ae):Cn(n.errors,K)),(ae?!ho(Ae,ae):Ae)||!hr(Oe)||Ie){const ke={...Oe,...Ie&&fo(ne)?{isValid:ne}:{},errors:n.errors,name:K};n={...n,...ke},v.state.next(ke)}},L=async K=>(S(K,!0),await t.resolver(s,t.context,wK(K||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),q=async K=>{const{errors:ne}=await L(K);if(S(K),K)for(const ae of K){const Oe=De(ne,ae);Oe?zt(n.errors,ae,Oe):Cn(n.errors,ae)}else n.errors=ne;return ne},j=async({name:K,eventType:ne})=>{if(e.validate){const ae=await e.validate({formValues:s,formState:n,name:K,eventType:ne});if(Nn(ae))for(const Oe in ae)ae[Oe]&&fe(`${s_}.${Oe}`,{message:Tr(ae.message)?ae.message:"",type:Jo.validate});else Tr(ae)||!ae?fe(s_,{message:ae||"",type:Jo.validate}):X(s_);return ae}return!0},B=async({fields:K,onlyCheckValid:ne,name:ae,eventType:Oe,context:Ae={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ae.runRootValidation=!0,!await j({name:ae,eventType:Oe})&&(Ae.valid=!1,ne)))return Ae.valid;for(const Ie in K){const ke=K[Ie];if(ke){const{_f:Je,...et}=ke;if(Je){const vt=c.array.has(Je.name),Tt=ke._f&&SK(ke._f);Tt&&h.validatingFields&&S([Je.name],!0);const yt=await Jb(ke,c.disabled,s,_,t.shouldUseNativeValidation&&!ne,vt);if(Tt&&h.validatingFields&&S([Je.name]),yt[Je.name]&&(Ae.valid=!1,ne)||(!ne&&(De(yt,Je.name)?vt?WN(n.errors,yt,Je.name):zt(n.errors,Je.name,yt[Je.name]):Cn(n.errors,Je.name)),e.shouldUseNativeValidation&&yt[Je.name]))break}!hr(et)&&await B({context:Ae,onlyCheckValid:ne,fields:et,name:Ie,eventType:Oe})}}return Ae.valid},F=()=>{for(const K of c.unMount){const ne=De(r,K);ne&&(ne._f.refs?ne._f.refs.every(ae=>!a_(ae)):!a_(ne._f.ref))&&Y(K)}c.unMount=new Set},Z=(K,ne)=>!t.disabled&&(K&&ne&&zt(s,K,ne),!ho(D(),o)),ie=(K,ne,ae)=>Yb(K,c,{...l.mount?s:tn(ne)?o:Tr(K)?{[K]:ne}:ne},ae,ne),H=K=>Hg(De(l.mount?s:o,K,t.shouldUnregister?De(o,K,[]):[])),W=(K,ne,ae={})=>{const Oe=De(r,K);let Ae=ne;if(Oe){const Ie=Oe._f;Ie&&(!Ie.disabled&&zt(s,K,ZN(ne,Ie)),Ae=Gm(Ie.ref)&&jr(ne)?"":ne,HN(Ie.ref)?[...Ie.ref.options].forEach(ke=>ke.selected=Ae.includes(ke.value)):Ie.refs?pf(Ie.ref)?Ie.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Ae)?ke.checked=!!Ae.find(Je=>Je===ke.value):ke.checked=Ae===ke.value||!!Ae)}):Ie.refs.forEach(ke=>ke.checked=ke.value===Ae):rS(Ie.ref)?Ie.ref.value="":(Ie.ref.value=Ae,Ie.ref.type||v.state.next({name:K,values:on(s)})))}(ae.shouldDirty||ae.shouldTouch)&&I(K,Ae,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&V(K)},te=(K,ne,ae)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const Ae=ne[Oe],Ie=K+"."+Oe,ke=De(r,Ie);(c.array.has(K)||Nn(Ae)||ke&&!ke._f)&&!nl(Ae)?te(Ie,Ae,ae):W(Ie,Ae,ae)}},le=(K,ne,ae={})=>{const Oe=De(r,K),Ae=c.array.has(K),Ie=on(ne),ke=De(s,K),Je=ho(ke,Ie);if(zt(s,K,Ie),Ae)v.array.next({name:K,values:on(s)}),ae.shouldDirty&&(E(K),v.state.next({name:K,dirtyFields:n.dirtyFields,isDirty:Z(K,Ie)}));else{const et=Array.isArray(Ie)&&!Ie.length||hr(Ie);!Oe||Oe._f||jr(Ie)||et?W(K,Ie,ae):te(K,Ie,ae)}Je||(Xb(K,c)?v.state.next({...n,name:K,values:on(s)}):v.state.next({name:l.mount?K:void 0,values:on(s)}))},Q=K=>{const ne=Or(K)?K(s):K;ho(s,ne)||(s={...s,...ne},v.state.next({...n,values:s}))},k=async K=>{l.mount=!0;const ne=K.target;let ae=ne.name,Oe=!0;const Ae=De(r,ae),Ie=et=>{Oe=Number.isNaN(et)||nl(et)&&isNaN(et.getTime())||ho(et,De(s,ae,et))},ke=Ac(t.mode),Je=Ac(t.reValidateMode);if(Ae){let et,vt;const Tt=ne.type?sC(Ae._f):zN(K),yt=K.type===ea.BLUR||K.type===ea.FOCUS_OUT,Ln=!EK(Ae._f)&&!e.validate&&!t.resolver&&!De(n.errors,ae)&&!Ae._f.deps||OK(yt,De(n.touchedFields,ae),n.isSubmitted,Je,ke),Ni=Xb(ae,c,yt);zt(s,ae,Tt),yt?(!ne||!ne.readOnly)&&(Ae._f.onBlur&&Ae._f.onBlur(K),d&&d(0)):Ae._f.onChange&&Ae._f.onChange(K);const Ho=I(ae,Tt,yt),Ye=!hr(Ho)||Ni;if(!yt&&v.state.next({name:ae,type:K.type,values:on(s)}),Ln)return(h.isValid||g.isValid)&&(t.mode==="onBlur"?yt&&x():yt||x()),Ye&&v.state.next({name:ae,...Ni?{}:Ho});if(!t.resolver&&e.validate&&await j({name:ae,eventType:K.type}),!yt&&Ni&&v.state.next({...n}),t.resolver){const{errors:dt}=await L([ae]);if(S([ae]),Ie(Tt),Oe){const Ct=lC(n.errors,r,ae),it=lC(dt,r,Ct.name||ae);et=it.error,ae=it.name,vt=hr(dt)}}else S([ae],!0),et=(await Jb(Ae,c.disabled,s,_,t.shouldUseNativeValidation))[ae],S([ae]),Ie(Tt),Oe&&(et?vt=!1:(h.isValid||g.isValid)&&(vt=await B({fields:r,onlyCheckValid:!0,name:ae,eventType:K.type})));Oe&&(Ae._f.deps&&(!Array.isArray(Ae._f.deps)||Ae._f.deps.length>0)&&V(Ae._f.deps),P(ae,vt,et,Ho))}},G=(K,ne)=>{if(De(n.errors,ne)&&K.focus)return K.focus(),1},V=async(K,ne={})=>{let ae,Oe;const Ae=Xr(K);if(t.resolver){const Ie=await q(tn(K)?K:Ae);ae=hr(Ie),Oe=K?!Ae.some(ke=>De(Ie,ke)):ae}else K?(Oe=(await Promise.all(Ae.map(async Ie=>{const ke=De(r,Ie);return await B({fields:ke&&ke._f?{[Ie]:ke}:ke,eventType:ea.TRIGGER})}))).every(Boolean),!(!Oe&&!n.isValid)&&x()):Oe=ae=await B({fields:r,name:K,eventType:ea.TRIGGER});return v.state.next({...!Tr(K)||(h.isValid||g.isValid)&&ae!==n.isValid?{}:{name:K},...t.resolver||!K?{isValid:ae}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&Lc(r,G,K?Ae:c.mount),Oe},D=(K,ne)=>{let ae={...l.mount?s:o};return ne&&(ae=qN(ne.dirtyFields?n.dirtyFields:n.touchedFields,ae)),tn(K)?ae:Tr(K)?De(ae,K):K.map(Oe=>De(ae,Oe))},U=(K,ne)=>({invalid:!!De((ne||n).errors,K),isDirty:!!De((ne||n).dirtyFields,K),error:De((ne||n).errors,K),isValidating:!!De(n.validatingFields,K),isTouched:!!De((ne||n).touchedFields,K)}),X=K=>{const ne=K?Xr(K):void 0;ne?.forEach(ae=>Cn(n.errors,ae)),ne?ne.forEach(ae=>{v.state.next({name:ae,errors:n.errors})}):v.state.next({errors:{}})},fe=(K,ne,ae)=>{const Oe=(De(r,K,{_f:{}})._f||{}).ref,Ae=De(n.errors,K)||{},{ref:Ie,message:ke,type:Je,...et}=Ae;zt(n.errors,K,{...et,...ne,ref:Oe}),v.state.next({name:K,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},pe=(K,ne)=>Or(K)?v.state.subscribe({next:ae=>"values"in ae&&K(ae.values||ie(void 0,ne),ae)}):ie(K,ne,!0),xe=K=>v.state.subscribe({next:ne=>{if(RK(K.name,ne.name,K.exact)&&xK(ne,K.formState||h,Pe,K.reRenderRoot)){const ae={...s};K.callback({values:ae,...n,...ne,defaultValues:o})}}}).unsubscribe,je=K=>(l.mount=!0,g={...g,...K.formState},xe({...K,formState:{...p,...K.formState}})),Y=(K,ne={})=>{for(const ae of K?Xr(K):c.mount)c.mount.delete(ae),c.array.delete(ae),ne.keepValue||(Cn(r,ae),Cn(s,ae)),!ne.keepError&&Cn(n.errors,ae),!ne.keepDirty&&Cn(n.dirtyFields,ae),!ne.keepTouched&&Cn(n.touchedFields,ae),!ne.keepIsValidating&&Cn(n.validatingFields,ae),!t.shouldUnregister&&!ne.keepDefaultValue&&Cn(o,ae);v.state.next({values:on(s)}),v.state.next({...n,...ne.keepDirty?{isDirty:Z()}:{}}),!ne.keepIsValid&&x()},re=({disabled:K,name:ne})=>{if(fo(K)&&l.mount||K||c.disabled.has(ne)){const Ae=c.disabled.has(ne)!==!!K;K?c.disabled.add(ne):c.disabled.delete(ne),Ae&&l.mount&&!l.action&&x()}},ve=(K,ne={})=>{let ae=De(r,K);const Oe=fo(ne.disabled)||fo(t.disabled),Ae=!c.registerName.has(K)&&ae&&ae._f&&!ae._f.mount;return zt(r,K,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:K}},name:K,mount:!0,...ne}}),c.mount.add(K),ae&&!Ae?re({disabled:fo(ne.disabled)?ne.disabled:t.disabled,name:K}):A(K,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:id(ne.min),max:id(ne.max),minLength:id(ne.minLength),maxLength:id(ne.maxLength),pattern:id(ne.pattern)}:{},name:K,onChange:k,onBlur:k,ref:Ie=>{if(Ie){c.registerName.add(K),ve(K,ne),c.registerName.delete(K),ae=De(r,K);const ke=tn(Ie.value)&&Ie.querySelectorAll&&Ie.querySelectorAll("input,select,textarea")[0]||Ie,Je=gK(ke),et=ae._f.refs||[];if(Je?et.find(vt=>vt===ke):ke===ae._f.ref)return;zt(r,K,{_f:{...ae._f,...Je?{refs:[...et.filter(a_),ke,...Array.isArray(De(o,K))?[{}]:[]],ref:{type:ke.type,name:K}}:{ref:ke}}}),A(K,!1,void 0,ke)}else ae=De(r,K,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(UN(c.array,K)&&l.action)&&c.unMount.add(K)}}},se=()=>t.shouldFocusError&&Lc(r,G,c.mount),Se=K=>{fo(K)&&(v.state.next({disabled:K}),Lc(r,(ne,ae)=>{const Oe=De(r,ae);Oe&&(ne.disabled=Oe._f.disabled||K,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(Ae=>{Ae.disabled=Oe._f.disabled||K}))},0,!1))},Te=(K,ne)=>async ae=>{let Oe;ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let Ae=on(s);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ie,values:ke}=await L();S(),n.errors=Ie,Ae=on(ke)}else await B({fields:r,eventType:ea.SUBMIT});if(c.disabled.size)for(const Ie of c.disabled)Cn(Ae,Ie);if(Cn(n.errors,FN),hr(n.errors)){v.state.next({errors:{}});try{await K(Ae,ae)}catch(Ie){Oe=Ie}}else ne&&await ne({...n.errors},ae),se(),setTimeout(se);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hr(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},tt=(K,ne={})=>{De(r,K)&&(tn(ne.defaultValue)?le(K,on(De(o,K))):(le(K,ne.defaultValue),zt(o,K,on(ne.defaultValue))),ne.keepTouched||Cn(n.touchedFields,K),ne.keepDirty||(Cn(n.dirtyFields,K),n.isDirty=ne.defaultValue?Z(K,on(De(o,K))):Z()),ne.keepError||(Cn(n.errors,K),h.isValid&&x()),v.state.next({...n}))},rt=(K,ne={})=>{const ae=K?on(K):o,Oe=on(ae),Ae=hr(K),Ie=Ae?o:Oe;if(ne.keepDefaultValues||(o=ae),!ne.keepValues){if(ne.keepDirtyValues){const ke=new Set([...c.mount,...Object.keys(xd(o,s))]);for(const Je of Array.from(ke)){const et=De(n.dirtyFields,Je),vt=De(s,Je),Tt=De(Ie,Je);et&&!tn(vt)?zt(Ie,Je,vt):!et&&!tn(Tt)&&le(Je,Tt)}}else{if(Xw&&tn(K))for(const ke of c.mount){const Je=De(r,ke);if(Je&&Je._f){const et=Array.isArray(Je._f.refs)?Je._f.refs[0]:Je._f.ref;if(Gm(et)){const vt=et.closest("form");if(vt){vt.reset();break}}}}if(ne.keepFieldsRef)for(const ke of c.mount)le(ke,De(Ie,ke));else r={}}s=t.shouldUnregister?ne.keepDefaultValues?on(o):{}:on(Ie),v.array.next({values:{...Ie}}),v.state.next({values:{...Ie}})}c={mount:ne.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!hr(Ie),l.watch=!!t.shouldUnregister,l.keepIsValid=!!ne.keepIsValid,l.action=!1,ne.keepErrors||(n.errors={}),v.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ae?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ho(K,o)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ae?{}:ne.keepDirtyValues?ne.keepDefaultValues&&s?xd(o,s):n.dirtyFields:ne.keepDefaultValues&&K?xd(o,K):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Be=(K,ne)=>rt(Or(K)?K(s):K,{...t.resetOptions,...ne}),Qe=(K,ne={})=>{const ae=De(r,K),Oe=ae&&ae._f;if(Oe){const Ae=Oe.refs?Oe.refs[0]:Oe.ref;Ae.focus&&setTimeout(()=>{Ae.focus(),ne.shouldSelect&&Or(Ae.select)&&Ae.select()})}},Pe=K=>{n={...n,...K}},Ue={control:{register:ve,unregister:Y,getFieldState:U,handleSubmit:Te,setError:fe,_subscribe:xe,_runSchema:L,_updateIsValidating:S,_focusError:se,_getWatch:ie,_getDirty:Z,_setValid:x,_setFieldArray:T,_setDisabledField:re,_setErrors:O,_getFieldArray:H,_reset:rt,_resetDefaultValues:()=>Or(t.defaultValues)&&t.defaultValues().then(K=>{Be(K,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Se,_subjects:v,_proxyFormState:h,get _fields(){return r},get _formValues(){return s},get _state(){return l},set _state(K){l=K},get _defaultValues(){return o},get _names(){return c},set _names(K){c=K},get _formState(){return n},get _options(){return t},set _options(K){t={...t,...K}}},subscribe:je,trigger:V,register:ve,handleSubmit:Te,watch:pe,setValue:le,setValues:Q,getValues:D,reset:Be,resetField:tt,clearErrors:X,unregister:Y,setError:fe,setFocus:Qe,getFieldState:U};return{...Ue,formControl:Ue}}var Hs=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},l_=(e,t,n={})=>n.shouldFocus||tn(n.shouldFocus)?n.focusName||`${e}.${tn(n.focusIndex)?t:n.focusIndex}.`:"",c_=(e,t)=>[...e,...Xr(t)],u_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function d_(e,t,n){return[...e.slice(0,t),...Xr(n),...e.slice(t)]}var f_=(e,t,n)=>Array.isArray(e)?(tn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],h_=(e,t)=>[...Xr(t),...Xr(e)];function IK(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Hg(r).length?r:[]}var p_=(e,t)=>tn(t)?[]:IK(e,Xr(t).sort((n,r)=>n-r)),m_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},uC=(e,t,n)=>(e[t]=n,e);function Lce(e){const t=Gg(),{control:n=t,name:r,keyName:o="id",shouldUnregister:s,rules:l}=e,[c,d]=ee.useState(n._getFieldArray(r)),f=ee.useRef(n._getFieldArray(r).map(Hs)),p=ee.useRef(!1);n._names.array.add(r),ee.useMemo(()=>l&&c.length>=0&&n.register(r,l),[n,r,c.length,l]),Kg(()=>n._subjects.array.subscribe({next:({values:R,name:O})=>{if(O===r||!O){const A=De(R,r);Array.isArray(A)&&(d(A),f.current=A.map(Hs))}}}).unsubscribe,[n,r]);const h=ee.useCallback(R=>{p.current=!0,n._setFieldArray(r,R)},[n,r]),g=(R,O)=>{const A=Xr(on(R)),I=c_(n._getFieldArray(r),A);n._names.focus=l_(r,I.length-1,O),f.current=c_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,c_,{argA:u_(R)})},v=(R,O)=>{const A=Xr(on(R)),I=h_(n._getFieldArray(r),A);n._names.focus=l_(r,0,O),f.current=h_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,h_,{argA:u_(R)})},_=R=>{const O=p_(n._getFieldArray(r),R);f.current=p_(f.current,R),h(O),d(O),!Array.isArray(De(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,O,p_,{argA:R})},b=(R,O,A)=>{const I=Xr(on(O)),P=d_(n._getFieldArray(r),R,I);n._names.focus=l_(r,R,A),f.current=d_(f.current,R,I.map(Hs)),h(P),d(P),n._setFieldArray(r,P,d_,{argA:R,argB:u_(O)})},x=(R,O)=>{const A=n._getFieldArray(r);m_(A,R,O),m_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,m_,{argA:R,argB:O},!1)},S=(R,O)=>{const A=n._getFieldArray(r);f_(A,R,O),f_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,f_,{argA:R,argB:O},!1)},E=(R,O)=>{const A=on(O),I=uC(n._getFieldArray(r),R,A);f.current=[...I].map((P,L)=>!P||L===R?Hs():f.current[L]),h(I),d([...I]),n._setFieldArray(r,I,uC,{argA:R,argB:A},!0,!1)},T=R=>{const O=Xr(on(R));f.current=O.map(Hs),h([...O]),d([...O]),n._setFieldArray(r,[...O],A=>A,{},!0,!1)};return ee.useEffect(()=>{n._state.action=!1,Xb(r,n._names)&&n._subjects.state.next({...n._formState});const R=Ac(n._options.mode);if(p.current&&(!R.isOnSubmit||n._formState.isSubmitted)&&!Ac(n._options.reValidateMode).isOnSubmit&&!R.isOnBlur)if(n._options.resolver)n._runSchema([r]).then(O=>{n._updateIsValidating([r]);const A=De(O.errors,r),I=De(n._formState.errors,r);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):Cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const O=De(n._fields,r);O&&O._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&Jb(O,n._names.disabled,n._formValues,n._options.criteriaMode===jo.all,n._options.shouldUseNativeValidation,!0).then(A=>!hr(A)&&n._subjects.state.next({errors:WN(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:on(n._formValues)}),n._names.focus&&Lc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),ee.useEffect(()=>(!De(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(O,A)=>{const I=De(n._fields,O);I&&I._f&&(I._f.mount=A)};n._options.shouldUnregister||s?n.unregister(r):R(r,!1)}),[r,n,o,s]),{swap:ee.useCallback(x,[h,r,n]),move:ee.useCallback(S,[h,r,n]),prepend:ee.useCallback(v,[h,r,n]),append:ee.useCallback(g,[h,r,n]),remove:ee.useCallback(_,[h,r,n]),insert:ee.useCallback(b,[h,r,n]),update:ee.useCallback(E,[h,r,n]),replace:ee.useCallback(T,[h,r,n]),fields:ee.useMemo(()=>c.map((R,O)=>({...R,[o]:f.current[O]||Hs()})),[c,o])}}function Ti(e={}){const t=ee.useRef(void 0),n=ee.useRef(void 0),[r,o]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Or(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Or(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Or(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...c}=AK(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Kg(()=>{const l=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,l},[s]),ee.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ee.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const l=s._getDirty();l!==r.isDirty&&s._subjects.state.next({isDirty:l})}},[s,r.isDirty]),ee.useEffect(()=>{var l;e.values&&!ho(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((l=s._options.resetOptions)===null||l===void 0)&&l.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),ee.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=ee.useMemo(()=>BN(r,s),[s,r]),t.current}function dC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=dC(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():dC(e[o],null)}}}}function Jn(...e){return M.useCallback(mf(...e),e)}var MK=Symbol.for("react.lazy"),Zm=Ew[" use ".trim().toString()];function PK(e){return typeof e=="object"&&e!==null&&"then"in e}function QN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MK&&"_payload"in e&&PK(e._payload)}function XN(e){const t=NK(e),n=M.forwardRef((r,o)=>{let{children:s,...l}=r;QN(s)&&typeof Zm=="function"&&(s=Zm(s._payload));const c=M.Children.toArray(s),d=c.find(DK);if(d){const f=d.props.children,p=c.map(h=>h===d?M.Children.count(f)>1?M.Children.only(null):M.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:M.isValidElement(f)?M.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var iS=XN("Slot");function NK(e){const t=M.forwardRef((n,r)=>{let{children:o,...s}=n;if(QN(o)&&typeof Zm=="function"&&(o=Zm(o._payload)),M.isValidElement(o)){const l=$K(o),c=LK(s,o.props);return o.type!==M.Fragment&&(c.ref=r?mf(r,l):l),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kK=Symbol("radix.slottable");function DK(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kK}function LK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $K(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const fC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hC=Zw,JN=(e,t)=>n=>{var r;if(t?.variants==null)return hC(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(f=>{const p=n?.[f],h=s?.[f];if(p===null)return null;const g=fC(p)||fC(h);return o[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[h,g]=p;return g===void 0||(f[h]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:g,...v}=p;return Object.entries(v).every(_=>{let[b,x]=_;return Array.isArray(x)?x.includes({...s,...c}[b]):{...s,...c}[b]===x})?[...f,h,g]:f},[]);return hC(e,l,d,n?.class,n?.className)},pC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},e1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?pC(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>pC(o,n,e))}},mC=(e,t)=>{t.shouldUseNativeValidation&&e1(e,t);const n={};for(const r in e){const o=De(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(jK(t.names||Object.keys(e),r)){const l=Object.assign({},De(n,r));zt(l,"root",s),zt(n,r,l)}else zt(n,r,s)}return n},jK=(e,t)=>{const n=gC(t);return e.some(r=>gC(r).match(`^${n}\\.\\d+`))};function gC(e){return e.replace(/\]|\[/g,"")}function vC(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function zK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(p){return p.errors.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=nS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function UK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(p){return p.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=nS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Ci(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(vC(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return s.shouldUseNativeValidation&&e1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return Array.isArray(c?.issues)})(l))return{values:{},errors:mC(zK(l.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(vC(function(){return Promise.resolve((n.mode==="sync"?q9:H9)(e,r,t)).then(function(l){return s.shouldUseNativeValidation&&e1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return c instanceof jw})(l))return{values:{},errors:mC(UK(l.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function ct(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function FK(e,t){const n=M.createContext(t),r=s=>{const{children:l,...c}=s,d=M.useMemo(()=>c,Object.values(c));return C.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function o(s){const l=M.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function gl(e,t=[]){let n=[];function r(s,l){const c=M.createContext(l),d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:v,..._}=h,b=g?.[e]?.[d]||c,x=M.useMemo(()=>_,Object.values(_));return C.jsx(b.Provider,{value:x,children:v})};f.displayName=s+"Provider";function p(h,g){const v=g?.[e]?.[d]||c,_=M.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,p]}const o=()=>{const s=n.map(l=>M.createContext(l));return function(c){const d=c?.[e]||s;return M.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,BK(o,...t)]}function BK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ri=globalThis?.document?M.useLayoutEffect:()=>{},VK=Ew[" useId ".trim().toString()]||(()=>{}),qK=0;function la(e){const[t,n]=M.useState(VK());return ri(()=>{n(r=>r??String(qK++))},[e]),e||(t?`radix-${t}`:"")}var HK=Ew[" useInsertionEffect ".trim().toString()]||ri;function gf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,l]=GK({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o;{const p=M.useRef(e!==void 0);M.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=M.useCallback(p=>{if(c){const h=KK(p)?p(e):p;h!==e&&l.current?.(h)}else s(p)},[c,e,s,l]);return[d,f]}function GK({defaultProp:e,onChange:t}){const[n,r]=M.useState(e),o=M.useRef(n),s=M.useRef(t);return HK(()=>{s.current=t},[t]),M.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function KK(e){return typeof e=="function"}function Xd(e){const t=ZK(e),n=M.forwardRef((r,o)=>{const{children:s,...l}=r,c=M.Children.toArray(s),d=c.find(YK);if(d){const f=d.props.children,p=c.map(h=>h===d?M.Children.count(f)>1?M.Children.only(null):M.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:M.isValidElement(f)?M.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ZK(e){const t=M.forwardRef((n,r)=>{const{children:o,...s}=n;if(M.isValidElement(o)){const l=QK(o),c=WK(s,o.props);return o.type!==M.Fragment&&(c.ref=r?mf(r,l):l),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e4=Symbol("radix.slottable");function $ce(e){const t=({children:n})=>C.jsx(C.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=e4,t}function YK(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e4}function WK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function QK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=XK.reduce((e,t)=>{const n=Xd(`Primitive.${t}`),r=M.forwardRef((o,s)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t4(e,t){e&&kg.flushSync(()=>e.dispatchEvent(t))}function oi(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>t.current?.(...n),[])}function JK(e,t=globalThis?.document){const n=oi(e);M.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var eZ="DismissableLayer",t1="dismissableLayer.update",tZ="dismissableLayer.pointerDownOutside",nZ="dismissableLayer.focusOutside",yC,n4=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sS=M.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,f=M.useContext(n4),[p,h]=M.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=M.useState({}),_=Jn(t,I=>h(I)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),E=p?b.indexOf(p):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=S,O=iZ(I=>{const P=I.target,L=[...f.branches].some(q=>q.contains(P));!R||L||(o?.(I),l?.(I),I.defaultPrevented||c?.())},g),A=sZ(I=>{const P=I.target;[...f.branches].some(q=>q.contains(P))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},g);return JK(I=>{E===f.layers.size-1&&(r?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},g),M.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(yC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),_C(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=yC)}},[p,g,n,f]),M.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),_C())},[p,f]),M.useEffect(()=>{const I=()=>v({});return document.addEventListener(t1,I),()=>document.removeEventListener(t1,I)},[]),C.jsx(Sn.div,{...d,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...e.style},onFocusCapture:ct(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ct(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ct(e.onPointerDownCapture,O.onPointerDownCapture)})});sS.displayName=eZ;var rZ="DismissableLayerBranch",oZ=M.forwardRef((e,t)=>{const n=M.useContext(n4),r=M.useRef(null),o=Jn(t,r);return M.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),C.jsx(Sn.div,{...e,ref:o})});oZ.displayName=rZ;function iZ(e,t=globalThis?.document){const n=oi(e),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){r4(tZ,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sZ(e,t=globalThis?.document){const n=oi(e),r=M.useRef(!1);return M.useEffect(()=>{const o=s=>{s.target&&!r.current&&r4(nZ,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _C(){const e=new CustomEvent(t1);document.dispatchEvent(e)}function r4(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?t4(o,s):o.dispatchEvent(s)}var g_="focusScope.autoFocusOnMount",v_="focusScope.autoFocusOnUnmount",bC={bubbles:!1,cancelable:!0},aZ="FocusScope",aS=M.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=e,[c,d]=M.useState(null),f=oi(o),p=oi(s),h=M.useRef(null),g=Jn(t,b=>d(b)),v=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let b=function(T){if(v.paused||!c)return;const R=T.target;c.contains(R)?h.current=R:Xs(h.current,{select:!0})},x=function(T){if(v.paused||!c)return;const R=T.relatedTarget;R!==null&&(c.contains(R)||Xs(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&Xs(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const E=new MutationObserver(S);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),E.disconnect()}}},[r,c,v.paused]),M.useEffect(()=>{if(c){SC.add(v);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(g_,bC);c.addEventListener(g_,f),c.dispatchEvent(S),S.defaultPrevented||(lZ(hZ(o4(c)),{select:!0}),document.activeElement===b&&Xs(c))}return()=>{c.removeEventListener(g_,f),setTimeout(()=>{const S=new CustomEvent(v_,bC);c.addEventListener(v_,p),c.dispatchEvent(S),S.defaultPrevented||Xs(b??document.body,{select:!0}),c.removeEventListener(v_,p),SC.remove(v)},0)}}},[c,f,p,v]);const _=M.useCallback(b=>{if(!n&&!r||v.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const E=b.currentTarget,[T,R]=cZ(E);T&&R?!b.shiftKey&&S===R?(b.preventDefault(),n&&Xs(T,{select:!0})):b.shiftKey&&S===T&&(b.preventDefault(),n&&Xs(R,{select:!0})):S===E&&b.preventDefault()}},[n,r,v.paused]);return C.jsx(Sn.div,{tabIndex:-1,...l,ref:g,onKeyDown:_})});aS.displayName=aZ;function lZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xs(r,{select:t}),document.activeElement!==n)return}function cZ(e){const t=o4(e),n=wC(t,e),r=wC(t.reverse(),e);return[n,r]}function o4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wC(e,t){for(const n of e)if(!uZ(n,{upTo:t}))return n}function uZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dZ(e){return e instanceof HTMLInputElement&&"select"in e}function Xs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dZ(e)&&t&&e.select()}}var SC=fZ();function fZ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=EC(e,t),e.unshift(t)},remove(t){e=EC(e,t),e[0]?.resume()}}}function EC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hZ(e){return e.filter(t=>t.tagName!=="A")}var pZ="Portal",lS=M.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=M.useState(!1);ri(()=>s(!0),[]);const l=n||o&&globalThis?.document?.body;return l?GP.createPortal(C.jsx(Sn.div,{...r,ref:t}),l):null});lS.displayName=pZ;function mZ(e,t){return M.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=gZ(t),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),s=Jn(r.ref,vZ(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:s}):null};gs.displayName="Presence";function gZ(e){const[t,n]=M.useState(),r=M.useRef(null),o=M.useRef(e),s=M.useRef("none"),l=e?"mounted":"unmounted",[c,d]=mZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const f=lp(r.current);s.current=c==="mounted"?f:"none"},[c]),ri(()=>{const f=r.current,p=o.current;if(p!==e){const g=s.current,v=lp(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),ri(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=v=>{const b=lp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=lp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:M.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function lp(e){return e?.animationName||"none"}function vZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var y_=0;function i4(){M.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xC()),document.body.insertAdjacentElement("beforeend",e[1]??xC()),y_++,()=>{y_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),y_--}},[])}function xC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wi=function(){return wi=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},wi.apply(this,arguments)};function s4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yZ(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var bm="right-scroll-bar-position",wm="width-before-scroll-bar",_Z="with-scroll-bars-hidden",bZ="--removed-body-scroll-bar-size";function __(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wZ(e,t){var n=M.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var SZ=typeof window<"u"?M.useLayoutEffect:M.useEffect,RC=new WeakMap;function EZ(e,t){var n=wZ(null,function(r){return e.forEach(function(o){return __(o,r)})});return SZ(function(){var r=RC.get(n);if(r){var o=new Set(r),s=new Set(e),l=n.current;o.forEach(function(c){s.has(c)||__(c,null)}),s.forEach(function(c){o.has(c)||__(c,l)})}RC.set(n,e)},[e]),n}function xZ(e){return e}function RZ(e,t){t===void 0&&(t=xZ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var d=function(){var p=l;l=[],p.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return o}function OZ(e){e===void 0&&(e={});var t=RZ(null);return t.options=wi({async:!0,ssr:!1},e),t}var a4=function(e){var t=e.sideCar,n=s4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,wi({},n))};a4.isSideCarExport=!0;function TZ(e,t){return e.useMedium(t),a4}var l4=OZ(),b_=function(){},Zg=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:b_,onWheelCapture:b_,onTouchMoveCapture:b_}),o=r[0],s=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,_=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,T=e.gapMode,R=s4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=EZ([n,t]),I=wi(wi({},R),o);return M.createElement(M.Fragment,null,p&&M.createElement(O,{sideCar:l4,removeScrollBar:f,shards:h,noRelative:v,noIsolation:_,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:T}),l?M.cloneElement(M.Children.only(c),wi(wi({},I),{ref:A})):M.createElement(E,wi({},I,{className:d,ref:A}),c))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:wm,zeroRight:bm};var CZ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=CZ();return t&&e.setAttribute("nonce",t),e}function IZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PZ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AZ())&&(IZ(t,n),MZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},NZ=function(){var e=PZ();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c4=function(){var e=NZ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},kZ={left:0,top:0,right:0,gap:0},w_=function(e){return parseInt(e||"",10)||0},DZ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[w_(n),w_(r),w_(o)]},LZ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kZ;var t=DZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$Z=c4(),$c="data-scroll-locked",jZ=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
`}),C.jsx(BG,{}),e]})}function BG(){const{executeRecaptcha:e}=MN(),{theme:t}=Qw(),{lang:n}=NN();return M.useEffect(()=>{if(!e)return;(async()=>{const o=document.querySelector("iframe[title='reCAPTCHA']");if(o){const s=new URL(o.src);s.searchParams.set("theme",t),n&&s.searchParams.set("hl",n),o.src=s.toString()}})()},[e,t,n]),null}function VG({slug:e}={}){const{organization:t,hooks:{useActiveOrganization:n,useListOrganizations:r}}=M.useContext(pt),{pathMode:o,slug:s}=t||{};let l,c,d,f;const{data:p,isPending:h,isRefetching:g}=r();if(o==="slug"){const v=e||s;l=p?.find(_=>_.slug===v),c=h,d=g}else{const{data:v,isPending:_,isRefetching:b,refetch:x}=n();f=x,l=v,c=_,d=b}return M.useMemo(()=>({data:l,isPending:c,isRefetching:d,refetch:f}),[l,c,d,f])}var qG=()=>{const{hooks:{useListOrganizations:e,useSession:t},organization:n,navigate:r,redirectTo:o}=M.useContext(pt),{slug:s,pathMode:l,personalPath:c}=n||{},{data:d}=t(),{data:f,isPending:p,isRefetching:h,refetch:g}=VG(),{refetch:v}=e(),{data:_}=e();return M.useEffect(()=>{d?.user.id&&(f||_)&&(g?.(),v?.())},[d?.user.id]),M.useEffect(()=>{h||p||s&&l==="slug"&&!f&&r(c||o)},[f,h,p,s,l,c,r,o]),null},HG=({href:e,className:t,children:n})=>C.jsx("a",{className:t,href:e,children:n}),GG=e=>{window.location.href=e},KG=e=>{window.location.replace(e)},ZG=({variant:e="default",message:t})=>{e==="default"?WT(t):WT[e](t)},pt=M.createContext({}),YG=({children:e,authClient:t,account:n,avatar:r,deleteUser:o,social:s,genericOAuth:l,basePath:c="/auth",baseURL:d="",captcha:f,redirectTo:p="/",credentials:h,changeEmail:g=!0,freshAge:v=3600*24,hooks:_,mutators:b,localization:x,localizeErrors:S=!0,nameRequired:E=!0,organization:T,teams:R,signUp:O=!0,toast:A=ZG,viewPaths:I,navigate:P,replace:L,Link:q=HG,emailVerification:j,...B})=>{const F=t,Z=M.useMemo(()=>{if(r)return r===!0?{extension:"png",size:128}:{upload:r.upload,delete:r.delete,extension:r.extension||"png",size:r.size||(r.upload?256:128),Image:r.Image}},[r]),ie=M.useMemo(()=>{if(j)return j===!0?{otp:!1}:{otp:j.otp??!1}},[j]),H=M.useMemo(()=>{var Y;return n===!1?void 0:n===!0||n===void 0?{basePath:"/account",fields:["image","name"],viewPaths:ZT}:{basePath:((Y=n.basePath)!=null&&Y.endsWith("/")?n.basePath.slice(0,-1):n.basePath)??"/account",fields:n.fields||["image","name"],viewPaths:{...ZT,...n.viewPaths}}},[n]),W=M.useMemo(()=>{if(o)return o===!0?{}:o},[o]),te=M.useMemo(()=>{if(s)return s},[s]),le=M.useMemo(()=>{if(l)return l},[l]),Q=M.useMemo(()=>{if(h!==!1)return h===!0?{forgotPassword:!0,usernameRequired:!0}:{...h,forgotPassword:h?.forgotPassword??!0,usernameRequired:h?.usernameRequired??!0}},[h]),k=M.useMemo(()=>{if(O!==!1)return O===!0||O===void 0?{fields:["name"]}:{fields:O.fields||["name"]}},[O]),G=M.useMemo(()=>{var Y;if(!T)return;if(T===!0)return{basePath:"/organization",viewPaths:YT,customRoles:[]};let re;T.logo===!0?re={extension:"png",size:128}:T.logo&&(re={upload:T.logo.upload,delete:T.logo.delete,extension:T.logo.extension||"png",size:T.logo.size||(T.logo.upload?256:128)});const ve=(Y=T.basePath)!=null&&Y.endsWith("/")?T.basePath.slice(0,-1):T.basePath;return{...T,logo:re,basePath:ve??"/organization",customRoles:T.customRoles||[],viewPaths:{...YT,...T.viewPaths}}},[T]),V=M.useMemo(()=>{var Y,re;if(!(!R||!G))return R===!0?{enabled:!0,customRoles:[],colors:{count:5,prefix:"team"}}:{enabled:R.enabled??!0,customRoles:R.customRoles||[],colors:{count:((Y=R.colors)==null?void 0:Y.count)??5,prefix:((re=R.colors)==null?void 0:re.prefix)??"team"}}},[R,G]),D=M.useMemo(()=>({deleteApiKey:Y=>F.apiKey.delete({...Y,fetchOptions:{throw:!0}}),deletePasskey:Y=>F.passkey.deletePasskey({...Y,fetchOptions:{throw:!0}}),revokeDeviceSession:Y=>F.multiSession.revoke({...Y,fetchOptions:{throw:!0}}),revokeSession:Y=>F.revokeSession({...Y,fetchOptions:{throw:!0}}),setActiveSession:Y=>F.multiSession.setActive({...Y,fetchOptions:{throw:!0}}),updateOrganization:Y=>F.organization.update({...Y,fetchOptions:{throw:!0}}),updateTeam:Y=>F.$fetch("/organization/update-team",{method:"POST",body:Y,throw:!0}),updateUser:Y=>F.updateUser({...Y,fetchOptions:{throw:!0}}),unlinkAccount:Y=>F.unlinkAccount({...Y,fetchOptions:{throw:!0}})}),[F]),U=M.useMemo(()=>({useSession:F.useSession,useListAccounts:()=>ao({queryFn:F.listAccounts,cacheKey:"listAccounts"}),useAccountInfo:Y=>ao({queryFn:()=>F.accountInfo(Y),cacheKey:`accountInfo:${JSON.stringify(Y)}`}),useListDeviceSessions:()=>ao({queryFn:F.multiSession.listDeviceSessions,cacheKey:"listDeviceSessions"}),useListSessions:()=>ao({queryFn:F.listSessions,cacheKey:"listSessions"}),useListPasskeys:F.useListPasskeys,useListApiKeys:()=>ao({queryFn:F.apiKey.list,cacheKey:"listApiKeys"}),useActiveOrganization:F.useActiveOrganization,useListOrganizations:F.useListOrganizations,useHasPermission:Y=>ao({queryFn:()=>F.$fetch("/organization/has-permission",{method:"POST",body:Y}),cacheKey:`hasPermission:${JSON.stringify(Y)}`}),useInvitation:Y=>ao({queryFn:()=>F.organization.getInvitation(Y),cacheKey:`invitation:${JSON.stringify(Y)}`}),useListInvitations:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-invitations?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listInvitations:${JSON.stringify(Y)}`}),useListUserInvitations:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-invitations"),cacheKey:"listUserInvitations"}),useListMembers:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-members?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listMembers:${JSON.stringify(Y)}`}),useListTeams:Y=>ao({queryFn:()=>F.$fetch(`/organization/list-teams?organizationId=${Y?.organizationId||""}`),cacheKey:`listTeams:${JSON.stringify(Y)}`}),useListTeamMembers:Y=>ao({queryFn:()=>F.$fetch("/organization/list-team-members",{method:"POST",body:Y?.teamId?{query:{teamId:Y.teamId}}:void 0}),cacheKey:`listTeamMembers:${JSON.stringify(Y)}`}),useListUserTeams:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-teams"),cacheKey:"listUserTeams"})}),[F]),X=M.useMemo(()=>({...XH,...I}),[I]),fe=M.useMemo(()=>({...QH,...x}),[x]),pe=M.useMemo(()=>({...U,..._}),[U,_]),xe=M.useMemo(()=>({...D,...b}),[D,b]);d=d.endsWith("/")?d.slice(0,-1):d,c=c.endsWith("/")?c.slice(0,-1):c;const{data:je}=pe.useSession();return C.jsxs(pt.Provider,{value:{authClient:F,avatar:Z,basePath:c==="/"?"":c,baseURL:d,captcha:f,redirectTo:p,changeEmail:g,credentials:Q,deleteUser:W,emailVerification:ie,freshAge:v,genericOAuth:le,hooks:pe,mutators:xe,localization:fe,localizeErrors:S,nameRequired:E,organization:G,teams:V,account:H,signUp:k,social:te,toast:A,navigate:P||GG,replace:L||P||KG,viewPaths:X,Link:q,...B},children:[je&&G&&C.jsx(qG,{}),f?.provider==="google-recaptcha-v3"?C.jsx(FG,{children:e}):e]})};function ao({queryFn:e,cacheKey:t,staleTime:n=1e4}){var r;const{hooks:{useSession:o},toast:s,localization:l,localizeErrors:c}=M.useContext(pt),{data:d,isPending:f}=o(),p=M.useRef(e);p.current=e;const h=t||e.toString(),g=M.useSyncExternalStore(M.useCallback(T=>No.subscribe(h,T),[h]),M.useCallback(()=>No.get(h),[h]),M.useCallback(()=>No.get(h),[h])),v=M.useRef(!1),_=M.useRef(void 0),[b,x]=M.useState(null),S=M.useCallback(async()=>{const T=No.getInFlightRequest(h);if(T){try{const O=await T;O.error?x(O.error):x(null)}catch(O){x(O)}return}g?.data!==void 0&&No.setRefetching(h,!0);const R=p.current();No.setInFlightRequest(h,R);try{const{data:O,error:A}=await R;A?(x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})):x(null),No.set(h,O)}catch(O){const A=O;x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})}finally{No.setRefetching(h,!1),No.removeInFlightRequest(h)}},[h,s,l,c,g]);M.useEffect(()=>{var T;const R=(T=d?.user)==null?void 0:T.id;if(!d){No.setRefetching(h,!1),No.clear(h),v.current=!1,_.current=void 0;return}const O=_.current!==void 0&&_.current!==R;O&&No.clear(h);const A=g?.data!==void 0,I=!g||Date.now()-g.timestamp>n;(!v.current||!A||O||A&&I)&&(!A||I)&&(v.current=!0,S()),_.current=R},[d,(r=d?.user)==null?void 0:r.id,h,S,g,n]);const E=f||g?.data===void 0&&!b;return{data:g?.data??null,isPending:E,isRefetching:g?.isRefetching??!1,error:b,refetch:S}}const WG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var QG={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const XG=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},d)=>M.createElement("svg",{ref:d,...QG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kN("lucide",o),...c},[...l.map(([f,p])=>M.createElement(f,p)),...Array.isArray(s)?s:[s]]));const Ir=(e,t)=>{const n=M.forwardRef(({className:r,...o},s)=>M.createElement(XG,{ref:s,iconNode:t,className:kN(`lucide-${WG(e)}`,r),...o}));return n.displayName=`${e}`,n};const JG=Ir("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const eK=Ir("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);const DN=Ir("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const tK=Ir("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const nK=Ir("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const rK=Ir("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const oK=Ir("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);const Ar=Ir("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const LN=Ir("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const $N=Ir("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const iK=Ir("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const sK=Ir("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);const tC=Ir("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const aK=Ir("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const lK=Ir("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const cK=Ir("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var pf=e=>e.type==="checkbox",nl=e=>e instanceof Date,jr=e=>e==null;const jN=e=>typeof e=="object";var Nn=e=>!jr(e)&&!Array.isArray(e)&&jN(e)&&!nl(e),zN=e=>Nn(e)&&e.target?pf(e.target)?e.target.checked:e.target.value:e,UN=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),uK=e=>{const t=e.constructor&&e.constructor.prototype;return Nn(t)&&t.hasOwnProperty("isPrototypeOf")},Xw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function nn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Xw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Nn(e)&&uK(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=nn(e[o]));return r}var qg=e=>/^\w*$/.test(e),tn=e=>e===void 0,Hg=e=>Array.isArray(e)?e.filter(Boolean):[],Jw=e=>Hg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Nn(e))return n;const o=(qg(t)?[t]:Jw(t)).reduce((s,l)=>jr(s)?void 0:s[l],e);return tn(o)||o===e?tn(e[t])?n:e[t]:o},fo=e=>typeof e=="boolean",Or=e=>typeof e=="function",zt=(e,t,n)=>{let r=-1;const o=qg(t)?[t]:Jw(t),s=o.length,l=s-1;for(;++r<s;){const c=o[r];let d=n;if(r!==l){const f=e[c];d=Nn(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const ea={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},jo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},s_="form",FN="root",eS=ee.createContext(null);eS.displayName="HookFormControlContext";const Gg=()=>ee.useContext(eS);var BN=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const l=s;return t._proxyFormState[l]!==jo.all&&(t._proxyFormState[l]=!r||jo.all),n&&(n[l]=!0),e[l]}});return o};const Kg=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function VN(e){const t=Gg(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[l,c]=ee.useState(n._formState),d=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Kg(()=>n._subscribe({name:o,formState:d.current,exact:s,callback:f=>{!r&&c({...n._formState,...f})}}),[o,r,s]),ee.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ee.useMemo(()=>BN(l,n,d.current,!1),[l,n])}var Tr=e=>typeof e=="string",Yb=(e,t,n,r,o)=>Tr(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),De(n,s))):(r&&(t.watchAll=!0),n),Wb=e=>jr(e)||!jN(e);function ho(e,t,n=new WeakSet){if(e===t)return!0;if(Wb(e)||Wb(t))return Object.is(e,t);if(nl(e)&&nl(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const l=e[s];if(!(s in t))return!1;if(s!=="ref"){const c=t[s];if(nl(l)&&nl(c)||(Nn(l)||Array.isArray(l))&&(Nn(c)||Array.isArray(c))?!ho(l,c,n):!Object.is(l,c))return!1}}return!0}function dK(e){const t=Gg(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:l,compute:c}=e||{},d=ee.useRef(o),f=ee.useRef(c),p=ee.useRef(void 0),h=ee.useRef(n),g=ee.useRef(r);f.current=c;const[v,_]=ee.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),b=ee.useCallback(R=>{const O=Yb(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(O):O},[n._formValues,n._names,r]),x=ee.useCallback(R=>{if(!s){const O=Yb(r,n._names,R||n._formValues,!1,d.current);if(f.current){const A=f.current(O);ho(A,p.current)||(_(A),p.current=A)}else _(O)}},[n._formValues,n._names,s,r]);Kg(()=>((h.current!==n||!ho(g.current,r))&&(h.current=n,g.current=r,x()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:R=>{x(R.values)}})),[n,l,r,x]),ee.useEffect(()=>n._removeUnmounted());const S=h.current!==n,E=g.current,T=ee.useMemo(()=>{if(s)return null;const R=!S&&!ho(E,r);return S||R?b():null},[s,S,r,E,b]);return T!==null?T:v}function fK(e){const t=Gg(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:l,exact:c=!0}=e,d=UN(o._names.array,n),f=ee.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,l)),[o,n,l]),p=dK({control:o,name:n,defaultValue:f,exact:c}),h=VN({control:o,name:n,exact:c}),g=ee.useRef(e),v=ee.useRef(o.register(n,{...e.rules,value:p,...fo(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const _=ee.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(h.validatingFields,n)},error:{enumerable:!0,get:()=>De(h.errors,n)}}),[h,n]),b=ee.useCallback(T=>v.current.onChange({target:{value:zN(T),name:n},type:ea.CHANGE}),[n]),x=ee.useCallback(()=>v.current.onBlur({target:{value:De(o._formValues,n),name:n},type:ea.BLUR}),[n,o._formValues]),S=ee.useCallback(T=>{const R=De(o._fields,n);R&&R._f&&T&&(R._f.ref={focus:()=>Or(T.focus)&&T.focus(),select:()=>Or(T.select)&&T.select(),setCustomValidity:O=>Or(T.setCustomValidity)&&T.setCustomValidity(O),reportValidity:()=>Or(T.reportValidity)&&T.reportValidity()})},[o._fields,n]),E=ee.useMemo(()=>({name:n,value:p,...fo(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:b,onBlur:x,ref:S}),[n,r,h.disabled,b,x,S,p]);return ee.useEffect(()=>{const T=o._options.shouldUnregister||s;o.register(n,{...g.current.rules,...fo(g.current.disabled)?{disabled:g.current.disabled}:{}});const R=(O,A)=>{const I=De(o._fields,O);I&&I._f&&(I._f.mount=A)};if(R(n,!0),T){const O=nn(De(o._options.defaultValues,n,g.current.defaultValue));zt(o._defaultValues,n,O),tn(De(o._formValues,n))&&zt(o._formValues,n,O)}return!d&&o.register(n),()=>{(d?T&&!o._state.action:T)?o.unregister(n):R(n,!1)}},[n,o,d,s]),ee.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ee.useMemo(()=>({field:E,formState:h,fieldState:_}),[E,h,_])}const hK=e=>e.render(fK(e)),tS=ee.createContext(null);tS.displayName="HookFormContext";const pK=()=>ee.useContext(tS),mK=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}=e,E=ee.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}),[l,_,f,o,r,g,b,h,p,s,x,c,S,d,v,n]);return ee.createElement(tS.Provider,{value:E},ee.createElement(eS.Provider,{value:E.control},t))};var nS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Xr=e=>Array.isArray(e)?e:[e],nC=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function qN(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Nn(o)&&s){const l=qN(o,s);Nn(l)&&(n[r]=l)}else e[r]&&(n[r]=s)}return n}var hr=e=>Nn(e)&&!Object.keys(e).length,rS=e=>e.type==="file",Gm=e=>{if(!Xw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},HN=e=>e.type==="select-multiple",oS=e=>e.type==="radio",gK=e=>oS(e)||pf(e),a_=e=>Gm(e)&&e.isConnected;function vK(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;){if(jr(e)){e=void 0;break}e=e[t[r]],r++}return e}function yK(e){for(const t in e)if(e.hasOwnProperty(t)&&!tn(e[t]))return!1;return!0}function Cn(e,t){if(Tr(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:qg(t)?[t]:Jw(t),r=n.length===1?e:vK(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Nn(r)&&hr(r)||Array.isArray(r)&&yK(r))&&Cn(e,n.slice(0,-1)),e}var _K=e=>{for(const t in e)if(Or(e[t]))return!0;return!1};function GN(e){return Array.isArray(e)||Nn(e)&&!_K(e)}function Qb(e,t={}){for(const n in e){const r=e[n];GN(r)?(t[n]=Array.isArray(r)?[]:{},Qb(r,t[n])):tn(r)||(t[n]=!0)}return t}function xd(e,t,n){n||(n=Qb(t));for(const r in e){const o=e[r];if(GN(o))tn(t)||Wb(n[r])?n[r]=Qb(o,Array.isArray(o)?[]:{}):xd(o,jr(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!ho(o,s)}}return n}const rC={value:!1,isValid:!1},oC={value:!0,isValid:!0};var KN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?oC:{value:e[0].value,isValid:!0}:oC:rC}return rC},ZN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>tn(e)?e:t?e===""?NaN:e&&+e:n&&Tr(e)?new Date(e):r?r(e):e;const iC={isValid:!1,value:null};var YN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,iC):iC;function sC(e){const t=e.ref;return rS(t)?t.files:oS(t)?YN(e.refs).value:HN(t)?[...t.selectedOptions].map(({value:n})=>n):pf(t)?KN(e.refs).value:ZN(tn(t.value)?e.ref.value:t.value,e)}var bK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wK=(e,t,n,r)=>{const o={};for(const s of e){const l=De(t,s);l&&zt(o,s,l._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Km=e=>e instanceof RegExp,id=e=>tn(e)?e:Km(e)?e.source:Nn(e)?Km(e.value)?e.value.source:e.value:e,Ac=e=>({isOnSubmit:!e||e===jo.onSubmit,isOnBlur:e===jo.onBlur,isOnChange:e===jo.onChange,isOnAll:e===jo.all,isOnTouch:e===jo.onTouched});const aC="AsyncFunction";var SK=e=>!!e&&!!e.validate&&!!(Or(e.validate)&&e.validate.constructor.name===aC||Nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aC)),EK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Xb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Lc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=De(e,o);if(s){const{_f:l,...c}=s;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],o)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Lc(c,t))break}else if(Nn(c)&&Lc(c,t))break}}};function lC(e,t,n){const r=De(e,n);if(r||qg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),l=De(t,s),c=De(e,s);if(l&&!Array.isArray(l)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var xK=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return hr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!r||jo.all))},RK=(e,t,n)=>!e||!t||e===t||Xr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),OK=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,TK=(e,t)=>!Hg(De(e,t)).length&&Cn(e,t),WN=(e,t,n)=>{const r=Xr(De(e,n));return zt(r,FN,t[n]),zt(e,n,r),e};function cC(e,t,n="validate"){if(Tr(e)||Array.isArray(e)&&e.every(Tr)||fo(e)&&!e)return{type:n,message:Tr(e)?e:"",ref:t}}var sc=e=>Nn(e)&&!Km(e)?e:{value:e,message:""},Jb=async(e,t,n,r,o,s)=>{const{ref:l,refs:c,required:d,maxLength:f,minLength:p,min:h,max:g,pattern:v,validate:_,name:b,valueAsNumber:x,mount:S}=e._f,E=De(n,b);if(!S||t.has(b))return{};const T=c?c[0]:l,R=B=>{o&&T.reportValidity&&(T.setCustomValidity(fo(B)?"":B||""),T.reportValidity())},O={},A=oS(l),I=pf(l),P=A||I,L=(x||rS(l))&&tn(l.value)&&tn(E)||Gm(l)&&l.value===""||E===""||Array.isArray(E)&&!E.length||x&&typeof E=="number"&&isNaN(E),q=nS.bind(null,b,r,O),j=(B,F,Z,ie=Jo.maxLength,H=Jo.minLength)=>{const W=B?F:Z;O[b]={type:B?ie:H,message:W,ref:l,...q(B?ie:H,W)}};if(s?!Array.isArray(E)||!E.length:d&&(!P&&(L||jr(E))||fo(E)&&!E||I&&!KN(c).isValid||A&&!YN(c).isValid)){const{value:B,message:F}=Tr(d)?{value:!!d,message:d}:sc(d);if(B&&(O[b]={type:Jo.required,message:F,ref:T,...q(Jo.required,F)},!r))return R(F),O}if(!L&&(!jr(h)||!jr(g))){let B,F;const Z=sc(g),ie=sc(h);if(!jr(E)&&!isNaN(E)){const H=l.valueAsNumber||E&&+E;jr(Z.value)||(B=H>Z.value),jr(ie.value)||(F=H<ie.value)}else{const H=l.valueAsDate||new Date(E),W=Q=>new Date(new Date().toDateString()+" "+Q),te=l.type=="time",le=l.type=="week";Tr(Z.value)&&E&&(B=te?W(E)>W(Z.value):le?E>Z.value:H>new Date(Z.value)),Tr(ie.value)&&E&&(F=te?W(E)<W(ie.value):le?E<ie.value:H<new Date(ie.value))}if((B||F)&&(j(!!B,Z.message,ie.message,Jo.max,Jo.min),!r))return R(O[b].message),O}if((f||p)&&!L&&(Tr(E)||s&&Array.isArray(E))){const B=sc(f),F=sc(p),Z=!jr(B.value)&&E.length>+B.value,ie=!jr(F.value)&&E.length<+F.value;if((Z||ie)&&(j(Z,B.message,F.message),!r))return R(O[b].message),O}if(v&&!L&&Tr(E)){const{value:B,message:F}=sc(v);if(Km(B)&&!E.match(B)&&(O[b]={type:Jo.pattern,message:F,ref:l,...q(Jo.pattern,F)},!r))return R(F),O}if(_){if(Or(_)){const B=await _(E,n),F=cC(B,T);if(F&&(O[b]={...F,...q(Jo.validate,F.message)},!r))return R(F.message),O}else if(Nn(_)){let B={};for(const F in _){if(!hr(B)&&!r)break;const Z=cC(await _[F](E,n),T,F);Z&&(B={...Z,...q(F,Z.message)},R(Z.message),r&&(O[b]=B))}if(!hr(B)&&(O[b]={ref:T,...B},!r))return O}}return R(!0),O};const CK={mode:jo.onSubmit,reValidateMode:jo.onChange,shouldFocusError:!0};function AK(e={}){let t={...CK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Or(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Nn(t.defaultValues)||Nn(t.values)?nn(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:nn(o),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...p};let g={...h};const v={array:nC(),state:nC()},_=t.criteriaMode===jo.all,b=K=>ne=>{clearTimeout(f),f=setTimeout(K,ne)},x=async K=>{if(!l.keepIsValid&&!t.disabled&&(h.isValid||g.isValid||K)){let ne;t.resolver?(ne=hr((await L()).errors),S()):ne=await B({fields:r,onlyCheckValid:!0,eventType:ea.VALID}),ne!==n.isValid&&v.state.next({isValid:ne})}},S=(K,ne)=>{!t.disabled&&(h.isValidating||h.validatingFields||g.isValidating||g.validatingFields)&&((K||Array.from(c.mount)).forEach(ae=>{ae&&(ne?zt(n.validatingFields,ae,ne):Cn(n.validatingFields,ae))}),v.state.next({validatingFields:n.validatingFields,isValidating:!hr(n.validatingFields)}))},E=K=>{const ne=xd(o,s),ae=bK(K);zt(n.dirtyFields,ae,De(ne,ae))},T=(K,ne=[],ae,Oe,Ae=!0,Ie=!0)=>{if(Oe&&ae&&!t.disabled){if(l.action=!0,Ie&&Array.isArray(De(r,K))){const ke=ae(De(r,K),Oe.argA,Oe.argB);Ae&&zt(r,K,ke)}if(Ie&&Array.isArray(De(n.errors,K))){const ke=ae(De(n.errors,K),Oe.argA,Oe.argB);Ae&&zt(n.errors,K,ke),TK(n.errors,K)}if((h.touchedFields||g.touchedFields)&&Ie&&Array.isArray(De(n.touchedFields,K))){const ke=ae(De(n.touchedFields,K),Oe.argA,Oe.argB);Ae&&zt(n.touchedFields,K,ke)}(h.dirtyFields||g.dirtyFields)&&E(K),v.state.next({name:K,isDirty:Z(K,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(s,K,ne)},R=(K,ne)=>{zt(n.errors,K,ne),v.state.next({errors:n.errors})},O=K=>{n.errors=K,v.state.next({errors:n.errors,isValid:!1})},A=(K,ne,ae,Oe)=>{const Ae=De(r,K);if(Ae){const Ie=De(s,K,tn(ae)?De(o,K):ae);tn(Ie)||Oe&&Oe.defaultChecked||ne?zt(s,K,ne?Ie:sC(Ae._f)):W(K,Ie),l.mount&&!l.action&&x()}},I=(K,ne,ae,Oe,Ae)=>{let Ie=!1,ke=!1;const Je={name:K};if(!t.disabled){if(!ae||Oe){(h.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=Je.isDirty=Z(),Ie=ke!==Je.isDirty);const et=ho(De(o,K),ne);ke=!!De(n.dirtyFields,K),et?Cn(n.dirtyFields,K):zt(n.dirtyFields,K,!0),Je.dirtyFields=n.dirtyFields,Ie=Ie||(h.dirtyFields||g.dirtyFields)&&ke!==!et}if(ae){const et=De(n.touchedFields,K);et||(zt(n.touchedFields,K,ae),Je.touchedFields=n.touchedFields,Ie=Ie||(h.touchedFields||g.touchedFields)&&et!==ae)}Ie&&Ae&&v.state.next(Je)}return Ie?Je:{}},P=(K,ne,ae,Oe)=>{const Ae=De(n.errors,K),Ie=(h.isValid||g.isValid)&&fo(ne)&&n.isValid!==ne;if(t.delayError&&ae?(d=b(()=>R(K,ae)),d(t.delayError)):(clearTimeout(f),d=null,ae?zt(n.errors,K,ae):Cn(n.errors,K)),(ae?!ho(Ae,ae):Ae)||!hr(Oe)||Ie){const ke={...Oe,...Ie&&fo(ne)?{isValid:ne}:{},errors:n.errors,name:K};n={...n,...ke},v.state.next(ke)}},L=async K=>(S(K,!0),await t.resolver(s,t.context,wK(K||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),q=async K=>{const{errors:ne}=await L(K);if(S(K),K)for(const ae of K){const Oe=De(ne,ae);Oe?zt(n.errors,ae,Oe):Cn(n.errors,ae)}else n.errors=ne;return ne},j=async({name:K,eventType:ne})=>{if(e.validate){const ae=await e.validate({formValues:s,formState:n,name:K,eventType:ne});if(Nn(ae))for(const Oe in ae)ae[Oe]&&fe(`${s_}.${Oe}`,{message:Tr(ae.message)?ae.message:"",type:Jo.validate});else Tr(ae)||!ae?fe(s_,{message:ae||"",type:Jo.validate}):X(s_);return ae}return!0},B=async({fields:K,onlyCheckValid:ne,name:ae,eventType:Oe,context:Ae={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ae.runRootValidation=!0,!await j({name:ae,eventType:Oe})&&(Ae.valid=!1,ne)))return Ae.valid;for(const Ie in K){const ke=K[Ie];if(ke){const{_f:Je,...et}=ke;if(Je){const vt=c.array.has(Je.name),Tt=ke._f&&SK(ke._f);Tt&&h.validatingFields&&S([Je.name],!0);const yt=await Jb(ke,c.disabled,s,_,t.shouldUseNativeValidation&&!ne,vt);if(Tt&&h.validatingFields&&S([Je.name]),yt[Je.name]&&(Ae.valid=!1,ne)||(!ne&&(De(yt,Je.name)?vt?WN(n.errors,yt,Je.name):zt(n.errors,Je.name,yt[Je.name]):Cn(n.errors,Je.name)),e.shouldUseNativeValidation&&yt[Je.name]))break}!hr(et)&&await B({context:Ae,onlyCheckValid:ne,fields:et,name:Ie,eventType:Oe})}}return Ae.valid},F=()=>{for(const K of c.unMount){const ne=De(r,K);ne&&(ne._f.refs?ne._f.refs.every(ae=>!a_(ae)):!a_(ne._f.ref))&&Y(K)}c.unMount=new Set},Z=(K,ne)=>!t.disabled&&(K&&ne&&zt(s,K,ne),!ho(D(),o)),ie=(K,ne,ae)=>Yb(K,c,{...l.mount?s:tn(ne)?o:Tr(K)?{[K]:ne}:ne},ae,ne),H=K=>Hg(De(l.mount?s:o,K,t.shouldUnregister?De(o,K,[]):[])),W=(K,ne,ae={})=>{const Oe=De(r,K);let Ae=ne;if(Oe){const Ie=Oe._f;Ie&&(!Ie.disabled&&zt(s,K,ZN(ne,Ie)),Ae=Gm(Ie.ref)&&jr(ne)?"":ne,HN(Ie.ref)?[...Ie.ref.options].forEach(ke=>ke.selected=Ae.includes(ke.value)):Ie.refs?pf(Ie.ref)?Ie.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Ae)?ke.checked=!!Ae.find(Je=>Je===ke.value):ke.checked=Ae===ke.value||!!Ae)}):Ie.refs.forEach(ke=>ke.checked=ke.value===Ae):rS(Ie.ref)?Ie.ref.value="":(Ie.ref.value=Ae,Ie.ref.type||v.state.next({name:K,values:nn(s)})))}(ae.shouldDirty||ae.shouldTouch)&&I(K,Ae,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&V(K)},te=(K,ne,ae)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const Ae=ne[Oe],Ie=K+"."+Oe,ke=De(r,Ie);(c.array.has(K)||Nn(Ae)||ke&&!ke._f)&&!nl(Ae)?te(Ie,Ae,ae):W(Ie,Ae,ae)}},le=(K,ne,ae={})=>{const Oe=De(r,K),Ae=c.array.has(K),Ie=nn(ne),ke=De(s,K),Je=ho(ke,Ie);if(zt(s,K,Ie),Ae)v.array.next({name:K,values:nn(s)}),ae.shouldDirty&&(E(K),v.state.next({name:K,dirtyFields:n.dirtyFields,isDirty:Z(K,Ie)}));else{const et=Array.isArray(Ie)&&!Ie.length||hr(Ie);!Oe||Oe._f||jr(Ie)||et?W(K,Ie,ae):te(K,Ie,ae)}Je||(Xb(K,c)?v.state.next({...n,name:K,values:nn(s)}):v.state.next({name:l.mount?K:void 0,values:nn(s)}))},Q=K=>{const ne=Or(K)?K(s):K;ho(s,ne)||(s={...s,...ne},v.state.next({...n,values:s}))},k=async K=>{l.mount=!0;const ne=K.target;let ae=ne.name,Oe=!0;const Ae=De(r,ae),Ie=et=>{Oe=Number.isNaN(et)||nl(et)&&isNaN(et.getTime())||ho(et,De(s,ae,et))},ke=Ac(t.mode),Je=Ac(t.reValidateMode);if(Ae){let et,vt;const Tt=ne.type?sC(Ae._f):zN(K),yt=K.type===ea.BLUR||K.type===ea.FOCUS_OUT,Ln=!EK(Ae._f)&&!e.validate&&!t.resolver&&!De(n.errors,ae)&&!Ae._f.deps||OK(yt,De(n.touchedFields,ae),n.isSubmitted,Je,ke),Ni=Xb(ae,c,yt);zt(s,ae,Tt),yt?(!ne||!ne.readOnly)&&(Ae._f.onBlur&&Ae._f.onBlur(K),d&&d(0)):Ae._f.onChange&&Ae._f.onChange(K);const Ho=I(ae,Tt,yt),Ye=!hr(Ho)||Ni;if(!yt&&v.state.next({name:ae,type:K.type,values:nn(s)}),Ln)return(h.isValid||g.isValid)&&(t.mode==="onBlur"?yt&&x():yt||x()),Ye&&v.state.next({name:ae,...Ni?{}:Ho});if(!t.resolver&&e.validate&&await j({name:ae,eventType:K.type}),!yt&&Ni&&v.state.next({...n}),t.resolver){const{errors:dt}=await L([ae]);if(S([ae]),Ie(Tt),Oe){const Ct=lC(n.errors,r,ae),it=lC(dt,r,Ct.name||ae);et=it.error,ae=it.name,vt=hr(dt)}}else S([ae],!0),et=(await Jb(Ae,c.disabled,s,_,t.shouldUseNativeValidation))[ae],S([ae]),Ie(Tt),Oe&&(et?vt=!1:(h.isValid||g.isValid)&&(vt=await B({fields:r,onlyCheckValid:!0,name:ae,eventType:K.type})));Oe&&(Ae._f.deps&&(!Array.isArray(Ae._f.deps)||Ae._f.deps.length>0)&&V(Ae._f.deps),P(ae,vt,et,Ho))}},G=(K,ne)=>{if(De(n.errors,ne)&&K.focus)return K.focus(),1},V=async(K,ne={})=>{let ae,Oe;const Ae=Xr(K);if(t.resolver){const Ie=await q(tn(K)?K:Ae);ae=hr(Ie),Oe=K?!Ae.some(ke=>De(Ie,ke)):ae}else K?(Oe=(await Promise.all(Ae.map(async Ie=>{const ke=De(r,Ie);return await B({fields:ke&&ke._f?{[Ie]:ke}:ke,eventType:ea.TRIGGER})}))).every(Boolean),!(!Oe&&!n.isValid)&&x()):Oe=ae=await B({fields:r,name:K,eventType:ea.TRIGGER});return v.state.next({...!Tr(K)||(h.isValid||g.isValid)&&ae!==n.isValid?{}:{name:K},...t.resolver||!K?{isValid:ae}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&Lc(r,G,K?Ae:c.mount),Oe},D=(K,ne)=>{let ae={...l.mount?s:o};return ne&&(ae=qN(ne.dirtyFields?n.dirtyFields:n.touchedFields,ae)),tn(K)?ae:Tr(K)?De(ae,K):K.map(Oe=>De(ae,Oe))},U=(K,ne)=>({invalid:!!De((ne||n).errors,K),isDirty:!!De((ne||n).dirtyFields,K),error:De((ne||n).errors,K),isValidating:!!De(n.validatingFields,K),isTouched:!!De((ne||n).touchedFields,K)}),X=K=>{const ne=K?Xr(K):void 0;ne?.forEach(ae=>Cn(n.errors,ae)),ne?ne.forEach(ae=>{v.state.next({name:ae,errors:n.errors})}):v.state.next({errors:{}})},fe=(K,ne,ae)=>{const Oe=(De(r,K,{_f:{}})._f||{}).ref,Ae=De(n.errors,K)||{},{ref:Ie,message:ke,type:Je,...et}=Ae;zt(n.errors,K,{...et,...ne,ref:Oe}),v.state.next({name:K,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},pe=(K,ne)=>Or(K)?v.state.subscribe({next:ae=>"values"in ae&&K(ae.values||ie(void 0,ne),ae)}):ie(K,ne,!0),xe=K=>v.state.subscribe({next:ne=>{if(RK(K.name,ne.name,K.exact)&&xK(ne,K.formState||h,Pe,K.reRenderRoot)){const ae={...s};K.callback({values:ae,...n,...ne,defaultValues:o})}}}).unsubscribe,je=K=>(l.mount=!0,g={...g,...K.formState},xe({...K,formState:{...p,...K.formState}})),Y=(K,ne={})=>{for(const ae of K?Xr(K):c.mount)c.mount.delete(ae),c.array.delete(ae),ne.keepValue||(Cn(r,ae),Cn(s,ae)),!ne.keepError&&Cn(n.errors,ae),!ne.keepDirty&&Cn(n.dirtyFields,ae),!ne.keepTouched&&Cn(n.touchedFields,ae),!ne.keepIsValidating&&Cn(n.validatingFields,ae),!t.shouldUnregister&&!ne.keepDefaultValue&&Cn(o,ae);v.state.next({values:nn(s)}),v.state.next({...n,...ne.keepDirty?{isDirty:Z()}:{}}),!ne.keepIsValid&&x()},re=({disabled:K,name:ne})=>{if(fo(K)&&l.mount||K||c.disabled.has(ne)){const Ae=c.disabled.has(ne)!==!!K;K?c.disabled.add(ne):c.disabled.delete(ne),Ae&&l.mount&&!l.action&&x()}},ve=(K,ne={})=>{let ae=De(r,K);const Oe=fo(ne.disabled)||fo(t.disabled),Ae=!c.registerName.has(K)&&ae&&ae._f&&!ae._f.mount;return zt(r,K,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:K}},name:K,mount:!0,...ne}}),c.mount.add(K),ae&&!Ae?re({disabled:fo(ne.disabled)?ne.disabled:t.disabled,name:K}):A(K,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:id(ne.min),max:id(ne.max),minLength:id(ne.minLength),maxLength:id(ne.maxLength),pattern:id(ne.pattern)}:{},name:K,onChange:k,onBlur:k,ref:Ie=>{if(Ie){c.registerName.add(K),ve(K,ne),c.registerName.delete(K),ae=De(r,K);const ke=tn(Ie.value)&&Ie.querySelectorAll&&Ie.querySelectorAll("input,select,textarea")[0]||Ie,Je=gK(ke),et=ae._f.refs||[];if(Je?et.find(vt=>vt===ke):ke===ae._f.ref)return;zt(r,K,{_f:{...ae._f,...Je?{refs:[...et.filter(a_),ke,...Array.isArray(De(o,K))?[{}]:[]],ref:{type:ke.type,name:K}}:{ref:ke}}}),A(K,!1,void 0,ke)}else ae=De(r,K,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(UN(c.array,K)&&l.action)&&c.unMount.add(K)}}},se=()=>t.shouldFocusError&&Lc(r,G,c.mount),Se=K=>{fo(K)&&(v.state.next({disabled:K}),Lc(r,(ne,ae)=>{const Oe=De(r,ae);Oe&&(ne.disabled=Oe._f.disabled||K,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(Ae=>{Ae.disabled=Oe._f.disabled||K}))},0,!1))},Te=(K,ne)=>async ae=>{let Oe;ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let Ae=nn(s);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ie,values:ke}=await L();S(),n.errors=Ie,Ae=nn(ke)}else await B({fields:r,eventType:ea.SUBMIT});if(c.disabled.size)for(const Ie of c.disabled)Cn(Ae,Ie);if(Cn(n.errors,FN),hr(n.errors)){v.state.next({errors:{}});try{await K(Ae,ae)}catch(Ie){Oe=Ie}}else ne&&await ne({...n.errors},ae),se(),setTimeout(se);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hr(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},tt=(K,ne={})=>{De(r,K)&&(tn(ne.defaultValue)?le(K,nn(De(o,K))):(le(K,ne.defaultValue),zt(o,K,nn(ne.defaultValue))),ne.keepTouched||Cn(n.touchedFields,K),ne.keepDirty||(Cn(n.dirtyFields,K),n.isDirty=ne.defaultValue?Z(K,nn(De(o,K))):Z()),ne.keepError||(Cn(n.errors,K),h.isValid&&x()),v.state.next({...n}))},rt=(K,ne={})=>{const ae=K?nn(K):o,Oe=nn(ae),Ae=hr(K),Ie=Ae?o:Oe;if(ne.keepDefaultValues||(o=ae),!ne.keepValues){if(ne.keepDirtyValues){const ke=new Set([...c.mount,...Object.keys(xd(o,s))]);for(const Je of Array.from(ke)){const et=De(n.dirtyFields,Je),vt=De(s,Je),Tt=De(Ie,Je);et&&!tn(vt)?zt(Ie,Je,vt):!et&&!tn(Tt)&&le(Je,Tt)}}else{if(Xw&&tn(K))for(const ke of c.mount){const Je=De(r,ke);if(Je&&Je._f){const et=Array.isArray(Je._f.refs)?Je._f.refs[0]:Je._f.ref;if(Gm(et)){const vt=et.closest("form");if(vt){vt.reset();break}}}}if(ne.keepFieldsRef)for(const ke of c.mount)le(ke,De(Ie,ke));else r={}}s=t.shouldUnregister?ne.keepDefaultValues?nn(o):{}:nn(Ie),v.array.next({values:{...Ie}}),v.state.next({values:{...Ie}})}c={mount:ne.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!hr(Ie),l.watch=!!t.shouldUnregister,l.keepIsValid=!!ne.keepIsValid,l.action=!1,ne.keepErrors||(n.errors={}),v.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ae?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ho(K,o)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ae?{}:ne.keepDirtyValues?ne.keepDefaultValues&&s?xd(o,s):n.dirtyFields:ne.keepDefaultValues&&K?xd(o,K):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Be=(K,ne)=>rt(Or(K)?K(s):K,{...t.resetOptions,...ne}),Qe=(K,ne={})=>{const ae=De(r,K),Oe=ae&&ae._f;if(Oe){const Ae=Oe.refs?Oe.refs[0]:Oe.ref;Ae.focus&&setTimeout(()=>{Ae.focus(),ne.shouldSelect&&Or(Ae.select)&&Ae.select()})}},Pe=K=>{n={...n,...K}},Ue={control:{register:ve,unregister:Y,getFieldState:U,handleSubmit:Te,setError:fe,_subscribe:xe,_runSchema:L,_updateIsValidating:S,_focusError:se,_getWatch:ie,_getDirty:Z,_setValid:x,_setFieldArray:T,_setDisabledField:re,_setErrors:O,_getFieldArray:H,_reset:rt,_resetDefaultValues:()=>Or(t.defaultValues)&&t.defaultValues().then(K=>{Be(K,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Se,_subjects:v,_proxyFormState:h,get _fields(){return r},get _formValues(){return s},get _state(){return l},set _state(K){l=K},get _defaultValues(){return o},get _names(){return c},set _names(K){c=K},get _formState(){return n},get _options(){return t},set _options(K){t={...t,...K}}},subscribe:je,trigger:V,register:ve,handleSubmit:Te,watch:pe,setValue:le,setValues:Q,getValues:D,reset:Be,resetField:tt,clearErrors:X,unregister:Y,setError:fe,setFocus:Qe,getFieldState:U};return{...Ue,formControl:Ue}}var Hs=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},l_=(e,t,n={})=>n.shouldFocus||tn(n.shouldFocus)?n.focusName||`${e}.${tn(n.focusIndex)?t:n.focusIndex}.`:"",c_=(e,t)=>[...e,...Xr(t)],u_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function d_(e,t,n){return[...e.slice(0,t),...Xr(n),...e.slice(t)]}var f_=(e,t,n)=>Array.isArray(e)?(tn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],h_=(e,t)=>[...Xr(t),...Xr(e)];function IK(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Hg(r).length?r:[]}var p_=(e,t)=>tn(t)?[]:IK(e,Xr(t).sort((n,r)=>n-r)),m_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},uC=(e,t,n)=>(e[t]=n,e);function Lce(e){const t=Gg(),{control:n=t,name:r,keyName:o="id",shouldUnregister:s,rules:l}=e,[c,d]=ee.useState(n._getFieldArray(r)),f=ee.useRef(n._getFieldArray(r).map(Hs)),p=ee.useRef(!1);n._names.array.add(r),ee.useMemo(()=>l&&c.length>=0&&n.register(r,l),[n,r,c.length,l]),Kg(()=>n._subjects.array.subscribe({next:({values:R,name:O})=>{if(O===r||!O){const A=De(R,r);Array.isArray(A)&&(d(A),f.current=A.map(Hs))}}}).unsubscribe,[n,r]);const h=ee.useCallback(R=>{p.current=!0,n._setFieldArray(r,R)},[n,r]),g=(R,O)=>{const A=Xr(nn(R)),I=c_(n._getFieldArray(r),A);n._names.focus=l_(r,I.length-1,O),f.current=c_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,c_,{argA:u_(R)})},v=(R,O)=>{const A=Xr(nn(R)),I=h_(n._getFieldArray(r),A);n._names.focus=l_(r,0,O),f.current=h_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,h_,{argA:u_(R)})},_=R=>{const O=p_(n._getFieldArray(r),R);f.current=p_(f.current,R),h(O),d(O),!Array.isArray(De(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,O,p_,{argA:R})},b=(R,O,A)=>{const I=Xr(nn(O)),P=d_(n._getFieldArray(r),R,I);n._names.focus=l_(r,R,A),f.current=d_(f.current,R,I.map(Hs)),h(P),d(P),n._setFieldArray(r,P,d_,{argA:R,argB:u_(O)})},x=(R,O)=>{const A=n._getFieldArray(r);m_(A,R,O),m_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,m_,{argA:R,argB:O},!1)},S=(R,O)=>{const A=n._getFieldArray(r);f_(A,R,O),f_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,f_,{argA:R,argB:O},!1)},E=(R,O)=>{const A=nn(O),I=uC(n._getFieldArray(r),R,A);f.current=[...I].map((P,L)=>!P||L===R?Hs():f.current[L]),h(I),d([...I]),n._setFieldArray(r,I,uC,{argA:R,argB:A},!0,!1)},T=R=>{const O=Xr(nn(R));f.current=O.map(Hs),h([...O]),d([...O]),n._setFieldArray(r,[...O],A=>A,{},!0,!1)};return ee.useEffect(()=>{n._state.action=!1,Xb(r,n._names)&&n._subjects.state.next({...n._formState});const R=Ac(n._options.mode);if(p.current&&(!R.isOnSubmit||n._formState.isSubmitted)&&!Ac(n._options.reValidateMode).isOnSubmit&&!R.isOnBlur)if(n._options.resolver)n._runSchema([r]).then(O=>{n._updateIsValidating([r]);const A=De(O.errors,r),I=De(n._formState.errors,r);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):Cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const O=De(n._fields,r);O&&O._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&Jb(O,n._names.disabled,n._formValues,n._options.criteriaMode===jo.all,n._options.shouldUseNativeValidation,!0).then(A=>!hr(A)&&n._subjects.state.next({errors:WN(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:nn(n._formValues)}),n._names.focus&&Lc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),ee.useEffect(()=>(!De(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(O,A)=>{const I=De(n._fields,O);I&&I._f&&(I._f.mount=A)};n._options.shouldUnregister||s?n.unregister(r):R(r,!1)}),[r,n,o,s]),{swap:ee.useCallback(x,[h,r,n]),move:ee.useCallback(S,[h,r,n]),prepend:ee.useCallback(v,[h,r,n]),append:ee.useCallback(g,[h,r,n]),remove:ee.useCallback(_,[h,r,n]),insert:ee.useCallback(b,[h,r,n]),update:ee.useCallback(E,[h,r,n]),replace:ee.useCallback(T,[h,r,n]),fields:ee.useMemo(()=>c.map((R,O)=>({...R,[o]:f.current[O]||Hs()})),[c,o])}}function Ti(e={}){const t=ee.useRef(void 0),n=ee.useRef(void 0),[r,o]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Or(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Or(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Or(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...c}=AK(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Kg(()=>{const l=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,l},[s]),ee.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ee.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const l=s._getDirty();l!==r.isDirty&&s._subjects.state.next({isDirty:l})}},[s,r.isDirty]),ee.useEffect(()=>{var l;e.values&&!ho(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((l=s._options.resetOptions)===null||l===void 0)&&l.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),ee.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=ee.useMemo(()=>BN(r,s),[s,r]),t.current}function dC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=dC(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():dC(e[o],null)}}}}function Jn(...e){return M.useCallback(mf(...e),e)}var MK=Symbol.for("react.lazy"),Zm=Ew[" use ".trim().toString()];function PK(e){return typeof e=="object"&&e!==null&&"then"in e}function QN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MK&&"_payload"in e&&PK(e._payload)}function XN(e){const t=NK(e),n=M.forwardRef((r,o)=>{let{children:s,...l}=r;QN(s)&&typeof Zm=="function"&&(s=Zm(s._payload));const c=M.Children.toArray(s),d=c.find(DK);if(d){const f=d.props.children,p=c.map(h=>h===d?M.Children.count(f)>1?M.Children.only(null):M.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:M.isValidElement(f)?M.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var iS=XN("Slot");function NK(e){const t=M.forwardRef((n,r)=>{let{children:o,...s}=n;if(QN(o)&&typeof Zm=="function"&&(o=Zm(o._payload)),M.isValidElement(o)){const l=$K(o),c=LK(s,o.props);return o.type!==M.Fragment&&(c.ref=r?mf(r,l):l),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kK=Symbol("radix.slottable");function DK(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kK}function LK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $K(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const fC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hC=Zw,JN=(e,t)=>n=>{var r;if(t?.variants==null)return hC(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(f=>{const p=n?.[f],h=s?.[f];if(p===null)return null;const g=fC(p)||fC(h);return o[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[h,g]=p;return g===void 0||(f[h]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:g,...v}=p;return Object.entries(v).every(_=>{let[b,x]=_;return Array.isArray(x)?x.includes({...s,...c}[b]):{...s,...c}[b]===x})?[...f,h,g]:f},[]);return hC(e,l,d,n?.class,n?.className)},pC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},e1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?pC(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>pC(o,n,e))}},mC=(e,t)=>{t.shouldUseNativeValidation&&e1(e,t);const n={};for(const r in e){const o=De(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(jK(t.names||Object.keys(e),r)){const l=Object.assign({},De(n,r));zt(l,"root",s),zt(n,r,l)}else zt(n,r,s)}return n},jK=(e,t)=>{const n=gC(t);return e.some(r=>gC(r).match(`^${n}\\.\\d+`))};function gC(e){return e.replace(/\]|\[/g,"")}function vC(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function zK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(p){return p.errors.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=nS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function UK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(p){return p.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=nS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Ci(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(vC(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return s.shouldUseNativeValidation&&e1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return Array.isArray(c?.issues)})(l))return{values:{},errors:mC(zK(l.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(vC(function(){return Promise.resolve((n.mode==="sync"?q9:H9)(e,r,t)).then(function(l){return s.shouldUseNativeValidation&&e1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return c instanceof jw})(l))return{values:{},errors:mC(UK(l.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function ct(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function FK(e,t){const n=M.createContext(t),r=s=>{const{children:l,...c}=s,d=M.useMemo(()=>c,Object.values(c));return C.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function o(s){const l=M.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function gl(e,t=[]){let n=[];function r(s,l){const c=M.createContext(l),d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:v,..._}=h,b=g?.[e]?.[d]||c,x=M.useMemo(()=>_,Object.values(_));return C.jsx(b.Provider,{value:x,children:v})};f.displayName=s+"Provider";function p(h,g){const v=g?.[e]?.[d]||c,_=M.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,p]}const o=()=>{const s=n.map(l=>M.createContext(l));return function(c){const d=c?.[e]||s;return M.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,BK(o,...t)]}function BK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ri=globalThis?.document?M.useLayoutEffect:()=>{},VK=Ew[" useId ".trim().toString()]||(()=>{}),qK=0;function la(e){const[t,n]=M.useState(VK());return ri(()=>{n(r=>r??String(qK++))},[e]),e||(t?`radix-${t}`:"")}var HK=Ew[" useInsertionEffect ".trim().toString()]||ri;function gf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,l]=GK({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o;{const p=M.useRef(e!==void 0);M.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=M.useCallback(p=>{if(c){const h=KK(p)?p(e):p;h!==e&&l.current?.(h)}else s(p)},[c,e,s,l]);return[d,f]}function GK({defaultProp:e,onChange:t}){const[n,r]=M.useState(e),o=M.useRef(n),s=M.useRef(t);return HK(()=>{s.current=t},[t]),M.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function KK(e){return typeof e=="function"}function Xd(e){const t=ZK(e),n=M.forwardRef((r,o)=>{const{children:s,...l}=r,c=M.Children.toArray(s),d=c.find(YK);if(d){const f=d.props.children,p=c.map(h=>h===d?M.Children.count(f)>1?M.Children.only(null):M.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:M.isValidElement(f)?M.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ZK(e){const t=M.forwardRef((n,r)=>{const{children:o,...s}=n;if(M.isValidElement(o)){const l=QK(o),c=WK(s,o.props);return o.type!==M.Fragment&&(c.ref=r?mf(r,l):l),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e4=Symbol("radix.slottable");function $ce(e){const t=({children:n})=>C.jsx(C.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=e4,t}function YK(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e4}function WK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function QK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=XK.reduce((e,t)=>{const n=Xd(`Primitive.${t}`),r=M.forwardRef((o,s)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t4(e,t){e&&kg.flushSync(()=>e.dispatchEvent(t))}function oi(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>t.current?.(...n),[])}function JK(e,t=globalThis?.document){const n=oi(e);M.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var eZ="DismissableLayer",t1="dismissableLayer.update",tZ="dismissableLayer.pointerDownOutside",nZ="dismissableLayer.focusOutside",yC,n4=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sS=M.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,f=M.useContext(n4),[p,h]=M.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=M.useState({}),_=Jn(t,I=>h(I)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),E=p?b.indexOf(p):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=S,O=iZ(I=>{const P=I.target,L=[...f.branches].some(q=>q.contains(P));!R||L||(o?.(I),l?.(I),I.defaultPrevented||c?.())},g),A=sZ(I=>{const P=I.target;[...f.branches].some(q=>q.contains(P))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},g);return JK(I=>{E===f.layers.size-1&&(r?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},g),M.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(yC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),_C(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=yC)}},[p,g,n,f]),M.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),_C())},[p,f]),M.useEffect(()=>{const I=()=>v({});return document.addEventListener(t1,I),()=>document.removeEventListener(t1,I)},[]),C.jsx(Sn.div,{...d,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...e.style},onFocusCapture:ct(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ct(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ct(e.onPointerDownCapture,O.onPointerDownCapture)})});sS.displayName=eZ;var rZ="DismissableLayerBranch",oZ=M.forwardRef((e,t)=>{const n=M.useContext(n4),r=M.useRef(null),o=Jn(t,r);return M.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),C.jsx(Sn.div,{...e,ref:o})});oZ.displayName=rZ;function iZ(e,t=globalThis?.document){const n=oi(e),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){r4(tZ,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sZ(e,t=globalThis?.document){const n=oi(e),r=M.useRef(!1);return M.useEffect(()=>{const o=s=>{s.target&&!r.current&&r4(nZ,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _C(){const e=new CustomEvent(t1);document.dispatchEvent(e)}function r4(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?t4(o,s):o.dispatchEvent(s)}var g_="focusScope.autoFocusOnMount",v_="focusScope.autoFocusOnUnmount",bC={bubbles:!1,cancelable:!0},aZ="FocusScope",aS=M.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=e,[c,d]=M.useState(null),f=oi(o),p=oi(s),h=M.useRef(null),g=Jn(t,b=>d(b)),v=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let b=function(T){if(v.paused||!c)return;const R=T.target;c.contains(R)?h.current=R:Xs(h.current,{select:!0})},x=function(T){if(v.paused||!c)return;const R=T.relatedTarget;R!==null&&(c.contains(R)||Xs(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&Xs(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const E=new MutationObserver(S);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),E.disconnect()}}},[r,c,v.paused]),M.useEffect(()=>{if(c){SC.add(v);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(g_,bC);c.addEventListener(g_,f),c.dispatchEvent(S),S.defaultPrevented||(lZ(hZ(o4(c)),{select:!0}),document.activeElement===b&&Xs(c))}return()=>{c.removeEventListener(g_,f),setTimeout(()=>{const S=new CustomEvent(v_,bC);c.addEventListener(v_,p),c.dispatchEvent(S),S.defaultPrevented||Xs(b??document.body,{select:!0}),c.removeEventListener(v_,p),SC.remove(v)},0)}}},[c,f,p,v]);const _=M.useCallback(b=>{if(!n&&!r||v.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const E=b.currentTarget,[T,R]=cZ(E);T&&R?!b.shiftKey&&S===R?(b.preventDefault(),n&&Xs(T,{select:!0})):b.shiftKey&&S===T&&(b.preventDefault(),n&&Xs(R,{select:!0})):S===E&&b.preventDefault()}},[n,r,v.paused]);return C.jsx(Sn.div,{tabIndex:-1,...l,ref:g,onKeyDown:_})});aS.displayName=aZ;function lZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xs(r,{select:t}),document.activeElement!==n)return}function cZ(e){const t=o4(e),n=wC(t,e),r=wC(t.reverse(),e);return[n,r]}function o4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wC(e,t){for(const n of e)if(!uZ(n,{upTo:t}))return n}function uZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dZ(e){return e instanceof HTMLInputElement&&"select"in e}function Xs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dZ(e)&&t&&e.select()}}var SC=fZ();function fZ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=EC(e,t),e.unshift(t)},remove(t){e=EC(e,t),e[0]?.resume()}}}function EC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hZ(e){return e.filter(t=>t.tagName!=="A")}var pZ="Portal",lS=M.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=M.useState(!1);ri(()=>s(!0),[]);const l=n||o&&globalThis?.document?.body;return l?GP.createPortal(C.jsx(Sn.div,{...r,ref:t}),l):null});lS.displayName=pZ;function mZ(e,t){return M.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=gZ(t),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),s=Jn(r.ref,vZ(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:s}):null};gs.displayName="Presence";function gZ(e){const[t,n]=M.useState(),r=M.useRef(null),o=M.useRef(e),s=M.useRef("none"),l=e?"mounted":"unmounted",[c,d]=mZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const f=lp(r.current);s.current=c==="mounted"?f:"none"},[c]),ri(()=>{const f=r.current,p=o.current;if(p!==e){const g=s.current,v=lp(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),ri(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=v=>{const b=lp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=lp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:M.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function lp(e){return e?.animationName||"none"}function vZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var y_=0;function i4(){M.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xC()),document.body.insertAdjacentElement("beforeend",e[1]??xC()),y_++,()=>{y_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),y_--}},[])}function xC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wi=function(){return wi=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},wi.apply(this,arguments)};function s4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yZ(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var bm="right-scroll-bar-position",wm="width-before-scroll-bar",_Z="with-scroll-bars-hidden",bZ="--removed-body-scroll-bar-size";function __(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wZ(e,t){var n=M.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var SZ=typeof window<"u"?M.useLayoutEffect:M.useEffect,RC=new WeakMap;function EZ(e,t){var n=wZ(null,function(r){return e.forEach(function(o){return __(o,r)})});return SZ(function(){var r=RC.get(n);if(r){var o=new Set(r),s=new Set(e),l=n.current;o.forEach(function(c){s.has(c)||__(c,null)}),s.forEach(function(c){o.has(c)||__(c,l)})}RC.set(n,e)},[e]),n}function xZ(e){return e}function RZ(e,t){t===void 0&&(t=xZ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var d=function(){var p=l;l=[],p.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return o}function OZ(e){e===void 0&&(e={});var t=RZ(null);return t.options=wi({async:!0,ssr:!1},e),t}var a4=function(e){var t=e.sideCar,n=s4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,wi({},n))};a4.isSideCarExport=!0;function TZ(e,t){return e.useMedium(t),a4}var l4=OZ(),b_=function(){},Zg=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:b_,onWheelCapture:b_,onTouchMoveCapture:b_}),o=r[0],s=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,_=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,T=e.gapMode,R=s4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=EZ([n,t]),I=wi(wi({},R),o);return M.createElement(M.Fragment,null,p&&M.createElement(O,{sideCar:l4,removeScrollBar:f,shards:h,noRelative:v,noIsolation:_,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:T}),l?M.cloneElement(M.Children.only(c),wi(wi({},I),{ref:A})):M.createElement(E,wi({},I,{className:d,ref:A}),c))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:wm,zeroRight:bm};var CZ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=CZ();return t&&e.setAttribute("nonce",t),e}function IZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PZ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AZ())&&(IZ(t,n),MZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},NZ=function(){var e=PZ();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c4=function(){var e=NZ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},kZ={left:0,top:0,right:0,gap:0},w_=function(e){return parseInt(e||"",10)||0},DZ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[w_(n),w_(r),w_(o)]},LZ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kZ;var t=DZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$Z=c4(),$c="data-scroll-locked",jZ=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
62
62
|
.`.concat(_Z,` {
|
|
63
63
|
overflow: hidden `).concat(r,`;
|
|
64
64
|
padding-right: `).concat(c,"px ").concat(r,`;
|
|
@@ -126,7 +126,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
126
126
|
--nojs-bg: black !important;
|
|
127
127
|
--nojs-fg: white !important;
|
|
128
128
|
}
|
|
129
|
-
}`,dc={},$_,lA;function UD(){return lA||(lA=1,$_={L:1,M:0,Q:3,H:2}),$_}var j_,cA;function FD(){return cA||(cA=1,j_={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),j_}var z_,uA;function Lee(){if(uA)return z_;uA=1;var e=FD();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},z_=t,z_}var U_,dA;function $ee(){if(dA)return U_;dA=1;var e=UD();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var o=t.getRsBlockTable(n,r);if(o==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var s=o.length/3,l=new Array,c=0;c<s;c++)for(var d=o[c*3+0],f=o[c*3+1],p=o[c*3+2],h=0;h<d;h++)l.push(new t(f,p));return l},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},U_=t,U_}var F_,fA;function jee(){if(fA)return F_;fA=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},F_=e,F_}var B_,hA;function BD(){if(hA)return B_;hA=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return B_=e,B_}var V_,pA;function VD(){if(pA)return V_;pA=1;var e=BD();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var o=0;o<n.length&&n[o]==0;)o++;this.num=new Array(n.length-o+r);for(var s=0;s<n.length-o;s++)this.num[s]=n[s+o]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),o=0;o<this.getLength();o++)for(var s=0;s<n.getLength();s++)r[o+s]^=e.gexp(e.glog(this.get(o))+e.glog(n.get(s)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),o=new Array(this.getLength()),s=0;s<this.getLength();s++)o[s]=this.get(s);for(var s=0;s<n.getLength();s++)o[s]^=e.gexp(e.glog(n.get(s))+r);return new t(o,0).mod(n)}},V_=t,V_}var q_,mA;function zee(){if(mA)return q_;mA=1;var e=FD(),t=VD(),n=BD(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){for(var l=s<<10;o.getBCHDigit(l)-o.getBCHDigit(o.G15)>=0;)l^=o.G15<<o.getBCHDigit(l)-o.getBCHDigit(o.G15);return(s<<10|l)^o.G15_MASK},getBCHTypeNumber:function(s){for(var l=s<<12;o.getBCHDigit(l)-o.getBCHDigit(o.G18)>=0;)l^=o.G18<<o.getBCHDigit(l)-o.getBCHDigit(o.G18);return s<<12|l},getBCHDigit:function(s){for(var l=0;s!=0;)l++,s>>>=1;return l},getPatternPosition:function(s){return o.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,l,c){switch(s){case r.PATTERN000:return(l+c)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return c%3==0;case r.PATTERN011:return(l+c)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(c/3))%2==0;case r.PATTERN101:return l*c%2+l*c%3==0;case r.PATTERN110:return(l*c%2+l*c%3)%2==0;case r.PATTERN111:return(l*c%3+(l+c)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var l=new t([1],0),c=0;c<s;c++)l=l.multiply(new t([1,n.gexp(c)],0));return l},getLengthInBits:function(s,l){if(1<=l&&l<10)switch(s){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(l<27)switch(s){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(l<41)switch(s){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+l)},getLostPoint:function(s){for(var l=s.getModuleCount(),c=0,d=0;d<l;d++)for(var f=0;f<l;f++){for(var p=0,h=s.isDark(d,f),g=-1;g<=1;g++)if(!(d+g<0||l<=d+g))for(var v=-1;v<=1;v++)f+v<0||l<=f+v||g==0&&v==0||h==s.isDark(d+g,f+v)&&p++;p>5&&(c+=3+p-5)}for(var d=0;d<l-1;d++)for(var f=0;f<l-1;f++){var _=0;s.isDark(d,f)&&_++,s.isDark(d+1,f)&&_++,s.isDark(d,f+1)&&_++,s.isDark(d+1,f+1)&&_++,(_==0||_==4)&&(c+=3)}for(var d=0;d<l;d++)for(var f=0;f<l-6;f++)s.isDark(d,f)&&!s.isDark(d,f+1)&&s.isDark(d,f+2)&&s.isDark(d,f+3)&&s.isDark(d,f+4)&&!s.isDark(d,f+5)&&s.isDark(d,f+6)&&(c+=40);for(var f=0;f<l;f++)for(var d=0;d<l-6;d++)s.isDark(d,f)&&!s.isDark(d+1,f)&&s.isDark(d+2,f)&&s.isDark(d+3,f)&&s.isDark(d+4,f)&&!s.isDark(d+5,f)&&s.isDark(d+6,f)&&(c+=40);for(var b=0,f=0;f<l;f++)for(var d=0;d<l;d++)s.isDark(d,f)&&b++;var x=Math.abs(100*b/l/l-50)/5;return c+=x*10,c}};return q_=o,q_}var H_,gA;function Uee(){if(gA)return H_;gA=1;var e=Lee(),t=$ee(),n=jee(),r=zee(),o=VD();function s(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=s.prototype;return l.addData=function(c){var d=new e(c);this.dataList.push(d),this.dataCache=null},l.isDark=function(c,d){if(c<0||this.moduleCount<=c||d<0||this.moduleCount<=d)throw new Error(c+","+d);return this.modules[c][d]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var d=t.getRSBlocks(c,this.errorCorrectLevel),f=new n,p=0,h=0;h<d.length;h++)p+=d[h].dataCount;for(var h=0;h<this.dataList.length;h++){var g=this.dataList[h];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,c)),g.write(f)}if(f.getLengthInBits()<=p*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},l.makeImpl=function(c,d){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++)this.modules[f][p]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,d),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=s.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,d)},l.setupPositionProbePattern=function(c,d){for(var f=-1;f<=7;f++)if(!(c+f<=-1||this.moduleCount<=c+f))for(var p=-1;p<=7;p++)d+p<=-1||this.moduleCount<=d+p||(0<=f&&f<=6&&(p==0||p==6)||0<=p&&p<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=p&&p<=4?this.modules[c+f][d+p]=!0:this.modules[c+f][d+p]=!1)},l.getBestMaskPattern=function(){for(var c=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var p=r.getLostPoint(this);(f==0||c>p)&&(c=p,d=f)}return d},l.createMovieClip=function(c,d,f){var p=c.createEmptyMovieClip(d,f),h=1;this.make();for(var g=0;g<this.modules.length;g++)for(var v=g*h,_=0;_<this.modules[g].length;_++){var b=_*h,x=this.modules[g][_];x&&(p.beginFill(0,100),p.moveTo(b,v),p.lineTo(b+h,v),p.lineTo(b+h,v+h),p.lineTo(b,v+h),p.endFill())}return p},l.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++)this.modules[c][6]==null&&(this.modules[c][6]=c%2==0);for(var d=8;d<this.moduleCount-8;d++)this.modules[6][d]==null&&(this.modules[6][d]=d%2==0)},l.setupPositionAdjustPattern=function(){for(var c=r.getPatternPosition(this.typeNumber),d=0;d<c.length;d++)for(var f=0;f<c.length;f++){var p=c[d],h=c[f];if(this.modules[p][h]==null)for(var g=-2;g<=2;g++)for(var v=-2;v<=2;v++)g==-2||g==2||v==-2||v==2||g==0&&v==0?this.modules[p+g][h+v]=!0:this.modules[p+g][h+v]=!1}},l.setupTypeNumber=function(c){for(var d=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=p}for(var f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=p}},l.setupTypeInfo=function(c,d){for(var f=this.errorCorrectLevel<<3|d,p=r.getBCHTypeInfo(f),h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<6?this.modules[h][8]=g:h<8?this.modules[h+1][8]=g:this.modules[this.moduleCount-15+h][8]=g}for(var h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=g:h<9?this.modules[8][15-h-1+1]=g:this.modules[8][15-h-1]=g}this.modules[this.moduleCount-8][8]=!c},l.mapData=function(c,d){for(var f=-1,p=this.moduleCount-1,h=7,g=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var _=0;_<2;_++)if(this.modules[p][v-_]==null){var b=!1;g<c.length&&(b=(c[g]>>>h&1)==1);var x=r.getMask(d,p,v-_);x&&(b=!b),this.modules[p][v-_]=b,h--,h==-1&&(g++,h=7)}if(p+=f,p<0||this.moduleCount<=p){p-=f,f=-f;break}}},s.PAD0=236,s.PAD1=17,s.createData=function(c,d,f){for(var p=t.getRSBlocks(c,d),h=new n,g=0;g<f.length;g++){var v=f[g];h.put(v.mode,4),h.put(v.getLength(),r.getLengthInBits(v.mode,c)),v.write(h)}for(var _=0,g=0;g<p.length;g++)_+=p[g].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(s.PAD0,8),h.getLengthInBits()>=_*8));)h.put(s.PAD1,8);return s.createBytes(h,p)},s.createBytes=function(c,d){for(var f=0,p=0,h=0,g=new Array(d.length),v=new Array(d.length),_=0;_<d.length;_++){var b=d[_].dataCount,x=d[_].totalCount-b;p=Math.max(p,b),h=Math.max(h,x),g[_]=new Array(b);for(var S=0;S<g[_].length;S++)g[_][S]=255&c.buffer[S+f];f+=b;var E=r.getErrorCorrectPolynomial(x),T=new o(g[_],E.getLength()-1),R=T.mod(E);v[_]=new Array(E.getLength()-1);for(var S=0;S<v[_].length;S++){var O=S+R.getLength()-v[_].length;v[_][S]=O>=0?R.get(O):0}}for(var A=0,S=0;S<d.length;S++)A+=d[S].totalCount;for(var I=new Array(A),P=0,S=0;S<p;S++)for(var _=0;_<d.length;_++)S<g[_].length&&(I[P++]=g[_][S]);for(var S=0;S<h;S++)for(var _=0;_<d.length;_++)S<v[_].length&&(I[P++]=v[_][S]);return I},H_=s,H_}var _p={},vA;function Fee(){if(vA)return _p;vA=1,Object.defineProperty(_p,"__esModule",{value:!0});var e=Object.assign||function(f){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(f[g]=h[g])}return f},t=PS(),n=s(t),r=ma(),o=s(r);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,p){var h={};for(var g in f)p.indexOf(g)>=0||Object.prototype.hasOwnProperty.call(f,g)&&(h[g]=f[g]);return h}var c={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},d=(0,r.forwardRef)(function(f,p){var h=f.bgColor,g=f.bgD,v=f.fgD,_=f.fgColor,b=f.size,x=f.title,S=f.viewBoxSize,E=f.xmlns,T=E===void 0?"http://www.w3.org/2000/svg":E,R=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return o.default.createElement("svg",e({},R,{height:b,ref:p,viewBox:"0 0 "+S+" "+S,width:b,xmlns:T}),x?o.default.createElement("title",null,x):null,o.default.createElement("path",{d:g,fill:h}),o.default.createElement("path",{d:v,fill:_}))});return d.displayName="QRCodeSvg",d.propTypes=c,_p.default=d,_p}var yA;function Bee(){if(yA)return dc;yA=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.QRCode=void 0;var e=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&(b[E]=S[E])}return b},t=PS(),n=h(t),r=UD(),o=h(r),s=Uee(),l=h(s),c=ma(),d=h(c),f=Fee(),p=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function g(b,x){var S={};for(var E in b)x.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(b,E)&&(S[E]=b[E]);return S}var v={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},_=(0,c.forwardRef)(function(b,x){var S=b.bgColor,E=S===void 0?"#FFFFFF":S,T=b.fgColor,R=T===void 0?"#000000":T,O=b.level,A=O===void 0?"L":O,I=b.size,P=I===void 0?256:I,L=b.value,q=g(b,["bgColor","fgColor","level","size","value"]),j=new l.default(-1,o.default[A]);j.addData(L),j.make();var B=j.modules;return d.default.createElement(p.default,e({},q,{bgColor:E,bgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"":"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:x,size:P,viewBoxSize:B.length}))});return dc.QRCode=_,_.displayName="QRCode",_.propTypes=v,dc.default=_,dc}var Vee=Bee();const qee=dl(Vee);var Hee="Separator",_A="horizontal",Gee=["horizontal","vertical"],qD=M.forwardRef((e,t)=>{const{decorative:n,orientation:r=_A,...o}=e,s=Kee(r)?r:_A,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return C.jsx(Sf.div,{"data-orientation":s,...c,...o,ref:t})});qD.displayName=Hee;function Kee(e){return Gee.includes(e)}var Zee=qD;function Yee(e){const{authView:t="SIGN_IN",enabled:n=!0}={},{hooks:{useSession:r},basePath:o,viewPaths:s,replace:l}=M.useContext(pt),{data:c,isPending:d,error:f,refetch:p}=r(),h=c;return M.useEffect(()=>{if(!n||d||h)return;const v=new URLSearchParams(window.location.search).get("redirectTo")||window.location.pathname+window.location.search;l(`${o}/${s[t]}?redirectTo=${encodeURIComponent(v)}`)},[d,h,o,s,l,t,n]),{data:h,user:h?.user,isPending:d,error:f,refetch:p}}function nf({className:e,...t}){return C.jsx("div",{"data-slot":"card",className:Ce("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function kS({className:e,...t}){return C.jsx("div",{"data-slot":"card-header",className:Ce("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function HD({className:e,...t}){return C.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function GD({className:e,...t}){return C.jsx("div",{"data-slot":"card-description",className:Ce("text-muted-foreground text-sm",e),...t})}function DS({className:e,...t}){return C.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}function bA({className:e,...t}){return C.jsx("div",{"data-slot":"card-footer",className:Ce("flex items-center px-6 [.border-t]:pt-6",e),...t})}function ss({className:e,...t}){return C.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",e),...t})}var Wee=JN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function sn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?iS:"button";return C.jsx(s,{"data-slot":"button",className:Ce(Wee({variant:t,size:n,className:e})),...o})}async function Qee(e,t,n,r){const o=await Xee(e),s=document.createElement("canvas");s.width=s.height=n;const l=s.getContext("2d"),c=Math.min(o.width,o.height),d=(o.width-c)/2,f=(o.height-c)/2,p=c,h=c;l?.drawImage(o,d,f,p,h,0,0,n,n);const g=await new Promise(v=>s.toBlob(v,`image/${r}`));return new File([g],`${t}.${r}`,{type:`image/${r}`})}async function Xee(e){return new Promise((t,n)=>{const r=new Image,o=new FileReader;o.onload=s=>{var l;r.src=(l=s.target)==null?void 0:l.result},r.onload=()=>t(r),r.onerror=s=>n(s),o.readAsDataURL(e)})}async function Jee(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function ete({...e}){return C.jsx(eX,{"data-slot":"dropdown-menu",...e})}function tte({...e}){return C.jsx(tX,{"data-slot":"dropdown-menu-trigger",...e})}function nte({className:e,sideOffset:t=4,...n}){return C.jsx(nX,{children:C.jsx(rX,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ce("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function wA({className:e,inset:t,variant:n="default",...r}){return C.jsx(oX,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ce("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function KD({className:e,...t}){return C.jsx(aX,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Ii=mK,ZD=M.createContext({}),In=({...e})=>C.jsx(ZD.Provider,{value:{name:e.name},children:C.jsx(hK,{...e})}),LS=()=>{const e=M.useContext(ZD),t=M.useContext(YD),{getFieldState:n}=pK(),r=VN({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},YD=M.createContext({});function Mn({className:e,...t}){const n=M.useId();return C.jsx(YD.Provider,{value:{id:n},children:C.jsx("div",{"data-slot":"form-item",className:Ce("grid gap-2",e),...t})})}function Pn({className:e,...t}){const{error:n,formItemId:r}=LS();return C.jsx(KD,{"data-slot":"form-label","data-error":!!n,className:Ce("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function qn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=LS();return C.jsx(iS,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Yn({className:e,...t}){const{error:n,formMessageId:r}=LS(),o=n?String(n?.message??""):t.children;return o?C.jsx("p",{"data-slot":"form-message",id:r,className:Ce("text-destructive text-sm",e),...t,children:o}):null}function ni({className:e,type:t,...n}){return C.jsx("input",{type:t,"data-slot":"input",className:Ce("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function WD({className:e,...t}){return C.jsx(gX,{"data-slot":"avatar",className:Ce("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function QD({className:e,...t}){return C.jsx(vX,{"data-slot":"avatar-image",className:Ce("aspect-square size-full",e),...t})}function XD({className:e,...t}){return C.jsx(yX,{"data-slot":"avatar-fallback",className:Ce("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function rte({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s,...l}){const{localization:c,avatar:d}=M.useContext(pt),f=M.useMemo(()=>({...c,...s}),[c,s]),p=o?.name,h=o?.logo;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(WD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[d?.Image?C.jsx(d.Image,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||""}):C.jsx(QD,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||void 0}),C.jsx(XD,{className:Ce("text-foreground",t?.fallback),delayMs:h?600:void 0,children:C.jsx(eK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}function JD({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s}){const{localization:l}=M.useContext(pt),c={...l,...s};return C.jsxs("div",{className:Ce("flex items-center gap-2 truncate",e,t?.base),children:[C.jsx(rte,{className:Ce(r!=="sm"&&"my-0.5"),classNames:t?.avatar,isPending:n,localization:c,organization:o,size:r}),C.jsx("div",{className:Ce("flex flex-col truncate text-left leading-tight",t?.content),children:n?C.jsxs(C.Fragment,{children:[C.jsx(ss,{className:Ce("max-w-full",r==="lg"?"h-4.5 w-32":"h-3.5 w-24",t?.title,t?.skeleton)}),r!=="sm"&&C.jsx(ss,{className:Ce("mt-1.5 max-w-full",r==="lg"?"h-3.5 w-24":"h-3 w-16",t?.subtitle,t?.skeleton)})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Ce("truncate font-semibold",r==="lg"?"text-base":"text-sm",t?.title),children:o?.name||c?.ORGANIZATION}),r!=="sm"&&o?.slug&&C.jsx("span",{className:Ce("truncate opacity-70",r==="lg"?"text-sm":"text-xs",t?.subtitle),children:o.slug})]})})]})}function ote(e,t){if(!e)return null;try{const n=e.trim().toLowerCase(),o=new TextEncoder().encode(n),s=EX(PX(o)),l=t?.jpg?".jpg":"";let c=`https://gravatar.com/avatar/${s}${l}`;const d=new URLSearchParams;t?.size&&d.append("s",Math.min(Math.max(t.size,1),2048).toString()),t?.d&&d.append("d",t.d),t?.forceDefault&&d.append("f","y");const f=d.toString();return f&&(c+=`?${f}`),c}catch(n){return console.error("Error generating Gravatar URL:",n),null}}function ite({className:e,classNames:t,isPending:n,size:r,user:o,localization:s,...l}){const{localization:c,gravatar:d,avatar:f}=M.useContext(pt),p={...c,...s},h=o?.displayName||o?.name||o?.fullName||o?.firstName||o?.displayUsername||o?.username||o?.email,g=o?.image||o?.avatar||o?.avatarUrl,v=d&&o?.email?ote(o.email,d===!0?void 0:d):null,_=d?v:g;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(WD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[f?.Image?C.jsx(f.Image,{alt:h||p?.USER,className:t?.image,src:_||""}):C.jsx(QD,{alt:h||p?.USER,className:t?.image,src:_||void 0}),C.jsx(XD,{className:Ce("text-foreground uppercase",t?.fallback),delayMs:_?600:void 0,children:ste(h)||C.jsx(lK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}var ste=e=>e?.slice(0,2);function $S({className:e,...t}){return C.jsx(iD,{"data-slot":"checkbox",className:Ce("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:C.jsx(aD,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:C.jsx(DN,{className:"size-3.5"})})})}function ate({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ce("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var lte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M9.438 31.401a7 7 0 0 1-1.656-1.536a20 20 0 0 1-1.422-1.938a18.9 18.9 0 0 1-2.375-4.849c-.667-2-.99-3.917-.99-5.792c0-2.094.453-3.922 1.339-5.458a7.7 7.7 0 0 1 2.797-2.906a7.45 7.45 0 0 1 3.786-1.12q.705.002 1.51.198c.385.109.854.281 1.427.495c.729.281 1.13.453 1.266.495c.427.156.786.224 1.068.224c.214 0 .516-.068.859-.172c.193-.068.557-.188 1.078-.411c.516-.188.922-.349 1.245-.469c.495-.146.974-.281 1.401-.349a6.7 6.7 0 0 1 1.531-.063a9 9 0 0 1 2.589.557c1.359.547 2.458 1.401 3.276 2.615a6.4 6.4 0 0 0-.969.734a8.2 8.2 0 0 0-1.641 2.005a6.8 6.8 0 0 0-.859 3.359c.021 1.443.391 2.714 1.12 3.813a7.2 7.2 0 0 0 2.047 2.047c.417.281.776.474 1.12.604c-.161.5-.333.984-.536 1.464a19 19 0 0 1-1.667 3.083c-.578.839-1.031 1.464-1.375 1.88c-.536.635-1.052 1.12-1.573 1.458c-.573.38-1.25.583-1.938.583a4.4 4.4 0 0 1-1.38-.167c-.385-.13-.766-.271-1.141-.432a9 9 0 0 0-1.203-.453a6.3 6.3 0 0 0-3.099-.005c-.417.12-.818.26-1.214.432c-.557.234-.927.391-1.141.458c-.427.125-.87.203-1.318.229c-.693 0-1.339-.198-1.979-.599zm9.14-24.615c-.906.453-1.771.646-2.63.583c-.135-.865 0-1.75.359-2.719a7.3 7.3 0 0 1 1.333-2.24A7.1 7.1 0 0 1 19.812.733q1.319-.68 2.521-.734c.104.906 0 1.797-.333 2.76a8 8 0 0 1-1.333 2.344a6.8 6.8 0 0 1-2.115 1.682z",fill:"currentColor"})}),cte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 199",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18",fill:"#5865f2"})}),ute=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 218",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M63.995 0L0 40.771l63.995 40.772L128 40.771zM192 0l-64 40.775l64 40.775l64.001-40.775zM0 122.321l63.995 40.772L128 122.321L63.995 81.55zM192 81.55l-64 40.775l64 40.774l64-40.774zM64 176.771l64.005 40.772L192 176.771L128.005 136z",fill:"#0061ff"})}),dte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445",fill:"#1877f2"}),C.jsx("path",{d:"m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A129 129 0 0 0 128 256a129 129 0 0 0 20-1.555V165z",fill:"#fff"})]}),fte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",fill:"currentColor"})}),hte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 236",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"m128.075 236.075l47.104-144.97H80.97z",fill:"#e24329"}),C.jsx("path",{d:"M128.075 236.074L80.97 91.104H14.956z",fill:"#fc6d26"}),C.jsx("path",{d:"M14.956 91.104L.642 135.16a9.75 9.75 0 0 0 3.542 10.903l123.891 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0z",fill:"#e24329"}),C.jsx("path",{d:"m128.075 236.074l47.104-144.97h66.015z",fill:"#fc6d26"}),C.jsx("path",{d:"m241.194 91.104l14.314 44.056a9.75 9.75 0 0 1-3.543 10.903l-123.89 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0z",fill:"#e24329"})]}),pte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285f4"}),C.jsx("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34a853"}),C.jsx("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z",fill:"#fbbc05"}),C.jsx("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#eb4335"})]}),mte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})}),gte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M1.333 0h8v5.333H12V2.667h2.667V0h8v8H20v2.667h-2.667v2.666H20V16h2.667v8h-8v-2.667H12v-2.666H9.333V24h-8Z"})}),vte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M2.886 4.18A11.98 11.98 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556q-.787.496-1.65.866L.951 7.277q.371-.863.866-1.65ZM.322 9.163l14.515 14.515q-1.066.26-2.195.322L0 11.358a12 12 0 0 1 .322-2.195m-.17 4.862l9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"})}),yte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M116 3H12a8.91 8.91 0 0 0-9 8.8v104.42a8.91 8.91 0 0 0 9 8.78h104a8.93 8.93 0 0 0 9-8.81V11.77A8.93 8.93 0 0 0 116 3",fill:"#0076b2"}),C.jsx("path",{d:"M21.06 48.73h18.11V107H21.06zm9.06-29a10.5 10.5 0 1 1-10.5 10.49a10.5 10.5 0 0 1 10.5-10.49m20.41 29h17.36v8h.24c2.42-4.58 8.32-9.41 17.13-9.41C103.6 47.28 107 59.35 107 75v32H88.89V78.65c0-6.75-.12-15.44-9.41-15.44s-10.87 7.36-10.87 15V107H50.53z",fill:"#fff"})]}),_te=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M121.666 121.666H0V0h121.666z",fill:"#f1511b"}),C.jsx("path",{d:"M256 121.666H134.335V0H256z",fill:"#80cc28"}),C.jsx("path",{d:"M121.663 256.002H0V134.336h121.663z",fill:"#00adef"}),C.jsx("path",{d:"M256 256.002H134.335V134.336H256z",fill:"#fbbc09"})]}),bte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233l4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632"})}),wte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("circle",{cx:"128",cy:"128",fill:"#ff4500",r:"128"}),C.jsx("path",{d:"M213.15 129.22c0-10.376-8.391-18.617-18.617-18.617a18.74 18.74 0 0 0-12.97 5.189c-12.818-9.157-30.368-15.107-49.9-15.87l8.544-39.981l27.773 5.95c.307 7.02 6.104 12.667 13.278 12.667c7.324 0 13.275-5.95 13.275-13.278c0-7.324-5.95-13.275-13.275-13.275c-5.188 0-9.768 3.052-11.904 7.478l-30.976-6.562c-.916-.154-1.832 0-2.443.458c-.763.458-1.22 1.22-1.371 2.136l-9.464 44.558c-19.837.612-37.692 6.562-50.662 15.872a18.74 18.74 0 0 0-12.971-5.188c-10.377 0-18.617 8.391-18.617 18.617c0 7.629 4.577 14.037 10.988 16.939a33.6 33.6 0 0 0-.458 5.646c0 28.686 33.42 52.036 74.621 52.036c41.202 0 74.622-23.196 74.622-52.036a35 35 0 0 0-.458-5.646c6.408-2.902 10.985-9.464 10.985-17.093M85.272 142.495c0-7.324 5.95-13.275 13.278-13.275c7.324 0 13.275 5.95 13.275 13.275s-5.95 13.278-13.275 13.278c-7.327.15-13.278-5.953-13.278-13.278m74.317 35.251c-9.156 9.157-26.553 9.768-31.588 9.768c-5.188 0-22.584-.765-31.59-9.768c-1.371-1.373-1.371-3.51 0-4.883c1.374-1.371 3.51-1.371 4.884 0c5.8 5.8 18.008 7.782 26.706 7.782s21.058-1.983 26.704-7.782c1.374-1.371 3.51-1.371 4.884 0c1.22 1.373 1.22 3.51 0 4.883m-2.443-21.822c-7.325 0-13.275-5.95-13.275-13.275s5.95-13.275 13.275-13.275c7.327 0 13.277 5.95 13.277 13.275c0 7.17-5.95 13.275-13.277 13.275",fill:"#fff"})]}),Ste=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M18.926 23.998L0 18.892L5.075.002L24 5.108ZM15.348 10.09l-5.282-1.453l-1.414 5.273l5.282 1.453z",fill:"currentColor"})}),Ete=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z"})}),xte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128c70.697 0 128-57.304 128-128C256 57.314 198.697.007 127.998.007zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.98 7.98 0 0 1-9.552-6.007a7.97 7.97 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276c3.76 2.308 4.952 7.215 2.644 10.975m15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187z",fill:"#1ed760"})}),Rte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 290",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M189.72 104.421c18.678 13.345 41.56 21.197 66.273 21.197v-47.53a67 67 0 0 1-13.918-1.456v37.413c-24.711 0-47.59-7.851-66.272-21.195v96.996c0 48.523-39.356 87.855-87.9 87.855c-18.113 0-34.949-5.473-48.934-14.86c15.962 16.313 38.222 26.432 62.848 26.432c48.548 0 87.905-39.332 87.905-87.857v-96.995zm17.17-47.952c-9.546-10.423-15.814-23.893-17.17-38.785v-6.113h-13.189c3.32 18.927 14.644 35.097 30.358 44.898M69.673 225.607a40 40 0 0 1-8.203-24.33c0-22.192 18.001-40.186 40.21-40.186a40.3 40.3 0 0 1 12.197 1.883v-48.593c-4.61-.631-9.262-.9-13.912-.801v37.822a40.3 40.3 0 0 0-12.203-1.882c-22.208 0-40.208 17.992-40.208 40.187c0 15.694 8.997 29.281 22.119 35.9",fill:"#ff004f"}),C.jsx("path",{d:"M175.803 92.849c18.683 13.344 41.56 21.195 66.272 21.195V76.631c-13.794-2.937-26.005-10.141-35.186-20.162c-15.715-9.802-27.038-25.972-30.358-44.898h-34.643v189.843c-.079 22.132-18.049 40.052-40.21 40.052c-13.058 0-24.66-6.221-32.007-15.86c-13.12-6.618-22.118-20.206-22.118-35.898c0-22.193 18-40.187 40.208-40.187c4.255 0 8.356.662 12.203 1.882v-37.822c-47.692.985-86.047 39.933-86.047 87.834c0 23.912 9.551 45.589 25.053 61.428c13.985 9.385 30.82 14.86 48.934 14.86c48.545 0 87.9-39.335 87.9-87.857z"}),C.jsx("path",{d:"M242.075 76.63V66.516a66.3 66.3 0 0 1-35.186-10.047a66.47 66.47 0 0 0 35.186 20.163M176.53 11.57a68 68 0 0 1-.728-5.457V0h-47.834v189.845c-.076 22.13-18.046 40.05-40.208 40.05a40.06 40.06 0 0 1-18.09-4.287c7.347 9.637 18.949 15.857 32.007 15.857c22.16 0 40.132-17.918 40.21-40.05V11.571zM99.966 113.58v-10.769a89 89 0 0 0-12.061-.818C39.355 101.993 0 141.327 0 189.845c0 30.419 15.467 57.227 38.971 72.996c-15.502-15.838-25.053-37.516-25.053-61.427c0-47.9 38.354-86.848 86.048-87.833",fill:"#00f2ea"})]}),Ote=({className:e})=>C.jsxs("svg",{className:e,version:"1.1",viewBox:"0 0 2400 2800",x:"0px",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",y:"0px",children:[C.jsx("style",{type:"text/css",children:`
|
|
129
|
+
}`,dc={},$_,lA;function UD(){return lA||(lA=1,$_={L:1,M:0,Q:3,H:2}),$_}var j_,cA;function FD(){return cA||(cA=1,j_={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),j_}var z_,uA;function Lee(){if(uA)return z_;uA=1;var e=FD();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},z_=t,z_}var U_,dA;function $ee(){if(dA)return U_;dA=1;var e=UD();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var o=t.getRsBlockTable(n,r);if(o==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var s=o.length/3,l=new Array,c=0;c<s;c++)for(var d=o[c*3+0],f=o[c*3+1],p=o[c*3+2],h=0;h<d;h++)l.push(new t(f,p));return l},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},U_=t,U_}var F_,fA;function jee(){if(fA)return F_;fA=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},F_=e,F_}var B_,hA;function BD(){if(hA)return B_;hA=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return B_=e,B_}var V_,pA;function VD(){if(pA)return V_;pA=1;var e=BD();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var o=0;o<n.length&&n[o]==0;)o++;this.num=new Array(n.length-o+r);for(var s=0;s<n.length-o;s++)this.num[s]=n[s+o]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),o=0;o<this.getLength();o++)for(var s=0;s<n.getLength();s++)r[o+s]^=e.gexp(e.glog(this.get(o))+e.glog(n.get(s)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),o=new Array(this.getLength()),s=0;s<this.getLength();s++)o[s]=this.get(s);for(var s=0;s<n.getLength();s++)o[s]^=e.gexp(e.glog(n.get(s))+r);return new t(o,0).mod(n)}},V_=t,V_}var q_,mA;function zee(){if(mA)return q_;mA=1;var e=FD(),t=VD(),n=BD(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){for(var l=s<<10;o.getBCHDigit(l)-o.getBCHDigit(o.G15)>=0;)l^=o.G15<<o.getBCHDigit(l)-o.getBCHDigit(o.G15);return(s<<10|l)^o.G15_MASK},getBCHTypeNumber:function(s){for(var l=s<<12;o.getBCHDigit(l)-o.getBCHDigit(o.G18)>=0;)l^=o.G18<<o.getBCHDigit(l)-o.getBCHDigit(o.G18);return s<<12|l},getBCHDigit:function(s){for(var l=0;s!=0;)l++,s>>>=1;return l},getPatternPosition:function(s){return o.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,l,c){switch(s){case r.PATTERN000:return(l+c)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return c%3==0;case r.PATTERN011:return(l+c)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(c/3))%2==0;case r.PATTERN101:return l*c%2+l*c%3==0;case r.PATTERN110:return(l*c%2+l*c%3)%2==0;case r.PATTERN111:return(l*c%3+(l+c)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var l=new t([1],0),c=0;c<s;c++)l=l.multiply(new t([1,n.gexp(c)],0));return l},getLengthInBits:function(s,l){if(1<=l&&l<10)switch(s){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(l<27)switch(s){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(l<41)switch(s){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+l)},getLostPoint:function(s){for(var l=s.getModuleCount(),c=0,d=0;d<l;d++)for(var f=0;f<l;f++){for(var p=0,h=s.isDark(d,f),g=-1;g<=1;g++)if(!(d+g<0||l<=d+g))for(var v=-1;v<=1;v++)f+v<0||l<=f+v||g==0&&v==0||h==s.isDark(d+g,f+v)&&p++;p>5&&(c+=3+p-5)}for(var d=0;d<l-1;d++)for(var f=0;f<l-1;f++){var _=0;s.isDark(d,f)&&_++,s.isDark(d+1,f)&&_++,s.isDark(d,f+1)&&_++,s.isDark(d+1,f+1)&&_++,(_==0||_==4)&&(c+=3)}for(var d=0;d<l;d++)for(var f=0;f<l-6;f++)s.isDark(d,f)&&!s.isDark(d,f+1)&&s.isDark(d,f+2)&&s.isDark(d,f+3)&&s.isDark(d,f+4)&&!s.isDark(d,f+5)&&s.isDark(d,f+6)&&(c+=40);for(var f=0;f<l;f++)for(var d=0;d<l-6;d++)s.isDark(d,f)&&!s.isDark(d+1,f)&&s.isDark(d+2,f)&&s.isDark(d+3,f)&&s.isDark(d+4,f)&&!s.isDark(d+5,f)&&s.isDark(d+6,f)&&(c+=40);for(var b=0,f=0;f<l;f++)for(var d=0;d<l;d++)s.isDark(d,f)&&b++;var x=Math.abs(100*b/l/l-50)/5;return c+=x*10,c}};return q_=o,q_}var H_,gA;function Uee(){if(gA)return H_;gA=1;var e=Lee(),t=$ee(),n=jee(),r=zee(),o=VD();function s(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=s.prototype;return l.addData=function(c){var d=new e(c);this.dataList.push(d),this.dataCache=null},l.isDark=function(c,d){if(c<0||this.moduleCount<=c||d<0||this.moduleCount<=d)throw new Error(c+","+d);return this.modules[c][d]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var d=t.getRSBlocks(c,this.errorCorrectLevel),f=new n,p=0,h=0;h<d.length;h++)p+=d[h].dataCount;for(var h=0;h<this.dataList.length;h++){var g=this.dataList[h];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,c)),g.write(f)}if(f.getLengthInBits()<=p*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},l.makeImpl=function(c,d){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++)this.modules[f][p]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,d),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=s.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,d)},l.setupPositionProbePattern=function(c,d){for(var f=-1;f<=7;f++)if(!(c+f<=-1||this.moduleCount<=c+f))for(var p=-1;p<=7;p++)d+p<=-1||this.moduleCount<=d+p||(0<=f&&f<=6&&(p==0||p==6)||0<=p&&p<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=p&&p<=4?this.modules[c+f][d+p]=!0:this.modules[c+f][d+p]=!1)},l.getBestMaskPattern=function(){for(var c=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var p=r.getLostPoint(this);(f==0||c>p)&&(c=p,d=f)}return d},l.createMovieClip=function(c,d,f){var p=c.createEmptyMovieClip(d,f),h=1;this.make();for(var g=0;g<this.modules.length;g++)for(var v=g*h,_=0;_<this.modules[g].length;_++){var b=_*h,x=this.modules[g][_];x&&(p.beginFill(0,100),p.moveTo(b,v),p.lineTo(b+h,v),p.lineTo(b+h,v+h),p.lineTo(b,v+h),p.endFill())}return p},l.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++)this.modules[c][6]==null&&(this.modules[c][6]=c%2==0);for(var d=8;d<this.moduleCount-8;d++)this.modules[6][d]==null&&(this.modules[6][d]=d%2==0)},l.setupPositionAdjustPattern=function(){for(var c=r.getPatternPosition(this.typeNumber),d=0;d<c.length;d++)for(var f=0;f<c.length;f++){var p=c[d],h=c[f];if(this.modules[p][h]==null)for(var g=-2;g<=2;g++)for(var v=-2;v<=2;v++)g==-2||g==2||v==-2||v==2||g==0&&v==0?this.modules[p+g][h+v]=!0:this.modules[p+g][h+v]=!1}},l.setupTypeNumber=function(c){for(var d=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=p}for(var f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=p}},l.setupTypeInfo=function(c,d){for(var f=this.errorCorrectLevel<<3|d,p=r.getBCHTypeInfo(f),h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<6?this.modules[h][8]=g:h<8?this.modules[h+1][8]=g:this.modules[this.moduleCount-15+h][8]=g}for(var h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=g:h<9?this.modules[8][15-h-1+1]=g:this.modules[8][15-h-1]=g}this.modules[this.moduleCount-8][8]=!c},l.mapData=function(c,d){for(var f=-1,p=this.moduleCount-1,h=7,g=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var _=0;_<2;_++)if(this.modules[p][v-_]==null){var b=!1;g<c.length&&(b=(c[g]>>>h&1)==1);var x=r.getMask(d,p,v-_);x&&(b=!b),this.modules[p][v-_]=b,h--,h==-1&&(g++,h=7)}if(p+=f,p<0||this.moduleCount<=p){p-=f,f=-f;break}}},s.PAD0=236,s.PAD1=17,s.createData=function(c,d,f){for(var p=t.getRSBlocks(c,d),h=new n,g=0;g<f.length;g++){var v=f[g];h.put(v.mode,4),h.put(v.getLength(),r.getLengthInBits(v.mode,c)),v.write(h)}for(var _=0,g=0;g<p.length;g++)_+=p[g].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(s.PAD0,8),h.getLengthInBits()>=_*8));)h.put(s.PAD1,8);return s.createBytes(h,p)},s.createBytes=function(c,d){for(var f=0,p=0,h=0,g=new Array(d.length),v=new Array(d.length),_=0;_<d.length;_++){var b=d[_].dataCount,x=d[_].totalCount-b;p=Math.max(p,b),h=Math.max(h,x),g[_]=new Array(b);for(var S=0;S<g[_].length;S++)g[_][S]=255&c.buffer[S+f];f+=b;var E=r.getErrorCorrectPolynomial(x),T=new o(g[_],E.getLength()-1),R=T.mod(E);v[_]=new Array(E.getLength()-1);for(var S=0;S<v[_].length;S++){var O=S+R.getLength()-v[_].length;v[_][S]=O>=0?R.get(O):0}}for(var A=0,S=0;S<d.length;S++)A+=d[S].totalCount;for(var I=new Array(A),P=0,S=0;S<p;S++)for(var _=0;_<d.length;_++)S<g[_].length&&(I[P++]=g[_][S]);for(var S=0;S<h;S++)for(var _=0;_<d.length;_++)S<v[_].length&&(I[P++]=v[_][S]);return I},H_=s,H_}var _p={},vA;function Fee(){if(vA)return _p;vA=1,Object.defineProperty(_p,"__esModule",{value:!0});var e=Object.assign||function(f){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(f[g]=h[g])}return f},t=PS(),n=s(t),r=ma(),o=s(r);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,p){var h={};for(var g in f)p.indexOf(g)>=0||Object.prototype.hasOwnProperty.call(f,g)&&(h[g]=f[g]);return h}var c={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},d=(0,r.forwardRef)(function(f,p){var h=f.bgColor,g=f.bgD,v=f.fgD,_=f.fgColor,b=f.size,x=f.title,S=f.viewBoxSize,E=f.xmlns,T=E===void 0?"http://www.w3.org/2000/svg":E,R=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return o.default.createElement("svg",e({},R,{height:b,ref:p,viewBox:"0 0 "+S+" "+S,width:b,xmlns:T}),x?o.default.createElement("title",null,x):null,o.default.createElement("path",{d:g,fill:h}),o.default.createElement("path",{d:v,fill:_}))});return d.displayName="QRCodeSvg",d.propTypes=c,_p.default=d,_p}var yA;function Bee(){if(yA)return dc;yA=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.QRCode=void 0;var e=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&(b[E]=S[E])}return b},t=PS(),n=h(t),r=UD(),o=h(r),s=Uee(),l=h(s),c=ma(),d=h(c),f=Fee(),p=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function g(b,x){var S={};for(var E in b)x.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(b,E)&&(S[E]=b[E]);return S}var v={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},_=(0,c.forwardRef)(function(b,x){var S=b.bgColor,E=S===void 0?"#FFFFFF":S,T=b.fgColor,R=T===void 0?"#000000":T,O=b.level,A=O===void 0?"L":O,I=b.size,P=I===void 0?256:I,L=b.value,q=g(b,["bgColor","fgColor","level","size","value"]),j=new l.default(-1,o.default[A]);j.addData(L),j.make();var B=j.modules;return d.default.createElement(p.default,e({},q,{bgColor:E,bgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"":"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:x,size:P,viewBoxSize:B.length}))});return dc.QRCode=_,_.displayName="QRCode",_.propTypes=v,dc.default=_,dc}var Vee=Bee();const qee=dl(Vee);var Hee="Separator",_A="horizontal",Gee=["horizontal","vertical"],qD=M.forwardRef((e,t)=>{const{decorative:n,orientation:r=_A,...o}=e,s=Kee(r)?r:_A,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return C.jsx(Sf.div,{"data-orientation":s,...c,...o,ref:t})});qD.displayName=Hee;function Kee(e){return Gee.includes(e)}var Zee=qD;function Yee(e){const{authView:t="SIGN_IN",enabled:n=!0}={},{hooks:{useSession:r},basePath:o,viewPaths:s,replace:l}=M.useContext(pt),{data:c,isPending:d,error:f,refetch:p}=r(),h=c;return M.useEffect(()=>{if(!n||d||h)return;const v=new URLSearchParams(window.location.search).get("redirectTo")||window.location.pathname+window.location.search;l(`${o}/${s[t]}?redirectTo=${encodeURIComponent(v)}`)},[d,h,o,s,l,t,n]),{data:h,user:h?.user,isPending:d,error:f,refetch:p}}function nf({className:e,...t}){return C.jsx("div",{"data-slot":"card",className:Ce("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function kS({className:e,...t}){return C.jsx("div",{"data-slot":"card-header",className:Ce("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function HD({className:e,...t}){return C.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function GD({className:e,...t}){return C.jsx("div",{"data-slot":"card-description",className:Ce("text-muted-foreground text-sm",e),...t})}function DS({className:e,...t}){return C.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}function bA({className:e,...t}){return C.jsx("div",{"data-slot":"card-footer",className:Ce("flex items-center px-6 [.border-t]:pt-6",e),...t})}function ss({className:e,...t}){return C.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",e),...t})}var Wee=JN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function rn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?iS:"button";return C.jsx(s,{"data-slot":"button",className:Ce(Wee({variant:t,size:n,className:e})),...o})}async function Qee(e,t,n,r){const o=await Xee(e),s=document.createElement("canvas");s.width=s.height=n;const l=s.getContext("2d"),c=Math.min(o.width,o.height),d=(o.width-c)/2,f=(o.height-c)/2,p=c,h=c;l?.drawImage(o,d,f,p,h,0,0,n,n);const g=await new Promise(v=>s.toBlob(v,`image/${r}`));return new File([g],`${t}.${r}`,{type:`image/${r}`})}async function Xee(e){return new Promise((t,n)=>{const r=new Image,o=new FileReader;o.onload=s=>{var l;r.src=(l=s.target)==null?void 0:l.result},r.onload=()=>t(r),r.onerror=s=>n(s),o.readAsDataURL(e)})}async function Jee(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function ete({...e}){return C.jsx(eX,{"data-slot":"dropdown-menu",...e})}function tte({...e}){return C.jsx(tX,{"data-slot":"dropdown-menu-trigger",...e})}function nte({className:e,sideOffset:t=4,...n}){return C.jsx(nX,{children:C.jsx(rX,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ce("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function wA({className:e,inset:t,variant:n="default",...r}){return C.jsx(oX,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ce("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function KD({className:e,...t}){return C.jsx(aX,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Ii=mK,ZD=M.createContext({}),In=({...e})=>C.jsx(ZD.Provider,{value:{name:e.name},children:C.jsx(hK,{...e})}),LS=()=>{const e=M.useContext(ZD),t=M.useContext(YD),{getFieldState:n}=pK(),r=VN({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},YD=M.createContext({});function Mn({className:e,...t}){const n=M.useId();return C.jsx(YD.Provider,{value:{id:n},children:C.jsx("div",{"data-slot":"form-item",className:Ce("grid gap-2",e),...t})})}function Pn({className:e,...t}){const{error:n,formItemId:r}=LS();return C.jsx(KD,{"data-slot":"form-label","data-error":!!n,className:Ce("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function qn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=LS();return C.jsx(iS,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Yn({className:e,...t}){const{error:n,formMessageId:r}=LS(),o=n?String(n?.message??""):t.children;return o?C.jsx("p",{"data-slot":"form-message",id:r,className:Ce("text-destructive text-sm",e),...t,children:o}):null}function ni({className:e,type:t,...n}){return C.jsx("input",{type:t,"data-slot":"input",className:Ce("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function WD({className:e,...t}){return C.jsx(gX,{"data-slot":"avatar",className:Ce("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function QD({className:e,...t}){return C.jsx(vX,{"data-slot":"avatar-image",className:Ce("aspect-square size-full",e),...t})}function XD({className:e,...t}){return C.jsx(yX,{"data-slot":"avatar-fallback",className:Ce("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function rte({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s,...l}){const{localization:c,avatar:d}=M.useContext(pt),f=M.useMemo(()=>({...c,...s}),[c,s]),p=o?.name,h=o?.logo;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(WD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[d?.Image?C.jsx(d.Image,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||""}):C.jsx(QD,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||void 0}),C.jsx(XD,{className:Ce("text-foreground",t?.fallback),delayMs:h?600:void 0,children:C.jsx(eK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}function JD({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s}){const{localization:l}=M.useContext(pt),c={...l,...s};return C.jsxs("div",{className:Ce("flex items-center gap-2 truncate",e,t?.base),children:[C.jsx(rte,{className:Ce(r!=="sm"&&"my-0.5"),classNames:t?.avatar,isPending:n,localization:c,organization:o,size:r}),C.jsx("div",{className:Ce("flex flex-col truncate text-left leading-tight",t?.content),children:n?C.jsxs(C.Fragment,{children:[C.jsx(ss,{className:Ce("max-w-full",r==="lg"?"h-4.5 w-32":"h-3.5 w-24",t?.title,t?.skeleton)}),r!=="sm"&&C.jsx(ss,{className:Ce("mt-1.5 max-w-full",r==="lg"?"h-3.5 w-24":"h-3 w-16",t?.subtitle,t?.skeleton)})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Ce("truncate font-semibold",r==="lg"?"text-base":"text-sm",t?.title),children:o?.name||c?.ORGANIZATION}),r!=="sm"&&o?.slug&&C.jsx("span",{className:Ce("truncate opacity-70",r==="lg"?"text-sm":"text-xs",t?.subtitle),children:o.slug})]})})]})}function ote(e,t){if(!e)return null;try{const n=e.trim().toLowerCase(),o=new TextEncoder().encode(n),s=EX(PX(o)),l=t?.jpg?".jpg":"";let c=`https://gravatar.com/avatar/${s}${l}`;const d=new URLSearchParams;t?.size&&d.append("s",Math.min(Math.max(t.size,1),2048).toString()),t?.d&&d.append("d",t.d),t?.forceDefault&&d.append("f","y");const f=d.toString();return f&&(c+=`?${f}`),c}catch(n){return console.error("Error generating Gravatar URL:",n),null}}function ite({className:e,classNames:t,isPending:n,size:r,user:o,localization:s,...l}){const{localization:c,gravatar:d,avatar:f}=M.useContext(pt),p={...c,...s},h=o?.displayName||o?.name||o?.fullName||o?.firstName||o?.displayUsername||o?.username||o?.email,g=o?.image||o?.avatar||o?.avatarUrl,v=d&&o?.email?ote(o.email,d===!0?void 0:d):null,_=d?v:g;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(WD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[f?.Image?C.jsx(f.Image,{alt:h||p?.USER,className:t?.image,src:_||""}):C.jsx(QD,{alt:h||p?.USER,className:t?.image,src:_||void 0}),C.jsx(XD,{className:Ce("text-foreground uppercase",t?.fallback),delayMs:_?600:void 0,children:ste(h)||C.jsx(lK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}var ste=e=>e?.slice(0,2);function $S({className:e,...t}){return C.jsx(iD,{"data-slot":"checkbox",className:Ce("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:C.jsx(aD,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:C.jsx(DN,{className:"size-3.5"})})})}function ate({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ce("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var lte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M9.438 31.401a7 7 0 0 1-1.656-1.536a20 20 0 0 1-1.422-1.938a18.9 18.9 0 0 1-2.375-4.849c-.667-2-.99-3.917-.99-5.792c0-2.094.453-3.922 1.339-5.458a7.7 7.7 0 0 1 2.797-2.906a7.45 7.45 0 0 1 3.786-1.12q.705.002 1.51.198c.385.109.854.281 1.427.495c.729.281 1.13.453 1.266.495c.427.156.786.224 1.068.224c.214 0 .516-.068.859-.172c.193-.068.557-.188 1.078-.411c.516-.188.922-.349 1.245-.469c.495-.146.974-.281 1.401-.349a6.7 6.7 0 0 1 1.531-.063a9 9 0 0 1 2.589.557c1.359.547 2.458 1.401 3.276 2.615a6.4 6.4 0 0 0-.969.734a8.2 8.2 0 0 0-1.641 2.005a6.8 6.8 0 0 0-.859 3.359c.021 1.443.391 2.714 1.12 3.813a7.2 7.2 0 0 0 2.047 2.047c.417.281.776.474 1.12.604c-.161.5-.333.984-.536 1.464a19 19 0 0 1-1.667 3.083c-.578.839-1.031 1.464-1.375 1.88c-.536.635-1.052 1.12-1.573 1.458c-.573.38-1.25.583-1.938.583a4.4 4.4 0 0 1-1.38-.167c-.385-.13-.766-.271-1.141-.432a9 9 0 0 0-1.203-.453a6.3 6.3 0 0 0-3.099-.005c-.417.12-.818.26-1.214.432c-.557.234-.927.391-1.141.458c-.427.125-.87.203-1.318.229c-.693 0-1.339-.198-1.979-.599zm9.14-24.615c-.906.453-1.771.646-2.63.583c-.135-.865 0-1.75.359-2.719a7.3 7.3 0 0 1 1.333-2.24A7.1 7.1 0 0 1 19.812.733q1.319-.68 2.521-.734c.104.906 0 1.797-.333 2.76a8 8 0 0 1-1.333 2.344a6.8 6.8 0 0 1-2.115 1.682z",fill:"currentColor"})}),cte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 199",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18",fill:"#5865f2"})}),ute=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 218",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M63.995 0L0 40.771l63.995 40.772L128 40.771zM192 0l-64 40.775l64 40.775l64.001-40.775zM0 122.321l63.995 40.772L128 122.321L63.995 81.55zM192 81.55l-64 40.775l64 40.774l64-40.774zM64 176.771l64.005 40.772L192 176.771L128.005 136z",fill:"#0061ff"})}),dte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445",fill:"#1877f2"}),C.jsx("path",{d:"m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A129 129 0 0 0 128 256a129 129 0 0 0 20-1.555V165z",fill:"#fff"})]}),fte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",fill:"currentColor"})}),hte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 236",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"m128.075 236.075l47.104-144.97H80.97z",fill:"#e24329"}),C.jsx("path",{d:"M128.075 236.074L80.97 91.104H14.956z",fill:"#fc6d26"}),C.jsx("path",{d:"M14.956 91.104L.642 135.16a9.75 9.75 0 0 0 3.542 10.903l123.891 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0z",fill:"#e24329"}),C.jsx("path",{d:"m128.075 236.074l47.104-144.97h66.015z",fill:"#fc6d26"}),C.jsx("path",{d:"m241.194 91.104l14.314 44.056a9.75 9.75 0 0 1-3.543 10.903l-123.89 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0z",fill:"#e24329"})]}),pte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285f4"}),C.jsx("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34a853"}),C.jsx("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z",fill:"#fbbc05"}),C.jsx("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#eb4335"})]}),mte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})}),gte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M1.333 0h8v5.333H12V2.667h2.667V0h8v8H20v2.667h-2.667v2.666H20V16h2.667v8h-8v-2.667H12v-2.666H9.333V24h-8Z"})}),vte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M2.886 4.18A11.98 11.98 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556q-.787.496-1.65.866L.951 7.277q.371-.863.866-1.65ZM.322 9.163l14.515 14.515q-1.066.26-2.195.322L0 11.358a12 12 0 0 1 .322-2.195m-.17 4.862l9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"})}),yte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M116 3H12a8.91 8.91 0 0 0-9 8.8v104.42a8.91 8.91 0 0 0 9 8.78h104a8.93 8.93 0 0 0 9-8.81V11.77A8.93 8.93 0 0 0 116 3",fill:"#0076b2"}),C.jsx("path",{d:"M21.06 48.73h18.11V107H21.06zm9.06-29a10.5 10.5 0 1 1-10.5 10.49a10.5 10.5 0 0 1 10.5-10.49m20.41 29h17.36v8h.24c2.42-4.58 8.32-9.41 17.13-9.41C103.6 47.28 107 59.35 107 75v32H88.89V78.65c0-6.75-.12-15.44-9.41-15.44s-10.87 7.36-10.87 15V107H50.53z",fill:"#fff"})]}),_te=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M121.666 121.666H0V0h121.666z",fill:"#f1511b"}),C.jsx("path",{d:"M256 121.666H134.335V0H256z",fill:"#80cc28"}),C.jsx("path",{d:"M121.663 256.002H0V134.336h121.663z",fill:"#00adef"}),C.jsx("path",{d:"M256 256.002H134.335V134.336H256z",fill:"#fbbc09"})]}),bte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233l4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632"})}),wte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("circle",{cx:"128",cy:"128",fill:"#ff4500",r:"128"}),C.jsx("path",{d:"M213.15 129.22c0-10.376-8.391-18.617-18.617-18.617a18.74 18.74 0 0 0-12.97 5.189c-12.818-9.157-30.368-15.107-49.9-15.87l8.544-39.981l27.773 5.95c.307 7.02 6.104 12.667 13.278 12.667c7.324 0 13.275-5.95 13.275-13.278c0-7.324-5.95-13.275-13.275-13.275c-5.188 0-9.768 3.052-11.904 7.478l-30.976-6.562c-.916-.154-1.832 0-2.443.458c-.763.458-1.22 1.22-1.371 2.136l-9.464 44.558c-19.837.612-37.692 6.562-50.662 15.872a18.74 18.74 0 0 0-12.971-5.188c-10.377 0-18.617 8.391-18.617 18.617c0 7.629 4.577 14.037 10.988 16.939a33.6 33.6 0 0 0-.458 5.646c0 28.686 33.42 52.036 74.621 52.036c41.202 0 74.622-23.196 74.622-52.036a35 35 0 0 0-.458-5.646c6.408-2.902 10.985-9.464 10.985-17.093M85.272 142.495c0-7.324 5.95-13.275 13.278-13.275c7.324 0 13.275 5.95 13.275 13.275s-5.95 13.278-13.275 13.278c-7.327.15-13.278-5.953-13.278-13.278m74.317 35.251c-9.156 9.157-26.553 9.768-31.588 9.768c-5.188 0-22.584-.765-31.59-9.768c-1.371-1.373-1.371-3.51 0-4.883c1.374-1.371 3.51-1.371 4.884 0c5.8 5.8 18.008 7.782 26.706 7.782s21.058-1.983 26.704-7.782c1.374-1.371 3.51-1.371 4.884 0c1.22 1.373 1.22 3.51 0 4.883m-2.443-21.822c-7.325 0-13.275-5.95-13.275-13.275s5.95-13.275 13.275-13.275c7.327 0 13.277 5.95 13.277 13.275c0 7.17-5.95 13.275-13.277 13.275",fill:"#fff"})]}),Ste=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M18.926 23.998L0 18.892L5.075.002L24 5.108ZM15.348 10.09l-5.282-1.453l-1.414 5.273l5.282 1.453z",fill:"currentColor"})}),Ete=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z"})}),xte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128c70.697 0 128-57.304 128-128C256 57.314 198.697.007 127.998.007zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.98 7.98 0 0 1-9.552-6.007a7.97 7.97 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276c3.76 2.308 4.952 7.215 2.644 10.975m15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187z",fill:"#1ed760"})}),Rte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 290",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M189.72 104.421c18.678 13.345 41.56 21.197 66.273 21.197v-47.53a67 67 0 0 1-13.918-1.456v37.413c-24.711 0-47.59-7.851-66.272-21.195v96.996c0 48.523-39.356 87.855-87.9 87.855c-18.113 0-34.949-5.473-48.934-14.86c15.962 16.313 38.222 26.432 62.848 26.432c48.548 0 87.905-39.332 87.905-87.857v-96.995zm17.17-47.952c-9.546-10.423-15.814-23.893-17.17-38.785v-6.113h-13.189c3.32 18.927 14.644 35.097 30.358 44.898M69.673 225.607a40 40 0 0 1-8.203-24.33c0-22.192 18.001-40.186 40.21-40.186a40.3 40.3 0 0 1 12.197 1.883v-48.593c-4.61-.631-9.262-.9-13.912-.801v37.822a40.3 40.3 0 0 0-12.203-1.882c-22.208 0-40.208 17.992-40.208 40.187c0 15.694 8.997 29.281 22.119 35.9",fill:"#ff004f"}),C.jsx("path",{d:"M175.803 92.849c18.683 13.344 41.56 21.195 66.272 21.195V76.631c-13.794-2.937-26.005-10.141-35.186-20.162c-15.715-9.802-27.038-25.972-30.358-44.898h-34.643v189.843c-.079 22.132-18.049 40.052-40.21 40.052c-13.058 0-24.66-6.221-32.007-15.86c-13.12-6.618-22.118-20.206-22.118-35.898c0-22.193 18-40.187 40.208-40.187c4.255 0 8.356.662 12.203 1.882v-37.822c-47.692.985-86.047 39.933-86.047 87.834c0 23.912 9.551 45.589 25.053 61.428c13.985 9.385 30.82 14.86 48.934 14.86c48.545 0 87.9-39.335 87.9-87.857z"}),C.jsx("path",{d:"M242.075 76.63V66.516a66.3 66.3 0 0 1-35.186-10.047a66.47 66.47 0 0 0 35.186 20.163M176.53 11.57a68 68 0 0 1-.728-5.457V0h-47.834v189.845c-.076 22.13-18.046 40.05-40.208 40.05a40.06 40.06 0 0 1-18.09-4.287c7.347 9.637 18.949 15.857 32.007 15.857c22.16 0 40.132-17.918 40.21-40.05V11.571zM99.966 113.58v-10.769a89 89 0 0 0-12.061-.818C39.355 101.993 0 141.327 0 189.845c0 30.419 15.467 57.227 38.971 72.996c-15.502-15.838-25.053-37.516-25.053-61.427c0-47.9 38.354-86.848 86.048-87.833",fill:"#00f2ea"})]}),Ote=({className:e})=>C.jsxs("svg",{className:e,version:"1.1",viewBox:"0 0 2400 2800",x:"0px",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",y:"0px",children:[C.jsx("style",{type:"text/css",children:`
|
|
130
130
|
.st0{fill:#FFFFFF}
|
|
131
131
|
.st1{fill:#9146FF}
|
|
132
132
|
`}),C.jsx("title",{children:"Asset 2"}),C.jsxs("g",{children:[C.jsx("polygon",{className:"st0",points:"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200"}),C.jsx("g",{children:C.jsxs("g",{children:[C.jsx("path",{className:"st1",d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600V1300z"}),C.jsx("rect",{className:"st1",height:"600",width:"200",x:"1700",y:"550"}),C.jsx("rect",{className:"st1",height:"600",width:"200",x:"1150",y:"550"})]})})]})]}),Tte=({className:e})=>C.jsx("svg",{"data-testid":"geist-icon",height:"16","stroke-linejoin":"round",viewBox:"0 0 16 16",width:"16",className:e,style:{color:"currentcolor"},children:C.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1L16 15H0L8 1Z",fill:"currentColor"})}),Cte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M545 117.7c3.7-12.5 0-21.7-17.8-21.7h-58.9c-15 0-21.9 7.9-25.6 16.7c0 0-30 73.1-72.4 120.5c-13.7 13.7-20 18.1-27.5 18.1c-3.7 0-9.4-4.4-9.4-16.9V117.7c0-15-4.2-21.7-16.6-21.7h-92.6c-9.4 0-15 7-15 13.5c0 14.2 21.2 17.5 23.4 57.5v86.8c0 19-3.4 22.5-10.9 22.5c-20 0-68.6-73.4-97.4-157.4c-5.8-16.3-11.5-22.9-26.6-22.9H38.8c-16.8 0-20.2 7.9-20.2 16.7c0 15.6 20 93.1 93.1 195.5C160.4 378.1 229 416 291.4 416c37.5 0 42.1-8.4 42.1-22.9c0-66.8-3.4-73.1 15.4-73.1c8.7 0 23.7 4.4 58.7 38.1c40 40 46.6 57.9 69 57.9h58.9c16.8 0 25.3-8.4 20.4-25c-11.2-34.9-86.9-106.7-90.3-111.5c-8.7-11.2-6.2-16.2 0-26.2c.1-.1 72-101.3 79.4-135.6",fill:"currentColor"})}),Ate=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M389.2 48h70.6L305.6 224.2L487 464H345L233.7 318.6L106.5 464H35.8l164.9-188.5L26.8 48h145.6l100.5 132.9zm-24.8 373.8h39.1L151.1 88h-42z",fill:"currentColor"})}),Ite=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:512,height:117,viewBox:"0 0 512 117",children:C.jsx("path",{fill:"#0b5cff",d:"M107.472 114.706H16.348c-5.968 0-11.791-3.203-14.557-8.589C-1.41 99.858-.247 92.434 4.702 87.63L68.17 24.164H22.607C10.088 24.164.044 13.974.044 1.6h83.992c5.968 0 11.79 3.203 14.556 8.589c3.203 6.259 2.038 13.683-2.911 18.486L32.214 92.143h52.55c12.518 0 22.708 10.19 22.708 22.563M468.183 0c-13.1 0-24.746 5.677-32.898 14.702C427.134 5.677 415.488 0 402.388 0c-24.164 0-43.961 20.67-43.961 44.834v69.872c12.518 0 22.562-10.19 22.562-22.563V44.689c0-11.646 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.315 22.272 21.397v48.037c0 12.519 10.19 22.563 22.563 22.563V44.543c0-11.645 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.316 22.272 21.398v48.036c0 12.52 10.19 22.563 22.563 22.563V44.69C512.144 20.67 492.347 0 468.183 0M221.595 58.226c0 32.17-26.056 58.226-58.226 58.226s-58.226-26.056-58.226-58.226S131.199 0 163.369 0s58.226 26.056 58.226 58.226m-22.563 0c0-19.651-16.012-35.663-35.663-35.663s-35.664 16.012-35.664 35.663c0 19.652 16.013 35.664 35.664 35.664s35.663-16.012 35.663-35.664m148.04 0c0 32.17-26.056 58.226-58.226 58.226S230.62 90.396 230.62 58.226S256.676 0 288.846 0s58.227 26.056 58.227 58.226m-22.562 0c0-19.651-16.012-35.663-35.664-35.663c-19.65 0-35.663 16.012-35.663 35.663c0 19.652 16.012 35.664 35.663 35.664c19.652 0 35.664-16.012 35.664-35.664"})}),Mte=[{provider:"apple",name:"Apple",icon:lte},{provider:"discord",name:"Discord",icon:cte},{provider:"dropbox",name:"Dropbox",icon:ute},{provider:"facebook",name:"Facebook",icon:dte},{provider:"github",name:"GitHub",icon:fte},{provider:"gitlab",name:"GitLab",icon:hte},{provider:"google",name:"Google",icon:pte},{provider:"huggingface",name:"Hugging Face",icon:mte},{provider:"kick",name:"Kick",icon:gte},{provider:"linear",name:"Linear",icon:vte},{provider:"linkedin",name:"LinkedIn",icon:yte},{provider:"microsoft",name:"Microsoft",icon:_te},{provider:"notion",name:"Notion",icon:bte},{provider:"reddit",name:"Reddit",icon:wte},{provider:"roblox",name:"Roblox",icon:Ste},{provider:"slack",name:"Slack",icon:Ete},{provider:"spotify",name:"Spotify",icon:xte},{provider:"tiktok",name:"TikTok",icon:Rte},{provider:"twitch",name:"Twitch",icon:Ote},{provider:"vercel",name:"Vercel",icon:Tte},{provider:"vk",name:"VK",icon:Cte},{provider:"twitter",name:"X",icon:Ate},{provider:"zoom",name:"Zoom",icon:Ite}],Pte=["/sign-up/email","/sign-in/email","/forget-password"],Nte=e=>{let t=e.startsWith("/")?e.substring(1):e;return t=t.replace(/-([a-z])/g,(n,r)=>r.toUpperCase()).replace(/\/([a-z])/g,(n,r)=>r.toUpperCase()).replace(/\//g,"").replace(/[^A-Za-z0-9_]/g,""),t};function xf({localization:e}){const{captcha:t,localization:n}=M.useContext(pt);e={...n,...e};const r=M.useRef(null),{executeRecaptcha:o}=MN(),s=async d=>{if(!t)throw new Error(e.MISSING_RESPONSE);let f;switch(t.provider){case"google-recaptcha-v3":{const p=Nte(d);f=await o?.(p);break}case"google-recaptcha-v2-checkbox":{f=r.current.getValue();break}case"google-recaptcha-v2-invisible":{f=await r.current.executeAsync();break}case"cloudflare-turnstile":{f=r.current.getResponse();break}case"hcaptcha":{f=r.current.getResponse();break}case"captchafox":{f=r.current.getResponse();break}}if(!f)throw new Error(e.MISSING_RESPONSE);return f};return{captchaRef:r,getCaptchaHeaders:async d=>{if(!t)return;if((t.endpoints||Pte).includes(d))return{"x-captcha-response":await s(d)}},resetCaptcha:()=>{var d,f,p,h,g,v,_,b;if(t)switch(t.provider){case"google-recaptcha-v3":break;case"google-recaptcha-v2-checkbox":case"google-recaptcha-v2-invisible":{(f=(d=r.current)==null?void 0:d.reset)==null||f.call(d);break}case"cloudflare-turnstile":{(h=(p=r.current)==null?void 0:p.reset)==null||h.call(p);break}case"hcaptcha":{(v=(g=r.current)==null?void 0:g.resetCaptcha)==null||v.call(g);break}case"captchafox":{(b=(_=r.current)==null?void 0:_.reset)==null||b.call(_);break}}}}}function kte({className:e,localization:t}){const n=ms(),{captcha:r,localization:o}=M.useContext(pt),s={...o,...t};return r?r.hideBadge?C.jsxs(C.Fragment,{children:[C.jsx("style",{children:`
|
|
@@ -145,22 +145,22 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
145
145
|
.dark .grecaptcha-badge {
|
|
146
146
|
border-color: var(--input) !important;
|
|
147
147
|
}
|
|
148
|
-
`}),C.jsx(ZJ,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var Lte=["/sign-up/email","/sign-in/email","/forget-password"];function Rf({ref:e,localization:t,action:n}){const{captcha:r}=M.useContext(pt);if(!r||n&&!(r.endpoints||Lte).includes(n))return null;const{theme:o}=Qw(),s=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",c=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return C.jsxs(C.Fragment,{children:[s&&C.jsx(Dte,{ref:e}),l&&C.jsx(kte,{localization:t}),c&&C.jsx(ED,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:o,size:"flexible"}}),d&&C.jsx("div",{className:"mx-auto",children:C.jsx(EJ,{ref:e,sitekey:r.siteKey,theme:o})}),f&&C.jsx("div",{className:"mx-auto",children:C.jsx(fD,{ref:e,sitekey:r.siteKey,theme:o})})]})}function rf({className:e,enableToggle:t,onChange:n,...r}){const[o,s]=M.useState(!0),[l,c]=M.useState(!1);return C.jsxs("div",{className:"relative",children:[C.jsx(ni,{className:Ce(t&&"pr-10",e),...r,type:l&&t?"text":"password",onChange:d=>{s(!d.target.value),n?.(d)}}),t&&C.jsxs(C.Fragment,{children:[C.jsx(
|
|
148
|
+
`}),C.jsx(ZJ,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var Lte=["/sign-up/email","/sign-in/email","/forget-password"];function Rf({ref:e,localization:t,action:n}){const{captcha:r}=M.useContext(pt);if(!r||n&&!(r.endpoints||Lte).includes(n))return null;const{theme:o}=Qw(),s=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",c=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return C.jsxs(C.Fragment,{children:[s&&C.jsx(Dte,{ref:e}),l&&C.jsx(kte,{localization:t}),c&&C.jsx(ED,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:o,size:"flexible"}}),d&&C.jsx("div",{className:"mx-auto",children:C.jsx(EJ,{ref:e,sitekey:r.siteKey,theme:o})}),f&&C.jsx("div",{className:"mx-auto",children:C.jsx(fD,{ref:e,sitekey:r.siteKey,theme:o})})]})}function rf({className:e,enableToggle:t,onChange:n,...r}){const[o,s]=M.useState(!0),[l,c]=M.useState(!1);return C.jsxs("div",{className:"relative",children:[C.jsx(ni,{className:Ce(t&&"pr-10",e),...r,type:l&&t?"text":"password",onChange:d=>{s(!d.target.value),n?.(d)}}),t&&C.jsxs(C.Fragment,{children:[C.jsx(rn,{className:"!bg-transparent absolute top-0 right-0",disabled:o,size:"icon",type:"button",variant:"ghost",onClick:()=>c(!l),children:l?C.jsx(rK,{}):C.jsx(nK,{})}),C.jsx("style",{children:`
|
|
149
149
|
.hide-password-toggle::-ms-reveal,
|
|
150
150
|
.hide-password-toggle::-ms-clear {
|
|
151
151
|
visibility: hidden;
|
|
152
152
|
pointer-events: none;
|
|
153
153
|
display: none;
|
|
154
154
|
}
|
|
155
|
-
`})]})]})}function Mi({redirectTo:e}){const{redirectTo:t}=M.useContext(pt),[n,r]=M.useState(!1),{navigate:o,hooks:{useSession:s},onSessionChange:l}=M.useContext(pt),{refetch:c}=s();return{onSuccess:M.useCallback(async()=>{r(!0),await c?.(),l&&await l(),r(!1);const f=e||ml("redirectTo")||t;o(f)},[c,l,o,e,t]),isPending:n}}function e5({redirectTo:e}){const{hooks:{useIsRestoring:t},persistClient:n}=M.useContext(pt),r=t?.(),o=M.useRef(!1),{onSuccess:s}=Mi({redirectTo:e});return M.useEffect(()=>{if(!o.current){if(!n){o.current=!0,s();return}r||(o.current=!0,s())}},[r,n,s]),C.jsx(Ar,{className:"animate-spin"})}function jS({className:e,containerClassName:t,...n}){return C.jsx(zD,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function fc({className:e,...t}){return C.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function rr({index:e,className:t,...n}){const r=M.useContext(jD),{char:o,hasFakeCaret:s,isActive:l}=r?.slots[e]??{};return C.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[o,s&&C.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:C.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function G_({...e}){return C.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:C.jsx(iK,{})})}function zS({otpSeparators:e=0}){return e===0?C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2}),C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]}):e===1?C.jsxs(C.Fragment,{children:[C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]}):C.jsxs(C.Fragment,{children:[C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:2}),C.jsx(rr,{index:3})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]})}function SA(e){const[t,n]=M.useState();return t?C.jsx(jte,{...e,email:t}):C.jsx($te,{...e,setEmail:n})}function $te({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o,setEmail:s}){const l=ms(),{captchaRef:c,getCaptchaHeaders:d}=xf({localization:r}),{authClient:f,localization:p,toast:h,localizeErrors:g}=M.useContext(pt);r={...p,...r};const v=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),_=Ti({resolver:Ci(v),defaultValues:{email:""}});n=n||_.formState.isSubmitting,M.useEffect(()=>{o?.(_.formState.isSubmitting)},[_.formState.isSubmitting,o]);async function b({email:x}){const S={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:x,type:"sign-in",fetchOptions:S}),h({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),s(x)}catch(E){h({variant:"error",message:kn({error:E,localization:r,localizeErrors:g})})}}return C.jsx(Ii,{..._,children:C.jsxs("form",{method:"POST",onSubmit:_.handleSubmit(b),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:_.control,name:"email",render:({field:x})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...x})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:c,localization:r,action:"/email-otp/send-verification-otp"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function jte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l,email:c}){const{authClient:d,localization:f,toast:p,localizeErrors:h}=M.useContext(pt);r={...f,...r};const{onSuccess:g,isPending:v}=Mi({redirectTo:s}),_=be({code:$().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),b=Ti({resolver:Ci(_),defaultValues:{code:""}});n=n||b.formState.isSubmitting||v,M.useEffect(()=>{l?.(b.formState.isSubmitting||v)},[b.formState.isSubmitting,v,l]);async function x({code:S}){try{await d.signIn.emailOtp({email:c,otp:S,fetchOptions:{throw:!0}}),await g()}catch(E){p({variant:"error",message:kn({error:E,localization:r,localizeErrors:h})}),b.reset()}}return C.jsx(Ii,{...b,children:C.jsxs("form",{method:"POST",onSubmit:b.handleSubmit(x),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:b.control,name:"code",render:({field:S})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(jS,{...S,maxLength:6,onChange:E=>{S.onChange(E),E.length===6&&b.handleSubmit(x)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx("div",{className:"grid gap-4",children:C.jsxs(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function zte({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:o,callbackURL:s,isSubmitting:l,redirectTo:c,setIsSubmitting:d}){const[f,p]=M.useState(!0),[h,g]=M.useState(30),{authClient:v,localization:_,toast:b,localizeErrors:x,navigate:S,basePath:E,viewPaths:T}=M.useContext(pt);t={..._,...t};const R=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:O,isPending:A}=Mi({redirectTo:c}),I=be({code:$().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),P=Ti({resolver:Ci(I),defaultValues:{code:""}}),L=l||P.formState.isSubmitting||A;M.useEffect(()=>{d?.(P.formState.isSubmitting||A)},[P.formState.isSubmitting,A,d]),M.useEffect(()=>{if(h>0){const B=setTimeout(()=>g(h-1),1e3);return()=>clearTimeout(B)}else p(!1)},[h]);async function q({code:B}){try{const F=await v.emailOtp.verifyEmail({email:R,otp:B,fetchOptions:{throw:!0}});"token"in F&&F.token?await O():(S(`${E}/${T.SIGN_IN}${window.location.search}`),b({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(F){b({variant:"error",message:kn({error:F,localization:t,localizeErrors:x})}),P.reset()}}async function j(){if(!f){p(!0),g(30);try{await v.emailOtp.sendVerificationOtp({email:R,type:"email-verification",fetchOptions:{throw:!0}}),b({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(B){b({variant:"error",message:kn({error:B,localization:t,localizeErrors:x})}),p(!1),g(0)}}}return R?C.jsx(Ii,{...P,children:C.jsxs("form",{method:"POST",onSubmit:P.handleSubmit(q),className:Ce("grid w-full gap-6",n,r?.base),children:[C.jsx(In,{control:P.control,name:"code",render:({field:B})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:r?.label,children:t.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(jS,{...B,maxLength:6,onChange:F=>{B.onChange(F),F.length===6&&P.handleSubmit(q)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:L,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:r?.error})]})}),C.jsxs("div",{className:"grid gap-4",children:[C.jsxs(sn,{type:"submit",disabled:L,className:Ce(r?.button,r?.primaryButton),children:[L&&C.jsx(Ar,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),C.jsx(sn,{type:"button",variant:"outline",onClick:j,disabled:f||L,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${h}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&C.jsx(sn,{type:"button",variant:"ghost",onClick:e,disabled:L,className:"w-full",children:t.CANCEL})]})]})}):C.jsx("div",{className:Ce("grid w-full gap-6",n),children:C.jsxs("div",{className:"text-center",children:[C.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),C.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function Ute({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o}){const s=ms(),{captchaRef:l,getCaptchaHeaders:c,resetCaptcha:d}=xf({localization:r}),{authClient:f,basePath:p,baseURL:h,localization:g,navigate:v,toast:_,viewPaths:b,localizeErrors:x}=M.useContext(pt);r={...g,...r};const S=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),E=Ti({resolver:Ci(S),defaultValues:{email:""}});n=n||E.formState.isSubmitting,M.useEffect(()=>{o?.(E.formState.isSubmitting)},[E.formState.isSubmitting,o]);async function T({email:R}){try{const O={throw:!0,headers:await c("/forget-password")};await f.requestPasswordReset({email:R,redirectTo:`${h}${p}/${b.RESET_PASSWORD}`,fetchOptions:O}),_({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),v(`${p}/${b.SIGN_IN}${window.location.search}`)}catch(O){_({variant:"error",message:kn({error:O,localization:r,localizeErrors:x})}),d()}}return C.jsx(Ii,{...E,children:C.jsxs("form",{method:"POST",onSubmit:E.handleSubmit(T),noValidate:s,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:E.control,name:"email",render:({field:R})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...R})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:l,localization:r,action:"/forget-password"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function EA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l}){const c=ms(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:p}=xf({localization:o}),{authClient:h,basePath:g,baseURL:v,persistClient:_,localization:b,redirectTo:x,viewPaths:S,toast:E,localizeErrors:T}=M.useContext(pt);o={...b,...o};const R=M.useCallback(()=>s||ml("redirectTo")||x,[s,x]),O=M.useCallback(()=>`${v}${n||(_?`${g}/${S.CALLBACK}?redirectTo=${encodeURIComponent(R())}`:R())}`,[n,_,g,S,v,R]),A=be({email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),I=Ti({resolver:Ci(A),defaultValues:{email:""}});r=r||I.formState.isSubmitting,M.useEffect(()=>{l?.(I.formState.isSubmitting)},[I.formState.isSubmitting,l]);async function P({email:L}){try{const q={throw:!0,headers:await f("/sign-in/magic-link")};await h.signIn.magicLink({email:L,callbackURL:O(),fetchOptions:q}),E({variant:"success",message:o.MAGIC_LINK_EMAIL}),I.reset()}catch(q){E({variant:"error",message:kn({error:q,localization:o,localizeErrors:T})}),p()}}return C.jsx(Ii,{...I,children:C.jsxs("form",{method:"POST",onSubmit:I.handleSubmit(P),noValidate:c,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:I.control,name:"email",render:({field:L})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...L})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:d,localization:o,action:"/sign-in/magic-link"}),C.jsx(sn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.MAGIC_LINK_ACTION})]})})}function Fte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s}){const{authClient:l,localization:c,toast:d,localizeErrors:f}=M.useContext(pt);r={...c,...r};const{onSuccess:p,isPending:h}=Mi({redirectTo:o}),g=be({code:$().min(1,{message:r.BACKUP_CODE_REQUIRED})}),v=Ti({resolver:Ci(g),defaultValues:{code:""}});n=n||v.formState.isSubmitting||h,M.useEffect(()=>{s?.(v.formState.isSubmitting||h)},[v.formState.isSubmitting,h,s]);async function _({code:b}){try{await l.twoFactor.verifyBackupCode({code:b,fetchOptions:{throw:!0}}),await p()}catch(x){d({variant:"error",message:kn({error:x,localization:r,localizeErrors:f})}),v.reset()}}return C.jsx(Ii,{...v,children:C.jsxs("form",{method:"POST",onSubmit:v.handleSubmit(_),className:Ce("grid gap-6",e,t?.base),children:[C.jsx(In,{control:v.control,name:"code",render:({field:b})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.BACKUP_CODE}),C.jsx(qn,{children:C.jsx(ni,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...b})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function Bte({className:e,classNames:t,localization:n,passwordValidation:r}){const o=M.useRef(!1),{authClient:s,basePath:l,credentials:c,localization:d,viewPaths:f,navigate:p,toast:h,localizeErrors:g}=M.useContext(pt),v=c?.confirmPassword,_=c?.passwordValidation;n={...d,...n},r={..._,...r};const b=be({newPassword:Wd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:v?Wd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):$().optional()}).refine(T=>!v||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),x=Ti({resolver:Ci(b),defaultValues:{newPassword:"",confirmPassword:""}}),S=x.formState.isSubmitting;M.useEffect(()=>{if(o.current)return;o.current=!0;const R=new URLSearchParams(window.location.search).get("token");(!R||R==="INVALID_TOKEN")&&(p(`${l}/${f.SIGN_IN}${window.location.search}`),h({variant:"error",message:n.INVALID_TOKEN}))},[l,p,h,f,n]);async function E({newPassword:T}){try{const O=new URLSearchParams(window.location.search).get("token");await s.resetPassword({newPassword:T,token:O,fetchOptions:{throw:!0}}),h({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),p(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(R){h({variant:"error",message:kn({error:R,localization:n,localizeErrors:g})}),x.reset()}}return C.jsx(Ii,{...x,children:C.jsxs("form",{method:"POST",onSubmit:x.handleSubmit(E),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:x.control,name:"newPassword",render:({field:T})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:n.NEW_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Yn,{className:t?.error})]})}),v&&C.jsx(In,{control:x.control,name:"confirmPassword",render:({field:T})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:n.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(sn,{type:"submit",disabled:S,className:Ce("w-full",t?.button,t?.primaryButton),children:S?C.jsx(Ar,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function Vte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s,passwordValidation:l,callbackURL:c}){const d=ms(),{captchaRef:f,getCaptchaHeaders:p,resetCaptcha:h}=xf({localization:r}),{authClient:g,basePath:v,credentials:_,localization:b,viewPaths:x,navigate:S,toast:E,Link:T,localizeErrors:R,emailVerification:O}=M.useContext(pt),A=_?.rememberMe,I=_?.username,P=_?.passwordValidation;r={...b,...r},l={...P,...l};const{onSuccess:L,isPending:q}=Mi({redirectTo:o}),j=be({email:I?$().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:Wd(l,r),rememberMe:Nt().optional()}),B=Ti({resolver:Ci(j),defaultValues:{email:"",password:"",rememberMe:!A}});n=n||B.formState.isSubmitting||q,M.useEffect(()=>{s?.(B.formState.isSubmitting||q)},[B.formState.isSubmitting,q,s]);async function F({email:Z,password:ie,rememberMe:H}){var W;try{let te={};if(I&&!PH(Z)){const le={throw:!0,headers:await p("/sign-in/username")};te=await g.signIn.username({username:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}else{const le={throw:!0,headers:await p("/sign-in/email")};te=await g.signIn.email({email:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}te.twoFactorRedirect?S(`${v}/${x.TWO_FACTOR}${window.location.search}`):await L()}catch(te){B.resetField("password"),h(),E({variant:"error",message:kn({error:te,localization:r,localizeErrors:R})}),O?.otp&&((W=te?.error)==null?void 0:W.code)==="EMAIL_NOT_VERIFIED"&&S(`${v}/${x.EMAIL_VERIFICATION}?email=${encodeURIComponent(Z)}`)}}return C.jsx(Ii,{...B,children:C.jsxs("form",{method:"POST",onSubmit:B.handleSubmit(F),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:B.control,name:"email",render:({field:Z})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:B.control,name:"password",render:({field:Z})=>C.jsxs(Mn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Pn,{className:t?.label,children:r.PASSWORD}),_?.forgotPassword&&C.jsx(T,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${v}/${x.FORGOT_PASSWORD}${d?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Yn,{className:t?.error})]})}),A&&C.jsx(In,{control:B.control,name:"rememberMe",render:({field:Z})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:Z.value,onCheckedChange:Z.onChange,disabled:n})}),C.jsx(Pn,{children:r.REMEMBER_ME})]})}),C.jsx(Rf,{ref:f,localization:r,action:"/sign-in/email"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function qte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l,passwordValidation:c}){var d,f,p,h,g,v;const _=ms(),{captchaRef:b,getCaptchaHeaders:x,resetCaptcha:S}=xf({localization:o}),{additionalFields:E,authClient:T,basePath:R,baseURL:O,credentials:A,localization:I,nameRequired:P,persistClient:L,redirectTo:q,signUp:j,viewPaths:B,navigate:F,toast:Z,avatar:ie,localizeErrors:H,emailVerification:W}=M.useContext(pt),te=A?.confirmPassword,le=A?.username,Q=A?.usernameRequired??!0,k=A?.passwordValidation,G=j?.fields;o={...I,...o},c={...k,...c};const V=M.useRef(null),[D,U]=M.useState(null),[X,fe]=M.useState(!1),pe=M.useCallback(()=>s||ml("redirectTo")||q,[s,q]),xe=M.useCallback(()=>`${O}${n||(L?`${R}/${B.CALLBACK}?redirectTo=${encodeURIComponent(pe())}`:pe())}`,[n,L,R,B,O,pe]),{onSuccess:je,isPending:Y}=Mi({redirectTo:s}),re={email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:Wd(c,o),name:G?.includes("name")&&P?$().min(1,{message:`${o.NAME} ${o.IS_REQUIRED}`}):$().optional(),image:$().optional(),username:le&&Q?$().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):$().optional(),confirmPassword:te?Wd(c,{PASSWORD_REQUIRED:o.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:o.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:o.PASSWORD_TOO_LONG,INVALID_PASSWORD:o.INVALID_PASSWORD}):$().optional()},ve={};if(G)for(const Pe of G){if(Pe==="name"||Pe==="image")continue;const Me=E?.[Pe];if(!Me)continue;let Ue;Me.type==="number"?Ue=Me.required?Gw(K=>K?Number(K):void 0,at({message:((d=Me.errorMessage)==null?void 0:d.invalid)??`${Me.label} ${o.IS_INVALID}`})):tN({message:((f=Me.errorMessage)==null?void 0:f.invalid)??`${Me.label} ${o.IS_INVALID}`}).optional():Me.type==="boolean"?Ue=Me.required?kT({message:((p=Me.errorMessage)==null?void 0:p.invalid)??`${Me.label} ${o.IS_INVALID}`}).refine(K=>K===!0,{message:((h=Me.errorMessage)==null?void 0:h.required)??`${Me.label} ${o.IS_REQUIRED}`}):kT({message:((g=Me.errorMessage)==null?void 0:g.invalid)??`${Me.label} ${o.IS_INVALID}`}).optional():Ue=Me.required?$().min(1,((v=Me.errorMessage)==null?void 0:v.required)??`${Me.label} ${o.IS_REQUIRED}`):$().optional(),ve[Pe]=Ue}const se=be(re).extend(ve).refine(Pe=>te?Pe.password===Pe.confirmPassword:!0,{message:o.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Se={email:"",password:"",...te&&{confirmPassword:""},...G?.includes("name")?{name:""}:{},...le?{username:""}:{},...G?.includes("image")&&ie?{image:""}:{}};if(G)for(const Pe of G){if(Pe==="name"||Pe==="image")continue;const Me=E?.[Pe];Me&&(Se[Pe]=Me.type==="boolean"?!1:"")}const Te=Ti({resolver:Ci(se),defaultValues:Se});r=r||Te.formState.isSubmitting||Y,M.useEffect(()=>{l?.(Te.formState.isSubmitting||Y)},[Te.formState.isSubmitting,Y,l]);const tt=async Pe=>{if(ie){fe(!0);try{const Me=await Qee(Pe,crypto.randomUUID(),ie.size,ie.extension);let Ue;ie.upload?Ue=await ie.upload(Me):Ue=await Jee(Me),Ue?(U(Ue),Te.setValue("image",Ue)):(U(null),Te.setValue("image",""))}catch(Me){console.error(Me),Z({variant:"error",message:kn({error:Me,localization:o,localizeErrors:H})})}fe(!1)}},rt=()=>{U(null),Te.setValue("image","")},Be=()=>{var Pe;return(Pe=V.current)==null?void 0:Pe.click()};async function Qe({email:Pe,password:Me,name:Ue,username:K,confirmPassword:ne,image:ae,...Oe}){var Ae,Ie;try{for(const[vt,Tt]of Object.entries(Oe)){const yt=E?.[vt];if(yt?.validate&&typeof Tt=="string"&&!await yt.validate(Tt)){Te.setError(vt,{message:((Ae=yt.errorMessage)==null?void 0:Ae.validate)??((Ie=yt.errorMessage)==null?void 0:Ie.invalid)??`${yt.label} ${o.IS_INVALID}`});return}}const ke={throw:!0,headers:await x("/sign-up/email")},Je={};K!==void 0&&(!Q&&(K===null||K===""||typeof K=="string"&&K.trim()==="")||(Je.username=K)),ae!==void 0&&(Je.image=ae);const et=await T.signUp.email({email:Pe,password:Me,name:Ue||"",...Je,...Oe,callbackURL:xe(),fetchOptions:ke});"token"in et&&et.token?await je():W?.otp?F(`${R}/${B.EMAIL_VERIFICATION}?email=${encodeURIComponent(Pe)}`):(F(`${R}/${B.SIGN_IN}${window.location.search}`),Z({variant:"success",message:o.SIGN_UP_EMAIL}))}catch(ke){Z({variant:"error",message:kn({error:ke,localization:o,localizeErrors:H})}),Te.resetField("password"),Te.resetField("confirmPassword"),S()}}return C.jsx(Ii,{...Te,children:C.jsxs("form",{method:"POST",onSubmit:Te.handleSubmit(Qe),noValidate:_,className:Ce("grid w-full gap-6",e,t?.base),children:[G?.includes("image")&&ie&&C.jsxs(C.Fragment,{children:[C.jsx("input",{ref:V,accept:"image/*",disabled:X,hidden:!0,type:"file",onChange:Pe=>{var Me;const Ue=(Me=Pe.target.files)==null?void 0:Me.item(0);Ue&&tt(Ue),Pe.target.value=""}}),C.jsx(In,{control:Te.control,name:"image",render:()=>C.jsxs(Mn,{children:[C.jsx(Pn,{children:o.AVATAR}),C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsxs(ete,{children:[C.jsx(tte,{asChild:!0,children:C.jsx(sn,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:C.jsx(ite,{isPending:X,className:"size-16",user:D?{name:Te.watch("name"),email:Te.watch("email"),image:D}:null,localization:o})})}),C.jsxs(nte,{align:"start",onCloseAutoFocus:Pe=>Pe.preventDefault(),children:[C.jsxs(wA,{onClick:Be,disabled:X,children:[C.jsx(tK,{}),o.UPLOAD_AVATAR]}),D&&C.jsxs(wA,{onClick:rt,disabled:X,variant:"destructive",children:[C.jsx(aK,{}),o.DELETE_AVATAR]})]})]}),C.jsxs(sn,{type:"button",variant:"outline",onClick:Be,disabled:X,children:[X&&C.jsx(Ar,{className:"animate-spin"}),o.UPLOAD]})]}),C.jsx(Yn,{})]})})]}),G?.includes("name")&&C.jsx(In,{control:Te.control,name:"name",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsxs(Pn,{className:t?.label,children:[o.NAME,!P&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"name",className:t?.input,placeholder:o.NAME_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),le&&C.jsx(In,{control:Te.control,name:"username",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsxs(Pn,{className:t?.label,children:[o.USERNAME,!Q&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"username",className:t?.input,placeholder:o.USERNAME_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"email",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"email",className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"password",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),te&&C.jsx(In,{control:Te.control,name:"confirmPassword",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),G?.filter(Pe=>Pe!=="name"&&Pe!=="image").map(Pe=>{const Me=E?.[Pe];return Me?Me.type==="boolean"?C.jsx(In,{control:Te.control,name:Pe,render:({field:Ue})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:Ue.value,onCheckedChange:Ue.onChange,disabled:r})}),C.jsx(Pn,{className:t?.label,children:Me.label}),C.jsx(Yn,{className:t?.error})]})},Pe):C.jsx(In,{control:Te.control,name:Pe,render:({field:Ue})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:Me.label}),C.jsx(qn,{children:Me.type==="number"?C.jsx(ni,{className:t?.input,type:"number",placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value}):Me.multiline?C.jsx(ate,{className:t?.input,placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value}):C.jsx(ni,{className:t?.input,type:"text",placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value})}),C.jsx(Yn,{className:t?.error})]})},Pe):(console.error(`Additional field ${Pe} not found`),null)}),C.jsx(Rf,{ref:b,localization:o,action:"/sign-up/email"}),C.jsx(sn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.SIGN_UP_ACTION})]})})}function Hte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l}){var c;const d=ms(),f=d?ml("totpURI"):null,p=M.useRef(!1),{authClient:h,basePath:g,hooks:{useSession:v},localization:_,twoFactor:b,viewPaths:x,toast:S,Link:E,localizeErrors:T}=M.useContext(pt);r={..._,...r};const{onSuccess:R,isPending:O}=Mi({redirectTo:s}),{data:A}=v(),I=(c=A?.user)==null?void 0:c.twoFactorEnabled,[P,L]=M.useState(b?.length===1?b[0]:null),[q,j]=M.useState(!1),[B,F]=M.useState(0),Z=be({code:$().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:Nt().optional()}),ie=Ti({resolver:Ci(Z),defaultValues:{code:""}});n=n||ie.formState.isSubmitting||O,M.useEffect(()=>{l?.(ie.formState.isSubmitting||O)},[ie.formState.isSubmitting,O,l]),M.useEffect(()=>{P==="otp"&&B<=0&&!p.current&&(p.current=!0,H())},[P]),M.useEffect(()=>{if(B<=0)return;const te=setTimeout(()=>{F(le=>le-1)},1e3);return()=>clearTimeout(te)},[B]);const H=async()=>{if(!(q||B>0)){try{j(!0),await h.twoFactor.sendOtp({fetchOptions:{throw:!0}}),F(60)}catch(te){S({variant:"error",message:kn({error:te,localization:r,localizeErrors:T})}),te.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}p.current=!1,j(!1)}};async function W({code:te,trustDevice:le}){try{await(P==="totp"?h.twoFactor.verifyTotp:h.twoFactor.verifyOtp)({code:te,trustDevice:le,fetchOptions:{throw:!0}}),await R(),A&&!I&&S({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(Q){S({variant:"error",message:kn({error:Q,localization:r,localizeErrors:T})}),ie.reset()}}return C.jsx(Ii,{...ie,children:C.jsxs("form",{method:"POST",onSubmit:ie.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[b?.includes("totp")&&f&&P==="totp"&&C.jsxs("div",{className:"space-y-3",children:[C.jsx(KD,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),C.jsx(qee,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),P!==null&&C.jsxs(C.Fragment,{children:[C.jsx(In,{control:ie.control,name:"code",render:({field:te})=>C.jsxs(Mn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Pn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),C.jsx(E,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${x.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),C.jsx(qn,{children:C.jsx(jS,{...te,maxLength:6,onChange:le=>{te.onChange(le),le.length===6&&ie.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:ie.control,name:"trustDevice",render:({field:te})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:te.value,onCheckedChange:te.onChange,disabled:n,className:t?.checkbox})}),C.jsx(Pn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),C.jsxs("div",{className:"grid gap-4",children:[P!==null&&C.jsxs(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),P==="otp"&&b?.includes("otp")&&C.jsxs(sn,{type:"button",variant:"outline",onClick:H,disabled:B>0||q||n,className:Ce(t?.button,t?.outlineButton),children:[q?C.jsx(Ar,{className:"animate-spin"}):C.jsx(tC,{className:t?.icon}),r.RESEND_CODE,B>0&&` (${B})`]}),P!=="otp"&&b?.includes("otp")&&C.jsxs(sn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("otp"),disabled:n,children:[C.jsx(tC,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),P!=="totp"&&b?.includes("totp")&&C.jsxs(sn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("totp"),disabled:n,children:[C.jsx(sK,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function t5({redirectTo:e}){const t=M.useRef(!1),{authClient:n,basePath:r,viewPaths:o}=M.useContext(pt),{onSuccess:s}=Mi({redirectTo:e||`${r}/${o.SIGN_IN}`});return M.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(s))},[n,s]),C.jsx(Ar,{className:"animate-spin"})}function Gte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,pathname:s,redirectTo:l,view:c,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:p,credentials:h,localization:g,magicLink:v,emailOTP:_,signUp:b,twoFactor:x,viewPaths:S,replace:E}=M.useContext(pt),T=!!b;if(o={...g,...o},M.useEffect(()=>{s&&!Kb(S,s)&&(console.error(`Invalid auth view: ${s}`),E(`${p}/${S.SIGN_IN}${window.location.search}`))},[s,S,p,E]),c=c||Kb(S,s)||"SIGN_IN",M.useEffect(()=>{let R=!1;c==="MAGIC_LINK"&&(!v||!h&&!_)&&(R=!0),c==="EMAIL_OTP"&&(!_||!h&&!v)&&(R=!0),c==="SIGN_UP"&&!T&&(R=!0),!h&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&(R=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&!x&&(R=!0),R&&E(`${p}/${S.SIGN_IN}${window.location.search}`)},[p,c,S,h,E,_,T,v,x]),c==="SIGN_OUT")return C.jsx(t5,{redirectTo:l});if(c==="CALLBACK")return C.jsx(e5,{redirectTo:l});if(c==="SIGN_IN")return h?C.jsx(Vte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f,callbackURL:n}):v?C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):_?C.jsx(SA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(c==="TWO_FACTOR")return C.jsx(Hte,{className:e,classNames:t,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="RECOVER_ACCOUNT")return C.jsx(Fte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="MAGIC_LINK")return C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_OTP")return C.jsx(SA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_VERIFICATION")return C.jsx(zte,{className:e,classNames:t,callbackURL:n,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="FORGOT_PASSWORD")return C.jsx(Ute,{className:e,classNames:t,localization:o,isSubmitting:r,setIsSubmitting:f});if(c==="RESET_PASSWORD")return C.jsx(Bte,{className:e,classNames:t,localization:o});if(c==="SIGN_UP")return T&&C.jsx(qte,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function Kte({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:o,replace:s,toast:l}=M.useContext(pt),c=M.useMemo(()=>({...r,...n}),[r,n]),{data:d}=Yee(),[f,p]=M.useState(null);return M.useEffect(()=>{const h=ml("invitationId");if(!h){l({variant:"error",message:c.INVITATION_NOT_FOUND}),s(o);return}p(h)},[c.INVITATION_NOT_FOUND,l,s,o]),!d||!f?C.jsx(n5,{className:e,classNames:t}):C.jsx(Zte,{className:e,classNames:t,localization:c,invitationId:f})}function Zte({className:e,classNames:t,localization:n,invitationId:r}){var o;const{authClient:s,hooks:{useInvitation:l},localization:c,organization:d,redirectTo:f,replace:p,toast:h,localizeErrors:g}=M.useContext(pt),v=M.useMemo(()=>({...c,...n}),[c,n]),[_,b]=M.useState(!1),[x,S]=M.useState(!1),E=_||x,{data:T,isPending:R}=l({query:{id:r}}),O=M.useCallback(()=>ml("redirectTo")||f,[f]);M.useEffect(()=>{if(!(R||!r)){if(!T){h({variant:"error",message:v.INVITATION_NOT_FOUND}),p(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(h({variant:"error",message:new Date(T.expiresAt)<new Date?v.INVITATION_EXPIRED:v.INVITATION_NOT_FOUND}),p(f))}},[T,R,r,v,h,p,f]);const A=async()=>{S(!0);try{await s.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_ACCEPTED||"Invitation accepted"}),p(O())}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),S(!1)}},I=async()=>{b(!0);try{await s.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_REJECTED}),p(f)}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),b(!1)}},q=((o=[...[{role:"owner",label:v.OWNER},{role:"admin",label:v.ADMIN},{role:"member",label:v.MEMBER}],...d?.customRoles||[]].find(j=>j.role===T?.role))==null?void 0:o.label)||T?.role;return T?C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(kS,{className:Ce("justify-items-center text-center",t?.header),children:[C.jsx(HD,{className:Ce("text-lg md:text-xl",t?.title),children:v.ACCEPT_INVITATION}),C.jsx(GD,{className:Ce("text-xs md:text-sm",t?.description),children:v.ACCEPT_INVITATION_DESCRIPTION})]}),C.jsxs(DS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(JD,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:v}),C.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:q})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsxs(sn,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:I,disabled:E,children:[_?C.jsx(Ar,{className:"animate-spin"}):C.jsx(cK,{}),v.REJECT]}),C.jsxs(sn,{className:Ce(t?.button,t?.primaryButton),onClick:A,disabled:E,children:[x?C.jsx(Ar,{className:"animate-spin"}):C.jsx(DN,{}),v.ACCEPT]})]})]})]}):C.jsx(n5,{className:e,classNames:t})}var n5=({className:e,classNames:t,localization:n})=>C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(kS,{className:Ce("justify-items-center",t?.header),children:[C.jsx(ss,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),C.jsx(ss,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),C.jsxs(DS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(JD,{isPending:!0,localization:n}),C.jsx(ss,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsx(ss,{className:"h-9 w-full"}),C.jsx(ss,{className:"h-9 w-full"})]})]})]});function xA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return C.jsx(Zee,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Yte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p}=M.useContext(pt);return C.jsxs(sn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?C.jsx(LN,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx($N,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function Wte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p,credentials:h}=M.useContext(pt);return C.jsxs(sn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="MAGIC_LINK"||!h?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?C.jsx(LN,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx($N,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function Qte({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:o,localizeErrors:s}=M.useContext(pt),l=M.useRef(!1);e=M.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:c}=Mi({redirectTo:t});return M.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:c}})}catch(d){o({variant:"error",message:kn({error:d,localization:e,localizeErrors:s})})}}},[n,e,s,c,o]),null}function Xte({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:o}){var s,l;const{authClient:c,localization:d,toast:f,localizeErrors:p}=M.useContext(pt);n={...d,...n};const{onSuccess:h}=Mi({redirectTo:r}),g=async()=>{o?.(!0);try{const v=await c.signIn.passkey({fetchOptions:{throw:!0}});v?.error?(f({variant:"error",message:kn({error:v.error,localization:n,localizeErrors:p})}),o?.(!1)):h()}catch(v){f({variant:"error",message:kn({error:v,localization:n,localizeErrors:p})}),o?.(!1)}};return C.jsxs(sn,{className:Ce("w-full",(s=e?.form)==null?void 0:s.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[C.jsx(oK,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function RA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,other:s,provider:l,redirectTo:c,socialLayout:d,setIsSubmitting:f}){var p,h,g,v;const{authClient:_,basePath:b,baseURL:x,persistClient:S,redirectTo:E,viewPaths:T,social:R,genericOAuth:O,toast:A,localizeErrors:I}=M.useContext(pt),P=M.useCallback(()=>c||ml("redirectTo")||E,[c,E]),L=M.useCallback(()=>`${x}${n||(S?`${b}/${T.CALLBACK}?redirectTo=${encodeURIComponent(P())}`:P())}`,[n,S,b,T,x,P]),q=async()=>{f(!0);try{if(s){const j={providerId:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.oauth2(j)}else{const j={provider:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};R?.signIn?(await R.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.social(j)}}catch(j){A({variant:"error",message:kn({error:j,localization:o,localizeErrors:I})}),f(!1)}};return C.jsxs(sn,{className:Ce(d==="vertical"?"w-full":"grow",e,(p=t?.form)==null?void 0:p.button,(h=t?.form)==null?void 0:h.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:q,children:[l.icon&&C.jsx(l.icon,{className:(v=t?.form)==null?void 0:v.icon}),d==="grid"&&l.name,d==="vertical"&&`${o.SIGN_IN_WITH} ${l.name}`]})}function Qce({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:o,localization:s,path:l,pathname:c,redirectTo:d,socialLayout:f="auto",view:p,otpSeparators:h=0}){var g,v,_,b,x,S;const E=ms(),{basePath:T,credentials:R,localization:O,magicLink:A,emailOTP:I,oneTap:P,passkey:L,signUp:q,social:j,genericOAuth:B,viewPaths:F,Link:Z}=M.useContext(pt);s={...O,...s};let ie=f;ie==="auto"&&(ie=R&&j?.providers&&j.providers.length>2?"horizontal":"vertical");const H=l??c?.split("/").pop(),W=p||Kb(F,H)||"SIGN_IN",[te,le]=M.useState(!1);if(M.useEffect(()=>{const k=()=>le(!1);return window.addEventListener("pagehide",k),()=>{le(!1),window.removeEventListener("pagehide",k)}},[]),W==="CALLBACK")return C.jsx(e5,{redirectTo:d});if(W==="SIGN_OUT")return C.jsx(t5,{redirectTo:d});if(W==="ACCEPT_INVITATION")return C.jsx(Kte,{className:e,classNames:t});const Q=!R&&!A&&!I?s.DISABLED_CREDENTIALS_DESCRIPTION:s[`${W}_DESCRIPTION`];return C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsx(kS,{className:t?.header,children:r||C.jsxs(C.Fragment,{children:[C.jsx(HD,{className:Ce("text-lg md:text-xl",t?.title),children:s[W]}),Q&&C.jsx(GD,{className:Ce("text-xs md:text-sm",t?.description),children:Q})]})}),C.jsxs(DS,{className:Ce("grid gap-6",t?.content),children:[P&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&C.jsx(Qte,{localization:s,redirectTo:d}),(R||A||I)&&C.jsxs("div",{className:"grid gap-4",children:[C.jsx(Gte,{classNames:t?.form,callbackURL:n,isSubmitting:te,localization:s,otpSeparators:h,view:W,redirectTo:d,setIsSubmitting:le}),A&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&W==="EMAIL_OTP")&&C.jsx(Wte,{classNames:t,localization:s,view:W,isSubmitting:te}),I&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||A&&["SIGN_IN","MAGIC_LINK"].includes(W))&&C.jsx(Yte,{classNames:t,localization:s,view:W,isSubmitting:te})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=j?.providers)==null?void 0:g.length)||((v=B?.providers)==null?void 0:v.length)||W==="SIGN_IN"&&L)&&C.jsxs(C.Fragment,{children:[(R||A||I)&&C.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[C.jsx(xA,{className:Ce("!w-auto grow",t?.separator)}),C.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:s.OR_CONTINUE_WITH}),C.jsx(xA,{className:Ce("!w-auto grow",t?.separator)})]}),C.jsxs("div",{className:"grid gap-4",children:[(((_=j?.providers)==null?void 0:_.length)||((b=B?.providers)==null?void 0:b.length))&&C.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",ie==="horizontal"&&"flex-wrap",ie==="vertical"&&"flex-col",ie==="grid"&&"grid grid-cols-2"),children:[(x=j?.providers)==null?void 0:x.map(k=>{const G=Mte.find(V=>V.provider===k);return G?C.jsx(RA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:G,redirectTo:d,setIsSubmitting:le,socialLayout:ie},k):null}),(S=B?.providers)==null?void 0:S.map(k=>C.jsx(RA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:k,redirectTo:d,setIsSubmitting:le,socialLayout:ie,other:!0},k.provider))]}),L&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&C.jsx(Xte,{classNames:t,isSubmitting:te,localization:s,redirectTo:d,setIsSubmitting:le})]})]})]}),o&&C.jsx(bA,{className:t?.footer,children:o}),R&&q&&C.jsxs(bA,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?s.ALREADY_HAVE_AN_ACCOUNT:C.jsx(JG,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?C.jsx(Z,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${F[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${E?window.location.search:""}`,children:C.jsx(sn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.SIGN_UP:s.SIGN_IN})}):C.jsx(sn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:s.GO_BACK})]})]})}function Xce({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{isPending:n}=t();return n?e:null}function Jce({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{data:n}=t();return n?e:null}function eue({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{data:n,isPending:r}=t();return!n&&!r?e:null}function Jte(e){const t=er.c(8),{children:n}=e,r=Ng();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={basePath:"/",pathMode:"slug"},t[0]=o):o=t[0];let s,l;t[1]!==r?(s=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let c;return t[4]!==n||t[5]!==s||t[6]!==l?(c=C.jsx(YG,{authClient:Vg,redirectTo:"/",organization:o,navigate:s,replace:l,Link:ene,children:n}),t[4]=n,t[5]=s,t[6]=l,t[7]=c):c=t[7],c}function ene(e){const{href:t,className:n,children:r,...o}=e;return C.jsx(Dg,{to:t,className:n,...o,children:r})}var me=typeof window<"u"?window:void 0,Qn=typeof globalThis<"u"?globalThis:me;typeof self>"u"&&(Qn.self=Qn),typeof File>"u"&&(Qn.File=function(){});var go=Qn?.navigator,Le=Qn?.document,pr=Qn?.location,y1=Qn?.fetch,_1=Qn!=null&&Qn.XMLHttpRequest&&"withCredentials"in new Qn.XMLHttpRequest?Qn.XMLHttpRequest:void 0,OA=Qn?.AbortController,tne=Qn?.CompressionStream,Yr=go?.userAgent,We=me??{},TA="1.372.3",$r={DEBUG:!1,LIB_VERSION:TA,LIB_NAME:"web",JS_SDK_VERSION:TA};function CA(e,t,n,r,o,s,l){try{var c=e[s](l),d=c.value}catch(f){return void n(f)}c.done?t(d):Promise.resolve(d).then(r,o)}function Lo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function l(d){CA(s,r,o,l,c,"next",d)}function c(d){CA(s,r,o,l,c,"throw",d)}l(void 0)}))}}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(null,arguments)}function r5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function b1(){return b1=Lo((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream("gzip"),o=r.writable.getWriter(),s=o.write(new TextEncoder().encode(e)).then((()=>o.close())).catch((function(){var d=Lo((function*(f){try{yield o.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,s]);return c}catch(d){if(n!=null&&n.rethrow)throw d;return t&&console.error("Failed to gzip compress data",d),null}})),b1.apply(this,arguments)}var nne=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],AA=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return nne.concat(t).some((r=>{var o=r.toLowerCase();return n.indexOf(o)!==-1}))},rne=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function wt(e,t){return e.indexOf(t)!==-1}var ov=function(e){return e.trim()},w1=function(e){return e.replace(/^\$/,"")},o5=Object.prototype,i5=o5.hasOwnProperty,iv=o5.toString,Pt=Array.isArray||function(e){return iv.call(e)==="[object Array]"},is=e=>typeof e=="function",An=e=>e===Object(e)&&!Pt(e),Ic=e=>{if(An(e)){for(var t in e)if(i5.call(e,t))return!1;return!0}return!1},ze=e=>e===void 0,_n=e=>iv.call(e)=="[object String]",Rm=e=>_n(e)&&e.trim().length===0,ys=e=>e===null,St=e=>ze(e)||ys(e),Fo=e=>iv.call(e)=="[object Number]"&&e==e,wc=e=>Fo(e)&&e>0,xi=e=>iv.call(e)==="[object Boolean]",one=e=>e instanceof FormData,ine=e=>wt(rne,e);function s5(e){return e===null||typeof e!="object"}function og(e,t){return{}.toString.call(e)==="[object "+t+"]"}function US(e){return typeof Event<"u"&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var sne=[!0,"true",1,"1","yes"],K_=e=>wt(sne,e),ane=[!1,"false",0,"0","no"];function Ri(e,t,n,r,o){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fo(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+o),Ri(o||n,t,n,r))}class lne{constructor(t){this.$t={},this.zt=t.zt,this.Ut=Ri(t.bucketSize,0,100,t.Gt),this.Wt=Ri(t.refillRate,0,this.Ut,t.Gt),this.Xt=Ri(t.refillInterval,0,864e5,t.Gt)}Jt(t,n){var r=Math.floor((n-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var n,r=Date.now(),o=String(t),s=this.$t[o];return s?this.Jt(s,r):this.$t[o]=s={tokens:this.Ut,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.zt)==null||n.call(this,t)),s.tokens===0)}stop(){this.$t={}}}var bp,IA,Z_,yo="Mobile",ig="iOS",cs="Android",Zc="Tablet",a5=cs+" "+Zc,l5="iPad",c5="Apple",u5=c5+" Watch",$d="Safari",Yc="BlackBerry",d5="Samsung",f5=d5+"Browser",h5=d5+" Internet",sl="Chrome",cne=sl+" OS",p5=sl+" "+ig,FS="Internet Explorer",m5=FS+" "+yo,BS="Opera",une=BS+" Mini",VS="Edge",g5="Microsoft "+VS,Uc="Firefox",v5=Uc+" "+ig,of="Nintendo",sf="PlayStation",Fc="Xbox",y5=cs+" "+yo,_5=yo+" "+$d,Od="Windows",S1=Od+" Phone",MA="Nokia",E1="Ouya",b5="Generic",dne=b5+" "+yo.toLowerCase(),w5=b5+" "+Zc.toLowerCase(),x1="Konqueror",Lr="(\\d+(\\.\\d+)?)",Y_=new RegExp("Version/"+Lr),fne=new RegExp(Fc,"i"),hne=new RegExp(sf+" \\w+","i"),pne=new RegExp(of+" \\w+","i"),qS=new RegExp(Yc+"|PlayBook|BB10","i"),mne={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},S5=function(e,t){return t=t||"",wt(e," OPR/")&&wt(e,"Mini")?une:wt(e," OPR/")?BS:qS.test(e)?Yc:wt(e,"IE"+yo)||wt(e,"WPDesktop")?m5:wt(e,f5)?h5:wt(e,VS)||wt(e,"Edg/")?g5:wt(e,"FBIOS")?"Facebook "+yo:wt(e,"UCWEB")||wt(e,"UCBrowser")?"UC Browser":wt(e,"CriOS")?p5:wt(e,"CrMo")||wt(e,sl)?sl:wt(e,cs)&&wt(e,$d)?y5:wt(e,"FxiOS")?v5:wt(e.toLowerCase(),x1.toLowerCase())?x1:((n,r)=>r&&wt(r,c5)||(function(o){return wt(o,$d)&&!wt(o,sl)&&!wt(o,cs)})(n))(e,t)?wt(e,yo)?_5:$d:wt(e,Uc)?Uc:wt(e,"MSIE")||wt(e,"Trident/")?FS:wt(e,"Gecko")?Uc:""},gne={[m5]:[new RegExp("rv:"+Lr)],[g5]:[new RegExp(VS+"?\\/"+Lr)],[sl]:[new RegExp("("+sl+"|CrMo)\\/"+Lr)],[p5]:[new RegExp("CriOS\\/"+Lr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Lr)],[$d]:[Y_],[_5]:[Y_],[BS]:[new RegExp("(Opera|OPR)\\/"+Lr)],[Uc]:[new RegExp(Uc+"\\/"+Lr)],[v5]:[new RegExp("FxiOS\\/"+Lr)],[x1]:[new RegExp("Konqueror[:/]?"+Lr,"i")],[Yc]:[new RegExp(Yc+" "+Lr),Y_],[y5]:[new RegExp("android\\s"+Lr,"i")],[h5]:[new RegExp(f5+"\\/"+Lr)],[FS]:[new RegExp("(rv:|MSIE )"+Lr)],Mozilla:[new RegExp("rv:"+Lr)]},vne=function(e,t){var n=S5(e,t),r=gne[n];if(ze(r))return null;for(var o=0;r.length>o;o++){var s=e.match(r[o]);if(s)return parseFloat(s[s.length-2])}return null},PA=[[new RegExp(Fc+"; "+Fc+" (.*?)[);]","i"),e=>[Fc,e&&e[1]||""]],[new RegExp(of,"i"),[of,""]],[new RegExp(sf,"i"),[sf,""]],[qS,[Yc,""]],[new RegExp(Od,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[S1,""];if(new RegExp(yo).test(t)&&!/IEMobile\b/.test(t))return[Od+" "+yo,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=mne[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Od,r]}return[Od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ig,[e[3],e[4],e[5]||"0"].join(".")]:[ig,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ze(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+cs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+cs+")","i"),e=>e&&e[2]?[cs,[e[2],e[3],e[4]||"0"].join(".")]:[cs,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cne,""]],[/Linux|debian/i,["Linux",""]]],NA=function(e){return pne.test(e)?of:hne.test(e)?sf:fne.test(e)?Fc:new RegExp(E1,"i").test(e)?E1:new RegExp("("+S1+"|WPDesktop)","i").test(e)?S1:/iPad/.test(e)?l5:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?u5:qS.test(e)?Yc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(MA,"i").test(e)?MA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(yo).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?cs:a5:new RegExp("(pda|"+yo+")","i").test(e)?dne:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?w5:""},yne=e=>e instanceof Error,E5={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},_ne=E5.info;function x5(e){if(xi(e))return{boolValue:e};if(typeof e=="number")return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e=="string")return{stringValue:e};if(Pt(e))return{arrayValue:{values:e.map((t=>x5(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function kA(e){var t=[];for(var n in e){var r=e[n];ys(r)||ze(r)||t.push({key:n,value:x5(r)})}return t}function bne(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Z_&&n.length===IA||(IA=n.length,Z_=n.reduce(((r,o)=>{bp||(bp={});var s=bp[o];if(s)r[s[0]]=s[1];else for(var l=e(o),c=l.length-1;c>=0;c--){var d=l[c],f=d?.filename,p=t[o];if(f&&p){r[f]=p,bp[o]=[f,p];break}}return r}),{})),Z_}}class wne{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},o=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),l=this.parseStacktrace(o,s);return{$exception_list:this.convertToExceptionList(l,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Lo((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Pt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,o;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(o=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),Ne({},t,{cause:r,stack:o})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Lo((function*(){var r=t;for(var o of n.modifiers)r=yield o(r);return r}))()}convertToExceptionList(t,n){var r,o,s,l={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(o=n.handled)===null||o===void 0||o,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(l.stacktrace={type:"raw",frames:t.stack});var c=[l];return t.cause!=null&&c.push(...this.convertToExceptionList(t.cause,Ne({},n,{handled:!0}))),c}buildParsingContext(t){var n;return{chunkIdMap:bne(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var o=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(t,n,l);return this.applyCoercers(s,c)}};return Ne({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>o(s,r),next:s=>o(s,r+1)})}}var Wc="?";function R1(e,t,n,r,o){var s={platform:e,filename:t,function:n==="<anonymous>"?Wc:n,in_app:!0};return ze(r)||(s.lineno=r),ze(o)||(s.colno=o),s}var R5=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Wc,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Sne=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ene=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xne=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rne=(e,t)=>{var n=Sne.exec(e);if(n){var[,r,o,s]=n;return R1(t,r,Wc,+o,+s)}var l=Ene.exec(e);if(l){if(l[2]&&l[2].indexOf("eval")===0){var c=xne.exec(l[2]);c&&(l[2]=c[1],l[3]=c[2],l[4]=c[3])}var[d,f]=R5(l[1]||Wc,l[2]);return R1(t,f,d,l[3]?+l[3]:void 0,l[4]?+l[4]:void 0)}},One=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cne=(e,t)=>{var n=One.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Tne.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],s=n[1]||Wc;return[s,o]=R5(s,o),R1(t,o,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},DA=/\(error: (.*)\)/;class Ane{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=_n(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return og(t,"DOMException")}isDOMError(t){return og(t,"DOMError")}}class Ine{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Mne{constructor(){}match(t){return og(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Pne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Nne{match(t){return typeof t=="string"}coerce(t,n){var r,[o,s]=this.getInfos(t);return{type:o??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,o=t.match(Pne);return o&&(n=o[1],r=o[2]),[n,r]}}var kne=["fatal","error","warning","log","info","debug"];function O5(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(t>=o.length)return r===n.length?o:o.length>t?o.slice(0,t)+"...":o}return""}class Dne{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,o=this.getErrorPropertyFromObject(t);return o?n.apply(o):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return US(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+O5(t)}isSeverityLevel(t){return _n(t)&&!Rm(t)&&kne.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(yne(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class Lne{match(t){return US(t)}coerce(t,n){var r,o=t.constructor.name;return{type:o,value:o+" captured as exception with keys: "+O5(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class $ne{match(t){return s5(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class jne{match(t){return og(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!US(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,o=this.getUnhandledRejectionReason(t);return s5(o)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(o)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var sg="$message",ag="$timestamp",zne=new Set([sg,ag]),W_={enabled:!0,max_bytes:32768};function lg(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:W_.enabled,max_bytes:Fne(e.max_bytes,W_.max_bytes)}:Ne({},W_)}class Une{constructor(t){this.Kt=[],this.Qt=0,this.Bt=lg(t)}setConfig(t){this.Bt=lg(t),this.er()}add(t){var n=(function(o){var s=(function(p){var h=new WeakSet;try{return JSON.stringify(p,((g,v)=>{if(typeof v=="bigint")return v.toString();if(typeof v!="function"&&typeof v!="symbol"){if(v instanceof Date)return v.toISOString();if(v instanceof Error)return{name:v.name,message:v.message,stack:v.stack};if(v&&typeof v=="object"){if(h.has(v))return"[Circular]";h.add(v)}return v}}))}catch{return}})(o);if(s)try{var l=JSON.parse(s);if(!An(l))return;var c=l,d=c[sg],f=c[ag];return!_n(d)||d.trim().length===0||!_n(f)&&!Fo(f)?void 0:{step:c,json:s}}catch{return}})(t);if(n){var r=(function(o){if(typeof TextEncoder<"u")return new TextEncoder().encode(o).length;for(var s=encodeURIComponent(o),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);r>this.Bt.max_bytes||(this.Kt.push({step:n.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((t=>t.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var t=this.Kt.shift();t&&(this.Qt-=t.bytes)}}}function Fne(e,t){if(!Fo(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var T5=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(o){if(me&&($r.DEBUG||We.POSTHOG_DEBUG||n)&&!ze(me.console)&&me.console){for(var s=("__rrweb_original__"in me.console[o])?me.console[o].__rrweb_original__:me.console[o],l=arguments.length,c=new Array(l>1?l-1:0),d=1;l>d;d++)c[d-1]=arguments[d];s(e,...c)}},info(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("log",...s)},warn(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("warn",...s)},error(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("error",...s)},critical(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];console.error(e,...s)},uninitializedWarning(o){r.error("You must initialize PostHog before calling "+o)},createLogger:(o,s)=>T5(e+" "+o,s)};return r},$e=T5("[PostHog.js]"),mn=$e.createLogger,Bne=mn("[ExternalScriptsLoader]"),Q_=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Bne.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Le?.querySelectorAll("script");if(r){for(var o,s=function(){if(r[l].src===t){var d=r[l];return d.__posthog_loading_callback_fired?{v:n()}:(d.addEventListener("load",(f=>{d.__posthog_loading_callback_fired=!0,n(void 0,f)})),d.onerror=f=>n(f),{v:void 0})}},l=0;r.length>l;l++)if(o=s())return o.v}var c=()=>{if(!Le)return n("document not found");var d=Le.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=t,d.onload=h=>{d.__posthog_loading_callback_fired=!0,n(void 0,h)},d.onerror=h=>n(h),e.config.prepare_external_dependency_script&&(d=e.config.prepare_external_dependency_script(d)),!d)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Le.head.appendChild(d);else{var f,p=Le.querySelectorAll("body > script");p.length>0?(f=p[0].parentNode)==null||f.insertBefore(d,p[0]):Le.body.appendChild(d)}};Le!=null&&Le.body?c():Le?.addEventListener("DOMContentLoaded",c)};We.__PosthogExtensions__=We.__PosthogExtensions__||{},We.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var o="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;o=o+"&t="+Math.floor(Date.now()/s)*s}r=e.requestRouter.endpointFor("assets",o)}Q_(e,r,n)}else{var l=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Q_(e,l,n)}},We.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Q_(e,r,n)};var C5="$people_distinct_id",cg="$device_id",Td="__alias",Cd="__timers",O1="$autocapture_disabled_server_side",T1="$heatmaps_enabled_server_side",C1="$exception_capture_enabled_server_side",A1="$error_tracking_suppression_rules",I1="$error_tracking_capture_extension_exceptions",M1="$web_vitals_enabled_server_side",HS="$dead_clicks_enabled_server_side",P1="$product_tours_enabled_server_side",N1="$web_vitals_allowed_metrics",Ad="$session_recording_remote_config",A5="$replay_override_sampling",I5="$replay_override_linked_flag",M5="$replay_override_url_trigger",P5="$replay_override_event_trigger",ug="$sesid",GS="$session_is_sampled",Mc="$enabled_feature_flags",Om="$active_feature_flags",Id="$early_access_features",k1="$feature_flag_details",D1="$feature_flag_payloads",L1="$feature_flag_request_id",os="$override_feature_flags",Sc="$override_feature_flag_payloads",Md="$stored_person_properties",Wa="$stored_group_properties",$1="$surveys",j1="$surveys_activated",Tm="ph_product_tours",jd="$flag_call_reported",z1="$flag_call_reported_session_id",U1="$feature_flag_errors",dg="$feature_flag_evaluated_at",ei="$user_state",F1="$client_session_props",B1="$capture_rate_limit",V1="$initial_campaign_params",q1="$initial_referrer_info",fg="$initial_person_info",hg="$epp",N5="__POSTHOG_TOOLBAR__",wp="$posthog_cookieless",k5="$sdk_debug_extensions_init_method",D5="$sdk_debug_extensions_init_time_ms",L5="$sdk_debug_recording_script_not_loaded",KS="PostHog loadExternalDependency extension not found.",Qa="on_reject",as="always",hc="anonymous",pc="identified",H1="identified_only",pg="visibilitychange",mg="beforeunload",Ec="$pageview",X_="$pageleave",J_="$identify",LA="$groupidentify";function Sp(e,t){Pt(e)&&e.forEach(t)}function dn(e,t){if(!St(e))if(Pt(e))e.forEach(t);else if(one(e))e.forEach(((r,o)=>t(r,o)));else for(var n in e)i5.call(e,n)&&t(e[n],n)}var Rn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var o of n)for(var s in o)o[s]!==void 0&&(e[s]=o[s]);return e};function Cm(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var $A=function(e){try{return e()}catch{return}},Vne=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(o){$e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$e.critical(o)}}},ZS=function(e){var t={};return dn(e,(function(n,r){(_n(n)&&n.length>0||Fo(n))&&(t[r]=n)})),t},qne=["herokuapp.com","vercel.app","netlify.app"];function Hne(e){var t=e?.hostname;if(!_n(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of qne)if(n===r)return!1;return!0}function Vn(e,t,n,r){var{capture:o=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:o,passive:s})}function $5(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fo(e)&&isFinite(e)&&Math.floor(e)===e});class gg{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,o){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||0>t||0>n||0>r||0>o||t>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new gg(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new gg(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Gne{constructor(){this.I=0,this.S=0,this.k=new Kne}generate(){var t=this.generateOrAbort();if(ze(t)){this.I=0;var n=this.generateOrAbort();if(ze(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return gg.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var jA,j5=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};me&&!ze(me.crypto)&&crypto.getRandomValues&&(j5=e=>crypto.getRandomValues(e));class Kne{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(j5(this.T),this.N=0),this.T[this.N++]}}var na=()=>Zne().toString(),Zne=()=>(jA||(jA=new Gne)).generate(),ud="",Yne=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Si={R:()=>!!Le,B(e){$e.error("cookieStore error: "+e)},O(e){if(Le){try{for(var t=e+"=",n=Le.cookie.split(";").filter((s=>s.length)),r=0;n.length>r;r++){for(var o=n[r];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(Si.O(e))||{}}catch{}return t},M(e,t,n,r,o){if(Le)try{var s="",l="",c=(function(p,h){if(h){var g=(function(_,b){if(b===void 0&&(b=Le),ud)return ud;if(!b||["localhost","127.0.0.1"].includes(_))return"";for(var x=_.split("."),S=Math.min(x.length,8),E="dmn_chk_"+na();!ud&&S--;){var T=x.slice(S).join("."),R=E+"=1;domain=."+T+";path=/";b.cookie=R+";max-age=3",b.cookie.includes(E)&&(b.cookie=R+";max-age=0",ud=T)}return ud})(p);if(!g){var v=(_=>{var b=_.match(Yne);return b?b[0]:""})(p);v!==g&&$e.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""})(Le.location.hostname,r);if(n){var d=new Date;d.setTime(d.getTime()+864e5*n),s="; expires="+d.toUTCString()}o&&(l="; secure");var f=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+c+l;return f.length>3686.4&&$e.warn("cookieStore warning: large cookie, len="+f.length),Le.cookie=f,f}catch{return}},F(e,t){if(Le!=null&&Le.cookie)try{Si.M(e,"",-1,t)}catch{return}}},eb=null,yn={R(){if(!ys(eb))return eb;var e=!0;if(ze(me))e=!1;else try{var t="__mplssupport__";yn.M(t,"xyz"),yn.O(t)!=='"xyz"'&&(e=!1),yn.F(t)}catch{e=!1}return e||$e.error("localStorage unsupported; falling back to cookie store"),eb=e,e},B(e){$e.error("localStorage error: "+e)},O(e){try{return me?.localStorage.getItem(e)}catch(t){yn.B(t)}return null},Z(e){try{return JSON.parse(yn.O(e))||{}}catch{}return null},M(e,t){try{me?.localStorage.setItem(e,JSON.stringify(t))}catch(n){yn.B(n)}},F(e){try{me?.localStorage.removeItem(e)}catch(t){yn.B(t)}}},Wne=[cg,"distinct_id",ug,GS,hg,fg,ei],Ep={},Qne={R:()=>!0,B(e){$e.error("memoryStorage error: "+e)},O:e=>Ep[e]||null,Z:e=>Ep[e]||null,M(e,t){Ep[e]=t},F(e){delete Ep[e]}},qa=null,mr={R(){if(!ys(qa))return qa;if(qa=!0,ze(me))qa=!1;else try{var e="__support__";mr.M(e,"xyz"),mr.O(e)!=='"xyz"'&&(qa=!1),mr.F(e)}catch{qa=!1}return qa},B(e){$e.error("sessionStorage error: ",e)},O(e){try{return me?.sessionStorage.getItem(e)}catch(t){mr.B(t)}return null},Z(e){try{return JSON.parse(mr.O(e))||null}catch{}return null},M(e,t){try{me?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){mr.B(n)}},F(e){try{me?.sessionStorage.removeItem(e)}catch(t){mr.B(t)}}};class Xne{constructor(t){this._instance=t}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===as||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Qa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(t){this.nr.M(this.sr,t?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.O(this.sr);return K_(t)?1:wt(ane,t)?0:-1}get nr(){var t=this.Bt.opt_out_capturing_persistence_type,n=t==="localStorage"?yn:Si;if(!this.ar||this.ar!==n){this.ar=n;var r=t==="localStorage"?Si:yn;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(K_(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[go?.doNotTrack,go?.msDoNotTrack,We.doNotTrack].some((t=>K_(t)))}}var xp=mn("[Dead Clicks]"),Jne=()=>!0,ere=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(HS)),r=e.instance.config.capture_dead_clicks;return xi(r)?r:!!An(r)||n};class zA{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[HS]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(o=>{o?xp.error("failed to load script",o):t()}))}hr(){var t;if(Le){if(!this.lr&&(t=We.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=An(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.lr=We.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.lr.start(Le),xp.info("starting...")}}else xp.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,xp.info("stopping..."))}}var tb=mn("[SegmentIntegration]"),z5="posthog-js";function U5(e,t){var{organization:n,projectId:r,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:l=!0}=t===void 0?{}:t;return c=>{var d,f,p,h,g;if(s!=="*"&&!s.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _,b=((d=c.exception)==null?void 0:d.values)||[],x=b.map((E=>Ne({},E,{stacktrace:E.stacktrace?Ne({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map((T=>Ne({},T,{platform:"web:javascript"})))}):void 0}))),S={$exception_message:((f=b[0])==null?void 0:f.value)||c.message,$exception_type:(p=b[0])==null?void 0:p.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((h=b[0])==null?void 0:h.value)||c.message,$sentry_exception_type:(g=b[0])==null?void 0:g.type,$sentry_tags:c.tags};return n&&r&&(S.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+c.event_id),l&&((_=e.exceptions)==null||_.sendExceptionEvent(S)),c}}class tre{constructor(t,n,r,o,s,l){this.name=z5,this.setupOnce=function(c){c(U5(t,{organization:n,projectId:r,prefix:o,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class UA{constructor(t){this.cr=(n,r,o)=>{o&&(o.noSessionId||o.activityTimeout||o.sessionPastMaximumLength)&&($e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:o}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.cr)}destroy(){var t;(t=this.pr)==null||t.call(this),this.pr=void 0}doPageView(t,n){var r,o=this.gr(t,n);return this.dr={pathname:(r=me?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),o}doPageLeave(t){var n;return this.gr(t,(n=this.dr)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.dr)==null?void 0:t.pageViewId}}gr(t,n){var r=this.dr;if(!r)return{$pageview_id:n};var o={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:l,lastScrollY:c,maxScrollY:d,maxContentHeight:f,lastContentY:p,maxContentY:h}=s;if(!(ze(l)||ze(c)||ze(d)||ze(f)||ze(p)||ze(h))){l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p),h=Math.ceil(h);var g=l>1?Ri(c/l,0,1,$e):1,v=l>1?Ri(d/l,0,1,$e):1,_=f>1?Ri(p/f,0,1,$e):1,b=f>1?Ri(h/f,0,1,$e):1;o=Rn(o,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(o.$prev_pageview_pathname=r.pathname),r.timestamp&&(o.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),o}}var nre={[C5]:{exposure:"hidden"},[Td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cd]:{exposure:"hidden"},[O1]:{exposure:"event"},[T1]:{exposure:"hidden"},[C1]:{exposure:"event"},[A1]:{exposure:"hidden"},[I1]:{exposure:"event"},[M1]:{exposure:"event"},[HS]:{exposure:"event"},[P1]:{exposure:"hidden"},[N1]:{exposure:"event"},[Ad]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ug]:{exposure:"hidden"},[GS]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Mc]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!An(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t["$feature/"+n[r]]=e[n[r]];return t}},[Om]:{exposure:"event"},[Id]:{exposure:"hidden"},[k1]:{exposure:"hidden"},[D1]:{exposure:"event"},[L1]:{exposure:"event"},[os]:{exposure:"event"},[Sc]:{exposure:"hidden"},[Md]:{exposure:"hidden"},[Wa]:{exposure:"hidden"},[$1]:{exposure:"hidden"},[j1]:{exposure:"event"},[Tm]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[jd]:{exposure:"hidden"},[z1]:{exposure:"hidden"},[U1]:{exposure:"hidden"},[dg]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[F1]:{exposure:"hidden"},[B1]:{exposure:"hidden"},[V1]:{exposure:"hidden"},[q1]:{exposure:"hidden"},[fg]:{exposure:"hidden"},[hg]:{exposure:"hidden"},[A5]:{exposure:"event"},[I5]:{exposure:"event"},[M5]:{exposure:"event"},[P5]:{exposure:"event"},[k5]:{exposure:"event"},[D5]:{exposure:"event"},[L5]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rre=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],vg=e=>{var t=Le?.createElement("a");return ze(t)?null:(t.href=e,t)},yg=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),o=0;r.length>o;o++){var s=r[o].split("=");if(s[0]===t){n=s;break}}if(!Pt(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{$e.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},af=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),o=r[1],s=(r[0]||"").split("?"),l=s[1],c=s[0],d=(l||"").split("&"),f=[],p=0;d.length>p;p++){var h=d[p].split("=");Pt(h)&&(t.includes(h[0])?f.push(h[0]+"="+n):f.push(d[p]))}var g=c;return l!=null&&(g+="?"+f.join("&")),o!=null&&(g+="#"+o),g},_g=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Rp="https?://(.*)",Qc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ore=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qc],lf="<masked>",ire=["li_fat_id"];function F5(e,t,n){if(!Le)return{};var r,o=t?[...Qc,...n||[]]:[],s=B5(af(Le.URL,o,lf),e),l=(r={},dn(ire,(function(c){var d=Si.O(c);r[c]=d||null})),r);return Rn(l,s)}function B5(e,t){var n=ore.concat(t||[]),r={};return dn(n,(function(o){var s=yg(e,o);r[o]=s||null})),r}function V5(e){var t=(function(s){return s?s.search(Rp+"google.([^/?]*)")===0?"google":s.search(Rp+"bing.com")===0?"bing":s.search(Rp+"yahoo.com")===0?"yahoo":s.search(Rp+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!ys(t)){r.$search_engine=t;var o=Le?yg(Le.referrer,n):"";o.length&&(r.ph_keyword=o)}return r}function FA(){return navigator.language||navigator.userLanguage}var bg="$direct";function q5(){return Le?.referrer||bg}function H5(e,t){var n=e?[...Qc,...t||[]]:[],r=pr?.href.substring(0,1e3);return{r:q5().substring(0,1e3),u:r?af(r,n,lf):void 0}}function G5(e){var t,{r:n,u:r}=e,o={$referrer:n,$referring_domain:n==null?void 0:n==bg?bg:(t=vg(n))==null?void 0:t.host};if(r){o.$current_url=r;var s=vg(r);o.$host=s?.host,o.$pathname=s?.pathname;var l=B5(r);Rn(o,l)}if(n){var c=V5(n);Rn(o,c)}return o}function K5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function sre(){try{return new Date().getTimezoneOffset()}catch{return}}var are=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class nb{constructor(t,n){this.Bt=t,this.props={},this.mr=!1,this.yr=(r=>{var o="";return r.token&&(o=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+o+"_posthog"})(t),this.nr=this.br(t),this.load(),t.debug&&$e.info("Persistence loaded",t.persistence,Ne({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this._r}br(t){are.indexOf(t.persistence.toLowerCase())===-1&&($e.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(o){o===void 0&&(o=[]);var s=[...Wne,...o];return Ne({},yn,{Z(l){try{var c={};try{c=Si.Z(l)||{}}catch{}var d=Rn(c,JSON.parse(yn.O(l)||"{}"));return yn.M(l,d),d}catch{}return null},M(l,c,d,f,p,h){try{yn.M(l,c,void 0,void 0,h);var g={};s.forEach((v=>{c[v]&&(g[v]=c[v])})),Object.keys(g).length&&Si.M(l,g,d,f,p,h)}catch(v){yn.B(v)}},F(l,c){try{me?.localStorage.removeItem(l),Si.F(l,c)}catch(d){yn.B(d)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&yn.R()?yn:r==="localstorage+cookie"&&n.R()?n:r==="sessionstorage"&&mr.R()?mr:r==="memory"?Qne:r==="cookie"?Si:n.R()?n:Si}wr(t){var n=t??this.Bt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[dg];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return dn(this.props,((n,r)=>{var o=(s=>{var l=nre[s];if(l)return l;for(var[c,d]of rre)if(s.indexOf(c)===0)return d})(r);if(o?.exposure==="derived"){if(o.shouldSkipFromEventProperties!=null&&o.shouldSkipFromEventProperties(n,r===Mc?()=>this.wr():()=>!1))return;o.transformToEventProperties&&Rn(t,o.transformToEventProperties(n))}else o&&o.exposure!=="event"||(t[r]=n)})),t}load(){if(!this._r){var t=this.nr.Z(this.yr);t&&(this.props=Rn({},t))}}save(){this._r||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(An(t)){ze(n)&&(n="None"),this.Ir=ze(r)?this.kr:r;var o=!1;if(dn(t,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.Tr(l,s),o=!0)})),o)return this.save(),!0}return!1}register(t,n){if(An(t)){this.Ir=ze(n)?this.kr:n;var r=!1;if(dn(t,((o,s)=>{t.hasOwnProperty(s)&&this.props[s]!==o&&(this.Tr(s,o),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Ar(t),this.save())}update_campaign_params(){if(!this.mr){var t=F5(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Ic(ZS(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=Le?.referrer)?V5(t):{})}update_referrer_info(){var t;this.register_once({$referrer:q5(),$referring_domain:Le!=null&&Le.referrer&&((t=vg(Le.referrer))==null?void 0:t.host)||bg},void 0)}set_initial_person_info(){this.props[V1]||this.props[q1]||this.register_once({[fg]:H5(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};dn([q1,V1],(l=>{var c=this.props[l];c&&dn(c,(function(d,f){t["$initial_"+w1(f)]=d}))}));var n,r,o=this.props[fg];if(o){var s=(n=G5(o),r={},dn(n,(function(l,c){r["$initial_"+w1(c)]=l})),r);Rn(t,s)}return t}safe_merge(t){return dn(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.kr=this.Ir=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((l,c)=>{if(l.length!==c.length)return!1;var d=[...l].sort(),f=[...c].sort();return d.every(((p,h)=>p===f[h]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var o=this.br(t),s=this.props;this.clear(),this.nr=o,this.props=s,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_secure(t){t!==this.Sr&&(this.Sr=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Cd]||{};r[t]=n,this.Tr(Cd,r),this.save()}remove_event_timer(t){var n=this.props[Cd]||{},r=n[t];return ze(r)||(delete n[t],this.Tr(Cd,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Tr(t,n),this.save()}Tr(t,n){this.props[t]=n}Ar(t){delete this.props[t]}}var dd={Activation:"events",Cancellation:"cancelEvents"},rb={Popover:"popover",API:"api",Widget:"widget"},Pd={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},ob={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},G1={Popover:"popover",Inline:"inline"},lre={SHOWN:"product tour shown"},BA={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},VA=mn("[RateLimiter]");class cre{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((o=>{VA.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void VA.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,o;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:l}=this,c=new Date().getTime(),d=(n=(r=this.instance.persistence)==null?void 0:r.get_property(B1))!==null&&n!==void 0?n:{tokens:s,last:c};d.tokens+=(c-d.last)/1e3*l,d.last=c,d.tokens>s&&(d.tokens=s);var f=1>d.tokens;return f||t||(d.tokens=Math.max(0,d.tokens-1)),!f||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(o=this.instance.persistence)==null||o.set_property(B1,d),{isRateLimited:f,remainingTokens:d.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var fd=mn("[RemoteConfig]");class Z5{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=We._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}Er(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Rr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return fd.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void fd.warn("Remote config is disabled. Falling back to local config.");this.Er((t=>{if(!t)return fd.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((n=>{this.Nr(n),this.Mr()}));this.Nr(t),this.Mr()}))}catch(t){fd.error("Error loading remote config",t)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||Le?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Mr(){var t;if(!this.Or){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Or=setInterval((()=>{this.refresh()}),n))}}Nr(t){var n;t||fd.error("Failed to fetch remote config from PostHog."),this._instance.Nr(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var yi={GZipJS:"gzip-js",Base64:"base64"},Uo=Uint8Array,Jr=Uint16Array,Xc=Uint32Array,YS=new Uo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),WS=new Uo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qA=new Uo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Y5=function(e,t){for(var n=new Jr(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var o=new Xc(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)o[s]=s-n[r]<<5|r;return[n,o]},W5=Y5(YS,2),K1=W5[1];W5[0][28]=258,K1[258]=28;for(var HA=Y5(WS,0)[1],Q5=new Jr(32768),fn=0;32768>fn;++fn){var mc=(43690&fn)>>>1|(21845&fn)<<1;Q5[fn]=((65280&(mc=(61680&(mc=(52428&mc)>>>2|(13107&mc)<<2))>>>4|(3855&mc)<<4))>>>8|(255&mc)<<8)>>>1}var zd=function(e,t,n){for(var r=e.length,o=0,s=new Jr(t);r>o;++o)++s[e[o]-1];var l,c=new Jr(t);for(o=0;t>o;++o)c[o]=c[o-1]+s[o-1]<<1;for(l=new Jr(r),o=0;r>o;++o)l[o]=Q5[c[e[o]-1]++]>>>15-e[o];return l},ul=new Uo(288);for(fn=0;144>fn;++fn)ul[fn]=8;for(fn=144;256>fn;++fn)ul[fn]=9;for(fn=256;280>fn;++fn)ul[fn]=7;for(fn=280;288>fn;++fn)ul[fn]=8;var wg=new Uo(32);for(fn=0;32>fn;++fn)wg[fn]=5;var ure=zd(ul,9),dre=zd(wg,5),X5=function(e){return(e/8>>0)+(7&e&&1)},J5=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Jr?Jr:e instanceof Xc?Xc:Uo)(n-t);return r.set(e.subarray(t,n)),r},Ji=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},hd=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ib=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,s=n.slice();if(!o)return[new Uo(0),0];if(o==1){var l=new Uo(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(O,A){return O.f-A.f})),n.push({s:-1,f:25001});var c=n[0],d=n[1],f=0,p=1,h=2;for(n[0]={s:-1,f:c.f+d.f,l:c,r:d};p!=o-1;)c=n[n[h].f>n[f].f?f++:h++],d=n[f!=p&&n[h].f>n[f].f?f++:h++],n[p++]={s:-1,f:c.f+d.f,l:c,r:d};var g=s[0].s;for(r=1;o>r;++r)s[r].s>g&&(g=s[r].s);var v=new Jr(g+1),_=Z1(n[p-1],v,0);if(_>t){r=0;var b=0,x=_-t,S=1<<x;for(s.sort((function(O,A){return v[A.s]-v[O.s]||O.f-A.f}));o>r;++r){var E=s[r].s;if(t>=v[E])break;b+=S-(1<<_-v[E]),v[E]=t}for(b>>>=x;b>0;){var T=s[r].s;t>v[T]?b-=1<<t-v[T]++-1:++r}for(;r>=0&&b;--r){var R=s[r].s;v[R]==t&&(--v[R],++b)}_=t}return[new Uo(v),_]},Z1=function(e,t,n){return e.s==-1?Math.max(Z1(e.l,t,n+1),Z1(e.r,t,n+1)):t[e.s]=n},GA=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jr(++t),r=0,o=e[0],s=1,l=function(d){n[r++]=d},c=1;t>=c;++c)if(e[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=e[c]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Y1=function(e,t,n){var r=n.length,o=X5(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var s=0;r>s;++s)e[o+s+4]=n[s];return 8*(o+4+r)},KA=function(e,t,n,r,o,s,l,c,d,f,p){Ji(t,p++,n),++o[256];for(var h=ib(o,15),g=h[0],v=h[1],_=ib(s,15),b=_[0],x=_[1],S=GA(g),E=S[0],T=S[1],R=GA(b),O=R[0],A=R[1],I=new Jr(19),P=0;E.length>P;++P)I[31&E[P]]++;for(P=0;O.length>P;++P)I[31&O[P]]++;for(var L=ib(I,7),q=L[0],j=L[1],B=19;B>4&&!q[qA[B-1]];--B);var F,Z,ie,H,W=f+5<<3,te=pd(o,ul)+pd(s,wg)+l,le=pd(o,g)+pd(s,b)+l+14+3*B+pd(I,q)+(2*I[16]+3*I[17]+7*I[18]);if(te>=W&&le>=W)return Y1(t,p,e.subarray(d,d+f));if(Ji(t,p,1+(te>le)),p+=2,te>le){F=zd(g,v),Z=g,ie=zd(b,x),H=b;var Q=zd(q,j);for(Ji(t,p,T-257),Ji(t,p+5,A-1),Ji(t,p+10,B-4),p+=14,P=0;B>P;++P)Ji(t,p+3*P,q[qA[P]]);p+=3*B;for(var k=[E,O],G=0;2>G;++G){var V=k[G];for(P=0;V.length>P;++P)Ji(t,p,Q[D=31&V[P]]),p+=q[D],D>15&&(Ji(t,p,V[P]>>>5&127),p+=V[P]>>>12)}}else F=ure,Z=ul,ie=dre,H=wg;for(P=0;c>P;++P)if(r[P]>255){var D;hd(t,p,F[257+(D=r[P]>>>18&31)]),p+=Z[D+257],D>7&&(Ji(t,p,r[P]>>>23&31),p+=YS[D]);var U=31&r[P];hd(t,p,ie[U]),p+=H[U],U>3&&(hd(t,p,r[P]>>>5&8191),p+=WS[U])}else hd(t,p,F[r[P]]),p+=Z[r[P]];return hd(t,p,F[256]),p+Z[256]},fre=new Xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),hre=(function(){for(var e=new Xc(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),sb=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function pre(e,t){t===void 0&&(t={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,_=0;g.length>_;++_)v=hre[255&v^g[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=e.length;n.p(e);var o,s,l,c,d,f=(c=10+((o=t).filename&&o.filename.length+1||0),d=8,(function(h,g,v,_,b,x){var S=h.length,E=new Uo(_+S+5*(1+Math.floor(S/7e3))+b),T=E.subarray(_,E.length-b),R=0;if(!g||8>S)for(var O=0;S>=O;O+=65535){var A=O+65535;S>A?R=Y1(T,R,h.subarray(O,A)):(T[O]=!0,R=Y1(T,R,h.subarray(O,S)))}else{for(var I=fre[g-1],P=I>>>13,L=8191&I,q=(1<<v)-1,j=new Jr(32768),B=new Jr(q+1),F=Math.ceil(v/3),Z=2*F,ie=function(Ue){return(h[Ue]^h[Ue+1]<<F^h[Ue+2]<<Z)&q},H=new Xc(25e3),W=new Jr(288),te=new Jr(32),le=0,Q=0,k=(O=0,0),G=0,V=0;S>O;++O){var D=ie(O),U=32767&O,X=B[D];if(j[U]=X,B[D]=U,O>=G){var fe=S-O;if((le>7e3||k>24576)&&fe>423){R=KA(h,T,0,H,W,te,Q,k,V,O-V,R),k=le=Q=0,V=O;for(var pe=0;286>pe;++pe)W[pe]=0;for(pe=0;30>pe;++pe)te[pe]=0}var xe=2,je=0,Y=L,re=U-X&32767;if(fe>2&&D==ie(O-re))for(var ve=Math.min(P,fe)-1,se=Math.min(32767,O),Se=Math.min(258,fe);se>=re&&--Y&&U!=X;){if(h[O+xe]==h[O+xe-re]){for(var Te=0;Se>Te&&h[O+Te]==h[O+Te-re];++Te);if(Te>xe){if(xe=Te,je=re,Te>ve)break;var tt=Math.min(re,Te-2),rt=0;for(pe=0;tt>pe;++pe){var Be=O-re+pe+32768&32767,Qe=Be-j[Be]+32768&32767;Qe>rt&&(rt=Qe,X=Be)}}}re+=(U=X)-(X=j[U])+32768&32767}if(je){H[k++]=268435456|K1[xe]<<18|HA[je];var Pe=31&K1[xe],Me=31&HA[je];Q+=YS[Pe]+WS[Me],++W[257+Pe],++te[Me],G=O+xe,++le}else H[k++]=h[O],++W[h[O]]}}R=KA(h,T,!0,H,W,te,Q,k,V,O-V,R)}return J5(E,0,_+X5(R)+b)})(s=e,(l=t).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,d)),p=f.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&sb(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(f,t),sb(f,p-8,n.d()),sb(f,p-4,r),f}var mre=!!_1||!!y1,e6="text/plain",ZA=!1,sv=function(e,t,n){var r;n===void 0&&(n=!0);var[o,s]=e.split("?"),l=Ne({},t),c=(r=s?.split("&").map((f=>{var p,[h,g]=f.split("="),v=n&&(p=l[h])!==null&&p!==void 0?p:g;return delete l[h],h+"="+v})))!==null&&r!==void 0?r:[],d=(function(f,p){var h,g;p===void 0&&(p="&");var v=[];return dn(f,(function(_,b){ze(_)||ze(b)||b==="undefined"||(h=encodeURIComponent((x=>x instanceof File)(_)?_.name:_.toString()),g=encodeURIComponent(b),v[v.length]=g+"="+h)})),v.join(p)})(l);return d&&c.push(d),o+"?"+c.join("&")},Pc=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),ab=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===yi.GZipJS){var r=pre((function(c,d){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Uo(c.length+(c.length>>>1)),h=0,g=function(x){p[h++]=x},v=0;f>v;++v){if(h+5>p.length){var _=new Uo(h+8+(f-v<<1));_.set(p),p=_}var b=c.charCodeAt(v);128>b?g(b):2048>b?(g(192|b>>>6),g(128|63&b)):b>55295&&57344>b?(g(240|(b=65536+(1047552&b)|1023&c.charCodeAt(++v))>>>18),g(128|b>>>12&63),g(128|b>>>6&63),g(128|63&b)):(g(224|b>>>12),g(128|b>>>6&63),g(128|63&b))}return J5(p,0,h)})(Pc(t)),{mtime:0});return{contentType:e6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===yi.Base64){var o=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((d,f)=>String.fromCharCode(parseInt(f,16)))))})(Pc(t)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:Pc(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=Pc(t);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},gre=(function(){var e=Lo((function*(t){var n=Pc(t.data),r=yield(function(s,l,c){return b1.apply(this,arguments)})(n,$r.DEBUG,{rethrow:!0});if(!r)return t;var o=yield r.arrayBuffer();return Ne({},t,{tr:{contentType:e6,body:o,estimatedSize:o.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),YA=(e,t)=>sv(e,{_:new Date().getTime().toString(),ver:$r.JS_SDK_VERSION,compression:t}),Am=[];y1&&Am.push({transport:"fetch",method(e){var t,n,{contentType:r,body:o,estimatedSize:s}=(t=ab(e))!==null&&t!==void 0?t:{},l=new Headers;dn(e.headers,(function(p,h){l.append(h,p)})),r&&l.append("Content-Type",r);var c=e.url,d=null;if(OA){var f=new OA;d={signal:f.signal,timeout:setTimeout((()=>f.abort()),e.timeout)}}y1(c,Ne({method:e?.method||"GET",headers:l,keepalive:e.method==="POST"&&52428.8>(s||0),body:o,signal:(n=d)==null?void 0:n.signal},e.fetchOptions)).then((p=>p.text().then((h=>{var g={statusCode:p.status,text:h};if(p.status===200)try{g.json=JSON.parse(h)}catch(v){$e.error(v)}e.callback==null||e.callback(g)})))).catch((p=>{$e.error(p),e.callback==null||e.callback({statusCode:0,error:p})})).finally((()=>d?clearTimeout(d.timeout):null))}}),_1&&Am.push({transport:"XHR",method(e){var t,n=new _1;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:o}=(t=ab(e))!==null&&t!==void 0?t:{};dn(e.headers,(function(s,l){n.setRequestHeader(l,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(o)}}),go!=null&&go.sendBeacon&&Am.push({transport:"sendBeacon",method(e){var t=sv(e.url,{beacon:"1"});try{var n,{contentType:r,body:o}=(n=ab(e))!==null&&n!==void 0?n:{};if(!o)return;var s=o instanceof Blob?o:new Blob([o],{type:r});go.sendBeacon(t,s)}catch{}}});var W1=3e3;class vre{constructor(t,n){this.Pr=!0,this.Lr=[],this.Dr=Ri(n?.flush_interval_ms||W1,250,5e3,$e.createLogger("flush interval"),W1),this.Br=t}enqueue(t){this.Lr.push(t),this.jr||this.$r()}unload(){this.qr();var t=this.Lr.length>0?this.Zr():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Br(Ne({},r,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var t=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var n=this.Zr(),r=function(){var s=n[o],l=new Date().getTime();s.data&&Pt(s.data)&&dn(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),t.Br(s)};for(var o in n)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var t={};return dn(this.Lr,(n=>{var r,o=n,s=(o?o.batchKey:null)||o.url;ze(t[s])&&(t[s]=Ne({},o,{data:[]})),(r=t[s].data)==null||r.push(o.data)})),this.Lr=[],t}}var yre=["retriesPerformedSoFar"];class _re{constructor(t){this.Vr=!1,this.Hr=3e3,this.Lr=[],this._instance=t,this.Lr=[],this.zr=!0,!ze(me)&&"onLine"in me.navigator&&(this.zr=me.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},Vn(me,"online",this.Ur),Vn(me,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=r5(t,yre);wc(n)&&(r.url=sv(r.url,{retry_count:n})),this._instance._send_request(Ne({},r,{callback:o=>{o.statusCode===200||o.statusCode>=400&&500>o.statusCode||(n??0)>=10?r.callback==null||r.callback(o):this.Wr(Ne({retriesPerformedSoFar:n},r))}}))}Wr(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(l){var c=3e3*Math.pow(2,l),d=c/2,f=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(f+p*(f-d))})(n),o=Date.now()+r;this.Lr.push({retryAt:o,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),$e.warn(s),this.Vr||(this.Vr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Vr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Hr)}Yr(){var t=Date.now(),n=[],r=this.Lr.filter((s=>t>s.retryAt||(n.push(s),!1)));if(this.Lr=n,r.length>0)for(var{requestOptions:o}of r)this.retriableRequest(o)}unload(){for(var{requestOptions:t}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Vr=!1,ze(me)||(this.Ur&&(me.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(me.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(Ne({},t,{transport:"sendBeacon"}))}catch(n){$e.error(n)}this.Lr=[]}}class bre{constructor(t){this.Kr=()=>{var n,r,o,s;this.Qr||(this.Qr={});var l=this.scrollElement(),c=this.scrollY(),d=l?Math.max(0,l.scrollHeight-l.clientHeight):0,f=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(c),this.Qr.maxScrollY=Math.max(c,(n=this.Qr.maxScrollY)!==null&&n!==void 0?n:0),this.Qr.maxScrollHeight=Math.max(d,(r=this.Qr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Qr.lastContentY=f,this.Qr.maxContentY=Math.max(f,(o=this.Qr.maxContentY)!==null&&o!==void 0?o:0),this.Qr.maxContentHeight=Math.max(p,(s=this.Qr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var t=this.Qr;return setTimeout(this.Kr,0),t}startMeasuringScrollPosition(){Vn(me,"scroll",this.Kr,{capture:!0}),Vn(me,"scrollend",this.Kr,{capture:!0}),Vn(me,"resize",this.Kr)}scrollElement(){if(!this.ei)return me?.document.documentElement;var t=Pt(this.ei)?this.ei:[this.ei];for(var n of t){var r=me?.document.querySelector(n);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return me&&(me.scrollY||me.pageYOffset||me.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return me&&(me.scrollX||me.pageXOffset||me.document.documentElement.scrollLeft)||0}}var wre=e=>H5(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class WA{constructor(t,n,r,o){this.ti=s=>{var l=this.ri();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ii(this._instance)};this.ni.register({[F1]:c})}},this._instance=t,this.si=n,this.ni=r,this.ii=o||wre,this.si.onSessionId(this.ti)}ri(){return this.ni.props[F1]}getSetOnceProps(){var t,n=(t=this.ri())==null?void 0:t.props;return n?"r"in n?G5(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return dn(ZS(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+w1(r)]=n})),t}}class QS{constructor(){this.oi={}}on(t,n){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(n),()=>{this.oi[t]=this.oi[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.oi[t]||[])r(n);for(var o of this.oi["*"]||[])o(t,n)}}var lb=mn("[SessionId]");class QA{on(t,n){return this.ai.on(t,n)}constructor(t,n,r){var o;if(this.li=[],this.ui=void 0,this.ai=new QS,this.hi=(f,p)=>!(!wc(f)||!wc(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===as)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||na,this.fi=r||na;var s=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*Ri(this.Bt.session_idle_timeout_seconds||1800,60,36e3,lb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=mr.Z(this.gi),c=mr.Z(this.mi);l&&!c?this.ci=l:mr.F(this.gi),mr.M(this.mi,!0)}if((o=this.Bt.bootstrap)!=null&&o.sessionID)try{var d=(f=>{var p=this.Bt.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),d)}catch(f){lb.error("Invalid sessionID in bootstrap",f)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ze(this.li)&&(this.li=[]),this.li.push(t),this.di&&t(this.di,this.ci),()=>{this.li=this.li.filter((n=>n!==t))}}yi(){return this.Bt.persistence!=="memory"&&!this.ni._r&&mr.R()}Ii(t){t!==this.ci&&(this.ci=t,this.yi()&&mr.M(this.gi,t))}Ci(){return this.ci?this.ci:this.yi()?mr.Z(this.gi):null}bi(t,n,r){t===this.di&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.di=t,this.ni.register({[ug]:[n,t,r]}))}Si(){var t=this.ni.props[ug];return Pt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&me&&(me.removeEventListener(mg,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&mr.F(this.mi)},Vn(me,mg,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Bt.cookieless_mode===as)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[o,s,l]=this.Si(),c=this.Ci(),d=wc(l)&&Math.abs(r-l)>864e5,f=!1,p=!s,h=!p&&!t&&this.hi(r,o);p||h||d?(s=this.vi(),c=this.fi(),lb.info("new session ID generated",{sessionId:s,windowId:c,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}}),l=r,f=!0):c||(c=this.fi(),f=!0);var g=wc(o)&&t&&!d?o:r,v=wc(l)?l:new Date().getTime();return this.Ii(c),this.bi(s,g,v),t||this.pi(),f&&this.li.forEach((_=>_(s,c,f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0))),{sessionId:s,windowId:c,sessionStartTimestamp:v,changeReason:f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0,lastActivityTimestamp:o}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[t]=this.Si();if(this.hi(new Date().getTime(),t)){var n=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var t6=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&AA(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((o=>AA(o?.brand,t))))return!0}catch{}return!!e.webdriver},Sg=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function XA(e,t,n){return Pc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var n6={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Sg(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Sg(n,r))))),icontains:(e,t)=>t.map(Op).some((n=>e.map(Op).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(Op).every((n=>e.map(Op).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r>parseFloat(o)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r<parseFloat(o)))}))},Op=e=>e.toLowerCase();function r6(e,t){return!e||Object.entries(e).every((n=>{var[r,o]=n,s=t?.[r];if(ze(s)||ys(s))return!1;var l=[String(s)],c=n6[o.operator];return!!c&&c(o.values,l)}))}var Q1="custom",JA="i.posthog.com",Sre=/^\/static\//;class Ere{constructor(t){this.ki={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+JA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Q1),this.ki[this.apiHost]}Ti(t){var n=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof n=="string"&&Sre.test(t))return n.trim().replace(/\/$/,"")||void 0}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(t==="assets"){var r=this.Ti(n);if(r)return""+r+n}if(this.region===Q1)return this.apiHost+n;var o=JA+n;switch(t){case"assets":return"https://"+this.region+"-assets."+o;case"api":return"https://"+this.region+"."+o}}}var Xt=mn("[Surveys]"),X1="seenSurvey_",xre=[rb.Popover,rb.Widget,rb.API],Rre={ignoreConditions:!1,ignoreDelay:!1,displayType:G1.Popover},Ore=mn("[PostHog ExternalIntegrations]"),Tre={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Cre{constructor(t){this._instance=t}ur(t,n){var r;(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(o=>{if(o)return Ore.error("failed to load script",o);n()}))}startIfEnabledOrStop(){var t=this,n=function(l){var c,d,f;!o||(c=We.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[l]||t.ur(Tre[l],(()=>{var p;(p=We.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[l])==null||p.start(t._instance)})),!o&&(d=We.__PosthogExtensions__)!=null&&(d=d.integrations)!=null&&d[l]&&((f=We.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[l])==null||f.stop())};for(var[r,o]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var gc,Ud={},cb=0,J1=()=>{},eI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',md="Surveys module not available",tI="sanitize_properties is deprecated. Use before_send instead",o6="Invalid value for property_denylist config: ",xc="posthog",i6=!mre&&Yr?.indexOf("MSIE")===-1&&Yr?.indexOf("Mozilla")===-1,nI=e=>{var t;return Ne({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hne(Le?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:J1,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:pr&&_n(pr?.search)&&pr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(me==null||(t=me.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){$e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:H1,before_send:void 0,request_queue_config:{flush_interval_ms:W1},error_tracking:{},_onCapture:J1,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Are=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],rI=e=>{var t={};for(var[n,r]of Are)ze(e[n])||(t[r]=e[n]);var o=Rn({},t,e);return Pt(e.property_blacklist)&&(ze(e.property_denylist)?o.property_denylist=e.property_blacklist:Pt(e.property_denylist)?o.property_denylist=[...e.property_blacklist,...e.property_denylist]:$e.error(o6+e.property_denylist)),o};class Ire{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(t){$e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class $o{Ei(t,n){if(t){var r=this.Ri.indexOf(t);r!==-1&&this.Ri.splice(r,1)}return this.Ri.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===as||this.config.cookieless_mode===Qa&&this.consent.isRejected()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new Ire,this.Mi=!1,this.version=$r.LIB_VERSION,this.Fi=new QS,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nI(),this.SentryIntegration=tre,this.sentryIntegration=r=>(function(o,s){var l=U5(o,s);return{name:z5,processEvent:c=>l(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new bre(this),this.pageViewManager=new UA(this),this.rateLimiter=new cre(this),this.requestRouter=new Ere(this),this.consent=new Xne(this),this.externalIntegrations=new Cre(this);var n=(t=$o.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(l),s?.({})},set_once:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(r=>$e.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==xc){var o,s=(o=Ud[r])!==null&&o!==void 0?o:new $o;return s._init(t,n,r),Ud[r]=s,Ud[xc][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var o,s;if(n===void 0&&(n={}),ze(t)||Rm(t))return $e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Bi(n.debug),this.ji=n,this.$i=[],n.person_profiles?this.Li=n.person_profiles:n.process_person&&(this.Li=n.process_person),this.set_config(Rn({},nI(n.defaults),rI(n),{name:r,token:t})),this.config.on_xhr_error&&$e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yi.GZipJS;var l=this.qi();this.persistence=new nb(this.config,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nb(Ne({},this.config,{persistence:"sessionStorage"}),l);var c=Ne({},this.persistence.props),d=Ne({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new vre((x=>this.Vi(x)),this.config.request_queue_config),this.Hi=new _re(this),this.__request_queue=[];var f=this.Ni();if(f||(this.sessionManager=new QA(this),this.sessionPropsManager=new WA(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(f)}),0)):($e.info("Initializing extensions synchronously"),this.zi(f)),$r.DEBUG=$r.DEBUG||this.config.debug,$r.DEBUG&&$e.info("Starting in debug mode",{this:this,config:n,thisC:Ne({},this.config),p:c,s:d}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=Ne({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var p=n.bootstrap.distinctID,h=this.get_distinct_id(),g=this.persistence.get_property(ei);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===hc)this.identify(p);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===pc)$e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(na()),_=n.bootstrap.isIdentifiedID?v:p;this.persistence.set_property(ei,n.bootstrap.isIdentifiedID?pc:hc),this.register({distinct_id:p,$device_id:_})}}if(f)this.register_once({distinct_id:wp,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(na());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ei,hc)}return Vn(me,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(x,S){var E=x.config.segment;if(!E)return S();(function(T,R){var O=T.config.segment;if(!O)return R();var A=P=>{var L=()=>P.anonymousId()||na();T.config.get_device_id=L,P.id()&&(T.register({distinct_id:P.id(),$device_id:L()}),T.persistence.set_property(ei,pc)),R()},I=O.user();"then"in I&&is(I.then)?I.then(A):A(I)})(x,(()=>{E.register((T=>{Promise&&Promise.resolve||tb.warn("This browser does not have Promise support, and can not use the segment integration");var R=(O,A)=>{if(!A)return O;O.event.userId||O.event.anonymousId===T.get_distinct_id()||(tb.info("No userId set, resetting PostHog"),T.reset()),O.event.userId&&O.event.userId!==T.get_distinct_id()&&(tb.info("UserId set, identifying with PostHog"),T.identify(O.event.userId));var I=T.calculateEventProperties(A,O.event.properties);return O.event.properties=Object.assign({},I,O.event.properties),O};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:O=>R(O,O.event.event),page:O=>R(O,Ec),identify:O=>R(O,J_),screen:O=>R(O,"$screen")}})(x)).then((()=>{S()}))}))})(this,(()=>this.Ui())):this.Ui(),is(this.config._onCapture)&&this.config._onCapture!==J1&&($e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(x=>this.config._onCapture(x.event,x)))),this.config.ip&&$e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n,r,o,s,l,c,d,f=performance.now(),p=Ne({},$o.__defaultExtensionClasses,this.config.__extensionClasses),h=[];p.featureFlags&&this.Ri.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ri.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ri.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ri.push(new p.tracingHeaders(this)),p.siteApps&&this.Ri.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ri.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ri.push(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new p.surveys(this)),p.logs&&this.Ri.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new p.logs(this)),p.conversations&&this.Ri.push(this.conversations=(l=this.conversations)!==null&&l!==void 0?l:new p.conversations(this)),p.productTours&&this.Ri.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ri.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ri.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,ere)),p.toolbar&&this.Ri.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ri.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ri.forEach((g=>{g.initialize&&h.push((()=>{g.initialize==null||g.initialize()}))})),h.push((()=>{if(this.Yi){var g=this.Yi;this.Yi=void 0,this.Nr(g)}})),this.Gi(h,f)}Gi(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){$e.error("Error initializing extension:",s)}}var o=Math.round(performance.now()-n);this.register_for_session({[k5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[D5]:o}),this.config.__preview_deferred_init_extensions&&$e.info("PostHog extensions initialized ("+o+"ms)")}Nr(t){var n;if(!Le||!Le.body)return $e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=t),this.Wi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=wt(t.supportedCompression,yi.GZipJS)?yi.GZipJS:wt(t.supportedCompression,yi.Base64)?yi.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:H1}),this.Ri.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ui(){try{this.config.loaded(this)}catch(r){$e.critical("`loaded` function failed",r)}if(this.Xi(),this.config.internal_or_test_user_hostname&&pr!=null&&pr.hostname){var t=pr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new Z5(this),this.Ki.load()}Xi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Zi)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Sp(this.__request_queue,(t=>this.Vi(t))),this.__request_queue=[],this.Xi()}_handle_unload(){var t,n,r,o;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(X_),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Zi)==null||r.unload(),(o=this.Hi)==null||o.unload()):this.Qi()&&this.capture(X_,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(i6?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=sv(t.url,{ip:this.config.ip?1:0}),t.headers=Ne({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,o,s,l=Ne({},n);l.timeout=l.timeout||6e4,l.url=YA(l.url,l.compression);var c=(r=l.transport)!==null&&r!==void 0?r:"fetch",d=Am.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),f=(o=(s=(function(p,h){for(var g=0;p.length>g;g++)if(p[g].transport===c)return p[g]})(d))==null?void 0:s.method)!==null&&o!==void 0?o:d[0].method;if(!f)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===yi.GZipJS&&tne&&!ZA?gre(l).then((p=>{f(p)})).catch((p=>{if((h=>!(!h||typeof h!="object")&&("name"in h?String(h.name):"")==="NotReadableError")(p))return ZA=!0,void f(Ne({},l,{compression:void 0,url:YA(n.url,void 0)}));f(l)})):f(l)})(Ne({},t,{callback:n=>{var r,o;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(o=this.config).on_request_error)==null||r.call(o,n),t.callback==null||t.callback(n)}}))))}Vi(t){this.Hi?this.Hi.retriableRequest(t):this._send_request(t)}_execute_array(t){cb++;try{var n,r=[],o=[],s=[];Sp(t,(c=>{c&&(Pt(n=c[0])?s.push(c):is(c)?c.call(this):Pt(c)&&n==="alias"?r.push(c):Pt(c)&&n.indexOf("capture")!==-1&&is(this[n])?s.push(c):o.push(c))}));var l=function(c,d){Sp(c,(function(f){if(Pt(f[0])){var p=d;dn(f,(function(h){p=p[h[0]].apply(p,h.slice(1))}))}else d[f[0]].apply(d,f.slice(1))}))};l(r,this),l(o,this),l(s,this)}finally{cb--}}push(t){if(cb>0&&Pt(t)&&_n(t[0])){var n=$o.prototype[t[0]];is(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var o,s,l,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!ze(t)&&_n(t)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!_n(n?.$current_url)&&($e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.en||$e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,g=r?.timestamp||h,v=na(),_={uuid:v,event:t,properties:this.calculateEventProperties(t,n||{},g,v)};t===Ec&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),r?.$set&&(_.$set=r?.$set);var b,x,S,E=this.tn(r?.$set_once,t!==LA,t===J_);if(E&&(_.$set_once=E),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,l=_,c=L=>_n(L)?L.slice(0,s):L,d=new Set,_=(function L(q,j){return q!==Object(q)?c?c(q):q:d.has(q)?void 0:(d.add(q),Pt(q)?(B=[],Sp(q,(F=>{B.push(L(F))}))):(B={},dn(q,((F,Z)=>{d.has(F)||(B[Z]=L(F))}))),B);var B})(l)),_.timestamp=g,ze(r?.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=h),t===Pd.DISMISSED||t===Pd.SENT){var T=n?.[ob.SURVEY_ID],R=n?.[ob.SURVEY_ITERATION];(L=>{try{var q=(j=>((B,F)=>{var Z=""+X1+F.id;return F.current_iteration&&F.current_iteration>0&&(Z=""+X1+F.id+"_"+F.current_iteration),Z})(0,j))(L);if(localStorage.getItem(q))return;localStorage.setItem(q,"true")}catch(j){Xt.error("Failed to persist survey seen state",j)}})({id:T,current_iteration:R}),_.$set=Ne({},_.$set,{[(b={id:T,current_iteration:R},x=t===Pd.SENT?"responded":"dismissed",S="$survey_"+x+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(S="$survey_"+x+"/"+b.id+"/"+b.current_iteration),S)]:!0})}else t===Pd.SHOWN&&(_.$set=Ne({},_.$set,{[ob.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===lre.SHOWN){var O=n?.[BA.TOUR_TYPE];O&&(_.$set=Ne({},_.$set,{[BA.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=Ne({},_.properties.$set,_.$set);if(Ic(A)||this.setPersonPropertiesForFlags(A),!St(this.config.before_send)){var I=this.rn(_);if(!I)return;_=I}this.Fi.emit("eventCaptured",_);var P={method:"POST",url:(o=r?._url)!==null&&o!==void 0?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Vi(P):this.Zi.enqueue(P),_}$e.critical("This capture call is ignored due to client rate limiting.")}}else $e.error("No event name provided to posthog.capture")}else $e.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,o,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(t),c=Ne({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),t==="$snapshot"){var d=Ne({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!_n(c.distinct_id)&&!Fo(c.distinct_id)||Rm(c.distinct_id))&&$e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,p=(function(S,E){var T,R,O,A;if(!Yr)return{};var I,P,L,q,j,B,F,Z,ie=S?[...Qc,...E||[]]:[],[H,W]=(function(te){for(var le=0;PA.length>le;le++){var[Q,k]=PA[le],G=Q.exec(te),V=G&&(is(k)?k(G,te):k);if(V)return V}return["",""]})(Yr);return Rn(ZS({$os:H,$os_version:W,$browser:S5(Yr,navigator.vendor),$device:NA(Yr),$device_type:(P=Yr,L={userAgentDataPlatform:(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,maxTouchPoints:(R=navigator)==null?void 0:R.maxTouchPoints,screenWidth:me==null||(O=me.screen)==null?void 0:O.width,screenHeight:me==null||(A=me.screen)==null?void 0:A.height,devicePixelRatio:me?.devicePixelRatio},Z=NA(P),Z===l5||Z===a5||Z==="Kobo"||Z==="Kindle Fire"||Z===w5?Zc:Z===of||Z===Fc||Z===sf||Z===E1?"Console":Z===u5?"Wearable":Z?yo:L?.userAgentDataPlatform==="Android"&&((q=L?.maxTouchPoints)!==null&&q!==void 0?q:0)>0?600>Math.min((j=L?.screenWidth)!==null&&j!==void 0?j:0,(B=L?.screenHeight)!==null&&B!==void 0?B:0)/((F=L?.devicePixelRatio)!==null&&F!==void 0?F:1)?yo:Zc:"Desktop"),$timezone:K5(),$timezone_offset:sre()}),{$current_url:af(pr?.href,ie,lf),$host:pr?.host,$pathname:pr?.pathname,$raw_user_agent:Yr.length>1e3?Yr.substring(0,997)+"...":Yr,$browser_version:vne(Yr,navigator.vendor),$browser_language:FA(),$browser_language_prefix:(I=FA(),typeof I=="string"?I.split("-")[0]:void 0),$screen_height:me?.screen.height,$screen_width:me?.screen.width,$viewport_height:me?.innerHeight,$viewport_width:me?.innerWidth,$lib:$r.LIB_NAME,$lib_version:$r.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());c.$session_id=h,c.$window_id=g}this.sessionPropsManager&&Rn(c,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Rn(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(v=this.Hi)==null?void 0:v.length}catch(S){c.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Q1&&(c.$lib_custom_api_host=this.config.api_host),f=t!==Ec||s?t!==X_||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,o),c=Rn(c,f),t===Ec&&Le&&(c.title=Le.title),!ze(l)){var _=r.getTime()-l;c.$duration=parseFloat((_/1e3).toFixed(3))}Yr&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Rn({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),Pt(this.config.property_denylist)?dn(this.config.property_denylist,(function(S){delete c[S]})):$e.error(o6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&($e.error(tI),c=b(c,t));var x=this.nn();return c.$process_person_profile=x,x&&!s&&this.sn("_calculate_event_properties"),c}tn(t,n,r){var o;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.nn()||this.Mi&&!r)return t;var s=this.persistence.get_initial_props(),l=(o=this.sessionPropsManager)==null?void 0:o.getSetOnceProps(),c=Rn({},s,l||{},t||{}),d=this.config.sanitize_properties;return d&&($e.error(tI),c=d(c,"$set_once")),n&&(this.Mi=!0),Ic(c)?void 0:c}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var o;(o=this.persistence)==null||o.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}an(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var o;(o=this.featureFlags)==null||o.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var o;(o=this.featureFlags)==null||o.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var o;return n===void 0&&(n=!1),(o=this.featureFlags)==null?void 0:o.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Fi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:md}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:md})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:md})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=Rre),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:md}}canRenderSurveyAsync(t,n){var r,o;return n===void 0&&(n=!1),(r=(o=this.surveys)==null?void 0:o.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:md})}ln(t){return!t||Rm(t)?($e.critical("Unique user id has not been set in posthog.identify"),!1):t===wp?($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return $e.uninitializedWarning("posthog.identify");if(Fo(t)&&(t=t.toString(),$e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(t)&&this.sn("posthog.identify")){var o=this.get_distinct_id();this.register({$user_id:t}),this.get_property(cg)||this.register_once({$had_persisted_distinct_id:!0,$device_id:o},""),t!==o&&t!==this.get_property(Td)&&(this.unregister(Td),this.register({distinct_id:t}));var s,l=(this.persistence.get_property(ei)||hc)===hc;t!==o&&l?(this.persistence.set_property(ei,pc),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(J_,{distinct_id:t,$anon_distinct_id:o},{$set:n||{},$set_once:r||{}}),this.Di=XA(t,n,r),(s=this.featureFlags)==null||s.setAnonymousDistinctId(o)):(n||r)&&this.setPersonProperties(n,r),t!==o&&(this.reloadFeatureFlags(),this.unregister(jd))}}setPersonProperties(t,n){if((t||n)&&this.sn("posthog.setPersonProperties")){var r=XA(this.get_distinct_id(),t,n);this.Di!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Di=r):$e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var o=this.getGroups(),s=o[t]!==n;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ne({},o,{[t]:n})}),s||r){var l={$group_type:t,$group_key:n};r&&(l.$group_set=r),this.capture(LA,l)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else $e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,o,s,l,c,d,f;if($e.info("reset"),!this.__loaded)return $e.uninitializedWarning("posthog.reset");var p=this.get_property(cg);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(o=this.surveys)==null||o.reset(),(s=this.Ki)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(d=this.persistence)==null||d.set_property(ei,hc),(f=this.sessionManager)==null||f.resetSessionId(),this.Di=null,this.config.cookieless_mode===as)this.register_once({distinct_id:wp,$device_id:null},"");else{var h=this.config.get_device_id(na());this.register_once({distinct_id:h,$device_id:t?h:p},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.un()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),o=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,l=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return o;o+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-l,0)}return o}alias(t,n){return t===this.get_property(C5)?($e.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(ze(n)&&(n=this.get_distinct_id()),t!==n?(this.an(Td,t),this.capture("$create_alias",{alias:t,distinct_id:n})):($e.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ne({},this.config);if(An(t)){var r,o,s,l,c,d,f,p,h,g;Rn(this.config,rI(t));var v=this.qi();(r=this.persistence)==null||r.update_config(this.config,n,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nb(Ne({},this.config,{persistence:"sessionStorage"}),v);var _=this.Bi(this.config.debug);xi(_)&&(this.config.debug=_),xi(this.config.debug)&&(this.config.debug?($r.DEBUG=!0,yn.R()&&yn.M("ph_debug",!0),$e.info("set_config",{config:t,oldConfig:n,newConfig:Ne({},this.config)})):($r.DEBUG=!1,yn.R()&&yn.F("ph_debug"))),(o=this.exceptionObserver)==null||o.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(f=this.exceptionObserver)==null||f.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.cn(),(g=this.externalIntegrations)==null||g.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){$r.LIB_NAME=t,$r.LIB_VERSION=n}startSessionRecording(t){var n,r,o,s,l,c=t===!0,d={sampling:c||!(t==null||!t.sampling),linked_flag:c||!(t==null||!t.linked_flag),url_trigger:c||!(t==null||!t.url_trigger),event_trigger:c||!(t==null||!t.event_trigger)};Object.values(d).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),d.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),d.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),d.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),d.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),o=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ne({},o,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:$o.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:xc;return n!==xc&&(n=xc+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(ei))===pc||((n=this.sessionPersistence)==null?void 0:n.get_property(ei))===pc}nn(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===H1&&!this._isIdentified()&&Ic(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Td])&&((n=this.persistence)==null||(n=n.props)==null||!n[hg]))}Qi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return this.config.person_profiles==="never"?($e.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(hg,!0),!0)}qi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Qa)}cn(){var t,n,r,o,s=this.qi();return((t=this.persistence)==null?void 0:t._r)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n._r)!==s&&((o=this.sessionPersistence)==null||o.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==as){if(this.Ni()){var r,o,s,l,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(o=this.pageViewManager)==null||o.destroy(),this.sessionManager=new QA(this),this.pageViewManager=new UA(this),this.persistence&&(this.sessionPropsManager=new WA(this,this.sessionManager,this.persistence));var d,f=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=$o.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ei(this.sessionRecording,new f(this)),this.Wi&&((d=this.sessionRecording)==null||d.onRemoteConfig==null||d.onRemoteConfig(this.Wi)))}var p,h;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Qa&&((p=this.surveys)==null||p.loadIfEnabled()),(ze(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t?.captureEventName)!==null&&h!==void 0?h:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else $e.warn(eI)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==as?(this.config.cookieless_mode===Qa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Qa&&(this.register({distinct_id:wp,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):$e.warn(eI)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===as||(this.config.cookieless_mode===Qa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return go?t6(go,this.config.custom_blocked_useragents):void 0}Ji(){Le&&(Le.visibilityState==="visible"?this.Oi||(this.Oi=!0,this.capture(Ec,{title:Le.title},{send_instantly:!0}),this.Pi&&(Le.removeEventListener(pg,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),Vn(Le,pg,this.Pi)))}debug(t){t===!1?(me?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(me?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var t,n,r,o,s,l,c=this.ji||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",o=$e,s=(n="advanced_disable_flags")in(t=c)&&!St(t[n]),l=r in t&&!St(t[r]),s?t[n]:!!l&&(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(St(this.config.before_send))return t;var n=Pt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var o of n){if(r=o(r),St(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return ine(t.event)?$e.warn(s+". This can cause unexpected behavior."):$e.info(s),null}r.properties&&!Ic(r.properties)||$e.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.dr)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Bi(t){var n=xi(t)&&!t,r=yn.R()&&yn.O("ph_debug")==="true";return!n&&(!!r||t)}}function oI(e){return e instanceof Element&&(e.id===N5||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function av(e){return!!e&&e.nodeType===1}function ua(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function s6(e){return!!e&&e.nodeType===3}function a6(e){return!!e&&e.nodeType===11}function XS(e){return e?ov(e).split(/\s+/):[]}function iI(e){var t=me?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Eg(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return XS(t)}function l6(e){return St(e)?null:ov(e).split(/(\s+)/).filter((t=>Fd(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function cf(e){var t="";return tw(e)&&!u6(e)&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;s6(n)&&n.textContent&&(t+=(r=l6(n.textContent))!==null&&r!==void 0?r:"")})),ov(t)}function sI(e){return ze(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}$o.__defaultExtensionClasses={},$o.dn={trace:gc=()=>{},debug:gc,info:gc,warn:gc,error:gc,fatal:gc},(function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Vne(e.prototype[t[n]])})($o,["identify"]);var JS=["a","button","form","input","select","textarea","label"];function aI(e,t){if(ze(t))return!0;var n,r=function(s){if(t.some((l=>s.matches(l))))return{v:!0}};for(var o of e)if(n=r(o))return n.v;return!1}function c6(e){var t=e.parentNode;return!(!t||!av(t))&&t}var Mre=["next","previous","prev",">","<"],lI=[".ph-no-rageclick",".ph-no-capture"],ew=e=>!e||ua(e,"html")||!av(e),cI=(e,t)=>{if(!me||ew(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],o=e;o.parentNode&&!ua(o,"body");)if(a6(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{var s=c6(o);if(!s)break;if(t||JS.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var l=me.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),o=s}return{parentIsUsefulElement:n,targetElementList:r}};function tw(e){for(var t=e;t.parentNode&&!ua(t,"body");t=t.parentNode){var n=Eg(t);if(wt(n,"ph-sensitive")||wt(n,"ph-no-capture"))return!1}if(wt(Eg(e),"ph-include"))return!0;var r=e.type||"";if(_n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!_n(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function u6(e){return!!(ua(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ua(e,"select")||ua(e,"textarea")||e.getAttribute("contenteditable")==="true")}var d6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Pre=new RegExp("^(?:"+d6+")$"),Nre=new RegExp(d6),f6="\\d{3}-?\\d{2}-?\\d{4}",kre=new RegExp("^("+f6+")$"),Dre=new RegExp("("+f6+")");function Fd(e,t){return t===void 0&&(t=!0),!(St(e)||_n(e)&&(e=ov(e),(t?Pre:Nre).test((e||"").replace(/[- ]/g,""))||(t?kre:Dre).test(e)))}function uI(e){var t=cf(e);return Fd(t=(t+" "+h6(e)).trim())?t:""}function h6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var o=cf(n);t=(t+" "+o).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+h6(n)).trim())}catch(s){$e.error("[AutoCapture]",s)}})),t}function dI(e){return e.replace(/"|\\"/g,'\\"')}function Lre(e){var t=e.attr__class;return t?Pt(t)?t:XS(t):void 0}class fI{constructor(t){this.disabled=t===!1;var n=An(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var o=this.clicks[this.clicks.length-1];if(o&&Math.abs(t-o.x)+Math.abs(n-o.y)<this.thresholdPx&&this.timeoutMs>r-o.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var ub="$copy_autocapture",hI=mn("[AutoCapture]");function db(e,t){return t.length>e?t.slice(0,e)+"...":t}function $re(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!av(t));return t}function jre(e,t){for(var n,r,{e:o,maskAllElementAttributes:s,maskAllText:l,elementAttributeIgnoreList:c,elementsChainAsString:d}=t,f=[e],p=e;p.parentNode&&!ua(p,"body");)a6(p.parentNode)?(f.push(p.parentNode.host),p=p.parentNode.host):(f.push(p.parentNode),p=p.parentNode);var h,g,v=[],_={},b=!1,x=!1;if(dn(f,(O=>{var A=tw(O);O.tagName.toLowerCase()==="a"&&(b=O.getAttribute("href"),b=A&&b&&Fd(b)&&b),wt(Eg(O),"ph-no-capture")&&(x=!0),v.push((function(P,L,q,j){var B=P.tagName.toLowerCase(),F={tag_name:B};JS.indexOf(B)>-1&&!q&&(F.$el_text=B.toLowerCase()==="a"||B.toLowerCase()==="button"?db(1024,uI(P)):db(1024,cf(P)));var Z=Eg(P);Z.length>0&&(F.classes=Z.filter((function(te){return te!==""}))),dn(P.attributes,(function(te){var le;if((!u6(P)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(j==null||!j.includes(te.name))&&!L&&Fd(te.value)&&(!_n(le=te.name)||le.substring(0,10)!=="_ngcontent"&&le.substring(0,7)!=="_nghost")){var Q=te.value;te.name==="class"&&(Q=XS(Q).join(" ")),F["attr__"+te.name]=db(1024,Q)}}));for(var ie=1,H=1,W=P;W=$re(W);)ie++,W.tagName===P.tagName&&H++;return F.nth_child=ie,F.nth_of_type=H,F})(O,s,l,c));var I=(function(P){if(!tw(P))return{};var L={};return dn(P.attributes,(function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var j=q.name.replace("data-ph-capture-attribute-",""),B=q.value;j&&B&&Fd(B)&&(L[j]=B)}})),L})(O);Rn(_,I)})),x)return{props:{},explicitNoCapture:x};if(l||(v[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?uI(e):cf(e)),b){var S,E;v[0].attr__href=b;var T=(S=vg(b))==null?void 0:S.host,R=me==null||(E=me.location)==null?void 0:E.host;T&&R&&T!==R&&(h=b)}return{props:Rn({$event_type:o.type,$ce_version:1},d?{}:{$elements:v},{$elements_chain:(g=v,(function(O){return O.map((A=>{var I,P,L="";if(A.tag_name&&(L+=A.tag_name),A.attr_class)for(var q of(A.attr_class.sort(),A.attr_class))L+="."+q.replace(/"/g,"");var j=Ne({},A.text?{text:A.text}:{},{"nth-child":(I=A.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(P=A.nth_of_type)!==null&&P!==void 0?P:0},A.href?{href:A.href}:{},A.attr_id?{attr_id:A.attr_id}:{},A.attributes),B={};return Cm(j).sort(((F,Z)=>{var[ie]=F,[H]=Z;return ie.localeCompare(H)})).forEach((F=>{var[Z,ie]=F;return B[dI(Z.toString())]=dI(ie.toString())})),(L+=":")+Cm(B).map((F=>{var[Z,ie]=F;return Z+'="'+ie+'"'})).join("")})).join(";")})((function(O){return O.map((A=>{var I,P,L={text:(I=A.$el_text)==null?void 0:I.slice(0,400),tag_name:A.tag_name,href:(P=A.attr__href)==null?void 0:P.slice(0,2048),attr_class:Lre(A),attr_id:A.attr__id,nth_child:A.nth_child,nth_of_type:A.nth_of_type,attributes:{}};return Cm(A).filter((q=>{var[j]=q;return j.indexOf("attr__")===0})).forEach((q=>{var[j,B]=q;return L.attributes[j]=B})),L}))})(g)))},(n=v[0])!=null&&n.$el_text?{$el_text:(r=v[0])==null?void 0:r.$el_text}:{},h&&o.type==="click"?{$external_click_url:h}:{},_)}}var gd=mn("[ExceptionAutocapture]");function pI(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],o=n(r);return is(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var zre=mn("[TracingHeaders]"),Zs=mn("[Web Vitals]"),mI=9e5,gI="disabled",vI="lazy_loading",vd="awaiting_config",Tp="missing_config";mn("[SessionRecording]"),mn("[SessionRecording]");var nw="[SessionRecording]",Ys=mn(nw),Ure=mn("[Heatmaps]");function yI(e){return An(e)&&"clientX"in e&&"clientY"in e&&Fo(e.clientX)&&Fo(e.clientY)}var _I=mn("[Product Tours]"),Fre=["$set_once","$set"],Ws=mn("[SiteApps]"),bI="Error while initializing PostHog app with config id ";function vc(e,t,n){if(St(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Bre{constructor(t){this.vn=new QS,this.fn=(n,r)=>this.pn(n,r)&&this.gn(n,r)&&this.mn(n,r)&&this.yn(n,r),this.pn=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,n;ze((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,o)=>{this.on(r,o)}))}register(t){var n,r;if(!ze((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((l=>{var c,d;(c=this._n)==null||c.add(l),(d=l.steps)==null||d.forEach((f=>{var p;(p=this.bn)==null||p.add(f?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var o,s=new Set;t.forEach((l=>{var c;(c=l.steps)==null||c.forEach((d=>{d!=null&&d.selector&&s.add(d?.selector)}))})),(o=this._instance)==null||o.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.bn.has(t)||this.bn.has(n?.event))&&this._n&&((r=this._n)==null?void 0:r.size)>0&&this._n.forEach((o=>{this.wn(n,o)&&this.vn.emit("actionCaptured",o.name)}))}In(t){this.onAction("actionCaptured",(n=>t(n)))}wn(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.fn(t,r))return!0;return!1}onAction(t,n){return this.vn.on(t,n)}gn(t,n){if(n!=null&&n.url){var r,o=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!o||typeof o!="string"||!vc(o,n.url,n.url_matching||"contains"))return!1}return!0}mn(t,n){return!!this.Cn(t,n)&&!!this.Sn(t,n)&&!!this.xn(t,n)}Cn(t,n){var r;if(n==null||!n.href)return!0;var o=this.kn(t);if(o.length>0)return o.some((c=>vc(c.href,n.href,n.href_matching||"exact")));var s,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&vc((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Sn(t,n){var r;if(n==null||!n.text)return!0;var o=this.kn(t);if(o.length>0)return o.some((f=>vc(f.text,n.text,n.text_matching||"exact")||vc(f.$el_text,n.text,n.text_matching||"exact")));var s,l,c,d=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!d&&(s=(function(f){for(var p,h=[],g=/(?::|")text="(.*?)"/g;!St(p=g.exec(f));)h.includes(p[1])||h.push(p[1]);return h})(d),l=n.text,c=n.text_matching||"exact",s.some((f=>vc(f,l,c))))}xn(t,n){var r,o;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(t==null||(o=t.properties)==null?void 0:o.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}kn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}yn(t,n){return n==null||!n.properties||n.properties.length===0||r6(n.properties.reduce(((r,o)=>{var s=Pt(o.value)?o.value.map(String):o.value!=null?[String(o.value)]:[];return r[o.key]={values:s,operator:o.operator||"exact"},r}),{}),t?.properties)}}class Vre{constructor(t){this._instance=t,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(t,n){return!!t&&r6(t.propertyFilters,n?.properties)}Nn(t,n){var r=new Map;return t.forEach((o=>{var s;(s=o.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=r.get(l.name)||[];c.push(o.id),r.set(l.name,c)}}))})),r}Mn(t,n,r){var o=(r===dd.Activation?this.Tn:this.An).get(t),s=[];return this.Fn((l=>{s=l.filter((c=>o?.includes(c.id)))})),s.filter((l=>{var c,d=(c=l.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===t));return this.Rn(d,n)}))}register(t){var n;ze((n=this._instance)==null?void 0:n._addCaptureHook)||(this.On(t),this.Pn(t))}Pn(t){var n=t.filter((r=>{var o,s;return((o=r.conditions)==null?void 0:o.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Ln==null&&(this.Ln=new Bre(this._instance),this.Ln.init(),this.Ln.In((r=>{this.onAction(r)}))),n.forEach((r=>{var o,s,l,c,d;r.conditions&&(o=r.conditions)!=null&&o.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Ln)==null||c.register(r.conditions.actions.values),(d=r.conditions)==null||(d=d.actions)==null||(d=d.values)==null||d.forEach((f=>{if(f&&f.name){var p=this.En.get(f.name);p&&p.push(r.id),this.En.set(f.name,p||[r.id])}})))})))}On(t){var n,r=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),o=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&o.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Tn=this.Nn(t,dd.Activation),this.An=this.Nn(t,dd.Cancellation))}onEvent(t,n){var r,o=this.le(),s=this.Dn(),l=this.Bn(),c=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(l===t&&n&&c.length>0){var d,f;o.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:c});var p=(n==null||(d=n.properties)==null?void 0:d.$survey_id)||(n==null||(f=n.properties)==null?void 0:f.$product_tour_id);if(p){var h=c.indexOf(p);0>h||(c.splice(h,1),this.jn(c))}}else{if(this.An.has(t)){var g=this.Mn(t,n,dd.Cancellation);g.length>0&&(o.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((_=>_.id))}),g.forEach((_=>{var b=c.indexOf(_.id);0>b||c.splice(b,1),this.$n(_.id)})),this.jn(c))}if(this.Tn.has(t)){o.info("event name matched",{event:t,eventPayload:n,items:this.Tn.get(t)});var v=this.Mn(t,n,dd.Activation);this.jn(c.concat(v.map((_=>_.id))||[]))}}}onAction(t){var n,r=this.Dn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.En.has(t)&&this.jn(o.concat(this.En.get(t)||[]))}jn(t){var n=this.le(),r=[...new Set(t)].filter((o=>!this.qn(o)));n.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var t,n=this.Dn();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.Tn}Vn(){return this.Ln}}class qre extends Vre{constructor(t){super(t)}Dn(){return j1}Bn(){return Pd.SHOWN}Fn(t){var n;(n=this._instance)==null||n.getSurveys(t)}$n(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}le(){return Xt}Zn(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[j1]:t})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var fb="SDK is not enabled or survey functionality is not yet loaded",wI="Disabled. Not loading surveys.",Hre=me!=null&&me.location?_g(me.location.hash,"__posthog")||_g(location.hash,"state"):null,SI="_postHogToolbarParams",EI=mn("[Toolbar]"),Nr=mn("[FeatureFlags]"),Ha=mn("[FeatureFlags]",{debugEnabled:!0}),hb=`" failed. Feature flags didn't load in time.`,xI=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},RI=e=>{var t={};for(var[n,r]of Cm(e||{}))r&&(t[n]=r);return t},es=mn("[Error tracking]"),OI="Refusing to render web experiment since the viewer is a likely bot",Gre={icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!me&&Sg(t.href,e),not_regex:(e,t)=>!!me&&!Sg(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Rr{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((o=>{Rr.Hn("retrieved web experiments from the server"),n.zn=new Map,o.forEach((s=>{if(s.feature_flag_key){var l;n.zn&&(Rr.Hn("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.zn)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);_n(c)&&s.variants[c]&&n.Un(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var d in s.variants){var f=s.variants[d];Rr.Yn(f)&&n.Un(s.name,d,f.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Rr.Hn(OI);else if(!this.Bt.disable_web_experiments){if(St(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.Hn("applying feature flags",t),t.forEach((n=>{var r;if(this.zn&&(r=this.zn)!=null&&r.has(n)){var o,s=this._instance.getFeatureFlag(n),l=(o=this.zn)==null?void 0:o.get(n);s&&l!=null&&l.variants[s]&&this.Un(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var t=Rr.getWindowLocation();if(t!=null&&t.search){var n=yg(t?.search,"__experiment_id"),r=yg(t?.search,"__experiment_variant");n&&r&&(Rr.Hn("previewing web experiments "+n+" && "+r),this.getWebExperiments((o=>{this.Gn(parseInt(n),r,o)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Bt.disable_web_experiments&&!r)return t([]);var o=this._instance.get_property("$web_experiments");if(o&&!n)return t(o);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Gn(t,n,r){var o=r.filter((s=>s.id===t));o&&o.length>0&&(Rr.Hn("Previewing web experiment ["+o[0].name+"] with variant ["+n+"]"),this.Un(o[0].name,n,o[0].variants[n].transforms))}static Yn(t){return!St(t.conditions)&&Rr.Wn(t)&&Rr.Xn(t)}static Wn(t){var n;if(St(t.conditions)||St((n=t.conditions)==null?void 0:n.url))return!0;var r,o,s,l=Rr.getWindowLocation();return!!l&&((r=t.conditions)==null||!r.url||Gre[(o=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l))}static getWindowLocation(){return me?.location}static Xn(t){var n;if(St(t.conditions)||St((n=t.conditions)==null?void 0:n.utm))return!0;var r=F5();if(r.utm_source){var o,s,l,c,d,f,p,h,g=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,v=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,_=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_medium||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,b=(p=t.conditions)==null||(p=p.utm)==null||!p.utm_term||((h=t.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return g&&_&&b&&v}return!1}static Hn(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];$e.info("[WebExperiments] "+t,r)}Un(t,n,r){this._is_bot()?Rr.Hn(OI):n!=="control"?r.forEach((o=>{if(o.selector){var s;Rr.Hn("applying transform of variant "+n+" for experiment "+t+" ",o);var l=(s=document)==null?void 0:s.querySelectorAll(o.selector);l?.forEach((c=>{var d=c;o.html&&(d.innerHTML=o.html),o.css&&d.setAttribute("style",o.css)}))}})):Rr.Hn("Control variants leave the page unmodified.")}_is_bot(){return go&&this._instance?t6(go,this.Bt.custom_blocked_useragents):void 0}}var ko=mn("[Conversations]"),Ga="Conversations not available yet.",lv={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return(e=(t=this.ni)==null?void 0:t.wr(this.Bt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Nr.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=(e=this.Bt.evaluation_contexts)!==null&&e!==void 0?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Nr.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Nr.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var o,s,l=(o=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&o!==void 0?o:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,p)=>(f[p]=r[p]||!1,f)),{}),d=Object.keys(l).filter((f=>c[f])).reduce(((f,p)=>(l[p]&&(f[p]=l[p]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:d})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},o=n!=null&&n.merge?this.getFlagPayloads():{},s=Ne({},r,e),l=Ne({},o,t),c={};for(var[d,f]of Object.entries(s)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:ze(l?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(k1),t=this.os(os),n=this.os(Sc);if(!n&&!t)return e||{};var r=Rn({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var l,c,d=r[s],f=t?.[s],p=ze(f)?(l=d?.enabled)!==null&&l!==void 0&&l:!!f,h=ze(f)?d.variant:typeof f=="string"?f:void 0,g=n?.[s],v=Ne({},d,{enabled:p,variant:p?h??d?.variant:void 0});p!==d?.enabled&&(v.original_enabled=d?.enabled),h!==d?.variant&&(v.original_variant=d?.variant),g&&(v.metadata=Ne({},d?.metadata,{payload:g,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),r[s]=v}return this.Jn||(Nr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Jn=!0),r}getFlagVariants(){var e=this.os(Mc),t=this.os(os);if(!t)return e||{};for(var n=Rn({},e),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Jn=!0),n}getFlagPayloads(){var e=this.os(D1),t=this.os(Sc);if(!t)return e||{};for(var n=Rn({},e||{}),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Jn=!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var n=this.Bt.token,r=this.os(cg),o={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ne({},((t=this.ni)==null?void 0:t.get_initial_props())||{},this.os(Md)||{}),group_properties:this.os(Wa),timezone:K5()};ys(r)||ze(r)||(o.$device_id=r),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.cs()&&(o.evaluation_contexts=this.hs());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:s,data:o,compression:this.Bt.disable_compression?void 0:yi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:l=>{var c,d,f,p=!0;if(l.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),p=!1),this.Qn=!1,!o.disable_flags||this.ts){this.rs=!p;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):l.statusCode!==200&&h.push("api_error_"+l.statusCode),(c=l.json)!=null&&c.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var g,v=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes("feature_flags"));v&&h.push("quota_limited"),(f=this.ni)==null||f.register({[U1]:h}),v?Nr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(o.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},p,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else Nr.warn('getFeatureFlag for key "'+e+hb)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,o=n[e],s=this.getFlagPayloads()[e],l=String(o),c=this.os(L1)||void 0,d=this.os(dg)||void 0,f=this.os(jd)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var p,h=this._instance.get_session_id(),g=this.os(z1);h&&h!==g&&(f={},(p=this.ni)==null||p.register({[jd]:f,[z1]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in f)||!f[e].includes(l))){var v,_,b,x,S,E,T,R,O,A;Pt(f[e])?f[e].push(l):f[e]=[l],(v=this.ni)==null||v.register({[jd]:f});var I=this.getFeatureFlagDetails(e),P=[...(_=this.os(U1))!==null&&_!==void 0?_:[]];ze(o)&&P.push("flag_missing");var L={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((b=this.Bt.bootstrap)==null||(b=b.featureFlags)==null?void 0:b[e])||null,$feature_flag_bootstrapped_payload:((x=this.Bt.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[e])||null,$used_bootstrap_value:!this.rs};ze(I==null||(S=I.metadata)==null?void 0:S.version)||(L.$feature_flag_version=I.metadata.version);var q,j=(E=I==null||(T=I.reason)==null?void 0:T.description)!==null&&E!==void 0?E:I==null||(R=I.reason)==null?void 0:R.code;j&&(L.$feature_flag_reason=j),I!=null&&(O=I.metadata)!=null&&O.id&&(L.$feature_flag_id=I.metadata.id),ze(I?.original_variant)&&ze(I?.original_enabled)||(L.$feature_flag_original_response=ze(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(A=I.metadata)!=null&&A.original_payload&&(L.$feature_flag_original_payload=I==null||(q=I.metadata)==null?void 0:q.original_payload),P.length&&(L.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",L)}if(r){var B=s;if(!ze(s))try{B=JSON.parse(s)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:B}}}}else Nr.warn('getFeatureFlagResult for key "'+e+hb)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Bt.disable_compression?void 0:yi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(o){var s,l=(s=o.json)==null?void 0:s.featureFlagPayloads;t(l?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return ze(n)?void 0:!!n}Nr.warn('isFeatureEnabled for key "'+e+hb)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),o=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,d,f,p,h){d===void 0&&(d={}),f===void 0&&(f={}),p===void 0&&(p={});var g=(P=>{var L=P.flags;return L?(P.featureFlags=Object.fromEntries(Object.keys(L).map((q=>{var j;return[q,(j=L[q].variant)!==null&&j!==void 0?j:L[q].enabled]}))),P.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter((q=>L[q].enabled)).filter((q=>{var j;return(j=L[q].metadata)==null?void 0:j.payload})).map((q=>{var j;return[q,(j=L[q].metadata)==null?void 0:j.payload]})))):Nr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),P})(l),v=g.flags,_=g.featureFlags,b=g.featureFlagPayloads;if(_){var x=l.requestId,S=l.evaluatedAt;if(Pt(_)){Nr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var E={};if(_)for(var T=0;_.length>T;T++)E[_[T]]=!0;c&&c.register({[Om]:_,[Mc]:E})}else{var R=_,O=b,A=v;if(h!=null&&h.partialResponse)R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);else if(l.errorsWhileComputingFlags)if(v){var I=new Set(Object.keys(v).filter((P=>{var L;return!((L=v[P])!=null&&L.failed)})));R=Ne({},d,Object.fromEntries(Object.entries(R).filter((P=>{var[L]=P;return I.has(L)})))),O=Ne({},f,Object.fromEntries(Object.entries(O||{}).filter((P=>{var[L]=P;return I.has(L)})))),A=Ne({},p,Object.fromEntries(Object.entries(A||{}).filter((P=>{var[L]=P;return I.has(L)}))))}else R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);c&&c.register(Ne({[Om]:Object.keys(RI(R)),[Mc]:R||{},[D1]:O||{},[k1]:A||{}},x?{[L1]:x}:{},S?{[dg]:S}:{}))}}})(e,this.ni,r,o,s,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Nr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Nr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.ni.unregister(os),this.ni.unregister(Sc),this.ps(),Ha.info("All overrides cleared");if(Pt(e)){var t=xI(e);return this.ni.register({[os]:t}),this.ps(),Ha.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ni.unregister(os),Ha.info("Flag overrides cleared");else if(r.flags){if(Pt(r.flags)){var o=xI(r.flags);this.ni.register({[os]:o})}else this.ni.register({[os]:r.flags});Ha.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ni.unregister(Sc),Ha.info("Payload overrides cleared")):r.payloads&&(this.ni.register({[Sc]:r.payloads}),Ha.info("Payload overrides set",{payloads:r.payloads}))),void this.ps()}if(e&&typeof e=="object")return this.ni.register({[os]:e}),this.ps(),Ha.info("Flag overrides set",{flags:e});Nr.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this.os(Id)||[]).find((d=>d.flagKey===e)),s={["$feature_enrollment/"+e]:t},l={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(l.$early_access_feature_name=o.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=Ne({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[Om]:Object.keys(RI(c)),[Mc]:c}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(Id),o=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+o),method:"GET",callback:s=>{var l,c;if(s.json){var d=s.json.earlyAccessFeatures;return(l=this.ni)==null||l.unregister(Id),(c=this.ni)==null||c.register({[Id]:d}),e(d)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Md)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),o=e?.$set_once,s={};if(o)for(var l in o)({}).hasOwnProperty.call(o,l)&&(l in n||(s[l]=o[l]));this._instance.register({[Md]:Ne({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Md)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Wa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Ne({},n[r],e[r]),delete e[r]})),this._instance.register({[Wa]:Ne({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(Wa)||{};this._instance.register({[Wa]:Ne({},t,{[e]:{}})})}else this._instance.unregister(Wa)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Kre={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){var e,t;return this.bs===vd||this.bs===Tp?this.bs:(e=(t=this.ys)==null?void 0:t.status)!==null&&e!==void 0?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=gI,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Ys.error("started without valid sessionManager"),new Error(nw+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===as)throw new Error(nw+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(Ad))==null||!e.enabled),n=!this.Bt.disable_session_recording,r=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return me&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!ze(Object.assign)&&!ze(Array.from);this.ws&&n?(this.Is(e),Ys.info("starting")):(this.bs=gI,this.stopRecording())}}Is(e){var t,n,r;this.ws&&(this.bs!==vd&&this.bs!==Tp&&(this.bs=vI),We!=null&&(t=We.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=We.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(o=>{if(o)return Ys.error("could not load recorder",o);this.Cs(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(GS)}Ts(e,t){if(St(e))return null;var n,r=Fo(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ys.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}As(e){if(this.ni){var t,n,r=this.ni,o=()=>{var s,l=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.Ts((s=this.Bt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),d=this.Ts(l?.sampleRate,"remote config sampleRate"),f=c??d;St(f)&&this.ks();var p=l?.minimumDurationMilliseconds;r.register({[Ad]:Ne({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:Ne({capturePerformance:e.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ze(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};o(),(t=this._s)==null||t.call(this),this._s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===vd&&(this.bs=Tp,Ys.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Ys.warn("log called before recorder was ready")}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ad);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Ad);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}Cs(e){var t,n;if((t=We.__PosthogExtensions__)==null||!t.initSessionRecording)return Ys.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[L5]:!0});if(this.ys||(this.ys=(n=We.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es())return this.bs===Tp||this.bs===vd?void 0:(this.bs=vd,Ys.info("persisted remote config is stale, requesting fresh config before starting"),void new Z5(this._instance).load());this.bs=vI,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[I5]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[A5]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e==="url"?M5:P5]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.ys)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},Zre={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new fI(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,n=An(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Os(){if(this.isBrowserSupported()){if(me&&Le){var e=n=>{n=n||me?.event;try{this.Ps(n)}catch(r){hI.error("Failed to capture event",r)}};if(Vn(Le,"submit",e,{capture:!0}),Vn(Le,"change",e,{capture:!0}),Vn(Le,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=n=>{this.Ps(n=n||me?.event,ub)};Vn(Le,"copy",t,{capture:!0}),Vn(Le,"cut",t,{capture:!0})}}}else hI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[O1]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((r=>{var o=Le?.querySelectorAll(r);o?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[O1];if(ys(this.Ns)&&!xi(n)&&!this.instance.Fr())return!1;var r=(t=this.Ns)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}Ps(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=sI(e);s6(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(h,g){if(!me||ew(h))return!1;var v,_,b;if(xi(g)?(v=!!g&&lI,_=void 0):(v=(b=g?.css_selector_ignorelist)!==null&&b!==void 0?b:lI,_=g?.content_ignorelist),v===!1)return!1;var{targetElementList:x}=cI(h,!1);return!(function(S,E){if(S===!1||ze(S))return!1;var T;if(S===!0)T=Mre;else{if(!Pt(S))return!1;if(S.length>10)return $e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;T=S.map((R=>R.toLowerCase()))}return E.some((R=>{var{safeText:O,ariaLabel:A}=R;return T.some((I=>O.includes(I)||A.includes(I)))}))})(_,x.map((S=>{var E;return{safeText:cf(S).toLowerCase(),ariaLabel:((E=S.getAttribute("aria-label"))==null?void 0:E.toLowerCase().trim())||""}})))&&!aI(x,v)})(r,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var o=t===ub;if(r&&(function(h,g,v,_,b){var x,S,E,T;if(v===void 0&&(v=void 0),!me||ew(h)||(x=v)!=null&&x.url_allowlist&&!iI(v.url_allowlist)||(S=v)!=null&&S.url_ignorelist&&iI(v.url_ignorelist))return!1;if((E=v)!=null&&E.dom_event_allowlist){var R=v.dom_event_allowlist;if(R&&!R.some((L=>g.type===L)))return!1}var{parentIsUsefulElement:O,targetElementList:A}=cI(h,_);if(!(function(L,q){var j=q?.element_allowlist;if(ze(j))return!0;var B,F=function(ie){if(j.some((H=>ie.tagName.toLowerCase()===H)))return{v:!0}};for(var Z of L)if(B=F(Z))return B.v;return!1})(A,v)||!aI(A,(T=v)==null?void 0:T.css_selector_allowlist))return!1;var I=me.getComputedStyle(h);if(I&&I.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0;var P=h.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(b||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(g.type)>=0;default:return O?(b||["click"]).indexOf(g.type)>=0:(b||["click"]).indexOf(g.type)>=0&&(JS.indexOf(P)>-1||h.getAttribute("contenteditable")==="true")}})(r,e,this.Bt,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:l}=jre(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(l)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(s.$element_selectors=c),t===ub){var d,f=l6(me==null||(d=me.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!f)return!1;s.$selected_content=f,s.$copy_type=p}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return is(Le?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(me==null||(t=me.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,$e.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(me&&me.history){var n=this;(e=me.history.pushState)!=null&&e.__posthog_wrapped__||pI(me.history,"pushState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("pushState")})),(t=me.history.replaceState)!=null&&t.__posthog_wrapped__||pI(me.history,"replaceState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("replaceState")})),this.js()}}Bs(e){try{var t,n=me==null||(t=me.location)==null?void 0:t.pathname;if(!n)return;n!==this.Ls&&this.isEnabled&&this._instance.capture(Ec,{navigation_type:e}),this.Ls=n}catch(r){$e.error("Error capturing "+e+" pageview",r)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};Vn(me,"popstate",e),this.Ds=()=>{me&&me.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[T1]),this.rageclicks=new fI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return An(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return St(this.Bt.capture_heatmaps)?St(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:this.Bt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Ure.info("starting..."),this.Zs(),this.Ft()}else{var e;clearInterval((e=this.qs)!==null&&e!==void 0?e:void 0),this.Vs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[T1]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Hs(e){this.Tt(e.originalEvent,"deadclick")}Ft(){this.qs&&clearInterval(this.qs),this.qs=Le?.visibilityState==="visible"?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){me&&Le&&(this.zs=this.Yr.bind(this),Vn(me,mg,this.zs),this.Us=e=>this.Tt(e||me?.event),Vn(Le,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||me?.event),Vn(Le,"mousemove",this.Ys,{capture:!0}),this.Ws=new zA(this.instance,Jne,this.Hs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Ft.bind(this),Vn(Le,pg,this.Xs),this.Rs=!0)}Vs(){var e;me&&Le&&(this.zs&&me.removeEventListener(mg,this.zs),this.Us&&Le.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Le.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Le.removeEventListener(pg,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(l,c,d){for(var f=l;f&&av(f)&&!ua(f,"body");){if(f===d)return!1;if(wt(c,me?.getComputedStyle(f).position))return!0;f=c6(f)}return!1})(sI(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}Tt(e,t){var n;if(t===void 0&&(t="click"),!oI(e.target)&&yI(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(Ne({},r,{type:"rageclick"})),this.Qs(r)}}Gs(e){!oI(e.target)&&yI(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(me){var t=me.location.href,n=this.Bt.custom_personal_data_properties,r=this.Bt.mask_personal_data_properties?[...Qc,...n||[]]:[],o=af(t,r,lf);this.T=this.T||{},this.T[o]||(this.T[o]=[]),this.T[o].push(e)}}Yr(){this.T&&!Ic(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zA,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((n,r)=>Ne({},n,{["$web_vitals_"+r.name+"_event"]:Ne({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(ze(o))Zs.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();ze(s)||(St(n?.name)||St(n?.value)?Zs.error("Invalid metric received",n):!this.no||this.no>n.value?(this.T.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),ze(this.T.url)&&(this.T.url=s),this.T.firstMetricTimestamp=ze(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(Ne({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Zs.error("Ignoring metric with value >= "+this.no,n))}},this.so=()=>{if(!this.Rs){var n,r,o,s,l=We.__PosthogExtensions__;ze(l)||ze(l.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:s}=l.postHogWebVitalsCallbacks),n&&r&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.Rs=!0):Zs.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[M1]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=An(this.oo)?(e=this.oo)==null?void 0:e.web_vitals_allowed_metrics:void 0;return St(n)?((t=this._instance.persistence)==null?void 0:t.props[N1])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(An(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=An(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=An(this.oo)&&Fo(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:mI;return e>0&&6e4>=e?mI:e}get isEnabled(){var e=pr?.protocol;if(e!=="http:"&&e!=="https:")return Zs.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=An(this.oo)?this.oo.web_vitals:xi(this.oo)?this.oo:void 0;return xi(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Zs.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=An(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=An(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[M1]:t}),this._instance.persistence.register({[N1]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Zs.error("failed to load script",r):e()}))}io(){var e=me?me.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qc,...t||[]]:[];return af(e,n,lf)}Zs.error("Could not determine current URL")}}},Yre={exceptionObserver:class{constructor(e){var t,n,r;this.so=()=>{var o;if(me&&this.isEnabled&&(o=We.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=We.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=We.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=We.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=s(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=l(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=c(this.captureException.bind(this)))}catch(d){gd.error("failed to start",d),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[C1]),this.do=new lne({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,Gt:gd}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return An(e)?t=Ne({},t,e):(ze(e)?this.co:e)&&(t=Ne({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gd.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return gd.error("failed to load script",r);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[C1]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r,o=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.do.consumeRateLimit(o)?gd.info("Skipping exception capture because of client rate limiting.",{exception:o}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.fo=[],this.po=new wne([new Ane,new jne,new Mne,new Ine,new Lne,new Dne,new Nne,new $ne],(function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;o>l;l++)s[l-1]=arguments[l];return function(c,d){d===void 0&&(d=0);for(var f=[],p=c.split(`
|
|
156
|
-
`),h=d;p.length>h;h++){var g=p[h];if(1024>=g.length){var v=DA.test(g)?g.replace(DA,"$1"):g;if(!v.match(/\S*Error: /)){for(var _ of s){var b=_(v,r);if(b){f.push(b);break}}if(f.length>=50)break}}}return(function(x){if(!x.length)return[];var S=Array.from(x);return S.reverse(),S.slice(0,50).map((E=>{return Ne({},E,{filename:E.filename||(T=S,T[T.length-1]||{}).filename,function:E.function||Wc});var T}))})(f)}})("web:javascript",Rne,Cne)),this._instance=e,this.fo=(t=(n=this._instance.persistence)==null?void 0:n.get_property(A1))!==null&&t!==void 0?t:[],this.mo=lg(this.yo()),this.bo=new Une(this.mo)}onConfigChange(){this.mo=lg(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fo=o,this._instance.persistence&&this._instance.persistence.register({[A1]:this.fo,[I1]:s})}}get _o(){var e,t=!!this._instance.get_property(I1),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!_n(e)||e.trim().length===0)return void es.warn("Ignoring exception step because message must be a non-empty string");var n=this.wo(t),{sanitizedProperties:r,droppedKeys:o}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(s).reduce(((c,d)=>zne.has(d)?(l.push(d),c):(c[d]=s[d],c)),{}),droppedKeys:l}})(n);o.length>0&&es.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.bo.add(Ne({[sg]:e,[ag]:new Date().toISOString()},r))}catch(s){es.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void es.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void es.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void es.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.mo.enabled&&St(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return r&&this.bo.clear(),r}catch(o){return es.error("Failed to capture exception event. Dropping this exception.",o),void this.bo.clear()}}catch(o){return void es.error("Failed to process exception event. Ignoring this exception.",o)}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:Ne({},e,{$exception_steps:t})}catch(n){return es.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}So(e){this.mo.enabled&&this.bo.add({[sg]:e,[ag]:new Date().toISOString()})}wo(e){return An(e)?Ne({},e):{}}yo(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:o,value:s}=r;return _n(o)&&o.length>0&&n.$exception_types.push(o),_n(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.fo.some((n=>{var r=n.values.map((o=>{var s,l=n6[o.operator],c=Pt(o.value)?o.value:[o.value],d=(s=t[o.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,d)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}xo(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,n,r,o,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],l=s[s.length-1];return(r=l==null||(o=l.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Io(e){return!St(e)&&Pt(e)}}},Wre=Ne({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[P1]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(P1)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?_I.error("Could not load product tours script",r):e()}))}Ro(){var e;!this.Ao&&(e=We.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=We.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Pt(this.Eo)||t){var n=this.ni;if(n){var r=n.props[Tm];if(Pt(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var s=o.statusCode;if(s!==200||!o.json){var l="Product Tours API could not be loaded, status: "+s;return _I.error(l),void e([],{isLoaded:!1,error:l})}var c=Pt(o.json.product_tours)?o.json.product_tours:[];this.Eo=c,n&&n.register({[Tm]:c}),e(c,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){St(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(Tm)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},lv),Qre={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=We._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,r,o,s,l,c;if(!e)throw new Error("Event payload is required");var d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(p))d[h]={id:f[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:Ne({},r5(e,Fre),{properties:Ne({},e.properties,_?{$set:Ne({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},v?{$set_once:Ne({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(s=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var l;!t.errored&&this.No.length&&(Ws.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((c=>t.processEvent==null?void 0:t.processEvent(c))),t.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((l=this.Fo)==null||l.call(this))},r=!1,o=l=>{t.errored=!l,t.loaded=!0,Ws.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(l){o(l)}});s&&(t.processEvent=s),r=!0}catch(l){Ws.error(bI+e.id,l),o(!1)}if(r&&t.loaded)try{n()}catch(l){Ws.error("Error while processing buffered events PostHog app with config id "+e.id,l),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Ws.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(d=>this.Po(d)))):void Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(d){var f;We["__$$ph_site_app_"+d]=o._instance,(f=We.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(o._instance,c,(p=>{if(p)return Ws.error(bI+d,p)}))};for(var{id:l,url:c}of e.siteApps)s(l)}else Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Xre={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var t,n,r=this.Bo()||[];ze(this.Lo)&&((t=We.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),ze(this.Do)&&((n=We.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return zre.error("failed to load script",r);e()}))}Bo(){var e;return(e=this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},Jre=Ne({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(St(t))return Xt.warn("Flags not loaded yet. Not loading surveys.");var n=Pt(t);this.jo=n?t.length>0:t,Xt.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(X1)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Xt.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)Xt.info(wI);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Xt.info("Not loading surveys in cookieless mode without consent.");else{var e=We?.__PosthogExtensions__;if(e){if(!ze(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Vo(n,t);var r=e.loadExternalDependency;if(!r)return void this.Ho(KS);r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.Ho("Could not load surveys script",o):this.Vo(e.generateSurveys,t)}))}catch(o){throw this.Ho("Error initializing surveys",o),o}finally{this.$o=!1}}}else Xt.error("PostHog Extensions not found.")}}Vo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new qre(this._instance),Xt.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Ho(e,t){Xt.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Xt.info(wI),e([]);var n,r=this._instance.get_property($1);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.Zo?this.Zo.then((o=>{var{surveys:s,context:l}=o;return e(s,l)})):(typeof Promise<"u"&&(this.Zo=new Promise((o=>{n=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:o=>{var s;this.Zo=null;var l=o.statusCode;if(l!==200||!o.json){var c="Surveys API could not be loaded, status: "+l;Xt.error(c);var d={isLoaded:!1,error:c};return e([],d),void(n==null||n({surveys:[],context:d}))}var f,p=o.json.surveys||[],h=p.filter((v=>(function(_){return!(!_.start_date||_.end_date)})(v)&&((function(_){var b;return!((b=_.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(v)||(function(_){var b;return!((b=_.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(v))));h.length>0&&((f=this._surveyEventReceiver)==null||f.register(h)),(s=this._instance.persistence)==null||s.register({[$1]:p});var g={isLoaded:!0};e(p,g),n?.({surveys:p,context:g})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){Xt.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!St(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Xt.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),t}Yo(e){if(St(this._surveyManager))return{eligible:!1,reason:fb};var t=typeof e=="string"?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(St(this._surveyManager))return Xt.warn("init was not called"),{visible:!1,disabledReason:fb};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return St(this._surveyManager)?(Xt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:fb})):new Promise((n=>{this.getSurveys((r=>{var o,s=(o=r.find((c=>c.id===e)))!==null&&o!==void 0?o:null;if(s){var l=this.Yo(s);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(St(this._surveyManager))Xt.warn("init was not called");else{var o=typeof e=="string"?this.Uo(e):e;if(o!=null&&o.id)if(xre.includes(o.type)){var s=Le?.querySelector(t);if(s)return(r=o.appearance)!=null&&r.surveyPopupDelaySeconds?(Xt.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Xt.info("Rendering survey "+o.id+" with delay of "+((l=o.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(o,s,n),Xt.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,s,n);Xt.warn("Survey element not found")}else Xt.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Xt.warn("Survey not found")}}displaySurvey(e,t){var n;if(St(this._surveyManager))Xt.warn("init was not called");else{var r=this.Uo(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=Ne({},r,{appearance:Ne({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==G1.Popover&&t.initialResponses&&Xt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void Xt.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==G1.Inline?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Xt.warn("Survey not found")}}cancelPendingSurvey(e){St(this._surveyManager)?Xt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},lv),eoe={toolbar:class{constructor(e){this.instance=e}Go(e){We.ph_toolbar_state=e}Wo(){var e;return(e=We.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),$5(this.instance.config)||!me||!Le)return!1;e=e??me.location,n=n??me.history;try{if(!t){try{me.localStorage.setItem("test","test"),me.localStorage.removeItem("test")}catch{return!1}t=me?.localStorage}var r,o=Hre||_g(e.hash,"__posthog")||_g(e.hash,"state"),s=o?$A((()=>JSON.parse(atob(decodeURIComponent(o)))))||$A((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(SI)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Xo(e){var t=We.ph_load_toolbar||We.ph_load_editor;!St(t)&&is(t)?t(e,this.instance):EI.warn("No toolbar load function found")}loadToolbar(e){var t=!(Le==null||!Le.getElementById(N5));if(!me||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Ne({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(me.localStorage.setItem(SI,JSON.stringify(Ne({},r,{source:void 0}))),this.Wo()===2)this.Xo(r);else if(this.Wo()===0){var o;this.Go(1),(o=We.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return EI.error("[Toolbar] Failed to load",s),void this.Go(0);this.Go(2),this.Xo(r)})),Vn(me,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(r)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},toe=Ne({experiments:Rr},lv),noe={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;St(t)||(xi(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||$5(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=We?.__PosthogExtensions__;if(e&&!ze(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(KS);n(this._instance,"conversations",(r=>{r||!e.initConversations?this.ra("Could not load conversations script",r):this.ta(e.initConversations),this.Qo=!1}))}catch(r){this.ra("Error initializing conversations",r),this.Qo=!1}}else ko.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),ko.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else ko.error("Cannot complete initialization: remote config is null")}ra(e,t){ko.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():ko.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ko===!0&&!ys(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Lo((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ko.warn(Ga),null)}))()}getMessages(e,t){var n=this;return Lo((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ko.warn(Ga),null)}))()}markAsRead(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ko.warn(Ga),null)}))()}getTickets(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ko.warn(Ga),null)}))()}requestRestoreLink(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ko.warn(Ga),null)}))()}restoreFromToken(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ko.warn(Ga),null)}))()}restoreFromUrlToken(){var e=this;return Lo((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ko.warn(Ga),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},roe={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=mn("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!St(n)&&n&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=We?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.Gt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(KS)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,o,s,l;if(this._instance.is_capturing())if(e&&e.body){var c=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,d=(r=(o=this._instance.config.logs)==null?void 0:o.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,f=Date.now();if(c>f-this.aa||(this.aa=f,this.oa=0,this.la=!1),d>this.oa){this.oa++;var p=(function(h,g){var v=h.level||"info",{text:_,number:b}=E5[v]||_ne,x=String(Date.now())+"000000",S={};g.distinctId&&(S.posthogDistinctId=g.distinctId),g.sessionId&&(S.sessionId=g.sessionId),g.currentUrl&&(S["url.full"]=g.currentUrl),g.screenName&&(S["screen.name"]=g.screenName),g.appState&&(S["app.state"]=g.appState),g.activeFeatureFlags&&g.activeFeatureFlags.length>0&&(S.feature_flags=g.activeFeatureFlags);var E=Ne({},S,h.attributes||{}),T={timeUnixNano:x,observedTimeUnixNano:x,severityNumber:b,severityText:_,body:{stringValue:h.body},attributes:kA(E)};return h.trace_id&&(T.traceId=h.trace_id),h.span_id&&(T.spanId=h.span_id),ze(h.trace_flags)||(T.flags=h.trace_flags),T})(e,this.ua());this.sa.push({record:p}),((s=(l=this._instance.config.logs)==null?void 0:l.maxBufferSize)!==null&&s!==void 0?s:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+d+" logs per "+c+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=Ne({"service.name":n?.serviceName||"unknown_service"},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),o=(function(l,c,d,f){return{resourceLogs:[{resource:{attributes:kA(c)},scopeLogs:[{scope:{name:d,version:f},logRecords:l}]}]}})(t.map((l=>l.record)),r,$r.LIB_NAME,$r.LIB_VERSION),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Vi({method:"POST",url:s,data:o,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(We!=null&&(e=We.location)!=null&&e.href&&(t.currentUrl=We.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},ooe=Ne({},lv,Kre,Zre,Yre,Wre,Qre,Jre,Xre,eoe,toe,noe,roe);$o.__defaultExtensionClasses=Ne({},ooe);var TI,yl=(TI=Ud[xc]=new $o,(function(){function e(){e.done||(e.done=!0,i6=!1,dn(Ud,(function(t){t._dom_loaded()})))}Le!=null&&Le.addEventListener?Le.readyState==="complete"?e():Vn(Le,"DOMContentLoaded",e,{capture:!1}):me&&$e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),TI);const ioe={from({org:e,project:t}){return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}}},p6=M.createContext(void 0),soe=()=>{const e=M.useContext(p6);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},tue=()=>soe().org,nue=e=>{const t=er.c(10),{children:n,org:r,project:o}=e;let s;t[0]!==r.id||t[1]!==o.id?(s=ioe.from({org:r.id,project:o.id}),t[0]=r.id,t[1]=o.id,t[2]=s):s=t[2];const l=s;let c;t[3]!==l||t[4]!==r||t[5]!==o?(c={org:r,project:o,locator:l},t[3]=l,t[4]=r,t[5]=o,t[6]=c):c=t[6];const d=c;let f;return t[7]!==n||t[8]!==d?(f=C.jsx(p6.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},cv={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,r)=>["mcp","client",e,t,n,r],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpUiResourceHtml:(e,t,n)=>["mcp","ui-resource-html",e,t,n],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],virtualMcpLastUsed:(e,t)=>["virtual-mcp","last-used",e,t],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,r,o)=>[e,t,n,"collection",r,o],collectionList:(e,t,n,r,o)=>[e,t,n,"collection",r,"list",o],collectionListInfinite:(e,t,n,r,o)=>[e,t,n,"collection",r,"list-infinite",o],githubReadme:(e,t)=>["github-readme",e,t],githubBranches:(e,t,n,r,o)=>["github-branches",e,t,n,r,o],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e],registryApp:(e,t)=>["registry-app",e,t]},aoe="2025-11-25",rue=[aoe,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],loe="io.modelcontextprotocol/related-task",uv="2.0",Xn=wV(e=>e!==null&&(typeof e=="object"||typeof e=="function")),m6=nn([$(),at().int()]),g6=$();vr({ttl:at().optional(),pollInterval:at().optional()});const coe=be({ttl:at().optional()}),uoe=be({taskId:$()}),eE=vr({progressToken:m6.optional(),[loe]:uoe.optional()}),wo=be({_meta:eE.optional()}),Of=wo.extend({task:coe.optional()}),oue=e=>Of.safeParse(e).success,_r=be({method:$(),params:wo.loose().optional()}),Vo=be({_meta:eE.optional()}),qo=be({method:$(),params:Vo.loose().optional()}),br=vr({_meta:eE.optional()}),dv=nn([$(),at().int()]),v6=be({jsonrpc:Ge(uv),id:dv,..._r.shape}).strict(),iue=e=>v6.safeParse(e).success,y6=be({jsonrpc:Ge(uv),...qo.shape}).strict(),sue=e=>y6.safeParse(e).success,tE=be({jsonrpc:Ge(uv),id:dv,result:br}).strict(),aue=e=>tE.safeParse(e).success;var uf;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(uf||(uf={}));const nE=be({jsonrpc:Ge(uv),id:dv.optional(),error:be({code:at().int(),message:$(),data:Gt().optional()})}).strict(),lue=e=>nE.safeParse(e).success,cue=nn([v6,y6,tE,nE]);nn([tE,nE]);const _6=br.strict(),doe=Vo.extend({requestId:dv.optional(),reason:$().optional()}),b6=qo.extend({method:Ge("notifications/cancelled"),params:doe}),foe=be({src:$(),mimeType:$().optional(),sizes:Re($()).optional(),theme:rn(["light","dark"]).optional()}),Tf=be({icons:Re(foe).optional()}),Jc=be({name:$(),title:$().optional()}),w6=Jc.extend({...Jc.shape,...Tf.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),hoe=qw(be({applyDefaults:Nt().optional()}),Mt($(),Gt())),poe=Gw(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,qw(be({form:hoe.optional(),url:Xn.optional()}),Mt($(),Gt()).optional())),moe=vr({list:Xn.optional(),cancel:Xn.optional(),requests:vr({sampling:vr({createMessage:Xn.optional()}).optional(),elicitation:vr({create:Xn.optional()}).optional()}).optional()}),goe=vr({list:Xn.optional(),cancel:Xn.optional(),requests:vr({tools:vr({call:Xn.optional()}).optional()}).optional()}),voe=be({experimental:Mt($(),Xn).optional(),sampling:be({context:Xn.optional(),tools:Xn.optional()}).optional(),elicitation:poe.optional(),roots:be({listChanged:Nt().optional()}).optional(),tasks:moe.optional(),extensions:Mt($(),Xn).optional()}),yoe=wo.extend({protocolVersion:$(),capabilities:voe,clientInfo:w6}),_oe=_r.extend({method:Ge("initialize"),params:yoe}),boe=be({experimental:Mt($(),Xn).optional(),logging:Xn.optional(),completions:Xn.optional(),prompts:be({listChanged:Nt().optional()}).optional(),resources:be({subscribe:Nt().optional(),listChanged:Nt().optional()}).optional(),tools:be({listChanged:Nt().optional()}).optional(),tasks:goe.optional(),extensions:Mt($(),Xn).optional()}),woe=br.extend({protocolVersion:$(),capabilities:boe,serverInfo:w6,instructions:$().optional()}),S6=qo.extend({method:Ge("notifications/initialized"),params:Vo.optional()}),uue=e=>S6.safeParse(e).success,E6=_r.extend({method:Ge("ping"),params:wo.optional()}),Soe=be({progress:at(),total:bn(at()),message:bn($())}),Eoe=be({...Vo.shape,...Soe.shape,progressToken:m6}),x6=qo.extend({method:Ge("notifications/progress"),params:Eoe}),xoe=wo.extend({cursor:g6.optional()}),Cf=_r.extend({params:xoe.optional()}),Af=br.extend({nextCursor:g6.optional()}),Roe=rn(["working","input_required","completed","failed","cancelled"]),If=be({taskId:$(),status:Roe,ttl:nn([at(),ZB()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:bn(at()),statusMessage:bn($())}),R6=br.extend({task:If}),Ooe=Vo.merge(If),O6=qo.extend({method:Ge("notifications/tasks/status"),params:Ooe}),T6=_r.extend({method:Ge("tasks/get"),params:wo.extend({taskId:$()})}),C6=br.merge(If),A6=_r.extend({method:Ge("tasks/result"),params:wo.extend({taskId:$()})});br.loose();const I6=Cf.extend({method:Ge("tasks/list")}),M6=Af.extend({tasks:Re(If)}),P6=_r.extend({method:Ge("tasks/cancel"),params:wo.extend({taskId:$()})}),due=br.merge(If),N6=be({uri:$(),mimeType:bn($()),_meta:Mt($(),Gt()).optional()}),k6=N6.extend({text:$()}),rE=$().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),D6=N6.extend({blob:rE}),Mf=rn(["user","assistant"]),iu=be({audience:Re(Mf).optional(),priority:at().min(0).max(1).optional(),lastModified:G3({offset:!0}).optional()}),L6=be({...Jc.shape,...Tf.shape,uri:$(),description:bn($()),mimeType:bn($()),size:bn(at()),annotations:iu.optional(),_meta:bn(vr({}))}),Toe=be({...Jc.shape,...Tf.shape,uriTemplate:$(),description:bn($()),mimeType:bn($()),annotations:iu.optional(),_meta:bn(vr({}))}),Coe=Cf.extend({method:Ge("resources/list")}),Aoe=Af.extend({resources:Re(L6)}),Ioe=Cf.extend({method:Ge("resources/templates/list")}),Moe=Af.extend({resourceTemplates:Re(Toe)}),oE=wo.extend({uri:$()}),Poe=oE,Noe=_r.extend({method:Ge("resources/read"),params:Poe}),koe=br.extend({contents:Re(nn([k6,D6]))}),Doe=qo.extend({method:Ge("notifications/resources/list_changed"),params:Vo.optional()}),Loe=oE,$oe=_r.extend({method:Ge("resources/subscribe"),params:Loe}),joe=oE,zoe=_r.extend({method:Ge("resources/unsubscribe"),params:joe}),Uoe=Vo.extend({uri:$()}),Foe=qo.extend({method:Ge("notifications/resources/updated"),params:Uoe}),Boe=be({name:$(),description:bn($()),required:bn(Nt())}),Voe=be({...Jc.shape,...Tf.shape,description:bn($()),arguments:bn(Re(Boe)),_meta:bn(vr({}))}),qoe=Cf.extend({method:Ge("prompts/list")}),Hoe=Af.extend({prompts:Re(Voe)}),Goe=wo.extend({name:$(),arguments:Mt($(),$()).optional()}),Koe=_r.extend({method:Ge("prompts/get"),params:Goe}),iE=be({type:Ge("text"),text:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),sE=be({type:Ge("image"),data:rE,mimeType:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),aE=be({type:Ge("audio"),data:rE,mimeType:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),Zoe=be({type:Ge("tool_use"),name:$(),id:$(),input:Mt($(),Gt()),_meta:Mt($(),Gt()).optional()}),Yoe=be({type:Ge("resource"),resource:nn([k6,D6]),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),Woe=L6.extend({type:Ge("resource_link")}),lE=nn([iE,sE,aE,Woe,Yoe]),Qoe=be({role:Mf,content:lE}),Xoe=br.extend({description:$().optional(),messages:Re(Qoe)}),Joe=qo.extend({method:Ge("notifications/prompts/list_changed"),params:Vo.optional()}),eie=be({title:$().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),tie=be({taskSupport:rn(["required","optional","forbidden"]).optional()}),cE=be({...Jc.shape,...Tf.shape,description:$().optional(),inputSchema:be({type:Ge("object"),properties:Mt($(),Xn).optional(),required:Re($()).optional()}).catchall(Gt()),outputSchema:be({type:Ge("object"),properties:Mt($(),Xn).optional(),required:Re($()).optional()}).catchall(Gt()).optional(),annotations:eie.optional(),execution:tie.optional(),_meta:Mt($(),Gt()).optional()}),nie=Cf.extend({method:Ge("tools/list")}),rie=Af.extend({tools:Re(cE)}),$6=br.extend({content:Re(lE).default([]),structuredContent:Mt($(),Gt()).optional(),isError:Nt().optional()});$6.or(br.extend({toolResult:Gt()}));const oie=Of.extend({name:$(),arguments:Mt($(),Gt()).optional()}),iie=_r.extend({method:Ge("tools/call"),params:oie}),sie=qo.extend({method:Ge("notifications/tools/list_changed"),params:Vo.optional()}),fue=be({autoRefresh:Nt().default(!0),debounceMs:at().int().nonnegative().default(300)}),j6=rn(["debug","info","notice","warning","error","critical","alert","emergency"]),aie=wo.extend({level:j6}),lie=_r.extend({method:Ge("logging/setLevel"),params:aie}),cie=Vo.extend({level:j6,logger:$().optional(),data:Gt()}),uie=qo.extend({method:Ge("notifications/message"),params:cie}),die=be({name:$().optional()}),fie=be({hints:Re(die).optional(),costPriority:at().min(0).max(1).optional(),speedPriority:at().min(0).max(1).optional(),intelligencePriority:at().min(0).max(1).optional()}),hie=be({mode:rn(["auto","required","none"]).optional()}),pie=be({type:Ge("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:Re(lE).default([]),structuredContent:be({}).loose().optional(),isError:Nt().optional(),_meta:Mt($(),Gt()).optional()}),mie=Vw("type",[iE,sE,aE]),xg=Vw("type",[iE,sE,aE,Zoe,pie]),gie=be({role:Mf,content:nn([xg,Re(xg)]),_meta:Mt($(),Gt()).optional()}),vie=Of.extend({messages:Re(gie),modelPreferences:fie.optional(),systemPrompt:$().optional(),includeContext:rn(["none","thisServer","allServers"]).optional(),temperature:at().optional(),maxTokens:at().int(),stopSequences:Re($()).optional(),metadata:Xn.optional(),tools:Re(cE).optional(),toolChoice:hie.optional()}),yie=_r.extend({method:Ge("sampling/createMessage"),params:vie}),_ie=br.extend({model:$(),stopReason:bn(rn(["endTurn","stopSequence","maxTokens"]).or($())),role:Mf,content:mie}),bie=br.extend({model:$(),stopReason:bn(rn(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:Mf,content:nn([xg,Re(xg)])}),wie=be({type:Ge("boolean"),title:$().optional(),description:$().optional(),default:Nt().optional()}),Sie=be({type:Ge("string"),title:$().optional(),description:$().optional(),minLength:at().optional(),maxLength:at().optional(),format:rn(["email","uri","date","date-time"]).optional(),default:$().optional()}),Eie=be({type:rn(["number","integer"]),title:$().optional(),description:$().optional(),minimum:at().optional(),maximum:at().optional(),default:at().optional()}),xie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),default:$().optional()}),Rie=be({type:Ge("string"),title:$().optional(),description:$().optional(),oneOf:Re(be({const:$(),title:$()})),default:$().optional()}),Oie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),enumNames:Re($()).optional(),default:$().optional()}),Tie=nn([xie,Rie]),Cie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:at().optional(),maxItems:at().optional(),items:be({type:Ge("string"),enum:Re($())}),default:Re($()).optional()}),Aie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:at().optional(),maxItems:at().optional(),items:be({anyOf:Re(be({const:$(),title:$()}))}),default:Re($()).optional()}),Iie=nn([Cie,Aie]),Mie=nn([Oie,Tie,Iie]),Pie=nn([Mie,wie,Sie,Eie]),Nie=Of.extend({mode:Ge("form").optional(),message:$(),requestedSchema:be({type:Ge("object"),properties:Mt($(),Pie),required:Re($()).optional()})}),kie=Of.extend({mode:Ge("url"),message:$(),elicitationId:$(),url:$().url()}),Die=nn([Nie,kie]),Lie=_r.extend({method:Ge("elicitation/create"),params:Die}),$ie=Vo.extend({elicitationId:$()}),jie=qo.extend({method:Ge("notifications/elicitation/complete"),params:$ie}),zie=br.extend({action:rn(["accept","decline","cancel"]),content:Gw(e=>e===null?void 0:e,Mt($(),nn([$(),at(),Nt(),Re($())])).optional())}),Uie=be({type:Ge("ref/resource"),uri:$()}),Fie=be({type:Ge("ref/prompt"),name:$()}),Bie=wo.extend({ref:nn([Fie,Uie]),argument:be({name:$(),value:$()}),context:be({arguments:Mt($(),$()).optional()}).optional()}),Vie=_r.extend({method:Ge("completion/complete"),params:Bie}),qie=br.extend({completion:vr({values:Re($()).max(100),total:bn(at().int()),hasMore:bn(Nt())})}),Hie=be({uri:$().startsWith("file://"),name:$().optional(),_meta:Mt($(),Gt()).optional()}),Gie=_r.extend({method:Ge("roots/list"),params:wo.optional()}),Kie=br.extend({roots:Re(Hie)}),Zie=qo.extend({method:Ge("notifications/roots/list_changed"),params:Vo.optional()});nn([E6,_oe,Vie,lie,Koe,qoe,Coe,Ioe,Noe,$oe,zoe,iie,nie,T6,A6,I6,P6]);nn([b6,x6,S6,Zie,O6]);nn([_6,_ie,bie,zie,Kie,C6,M6,R6]);nn([E6,yie,Lie,Gie,T6,A6,I6,P6]);nn([b6,x6,uie,Foe,Doe,sie,Joe,O6,jie]);nn([_6,woe,qie,Xoe,Hoe,Aoe,Moe,koe,$6,rie,C6,M6,R6]);class fv extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===uf.UrlElicitationRequired&&r){const o=r;if(o.elicitations)return new Yie(o.elicitations,n)}return new fv(t,n,r)}}class Yie extends fv{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(uf.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cp={exports:{}},pb={},ts={},Ka={},mb={},gb={},vb={},CI;function Rg(){return CI||(CI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(E){if(super(),!e.IDENTIFIER.test(E))throw new Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(E){super(),this._items=typeof E=="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((T,R)=>`${T}${R}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((T,R)=>(R instanceof n&&(T[R.str]=(T[R.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function o(S,...E){const T=[S[0]];let R=0;for(;R<E.length;)c(T,E[R]),T.push(S[++R]);return new r(T)}e._=o;const s=new r("+");function l(S,...E){const T=[v(S[0])];let R=0;for(;R<E.length;)T.push(s),c(T,E[R]),T.push(s,v(S[++R]));return d(T),new r(T)}e.str=l;function c(S,E){E instanceof r?S.push(...E._items):E instanceof n?S.push(E):S.push(h(E))}e.addCodeArg=c;function d(S){let E=1;for(;E<S.length-1;){if(S[E]===s){const T=f(S[E-1],S[E+1]);if(T!==void 0){S.splice(E-1,3,T);continue}S[E++]="+"}E++}}function f(S,E){if(E==='""')return S;if(S==='""')return E;if(typeof S=="string")return E instanceof n||S[S.length-1]!=='"'?void 0:typeof E!="string"?`${S.slice(0,-1)}${E}"`:E[0]==='"'?S.slice(0,-1)+E.slice(1):void 0;if(typeof E=="string"&&E[0]==='"'&&!(S instanceof n))return`"${S}${E.slice(1)}`}function p(S,E){return E.emptyStr()?S:S.emptyStr()?E:l`${S}${E}`}e.strConcat=p;function h(S){return typeof S=="number"||typeof S=="boolean"||S===null?S:v(Array.isArray(S)?S.join(","):S)}function g(S){return new r(v(S))}e.stringify=g;function v(S){return JSON.stringify(S).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function _(S){return typeof S=="string"&&e.IDENTIFIER.test(S)?new r(`.${S}`):o`[${S}]`}e.getProperty=_;function b(S){if(typeof S=="string"&&e.IDENTIFIER.test(S))return new r(`${S}`);throw new Error(`CodeGen: invalid export name: ${S}, use explicit $id name mapping`)}e.getEsmExportName=b;function x(S){return new r(S.toString())}e.regexpCode=x})(vb)),vb}var yb={},AI;function II(){return AI||(AI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Rg();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:f,parent:p}={}){this._names={},this._prefixes=f,this._parent=p}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const p=this._names[f]||this._nameGroup(f);return`${f}${p.index++}`}_nameGroup(f){var p,h;if(!((h=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=o;class s extends t.Name{constructor(f,p){super(p),this.prefix=f}setValue(f,{property:p,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(p)}[${h}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class c extends o{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new s(f,this._newName(f))}value(f,p){var h;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:v}=g,_=(h=p.key)!==null&&h!==void 0?h:p.ref;let b=this._values[v];if(b){const E=b.get(_);if(E)return E}else b=this._values[v]=new Map;b.set(_,g);const x=this._scope[v]||(this._scope[v]=[]),S=x.length;return x[S]=p.ref,g.setValue(p,{property:v,itemIndex:S}),g}getValue(f,p){const h=this._values[f];if(h)return h.get(p)}scopeRefs(f,p=this._values){return this._reduceValues(p,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,p,h){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},p,h)}_reduceValues(f,p,h={},g){let v=t.nil;for(const _ in f){const b=f[_];if(!b)continue;const x=h[_]=h[_]||new Map;b.forEach(S=>{if(x.has(S))return;x.set(S,r.Started);let E=p(S);if(E){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${T} ${S} = ${E};${this.opts._n}`}else if(E=g?.(S))v=(0,t._)`${v}${E}${this.opts._n}`;else throw new n(S);x.set(S,r.Completed)})}return v}}e.ValueScope=c})(yb)),yb}var MI;function mt(){return MI||(MI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Rg(),n=II();var r=Rg();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=II();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(D,U){return this}}class l extends s{constructor(D,U,X){super(),this.varKind=D,this.name=U,this.rhs=X}render({es5:D,_n:U}){const X=D?n.varKinds.var:this.varKind,fe=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${fe};`+U}optimizeNames(D,U){if(D[this.name.str])return this.rhs&&(this.rhs=Z(this.rhs,D,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(D,U,X){super(),this.lhs=D,this.rhs=U,this.sideEffects=X}render({_n:D}){return`${this.lhs} = ${this.rhs};`+D}optimizeNames(D,U){if(!(this.lhs instanceof t.Name&&!D[this.lhs.str]&&!this.sideEffects))return this.rhs=Z(this.rhs,D,U),this}get names(){const D=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(D,this.rhs)}}class d extends c{constructor(D,U,X,fe){super(D,X,fe),this.op=U}render({_n:D}){return`${this.lhs} ${this.op}= ${this.rhs};`+D}}class f extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`${this.label}:`+D}}class p extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`break${this.label?` ${this.label}`:""};`+D}}class h extends s{constructor(D){super(),this.error=D}render({_n:D}){return`throw ${this.error};`+D}get names(){return this.error.names}}class g extends s{constructor(D){super(),this.code=D}render({_n:D}){return`${this.code};`+D}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(D,U){return this.code=Z(this.code,D,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(D=[]){super(),this.nodes=D}render(D){return this.nodes.reduce((U,X)=>U+X.render(D),"")}optimizeNodes(){const{nodes:D}=this;let U=D.length;for(;U--;){const X=D[U].optimizeNodes();Array.isArray(X)?D.splice(U,1,...X):X?D[U]=X:D.splice(U,1)}return D.length>0?this:void 0}optimizeNames(D,U){const{nodes:X}=this;let fe=X.length;for(;fe--;){const pe=X[fe];pe.optimizeNames(D,U)||(ie(D,pe.names),X.splice(fe,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((D,U)=>B(D,U.names),{})}}class _ extends v{render(D){return"{"+D._n+super.render(D)+"}"+D._n}}class b extends v{}class x extends _{}x.kind="else";class S extends _{constructor(D,U){super(U),this.condition=D}render(D){let U=`if(${this.condition})`+super.render(D);return this.else&&(U+="else "+this.else.render(D)),U}optimizeNodes(){super.optimizeNodes();const D=this.condition;if(D===!0)return this.nodes;let U=this.else;if(U){const X=U.optimizeNodes();U=this.else=Array.isArray(X)?new x(X):X}if(U)return D===!1?U instanceof S?U:U.nodes:this.nodes.length?this:new S(H(D),U instanceof S?[U]:U.nodes);if(!(D===!1||!this.nodes.length))return this}optimizeNames(D,U){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(D,U),!!(super.optimizeNames(D,U)||this.else))return this.condition=Z(this.condition,D,U),this}get names(){const D=super.names;return F(D,this.condition),this.else&&B(D,this.else.names),D}}S.kind="if";class E extends _{}E.kind="for";class T extends E{constructor(D){super(),this.iteration=D}render(D){return`for(${this.iteration})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iteration=Z(this.iteration,D,U),this}get names(){return B(super.names,this.iteration.names)}}class R extends E{constructor(D,U,X,fe){super(),this.varKind=D,this.name=U,this.from=X,this.to=fe}render(D){const U=D.es5?n.varKinds.var:this.varKind,{name:X,from:fe,to:pe}=this;return`for(${U} ${X}=${fe}; ${X}<${pe}; ${X}++)`+super.render(D)}get names(){const D=F(super.names,this.from);return F(D,this.to)}}class O extends E{constructor(D,U,X,fe){super(),this.loop=D,this.varKind=U,this.name=X,this.iterable=fe}render(D){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iterable=Z(this.iterable,D,U),this}get names(){return B(super.names,this.iterable.names)}}class A extends _{constructor(D,U,X){super(),this.name=D,this.args=U,this.async=X}render(D){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(D)}}A.kind="func";class I extends v{render(D){return"return "+super.render(D)}}I.kind="return";class P extends _{render(D){let U="try"+super.render(D);return this.catch&&(U+=this.catch.render(D)),this.finally&&(U+=this.finally.render(D)),U}optimizeNodes(){var D,U;return super.optimizeNodes(),(D=this.catch)===null||D===void 0||D.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(D,U){var X,fe;return super.optimizeNames(D,U),(X=this.catch)===null||X===void 0||X.optimizeNames(D,U),(fe=this.finally)===null||fe===void 0||fe.optimizeNames(D,U),this}get names(){const D=super.names;return this.catch&&B(D,this.catch.names),this.finally&&B(D,this.finally.names),D}}class L extends _{constructor(D){super(),this.error=D}render(D){return`catch(${this.error})`+super.render(D)}}L.kind="catch";class q extends _{render(D){return"finally"+super.render(D)}}q.kind="finally";class j{constructor(D,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
155
|
+
`})]})]})}function Mi({redirectTo:e}){const{redirectTo:t}=M.useContext(pt),[n,r]=M.useState(!1),{navigate:o,hooks:{useSession:s},onSessionChange:l}=M.useContext(pt),{refetch:c}=s();return{onSuccess:M.useCallback(async()=>{r(!0),await c?.(),l&&await l(),r(!1);const f=e||ml("redirectTo")||t;o(f)},[c,l,o,e,t]),isPending:n}}function e5({redirectTo:e}){const{hooks:{useIsRestoring:t},persistClient:n}=M.useContext(pt),r=t?.(),o=M.useRef(!1),{onSuccess:s}=Mi({redirectTo:e});return M.useEffect(()=>{if(!o.current){if(!n){o.current=!0,s();return}r||(o.current=!0,s())}},[r,n,s]),C.jsx(Ar,{className:"animate-spin"})}function jS({className:e,containerClassName:t,...n}){return C.jsx(zD,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function fc({className:e,...t}){return C.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function rr({index:e,className:t,...n}){const r=M.useContext(jD),{char:o,hasFakeCaret:s,isActive:l}=r?.slots[e]??{};return C.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[o,s&&C.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:C.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function G_({...e}){return C.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:C.jsx(iK,{})})}function zS({otpSeparators:e=0}){return e===0?C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2}),C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]}):e===1?C.jsxs(C.Fragment,{children:[C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]}):C.jsxs(C.Fragment,{children:[C.jsxs(fc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:2}),C.jsx(rr,{index:3})]}),C.jsx(G_,{}),C.jsxs(fc,{children:[C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]})}function SA(e){const[t,n]=M.useState();return t?C.jsx(jte,{...e,email:t}):C.jsx($te,{...e,setEmail:n})}function $te({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o,setEmail:s}){const l=ms(),{captchaRef:c,getCaptchaHeaders:d}=xf({localization:r}),{authClient:f,localization:p,toast:h,localizeErrors:g}=M.useContext(pt);r={...p,...r};const v=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),_=Ti({resolver:Ci(v),defaultValues:{email:""}});n=n||_.formState.isSubmitting,M.useEffect(()=>{o?.(_.formState.isSubmitting)},[_.formState.isSubmitting,o]);async function b({email:x}){const S={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:x,type:"sign-in",fetchOptions:S}),h({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),s(x)}catch(E){h({variant:"error",message:kn({error:E,localization:r,localizeErrors:g})})}}return C.jsx(Ii,{..._,children:C.jsxs("form",{method:"POST",onSubmit:_.handleSubmit(b),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:_.control,name:"email",render:({field:x})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...x})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:c,localization:r,action:"/email-otp/send-verification-otp"}),C.jsx(rn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function jte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l,email:c}){const{authClient:d,localization:f,toast:p,localizeErrors:h}=M.useContext(pt);r={...f,...r};const{onSuccess:g,isPending:v}=Mi({redirectTo:s}),_=be({code:$().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),b=Ti({resolver:Ci(_),defaultValues:{code:""}});n=n||b.formState.isSubmitting||v,M.useEffect(()=>{l?.(b.formState.isSubmitting||v)},[b.formState.isSubmitting,v,l]);async function x({code:S}){try{await d.signIn.emailOtp({email:c,otp:S,fetchOptions:{throw:!0}}),await g()}catch(E){p({variant:"error",message:kn({error:E,localization:r,localizeErrors:h})}),b.reset()}}return C.jsx(Ii,{...b,children:C.jsxs("form",{method:"POST",onSubmit:b.handleSubmit(x),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:b.control,name:"code",render:({field:S})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(jS,{...S,maxLength:6,onChange:E=>{S.onChange(E),E.length===6&&b.handleSubmit(x)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx("div",{className:"grid gap-4",children:C.jsxs(rn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function zte({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:o,callbackURL:s,isSubmitting:l,redirectTo:c,setIsSubmitting:d}){const[f,p]=M.useState(!0),[h,g]=M.useState(30),{authClient:v,localization:_,toast:b,localizeErrors:x,navigate:S,basePath:E,viewPaths:T}=M.useContext(pt);t={..._,...t};const R=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:O,isPending:A}=Mi({redirectTo:c}),I=be({code:$().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),P=Ti({resolver:Ci(I),defaultValues:{code:""}}),L=l||P.formState.isSubmitting||A;M.useEffect(()=>{d?.(P.formState.isSubmitting||A)},[P.formState.isSubmitting,A,d]),M.useEffect(()=>{if(h>0){const B=setTimeout(()=>g(h-1),1e3);return()=>clearTimeout(B)}else p(!1)},[h]);async function q({code:B}){try{const F=await v.emailOtp.verifyEmail({email:R,otp:B,fetchOptions:{throw:!0}});"token"in F&&F.token?await O():(S(`${E}/${T.SIGN_IN}${window.location.search}`),b({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(F){b({variant:"error",message:kn({error:F,localization:t,localizeErrors:x})}),P.reset()}}async function j(){if(!f){p(!0),g(30);try{await v.emailOtp.sendVerificationOtp({email:R,type:"email-verification",fetchOptions:{throw:!0}}),b({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(B){b({variant:"error",message:kn({error:B,localization:t,localizeErrors:x})}),p(!1),g(0)}}}return R?C.jsx(Ii,{...P,children:C.jsxs("form",{method:"POST",onSubmit:P.handleSubmit(q),className:Ce("grid w-full gap-6",n,r?.base),children:[C.jsx(In,{control:P.control,name:"code",render:({field:B})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:r?.label,children:t.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(jS,{...B,maxLength:6,onChange:F=>{B.onChange(F),F.length===6&&P.handleSubmit(q)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:L,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:r?.error})]})}),C.jsxs("div",{className:"grid gap-4",children:[C.jsxs(rn,{type:"submit",disabled:L,className:Ce(r?.button,r?.primaryButton),children:[L&&C.jsx(Ar,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),C.jsx(rn,{type:"button",variant:"outline",onClick:j,disabled:f||L,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${h}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&C.jsx(rn,{type:"button",variant:"ghost",onClick:e,disabled:L,className:"w-full",children:t.CANCEL})]})]})}):C.jsx("div",{className:Ce("grid w-full gap-6",n),children:C.jsxs("div",{className:"text-center",children:[C.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),C.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function Ute({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o}){const s=ms(),{captchaRef:l,getCaptchaHeaders:c,resetCaptcha:d}=xf({localization:r}),{authClient:f,basePath:p,baseURL:h,localization:g,navigate:v,toast:_,viewPaths:b,localizeErrors:x}=M.useContext(pt);r={...g,...r};const S=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),E=Ti({resolver:Ci(S),defaultValues:{email:""}});n=n||E.formState.isSubmitting,M.useEffect(()=>{o?.(E.formState.isSubmitting)},[E.formState.isSubmitting,o]);async function T({email:R}){try{const O={throw:!0,headers:await c("/forget-password")};await f.requestPasswordReset({email:R,redirectTo:`${h}${p}/${b.RESET_PASSWORD}`,fetchOptions:O}),_({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),v(`${p}/${b.SIGN_IN}${window.location.search}`)}catch(O){_({variant:"error",message:kn({error:O,localization:r,localizeErrors:x})}),d()}}return C.jsx(Ii,{...E,children:C.jsxs("form",{method:"POST",onSubmit:E.handleSubmit(T),noValidate:s,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:E.control,name:"email",render:({field:R})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...R})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:l,localization:r,action:"/forget-password"}),C.jsx(rn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function EA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l}){const c=ms(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:p}=xf({localization:o}),{authClient:h,basePath:g,baseURL:v,persistClient:_,localization:b,redirectTo:x,viewPaths:S,toast:E,localizeErrors:T}=M.useContext(pt);o={...b,...o};const R=M.useCallback(()=>s||ml("redirectTo")||x,[s,x]),O=M.useCallback(()=>`${v}${n||(_?`${g}/${S.CALLBACK}?redirectTo=${encodeURIComponent(R())}`:R())}`,[n,_,g,S,v,R]),A=be({email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),I=Ti({resolver:Ci(A),defaultValues:{email:""}});r=r||I.formState.isSubmitting,M.useEffect(()=>{l?.(I.formState.isSubmitting)},[I.formState.isSubmitting,l]);async function P({email:L}){try{const q={throw:!0,headers:await f("/sign-in/magic-link")};await h.signIn.magicLink({email:L,callbackURL:O(),fetchOptions:q}),E({variant:"success",message:o.MAGIC_LINK_EMAIL}),I.reset()}catch(q){E({variant:"error",message:kn({error:q,localization:o,localizeErrors:T})}),p()}}return C.jsx(Ii,{...I,children:C.jsxs("form",{method:"POST",onSubmit:I.handleSubmit(P),noValidate:c,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:I.control,name:"email",render:({field:L})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...L})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(Rf,{ref:d,localization:o,action:"/sign-in/magic-link"}),C.jsx(rn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.MAGIC_LINK_ACTION})]})})}function Fte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s}){const{authClient:l,localization:c,toast:d,localizeErrors:f}=M.useContext(pt);r={...c,...r};const{onSuccess:p,isPending:h}=Mi({redirectTo:o}),g=be({code:$().min(1,{message:r.BACKUP_CODE_REQUIRED})}),v=Ti({resolver:Ci(g),defaultValues:{code:""}});n=n||v.formState.isSubmitting||h,M.useEffect(()=>{s?.(v.formState.isSubmitting||h)},[v.formState.isSubmitting,h,s]);async function _({code:b}){try{await l.twoFactor.verifyBackupCode({code:b,fetchOptions:{throw:!0}}),await p()}catch(x){d({variant:"error",message:kn({error:x,localization:r,localizeErrors:f})}),v.reset()}}return C.jsx(Ii,{...v,children:C.jsxs("form",{method:"POST",onSubmit:v.handleSubmit(_),className:Ce("grid gap-6",e,t?.base),children:[C.jsx(In,{control:v.control,name:"code",render:({field:b})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:r.BACKUP_CODE}),C.jsx(qn,{children:C.jsx(ni,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...b})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(rn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function Bte({className:e,classNames:t,localization:n,passwordValidation:r}){const o=M.useRef(!1),{authClient:s,basePath:l,credentials:c,localization:d,viewPaths:f,navigate:p,toast:h,localizeErrors:g}=M.useContext(pt),v=c?.confirmPassword,_=c?.passwordValidation;n={...d,...n},r={..._,...r};const b=be({newPassword:Wd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:v?Wd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):$().optional()}).refine(T=>!v||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),x=Ti({resolver:Ci(b),defaultValues:{newPassword:"",confirmPassword:""}}),S=x.formState.isSubmitting;M.useEffect(()=>{if(o.current)return;o.current=!0;const R=new URLSearchParams(window.location.search).get("token");(!R||R==="INVALID_TOKEN")&&(p(`${l}/${f.SIGN_IN}${window.location.search}`),h({variant:"error",message:n.INVALID_TOKEN}))},[l,p,h,f,n]);async function E({newPassword:T}){try{const O=new URLSearchParams(window.location.search).get("token");await s.resetPassword({newPassword:T,token:O,fetchOptions:{throw:!0}}),h({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),p(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(R){h({variant:"error",message:kn({error:R,localization:n,localizeErrors:g})}),x.reset()}}return C.jsx(Ii,{...x,children:C.jsxs("form",{method:"POST",onSubmit:x.handleSubmit(E),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:x.control,name:"newPassword",render:({field:T})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:n.NEW_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Yn,{className:t?.error})]})}),v&&C.jsx(In,{control:x.control,name:"confirmPassword",render:({field:T})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:n.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(rn,{type:"submit",disabled:S,className:Ce("w-full",t?.button,t?.primaryButton),children:S?C.jsx(Ar,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function Vte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s,passwordValidation:l,callbackURL:c}){const d=ms(),{captchaRef:f,getCaptchaHeaders:p,resetCaptcha:h}=xf({localization:r}),{authClient:g,basePath:v,credentials:_,localization:b,viewPaths:x,navigate:S,toast:E,Link:T,localizeErrors:R,emailVerification:O}=M.useContext(pt),A=_?.rememberMe,I=_?.username,P=_?.passwordValidation;r={...b,...r},l={...P,...l};const{onSuccess:L,isPending:q}=Mi({redirectTo:o}),j=be({email:I?$().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:Wd(l,r),rememberMe:Nt().optional()}),B=Ti({resolver:Ci(j),defaultValues:{email:"",password:"",rememberMe:!A}});n=n||B.formState.isSubmitting||q,M.useEffect(()=>{s?.(B.formState.isSubmitting||q)},[B.formState.isSubmitting,q,s]);async function F({email:Z,password:ie,rememberMe:H}){var W;try{let te={};if(I&&!PH(Z)){const le={throw:!0,headers:await p("/sign-in/username")};te=await g.signIn.username({username:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}else{const le={throw:!0,headers:await p("/sign-in/email")};te=await g.signIn.email({email:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}te.twoFactorRedirect?S(`${v}/${x.TWO_FACTOR}${window.location.search}`):await L()}catch(te){B.resetField("password"),h(),E({variant:"error",message:kn({error:te,localization:r,localizeErrors:R})}),O?.otp&&((W=te?.error)==null?void 0:W.code)==="EMAIL_NOT_VERIFIED"&&S(`${v}/${x.EMAIL_VERIFICATION}?email=${encodeURIComponent(Z)}`)}}return C.jsx(Ii,{...B,children:C.jsxs("form",{method:"POST",onSubmit:B.handleSubmit(F),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:B.control,name:"email",render:({field:Z})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:B.control,name:"password",render:({field:Z})=>C.jsxs(Mn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Pn,{className:t?.label,children:r.PASSWORD}),_?.forgotPassword&&C.jsx(T,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${v}/${x.FORGOT_PASSWORD}${d?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Yn,{className:t?.error})]})}),A&&C.jsx(In,{control:B.control,name:"rememberMe",render:({field:Z})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:Z.value,onCheckedChange:Z.onChange,disabled:n})}),C.jsx(Pn,{children:r.REMEMBER_ME})]})}),C.jsx(Rf,{ref:f,localization:r,action:"/sign-in/email"}),C.jsx(rn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function qte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l,passwordValidation:c}){var d,f,p,h,g,v;const _=ms(),{captchaRef:b,getCaptchaHeaders:x,resetCaptcha:S}=xf({localization:o}),{additionalFields:E,authClient:T,basePath:R,baseURL:O,credentials:A,localization:I,nameRequired:P,persistClient:L,redirectTo:q,signUp:j,viewPaths:B,navigate:F,toast:Z,avatar:ie,localizeErrors:H,emailVerification:W}=M.useContext(pt),te=A?.confirmPassword,le=A?.username,Q=A?.usernameRequired??!0,k=A?.passwordValidation,G=j?.fields;o={...I,...o},c={...k,...c};const V=M.useRef(null),[D,U]=M.useState(null),[X,fe]=M.useState(!1),pe=M.useCallback(()=>s||ml("redirectTo")||q,[s,q]),xe=M.useCallback(()=>`${O}${n||(L?`${R}/${B.CALLBACK}?redirectTo=${encodeURIComponent(pe())}`:pe())}`,[n,L,R,B,O,pe]),{onSuccess:je,isPending:Y}=Mi({redirectTo:s}),re={email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:Wd(c,o),name:G?.includes("name")&&P?$().min(1,{message:`${o.NAME} ${o.IS_REQUIRED}`}):$().optional(),image:$().optional(),username:le&&Q?$().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):$().optional(),confirmPassword:te?Wd(c,{PASSWORD_REQUIRED:o.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:o.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:o.PASSWORD_TOO_LONG,INVALID_PASSWORD:o.INVALID_PASSWORD}):$().optional()},ve={};if(G)for(const Pe of G){if(Pe==="name"||Pe==="image")continue;const Me=E?.[Pe];if(!Me)continue;let Ue;Me.type==="number"?Ue=Me.required?Gw(K=>K?Number(K):void 0,at({message:((d=Me.errorMessage)==null?void 0:d.invalid)??`${Me.label} ${o.IS_INVALID}`})):tN({message:((f=Me.errorMessage)==null?void 0:f.invalid)??`${Me.label} ${o.IS_INVALID}`}).optional():Me.type==="boolean"?Ue=Me.required?kT({message:((p=Me.errorMessage)==null?void 0:p.invalid)??`${Me.label} ${o.IS_INVALID}`}).refine(K=>K===!0,{message:((h=Me.errorMessage)==null?void 0:h.required)??`${Me.label} ${o.IS_REQUIRED}`}):kT({message:((g=Me.errorMessage)==null?void 0:g.invalid)??`${Me.label} ${o.IS_INVALID}`}).optional():Ue=Me.required?$().min(1,((v=Me.errorMessage)==null?void 0:v.required)??`${Me.label} ${o.IS_REQUIRED}`):$().optional(),ve[Pe]=Ue}const se=be(re).extend(ve).refine(Pe=>te?Pe.password===Pe.confirmPassword:!0,{message:o.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Se={email:"",password:"",...te&&{confirmPassword:""},...G?.includes("name")?{name:""}:{},...le?{username:""}:{},...G?.includes("image")&&ie?{image:""}:{}};if(G)for(const Pe of G){if(Pe==="name"||Pe==="image")continue;const Me=E?.[Pe];Me&&(Se[Pe]=Me.type==="boolean"?!1:"")}const Te=Ti({resolver:Ci(se),defaultValues:Se});r=r||Te.formState.isSubmitting||Y,M.useEffect(()=>{l?.(Te.formState.isSubmitting||Y)},[Te.formState.isSubmitting,Y,l]);const tt=async Pe=>{if(ie){fe(!0);try{const Me=await Qee(Pe,crypto.randomUUID(),ie.size,ie.extension);let Ue;ie.upload?Ue=await ie.upload(Me):Ue=await Jee(Me),Ue?(U(Ue),Te.setValue("image",Ue)):(U(null),Te.setValue("image",""))}catch(Me){console.error(Me),Z({variant:"error",message:kn({error:Me,localization:o,localizeErrors:H})})}fe(!1)}},rt=()=>{U(null),Te.setValue("image","")},Be=()=>{var Pe;return(Pe=V.current)==null?void 0:Pe.click()};async function Qe({email:Pe,password:Me,name:Ue,username:K,confirmPassword:ne,image:ae,...Oe}){var Ae,Ie;try{for(const[vt,Tt]of Object.entries(Oe)){const yt=E?.[vt];if(yt?.validate&&typeof Tt=="string"&&!await yt.validate(Tt)){Te.setError(vt,{message:((Ae=yt.errorMessage)==null?void 0:Ae.validate)??((Ie=yt.errorMessage)==null?void 0:Ie.invalid)??`${yt.label} ${o.IS_INVALID}`});return}}const ke={throw:!0,headers:await x("/sign-up/email")},Je={};K!==void 0&&(!Q&&(K===null||K===""||typeof K=="string"&&K.trim()==="")||(Je.username=K)),ae!==void 0&&(Je.image=ae);const et=await T.signUp.email({email:Pe,password:Me,name:Ue||"",...Je,...Oe,callbackURL:xe(),fetchOptions:ke});"token"in et&&et.token?await je():W?.otp?F(`${R}/${B.EMAIL_VERIFICATION}?email=${encodeURIComponent(Pe)}`):(F(`${R}/${B.SIGN_IN}${window.location.search}`),Z({variant:"success",message:o.SIGN_UP_EMAIL}))}catch(ke){Z({variant:"error",message:kn({error:ke,localization:o,localizeErrors:H})}),Te.resetField("password"),Te.resetField("confirmPassword"),S()}}return C.jsx(Ii,{...Te,children:C.jsxs("form",{method:"POST",onSubmit:Te.handleSubmit(Qe),noValidate:_,className:Ce("grid w-full gap-6",e,t?.base),children:[G?.includes("image")&&ie&&C.jsxs(C.Fragment,{children:[C.jsx("input",{ref:V,accept:"image/*",disabled:X,hidden:!0,type:"file",onChange:Pe=>{var Me;const Ue=(Me=Pe.target.files)==null?void 0:Me.item(0);Ue&&tt(Ue),Pe.target.value=""}}),C.jsx(In,{control:Te.control,name:"image",render:()=>C.jsxs(Mn,{children:[C.jsx(Pn,{children:o.AVATAR}),C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsxs(ete,{children:[C.jsx(tte,{asChild:!0,children:C.jsx(rn,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:C.jsx(ite,{isPending:X,className:"size-16",user:D?{name:Te.watch("name"),email:Te.watch("email"),image:D}:null,localization:o})})}),C.jsxs(nte,{align:"start",onCloseAutoFocus:Pe=>Pe.preventDefault(),children:[C.jsxs(wA,{onClick:Be,disabled:X,children:[C.jsx(tK,{}),o.UPLOAD_AVATAR]}),D&&C.jsxs(wA,{onClick:rt,disabled:X,variant:"destructive",children:[C.jsx(aK,{}),o.DELETE_AVATAR]})]})]}),C.jsxs(rn,{type:"button",variant:"outline",onClick:Be,disabled:X,children:[X&&C.jsx(Ar,{className:"animate-spin"}),o.UPLOAD]})]}),C.jsx(Yn,{})]})})]}),G?.includes("name")&&C.jsx(In,{control:Te.control,name:"name",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsxs(Pn,{className:t?.label,children:[o.NAME,!P&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"name",className:t?.input,placeholder:o.NAME_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),le&&C.jsx(In,{control:Te.control,name:"username",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsxs(Pn,{className:t?.label,children:[o.USERNAME,!Q&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"username",className:t?.input,placeholder:o.USERNAME_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"email",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"email",className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"password",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),te&&C.jsx(In,{control:Te.control,name:"confirmPassword",render:({field:Pe})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:o.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Pe,value:Pe.value})}),C.jsx(Yn,{className:t?.error})]})}),G?.filter(Pe=>Pe!=="name"&&Pe!=="image").map(Pe=>{const Me=E?.[Pe];return Me?Me.type==="boolean"?C.jsx(In,{control:Te.control,name:Pe,render:({field:Ue})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:Ue.value,onCheckedChange:Ue.onChange,disabled:r})}),C.jsx(Pn,{className:t?.label,children:Me.label}),C.jsx(Yn,{className:t?.error})]})},Pe):C.jsx(In,{control:Te.control,name:Pe,render:({field:Ue})=>C.jsxs(Mn,{children:[C.jsx(Pn,{className:t?.label,children:Me.label}),C.jsx(qn,{children:Me.type==="number"?C.jsx(ni,{className:t?.input,type:"number",placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value}):Me.multiline?C.jsx(ate,{className:t?.input,placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value}):C.jsx(ni,{className:t?.input,type:"text",placeholder:Me.placeholder||(typeof Me.label=="string"?Me.label:""),disabled:r,...Ue,value:Ue.value})}),C.jsx(Yn,{className:t?.error})]})},Pe):(console.error(`Additional field ${Pe} not found`),null)}),C.jsx(Rf,{ref:b,localization:o,action:"/sign-up/email"}),C.jsx(rn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.SIGN_UP_ACTION})]})})}function Hte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l}){var c;const d=ms(),f=d?ml("totpURI"):null,p=M.useRef(!1),{authClient:h,basePath:g,hooks:{useSession:v},localization:_,twoFactor:b,viewPaths:x,toast:S,Link:E,localizeErrors:T}=M.useContext(pt);r={..._,...r};const{onSuccess:R,isPending:O}=Mi({redirectTo:s}),{data:A}=v(),I=(c=A?.user)==null?void 0:c.twoFactorEnabled,[P,L]=M.useState(b?.length===1?b[0]:null),[q,j]=M.useState(!1),[B,F]=M.useState(0),Z=be({code:$().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:Nt().optional()}),ie=Ti({resolver:Ci(Z),defaultValues:{code:""}});n=n||ie.formState.isSubmitting||O,M.useEffect(()=>{l?.(ie.formState.isSubmitting||O)},[ie.formState.isSubmitting,O,l]),M.useEffect(()=>{P==="otp"&&B<=0&&!p.current&&(p.current=!0,H())},[P]),M.useEffect(()=>{if(B<=0)return;const te=setTimeout(()=>{F(le=>le-1)},1e3);return()=>clearTimeout(te)},[B]);const H=async()=>{if(!(q||B>0)){try{j(!0),await h.twoFactor.sendOtp({fetchOptions:{throw:!0}}),F(60)}catch(te){S({variant:"error",message:kn({error:te,localization:r,localizeErrors:T})}),te.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}p.current=!1,j(!1)}};async function W({code:te,trustDevice:le}){try{await(P==="totp"?h.twoFactor.verifyTotp:h.twoFactor.verifyOtp)({code:te,trustDevice:le,fetchOptions:{throw:!0}}),await R(),A&&!I&&S({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(Q){S({variant:"error",message:kn({error:Q,localization:r,localizeErrors:T})}),ie.reset()}}return C.jsx(Ii,{...ie,children:C.jsxs("form",{method:"POST",onSubmit:ie.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[b?.includes("totp")&&f&&P==="totp"&&C.jsxs("div",{className:"space-y-3",children:[C.jsx(KD,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),C.jsx(qee,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),P!==null&&C.jsxs(C.Fragment,{children:[C.jsx(In,{control:ie.control,name:"code",render:({field:te})=>C.jsxs(Mn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Pn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),C.jsx(E,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${x.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),C.jsx(qn,{children:C.jsx(jS,{...te,maxLength:6,onChange:le=>{te.onChange(le),le.length===6&&ie.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(zS,{otpSeparators:o})})}),C.jsx(Yn,{className:t?.error})]})}),C.jsx(In,{control:ie.control,name:"trustDevice",render:({field:te})=>C.jsxs(Mn,{className:"flex",children:[C.jsx(qn,{children:C.jsx($S,{checked:te.value,onCheckedChange:te.onChange,disabled:n,className:t?.checkbox})}),C.jsx(Pn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),C.jsxs("div",{className:"grid gap-4",children:[P!==null&&C.jsxs(rn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),P==="otp"&&b?.includes("otp")&&C.jsxs(rn,{type:"button",variant:"outline",onClick:H,disabled:B>0||q||n,className:Ce(t?.button,t?.outlineButton),children:[q?C.jsx(Ar,{className:"animate-spin"}):C.jsx(tC,{className:t?.icon}),r.RESEND_CODE,B>0&&` (${B})`]}),P!=="otp"&&b?.includes("otp")&&C.jsxs(rn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("otp"),disabled:n,children:[C.jsx(tC,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),P!=="totp"&&b?.includes("totp")&&C.jsxs(rn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("totp"),disabled:n,children:[C.jsx(sK,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function t5({redirectTo:e}){const t=M.useRef(!1),{authClient:n,basePath:r,viewPaths:o}=M.useContext(pt),{onSuccess:s}=Mi({redirectTo:e||`${r}/${o.SIGN_IN}`});return M.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(s))},[n,s]),C.jsx(Ar,{className:"animate-spin"})}function Gte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,pathname:s,redirectTo:l,view:c,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:p,credentials:h,localization:g,magicLink:v,emailOTP:_,signUp:b,twoFactor:x,viewPaths:S,replace:E}=M.useContext(pt),T=!!b;if(o={...g,...o},M.useEffect(()=>{s&&!Kb(S,s)&&(console.error(`Invalid auth view: ${s}`),E(`${p}/${S.SIGN_IN}${window.location.search}`))},[s,S,p,E]),c=c||Kb(S,s)||"SIGN_IN",M.useEffect(()=>{let R=!1;c==="MAGIC_LINK"&&(!v||!h&&!_)&&(R=!0),c==="EMAIL_OTP"&&(!_||!h&&!v)&&(R=!0),c==="SIGN_UP"&&!T&&(R=!0),!h&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&(R=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&!x&&(R=!0),R&&E(`${p}/${S.SIGN_IN}${window.location.search}`)},[p,c,S,h,E,_,T,v,x]),c==="SIGN_OUT")return C.jsx(t5,{redirectTo:l});if(c==="CALLBACK")return C.jsx(e5,{redirectTo:l});if(c==="SIGN_IN")return h?C.jsx(Vte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f,callbackURL:n}):v?C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):_?C.jsx(SA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(c==="TWO_FACTOR")return C.jsx(Hte,{className:e,classNames:t,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="RECOVER_ACCOUNT")return C.jsx(Fte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="MAGIC_LINK")return C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_OTP")return C.jsx(SA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_VERIFICATION")return C.jsx(zte,{className:e,classNames:t,callbackURL:n,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="FORGOT_PASSWORD")return C.jsx(Ute,{className:e,classNames:t,localization:o,isSubmitting:r,setIsSubmitting:f});if(c==="RESET_PASSWORD")return C.jsx(Bte,{className:e,classNames:t,localization:o});if(c==="SIGN_UP")return T&&C.jsx(qte,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function Kte({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:o,replace:s,toast:l}=M.useContext(pt),c=M.useMemo(()=>({...r,...n}),[r,n]),{data:d}=Yee(),[f,p]=M.useState(null);return M.useEffect(()=>{const h=ml("invitationId");if(!h){l({variant:"error",message:c.INVITATION_NOT_FOUND}),s(o);return}p(h)},[c.INVITATION_NOT_FOUND,l,s,o]),!d||!f?C.jsx(n5,{className:e,classNames:t}):C.jsx(Zte,{className:e,classNames:t,localization:c,invitationId:f})}function Zte({className:e,classNames:t,localization:n,invitationId:r}){var o;const{authClient:s,hooks:{useInvitation:l},localization:c,organization:d,redirectTo:f,replace:p,toast:h,localizeErrors:g}=M.useContext(pt),v=M.useMemo(()=>({...c,...n}),[c,n]),[_,b]=M.useState(!1),[x,S]=M.useState(!1),E=_||x,{data:T,isPending:R}=l({query:{id:r}}),O=M.useCallback(()=>ml("redirectTo")||f,[f]);M.useEffect(()=>{if(!(R||!r)){if(!T){h({variant:"error",message:v.INVITATION_NOT_FOUND}),p(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(h({variant:"error",message:new Date(T.expiresAt)<new Date?v.INVITATION_EXPIRED:v.INVITATION_NOT_FOUND}),p(f))}},[T,R,r,v,h,p,f]);const A=async()=>{S(!0);try{await s.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_ACCEPTED||"Invitation accepted"}),p(O())}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),S(!1)}},I=async()=>{b(!0);try{await s.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_REJECTED}),p(f)}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),b(!1)}},q=((o=[...[{role:"owner",label:v.OWNER},{role:"admin",label:v.ADMIN},{role:"member",label:v.MEMBER}],...d?.customRoles||[]].find(j=>j.role===T?.role))==null?void 0:o.label)||T?.role;return T?C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(kS,{className:Ce("justify-items-center text-center",t?.header),children:[C.jsx(HD,{className:Ce("text-lg md:text-xl",t?.title),children:v.ACCEPT_INVITATION}),C.jsx(GD,{className:Ce("text-xs md:text-sm",t?.description),children:v.ACCEPT_INVITATION_DESCRIPTION})]}),C.jsxs(DS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(JD,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:v}),C.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:q})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsxs(rn,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:I,disabled:E,children:[_?C.jsx(Ar,{className:"animate-spin"}):C.jsx(cK,{}),v.REJECT]}),C.jsxs(rn,{className:Ce(t?.button,t?.primaryButton),onClick:A,disabled:E,children:[x?C.jsx(Ar,{className:"animate-spin"}):C.jsx(DN,{}),v.ACCEPT]})]})]})]}):C.jsx(n5,{className:e,classNames:t})}var n5=({className:e,classNames:t,localization:n})=>C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(kS,{className:Ce("justify-items-center",t?.header),children:[C.jsx(ss,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),C.jsx(ss,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),C.jsxs(DS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(JD,{isPending:!0,localization:n}),C.jsx(ss,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsx(ss,{className:"h-9 w-full"}),C.jsx(ss,{className:"h-9 w-full"})]})]})]});function xA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return C.jsx(Zee,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Yte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p}=M.useContext(pt);return C.jsxs(rn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?C.jsx(LN,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx($N,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function Wte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p,credentials:h}=M.useContext(pt);return C.jsxs(rn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="MAGIC_LINK"||!h?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?C.jsx(LN,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx($N,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function Qte({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:o,localizeErrors:s}=M.useContext(pt),l=M.useRef(!1);e=M.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:c}=Mi({redirectTo:t});return M.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:c}})}catch(d){o({variant:"error",message:kn({error:d,localization:e,localizeErrors:s})})}}},[n,e,s,c,o]),null}function Xte({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:o}){var s,l;const{authClient:c,localization:d,toast:f,localizeErrors:p}=M.useContext(pt);n={...d,...n};const{onSuccess:h}=Mi({redirectTo:r}),g=async()=>{o?.(!0);try{const v=await c.signIn.passkey({fetchOptions:{throw:!0}});v?.error?(f({variant:"error",message:kn({error:v.error,localization:n,localizeErrors:p})}),o?.(!1)):h()}catch(v){f({variant:"error",message:kn({error:v,localization:n,localizeErrors:p})}),o?.(!1)}};return C.jsxs(rn,{className:Ce("w-full",(s=e?.form)==null?void 0:s.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[C.jsx(oK,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function RA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,other:s,provider:l,redirectTo:c,socialLayout:d,setIsSubmitting:f}){var p,h,g,v;const{authClient:_,basePath:b,baseURL:x,persistClient:S,redirectTo:E,viewPaths:T,social:R,genericOAuth:O,toast:A,localizeErrors:I}=M.useContext(pt),P=M.useCallback(()=>c||ml("redirectTo")||E,[c,E]),L=M.useCallback(()=>`${x}${n||(S?`${b}/${T.CALLBACK}?redirectTo=${encodeURIComponent(P())}`:P())}`,[n,S,b,T,x,P]),q=async()=>{f(!0);try{if(s){const j={providerId:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.oauth2(j)}else{const j={provider:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};R?.signIn?(await R.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.social(j)}}catch(j){A({variant:"error",message:kn({error:j,localization:o,localizeErrors:I})}),f(!1)}};return C.jsxs(rn,{className:Ce(d==="vertical"?"w-full":"grow",e,(p=t?.form)==null?void 0:p.button,(h=t?.form)==null?void 0:h.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:q,children:[l.icon&&C.jsx(l.icon,{className:(v=t?.form)==null?void 0:v.icon}),d==="grid"&&l.name,d==="vertical"&&`${o.SIGN_IN_WITH} ${l.name}`]})}function Qce({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:o,localization:s,path:l,pathname:c,redirectTo:d,socialLayout:f="auto",view:p,otpSeparators:h=0}){var g,v,_,b,x,S;const E=ms(),{basePath:T,credentials:R,localization:O,magicLink:A,emailOTP:I,oneTap:P,passkey:L,signUp:q,social:j,genericOAuth:B,viewPaths:F,Link:Z}=M.useContext(pt);s={...O,...s};let ie=f;ie==="auto"&&(ie=R&&j?.providers&&j.providers.length>2?"horizontal":"vertical");const H=l??c?.split("/").pop(),W=p||Kb(F,H)||"SIGN_IN",[te,le]=M.useState(!1);if(M.useEffect(()=>{const k=()=>le(!1);return window.addEventListener("pagehide",k),()=>{le(!1),window.removeEventListener("pagehide",k)}},[]),W==="CALLBACK")return C.jsx(e5,{redirectTo:d});if(W==="SIGN_OUT")return C.jsx(t5,{redirectTo:d});if(W==="ACCEPT_INVITATION")return C.jsx(Kte,{className:e,classNames:t});const Q=!R&&!A&&!I?s.DISABLED_CREDENTIALS_DESCRIPTION:s[`${W}_DESCRIPTION`];return C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsx(kS,{className:t?.header,children:r||C.jsxs(C.Fragment,{children:[C.jsx(HD,{className:Ce("text-lg md:text-xl",t?.title),children:s[W]}),Q&&C.jsx(GD,{className:Ce("text-xs md:text-sm",t?.description),children:Q})]})}),C.jsxs(DS,{className:Ce("grid gap-6",t?.content),children:[P&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&C.jsx(Qte,{localization:s,redirectTo:d}),(R||A||I)&&C.jsxs("div",{className:"grid gap-4",children:[C.jsx(Gte,{classNames:t?.form,callbackURL:n,isSubmitting:te,localization:s,otpSeparators:h,view:W,redirectTo:d,setIsSubmitting:le}),A&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&W==="EMAIL_OTP")&&C.jsx(Wte,{classNames:t,localization:s,view:W,isSubmitting:te}),I&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||A&&["SIGN_IN","MAGIC_LINK"].includes(W))&&C.jsx(Yte,{classNames:t,localization:s,view:W,isSubmitting:te})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=j?.providers)==null?void 0:g.length)||((v=B?.providers)==null?void 0:v.length)||W==="SIGN_IN"&&L)&&C.jsxs(C.Fragment,{children:[(R||A||I)&&C.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[C.jsx(xA,{className:Ce("!w-auto grow",t?.separator)}),C.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:s.OR_CONTINUE_WITH}),C.jsx(xA,{className:Ce("!w-auto grow",t?.separator)})]}),C.jsxs("div",{className:"grid gap-4",children:[(((_=j?.providers)==null?void 0:_.length)||((b=B?.providers)==null?void 0:b.length))&&C.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",ie==="horizontal"&&"flex-wrap",ie==="vertical"&&"flex-col",ie==="grid"&&"grid grid-cols-2"),children:[(x=j?.providers)==null?void 0:x.map(k=>{const G=Mte.find(V=>V.provider===k);return G?C.jsx(RA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:G,redirectTo:d,setIsSubmitting:le,socialLayout:ie},k):null}),(S=B?.providers)==null?void 0:S.map(k=>C.jsx(RA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:k,redirectTo:d,setIsSubmitting:le,socialLayout:ie,other:!0},k.provider))]}),L&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&C.jsx(Xte,{classNames:t,isSubmitting:te,localization:s,redirectTo:d,setIsSubmitting:le})]})]})]}),o&&C.jsx(bA,{className:t?.footer,children:o}),R&&q&&C.jsxs(bA,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?s.ALREADY_HAVE_AN_ACCOUNT:C.jsx(JG,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?C.jsx(Z,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${F[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${E?window.location.search:""}`,children:C.jsx(rn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.SIGN_UP:s.SIGN_IN})}):C.jsx(rn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:s.GO_BACK})]})]})}function Xce({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{isPending:n}=t();return n?e:null}function Jce({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{data:n}=t();return n?e:null}function eue({children:e}){const{hooks:{useSession:t}}=M.useContext(pt),{data:n,isPending:r}=t();return!n&&!r?e:null}function Jte(e){const t=er.c(8),{children:n}=e,r=Ng();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={basePath:"/",pathMode:"slug"},t[0]=o):o=t[0];let s,l;t[1]!==r?(s=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let c;return t[4]!==n||t[5]!==s||t[6]!==l?(c=C.jsx(YG,{authClient:Vg,redirectTo:"/",organization:o,navigate:s,replace:l,Link:ene,children:n}),t[4]=n,t[5]=s,t[6]=l,t[7]=c):c=t[7],c}function ene(e){const{href:t,className:n,children:r,...o}=e;return C.jsx(Dg,{to:t,className:n,...o,children:r})}var me=typeof window<"u"?window:void 0,Qn=typeof globalThis<"u"?globalThis:me;typeof self>"u"&&(Qn.self=Qn),typeof File>"u"&&(Qn.File=function(){});var go=Qn?.navigator,Le=Qn?.document,pr=Qn?.location,y1=Qn?.fetch,_1=Qn!=null&&Qn.XMLHttpRequest&&"withCredentials"in new Qn.XMLHttpRequest?Qn.XMLHttpRequest:void 0,OA=Qn?.AbortController,tne=Qn?.CompressionStream,Yr=go?.userAgent,We=me??{},TA="1.372.3",$r={DEBUG:!1,LIB_VERSION:TA,LIB_NAME:"web",JS_SDK_VERSION:TA};function CA(e,t,n,r,o,s,l){try{var c=e[s](l),d=c.value}catch(f){return void n(f)}c.done?t(d):Promise.resolve(d).then(r,o)}function Lo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function l(d){CA(s,r,o,l,c,"next",d)}function c(d){CA(s,r,o,l,c,"throw",d)}l(void 0)}))}}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(null,arguments)}function r5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function b1(){return b1=Lo((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream("gzip"),o=r.writable.getWriter(),s=o.write(new TextEncoder().encode(e)).then((()=>o.close())).catch((function(){var d=Lo((function*(f){try{yield o.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,s]);return c}catch(d){if(n!=null&&n.rethrow)throw d;return t&&console.error("Failed to gzip compress data",d),null}})),b1.apply(this,arguments)}var nne=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],AA=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return nne.concat(t).some((r=>{var o=r.toLowerCase();return n.indexOf(o)!==-1}))},rne=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function wt(e,t){return e.indexOf(t)!==-1}var ov=function(e){return e.trim()},w1=function(e){return e.replace(/^\$/,"")},o5=Object.prototype,i5=o5.hasOwnProperty,iv=o5.toString,Pt=Array.isArray||function(e){return iv.call(e)==="[object Array]"},is=e=>typeof e=="function",An=e=>e===Object(e)&&!Pt(e),Ic=e=>{if(An(e)){for(var t in e)if(i5.call(e,t))return!1;return!0}return!1},ze=e=>e===void 0,_n=e=>iv.call(e)=="[object String]",Rm=e=>_n(e)&&e.trim().length===0,ys=e=>e===null,St=e=>ze(e)||ys(e),Fo=e=>iv.call(e)=="[object Number]"&&e==e,wc=e=>Fo(e)&&e>0,xi=e=>iv.call(e)==="[object Boolean]",one=e=>e instanceof FormData,ine=e=>wt(rne,e);function s5(e){return e===null||typeof e!="object"}function og(e,t){return{}.toString.call(e)==="[object "+t+"]"}function US(e){return typeof Event<"u"&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var sne=[!0,"true",1,"1","yes"],K_=e=>wt(sne,e),ane=[!1,"false",0,"0","no"];function Ri(e,t,n,r,o){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fo(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+o),Ri(o||n,t,n,r))}class lne{constructor(t){this.$t={},this.zt=t.zt,this.Ut=Ri(t.bucketSize,0,100,t.Gt),this.Wt=Ri(t.refillRate,0,this.Ut,t.Gt),this.Xt=Ri(t.refillInterval,0,864e5,t.Gt)}Jt(t,n){var r=Math.floor((n-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var n,r=Date.now(),o=String(t),s=this.$t[o];return s?this.Jt(s,r):this.$t[o]=s={tokens:this.Ut,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.zt)==null||n.call(this,t)),s.tokens===0)}stop(){this.$t={}}}var bp,IA,Z_,yo="Mobile",ig="iOS",cs="Android",Zc="Tablet",a5=cs+" "+Zc,l5="iPad",c5="Apple",u5=c5+" Watch",$d="Safari",Yc="BlackBerry",d5="Samsung",f5=d5+"Browser",h5=d5+" Internet",sl="Chrome",cne=sl+" OS",p5=sl+" "+ig,FS="Internet Explorer",m5=FS+" "+yo,BS="Opera",une=BS+" Mini",VS="Edge",g5="Microsoft "+VS,Uc="Firefox",v5=Uc+" "+ig,of="Nintendo",sf="PlayStation",Fc="Xbox",y5=cs+" "+yo,_5=yo+" "+$d,Od="Windows",S1=Od+" Phone",MA="Nokia",E1="Ouya",b5="Generic",dne=b5+" "+yo.toLowerCase(),w5=b5+" "+Zc.toLowerCase(),x1="Konqueror",Lr="(\\d+(\\.\\d+)?)",Y_=new RegExp("Version/"+Lr),fne=new RegExp(Fc,"i"),hne=new RegExp(sf+" \\w+","i"),pne=new RegExp(of+" \\w+","i"),qS=new RegExp(Yc+"|PlayBook|BB10","i"),mne={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},S5=function(e,t){return t=t||"",wt(e," OPR/")&&wt(e,"Mini")?une:wt(e," OPR/")?BS:qS.test(e)?Yc:wt(e,"IE"+yo)||wt(e,"WPDesktop")?m5:wt(e,f5)?h5:wt(e,VS)||wt(e,"Edg/")?g5:wt(e,"FBIOS")?"Facebook "+yo:wt(e,"UCWEB")||wt(e,"UCBrowser")?"UC Browser":wt(e,"CriOS")?p5:wt(e,"CrMo")||wt(e,sl)?sl:wt(e,cs)&&wt(e,$d)?y5:wt(e,"FxiOS")?v5:wt(e.toLowerCase(),x1.toLowerCase())?x1:((n,r)=>r&&wt(r,c5)||(function(o){return wt(o,$d)&&!wt(o,sl)&&!wt(o,cs)})(n))(e,t)?wt(e,yo)?_5:$d:wt(e,Uc)?Uc:wt(e,"MSIE")||wt(e,"Trident/")?FS:wt(e,"Gecko")?Uc:""},gne={[m5]:[new RegExp("rv:"+Lr)],[g5]:[new RegExp(VS+"?\\/"+Lr)],[sl]:[new RegExp("("+sl+"|CrMo)\\/"+Lr)],[p5]:[new RegExp("CriOS\\/"+Lr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Lr)],[$d]:[Y_],[_5]:[Y_],[BS]:[new RegExp("(Opera|OPR)\\/"+Lr)],[Uc]:[new RegExp(Uc+"\\/"+Lr)],[v5]:[new RegExp("FxiOS\\/"+Lr)],[x1]:[new RegExp("Konqueror[:/]?"+Lr,"i")],[Yc]:[new RegExp(Yc+" "+Lr),Y_],[y5]:[new RegExp("android\\s"+Lr,"i")],[h5]:[new RegExp(f5+"\\/"+Lr)],[FS]:[new RegExp("(rv:|MSIE )"+Lr)],Mozilla:[new RegExp("rv:"+Lr)]},vne=function(e,t){var n=S5(e,t),r=gne[n];if(ze(r))return null;for(var o=0;r.length>o;o++){var s=e.match(r[o]);if(s)return parseFloat(s[s.length-2])}return null},PA=[[new RegExp(Fc+"; "+Fc+" (.*?)[);]","i"),e=>[Fc,e&&e[1]||""]],[new RegExp(of,"i"),[of,""]],[new RegExp(sf,"i"),[sf,""]],[qS,[Yc,""]],[new RegExp(Od,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[S1,""];if(new RegExp(yo).test(t)&&!/IEMobile\b/.test(t))return[Od+" "+yo,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=mne[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Od,r]}return[Od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ig,[e[3],e[4],e[5]||"0"].join(".")]:[ig,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ze(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+cs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+cs+")","i"),e=>e&&e[2]?[cs,[e[2],e[3],e[4]||"0"].join(".")]:[cs,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cne,""]],[/Linux|debian/i,["Linux",""]]],NA=function(e){return pne.test(e)?of:hne.test(e)?sf:fne.test(e)?Fc:new RegExp(E1,"i").test(e)?E1:new RegExp("("+S1+"|WPDesktop)","i").test(e)?S1:/iPad/.test(e)?l5:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?u5:qS.test(e)?Yc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(MA,"i").test(e)?MA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(yo).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?cs:a5:new RegExp("(pda|"+yo+")","i").test(e)?dne:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?w5:""},yne=e=>e instanceof Error,E5={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},_ne=E5.info;function x5(e){if(xi(e))return{boolValue:e};if(typeof e=="number")return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e=="string")return{stringValue:e};if(Pt(e))return{arrayValue:{values:e.map((t=>x5(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function kA(e){var t=[];for(var n in e){var r=e[n];ys(r)||ze(r)||t.push({key:n,value:x5(r)})}return t}function bne(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Z_&&n.length===IA||(IA=n.length,Z_=n.reduce(((r,o)=>{bp||(bp={});var s=bp[o];if(s)r[s[0]]=s[1];else for(var l=e(o),c=l.length-1;c>=0;c--){var d=l[c],f=d?.filename,p=t[o];if(f&&p){r[f]=p,bp[o]=[f,p];break}}return r}),{})),Z_}}class wne{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},o=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),l=this.parseStacktrace(o,s);return{$exception_list:this.convertToExceptionList(l,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Lo((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Pt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,o;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(o=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),Ne({},t,{cause:r,stack:o})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Lo((function*(){var r=t;for(var o of n.modifiers)r=yield o(r);return r}))()}convertToExceptionList(t,n){var r,o,s,l={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(o=n.handled)===null||o===void 0||o,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(l.stacktrace={type:"raw",frames:t.stack});var c=[l];return t.cause!=null&&c.push(...this.convertToExceptionList(t.cause,Ne({},n,{handled:!0}))),c}buildParsingContext(t){var n;return{chunkIdMap:bne(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var o=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(t,n,l);return this.applyCoercers(s,c)}};return Ne({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>o(s,r),next:s=>o(s,r+1)})}}var Wc="?";function R1(e,t,n,r,o){var s={platform:e,filename:t,function:n==="<anonymous>"?Wc:n,in_app:!0};return ze(r)||(s.lineno=r),ze(o)||(s.colno=o),s}var R5=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Wc,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Sne=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ene=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xne=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rne=(e,t)=>{var n=Sne.exec(e);if(n){var[,r,o,s]=n;return R1(t,r,Wc,+o,+s)}var l=Ene.exec(e);if(l){if(l[2]&&l[2].indexOf("eval")===0){var c=xne.exec(l[2]);c&&(l[2]=c[1],l[3]=c[2],l[4]=c[3])}var[d,f]=R5(l[1]||Wc,l[2]);return R1(t,f,d,l[3]?+l[3]:void 0,l[4]?+l[4]:void 0)}},One=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cne=(e,t)=>{var n=One.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Tne.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],s=n[1]||Wc;return[s,o]=R5(s,o),R1(t,o,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},DA=/\(error: (.*)\)/;class Ane{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=_n(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return og(t,"DOMException")}isDOMError(t){return og(t,"DOMError")}}class Ine{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Mne{constructor(){}match(t){return og(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Pne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Nne{match(t){return typeof t=="string"}coerce(t,n){var r,[o,s]=this.getInfos(t);return{type:o??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,o=t.match(Pne);return o&&(n=o[1],r=o[2]),[n,r]}}var kne=["fatal","error","warning","log","info","debug"];function O5(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(t>=o.length)return r===n.length?o:o.length>t?o.slice(0,t)+"...":o}return""}class Dne{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,o=this.getErrorPropertyFromObject(t);return o?n.apply(o):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return US(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+O5(t)}isSeverityLevel(t){return _n(t)&&!Rm(t)&&kne.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(yne(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class Lne{match(t){return US(t)}coerce(t,n){var r,o=t.constructor.name;return{type:o,value:o+" captured as exception with keys: "+O5(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class $ne{match(t){return s5(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class jne{match(t){return og(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!US(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,o=this.getUnhandledRejectionReason(t);return s5(o)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(o)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var sg="$message",ag="$timestamp",zne=new Set([sg,ag]),W_={enabled:!0,max_bytes:32768};function lg(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:W_.enabled,max_bytes:Fne(e.max_bytes,W_.max_bytes)}:Ne({},W_)}class Une{constructor(t){this.Kt=[],this.Qt=0,this.Bt=lg(t)}setConfig(t){this.Bt=lg(t),this.er()}add(t){var n=(function(o){var s=(function(p){var h=new WeakSet;try{return JSON.stringify(p,((g,v)=>{if(typeof v=="bigint")return v.toString();if(typeof v!="function"&&typeof v!="symbol"){if(v instanceof Date)return v.toISOString();if(v instanceof Error)return{name:v.name,message:v.message,stack:v.stack};if(v&&typeof v=="object"){if(h.has(v))return"[Circular]";h.add(v)}return v}}))}catch{return}})(o);if(s)try{var l=JSON.parse(s);if(!An(l))return;var c=l,d=c[sg],f=c[ag];return!_n(d)||d.trim().length===0||!_n(f)&&!Fo(f)?void 0:{step:c,json:s}}catch{return}})(t);if(n){var r=(function(o){if(typeof TextEncoder<"u")return new TextEncoder().encode(o).length;for(var s=encodeURIComponent(o),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);r>this.Bt.max_bytes||(this.Kt.push({step:n.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((t=>t.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var t=this.Kt.shift();t&&(this.Qt-=t.bytes)}}}function Fne(e,t){if(!Fo(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var T5=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(o){if(me&&($r.DEBUG||We.POSTHOG_DEBUG||n)&&!ze(me.console)&&me.console){for(var s=("__rrweb_original__"in me.console[o])?me.console[o].__rrweb_original__:me.console[o],l=arguments.length,c=new Array(l>1?l-1:0),d=1;l>d;d++)c[d-1]=arguments[d];s(e,...c)}},info(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("log",...s)},warn(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("warn",...s)},error(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("error",...s)},critical(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];console.error(e,...s)},uninitializedWarning(o){r.error("You must initialize PostHog before calling "+o)},createLogger:(o,s)=>T5(e+" "+o,s)};return r},$e=T5("[PostHog.js]"),mn=$e.createLogger,Bne=mn("[ExternalScriptsLoader]"),Q_=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Bne.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Le?.querySelectorAll("script");if(r){for(var o,s=function(){if(r[l].src===t){var d=r[l];return d.__posthog_loading_callback_fired?{v:n()}:(d.addEventListener("load",(f=>{d.__posthog_loading_callback_fired=!0,n(void 0,f)})),d.onerror=f=>n(f),{v:void 0})}},l=0;r.length>l;l++)if(o=s())return o.v}var c=()=>{if(!Le)return n("document not found");var d=Le.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=t,d.onload=h=>{d.__posthog_loading_callback_fired=!0,n(void 0,h)},d.onerror=h=>n(h),e.config.prepare_external_dependency_script&&(d=e.config.prepare_external_dependency_script(d)),!d)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Le.head.appendChild(d);else{var f,p=Le.querySelectorAll("body > script");p.length>0?(f=p[0].parentNode)==null||f.insertBefore(d,p[0]):Le.body.appendChild(d)}};Le!=null&&Le.body?c():Le?.addEventListener("DOMContentLoaded",c)};We.__PosthogExtensions__=We.__PosthogExtensions__||{},We.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var o="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;o=o+"&t="+Math.floor(Date.now()/s)*s}r=e.requestRouter.endpointFor("assets",o)}Q_(e,r,n)}else{var l=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Q_(e,l,n)}},We.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Q_(e,r,n)};var C5="$people_distinct_id",cg="$device_id",Td="__alias",Cd="__timers",O1="$autocapture_disabled_server_side",T1="$heatmaps_enabled_server_side",C1="$exception_capture_enabled_server_side",A1="$error_tracking_suppression_rules",I1="$error_tracking_capture_extension_exceptions",M1="$web_vitals_enabled_server_side",HS="$dead_clicks_enabled_server_side",P1="$product_tours_enabled_server_side",N1="$web_vitals_allowed_metrics",Ad="$session_recording_remote_config",A5="$replay_override_sampling",I5="$replay_override_linked_flag",M5="$replay_override_url_trigger",P5="$replay_override_event_trigger",ug="$sesid",GS="$session_is_sampled",Mc="$enabled_feature_flags",Om="$active_feature_flags",Id="$early_access_features",k1="$feature_flag_details",D1="$feature_flag_payloads",L1="$feature_flag_request_id",os="$override_feature_flags",Sc="$override_feature_flag_payloads",Md="$stored_person_properties",Wa="$stored_group_properties",$1="$surveys",j1="$surveys_activated",Tm="ph_product_tours",jd="$flag_call_reported",z1="$flag_call_reported_session_id",U1="$feature_flag_errors",dg="$feature_flag_evaluated_at",ei="$user_state",F1="$client_session_props",B1="$capture_rate_limit",V1="$initial_campaign_params",q1="$initial_referrer_info",fg="$initial_person_info",hg="$epp",N5="__POSTHOG_TOOLBAR__",wp="$posthog_cookieless",k5="$sdk_debug_extensions_init_method",D5="$sdk_debug_extensions_init_time_ms",L5="$sdk_debug_recording_script_not_loaded",KS="PostHog loadExternalDependency extension not found.",Qa="on_reject",as="always",hc="anonymous",pc="identified",H1="identified_only",pg="visibilitychange",mg="beforeunload",Ec="$pageview",X_="$pageleave",J_="$identify",LA="$groupidentify";function Sp(e,t){Pt(e)&&e.forEach(t)}function dn(e,t){if(!St(e))if(Pt(e))e.forEach(t);else if(one(e))e.forEach(((r,o)=>t(r,o)));else for(var n in e)i5.call(e,n)&&t(e[n],n)}var Rn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var o of n)for(var s in o)o[s]!==void 0&&(e[s]=o[s]);return e};function Cm(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var $A=function(e){try{return e()}catch{return}},Vne=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(o){$e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$e.critical(o)}}},ZS=function(e){var t={};return dn(e,(function(n,r){(_n(n)&&n.length>0||Fo(n))&&(t[r]=n)})),t},qne=["herokuapp.com","vercel.app","netlify.app"];function Hne(e){var t=e?.hostname;if(!_n(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of qne)if(n===r)return!1;return!0}function Vn(e,t,n,r){var{capture:o=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:o,passive:s})}function $5(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fo(e)&&isFinite(e)&&Math.floor(e)===e});class gg{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,o){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||0>t||0>n||0>r||0>o||t>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new gg(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new gg(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Gne{constructor(){this.I=0,this.S=0,this.k=new Kne}generate(){var t=this.generateOrAbort();if(ze(t)){this.I=0;var n=this.generateOrAbort();if(ze(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return gg.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var jA,j5=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};me&&!ze(me.crypto)&&crypto.getRandomValues&&(j5=e=>crypto.getRandomValues(e));class Kne{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(j5(this.T),this.N=0),this.T[this.N++]}}var na=()=>Zne().toString(),Zne=()=>(jA||(jA=new Gne)).generate(),ud="",Yne=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Si={R:()=>!!Le,B(e){$e.error("cookieStore error: "+e)},O(e){if(Le){try{for(var t=e+"=",n=Le.cookie.split(";").filter((s=>s.length)),r=0;n.length>r;r++){for(var o=n[r];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(Si.O(e))||{}}catch{}return t},M(e,t,n,r,o){if(Le)try{var s="",l="",c=(function(p,h){if(h){var g=(function(_,b){if(b===void 0&&(b=Le),ud)return ud;if(!b||["localhost","127.0.0.1"].includes(_))return"";for(var x=_.split("."),S=Math.min(x.length,8),E="dmn_chk_"+na();!ud&&S--;){var T=x.slice(S).join("."),R=E+"=1;domain=."+T+";path=/";b.cookie=R+";max-age=3",b.cookie.includes(E)&&(b.cookie=R+";max-age=0",ud=T)}return ud})(p);if(!g){var v=(_=>{var b=_.match(Yne);return b?b[0]:""})(p);v!==g&&$e.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""})(Le.location.hostname,r);if(n){var d=new Date;d.setTime(d.getTime()+864e5*n),s="; expires="+d.toUTCString()}o&&(l="; secure");var f=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+c+l;return f.length>3686.4&&$e.warn("cookieStore warning: large cookie, len="+f.length),Le.cookie=f,f}catch{return}},F(e,t){if(Le!=null&&Le.cookie)try{Si.M(e,"",-1,t)}catch{return}}},eb=null,yn={R(){if(!ys(eb))return eb;var e=!0;if(ze(me))e=!1;else try{var t="__mplssupport__";yn.M(t,"xyz"),yn.O(t)!=='"xyz"'&&(e=!1),yn.F(t)}catch{e=!1}return e||$e.error("localStorage unsupported; falling back to cookie store"),eb=e,e},B(e){$e.error("localStorage error: "+e)},O(e){try{return me?.localStorage.getItem(e)}catch(t){yn.B(t)}return null},Z(e){try{return JSON.parse(yn.O(e))||{}}catch{}return null},M(e,t){try{me?.localStorage.setItem(e,JSON.stringify(t))}catch(n){yn.B(n)}},F(e){try{me?.localStorage.removeItem(e)}catch(t){yn.B(t)}}},Wne=[cg,"distinct_id",ug,GS,hg,fg,ei],Ep={},Qne={R:()=>!0,B(e){$e.error("memoryStorage error: "+e)},O:e=>Ep[e]||null,Z:e=>Ep[e]||null,M(e,t){Ep[e]=t},F(e){delete Ep[e]}},qa=null,mr={R(){if(!ys(qa))return qa;if(qa=!0,ze(me))qa=!1;else try{var e="__support__";mr.M(e,"xyz"),mr.O(e)!=='"xyz"'&&(qa=!1),mr.F(e)}catch{qa=!1}return qa},B(e){$e.error("sessionStorage error: ",e)},O(e){try{return me?.sessionStorage.getItem(e)}catch(t){mr.B(t)}return null},Z(e){try{return JSON.parse(mr.O(e))||null}catch{}return null},M(e,t){try{me?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){mr.B(n)}},F(e){try{me?.sessionStorage.removeItem(e)}catch(t){mr.B(t)}}};class Xne{constructor(t){this._instance=t}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===as||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Qa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(t){this.nr.M(this.sr,t?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.O(this.sr);return K_(t)?1:wt(ane,t)?0:-1}get nr(){var t=this.Bt.opt_out_capturing_persistence_type,n=t==="localStorage"?yn:Si;if(!this.ar||this.ar!==n){this.ar=n;var r=t==="localStorage"?Si:yn;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(K_(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[go?.doNotTrack,go?.msDoNotTrack,We.doNotTrack].some((t=>K_(t)))}}var xp=mn("[Dead Clicks]"),Jne=()=>!0,ere=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(HS)),r=e.instance.config.capture_dead_clicks;return xi(r)?r:!!An(r)||n};class zA{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[HS]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(o=>{o?xp.error("failed to load script",o):t()}))}hr(){var t;if(Le){if(!this.lr&&(t=We.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=An(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.lr=We.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.lr.start(Le),xp.info("starting...")}}else xp.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,xp.info("stopping..."))}}var tb=mn("[SegmentIntegration]"),z5="posthog-js";function U5(e,t){var{organization:n,projectId:r,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:l=!0}=t===void 0?{}:t;return c=>{var d,f,p,h,g;if(s!=="*"&&!s.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _,b=((d=c.exception)==null?void 0:d.values)||[],x=b.map((E=>Ne({},E,{stacktrace:E.stacktrace?Ne({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map((T=>Ne({},T,{platform:"web:javascript"})))}):void 0}))),S={$exception_message:((f=b[0])==null?void 0:f.value)||c.message,$exception_type:(p=b[0])==null?void 0:p.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((h=b[0])==null?void 0:h.value)||c.message,$sentry_exception_type:(g=b[0])==null?void 0:g.type,$sentry_tags:c.tags};return n&&r&&(S.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+c.event_id),l&&((_=e.exceptions)==null||_.sendExceptionEvent(S)),c}}class tre{constructor(t,n,r,o,s,l){this.name=z5,this.setupOnce=function(c){c(U5(t,{organization:n,projectId:r,prefix:o,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class UA{constructor(t){this.cr=(n,r,o)=>{o&&(o.noSessionId||o.activityTimeout||o.sessionPastMaximumLength)&&($e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:o}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.cr)}destroy(){var t;(t=this.pr)==null||t.call(this),this.pr=void 0}doPageView(t,n){var r,o=this.gr(t,n);return this.dr={pathname:(r=me?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),o}doPageLeave(t){var n;return this.gr(t,(n=this.dr)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.dr)==null?void 0:t.pageViewId}}gr(t,n){var r=this.dr;if(!r)return{$pageview_id:n};var o={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:l,lastScrollY:c,maxScrollY:d,maxContentHeight:f,lastContentY:p,maxContentY:h}=s;if(!(ze(l)||ze(c)||ze(d)||ze(f)||ze(p)||ze(h))){l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p),h=Math.ceil(h);var g=l>1?Ri(c/l,0,1,$e):1,v=l>1?Ri(d/l,0,1,$e):1,_=f>1?Ri(p/f,0,1,$e):1,b=f>1?Ri(h/f,0,1,$e):1;o=Rn(o,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(o.$prev_pageview_pathname=r.pathname),r.timestamp&&(o.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),o}}var nre={[C5]:{exposure:"hidden"},[Td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cd]:{exposure:"hidden"},[O1]:{exposure:"event"},[T1]:{exposure:"hidden"},[C1]:{exposure:"event"},[A1]:{exposure:"hidden"},[I1]:{exposure:"event"},[M1]:{exposure:"event"},[HS]:{exposure:"event"},[P1]:{exposure:"hidden"},[N1]:{exposure:"event"},[Ad]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ug]:{exposure:"hidden"},[GS]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Mc]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!An(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t["$feature/"+n[r]]=e[n[r]];return t}},[Om]:{exposure:"event"},[Id]:{exposure:"hidden"},[k1]:{exposure:"hidden"},[D1]:{exposure:"event"},[L1]:{exposure:"event"},[os]:{exposure:"event"},[Sc]:{exposure:"hidden"},[Md]:{exposure:"hidden"},[Wa]:{exposure:"hidden"},[$1]:{exposure:"hidden"},[j1]:{exposure:"event"},[Tm]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[jd]:{exposure:"hidden"},[z1]:{exposure:"hidden"},[U1]:{exposure:"hidden"},[dg]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[F1]:{exposure:"hidden"},[B1]:{exposure:"hidden"},[V1]:{exposure:"hidden"},[q1]:{exposure:"hidden"},[fg]:{exposure:"hidden"},[hg]:{exposure:"hidden"},[A5]:{exposure:"event"},[I5]:{exposure:"event"},[M5]:{exposure:"event"},[P5]:{exposure:"event"},[k5]:{exposure:"event"},[D5]:{exposure:"event"},[L5]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rre=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],vg=e=>{var t=Le?.createElement("a");return ze(t)?null:(t.href=e,t)},yg=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),o=0;r.length>o;o++){var s=r[o].split("=");if(s[0]===t){n=s;break}}if(!Pt(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{$e.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},af=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),o=r[1],s=(r[0]||"").split("?"),l=s[1],c=s[0],d=(l||"").split("&"),f=[],p=0;d.length>p;p++){var h=d[p].split("=");Pt(h)&&(t.includes(h[0])?f.push(h[0]+"="+n):f.push(d[p]))}var g=c;return l!=null&&(g+="?"+f.join("&")),o!=null&&(g+="#"+o),g},_g=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Rp="https?://(.*)",Qc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ore=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qc],lf="<masked>",ire=["li_fat_id"];function F5(e,t,n){if(!Le)return{};var r,o=t?[...Qc,...n||[]]:[],s=B5(af(Le.URL,o,lf),e),l=(r={},dn(ire,(function(c){var d=Si.O(c);r[c]=d||null})),r);return Rn(l,s)}function B5(e,t){var n=ore.concat(t||[]),r={};return dn(n,(function(o){var s=yg(e,o);r[o]=s||null})),r}function V5(e){var t=(function(s){return s?s.search(Rp+"google.([^/?]*)")===0?"google":s.search(Rp+"bing.com")===0?"bing":s.search(Rp+"yahoo.com")===0?"yahoo":s.search(Rp+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!ys(t)){r.$search_engine=t;var o=Le?yg(Le.referrer,n):"";o.length&&(r.ph_keyword=o)}return r}function FA(){return navigator.language||navigator.userLanguage}var bg="$direct";function q5(){return Le?.referrer||bg}function H5(e,t){var n=e?[...Qc,...t||[]]:[],r=pr?.href.substring(0,1e3);return{r:q5().substring(0,1e3),u:r?af(r,n,lf):void 0}}function G5(e){var t,{r:n,u:r}=e,o={$referrer:n,$referring_domain:n==null?void 0:n==bg?bg:(t=vg(n))==null?void 0:t.host};if(r){o.$current_url=r;var s=vg(r);o.$host=s?.host,o.$pathname=s?.pathname;var l=B5(r);Rn(o,l)}if(n){var c=V5(n);Rn(o,c)}return o}function K5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function sre(){try{return new Date().getTimezoneOffset()}catch{return}}var are=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class nb{constructor(t,n){this.Bt=t,this.props={},this.mr=!1,this.yr=(r=>{var o="";return r.token&&(o=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+o+"_posthog"})(t),this.nr=this.br(t),this.load(),t.debug&&$e.info("Persistence loaded",t.persistence,Ne({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this._r}br(t){are.indexOf(t.persistence.toLowerCase())===-1&&($e.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(o){o===void 0&&(o=[]);var s=[...Wne,...o];return Ne({},yn,{Z(l){try{var c={};try{c=Si.Z(l)||{}}catch{}var d=Rn(c,JSON.parse(yn.O(l)||"{}"));return yn.M(l,d),d}catch{}return null},M(l,c,d,f,p,h){try{yn.M(l,c,void 0,void 0,h);var g={};s.forEach((v=>{c[v]&&(g[v]=c[v])})),Object.keys(g).length&&Si.M(l,g,d,f,p,h)}catch(v){yn.B(v)}},F(l,c){try{me?.localStorage.removeItem(l),Si.F(l,c)}catch(d){yn.B(d)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&yn.R()?yn:r==="localstorage+cookie"&&n.R()?n:r==="sessionstorage"&&mr.R()?mr:r==="memory"?Qne:r==="cookie"?Si:n.R()?n:Si}wr(t){var n=t??this.Bt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[dg];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return dn(this.props,((n,r)=>{var o=(s=>{var l=nre[s];if(l)return l;for(var[c,d]of rre)if(s.indexOf(c)===0)return d})(r);if(o?.exposure==="derived"){if(o.shouldSkipFromEventProperties!=null&&o.shouldSkipFromEventProperties(n,r===Mc?()=>this.wr():()=>!1))return;o.transformToEventProperties&&Rn(t,o.transformToEventProperties(n))}else o&&o.exposure!=="event"||(t[r]=n)})),t}load(){if(!this._r){var t=this.nr.Z(this.yr);t&&(this.props=Rn({},t))}}save(){this._r||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(An(t)){ze(n)&&(n="None"),this.Ir=ze(r)?this.kr:r;var o=!1;if(dn(t,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.Tr(l,s),o=!0)})),o)return this.save(),!0}return!1}register(t,n){if(An(t)){this.Ir=ze(n)?this.kr:n;var r=!1;if(dn(t,((o,s)=>{t.hasOwnProperty(s)&&this.props[s]!==o&&(this.Tr(s,o),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Ar(t),this.save())}update_campaign_params(){if(!this.mr){var t=F5(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Ic(ZS(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=Le?.referrer)?V5(t):{})}update_referrer_info(){var t;this.register_once({$referrer:q5(),$referring_domain:Le!=null&&Le.referrer&&((t=vg(Le.referrer))==null?void 0:t.host)||bg},void 0)}set_initial_person_info(){this.props[V1]||this.props[q1]||this.register_once({[fg]:H5(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};dn([q1,V1],(l=>{var c=this.props[l];c&&dn(c,(function(d,f){t["$initial_"+w1(f)]=d}))}));var n,r,o=this.props[fg];if(o){var s=(n=G5(o),r={},dn(n,(function(l,c){r["$initial_"+w1(c)]=l})),r);Rn(t,s)}return t}safe_merge(t){return dn(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.kr=this.Ir=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((l,c)=>{if(l.length!==c.length)return!1;var d=[...l].sort(),f=[...c].sort();return d.every(((p,h)=>p===f[h]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var o=this.br(t),s=this.props;this.clear(),this.nr=o,this.props=s,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_secure(t){t!==this.Sr&&(this.Sr=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Cd]||{};r[t]=n,this.Tr(Cd,r),this.save()}remove_event_timer(t){var n=this.props[Cd]||{},r=n[t];return ze(r)||(delete n[t],this.Tr(Cd,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Tr(t,n),this.save()}Tr(t,n){this.props[t]=n}Ar(t){delete this.props[t]}}var dd={Activation:"events",Cancellation:"cancelEvents"},rb={Popover:"popover",API:"api",Widget:"widget"},Pd={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},ob={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},G1={Popover:"popover",Inline:"inline"},lre={SHOWN:"product tour shown"},BA={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},VA=mn("[RateLimiter]");class cre{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((o=>{VA.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void VA.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,o;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:l}=this,c=new Date().getTime(),d=(n=(r=this.instance.persistence)==null?void 0:r.get_property(B1))!==null&&n!==void 0?n:{tokens:s,last:c};d.tokens+=(c-d.last)/1e3*l,d.last=c,d.tokens>s&&(d.tokens=s);var f=1>d.tokens;return f||t||(d.tokens=Math.max(0,d.tokens-1)),!f||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(o=this.instance.persistence)==null||o.set_property(B1,d),{isRateLimited:f,remainingTokens:d.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var fd=mn("[RemoteConfig]");class Z5{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=We._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}Er(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Rr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return fd.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void fd.warn("Remote config is disabled. Falling back to local config.");this.Er((t=>{if(!t)return fd.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((n=>{this.Nr(n),this.Mr()}));this.Nr(t),this.Mr()}))}catch(t){fd.error("Error loading remote config",t)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||Le?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Mr(){var t;if(!this.Or){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Or=setInterval((()=>{this.refresh()}),n))}}Nr(t){var n;t||fd.error("Failed to fetch remote config from PostHog."),this._instance.Nr(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var yi={GZipJS:"gzip-js",Base64:"base64"},Uo=Uint8Array,Jr=Uint16Array,Xc=Uint32Array,YS=new Uo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),WS=new Uo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qA=new Uo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Y5=function(e,t){for(var n=new Jr(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var o=new Xc(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)o[s]=s-n[r]<<5|r;return[n,o]},W5=Y5(YS,2),K1=W5[1];W5[0][28]=258,K1[258]=28;for(var HA=Y5(WS,0)[1],Q5=new Jr(32768),fn=0;32768>fn;++fn){var mc=(43690&fn)>>>1|(21845&fn)<<1;Q5[fn]=((65280&(mc=(61680&(mc=(52428&mc)>>>2|(13107&mc)<<2))>>>4|(3855&mc)<<4))>>>8|(255&mc)<<8)>>>1}var zd=function(e,t,n){for(var r=e.length,o=0,s=new Jr(t);r>o;++o)++s[e[o]-1];var l,c=new Jr(t);for(o=0;t>o;++o)c[o]=c[o-1]+s[o-1]<<1;for(l=new Jr(r),o=0;r>o;++o)l[o]=Q5[c[e[o]-1]++]>>>15-e[o];return l},ul=new Uo(288);for(fn=0;144>fn;++fn)ul[fn]=8;for(fn=144;256>fn;++fn)ul[fn]=9;for(fn=256;280>fn;++fn)ul[fn]=7;for(fn=280;288>fn;++fn)ul[fn]=8;var wg=new Uo(32);for(fn=0;32>fn;++fn)wg[fn]=5;var ure=zd(ul,9),dre=zd(wg,5),X5=function(e){return(e/8>>0)+(7&e&&1)},J5=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Jr?Jr:e instanceof Xc?Xc:Uo)(n-t);return r.set(e.subarray(t,n)),r},Ji=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},hd=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ib=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,s=n.slice();if(!o)return[new Uo(0),0];if(o==1){var l=new Uo(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(O,A){return O.f-A.f})),n.push({s:-1,f:25001});var c=n[0],d=n[1],f=0,p=1,h=2;for(n[0]={s:-1,f:c.f+d.f,l:c,r:d};p!=o-1;)c=n[n[h].f>n[f].f?f++:h++],d=n[f!=p&&n[h].f>n[f].f?f++:h++],n[p++]={s:-1,f:c.f+d.f,l:c,r:d};var g=s[0].s;for(r=1;o>r;++r)s[r].s>g&&(g=s[r].s);var v=new Jr(g+1),_=Z1(n[p-1],v,0);if(_>t){r=0;var b=0,x=_-t,S=1<<x;for(s.sort((function(O,A){return v[A.s]-v[O.s]||O.f-A.f}));o>r;++r){var E=s[r].s;if(t>=v[E])break;b+=S-(1<<_-v[E]),v[E]=t}for(b>>>=x;b>0;){var T=s[r].s;t>v[T]?b-=1<<t-v[T]++-1:++r}for(;r>=0&&b;--r){var R=s[r].s;v[R]==t&&(--v[R],++b)}_=t}return[new Uo(v),_]},Z1=function(e,t,n){return e.s==-1?Math.max(Z1(e.l,t,n+1),Z1(e.r,t,n+1)):t[e.s]=n},GA=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jr(++t),r=0,o=e[0],s=1,l=function(d){n[r++]=d},c=1;t>=c;++c)if(e[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=e[c]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Y1=function(e,t,n){var r=n.length,o=X5(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var s=0;r>s;++s)e[o+s+4]=n[s];return 8*(o+4+r)},KA=function(e,t,n,r,o,s,l,c,d,f,p){Ji(t,p++,n),++o[256];for(var h=ib(o,15),g=h[0],v=h[1],_=ib(s,15),b=_[0],x=_[1],S=GA(g),E=S[0],T=S[1],R=GA(b),O=R[0],A=R[1],I=new Jr(19),P=0;E.length>P;++P)I[31&E[P]]++;for(P=0;O.length>P;++P)I[31&O[P]]++;for(var L=ib(I,7),q=L[0],j=L[1],B=19;B>4&&!q[qA[B-1]];--B);var F,Z,ie,H,W=f+5<<3,te=pd(o,ul)+pd(s,wg)+l,le=pd(o,g)+pd(s,b)+l+14+3*B+pd(I,q)+(2*I[16]+3*I[17]+7*I[18]);if(te>=W&&le>=W)return Y1(t,p,e.subarray(d,d+f));if(Ji(t,p,1+(te>le)),p+=2,te>le){F=zd(g,v),Z=g,ie=zd(b,x),H=b;var Q=zd(q,j);for(Ji(t,p,T-257),Ji(t,p+5,A-1),Ji(t,p+10,B-4),p+=14,P=0;B>P;++P)Ji(t,p+3*P,q[qA[P]]);p+=3*B;for(var k=[E,O],G=0;2>G;++G){var V=k[G];for(P=0;V.length>P;++P)Ji(t,p,Q[D=31&V[P]]),p+=q[D],D>15&&(Ji(t,p,V[P]>>>5&127),p+=V[P]>>>12)}}else F=ure,Z=ul,ie=dre,H=wg;for(P=0;c>P;++P)if(r[P]>255){var D;hd(t,p,F[257+(D=r[P]>>>18&31)]),p+=Z[D+257],D>7&&(Ji(t,p,r[P]>>>23&31),p+=YS[D]);var U=31&r[P];hd(t,p,ie[U]),p+=H[U],U>3&&(hd(t,p,r[P]>>>5&8191),p+=WS[U])}else hd(t,p,F[r[P]]),p+=Z[r[P]];return hd(t,p,F[256]),p+Z[256]},fre=new Xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),hre=(function(){for(var e=new Xc(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),sb=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function pre(e,t){t===void 0&&(t={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,_=0;g.length>_;++_)v=hre[255&v^g[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=e.length;n.p(e);var o,s,l,c,d,f=(c=10+((o=t).filename&&o.filename.length+1||0),d=8,(function(h,g,v,_,b,x){var S=h.length,E=new Uo(_+S+5*(1+Math.floor(S/7e3))+b),T=E.subarray(_,E.length-b),R=0;if(!g||8>S)for(var O=0;S>=O;O+=65535){var A=O+65535;S>A?R=Y1(T,R,h.subarray(O,A)):(T[O]=!0,R=Y1(T,R,h.subarray(O,S)))}else{for(var I=fre[g-1],P=I>>>13,L=8191&I,q=(1<<v)-1,j=new Jr(32768),B=new Jr(q+1),F=Math.ceil(v/3),Z=2*F,ie=function(Ue){return(h[Ue]^h[Ue+1]<<F^h[Ue+2]<<Z)&q},H=new Xc(25e3),W=new Jr(288),te=new Jr(32),le=0,Q=0,k=(O=0,0),G=0,V=0;S>O;++O){var D=ie(O),U=32767&O,X=B[D];if(j[U]=X,B[D]=U,O>=G){var fe=S-O;if((le>7e3||k>24576)&&fe>423){R=KA(h,T,0,H,W,te,Q,k,V,O-V,R),k=le=Q=0,V=O;for(var pe=0;286>pe;++pe)W[pe]=0;for(pe=0;30>pe;++pe)te[pe]=0}var xe=2,je=0,Y=L,re=U-X&32767;if(fe>2&&D==ie(O-re))for(var ve=Math.min(P,fe)-1,se=Math.min(32767,O),Se=Math.min(258,fe);se>=re&&--Y&&U!=X;){if(h[O+xe]==h[O+xe-re]){for(var Te=0;Se>Te&&h[O+Te]==h[O+Te-re];++Te);if(Te>xe){if(xe=Te,je=re,Te>ve)break;var tt=Math.min(re,Te-2),rt=0;for(pe=0;tt>pe;++pe){var Be=O-re+pe+32768&32767,Qe=Be-j[Be]+32768&32767;Qe>rt&&(rt=Qe,X=Be)}}}re+=(U=X)-(X=j[U])+32768&32767}if(je){H[k++]=268435456|K1[xe]<<18|HA[je];var Pe=31&K1[xe],Me=31&HA[je];Q+=YS[Pe]+WS[Me],++W[257+Pe],++te[Me],G=O+xe,++le}else H[k++]=h[O],++W[h[O]]}}R=KA(h,T,!0,H,W,te,Q,k,V,O-V,R)}return J5(E,0,_+X5(R)+b)})(s=e,(l=t).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,d)),p=f.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&sb(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(f,t),sb(f,p-8,n.d()),sb(f,p-4,r),f}var mre=!!_1||!!y1,e6="text/plain",ZA=!1,sv=function(e,t,n){var r;n===void 0&&(n=!0);var[o,s]=e.split("?"),l=Ne({},t),c=(r=s?.split("&").map((f=>{var p,[h,g]=f.split("="),v=n&&(p=l[h])!==null&&p!==void 0?p:g;return delete l[h],h+"="+v})))!==null&&r!==void 0?r:[],d=(function(f,p){var h,g;p===void 0&&(p="&");var v=[];return dn(f,(function(_,b){ze(_)||ze(b)||b==="undefined"||(h=encodeURIComponent((x=>x instanceof File)(_)?_.name:_.toString()),g=encodeURIComponent(b),v[v.length]=g+"="+h)})),v.join(p)})(l);return d&&c.push(d),o+"?"+c.join("&")},Pc=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),ab=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===yi.GZipJS){var r=pre((function(c,d){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Uo(c.length+(c.length>>>1)),h=0,g=function(x){p[h++]=x},v=0;f>v;++v){if(h+5>p.length){var _=new Uo(h+8+(f-v<<1));_.set(p),p=_}var b=c.charCodeAt(v);128>b?g(b):2048>b?(g(192|b>>>6),g(128|63&b)):b>55295&&57344>b?(g(240|(b=65536+(1047552&b)|1023&c.charCodeAt(++v))>>>18),g(128|b>>>12&63),g(128|b>>>6&63),g(128|63&b)):(g(224|b>>>12),g(128|b>>>6&63),g(128|63&b))}return J5(p,0,h)})(Pc(t)),{mtime:0});return{contentType:e6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===yi.Base64){var o=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((d,f)=>String.fromCharCode(parseInt(f,16)))))})(Pc(t)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:Pc(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=Pc(t);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},gre=(function(){var e=Lo((function*(t){var n=Pc(t.data),r=yield(function(s,l,c){return b1.apply(this,arguments)})(n,$r.DEBUG,{rethrow:!0});if(!r)return t;var o=yield r.arrayBuffer();return Ne({},t,{tr:{contentType:e6,body:o,estimatedSize:o.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),YA=(e,t)=>sv(e,{_:new Date().getTime().toString(),ver:$r.JS_SDK_VERSION,compression:t}),Am=[];y1&&Am.push({transport:"fetch",method(e){var t,n,{contentType:r,body:o,estimatedSize:s}=(t=ab(e))!==null&&t!==void 0?t:{},l=new Headers;dn(e.headers,(function(p,h){l.append(h,p)})),r&&l.append("Content-Type",r);var c=e.url,d=null;if(OA){var f=new OA;d={signal:f.signal,timeout:setTimeout((()=>f.abort()),e.timeout)}}y1(c,Ne({method:e?.method||"GET",headers:l,keepalive:e.method==="POST"&&52428.8>(s||0),body:o,signal:(n=d)==null?void 0:n.signal},e.fetchOptions)).then((p=>p.text().then((h=>{var g={statusCode:p.status,text:h};if(p.status===200)try{g.json=JSON.parse(h)}catch(v){$e.error(v)}e.callback==null||e.callback(g)})))).catch((p=>{$e.error(p),e.callback==null||e.callback({statusCode:0,error:p})})).finally((()=>d?clearTimeout(d.timeout):null))}}),_1&&Am.push({transport:"XHR",method(e){var t,n=new _1;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:o}=(t=ab(e))!==null&&t!==void 0?t:{};dn(e.headers,(function(s,l){n.setRequestHeader(l,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(o)}}),go!=null&&go.sendBeacon&&Am.push({transport:"sendBeacon",method(e){var t=sv(e.url,{beacon:"1"});try{var n,{contentType:r,body:o}=(n=ab(e))!==null&&n!==void 0?n:{};if(!o)return;var s=o instanceof Blob?o:new Blob([o],{type:r});go.sendBeacon(t,s)}catch{}}});var W1=3e3;class vre{constructor(t,n){this.Pr=!0,this.Lr=[],this.Dr=Ri(n?.flush_interval_ms||W1,250,5e3,$e.createLogger("flush interval"),W1),this.Br=t}enqueue(t){this.Lr.push(t),this.jr||this.$r()}unload(){this.qr();var t=this.Lr.length>0?this.Zr():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Br(Ne({},r,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var t=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var n=this.Zr(),r=function(){var s=n[o],l=new Date().getTime();s.data&&Pt(s.data)&&dn(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),t.Br(s)};for(var o in n)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var t={};return dn(this.Lr,(n=>{var r,o=n,s=(o?o.batchKey:null)||o.url;ze(t[s])&&(t[s]=Ne({},o,{data:[]})),(r=t[s].data)==null||r.push(o.data)})),this.Lr=[],t}}var yre=["retriesPerformedSoFar"];class _re{constructor(t){this.Vr=!1,this.Hr=3e3,this.Lr=[],this._instance=t,this.Lr=[],this.zr=!0,!ze(me)&&"onLine"in me.navigator&&(this.zr=me.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},Vn(me,"online",this.Ur),Vn(me,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=r5(t,yre);wc(n)&&(r.url=sv(r.url,{retry_count:n})),this._instance._send_request(Ne({},r,{callback:o=>{o.statusCode===200||o.statusCode>=400&&500>o.statusCode||(n??0)>=10?r.callback==null||r.callback(o):this.Wr(Ne({retriesPerformedSoFar:n},r))}}))}Wr(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(l){var c=3e3*Math.pow(2,l),d=c/2,f=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(f+p*(f-d))})(n),o=Date.now()+r;this.Lr.push({retryAt:o,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),$e.warn(s),this.Vr||(this.Vr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Vr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Hr)}Yr(){var t=Date.now(),n=[],r=this.Lr.filter((s=>t>s.retryAt||(n.push(s),!1)));if(this.Lr=n,r.length>0)for(var{requestOptions:o}of r)this.retriableRequest(o)}unload(){for(var{requestOptions:t}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Vr=!1,ze(me)||(this.Ur&&(me.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(me.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(Ne({},t,{transport:"sendBeacon"}))}catch(n){$e.error(n)}this.Lr=[]}}class bre{constructor(t){this.Kr=()=>{var n,r,o,s;this.Qr||(this.Qr={});var l=this.scrollElement(),c=this.scrollY(),d=l?Math.max(0,l.scrollHeight-l.clientHeight):0,f=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(c),this.Qr.maxScrollY=Math.max(c,(n=this.Qr.maxScrollY)!==null&&n!==void 0?n:0),this.Qr.maxScrollHeight=Math.max(d,(r=this.Qr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Qr.lastContentY=f,this.Qr.maxContentY=Math.max(f,(o=this.Qr.maxContentY)!==null&&o!==void 0?o:0),this.Qr.maxContentHeight=Math.max(p,(s=this.Qr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var t=this.Qr;return setTimeout(this.Kr,0),t}startMeasuringScrollPosition(){Vn(me,"scroll",this.Kr,{capture:!0}),Vn(me,"scrollend",this.Kr,{capture:!0}),Vn(me,"resize",this.Kr)}scrollElement(){if(!this.ei)return me?.document.documentElement;var t=Pt(this.ei)?this.ei:[this.ei];for(var n of t){var r=me?.document.querySelector(n);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return me&&(me.scrollY||me.pageYOffset||me.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return me&&(me.scrollX||me.pageXOffset||me.document.documentElement.scrollLeft)||0}}var wre=e=>H5(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class WA{constructor(t,n,r,o){this.ti=s=>{var l=this.ri();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ii(this._instance)};this.ni.register({[F1]:c})}},this._instance=t,this.si=n,this.ni=r,this.ii=o||wre,this.si.onSessionId(this.ti)}ri(){return this.ni.props[F1]}getSetOnceProps(){var t,n=(t=this.ri())==null?void 0:t.props;return n?"r"in n?G5(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return dn(ZS(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+w1(r)]=n})),t}}class QS{constructor(){this.oi={}}on(t,n){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(n),()=>{this.oi[t]=this.oi[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.oi[t]||[])r(n);for(var o of this.oi["*"]||[])o(t,n)}}var lb=mn("[SessionId]");class QA{on(t,n){return this.ai.on(t,n)}constructor(t,n,r){var o;if(this.li=[],this.ui=void 0,this.ai=new QS,this.hi=(f,p)=>!(!wc(f)||!wc(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===as)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||na,this.fi=r||na;var s=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*Ri(this.Bt.session_idle_timeout_seconds||1800,60,36e3,lb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=mr.Z(this.gi),c=mr.Z(this.mi);l&&!c?this.ci=l:mr.F(this.gi),mr.M(this.mi,!0)}if((o=this.Bt.bootstrap)!=null&&o.sessionID)try{var d=(f=>{var p=this.Bt.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),d)}catch(f){lb.error("Invalid sessionID in bootstrap",f)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ze(this.li)&&(this.li=[]),this.li.push(t),this.di&&t(this.di,this.ci),()=>{this.li=this.li.filter((n=>n!==t))}}yi(){return this.Bt.persistence!=="memory"&&!this.ni._r&&mr.R()}Ii(t){t!==this.ci&&(this.ci=t,this.yi()&&mr.M(this.gi,t))}Ci(){return this.ci?this.ci:this.yi()?mr.Z(this.gi):null}bi(t,n,r){t===this.di&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.di=t,this.ni.register({[ug]:[n,t,r]}))}Si(){var t=this.ni.props[ug];return Pt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&me&&(me.removeEventListener(mg,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&mr.F(this.mi)},Vn(me,mg,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Bt.cookieless_mode===as)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[o,s,l]=this.Si(),c=this.Ci(),d=wc(l)&&Math.abs(r-l)>864e5,f=!1,p=!s,h=!p&&!t&&this.hi(r,o);p||h||d?(s=this.vi(),c=this.fi(),lb.info("new session ID generated",{sessionId:s,windowId:c,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}}),l=r,f=!0):c||(c=this.fi(),f=!0);var g=wc(o)&&t&&!d?o:r,v=wc(l)?l:new Date().getTime();return this.Ii(c),this.bi(s,g,v),t||this.pi(),f&&this.li.forEach((_=>_(s,c,f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0))),{sessionId:s,windowId:c,sessionStartTimestamp:v,changeReason:f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0,lastActivityTimestamp:o}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[t]=this.Si();if(this.hi(new Date().getTime(),t)){var n=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var t6=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&AA(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((o=>AA(o?.brand,t))))return!0}catch{}return!!e.webdriver},Sg=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function XA(e,t,n){return Pc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var n6={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Sg(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Sg(n,r))))),icontains:(e,t)=>t.map(Op).some((n=>e.map(Op).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(Op).every((n=>e.map(Op).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r>parseFloat(o)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r<parseFloat(o)))}))},Op=e=>e.toLowerCase();function r6(e,t){return!e||Object.entries(e).every((n=>{var[r,o]=n,s=t?.[r];if(ze(s)||ys(s))return!1;var l=[String(s)],c=n6[o.operator];return!!c&&c(o.values,l)}))}var Q1="custom",JA="i.posthog.com",Sre=/^\/static\//;class Ere{constructor(t){this.ki={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+JA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Q1),this.ki[this.apiHost]}Ti(t){var n=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof n=="string"&&Sre.test(t))return n.trim().replace(/\/$/,"")||void 0}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(t==="assets"){var r=this.Ti(n);if(r)return""+r+n}if(this.region===Q1)return this.apiHost+n;var o=JA+n;switch(t){case"assets":return"https://"+this.region+"-assets."+o;case"api":return"https://"+this.region+"."+o}}}var Xt=mn("[Surveys]"),X1="seenSurvey_",xre=[rb.Popover,rb.Widget,rb.API],Rre={ignoreConditions:!1,ignoreDelay:!1,displayType:G1.Popover},Ore=mn("[PostHog ExternalIntegrations]"),Tre={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Cre{constructor(t){this._instance=t}ur(t,n){var r;(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(o=>{if(o)return Ore.error("failed to load script",o);n()}))}startIfEnabledOrStop(){var t=this,n=function(l){var c,d,f;!o||(c=We.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[l]||t.ur(Tre[l],(()=>{var p;(p=We.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[l])==null||p.start(t._instance)})),!o&&(d=We.__PosthogExtensions__)!=null&&(d=d.integrations)!=null&&d[l]&&((f=We.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[l])==null||f.stop())};for(var[r,o]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var gc,Ud={},cb=0,J1=()=>{},eI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',md="Surveys module not available",tI="sanitize_properties is deprecated. Use before_send instead",o6="Invalid value for property_denylist config: ",xc="posthog",i6=!mre&&Yr?.indexOf("MSIE")===-1&&Yr?.indexOf("Mozilla")===-1,nI=e=>{var t;return Ne({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hne(Le?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:J1,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:pr&&_n(pr?.search)&&pr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(me==null||(t=me.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){$e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:H1,before_send:void 0,request_queue_config:{flush_interval_ms:W1},error_tracking:{},_onCapture:J1,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Are=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],rI=e=>{var t={};for(var[n,r]of Are)ze(e[n])||(t[r]=e[n]);var o=Rn({},t,e);return Pt(e.property_blacklist)&&(ze(e.property_denylist)?o.property_denylist=e.property_blacklist:Pt(e.property_denylist)?o.property_denylist=[...e.property_blacklist,...e.property_denylist]:$e.error(o6+e.property_denylist)),o};class Ire{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(t){$e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class $o{Ei(t,n){if(t){var r=this.Ri.indexOf(t);r!==-1&&this.Ri.splice(r,1)}return this.Ri.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===as||this.config.cookieless_mode===Qa&&this.consent.isRejected()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new Ire,this.Mi=!1,this.version=$r.LIB_VERSION,this.Fi=new QS,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nI(),this.SentryIntegration=tre,this.sentryIntegration=r=>(function(o,s){var l=U5(o,s);return{name:z5,processEvent:c=>l(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new bre(this),this.pageViewManager=new UA(this),this.rateLimiter=new cre(this),this.requestRouter=new Ere(this),this.consent=new Xne(this),this.externalIntegrations=new Cre(this);var n=(t=$o.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(l),s?.({})},set_once:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(r=>$e.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==xc){var o,s=(o=Ud[r])!==null&&o!==void 0?o:new $o;return s._init(t,n,r),Ud[r]=s,Ud[xc][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var o,s;if(n===void 0&&(n={}),ze(t)||Rm(t))return $e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Bi(n.debug),this.ji=n,this.$i=[],n.person_profiles?this.Li=n.person_profiles:n.process_person&&(this.Li=n.process_person),this.set_config(Rn({},nI(n.defaults),rI(n),{name:r,token:t})),this.config.on_xhr_error&&$e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yi.GZipJS;var l=this.qi();this.persistence=new nb(this.config,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nb(Ne({},this.config,{persistence:"sessionStorage"}),l);var c=Ne({},this.persistence.props),d=Ne({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new vre((x=>this.Vi(x)),this.config.request_queue_config),this.Hi=new _re(this),this.__request_queue=[];var f=this.Ni();if(f||(this.sessionManager=new QA(this),this.sessionPropsManager=new WA(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(f)}),0)):($e.info("Initializing extensions synchronously"),this.zi(f)),$r.DEBUG=$r.DEBUG||this.config.debug,$r.DEBUG&&$e.info("Starting in debug mode",{this:this,config:n,thisC:Ne({},this.config),p:c,s:d}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=Ne({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var p=n.bootstrap.distinctID,h=this.get_distinct_id(),g=this.persistence.get_property(ei);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===hc)this.identify(p);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===pc)$e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(na()),_=n.bootstrap.isIdentifiedID?v:p;this.persistence.set_property(ei,n.bootstrap.isIdentifiedID?pc:hc),this.register({distinct_id:p,$device_id:_})}}if(f)this.register_once({distinct_id:wp,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(na());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ei,hc)}return Vn(me,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(x,S){var E=x.config.segment;if(!E)return S();(function(T,R){var O=T.config.segment;if(!O)return R();var A=P=>{var L=()=>P.anonymousId()||na();T.config.get_device_id=L,P.id()&&(T.register({distinct_id:P.id(),$device_id:L()}),T.persistence.set_property(ei,pc)),R()},I=O.user();"then"in I&&is(I.then)?I.then(A):A(I)})(x,(()=>{E.register((T=>{Promise&&Promise.resolve||tb.warn("This browser does not have Promise support, and can not use the segment integration");var R=(O,A)=>{if(!A)return O;O.event.userId||O.event.anonymousId===T.get_distinct_id()||(tb.info("No userId set, resetting PostHog"),T.reset()),O.event.userId&&O.event.userId!==T.get_distinct_id()&&(tb.info("UserId set, identifying with PostHog"),T.identify(O.event.userId));var I=T.calculateEventProperties(A,O.event.properties);return O.event.properties=Object.assign({},I,O.event.properties),O};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:O=>R(O,O.event.event),page:O=>R(O,Ec),identify:O=>R(O,J_),screen:O=>R(O,"$screen")}})(x)).then((()=>{S()}))}))})(this,(()=>this.Ui())):this.Ui(),is(this.config._onCapture)&&this.config._onCapture!==J1&&($e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(x=>this.config._onCapture(x.event,x)))),this.config.ip&&$e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n,r,o,s,l,c,d,f=performance.now(),p=Ne({},$o.__defaultExtensionClasses,this.config.__extensionClasses),h=[];p.featureFlags&&this.Ri.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ri.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ri.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ri.push(new p.tracingHeaders(this)),p.siteApps&&this.Ri.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ri.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ri.push(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new p.surveys(this)),p.logs&&this.Ri.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new p.logs(this)),p.conversations&&this.Ri.push(this.conversations=(l=this.conversations)!==null&&l!==void 0?l:new p.conversations(this)),p.productTours&&this.Ri.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ri.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ri.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,ere)),p.toolbar&&this.Ri.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ri.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ri.forEach((g=>{g.initialize&&h.push((()=>{g.initialize==null||g.initialize()}))})),h.push((()=>{if(this.Yi){var g=this.Yi;this.Yi=void 0,this.Nr(g)}})),this.Gi(h,f)}Gi(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){$e.error("Error initializing extension:",s)}}var o=Math.round(performance.now()-n);this.register_for_session({[k5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[D5]:o}),this.config.__preview_deferred_init_extensions&&$e.info("PostHog extensions initialized ("+o+"ms)")}Nr(t){var n;if(!Le||!Le.body)return $e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=t),this.Wi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=wt(t.supportedCompression,yi.GZipJS)?yi.GZipJS:wt(t.supportedCompression,yi.Base64)?yi.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:H1}),this.Ri.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ui(){try{this.config.loaded(this)}catch(r){$e.critical("`loaded` function failed",r)}if(this.Xi(),this.config.internal_or_test_user_hostname&&pr!=null&&pr.hostname){var t=pr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new Z5(this),this.Ki.load()}Xi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Zi)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Sp(this.__request_queue,(t=>this.Vi(t))),this.__request_queue=[],this.Xi()}_handle_unload(){var t,n,r,o;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(X_),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Zi)==null||r.unload(),(o=this.Hi)==null||o.unload()):this.Qi()&&this.capture(X_,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(i6?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=sv(t.url,{ip:this.config.ip?1:0}),t.headers=Ne({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,o,s,l=Ne({},n);l.timeout=l.timeout||6e4,l.url=YA(l.url,l.compression);var c=(r=l.transport)!==null&&r!==void 0?r:"fetch",d=Am.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),f=(o=(s=(function(p,h){for(var g=0;p.length>g;g++)if(p[g].transport===c)return p[g]})(d))==null?void 0:s.method)!==null&&o!==void 0?o:d[0].method;if(!f)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===yi.GZipJS&&tne&&!ZA?gre(l).then((p=>{f(p)})).catch((p=>{if((h=>!(!h||typeof h!="object")&&("name"in h?String(h.name):"")==="NotReadableError")(p))return ZA=!0,void f(Ne({},l,{compression:void 0,url:YA(n.url,void 0)}));f(l)})):f(l)})(Ne({},t,{callback:n=>{var r,o;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(o=this.config).on_request_error)==null||r.call(o,n),t.callback==null||t.callback(n)}}))))}Vi(t){this.Hi?this.Hi.retriableRequest(t):this._send_request(t)}_execute_array(t){cb++;try{var n,r=[],o=[],s=[];Sp(t,(c=>{c&&(Pt(n=c[0])?s.push(c):is(c)?c.call(this):Pt(c)&&n==="alias"?r.push(c):Pt(c)&&n.indexOf("capture")!==-1&&is(this[n])?s.push(c):o.push(c))}));var l=function(c,d){Sp(c,(function(f){if(Pt(f[0])){var p=d;dn(f,(function(h){p=p[h[0]].apply(p,h.slice(1))}))}else d[f[0]].apply(d,f.slice(1))}))};l(r,this),l(o,this),l(s,this)}finally{cb--}}push(t){if(cb>0&&Pt(t)&&_n(t[0])){var n=$o.prototype[t[0]];is(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var o,s,l,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!ze(t)&&_n(t)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!_n(n?.$current_url)&&($e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.en||$e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,g=r?.timestamp||h,v=na(),_={uuid:v,event:t,properties:this.calculateEventProperties(t,n||{},g,v)};t===Ec&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),r?.$set&&(_.$set=r?.$set);var b,x,S,E=this.tn(r?.$set_once,t!==LA,t===J_);if(E&&(_.$set_once=E),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,l=_,c=L=>_n(L)?L.slice(0,s):L,d=new Set,_=(function L(q,j){return q!==Object(q)?c?c(q):q:d.has(q)?void 0:(d.add(q),Pt(q)?(B=[],Sp(q,(F=>{B.push(L(F))}))):(B={},dn(q,((F,Z)=>{d.has(F)||(B[Z]=L(F))}))),B);var B})(l)),_.timestamp=g,ze(r?.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=h),t===Pd.DISMISSED||t===Pd.SENT){var T=n?.[ob.SURVEY_ID],R=n?.[ob.SURVEY_ITERATION];(L=>{try{var q=(j=>((B,F)=>{var Z=""+X1+F.id;return F.current_iteration&&F.current_iteration>0&&(Z=""+X1+F.id+"_"+F.current_iteration),Z})(0,j))(L);if(localStorage.getItem(q))return;localStorage.setItem(q,"true")}catch(j){Xt.error("Failed to persist survey seen state",j)}})({id:T,current_iteration:R}),_.$set=Ne({},_.$set,{[(b={id:T,current_iteration:R},x=t===Pd.SENT?"responded":"dismissed",S="$survey_"+x+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(S="$survey_"+x+"/"+b.id+"/"+b.current_iteration),S)]:!0})}else t===Pd.SHOWN&&(_.$set=Ne({},_.$set,{[ob.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===lre.SHOWN){var O=n?.[BA.TOUR_TYPE];O&&(_.$set=Ne({},_.$set,{[BA.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=Ne({},_.properties.$set,_.$set);if(Ic(A)||this.setPersonPropertiesForFlags(A),!St(this.config.before_send)){var I=this.rn(_);if(!I)return;_=I}this.Fi.emit("eventCaptured",_);var P={method:"POST",url:(o=r?._url)!==null&&o!==void 0?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Vi(P):this.Zi.enqueue(P),_}$e.critical("This capture call is ignored due to client rate limiting.")}}else $e.error("No event name provided to posthog.capture")}else $e.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,o,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(t),c=Ne({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),t==="$snapshot"){var d=Ne({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!_n(c.distinct_id)&&!Fo(c.distinct_id)||Rm(c.distinct_id))&&$e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,p=(function(S,E){var T,R,O,A;if(!Yr)return{};var I,P,L,q,j,B,F,Z,ie=S?[...Qc,...E||[]]:[],[H,W]=(function(te){for(var le=0;PA.length>le;le++){var[Q,k]=PA[le],G=Q.exec(te),V=G&&(is(k)?k(G,te):k);if(V)return V}return["",""]})(Yr);return Rn(ZS({$os:H,$os_version:W,$browser:S5(Yr,navigator.vendor),$device:NA(Yr),$device_type:(P=Yr,L={userAgentDataPlatform:(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,maxTouchPoints:(R=navigator)==null?void 0:R.maxTouchPoints,screenWidth:me==null||(O=me.screen)==null?void 0:O.width,screenHeight:me==null||(A=me.screen)==null?void 0:A.height,devicePixelRatio:me?.devicePixelRatio},Z=NA(P),Z===l5||Z===a5||Z==="Kobo"||Z==="Kindle Fire"||Z===w5?Zc:Z===of||Z===Fc||Z===sf||Z===E1?"Console":Z===u5?"Wearable":Z?yo:L?.userAgentDataPlatform==="Android"&&((q=L?.maxTouchPoints)!==null&&q!==void 0?q:0)>0?600>Math.min((j=L?.screenWidth)!==null&&j!==void 0?j:0,(B=L?.screenHeight)!==null&&B!==void 0?B:0)/((F=L?.devicePixelRatio)!==null&&F!==void 0?F:1)?yo:Zc:"Desktop"),$timezone:K5(),$timezone_offset:sre()}),{$current_url:af(pr?.href,ie,lf),$host:pr?.host,$pathname:pr?.pathname,$raw_user_agent:Yr.length>1e3?Yr.substring(0,997)+"...":Yr,$browser_version:vne(Yr,navigator.vendor),$browser_language:FA(),$browser_language_prefix:(I=FA(),typeof I=="string"?I.split("-")[0]:void 0),$screen_height:me?.screen.height,$screen_width:me?.screen.width,$viewport_height:me?.innerHeight,$viewport_width:me?.innerWidth,$lib:$r.LIB_NAME,$lib_version:$r.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());c.$session_id=h,c.$window_id=g}this.sessionPropsManager&&Rn(c,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Rn(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(v=this.Hi)==null?void 0:v.length}catch(S){c.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Q1&&(c.$lib_custom_api_host=this.config.api_host),f=t!==Ec||s?t!==X_||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,o),c=Rn(c,f),t===Ec&&Le&&(c.title=Le.title),!ze(l)){var _=r.getTime()-l;c.$duration=parseFloat((_/1e3).toFixed(3))}Yr&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Rn({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),Pt(this.config.property_denylist)?dn(this.config.property_denylist,(function(S){delete c[S]})):$e.error(o6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&($e.error(tI),c=b(c,t));var x=this.nn();return c.$process_person_profile=x,x&&!s&&this.sn("_calculate_event_properties"),c}tn(t,n,r){var o;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.nn()||this.Mi&&!r)return t;var s=this.persistence.get_initial_props(),l=(o=this.sessionPropsManager)==null?void 0:o.getSetOnceProps(),c=Rn({},s,l||{},t||{}),d=this.config.sanitize_properties;return d&&($e.error(tI),c=d(c,"$set_once")),n&&(this.Mi=!0),Ic(c)?void 0:c}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var o;(o=this.persistence)==null||o.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}an(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var o;(o=this.featureFlags)==null||o.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var o;(o=this.featureFlags)==null||o.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var o;return n===void 0&&(n=!1),(o=this.featureFlags)==null?void 0:o.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Fi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:md}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:md})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:md})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=Rre),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:md}}canRenderSurveyAsync(t,n){var r,o;return n===void 0&&(n=!1),(r=(o=this.surveys)==null?void 0:o.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:md})}ln(t){return!t||Rm(t)?($e.critical("Unique user id has not been set in posthog.identify"),!1):t===wp?($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return $e.uninitializedWarning("posthog.identify");if(Fo(t)&&(t=t.toString(),$e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(t)&&this.sn("posthog.identify")){var o=this.get_distinct_id();this.register({$user_id:t}),this.get_property(cg)||this.register_once({$had_persisted_distinct_id:!0,$device_id:o},""),t!==o&&t!==this.get_property(Td)&&(this.unregister(Td),this.register({distinct_id:t}));var s,l=(this.persistence.get_property(ei)||hc)===hc;t!==o&&l?(this.persistence.set_property(ei,pc),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(J_,{distinct_id:t,$anon_distinct_id:o},{$set:n||{},$set_once:r||{}}),this.Di=XA(t,n,r),(s=this.featureFlags)==null||s.setAnonymousDistinctId(o)):(n||r)&&this.setPersonProperties(n,r),t!==o&&(this.reloadFeatureFlags(),this.unregister(jd))}}setPersonProperties(t,n){if((t||n)&&this.sn("posthog.setPersonProperties")){var r=XA(this.get_distinct_id(),t,n);this.Di!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Di=r):$e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var o=this.getGroups(),s=o[t]!==n;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ne({},o,{[t]:n})}),s||r){var l={$group_type:t,$group_key:n};r&&(l.$group_set=r),this.capture(LA,l)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else $e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,o,s,l,c,d,f;if($e.info("reset"),!this.__loaded)return $e.uninitializedWarning("posthog.reset");var p=this.get_property(cg);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(o=this.surveys)==null||o.reset(),(s=this.Ki)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(d=this.persistence)==null||d.set_property(ei,hc),(f=this.sessionManager)==null||f.resetSessionId(),this.Di=null,this.config.cookieless_mode===as)this.register_once({distinct_id:wp,$device_id:null},"");else{var h=this.config.get_device_id(na());this.register_once({distinct_id:h,$device_id:t?h:p},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.un()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),o=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,l=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return o;o+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-l,0)}return o}alias(t,n){return t===this.get_property(C5)?($e.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(ze(n)&&(n=this.get_distinct_id()),t!==n?(this.an(Td,t),this.capture("$create_alias",{alias:t,distinct_id:n})):($e.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ne({},this.config);if(An(t)){var r,o,s,l,c,d,f,p,h,g;Rn(this.config,rI(t));var v=this.qi();(r=this.persistence)==null||r.update_config(this.config,n,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nb(Ne({},this.config,{persistence:"sessionStorage"}),v);var _=this.Bi(this.config.debug);xi(_)&&(this.config.debug=_),xi(this.config.debug)&&(this.config.debug?($r.DEBUG=!0,yn.R()&&yn.M("ph_debug",!0),$e.info("set_config",{config:t,oldConfig:n,newConfig:Ne({},this.config)})):($r.DEBUG=!1,yn.R()&&yn.F("ph_debug"))),(o=this.exceptionObserver)==null||o.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(f=this.exceptionObserver)==null||f.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.cn(),(g=this.externalIntegrations)==null||g.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){$r.LIB_NAME=t,$r.LIB_VERSION=n}startSessionRecording(t){var n,r,o,s,l,c=t===!0,d={sampling:c||!(t==null||!t.sampling),linked_flag:c||!(t==null||!t.linked_flag),url_trigger:c||!(t==null||!t.url_trigger),event_trigger:c||!(t==null||!t.event_trigger)};Object.values(d).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),d.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),d.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),d.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),d.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),o=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ne({},o,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:$o.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:xc;return n!==xc&&(n=xc+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(ei))===pc||((n=this.sessionPersistence)==null?void 0:n.get_property(ei))===pc}nn(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===H1&&!this._isIdentified()&&Ic(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Td])&&((n=this.persistence)==null||(n=n.props)==null||!n[hg]))}Qi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return this.config.person_profiles==="never"?($e.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(hg,!0),!0)}qi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Qa)}cn(){var t,n,r,o,s=this.qi();return((t=this.persistence)==null?void 0:t._r)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n._r)!==s&&((o=this.sessionPersistence)==null||o.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==as){if(this.Ni()){var r,o,s,l,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(o=this.pageViewManager)==null||o.destroy(),this.sessionManager=new QA(this),this.pageViewManager=new UA(this),this.persistence&&(this.sessionPropsManager=new WA(this,this.sessionManager,this.persistence));var d,f=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=$o.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ei(this.sessionRecording,new f(this)),this.Wi&&((d=this.sessionRecording)==null||d.onRemoteConfig==null||d.onRemoteConfig(this.Wi)))}var p,h;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Qa&&((p=this.surveys)==null||p.loadIfEnabled()),(ze(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t?.captureEventName)!==null&&h!==void 0?h:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else $e.warn(eI)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==as?(this.config.cookieless_mode===Qa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Qa&&(this.register({distinct_id:wp,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):$e.warn(eI)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===as||(this.config.cookieless_mode===Qa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return go?t6(go,this.config.custom_blocked_useragents):void 0}Ji(){Le&&(Le.visibilityState==="visible"?this.Oi||(this.Oi=!0,this.capture(Ec,{title:Le.title},{send_instantly:!0}),this.Pi&&(Le.removeEventListener(pg,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),Vn(Le,pg,this.Pi)))}debug(t){t===!1?(me?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(me?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var t,n,r,o,s,l,c=this.ji||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",o=$e,s=(n="advanced_disable_flags")in(t=c)&&!St(t[n]),l=r in t&&!St(t[r]),s?t[n]:!!l&&(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(St(this.config.before_send))return t;var n=Pt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var o of n){if(r=o(r),St(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return ine(t.event)?$e.warn(s+". This can cause unexpected behavior."):$e.info(s),null}r.properties&&!Ic(r.properties)||$e.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.dr)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Bi(t){var n=xi(t)&&!t,r=yn.R()&&yn.O("ph_debug")==="true";return!n&&(!!r||t)}}function oI(e){return e instanceof Element&&(e.id===N5||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function av(e){return!!e&&e.nodeType===1}function ua(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function s6(e){return!!e&&e.nodeType===3}function a6(e){return!!e&&e.nodeType===11}function XS(e){return e?ov(e).split(/\s+/):[]}function iI(e){var t=me?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Eg(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return XS(t)}function l6(e){return St(e)?null:ov(e).split(/(\s+)/).filter((t=>Fd(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function cf(e){var t="";return tw(e)&&!u6(e)&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;s6(n)&&n.textContent&&(t+=(r=l6(n.textContent))!==null&&r!==void 0?r:"")})),ov(t)}function sI(e){return ze(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}$o.__defaultExtensionClasses={},$o.dn={trace:gc=()=>{},debug:gc,info:gc,warn:gc,error:gc,fatal:gc},(function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Vne(e.prototype[t[n]])})($o,["identify"]);var JS=["a","button","form","input","select","textarea","label"];function aI(e,t){if(ze(t))return!0;var n,r=function(s){if(t.some((l=>s.matches(l))))return{v:!0}};for(var o of e)if(n=r(o))return n.v;return!1}function c6(e){var t=e.parentNode;return!(!t||!av(t))&&t}var Mre=["next","previous","prev",">","<"],lI=[".ph-no-rageclick",".ph-no-capture"],ew=e=>!e||ua(e,"html")||!av(e),cI=(e,t)=>{if(!me||ew(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],o=e;o.parentNode&&!ua(o,"body");)if(a6(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{var s=c6(o);if(!s)break;if(t||JS.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var l=me.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),o=s}return{parentIsUsefulElement:n,targetElementList:r}};function tw(e){for(var t=e;t.parentNode&&!ua(t,"body");t=t.parentNode){var n=Eg(t);if(wt(n,"ph-sensitive")||wt(n,"ph-no-capture"))return!1}if(wt(Eg(e),"ph-include"))return!0;var r=e.type||"";if(_n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!_n(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function u6(e){return!!(ua(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ua(e,"select")||ua(e,"textarea")||e.getAttribute("contenteditable")==="true")}var d6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Pre=new RegExp("^(?:"+d6+")$"),Nre=new RegExp(d6),f6="\\d{3}-?\\d{2}-?\\d{4}",kre=new RegExp("^("+f6+")$"),Dre=new RegExp("("+f6+")");function Fd(e,t){return t===void 0&&(t=!0),!(St(e)||_n(e)&&(e=ov(e),(t?Pre:Nre).test((e||"").replace(/[- ]/g,""))||(t?kre:Dre).test(e)))}function uI(e){var t=cf(e);return Fd(t=(t+" "+h6(e)).trim())?t:""}function h6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var o=cf(n);t=(t+" "+o).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+h6(n)).trim())}catch(s){$e.error("[AutoCapture]",s)}})),t}function dI(e){return e.replace(/"|\\"/g,'\\"')}function Lre(e){var t=e.attr__class;return t?Pt(t)?t:XS(t):void 0}class fI{constructor(t){this.disabled=t===!1;var n=An(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var o=this.clicks[this.clicks.length-1];if(o&&Math.abs(t-o.x)+Math.abs(n-o.y)<this.thresholdPx&&this.timeoutMs>r-o.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var ub="$copy_autocapture",hI=mn("[AutoCapture]");function db(e,t){return t.length>e?t.slice(0,e)+"...":t}function $re(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!av(t));return t}function jre(e,t){for(var n,r,{e:o,maskAllElementAttributes:s,maskAllText:l,elementAttributeIgnoreList:c,elementsChainAsString:d}=t,f=[e],p=e;p.parentNode&&!ua(p,"body");)a6(p.parentNode)?(f.push(p.parentNode.host),p=p.parentNode.host):(f.push(p.parentNode),p=p.parentNode);var h,g,v=[],_={},b=!1,x=!1;if(dn(f,(O=>{var A=tw(O);O.tagName.toLowerCase()==="a"&&(b=O.getAttribute("href"),b=A&&b&&Fd(b)&&b),wt(Eg(O),"ph-no-capture")&&(x=!0),v.push((function(P,L,q,j){var B=P.tagName.toLowerCase(),F={tag_name:B};JS.indexOf(B)>-1&&!q&&(F.$el_text=B.toLowerCase()==="a"||B.toLowerCase()==="button"?db(1024,uI(P)):db(1024,cf(P)));var Z=Eg(P);Z.length>0&&(F.classes=Z.filter((function(te){return te!==""}))),dn(P.attributes,(function(te){var le;if((!u6(P)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(j==null||!j.includes(te.name))&&!L&&Fd(te.value)&&(!_n(le=te.name)||le.substring(0,10)!=="_ngcontent"&&le.substring(0,7)!=="_nghost")){var Q=te.value;te.name==="class"&&(Q=XS(Q).join(" ")),F["attr__"+te.name]=db(1024,Q)}}));for(var ie=1,H=1,W=P;W=$re(W);)ie++,W.tagName===P.tagName&&H++;return F.nth_child=ie,F.nth_of_type=H,F})(O,s,l,c));var I=(function(P){if(!tw(P))return{};var L={};return dn(P.attributes,(function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var j=q.name.replace("data-ph-capture-attribute-",""),B=q.value;j&&B&&Fd(B)&&(L[j]=B)}})),L})(O);Rn(_,I)})),x)return{props:{},explicitNoCapture:x};if(l||(v[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?uI(e):cf(e)),b){var S,E;v[0].attr__href=b;var T=(S=vg(b))==null?void 0:S.host,R=me==null||(E=me.location)==null?void 0:E.host;T&&R&&T!==R&&(h=b)}return{props:Rn({$event_type:o.type,$ce_version:1},d?{}:{$elements:v},{$elements_chain:(g=v,(function(O){return O.map((A=>{var I,P,L="";if(A.tag_name&&(L+=A.tag_name),A.attr_class)for(var q of(A.attr_class.sort(),A.attr_class))L+="."+q.replace(/"/g,"");var j=Ne({},A.text?{text:A.text}:{},{"nth-child":(I=A.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(P=A.nth_of_type)!==null&&P!==void 0?P:0},A.href?{href:A.href}:{},A.attr_id?{attr_id:A.attr_id}:{},A.attributes),B={};return Cm(j).sort(((F,Z)=>{var[ie]=F,[H]=Z;return ie.localeCompare(H)})).forEach((F=>{var[Z,ie]=F;return B[dI(Z.toString())]=dI(ie.toString())})),(L+=":")+Cm(B).map((F=>{var[Z,ie]=F;return Z+'="'+ie+'"'})).join("")})).join(";")})((function(O){return O.map((A=>{var I,P,L={text:(I=A.$el_text)==null?void 0:I.slice(0,400),tag_name:A.tag_name,href:(P=A.attr__href)==null?void 0:P.slice(0,2048),attr_class:Lre(A),attr_id:A.attr__id,nth_child:A.nth_child,nth_of_type:A.nth_of_type,attributes:{}};return Cm(A).filter((q=>{var[j]=q;return j.indexOf("attr__")===0})).forEach((q=>{var[j,B]=q;return L.attributes[j]=B})),L}))})(g)))},(n=v[0])!=null&&n.$el_text?{$el_text:(r=v[0])==null?void 0:r.$el_text}:{},h&&o.type==="click"?{$external_click_url:h}:{},_)}}var gd=mn("[ExceptionAutocapture]");function pI(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],o=n(r);return is(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var zre=mn("[TracingHeaders]"),Zs=mn("[Web Vitals]"),mI=9e5,gI="disabled",vI="lazy_loading",vd="awaiting_config",Tp="missing_config";mn("[SessionRecording]"),mn("[SessionRecording]");var nw="[SessionRecording]",Ys=mn(nw),Ure=mn("[Heatmaps]");function yI(e){return An(e)&&"clientX"in e&&"clientY"in e&&Fo(e.clientX)&&Fo(e.clientY)}var _I=mn("[Product Tours]"),Fre=["$set_once","$set"],Ws=mn("[SiteApps]"),bI="Error while initializing PostHog app with config id ";function vc(e,t,n){if(St(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Bre{constructor(t){this.vn=new QS,this.fn=(n,r)=>this.pn(n,r)&&this.gn(n,r)&&this.mn(n,r)&&this.yn(n,r),this.pn=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,n;ze((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,o)=>{this.on(r,o)}))}register(t){var n,r;if(!ze((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((l=>{var c,d;(c=this._n)==null||c.add(l),(d=l.steps)==null||d.forEach((f=>{var p;(p=this.bn)==null||p.add(f?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var o,s=new Set;t.forEach((l=>{var c;(c=l.steps)==null||c.forEach((d=>{d!=null&&d.selector&&s.add(d?.selector)}))})),(o=this._instance)==null||o.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.bn.has(t)||this.bn.has(n?.event))&&this._n&&((r=this._n)==null?void 0:r.size)>0&&this._n.forEach((o=>{this.wn(n,o)&&this.vn.emit("actionCaptured",o.name)}))}In(t){this.onAction("actionCaptured",(n=>t(n)))}wn(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.fn(t,r))return!0;return!1}onAction(t,n){return this.vn.on(t,n)}gn(t,n){if(n!=null&&n.url){var r,o=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!o||typeof o!="string"||!vc(o,n.url,n.url_matching||"contains"))return!1}return!0}mn(t,n){return!!this.Cn(t,n)&&!!this.Sn(t,n)&&!!this.xn(t,n)}Cn(t,n){var r;if(n==null||!n.href)return!0;var o=this.kn(t);if(o.length>0)return o.some((c=>vc(c.href,n.href,n.href_matching||"exact")));var s,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&vc((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Sn(t,n){var r;if(n==null||!n.text)return!0;var o=this.kn(t);if(o.length>0)return o.some((f=>vc(f.text,n.text,n.text_matching||"exact")||vc(f.$el_text,n.text,n.text_matching||"exact")));var s,l,c,d=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!d&&(s=(function(f){for(var p,h=[],g=/(?::|")text="(.*?)"/g;!St(p=g.exec(f));)h.includes(p[1])||h.push(p[1]);return h})(d),l=n.text,c=n.text_matching||"exact",s.some((f=>vc(f,l,c))))}xn(t,n){var r,o;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(t==null||(o=t.properties)==null?void 0:o.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}kn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}yn(t,n){return n==null||!n.properties||n.properties.length===0||r6(n.properties.reduce(((r,o)=>{var s=Pt(o.value)?o.value.map(String):o.value!=null?[String(o.value)]:[];return r[o.key]={values:s,operator:o.operator||"exact"},r}),{}),t?.properties)}}class Vre{constructor(t){this._instance=t,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(t,n){return!!t&&r6(t.propertyFilters,n?.properties)}Nn(t,n){var r=new Map;return t.forEach((o=>{var s;(s=o.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=r.get(l.name)||[];c.push(o.id),r.set(l.name,c)}}))})),r}Mn(t,n,r){var o=(r===dd.Activation?this.Tn:this.An).get(t),s=[];return this.Fn((l=>{s=l.filter((c=>o?.includes(c.id)))})),s.filter((l=>{var c,d=(c=l.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===t));return this.Rn(d,n)}))}register(t){var n;ze((n=this._instance)==null?void 0:n._addCaptureHook)||(this.On(t),this.Pn(t))}Pn(t){var n=t.filter((r=>{var o,s;return((o=r.conditions)==null?void 0:o.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Ln==null&&(this.Ln=new Bre(this._instance),this.Ln.init(),this.Ln.In((r=>{this.onAction(r)}))),n.forEach((r=>{var o,s,l,c,d;r.conditions&&(o=r.conditions)!=null&&o.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Ln)==null||c.register(r.conditions.actions.values),(d=r.conditions)==null||(d=d.actions)==null||(d=d.values)==null||d.forEach((f=>{if(f&&f.name){var p=this.En.get(f.name);p&&p.push(r.id),this.En.set(f.name,p||[r.id])}})))})))}On(t){var n,r=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),o=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&o.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Tn=this.Nn(t,dd.Activation),this.An=this.Nn(t,dd.Cancellation))}onEvent(t,n){var r,o=this.le(),s=this.Dn(),l=this.Bn(),c=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(l===t&&n&&c.length>0){var d,f;o.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:c});var p=(n==null||(d=n.properties)==null?void 0:d.$survey_id)||(n==null||(f=n.properties)==null?void 0:f.$product_tour_id);if(p){var h=c.indexOf(p);0>h||(c.splice(h,1),this.jn(c))}}else{if(this.An.has(t)){var g=this.Mn(t,n,dd.Cancellation);g.length>0&&(o.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((_=>_.id))}),g.forEach((_=>{var b=c.indexOf(_.id);0>b||c.splice(b,1),this.$n(_.id)})),this.jn(c))}if(this.Tn.has(t)){o.info("event name matched",{event:t,eventPayload:n,items:this.Tn.get(t)});var v=this.Mn(t,n,dd.Activation);this.jn(c.concat(v.map((_=>_.id))||[]))}}}onAction(t){var n,r=this.Dn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.En.has(t)&&this.jn(o.concat(this.En.get(t)||[]))}jn(t){var n=this.le(),r=[...new Set(t)].filter((o=>!this.qn(o)));n.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var t,n=this.Dn();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.Tn}Vn(){return this.Ln}}class qre extends Vre{constructor(t){super(t)}Dn(){return j1}Bn(){return Pd.SHOWN}Fn(t){var n;(n=this._instance)==null||n.getSurveys(t)}$n(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}le(){return Xt}Zn(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[j1]:t})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var fb="SDK is not enabled or survey functionality is not yet loaded",wI="Disabled. Not loading surveys.",Hre=me!=null&&me.location?_g(me.location.hash,"__posthog")||_g(location.hash,"state"):null,SI="_postHogToolbarParams",EI=mn("[Toolbar]"),Nr=mn("[FeatureFlags]"),Ha=mn("[FeatureFlags]",{debugEnabled:!0}),hb=`" failed. Feature flags didn't load in time.`,xI=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},RI=e=>{var t={};for(var[n,r]of Cm(e||{}))r&&(t[n]=r);return t},es=mn("[Error tracking]"),OI="Refusing to render web experiment since the viewer is a likely bot",Gre={icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!me&&Sg(t.href,e),not_regex:(e,t)=>!!me&&!Sg(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Rr{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((o=>{Rr.Hn("retrieved web experiments from the server"),n.zn=new Map,o.forEach((s=>{if(s.feature_flag_key){var l;n.zn&&(Rr.Hn("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.zn)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);_n(c)&&s.variants[c]&&n.Un(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var d in s.variants){var f=s.variants[d];Rr.Yn(f)&&n.Un(s.name,d,f.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Rr.Hn(OI);else if(!this.Bt.disable_web_experiments){if(St(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.Hn("applying feature flags",t),t.forEach((n=>{var r;if(this.zn&&(r=this.zn)!=null&&r.has(n)){var o,s=this._instance.getFeatureFlag(n),l=(o=this.zn)==null?void 0:o.get(n);s&&l!=null&&l.variants[s]&&this.Un(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var t=Rr.getWindowLocation();if(t!=null&&t.search){var n=yg(t?.search,"__experiment_id"),r=yg(t?.search,"__experiment_variant");n&&r&&(Rr.Hn("previewing web experiments "+n+" && "+r),this.getWebExperiments((o=>{this.Gn(parseInt(n),r,o)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Bt.disable_web_experiments&&!r)return t([]);var o=this._instance.get_property("$web_experiments");if(o&&!n)return t(o);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Gn(t,n,r){var o=r.filter((s=>s.id===t));o&&o.length>0&&(Rr.Hn("Previewing web experiment ["+o[0].name+"] with variant ["+n+"]"),this.Un(o[0].name,n,o[0].variants[n].transforms))}static Yn(t){return!St(t.conditions)&&Rr.Wn(t)&&Rr.Xn(t)}static Wn(t){var n;if(St(t.conditions)||St((n=t.conditions)==null?void 0:n.url))return!0;var r,o,s,l=Rr.getWindowLocation();return!!l&&((r=t.conditions)==null||!r.url||Gre[(o=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l))}static getWindowLocation(){return me?.location}static Xn(t){var n;if(St(t.conditions)||St((n=t.conditions)==null?void 0:n.utm))return!0;var r=F5();if(r.utm_source){var o,s,l,c,d,f,p,h,g=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,v=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,_=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_medium||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,b=(p=t.conditions)==null||(p=p.utm)==null||!p.utm_term||((h=t.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return g&&_&&b&&v}return!1}static Hn(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];$e.info("[WebExperiments] "+t,r)}Un(t,n,r){this._is_bot()?Rr.Hn(OI):n!=="control"?r.forEach((o=>{if(o.selector){var s;Rr.Hn("applying transform of variant "+n+" for experiment "+t+" ",o);var l=(s=document)==null?void 0:s.querySelectorAll(o.selector);l?.forEach((c=>{var d=c;o.html&&(d.innerHTML=o.html),o.css&&d.setAttribute("style",o.css)}))}})):Rr.Hn("Control variants leave the page unmodified.")}_is_bot(){return go&&this._instance?t6(go,this.Bt.custom_blocked_useragents):void 0}}var ko=mn("[Conversations]"),Ga="Conversations not available yet.",lv={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return(e=(t=this.ni)==null?void 0:t.wr(this.Bt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Nr.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=(e=this.Bt.evaluation_contexts)!==null&&e!==void 0?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Nr.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Nr.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var o,s,l=(o=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&o!==void 0?o:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,p)=>(f[p]=r[p]||!1,f)),{}),d=Object.keys(l).filter((f=>c[f])).reduce(((f,p)=>(l[p]&&(f[p]=l[p]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:d})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},o=n!=null&&n.merge?this.getFlagPayloads():{},s=Ne({},r,e),l=Ne({},o,t),c={};for(var[d,f]of Object.entries(s)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:ze(l?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(k1),t=this.os(os),n=this.os(Sc);if(!n&&!t)return e||{};var r=Rn({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var l,c,d=r[s],f=t?.[s],p=ze(f)?(l=d?.enabled)!==null&&l!==void 0&&l:!!f,h=ze(f)?d.variant:typeof f=="string"?f:void 0,g=n?.[s],v=Ne({},d,{enabled:p,variant:p?h??d?.variant:void 0});p!==d?.enabled&&(v.original_enabled=d?.enabled),h!==d?.variant&&(v.original_variant=d?.variant),g&&(v.metadata=Ne({},d?.metadata,{payload:g,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),r[s]=v}return this.Jn||(Nr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Jn=!0),r}getFlagVariants(){var e=this.os(Mc),t=this.os(os);if(!t)return e||{};for(var n=Rn({},e),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Jn=!0),n}getFlagPayloads(){var e=this.os(D1),t=this.os(Sc);if(!t)return e||{};for(var n=Rn({},e||{}),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Jn=!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var n=this.Bt.token,r=this.os(cg),o={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ne({},((t=this.ni)==null?void 0:t.get_initial_props())||{},this.os(Md)||{}),group_properties:this.os(Wa),timezone:K5()};ys(r)||ze(r)||(o.$device_id=r),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.cs()&&(o.evaluation_contexts=this.hs());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:s,data:o,compression:this.Bt.disable_compression?void 0:yi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:l=>{var c,d,f,p=!0;if(l.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),p=!1),this.Qn=!1,!o.disable_flags||this.ts){this.rs=!p;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):l.statusCode!==200&&h.push("api_error_"+l.statusCode),(c=l.json)!=null&&c.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var g,v=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes("feature_flags"));v&&h.push("quota_limited"),(f=this.ni)==null||f.register({[U1]:h}),v?Nr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(o.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},p,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else Nr.warn('getFeatureFlag for key "'+e+hb)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,o=n[e],s=this.getFlagPayloads()[e],l=String(o),c=this.os(L1)||void 0,d=this.os(dg)||void 0,f=this.os(jd)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var p,h=this._instance.get_session_id(),g=this.os(z1);h&&h!==g&&(f={},(p=this.ni)==null||p.register({[jd]:f,[z1]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in f)||!f[e].includes(l))){var v,_,b,x,S,E,T,R,O,A;Pt(f[e])?f[e].push(l):f[e]=[l],(v=this.ni)==null||v.register({[jd]:f});var I=this.getFeatureFlagDetails(e),P=[...(_=this.os(U1))!==null&&_!==void 0?_:[]];ze(o)&&P.push("flag_missing");var L={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((b=this.Bt.bootstrap)==null||(b=b.featureFlags)==null?void 0:b[e])||null,$feature_flag_bootstrapped_payload:((x=this.Bt.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[e])||null,$used_bootstrap_value:!this.rs};ze(I==null||(S=I.metadata)==null?void 0:S.version)||(L.$feature_flag_version=I.metadata.version);var q,j=(E=I==null||(T=I.reason)==null?void 0:T.description)!==null&&E!==void 0?E:I==null||(R=I.reason)==null?void 0:R.code;j&&(L.$feature_flag_reason=j),I!=null&&(O=I.metadata)!=null&&O.id&&(L.$feature_flag_id=I.metadata.id),ze(I?.original_variant)&&ze(I?.original_enabled)||(L.$feature_flag_original_response=ze(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(A=I.metadata)!=null&&A.original_payload&&(L.$feature_flag_original_payload=I==null||(q=I.metadata)==null?void 0:q.original_payload),P.length&&(L.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",L)}if(r){var B=s;if(!ze(s))try{B=JSON.parse(s)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:B}}}}else Nr.warn('getFeatureFlagResult for key "'+e+hb)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Bt.disable_compression?void 0:yi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(o){var s,l=(s=o.json)==null?void 0:s.featureFlagPayloads;t(l?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return ze(n)?void 0:!!n}Nr.warn('isFeatureEnabled for key "'+e+hb)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),o=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,d,f,p,h){d===void 0&&(d={}),f===void 0&&(f={}),p===void 0&&(p={});var g=(P=>{var L=P.flags;return L?(P.featureFlags=Object.fromEntries(Object.keys(L).map((q=>{var j;return[q,(j=L[q].variant)!==null&&j!==void 0?j:L[q].enabled]}))),P.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter((q=>L[q].enabled)).filter((q=>{var j;return(j=L[q].metadata)==null?void 0:j.payload})).map((q=>{var j;return[q,(j=L[q].metadata)==null?void 0:j.payload]})))):Nr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),P})(l),v=g.flags,_=g.featureFlags,b=g.featureFlagPayloads;if(_){var x=l.requestId,S=l.evaluatedAt;if(Pt(_)){Nr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var E={};if(_)for(var T=0;_.length>T;T++)E[_[T]]=!0;c&&c.register({[Om]:_,[Mc]:E})}else{var R=_,O=b,A=v;if(h!=null&&h.partialResponse)R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);else if(l.errorsWhileComputingFlags)if(v){var I=new Set(Object.keys(v).filter((P=>{var L;return!((L=v[P])!=null&&L.failed)})));R=Ne({},d,Object.fromEntries(Object.entries(R).filter((P=>{var[L]=P;return I.has(L)})))),O=Ne({},f,Object.fromEntries(Object.entries(O||{}).filter((P=>{var[L]=P;return I.has(L)})))),A=Ne({},p,Object.fromEntries(Object.entries(A||{}).filter((P=>{var[L]=P;return I.has(L)}))))}else R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);c&&c.register(Ne({[Om]:Object.keys(RI(R)),[Mc]:R||{},[D1]:O||{},[k1]:A||{}},x?{[L1]:x}:{},S?{[dg]:S}:{}))}}})(e,this.ni,r,o,s,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Nr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Nr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.ni.unregister(os),this.ni.unregister(Sc),this.ps(),Ha.info("All overrides cleared");if(Pt(e)){var t=xI(e);return this.ni.register({[os]:t}),this.ps(),Ha.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ni.unregister(os),Ha.info("Flag overrides cleared");else if(r.flags){if(Pt(r.flags)){var o=xI(r.flags);this.ni.register({[os]:o})}else this.ni.register({[os]:r.flags});Ha.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ni.unregister(Sc),Ha.info("Payload overrides cleared")):r.payloads&&(this.ni.register({[Sc]:r.payloads}),Ha.info("Payload overrides set",{payloads:r.payloads}))),void this.ps()}if(e&&typeof e=="object")return this.ni.register({[os]:e}),this.ps(),Ha.info("Flag overrides set",{flags:e});Nr.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this.os(Id)||[]).find((d=>d.flagKey===e)),s={["$feature_enrollment/"+e]:t},l={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(l.$early_access_feature_name=o.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=Ne({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[Om]:Object.keys(RI(c)),[Mc]:c}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(Id),o=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+o),method:"GET",callback:s=>{var l,c;if(s.json){var d=s.json.earlyAccessFeatures;return(l=this.ni)==null||l.unregister(Id),(c=this.ni)==null||c.register({[Id]:d}),e(d)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Md)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),o=e?.$set_once,s={};if(o)for(var l in o)({}).hasOwnProperty.call(o,l)&&(l in n||(s[l]=o[l]));this._instance.register({[Md]:Ne({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Md)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Wa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Ne({},n[r],e[r]),delete e[r]})),this._instance.register({[Wa]:Ne({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(Wa)||{};this._instance.register({[Wa]:Ne({},t,{[e]:{}})})}else this._instance.unregister(Wa)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Kre={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){var e,t;return this.bs===vd||this.bs===Tp?this.bs:(e=(t=this.ys)==null?void 0:t.status)!==null&&e!==void 0?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=gI,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Ys.error("started without valid sessionManager"),new Error(nw+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===as)throw new Error(nw+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(Ad))==null||!e.enabled),n=!this.Bt.disable_session_recording,r=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return me&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!ze(Object.assign)&&!ze(Array.from);this.ws&&n?(this.Is(e),Ys.info("starting")):(this.bs=gI,this.stopRecording())}}Is(e){var t,n,r;this.ws&&(this.bs!==vd&&this.bs!==Tp&&(this.bs=vI),We!=null&&(t=We.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=We.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(o=>{if(o)return Ys.error("could not load recorder",o);this.Cs(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(GS)}Ts(e,t){if(St(e))return null;var n,r=Fo(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ys.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}As(e){if(this.ni){var t,n,r=this.ni,o=()=>{var s,l=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.Ts((s=this.Bt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),d=this.Ts(l?.sampleRate,"remote config sampleRate"),f=c??d;St(f)&&this.ks();var p=l?.minimumDurationMilliseconds;r.register({[Ad]:Ne({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:Ne({capturePerformance:e.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ze(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};o(),(t=this._s)==null||t.call(this),this._s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===vd&&(this.bs=Tp,Ys.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Ys.warn("log called before recorder was ready")}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ad);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Ad);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}Cs(e){var t,n;if((t=We.__PosthogExtensions__)==null||!t.initSessionRecording)return Ys.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[L5]:!0});if(this.ys||(this.ys=(n=We.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es())return this.bs===Tp||this.bs===vd?void 0:(this.bs=vd,Ys.info("persisted remote config is stale, requesting fresh config before starting"),void new Z5(this._instance).load());this.bs=vI,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[I5]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[A5]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e==="url"?M5:P5]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.ys)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},Zre={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new fI(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,n=An(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Os(){if(this.isBrowserSupported()){if(me&&Le){var e=n=>{n=n||me?.event;try{this.Ps(n)}catch(r){hI.error("Failed to capture event",r)}};if(Vn(Le,"submit",e,{capture:!0}),Vn(Le,"change",e,{capture:!0}),Vn(Le,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=n=>{this.Ps(n=n||me?.event,ub)};Vn(Le,"copy",t,{capture:!0}),Vn(Le,"cut",t,{capture:!0})}}}else hI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[O1]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((r=>{var o=Le?.querySelectorAll(r);o?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[O1];if(ys(this.Ns)&&!xi(n)&&!this.instance.Fr())return!1;var r=(t=this.Ns)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}Ps(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=sI(e);s6(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(h,g){if(!me||ew(h))return!1;var v,_,b;if(xi(g)?(v=!!g&&lI,_=void 0):(v=(b=g?.css_selector_ignorelist)!==null&&b!==void 0?b:lI,_=g?.content_ignorelist),v===!1)return!1;var{targetElementList:x}=cI(h,!1);return!(function(S,E){if(S===!1||ze(S))return!1;var T;if(S===!0)T=Mre;else{if(!Pt(S))return!1;if(S.length>10)return $e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;T=S.map((R=>R.toLowerCase()))}return E.some((R=>{var{safeText:O,ariaLabel:A}=R;return T.some((I=>O.includes(I)||A.includes(I)))}))})(_,x.map((S=>{var E;return{safeText:cf(S).toLowerCase(),ariaLabel:((E=S.getAttribute("aria-label"))==null?void 0:E.toLowerCase().trim())||""}})))&&!aI(x,v)})(r,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var o=t===ub;if(r&&(function(h,g,v,_,b){var x,S,E,T;if(v===void 0&&(v=void 0),!me||ew(h)||(x=v)!=null&&x.url_allowlist&&!iI(v.url_allowlist)||(S=v)!=null&&S.url_ignorelist&&iI(v.url_ignorelist))return!1;if((E=v)!=null&&E.dom_event_allowlist){var R=v.dom_event_allowlist;if(R&&!R.some((L=>g.type===L)))return!1}var{parentIsUsefulElement:O,targetElementList:A}=cI(h,_);if(!(function(L,q){var j=q?.element_allowlist;if(ze(j))return!0;var B,F=function(ie){if(j.some((H=>ie.tagName.toLowerCase()===H)))return{v:!0}};for(var Z of L)if(B=F(Z))return B.v;return!1})(A,v)||!aI(A,(T=v)==null?void 0:T.css_selector_allowlist))return!1;var I=me.getComputedStyle(h);if(I&&I.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0;var P=h.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(b||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(g.type)>=0;default:return O?(b||["click"]).indexOf(g.type)>=0:(b||["click"]).indexOf(g.type)>=0&&(JS.indexOf(P)>-1||h.getAttribute("contenteditable")==="true")}})(r,e,this.Bt,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:l}=jre(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(l)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(s.$element_selectors=c),t===ub){var d,f=l6(me==null||(d=me.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!f)return!1;s.$selected_content=f,s.$copy_type=p}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return is(Le?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(me==null||(t=me.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,$e.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(me&&me.history){var n=this;(e=me.history.pushState)!=null&&e.__posthog_wrapped__||pI(me.history,"pushState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("pushState")})),(t=me.history.replaceState)!=null&&t.__posthog_wrapped__||pI(me.history,"replaceState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("replaceState")})),this.js()}}Bs(e){try{var t,n=me==null||(t=me.location)==null?void 0:t.pathname;if(!n)return;n!==this.Ls&&this.isEnabled&&this._instance.capture(Ec,{navigation_type:e}),this.Ls=n}catch(r){$e.error("Error capturing "+e+" pageview",r)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};Vn(me,"popstate",e),this.Ds=()=>{me&&me.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[T1]),this.rageclicks=new fI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return An(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return St(this.Bt.capture_heatmaps)?St(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:this.Bt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Ure.info("starting..."),this.Zs(),this.Ft()}else{var e;clearInterval((e=this.qs)!==null&&e!==void 0?e:void 0),this.Vs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[T1]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Hs(e){this.Tt(e.originalEvent,"deadclick")}Ft(){this.qs&&clearInterval(this.qs),this.qs=Le?.visibilityState==="visible"?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){me&&Le&&(this.zs=this.Yr.bind(this),Vn(me,mg,this.zs),this.Us=e=>this.Tt(e||me?.event),Vn(Le,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||me?.event),Vn(Le,"mousemove",this.Ys,{capture:!0}),this.Ws=new zA(this.instance,Jne,this.Hs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Ft.bind(this),Vn(Le,pg,this.Xs),this.Rs=!0)}Vs(){var e;me&&Le&&(this.zs&&me.removeEventListener(mg,this.zs),this.Us&&Le.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Le.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Le.removeEventListener(pg,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(l,c,d){for(var f=l;f&&av(f)&&!ua(f,"body");){if(f===d)return!1;if(wt(c,me?.getComputedStyle(f).position))return!0;f=c6(f)}return!1})(sI(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}Tt(e,t){var n;if(t===void 0&&(t="click"),!oI(e.target)&&yI(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(Ne({},r,{type:"rageclick"})),this.Qs(r)}}Gs(e){!oI(e.target)&&yI(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(me){var t=me.location.href,n=this.Bt.custom_personal_data_properties,r=this.Bt.mask_personal_data_properties?[...Qc,...n||[]]:[],o=af(t,r,lf);this.T=this.T||{},this.T[o]||(this.T[o]=[]),this.T[o].push(e)}}Yr(){this.T&&!Ic(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zA,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((n,r)=>Ne({},n,{["$web_vitals_"+r.name+"_event"]:Ne({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(ze(o))Zs.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();ze(s)||(St(n?.name)||St(n?.value)?Zs.error("Invalid metric received",n):!this.no||this.no>n.value?(this.T.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),ze(this.T.url)&&(this.T.url=s),this.T.firstMetricTimestamp=ze(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(Ne({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Zs.error("Ignoring metric with value >= "+this.no,n))}},this.so=()=>{if(!this.Rs){var n,r,o,s,l=We.__PosthogExtensions__;ze(l)||ze(l.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:s}=l.postHogWebVitalsCallbacks),n&&r&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.Rs=!0):Zs.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[M1]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=An(this.oo)?(e=this.oo)==null?void 0:e.web_vitals_allowed_metrics:void 0;return St(n)?((t=this._instance.persistence)==null?void 0:t.props[N1])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(An(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=An(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=An(this.oo)&&Fo(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:mI;return e>0&&6e4>=e?mI:e}get isEnabled(){var e=pr?.protocol;if(e!=="http:"&&e!=="https:")return Zs.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=An(this.oo)?this.oo.web_vitals:xi(this.oo)?this.oo:void 0;return xi(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Zs.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=An(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=An(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[M1]:t}),this._instance.persistence.register({[N1]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Zs.error("failed to load script",r):e()}))}io(){var e=me?me.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qc,...t||[]]:[];return af(e,n,lf)}Zs.error("Could not determine current URL")}}},Yre={exceptionObserver:class{constructor(e){var t,n,r;this.so=()=>{var o;if(me&&this.isEnabled&&(o=We.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=We.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=We.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=We.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=s(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=l(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=c(this.captureException.bind(this)))}catch(d){gd.error("failed to start",d),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[C1]),this.do=new lne({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,Gt:gd}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return An(e)?t=Ne({},t,e):(ze(e)?this.co:e)&&(t=Ne({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gd.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return gd.error("failed to load script",r);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[C1]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r,o=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.do.consumeRateLimit(o)?gd.info("Skipping exception capture because of client rate limiting.",{exception:o}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.fo=[],this.po=new wne([new Ane,new jne,new Mne,new Ine,new Lne,new Dne,new Nne,new $ne],(function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;o>l;l++)s[l-1]=arguments[l];return function(c,d){d===void 0&&(d=0);for(var f=[],p=c.split(`
|
|
156
|
+
`),h=d;p.length>h;h++){var g=p[h];if(1024>=g.length){var v=DA.test(g)?g.replace(DA,"$1"):g;if(!v.match(/\S*Error: /)){for(var _ of s){var b=_(v,r);if(b){f.push(b);break}}if(f.length>=50)break}}}return(function(x){if(!x.length)return[];var S=Array.from(x);return S.reverse(),S.slice(0,50).map((E=>{return Ne({},E,{filename:E.filename||(T=S,T[T.length-1]||{}).filename,function:E.function||Wc});var T}))})(f)}})("web:javascript",Rne,Cne)),this._instance=e,this.fo=(t=(n=this._instance.persistence)==null?void 0:n.get_property(A1))!==null&&t!==void 0?t:[],this.mo=lg(this.yo()),this.bo=new Une(this.mo)}onConfigChange(){this.mo=lg(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fo=o,this._instance.persistence&&this._instance.persistence.register({[A1]:this.fo,[I1]:s})}}get _o(){var e,t=!!this._instance.get_property(I1),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!_n(e)||e.trim().length===0)return void es.warn("Ignoring exception step because message must be a non-empty string");var n=this.wo(t),{sanitizedProperties:r,droppedKeys:o}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(s).reduce(((c,d)=>zne.has(d)?(l.push(d),c):(c[d]=s[d],c)),{}),droppedKeys:l}})(n);o.length>0&&es.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.bo.add(Ne({[sg]:e,[ag]:new Date().toISOString()},r))}catch(s){es.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void es.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void es.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void es.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.mo.enabled&&St(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return r&&this.bo.clear(),r}catch(o){return es.error("Failed to capture exception event. Dropping this exception.",o),void this.bo.clear()}}catch(o){return void es.error("Failed to process exception event. Ignoring this exception.",o)}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:Ne({},e,{$exception_steps:t})}catch(n){return es.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}So(e){this.mo.enabled&&this.bo.add({[sg]:e,[ag]:new Date().toISOString()})}wo(e){return An(e)?Ne({},e):{}}yo(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:o,value:s}=r;return _n(o)&&o.length>0&&n.$exception_types.push(o),_n(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.fo.some((n=>{var r=n.values.map((o=>{var s,l=n6[o.operator],c=Pt(o.value)?o.value:[o.value],d=(s=t[o.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,d)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}xo(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,n,r,o,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],l=s[s.length-1];return(r=l==null||(o=l.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Io(e){return!St(e)&&Pt(e)}}},Wre=Ne({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[P1]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(P1)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?_I.error("Could not load product tours script",r):e()}))}Ro(){var e;!this.Ao&&(e=We.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=We.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Pt(this.Eo)||t){var n=this.ni;if(n){var r=n.props[Tm];if(Pt(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var s=o.statusCode;if(s!==200||!o.json){var l="Product Tours API could not be loaded, status: "+s;return _I.error(l),void e([],{isLoaded:!1,error:l})}var c=Pt(o.json.product_tours)?o.json.product_tours:[];this.Eo=c,n&&n.register({[Tm]:c}),e(c,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){St(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(Tm)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},lv),Qre={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=We._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,r,o,s,l,c;if(!e)throw new Error("Event payload is required");var d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(p))d[h]={id:f[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:Ne({},r5(e,Fre),{properties:Ne({},e.properties,_?{$set:Ne({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},v?{$set_once:Ne({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(s=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var l;!t.errored&&this.No.length&&(Ws.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((c=>t.processEvent==null?void 0:t.processEvent(c))),t.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((l=this.Fo)==null||l.call(this))},r=!1,o=l=>{t.errored=!l,t.loaded=!0,Ws.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(l){o(l)}});s&&(t.processEvent=s),r=!0}catch(l){Ws.error(bI+e.id,l),o(!1)}if(r&&t.loaded)try{n()}catch(l){Ws.error("Error while processing buffered events PostHog app with config id "+e.id,l),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Ws.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(d=>this.Po(d)))):void Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(d){var f;We["__$$ph_site_app_"+d]=o._instance,(f=We.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(o._instance,c,(p=>{if(p)return Ws.error(bI+d,p)}))};for(var{id:l,url:c}of e.siteApps)s(l)}else Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Xre={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var t,n,r=this.Bo()||[];ze(this.Lo)&&((t=We.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),ze(this.Do)&&((n=We.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return zre.error("failed to load script",r);e()}))}Bo(){var e;return(e=this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},Jre=Ne({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(St(t))return Xt.warn("Flags not loaded yet. Not loading surveys.");var n=Pt(t);this.jo=n?t.length>0:t,Xt.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(X1)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Xt.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)Xt.info(wI);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Xt.info("Not loading surveys in cookieless mode without consent.");else{var e=We?.__PosthogExtensions__;if(e){if(!ze(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Vo(n,t);var r=e.loadExternalDependency;if(!r)return void this.Ho(KS);r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.Ho("Could not load surveys script",o):this.Vo(e.generateSurveys,t)}))}catch(o){throw this.Ho("Error initializing surveys",o),o}finally{this.$o=!1}}}else Xt.error("PostHog Extensions not found.")}}Vo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new qre(this._instance),Xt.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Ho(e,t){Xt.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Xt.info(wI),e([]);var n,r=this._instance.get_property($1);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.Zo?this.Zo.then((o=>{var{surveys:s,context:l}=o;return e(s,l)})):(typeof Promise<"u"&&(this.Zo=new Promise((o=>{n=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:o=>{var s;this.Zo=null;var l=o.statusCode;if(l!==200||!o.json){var c="Surveys API could not be loaded, status: "+l;Xt.error(c);var d={isLoaded:!1,error:c};return e([],d),void(n==null||n({surveys:[],context:d}))}var f,p=o.json.surveys||[],h=p.filter((v=>(function(_){return!(!_.start_date||_.end_date)})(v)&&((function(_){var b;return!((b=_.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(v)||(function(_){var b;return!((b=_.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(v))));h.length>0&&((f=this._surveyEventReceiver)==null||f.register(h)),(s=this._instance.persistence)==null||s.register({[$1]:p});var g={isLoaded:!0};e(p,g),n?.({surveys:p,context:g})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){Xt.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!St(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Xt.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),t}Yo(e){if(St(this._surveyManager))return{eligible:!1,reason:fb};var t=typeof e=="string"?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(St(this._surveyManager))return Xt.warn("init was not called"),{visible:!1,disabledReason:fb};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return St(this._surveyManager)?(Xt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:fb})):new Promise((n=>{this.getSurveys((r=>{var o,s=(o=r.find((c=>c.id===e)))!==null&&o!==void 0?o:null;if(s){var l=this.Yo(s);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(St(this._surveyManager))Xt.warn("init was not called");else{var o=typeof e=="string"?this.Uo(e):e;if(o!=null&&o.id)if(xre.includes(o.type)){var s=Le?.querySelector(t);if(s)return(r=o.appearance)!=null&&r.surveyPopupDelaySeconds?(Xt.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Xt.info("Rendering survey "+o.id+" with delay of "+((l=o.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(o,s,n),Xt.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,s,n);Xt.warn("Survey element not found")}else Xt.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Xt.warn("Survey not found")}}displaySurvey(e,t){var n;if(St(this._surveyManager))Xt.warn("init was not called");else{var r=this.Uo(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=Ne({},r,{appearance:Ne({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==G1.Popover&&t.initialResponses&&Xt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void Xt.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==G1.Inline?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Xt.warn("Survey not found")}}cancelPendingSurvey(e){St(this._surveyManager)?Xt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},lv),eoe={toolbar:class{constructor(e){this.instance=e}Go(e){We.ph_toolbar_state=e}Wo(){var e;return(e=We.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),$5(this.instance.config)||!me||!Le)return!1;e=e??me.location,n=n??me.history;try{if(!t){try{me.localStorage.setItem("test","test"),me.localStorage.removeItem("test")}catch{return!1}t=me?.localStorage}var r,o=Hre||_g(e.hash,"__posthog")||_g(e.hash,"state"),s=o?$A((()=>JSON.parse(atob(decodeURIComponent(o)))))||$A((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(SI)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Xo(e){var t=We.ph_load_toolbar||We.ph_load_editor;!St(t)&&is(t)?t(e,this.instance):EI.warn("No toolbar load function found")}loadToolbar(e){var t=!(Le==null||!Le.getElementById(N5));if(!me||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Ne({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(me.localStorage.setItem(SI,JSON.stringify(Ne({},r,{source:void 0}))),this.Wo()===2)this.Xo(r);else if(this.Wo()===0){var o;this.Go(1),(o=We.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return EI.error("[Toolbar] Failed to load",s),void this.Go(0);this.Go(2),this.Xo(r)})),Vn(me,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(r)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},toe=Ne({experiments:Rr},lv),noe={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;St(t)||(xi(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||$5(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=We?.__PosthogExtensions__;if(e&&!ze(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(KS);n(this._instance,"conversations",(r=>{r||!e.initConversations?this.ra("Could not load conversations script",r):this.ta(e.initConversations),this.Qo=!1}))}catch(r){this.ra("Error initializing conversations",r),this.Qo=!1}}else ko.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),ko.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else ko.error("Cannot complete initialization: remote config is null")}ra(e,t){ko.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():ko.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ko===!0&&!ys(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Lo((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ko.warn(Ga),null)}))()}getMessages(e,t){var n=this;return Lo((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ko.warn(Ga),null)}))()}markAsRead(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ko.warn(Ga),null)}))()}getTickets(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ko.warn(Ga),null)}))()}requestRestoreLink(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ko.warn(Ga),null)}))()}restoreFromToken(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ko.warn(Ga),null)}))()}restoreFromUrlToken(){var e=this;return Lo((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ko.warn(Ga),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},roe={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=mn("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!St(n)&&n&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=We?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.Gt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(KS)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,o,s,l;if(this._instance.is_capturing())if(e&&e.body){var c=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,d=(r=(o=this._instance.config.logs)==null?void 0:o.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,f=Date.now();if(c>f-this.aa||(this.aa=f,this.oa=0,this.la=!1),d>this.oa){this.oa++;var p=(function(h,g){var v=h.level||"info",{text:_,number:b}=E5[v]||_ne,x=String(Date.now())+"000000",S={};g.distinctId&&(S.posthogDistinctId=g.distinctId),g.sessionId&&(S.sessionId=g.sessionId),g.currentUrl&&(S["url.full"]=g.currentUrl),g.screenName&&(S["screen.name"]=g.screenName),g.appState&&(S["app.state"]=g.appState),g.activeFeatureFlags&&g.activeFeatureFlags.length>0&&(S.feature_flags=g.activeFeatureFlags);var E=Ne({},S,h.attributes||{}),T={timeUnixNano:x,observedTimeUnixNano:x,severityNumber:b,severityText:_,body:{stringValue:h.body},attributes:kA(E)};return h.trace_id&&(T.traceId=h.trace_id),h.span_id&&(T.spanId=h.span_id),ze(h.trace_flags)||(T.flags=h.trace_flags),T})(e,this.ua());this.sa.push({record:p}),((s=(l=this._instance.config.logs)==null?void 0:l.maxBufferSize)!==null&&s!==void 0?s:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+d+" logs per "+c+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=Ne({"service.name":n?.serviceName||"unknown_service"},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),o=(function(l,c,d,f){return{resourceLogs:[{resource:{attributes:kA(c)},scopeLogs:[{scope:{name:d,version:f},logRecords:l}]}]}})(t.map((l=>l.record)),r,$r.LIB_NAME,$r.LIB_VERSION),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Vi({method:"POST",url:s,data:o,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(We!=null&&(e=We.location)!=null&&e.href&&(t.currentUrl=We.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},ooe=Ne({},lv,Kre,Zre,Yre,Wre,Qre,Jre,Xre,eoe,toe,noe,roe);$o.__defaultExtensionClasses=Ne({},ooe);var TI,yl=(TI=Ud[xc]=new $o,(function(){function e(){e.done||(e.done=!0,i6=!1,dn(Ud,(function(t){t._dom_loaded()})))}Le!=null&&Le.addEventListener?Le.readyState==="complete"?e():Vn(Le,"DOMContentLoaded",e,{capture:!1}):me&&$e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),TI);const ioe={from({org:e,project:t}){return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}}},p6=M.createContext(void 0),soe=()=>{const e=M.useContext(p6);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},tue=()=>soe().org,nue=e=>{const t=er.c(10),{children:n,org:r,project:o}=e;let s;t[0]!==r.id||t[1]!==o.id?(s=ioe.from({org:r.id,project:o.id}),t[0]=r.id,t[1]=o.id,t[2]=s):s=t[2];const l=s;let c;t[3]!==l||t[4]!==r||t[5]!==o?(c={org:r,project:o,locator:l},t[3]=l,t[4]=r,t[5]=o,t[6]=c):c=t[6];const d=c;let f;return t[7]!==n||t[8]!==d?(f=C.jsx(p6.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},cv={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,r)=>["mcp","client",e,t,n,r],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpUiResourceHtml:(e,t,n)=>["mcp","ui-resource-html",e,t,n],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],virtualMcpLastUsed:(e,t)=>["virtual-mcp","last-used",e,t],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,r,o)=>[e,t,n,"collection",r,o],collectionList:(e,t,n,r,o)=>[e,t,n,"collection",r,"list",o],collectionListInfinite:(e,t,n,r,o)=>[e,t,n,"collection",r,"list-infinite",o],githubReadme:(e,t)=>["github-readme",e,t],githubBranches:(e,t,n,r,o)=>["github-branches",e,t,n,r,o],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e],registryApp:(e,t)=>["registry-app",e,t]},aoe="2025-11-25",rue=[aoe,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],loe="io.modelcontextprotocol/related-task",uv="2.0",Xn=wV(e=>e!==null&&(typeof e=="object"||typeof e=="function")),m6=an([$(),at().int()]),g6=$();vr({ttl:at().optional(),pollInterval:at().optional()});const coe=be({ttl:at().optional()}),uoe=be({taskId:$()}),eE=vr({progressToken:m6.optional(),[loe]:uoe.optional()}),wo=be({_meta:eE.optional()}),Of=wo.extend({task:coe.optional()}),oue=e=>Of.safeParse(e).success,_r=be({method:$(),params:wo.loose().optional()}),Vo=be({_meta:eE.optional()}),qo=be({method:$(),params:Vo.loose().optional()}),br=vr({_meta:eE.optional()}),dv=an([$(),at().int()]),v6=be({jsonrpc:Ge(uv),id:dv,..._r.shape}).strict(),iue=e=>v6.safeParse(e).success,y6=be({jsonrpc:Ge(uv),...qo.shape}).strict(),sue=e=>y6.safeParse(e).success,tE=be({jsonrpc:Ge(uv),id:dv,result:br}).strict(),aue=e=>tE.safeParse(e).success;var uf;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(uf||(uf={}));const nE=be({jsonrpc:Ge(uv),id:dv.optional(),error:be({code:at().int(),message:$(),data:Gt().optional()})}).strict(),lue=e=>nE.safeParse(e).success,cue=an([v6,y6,tE,nE]);an([tE,nE]);const _6=br.strict(),doe=Vo.extend({requestId:dv.optional(),reason:$().optional()}),b6=qo.extend({method:Ge("notifications/cancelled"),params:doe}),foe=be({src:$(),mimeType:$().optional(),sizes:Re($()).optional(),theme:sn(["light","dark"]).optional()}),Tf=be({icons:Re(foe).optional()}),Jc=be({name:$(),title:$().optional()}),w6=Jc.extend({...Jc.shape,...Tf.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),hoe=qw(be({applyDefaults:Nt().optional()}),Mt($(),Gt())),poe=Gw(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,qw(be({form:hoe.optional(),url:Xn.optional()}),Mt($(),Gt()).optional())),moe=vr({list:Xn.optional(),cancel:Xn.optional(),requests:vr({sampling:vr({createMessage:Xn.optional()}).optional(),elicitation:vr({create:Xn.optional()}).optional()}).optional()}),goe=vr({list:Xn.optional(),cancel:Xn.optional(),requests:vr({tools:vr({call:Xn.optional()}).optional()}).optional()}),voe=be({experimental:Mt($(),Xn).optional(),sampling:be({context:Xn.optional(),tools:Xn.optional()}).optional(),elicitation:poe.optional(),roots:be({listChanged:Nt().optional()}).optional(),tasks:moe.optional(),extensions:Mt($(),Xn).optional()}),yoe=wo.extend({protocolVersion:$(),capabilities:voe,clientInfo:w6}),_oe=_r.extend({method:Ge("initialize"),params:yoe}),boe=be({experimental:Mt($(),Xn).optional(),logging:Xn.optional(),completions:Xn.optional(),prompts:be({listChanged:Nt().optional()}).optional(),resources:be({subscribe:Nt().optional(),listChanged:Nt().optional()}).optional(),tools:be({listChanged:Nt().optional()}).optional(),tasks:goe.optional(),extensions:Mt($(),Xn).optional()}),woe=br.extend({protocolVersion:$(),capabilities:boe,serverInfo:w6,instructions:$().optional()}),S6=qo.extend({method:Ge("notifications/initialized"),params:Vo.optional()}),uue=e=>S6.safeParse(e).success,E6=_r.extend({method:Ge("ping"),params:wo.optional()}),Soe=be({progress:at(),total:bn(at()),message:bn($())}),Eoe=be({...Vo.shape,...Soe.shape,progressToken:m6}),x6=qo.extend({method:Ge("notifications/progress"),params:Eoe}),xoe=wo.extend({cursor:g6.optional()}),Cf=_r.extend({params:xoe.optional()}),Af=br.extend({nextCursor:g6.optional()}),Roe=sn(["working","input_required","completed","failed","cancelled"]),If=be({taskId:$(),status:Roe,ttl:an([at(),ZB()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:bn(at()),statusMessage:bn($())}),R6=br.extend({task:If}),Ooe=Vo.merge(If),O6=qo.extend({method:Ge("notifications/tasks/status"),params:Ooe}),T6=_r.extend({method:Ge("tasks/get"),params:wo.extend({taskId:$()})}),C6=br.merge(If),A6=_r.extend({method:Ge("tasks/result"),params:wo.extend({taskId:$()})});br.loose();const I6=Cf.extend({method:Ge("tasks/list")}),M6=Af.extend({tasks:Re(If)}),P6=_r.extend({method:Ge("tasks/cancel"),params:wo.extend({taskId:$()})}),due=br.merge(If),N6=be({uri:$(),mimeType:bn($()),_meta:Mt($(),Gt()).optional()}),k6=N6.extend({text:$()}),rE=$().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),D6=N6.extend({blob:rE}),Mf=sn(["user","assistant"]),iu=be({audience:Re(Mf).optional(),priority:at().min(0).max(1).optional(),lastModified:G3({offset:!0}).optional()}),L6=be({...Jc.shape,...Tf.shape,uri:$(),description:bn($()),mimeType:bn($()),size:bn(at()),annotations:iu.optional(),_meta:bn(vr({}))}),Toe=be({...Jc.shape,...Tf.shape,uriTemplate:$(),description:bn($()),mimeType:bn($()),annotations:iu.optional(),_meta:bn(vr({}))}),Coe=Cf.extend({method:Ge("resources/list")}),Aoe=Af.extend({resources:Re(L6)}),Ioe=Cf.extend({method:Ge("resources/templates/list")}),Moe=Af.extend({resourceTemplates:Re(Toe)}),oE=wo.extend({uri:$()}),Poe=oE,Noe=_r.extend({method:Ge("resources/read"),params:Poe}),koe=br.extend({contents:Re(an([k6,D6]))}),Doe=qo.extend({method:Ge("notifications/resources/list_changed"),params:Vo.optional()}),Loe=oE,$oe=_r.extend({method:Ge("resources/subscribe"),params:Loe}),joe=oE,zoe=_r.extend({method:Ge("resources/unsubscribe"),params:joe}),Uoe=Vo.extend({uri:$()}),Foe=qo.extend({method:Ge("notifications/resources/updated"),params:Uoe}),Boe=be({name:$(),description:bn($()),required:bn(Nt())}),Voe=be({...Jc.shape,...Tf.shape,description:bn($()),arguments:bn(Re(Boe)),_meta:bn(vr({}))}),qoe=Cf.extend({method:Ge("prompts/list")}),Hoe=Af.extend({prompts:Re(Voe)}),Goe=wo.extend({name:$(),arguments:Mt($(),$()).optional()}),Koe=_r.extend({method:Ge("prompts/get"),params:Goe}),iE=be({type:Ge("text"),text:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),sE=be({type:Ge("image"),data:rE,mimeType:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),aE=be({type:Ge("audio"),data:rE,mimeType:$(),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),Zoe=be({type:Ge("tool_use"),name:$(),id:$(),input:Mt($(),Gt()),_meta:Mt($(),Gt()).optional()}),Yoe=be({type:Ge("resource"),resource:an([k6,D6]),annotations:iu.optional(),_meta:Mt($(),Gt()).optional()}),Woe=L6.extend({type:Ge("resource_link")}),lE=an([iE,sE,aE,Woe,Yoe]),Qoe=be({role:Mf,content:lE}),Xoe=br.extend({description:$().optional(),messages:Re(Qoe)}),Joe=qo.extend({method:Ge("notifications/prompts/list_changed"),params:Vo.optional()}),eie=be({title:$().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),tie=be({taskSupport:sn(["required","optional","forbidden"]).optional()}),cE=be({...Jc.shape,...Tf.shape,description:$().optional(),inputSchema:be({type:Ge("object"),properties:Mt($(),Xn).optional(),required:Re($()).optional()}).catchall(Gt()),outputSchema:be({type:Ge("object"),properties:Mt($(),Xn).optional(),required:Re($()).optional()}).catchall(Gt()).optional(),annotations:eie.optional(),execution:tie.optional(),_meta:Mt($(),Gt()).optional()}),nie=Cf.extend({method:Ge("tools/list")}),rie=Af.extend({tools:Re(cE)}),$6=br.extend({content:Re(lE).default([]),structuredContent:Mt($(),Gt()).optional(),isError:Nt().optional()});$6.or(br.extend({toolResult:Gt()}));const oie=Of.extend({name:$(),arguments:Mt($(),Gt()).optional()}),iie=_r.extend({method:Ge("tools/call"),params:oie}),sie=qo.extend({method:Ge("notifications/tools/list_changed"),params:Vo.optional()}),fue=be({autoRefresh:Nt().default(!0),debounceMs:at().int().nonnegative().default(300)}),j6=sn(["debug","info","notice","warning","error","critical","alert","emergency"]),aie=wo.extend({level:j6}),lie=_r.extend({method:Ge("logging/setLevel"),params:aie}),cie=Vo.extend({level:j6,logger:$().optional(),data:Gt()}),uie=qo.extend({method:Ge("notifications/message"),params:cie}),die=be({name:$().optional()}),fie=be({hints:Re(die).optional(),costPriority:at().min(0).max(1).optional(),speedPriority:at().min(0).max(1).optional(),intelligencePriority:at().min(0).max(1).optional()}),hie=be({mode:sn(["auto","required","none"]).optional()}),pie=be({type:Ge("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:Re(lE).default([]),structuredContent:be({}).loose().optional(),isError:Nt().optional(),_meta:Mt($(),Gt()).optional()}),mie=Vw("type",[iE,sE,aE]),xg=Vw("type",[iE,sE,aE,Zoe,pie]),gie=be({role:Mf,content:an([xg,Re(xg)]),_meta:Mt($(),Gt()).optional()}),vie=Of.extend({messages:Re(gie),modelPreferences:fie.optional(),systemPrompt:$().optional(),includeContext:sn(["none","thisServer","allServers"]).optional(),temperature:at().optional(),maxTokens:at().int(),stopSequences:Re($()).optional(),metadata:Xn.optional(),tools:Re(cE).optional(),toolChoice:hie.optional()}),yie=_r.extend({method:Ge("sampling/createMessage"),params:vie}),_ie=br.extend({model:$(),stopReason:bn(sn(["endTurn","stopSequence","maxTokens"]).or($())),role:Mf,content:mie}),bie=br.extend({model:$(),stopReason:bn(sn(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:Mf,content:an([xg,Re(xg)])}),wie=be({type:Ge("boolean"),title:$().optional(),description:$().optional(),default:Nt().optional()}),Sie=be({type:Ge("string"),title:$().optional(),description:$().optional(),minLength:at().optional(),maxLength:at().optional(),format:sn(["email","uri","date","date-time"]).optional(),default:$().optional()}),Eie=be({type:sn(["number","integer"]),title:$().optional(),description:$().optional(),minimum:at().optional(),maximum:at().optional(),default:at().optional()}),xie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),default:$().optional()}),Rie=be({type:Ge("string"),title:$().optional(),description:$().optional(),oneOf:Re(be({const:$(),title:$()})),default:$().optional()}),Oie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),enumNames:Re($()).optional(),default:$().optional()}),Tie=an([xie,Rie]),Cie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:at().optional(),maxItems:at().optional(),items:be({type:Ge("string"),enum:Re($())}),default:Re($()).optional()}),Aie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:at().optional(),maxItems:at().optional(),items:be({anyOf:Re(be({const:$(),title:$()}))}),default:Re($()).optional()}),Iie=an([Cie,Aie]),Mie=an([Oie,Tie,Iie]),Pie=an([Mie,wie,Sie,Eie]),Nie=Of.extend({mode:Ge("form").optional(),message:$(),requestedSchema:be({type:Ge("object"),properties:Mt($(),Pie),required:Re($()).optional()})}),kie=Of.extend({mode:Ge("url"),message:$(),elicitationId:$(),url:$().url()}),Die=an([Nie,kie]),Lie=_r.extend({method:Ge("elicitation/create"),params:Die}),$ie=Vo.extend({elicitationId:$()}),jie=qo.extend({method:Ge("notifications/elicitation/complete"),params:$ie}),zie=br.extend({action:sn(["accept","decline","cancel"]),content:Gw(e=>e===null?void 0:e,Mt($(),an([$(),at(),Nt(),Re($())])).optional())}),Uie=be({type:Ge("ref/resource"),uri:$()}),Fie=be({type:Ge("ref/prompt"),name:$()}),Bie=wo.extend({ref:an([Fie,Uie]),argument:be({name:$(),value:$()}),context:be({arguments:Mt($(),$()).optional()}).optional()}),Vie=_r.extend({method:Ge("completion/complete"),params:Bie}),qie=br.extend({completion:vr({values:Re($()).max(100),total:bn(at().int()),hasMore:bn(Nt())})}),Hie=be({uri:$().startsWith("file://"),name:$().optional(),_meta:Mt($(),Gt()).optional()}),Gie=_r.extend({method:Ge("roots/list"),params:wo.optional()}),Kie=br.extend({roots:Re(Hie)}),Zie=qo.extend({method:Ge("notifications/roots/list_changed"),params:Vo.optional()});an([E6,_oe,Vie,lie,Koe,qoe,Coe,Ioe,Noe,$oe,zoe,iie,nie,T6,A6,I6,P6]);an([b6,x6,S6,Zie,O6]);an([_6,_ie,bie,zie,Kie,C6,M6,R6]);an([E6,yie,Lie,Gie,T6,A6,I6,P6]);an([b6,x6,uie,Foe,Doe,sie,Joe,O6,jie]);an([_6,woe,qie,Xoe,Hoe,Aoe,Moe,koe,$6,rie,C6,M6,R6]);class fv extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===uf.UrlElicitationRequired&&r){const o=r;if(o.elicitations)return new Yie(o.elicitations,n)}return new fv(t,n,r)}}class Yie extends fv{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(uf.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cp={exports:{}},pb={},ts={},Ka={},mb={},gb={},vb={},CI;function Rg(){return CI||(CI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(E){if(super(),!e.IDENTIFIER.test(E))throw new Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(E){super(),this._items=typeof E=="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((T,R)=>`${T}${R}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((T,R)=>(R instanceof n&&(T[R.str]=(T[R.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function o(S,...E){const T=[S[0]];let R=0;for(;R<E.length;)c(T,E[R]),T.push(S[++R]);return new r(T)}e._=o;const s=new r("+");function l(S,...E){const T=[v(S[0])];let R=0;for(;R<E.length;)T.push(s),c(T,E[R]),T.push(s,v(S[++R]));return d(T),new r(T)}e.str=l;function c(S,E){E instanceof r?S.push(...E._items):E instanceof n?S.push(E):S.push(h(E))}e.addCodeArg=c;function d(S){let E=1;for(;E<S.length-1;){if(S[E]===s){const T=f(S[E-1],S[E+1]);if(T!==void 0){S.splice(E-1,3,T);continue}S[E++]="+"}E++}}function f(S,E){if(E==='""')return S;if(S==='""')return E;if(typeof S=="string")return E instanceof n||S[S.length-1]!=='"'?void 0:typeof E!="string"?`${S.slice(0,-1)}${E}"`:E[0]==='"'?S.slice(0,-1)+E.slice(1):void 0;if(typeof E=="string"&&E[0]==='"'&&!(S instanceof n))return`"${S}${E.slice(1)}`}function p(S,E){return E.emptyStr()?S:S.emptyStr()?E:l`${S}${E}`}e.strConcat=p;function h(S){return typeof S=="number"||typeof S=="boolean"||S===null?S:v(Array.isArray(S)?S.join(","):S)}function g(S){return new r(v(S))}e.stringify=g;function v(S){return JSON.stringify(S).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function _(S){return typeof S=="string"&&e.IDENTIFIER.test(S)?new r(`.${S}`):o`[${S}]`}e.getProperty=_;function b(S){if(typeof S=="string"&&e.IDENTIFIER.test(S))return new r(`${S}`);throw new Error(`CodeGen: invalid export name: ${S}, use explicit $id name mapping`)}e.getEsmExportName=b;function x(S){return new r(S.toString())}e.regexpCode=x})(vb)),vb}var yb={},AI;function II(){return AI||(AI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Rg();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:f,parent:p}={}){this._names={},this._prefixes=f,this._parent=p}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const p=this._names[f]||this._nameGroup(f);return`${f}${p.index++}`}_nameGroup(f){var p,h;if(!((h=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=o;class s extends t.Name{constructor(f,p){super(p),this.prefix=f}setValue(f,{property:p,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(p)}[${h}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class c extends o{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new s(f,this._newName(f))}value(f,p){var h;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:v}=g,_=(h=p.key)!==null&&h!==void 0?h:p.ref;let b=this._values[v];if(b){const E=b.get(_);if(E)return E}else b=this._values[v]=new Map;b.set(_,g);const x=this._scope[v]||(this._scope[v]=[]),S=x.length;return x[S]=p.ref,g.setValue(p,{property:v,itemIndex:S}),g}getValue(f,p){const h=this._values[f];if(h)return h.get(p)}scopeRefs(f,p=this._values){return this._reduceValues(p,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,p,h){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},p,h)}_reduceValues(f,p,h={},g){let v=t.nil;for(const _ in f){const b=f[_];if(!b)continue;const x=h[_]=h[_]||new Map;b.forEach(S=>{if(x.has(S))return;x.set(S,r.Started);let E=p(S);if(E){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${T} ${S} = ${E};${this.opts._n}`}else if(E=g?.(S))v=(0,t._)`${v}${E}${this.opts._n}`;else throw new n(S);x.set(S,r.Completed)})}return v}}e.ValueScope=c})(yb)),yb}var MI;function mt(){return MI||(MI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Rg(),n=II();var r=Rg();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=II();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(D,U){return this}}class l extends s{constructor(D,U,X){super(),this.varKind=D,this.name=U,this.rhs=X}render({es5:D,_n:U}){const X=D?n.varKinds.var:this.varKind,fe=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${fe};`+U}optimizeNames(D,U){if(D[this.name.str])return this.rhs&&(this.rhs=Z(this.rhs,D,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(D,U,X){super(),this.lhs=D,this.rhs=U,this.sideEffects=X}render({_n:D}){return`${this.lhs} = ${this.rhs};`+D}optimizeNames(D,U){if(!(this.lhs instanceof t.Name&&!D[this.lhs.str]&&!this.sideEffects))return this.rhs=Z(this.rhs,D,U),this}get names(){const D=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(D,this.rhs)}}class d extends c{constructor(D,U,X,fe){super(D,X,fe),this.op=U}render({_n:D}){return`${this.lhs} ${this.op}= ${this.rhs};`+D}}class f extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`${this.label}:`+D}}class p extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`break${this.label?` ${this.label}`:""};`+D}}class h extends s{constructor(D){super(),this.error=D}render({_n:D}){return`throw ${this.error};`+D}get names(){return this.error.names}}class g extends s{constructor(D){super(),this.code=D}render({_n:D}){return`${this.code};`+D}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(D,U){return this.code=Z(this.code,D,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(D=[]){super(),this.nodes=D}render(D){return this.nodes.reduce((U,X)=>U+X.render(D),"")}optimizeNodes(){const{nodes:D}=this;let U=D.length;for(;U--;){const X=D[U].optimizeNodes();Array.isArray(X)?D.splice(U,1,...X):X?D[U]=X:D.splice(U,1)}return D.length>0?this:void 0}optimizeNames(D,U){const{nodes:X}=this;let fe=X.length;for(;fe--;){const pe=X[fe];pe.optimizeNames(D,U)||(ie(D,pe.names),X.splice(fe,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((D,U)=>B(D,U.names),{})}}class _ extends v{render(D){return"{"+D._n+super.render(D)+"}"+D._n}}class b extends v{}class x extends _{}x.kind="else";class S extends _{constructor(D,U){super(U),this.condition=D}render(D){let U=`if(${this.condition})`+super.render(D);return this.else&&(U+="else "+this.else.render(D)),U}optimizeNodes(){super.optimizeNodes();const D=this.condition;if(D===!0)return this.nodes;let U=this.else;if(U){const X=U.optimizeNodes();U=this.else=Array.isArray(X)?new x(X):X}if(U)return D===!1?U instanceof S?U:U.nodes:this.nodes.length?this:new S(H(D),U instanceof S?[U]:U.nodes);if(!(D===!1||!this.nodes.length))return this}optimizeNames(D,U){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(D,U),!!(super.optimizeNames(D,U)||this.else))return this.condition=Z(this.condition,D,U),this}get names(){const D=super.names;return F(D,this.condition),this.else&&B(D,this.else.names),D}}S.kind="if";class E extends _{}E.kind="for";class T extends E{constructor(D){super(),this.iteration=D}render(D){return`for(${this.iteration})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iteration=Z(this.iteration,D,U),this}get names(){return B(super.names,this.iteration.names)}}class R extends E{constructor(D,U,X,fe){super(),this.varKind=D,this.name=U,this.from=X,this.to=fe}render(D){const U=D.es5?n.varKinds.var:this.varKind,{name:X,from:fe,to:pe}=this;return`for(${U} ${X}=${fe}; ${X}<${pe}; ${X}++)`+super.render(D)}get names(){const D=F(super.names,this.from);return F(D,this.to)}}class O extends E{constructor(D,U,X,fe){super(),this.loop=D,this.varKind=U,this.name=X,this.iterable=fe}render(D){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iterable=Z(this.iterable,D,U),this}get names(){return B(super.names,this.iterable.names)}}class A extends _{constructor(D,U,X){super(),this.name=D,this.args=U,this.async=X}render(D){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(D)}}A.kind="func";class I extends v{render(D){return"return "+super.render(D)}}I.kind="return";class P extends _{render(D){let U="try"+super.render(D);return this.catch&&(U+=this.catch.render(D)),this.finally&&(U+=this.finally.render(D)),U}optimizeNodes(){var D,U;return super.optimizeNodes(),(D=this.catch)===null||D===void 0||D.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(D,U){var X,fe;return super.optimizeNames(D,U),(X=this.catch)===null||X===void 0||X.optimizeNames(D,U),(fe=this.finally)===null||fe===void 0||fe.optimizeNames(D,U),this}get names(){const D=super.names;return this.catch&&B(D,this.catch.names),this.finally&&B(D,this.finally.names),D}}class L extends _{constructor(D){super(),this.error=D}render(D){return`catch(${this.error})`+super.render(D)}}L.kind="catch";class q extends _{render(D){return"finally"+super.render(D)}}q.kind="finally";class j{constructor(D,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
157
157
|
`:""},this._extScope=D,this._scope=new n.Scope({parent:D}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(D){return this._scope.name(D)}scopeName(D){return this._extScope.name(D)}scopeValue(D,U){const X=this._extScope.value(D,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(D,U){return this._extScope.getValue(D,U)}scopeRefs(D){return this._extScope.scopeRefs(D,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(D,U,X,fe){const pe=this._scope.toName(U);return X!==void 0&&fe&&(this._constants[pe.str]=X),this._leafNode(new l(D,pe,X)),pe}const(D,U,X){return this._def(n.varKinds.const,D,U,X)}let(D,U,X){return this._def(n.varKinds.let,D,U,X)}var(D,U,X){return this._def(n.varKinds.var,D,U,X)}assign(D,U,X){return this._leafNode(new c(D,U,X))}add(D,U){return this._leafNode(new d(D,e.operators.ADD,U))}code(D){return typeof D=="function"?D():D!==t.nil&&this._leafNode(new g(D)),this}object(...D){const U=["{"];for(const[X,fe]of D)U.length>1&&U.push(","),U.push(X),(X!==fe||this.opts.es5)&&(U.push(":"),(0,t.addCodeArg)(U,fe));return U.push("}"),new t._Code(U)}if(D,U,X){if(this._blockNode(new S(D)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(D){return this._elseNode(new S(D))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(S,x)}_for(D,U){return this._blockNode(D),U&&this.code(U).endFor(),this}for(D,U){return this._for(new T(D),U)}forRange(D,U,X,fe,pe=this.opts.es5?n.varKinds.var:n.varKinds.let){const xe=this._scope.toName(D);return this._for(new R(pe,xe,U,X),()=>fe(xe))}forOf(D,U,X,fe=n.varKinds.const){const pe=this._scope.toName(D);if(this.opts.es5){const xe=U instanceof t.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,t._)`${xe}.length`,je=>{this.var(pe,(0,t._)`${xe}[${je}]`),X(pe)})}return this._for(new O("of",fe,pe,U),()=>X(pe))}forIn(D,U,X,fe=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(D,(0,t._)`Object.keys(${U})`,X);const pe=this._scope.toName(D);return this._for(new O("in",fe,pe,U),()=>X(pe))}endFor(){return this._endBlockNode(E)}label(D){return this._leafNode(new f(D))}break(D){return this._leafNode(new p(D))}return(D){const U=new I;if(this._blockNode(U),this.code(D),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(D,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const fe=new P;if(this._blockNode(fe),this.code(D),U){const pe=this.name("e");this._currNode=fe.catch=new L(pe),U(pe)}return X&&(this._currNode=fe.finally=new q,this.code(X)),this._endBlockNode(L,q)}throw(D){return this._leafNode(new h(D))}block(D,U){return this._blockStarts.push(this._nodes.length),D&&this.code(D).endBlock(U),this}endBlock(D){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||D!==void 0&&X!==D)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${D} expected`);return this._nodes.length=U,this}func(D,U=t.nil,X,fe){return this._blockNode(new A(D,U,X)),fe&&this.code(fe).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize(D=1){for(;D-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(D){return this._currNode.nodes.push(D),this}_blockNode(D){this._currNode.nodes.push(D),this._nodes.push(D)}_endBlockNode(D,U){const X=this._currNode;if(X instanceof D||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${D.kind}/${U.kind}`:D.kind}"`)}_elseNode(D){const U=this._currNode;if(!(U instanceof S))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=D,this}get _root(){return this._nodes[0]}get _currNode(){const D=this._nodes;return D[D.length-1]}set _currNode(D){const U=this._nodes;U[U.length-1]=D}}e.CodeGen=j;function B(V,D){for(const U in D)V[U]=(V[U]||0)+(D[U]||0);return V}function F(V,D){return D instanceof t._CodeOrName?B(V,D.names):V}function Z(V,D,U){if(V instanceof t.Name)return X(V);if(!fe(V))return V;return new t._Code(V._items.reduce((pe,xe)=>(xe instanceof t.Name&&(xe=X(xe)),xe instanceof t._Code?pe.push(...xe._items):pe.push(xe),pe),[]));function X(pe){const xe=U[pe.str];return xe===void 0||D[pe.str]!==1?pe:(delete D[pe.str],xe)}function fe(pe){return pe instanceof t._Code&&pe._items.some(xe=>xe instanceof t.Name&&D[xe.str]===1&&U[xe.str]!==void 0)}}function ie(V,D){for(const U in D)V[U]=(V[U]||0)-(D[U]||0)}function H(V){return typeof V=="boolean"||typeof V=="number"||V===null?!V:(0,t._)`!${G(V)}`}e.not=H;const W=k(e.operators.AND);function te(...V){return V.reduce(W)}e.and=te;const le=k(e.operators.OR);function Q(...V){return V.reduce(le)}e.or=Q;function k(V){return(D,U)=>D===t.nil?U:U===t.nil?D:(0,t._)`${G(D)} ${V} ${G(U)}`}function G(V){return V instanceof t.Name?V:(0,t._)`(${V})`}})(gb)),gb}var ft={},PI;function kt(){if(PI)return ft;PI=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.checkStrictMode=ft.getErrorPath=ft.Type=ft.useFunc=ft.setEvaluated=ft.evaluatedPropsToName=ft.mergeEvaluated=ft.eachItem=ft.unescapeJsonPointer=ft.escapeJsonPointer=ft.escapeFragment=ft.unescapeFragment=ft.schemaRefOrVal=ft.schemaHasRulesButRef=ft.schemaHasRules=ft.checkUnknownRules=ft.alwaysValidSchema=ft.toHash=void 0;const e=mt(),t=Rg();function n(O){const A={};for(const I of O)A[I]=!0;return A}ft.toHash=n;function r(O,A){return typeof A=="boolean"?A:Object.keys(A).length===0?!0:(o(O,A),!s(A,O.self.RULES.all))}ft.alwaysValidSchema=r;function o(O,A=O.schema){const{opts:I,self:P}=O;if(!I.strictSchema||typeof A=="boolean")return;const L=P.RULES.keywords;for(const q in A)L[q]||R(O,`unknown keyword: "${q}"`)}ft.checkUnknownRules=o;function s(O,A){if(typeof O=="boolean")return!O;for(const I in O)if(A[I])return!0;return!1}ft.schemaHasRules=s;function l(O,A){if(typeof O=="boolean")return!O;for(const I in O)if(I!=="$ref"&&A.all[I])return!0;return!1}ft.schemaHasRulesButRef=l;function c({topSchemaRef:O,schemaPath:A},I,P,L){if(!L){if(typeof I=="number"||typeof I=="boolean")return I;if(typeof I=="string")return(0,e._)`${I}`}return(0,e._)`${O}${A}${(0,e.getProperty)(P)}`}ft.schemaRefOrVal=c;function d(O){return h(decodeURIComponent(O))}ft.unescapeFragment=d;function f(O){return encodeURIComponent(p(O))}ft.escapeFragment=f;function p(O){return typeof O=="number"?`${O}`:O.replace(/~/g,"~0").replace(/\//g,"~1")}ft.escapeJsonPointer=p;function h(O){return O.replace(/~1/g,"/").replace(/~0/g,"~")}ft.unescapeJsonPointer=h;function g(O,A){if(Array.isArray(O))for(const I of O)A(I);else A(O)}ft.eachItem=g;function v({mergeNames:O,mergeToName:A,mergeValues:I,resultToName:P}){return(L,q,j,B)=>{const F=j===void 0?q:j instanceof e.Name?(q instanceof e.Name?O(L,q,j):A(L,q,j),j):q instanceof e.Name?(A(L,j,q),q):I(q,j);return B===e.Name&&!(F instanceof e.Name)?P(L,F):F}}ft.mergeEvaluated={props:v({mergeNames:(O,A,I)=>O.if((0,e._)`${I} !== true && ${A} !== undefined`,()=>{O.if((0,e._)`${A} === true`,()=>O.assign(I,!0),()=>O.assign(I,(0,e._)`${I} || {}`).code((0,e._)`Object.assign(${I}, ${A})`))}),mergeToName:(O,A,I)=>O.if((0,e._)`${I} !== true`,()=>{A===!0?O.assign(I,!0):(O.assign(I,(0,e._)`${I} || {}`),b(O,I,A))}),mergeValues:(O,A)=>O===!0?!0:{...O,...A},resultToName:_}),items:v({mergeNames:(O,A,I)=>O.if((0,e._)`${I} !== true && ${A} !== undefined`,()=>O.assign(I,(0,e._)`${A} === true ? true : ${I} > ${A} ? ${I} : ${A}`)),mergeToName:(O,A,I)=>O.if((0,e._)`${I} !== true`,()=>O.assign(I,A===!0?!0:(0,e._)`${I} > ${A} ? ${I} : ${A}`)),mergeValues:(O,A)=>O===!0?!0:Math.max(O,A),resultToName:(O,A)=>O.var("items",A)})};function _(O,A){if(A===!0)return O.var("props",!0);const I=O.var("props",(0,e._)`{}`);return A!==void 0&&b(O,I,A),I}ft.evaluatedPropsToName=_;function b(O,A,I){Object.keys(I).forEach(P=>O.assign((0,e._)`${A}${(0,e.getProperty)(P)}`,!0))}ft.setEvaluated=b;const x={};function S(O,A){return O.scopeValue("func",{ref:A,code:x[A.code]||(x[A.code]=new t._Code(A.code))})}ft.useFunc=S;var E;(function(O){O[O.Num=0]="Num",O[O.Str=1]="Str"})(E||(ft.Type=E={}));function T(O,A,I){if(O instanceof e.Name){const P=A===E.Num;return I?P?(0,e._)`"[" + ${O} + "]"`:(0,e._)`"['" + ${O} + "']"`:P?(0,e._)`"/" + ${O}`:(0,e._)`"/" + ${O}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return I?(0,e.getProperty)(O).toString():"/"+p(O)}ft.getErrorPath=T;function R(O,A,I=O.opts.strictSchema){if(I){if(A=`strict mode: ${A}`,I===!0)throw new Error(A);O.self.logger.warn(A)}}return ft.checkStrictMode=R,ft}var Ap={},NI;function wa(){if(NI)return Ap;NI=1,Object.defineProperty(Ap,"__esModule",{value:!0});const e=mt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ap.default=t,Ap}var kI;function hv(){return kI||(kI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=mt(),n=kt(),r=wa();e.keywordError={message:({keyword:x})=>(0,t.str)`must pass "${x}" keyword validation`},e.keyword$DataError={message:({keyword:x,schemaType:S})=>S?(0,t.str)`"${x}" keyword must be ${S} ($data)`:(0,t.str)`"${x}" keyword is invalid ($data)`};function o(x,S=e.keywordError,E,T){const{it:R}=x,{gen:O,compositeRule:A,allErrors:I}=R,P=h(x,S,E);T??(A||I)?d(O,P):f(R,(0,t._)`[${P}]`)}e.reportError=o;function s(x,S=e.keywordError,E){const{it:T}=x,{gen:R,compositeRule:O,allErrors:A}=T,I=h(x,S,E);d(R,I),O||A||f(T,r.default.vErrors)}e.reportExtraError=s;function l(x,S){x.assign(r.default.errors,S),x.if((0,t._)`${r.default.vErrors} !== null`,()=>x.if(S,()=>x.assign((0,t._)`${r.default.vErrors}.length`,S),()=>x.assign(r.default.vErrors,null)))}e.resetErrorsCount=l;function c({gen:x,keyword:S,schemaValue:E,data:T,errsCount:R,it:O}){if(R===void 0)throw new Error("ajv implementation error");const A=x.name("err");x.forRange("i",R,r.default.errors,I=>{x.const(A,(0,t._)`${r.default.vErrors}[${I}]`),x.if((0,t._)`${A}.instancePath === undefined`,()=>x.assign((0,t._)`${A}.instancePath`,(0,t.strConcat)(r.default.instancePath,O.errorPath))),x.assign((0,t._)`${A}.schemaPath`,(0,t.str)`${O.errSchemaPath}/${S}`),O.opts.verbose&&(x.assign((0,t._)`${A}.schema`,E),x.assign((0,t._)`${A}.data`,T))})}e.extendErrors=c;function d(x,S){const E=x.const("err",S);x.if((0,t._)`${r.default.vErrors} === null`,()=>x.assign(r.default.vErrors,(0,t._)`[${E}]`),(0,t._)`${r.default.vErrors}.push(${E})`),x.code((0,t._)`${r.default.errors}++`)}function f(x,S){const{gen:E,validateName:T,schemaEnv:R}=x;R.$async?E.throw((0,t._)`new ${x.ValidationError}(${S})`):(E.assign((0,t._)`${T}.errors`,S),E.return(!1))}const p={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function h(x,S,E){const{createErrors:T}=x.it;return T===!1?(0,t._)`{}`:g(x,S,E)}function g(x,S,E={}){const{gen:T,it:R}=x,O=[v(R,E),_(x,E)];return b(x,S,O),T.object(...O)}function v({errorPath:x},{instancePath:S}){const E=S?(0,t.str)`${x}${(0,n.getErrorPath)(S,n.Type.Str)}`:x;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,E)]}function _({keyword:x,it:{errSchemaPath:S}},{schemaPath:E,parentSchema:T}){let R=T?S:(0,t.str)`${S}/${x}`;return E&&(R=(0,t.str)`${R}${(0,n.getErrorPath)(E,n.Type.Str)}`),[p.schemaPath,R]}function b(x,{params:S,message:E},T){const{keyword:R,data:O,schemaValue:A,it:I}=x,{opts:P,propertyName:L,topSchemaRef:q,schemaPath:j}=I;T.push([p.keyword,R],[p.params,typeof S=="function"?S(x):S||(0,t._)`{}`]),P.messages&&T.push([p.message,typeof E=="function"?E(x):E]),P.verbose&&T.push([p.schema,A],[p.parentSchema,(0,t._)`${q}${j}`],[r.default.data,O]),L&&T.push([p.propertyName,L])}})(mb)),mb}var DI;function Wie(){if(DI)return Ka;DI=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.boolOrEmptySchema=Ka.topBoolOrEmptySchema=void 0;const e=hv(),t=mt(),n=wa(),r={message:"boolean schema is false"};function o(c){const{gen:d,schema:f,validateName:p}=c;f===!1?l(c,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign((0,t._)`${p}.errors`,null),d.return(!0))}Ka.topBoolOrEmptySchema=o;function s(c,d){const{gen:f,schema:p}=c;p===!1?(f.var(d,!1),l(c)):f.var(d,!0)}Ka.boolOrEmptySchema=s;function l(c,d){const{gen:f,data:p}=c,h={gen:f,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(h,r,void 0,d)}return Ka}var fr={},Za={},LI;function z6(){if(LI)return Za;LI=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.getRules=Za.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(o){return typeof o=="string"&&t.has(o)}Za.isJSONType=n;function r(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return Za.getRules=r,Za}var ns={},$I;function U6(){if($I)return ns;$I=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.shouldUseRule=ns.shouldUseGroup=ns.schemaHasRulesForType=void 0;function e({schema:r,self:o},s){const l=o.RULES.types[s];return l&&l!==!0&&t(r,l)}ns.schemaHasRulesForType=e;function t(r,o){return o.rules.some(s=>n(r,s))}ns.shouldUseGroup=t;function n(r,o){var s;return r[o.keyword]!==void 0||((s=o.definition.implements)===null||s===void 0?void 0:s.some(l=>r[l]!==void 0))}return ns.shouldUseRule=n,ns}var jI;function Og(){if(jI)return fr;jI=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.reportTypeError=fr.checkDataTypes=fr.checkDataType=fr.coerceAndCheckDataType=fr.getJSONTypes=fr.getSchemaTypes=fr.DataType=void 0;const e=z6(),t=U6(),n=hv(),r=mt(),o=kt();var s;(function(E){E[E.Correct=0]="Correct",E[E.Wrong=1]="Wrong"})(s||(fr.DataType=s={}));function l(E){const T=c(E.type);if(T.includes("null")){if(E.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!T.length&&E.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');E.nullable===!0&&T.push("null")}return T}fr.getSchemaTypes=l;function c(E){const T=Array.isArray(E)?E:E?[E]:[];if(T.every(e.isJSONType))return T;throw new Error("type must be JSONType or JSONType[]: "+T.join(","))}fr.getJSONTypes=c;function d(E,T){const{gen:R,data:O,opts:A}=E,I=p(T,A.coerceTypes),P=T.length>0&&!(I.length===0&&T.length===1&&(0,t.schemaHasRulesForType)(E,T[0]));if(P){const L=_(T,O,A.strictNumbers,s.Wrong);R.if(L,()=>{I.length?h(E,T,I):x(E)})}return P}fr.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function p(E,T){return T?E.filter(R=>f.has(R)||T==="array"&&R==="array"):[]}function h(E,T,R){const{gen:O,data:A,opts:I}=E,P=O.let("dataType",(0,r._)`typeof ${A}`),L=O.let("coerced",(0,r._)`undefined`);I.coerceTypes==="array"&&O.if((0,r._)`${P} == 'object' && Array.isArray(${A}) && ${A}.length == 1`,()=>O.assign(A,(0,r._)`${A}[0]`).assign(P,(0,r._)`typeof ${A}`).if(_(T,A,I.strictNumbers),()=>O.assign(L,A))),O.if((0,r._)`${L} !== undefined`);for(const j of R)(f.has(j)||j==="array"&&I.coerceTypes==="array")&&q(j);O.else(),x(E),O.endIf(),O.if((0,r._)`${L} !== undefined`,()=>{O.assign(A,L),g(E,L)});function q(j){switch(j){case"string":O.elseIf((0,r._)`${P} == "number" || ${P} == "boolean"`).assign(L,(0,r._)`"" + ${A}`).elseIf((0,r._)`${A} === null`).assign(L,(0,r._)`""`);return;case"number":O.elseIf((0,r._)`${P} == "boolean" || ${A} === null
|
|
158
158
|
|| (${P} == "string" && ${A} && ${A} == +${A})`).assign(L,(0,r._)`+${A}`);return;case"integer":O.elseIf((0,r._)`${P} === "boolean" || ${A} === null
|
|
159
159
|
|| (${P} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(L,(0,r._)`+${A}`);return;case"boolean":O.elseIf((0,r._)`${A} === "false" || ${A} === 0 || ${A} === null`).assign(L,!1).elseIf((0,r._)`${A} === "true" || ${A} === 1`).assign(L,!0);return;case"null":O.elseIf((0,r._)`${A} === "" || ${A} === 0 || ${A} === false`),O.assign(L,null);return;case"array":O.elseIf((0,r._)`${P} === "string" || ${P} === "number"
|
|
160
160
|
|| ${P} === "boolean" || ${A} === null`).assign(L,(0,r._)`[${A}]`)}}}function g({gen:E,parentData:T,parentDataProperty:R},O){E.if((0,r._)`${T} !== undefined`,()=>E.assign((0,r._)`${T}[${R}]`,O))}function v(E,T,R,O=s.Correct){const A=O===s.Correct?r.operators.EQ:r.operators.NEQ;let I;switch(E){case"null":return(0,r._)`${T} ${A} null`;case"array":I=(0,r._)`Array.isArray(${T})`;break;case"object":I=(0,r._)`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":I=P((0,r._)`!(${T} % 1) && !isNaN(${T})`);break;case"number":I=P();break;default:return(0,r._)`typeof ${T} ${A} ${E}`}return O===s.Correct?I:(0,r.not)(I);function P(L=r.nil){return(0,r.and)((0,r._)`typeof ${T} == "number"`,L,R?(0,r._)`isFinite(${T})`:r.nil)}}fr.checkDataType=v;function _(E,T,R,O){if(E.length===1)return v(E[0],T,R,O);let A;const I=(0,o.toHash)(E);if(I.array&&I.object){const P=(0,r._)`typeof ${T} != "object"`;A=I.null?P:(0,r._)`!${T} || ${P}`,delete I.null,delete I.array,delete I.object}else A=r.nil;I.number&&delete I.integer;for(const P in I)A=(0,r.and)(A,v(P,T,R,O));return A}fr.checkDataTypes=_;const b={message:({schema:E})=>`must be ${E}`,params:({schema:E,schemaValue:T})=>typeof E=="string"?(0,r._)`{type: ${E}}`:(0,r._)`{type: ${T}}`};function x(E){const T=S(E);(0,n.reportError)(T,b)}fr.reportTypeError=x;function S(E){const{gen:T,data:R,schema:O}=E,A=(0,o.schemaRefOrVal)(E,O,"type");return{gen:T,keyword:"type",data:R,schema:O.type,schemaCode:A,schemaValue:A,parentSchema:O,params:{},it:E}}return fr}var yd={},zI;function Qie(){if(zI)return yd;zI=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.assignDefaults=void 0;const e=mt(),t=kt();function n(o,s){const{properties:l,items:c}=o.schema;if(s==="object"&&l)for(const d in l)r(o,d,l[d].default);else s==="array"&&Array.isArray(c)&&c.forEach((d,f)=>r(o,f,d.default))}yd.assignDefaults=n;function r(o,s,l){const{gen:c,compositeRule:d,data:f,opts:p}=o;if(l===void 0)return;const h=(0,e._)`${f}${(0,e.getProperty)(s)}`;if(d){(0,t.checkStrictMode)(o,`default is ignored for: ${h}`);return}let g=(0,e._)`${h} === undefined`;p.useDefaults==="empty"&&(g=(0,e._)`${g} || ${h} === null || ${h} === ""`),c.if(g,(0,e._)`${h} = ${(0,e.stringify)(l)}`)}return yd}var Xo={},Ht={},UI;function li(){if(UI)return Ht;UI=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.validateUnion=Ht.validateArray=Ht.usePattern=Ht.callValidateCode=Ht.schemaProperties=Ht.allSchemaProperties=Ht.noPropertyInData=Ht.propertyInData=Ht.isOwnProperty=Ht.hasPropFunc=Ht.reportMissingProp=Ht.checkMissingProp=Ht.checkReportMissingProp=void 0;const e=mt(),t=kt(),n=wa(),r=kt();function o(E,T){const{gen:R,data:O,it:A}=E;R.if(p(R,O,T,A.opts.ownProperties),()=>{E.setParams({missingProperty:(0,e._)`${T}`},!0),E.error()})}Ht.checkReportMissingProp=o;function s({gen:E,data:T,it:{opts:R}},O,A){return(0,e.or)(...O.map(I=>(0,e.and)(p(E,T,I,R.ownProperties),(0,e._)`${A} = ${I}`)))}Ht.checkMissingProp=s;function l(E,T){E.setParams({missingProperty:T},!0),E.error()}Ht.reportMissingProp=l;function c(E){return E.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Ht.hasPropFunc=c;function d(E,T,R){return(0,e._)`${c(E)}.call(${T}, ${R})`}Ht.isOwnProperty=d;function f(E,T,R,O){const A=(0,e._)`${T}${(0,e.getProperty)(R)} !== undefined`;return O?(0,e._)`${A} && ${d(E,T,R)}`:A}Ht.propertyInData=f;function p(E,T,R,O){const A=(0,e._)`${T}${(0,e.getProperty)(R)} === undefined`;return O?(0,e.or)(A,(0,e.not)(d(E,T,R))):A}Ht.noPropertyInData=p;function h(E){return E?Object.keys(E).filter(T=>T!=="__proto__"):[]}Ht.allSchemaProperties=h;function g(E,T){return h(T).filter(R=>!(0,t.alwaysValidSchema)(E,T[R]))}Ht.schemaProperties=g;function v({schemaCode:E,data:T,it:{gen:R,topSchemaRef:O,schemaPath:A,errorPath:I},it:P},L,q,j){const B=j?(0,e._)`${E}, ${T}, ${O}${A}`:T,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,I)],[n.default.parentData,P.parentData],[n.default.parentDataProperty,P.parentDataProperty],[n.default.rootData,n.default.rootData]];P.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const Z=(0,e._)`${B}, ${R.object(...F)}`;return q!==e.nil?(0,e._)`${L}.call(${q}, ${Z})`:(0,e._)`${L}(${Z})`}Ht.callValidateCode=v;const _=(0,e._)`new RegExp`;function b({gen:E,it:{opts:T}},R){const O=T.unicodeRegExp?"u":"",{regExp:A}=T.code,I=A(R,O);return E.scopeValue("pattern",{key:I.toString(),ref:I,code:(0,e._)`${A.code==="new RegExp"?_:(0,r.useFunc)(E,A)}(${R}, ${O})`})}Ht.usePattern=b;function x(E){const{gen:T,data:R,keyword:O,it:A}=E,I=T.name("valid");if(A.allErrors){const L=T.let("valid",!0);return P(()=>T.assign(L,!1)),L}return T.var(I,!0),P(()=>T.break()),I;function P(L){const q=T.const("len",(0,e._)`${R}.length`);T.forRange("i",0,q,j=>{E.subschema({keyword:O,dataProp:j,dataPropType:t.Type.Num},I),T.if((0,e.not)(I),L)})}}Ht.validateArray=x;function S(E){const{gen:T,schema:R,keyword:O,it:A}=E;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(q=>(0,t.alwaysValidSchema)(A,q))&&!A.opts.unevaluated)return;const P=T.let("valid",!1),L=T.name("_valid");T.block(()=>R.forEach((q,j)=>{const B=E.subschema({keyword:O,schemaProp:j,compositeRule:!0},L);T.assign(P,(0,e._)`${P} || ${L}`),E.mergeValidEvaluated(B,L)||T.if((0,e.not)(P))})),E.result(P,()=>E.reset(),()=>E.error(!0))}return Ht.validateUnion=S,Ht}var FI;function Xie(){if(FI)return Xo;FI=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.validateKeywordUsage=Xo.validSchemaType=Xo.funcKeywordCode=Xo.macroKeywordCode=void 0;const e=mt(),t=wa(),n=li(),r=hv();function o(g,v){const{gen:_,keyword:b,schema:x,parentSchema:S,it:E}=g,T=v.macro.call(E.self,x,S,E),R=f(_,b,T);E.opts.validateSchema!==!1&&E.self.validateSchema(T,!0);const O=_.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${E.errSchemaPath}/${b}`,topSchemaRef:R,compositeRule:!0},O),g.pass(O,()=>g.error(!0))}Xo.macroKeywordCode=o;function s(g,v){var _;const{gen:b,keyword:x,schema:S,parentSchema:E,$data:T,it:R}=g;d(R,v);const O=!T&&v.compile?v.compile.call(R.self,S,E,R):v.validate,A=f(b,x,O),I=b.let("valid");g.block$data(I,P),g.ok((_=v.valid)!==null&&_!==void 0?_:I);function P(){if(v.errors===!1)j(),v.modifying&&l(g),B(()=>g.error());else{const F=v.async?L():q();v.modifying&&l(g),B(()=>c(g,F))}}function L(){const F=b.let("ruleErrs",null);return b.try(()=>j((0,e._)`await `),Z=>b.assign(I,!1).if((0,e._)`${Z} instanceof ${R.ValidationError}`,()=>b.assign(F,(0,e._)`${Z}.errors`),()=>b.throw(Z))),F}function q(){const F=(0,e._)`${A}.errors`;return b.assign(F,null),j(e.nil),F}function j(F=v.async?(0,e._)`await `:e.nil){const Z=R.opts.passContext?t.default.this:t.default.self,ie=!("compile"in v&&!T||v.schema===!1);b.assign(I,(0,e._)`${F}${(0,n.callValidateCode)(g,A,Z,ie)}`,v.modifying)}function B(F){var Z;b.if((0,e.not)((Z=v.valid)!==null&&Z!==void 0?Z:I),F)}}Xo.funcKeywordCode=s;function l(g){const{gen:v,data:_,it:b}=g;v.if(b.parentData,()=>v.assign(_,(0,e._)`${b.parentData}[${b.parentDataProperty}]`))}function c(g,v){const{gen:_}=g;_.if((0,e._)`Array.isArray(${v})`,()=>{_.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(g)},()=>g.error())}function d({schemaEnv:g},v){if(v.async&&!g.$async)throw new Error("async keyword in sync schema")}function f(g,v,_){if(_===void 0)throw new Error(`keyword "${v}" failed to compile`);return g.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,e.stringify)(_)})}function p(g,v,_=!1){return!v.length||v.some(b=>b==="array"?Array.isArray(g):b==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==b||_&&typeof g>"u")}Xo.validSchemaType=p;function h({schema:g,opts:v,self:_,errSchemaPath:b},x,S){if(Array.isArray(x.keyword)?!x.keyword.includes(S):x.keyword!==S)throw new Error("ajv implementation error");const E=x.dependencies;if(E?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw new Error(`parent schema must have dependencies of ${S}: ${E.join(",")}`);if(x.validateSchema&&!x.validateSchema(g[S])){const R=`keyword "${S}" value is invalid at path "${b}": `+_.errorsText(x.validateSchema.errors);if(v.validateSchema==="log")_.logger.error(R);else throw new Error(R)}}return Xo.validateKeywordUsage=h,Xo}var rs={},BI;function Jie(){if(BI)return rs;BI=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.extendSubschemaMode=rs.extendSubschemaData=rs.getSubschema=void 0;const e=mt(),t=kt();function n(s,{keyword:l,schemaProp:c,schema:d,schemaPath:f,errSchemaPath:p,topSchemaRef:h}){if(l!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const g=s.schema[l];return c===void 0?{schema:g,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${l}`}:{schema:g[c],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(c)}`,errSchemaPath:`${s.errSchemaPath}/${l}/${(0,t.escapeFragment)(c)}`}}if(d!==void 0){if(f===void 0||p===void 0||h===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:h,errSchemaPath:p}}throw new Error('either "keyword" or "schema" must be passed')}rs.getSubschema=n;function r(s,l,{dataProp:c,dataPropType:d,data:f,dataTypes:p,propertyName:h}){if(f!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:g}=l;if(c!==void 0){const{errorPath:_,dataPathArr:b,opts:x}=l,S=g.let("data",(0,e._)`${l.data}${(0,e.getProperty)(c)}`,!0);v(S),s.errorPath=(0,e.str)`${_}${(0,t.getErrorPath)(c,d,x.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${c}`,s.dataPathArr=[...b,s.parentDataProperty]}if(f!==void 0){const _=f instanceof e.Name?f:g.let("data",f,!0);v(_),h!==void 0&&(s.propertyName=h)}p&&(s.dataTypes=p);function v(_){s.data=_,s.dataLevel=l.dataLevel+1,s.dataTypes=[],l.definedProperties=new Set,s.parentData=l.data,s.dataNames=[...l.dataNames,_]}}rs.extendSubschemaData=r;function o(s,{jtdDiscriminator:l,jtdMetadata:c,compositeRule:d,createErrors:f,allErrors:p}){d!==void 0&&(s.compositeRule=d),f!==void 0&&(s.createErrors=f),p!==void 0&&(s.allErrors=p),s.jtdDiscriminator=l,s.jtdMetadata=c}return rs.extendSubschemaMode=o,rs}var kr={},_b,VI;function F6(){return VI||(VI=1,_b=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var l=s[o];if(!e(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}),_b}var bb={exports:{}},qI;function ese(){if(qI)return bb.exports;qI=1;var e=bb.exports=function(r,o,s){typeof o=="function"&&(s=o,o={}),s=o.cb||s;var l=typeof s=="function"?s:s.pre||function(){},c=s.post||function(){};t(o,l,c,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,o,s,l,c,d,f,p,h,g){if(l&&typeof l=="object"&&!Array.isArray(l)){o(l,c,d,f,p,h,g);for(var v in l){var _=l[v];if(Array.isArray(_)){if(v in e.arrayKeywords)for(var b=0;b<_.length;b++)t(r,o,s,_[b],c+"/"+v+"/"+b,d,c,v,l,b)}else if(v in e.propsKeywords){if(_&&typeof _=="object")for(var x in _)t(r,o,s,_[x],c+"/"+v+"/"+n(x),d,c,v,l,x)}else(v in e.keywords||r.allKeys&&!(v in e.skipKeywords))&&t(r,o,s,_,c+"/"+v,d,c,v,l)}s(l,c,d,f,p,h,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return bb.exports}var HI;function pv(){if(HI)return kr;HI=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.getSchemaRefs=kr.resolveUrl=kr.normalizeId=kr._getFullPath=kr.getFullPath=kr.inlineRef=void 0;const e=kt(),t=F6(),n=ese(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(b,x=!0){return typeof b=="boolean"?!0:x===!0?!l(b):x?c(b)<=x:!1}kr.inlineRef=o;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(b){for(const x in b){if(s.has(x))return!0;const S=b[x];if(Array.isArray(S)&&S.some(l)||typeof S=="object"&&l(S))return!0}return!1}function c(b){let x=0;for(const S in b){if(S==="$ref")return 1/0;if(x++,!r.has(S)&&(typeof b[S]=="object"&&(0,e.eachItem)(b[S],E=>x+=c(E)),x===1/0))return 1/0}return x}function d(b,x="",S){S!==!1&&(x=h(x));const E=b.parse(x);return f(b,E)}kr.getFullPath=d;function f(b,x){return b.serialize(x).split("#")[0]+"#"}kr._getFullPath=f;const p=/#\/?$/;function h(b){return b?b.replace(p,""):""}kr.normalizeId=h;function g(b,x,S){return S=h(S),b.resolve(x,S)}kr.resolveUrl=g;const v=/^[a-z_][-a-z0-9._]*$/i;function _(b,x){if(typeof b=="boolean")return{};const{schemaId:S,uriResolver:E}=this.opts,T=h(b[S]||x),R={"":T},O=d(E,T,!1),A={},I=new Set;return n(b,{allKeys:!0},(q,j,B,F)=>{if(F===void 0)return;const Z=O+j;let ie=R[F];typeof q[S]=="string"&&(ie=H.call(this,q[S])),W.call(this,q.$anchor),W.call(this,q.$dynamicAnchor),R[j]=ie;function H(te){const le=this.opts.uriResolver.resolve;if(te=h(ie?le(ie,te):te),I.has(te))throw L(te);I.add(te);let Q=this.refs[te];return typeof Q=="string"&&(Q=this.refs[Q]),typeof Q=="object"?P(q,Q.schema,te):te!==h(Z)&&(te[0]==="#"?(P(q,A[te],te),A[te]=q):this.refs[te]=Z),te}function W(te){if(typeof te=="string"){if(!v.test(te))throw new Error(`invalid anchor "${te}"`);H.call(this,`#${te}`)}}}),A;function P(q,j,B){if(j!==void 0&&!t(q,j))throw L(B)}function L(q){return new Error(`reference "${q}" resolves to more than one schema`)}}return kr.getSchemaRefs=_,kr}var GI;function mv(){if(GI)return ts;GI=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.getData=ts.KeywordCxt=ts.validateFunctionCode=void 0;const e=Wie(),t=Og(),n=U6(),r=Og(),o=Qie(),s=Xie(),l=Jie(),c=mt(),d=wa(),f=pv(),p=kt(),h=hv();function g(Y){if(O(Y)&&(I(Y),R(Y))){x(Y);return}v(Y,()=>(0,e.topBoolOrEmptySchema)(Y))}ts.validateFunctionCode=g;function v({gen:Y,validateName:re,schema:ve,schemaEnv:se,opts:Se},Te){Se.code.es5?Y.func(re,(0,c._)`${d.default.data}, ${d.default.valCxt}`,se.$async,()=>{Y.code((0,c._)`"use strict"; ${E(ve,Se)}`),b(Y,Se),Y.code(Te)}):Y.func(re,(0,c._)`${d.default.data}, ${_(Se)}`,se.$async,()=>Y.code(E(ve,Se)).code(Te))}function _(Y){return(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${Y.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}function b(Y,re){Y.if(d.default.valCxt,()=>{Y.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),Y.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),Y.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),Y.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),re.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{Y.var(d.default.instancePath,(0,c._)`""`),Y.var(d.default.parentData,(0,c._)`undefined`),Y.var(d.default.parentDataProperty,(0,c._)`undefined`),Y.var(d.default.rootData,d.default.data),re.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,c._)`{}`)})}function x(Y){const{schema:re,opts:ve,gen:se}=Y;v(Y,()=>{ve.$comment&&re.$comment&&F(Y),q(Y),se.let(d.default.vErrors,null),se.let(d.default.errors,0),ve.unevaluated&&S(Y),P(Y),Z(Y)})}function S(Y){const{gen:re,validateName:ve}=Y;Y.evaluated=re.const("evaluated",(0,c._)`${ve}.evaluated`),re.if((0,c._)`${Y.evaluated}.dynamicProps`,()=>re.assign((0,c._)`${Y.evaluated}.props`,(0,c._)`undefined`)),re.if((0,c._)`${Y.evaluated}.dynamicItems`,()=>re.assign((0,c._)`${Y.evaluated}.items`,(0,c._)`undefined`))}function E(Y,re){const ve=typeof Y=="object"&&Y[re.schemaId];return ve&&(re.code.source||re.code.process)?(0,c._)`/*# sourceURL=${ve} */`:c.nil}function T(Y,re){if(O(Y)&&(I(Y),R(Y))){A(Y,re);return}(0,e.boolOrEmptySchema)(Y,re)}function R({schema:Y,self:re}){if(typeof Y=="boolean")return!Y;for(const ve in Y)if(re.RULES.all[ve])return!0;return!1}function O(Y){return typeof Y.schema!="boolean"}function A(Y,re){const{schema:ve,gen:se,opts:Se}=Y;Se.$comment&&ve.$comment&&F(Y),j(Y),B(Y);const Te=se.const("_errs",d.default.errors);P(Y,Te),se.var(re,(0,c._)`${Te} === ${d.default.errors}`)}function I(Y){(0,p.checkUnknownRules)(Y),L(Y)}function P(Y,re){if(Y.opts.jtd)return H(Y,[],!1,re);const ve=(0,t.getSchemaTypes)(Y.schema),se=(0,t.coerceAndCheckDataType)(Y,ve);H(Y,ve,!se,re)}function L(Y){const{schema:re,errSchemaPath:ve,opts:se,self:Se}=Y;re.$ref&&se.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(re,Se.RULES)&&Se.logger.warn(`$ref: keywords ignored in schema at path "${ve}"`)}function q(Y){const{schema:re,opts:ve}=Y;re.default!==void 0&&ve.useDefaults&&ve.strictSchema&&(0,p.checkStrictMode)(Y,"default is ignored in the schema root")}function j(Y){const re=Y.schema[Y.opts.schemaId];re&&(Y.baseId=(0,f.resolveUrl)(Y.opts.uriResolver,Y.baseId,re))}function B(Y){if(Y.schema.$async&&!Y.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:Y,schemaEnv:re,schema:ve,errSchemaPath:se,opts:Se}){const Te=ve.$comment;if(Se.$comment===!0)Y.code((0,c._)`${d.default.self}.logger.log(${Te})`);else if(typeof Se.$comment=="function"){const tt=(0,c.str)`${se}/$comment`,rt=Y.scopeValue("root",{ref:re.root});Y.code((0,c._)`${d.default.self}.opts.$comment(${Te}, ${tt}, ${rt}.schema)`)}}function Z(Y){const{gen:re,schemaEnv:ve,validateName:se,ValidationError:Se,opts:Te}=Y;ve.$async?re.if((0,c._)`${d.default.errors} === 0`,()=>re.return(d.default.data),()=>re.throw((0,c._)`new ${Se}(${d.default.vErrors})`)):(re.assign((0,c._)`${se}.errors`,d.default.vErrors),Te.unevaluated&&ie(Y),re.return((0,c._)`${d.default.errors} === 0`))}function ie({gen:Y,evaluated:re,props:ve,items:se}){ve instanceof c.Name&&Y.assign((0,c._)`${re}.props`,ve),se instanceof c.Name&&Y.assign((0,c._)`${re}.items`,se)}function H(Y,re,ve,se){const{gen:Se,schema:Te,data:tt,allErrors:rt,opts:Be,self:Qe}=Y,{RULES:Pe}=Qe;if(Te.$ref&&(Be.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(Te,Pe))){Se.block(()=>fe(Y,"$ref",Pe.all.$ref.definition));return}Be.jtd||te(Y,re),Se.block(()=>{for(const Ue of Pe.rules)Me(Ue);Me(Pe.post)});function Me(Ue){(0,n.shouldUseGroup)(Te,Ue)&&(Ue.type?(Se.if((0,r.checkDataType)(Ue.type,tt,Be.strictNumbers)),W(Y,Ue),re.length===1&&re[0]===Ue.type&&ve&&(Se.else(),(0,r.reportTypeError)(Y)),Se.endIf()):W(Y,Ue),rt||Se.if((0,c._)`${d.default.errors} === ${se||0}`))}}function W(Y,re){const{gen:ve,schema:se,opts:{useDefaults:Se}}=Y;Se&&(0,o.assignDefaults)(Y,re.type),ve.block(()=>{for(const Te of re.rules)(0,n.shouldUseRule)(se,Te)&&fe(Y,Te.keyword,Te.definition,re.type)})}function te(Y,re){Y.schemaEnv.meta||!Y.opts.strictTypes||(le(Y,re),Y.opts.allowUnionTypes||Q(Y,re),k(Y,Y.dataTypes))}function le(Y,re){if(re.length){if(!Y.dataTypes.length){Y.dataTypes=re;return}re.forEach(ve=>{V(Y.dataTypes,ve)||U(Y,`type "${ve}" not allowed by context "${Y.dataTypes.join(",")}"`)}),D(Y,re)}}function Q(Y,re){re.length>1&&!(re.length===2&&re.includes("null"))&&U(Y,"use allowUnionTypes to allow union type keyword")}function k(Y,re){const ve=Y.self.RULES.all;for(const se in ve){const Se=ve[se];if(typeof Se=="object"&&(0,n.shouldUseRule)(Y.schema,Se)){const{type:Te}=Se.definition;Te.length&&!Te.some(tt=>G(re,tt))&&U(Y,`missing type "${Te.join(",")}" for keyword "${se}"`)}}}function G(Y,re){return Y.includes(re)||re==="number"&&Y.includes("integer")}function V(Y,re){return Y.includes(re)||re==="integer"&&Y.includes("number")}function D(Y,re){const ve=[];for(const se of Y.dataTypes)V(re,se)?ve.push(se):re.includes("integer")&&se==="number"&&ve.push("integer");Y.dataTypes=ve}function U(Y,re){const ve=Y.schemaEnv.baseId+Y.errSchemaPath;re+=` at "${ve}" (strictTypes)`,(0,p.checkStrictMode)(Y,re,Y.opts.strictTypes)}class X{constructor(re,ve,se){if((0,s.validateKeywordUsage)(re,ve,se),this.gen=re.gen,this.allErrors=re.allErrors,this.keyword=se,this.data=re.data,this.schema=re.schema[se],this.$data=ve.$data&&re.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(re,this.schema,se,this.$data),this.schemaType=ve.schemaType,this.parentSchema=re.schema,this.params={},this.it=re,this.def=ve,this.$data)this.schemaCode=re.gen.const("vSchema",je(this.$data,re));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,ve.schemaType,ve.allowUndefined))throw new Error(`${se} value must be ${JSON.stringify(ve.schemaType)}`);("code"in ve?ve.trackErrors:ve.errors!==!1)&&(this.errsCount=re.gen.const("_errs",d.default.errors))}result(re,ve,se){this.failResult((0,c.not)(re),ve,se)}failResult(re,ve,se){this.gen.if(re),se?se():this.error(),ve?(this.gen.else(),ve(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(re,ve){this.failResult((0,c.not)(re),void 0,ve)}fail(re){if(re===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(re),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(re){if(!this.$data)return this.fail(re);const{schemaCode:ve}=this;this.fail((0,c._)`${ve} !== undefined && (${(0,c.or)(this.invalid$data(),re)})`)}error(re,ve,se){if(ve){this.setParams(ve),this._error(re,se),this.setParams({});return}this._error(re,se)}_error(re,ve){(re?h.reportExtraError:h.reportError)(this,this.def.error,ve)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(re){this.allErrors||this.gen.if(re)}setParams(re,ve){ve?Object.assign(this.params,re):this.params=re}block$data(re,ve,se=c.nil){this.gen.block(()=>{this.check$data(re,se),ve()})}check$data(re=c.nil,ve=c.nil){if(!this.$data)return;const{gen:se,schemaCode:Se,schemaType:Te,def:tt}=this;se.if((0,c.or)((0,c._)`${Se} === undefined`,ve)),re!==c.nil&&se.assign(re,!0),(Te.length||tt.validateSchema)&&(se.elseIf(this.invalid$data()),this.$dataError(),re!==c.nil&&se.assign(re,!1)),se.else()}invalid$data(){const{gen:re,schemaCode:ve,schemaType:se,def:Se,it:Te}=this;return(0,c.or)(tt(),rt());function tt(){if(se.length){if(!(ve instanceof c.Name))throw new Error("ajv implementation error");const Be=Array.isArray(se)?se:[se];return(0,c._)`${(0,r.checkDataTypes)(Be,ve,Te.opts.strictNumbers,r.DataType.Wrong)}`}return c.nil}function rt(){if(Se.validateSchema){const Be=re.scopeValue("validate$data",{ref:Se.validateSchema});return(0,c._)`!${Be}(${ve})`}return c.nil}}subschema(re,ve){const se=(0,l.getSubschema)(this.it,re);(0,l.extendSubschemaData)(se,this.it,re),(0,l.extendSubschemaMode)(se,re);const Se={...this.it,...se,items:void 0,props:void 0};return T(Se,ve),Se}mergeEvaluated(re,ve){const{it:se,gen:Se}=this;se.opts.unevaluated&&(se.props!==!0&&re.props!==void 0&&(se.props=p.mergeEvaluated.props(Se,re.props,se.props,ve)),se.items!==!0&&re.items!==void 0&&(se.items=p.mergeEvaluated.items(Se,re.items,se.items,ve)))}mergeValidEvaluated(re,ve){const{it:se,gen:Se}=this;if(se.opts.unevaluated&&(se.props!==!0||se.items!==!0))return Se.if(ve,()=>this.mergeEvaluated(re,c.Name)),!0}}ts.KeywordCxt=X;function fe(Y,re,ve,se){const Se=new X(Y,ve,re);"code"in ve?ve.code(Se,se):Se.$data&&ve.validate?(0,s.funcKeywordCode)(Se,ve):"macro"in ve?(0,s.macroKeywordCode)(Se,ve):(ve.compile||ve.validate)&&(0,s.funcKeywordCode)(Se,ve)}const pe=/^\/(?:[^~]|~0|~1)*$/,xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function je(Y,{dataLevel:re,dataNames:ve,dataPathArr:se}){let Se,Te;if(Y==="")return d.default.rootData;if(Y[0]==="/"){if(!pe.test(Y))throw new Error(`Invalid JSON-pointer: ${Y}`);Se=Y,Te=d.default.rootData}else{const Qe=xe.exec(Y);if(!Qe)throw new Error(`Invalid JSON-pointer: ${Y}`);const Pe=+Qe[1];if(Se=Qe[2],Se==="#"){if(Pe>=re)throw new Error(Be("property/index",Pe));return se[re-Pe]}if(Pe>re)throw new Error(Be("data",Pe));if(Te=ve[re-Pe],!Se)return Te}let tt=Te;const rt=Se.split("/");for(const Qe of rt)Qe&&(Te=(0,c._)`${Te}${(0,c.getProperty)((0,p.unescapeJsonPointer)(Qe))}`,tt=(0,c._)`${tt} && ${Te}`);return tt;function Be(Qe,Pe){return`Cannot access ${Qe} ${Pe} levels up, current level is ${re}`}}return ts.getData=je,ts}var Ip={},KI;function uE(){if(KI)return Ip;KI=1,Object.defineProperty(Ip,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Ip.default=e,Ip}var Mp={},ZI;function gv(){if(ZI)return Mp;ZI=1,Object.defineProperty(Mp,"__esModule",{value:!0});const e=pv();class t extends Error{constructor(r,o,s,l){super(l||`can't resolve reference ${s} from id ${o}`),this.missingRef=(0,e.resolveUrl)(r,o,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Mp.default=t,Mp}var lo={},YI;function dE(){if(YI)return lo;YI=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.resolveSchema=lo.getCompilingSchema=lo.resolveRef=lo.compileSchema=lo.SchemaEnv=void 0;const e=mt(),t=uE(),n=wa(),r=pv(),o=kt(),s=mv();class l{constructor(S){var E;this.refs={},this.dynamicAnchors={};let T;typeof S.schema=="object"&&(T=S.schema),this.schema=S.schema,this.schemaId=S.schemaId,this.root=S.root||this,this.baseId=(E=S.baseId)!==null&&E!==void 0?E:(0,r.normalizeId)(T?.[S.schemaId||"$id"]),this.schemaPath=S.schemaPath,this.localRefs=S.localRefs,this.meta=S.meta,this.$async=T?.$async,this.refs={}}}lo.SchemaEnv=l;function c(x){const S=p.call(this,x);if(S)return S;const E=(0,r.getFullPath)(this.opts.uriResolver,x.root.baseId),{es5:T,lines:R}=this.opts.code,{ownProperties:O}=this.opts,A=new e.CodeGen(this.scope,{es5:T,lines:R,ownProperties:O});let I;x.$async&&(I=A.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const P=A.scopeName("validate");x.validateName=P;const L={gen:A,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:x.schema,code:(0,e.stringify)(x.schema)}:{ref:x.schema}),validateName:P,ValidationError:I,schema:x.schema,schemaEnv:x,rootId:E,baseId:x.baseId||E,schemaPath:e.nil,errSchemaPath:x.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let q;try{this._compilations.add(x),(0,s.validateFunctionCode)(L),A.optimize(this.opts.code.optimize);const j=A.toString();q=`${A.scopeRefs(n.default.scope)}return ${j}`,this.opts.code.process&&(q=this.opts.code.process(q,x));const F=new Function(`${n.default.self}`,`${n.default.scope}`,q)(this,this.scope.get());if(this.scope.value(P,{ref:F}),F.errors=null,F.schema=x.schema,F.schemaEnv=x,x.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:P,validateCode:j,scopeValues:A._values}),this.opts.unevaluated){const{props:Z,items:ie}=L;F.evaluated={props:Z instanceof e.Name?void 0:Z,items:ie instanceof e.Name?void 0:ie,dynamicProps:Z instanceof e.Name,dynamicItems:ie instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return x.validate=F,x}catch(j){throw delete x.validate,delete x.validateName,q&&this.logger.error("Error compiling schema, function code:",q),j}finally{this._compilations.delete(x)}}lo.compileSchema=c;function d(x,S,E){var T;E=(0,r.resolveUrl)(this.opts.uriResolver,S,E);const R=x.refs[E];if(R)return R;let O=g.call(this,x,E);if(O===void 0){const A=(T=x.localRefs)===null||T===void 0?void 0:T[E],{schemaId:I}=this.opts;A&&(O=new l({schema:A,schemaId:I,root:x,baseId:S}))}if(O!==void 0)return x.refs[E]=f.call(this,O)}lo.resolveRef=d;function f(x){return(0,r.inlineRef)(x.schema,this.opts.inlineRefs)?x.schema:x.validate?x:c.call(this,x)}function p(x){for(const S of this._compilations)if(h(S,x))return S}lo.getCompilingSchema=p;function h(x,S){return x.schema===S.schema&&x.root===S.root&&x.baseId===S.baseId}function g(x,S){let E;for(;typeof(E=this.refs[S])=="string";)S=E;return E||this.schemas[S]||v.call(this,x,S)}function v(x,S){const E=this.opts.uriResolver.parse(S),T=(0,r._getFullPath)(this.opts.uriResolver,E);let R=(0,r.getFullPath)(this.opts.uriResolver,x.baseId,void 0);if(Object.keys(x.schema).length>0&&T===R)return b.call(this,E,x);const O=(0,r.normalizeId)(T),A=this.refs[O]||this.schemas[O];if(typeof A=="string"){const I=v.call(this,x,A);return typeof I?.schema!="object"?void 0:b.call(this,E,I)}if(typeof A?.schema=="object"){if(A.validate||c.call(this,A),O===(0,r.normalizeId)(S)){const{schema:I}=A,{schemaId:P}=this.opts,L=I[P];return L&&(R=(0,r.resolveUrl)(this.opts.uriResolver,R,L)),new l({schema:I,schemaId:P,root:x,baseId:R})}return b.call(this,E,A)}}lo.resolveSchema=v;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(x,{baseId:S,schema:E,root:T}){var R;if(((R=x.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(const I of x.fragment.slice(1).split("/")){if(typeof E=="boolean")return;const P=E[(0,o.unescapeFragment)(I)];if(P===void 0)return;E=P;const L=typeof E=="object"&&E[this.opts.schemaId];!_.has(I)&&L&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,L))}let O;if(typeof E!="boolean"&&E.$ref&&!(0,o.schemaHasRulesButRef)(E,this.RULES)){const I=(0,r.resolveUrl)(this.opts.uriResolver,S,E.$ref);O=v.call(this,T,I)}const{schemaId:A}=this.opts;if(O=O||new l({schema:E,schemaId:A,root:T,baseId:S}),O.schema!==O.root.schema)return O}return lo}const tse="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",nse="Meta-schema for $data reference (JSON AnySchema extension proposal)",rse="object",ose=["$data"],ise={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},sse=!1,ase={$id:tse,description:nse,type:rse,required:ose,properties:ise,additionalProperties:sse};var Pp={},_d={exports:{}},wb,WI;function B6(){if(WI)return wb;WI=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(g){let v="",_=0,b=0;for(b=0;b<g.length;b++)if(_=g[b].charCodeAt(0),_!==48){if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";v+=g[b];break}for(b+=1;b<g.length;b++){if(_=g[b].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";v+=g[b]}return v}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(g){return g.length=0,!0}function s(g,v,_){if(g.length){const b=n(g);if(b!=="")v.push(b);else return _.error=!0,!1;g.length=0}return!0}function l(g){let v=0;const _={error:!1,address:"",zone:""},b=[],x=[];let S=!1,E=!1,T=s;for(let R=0;R<g.length;R++){const O=g[R];if(!(O==="["||O==="]"))if(O===":"){if(S===!0&&(E=!0),!T(x,b,_))break;if(++v>7){_.error=!0;break}R>0&&g[R-1]===":"&&(S=!0),b.push(":");continue}else if(O==="%"){if(!T(x,b,_))break;T=o}else{x.push(O);continue}}return x.length&&(T===o?_.zone=x.join(""):E?b.push(x.join("")):b.push(n(x))),_.address=b.join(""),_}function c(g){if(d(g,":")<2)return{host:g,isIPV6:!1};const v=l(g);if(v.error)return{host:g,isIPV6:!1};{let _=v.address,b=v.address;return v.zone&&(_+="%"+v.zone,b+="%25"+v.zone),{host:_,isIPV6:!0,escapedHost:b}}}function d(g,v){let _=0;for(let b=0;b<g.length;b++)g[b]===v&&_++;return _}function f(g){let v=g;const _=[];let b=-1,x=0;for(;x=v.length;){if(x===1){if(v===".")break;if(v==="/"){_.push("/");break}else{_.push(v);break}}else if(x===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){_.push("/");break}}else if(x===3&&v==="/.."){_.length!==0&&_.pop(),_.push("/");break}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."&&v[3]==="/"){v=v.slice(3),_.length!==0&&_.pop();continue}}if((b=v.indexOf("/",1))===-1){_.push(v);break}else _.push(v.slice(0,b)),v=v.slice(b)}return _.join("")}function p(g,v){const _=v!==!0?escape:unescape;return g.scheme!==void 0&&(g.scheme=_(g.scheme)),g.userinfo!==void 0&&(g.userinfo=_(g.userinfo)),g.host!==void 0&&(g.host=_(g.host)),g.path!==void 0&&(g.path=_(g.path)),g.query!==void 0&&(g.query=_(g.query)),g.fragment!==void 0&&(g.fragment=_(g.fragment)),g}function h(g){const v=[];if(g.userinfo!==void 0&&(v.push(g.userinfo),v.push("@")),g.host!==void 0){let _=unescape(g.host);if(!t(_)){const b=c(_);b.isIPV6===!0?_=`[${b.escapedHost}]`:_=g.host}v.push(_)}return(typeof g.port=="number"||typeof g.port=="string")&&(v.push(":"),v.push(String(g.port))),v.length?v.join(""):void 0}return wb={nonSimpleDomain:r,recomposeAuthority:h,normalizeComponentEncoding:p,removeDotSegments:f,isIPv4:t,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:n},wb}var Sb,QI;function lse(){if(QI)return Sb;QI=1;const{isUUID:e}=B6(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(O){return n.indexOf(O)!==-1}function o(O){return O.secure===!0?!0:O.secure===!1?!1:O.scheme?O.scheme.length===3&&(O.scheme[0]==="w"||O.scheme[0]==="W")&&(O.scheme[1]==="s"||O.scheme[1]==="S")&&(O.scheme[2]==="s"||O.scheme[2]==="S"):!1}function s(O){return O.host||(O.error=O.error||"HTTP URIs must have a host."),O}function l(O){const A=String(O.scheme).toLowerCase()==="https";return(O.port===(A?443:80)||O.port==="")&&(O.port=void 0),O.path||(O.path="/"),O}function c(O){return O.secure=o(O),O.resourceName=(O.path||"/")+(O.query?"?"+O.query:""),O.path=void 0,O.query=void 0,O}function d(O){if((O.port===(o(O)?443:80)||O.port==="")&&(O.port=void 0),typeof O.secure=="boolean"&&(O.scheme=O.secure?"wss":"ws",O.secure=void 0),O.resourceName){const[A,I]=O.resourceName.split("?");O.path=A&&A!=="/"?A:void 0,O.query=I,O.resourceName=void 0}return O.fragment=void 0,O}function f(O,A){if(!O.path)return O.error="URN can not be parsed",O;const I=O.path.match(t);if(I){const P=A.scheme||O.scheme||"urn";O.nid=I[1].toLowerCase(),O.nss=I[2];const L=`${P}:${A.nid||O.nid}`,q=R(L);O.path=void 0,q&&(O=q.parse(O,A))}else O.error=O.error||"URN can not be parsed.";return O}function p(O,A){if(O.nid===void 0)throw new Error("URN without nid cannot be serialized");const I=A.scheme||O.scheme||"urn",P=O.nid.toLowerCase(),L=`${I}:${A.nid||P}`,q=R(L);q&&(O=q.serialize(O,A));const j=O,B=O.nss;return j.path=`${P||A.nid}:${B}`,A.skipEscape=!0,j}function h(O,A){const I=O;return I.uuid=I.nss,I.nss=void 0,!A.tolerant&&(!I.uuid||!e(I.uuid))&&(I.error=I.error||"UUID is not valid."),I}function g(O){const A=O;return A.nss=(O.uuid||"").toLowerCase(),A}const v={scheme:"http",domainHost:!0,parse:s,serialize:l},_={scheme:"https",domainHost:v.domainHost,parse:s,serialize:l},b={scheme:"ws",domainHost:!0,parse:c,serialize:d},x={scheme:"wss",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize},T={http:v,https:_,ws:b,wss:x,urn:{scheme:"urn",parse:f,serialize:p,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(T,null);function R(O){return O&&(T[O]||T[O.toLowerCase()])||void 0}return Sb={wsIsSecure:o,SCHEMES:T,isValidSchemeName:r,getSchemeHandler:R},Sb}var XI;function cse(){if(XI)return _d.exports;XI=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:o,nonSimpleDomain:s}=B6(),{SCHEMES:l,getSchemeHandler:c}=lse();function d(x,S){return typeof x=="string"?x=g(_(x,S),S):typeof x=="object"&&(x=_(g(x,S),S)),x}function f(x,S,E){const T=E?Object.assign({scheme:"null"},E):{scheme:"null"},R=p(_(x,T),_(S,T),T,!0);return T.skipEscape=!0,g(R,T)}function p(x,S,E,T){const R={};return T||(x=_(g(x,E),E),S=_(g(S,E),E)),E=E||{},!E.tolerant&&S.scheme?(R.scheme=S.scheme,R.userinfo=S.userinfo,R.host=S.host,R.port=S.port,R.path=t(S.path||""),R.query=S.query):(S.userinfo!==void 0||S.host!==void 0||S.port!==void 0?(R.userinfo=S.userinfo,R.host=S.host,R.port=S.port,R.path=t(S.path||""),R.query=S.query):(S.path?(S.path[0]==="/"?R.path=t(S.path):((x.userinfo!==void 0||x.host!==void 0||x.port!==void 0)&&!x.path?R.path="/"+S.path:x.path?R.path=x.path.slice(0,x.path.lastIndexOf("/")+1)+S.path:R.path=S.path,R.path=t(R.path)),R.query=S.query):(R.path=x.path,S.query!==void 0?R.query=S.query:R.query=x.query),R.userinfo=x.userinfo,R.host=x.host,R.port=x.port),R.scheme=x.scheme),R.fragment=S.fragment,R}function h(x,S,E){return typeof x=="string"?(x=unescape(x),x=g(r(_(x,E),!0),{...E,skipEscape:!0})):typeof x=="object"&&(x=g(r(x,!0),{...E,skipEscape:!0})),typeof S=="string"?(S=unescape(S),S=g(r(_(S,E),!0),{...E,skipEscape:!0})):typeof S=="object"&&(S=g(r(S,!0),{...E,skipEscape:!0})),x.toLowerCase()===S.toLowerCase()}function g(x,S){const E={host:x.host,scheme:x.scheme,userinfo:x.userinfo,port:x.port,path:x.path,query:x.query,nid:x.nid,nss:x.nss,uuid:x.uuid,fragment:x.fragment,reference:x.reference,resourceName:x.resourceName,secure:x.secure,error:""},T=Object.assign({},S),R=[],O=c(T.scheme||E.scheme);O&&O.serialize&&O.serialize(E,T),E.path!==void 0&&(T.skipEscape?E.path=unescape(E.path):(E.path=escape(E.path),E.scheme!==void 0&&(E.path=E.path.split("%3A").join(":")))),T.reference!=="suffix"&&E.scheme&&R.push(E.scheme,":");const A=n(E);if(A!==void 0&&(T.reference!=="suffix"&&R.push("//"),R.push(A),E.path&&E.path[0]!=="/"&&R.push("/")),E.path!==void 0){let I=E.path;!T.absolutePath&&(!O||!O.absolutePath)&&(I=t(I)),A===void 0&&I[0]==="/"&&I[1]==="/"&&(I="/%2F"+I.slice(2)),R.push(I)}return E.query!==void 0&&R.push("?",E.query),E.fragment!==void 0&&R.push("#",E.fragment),R.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _(x,S){const E=Object.assign({},S),T={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let R=!1;E.reference==="suffix"&&(E.scheme?x=E.scheme+":"+x:x="//"+x);const O=x.match(v);if(O){if(T.scheme=O[1],T.userinfo=O[3],T.host=O[4],T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=O[7],T.fragment=O[8],isNaN(T.port)&&(T.port=O[5]),T.host)if(o(T.host)===!1){const P=e(T.host);T.host=P.host.toLowerCase(),R=P.isIPV6}else R=!0;T.scheme===void 0&&T.userinfo===void 0&&T.host===void 0&&T.port===void 0&&T.query===void 0&&!T.path?T.reference="same-document":T.scheme===void 0?T.reference="relative":T.fragment===void 0?T.reference="absolute":T.reference="uri",E.reference&&E.reference!=="suffix"&&E.reference!==T.reference&&(T.error=T.error||"URI is not a "+E.reference+" reference.");const A=c(E.scheme||T.scheme);if(!E.unicodeSupport&&(!A||!A.unicodeSupport)&&T.host&&(E.domainHost||A&&A.domainHost)&&R===!1&&s(T.host))try{T.host=URL.domainToASCII(T.host.toLowerCase())}catch(I){T.error=T.error||"Host's domain name can not be converted to ASCII: "+I}(!A||A&&!A.skipNormalize)&&(x.indexOf("%")!==-1&&(T.scheme!==void 0&&(T.scheme=unescape(T.scheme)),T.host!==void 0&&(T.host=unescape(T.host))),T.path&&(T.path=escape(unescape(T.path))),T.fragment&&(T.fragment=encodeURI(decodeURIComponent(T.fragment)))),A&&A.parse&&A.parse(T,E)}else T.error=T.error||"URI can not be parsed.";return T}const b={SCHEMES:l,normalize:d,resolve:f,resolveComponent:p,equal:h,serialize:g,parse:_};return _d.exports=b,_d.exports.default=b,_d.exports.fastUri=b,_d.exports}var JI;function use(){if(JI)return Pp;JI=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=cse();return e.code='require("ajv/dist/runtime/uri").default',Pp.default=e,Pp}var eM;function dse(){return eM||(eM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=mv();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=mt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=uE(),o=gv(),s=z6(),l=dE(),c=mt(),d=pv(),f=Og(),p=kt(),h=ase,g=use(),v=(Q,k)=>new RegExp(Q,k);v.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},S={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},E=200;function T(Q){var k,G,V,D,U,X,fe,pe,xe,je,Y,re,ve,se,Se,Te,tt,rt,Be,Qe,Pe,Me,Ue,K,ne;const ae=Q.strict,Oe=(k=Q.code)===null||k===void 0?void 0:k.optimize,Ae=Oe===!0||Oe===void 0?1:Oe||0,Ie=(V=(G=Q.code)===null||G===void 0?void 0:G.regExp)!==null&&V!==void 0?V:v,ke=(D=Q.uriResolver)!==null&&D!==void 0?D:g.default;return{strictSchema:(X=(U=Q.strictSchema)!==null&&U!==void 0?U:ae)!==null&&X!==void 0?X:!0,strictNumbers:(pe=(fe=Q.strictNumbers)!==null&&fe!==void 0?fe:ae)!==null&&pe!==void 0?pe:!0,strictTypes:(je=(xe=Q.strictTypes)!==null&&xe!==void 0?xe:ae)!==null&&je!==void 0?je:"log",strictTuples:(re=(Y=Q.strictTuples)!==null&&Y!==void 0?Y:ae)!==null&&re!==void 0?re:"log",strictRequired:(se=(ve=Q.strictRequired)!==null&&ve!==void 0?ve:ae)!==null&&se!==void 0?se:!1,code:Q.code?{...Q.code,optimize:Ae,regExp:Ie}:{optimize:Ae,regExp:Ie},loopRequired:(Se=Q.loopRequired)!==null&&Se!==void 0?Se:E,loopEnum:(Te=Q.loopEnum)!==null&&Te!==void 0?Te:E,meta:(tt=Q.meta)!==null&&tt!==void 0?tt:!0,messages:(rt=Q.messages)!==null&&rt!==void 0?rt:!0,inlineRefs:(Be=Q.inlineRefs)!==null&&Be!==void 0?Be:!0,schemaId:(Qe=Q.schemaId)!==null&&Qe!==void 0?Qe:"$id",addUsedSchema:(Pe=Q.addUsedSchema)!==null&&Pe!==void 0?Pe:!0,validateSchema:(Me=Q.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(Ue=Q.validateFormats)!==null&&Ue!==void 0?Ue:!0,unicodeRegExp:(K=Q.unicodeRegExp)!==null&&K!==void 0?K:!0,int32range:(ne=Q.int32range)!==null&&ne!==void 0?ne:!0,uriResolver:ke}}class R{constructor(k={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...T(k)};const{es5:G,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:G,lines:V}),this.logger=B(k.logger);const D=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),O.call(this,x,k,"NOT SUPPORTED"),O.call(this,S,k,"DEPRECATED","warn"),this._metaOpts=q.call(this),k.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&L.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),I.call(this),k.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:G,schemaId:V}=this.opts;let D=h;V==="id"&&(D={...h},D.id=D.$id,delete D.$id),G&&k&&this.addMetaSchema(D,D[V],!1)}defaultMeta(){const{meta:k,schemaId:G}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[G]||k:void 0}validate(k,G){let V;if(typeof k=="string"){if(V=this.getSchema(k),!V)throw new Error(`no schema with key or ref "${k}"`)}else V=this.compile(k);const D=V(G);return"$async"in V||(this.errors=V.errors),D}compile(k,G){const V=this._addSchema(k,G);return V.validate||this._compileSchemaEnv(V)}compileAsync(k,G){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:V}=this.opts;return D.call(this,k,G);async function D(je,Y){await U.call(this,je.$schema);const re=this._addSchema(je,Y);return re.validate||X.call(this,re)}async function U(je){je&&!this.getSchema(je)&&await D.call(this,{$ref:je},!0)}async function X(je){try{return this._compileSchemaEnv(je)}catch(Y){if(!(Y instanceof o.default))throw Y;return fe.call(this,Y),await pe.call(this,Y.missingSchema),X.call(this,je)}}function fe({missingSchema:je,missingRef:Y}){if(this.refs[je])throw new Error(`AnySchema ${je} is loaded but ${Y} cannot be resolved`)}async function pe(je){const Y=await xe.call(this,je);this.refs[je]||await U.call(this,Y.$schema),this.refs[je]||this.addSchema(Y,je,G)}async function xe(je){const Y=this._loading[je];if(Y)return Y;try{return await(this._loading[je]=V(je))}finally{delete this._loading[je]}}}addSchema(k,G,V,D=this.opts.validateSchema){if(Array.isArray(k)){for(const X of k)this.addSchema(X,void 0,V,D);return this}let U;if(typeof k=="object"){const{schemaId:X}=this.opts;if(U=k[X],U!==void 0&&typeof U!="string")throw new Error(`schema ${X} must be string`)}return G=(0,d.normalizeId)(G||U),this._checkUnique(G),this.schemas[G]=this._addSchema(k,V,G,D,!0),this}addMetaSchema(k,G,V=this.opts.validateSchema){return this.addSchema(k,G,!0,V),this}validateSchema(k,G){if(typeof k=="boolean")return!0;let V;if(V=k.$schema,V!==void 0&&typeof V!="string")throw new Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const D=this.validate(V,k);if(!D&&G){const U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw new Error(U)}return D}getSchema(k){let G;for(;typeof(G=A.call(this,k))=="string";)k=G;if(G===void 0){const{schemaId:V}=this.opts,D=new l.SchemaEnv({schema:{},schemaId:V});if(G=l.resolveSchema.call(this,D,k),!G)return;this.refs[k]=G}return G.validate||this._compileSchemaEnv(G)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const G=A.call(this,k);return typeof G=="object"&&this._cache.delete(G.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const G=k;this._cache.delete(G);let V=k[this.opts.schemaId];return V&&(V=(0,d.normalizeId)(V),delete this.schemas[V],delete this.refs[V]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const G of k)this.addKeyword(G);return this}addKeyword(k,G){let V;if(typeof k=="string")V=k,typeof G=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),G.keyword=V);else if(typeof k=="object"&&G===void 0){if(G=k,V=G.keyword,Array.isArray(V)&&!V.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Z.call(this,V,G),!G)return(0,p.eachItem)(V,U=>ie.call(this,U)),this;W.call(this,G);const D={...G,type:(0,f.getJSONTypes)(G.type),schemaType:(0,f.getJSONTypes)(G.schemaType)};return(0,p.eachItem)(V,D.type.length===0?U=>ie.call(this,U,D):U=>D.type.forEach(X=>ie.call(this,U,D,X))),this}getKeyword(k){const G=this.RULES.all[k];return typeof G=="object"?G.definition:!!G}removeKeyword(k){const{RULES:G}=this;delete G.keywords[k],delete G.all[k];for(const V of G.rules){const D=V.rules.findIndex(U=>U.keyword===k);D>=0&&V.rules.splice(D,1)}return this}addFormat(k,G){return typeof G=="string"&&(G=new RegExp(G)),this.formats[k]=G,this}errorsText(k=this.errors,{separator:G=", ",dataVar:V="data"}={}){return!k||k.length===0?"No errors":k.map(D=>`${V}${D.instancePath} ${D.message}`).reduce((D,U)=>D+G+U)}$dataMetaSchema(k,G){const V=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const D of G){const U=D.split("/").slice(1);let X=k;for(const fe of U)X=X[fe];for(const fe in V){const pe=V[fe];if(typeof pe!="object")continue;const{$data:xe}=pe.definition,je=X[fe];xe&&je&&(X[fe]=le(je))}}return k}_removeAllSchemas(k,G){for(const V in k){const D=k[V];(!G||G.test(V))&&(typeof D=="string"?delete k[V]:D&&!D.meta&&(this._cache.delete(D.schema),delete k[V]))}}_addSchema(k,G,V,D=this.opts.validateSchema,U=this.opts.addUsedSchema){let X;const{schemaId:fe}=this.opts;if(typeof k=="object")X=k[fe];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let pe=this._cache.get(k);if(pe!==void 0)return pe;V=(0,d.normalizeId)(X||V);const xe=d.getSchemaRefs.call(this,k,V);return pe=new l.SchemaEnv({schema:k,schemaId:fe,meta:G,baseId:V,localRefs:xe}),this._cache.set(pe.schema,pe),U&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=pe),D&&this.validateSchema(k,!0),pe}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):l.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const G=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,k)}finally{this.opts=G}}}R.ValidationError=r.default,R.MissingRefError=o.default,e.default=R;function O(Q,k,G,V="error"){for(const D in Q){const U=D;U in k&&this.logger[V](`${G}: option ${D}. ${Q[U]}`)}}function A(Q){return Q=(0,d.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function I(){const Q=this.opts.schemas;if(Q)if(Array.isArray(Q))this.addSchema(Q);else for(const k in Q)this.addSchema(Q[k],k)}function P(){for(const Q in this.opts.formats){const k=this.opts.formats[Q];k&&this.addFormat(Q,k)}}function L(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in Q){const G=Q[k];G.keyword||(G.keyword=k),this.addKeyword(G)}}function q(){const Q={...this.opts};for(const k of _)delete Q[k];return Q}const j={log(){},warn(){},error(){}};function B(Q){if(Q===!1)return j;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function Z(Q,k){const{RULES:G}=this;if((0,p.eachItem)(Q,V=>{if(G.keywords[V])throw new Error(`Keyword ${V} is already defined`);if(!F.test(V))throw new Error(`Keyword ${V} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function ie(Q,k,G){var V;const D=k?.post;if(G&&D)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:U}=this;let X=D?U.post:U.rules.find(({type:pe})=>pe===G);if(X||(X={type:G,rules:[]},U.rules.push(X)),U.keywords[Q]=!0,!k)return;const fe={keyword:Q,definition:{...k,type:(0,f.getJSONTypes)(k.type),schemaType:(0,f.getJSONTypes)(k.schemaType)}};k.before?H.call(this,X,fe,k.before):X.rules.push(fe),U.all[Q]=fe,(V=k.implements)===null||V===void 0||V.forEach(pe=>this.addKeyword(pe))}function H(Q,k,G){const V=Q.rules.findIndex(D=>D.keyword===G);V>=0?Q.rules.splice(V,0,k):(Q.rules.push(k),this.logger.warn(`rule ${G} is not defined`))}function W(Q){let{metaSchema:k}=Q;k!==void 0&&(Q.$data&&this.opts.$data&&(k=le(k)),Q.validateSchema=this.compile(k,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(Q){return{anyOf:[Q,te]}}})(pb)),pb}var Np={},kp={},Dp={},tM;function fse(){if(tM)return Dp;tM=1,Object.defineProperty(Dp,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Dp.default=e,Dp}var Qs={},nM;function hse(){if(nM)return Qs;nM=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.callRef=Qs.getValidate=void 0;const e=gv(),t=li(),n=mt(),r=wa(),o=dE(),s=kt(),l={keyword:"$ref",schemaType:"string",code(f){const{gen:p,schema:h,it:g}=f,{baseId:v,schemaEnv:_,validateName:b,opts:x,self:S}=g,{root:E}=_;if((h==="#"||h==="#/")&&v===E.baseId)return R();const T=o.resolveRef.call(S,E,v,h);if(T===void 0)throw new e.default(g.opts.uriResolver,v,h);if(T instanceof o.SchemaEnv)return O(T);return A(T);function R(){if(_===E)return d(f,b,_,_.$async);const I=p.scopeValue("root",{ref:E});return d(f,(0,n._)`${I}.validate`,E,E.$async)}function O(I){const P=c(f,I);d(f,P,I,I.$async)}function A(I){const P=p.scopeValue("schema",x.code.source===!0?{ref:I,code:(0,n.stringify)(I)}:{ref:I}),L=p.name("valid"),q=f.subschema({schema:I,dataTypes:[],schemaPath:n.nil,topSchemaRef:P,errSchemaPath:h},L);f.mergeEvaluated(q),f.ok(L)}}};function c(f,p){const{gen:h}=f;return p.validate?h.scopeValue("validate",{ref:p.validate}):(0,n._)`${h.scopeValue("wrapper",{ref:p})}.validate`}Qs.getValidate=c;function d(f,p,h,g){const{gen:v,it:_}=f,{allErrors:b,schemaEnv:x,opts:S}=_,E=S.passContext?r.default.this:n.nil;g?T():R();function T(){if(!x.$async)throw new Error("async schema referenced by sync schema");const I=v.let("valid");v.try(()=>{v.code((0,n._)`await ${(0,t.callValidateCode)(f,p,E)}`),A(p),b||v.assign(I,!0)},P=>{v.if((0,n._)`!(${P} instanceof ${_.ValidationError})`,()=>v.throw(P)),O(P),b||v.assign(I,!1)}),f.ok(I)}function R(){f.result((0,t.callValidateCode)(f,p,E),()=>A(p),()=>O(p))}function O(I){const P=(0,n._)`${I}.errors`;v.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${P} : ${r.default.vErrors}.concat(${P})`),v.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function A(I){var P;if(!_.opts.unevaluated)return;const L=(P=h?.validate)===null||P===void 0?void 0:P.evaluated;if(_.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(_.props=s.mergeEvaluated.props(v,L.props,_.props));else{const q=v.var("props",(0,n._)`${I}.evaluated.props`);_.props=s.mergeEvaluated.props(v,q,_.props,n.Name)}if(_.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(_.items=s.mergeEvaluated.items(v,L.items,_.items));else{const q=v.var("items",(0,n._)`${I}.evaluated.items`);_.items=s.mergeEvaluated.items(v,q,_.items,n.Name)}}}return Qs.callRef=d,Qs.default=l,Qs}var rM;function pse(){if(rM)return kp;rM=1,Object.defineProperty(kp,"__esModule",{value:!0});const e=fse(),t=hse(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return kp.default=n,kp}var Lp={},$p={},oM;function mse(){if(oM)return $p;oM=1,Object.defineProperty($p,"__esModule",{value:!0});const e=mt(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:s,schemaCode:l})=>(0,e.str)`must be ${n[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${l}}`},o={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(s){const{keyword:l,data:c,schemaCode:d}=s;s.fail$data((0,e._)`${c} ${n[l].fail} ${d} || isNaN(${c})`)}};return $p.default=o,$p}var jp={},iM;function gse(){if(iM)return jp;iM=1,Object.defineProperty(jp,"__esModule",{value:!0});const e=mt(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:o,data:s,schemaCode:l,it:c}=r,d=c.opts.multipleOfPrecision,f=o.let("res"),p=d?(0,e._)`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:(0,e._)`${f} !== parseInt(${f})`;r.fail$data((0,e._)`(${l} === 0 || (${f} = ${s}/${l}, ${p}))`)}};return jp.default=n,jp}var zp={},Up={},sM;function vse(){if(sM)return Up;sM=1,Object.defineProperty(Up,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,o=0,s;for(;o<n;)r++,s=t.charCodeAt(o++),s>=55296&&s<=56319&&o<n&&(s=t.charCodeAt(o),(s&64512)===56320&&o++);return r}return Up.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Up}var aM;function yse(){if(aM)return zp;aM=1,Object.defineProperty(zp,"__esModule",{value:!0});const e=mt(),t=kt(),n=vse(),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:l}){const c=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${c} than ${l} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:l,data:c,schemaCode:d,it:f}=s,p=l==="maxLength"?e.operators.GT:e.operators.LT,h=f.opts.unicode===!1?(0,e._)`${c}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${c})`;s.fail$data((0,e._)`${h} ${p} ${d}`)}};return zp.default=o,zp}var Fp={},lM;function _se(){if(lM)return Fp;lM=1,Object.defineProperty(Fp,"__esModule",{value:!0});const e=li(),t=kt(),n=mt(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,n.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,n._)`{pattern: ${s}}`},code(s){const{gen:l,data:c,$data:d,schema:f,schemaCode:p,it:h}=s,g=h.opts.unicodeRegExp?"u":"";if(d){const{regExp:v}=h.opts.code,_=v.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(l,v),b=l.let("valid");l.try(()=>l.assign(b,(0,n._)`${_}(${p}, ${g}).test(${c})`),()=>l.assign(b,!1)),s.fail$data((0,n._)`!${b}`)}else{const v=(0,e.usePattern)(s,f);s.fail$data((0,n._)`!${v}.test(${c})`)}}};return Fp.default=o,Fp}var Bp={},cM;function bse(){if(cM)return Bp;cM=1,Object.defineProperty(Bp,"__esModule",{value:!0});const e=mt(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:o}){const s=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${o} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:o,data:s,schemaCode:l}=r,c=o==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${s}).length ${c} ${l}`)}};return Bp.default=n,Bp}var Vp={},uM;function wse(){if(uM)return Vp;uM=1,Object.defineProperty(Vp,"__esModule",{value:!0});const e=li(),t=mt(),n=kt(),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:l,schema:c,schemaCode:d,data:f,$data:p,it:h}=s,{opts:g}=h;if(!p&&c.length===0)return;const v=c.length>=g.loopRequired;if(h.allErrors?_():b(),g.strictRequired){const E=s.parentSchema.properties,{definedProperties:T}=s.it;for(const R of c)if(E?.[R]===void 0&&!T.has(R)){const O=h.schemaEnv.baseId+h.errSchemaPath,A=`required property "${R}" is not defined at "${O}" (strictRequired)`;(0,n.checkStrictMode)(h,A,h.opts.strictRequired)}}function _(){if(v||p)s.block$data(t.nil,x);else for(const E of c)(0,e.checkReportMissingProp)(s,E)}function b(){const E=l.let("missing");if(v||p){const T=l.let("valid",!0);s.block$data(T,()=>S(E,T)),s.ok(T)}else l.if((0,e.checkMissingProp)(s,c,E)),(0,e.reportMissingProp)(s,E),l.else()}function x(){l.forOf("prop",d,E=>{s.setParams({missingProperty:E}),l.if((0,e.noPropertyInData)(l,f,E,g.ownProperties),()=>s.error())})}function S(E,T){s.setParams({missingProperty:E}),l.forOf(E,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,E,g.ownProperties)),l.if((0,t.not)(T),()=>{s.error(),l.break()})},t.nil)}}};return Vp.default=o,Vp}var qp={},dM;function Sse(){if(dM)return qp;dM=1,Object.defineProperty(qp,"__esModule",{value:!0});const e=mt(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:o}){const s=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${o} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:o,data:s,schemaCode:l}=r,c=o==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${s}.length ${c} ${l}`)}};return qp.default=n,qp}var Hp={},Gp={},fM;function fE(){if(fM)return Gp;fM=1,Object.defineProperty(Gp,"__esModule",{value:!0});const e=F6();return e.code='require("ajv/dist/runtime/equal").default',Gp.default=e,Gp}var hM;function Ese(){if(hM)return Hp;hM=1,Object.defineProperty(Hp,"__esModule",{value:!0});const e=Og(),t=mt(),n=kt(),r=fE(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:c}})=>(0,t.str)`must NOT have duplicate items (items ## ${c} and ${l} are identical)`,params:({params:{i:l,j:c}})=>(0,t._)`{i: ${l}, j: ${c}}`},code(l){const{gen:c,data:d,$data:f,schema:p,parentSchema:h,schemaCode:g,it:v}=l;if(!f&&!p)return;const _=c.let("valid"),b=h.items?(0,e.getSchemaTypes)(h.items):[];l.block$data(_,x,(0,t._)`${g} === false`),l.ok(_);function x(){const R=c.let("i",(0,t._)`${d}.length`),O=c.let("j");l.setParams({i:R,j:O}),c.assign(_,!0),c.if((0,t._)`${R} > 1`,()=>(S()?E:T)(R,O))}function S(){return b.length>0&&!b.some(R=>R==="object"||R==="array")}function E(R,O){const A=c.name("item"),I=(0,e.checkDataTypes)(b,A,v.opts.strictNumbers,e.DataType.Wrong),P=c.const("indices",(0,t._)`{}`);c.for((0,t._)`;${R}--;`,()=>{c.let(A,(0,t._)`${d}[${R}]`),c.if(I,(0,t._)`continue`),b.length>1&&c.if((0,t._)`typeof ${A} == "string"`,(0,t._)`${A} += "_"`),c.if((0,t._)`typeof ${P}[${A}] == "number"`,()=>{c.assign(O,(0,t._)`${P}[${A}]`),l.error(),c.assign(_,!1).break()}).code((0,t._)`${P}[${A}] = ${R}`)})}function T(R,O){const A=(0,n.useFunc)(c,r.default),I=c.name("outer");c.label(I).for((0,t._)`;${R}--;`,()=>c.for((0,t._)`${O} = ${R}; ${O}--;`,()=>c.if((0,t._)`${A}(${d}[${R}], ${d}[${O}])`,()=>{l.error(),c.assign(_,!1).break(I)})))}}};return Hp.default=s,Hp}var Kp={},pM;function xse(){if(pM)return Kp;pM=1,Object.defineProperty(Kp,"__esModule",{value:!0});const e=mt(),t=kt(),n=fE(),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:l,data:c,$data:d,schemaCode:f,schema:p}=s;d||p&&typeof p=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(l,n.default)}(${c}, ${f})`):s.fail((0,e._)`${p} !== ${c}`)}};return Kp.default=o,Kp}var Zp={},mM;function Rse(){if(mM)return Zp;mM=1,Object.defineProperty(Zp,"__esModule",{value:!0});const e=mt(),t=kt(),n=fE(),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:l,data:c,$data:d,schema:f,schemaCode:p,it:h}=s;if(!d&&f.length===0)throw new Error("enum must have non-empty array");const g=f.length>=h.opts.loopEnum;let v;const _=()=>v??(v=(0,t.useFunc)(l,n.default));let b;if(g||d)b=l.let("valid"),s.block$data(b,x);else{if(!Array.isArray(f))throw new Error("ajv implementation error");const E=l.const("vSchema",p);b=(0,e.or)(...f.map((T,R)=>S(E,R)))}s.pass(b);function x(){l.assign(b,!1),l.forOf("v",p,E=>l.if((0,e._)`${_()}(${c}, ${E})`,()=>l.assign(b,!0).break()))}function S(E,T){const R=f[T];return typeof R=="object"&&R!==null?(0,e._)`${_()}(${c}, ${E}[${T}])`:(0,e._)`${c} === ${R}`}}};return Zp.default=o,Zp}var gM;function Ose(){if(gM)return Lp;gM=1,Object.defineProperty(Lp,"__esModule",{value:!0});const e=mse(),t=gse(),n=yse(),r=_se(),o=bse(),s=wse(),l=Sse(),c=Ese(),d=xse(),f=Rse(),p=[e.default,t.default,n.default,r.default,o.default,s.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];return Lp.default=p,Lp}var Yp={},yc={},vM;function V6(){if(vM)return yc;vM=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.validateAdditionalItems=void 0;const e=mt(),t=kt(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:l,it:c}=s,{items:d}=l;if(!Array.isArray(d)){(0,t.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}o(s,d)}};function o(s,l){const{gen:c,schema:d,data:f,keyword:p,it:h}=s;h.items=!0;const g=c.const("len",(0,e._)`${f}.length`);if(d===!1)s.setParams({len:l.length}),s.pass((0,e._)`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,t.alwaysValidSchema)(h,d)){const _=c.var("valid",(0,e._)`${g} <= ${l.length}`);c.if((0,e.not)(_),()=>v(_)),s.ok(_)}function v(_){c.forRange("i",l.length,g,b=>{s.subschema({keyword:p,dataProp:b,dataPropType:t.Type.Num},_),h.allErrors||c.if((0,e.not)(_),()=>c.break())})}}return yc.validateAdditionalItems=o,yc.default=r,yc}var Wp={},_c={},yM;function q6(){if(yM)return _c;yM=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.validateTuple=void 0;const e=mt(),t=kt(),n=li(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:l,it:c}=s;if(Array.isArray(l))return o(s,"additionalItems",l);c.items=!0,!(0,t.alwaysValidSchema)(c,l)&&s.ok((0,n.validateArray)(s))}};function o(s,l,c=s.schema){const{gen:d,parentSchema:f,data:p,keyword:h,it:g}=s;b(f),g.opts.unevaluated&&c.length&&g.items!==!0&&(g.items=t.mergeEvaluated.items(d,c.length,g.items));const v=d.name("valid"),_=d.const("len",(0,e._)`${p}.length`);c.forEach((x,S)=>{(0,t.alwaysValidSchema)(g,x)||(d.if((0,e._)`${_} > ${S}`,()=>s.subschema({keyword:h,schemaProp:S,dataProp:S},v)),s.ok(v))});function b(x){const{opts:S,errSchemaPath:E}=g,T=c.length,R=T===x.minItems&&(T===x.maxItems||x[l]===!1);if(S.strictTuples&&!R){const O=`"${h}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${E}"`;(0,t.checkStrictMode)(g,O,S.strictTuples)}}}return _c.validateTuple=o,_c.default=r,_c}var _M;function Tse(){if(_M)return Wp;_M=1,Object.defineProperty(Wp,"__esModule",{value:!0});const e=q6(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Wp.default=t,Wp}var Qp={},bM;function Cse(){if(bM)return Qp;bM=1,Object.defineProperty(Qp,"__esModule",{value:!0});const e=mt(),t=kt(),n=li(),r=V6(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:c,parentSchema:d,it:f}=l,{prefixItems:p}=d;f.items=!0,!(0,t.alwaysValidSchema)(f,c)&&(p?(0,r.validateAdditionalItems)(l,p):l.ok((0,n.validateArray)(l)))}};return Qp.default=s,Qp}var Xp={},wM;function Ase(){if(wM)return Xp;wM=1,Object.defineProperty(Xp,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:o,max:s}})=>s===void 0?(0,e.str)`must contain at least ${o} valid item(s)`:(0,e.str)`must contain at least ${o} and no more than ${s} valid item(s)`,params:({params:{min:o,max:s}})=>s===void 0?(0,e._)`{minContains: ${o}}`:(0,e._)`{minContains: ${o}, maxContains: ${s}}`},code(o){const{gen:s,schema:l,parentSchema:c,data:d,it:f}=o;let p,h;const{minContains:g,maxContains:v}=c;f.opts.next?(p=g===void 0?1:g,h=v):p=1;const _=s.const("len",(0,e._)`${d}.length`);if(o.setParams({min:p,max:h}),h===void 0&&p===0){(0,t.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&p>h){(0,t.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),o.fail();return}if((0,t.alwaysValidSchema)(f,l)){let T=(0,e._)`${_} >= ${p}`;h!==void 0&&(T=(0,e._)`${T} && ${_} <= ${h}`),o.pass(T);return}f.items=!0;const b=s.name("valid");h===void 0&&p===1?S(b,()=>s.if(b,()=>s.break())):p===0?(s.let(b,!0),h!==void 0&&s.if((0,e._)`${d}.length > 0`,x)):(s.let(b,!1),x()),o.result(b,()=>o.reset());function x(){const T=s.name("_valid"),R=s.let("count",0);S(T,()=>s.if(T,()=>E(R)))}function S(T,R){s.forRange("i",0,_,O=>{o.subschema({keyword:"contains",dataProp:O,dataPropType:t.Type.Num,compositeRule:!0},T),R()})}function E(T){s.code((0,e._)`${T}++`),h===void 0?s.if((0,e._)`${T} >= ${p}`,()=>s.assign(b,!0).break()):(s.if((0,e._)`${T} > ${h}`,()=>s.assign(b,!1).break()),p===1?s.assign(b,!0):s.if((0,e._)`${T} >= ${p}`,()=>s.assign(b,!0)))}}};return Xp.default=r,Xp}var Eb={},SM;function Ise(){return SM||(SM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=mt(),n=kt(),r=li();e.error={message:({params:{property:d,depsCount:f,deps:p}})=>{const h=f===1?"property":"properties";return(0,t.str)`must have ${h} ${p} when property ${d} is present`},params:({params:{property:d,depsCount:f,deps:p,missingProperty:h}})=>(0,t._)`{property: ${d},
|
|
161
161
|
missingProperty: ${h},
|
|
162
162
|
depsCount: ${f},
|
|
163
|
-
deps: ${p}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[f,p]=s(d);l(d,f),c(d,p)}};function s({schema:d}){const f={},p={};for(const h in d){if(h==="__proto__")continue;const g=Array.isArray(d[h])?f:p;g[h]=d[h]}return[f,p]}function l(d,f=d.schema){const{gen:p,data:h,it:g}=d;if(Object.keys(f).length===0)return;const v=p.let("missing");for(const _ in f){const b=f[_];if(b.length===0)continue;const x=(0,r.propertyInData)(p,h,_,g.opts.ownProperties);d.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),g.allErrors?p.if(x,()=>{for(const S of b)(0,r.checkReportMissingProp)(d,S)}):(p.if((0,t._)`${x} && (${(0,r.checkMissingProp)(d,b,v)})`),(0,r.reportMissingProp)(d,v),p.else())}}e.validatePropertyDeps=l;function c(d,f=d.schema){const{gen:p,data:h,keyword:g,it:v}=d,_=p.name("valid");for(const b in f)(0,n.alwaysValidSchema)(v,f[b])||(p.if((0,r.propertyInData)(p,h,b,v.opts.ownProperties),()=>{const x=d.subschema({keyword:g,schemaProp:b},_);d.mergeValidEvaluated(x,_)},()=>p.var(_,!0)),d.ok(_))}e.validateSchemaDeps=c,e.default=o})(Eb)),Eb}var Jp={},EM;function Mse(){if(EM)return Jp;EM=1,Object.defineProperty(Jp,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:o})=>(0,e._)`{propertyName: ${o.propertyName}}`},code(o){const{gen:s,schema:l,data:c,it:d}=o;if((0,t.alwaysValidSchema)(d,l))return;const f=s.name("valid");s.forIn("key",c,p=>{o.setParams({propertyName:p}),o.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},f),s.if((0,e.not)(f),()=>{o.error(!0),d.allErrors||s.break()})}),o.ok(f)}};return Jp.default=r,Jp}var em={},xM;function H6(){if(xM)return em;xM=1,Object.defineProperty(em,"__esModule",{value:!0});const e=li(),t=mt(),n=wa(),r=kt(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:f,data:p,errsCount:h,it:g}=l;if(!h)throw new Error("ajv implementation error");const{allErrors:v,opts:_}=g;if(g.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,d))return;const b=(0,e.allSchemaProperties)(f.properties),x=(0,e.allSchemaProperties)(f.patternProperties);S(),l.ok((0,t._)`${h} === ${n.default.errors}`);function S(){c.forIn("key",p,A=>{!b.length&&!x.length?R(A):c.if(E(A),()=>R(A))})}function E(A){let I;if(b.length>8){const P=(0,r.schemaRefOrVal)(g,f.properties,"properties");I=(0,e.isOwnProperty)(c,P,A)}else b.length?I=(0,t.or)(...b.map(P=>(0,t._)`${A} === ${P}`)):I=t.nil;return x.length&&(I=(0,t.or)(I,...x.map(P=>(0,t._)`${(0,e.usePattern)(l,P)}.test(${A})`))),(0,t.not)(I)}function T(A){c.code((0,t._)`delete ${p}[${A}]`)}function R(A){if(_.removeAdditional==="all"||_.removeAdditional&&d===!1){T(A);return}if(d===!1){l.setParams({additionalProperty:A}),l.error(),v||c.break();return}if(typeof d=="object"&&!(0,r.alwaysValidSchema)(g,d)){const I=c.name("valid");_.removeAdditional==="failing"?(O(A,I,!1),c.if((0,t.not)(I),()=>{l.reset(),T(A)})):(O(A,I),v||c.if((0,t.not)(I),()=>c.break()))}}function O(A,I,P){const L={keyword:"additionalProperties",dataProp:A,dataPropType:r.Type.Str};P===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(L,I)}}};return em.default=s,em}var tm={},RM;function Pse(){if(RM)return tm;RM=1,Object.defineProperty(tm,"__esModule",{value:!0});const e=mv(),t=li(),n=kt(),r=H6(),o={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,parentSchema:d,data:f,it:p}=s;p.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(p,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(c);for(const x of h)p.definedProperties.add(x);p.opts.unevaluated&&h.length&&p.props!==!0&&(p.props=n.mergeEvaluated.props(l,(0,n.toHash)(h),p.props));const g=h.filter(x=>!(0,n.alwaysValidSchema)(p,c[x]));if(g.length===0)return;const v=l.name("valid");for(const x of g)_(x)?b(x):(l.if((0,t.propertyInData)(l,f,x,p.opts.ownProperties)),b(x),p.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(x),s.ok(v);function _(x){return p.opts.useDefaults&&!p.compositeRule&&c[x].default!==void 0}function b(x){s.subschema({keyword:"properties",schemaProp:x,dataProp:x},v)}}};return tm.default=o,tm}var nm={},OM;function Nse(){if(OM)return nm;OM=1,Object.defineProperty(nm,"__esModule",{value:!0});const e=li(),t=mt(),n=kt(),r=kt(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,data:d,parentSchema:f,it:p}=s,{opts:h}=p,g=(0,e.allSchemaProperties)(c),v=g.filter(R=>(0,n.alwaysValidSchema)(p,c[R]));if(g.length===0||v.length===g.length&&(!p.opts.unevaluated||p.props===!0))return;const _=h.strictSchema&&!h.allowMatchingProperties&&f.properties,b=l.name("valid");p.props!==!0&&!(p.props instanceof t.Name)&&(p.props=(0,r.evaluatedPropsToName)(l,p.props));const{props:x}=p;S();function S(){for(const R of g)_&&E(R),p.allErrors?T(R):(l.var(b,!0),T(R),l.if(b))}function E(R){for(const O in _)new RegExp(R).test(O)&&(0,n.checkStrictMode)(p,`property ${O} matches pattern ${R} (use allowMatchingProperties)`)}function T(R){l.forIn("key",d,O=>{l.if((0,t._)`${(0,e.usePattern)(s,R)}.test(${O})`,()=>{const A=v.includes(R);A||s.subschema({keyword:"patternProperties",schemaProp:R,dataProp:O,dataPropType:r.Type.Str},b),p.opts.unevaluated&&x!==!0?l.assign((0,t._)`${x}[${O}]`,!0):!A&&!p.allErrors&&l.if((0,t.not)(b),()=>l.break())})})}}};return nm.default=o,nm}var rm={},TM;function kse(){if(TM)return rm;TM=1,Object.defineProperty(rm,"__esModule",{value:!0});const e=kt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:o,it:s}=n;if((0,e.alwaysValidSchema)(s,o)){n.fail();return}const l=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return rm.default=t,rm}var om={},CM;function Dse(){if(CM)return om;CM=1,Object.defineProperty(om,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:li().validateUnion,error:{message:"must match a schema in anyOf"}};return om.default=t,om}var im={},AM;function Lse(){if(AM)return im;AM=1,Object.defineProperty(im,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:o})=>(0,e._)`{passingSchemas: ${o.passing}}`},code(o){const{gen:s,schema:l,parentSchema:c,it:d}=o;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const f=l,p=s.let("valid",!1),h=s.let("passing",null),g=s.name("_valid");o.setParams({passing:h}),s.block(v),o.result(p,()=>o.reset(),()=>o.error(!0));function v(){f.forEach((_,b)=>{let x;(0,t.alwaysValidSchema)(d,_)?s.var(g,!0):x=o.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},g),b>0&&s.if((0,e._)`${g} && ${p}`).assign(p,!1).assign(h,(0,e._)`[${h}, ${b}]`).else(),s.if(g,()=>{s.assign(p,!0),s.assign(h,b),x&&o.mergeEvaluated(x,e.Name)})})}}};return im.default=r,im}var sm={},IM;function $se(){if(IM)return sm;IM=1,Object.defineProperty(sm,"__esModule",{value:!0});const e=kt(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:o,it:s}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");const l=r.name("valid");o.forEach((c,d)=>{if((0,e.alwaysValidSchema)(s,c))return;const f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};return sm.default=t,sm}var am={},MM;function jse(){if(MM)return am;MM=1,Object.defineProperty(am,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:c,it:d}=s;c.then===void 0&&c.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const f=o(d,"then"),p=o(d,"else");if(!f&&!p)return;const h=l.let("valid",!0),g=l.name("_valid");if(v(),s.reset(),f&&p){const b=l.let("ifClause");s.setParams({ifClause:b}),l.if(g,_("then",b),_("else",b))}else f?l.if(g,_("then")):l.if((0,e.not)(g),_("else"));s.pass(h,()=>s.error(!0));function v(){const b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(b)}function _(b,x){return()=>{const S=s.subschema({keyword:b},g);l.assign(h,g),s.mergeValidEvaluated(S,h),x?l.assign(x,(0,e._)`${b}`):s.setParams({ifClause:b})}}}};function o(s,l){const c=s.schema[l];return c!==void 0&&!(0,t.alwaysValidSchema)(s,c)}return am.default=r,am}var lm={},PM;function zse(){if(PM)return lm;PM=1,Object.defineProperty(lm,"__esModule",{value:!0});const e=kt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:o}){r.if===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "if" is ignored`)}};return lm.default=t,lm}var NM;function Use(){if(NM)return Yp;NM=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=V6(),t=Tse(),n=q6(),r=Cse(),o=Ase(),s=Ise(),l=Mse(),c=H6(),d=Pse(),f=Nse(),p=kse(),h=Dse(),g=Lse(),v=$se(),_=jse(),b=zse();function x(S=!1){const E=[p.default,h.default,g.default,v.default,_.default,b.default,l.default,c.default,s.default,d.default,f.default];return S?E.push(t.default,r.default):E.push(e.default,n.default),E.push(o.default),E}return Yp.default=x,Yp}var cm={},um={},kM;function Fse(){if(kM)return um;kM=1,Object.defineProperty(um,"__esModule",{value:!0});const e=mt(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,o){const{gen:s,data:l,$data:c,schema:d,schemaCode:f,it:p}=r,{opts:h,errSchemaPath:g,schemaEnv:v,self:_}=p;if(!h.validateFormats)return;c?b():x();function b(){const S=s.scopeValue("formats",{ref:_.formats,code:h.code.formats}),E=s.const("fDef",(0,e._)`${S}[${f}]`),T=s.let("fType"),R=s.let("format");s.if((0,e._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>s.assign(T,(0,e._)`${E}.type || "string"`).assign(R,(0,e._)`${E}.validate`),()=>s.assign(T,(0,e._)`"string"`).assign(R,E)),r.fail$data((0,e.or)(O(),A()));function O(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${R}`}function A(){const I=v.$async?(0,e._)`(${E}.async ? await ${R}(${l}) : ${R}(${l}))`:(0,e._)`${R}(${l})`,P=(0,e._)`(typeof ${R} == "function" ? ${I} : ${R}.test(${l}))`;return(0,e._)`${R} && ${R} !== true && ${T} === ${o} && !${P}`}}function x(){const S=_.formats[d];if(!S){O();return}if(S===!0)return;const[E,T,R]=A(S);E===o&&r.pass(I());function O(){if(h.strictSchema===!1){_.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${d}" ignored in schema at path "${g}"`}}function A(P){const L=P instanceof RegExp?(0,e.regexpCode)(P):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(d)}`:void 0,q=s.scopeValue("formats",{key:d,ref:P,code:L});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,e._)`${q}.validate`]:["string",P,q]}function I(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${R}(${l})`}return typeof T=="function"?(0,e._)`${R}(${l})`:(0,e._)`${R}.test(${l})`}}}};return um.default=n,um}var DM;function Bse(){if(DM)return cm;DM=1,Object.defineProperty(cm,"__esModule",{value:!0});const t=[Fse().default];return cm.default=t,cm}var Ya={},LM;function Vse(){return LM||(LM=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.contentVocabulary=Ya.metadataVocabulary=void 0,Ya.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ya.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ya}var $M;function qse(){if($M)return Np;$M=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=pse(),t=Ose(),n=Use(),r=Bse(),o=Vse(),s=[e.default,t.default,(0,n.default)(),r.default,o.metadataVocabulary,o.contentVocabulary];return Np.default=s,Np}var dm={},bd={},jM;function Hse(){if(jM)return bd;jM=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(bd.DiscrError=e={})),bd}var zM;function Gse(){if(zM)return dm;zM=1,Object.defineProperty(dm,"__esModule",{value:!0});const e=mt(),t=Hse(),n=dE(),r=gv(),o=kt(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:f}})=>(0,e._)`{error: ${c}, tag: ${f}, tagValue: ${d}}`},code(c){const{gen:d,data:f,schema:p,parentSchema:h,it:g}=c,{oneOf:v}=h;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=p.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(p.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const b=d.let("valid",!1),x=d.const("tag",(0,e._)`${f}${(0,e.getProperty)(_)}`);d.if((0,e._)`typeof ${x} == "string"`,()=>S(),()=>c.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:_})),c.ok(b);function S(){const R=T();d.if(!1);for(const O in R)d.elseIf((0,e._)`${x} === ${O}`),d.assign(b,E(R[O]));d.else(),c.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:_}),d.endIf()}function E(R){const O=d.name("valid"),A=c.subschema({keyword:"oneOf",schemaProp:R},O);return c.mergeEvaluated(A,e.Name),O}function T(){var R;const O={},A=P(h);let I=!0;for(let j=0;j<v.length;j++){let B=v[j];if(B?.$ref&&!(0,o.schemaHasRulesButRef)(B,g.self.RULES)){const Z=B.$ref;if(B=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,Z),B instanceof n.SchemaEnv&&(B=B.schema),B===void 0)throw new r.default(g.opts.uriResolver,g.baseId,Z)}const F=(R=B?.properties)===null||R===void 0?void 0:R[_];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);I=I&&(A||P(B)),L(F,j)}if(!I)throw new Error(`discriminator: "${_}" must be required`);return O;function P({required:j}){return Array.isArray(j)&&j.includes(_)}function L(j,B){if(j.const)q(j.const,B);else if(j.enum)for(const F of j.enum)q(F,B);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function q(j,B){if(typeof j!="string"||j in O)throw new Error(`discriminator: "${_}" values must be unique strings`);O[j]=B}}}};return dm.default=l,dm}const Kse="http://json-schema.org/draft-07/schema#",Zse="http://json-schema.org/draft-07/schema#",Yse="Core schema meta-schema",Wse={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Qse=["object","boolean"],Xse={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Jse={$schema:Kse,$id:Zse,title:Yse,definitions:Wse,type:Qse,properties:Xse,default:!0};var UM;function eae(){return UM||(UM=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=dse(),r=qse(),o=Gse(),s=Jse,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(_,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var f=mv();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var p=mt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=uE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var g=gv();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})(Cp,Cp.exports)),Cp.exports}var fm={exports:{}},xb={},FM;function tae(){return FM||(FM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,B){return{validate:j,compare:B}}e.fullFormats={date:t(s,l),time:t(d(!0),f),"date-time":t(g(!0),v),"iso-time":t(d(),p),"iso-date-time":t(g(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:S,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:T,int32:{type:"number",validate:A},int64:{type:"number",validate:I},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const B=r.exec(j);if(!B)return!1;const F=+B[1],Z=+B[2],ie=+B[3];return Z>=1&&Z<=12&&ie>=1&&ie<=(Z===2&&n(F)?29:o[Z])}function l(j,B){if(j&&B)return j>B?1:j<B?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function d(j){return function(F){const Z=c.exec(F);if(!Z)return!1;const ie=+Z[1],H=+Z[2],W=+Z[3],te=Z[4],le=Z[5]==="-"?-1:1,Q=+(Z[6]||0),k=+(Z[7]||0);if(Q>23||k>59||j&&!te)return!1;if(ie<=23&&H<=59&&W<60)return!0;const G=H-k*le,V=ie-Q*le-(G<0?1:0);return(V===23||V===-1)&&(G===59||G===-1)&&W<61}}function f(j,B){if(!(j&&B))return;const F=new Date("2020-01-01T"+j).valueOf(),Z=new Date("2020-01-01T"+B).valueOf();if(F&&Z)return F-Z}function p(j,B){if(!(j&&B))return;const F=c.exec(j),Z=c.exec(B);if(F&&Z)return j=F[1]+F[2]+F[3],B=Z[1]+Z[2]+Z[3],j>B?1:j<B?-1:0}const h=/t|\s/i;function g(j){const B=d(j);return function(Z){const ie=Z.split(h);return ie.length===2&&s(ie[0])&&B(ie[1])}}function v(j,B){if(!(j&&B))return;const F=new Date(j).valueOf(),Z=new Date(B).valueOf();if(F&&Z)return F-Z}function _(j,B){if(!(j&&B))return;const[F,Z]=j.split(h),[ie,H]=B.split(h),W=l(F,ie);if(W!==void 0)return W||f(Z,H)}const b=/\/|:/,x=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function S(j){return b.test(j)&&x.test(j)}const E=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function T(j){return E.lastIndex=0,E.test(j)}const R=-2147483648,O=2**31-1;function A(j){return Number.isInteger(j)&&j<=O&&j>=R}function I(j){return Number.isInteger(j)}function P(){return!0}const L=/[^\\]\\Z/;function q(j){if(L.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(xb)),xb}var Rb={},BM;function nae(){return BM||(BM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=eae(),n=mt(),r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:c,schemaCode:d})=>(0,n.str)`should be ${o[c].okStr} ${d}`,params:({keyword:c,schemaCode:d})=>(0,n._)`{comparison: ${o[c].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(c){const{gen:d,data:f,schemaCode:p,keyword:h,it:g}=c,{opts:v,self:_}=g;if(!v.validateFormats)return;const b=new t.KeywordCxt(g,_.RULES.all.format.definition,"format");b.$data?x():S();function x(){const T=d.scopeValue("formats",{ref:_.formats,code:v.code.formats}),R=d.const("fmt",(0,n._)`${T}[${b.schemaCode}]`);c.fail$data((0,n.or)((0,n._)`typeof ${R} != "object"`,(0,n._)`${R} instanceof RegExp`,(0,n._)`typeof ${R}.compare != "function"`,E(R)))}function S(){const T=b.schema,R=_.formats[T];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${h}": format "${T}" does not define "compare" function`);const O=d.scopeValue("formats",{key:T,ref:R,code:v.code.formats?(0,n._)`${v.code.formats}${(0,n.getProperty)(T)}`:void 0});c.fail$data(E(O))}function E(T){return(0,n._)`${T}.compare(${f}, ${p}) ${o[h].fail} 0`}},dependencies:["format"]};const l=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=l})(Rb)),Rb}var VM;function rae(){return VM||(VM=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tae(),r=nae(),o=mt(),s=new o.Name("fullFormats"),l=new o.Name("fastFormats"),c=(f,p={keywords:!0})=>{if(Array.isArray(p))return d(f,p,n.fullFormats,s),f;const[h,g]=p.mode==="fast"?[n.fastFormats,l]:[n.fullFormats,s],v=p.formats||n.formatNames;return d(f,v,h,g),p.keywords&&(0,r.default)(f),f};c.get=(f,p="full")=>{const g=(p==="fast"?n.fastFormats:n.fullFormats)[f];if(!g)throw new Error(`Unknown format "${f}"`);return g};function d(f,p,h,g){var v,_;(v=(_=f.opts.code).formats)!==null&&v!==void 0||(_.formats=(0,o._)`require("ajv-formats/dist/formats").${g}`);for(const b of p)f.addFormat(b,h[b])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fm,fm.exports)),fm.exports}var oae=rae();const hue=dl(oae);let hE;hE=globalThis.crypto;async function iae(e){return(await hE).getRandomValues(new Uint8Array(e))}async function sae(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const o=await iae(e-r.length);for(const s of o)s<n&&(r+=t[s%t.length])}return r}async function aae(e){return await sae(e)}async function lae(e){const t=await(await hE).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function pue(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await aae(e),n=await lae(t);return{code_verifier:t,code_challenge:n}}const gr=AB().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:xV.custom,message:"URL must be parseable",fatal:!0}),C9}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),mue=vr({resource:$().url(),authorization_servers:Re(gr).optional(),jwks_uri:$().url().optional(),scopes_supported:Re($()).optional(),bearer_methods_supported:Re($()).optional(),resource_signing_alg_values_supported:Re($()).optional(),resource_name:$().optional(),resource_documentation:$().optional(),resource_policy_uri:$().url().optional(),resource_tos_uri:$().url().optional(),tls_client_certificate_bound_access_tokens:Nt().optional(),authorization_details_types_supported:Re($()).optional(),dpop_signing_alg_values_supported:Re($()).optional(),dpop_bound_access_tokens_required:Nt().optional()}),cae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),service_documentation:gr.optional(),revocation_endpoint:gr.optional(),revocation_endpoint_auth_methods_supported:Re($()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re($()).optional(),introspection_endpoint:$().optional(),introspection_endpoint_auth_methods_supported:Re($()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re($()).optional(),code_challenge_methods_supported:Re($()).optional(),client_id_metadata_document_supported:Nt().optional()}),uae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,userinfo_endpoint:gr.optional(),jwks_uri:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),acr_values_supported:Re($()).optional(),subject_types_supported:Re($()),id_token_signing_alg_values_supported:Re($()),id_token_encryption_alg_values_supported:Re($()).optional(),id_token_encryption_enc_values_supported:Re($()).optional(),userinfo_signing_alg_values_supported:Re($()).optional(),userinfo_encryption_alg_values_supported:Re($()).optional(),userinfo_encryption_enc_values_supported:Re($()).optional(),request_object_signing_alg_values_supported:Re($()).optional(),request_object_encryption_alg_values_supported:Re($()).optional(),request_object_encryption_enc_values_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),display_values_supported:Re($()).optional(),claim_types_supported:Re($()).optional(),claims_supported:Re($()).optional(),service_documentation:$().optional(),claims_locales_supported:Re($()).optional(),ui_locales_supported:Re($()).optional(),claims_parameter_supported:Nt().optional(),request_parameter_supported:Nt().optional(),request_uri_parameter_supported:Nt().optional(),require_request_uri_registration:Nt().optional(),op_policy_uri:gr.optional(),op_tos_uri:gr.optional(),client_id_metadata_document_supported:Nt().optional()}),gue=be({...uae.shape,...cae.pick({code_challenge_methods_supported:!0}).shape}),vue=be({access_token:$(),id_token:$().optional(),token_type:$(),expires_in:tN().optional(),scope:$().optional(),refresh_token:$().optional()}).strip(),yue=be({error:$(),error_description:$().optional(),error_uri:$().optional()}),qM=gr.optional().or(Ge("").transform(()=>{})),dae=be({redirect_uris:Re(gr),token_endpoint_auth_method:$().optional(),grant_types:Re($()).optional(),response_types:Re($()).optional(),client_name:$().optional(),client_uri:gr.optional(),logo_uri:qM,scope:$().optional(),contacts:Re($()).optional(),tos_uri:qM,policy_uri:$().optional(),jwks_uri:gr.optional(),jwks:WB().optional(),software_id:$().optional(),software_version:$().optional(),software_statement:$().optional()}).strip(),fae=be({client_id:$(),client_secret:$().optional(),client_id_issued_at:at().optional(),client_secret_expires_at:at().optional()}).strip(),_ue=dae.merge(fae);be({error:$(),error_description:$().optional()}).strip();be({token:$(),token_type_hint:$().optional()}).strip();class wr extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class rw extends wr{}rw.errorCode="invalid_request";class ow extends wr{}ow.errorCode="invalid_client";class iw extends wr{}iw.errorCode="invalid_grant";class sw extends wr{}sw.errorCode="unauthorized_client";class aw extends wr{}aw.errorCode="unsupported_grant_type";class lw extends wr{}lw.errorCode="invalid_scope";class cw extends wr{}cw.errorCode="access_denied";class uw extends wr{}uw.errorCode="server_error";class dw extends wr{}dw.errorCode="temporarily_unavailable";class fw extends wr{}fw.errorCode="unsupported_response_type";class hw extends wr{}hw.errorCode="unsupported_token_type";class pw extends wr{}pw.errorCode="invalid_token";class mw extends wr{}mw.errorCode="method_not_allowed";class gw extends wr{}gw.errorCode="too_many_requests";class vw extends wr{}vw.errorCode="invalid_client_metadata";class yw extends wr{}yw.errorCode="insufficient_scope";class _w extends wr{}_w.errorCode="invalid_target";const bue={[rw.errorCode]:rw,[ow.errorCode]:ow,[iw.errorCode]:iw,[sw.errorCode]:sw,[aw.errorCode]:aw,[lw.errorCode]:lw,[cw.errorCode]:cw,[uw.errorCode]:uw,[dw.errorCode]:dw,[fw.errorCode]:fw,[hw.errorCode]:hw,[pw.errorCode]:pw,[mw.errorCode]:mw,[gw.errorCode]:gw,[vw.errorCode]:vw,[yw.errorCode]:yw,[_w.errorCode]:_w};async function G6(e){if(!e.getServerCapabilities()?.resources)return{resources:[]};try{return await e.listResources()}catch(n){if(n instanceof fv&&n.code===uf.MethodNotFound)return{resources:[]};throw n}}async function hae(e,t){return await e.readResource({uri:t})}function wue(e){const t=er.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>G6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],ff(c)}function Sue(e){const t=er.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>G6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],vP(c)}function Eue(e){const t=er.c(15);let n,r,o;t[0]!==e?({client:n,uri:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o):(n=t[1],r=t[2],o=t[3]);let s;t[4]!==n||t[5]!==o?(s=cv.mcpReadResource(n,o),t[4]=n,t[5]=o,t[6]=s):s=t[6];let l;t[7]!==n||t[8]!==o?(l=()=>hae(n,o),t[7]=n,t[8]=o,t[9]=l):l=t[9];const c=r.staleTime??3e4;let d;return t[10]!==r||t[11]!==s||t[12]!==l||t[13]!==c?(d={...r,queryKey:s,queryFn:l,staleTime:c,retry:!1},t[10]=r,t[11]=s,t[12]=l,t[13]=c,t[14]=d):d=t[14],ff(d)}const K6="ui-resource-html";function xue(e){const t=er.c(20);let n,r,o,s,l;t[0]!==e?({orgSlug:o,connectionId:n,uri:l,meshUrl:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);let c;t[6]!==n||t[7]!==o||t[8]!==l?(c=cv.mcpUiResourceHtml(o,n,l),t[6]=n,t[7]=o,t[8]=l,t[9]=c):c=t[9];let d;t[10]!==n||t[11]!==r||t[12]!==o||t[13]!==l?(d=async()=>{const g=`${r??(typeof window<"u"?window.location.origin:"")}/api/${encodeURIComponent(o)}/mcp/${encodeURIComponent(n)}/ui-resource?uri=${encodeURIComponent(l)}`,v=await fetch(g,{credentials:"include"});if(!v.ok)throw new Error(`Failed to read UI resource (${v.status})`);return v.text()},t[10]=n,t[11]=r,t[12]=o,t[13]=l,t[14]=d):d=t[14];const f=s.staleTime??3e4;let p;return t[15]!==s||t[16]!==c||t[17]!==d||t[18]!==f?(p={...s,queryKey:c,queryFn:d,staleTime:f,retry:!1},t[15]=s,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19],ff(p)}const pae=be({authorizationEndpoint:$().url(),tokenEndpoint:$().url(),introspectionEndpoint:$().url().optional(),clientId:$(),clientSecret:$().optional(),scopes:Re($()),grantType:rn(["authorization_code","client_credentials"])}),HM=be({type:Ge("object"),properties:Mt($(),Gt()).optional(),required:Re($()).optional()}).catchall(Gt()),mae=cE.extend({inputSchema:HM,outputSchema:HM.optional()}),gae=be({headers:Mt($(),$()).optional()}),vae=be({command:$().describe("Command to run (e.g., 'npx', 'node')"),args:Re($()).optional().describe("Command arguments"),cwd:$().optional().describe("Working directory"),envVars:Mt($(),$()).optional().describe("Environment variables (encrypted in storage)")}),Z6=be({id:$().describe("Unique identifier for the connection"),title:$().describe("Human-readable name for the connection"),created_at:$().describe("When the connection was created"),updated_at:$().describe("When the connection was last updated"),created_by:$().describe("User ID who created the connection"),updated_by:$().optional().describe("User ID who last updated the connection"),organization_id:$().describe("Organization ID this connection belongs to"),description:$().nullable().describe("Description of the connection"),icon:$().nullable().describe("Icon URL for the connection"),app_name:$().nullable().describe("Associated app name"),app_id:$().nullable().describe("Associated app ID"),slug:$().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:rn(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:$().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:$().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:nn([vae,gae]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:pae.nullable().describe("OAuth configuration"),configuration_state:Mt($(),Gt()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Re($()).nullable().optional().describe("Configuration scopes"),metadata:Mt($(),Gt()).nullable().describe("Additional metadata (includes repository info)"),tools:Re(mae).nullable().describe("Discovered tools from MCP"),bindings:Re($()).nullable().describe("Detected bindings"),status:rn(["active","inactive","error"]).describe("Current status")});Z6.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:$().nullish()});Z6.partial();function Rue(e){return e!=null&&"command"in e}function Oue(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const Nd=be({connection_id:$().describe("Connection ID"),selected_tools:Re($()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Re($()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Re($()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),Y6=Nd.extend({selected_tools:Nd.shape.selected_tools.optional(),selected_resources:Nd.shape.selected_resources.optional(),selected_prompts:Nd.shape.selected_prompts.optional()}),yae=be({connectionId:$(),toolName:$(),label:$(),icon:$().nullable().optional()}),_ae=be({id:$().describe("Stable id; used as React key and ?tab= value"),title:$().describe("Tab label"),icon:$().optional().describe("Optional lucide icon name"),view:be({type:Ge("ext-app"),appId:$(),args:Mt($(),Gt()).optional()})}),bae=be({defaultMainView:be({type:$(),id:$().optional(),toolName:$().optional()}).nullable().optional(),chatDefaultOpen:Nt().nullable().optional(),tabs:Re(_ae).optional()}),GM=be({tileId:$().optional(),connectionId:$().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:$().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:$().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Mt($(),Gt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:at().int().positive().optional(),maxHeight:at().int().positive().optional()}),pE=be({banner:$().nullable().optional(),bannerColor:$().nullable().optional(),icon:$().nullable().optional(),themeColor:$().nullable().optional(),pinnedViews:Re(yae).nullable().optional(),layout:bae.nullable().optional(),homeTile:GM.nullable().optional(),homeTiles:Re(GM).nullable().optional(),homePrompts:Re($()).nullable().optional()});function Tue(e){const t=e?.homeTiles;if(Array.isArray(t)&&t.length>0)return t;const n=e?.homeTile;return n?[n]:[]}const wae=/^[A-Za-z_][A-Za-z0-9_]*$/,KM=$().min(1).regex(wae,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),Sae=Vw("kind",[be({key:KM,kind:Ge("literal"),value:$()}),be({key:KM,kind:Ge("secret"),secretId:$().min(1)})]),mE=be({selected:$().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:$().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:$().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:Re(Sae).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that mesh resolves via the credential vault before posting /_sandbox/config.")}),gE=be({url:$().describe("GitHub repository URL"),owner:$().describe("Repository owner"),name:$().describe("Repository name"),installationId:at().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:$().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),Eae=rn(["agent-sandbox","user-desktop"]),xae=rn(["agent-sandbox","user-desktop","cluster"]);function W6(e){return e==="cluster"?"agent-sandbox":e}const Q6={sandboxHandle:$().describe("Provider-specific handle"),previewUrl:$().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:$().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:Eae.optional(),createdAt:at().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:be({packageManager:$().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:$().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:$().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},X6=be(Q6),Rae=be({...Q6,sandboxProviderKind:xae.optional()});function Oae(e){const t=Rae.parse(e);return X6.parse({...t,sandboxProviderKind:t.sandboxProviderKind?W6(t.sandboxProviderKind):void 0})}function Cue(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t=e,n={};for(const[r,o]of Object.entries(t)){if(!o||typeof o!="object"||r!=="cluster"&&r!=="agent-sandbox"&&r!=="user-desktop")continue;const s=W6(r);try{if(r==="cluster"&&n[s])continue;n[s]=Oae(o)}catch{}}return n}const vE=Mt($().describe("userId"),Mt($().describe("branch"),Mt($().describe("sandboxProviderKind"),X6))),Tae=be({id:$().describe("Stable identifier for this knowledge file"),name:$().describe("File name shown in the UI"),kind:rn(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:$().describe("Org filesystem (Library) volume the file lives in"),path:$().describe("Path within the volume"),url:$().describe("Same-origin URL to read the file (display/download)"),contentType:$().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:at().nullable().optional().describe("File size in bytes"),addedAt:$().describe("ISO timestamp when the file was attached")}),yE=Re(Tae).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),Aue=be({id:$().describe("Unique identifier"),title:$().describe("Human-readable name"),description:$().nullable().describe("Description"),icon:$().nullable().describe("Icon URL"),created_at:$().describe("Creation timestamp"),updated_at:$().describe("Last update timestamp"),created_by:$().describe("User ID who created this item"),updated_by:$().optional().describe("User ID who last updated this item"),organization_id:$().describe("Organization ID this item belongs to"),status:rn(["active","inactive"]).describe("Current status"),pinned:Nt().describe("Whether this space is pinned to the sidebar"),metadata:be({instructions:$().nullable().describe("Instructions also used as system prompt"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().describe("Metadata"),connections:Re(Nd).describe("Connections with their selected tools, resources, and prompts")}),J6=be({title:$().min(1).max(120).describe("Short label shown on the chip"),description:$().max(280).optional().describe("One-line subtitle shown under the title"),text:$().min(1).describe("The message sent to the agent when the prompt is clicked")});be({title:$().min(1).max(255).describe("Name for the virtual MCP"),description:$().nullable().optional().describe("Optional description"),icon:$().nullish().describe("Optional icon URL"),status:rn(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Nt().optional().default(!1).describe("Pin to sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(Y6).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:Re(J6).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});be({title:$().min(1).max(255).optional().describe("New name"),description:$().nullable().optional().describe("New description (null to clear)"),icon:$().nullish().describe("New icon URL"),status:rn(["active","inactive"]).optional().describe("New status"),pinned:Nt().optional().describe("Pin/unpin from sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(Y6).optional().describe("New connections (replaces existing)"),prompts:Re(J6).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});var ZM;(function(e){e.Completable="McpCompletable"})(ZM||(ZM={}));const Cae="mesh-ui-resources",Tg="html",Aae=10080*60*1e3,Iae=50,Mae=16*1024*1024;function Pae(e){return e[0]==="mcp"&&e[1]===K6}function vv(){return new Promise((e,t)=>{const n=indexedDB.open(Cae,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(Tg)||n.result.createObjectStore(Tg)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function eu(e,t){return e.transaction(Tg,t).objectStore(Tg)}function bw(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}async function Nae(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=eu(t,"readonly"),r=await bw(n.getAllKeys()),o=await bw(n.getAll()),s=Date.now(),l=r.map((f,p)=>({key:f,value:o[p]})).sort((f,p)=>(p.value?.updatedAt??0)-(f.value?.updatedAt??0)),c=[];let d=0;for(const{key:f,value:p}of l){if(!p||s-p.updatedAt>Aae||d>=Iae){c.push(f);continue}d++;try{const g=JSON.parse(String(f));e.getQueryData(g)===void 0&&e.setQueryData(g,p.html,{updatedAt:0})}catch{c.push(f)}}if(c.length>0){const f=eu(t,"readwrite");for(const p of c)f.delete(p)}}catch{}}function kae(e){if(typeof indexedDB>"u")return()=>{};const t=vv().catch(()=>null);return e.getQueryCache().subscribe(n=>{const r=n.query;if(!Array.isArray(r.queryKey)||!Pae(r.queryKey)||r.state.status!=="success")return;const o=r.state.data;typeof o!="string"||o.length>Mae||t.then(s=>{if(s)try{eu(s,"readwrite").put({html:o,updatedAt:Date.now()},JSON.stringify(r.queryKey))}catch{}})})}function Dae(){typeof indexedDB>"u"||vv().then(e=>eu(e,"readwrite").clear()).catch(()=>{})}async function Iue(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=await bw(eu(t,"readonly").getAllKeys()),r=eu(t,"readwrite");for(const o of n)try{const s=JSON.parse(String(o));s[1]===K6&&s[3]===e&&r.delete(o)}catch{}}catch{}}const Cg="mesh:rq-cache",eL=1440*60*1e3,Lae=1e3,$ae=new Set(["publicConfig","ai-provider-keys","organization-settings","home-next-actions"]),jae=new Set(["VIRTUAL_MCP","CONNECTIONS"]);let tL=!1,nL=!1;function zae(e){const t=e[0];return typeof t=="string"&&$ae.has(t)?!0:e[3]==="collection"&&typeof e[4]=="string"&&jae.has(e[4])}function Uae(e){if(!(typeof window>"u"))try{const t=window.localStorage.getItem(Cg);if(!t)return;const n=JSON.parse(t),r=!n.timestamp||Date.now()-n.timestamp>eL;if(n.buster!=="4.42.1"||r||!n.state){window.localStorage.removeItem(Cg);return}o8(e,n.state),tL=!0}catch{Bae()}}function Fae(e){if(typeof window>"u")return()=>{};let t=null;const n=()=>{t=null;try{const r=r8(e,{shouldDehydrateQuery:o=>o.state.status==="success"&&zae(o.queryKey)});window.localStorage.setItem(Cg,JSON.stringify({buster:"4.42.1",timestamp:Date.now(),state:r}))}catch{}};return e.getQueryCache().subscribe(()=>{t==null&&(t=setTimeout(n,Lae))})}const rL="studio:org-cache:";function oL(e){return`${rL}${e}`}function Mue(e,t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(oL(e));if(!n)return null;const r=JSON.parse(n)[t];return!r||Date.now()-r.updatedAt>eL?null:(nL=!0,r)}catch{return null}}function Pue(e,t,n){if(!(typeof window>"u"))try{const r=oL(e),o=window.localStorage.getItem(r),s=o?JSON.parse(o):{};s[t]={data:n,updatedAt:Date.now()},window.localStorage.setItem(r,JSON.stringify(s))}catch{}}function Bae(){if(Dae(),!(typeof window>"u"))try{window.localStorage.removeItem(Cg);for(let e=window.localStorage.length-1;e>=0;e--){const t=window.localStorage.key(e);t?.startsWith(rL)&&window.localStorage.removeItem(t)}}catch{}}function Vae(){return tL}function qae(){return nL}let ps=!1,ww=null,YM=!1;const _E="mesh:lp-distinct-id",Hae=1440*60*1e3;function iL(){try{const e=window.localStorage.getItem(_E);if(!e)return;const{id:t,ts:n}=JSON.parse(e);return typeof t!="string"||!t||typeof n!="number"?void 0:Date.now()-n<=Hae?t:void 0}catch{return}}function Gae(){try{window.localStorage.removeItem(_E)}catch{}}function Kae(){try{const e=new URL(window.location.href),t=e.searchParams.get("ph_did");t&&(window.localStorage.setItem(_E,JSON.stringify({id:t,ts:Date.now()})),e.searchParams.delete("ph_did"),window.history.replaceState(window.history.state,"",e.toString()));const n=t??iL();return n?Object.keys(window.localStorage).some(o=>o.startsWith("ph_")&&o.endsWith("_posthog"))?void 0:n:void 0}catch{return}}function Zae(e){const t=iL();if(t&&(Gae(),t!==e))try{yl.alias(t)}catch{}}function Yae(e,t){if(ps||typeof window>"u")return;const n=Kae();yl.init(e,{api_host:t,ui_host:"https://us.posthog.com",cross_subdomain_cookie:!0,...n?{bootstrap:{distinctID:n}}:{},capture_pageview:"history_change",capture_pageleave:!0,autocapture:!0,capture_performance:{web_vitals:!0,network_timing:!0},capture_exceptions:!0,session_recording:{maskAllInputs:!0,blockClass:"ph-no-capture"},person_profiles:"identified_only"}),ps=!0}function Wae(e,t){ps&&(yl.identify(e,t),Zae(e))}function Qae(){ps&&(yl.reset(),ww=null)}function Xae(e,t){ps&&yl.capture(e,t)}function Nue(){return ps}function kue(){if(!ps||YM||typeof performance>"u")return;YM=!0;const e=performance.getEntriesByType("navigation")[0],t=n=>{const r=performance.getEntriesByName(n,"measure")[0];return r?Math.round(r.duration):void 0};Xae("perf_app_bootstrap",{nav_type:e?.type,ttfb_ms:e?Math.round(e.responseStart):void 0,dom_interactive_ms:e?Math.round(e.domInteractive):void 0,dom_content_loaded_ms:e?Math.round(e.domContentLoadedEventEnd):void 0,config_fetch_ms:t("mesh:config-fetch"),active_org_fetch_ms:t("mesh:active-org-fetch"),time_to_shell_ms:Math.round(performance.now()),cache_restored:Vae(),org_cache_restored:qae()})}function Due(e,t){ps&&e!==ww&&(yl.group("organization",e,t),ww=e)}function sL(e,t){if(ps)try{yl.captureException(e,t)}catch{}}let hm=null;function Jae({children:e}){const t=_P(),{data:n}=Vg.useSession();if(t.posthog){Yae(t.posthog.key,t.posthog.host);const r=n?.user?.id??null;r&&r!==hm?(Wae(r,{email:n?.user?.email,name:n?.user?.name}),hm=r):!r&&hm&&(Qae(),hm=null)}return C.jsx(C.Fragment,{children:e})}const bE=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));bE.displayName="AlertTriangle";const aL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M4 7.997a2.295 2.295 0 0 1-.39-.035A2 2 0 0 1 2.038 6.39C2 6.197 2 5.965 2 5.5s0-.697.038-.89A2 2 0 0 1 3.61 3.038C3.803 3 4.035 3 4.5 3h15c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89s0 .697-.038.89a2 2 0 0 1-1.572 1.572c-.107.02-.226.03-.39.035M10 13h4M4 8h16v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 21 16.88 21 15.2 21H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 18.72 4 17.88 4 16.2V8Z"}));aL.displayName="Archive";const wE=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 2.25v2.5M12 18v4M5.75 12h-3.5m19 0h-1.5m-1.293 6.457-.707-.707m.914-12.334L17.25 6.83M4.922 19.078 7.75 16.25M5.129 5.209 7.25 7.33"}));wE.displayName="Loading01";const lL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));lL.displayName="Lock01";const cL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M21 10s-2.005-2.732-3.634-4.362a9 9 0 1 0 2.282 8.862M21 10V4m0 6h-6"}));cL.displayName="RefreshCw01";function SE(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{className:"flex items-center justify-center min-h-screen w-full",children:C.jsx(wE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function ele(e){try{return JSON.parse(e)}catch{return}}function WM(e,t){const n=localStorage.getItem(e),r=n?ele(n):void 0,o=typeof t=="function"?t(r):r??t;if(r===void 0||o!==r)try{const s=JSON.stringify(o);localStorage.setItem(e,s)}catch{}return o}function tle(e,t){const n=er.c(25),r=Aw();let o;n[0]!==e?(o=["localStorage",e],n[0]=e,n[1]=o):o=n[1];const s=o;let l,c;n[2]!==t||n[3]!==e?(l=()=>WM(e,t),c=()=>WM(e,t),n[2]=t,n[3]=e,n[4]=l,n[5]=c):(l=n[4],c=n[5]);let d;n[6]!==s||n[7]!==l||n[8]!==c?(d={queryKey:s,queryFn:l,initialData:c,staleTime:1/0,gcTime:1/0},n[6]=s,n[7]=l,n[8]=c,n[9]=d):d=n[9];const{data:f}=vP(d);let p;n[10]!==e?(p=async E=>{const T=JSON.stringify(E);return localStorage.setItem(e,T),E},n[10]=e,n[11]=p):p=n[11];let h;n[12]!==r||n[13]!==s?(h=E=>{r.setQueryData(s,E)},n[12]=r,n[13]=s,n[14]=h):h=n[14];let g;n[15]!==p||n[16]!==h?(g={mutationFn:p,onSuccess:h},n[15]=p,n[16]=h,n[17]=g):g=n[17];const v=C8(g);let _;n[18]!==v||n[19]!==r||n[20]!==s?(_=E=>{const T=r.getQueryData(s),R=typeof E=="function"?E(T):E;v.mutate(R)},n[18]=v,n[19]=r,n[20]=s,n[21]=_):_=n[21];const b=_,x=f;let S;return n[22]!==b||n[23]!==x?(S=[x,b],n[22]=b,n[23]=x,n[24]=S):S=n[24],S}const su={assistantChatTasks:e=>`mesh:assistant-chat:tasks:${e}`,messages:(e,t)=>`mesh:messages:${e}:${t}`,chatSelectedMode:e=>`mesh:chat:selectedMode:${e}`,chatSelectedImageModel:e=>`mesh:chat:selectedImageModel:${e}`,chatSelectedWebSearchModel:e=>`mesh:chat:selectedWebSearchModel:${e}`,chatSelectedDeepResearchModel:e=>`mesh:chat:selectedDeepResearchModel:${e}`,chatSimpleModeTier:e=>`mesh:chat:simpleModeTier:${e}`,chatLastAgentOption:e=>`mesh:chat:lastAgentOption:${e}`,chatAutosend:(e,t)=>`mesh:chat:autosend:${e}:${t}`,chatDraft:(e,t)=>`mesh:chat:draft:${e}:${t}`,assistantChatActiveTask:e=>`mesh:assistant-chat:active-task:${e}`,sidePanelWidth:e=>`mesh:workspace:side-panel-width:${e}`,tasksPanelWidth:()=>"mesh:tasks-panel:width",sidebarOpen:()=>"mesh:sidebar-open",orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",preferences:()=>"mesh:user:preferences",pluginConnection:(e,t)=>`mesh:plugin:connection:${e}:${t}`,lastOrgSlug:()=>"mesh:last-org-slug",lastLocation:()=>"mesh:last-location",connectionsTab:e=>`mesh:connections:tab:${e}`,taskLastViewed:e=>`mesh:chat:task-last-viewed:${e}`,sidebarGroupOrder:(e,t)=>`sidebar.group-order.${e}.${t}`,sidebarOrgPinnedOrder:e=>`sidebar.org-pinned-order.${e}`},nle={toolApprovalLevel:"auto",enableNotifications:typeof Notification<"u",enableSounds:!1,theme:"system"},uL=["auto","readonly"],Lue=[{value:"readonly",label:"Ask before edit",short:"Ask"},{value:"auto",label:"Auto approve",short:"Auto"}],rle=["light","dark","system"];function $ue(){try{const e=JSON.parse(localStorage.getItem(su.preferences())??"{}");if(uL.includes(e.toolApprovalLevel))return e.toolApprovalLevel}catch{}return"auto"}function ole(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=su.preferences(),e[0]=t):t=e[0],tle(t,ile)}function ile(e){const t={...nle,...e};return uL.includes(t.toolApprovalLevel)||(t.toolApprovalLevel="auto"),rle.includes(t.theme)||(t.theme="system"),t}async function sle(){performance.mark("mesh:config-fetch:start");try{const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}finally{performance.mark("mesh:config-fetch:end"),performance.measure("mesh:config-fetch","mesh:config-fetch:start","mesh:config-fetch:end")}}function ale(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
163
|
+
deps: ${p}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[f,p]=s(d);l(d,f),c(d,p)}};function s({schema:d}){const f={},p={};for(const h in d){if(h==="__proto__")continue;const g=Array.isArray(d[h])?f:p;g[h]=d[h]}return[f,p]}function l(d,f=d.schema){const{gen:p,data:h,it:g}=d;if(Object.keys(f).length===0)return;const v=p.let("missing");for(const _ in f){const b=f[_];if(b.length===0)continue;const x=(0,r.propertyInData)(p,h,_,g.opts.ownProperties);d.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),g.allErrors?p.if(x,()=>{for(const S of b)(0,r.checkReportMissingProp)(d,S)}):(p.if((0,t._)`${x} && (${(0,r.checkMissingProp)(d,b,v)})`),(0,r.reportMissingProp)(d,v),p.else())}}e.validatePropertyDeps=l;function c(d,f=d.schema){const{gen:p,data:h,keyword:g,it:v}=d,_=p.name("valid");for(const b in f)(0,n.alwaysValidSchema)(v,f[b])||(p.if((0,r.propertyInData)(p,h,b,v.opts.ownProperties),()=>{const x=d.subschema({keyword:g,schemaProp:b},_);d.mergeValidEvaluated(x,_)},()=>p.var(_,!0)),d.ok(_))}e.validateSchemaDeps=c,e.default=o})(Eb)),Eb}var Jp={},EM;function Mse(){if(EM)return Jp;EM=1,Object.defineProperty(Jp,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:o})=>(0,e._)`{propertyName: ${o.propertyName}}`},code(o){const{gen:s,schema:l,data:c,it:d}=o;if((0,t.alwaysValidSchema)(d,l))return;const f=s.name("valid");s.forIn("key",c,p=>{o.setParams({propertyName:p}),o.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},f),s.if((0,e.not)(f),()=>{o.error(!0),d.allErrors||s.break()})}),o.ok(f)}};return Jp.default=r,Jp}var em={},xM;function H6(){if(xM)return em;xM=1,Object.defineProperty(em,"__esModule",{value:!0});const e=li(),t=mt(),n=wa(),r=kt(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:f,data:p,errsCount:h,it:g}=l;if(!h)throw new Error("ajv implementation error");const{allErrors:v,opts:_}=g;if(g.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,d))return;const b=(0,e.allSchemaProperties)(f.properties),x=(0,e.allSchemaProperties)(f.patternProperties);S(),l.ok((0,t._)`${h} === ${n.default.errors}`);function S(){c.forIn("key",p,A=>{!b.length&&!x.length?R(A):c.if(E(A),()=>R(A))})}function E(A){let I;if(b.length>8){const P=(0,r.schemaRefOrVal)(g,f.properties,"properties");I=(0,e.isOwnProperty)(c,P,A)}else b.length?I=(0,t.or)(...b.map(P=>(0,t._)`${A} === ${P}`)):I=t.nil;return x.length&&(I=(0,t.or)(I,...x.map(P=>(0,t._)`${(0,e.usePattern)(l,P)}.test(${A})`))),(0,t.not)(I)}function T(A){c.code((0,t._)`delete ${p}[${A}]`)}function R(A){if(_.removeAdditional==="all"||_.removeAdditional&&d===!1){T(A);return}if(d===!1){l.setParams({additionalProperty:A}),l.error(),v||c.break();return}if(typeof d=="object"&&!(0,r.alwaysValidSchema)(g,d)){const I=c.name("valid");_.removeAdditional==="failing"?(O(A,I,!1),c.if((0,t.not)(I),()=>{l.reset(),T(A)})):(O(A,I),v||c.if((0,t.not)(I),()=>c.break()))}}function O(A,I,P){const L={keyword:"additionalProperties",dataProp:A,dataPropType:r.Type.Str};P===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(L,I)}}};return em.default=s,em}var tm={},RM;function Pse(){if(RM)return tm;RM=1,Object.defineProperty(tm,"__esModule",{value:!0});const e=mv(),t=li(),n=kt(),r=H6(),o={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,parentSchema:d,data:f,it:p}=s;p.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(p,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(c);for(const x of h)p.definedProperties.add(x);p.opts.unevaluated&&h.length&&p.props!==!0&&(p.props=n.mergeEvaluated.props(l,(0,n.toHash)(h),p.props));const g=h.filter(x=>!(0,n.alwaysValidSchema)(p,c[x]));if(g.length===0)return;const v=l.name("valid");for(const x of g)_(x)?b(x):(l.if((0,t.propertyInData)(l,f,x,p.opts.ownProperties)),b(x),p.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(x),s.ok(v);function _(x){return p.opts.useDefaults&&!p.compositeRule&&c[x].default!==void 0}function b(x){s.subschema({keyword:"properties",schemaProp:x,dataProp:x},v)}}};return tm.default=o,tm}var nm={},OM;function Nse(){if(OM)return nm;OM=1,Object.defineProperty(nm,"__esModule",{value:!0});const e=li(),t=mt(),n=kt(),r=kt(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,data:d,parentSchema:f,it:p}=s,{opts:h}=p,g=(0,e.allSchemaProperties)(c),v=g.filter(R=>(0,n.alwaysValidSchema)(p,c[R]));if(g.length===0||v.length===g.length&&(!p.opts.unevaluated||p.props===!0))return;const _=h.strictSchema&&!h.allowMatchingProperties&&f.properties,b=l.name("valid");p.props!==!0&&!(p.props instanceof t.Name)&&(p.props=(0,r.evaluatedPropsToName)(l,p.props));const{props:x}=p;S();function S(){for(const R of g)_&&E(R),p.allErrors?T(R):(l.var(b,!0),T(R),l.if(b))}function E(R){for(const O in _)new RegExp(R).test(O)&&(0,n.checkStrictMode)(p,`property ${O} matches pattern ${R} (use allowMatchingProperties)`)}function T(R){l.forIn("key",d,O=>{l.if((0,t._)`${(0,e.usePattern)(s,R)}.test(${O})`,()=>{const A=v.includes(R);A||s.subschema({keyword:"patternProperties",schemaProp:R,dataProp:O,dataPropType:r.Type.Str},b),p.opts.unevaluated&&x!==!0?l.assign((0,t._)`${x}[${O}]`,!0):!A&&!p.allErrors&&l.if((0,t.not)(b),()=>l.break())})})}}};return nm.default=o,nm}var rm={},TM;function kse(){if(TM)return rm;TM=1,Object.defineProperty(rm,"__esModule",{value:!0});const e=kt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:o,it:s}=n;if((0,e.alwaysValidSchema)(s,o)){n.fail();return}const l=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return rm.default=t,rm}var om={},CM;function Dse(){if(CM)return om;CM=1,Object.defineProperty(om,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:li().validateUnion,error:{message:"must match a schema in anyOf"}};return om.default=t,om}var im={},AM;function Lse(){if(AM)return im;AM=1,Object.defineProperty(im,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:o})=>(0,e._)`{passingSchemas: ${o.passing}}`},code(o){const{gen:s,schema:l,parentSchema:c,it:d}=o;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const f=l,p=s.let("valid",!1),h=s.let("passing",null),g=s.name("_valid");o.setParams({passing:h}),s.block(v),o.result(p,()=>o.reset(),()=>o.error(!0));function v(){f.forEach((_,b)=>{let x;(0,t.alwaysValidSchema)(d,_)?s.var(g,!0):x=o.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},g),b>0&&s.if((0,e._)`${g} && ${p}`).assign(p,!1).assign(h,(0,e._)`[${h}, ${b}]`).else(),s.if(g,()=>{s.assign(p,!0),s.assign(h,b),x&&o.mergeEvaluated(x,e.Name)})})}}};return im.default=r,im}var sm={},IM;function $se(){if(IM)return sm;IM=1,Object.defineProperty(sm,"__esModule",{value:!0});const e=kt(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:o,it:s}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");const l=r.name("valid");o.forEach((c,d)=>{if((0,e.alwaysValidSchema)(s,c))return;const f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};return sm.default=t,sm}var am={},MM;function jse(){if(MM)return am;MM=1,Object.defineProperty(am,"__esModule",{value:!0});const e=mt(),t=kt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:c,it:d}=s;c.then===void 0&&c.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const f=o(d,"then"),p=o(d,"else");if(!f&&!p)return;const h=l.let("valid",!0),g=l.name("_valid");if(v(),s.reset(),f&&p){const b=l.let("ifClause");s.setParams({ifClause:b}),l.if(g,_("then",b),_("else",b))}else f?l.if(g,_("then")):l.if((0,e.not)(g),_("else"));s.pass(h,()=>s.error(!0));function v(){const b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(b)}function _(b,x){return()=>{const S=s.subschema({keyword:b},g);l.assign(h,g),s.mergeValidEvaluated(S,h),x?l.assign(x,(0,e._)`${b}`):s.setParams({ifClause:b})}}}};function o(s,l){const c=s.schema[l];return c!==void 0&&!(0,t.alwaysValidSchema)(s,c)}return am.default=r,am}var lm={},PM;function zse(){if(PM)return lm;PM=1,Object.defineProperty(lm,"__esModule",{value:!0});const e=kt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:o}){r.if===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "if" is ignored`)}};return lm.default=t,lm}var NM;function Use(){if(NM)return Yp;NM=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=V6(),t=Tse(),n=q6(),r=Cse(),o=Ase(),s=Ise(),l=Mse(),c=H6(),d=Pse(),f=Nse(),p=kse(),h=Dse(),g=Lse(),v=$se(),_=jse(),b=zse();function x(S=!1){const E=[p.default,h.default,g.default,v.default,_.default,b.default,l.default,c.default,s.default,d.default,f.default];return S?E.push(t.default,r.default):E.push(e.default,n.default),E.push(o.default),E}return Yp.default=x,Yp}var cm={},um={},kM;function Fse(){if(kM)return um;kM=1,Object.defineProperty(um,"__esModule",{value:!0});const e=mt(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,o){const{gen:s,data:l,$data:c,schema:d,schemaCode:f,it:p}=r,{opts:h,errSchemaPath:g,schemaEnv:v,self:_}=p;if(!h.validateFormats)return;c?b():x();function b(){const S=s.scopeValue("formats",{ref:_.formats,code:h.code.formats}),E=s.const("fDef",(0,e._)`${S}[${f}]`),T=s.let("fType"),R=s.let("format");s.if((0,e._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>s.assign(T,(0,e._)`${E}.type || "string"`).assign(R,(0,e._)`${E}.validate`),()=>s.assign(T,(0,e._)`"string"`).assign(R,E)),r.fail$data((0,e.or)(O(),A()));function O(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${R}`}function A(){const I=v.$async?(0,e._)`(${E}.async ? await ${R}(${l}) : ${R}(${l}))`:(0,e._)`${R}(${l})`,P=(0,e._)`(typeof ${R} == "function" ? ${I} : ${R}.test(${l}))`;return(0,e._)`${R} && ${R} !== true && ${T} === ${o} && !${P}`}}function x(){const S=_.formats[d];if(!S){O();return}if(S===!0)return;const[E,T,R]=A(S);E===o&&r.pass(I());function O(){if(h.strictSchema===!1){_.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${d}" ignored in schema at path "${g}"`}}function A(P){const L=P instanceof RegExp?(0,e.regexpCode)(P):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(d)}`:void 0,q=s.scopeValue("formats",{key:d,ref:P,code:L});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,e._)`${q}.validate`]:["string",P,q]}function I(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${R}(${l})`}return typeof T=="function"?(0,e._)`${R}(${l})`:(0,e._)`${R}.test(${l})`}}}};return um.default=n,um}var DM;function Bse(){if(DM)return cm;DM=1,Object.defineProperty(cm,"__esModule",{value:!0});const t=[Fse().default];return cm.default=t,cm}var Ya={},LM;function Vse(){return LM||(LM=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.contentVocabulary=Ya.metadataVocabulary=void 0,Ya.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ya.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ya}var $M;function qse(){if($M)return Np;$M=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=pse(),t=Ose(),n=Use(),r=Bse(),o=Vse(),s=[e.default,t.default,(0,n.default)(),r.default,o.metadataVocabulary,o.contentVocabulary];return Np.default=s,Np}var dm={},bd={},jM;function Hse(){if(jM)return bd;jM=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(bd.DiscrError=e={})),bd}var zM;function Gse(){if(zM)return dm;zM=1,Object.defineProperty(dm,"__esModule",{value:!0});const e=mt(),t=Hse(),n=dE(),r=gv(),o=kt(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:f}})=>(0,e._)`{error: ${c}, tag: ${f}, tagValue: ${d}}`},code(c){const{gen:d,data:f,schema:p,parentSchema:h,it:g}=c,{oneOf:v}=h;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=p.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(p.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const b=d.let("valid",!1),x=d.const("tag",(0,e._)`${f}${(0,e.getProperty)(_)}`);d.if((0,e._)`typeof ${x} == "string"`,()=>S(),()=>c.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:_})),c.ok(b);function S(){const R=T();d.if(!1);for(const O in R)d.elseIf((0,e._)`${x} === ${O}`),d.assign(b,E(R[O]));d.else(),c.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:_}),d.endIf()}function E(R){const O=d.name("valid"),A=c.subschema({keyword:"oneOf",schemaProp:R},O);return c.mergeEvaluated(A,e.Name),O}function T(){var R;const O={},A=P(h);let I=!0;for(let j=0;j<v.length;j++){let B=v[j];if(B?.$ref&&!(0,o.schemaHasRulesButRef)(B,g.self.RULES)){const Z=B.$ref;if(B=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,Z),B instanceof n.SchemaEnv&&(B=B.schema),B===void 0)throw new r.default(g.opts.uriResolver,g.baseId,Z)}const F=(R=B?.properties)===null||R===void 0?void 0:R[_];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);I=I&&(A||P(B)),L(F,j)}if(!I)throw new Error(`discriminator: "${_}" must be required`);return O;function P({required:j}){return Array.isArray(j)&&j.includes(_)}function L(j,B){if(j.const)q(j.const,B);else if(j.enum)for(const F of j.enum)q(F,B);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function q(j,B){if(typeof j!="string"||j in O)throw new Error(`discriminator: "${_}" values must be unique strings`);O[j]=B}}}};return dm.default=l,dm}const Kse="http://json-schema.org/draft-07/schema#",Zse="http://json-schema.org/draft-07/schema#",Yse="Core schema meta-schema",Wse={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Qse=["object","boolean"],Xse={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Jse={$schema:Kse,$id:Zse,title:Yse,definitions:Wse,type:Qse,properties:Xse,default:!0};var UM;function eae(){return UM||(UM=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=dse(),r=qse(),o=Gse(),s=Jse,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(_,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var f=mv();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var p=mt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=uE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var g=gv();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})(Cp,Cp.exports)),Cp.exports}var fm={exports:{}},xb={},FM;function tae(){return FM||(FM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,B){return{validate:j,compare:B}}e.fullFormats={date:t(s,l),time:t(d(!0),f),"date-time":t(g(!0),v),"iso-time":t(d(),p),"iso-date-time":t(g(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:S,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:T,int32:{type:"number",validate:A},int64:{type:"number",validate:I},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const B=r.exec(j);if(!B)return!1;const F=+B[1],Z=+B[2],ie=+B[3];return Z>=1&&Z<=12&&ie>=1&&ie<=(Z===2&&n(F)?29:o[Z])}function l(j,B){if(j&&B)return j>B?1:j<B?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function d(j){return function(F){const Z=c.exec(F);if(!Z)return!1;const ie=+Z[1],H=+Z[2],W=+Z[3],te=Z[4],le=Z[5]==="-"?-1:1,Q=+(Z[6]||0),k=+(Z[7]||0);if(Q>23||k>59||j&&!te)return!1;if(ie<=23&&H<=59&&W<60)return!0;const G=H-k*le,V=ie-Q*le-(G<0?1:0);return(V===23||V===-1)&&(G===59||G===-1)&&W<61}}function f(j,B){if(!(j&&B))return;const F=new Date("2020-01-01T"+j).valueOf(),Z=new Date("2020-01-01T"+B).valueOf();if(F&&Z)return F-Z}function p(j,B){if(!(j&&B))return;const F=c.exec(j),Z=c.exec(B);if(F&&Z)return j=F[1]+F[2]+F[3],B=Z[1]+Z[2]+Z[3],j>B?1:j<B?-1:0}const h=/t|\s/i;function g(j){const B=d(j);return function(Z){const ie=Z.split(h);return ie.length===2&&s(ie[0])&&B(ie[1])}}function v(j,B){if(!(j&&B))return;const F=new Date(j).valueOf(),Z=new Date(B).valueOf();if(F&&Z)return F-Z}function _(j,B){if(!(j&&B))return;const[F,Z]=j.split(h),[ie,H]=B.split(h),W=l(F,ie);if(W!==void 0)return W||f(Z,H)}const b=/\/|:/,x=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function S(j){return b.test(j)&&x.test(j)}const E=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function T(j){return E.lastIndex=0,E.test(j)}const R=-2147483648,O=2**31-1;function A(j){return Number.isInteger(j)&&j<=O&&j>=R}function I(j){return Number.isInteger(j)}function P(){return!0}const L=/[^\\]\\Z/;function q(j){if(L.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(xb)),xb}var Rb={},BM;function nae(){return BM||(BM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=eae(),n=mt(),r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:c,schemaCode:d})=>(0,n.str)`should be ${o[c].okStr} ${d}`,params:({keyword:c,schemaCode:d})=>(0,n._)`{comparison: ${o[c].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(c){const{gen:d,data:f,schemaCode:p,keyword:h,it:g}=c,{opts:v,self:_}=g;if(!v.validateFormats)return;const b=new t.KeywordCxt(g,_.RULES.all.format.definition,"format");b.$data?x():S();function x(){const T=d.scopeValue("formats",{ref:_.formats,code:v.code.formats}),R=d.const("fmt",(0,n._)`${T}[${b.schemaCode}]`);c.fail$data((0,n.or)((0,n._)`typeof ${R} != "object"`,(0,n._)`${R} instanceof RegExp`,(0,n._)`typeof ${R}.compare != "function"`,E(R)))}function S(){const T=b.schema,R=_.formats[T];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${h}": format "${T}" does not define "compare" function`);const O=d.scopeValue("formats",{key:T,ref:R,code:v.code.formats?(0,n._)`${v.code.formats}${(0,n.getProperty)(T)}`:void 0});c.fail$data(E(O))}function E(T){return(0,n._)`${T}.compare(${f}, ${p}) ${o[h].fail} 0`}},dependencies:["format"]};const l=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=l})(Rb)),Rb}var VM;function rae(){return VM||(VM=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tae(),r=nae(),o=mt(),s=new o.Name("fullFormats"),l=new o.Name("fastFormats"),c=(f,p={keywords:!0})=>{if(Array.isArray(p))return d(f,p,n.fullFormats,s),f;const[h,g]=p.mode==="fast"?[n.fastFormats,l]:[n.fullFormats,s],v=p.formats||n.formatNames;return d(f,v,h,g),p.keywords&&(0,r.default)(f),f};c.get=(f,p="full")=>{const g=(p==="fast"?n.fastFormats:n.fullFormats)[f];if(!g)throw new Error(`Unknown format "${f}"`);return g};function d(f,p,h,g){var v,_;(v=(_=f.opts.code).formats)!==null&&v!==void 0||(_.formats=(0,o._)`require("ajv-formats/dist/formats").${g}`);for(const b of p)f.addFormat(b,h[b])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fm,fm.exports)),fm.exports}var oae=rae();const hue=dl(oae);let hE;hE=globalThis.crypto;async function iae(e){return(await hE).getRandomValues(new Uint8Array(e))}async function sae(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const o=await iae(e-r.length);for(const s of o)s<n&&(r+=t[s%t.length])}return r}async function aae(e){return await sae(e)}async function lae(e){const t=await(await hE).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function pue(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await aae(e),n=await lae(t);return{code_verifier:t,code_challenge:n}}const gr=AB().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:xV.custom,message:"URL must be parseable",fatal:!0}),C9}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),mue=vr({resource:$().url(),authorization_servers:Re(gr).optional(),jwks_uri:$().url().optional(),scopes_supported:Re($()).optional(),bearer_methods_supported:Re($()).optional(),resource_signing_alg_values_supported:Re($()).optional(),resource_name:$().optional(),resource_documentation:$().optional(),resource_policy_uri:$().url().optional(),resource_tos_uri:$().url().optional(),tls_client_certificate_bound_access_tokens:Nt().optional(),authorization_details_types_supported:Re($()).optional(),dpop_signing_alg_values_supported:Re($()).optional(),dpop_bound_access_tokens_required:Nt().optional()}),cae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),service_documentation:gr.optional(),revocation_endpoint:gr.optional(),revocation_endpoint_auth_methods_supported:Re($()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re($()).optional(),introspection_endpoint:$().optional(),introspection_endpoint_auth_methods_supported:Re($()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re($()).optional(),code_challenge_methods_supported:Re($()).optional(),client_id_metadata_document_supported:Nt().optional()}),uae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,userinfo_endpoint:gr.optional(),jwks_uri:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),acr_values_supported:Re($()).optional(),subject_types_supported:Re($()),id_token_signing_alg_values_supported:Re($()),id_token_encryption_alg_values_supported:Re($()).optional(),id_token_encryption_enc_values_supported:Re($()).optional(),userinfo_signing_alg_values_supported:Re($()).optional(),userinfo_encryption_alg_values_supported:Re($()).optional(),userinfo_encryption_enc_values_supported:Re($()).optional(),request_object_signing_alg_values_supported:Re($()).optional(),request_object_encryption_alg_values_supported:Re($()).optional(),request_object_encryption_enc_values_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),display_values_supported:Re($()).optional(),claim_types_supported:Re($()).optional(),claims_supported:Re($()).optional(),service_documentation:$().optional(),claims_locales_supported:Re($()).optional(),ui_locales_supported:Re($()).optional(),claims_parameter_supported:Nt().optional(),request_parameter_supported:Nt().optional(),request_uri_parameter_supported:Nt().optional(),require_request_uri_registration:Nt().optional(),op_policy_uri:gr.optional(),op_tos_uri:gr.optional(),client_id_metadata_document_supported:Nt().optional()}),gue=be({...uae.shape,...cae.pick({code_challenge_methods_supported:!0}).shape}),vue=be({access_token:$(),id_token:$().optional(),token_type:$(),expires_in:tN().optional(),scope:$().optional(),refresh_token:$().optional()}).strip(),yue=be({error:$(),error_description:$().optional(),error_uri:$().optional()}),qM=gr.optional().or(Ge("").transform(()=>{})),dae=be({redirect_uris:Re(gr),token_endpoint_auth_method:$().optional(),grant_types:Re($()).optional(),response_types:Re($()).optional(),client_name:$().optional(),client_uri:gr.optional(),logo_uri:qM,scope:$().optional(),contacts:Re($()).optional(),tos_uri:qM,policy_uri:$().optional(),jwks_uri:gr.optional(),jwks:WB().optional(),software_id:$().optional(),software_version:$().optional(),software_statement:$().optional()}).strip(),fae=be({client_id:$(),client_secret:$().optional(),client_id_issued_at:at().optional(),client_secret_expires_at:at().optional()}).strip(),_ue=dae.merge(fae);be({error:$(),error_description:$().optional()}).strip();be({token:$(),token_type_hint:$().optional()}).strip();class wr extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class rw extends wr{}rw.errorCode="invalid_request";class ow extends wr{}ow.errorCode="invalid_client";class iw extends wr{}iw.errorCode="invalid_grant";class sw extends wr{}sw.errorCode="unauthorized_client";class aw extends wr{}aw.errorCode="unsupported_grant_type";class lw extends wr{}lw.errorCode="invalid_scope";class cw extends wr{}cw.errorCode="access_denied";class uw extends wr{}uw.errorCode="server_error";class dw extends wr{}dw.errorCode="temporarily_unavailable";class fw extends wr{}fw.errorCode="unsupported_response_type";class hw extends wr{}hw.errorCode="unsupported_token_type";class pw extends wr{}pw.errorCode="invalid_token";class mw extends wr{}mw.errorCode="method_not_allowed";class gw extends wr{}gw.errorCode="too_many_requests";class vw extends wr{}vw.errorCode="invalid_client_metadata";class yw extends wr{}yw.errorCode="insufficient_scope";class _w extends wr{}_w.errorCode="invalid_target";const bue={[rw.errorCode]:rw,[ow.errorCode]:ow,[iw.errorCode]:iw,[sw.errorCode]:sw,[aw.errorCode]:aw,[lw.errorCode]:lw,[cw.errorCode]:cw,[uw.errorCode]:uw,[dw.errorCode]:dw,[fw.errorCode]:fw,[hw.errorCode]:hw,[pw.errorCode]:pw,[mw.errorCode]:mw,[gw.errorCode]:gw,[vw.errorCode]:vw,[yw.errorCode]:yw,[_w.errorCode]:_w};async function G6(e){if(!e.getServerCapabilities()?.resources)return{resources:[]};try{return await e.listResources()}catch(n){if(n instanceof fv&&n.code===uf.MethodNotFound)return{resources:[]};throw n}}async function hae(e,t){return await e.readResource({uri:t})}function wue(e){const t=er.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>G6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],ff(c)}function Sue(e){const t=er.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>G6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],vP(c)}function Eue(e){const t=er.c(15);let n,r,o;t[0]!==e?({client:n,uri:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o):(n=t[1],r=t[2],o=t[3]);let s;t[4]!==n||t[5]!==o?(s=cv.mcpReadResource(n,o),t[4]=n,t[5]=o,t[6]=s):s=t[6];let l;t[7]!==n||t[8]!==o?(l=()=>hae(n,o),t[7]=n,t[8]=o,t[9]=l):l=t[9];const c=r.staleTime??3e4;let d;return t[10]!==r||t[11]!==s||t[12]!==l||t[13]!==c?(d={...r,queryKey:s,queryFn:l,staleTime:c,retry:!1},t[10]=r,t[11]=s,t[12]=l,t[13]=c,t[14]=d):d=t[14],ff(d)}const K6="ui-resource-html";function xue(e){const t=er.c(20);let n,r,o,s,l;t[0]!==e?({orgSlug:o,connectionId:n,uri:l,meshUrl:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);let c;t[6]!==n||t[7]!==o||t[8]!==l?(c=cv.mcpUiResourceHtml(o,n,l),t[6]=n,t[7]=o,t[8]=l,t[9]=c):c=t[9];let d;t[10]!==n||t[11]!==r||t[12]!==o||t[13]!==l?(d=async()=>{const g=`${r??(typeof window<"u"?window.location.origin:"")}/api/${encodeURIComponent(o)}/mcp/${encodeURIComponent(n)}/ui-resource?uri=${encodeURIComponent(l)}`,v=await fetch(g,{credentials:"include"});if(!v.ok)throw new Error(`Failed to read UI resource (${v.status})`);return v.text()},t[10]=n,t[11]=r,t[12]=o,t[13]=l,t[14]=d):d=t[14];const f=s.staleTime??3e4;let p;return t[15]!==s||t[16]!==c||t[17]!==d||t[18]!==f?(p={...s,queryKey:c,queryFn:d,staleTime:f,retry:!1},t[15]=s,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19],ff(p)}const pae=be({authorizationEndpoint:$().url(),tokenEndpoint:$().url(),introspectionEndpoint:$().url().optional(),clientId:$(),clientSecret:$().optional(),scopes:Re($()),grantType:sn(["authorization_code","client_credentials"])}),HM=be({type:Ge("object"),properties:Mt($(),Gt()).optional(),required:Re($()).optional()}).catchall(Gt()),mae=cE.extend({inputSchema:HM,outputSchema:HM.optional()}),gae=be({headers:Mt($(),$()).optional()}),vae=be({command:$().describe("Command to run (e.g., 'npx', 'node')"),args:Re($()).optional().describe("Command arguments"),cwd:$().optional().describe("Working directory"),envVars:Mt($(),$()).optional().describe("Environment variables (encrypted in storage)")}),Z6=be({id:$().describe("Unique identifier for the connection"),title:$().describe("Human-readable name for the connection"),created_at:$().describe("When the connection was created"),updated_at:$().describe("When the connection was last updated"),created_by:$().describe("User ID who created the connection"),updated_by:$().optional().describe("User ID who last updated the connection"),organization_id:$().describe("Organization ID this connection belongs to"),description:$().nullable().describe("Description of the connection"),icon:$().nullable().describe("Icon URL for the connection"),app_name:$().nullable().describe("Associated app name"),app_id:$().nullable().describe("Associated app ID"),slug:$().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:sn(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:$().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:$().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:an([vae,gae]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:pae.nullable().describe("OAuth configuration"),configuration_state:Mt($(),Gt()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Re($()).nullable().optional().describe("Configuration scopes"),metadata:Mt($(),Gt()).nullable().describe("Additional metadata (includes repository info)"),tools:Re(mae).nullable().describe("Discovered tools from MCP"),bindings:Re($()).nullable().describe("Detected bindings"),status:sn(["active","inactive","error"]).describe("Current status")});Z6.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:$().nullish()});Z6.partial();function Rue(e){return e!=null&&"command"in e}function Oue(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const Nd=be({connection_id:$().describe("Connection ID"),selected_tools:Re($()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Re($()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Re($()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),Y6=Nd.extend({selected_tools:Nd.shape.selected_tools.optional(),selected_resources:Nd.shape.selected_resources.optional(),selected_prompts:Nd.shape.selected_prompts.optional()}),yae=be({connectionId:$(),toolName:$(),label:$(),icon:$().nullable().optional()}),_ae=be({id:$().describe("Stable id; used as React key and ?tab= value"),title:$().describe("Tab label"),icon:$().optional().describe("Optional lucide icon name"),view:be({type:Ge("ext-app"),appId:$(),args:Mt($(),Gt()).optional()})}),bae=be({defaultMainView:be({type:$(),id:$().optional(),toolName:$().optional()}).nullable().optional(),chatDefaultOpen:Nt().nullable().optional(),tabs:Re(_ae).optional()}),GM=be({tileId:$().optional(),connectionId:$().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:$().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:$().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Mt($(),Gt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:at().int().positive().optional(),maxHeight:at().int().positive().optional()}),pE=be({banner:$().nullable().optional(),bannerColor:$().nullable().optional(),icon:$().nullable().optional(),themeColor:$().nullable().optional(),pinnedViews:Re(yae).nullable().optional(),layout:bae.nullable().optional(),homeTile:GM.nullable().optional(),homeTiles:Re(GM).nullable().optional(),homePrompts:Re($()).nullable().optional()});function Tue(e){const t=e?.homeTiles;if(Array.isArray(t)&&t.length>0)return t;const n=e?.homeTile;return n?[n]:[]}const wae=/^[A-Za-z_][A-Za-z0-9_]*$/,KM=$().min(1).regex(wae,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),Sae=Vw("kind",[be({key:KM,kind:Ge("literal"),value:$()}),be({key:KM,kind:Ge("secret"),secretId:$().min(1)})]),mE=be({selected:$().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:$().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:$().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:Re(Sae).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that mesh resolves via the credential vault before posting /_sandbox/config.")}),gE=be({url:$().describe("GitHub repository URL"),owner:$().describe("Repository owner"),name:$().describe("Repository name"),installationId:at().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:$().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),Eae=sn(["agent-sandbox","user-desktop"]),xae=sn(["agent-sandbox","user-desktop","cluster"]);function W6(e){return e==="cluster"?"agent-sandbox":e}const Q6={sandboxHandle:$().describe("Provider-specific handle"),previewUrl:$().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:$().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:Eae.optional(),createdAt:at().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:be({packageManager:$().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:$().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:$().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},X6=be(Q6),Rae=be({...Q6,sandboxProviderKind:xae.optional()});function Oae(e){const t=Rae.parse(e);return X6.parse({...t,sandboxProviderKind:t.sandboxProviderKind?W6(t.sandboxProviderKind):void 0})}function Cue(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t=e,n={};for(const[r,o]of Object.entries(t)){if(!o||typeof o!="object"||r!=="cluster"&&r!=="agent-sandbox"&&r!=="user-desktop")continue;const s=W6(r);try{if(r==="cluster"&&n[s])continue;n[s]=Oae(o)}catch{}}return n}const vE=Mt($().describe("userId"),Mt($().describe("branch"),Mt($().describe("sandboxProviderKind"),X6))),Tae=be({id:$().describe("Stable identifier for this knowledge file"),name:$().describe("File name shown in the UI"),kind:sn(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:$().describe("Org filesystem (Library) volume the file lives in"),path:$().describe("Path within the volume"),url:$().describe("Same-origin URL to read the file (display/download)"),contentType:$().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:at().nullable().optional().describe("File size in bytes"),addedAt:$().describe("ISO timestamp when the file was attached")}),yE=Re(Tae).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),Aue=be({id:$().describe("Unique identifier"),title:$().describe("Human-readable name"),description:$().nullable().describe("Description"),icon:$().nullable().describe("Icon URL"),created_at:$().describe("Creation timestamp"),updated_at:$().describe("Last update timestamp"),created_by:$().describe("User ID who created this item"),updated_by:$().optional().describe("User ID who last updated this item"),organization_id:$().describe("Organization ID this item belongs to"),status:sn(["active","inactive"]).describe("Current status"),pinned:Nt().describe("Whether this space is pinned to the sidebar"),metadata:be({instructions:$().nullable().describe("Instructions also used as system prompt"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().describe("Metadata"),connections:Re(Nd).describe("Connections with their selected tools, resources, and prompts")}),J6=be({title:$().min(1).max(120).describe("Short label shown on the chip"),description:$().max(280).optional().describe("One-line subtitle shown under the title"),text:$().min(1).describe("The message sent to the agent when the prompt is clicked")});be({title:$().min(1).max(255).describe("Name for the virtual MCP"),description:$().nullable().optional().describe("Optional description"),icon:$().nullish().describe("Optional icon URL"),status:sn(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Nt().optional().default(!1).describe("Pin to sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(Y6).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:Re(J6).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});be({title:$().min(1).max(255).optional().describe("New name"),description:$().nullable().optional().describe("New description (null to clear)"),icon:$().nullish().describe("New icon URL"),status:sn(["active","inactive"]).optional().describe("New status"),pinned:Nt().optional().describe("Pin/unpin from sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) IDs this agent may delegate to via subtask. null/absent = all active org agents; empty array = itself only (no cross-agent delegation)."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:pE.nullable().optional().describe("UI customization settings"),githubRepo:gE.nullable().optional().describe("Linked GitHub repository"),runtime:mE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:vE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:yE,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(Y6).optional().describe("New connections (replaces existing)"),prompts:Re(J6).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});var ZM;(function(e){e.Completable="McpCompletable"})(ZM||(ZM={}));const Cae="mesh-ui-resources",Tg="html",Aae=10080*60*1e3,Iae=50,Mae=16*1024*1024;function Pae(e){return e[0]==="mcp"&&e[1]===K6}function vv(){return new Promise((e,t)=>{const n=indexedDB.open(Cae,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(Tg)||n.result.createObjectStore(Tg)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function eu(e,t){return e.transaction(Tg,t).objectStore(Tg)}function bw(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}async function Nae(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=eu(t,"readonly"),r=await bw(n.getAllKeys()),o=await bw(n.getAll()),s=Date.now(),l=r.map((f,p)=>({key:f,value:o[p]})).sort((f,p)=>(p.value?.updatedAt??0)-(f.value?.updatedAt??0)),c=[];let d=0;for(const{key:f,value:p}of l){if(!p||s-p.updatedAt>Aae||d>=Iae){c.push(f);continue}d++;try{const g=JSON.parse(String(f));e.getQueryData(g)===void 0&&e.setQueryData(g,p.html,{updatedAt:0})}catch{c.push(f)}}if(c.length>0){const f=eu(t,"readwrite");for(const p of c)f.delete(p)}}catch{}}function kae(e){if(typeof indexedDB>"u")return()=>{};const t=vv().catch(()=>null);return e.getQueryCache().subscribe(n=>{const r=n.query;if(!Array.isArray(r.queryKey)||!Pae(r.queryKey)||r.state.status!=="success")return;const o=r.state.data;typeof o!="string"||o.length>Mae||t.then(s=>{if(s)try{eu(s,"readwrite").put({html:o,updatedAt:Date.now()},JSON.stringify(r.queryKey))}catch{}})})}function Dae(){typeof indexedDB>"u"||vv().then(e=>eu(e,"readwrite").clear()).catch(()=>{})}async function Iue(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=await bw(eu(t,"readonly").getAllKeys()),r=eu(t,"readwrite");for(const o of n)try{const s=JSON.parse(String(o));s[1]===K6&&s[3]===e&&r.delete(o)}catch{}}catch{}}const Cg="mesh:rq-cache",eL=1440*60*1e3,Lae=1e3,$ae=new Set(["publicConfig","ai-provider-keys","organization-settings","home-next-actions"]),jae=new Set(["VIRTUAL_MCP","CONNECTIONS"]);let tL=!1,nL=!1;function zae(e){const t=e[0];return typeof t=="string"&&$ae.has(t)?!0:e[3]==="collection"&&typeof e[4]=="string"&&jae.has(e[4])}function Uae(e){if(!(typeof window>"u"))try{const t=window.localStorage.getItem(Cg);if(!t)return;const n=JSON.parse(t),r=!n.timestamp||Date.now()-n.timestamp>eL;if(n.buster!=="4.43.0"||r||!n.state){window.localStorage.removeItem(Cg);return}o8(e,n.state),tL=!0}catch{Bae()}}function Fae(e){if(typeof window>"u")return()=>{};let t=null;const n=()=>{t=null;try{const r=r8(e,{shouldDehydrateQuery:o=>o.state.status==="success"&&zae(o.queryKey)});window.localStorage.setItem(Cg,JSON.stringify({buster:"4.43.0",timestamp:Date.now(),state:r}))}catch{}};return e.getQueryCache().subscribe(()=>{t==null&&(t=setTimeout(n,Lae))})}const rL="studio:org-cache:";function oL(e){return`${rL}${e}`}function Mue(e,t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(oL(e));if(!n)return null;const r=JSON.parse(n)[t];return!r||Date.now()-r.updatedAt>eL?null:(nL=!0,r)}catch{return null}}function Pue(e,t,n){if(!(typeof window>"u"))try{const r=oL(e),o=window.localStorage.getItem(r),s=o?JSON.parse(o):{};s[t]={data:n,updatedAt:Date.now()},window.localStorage.setItem(r,JSON.stringify(s))}catch{}}function Bae(){if(Dae(),!(typeof window>"u"))try{window.localStorage.removeItem(Cg);for(let e=window.localStorage.length-1;e>=0;e--){const t=window.localStorage.key(e);t?.startsWith(rL)&&window.localStorage.removeItem(t)}}catch{}}function Vae(){return tL}function qae(){return nL}let ps=!1,ww=null,YM=!1;const _E="mesh:lp-distinct-id",Hae=1440*60*1e3;function iL(){try{const e=window.localStorage.getItem(_E);if(!e)return;const{id:t,ts:n}=JSON.parse(e);return typeof t!="string"||!t||typeof n!="number"?void 0:Date.now()-n<=Hae?t:void 0}catch{return}}function Gae(){try{window.localStorage.removeItem(_E)}catch{}}function Kae(){try{const e=new URL(window.location.href),t=e.searchParams.get("ph_did");t&&(window.localStorage.setItem(_E,JSON.stringify({id:t,ts:Date.now()})),e.searchParams.delete("ph_did"),window.history.replaceState(window.history.state,"",e.toString()));const n=t??iL();return n?Object.keys(window.localStorage).some(o=>o.startsWith("ph_")&&o.endsWith("_posthog"))?void 0:n:void 0}catch{return}}function Zae(e){const t=iL();if(t&&(Gae(),t!==e))try{yl.alias(t)}catch{}}function Yae(e,t){if(ps||typeof window>"u")return;const n=Kae();yl.init(e,{api_host:t,ui_host:"https://us.posthog.com",cross_subdomain_cookie:!0,...n?{bootstrap:{distinctID:n}}:{},capture_pageview:"history_change",capture_pageleave:!0,autocapture:!0,capture_performance:{web_vitals:!0,network_timing:!0},capture_exceptions:!0,session_recording:{maskAllInputs:!0,blockClass:"ph-no-capture"},person_profiles:"identified_only"}),ps=!0}function Wae(e,t){ps&&(yl.identify(e,t),Zae(e))}function Qae(){ps&&(yl.reset(),ww=null)}function Xae(e,t){ps&&yl.capture(e,t)}function Nue(){return ps}function kue(){if(!ps||YM||typeof performance>"u")return;YM=!0;const e=performance.getEntriesByType("navigation")[0],t=n=>{const r=performance.getEntriesByName(n,"measure")[0];return r?Math.round(r.duration):void 0};Xae("perf_app_bootstrap",{nav_type:e?.type,ttfb_ms:e?Math.round(e.responseStart):void 0,dom_interactive_ms:e?Math.round(e.domInteractive):void 0,dom_content_loaded_ms:e?Math.round(e.domContentLoadedEventEnd):void 0,config_fetch_ms:t("mesh:config-fetch"),active_org_fetch_ms:t("mesh:active-org-fetch"),time_to_shell_ms:Math.round(performance.now()),cache_restored:Vae(),org_cache_restored:qae()})}function Due(e,t){ps&&e!==ww&&(yl.group("organization",e,t),ww=e)}function sL(e,t){if(ps)try{yl.captureException(e,t)}catch{}}let hm=null;function Jae({children:e}){const t=_P(),{data:n}=Vg.useSession();if(t.posthog){Yae(t.posthog.key,t.posthog.host);const r=n?.user?.id??null;r&&r!==hm?(Wae(r,{email:n?.user?.email,name:n?.user?.name}),hm=r):!r&&hm&&(Qae(),hm=null)}return C.jsx(C.Fragment,{children:e})}const bE=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));bE.displayName="AlertTriangle";const aL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M4 7.997a2.295 2.295 0 0 1-.39-.035A2 2 0 0 1 2.038 6.39C2 6.197 2 5.965 2 5.5s0-.697.038-.89A2 2 0 0 1 3.61 3.038C3.803 3 4.035 3 4.5 3h15c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89s0 .697-.038.89a2 2 0 0 1-1.572 1.572c-.107.02-.226.03-.39.035M10 13h4M4 8h16v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 21 16.88 21 15.2 21H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 18.72 4 17.88 4 16.2V8Z"}));aL.displayName="Archive";const wE=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 2.25v2.5M12 18v4M5.75 12h-3.5m19 0h-1.5m-1.293 6.457-.707-.707m.914-12.334L17.25 6.83M4.922 19.078 7.75 16.25M5.129 5.209 7.25 7.33"}));wE.displayName="Loading01";const lL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));lL.displayName="Lock01";const cL=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M21 10s-2.005-2.732-3.634-4.362a9 9 0 1 0 2.282 8.862M21 10V4m0 6h-6"}));cL.displayName="RefreshCw01";function SE(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{className:"flex items-center justify-center min-h-screen w-full",children:C.jsx(wE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function ele(e){try{return JSON.parse(e)}catch{return}}function WM(e,t){const n=localStorage.getItem(e),r=n?ele(n):void 0,o=typeof t=="function"?t(r):r??t;if(r===void 0||o!==r)try{const s=JSON.stringify(o);localStorage.setItem(e,s)}catch{}return o}function tle(e,t){const n=er.c(25),r=Aw();let o;n[0]!==e?(o=["localStorage",e],n[0]=e,n[1]=o):o=n[1];const s=o;let l,c;n[2]!==t||n[3]!==e?(l=()=>WM(e,t),c=()=>WM(e,t),n[2]=t,n[3]=e,n[4]=l,n[5]=c):(l=n[4],c=n[5]);let d;n[6]!==s||n[7]!==l||n[8]!==c?(d={queryKey:s,queryFn:l,initialData:c,staleTime:1/0,gcTime:1/0},n[6]=s,n[7]=l,n[8]=c,n[9]=d):d=n[9];const{data:f}=vP(d);let p;n[10]!==e?(p=async E=>{const T=JSON.stringify(E);return localStorage.setItem(e,T),E},n[10]=e,n[11]=p):p=n[11];let h;n[12]!==r||n[13]!==s?(h=E=>{r.setQueryData(s,E)},n[12]=r,n[13]=s,n[14]=h):h=n[14];let g;n[15]!==p||n[16]!==h?(g={mutationFn:p,onSuccess:h},n[15]=p,n[16]=h,n[17]=g):g=n[17];const v=C8(g);let _;n[18]!==v||n[19]!==r||n[20]!==s?(_=E=>{const T=r.getQueryData(s),R=typeof E=="function"?E(T):E;v.mutate(R)},n[18]=v,n[19]=r,n[20]=s,n[21]=_):_=n[21];const b=_,x=f;let S;return n[22]!==b||n[23]!==x?(S=[x,b],n[22]=b,n[23]=x,n[24]=S):S=n[24],S}const su={assistantChatTasks:e=>`mesh:assistant-chat:tasks:${e}`,messages:(e,t)=>`mesh:messages:${e}:${t}`,chatSelectedMode:e=>`mesh:chat:selectedMode:${e}`,chatSelectedImageModel:e=>`mesh:chat:selectedImageModel:${e}`,chatSelectedWebSearchModel:e=>`mesh:chat:selectedWebSearchModel:${e}`,chatSelectedDeepResearchModel:e=>`mesh:chat:selectedDeepResearchModel:${e}`,chatSimpleModeTier:e=>`mesh:chat:simpleModeTier:${e}`,chatLastAgentOption:e=>`mesh:chat:lastAgentOption:${e}`,chatAutosend:(e,t)=>`mesh:chat:autosend:${e}:${t}`,chatDraft:(e,t)=>`mesh:chat:draft:${e}:${t}`,assistantChatActiveTask:e=>`mesh:assistant-chat:active-task:${e}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",blocksPanelWidth:()=>"mesh:blocks:panel-width",tasksPanelWidth:()=>"mesh:tasks-panel:width",sidebarOpen:()=>"mesh:sidebar-open",orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",preferences:()=>"mesh:user:preferences",pluginConnection:(e,t)=>`mesh:plugin:connection:${e}:${t}`,lastOrgSlug:()=>"mesh:last-org-slug",lastLocation:()=>"mesh:last-location",connectionsTab:e=>`mesh:connections:tab:${e}`,taskLastViewed:e=>`mesh:chat:task-last-viewed:${e}`,sidebarGroupOrder:(e,t)=>`sidebar.group-order.${e}.${t}`,sidebarOrgPinnedOrder:e=>`sidebar.org-pinned-order.${e}`},nle={toolApprovalLevel:"auto",enableNotifications:typeof Notification<"u",enableSounds:!1,theme:"system"},uL=["auto","readonly"],Lue=[{value:"readonly",label:"Ask before edit",short:"Ask"},{value:"auto",label:"Auto approve",short:"Auto"}],rle=["light","dark","system"];function $ue(){try{const e=JSON.parse(localStorage.getItem(su.preferences())??"{}");if(uL.includes(e.toolApprovalLevel))return e.toolApprovalLevel}catch{}return"auto"}function ole(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=su.preferences(),e[0]=t):t=e[0],tle(t,ile)}function ile(e){const t={...nle,...e};return uL.includes(t.toolApprovalLevel)||(t.toolApprovalLevel="auto"),rle.includes(t.theme)||(t.theme="system"),t}async function sle(){performance.mark("mesh:config-fetch:start");try{const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}finally{performance.mark("mesh:config-fetch:end"),performance.measure("mesh:config-fetch","mesh:config-fetch:start","mesh:config-fetch:end")}}function ale(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
164
164
|
`);n.push(`:root {
|
|
165
165
|
${r}
|
|
166
166
|
}`)}if(e.dark&&Object.keys(e.dark).length>0){const r=Object.entries(e.dark).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
@@ -168,4 +168,4 @@ ${r}
|
|
|
168
168
|
${r}
|
|
169
169
|
}`)}if(n.length>0){const r=document.createElement("style");r.id="mesh-theme-overrides",r.textContent=n.join(`
|
|
170
170
|
|
|
171
|
-
`),document.head.appendChild(r)}}function lle(e){const t=er.c(9),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:yP.publicConfig(),queryFn:sle,staleTime:1/0},t[0]=r):r=t[0];const{data:o}=ff(r),[s]=ole();let l,c;t[1]!==o.theme?(l=()=>{ale(o.theme)},c=[o.theme],t[1]=o.theme,t[2]=l,t[3]=c):(l=t[2],c=t[3]),M.useLayoutEffect(l,c);let d,f;t[4]!==s.theme?(d=()=>{const h=document.documentElement,g=()=>{const x=document.querySelector('meta[name="theme-color"]');if(!x)return;const S=getComputedStyle(h).getPropertyValue("--sidebar").trim();if(!S)return;const E=document.createElement("canvas").getContext("2d");if(!E)return;E.fillStyle="#010203";const T=E.fillStyle;E.fillStyle=S;const R=E.fillStyle;R!==T&&(x.content=R)};if(s.theme==="dark"){h.classList.add("dark"),g();return}if(s.theme==="light"){h.classList.remove("dark"),g();return}const v=window.matchMedia("(prefers-color-scheme: dark)"),_=x=>{h.classList.toggle("dark",x),g()};_(v.matches);const b=x=>_(x.matches);return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},f=[s.theme],t[4]=s.theme,t[5]=d,t[6]=f):(d=t[5],f=t[6]),M.useLayoutEffect(d,f);let p;return t[7]!==n?(p=C.jsx(C.Fragment,{children:n}),t[7]=n,t[8]=p):p=t[8],p}const Pf=new v8({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});Uae(Pf);Fae(Pf);Nae(Pf);kae(Pf);function cle(e){const t=er.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx(RG,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx(SE,{}),t[1]=o):o=t[1];let s;return t[2]!==n?(s=C.jsxs(y8,{client:Pf,children:[r,C.jsx(M.Suspense,{fallback:o,children:C.jsx(lle,{children:C.jsx(I8,{children:C.jsx(Jte,{children:C.jsx(Jae,{children:n})})})})})]}),t[2]=n,t[3]=s):s=t[3],s}function EE(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 h-full w-full flex items-center justify-center",children:C.jsx(wE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function ule(...e){return AN(Zw(e))}const dle=JN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50 card-shadow",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",special:"bg-special text-special-foreground hover:bg-special/90 focus-visible:ring-special/20 dark:focus-visible:ring-special/40",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground"},size:{default:"h-8 px-3 has-[>svg]:px-2.5",sm:"h-7 gap-1.5 px-2.5 has-[>svg]:px-2",xs:"h-6 gap-1 px-1.5 text-xs has-[>svg]:px-1",lg:"h-10 px-3.5 has-[>svg]:px-3",xl:"h-12 px-4 has-[>svg]:px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}});function df(e){const t=er.c(14);let n,r,o,s,l;t[0]!==e?({className:n,variant:l,size:o,asChild:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);const d=(s===void 0?!1:s)?iS:"button";let f;t[6]!==n||t[7]!==o||t[8]!==l?(f=ule(dle({variant:l,size:o,className:n})),t[6]=n,t[7]=o,t[8]=l,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==r||t[12]!==f?(p=C.jsx(d,{"data-slot":"button",className:f,...r}),t[10]=d,t[11]=r,t[12]=f,t[13]=p):p=t[13],p}const fle=["radial-gradient(ellipse 85% 85% at 0% 0%, rgba(165,149,255,0.6) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 100% 100%, rgba(208,236,26,0.52) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 0% 100%, rgba(255,193,22,0.48) 0%, transparent 72%)"].join(", ");function hle(e){const t=er.c(3),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:fle}}),t[0]=r):r=t[0];let o;return t[1]!==n?(o=C.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-background overflow-hidden",children:[r,C.jsx("div",{className:"relative flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:n})]}),t[1]=n,t[2]=o):o=t[2],o}function dL(e){const t=er.c(9),{orgName:n}=e,r=ple;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx("div",{className:"bg-muted p-3 rounded-full",children:C.jsx(aL,{className:"h-6 w-6 text-muted-foreground"})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=C.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),t[1]=s):s=t[1];let l;t[2]!==n?(l=n?C.jsxs(C.Fragment,{children:[C.jsx("strong",{children:n})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",t[2]=n,t[3]=l):l=t[3];let c;t[4]!==l?(c=C.jsxs("div",{className:"space-y-2",children:[s,C.jsx("p",{className:"text-sm text-muted-foreground",children:l})]}),t[4]=l,t[5]=c):c=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx(df,{onClick:r,children:"Go to home"}),t[6]=d):d=t[6];let f;return t[7]!==c?(f=C.jsxs(hle,{children:[o,c,d]}),t[7]=c,t[8]=f):f=t[8],f}function ple(){window.location.href="/"}function mle(e){const t=er.c(14),{area:n,description:r}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:s}=Dw(o),l=n?`No access to ${n}`:"No access",c=r??"Your role doesn't include permission for this section. Ask an organization admin to update your role if you need it.";let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:C.jsx(lL,{size:28})}),t[1]=d):d=t[1];let f;t[2]!==l?(f=C.jsx("h3",{className:"text-lg font-medium",children:l}),t[2]=l,t[3]=f):f=t[3];let p;t[4]!==c?(p=C.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=p):p=t[5];let h;t[6]!==f||t[7]!==p?(h=C.jsxs("div",{className:"space-y-1",children:[f,p]}),t[6]=f,t[7]=p,t[8]=h):h=t[8];let g;t[9]!==s?(g=C.jsx(df,{variant:"outline",size:"sm",asChild:!0,children:C.jsx(Dg,{to:"/$org/settings/profile",params:{org:s},children:"Go to your profile"})}),t[9]=s,t[10]=g):g=t[10];let v;return t[11]!==h||t[12]!==g?(v=C.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[d,h,g]}),t[11]=h,t[12]=g,t[13]=v):v=t[13],v}const QM="__mesh_chunk_reload_ts";function fL(e){return e?.message==="Organization is archived"}function gle(e){return!!e?.message?.includes("Access denied")}function XM(e){if(!e)return!1;const t=e.message||"";return t.includes("Failed to fetch dynamically imported module")||t.includes("Importing a module script failed")||t.includes("error loading dynamically imported module")||t.includes("Failed to fetch")&&e.name==="TypeError"}class jue extends M.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),sL(t,{boundary:"default",error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null})}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t({error:this.state.error,resetError:this.resetError}):t!==void 0?t:fL(this.state.error)?C.jsx(dL,{}):gle(this.state.error)?C.jsx(mle,{}):C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(bE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}class vle extends M.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n);const r=XM(t);if(sL(t,{boundary:"chunk_root",is_chunk_load_error:r,error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null}),!r)return;const o=sessionStorage.getItem(QM),s=Date.now();(!o||s-Number(o)>1e4)&&(sessionStorage.setItem(QM,String(s)),window.location.reload())}render(){return this.state.hasError&&XM(this.state.error)?C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:C.jsx(cL,{className:"h-6 w-6 text-primary"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"New version available"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"A new version has been deployed. Refresh to continue."})]}),C.jsx(df,{onClick:()=>window.location.reload(),children:"Refresh"})]}):this.state.hasError?fL(this.state.error)?C.jsx(dL,{}):C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(bE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function hL(e){try{localStorage.setItem(su.lastLocation(),JSON.stringify(e))}catch{}}function yle(){try{const e=localStorage.getItem(su.lastLocation());if(!e)return null;const t=JSON.parse(e);if(typeof t?.org=="string")return{org:t.org,taskId:typeof t.taskId=="string"?t.taskId:void 0,virtualmcpid:typeof t.virtualmcpid=="string"?t.virtualmcpid:void 0}}catch{}return null}function zue(){try{localStorage.removeItem(su.lastLocation())}catch{}}let us=null,JM=!1;const Sw=new Set;function Ag(){for(const e of Sw)e()}function _le(){JM||typeof window>"u"||(JM=!0,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),us=e,Ag()}),window.addEventListener("appinstalled",()=>{us=null,Ag()}))}function Uue(){us!==null&&(us=null,Ag())}function ble(e){return Sw.add(e),()=>{Sw.delete(e)}}function wle(){return us}function Sle(){return null}function Ele(){if(typeof window>"u")return!1;const e=typeof window.matchMedia=="function"&&["(display-mode: standalone)","(display-mode: window-controls-overlay)"].some(n=>window.matchMedia(n).matches),t=navigator.standalone===!0;return e||t}function xle(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)?!0:e.includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Fue(){const e=er.c(5),t=M.useSyncExternalStore(ble,wle,Sle);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ele(),e[0]=n):n=e[0];const r=n,o=t!==null&&!r;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=xle(),l=Rle,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let c;return e[3]!==o?(c={canPrompt:o,installed:r,ios:s,promptInstall:l},e[3]=o,e[4]=c):c=e[4],c}async function Rle(){if(!us)return"unavailable";await us.prompt();const e=await us.userChoice;return us=null,Ag(),e.outcome}const Pi=i9({component:()=>C.jsx(vle,{children:C.jsx(cle,{children:C.jsx(M.Suspense,{fallback:C.jsx(SE,{}),children:C.jsx(YP,{})})})})}),Ole=gt({getParentRoute:()=>Pi,path:"/login",component:xt(()=>Et(()=>import("./login-DOZHO9E2.js"),__vite__mapDeps([0,1,2,3,4,5]))),validateSearch:ya(()=>be({next:$().optional(),client_id:$().optional(),redirect_uri:$().optional(),response_type:$().optional(),state:$().optional(),scope:$().optional(),code_challenge:$().optional(),code_challenge_method:$().optional()}))}),Tle=gt({getParentRoute:()=>Pi,path:"/cli/auth-success",component:xt(()=>Et(()=>import("./cli-auth-success-Bv-I3_Gx.js"),__vite__mapDeps([6,5])))}),Cle=gt({getParentRoute:()=>Pi,path:"/reset-password",component:xt(()=>Et(()=>import("./reset-password-Ml42vC8p.js"),__vite__mapDeps([7,2]))),validateSearch:ya(()=>be({token:$().optional(),error:$().optional()}))}),Ale=gt({getParentRoute:()=>Pi,path:"/auth/$pathname",component:xt(()=>Et(()=>import("./auth-catchall-DCcZhJ5p.js"),[]))}),Ile=gt({getParentRoute:()=>Pi,path:"/oauth/callback",component:xt(()=>Et(()=>import("./oauth-callback-OQFjwRKe.js"),__vite__mapDeps([8,9,10])))}),Mle=gt({getParentRoute:()=>Pi,path:"/oauth/callback/ai-provider",component:xt(()=>Et(()=>import("./oauth-callback-ai-provider-DrTpi1tG.js"),[]))}),xE=gt({getParentRoute:()=>Pi,id:"shell",component:xt(()=>Et(()=>import("./shell-layout-CMtQD7SX.js").then(e=>e.g),__vite__mapDeps([11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,10,28,3,4,29,30,31,32,33])))}),Ple=gt({getParentRoute:()=>xE,path:"/",beforeLoad:async()=>{const e=yle();if(e)throw Oc({to:"/$org",params:{org:e.org}});const t=localStorage.getItem(su.lastOrgSlug());if(t)throw Oc({to:"/$org",params:{org:t}});const{data:n}=await hN();if(!n)return;const r=n[0];throw Oc(r?{to:"/$org",params:{org:r.slug}}:{to:"/onboarding"})}}),Nle=gt({getParentRoute:()=>Pi,path:"/onboarding",beforeLoad:async()=>{const{data:e}=await hN();if(e&&e.length>0)throw Oc({to:"/"})},component:xt(()=>Et(()=>import("./onboarding-nIzVSXob.js"),__vite__mapDeps([34,29,5,35,12,13,2,36,37,14,18,38,39,40])))}),kle=gt({getParentRoute:()=>Pi,path:"/commerce-onboarding",component:xt(()=>Et(()=>import("./commerce-onboarding-BCHKuTrr.js"),__vite__mapDeps([41,1,2,3,4,5,35,12,13,24,26,27,10,42,43,44,45,46,47,48,49,50,14,51,18,52,53,54,55,56,16,57,58,59,60,61,19,62,38,63,64,65,66,67,68,69,39,70,71,15,72,73,74,75,40,76,17,22,20,21,77,78,79,36,80,81,82,9]))),validateSearch:ya(()=>be({org:$().optional(),siteUrl:$().optional()}))}),yv=gt({getParentRoute:()=>xE,path:"/$org",beforeLoad:({params:e})=>{hL({org:e.org})},component:xt(()=>Et(()=>import("./org-layout-8bhX7pQC.js"),[]))}),Nf=gt({getParentRoute:()=>yv,id:"org-shell",component:xt(()=>Et(()=>import("./index-D23suRTi.js"),__vite__mapDeps([83,84,65,85,22,77,86,87,88,89,12,13,57,60,58,50,68,69,48,73,14,44,45,46,47,42,49,51,18,52,53,54,55,56,16,59,61,19,62,38,63,64,66,67,39,70,71,15,72,74,75,40,76,17,20,90,91,21,79,36,92,93,94,95,96,97,98,99,100,101,26,27,10,31,32,102,103,78,104,43,105,106,107,2,108,82,9,109,110,111,112,30,25,28,3,4,113,114,24,115,11,23,29,33,116,117,118,119,120,121,122,123,124,125,80,126,81,127])))}),pL=gt({getParentRoute:()=>Nf,id:"agent-shell",pendingComponent:EE,component:xt(()=>Et(()=>import("./index-_2thZC-g.js").then(e=>e.aR),__vite__mapDeps([128,47,112,30,25,26,27,10,28,3,4,113,101,110,32,114,24,31,129,92,77,52,53,55,102,103,100,104,84,65,85,22,130,131,132,94,119,45,18,56,44,46,48,42,49,50,14,51,54,16,57,58,59,60,61,19,62,38,63,64,66,67,68,69,39,70,71,15,72,73,74,75,40,13,76,17,20,133,109,107,134,116,117,21,88,12,120,121,135,136,137,138,139,11,23,29,33,43,122,123,140,79,36,2,89,105,141,115,96,97,98,99,78,106,93,108,82,9,111,142,86,143,144,145,146,127,80,147,148,126,149,150,37,151,152,153,125,81,154,155,156,157,158,87,159,160,161])))}),Dle=be({virtualmcpid:$().optional(),tab:$().optional(),main:nn([$(),Ge(0)]).optional(),preview:$().optional(),id:$().optional(),toolName:$().optional(),tasks:at().optional(),mainOpen:at().optional(),sidepanel:nn([rn(["chat","blocks"]),Ge(0)]).optional(),chat:at().optional(),blocks:at().optional(),autosend:$().optional(),runLocally:$().optional()}),Lle=gt({getParentRoute:()=>pL,path:"/$taskId",validateSearch:Dle,beforeLoad:({params:e,search:t})=>{hL({org:e.org,taskId:e.taskId,virtualmcpid:t.virtualmcpid})},component:()=>null}),$le=be({main:$().optional()}),jle=gt({getParentRoute:()=>Nf,path:"/",validateSearch:$le,pendingComponent:EE,component:xt(()=>Et(()=>import("./index-D-LnlVR-.js"),__vite__mapDeps([162,27,25,26,10,28,3,4,31,32,123])))}),zle=be({path:$().optional(),preview:$().optional(),skill:$().optional()}),Ule=gt({getParentRoute:()=>Nf,path:"/files",validateSearch:zle,pendingComponent:EE,component:xt(()=>Et(()=>import("./index-C_QjJ53G.js").then(e=>e.P),__vite__mapDeps([146,54,61,60,58,39,71,15,74,40,17,20,85,23,21,22,2,86,136,52,57,24,127,80,59,64,75,145,56,93,53,55,88,77,66,138,65])))}),Fle=gt({getParentRoute:()=>Nf,path:"/board",component:xt(()=>Et(()=>import("./index-87jGW96_.js").then(e=>e.i),__vite__mapDeps([156,157,12,13,107,51,67,71,132,94,32,120,121,45,18,56,61,21,22,145,52,54,88,158,53,75])))}),Dn=gt({getParentRoute:()=>yv,path:"/settings",component:xt(()=>Et(()=>import("./settings-layout-B3ALc5wh.js"),__vite__mapDeps([163,84,65,85,22,77,152,50,14,63,64,73,13,20,31,27,32,149,164,148,147,114,28,3,127,118,87])))}),Ble=gt({getParentRoute:()=>yv,path:"/install",component:xt(()=>Et(()=>import("./org-install-BMP-9_b6.js"),[]))}),Vle=gt({getParentRoute:()=>Dn,path:"/",component:xt(()=>Et(()=>import("./index-redirect-DZROBaZp.js"),__vite__mapDeps([165,149,166])))}),qle=gt({getParentRoute:()=>Dn,path:"/connections",component:xt(()=>Et(()=>import("./connections-CwAnq_cV.js"),__vite__mapDeps([167,78,26,27,10,168,145,52,54,56,47,67,77,169,107,153,72,106,98,97,99,100,101,31,32,102,103,104,43,42,44,45,46,48,49,50,14,51,18,53,55,16,57,58,59,60,61,19,62,38,63,64,65,66,68,69,39,70,71,15,73,74,75,40,13,76,17,22,20,131,152,84,85,170,23,149,171,134,21,89,79,36,2,92,93,113,108,82,9]))),validateSearch:ya(()=>be({action:rn(["create"]).optional(),tab:rn(["all","connected"]).optional()}))}),Hle=gt({getParentRoute:()=>Dn,path:"/connections/$appSlug",component:xt(()=>Et(()=>import("./connection-detail-YTipj66f.js"),__vite__mapDeps([172,78,26,27,10,131,108,2,71,75,173,152,84,65,85,22,77,126,58,64,100,101,99,31,32,92,52,53,55,174,175,117,44,45,46,47,48,42,49,50,14,51,18,54,56,16,57,59,60,61,19,62,38,63,66,67,68,69,39,70,15,72,73,74,40,13,76,17,20,88,113,176,122,25,28,3,4,123,150,9,107,139,132,94,12,140,43,79,36,170,23,177,141,97,105,104,145]))),validateSearch:ya(()=>be({tab:$().optional()}))}),Gle=gt({getParentRoute:()=>Dn,path:"/connections/$appSlug/$collectionName/$itemId",component:xt(()=>Et(()=>import("./collection-detail-6gCqNuEz.js"),__vite__mapDeps([178,131,101,26,27,10,79,36,2,93,173,152,84,65,85,22,77,126,58,64,100,78,99,31,32,71,92,52,53,55,174,175,117,44,45,46,47,48,42,49,50,14,51,18,54,56,16,57,59,60,61,19,62,38,63,66,67,68,69,39,70,15,72,73,74,75,40,13,76,17,20,88,113,176,122,25,28,3,4,123,139,179,124,97,150,9,107,137,138,112,30,110,114,24,43,11,12,21,23,29,33]))),validateSearch:ya(()=>be({replayId:$().optional()}))}),Kle=gt({getParentRoute:()=>Dn,path:"/monitor",component:xt(()=>Et(()=>import("./index-Dx7DdQRD.js"),__vite__mapDeps([180,153,72,152,84,65,85,22,77,131,181,149,182,166,129,92,52,53,55,102,103,100,101,26,27,10,113,104,130,132,94,119,45,18,56,44,46,47,48,42,49,50,14,51,54,16,57,58,59,60,61,19,62,38,63,64,66,67,68,69,39,70,71,15,73,74,75,40,13,76,17,20,133,32,109,107,134,116,117,21,88,12,120,121,135,136,24,137,138,112,30,25,28,3,4,110,114,31,139,11,23,29,33,43,122,123,140,79,36,2,97,158,93,106,37,179,177,174]))),validateSearch:ya(()=>be({tab:rn(["overview","audit","dashboards","threads","automations"]).default("overview"),from:$().default("now-30m"),to:$().default("now"),connectionId:Re($()).optional().default([]),virtualMcpId:Re($()).optional().default([]),tool:$().default(""),status:rn(["all","success","errors"]).default("all"),search:$().default(""),page:at().optional(),streaming:Nt().default(!0),propertyFilters:$().default(""),hideSystem:Nt().default(!1)}))}),Zle=gt({getParentRoute:()=>Dn,path:"/general",component:xt(()=>Et(()=>import("./general-WssWwsmi.js"),__vite__mapDeps([183,152,84,65,85,22,77,94,151,12,13,2,144,104,49,184,32,107,92,52,53,55,37,31,27,23,181,149,182,166])))}),Yle=gt({getParentRoute:()=>Dn,path:"/brand-context",component:xt(()=>Et(()=>import("./brand-context-D0e9ClrU.js"),__vite__mapDeps([185,53,54,62,66,71,75,20,23,2,93,152,84,65,85,22,77,32,151,181,149,182,166])))}),Wle=gt({getParentRoute:()=>Dn,path:"/ai-providers",component:xt(()=>Et(()=>import("./ai-providers-C59nw8WL.js"),__vite__mapDeps([186,45,152,84,65,85,22,77,86,144,104,49,110,32,18,112,30,25,26,27,10,28,3,4,113,101,114,24,31,142,21,89,134,52,2,92,53,55,48,46,64,72,143,68,54,12,13,61,111,57,74,151,115,23,71,75,155,121,181,149,182,166])))}),Qle=gt({getParentRoute:()=>Dn,path:"/secrets",component:xt(()=>Et(()=>import("./secrets-D0zh91De.js"),__vite__mapDeps([187,45,71,13,76,21,22,2,36,92,77,52,53,55,86,93,152,84,65,85,144,104,49,154,32,181,149,182,166])))}),Xle=gt({getParentRoute:()=>Dn,path:"/files",component:xt(()=>Et(()=>import("./files-DbPQpdYj.js"),[]))}),Jle=gt({getParentRoute:()=>Dn,path:"/buckets",component:xt(()=>Et(()=>import("./buckets-4KVSvyFr.js"),__vite__mapDeps([188,45,63,71,75,23,21,22,2,36,92,77,52,53,55,37,86,93,152,84,65,85,144,104,49,160,32,181,149,182,166])))}),ece=gt({getParentRoute:()=>Dn,path:"/members",component:xt(()=>Et(()=>import("./members-CSK3868z.js"),__vite__mapDeps([189,168,145,52,54,56,47,67,77,169,107,153,72,152,84,65,85,22,190,130,131,91,21,79,36,92,53,55,93,94,95,144,104,49,164,149,32,12,13,157,132,23,59,64,73,75,17,134,116,117,88,71,181,182,166])))}),tce=gt({getParentRoute:()=>Dn,path:"/roles",component:xt(()=>Et(()=>import("./roles-zoLqZoaX.js"),__vite__mapDeps([191,95,94,107,23,145,52,54,56,59,71,75,190,130,47,152,84,65,85,22,77,131,153,72,143,43,42,44,45,46,48,49,50,14,51,18,53,55,16,57,58,60,61,19,62,38,63,64,66,67,68,69,39,70,15,73,74,40,13,76,17,20,103,134,109,26,27,10,105,132,157,100,101,110,32,12,37,144,104,149,182,166]))),validateSearch:ya(()=>be({role:$().optional()}))}),nce=gt({getParentRoute:()=>Dn,path:"/sso",component:xt(()=>Et(()=>import("./sso-DTTEgRnf.js"),__vite__mapDeps([192,184,32,144,104,49,107,2,92,77,52,53,55,152,84,65,85,22,37,33,75,181,149,182,166])))}),rce=gt({getParentRoute:()=>Dn,path:"/profile",component:xt(()=>Et(()=>import("./profile-DR-6zBTk.js"),__vite__mapDeps([193,152,84,65,85,22,77,12,13,37,92,52,53,55,115,2,68,69,70,151,147,90,144,104,49])))}),oce=gt({getParentRoute:()=>Dn,path:"/store",component:xt(()=>Et(()=>import("./store-CqpUz5qD.js"),__vite__mapDeps([194,45,54,71,75,2,37,86,12,13,88,100,101,26,27,10,152,84,65,85,22,77,99,31,32,144,104,49,181,149,182,166])))}),ice=gt({getParentRoute:()=>Dn,path:"/registry",component:xt(()=>Et(()=>import("./registry-BDxKgIex.js"),__vite__mapDeps([195,181,149,182,166])))}),sce=gt({getParentRoute:()=>Dn,path:"/store/registry",component:xt(()=>Et(()=>import("./store-registry-BI075YdI.js"),__vite__mapDeps([196,181,149,182,166])))}),ace=gt({getParentRoute:()=>Dn,path:"/agents",component:xt(()=>Et(()=>import("./agents-list-jvSb6xVs.js"),__vite__mapDeps([197,145,52,54,56,14,125,21,22,105,72,80,100,101,26,27,10,82,9,48,44,45,46,47,42,49,50,51,18,53,55,16,57,58,59,60,61,19,62,38,63,64,65,66,67,68,69,39,70,71,15,73,74,75,40,13,76,17,20,126,78,122,113,25,28,3,4,123,81,152,84,85,77,104,155,121,149,131,176,23,153])))}),lce=gt({getParentRoute:()=>Dn,path:"/automations",component:xt(()=>Et(()=>import("./automations-BmlQyKZJ.js"),__vite__mapDeps([198,71,20,153,72,152,84,65,85,22,77,131,133,26,27,10,32,122,113,101,25,28,3,4,123,159,23,145,52,54,56,16,59,75,44,45,46,47,48,42,49,50,14,51,18,53,55,57,58,60,61,19,62,38,63,64,66,67,68,69,39,70,15,73,74,40,13,76,17,181,149,182,166])))}),cce=Dn.addChildren([Vle,qle,Hle,Gle,ace,lce,Kle,Zle,Yle,Wle,Qle,Xle,Jle,ece,tce,nce,rce,oce,sce,ice]),uce=pL.addChildren([Lle]),dce=Nf.addChildren([jle,Ule,Fle,uce]),fce=yv.addChildren([dce,cce,Ble]),hce=xE.addChildren([Ple,fce]),pce=Pi.addChildren([hce,Nle,kle,Ole,Tle,Cle,Ale,Ile,Mle]),mce=g9({routeTree:pce,defaultPendingComponent:SE,defaultPendingMs:200,defaultNotFoundComponent:()=>C.jsx("div",{className:"flex h-full items-center justify-center",children:C.jsxs("div",{className:"flex flex-col items-center gap-4 p-8",children:[C.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Page not found"}),C.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-[300px]",children:"The page you are looking for does not exist or has been moved."}),C.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"text-sm text-primary hover:underline",children:"Go back"})]})})});_le();const gce=document.getElementById("root");$j.createRoot(gce).render(C.jsx(M.StrictMode,{children:C.jsx(_9,{router:mce})}));export{soe as $,Xce as A,df as B,T8 as C,$2 as D,E8 as E,x8 as F,be as G,$ as H,Ci as I,Ti as J,yP as K,ff as L,Xae as M,Tce as N,Sce as O,jue as P,uP as Q,Nue as R,SE as S,kce as T,Dce as U,su as V,Oce as W,YP as X,tle as Y,_P as Z,Rce as _,Vg as a,Gt as a$,fl as a0,ole as a1,fte as a2,Bae as a3,aL as a4,pt as a5,Dg as a6,EE as a7,Re as a8,rn as a9,hae as aA,G6 as aB,lL as aC,ee as aD,cL as aE,Et as aF,wue as aG,Aue as aH,dK as aI,Lce as aJ,wae as aK,Tue as aL,Sn as aM,M4 as aN,gl as aO,gf as aP,Jn as aQ,P4 as aR,ct as aS,la as aT,at as aU,yce as aV,bo as aW,_o as aX,Ja as aY,Uue as aZ,Fue as a_,Mt as aa,Nt as ab,hK as ac,Lue as ad,fK as ae,$ue as af,bE as ag,cv as ah,Ece as ai,Cue as aj,DC as ak,Ew as al,gW as am,ii as an,Jd as ao,kg as ap,vS as aq,Gc as ar,pa as as,vs as at,si as au,D4 as av,yW as aw,wW as ax,_W as ay,sW as az,Ng as b,Ace as b$,Oue as b0,Sue as b1,Rue as b2,KW as b3,ok as b4,GW as b5,gs as b6,Iue as b7,K6 as b8,iS as b9,iD as bA,aD as bB,aX as bC,H4 as bD,NX as bE,uX as bF,H7 as bG,GP as bH,ri as bI,tue as bJ,oi as bK,vce as bL,gY as bM,dle as bN,ma as bO,fv as bP,uf as bQ,hle as bR,yle as bS,zue as bT,Due as bU,kue as bV,Mue as bW,fN as bX,dL as bY,Pue as bZ,nue as b_,hue as ba,WB as bb,W3 as bc,ZB as bd,nn as be,Ge as bf,Fw as bg,TB as bh,Mce as bi,JB as bj,wV as bk,qw as bl,Bw as bm,rV as bn,Pce as bo,cue as bp,rie as bq,ya as br,AB as bs,dl as bt,mt as bu,eae as bv,AN as bw,Zw as bx,JN as by,Zee as bz,er as c,R6 as c$,Yoe as c0,Woe as c1,lE as c2,$6 as c3,cE as c4,dv as c5,w6 as c6,uie as c7,E6 as c8,iie as c9,cae as cA,gue as cB,aoe as cC,ow as cD,sw as cE,iw as cF,vue as cG,vw as cH,wr as cI,uw as cJ,yue as cK,bue as cL,_ue as cM,pue as cN,G9 as cO,b6 as cP,x6 as cQ,T6 as cR,A6 as cS,I6 as cT,P6 as cU,aue as cV,lue as cW,iue as cX,sue as cY,loe as cZ,oue as c_,yie as ca,Coe as cb,Ioe as cc,Noe as cd,qoe as ce,sie as cf,Aoe as cg,Moe as ch,koe as ci,Doe as cj,Hoe as ck,Joe as cl,xue as cm,Eue as cn,Wce as co,W6 as cp,Sf as cq,fY as cr,pY as cs,mY as ct,mf as cu,mK as cv,pK as cw,VN as cx,gP as cy,mue as cz,C8 as d,PQ as d$,C6 as d0,M6 as d1,due as d2,O6 as d3,woe as d4,rue as d5,_6 as d6,qie as d7,Xoe as d8,fue as d9,K4 as dA,DW as dB,p4 as dC,cS as dD,Xd as dE,i4 as dF,aS as dG,xce as dH,bce as dI,_ce as dJ,eX as dK,tX as dL,oX as dM,nX as dN,rX as dO,Uce as dP,Fce as dQ,Hce as dR,Gce as dS,Kce as dT,Zce as dU,Bce as dV,Vce as dW,qce as dX,mle as dY,SQ as dZ,TQ as d_,Lie as da,zie as db,bie as dc,_ie as dd,uue as de,yB as df,Cce as dg,Nce as dh,Vw as di,Ice as dj,vY as dk,yY as dl,_Y as dm,hY as dn,zce as dp,jce as dq,$ce as dr,vX as ds,yX as dt,gX as du,lS as dv,sS as dw,kW as dx,nk as dy,NW as dz,Dw as e,EQ as e0,xQ as e1,wQ as e2,uk as e3,RQ as e4,OQ as e5,CQ as e6,AQ as e7,IQ as e8,MQ as e9,NQ as ea,DQ as eb,LQ as ec,Jce as f,Qce as g,eue as h,wE as i,C as j,vP as k,ule as l,tu as m,Wn as n,nP as o,Aw as p,_8 as q,M as r,Im as s,WT as t,qP as u,b8 as v,R8 as w,w8 as x,S8 as y,Zn as z};
|
|
171
|
+
`),document.head.appendChild(r)}}function lle(e){const t=er.c(9),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:yP.publicConfig(),queryFn:sle,staleTime:1/0},t[0]=r):r=t[0];const{data:o}=ff(r),[s]=ole();let l,c;t[1]!==o.theme?(l=()=>{ale(o.theme)},c=[o.theme],t[1]=o.theme,t[2]=l,t[3]=c):(l=t[2],c=t[3]),M.useLayoutEffect(l,c);let d,f;t[4]!==s.theme?(d=()=>{const h=document.documentElement,g=()=>{const x=document.querySelector('meta[name="theme-color"]');if(!x)return;const S=getComputedStyle(h).getPropertyValue("--sidebar").trim();if(!S)return;const E=document.createElement("canvas").getContext("2d");if(!E)return;E.fillStyle="#010203";const T=E.fillStyle;E.fillStyle=S;const R=E.fillStyle;R!==T&&(x.content=R)};if(s.theme==="dark"){h.classList.add("dark"),g();return}if(s.theme==="light"){h.classList.remove("dark"),g();return}const v=window.matchMedia("(prefers-color-scheme: dark)"),_=x=>{h.classList.toggle("dark",x),g()};_(v.matches);const b=x=>_(x.matches);return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},f=[s.theme],t[4]=s.theme,t[5]=d,t[6]=f):(d=t[5],f=t[6]),M.useLayoutEffect(d,f);let p;return t[7]!==n?(p=C.jsx(C.Fragment,{children:n}),t[7]=n,t[8]=p):p=t[8],p}const Pf=new v8({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});Uae(Pf);Fae(Pf);Nae(Pf);kae(Pf);function cle(e){const t=er.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx(RG,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx(SE,{}),t[1]=o):o=t[1];let s;return t[2]!==n?(s=C.jsxs(y8,{client:Pf,children:[r,C.jsx(M.Suspense,{fallback:o,children:C.jsx(lle,{children:C.jsx(I8,{children:C.jsx(Jte,{children:C.jsx(Jae,{children:n})})})})})]}),t[2]=n,t[3]=s):s=t[3],s}function EE(){const e=er.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 h-full w-full flex items-center justify-center",children:C.jsx(wE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function ule(...e){return AN(Zw(e))}const dle=JN("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50 card-shadow",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",special:"bg-special text-special-foreground hover:bg-special/90 focus-visible:ring-special/20 dark:focus-visible:ring-special/40",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground"},size:{default:"h-8 px-3 has-[>svg]:px-2.5",sm:"h-7 gap-1.5 px-2.5 has-[>svg]:px-2",xs:"h-6 gap-1 px-1.5 text-xs has-[>svg]:px-1",lg:"h-10 px-3.5 has-[>svg]:px-3",xl:"h-12 px-4 has-[>svg]:px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}});function df(e){const t=er.c(14);let n,r,o,s,l;t[0]!==e?({className:n,variant:l,size:o,asChild:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);const d=(s===void 0?!1:s)?iS:"button";let f;t[6]!==n||t[7]!==o||t[8]!==l?(f=ule(dle({variant:l,size:o,className:n})),t[6]=n,t[7]=o,t[8]=l,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==r||t[12]!==f?(p=C.jsx(d,{"data-slot":"button",className:f,...r}),t[10]=d,t[11]=r,t[12]=f,t[13]=p):p=t[13],p}const fle=["radial-gradient(ellipse 85% 85% at 0% 0%, rgba(165,149,255,0.6) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 100% 100%, rgba(208,236,26,0.52) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 0% 100%, rgba(255,193,22,0.48) 0%, transparent 72%)"].join(", ");function hle(e){const t=er.c(3),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:fle}}),t[0]=r):r=t[0];let o;return t[1]!==n?(o=C.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-background overflow-hidden",children:[r,C.jsx("div",{className:"relative flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:n})]}),t[1]=n,t[2]=o):o=t[2],o}function dL(e){const t=er.c(9),{orgName:n}=e,r=ple;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx("div",{className:"bg-muted p-3 rounded-full",children:C.jsx(aL,{className:"h-6 w-6 text-muted-foreground"})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=C.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),t[1]=s):s=t[1];let l;t[2]!==n?(l=n?C.jsxs(C.Fragment,{children:[C.jsx("strong",{children:n})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",t[2]=n,t[3]=l):l=t[3];let c;t[4]!==l?(c=C.jsxs("div",{className:"space-y-2",children:[s,C.jsx("p",{className:"text-sm text-muted-foreground",children:l})]}),t[4]=l,t[5]=c):c=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx(df,{onClick:r,children:"Go to home"}),t[6]=d):d=t[6];let f;return t[7]!==c?(f=C.jsxs(hle,{children:[o,c,d]}),t[7]=c,t[8]=f):f=t[8],f}function ple(){window.location.href="/"}function mle(e){const t=er.c(14),{area:n,description:r}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:s}=Dw(o),l=n?`No access to ${n}`:"No access",c=r??"Your role doesn't include permission for this section. Ask an organization admin to update your role if you need it.";let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:C.jsx(lL,{size:28})}),t[1]=d):d=t[1];let f;t[2]!==l?(f=C.jsx("h3",{className:"text-lg font-medium",children:l}),t[2]=l,t[3]=f):f=t[3];let p;t[4]!==c?(p=C.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=p):p=t[5];let h;t[6]!==f||t[7]!==p?(h=C.jsxs("div",{className:"space-y-1",children:[f,p]}),t[6]=f,t[7]=p,t[8]=h):h=t[8];let g;t[9]!==s?(g=C.jsx(df,{variant:"outline",size:"sm",asChild:!0,children:C.jsx(Dg,{to:"/$org/settings/profile",params:{org:s},children:"Go to your profile"})}),t[9]=s,t[10]=g):g=t[10];let v;return t[11]!==h||t[12]!==g?(v=C.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[d,h,g]}),t[11]=h,t[12]=g,t[13]=v):v=t[13],v}const QM="__mesh_chunk_reload_ts";function fL(e){return e?.message==="Organization is archived"}function gle(e){return!!e?.message?.includes("Access denied")}function XM(e){if(!e)return!1;const t=e.message||"";return t.includes("Failed to fetch dynamically imported module")||t.includes("Importing a module script failed")||t.includes("error loading dynamically imported module")||t.includes("Failed to fetch")&&e.name==="TypeError"}class jue extends M.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),sL(t,{boundary:"default",error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null})}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t({error:this.state.error,resetError:this.resetError}):t!==void 0?t:fL(this.state.error)?C.jsx(dL,{}):gle(this.state.error)?C.jsx(mle,{}):C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(bE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}class vle extends M.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n);const r=XM(t);if(sL(t,{boundary:"chunk_root",is_chunk_load_error:r,error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null}),!r)return;const o=sessionStorage.getItem(QM),s=Date.now();(!o||s-Number(o)>1e4)&&(sessionStorage.setItem(QM,String(s)),window.location.reload())}render(){return this.state.hasError&&XM(this.state.error)?C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:C.jsx(cL,{className:"h-6 w-6 text-primary"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"New version available"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"A new version has been deployed. Refresh to continue."})]}),C.jsx(df,{onClick:()=>window.location.reload(),children:"Refresh"})]}):this.state.hasError?fL(this.state.error)?C.jsx(dL,{}):C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(bE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function hL(e){try{localStorage.setItem(su.lastLocation(),JSON.stringify(e))}catch{}}function yle(){try{const e=localStorage.getItem(su.lastLocation());if(!e)return null;const t=JSON.parse(e);if(typeof t?.org=="string")return{org:t.org,taskId:typeof t.taskId=="string"?t.taskId:void 0,virtualmcpid:typeof t.virtualmcpid=="string"?t.virtualmcpid:void 0}}catch{}return null}function zue(){try{localStorage.removeItem(su.lastLocation())}catch{}}let us=null,JM=!1;const Sw=new Set;function Ag(){for(const e of Sw)e()}function _le(){JM||typeof window>"u"||(JM=!0,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),us=e,Ag()}),window.addEventListener("appinstalled",()=>{us=null,Ag()}))}function Uue(){us!==null&&(us=null,Ag())}function ble(e){return Sw.add(e),()=>{Sw.delete(e)}}function wle(){return us}function Sle(){return null}function Ele(){if(typeof window>"u")return!1;const e=typeof window.matchMedia=="function"&&["(display-mode: standalone)","(display-mode: window-controls-overlay)"].some(n=>window.matchMedia(n).matches),t=navigator.standalone===!0;return e||t}function xle(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)?!0:e.includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Fue(){const e=er.c(5),t=M.useSyncExternalStore(ble,wle,Sle);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ele(),e[0]=n):n=e[0];const r=n,o=t!==null&&!r;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=xle(),l=Rle,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let c;return e[3]!==o?(c={canPrompt:o,installed:r,ios:s,promptInstall:l},e[3]=o,e[4]=c):c=e[4],c}async function Rle(){if(!us)return"unavailable";await us.prompt();const e=await us.userChoice;return us=null,Ag(),e.outcome}const Pi=i9({component:()=>C.jsx(vle,{children:C.jsx(cle,{children:C.jsx(M.Suspense,{fallback:C.jsx(SE,{}),children:C.jsx(YP,{})})})})}),Ole=gt({getParentRoute:()=>Pi,path:"/login",component:xt(()=>Et(()=>import("./login-2XaS9hkp.js"),__vite__mapDeps([0,1,2,3,4,5]))),validateSearch:ya(()=>be({next:$().optional(),client_id:$().optional(),redirect_uri:$().optional(),response_type:$().optional(),state:$().optional(),scope:$().optional(),code_challenge:$().optional(),code_challenge_method:$().optional()}))}),Tle=gt({getParentRoute:()=>Pi,path:"/cli/auth-success",component:xt(()=>Et(()=>import("./cli-auth-success-CIXoobY3.js"),__vite__mapDeps([6,5])))}),Cle=gt({getParentRoute:()=>Pi,path:"/reset-password",component:xt(()=>Et(()=>import("./reset-password-DuQNc2ea.js"),__vite__mapDeps([7,2]))),validateSearch:ya(()=>be({token:$().optional(),error:$().optional()}))}),Ale=gt({getParentRoute:()=>Pi,path:"/auth/$pathname",component:xt(()=>Et(()=>import("./auth-catchall-BGvnUEtF.js"),[]))}),Ile=gt({getParentRoute:()=>Pi,path:"/oauth/callback",component:xt(()=>Et(()=>import("./oauth-callback-DYLJAZCI.js"),__vite__mapDeps([8,9,10])))}),Mle=gt({getParentRoute:()=>Pi,path:"/oauth/callback/ai-provider",component:xt(()=>Et(()=>import("./oauth-callback-ai-provider-rdUL0BWX.js"),[]))}),xE=gt({getParentRoute:()=>Pi,id:"shell",component:xt(()=>Et(()=>import("./shell-layout-D5Tkk5tH.js").then(e=>e.s),__vite__mapDeps([11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,10,28,29,3,4,30,31,32,33])))}),Ple=gt({getParentRoute:()=>xE,path:"/",beforeLoad:async()=>{const e=yle();if(e)throw Oc({to:"/$org",params:{org:e.org}});const t=localStorage.getItem(su.lastOrgSlug());if(t)throw Oc({to:"/$org",params:{org:t}});const{data:n}=await hN();if(!n)return;const r=n[0];throw Oc(r?{to:"/$org",params:{org:r.slug}}:{to:"/onboarding"})}}),Nle=gt({getParentRoute:()=>Pi,path:"/onboarding",beforeLoad:async()=>{const{data:e}=await hN();if(e&&e.length>0)throw Oc({to:"/"})},component:xt(()=>Et(()=>import("./onboarding-B_o-kvWj.js"),__vite__mapDeps([34,24,5,35,12,13,2,36,37,14,18,38,39,40])))}),kle=gt({getParentRoute:()=>Pi,path:"/commerce-onboarding",component:xt(()=>Et(()=>import("./commerce-onboarding-BeTqoPNV.js"),__vite__mapDeps([41,1,2,3,4,5,35,12,13,30,26,27,10,42,43,44,45,46,47,48,49,50,14,51,18,52,53,54,55,56,16,57,58,59,60,61,19,62,38,63,64,65,66,67,68,69,39,70,71,15,72,73,74,75,40,76,17,22,20,21,77,78,79,36,80,81,82,9]))),validateSearch:ya(()=>be({org:$().optional(),siteUrl:$().optional()}))}),yv=gt({getParentRoute:()=>xE,path:"/$org",beforeLoad:({params:e})=>{hL({org:e.org})},component:xt(()=>Et(()=>import("./org-layout-BdKBHC6w.js"),[]))}),Nf=gt({getParentRoute:()=>yv,id:"org-shell",component:xt(()=>Et(()=>import("./index-DBcAf61g.js"),__vite__mapDeps([83,84,65,85,22,77,86,87,88,89,12,13,57,60,58,50,68,69,48,73,14,44,45,46,47,42,49,51,18,52,53,54,55,56,16,59,61,19,62,38,63,64,66,67,39,70,71,15,72,74,75,40,76,17,20,90,91,21,79,36,92,93,94,95,96,97,98,99,100,101,26,27,10,31,32,102,103,78,104,43,105,106,107,2,108,82,9,109,110,111,112,25,28,29,3,4,113,114,30,115,11,23,24,33,116,117,118,119,120,121,122,123,124,125,80,126,81,127])))}),pL=gt({getParentRoute:()=>Nf,id:"agent-shell",pendingComponent:EE,component:xt(()=>Et(()=>import("./index-wIKKJbMn.js").then(e=>e.aR),__vite__mapDeps([128,47,112,25,28,26,27,10,29,3,4,113,101,110,32,114,30,31,129,92,77,52,53,55,102,103,100,104,84,65,85,22,130,131,132,94,119,45,18,56,44,46,48,42,49,50,14,51,54,16,57,58,59,60,61,19,62,38,63,64,66,67,68,69,39,70,71,15,72,73,74,75,40,13,76,17,20,133,109,107,134,116,117,21,88,12,120,121,135,136,137,138,139,11,23,24,33,43,122,123,140,79,36,2,89,105,141,115,96,97,98,99,78,106,93,108,82,9,111,142,86,143,144,145,146,127,80,147,148,126,149,150,37,151,152,153,125,81,154,155,156,157,158,87,159,160,161])))}),Dle=be({virtualmcpid:$().optional(),tab:$().optional(),main:an([$(),Ge(0)]).optional(),preview:$().optional(),id:$().optional(),toolName:$().optional(),tasks:at().optional(),mainOpen:at().optional(),chat:at().optional(),blocks:at().optional(),autosend:$().optional(),runLocally:$().optional()}),Lle=gt({getParentRoute:()=>pL,path:"/$taskId",validateSearch:Dle,beforeLoad:({params:e,search:t})=>{hL({org:e.org,taskId:e.taskId,virtualmcpid:t.virtualmcpid})},component:()=>null}),$le=be({main:$().optional()}),jle=gt({getParentRoute:()=>Nf,path:"/",validateSearch:$le,pendingComponent:EE,component:xt(()=>Et(()=>import("./index-DQdKjxkd.js"),__vite__mapDeps([162,27,28,26,10,29,3,4,31,32,123])))}),zle=be({path:$().optional(),preview:$().optional(),skill:$().optional()}),Ule=gt({getParentRoute:()=>Nf,path:"/files",validateSearch:zle,pendingComponent:EE,component:xt(()=>Et(()=>import("./index-DoTvTLuW.js").then(e=>e.P),__vite__mapDeps([146,54,61,60,58,39,71,15,74,40,17,20,85,23,21,22,2,86,136,52,57,30,127,80,59,64,75,145,56,93,53,55,88,77,66,138,65])))}),Fle=gt({getParentRoute:()=>Nf,path:"/board",component:xt(()=>Et(()=>import("./index-Bm_EZj8m.js").then(e=>e.i),__vite__mapDeps([156,157,12,13,107,51,67,71,132,94,32,120,121,45,18,56,61,21,22,145,52,54,88,158,53,75])))}),Dn=gt({getParentRoute:()=>yv,path:"/settings",component:xt(()=>Et(()=>import("./settings-layout-Cb3KTyHO.js"),__vite__mapDeps([163,84,65,85,22,77,152,50,14,63,64,73,13,20,31,27,32,149,164,148,147,114,29,3,127,118,87])))}),Ble=gt({getParentRoute:()=>yv,path:"/install",component:xt(()=>Et(()=>import("./org-install-C9o_3Ac4.js"),[]))}),Vle=gt({getParentRoute:()=>Dn,path:"/",component:xt(()=>Et(()=>import("./index-redirect-BMGbap1t.js"),__vite__mapDeps([165,149,166])))}),qle=gt({getParentRoute:()=>Dn,path:"/connections",component:xt(()=>Et(()=>import("./connections-CSkEKBZR.js"),__vite__mapDeps([167,78,26,27,10,168,145,52,54,56,47,67,77,169,107,153,72,106,98,97,99,100,101,31,32,102,103,104,43,42,44,45,46,48,49,50,14,51,18,53,55,16,57,58,59,60,61,19,62,38,63,64,65,66,68,69,39,70,71,15,73,74,75,40,13,76,17,22,20,131,152,84,85,170,23,149,171,134,21,89,79,36,2,92,93,113,108,82,9]))),validateSearch:ya(()=>be({action:sn(["create"]).optional(),tab:sn(["all","connected"]).optional()}))}),Hle=gt({getParentRoute:()=>Dn,path:"/connections/$appSlug",component:xt(()=>Et(()=>import("./connection-detail-Dfja2B2f.js"),__vite__mapDeps([172,78,26,27,10,131,108,2,71,75,173,152,84,65,85,22,77,126,58,64,100,101,99,31,32,92,52,53,55,174,175,117,44,45,46,47,48,42,49,50,14,51,18,54,56,16,57,59,60,61,19,62,38,63,66,67,68,69,39,70,15,72,73,74,40,13,76,17,20,88,113,176,122,28,29,3,4,123,150,9,107,139,132,94,12,140,43,79,36,170,23,177,141,97,105,104,145]))),validateSearch:ya(()=>be({tab:$().optional()}))}),Gle=gt({getParentRoute:()=>Dn,path:"/connections/$appSlug/$collectionName/$itemId",component:xt(()=>Et(()=>import("./collection-detail-CeFAWnjG.js"),__vite__mapDeps([178,131,101,26,27,10,79,36,2,93,173,152,84,65,85,22,77,126,58,64,100,78,99,31,32,71,92,52,53,55,174,175,117,44,45,46,47,48,42,49,50,14,51,18,54,56,16,57,59,60,61,19,62,38,63,66,67,68,69,39,70,15,72,73,74,75,40,13,76,17,20,88,113,176,122,28,29,3,4,123,139,179,124,97,150,9,107,137,138,112,25,110,114,30,43,11,12,21,23,24,33]))),validateSearch:ya(()=>be({replayId:$().optional()}))}),Kle=gt({getParentRoute:()=>Dn,path:"/monitor",component:xt(()=>Et(()=>import("./index-mNvg-Lqv.js"),__vite__mapDeps([180,153,72,152,84,65,85,22,77,131,181,149,182,166,129,92,52,53,55,102,103,100,101,26,27,10,113,104,130,132,94,119,45,18,56,44,46,47,48,42,49,50,14,51,54,16,57,58,59,60,61,19,62,38,63,64,66,67,68,69,39,70,71,15,73,74,75,40,13,76,17,20,133,32,109,107,134,116,117,21,88,12,120,121,135,136,30,137,138,112,25,28,29,3,4,110,114,31,139,11,23,24,33,43,122,123,140,79,36,2,97,158,93,106,37,179,177,174]))),validateSearch:ya(()=>be({tab:sn(["overview","audit","dashboards","threads","automations"]).default("overview"),from:$().default("now-30m"),to:$().default("now"),connectionId:Re($()).optional().default([]),virtualMcpId:Re($()).optional().default([]),tool:$().default(""),status:sn(["all","success","errors"]).default("all"),search:$().default(""),page:at().optional(),streaming:Nt().default(!0),propertyFilters:$().default(""),hideSystem:Nt().default(!1)}))}),Zle=gt({getParentRoute:()=>Dn,path:"/general",component:xt(()=>Et(()=>import("./general--I5KqlRQ.js"),__vite__mapDeps([183,152,84,65,85,22,77,94,151,12,13,2,144,104,49,184,32,107,92,52,53,55,37,31,27,23,181,149,182,166])))}),Yle=gt({getParentRoute:()=>Dn,path:"/brand-context",component:xt(()=>Et(()=>import("./brand-context-BOgXJUxE.js"),__vite__mapDeps([185,53,54,62,66,71,75,20,23,2,93,152,84,65,85,22,77,32,151,181,149,182,166])))}),Wle=gt({getParentRoute:()=>Dn,path:"/ai-providers",component:xt(()=>Et(()=>import("./ai-providers-B3lTreJE.js"),__vite__mapDeps([186,45,152,84,65,85,22,77,86,144,104,49,110,32,18,112,25,28,26,27,10,29,3,4,113,101,114,30,31,142,21,89,134,52,2,92,53,55,48,46,64,72,143,68,54,12,13,61,111,57,74,151,115,23,71,75,155,121,181,149,182,166])))}),Qle=gt({getParentRoute:()=>Dn,path:"/secrets",component:xt(()=>Et(()=>import("./secrets-DndEjy4g.js"),__vite__mapDeps([187,45,71,13,76,21,22,2,36,92,77,52,53,55,86,93,152,84,65,85,144,104,49,154,32,181,149,182,166])))}),Xle=gt({getParentRoute:()=>Dn,path:"/files",component:xt(()=>Et(()=>import("./files-ss-TYfgu.js"),[]))}),Jle=gt({getParentRoute:()=>Dn,path:"/buckets",component:xt(()=>Et(()=>import("./buckets-Bb1TNWab.js"),__vite__mapDeps([188,45,63,71,75,23,21,22,2,36,92,77,52,53,55,37,86,93,152,84,65,85,144,104,49,159,32,181,149,182,166])))}),ece=gt({getParentRoute:()=>Dn,path:"/members",component:xt(()=>Et(()=>import("./members-B0G6c1op.js"),__vite__mapDeps([189,168,145,52,54,56,47,67,77,169,107,153,72,152,84,65,85,22,190,130,131,91,21,79,36,92,53,55,93,94,95,144,104,49,164,149,32,12,13,157,132,23,59,64,73,75,17,134,116,117,88,71,181,182,166])))}),tce=gt({getParentRoute:()=>Dn,path:"/roles",component:xt(()=>Et(()=>import("./roles-CpNKG1bi.js"),__vite__mapDeps([191,95,94,107,23,145,52,54,56,59,71,75,190,130,47,152,84,65,85,22,77,131,153,72,143,43,42,44,45,46,48,49,50,14,51,18,53,55,16,57,58,60,61,19,62,38,63,64,66,67,68,69,39,70,15,73,74,40,13,76,17,20,103,134,109,26,27,10,105,132,157,100,101,110,32,12,37,144,104,149,182,166]))),validateSearch:ya(()=>be({role:$().optional()}))}),nce=gt({getParentRoute:()=>Dn,path:"/sso",component:xt(()=>Et(()=>import("./sso-DLS5LHNj.js"),__vite__mapDeps([192,184,32,144,104,49,107,2,92,77,52,53,55,152,84,65,85,22,37,33,75,181,149,182,166])))}),rce=gt({getParentRoute:()=>Dn,path:"/profile",component:xt(()=>Et(()=>import("./profile-CoDoWWWA.js"),__vite__mapDeps([193,152,84,65,85,22,77,12,13,37,92,52,53,55,115,2,68,69,70,151,147,90,144,104,49])))}),oce=gt({getParentRoute:()=>Dn,path:"/store",component:xt(()=>Et(()=>import("./store-C53RYCQG.js"),__vite__mapDeps([194,45,54,71,75,2,37,86,12,13,88,100,101,26,27,10,152,84,65,85,22,77,99,31,32,144,104,49,181,149,182,166])))}),ice=gt({getParentRoute:()=>Dn,path:"/registry",component:xt(()=>Et(()=>import("./registry-IyO3mLgs.js"),__vite__mapDeps([195,181,149,182,166])))}),sce=gt({getParentRoute:()=>Dn,path:"/store/registry",component:xt(()=>Et(()=>import("./store-registry-BmEMUup4.js"),__vite__mapDeps([196,181,149,182,166])))}),ace=gt({getParentRoute:()=>Dn,path:"/agents",component:xt(()=>Et(()=>import("./agents-list-DUwHIebf.js"),__vite__mapDeps([197,145,52,54,56,14,125,21,22,105,72,80,100,101,26,27,10,82,9,48,44,45,46,47,42,49,50,51,18,53,55,16,57,58,59,60,61,19,62,38,63,64,65,66,67,68,69,39,70,71,15,73,74,75,40,13,76,17,20,126,78,122,113,28,29,3,4,123,81,152,84,85,77,104,155,121,149,131,176,23,153])))}),lce=gt({getParentRoute:()=>Dn,path:"/automations",component:xt(()=>Et(()=>import("./automations-BIqBOxuS.js"),__vite__mapDeps([198,71,20,153,72,152,84,65,85,22,77,131,133,26,27,10,32,122,113,101,28,29,3,4,123,160,23,145,52,54,56,16,59,75,44,45,46,47,48,42,49,50,14,51,18,53,55,57,58,60,61,19,62,38,63,64,66,67,68,69,39,70,15,73,74,40,13,76,17,181,149,182,166])))}),cce=Dn.addChildren([Vle,qle,Hle,Gle,ace,lce,Kle,Zle,Yle,Wle,Qle,Xle,Jle,ece,tce,nce,rce,oce,sce,ice]),uce=pL.addChildren([Lle]),dce=Nf.addChildren([jle,Ule,Fle,uce]),fce=yv.addChildren([dce,cce,Ble]),hce=xE.addChildren([Ple,fce]),pce=Pi.addChildren([hce,Nle,kle,Ole,Tle,Cle,Ale,Ile,Mle]),mce=g9({routeTree:pce,defaultPendingComponent:SE,defaultPendingMs:200,defaultNotFoundComponent:()=>C.jsx("div",{className:"flex h-full items-center justify-center",children:C.jsxs("div",{className:"flex flex-col items-center gap-4 p-8",children:[C.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Page not found"}),C.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-[300px]",children:"The page you are looking for does not exist or has been moved."}),C.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"text-sm text-primary hover:underline",children:"Go back"})]})})});_le();const gce=document.getElementById("root");$j.createRoot(gce).render(C.jsx(M.StrictMode,{children:C.jsx(_9,{router:mce})}));export{soe as $,Xce as A,df as B,T8 as C,$2 as D,E8 as E,x8 as F,be as G,$ as H,Ci as I,Ti as J,yP as K,ff as L,Xae as M,Tce as N,Sce as O,jue as P,uP as Q,Nue as R,SE as S,kce as T,Dce as U,su as V,Oce as W,YP as X,tle as Y,_P as Z,Rce as _,Vg as a,Gt as a$,fl as a0,ole as a1,fte as a2,Bae as a3,aL as a4,pt as a5,Dg as a6,EE as a7,Re as a8,sn as a9,hae as aA,G6 as aB,lL as aC,Et as aD,wue as aE,Aue as aF,dK as aG,Lce as aH,wae as aI,cL as aJ,ee as aK,Tue as aL,Sn as aM,M4 as aN,gl as aO,gf as aP,Jn as aQ,P4 as aR,ct as aS,la as aT,at as aU,yce as aV,bo as aW,_o as aX,Ja as aY,Uue as aZ,Fue as a_,Mt as aa,Nt as ab,hK as ac,Lue as ad,fK as ae,$ue as af,bE as ag,cv as ah,Ece as ai,Cue as aj,DC as ak,Ew as al,gW as am,ii as an,Jd as ao,kg as ap,vS as aq,Gc as ar,pa as as,vs as at,si as au,D4 as av,yW as aw,wW as ax,_W as ay,sW as az,Ng as b,Ace as b$,Oue as b0,Sue as b1,Rue as b2,KW as b3,ok as b4,GW as b5,gs as b6,Iue as b7,K6 as b8,iS as b9,iD as bA,aD as bB,aX as bC,H4 as bD,NX as bE,uX as bF,H7 as bG,GP as bH,ri as bI,tue as bJ,oi as bK,vce as bL,gY as bM,dle as bN,ma as bO,fv as bP,uf as bQ,hle as bR,yle as bS,zue as bT,Due as bU,kue as bV,Mue as bW,fN as bX,dL as bY,Pue as bZ,nue as b_,hue as ba,WB as bb,W3 as bc,ZB as bd,an as be,Ge as bf,Fw as bg,TB as bh,Mce as bi,JB as bj,wV as bk,qw as bl,Bw as bm,rV as bn,Pce as bo,cue as bp,rie as bq,ya as br,AB as bs,dl as bt,mt as bu,eae as bv,AN as bw,Zw as bx,JN as by,Zee as bz,er as c,R6 as c$,Yoe as c0,Woe as c1,lE as c2,$6 as c3,cE as c4,dv as c5,w6 as c6,uie as c7,E6 as c8,iie as c9,cae as cA,gue as cB,aoe as cC,ow as cD,sw as cE,iw as cF,vue as cG,vw as cH,wr as cI,uw as cJ,yue as cK,bue as cL,_ue as cM,pue as cN,G9 as cO,b6 as cP,x6 as cQ,T6 as cR,A6 as cS,I6 as cT,P6 as cU,aue as cV,lue as cW,iue as cX,sue as cY,loe as cZ,oue as c_,yie as ca,Coe as cb,Ioe as cc,Noe as cd,qoe as ce,sie as cf,Aoe as cg,Moe as ch,koe as ci,Doe as cj,Hoe as ck,Joe as cl,xue as cm,Eue as cn,Wce as co,W6 as cp,Sf as cq,fY as cr,pY as cs,mY as ct,mf as cu,mK as cv,pK as cw,VN as cx,gP as cy,mue as cz,C8 as d,PQ as d$,C6 as d0,M6 as d1,due as d2,O6 as d3,woe as d4,rue as d5,_6 as d6,qie as d7,Xoe as d8,fue as d9,K4 as dA,DW as dB,p4 as dC,cS as dD,Xd as dE,i4 as dF,aS as dG,xce as dH,bce as dI,_ce as dJ,eX as dK,tX as dL,oX as dM,nX as dN,rX as dO,Uce as dP,Fce as dQ,Hce as dR,Gce as dS,Kce as dT,Zce as dU,Bce as dV,Vce as dW,qce as dX,mle as dY,SQ as dZ,TQ as d_,Lie as da,zie as db,bie as dc,_ie as dd,uue as de,yB as df,Cce as dg,Nce as dh,Vw as di,Ice as dj,vY as dk,yY as dl,_Y as dm,hY as dn,zce as dp,jce as dq,$ce as dr,vX as ds,yX as dt,gX as du,lS as dv,sS as dw,kW as dx,nk as dy,NW as dz,Dw as e,EQ as e0,xQ as e1,wQ as e2,uk as e3,RQ as e4,OQ as e5,CQ as e6,AQ as e7,IQ as e8,MQ as e9,NQ as ea,DQ as eb,LQ as ec,Jce as f,Qce as g,eue as h,wE as i,C as j,vP as k,ule as l,tu as m,Wn as n,nP as o,Aw as p,_8 as q,M as r,Im as s,WT as t,qP as u,b8 as v,R8 as w,w8 as x,S8 as y,Zn as z};
|