decocms 2.165.0 → 2.165.1
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-1QakW086.js → AlertCircle-D7TQKa3p.js} +1 -1
- package/dist/client/assets/{AlignLeft-vwGS_Tc8.js → AlignLeft-CLBC9knS.js} +1 -1
- package/dist/client/assets/{ArrowDown-Bp2Uv8M5.js → ArrowDown-DOxGMRr0.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CkujvxKo.js → ArrowLeft-BZTKYd8I.js} +1 -1
- package/dist/client/assets/{ArrowUp-DFnK_aBf.js → ArrowUp-puKm4bi1.js} +1 -1
- package/dist/client/assets/{Check-f4O9q_OJ.js → Check-DQ1BAmVv.js} +1 -1
- package/dist/client/assets/{CheckCircle-BhRx7Ank.js → CheckCircle-6D_wdLa6.js} +1 -1
- package/dist/client/assets/{CheckDone01-RZ3Zxx-R.js → CheckDone01-Bk07OGaT.js} +1 -1
- package/dist/client/assets/{CheckVerified02-D-pafZ5d.js → CheckVerified02-ClaBzraJ.js} +1 -1
- package/dist/client/assets/{ChevronDown-YRVsbDzg.js → ChevronDown-CWn4luQm.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Da06GoLZ.js → ChevronLeft-1PB6Yp9Q.js} +1 -1
- package/dist/client/assets/{ChevronRight-DewMKP3_.js → ChevronRight-CQynwoIc.js} +1 -1
- package/dist/client/assets/{ChevronUp-N_p4JZtK.js → ChevronUp-BXd6oK8s.js} +1 -1
- package/dist/client/assets/{Clock-Dv7K3B1c.js → Clock-8CFysqdr.js} +1 -1
- package/dist/client/assets/{Code01-DbCxOQWR.js → Code01-CWfAb0BR.js} +1 -1
- package/dist/client/assets/{Coins01--S0dITMV.js → Coins01-C1RuVLR5.js} +1 -1
- package/dist/client/assets/{Container-D1vwHVSb.js → Container-D15y3BVn.js} +1 -1
- package/dist/client/assets/{Copy01-CcXO-nJQ.js → Copy01-BOZfJKXA.js} +1 -1
- package/dist/client/assets/{Dataflow03-Clca6ZPe.js → Dataflow03-p__STePR.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-jnmkwmmb.js → DotsHorizontal-DyXbhKFz.js} +1 -1
- package/dist/client/assets/{DotsVertical-y9TWqXKj.js → DotsVertical-DKVwlbpM.js} +1 -1
- package/dist/client/assets/{Download01-Zc-hI48y.js → Download01-CuVSTFaW.js} +1 -1
- package/dist/client/assets/{Edit01-aGyjGfdl.js → Edit01-2slsYFzH.js} +1 -1
- package/dist/client/assets/{Edit05-YUz8csOD.js → Edit05-DEfLw8Lo.js} +1 -1
- package/dist/client/assets/{Eye-DEBit-Yl.js → Eye-DErbH9P2.js} +1 -1
- package/dist/client/assets/{EyeOff-DwV60nBR.js → EyeOff-DpaiPdM2.js} +1 -1
- package/dist/client/assets/{File02-B0XS357p.js → File02-CmEDNBrD.js} +1 -1
- package/dist/client/assets/{File06-DeNDAg7y.js → File06-Dhqy0Nwl.js} +1 -1
- package/dist/client/assets/{FilterLines-BhNWO4Q_.js → FilterLines-DhcaPM0-.js} +1 -1
- package/dist/client/assets/{Globe01-DgwAaNoF.js → Globe01-CUSlm6mb.js} +1 -1
- package/dist/client/assets/{Globe02-BsgtJkDX.js → Globe02-C-XAQ0Gb.js} +1 -1
- package/dist/client/assets/{Grid01-Ic5eZX0n.js → Grid01-B45eUWNB.js} +1 -1
- package/dist/client/assets/{Hash02-A3iU-dB1.js → Hash02-C4c5OCw8.js} +1 -1
- package/dist/client/assets/{Home02-Bq9WRity.js → Home02-B5R769Bb.js} +1 -1
- package/dist/client/assets/{Image01-D65nYQbc.js → Image01-CJ4uiD7_.js} +1 -1
- package/dist/client/assets/{Inbox01-SCmpiX4z.js → Inbox01-ChZMrm2E.js} +1 -1
- package/dist/client/assets/{InfoCircle-LaZljcgq.js → InfoCircle-GUs5vj1r.js} +1 -1
- package/dist/client/assets/{Key01-BErDKYGF.js → Key01-CJZACR49.js} +1 -1
- package/dist/client/assets/{LayersTwo01-BbImusT4.js → LayersTwo01-DSXBMCgP.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CCLqUxPd.js → LayoutLeft-C4IuVP32.js} +1 -1
- package/dist/client/assets/{Link01-BMpKgaPM.js → Link01-nkBxFSeo.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CiQ7ahh0.js → LinkExternal01-GJePl5cf.js} +1 -1
- package/dist/client/assets/{List-Dj1Dlpy9.js → List-Cdeem2ME.js} +1 -1
- package/dist/client/assets/{Loading01-BURFZFD9.js → Loading01-DcEHnBjm.js} +1 -1
- package/dist/client/assets/{Lock01-DV4EB6gH.js → Lock01-sSAwPZf_.js} +1 -1
- package/dist/client/assets/{Play-ChTtO_ID.js → Play-7YJPJJ7N.js} +1 -1
- package/dist/client/assets/{Plus-CLarHhh-.js → Plus-DOCHKun1.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CSmC6Obi.js → RefreshCcw01-BApoAemo.js} +1 -1
- package/dist/client/assets/{Save01-C-3Aj4NO.js → Save01-Dij2u1X4.js} +1 -1
- package/dist/client/assets/{SearchMd-DCJb8fOK.js → SearchMd-sQBRSfuJ.js} +1 -1
- package/dist/client/assets/{Settings01-Dwr5JM4C.js → Settings01-C_qJ1Q82.js} +1 -1
- package/dist/client/assets/{Shield01-BRc0vH_E.js → Shield01-CdONwacH.js} +1 -1
- package/dist/client/assets/{Terminal-H9cvxxPt.js → Terminal-ucCfM0ix.js} +1 -1
- package/dist/client/assets/{Trash01-CgTrf2i2.js → Trash01-BhZZ-MeX.js} +1 -1
- package/dist/client/assets/{Upload01-aS1Am2W4.js → Upload01-BD3sqAIU.js} +1 -1
- package/dist/client/assets/{Users03-Dvfq93hu.js → Users03-BUi6BgGl.js} +1 -1
- package/dist/client/assets/{X-BlB4CXJB.js → X-ETt7mEvP.js} +1 -1
- package/dist/client/assets/{XCircle-CRJF0mYr.js → XCircle-CeNl7Qrj.js} +1 -1
- package/dist/client/assets/{XClose-jsRLjCTZ.js → XClose-DeY9Q1i1.js} +1 -1
- package/dist/client/assets/{Zap-BdVWJ6k0.js → Zap-C1Hgc9ky.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DIEx1R0u.js → agent-connections-preview-LIbSpl2v.js} +1 -1
- package/dist/client/assets/{agent-detail-yc3lnKnx.js → agent-detail-DEdyqIkz.js} +1 -1
- package/dist/client/assets/{agents-DVYTIfFB.js → agents-BOMnGvfr.js} +1 -1
- package/dist/client/assets/{alert-dialog-CHSulOFJ.js → alert-dialog-CHQH36aR.js} +1 -1
- package/dist/client/assets/{auth-catchall-DNGyg1Mp.js → auth-catchall-U27T4MaW.js} +1 -1
- package/dist/client/assets/{avatar-C1hLgeHC.js → avatar-iey74SLX.js} +1 -1
- package/dist/client/assets/{badge-CHTyv60D.js → badge-C-SscFh3.js} +1 -1
- package/dist/client/assets/{binder-geoOjSiO.js → binder-DV58csty.js} +1 -1
- package/dist/client/assets/{breadcrumb-g_7J0HbV.js → breadcrumb-D0D-9D6E.js} +1 -1
- package/dist/client/assets/{card-C-f8KwyF.js → card-C6ahS8mq.js} +1 -1
- package/dist/client/assets/{chart-CL3mZZb_.js → chart-BTz8fFHj.js} +1 -1
- package/dist/client/assets/{checkbox-BilJxbz1.js → checkbox-COh8XgzQ.js} +1 -1
- package/dist/client/assets/{circle-alert-CHdZDoX3.js → circle-alert-CUNvZA8H.js} +1 -1
- package/dist/client/assets/{collapsible-ChxgFzu0.js → collapsible-B7BEIlv-.js} +1 -1
- package/dist/client/assets/{collection-detail-p8LkHLWN.js → collection-detail-DH7b1x1Z.js} +1 -1
- package/dist/client/assets/{collection-display-button-rvMkYTBX.js → collection-display-button-BiT_Khrc.js} +1 -1
- package/dist/client/assets/{collection-search-X-iA5JKL.js → collection-search-BMs13yKW.js} +1 -1
- package/dist/client/assets/{collection-tab-Xa9T6yWU.js → collection-tab-DGo20RRS.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dgae3bHt.js → collection-table-wrapper-7n9q9_7B.js} +1 -1
- package/dist/client/assets/{collection-tabs-Cq3goLeX.js → collection-tabs-BPQzvaXN.js} +1 -1
- package/dist/client/assets/{command-BxzNPSaf.js → command-D3rzzLkt.js} +1 -1
- package/dist/client/assets/{connect-DrLmOjby.js → connect-Bo1KZaSV.js} +1 -1
- package/dist/client/assets/{connection-card-Dz6MGyAC.js → connection-card-Mik5-uNQ.js} +1 -1
- package/dist/client/assets/{connection-detail-Dc4BdK8k.js → connection-detail-BZ9-uSgP.js} +1 -1
- package/dist/client/assets/{connection-status-Cea8BChI.js → connection-status-DrZjHFiy.js} +1 -1
- package/dist/client/assets/{connections-DjmsagWj.js → connections-CKSqtNKv.js} +1 -1
- package/dist/client/assets/{constants-Da4wzw_x.js → constants-Dd96XKEr.js} +1 -1
- package/dist/client/assets/constants-_5pfyJOI.js +1 -0
- package/dist/client/assets/{context-BuB1ecy9.js → context-Bxg-Ba7i.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DLmUkmuq.js → create-organization-dialog-DO_52zRN.js} +1 -1
- package/dist/client/assets/{create-project-dialog-txcpxqGX.js → create-project-dialog-CLirnvvR.js} +1 -1
- package/dist/client/assets/{danger-Db5AncZ_.js → danger-DGlnNe-5.js} +1 -1
- package/dist/client/assets/{danger-zone-BQFDmKNC.js → danger-zone-CUTnnlmt.js} +1 -1
- package/dist/client/assets/{dependencies-Ddg9rx4X.js → dependencies-Dqipie-k.js} +1 -1
- package/dist/client/assets/{dialog-I4kC_n2m.js → dialog-DgxIt5FS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DjWSvd8M.js → dropdown-menu-Dk6eMUBz.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CZNrrHPL.js → dynamic-plugin-layout-D7g29rG2.js} +1 -1
- package/dist/client/assets/{editable-task-title-TnddfYo3.js → editable-task-title-DwN4Qe5D.js} +1 -1
- package/dist/client/assets/{empty-state-B4yNUXT2.js → empty-state-CYZqeiDA.js} +1 -1
- package/dist/client/assets/{empty-state-BcrG828R.js → empty-state-D8NpyikB.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CMBWh8XA.js → env-vars-editor-DCtHEAsL.js} +1 -1
- package/dist/client/assets/{extract-connection-data-KCyirOWR.js → extract-connection-data-DPgqlN74.js} +1 -1
- package/dist/client/assets/{file-browser-DHzmfbXa.js → file-browser-Bf_MuPt4.js} +2 -2
- package/dist/client/assets/{form-DQYDvmTc.js → form-BXfqiRaq.js} +1 -1
- package/dist/client/assets/{general-DmuuLxJd.js → general-BAKhzklE.js} +1 -1
- package/dist/client/assets/{grid-view-IU_mZc6h.js → grid-view-QZiDlTDR.js} +1 -1
- package/dist/client/assets/{home-DfP42W8c.js → home-BPjIatFm.js} +1 -1
- package/dist/client/assets/{icon-picker-lXrlVfxG.js → icon-picker-CcPPhPfE.js} +1 -1
- package/dist/client/assets/{index-DmbjnYH2.js → index-6s552MKL.js} +1 -1
- package/dist/client/assets/{index-B4kzS44h.js → index-B0CX2QDF.js} +1 -1
- package/dist/client/assets/{index-D1bp3HSQ.js → index-B8tIo_6p.js} +1 -1
- package/dist/client/assets/{index-D5KTp1Pv.js → index-BITRKgME.js} +1 -1
- package/dist/client/assets/{index-CXMgKOCW.js → index-CS03TtJC.js} +1 -1
- package/dist/client/assets/{index-Bl1NtFgi.js → index-DDbkyCdD.js} +3 -3
- package/dist/client/assets/{index-BtZ2QZjU.js → index-Dn1C1sRY.js} +1 -1
- package/dist/client/assets/{index-Ct1JpSKa.js → index-MalYa0oX.js} +1 -1
- package/dist/client/assets/{index-BlqT9q5w.js → index-TzrqHzRt.js} +1 -1
- package/dist/client/assets/{index-CXBl7HFs.js → index-rq3W4cxa.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Cf9-WEvV.js → infiniteQueryObserver-DtbDnXNB.js} +1 -1
- package/dist/client/assets/{input-CoFM3lLv.js → input-CYjEKz0J.js} +1 -1
- package/dist/client/assets/{integration-icon-Cp5SXwVK.js → integration-icon-CG0sf2wU.js} +1 -1
- package/dist/client/assets/{label-CuhfRA_F.js → label-eILa8V60.js} +1 -1
- package/dist/client/assets/{layout-DXF_2QIZ.js → layout-7k4wFgW7.js} +1 -1
- package/dist/client/assets/{layout-CP9ZOo3p.js → layout-D7-mYCyO.js} +1 -1
- package/dist/client/assets/{localstorage-keys-IvwjdG7B.js → localstorage-keys-Dl792xxl.js} +1 -1
- package/dist/client/assets/{login-CEl9Q6kv.js → login-CZMjla3m.js} +1 -1
- package/dist/client/assets/{logo-upload-CjZ3caYz.js → logo-upload-GwlwQeem.js} +1 -1
- package/dist/client/assets/{markdown-Pl7WT7rl.js → markdown-aq_Ksgmc.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DEqMpQjF.js → mcp-app-renderer-CiigKkwW.js} +1 -1
- package/dist/client/assets/{mcp-server-card-7SptIqkm.js → mcp-server-card-CUiPz9iA.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BpsfqynZ.js → mcp-server-detail-DHTodnjr.js} +2 -2
- package/dist/client/assets/{members-G2iqXgQE.js → members-B38P5YfP.js} +1 -1
- package/dist/client/assets/{monaco-editor-CgYl383o.js → monaco-editor-CMOsu-Bb.js} +1 -1
- package/dist/client/assets/monitoring-WQDffVLI.js +31 -0
- package/dist/client/assets/{monitoring-dashboard-edit-QZktK0Wz.js → monitoring-dashboard-edit-CVEbtYzQ.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-Cr0UIkB8.js → monitoring-dashboard-view-CCsKFpfD.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cl4vHb5I.js → oauth-callback-TCN_VkAY.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-IK3o049H.js → oauth-callback-ai-provider-CKttPvkw.js} +1 -1
- package/dist/client/assets/{org-ai-providers-C3avP3Oy.js → org-ai-providers-DXfO1LBd.js} +1 -1
- package/dist/client/assets/{page-BQcp0OE7.js → page-DDy_Y0vo.js} +1 -1
- package/dist/client/assets/{page-BmhSlrLB.js → page-T5I8750Y.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DmmCASf1.js → plugin-empty-state-CHh4qa2o.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DPoT38lj.js → plugin-empty-state-GF4oAbdb.js} +1 -1
- package/dist/client/assets/{plugin-header-pi1_oxBX.js → plugin-header-D3h4tHV2.js} +1 -1
- package/dist/client/assets/{plugin-header-BgcRv_zt.js → plugin-header-rZmJKo5A.js} +1 -1
- package/dist/client/assets/plugins-Cbjpf0qW.js +1 -0
- package/dist/client/assets/{popover-B2M0WUlS.js → popover-CMSkSced.js} +1 -1
- package/dist/client/assets/{project-app-view-DF4WAEbL.js → project-app-view-DcZwb6mI.js} +1 -1
- package/dist/client/assets/{project-layout-DHXSeC8K.js → project-layout-BnH-McKS.js} +1 -1
- package/dist/client/assets/{project-plugins-BxVqCTNM.js → project-plugins-1lyeH_Jc.js} +1 -1
- package/dist/client/assets/{projects-list-BVlk1Cj6.js → projects-list-B_T0QSfh.js} +1 -1
- package/dist/client/assets/{readme-viewer-CErD1lWP.js → readme-viewer-BEnAesrQ.js} +1 -1
- package/dist/client/assets/{registry-layout-DOPA-1TI.js → registry-layout-D8-0k93B.js} +1 -1
- package/dist/client/assets/{registry-utils-CuPZ42ek.js → registry-utils-BAcuqOf0.js} +1 -1
- package/dist/client/assets/{reports-layout-DuZQqQ36.js → reports-layout-CRCsoAWg.js} +1 -1
- package/dist/client/assets/{reset-password-BGt6mkNS.js → reset-password-BHZmireu.js} +1 -1
- package/dist/client/assets/{resizable-B5K7-Nqf.js → resizable-B97MwNO0.js} +1 -1
- package/dist/client/assets/{save-actions-qGb2gpbn.js → save-actions-BKHKBPhy.js} +1 -1
- package/dist/client/assets/{scroll-area-CDXHAH7Q.js → scroll-area-BDuwWoFD.js} +1 -1
- package/dist/client/assets/{select-DBb4P4BI.js → select-DPBpE0vm.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-Ds7tYvmF.js → select-virtual-mcp-B_RD3qJs.js} +1 -1
- package/dist/client/assets/{shell-layout-BDJc_BXz.js → shell-layout-BbnaPPsv.js} +2 -2
- package/dist/client/assets/{sidebar-settings-Cvt7DK9a.js → sidebar-settings-L_h0UX5V.js} +1 -1
- package/dist/client/assets/{skeleton-e2ynA9uK.js → skeleton-CSMrIFtT.js} +1 -1
- package/dist/client/assets/{spinner-TgLyTgPp.js → spinner-DpoOrGpU.js} +1 -1
- package/dist/client/assets/{store-invite-o-gfPHgs.js → store-invite-Z5xHhzSu.js} +1 -1
- package/dist/client/assets/{switch-BbxlmLAq.js → switch-DqrBgqUu.js} +1 -1
- package/dist/client/assets/{table-DlcXP4pV.js → table-CZnw9uWb.js} +1 -1
- package/dist/client/assets/{tabs-CFSWmcWB.js → tabs-C0yHO_Eu.js} +1 -1
- package/dist/client/assets/tasks-DEfeQj60.js +1 -0
- package/dist/client/assets/{tasks-panel-C1AohVaw.js → tasks-panel-DInV1cMN.js} +1 -1
- package/dist/client/assets/{textarea-Dw4vhUuP.js → textarea-DX9HrtlK.js} +1 -1
- package/dist/client/assets/{time-range-picker-D0LViZN0.js → time-range-picker-krLOb1cS.js} +1 -1
- package/dist/client/assets/{toggle-group-8k8bEF1s.js → toggle-group-DPPrdu49.js} +1 -1
- package/dist/client/assets/{tools-list-BxKWHa8o.js → tools-list-BYTXbpsL.js} +1 -1
- package/dist/client/assets/{tooltip-DvM2dSNA.js → tooltip-DfnMgwCr.js} +1 -1
- package/dist/client/assets/{topbar-portal-N9yuHNaj.js → topbar-portal-nAwRMgcF.js} +1 -1
- package/dist/client/assets/{types-KyWKwKZh.js → types-D88sg1jo.js} +1 -1
- package/dist/client/assets/{use-binding-Lx16rVbj.js → use-binding-DepOngwy.js} +1 -1
- package/dist/client/assets/{use-collections-CyxS85Wz.js → use-collections-DmLnQYka.js} +1 -1
- package/dist/client/assets/{use-connection-y60ZgPTl.js → use-connection-CKDxNWVl.js} +1 -1
- package/dist/client/assets/{use-copy-BZoxVw9E.js → use-copy-DuYfD86n.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D3jsDEiF.js → use-create-virtual-mcp-DceZ2AIZ.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-CJt_wtad.js → use-install-from-registry-DzxR14Xu.js} +1 -1
- package/dist/client/assets/{use-list-state-C0Pf8otn.js → use-list-state-D_7sWN0E.js} +1 -1
- package/dist/client/assets/{use-llm-DJfaBoIP.js → use-llm-Cb0B6mlA.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Di32csNy.js → use-mcp-prompts-B6Msj8rZ.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-B1l9M0d7.js → use-mcp-resources-QH35Zesn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Prl4ipbj.js → use-mcp-tools-82M5DtE0.js} +1 -1
- package/dist/client/assets/{use-members-ChQqucGC.js → use-members-CG-0eLYl.js} +1 -1
- package/dist/client/assets/{use-mobile-C-AxvmoR.js → use-mobile-B1AXsmhO.js} +1 -1
- package/dist/client/assets/{use-preferences-CsobHbPL.js → use-preferences-BAN8oI-x.js} +1 -1
- package/dist/client/assets/{use-project-Cn67dJqX.js → use-project-Q55M7oT8.js} +1 -1
- package/dist/client/assets/{use-view-mode-zB3ZQkyd.js → use-view-mode-B9gUvRzd.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BTz9kaTg.js → use-virtual-mcp-BJxxs2L1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BJ_27Zoi.js +1 -0
- package/dist/client/assets/{useMutation-qgnaJPxt.js → useMutation-dmmFS68U.js} +1 -1
- package/dist/client/assets/useQuery-p8KWCpJM.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-RHqr2xfV.js +1 -0
- package/dist/client/assets/{user-W5vygYLv.js → user-CTVxr-Qm.js} +1 -1
- package/dist/client/assets/{workflow-DhiIVyTd.js → workflow-BfvAGkcZ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-CLOIUbaQ.js +0 -1
- package/dist/client/assets/monitoring-wolOwaWP.js +0 -31
- package/dist/client/assets/plugins-DBcWcfrC.js +0 -1
- package/dist/client/assets/tasks-BaMsGEx7.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ByoMDhc8.js +0 -1
- package/dist/client/assets/useQuery-CeGiDDlk.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B6mTeFHB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as E,f as st,j as s,v as ue,x as Xe,o as us,n as Me,e as at,u as me,y as _t,t as ms,q as fs,K as mt,B as de,c8 as Pt,O as Ie,P as It,S as Je,g as ps,au as xs}from"./index-Bl1NtFgi.js";import{u as Et}from"./use-project-Cn67dJqX.js";import{c as Ot,d as hs,b as gs,a as Dt,D as Lt}from"./dialog-I4kC_n2m.js";import{i as vs}from"./X-BlB4CXJB.js";import{S as ne}from"./skeleton-e2ynA9uK.js";import{i as ys,u as bs,O as js}from"./org-ai-providers-C3avP3Oy.js";import{A as Tt}from"./avatar-C1hLgeHC.js";import{t as Ns,i as rt}from"./Coins01--S0dITMV.js";import{t as Ss}from"./Settings01-Dwr5JM4C.js";import{i as ws}from"./Zap-BdVWJ6k0.js";import{a as Cs,T as ks,b as As,c as _s}from"./tooltip-DvM2dSNA.js";import{i as Ps}from"./Check-f4O9q_OJ.js";import{a as Is}from"./Copy01-CcXO-nJQ.js";import{S as Ze}from"./switch-BbxlmLAq.js";import{S as Es,a as Os,d as Be,c as Ds}from"./select-DBb4P4BI.js";import{i as Ls}from"./Code01-DbCxOQWR.js";import{i as Ts}from"./Shield01-BRc0vH_E.js";import{u as zs}from"./use-preferences-CsobHbPL.js";import{u as $s}from"./useMutation-qgnaJPxt.js";import{a as Ms,F as Ge,b as We,c as Fe,d as Re,f as Ue,e as Bs}from"./form-DQYDvmTc.js";import{I as Pe}from"./input-CoFM3lLv.js";import{L as Gs}from"./logo-upload-CjZ3caYz.js";import{P as Ws}from"./project-plugins-BxVqCTNM.js";import{u as Fs,a as Rs,b as Us,i as ie,r as lt,D as zt,c as ze,d as fe,s as ft,e as pt,Z as $t,g as Mt,f as Bt,h as Gt,j as Ae,k as nt,l as $e,m as it,n as Ks,o as Vs,p as Wt,q as ot,t as ct,v as Ft,w as Ys,x as Rt,y as xt,z as Hs,A as qs,B as Qs,R as Xs,S as Js,C as Zs,E as ea,F as Ut,G as ta,H as sa,I as aa,J as ra,K as la,L as na,M as ia,N as oa,O as Oe,P as ca,Q as ht,T as gt,U as vt,V as da,W as Kt,X as ua,Y as Ne,_ as ma,$ as fa,a0 as pa,a1 as xa,a2 as ha,a3 as Ke,a4 as ga,a5 as De,a6 as va,a7 as J,a8 as Vt,a9 as ya,aa as ba,ab as ja,ac as Na,ad as Sa,ae as wa,af as Ca,ag as ka,ah as Aa,ai as _a,aj as Pa,ak as Ia,al as Ea,am as Oa,an as Da,ao as La,ap as Ta,aq as za}from"./chart-CL3mZZb_.js";import{L as _e}from"./label-CuhfRA_F.js";import{B as $a}from"./badge-CHTyv60D.js";import{a as Ma,T as Ve,b as Ye,c as Ba}from"./tabs-CFSWmcWB.js";import{i as Ga}from"./AlertCircle-1QakW086.js";import{s as Yt}from"./Plus-CLarHhh-.js";import{s as Wa}from"./RefreshCcw01-CSmC6Obi.js";import{u as ke,a as dt,K as Fa}from"./constants-Da4wzw_x.js";import{b as Ra}from"./use-connection-y60ZgPTl.js";import{b as oe,a as Ht}from"./use-mcp-tools-Prl4ipbj.js";import{u as Ua}from"./use-members-ChQqucGC.js";import{c as Ka,A as Va}from"./use-binding-Lx16rVbj.js";import"./useQuery-CeGiDDlk.js";import"./EyeOff-DwV60nBR.js";import"./Eye-DEBit-Yl.js";import"./Key01-BErDKYGF.js";import"./Trash01-CgTrf2i2.js";import"./card-C-f8KwyF.js";import"./popover-B2M0WUlS.js";import"./use-llm-DJfaBoIP.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-Ct1JpSKa.js";import"./ChevronUp-N_p4JZtK.js";import"./ChevronDown-YRVsbDzg.js";import"./localstorage-keys-IvwjdG7B.js";import"./Upload01-aS1Am2W4.js";import"./Container-D1vwHVSb.js";import"./use-install-from-registry-CJt_wtad.js";import"./extract-connection-data-KCyirOWR.js";import"./constants-CLOIUbaQ.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CuPZ42ek.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BURFZFD9.js";import"./index-BlqT9q5w.js";import"./use-collections-CyxS85Wz.js";import"./binder-geoOjSiO.js";const qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));qt.displayName="Bell01";function Ya(t){const e=E.c(26),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),n=l?.user,i=n?.image,o=n?.name??"Profile",d=n?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(Ss,{size:14})},e[6]=u):u=e[6];let f;e[7]!==c?(f=[c,u],e[7]=c,e[8]=f):f=e[8];const h=f;let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(Ns,{size:14})},e[9]=p):p=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.plugins",label:"Features",icon:s.jsx(ws,{size:14})},e[10]=x):x=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(ys,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[p,x,g,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[12]=y):y=e[12];const w=y;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=N):N=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[N,h.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=j):j=e[18];let S;e[19]!==r||e[20]!==a?(S=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,w.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[19]=r,e[20]=a,e[21]=S):S=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.165.0"]})}),e[22]=k):k=e[22];let A;return e[23]!==b||e[24]!==S?(A=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,S,k]}),e[23]=b,e[24]=S,e[25]=A):A=e[25],A}function Ha(){const t=E.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,n=l?.image;let i;t[0]!==l?(i=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=l?.name??"U";let c;t[3]!==m||t[4]!==n?(c=s.jsx(Tt,{url:n,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=n,t[5]=c):c=t[5];const u=l?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const h=l?.email;let p;t[8]!==h?(p=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=p):p=t[9];let x;t[10]!==f||t[11]!==p?(x=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,p]}),t[10]=f,t[11]=p,t[12]=x):x=t[12];let g;t[13]!==c||t[14]!==x?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,x]}),t[13]=c,t[14]=x,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const N=l?.id;let b;t[18]!==N?(b=s.jsx("span",{className:"font-mono text-sm",children:N}),t[18]=N,t[19]=b):b=t[19];let j;t[20]!==r?(j=r?s.jsx(Ps,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Is,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=j):j=t[21];let S;t[22]!==o||t[23]!==b||t[24]!==j?(S=s.jsx(Cs,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,j]})}),t[22]=o,t[23]=b,t[24]=j,t[25]=S):S=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ks,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let A;t[27]!==S?(A=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,s.jsx(As,{children:s.jsxs(_s,{children:[S,k]})})]})]}),t[27]=S,t[28]=A):A=t[28];let C;return t[29]!==A||t[30]!==g?(C=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,A]}),t[29]=A,t[30]=g,t[31]=C):C=t[31],C}function He(t){const e=E.c(27),{icon:r,label:a,description:l,control:n,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let p;e[5]!==r?(p=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==a?(x=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=x):x=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==x||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[x,g]}),e[11]=x,e[12]=g,e[13]=y):y=e[13];let w;e[14]!==y||e[15]!==p?(w=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[p,y]}),e[14]=y,e[15]=p,e[16]=w):w=e[16];let N;e[17]!==n?(N=s.jsx("div",{onClick:qa,className:"shrink-0",children:n}),e[17]=n,e[18]=N):N=e[18];let b;return e[19]!==d||e[20]!==w||e[21]!==N||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:h,children:[w,N]}),e[19]=d,e[20]=w,e[21]=N,e[22]=m,e[23]=c,e[24]=u,e[25]=h,e[26]=b):b=e[26],b}function qa(t){return t.stopPropagation()}function yt(){const t=E.c(35),[e,r]=zs();let a;t[0]!==r?(a=async k=>{if(k&&await Notification.requestPermission()!=="granted"){Xe.error("Notifications denied. Please enable them in your browser settings."),r(Xa);return}r(A=>({...A,enableNotifications:k}))},t[0]=r,t[1]=a):a=t[1];const l=a;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ls,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Qa),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=k=>r(A=>({...A,devMode:k})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Ze,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(He,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(qt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(He,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(Ze,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ts,{size:16}),t[18]=h):h=t[18];let p;t[19]!==r?(p=k=>r(A=>({...A,toolApprovalLevel:k})),t[19]=r,t[20]=p):p=t[20];let x;t[21]===Symbol.for("react.memo_cache_sentinel")?(x={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=x):x=t[21];const g=x[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Os,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let w;t[24]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Be,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=w):w=t[24];let N;t[25]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Be,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=N):N=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Ds,{children:[w,N,s.jsx(Be,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let j;t[27]!==e.toolApprovalLevel||t[28]!==p||t[29]!==y?(j=s.jsx(He,{icon:h,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Es,{value:e.toolApprovalLevel,onValueChange:p,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=p,t[29]=y,t[30]=j):j=t[30];let S;return t[31]!==j||t[32]!==c||t[33]!==f?(S=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,j]})]}),t[31]=j,t[32]=c,t[33]=f,t[34]=S):S=t[34],S}function Qa(t){return{...t,devMode:!t.devMode}}function Xa(t){return{...t,enableNotifications:!1}}const Ja=us({name:Me().min(1,"Name is required").max(255,"Name is too long"),slug:Me().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Me().optional()});function Za(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=ms({resolver:fs(Ja),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=$s({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Xe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Xe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{n(!1)}}),d=c=>{n(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(Ms,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Ge,{control:i.control,name:"name",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Name"}),s.jsx(Re,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ue,{})]})}),s.jsx(Ge,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Slug"}),s.jsx(Re,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Bs,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ue,{})]})}),s.jsx(Ge,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Logo"}),s.jsx(Re,{children:s.jsx(Gs,{value:c.value,onChange:c.onChange,name:i.watch("name"),disabled:l})}),s.jsx(Ue,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!m||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),m&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:l,children:"Cancel"})]})]})})}function er(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Za,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>l[i++]))}},tr=["x1","y1","x2","y2","key"],sr=["offset"],ar=["xAxisId","yAxisId"],rr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){lr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function lr(t,e,r){return(e=nr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t){var e=ir(t,"string");return typeof e=="symbol"?e:e+""}function ir(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function Le(t,e){if(t==null)return{};var r,a,l=or(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function or(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var cr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:n,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:n,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:n,y1:i,x2:o,y2:d,key:m}=r,c=Le(r,tr),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,h=Le(u,sr);a=v.createElement("line",pe({},h,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function dr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Le(t,ar),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ur(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Le(t,rr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function mr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:n,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],p=h==null,x=p?l+i-u:h-u;if(x<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:x,width:n,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function fr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:n,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],p=h==null,x=p?l+i-u:h-u;if(x<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:x,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var pr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},xr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},hr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:zt.grid};function Xt(t){var e=Fs(),r=Rs(),a=Us(),l=Z(Z({},lt(t,hr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:n,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:h}=l,p=ze(),x=fe(C=>ft(C,"xAxis",n,p)),g=fe(C=>ft(C,"yAxis",i,p));if(!pt(m)||!pt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||pr,w=l.horizontalCoordinatesGenerator||xr,{horizontalPoints:N,verticalPoints:b}=l;if((!N||!N.length)&&typeof w=="function"){var j=f&&f.length,S=w({yAxis:g?Z(Z({},g),{},{ticks:j?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},j?!0:u);bt(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(N=S)}if((!b||!b.length)&&typeof y=="function"){var k=h&&h.length,A=y({xAxis:x?Z(Z({},x),{},{ticks:k?h:x.ticks}):void 0,width:e??m,height:r??c,offset:a},k?!0:u);bt(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(b=A)}return v.createElement($t,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(cr,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(mr,pe({},l,{horizontalPoints:N})),v.createElement(fr,pe({},l,{verticalPoints:b})),v.createElement(dr,pe({},l,{offset:a,horizontalPoints:N,xAxis:x,yAxis:g})),v.createElement(ur,pe({},l,{offset:a,verticalPoints:b,xAxis:x,yAxis:g}))))}Xt.displayName="CartesianGrid";var Jt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),Zt=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ts=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),gr=$e([it,Jt,es,Zt,ts],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),vr=(t,e)=>e,ss=$e([Hs,vr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),as=t=>{var e=it(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},yr=(t,e)=>{var r=as(t);return r==="yAxis"?ct(t,e):ot(t,e)},br=(t,e,r)=>qs(t,as(t),yr(t,e),r),jr=$e([ss,br],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Ys(t);if(!(a==null||l==null)){var n=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=n?.find(o=>o.key===l);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Nr=$e([it,Jt,es,Zt,ts,jr,Ks,gr,ss,Vs],(t,e,r,a,l,n,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,p;if(h&&h.length>0?p=h:p=c?.slice(u,f+1),p!=null)return Fr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:p,chartBaseValue:m,bandSize:o})}}),Sr=["id"],wr=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function rs(t,e){if(t==null)return{};var r,a,l=Cr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Cr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){kr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function kr(t,e,r){return(e=Ar(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ar(t){var e=_r(t,"string");return typeof e=="symbol"?e:e+""}function _r(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Te(t,e){return t&&t!=="none"?t:e}var Pr=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:Te(a,l),value:Ut(r,e),payload:t}]},Ir=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:n,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:sa,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Ut(i,e),hide:o,type:m,color:Te(a,n),unit:d,graphicalItemId:c}};return v.createElement(ta,{tooltipEntrySettings:u})});function Er(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(ga,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Or(t){var{showLabels:e,children:r,points:a}=t,l=a.map(n=>{var i,o,d={x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:n.value,payload:n.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(xa,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:n}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=n,{id:u}=n,f=rs(n,Sr),h=nt(f),p=ha(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Oe,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ke,xe({},p,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ke,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ke,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Er,{points:e,props:f,clipPathId:l}))}function Dr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!De(o)||!De(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.x||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Lr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.x,d=(r=n[n.length-1])===null||r===void 0?void 0:r.x;if(!De(o)||!De(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.y||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Tr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Dr,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Lr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function zr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:h}=a,p=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),x=da(p,"recharts-area-"),g=Kt(),[y,w]=v.useState(!1),N=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),w(!1)},[h]),j=v.useCallback(()=>{typeof f=="function"&&f(),w(!0)},[f]);if(g==null)return null;var S=l.current,k=n.current;return v.createElement(Or,{showLabels:N,points:i},a.children,v.createElement(ua,{animationId:x,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:j,key:x},A=>{if(S){var C=S.length/i.length,I=A===1?i:i.map((_,O)=>{var L=Math.floor(O*C);if(S[L]){var D=S[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,A),y:Ne(D.y,_.y,A)})}return _}),z;return ie(o)?z=Ne(k,o,A):ma(o)||fa(o)?z=Ne(k,0,A):z=o.map((_,O)=>{var L=Math.floor(O*C);if(Array.isArray(k)&&k[L]){var D=k[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,A),y:Ne(D.y,_.y,A)})}return _}),A>0&&(l.current=I,n.current=z),v.createElement(St,{points:I,baseLine:z,needClip:e,clipPathId:r,props:a})}return A>0&&(l.current=i,n.current=o),v.createElement(Oe,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Tr,{alpha:A,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Oe,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(pa,{label:a.label}))}function $r(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement(zr,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class Mr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:n,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:h,zIndex:p}=this.props;if(e)return null;var x=Pt("recharts-area",l),g=f,{r:y,strokeWidth:w}=ia(r),N=oa(r),b=y*2+w,j=o?"url(#clipPath-".concat(N?"":"dots-").concat(g,")"):void 0;return v.createElement($t,{zIndex:p},v.createElement(Oe,{className:x},o&&v.createElement("defs",null,v.createElement(ca,{clipPathId:g,xAxisId:d,yAxisId:m}),!N&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:n-b/2,width:c+b,height:u+b}))),v.createElement($r,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:Te(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}),this.props.isRange&&Array.isArray(h)&&v.createElement(ht,{points:h,mainColor:Te(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}))}}var Br={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:zt.area};function Gr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,connectNulls:i,dot:o,fill:d,fillOpacity:m,hide:c,isAnimationActive:u,legendType:f,stroke:h,xAxisId:p,yAxisId:x}=t,g=rs(t,wr),y=aa(),w=ra(),{needClip:N}=la(p,x),b=ze(),{points:j,isRange:S,baseLine:k}=(e=fe(O=>Nr(O,t.id,b)))!==null&&e!==void 0?e:{},A=na();if(y!=="horizontal"&&y!=="vertical"||A==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:C,width:I,x:z,y:_}=A;return!j||!j.length?null:v.createElement(Mr,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:k,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:C,hide:c,layout:y,isAnimationActive:u,isRange:S,legendType:f,needClip:N,points:j,stroke:h,width:I,left:z,top:_,xAxisId:p,yAxisId:x}))}var Wr=(t,e,r,a,l)=>{var n=r??e;if(ie(n))return n;var i=t==="horizontal"?l:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return n==="dataMin"?m:n==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return n==="dataMin"?o[0]:n==="dataMax"?o[1]:o[0]};function Fr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:n,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:h}=t,p=l&&l.length,x=Wr(n,i,r,o,d),g=n==="horizontal",y=!1,w=m.map((b,j)=>{var S,k,A,C;if(p)C=l[c+j];else{var I=gt(b,a);Array.isArray(I)?(C=I,y=!0):C=[x,I]}var z=(S=(k=C)===null||k===void 0?void 0:k[1])!==null&&S!==void 0?S:null,_=z==null||p&&!e&>(b,a)==null;if(g){var O;return{x:vt({axis:o,ticks:u,bandSize:h,entry:b,index:j}),y:_?null:(O=d.scale.map(z))!==null&&O!==void 0?O:null,value:C,payload:b}}return{x:_?null:(A=o.scale.map(z))!==null&&A!==void 0?A:null,y:vt({axis:d,ticks:f,bandSize:h,entry:b,index:j}),value:C,payload:b}}),N;return p||y?N=w.map(b=>{var j,S=Array.isArray(b.value)?b.value[0]:null;if(g){var k;return{x:b.x,y:S!=null&&b.y!=null&&(k=d.scale.map(S))!==null&&k!==void 0?k:null,payload:b.payload}}return{x:S!=null&&(j=o.scale.map(S))!==null&&j!==void 0?j:null,y:b.y,payload:b.payload}}):N=g?d.scale.map(x):o.scale.map(x),{points:w,baseLine:N??0,isRange:y}}function Rr(t){var e=lt(t,Br),r=ze();return v.createElement(Xs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Js,{legendPayload:Pr(e)}),v.createElement(Ir,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(Zs,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:ea(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Gr,xe({},e,{id:a}))))}var ls=v.memo(Rr,Qs);ls.displayName="Area";var Ur=["type"],Kr=["dangerouslySetInnerHTML","ticks","scale"],Vr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Yr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Yr(t,e,r){return(e=Hr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hr(t){var e=qr(t,"string");return typeof e=="symbol"?e:e+""}function qr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Qr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Qr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Xr(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,n=tt(t,Ur),i=Ia(a,"yAxis",l),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},n),{},{type:i})},[i,n]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ya(o)):r.current!==o&&e(ba({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ja(r.current)),r.current=null)},[e]),null}function Jr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(Na),d=ze(),m=Vt(),c="yAxis",u=fe(S=>Sa(S,e)),f=fe(S=>wa(S,e)),h=fe(S=>Ca(S,c,e,d)),p=fe(S=>ka(S,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Aa(l)||v.isValidElement(l)||p==null)){var S=n.current;if(S){var k=S.getCalculatedWidth();Math.round(u.width)!==Math.round(k)&&m(_a({id:e,width:k}))}}},[h,u,m,l,e,a,p]),u==null||f==null||p==null)return null;var{dangerouslySetInnerHTML:x,ticks:g,scale:y}=t,w=tt(t,Kr),{id:N,scale:b}=p,j=tt(p,Vr);return v.createElement(Pa,et({},w,j,{ref:n,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var Zr={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:Ae.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:Ae.tickLine,tickSize:Ae.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},el=t=>{var e=lt(t,Zr);return v.createElement(v.Fragment,null,v.createElement(Xr,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(Jr,e))},ns=v.memo(el,va);ns.displayName="YAxis";var tl=["axis"],sl=v.forwardRef((t,e)=>v.createElement(Ea,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:tl,tooltipPayloadSearcher:Oa,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),n=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-n),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const is="gateway-chip-period";function al(){try{const t=localStorage.getItem(is);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function rl(t){try{localStorage.setItem(is,t)}catch{}}const ll={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},nl={daily:"daily",weekly:"weekly",monthly:"monthly"},il=[5,10,25,50,100],ol=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function cl(t){const e=E.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:n,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[h,p]=v.useState(null),[x,g]=v.useState(null),[y,w]=v.useState(o??"none");let N;e[0]!==l||e[1]!==d.id?(N={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=N):N=e[2];const b=ke(N);let j;e[3]!==b?(j={client:b},e[3]=b,e[4]=j):j=e[4];const{mutate:S,isPending:k}=Ht(j),A=_t(),C=i==="postpaid";let I;e[5]!==u?(I=u?Number.parseFloat(u):null,e[5]=u,e[6]=I):I=e[6];const _=m??I,O=y==="none"?null:y,L=C&&_!=null&&_===n&&O===o;let D;e[7]!==b?(D=Fa.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let V;e[9]!==G||e[10]!==A?(V=async()=>{await A.invalidateQueries({queryKey:G,exact:!0}),await A.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=A,e[11]=V):V=e[11];const R=V;let T,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==C||e[17]!==y||e[18]!==S||e[19]!==a||e[20]!==R?($=()=>{if(!_||_<=0)return;const B=C?_:n+_;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};C&&(ae.limit_period=y),S({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?p(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),p(null),g(null),w(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=n,e[15]=_,e[16]=C,e[17]=y,e[18]=S,e[19]=a,e[20]=R,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=C?"Configure Spending Limit":"Add Credit",H=C?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=C?"New limit":"Select amount",U=C?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(hs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(gs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==n||e[34]!==u||e[35]!==_||e[36]!==x||e[37]!==$||e[38]!==k||e[39]!==C||e[40]!==L||e[41]!==y||e[42]!==m?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:il.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:C?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),C&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:ol.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>w(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),x&&s.jsx("p",{className:"text-xs text-destructive",children:x}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:C?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:n>0?K(n):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(n)})]})}),s.jsx(de,{onClick:$,disabled:k||!_||_<=0||L,className:"gap-2",children:k?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=x,e[37]=$,e[38]=k,e[39]=C,e[40]=L,e[41]=y,e[42]=m,e[43]=F):F=e[43];let Q;e[44]!==W||e[45]!==F?(Q=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Lt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function dl(t){const e=E.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:n}=r;if(a==null)return null;let i;e[0]!==l?(i=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==n?(f=K(n),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let p;e[12]!==r.resetsBeforeDepletion?(p=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=p):p=e[13];const x=ll[r.confidence];let g;e[14]!==x?(g=s.jsx($a,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:x}),e[14]=x,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==h||e[20]!==p?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,h,p,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=h,e[20]=p,e[21]=y):y=e[21],y}function ul(t){const e=E.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:n,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let p;e[9]!==d||e[10]!==a.total||e[11]!==l?(p=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Wa,{size:10}),nl[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=p):p=e[12];let x;e[13]!==d?(x=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=x):x=e[14];let g;e[15]!==h||e[16]!==p||e[17]!==x?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,h,p,x]}),e[15]=h,e[16]=p,e[17]=x,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const w=d?"Configure Limit":"Set Limit";let N;e[20]!==n||e[21]!==w?(N=s.jsxs(de,{onClick:n,variant:"outline",className:"gap-2",children:[y,w]}),e[20]=n,e[21]=w,e[22]=N):N=e[22];let b;e[23]!==N||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,N]}),e[23]=N,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==d||e[27]!==a.reset||e[28]!==c?(j=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=j):j=e[29];let S;e[30]!==o||e[31]!==i?(S=s.jsx(os,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=S):S=e[32];let k;return e[33]!==b||e[34]!==j||e[35]!==S?(k=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,j,S]}),e[33]=b,e[34]=j,e[35]=S,e[36]=k):k=e[36],k}function ml(t){const e=E.c(30),{available:r,total:a,estimation:l,onAddCredit:n,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Yt,{size:16}),e[10]=p):p=e[10];let x;e[11]!==n?(x=s.jsxs(de,{onClick:n,className:"gap-2 px-5",children:[p,"Add Credit"]}),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==h||e[14]!==x?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,x]}),e[13]=h,e[14]=x,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let w;e[20]!==l?(w=s.jsx(dl,{estimation:l}),e[20]=l,e[21]=w):w=e[21];let N;e[22]!==o||e[23]!==i?(N=s.jsx(os,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=N):N=e[24];let b;return e[25]!==w||e[26]!==N||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,w,N]}),e[25]=w,e[26]=N,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function os(t){const e=E.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:n}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[p,x]=v.useState(!1),[g,y]=v.useState(null);let w;e[0]!==r||e[1]!==n.id?(w={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=w):w=e[2];const N=ke(w);let b;e[3]!==N?(b={client:N},e[3]=N,e[4]=b):b=e[4];const{mutate:j,isPending:S}=Ht(b),k=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let A;e[5]!==f||e[6]!==d||e[7]!==j||e[8]!==c?(A=()=>{y(null),x(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}j({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{x(!0),setTimeout(()=>x(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=j,e[8]=c,e[9]=A):A=e[9];const C=A,I=l==="postpaid"?"Usage Alert":"Low-Balance Alert",z=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Ga,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==I?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[12]=I,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let _;e[28]!==I?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[28]=I,e[29]=_):_=e[29];let O;e[30]!==z?(O=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=O):O=e[31];let L;e[32]!==_||e[33]!==O?(L=s.jsxs("div",{children:[_,O]}),e[32]=_,e[33]=O,e[34]=L):L=e[34];let D;e[35]!==d?(D=s.jsx(Ze,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==L||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[L,D]}),e[37]=L,e[38]=D,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=ue("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const T=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>h(X.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==Q?(se=s.jsxs("div",{className:R,children:[F,Q]}),e[60]=R,e[61]=F,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==p?(B=p&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=p,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=S||!k,te=S?"Saving...":"Save Alert";let le;e[67]!==C||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:C,disabled:re,children:te}),e[67]=C,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let P;return e[74]!==se||e[75]!==ce||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=P):P=e[77],P}const fl={cost:{label:"Cost",color:"var(--chart-1)"}};function pl(){const t=E.c(54),{org:e}=me(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=ut(r),t[0]=r,t[1]=l):l=t[1];const n=l;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=ke(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==n?(m={widget:d,timeRange:n,skipCount:!0},t[5]=n,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==n?(h={widget:f,timeRange:n,skipCount:!0},t[11]=n,t[12]=h):h=t[12];let p;t[13]!==o||t[14]!==h?(p={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=p):p=t[15];const{data:x}=oe(p);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==n?(y={widget:g,timeRange:n,skipCount:!0},t[17]=n,t[18]=y):y=t[18];let w;t[19]!==o||t[20]!==y?(w={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=w):w=t[21];const{data:N}=oe(w);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let j;t[24]!==b?(j=b.map(bl),t[24]=b,t[25]=j):j=t[25];const S=j;let k;if(t[26]!==x?.value||t[27]!==S||t[28]!==N?.groups||t[29]!==u?.timeseries||t[30]!==r){const A=(u?.timeseries??[]).reduce(yl,0),C=x?.value??0,I=(N?.groups??[]).filter(vl).sort(gl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let _;t[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=_):_=t[32];const O=K(A);let L;t[33]!==O?(L=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:O}),t[33]=O,t[34]=L):L=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==L||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[L,D]}),t[37]=L,t[38]=D,t[39]=G):G=t[39];let V;t[40]!==C?(V=C.toLocaleString(),t[40]=C,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let T;t[44]!==G||t[45]!==R?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,R]}),t[44]=G,t[45]=R,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(cs,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==S?(H=S.length>0?s.jsx(Da,{config:fl,className:"h-[200px] w-full",children:s.jsxs(sl,{data:S,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Xt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(La,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:hl}),s.jsx(Ta,{content:s.jsx(za,{formatter:xl})}),s.jsx(ls,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=S,t[53]=H):H=t[53],k=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,I.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:I.map((M,U)=>{const q=A>0?Math.min(M.value/A*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=x?.value,t[27]=S,t[28]=N?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=k}else k=t[31];return k}function xl(t){return K(t)}function hl(t){return`$${t}`}function gl(t,e){return e.value-t.value}function vl(t){return t.value>0}function yl(t,e){return t+e.value}function bl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function jl(){const t=E.c(6),[e,r]=v.useState(al);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),rl(m)},t[0]=a):a=t[0];const l=a;let n,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=n,t[2]=i):(n=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[n,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>l(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function qe(t){const e=E.c(20),{label:r,value:a,subValue:l,maxValue:n,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=n>0?Math.min(m/n*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let p;e[6]!==h?(p={width:h},e[6]=h,e[7]=p):p=e[7];let x;e[8]!==f||e[9]!==p?(x=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:p})}),e[8]=f,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let w;return e[15]!==u||e[16]!==x||e[17]!==g||e[18]!==y?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g,y]}),e[15]=u,e[16]=x,e[17]=g,e[18]=y,e[19]=w):w=e[19],w}function Qe(t){const e=E.c(8),{title:r,children:a,empty:l}=t;let n;e[0]!==r?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==a||e[3]!==l?(i=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==n||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7],o}const kt={"7d":"7 days","30d":"30 days","90d":"90 days"};function cs(t){const e=E.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(kt),e[0]=l):l=e[0];let n;return e[1]!==a||e[2]!==r?(n=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:kt[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function At(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Nl(){const t=E.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Ua(),i=n?.data?.members??[],o=new Map(i.map(_l));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=ke(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn},...P.limit&&{limit:P.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:p}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:x,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:w}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:N,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=j):j=t[2];const{data:S,isLoading:k}=oe(c(j));if(f||p||g||w||b||k){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Al)})]}),t[4]=X):X=t[4],X}const C=At(u?.groups??[],h?.groups??[]),I=At(x?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=S?.groups??[],_=new Map((N?.groups??[]).map(kl)),O=z.map(P=>({name:P.key,calls:P.value,cost:_.get(P.key)??0})).sort(Cl).slice(0,20),L=C.reduce(wl,0),D=C.reduce(Sl,0),G=C[0]?.cost??1,V=I[0]?.cost??1,R=O[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(cs,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=C.length===0,H=C.slice(0,8).map(P=>s.jsx(qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Qe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=I.length===0,ee=I.slice(0,8).map(P=>s.jsx(qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},P.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Qe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const Q=Qe,se="Top Tools",B=O.length===0,ae="space-y-2.5",re=O.slice(0,8).map(P=>s.jsx(qe,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?K(P.cost):void 0,maxValue:R,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(L)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),ce]})}function Sl(t,e){return t+e.calls}function wl(t,e){return t+e.cost}function Cl(t,e){return e.calls-t.calls}function kl(t){return[t.key,t.value]}function Al(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function _l(t){return[t.userId,t.user.name??t.user.email]}function Pl(t,e){const r=new Map;for(const a of t){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Il(){const t=E.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const n=ke(l);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=i):i=t[3];let o;t[4]!==n?(o={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=n,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let u;t[7]!==n?(u={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=n,t[8]=u):u=t[8];const{data:f,isLoading:h}=oe(u);if(m||h){let j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=j):j=t[9],j}let p,x,g,y,w;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const j=Pl(d?.timeseries??[],f?.timeseries??[]);w="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=p):p=t[17],x="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=j.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:j.map(El)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=p,t[13]=x,t[14]=g,t[15]=y,t[16]=w}else p=t[12],x=t[13],g=t[14],y=t[15],w=t[16];let N;t[19]!==x||t[20]!==g||t[21]!==y?(N=s.jsxs("div",{className:x,children:[g,y]}),t[19]=x,t[20]=g,t[21]=y,t[22]=N):N=t[22];let b;return t[23]!==p||t[24]!==N||t[25]!==w?(b=s.jsxs("div",{className:w,children:[p,N]}),t[23]=p,t[24]=N,t[25]=w,t[26]=b):b=t[26],b}function El(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Ol(t){const e=E.c(31),{connectionId:r}=t,{org:a}=me(),[l,n]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=ke(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Dl},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let I;return e[6]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=I):I=e[6],I}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,p=c.usage,x=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let w;e[7]!==c.alert?(w=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=w):w=e[8];const N=w,b=c.limit,j=x==="postpaid"&&(h==null||h===0);let S;e[9]!==N||e[10]!==f||e[11]!==x||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==p?(S=x==="postpaid"?s.jsx(ul,{usage:p,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:N}):s.jsx(ml,{available:f,total:h,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:N}),e[9]=N,e[10]=f,e[11]=x,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=p,e[18]=S):S=e[18];let k;e[19]!==j?(k=j&&s.jsx(jl,{}),e[19]=j,e[20]=k):k=e[20];let A;e[21]!==x||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(A=s.jsx(cl,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:h,billingMode:x,currentLimitPeriod:g}),e[21]=x,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=A):A=e[26];let C;return e[27]!==S||e[28]!==k||e[29]!==A?(C=s.jsxs(s.Fragment,{children:[S,k,A]}),e[27]=S,e[28]=k,e[29]=A,e[30]=C):C=e[30],C}function Dl(t){return t.structuredContent}function Ll(t){const e=E.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Ma,{variant:"underline",children:[s.jsx(Ve,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Ve,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Ve,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(Ol,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(pl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(Ye,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=m):m=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Nl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(Ye,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=u):u=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Il,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(Ye,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let p;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==h?(p=s.jsxs(s.Fragment,{children:[n,s.jsxs(Ba,{value:a,onValueChange:l,variant:"underline",children:[i,m,u,h]})]}),e[15]=a,e[16]=m,e[17]=u,e[18]=h,e[19]=p):p=e[19],p}function Tl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function zl(){const t=E.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class $l extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(zl,{}):this.props.children}}function Ml(){const t=E.c(4),e=Ra();let r;t[0]!==e?(r=e.find(Bl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Ll,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Bl(t){return Ka(t,Va)}function Gl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx($l,{children:s.jsx(v.Suspense,{fallback:s.jsx(Tl,{}),children:s.jsx(Ml,{})})})}),t[0]=e):e=t[0],e}function ds(){const t=E.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Wl(t){const e=E.c(14),{projectSlug:r,children:a}=t,{org:l}=me(),{data:n,isLoading:i}=Et(l.id,r);if(i||!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),e[0]=u):u=e[0],u}const o=r===Ie;let d;e[1]!==n.description||e[2]!==n.enabledPlugins||e[3]!==n.id||e[4]!==n.name||e[5]!==n.organizationId||e[6]!==n.slug||e[7]!==n.ui||e[8]!==o?(d={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:o},e[1]=n.description,e[2]=n.enabledPlugins,e[3]=n.id,e[4]=n.name,e[5]=n.organizationId,e[6]=n.slug,e[7]=n.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==l?(c=s.jsx(It,{org:l,project:m,children:a}),e[10]=a,e[11]=m,e[12]=l,e[13]=c):c=e[13],c}function Fl(t){const e=E.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ha,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(er,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Wl,{projectSlug:Ie,children:s.jsx(Ws,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(js,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function Rl(){const t=E.c(24),{isOpen:e,activeSection:r,open:a,close:l}=bs();let n;t[0]!==l?(n=y=>!y&&l(),t[0]=l,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=i):i=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(Ya,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let m,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(vs,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=m,t[8]=c):(m=t[7],c=t[8]);let u;t[9]!==l?(u=s.jsxs("button",{type:"button",onClick:l,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[m,c]}),t[9]=l,t[10]=u):u=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ds,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Fl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let p;t[14]!==u||t[15]!==h?(p=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[u,h]}),t[14]=u,t[15]=h,t[16]=p):p=t[16];let x;t[17]!==d||t[18]!==p?(x=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[i,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,p]})]}),t[17]=d,t[18]=p,t[19]=x):x=t[19];let g;return t[20]!==e||t[21]!==n||t[22]!==x?(g=s.jsx(Lt,{open:e,onOpenChange:n,children:x}),t[20]=e,t[21]=n,t[22]=x,t[23]=g):g=t[23],g}function Ul(t){const e=E.c(12),{projectSlug:r,orgSlug:a,error:l}=t,n=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let m;e[5]!==n||e[6]!==a?(m=s.jsx(de,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=n,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Kl(t){const e=E.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Vl(){const t=E.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=ps(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let x;return t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Je,{}),t[1]=x):x=t[1],x}if(d){let x;return t[2]!==d||t[3]!==l||t[4]!==n?(x=s.jsx(Ul,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=x):x=t[5],x}if(!i){let x;return t[6]!==l||t[7]!==n?(x=s.jsx(Kl,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=x):x=t[8],x}const m=i.slug===Ie;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(xs,{})}),h=s.jsx(Rl,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let p;return t[20]!==u||t[21]!==a?(p=s.jsxs(It,{org:a,project:u,children:[f,h]}),t[20]=u,t[21]=a,t[22]=p):p=t[22],p}function ti(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(Vl,{})}),t[0]=e):e=t[0],e}export{ti as default};
|
|
1
|
+
import{r as v,c as E,f as st,j as s,v as ue,x as Xe,o as us,n as Me,e as at,u as me,y as _t,t as ms,q as fs,K as mt,B as de,c8 as Pt,O as Ie,P as It,S as Je,g as ps,au as xs}from"./index-DDbkyCdD.js";import{u as Et}from"./use-project-Q55M7oT8.js";import{c as Ot,d as hs,b as gs,a as Dt,D as Lt}from"./dialog-DgxIt5FS.js";import{i as vs}from"./X-ETt7mEvP.js";import{S as ne}from"./skeleton-CSMrIFtT.js";import{i as ys,u as bs,O as js}from"./org-ai-providers-DXfO1LBd.js";import{A as Tt}from"./avatar-iey74SLX.js";import{t as Ns,i as rt}from"./Coins01-C1RuVLR5.js";import{t as Ss}from"./Settings01-C_qJ1Q82.js";import{i as ws}from"./Zap-C1Hgc9ky.js";import{a as Cs,T as ks,b as As,c as _s}from"./tooltip-DfnMgwCr.js";import{i as Ps}from"./Check-DQ1BAmVv.js";import{a as Is}from"./Copy01-BOZfJKXA.js";import{S as Ze}from"./switch-DqrBgqUu.js";import{S as Es,a as Os,d as Be,c as Ds}from"./select-DPBpE0vm.js";import{i as Ls}from"./Code01-CWfAb0BR.js";import{i as Ts}from"./Shield01-CdONwacH.js";import{u as zs}from"./use-preferences-BAN8oI-x.js";import{u as $s}from"./useMutation-dmmFS68U.js";import{a as Ms,F as Ge,b as We,c as Fe,d as Re,f as Ue,e as Bs}from"./form-BXfqiRaq.js";import{I as Pe}from"./input-CYjEKz0J.js";import{L as Gs}from"./logo-upload-GwlwQeem.js";import{P as Ws}from"./project-plugins-1lyeH_Jc.js";import{u as Fs,a as Rs,b as Us,i as ie,r as lt,D as zt,c as ze,d as fe,s as ft,e as pt,Z as $t,g as Mt,f as Bt,h as Gt,j as Ae,k as nt,l as $e,m as it,n as Ks,o as Vs,p as Wt,q as ot,t as ct,v as Ft,w as Ys,x as Rt,y as xt,z as Hs,A as qs,B as Qs,R as Xs,S as Js,C as Zs,E as ea,F as Ut,G as ta,H as sa,I as aa,J as ra,K as la,L as na,M as ia,N as oa,O as Oe,P as ca,Q as ht,T as gt,U as vt,V as da,W as Kt,X as ua,Y as Ne,_ as ma,$ as fa,a0 as pa,a1 as xa,a2 as ha,a3 as Ke,a4 as ga,a5 as De,a6 as va,a7 as J,a8 as Vt,a9 as ya,aa as ba,ab as ja,ac as Na,ad as Sa,ae as wa,af as Ca,ag as ka,ah as Aa,ai as _a,aj as Pa,ak as Ia,al as Ea,am as Oa,an as Da,ao as La,ap as Ta,aq as za}from"./chart-BTz8fFHj.js";import{L as _e}from"./label-eILa8V60.js";import{B as $a}from"./badge-C-SscFh3.js";import{a as Ma,T as Ve,b as Ye,c as Ba}from"./tabs-C0yHO_Eu.js";import{i as Ga}from"./AlertCircle-D7TQKa3p.js";import{s as Yt}from"./Plus-DOCHKun1.js";import{s as Wa}from"./RefreshCcw01-BApoAemo.js";import{u as ke,a as dt,K as Fa}from"./constants-Dd96XKEr.js";import{b as Ra}from"./use-connection-CKDxNWVl.js";import{b as oe,a as Ht}from"./use-mcp-tools-82M5DtE0.js";import{u as Ua}from"./use-members-CG-0eLYl.js";import{c as Ka,A as Va}from"./use-binding-DepOngwy.js";import"./useQuery-p8KWCpJM.js";import"./EyeOff-DpaiPdM2.js";import"./Eye-DErbH9P2.js";import"./Key01-CJZACR49.js";import"./Trash01-BhZZ-MeX.js";import"./card-C6ahS8mq.js";import"./popover-CMSkSced.js";import"./use-llm-Cb0B6mlA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-MalYa0oX.js";import"./ChevronUp-BXd6oK8s.js";import"./ChevronDown-CWn4luQm.js";import"./localstorage-keys-Dl792xxl.js";import"./Upload01-BD3sqAIU.js";import"./Container-D15y3BVn.js";import"./use-install-from-registry-DzxR14Xu.js";import"./extract-connection-data-DPgqlN74.js";import"./constants-_5pfyJOI.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BAcuqOf0.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DcEHnBjm.js";import"./index-TzrqHzRt.js";import"./use-collections-DmLnQYka.js";import"./binder-DV58csty.js";const qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));qt.displayName="Bell01";function Ya(t){const e=E.c(26),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),n=l?.user,i=n?.image,o=n?.name??"Profile",d=n?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(Ss,{size:14})},e[6]=u):u=e[6];let f;e[7]!==c?(f=[c,u],e[7]=c,e[8]=f):f=e[8];const h=f;let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(Ns,{size:14})},e[9]=p):p=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.plugins",label:"Features",icon:s.jsx(ws,{size:14})},e[10]=x):x=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(ys,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[p,x,g,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[12]=y):y=e[12];const w=y;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=N):N=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[N,h.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=j):j=e[18];let S;e[19]!==r||e[20]!==a?(S=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,w.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[19]=r,e[20]=a,e[21]=S):S=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.165.1"]})}),e[22]=k):k=e[22];let A;return e[23]!==b||e[24]!==S?(A=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,S,k]}),e[23]=b,e[24]=S,e[25]=A):A=e[25],A}function Ha(){const t=E.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,n=l?.image;let i;t[0]!==l?(i=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=l?.name??"U";let c;t[3]!==m||t[4]!==n?(c=s.jsx(Tt,{url:n,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=n,t[5]=c):c=t[5];const u=l?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const h=l?.email;let p;t[8]!==h?(p=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=p):p=t[9];let x;t[10]!==f||t[11]!==p?(x=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,p]}),t[10]=f,t[11]=p,t[12]=x):x=t[12];let g;t[13]!==c||t[14]!==x?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,x]}),t[13]=c,t[14]=x,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const N=l?.id;let b;t[18]!==N?(b=s.jsx("span",{className:"font-mono text-sm",children:N}),t[18]=N,t[19]=b):b=t[19];let j;t[20]!==r?(j=r?s.jsx(Ps,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Is,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=j):j=t[21];let S;t[22]!==o||t[23]!==b||t[24]!==j?(S=s.jsx(Cs,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,j]})}),t[22]=o,t[23]=b,t[24]=j,t[25]=S):S=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ks,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let A;t[27]!==S?(A=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,s.jsx(As,{children:s.jsxs(_s,{children:[S,k]})})]})]}),t[27]=S,t[28]=A):A=t[28];let C;return t[29]!==A||t[30]!==g?(C=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,A]}),t[29]=A,t[30]=g,t[31]=C):C=t[31],C}function He(t){const e=E.c(27),{icon:r,label:a,description:l,control:n,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let p;e[5]!==r?(p=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==a?(x=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=x):x=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==x||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[x,g]}),e[11]=x,e[12]=g,e[13]=y):y=e[13];let w;e[14]!==y||e[15]!==p?(w=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[p,y]}),e[14]=y,e[15]=p,e[16]=w):w=e[16];let N;e[17]!==n?(N=s.jsx("div",{onClick:qa,className:"shrink-0",children:n}),e[17]=n,e[18]=N):N=e[18];let b;return e[19]!==d||e[20]!==w||e[21]!==N||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:h,children:[w,N]}),e[19]=d,e[20]=w,e[21]=N,e[22]=m,e[23]=c,e[24]=u,e[25]=h,e[26]=b):b=e[26],b}function qa(t){return t.stopPropagation()}function yt(){const t=E.c(35),[e,r]=zs();let a;t[0]!==r?(a=async k=>{if(k&&await Notification.requestPermission()!=="granted"){Xe.error("Notifications denied. Please enable them in your browser settings."),r(Xa);return}r(A=>({...A,enableNotifications:k}))},t[0]=r,t[1]=a):a=t[1];const l=a;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ls,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Qa),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=k=>r(A=>({...A,devMode:k})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Ze,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(He,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(qt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(He,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(Ze,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ts,{size:16}),t[18]=h):h=t[18];let p;t[19]!==r?(p=k=>r(A=>({...A,toolApprovalLevel:k})),t[19]=r,t[20]=p):p=t[20];let x;t[21]===Symbol.for("react.memo_cache_sentinel")?(x={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=x):x=t[21];const g=x[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Os,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let w;t[24]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Be,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=w):w=t[24];let N;t[25]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Be,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=N):N=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Ds,{children:[w,N,s.jsx(Be,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let j;t[27]!==e.toolApprovalLevel||t[28]!==p||t[29]!==y?(j=s.jsx(He,{icon:h,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Es,{value:e.toolApprovalLevel,onValueChange:p,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=p,t[29]=y,t[30]=j):j=t[30];let S;return t[31]!==j||t[32]!==c||t[33]!==f?(S=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,j]})]}),t[31]=j,t[32]=c,t[33]=f,t[34]=S):S=t[34],S}function Qa(t){return{...t,devMode:!t.devMode}}function Xa(t){return{...t,enableNotifications:!1}}const Ja=us({name:Me().min(1,"Name is required").max(255,"Name is too long"),slug:Me().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Me().optional()});function Za(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=ms({resolver:fs(Ja),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=$s({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Xe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Xe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{n(!1)}}),d=c=>{n(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(Ms,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Ge,{control:i.control,name:"name",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Name"}),s.jsx(Re,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ue,{})]})}),s.jsx(Ge,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Slug"}),s.jsx(Re,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Bs,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ue,{})]})}),s.jsx(Ge,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Logo"}),s.jsx(Re,{children:s.jsx(Gs,{value:c.value,onChange:c.onChange,name:i.watch("name"),disabled:l})}),s.jsx(Ue,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!m||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),m&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:l,children:"Cancel"})]})]})})}function er(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Za,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>l[i++]))}},tr=["x1","y1","x2","y2","key"],sr=["offset"],ar=["xAxisId","yAxisId"],rr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){lr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function lr(t,e,r){return(e=nr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t){var e=ir(t,"string");return typeof e=="symbol"?e:e+""}function ir(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function Le(t,e){if(t==null)return{};var r,a,l=or(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function or(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var cr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:n,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:n,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:n,y1:i,x2:o,y2:d,key:m}=r,c=Le(r,tr),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,h=Le(u,sr);a=v.createElement("line",pe({},h,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function dr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Le(t,ar),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ur(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Le(t,rr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function mr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:n,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],p=h==null,x=p?l+i-u:h-u;if(x<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:x,width:n,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function fr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:n,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],p=h==null,x=p?l+i-u:h-u;if(x<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:x,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var pr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},xr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},hr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:zt.grid};function Xt(t){var e=Fs(),r=Rs(),a=Us(),l=Z(Z({},lt(t,hr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:n,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:h}=l,p=ze(),x=fe(C=>ft(C,"xAxis",n,p)),g=fe(C=>ft(C,"yAxis",i,p));if(!pt(m)||!pt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||pr,w=l.horizontalCoordinatesGenerator||xr,{horizontalPoints:N,verticalPoints:b}=l;if((!N||!N.length)&&typeof w=="function"){var j=f&&f.length,S=w({yAxis:g?Z(Z({},g),{},{ticks:j?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},j?!0:u);bt(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(N=S)}if((!b||!b.length)&&typeof y=="function"){var k=h&&h.length,A=y({xAxis:x?Z(Z({},x),{},{ticks:k?h:x.ticks}):void 0,width:e??m,height:r??c,offset:a},k?!0:u);bt(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(b=A)}return v.createElement($t,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(cr,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(mr,pe({},l,{horizontalPoints:N})),v.createElement(fr,pe({},l,{verticalPoints:b})),v.createElement(dr,pe({},l,{offset:a,horizontalPoints:N,xAxis:x,yAxis:g})),v.createElement(ur,pe({},l,{offset:a,verticalPoints:b,xAxis:x,yAxis:g}))))}Xt.displayName="CartesianGrid";var Jt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),Zt=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ts=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),gr=$e([it,Jt,es,Zt,ts],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),vr=(t,e)=>e,ss=$e([Hs,vr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),as=t=>{var e=it(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},yr=(t,e)=>{var r=as(t);return r==="yAxis"?ct(t,e):ot(t,e)},br=(t,e,r)=>qs(t,as(t),yr(t,e),r),jr=$e([ss,br],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Ys(t);if(!(a==null||l==null)){var n=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=n?.find(o=>o.key===l);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Nr=$e([it,Jt,es,Zt,ts,jr,Ks,gr,ss,Vs],(t,e,r,a,l,n,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,p;if(h&&h.length>0?p=h:p=c?.slice(u,f+1),p!=null)return Fr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:p,chartBaseValue:m,bandSize:o})}}),Sr=["id"],wr=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function rs(t,e){if(t==null)return{};var r,a,l=Cr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Cr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){kr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function kr(t,e,r){return(e=Ar(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ar(t){var e=_r(t,"string");return typeof e=="symbol"?e:e+""}function _r(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Te(t,e){return t&&t!=="none"?t:e}var Pr=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:Te(a,l),value:Ut(r,e),payload:t}]},Ir=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:n,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:sa,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Ut(i,e),hide:o,type:m,color:Te(a,n),unit:d,graphicalItemId:c}};return v.createElement(ta,{tooltipEntrySettings:u})});function Er(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(ga,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Or(t){var{showLabels:e,children:r,points:a}=t,l=a.map(n=>{var i,o,d={x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:n.value,payload:n.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(xa,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:n}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=n,{id:u}=n,f=rs(n,Sr),h=nt(f),p=ha(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Oe,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ke,xe({},p,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ke,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ke,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Er,{points:e,props:f,clipPathId:l}))}function Dr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!De(o)||!De(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.x||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Lr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.x,d=(r=n[n.length-1])===null||r===void 0?void 0:r.x;if(!De(o)||!De(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.y||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Tr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Dr,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Lr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function zr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:h}=a,p=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),x=da(p,"recharts-area-"),g=Kt(),[y,w]=v.useState(!1),N=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),w(!1)},[h]),j=v.useCallback(()=>{typeof f=="function"&&f(),w(!0)},[f]);if(g==null)return null;var S=l.current,k=n.current;return v.createElement(Or,{showLabels:N,points:i},a.children,v.createElement(ua,{animationId:x,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:j,key:x},A=>{if(S){var C=S.length/i.length,I=A===1?i:i.map((_,O)=>{var L=Math.floor(O*C);if(S[L]){var D=S[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,A),y:Ne(D.y,_.y,A)})}return _}),z;return ie(o)?z=Ne(k,o,A):ma(o)||fa(o)?z=Ne(k,0,A):z=o.map((_,O)=>{var L=Math.floor(O*C);if(Array.isArray(k)&&k[L]){var D=k[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,A),y:Ne(D.y,_.y,A)})}return _}),A>0&&(l.current=I,n.current=z),v.createElement(St,{points:I,baseLine:z,needClip:e,clipPathId:r,props:a})}return A>0&&(l.current=i,n.current=o),v.createElement(Oe,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Tr,{alpha:A,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Oe,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(pa,{label:a.label}))}function $r(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement(zr,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class Mr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:n,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:h,zIndex:p}=this.props;if(e)return null;var x=Pt("recharts-area",l),g=f,{r:y,strokeWidth:w}=ia(r),N=oa(r),b=y*2+w,j=o?"url(#clipPath-".concat(N?"":"dots-").concat(g,")"):void 0;return v.createElement($t,{zIndex:p},v.createElement(Oe,{className:x},o&&v.createElement("defs",null,v.createElement(ca,{clipPathId:g,xAxisId:d,yAxisId:m}),!N&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:n-b/2,width:c+b,height:u+b}))),v.createElement($r,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:Te(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}),this.props.isRange&&Array.isArray(h)&&v.createElement(ht,{points:h,mainColor:Te(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}))}}var Br={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:zt.area};function Gr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,connectNulls:i,dot:o,fill:d,fillOpacity:m,hide:c,isAnimationActive:u,legendType:f,stroke:h,xAxisId:p,yAxisId:x}=t,g=rs(t,wr),y=aa(),w=ra(),{needClip:N}=la(p,x),b=ze(),{points:j,isRange:S,baseLine:k}=(e=fe(O=>Nr(O,t.id,b)))!==null&&e!==void 0?e:{},A=na();if(y!=="horizontal"&&y!=="vertical"||A==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:C,width:I,x:z,y:_}=A;return!j||!j.length?null:v.createElement(Mr,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:k,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:C,hide:c,layout:y,isAnimationActive:u,isRange:S,legendType:f,needClip:N,points:j,stroke:h,width:I,left:z,top:_,xAxisId:p,yAxisId:x}))}var Wr=(t,e,r,a,l)=>{var n=r??e;if(ie(n))return n;var i=t==="horizontal"?l:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return n==="dataMin"?m:n==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return n==="dataMin"?o[0]:n==="dataMax"?o[1]:o[0]};function Fr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:n,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:h}=t,p=l&&l.length,x=Wr(n,i,r,o,d),g=n==="horizontal",y=!1,w=m.map((b,j)=>{var S,k,A,C;if(p)C=l[c+j];else{var I=gt(b,a);Array.isArray(I)?(C=I,y=!0):C=[x,I]}var z=(S=(k=C)===null||k===void 0?void 0:k[1])!==null&&S!==void 0?S:null,_=z==null||p&&!e&>(b,a)==null;if(g){var O;return{x:vt({axis:o,ticks:u,bandSize:h,entry:b,index:j}),y:_?null:(O=d.scale.map(z))!==null&&O!==void 0?O:null,value:C,payload:b}}return{x:_?null:(A=o.scale.map(z))!==null&&A!==void 0?A:null,y:vt({axis:d,ticks:f,bandSize:h,entry:b,index:j}),value:C,payload:b}}),N;return p||y?N=w.map(b=>{var j,S=Array.isArray(b.value)?b.value[0]:null;if(g){var k;return{x:b.x,y:S!=null&&b.y!=null&&(k=d.scale.map(S))!==null&&k!==void 0?k:null,payload:b.payload}}return{x:S!=null&&(j=o.scale.map(S))!==null&&j!==void 0?j:null,y:b.y,payload:b.payload}}):N=g?d.scale.map(x):o.scale.map(x),{points:w,baseLine:N??0,isRange:y}}function Rr(t){var e=lt(t,Br),r=ze();return v.createElement(Xs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Js,{legendPayload:Pr(e)}),v.createElement(Ir,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(Zs,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:ea(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Gr,xe({},e,{id:a}))))}var ls=v.memo(Rr,Qs);ls.displayName="Area";var Ur=["type"],Kr=["dangerouslySetInnerHTML","ticks","scale"],Vr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Yr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Yr(t,e,r){return(e=Hr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hr(t){var e=qr(t,"string");return typeof e=="symbol"?e:e+""}function qr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Qr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Qr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Xr(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,n=tt(t,Ur),i=Ia(a,"yAxis",l),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},n),{},{type:i})},[i,n]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ya(o)):r.current!==o&&e(ba({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ja(r.current)),r.current=null)},[e]),null}function Jr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(Na),d=ze(),m=Vt(),c="yAxis",u=fe(S=>Sa(S,e)),f=fe(S=>wa(S,e)),h=fe(S=>Ca(S,c,e,d)),p=fe(S=>ka(S,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Aa(l)||v.isValidElement(l)||p==null)){var S=n.current;if(S){var k=S.getCalculatedWidth();Math.round(u.width)!==Math.round(k)&&m(_a({id:e,width:k}))}}},[h,u,m,l,e,a,p]),u==null||f==null||p==null)return null;var{dangerouslySetInnerHTML:x,ticks:g,scale:y}=t,w=tt(t,Kr),{id:N,scale:b}=p,j=tt(p,Vr);return v.createElement(Pa,et({},w,j,{ref:n,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var Zr={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:Ae.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:Ae.tickLine,tickSize:Ae.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},el=t=>{var e=lt(t,Zr);return v.createElement(v.Fragment,null,v.createElement(Xr,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(Jr,e))},ns=v.memo(el,va);ns.displayName="YAxis";var tl=["axis"],sl=v.forwardRef((t,e)=>v.createElement(Ea,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:tl,tooltipPayloadSearcher:Oa,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),n=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-n),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const is="gateway-chip-period";function al(){try{const t=localStorage.getItem(is);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function rl(t){try{localStorage.setItem(is,t)}catch{}}const ll={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},nl={daily:"daily",weekly:"weekly",monthly:"monthly"},il=[5,10,25,50,100],ol=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function cl(t){const e=E.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:n,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[h,p]=v.useState(null),[x,g]=v.useState(null),[y,w]=v.useState(o??"none");let N;e[0]!==l||e[1]!==d.id?(N={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=N):N=e[2];const b=ke(N);let j;e[3]!==b?(j={client:b},e[3]=b,e[4]=j):j=e[4];const{mutate:S,isPending:k}=Ht(j),A=_t(),C=i==="postpaid";let I;e[5]!==u?(I=u?Number.parseFloat(u):null,e[5]=u,e[6]=I):I=e[6];const _=m??I,O=y==="none"?null:y,L=C&&_!=null&&_===n&&O===o;let D;e[7]!==b?(D=Fa.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let V;e[9]!==G||e[10]!==A?(V=async()=>{await A.invalidateQueries({queryKey:G,exact:!0}),await A.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=A,e[11]=V):V=e[11];const R=V;let T,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==C||e[17]!==y||e[18]!==S||e[19]!==a||e[20]!==R?($=()=>{if(!_||_<=0)return;const B=C?_:n+_;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};C&&(ae.limit_period=y),S({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?p(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),p(null),g(null),w(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=n,e[15]=_,e[16]=C,e[17]=y,e[18]=S,e[19]=a,e[20]=R,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=C?"Configure Spending Limit":"Add Credit",H=C?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=C?"New limit":"Select amount",U=C?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(hs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(gs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==n||e[34]!==u||e[35]!==_||e[36]!==x||e[37]!==$||e[38]!==k||e[39]!==C||e[40]!==L||e[41]!==y||e[42]!==m?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:il.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:C?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),C&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:ol.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>w(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),x&&s.jsx("p",{className:"text-xs text-destructive",children:x}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:C?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:n>0?K(n):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(n)})]})}),s.jsx(de,{onClick:$,disabled:k||!_||_<=0||L,className:"gap-2",children:k?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=x,e[37]=$,e[38]=k,e[39]=C,e[40]=L,e[41]=y,e[42]=m,e[43]=F):F=e[43];let Q;e[44]!==W||e[45]!==F?(Q=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Lt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function dl(t){const e=E.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:n}=r;if(a==null)return null;let i;e[0]!==l?(i=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==n?(f=K(n),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let p;e[12]!==r.resetsBeforeDepletion?(p=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=p):p=e[13];const x=ll[r.confidence];let g;e[14]!==x?(g=s.jsx($a,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:x}),e[14]=x,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==h||e[20]!==p?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,h,p,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=h,e[20]=p,e[21]=y):y=e[21],y}function ul(t){const e=E.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:n,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let p;e[9]!==d||e[10]!==a.total||e[11]!==l?(p=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Wa,{size:10}),nl[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=p):p=e[12];let x;e[13]!==d?(x=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=x):x=e[14];let g;e[15]!==h||e[16]!==p||e[17]!==x?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,h,p,x]}),e[15]=h,e[16]=p,e[17]=x,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const w=d?"Configure Limit":"Set Limit";let N;e[20]!==n||e[21]!==w?(N=s.jsxs(de,{onClick:n,variant:"outline",className:"gap-2",children:[y,w]}),e[20]=n,e[21]=w,e[22]=N):N=e[22];let b;e[23]!==N||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,N]}),e[23]=N,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==d||e[27]!==a.reset||e[28]!==c?(j=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=j):j=e[29];let S;e[30]!==o||e[31]!==i?(S=s.jsx(os,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=S):S=e[32];let k;return e[33]!==b||e[34]!==j||e[35]!==S?(k=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,j,S]}),e[33]=b,e[34]=j,e[35]=S,e[36]=k):k=e[36],k}function ml(t){const e=E.c(30),{available:r,total:a,estimation:l,onAddCredit:n,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Yt,{size:16}),e[10]=p):p=e[10];let x;e[11]!==n?(x=s.jsxs(de,{onClick:n,className:"gap-2 px-5",children:[p,"Add Credit"]}),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==h||e[14]!==x?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,x]}),e[13]=h,e[14]=x,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let w;e[20]!==l?(w=s.jsx(dl,{estimation:l}),e[20]=l,e[21]=w):w=e[21];let N;e[22]!==o||e[23]!==i?(N=s.jsx(os,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=N):N=e[24];let b;return e[25]!==w||e[26]!==N||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,w,N]}),e[25]=w,e[26]=N,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function os(t){const e=E.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:n}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[p,x]=v.useState(!1),[g,y]=v.useState(null);let w;e[0]!==r||e[1]!==n.id?(w={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=w):w=e[2];const N=ke(w);let b;e[3]!==N?(b={client:N},e[3]=N,e[4]=b):b=e[4];const{mutate:j,isPending:S}=Ht(b),k=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let A;e[5]!==f||e[6]!==d||e[7]!==j||e[8]!==c?(A=()=>{y(null),x(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}j({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{x(!0),setTimeout(()=>x(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=j,e[8]=c,e[9]=A):A=e[9];const C=A,I=l==="postpaid"?"Usage Alert":"Low-Balance Alert",z=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Ga,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==I?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[12]=I,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let _;e[28]!==I?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[28]=I,e[29]=_):_=e[29];let O;e[30]!==z?(O=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=O):O=e[31];let L;e[32]!==_||e[33]!==O?(L=s.jsxs("div",{children:[_,O]}),e[32]=_,e[33]=O,e[34]=L):L=e[34];let D;e[35]!==d?(D=s.jsx(Ze,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==L||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[L,D]}),e[37]=L,e[38]=D,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=ue("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const T=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>h(X.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==Q?(se=s.jsxs("div",{className:R,children:[F,Q]}),e[60]=R,e[61]=F,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==p?(B=p&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=p,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=S||!k,te=S?"Saving...":"Save Alert";let le;e[67]!==C||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:C,disabled:re,children:te}),e[67]=C,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let P;return e[74]!==se||e[75]!==ce||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=P):P=e[77],P}const fl={cost:{label:"Cost",color:"var(--chart-1)"}};function pl(){const t=E.c(54),{org:e}=me(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=ut(r),t[0]=r,t[1]=l):l=t[1];const n=l;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=ke(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==n?(m={widget:d,timeRange:n,skipCount:!0},t[5]=n,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==n?(h={widget:f,timeRange:n,skipCount:!0},t[11]=n,t[12]=h):h=t[12];let p;t[13]!==o||t[14]!==h?(p={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=p):p=t[15];const{data:x}=oe(p);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==n?(y={widget:g,timeRange:n,skipCount:!0},t[17]=n,t[18]=y):y=t[18];let w;t[19]!==o||t[20]!==y?(w={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=w):w=t[21];const{data:N}=oe(w);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let j;t[24]!==b?(j=b.map(bl),t[24]=b,t[25]=j):j=t[25];const S=j;let k;if(t[26]!==x?.value||t[27]!==S||t[28]!==N?.groups||t[29]!==u?.timeseries||t[30]!==r){const A=(u?.timeseries??[]).reduce(yl,0),C=x?.value??0,I=(N?.groups??[]).filter(vl).sort(gl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let _;t[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=_):_=t[32];const O=K(A);let L;t[33]!==O?(L=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:O}),t[33]=O,t[34]=L):L=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==L||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[L,D]}),t[37]=L,t[38]=D,t[39]=G):G=t[39];let V;t[40]!==C?(V=C.toLocaleString(),t[40]=C,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let T;t[44]!==G||t[45]!==R?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,R]}),t[44]=G,t[45]=R,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(cs,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==S?(H=S.length>0?s.jsx(Da,{config:fl,className:"h-[200px] w-full",children:s.jsxs(sl,{data:S,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Xt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(La,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:hl}),s.jsx(Ta,{content:s.jsx(za,{formatter:xl})}),s.jsx(ls,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=S,t[53]=H):H=t[53],k=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,I.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:I.map((M,U)=>{const q=A>0?Math.min(M.value/A*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=x?.value,t[27]=S,t[28]=N?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=k}else k=t[31];return k}function xl(t){return K(t)}function hl(t){return`$${t}`}function gl(t,e){return e.value-t.value}function vl(t){return t.value>0}function yl(t,e){return t+e.value}function bl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function jl(){const t=E.c(6),[e,r]=v.useState(al);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),rl(m)},t[0]=a):a=t[0];const l=a;let n,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=n,t[2]=i):(n=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[n,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>l(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function qe(t){const e=E.c(20),{label:r,value:a,subValue:l,maxValue:n,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=n>0?Math.min(m/n*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let p;e[6]!==h?(p={width:h},e[6]=h,e[7]=p):p=e[7];let x;e[8]!==f||e[9]!==p?(x=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:p})}),e[8]=f,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let w;return e[15]!==u||e[16]!==x||e[17]!==g||e[18]!==y?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g,y]}),e[15]=u,e[16]=x,e[17]=g,e[18]=y,e[19]=w):w=e[19],w}function Qe(t){const e=E.c(8),{title:r,children:a,empty:l}=t;let n;e[0]!==r?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==a||e[3]!==l?(i=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==n||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7],o}const kt={"7d":"7 days","30d":"30 days","90d":"90 days"};function cs(t){const e=E.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(kt),e[0]=l):l=e[0];let n;return e[1]!==a||e[2]!==r?(n=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:kt[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function At(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Nl(){const t=E.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Ua(),i=n?.data?.members??[],o=new Map(i.map(_l));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=ke(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn},...P.limit&&{limit:P.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:p}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:x,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:w}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:N,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=j):j=t[2];const{data:S,isLoading:k}=oe(c(j));if(f||p||g||w||b||k){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Al)})]}),t[4]=X):X=t[4],X}const C=At(u?.groups??[],h?.groups??[]),I=At(x?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=S?.groups??[],_=new Map((N?.groups??[]).map(kl)),O=z.map(P=>({name:P.key,calls:P.value,cost:_.get(P.key)??0})).sort(Cl).slice(0,20),L=C.reduce(wl,0),D=C.reduce(Sl,0),G=C[0]?.cost??1,V=I[0]?.cost??1,R=O[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(cs,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=C.length===0,H=C.slice(0,8).map(P=>s.jsx(qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Qe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=I.length===0,ee=I.slice(0,8).map(P=>s.jsx(qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},P.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Qe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const Q=Qe,se="Top Tools",B=O.length===0,ae="space-y-2.5",re=O.slice(0,8).map(P=>s.jsx(qe,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?K(P.cost):void 0,maxValue:R,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(L)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),ce]})}function Sl(t,e){return t+e.calls}function wl(t,e){return t+e.cost}function Cl(t,e){return e.calls-t.calls}function kl(t){return[t.key,t.value]}function Al(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function _l(t){return[t.userId,t.user.name??t.user.email]}function Pl(t,e){const r=new Map;for(const a of t){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Il(){const t=E.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const n=ke(l);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=i):i=t[3];let o;t[4]!==n?(o={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=n,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let u;t[7]!==n?(u={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=n,t[8]=u):u=t[8];const{data:f,isLoading:h}=oe(u);if(m||h){let j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=j):j=t[9],j}let p,x,g,y,w;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const j=Pl(d?.timeseries??[],f?.timeseries??[]);w="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=p):p=t[17],x="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=j.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:j.map(El)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=p,t[13]=x,t[14]=g,t[15]=y,t[16]=w}else p=t[12],x=t[13],g=t[14],y=t[15],w=t[16];let N;t[19]!==x||t[20]!==g||t[21]!==y?(N=s.jsxs("div",{className:x,children:[g,y]}),t[19]=x,t[20]=g,t[21]=y,t[22]=N):N=t[22];let b;return t[23]!==p||t[24]!==N||t[25]!==w?(b=s.jsxs("div",{className:w,children:[p,N]}),t[23]=p,t[24]=N,t[25]=w,t[26]=b):b=t[26],b}function El(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Ol(t){const e=E.c(31),{connectionId:r}=t,{org:a}=me(),[l,n]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=ke(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Dl},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let I;return e[6]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=I):I=e[6],I}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,p=c.usage,x=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let w;e[7]!==c.alert?(w=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=w):w=e[8];const N=w,b=c.limit,j=x==="postpaid"&&(h==null||h===0);let S;e[9]!==N||e[10]!==f||e[11]!==x||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==p?(S=x==="postpaid"?s.jsx(ul,{usage:p,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:N}):s.jsx(ml,{available:f,total:h,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:N}),e[9]=N,e[10]=f,e[11]=x,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=p,e[18]=S):S=e[18];let k;e[19]!==j?(k=j&&s.jsx(jl,{}),e[19]=j,e[20]=k):k=e[20];let A;e[21]!==x||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(A=s.jsx(cl,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:h,billingMode:x,currentLimitPeriod:g}),e[21]=x,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=A):A=e[26];let C;return e[27]!==S||e[28]!==k||e[29]!==A?(C=s.jsxs(s.Fragment,{children:[S,k,A]}),e[27]=S,e[28]=k,e[29]=A,e[30]=C):C=e[30],C}function Dl(t){return t.structuredContent}function Ll(t){const e=E.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Ma,{variant:"underline",children:[s.jsx(Ve,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Ve,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Ve,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(Ol,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(pl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(Ye,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=m):m=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Nl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(Ye,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=u):u=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Il,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(Ye,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let p;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==h?(p=s.jsxs(s.Fragment,{children:[n,s.jsxs(Ba,{value:a,onValueChange:l,variant:"underline",children:[i,m,u,h]})]}),e[15]=a,e[16]=m,e[17]=u,e[18]=h,e[19]=p):p=e[19],p}function Tl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function zl(){const t=E.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class $l extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(zl,{}):this.props.children}}function Ml(){const t=E.c(4),e=Ra();let r;t[0]!==e?(r=e.find(Bl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Ll,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Bl(t){return Ka(t,Va)}function Gl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx($l,{children:s.jsx(v.Suspense,{fallback:s.jsx(Tl,{}),children:s.jsx(Ml,{})})})}),t[0]=e):e=t[0],e}function ds(){const t=E.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Wl(t){const e=E.c(14),{projectSlug:r,children:a}=t,{org:l}=me(),{data:n,isLoading:i}=Et(l.id,r);if(i||!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),e[0]=u):u=e[0],u}const o=r===Ie;let d;e[1]!==n.description||e[2]!==n.enabledPlugins||e[3]!==n.id||e[4]!==n.name||e[5]!==n.organizationId||e[6]!==n.slug||e[7]!==n.ui||e[8]!==o?(d={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:o},e[1]=n.description,e[2]=n.enabledPlugins,e[3]=n.id,e[4]=n.name,e[5]=n.organizationId,e[6]=n.slug,e[7]=n.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==l?(c=s.jsx(It,{org:l,project:m,children:a}),e[10]=a,e[11]=m,e[12]=l,e[13]=c):c=e[13],c}function Fl(t){const e=E.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ha,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(er,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Wl,{projectSlug:Ie,children:s.jsx(Ws,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(js,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function Rl(){const t=E.c(24),{isOpen:e,activeSection:r,open:a,close:l}=bs();let n;t[0]!==l?(n=y=>!y&&l(),t[0]=l,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=i):i=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(Ya,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let m,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(vs,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=m,t[8]=c):(m=t[7],c=t[8]);let u;t[9]!==l?(u=s.jsxs("button",{type:"button",onClick:l,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[m,c]}),t[9]=l,t[10]=u):u=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ds,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Fl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let p;t[14]!==u||t[15]!==h?(p=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[u,h]}),t[14]=u,t[15]=h,t[16]=p):p=t[16];let x;t[17]!==d||t[18]!==p?(x=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[i,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,p]})]}),t[17]=d,t[18]=p,t[19]=x):x=t[19];let g;return t[20]!==e||t[21]!==n||t[22]!==x?(g=s.jsx(Lt,{open:e,onOpenChange:n,children:x}),t[20]=e,t[21]=n,t[22]=x,t[23]=g):g=t[23],g}function Ul(t){const e=E.c(12),{projectSlug:r,orgSlug:a,error:l}=t,n=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let m;e[5]!==n||e[6]!==a?(m=s.jsx(de,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=n,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Kl(t){const e=E.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Vl(){const t=E.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=ps(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let x;return t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Je,{}),t[1]=x):x=t[1],x}if(d){let x;return t[2]!==d||t[3]!==l||t[4]!==n?(x=s.jsx(Ul,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=x):x=t[5],x}if(!i){let x;return t[6]!==l||t[7]!==n?(x=s.jsx(Kl,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=x):x=t[8],x}const m=i.slug===Ie;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(xs,{})}),h=s.jsx(Rl,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let p;return t[20]!==u||t[21]!==a?(p=s.jsxs(It,{org:a,project:u,children:[f,h]}),t[20]=u,t[21]=a,t[22]=p):p=t[22],p}function ti(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(Vl,{})}),t[0]=e):e=t[0],e}export{ti as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as _,j as n,v as J,B as G,u as V,y as W,x as M,K as q,bd as D,bf as $,c as Q}from"./index-
|
|
1
|
+
import{r as _,j as n,v as J,B as G,u as V,y as W,x as M,K as q,bd as D,bf as $,c as Q}from"./index-DDbkyCdD.js";import{u as Y}from"./useQuery-p8KWCpJM.js";import{u as H}from"./useMutation-dmmFS68U.js";import{u as X,a as Z}from"./constants-Dd96XKEr.js";import{S as ee}from"./switch-DqrBgqUu.js";import{L as te}from"./label-eILa8V60.js";import{n as ne}from"./Container-D15y3BVn.js";import{b as se}from"./use-connection-CKDxNWVl.js";import{a as ie,c as re}from"./use-binding-DepOngwy.js";import{u as oe}from"./use-install-from-registry-DzxR14Xu.js";import{i as le}from"./Loading01-DcEHnBjm.js";import{s as ae}from"./Plus-DOCHKun1.js";import{S as ce,a as de,b as ue,c as me,d as z}from"./select-DPBpE0vm.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:v,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),N=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),P=a?.startsWith("@"),A=async()=>{if(P&&a){d(!0);try{const t=await v(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=N.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(z,{value:"none",children:"No connection"}),N.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):N.map(t=>n.jsx(z,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||P)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},K=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:v,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==v||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await v.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return K(O)},e[5]=v,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const N=!!d&&w;let P;e[9]!==C||e[10]!==m||e[11]!==N?(P={queryKey:C,queryFn:m,enabled:N},e[9]=C,e[10]=m,e[11]=N,e[12]=P):P=e[12];const{data:A,isLoading:g}=Y(P),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),v=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:v.includes(t)},b=()=>{const t=new Set(v);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=v.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(K(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return K(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),M.success("Plugins updated successfully")},onError:t=>{M.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),N=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},P=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:P,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:N,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as G,c as O,u as H,v as M,j as s,at as V,r as I,e as q,B as R,O as U}from"./index-
|
|
1
|
+
import{be as G,c as O,u as H,v as M,j as s,at as V,r as I,e as q,B as R,O as U}from"./index-DDbkyCdD.js";import{a as F}from"./use-project-Q55M7oT8.js";import{P as D}from"./index-B8tIo_6p.js";import{C as J}from"./collection-search-BMs13yKW.js";import{A as K}from"./avatar-iey74SLX.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-CYZqeiDA.js";import{C as W}from"./create-project-dialog-CLirnvvR.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-D0D-9D6E.js";import"./useQuery-p8KWCpJM.js";import"./constants-Dd96XKEr.js";import"./localstorage-keys-Dl792xxl.js";import"./useMutation-dmmFS68U.js";import"./tooltip-DfnMgwCr.js";import"./index-MalYa0oX.js";import"./Loading01-DcEHnBjm.js";import"./SearchMd-sQBRSfuJ.js";import"./input-CYjEKz0J.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-DgxIt5FS.js";import"./X-ETt7mEvP.js";import"./form-BXfqiRaq.js";import"./label-eILa8V60.js";import"./textarea-DX9HrtlK.js";import"./Check-DQ1BAmVv.js";import"./ChevronRight-CQynwoIc.js";const te=G("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=M("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(K,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(V,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function De(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=F(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=q();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/projects/$slug/settings/general",params:{org:e.slug,project:U,slug:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(J,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==U}export{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,K as E,j as l}from"./index-
|
|
1
|
+
import{c as b,K as E,j as l}from"./index-DDbkyCdD.js";import{u as R}from"./useQuery-p8KWCpJM.js";import{i as j}from"./File06-Dhqy0Nwl.js";import{i as v}from"./Loading01-DcEHnBjm.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
|