decocms 2.175.1 → 2.175.3
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-De9oqjty.js → AlertCircle-Bu9DNwe-.js} +1 -1
- package/dist/client/assets/{AlignLeft-BaG4OcCg.js → AlignLeft-CJvAdEi-.js} +1 -1
- package/dist/client/assets/{ArrowDown-PFFBPH3j.js → ArrowDown-BrkOB1Av.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CPWCs_Od.js → ArrowLeft-BLUY3Pjw.js} +1 -1
- package/dist/client/assets/{ArrowUp-C6Q-EpUw.js → ArrowUp-Bl5YEbbF.js} +1 -1
- package/dist/client/assets/{Check-BfKCyKXX.js → Check-CN56KhoF.js} +1 -1
- package/dist/client/assets/{CheckCircle-DiRi76qb.js → CheckCircle-B4pYO1ZS.js} +1 -1
- package/dist/client/assets/{CheckDone01-ZekLHdFZ.js → CheckDone01-DgXembQE.js} +1 -1
- package/dist/client/assets/{CheckVerified02-DC3VT092.js → CheckVerified02-BTUqey_K.js} +1 -1
- package/dist/client/assets/{ChevronDown-BHMaRWRt.js → ChevronDown-BURkaeCD.js} +1 -1
- package/dist/client/assets/{ChevronLeft-0cpA2yNq.js → ChevronLeft-C1fUg8Ja.js} +1 -1
- package/dist/client/assets/{ChevronRight-1g9z-Z5h.js → ChevronRight-Df5oEIdG.js} +1 -1
- package/dist/client/assets/{ChevronUp-1s_S3eDF.js → ChevronUp-Ql_IhfwF.js} +1 -1
- package/dist/client/assets/{Clock-rHd8cQAO.js → Clock-DY1djxCP.js} +1 -1
- package/dist/client/assets/{Code01-CoTQP8pZ.js → Code01-ClhNhs6L.js} +1 -1
- package/dist/client/assets/{Coins01-D7lfLTbO.js → Coins01-C0DqkhBz.js} +1 -1
- package/dist/client/assets/{Container-DwxLlgWA.js → Container-De-pv4QL.js} +1 -1
- package/dist/client/assets/{Copy01-CIUDy0Hr.js → Copy01-E3kqWO3T.js} +1 -1
- package/dist/client/assets/{Dataflow03-T9TmjQN-.js → Dataflow03-DVfc8SxS.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CmCKbvuJ.js → DotsHorizontal-zFut2S5z.js} +1 -1
- package/dist/client/assets/{DotsVertical-Y8XpM2B_.js → DotsVertical-ZWNLrGdE.js} +1 -1
- package/dist/client/assets/{Download01-LinNp3zy.js → Download01-D_QoltgV.js} +1 -1
- package/dist/client/assets/{Edit01-Dw-lPBk-.js → Edit01-KzFCPjcw.js} +1 -1
- package/dist/client/assets/{Edit05-Bx682Mm6.js → Edit05-DFdmrfVO.js} +1 -1
- package/dist/client/assets/{Eye-JuDcZhJz.js → Eye-CUyEl5IU.js} +1 -1
- package/dist/client/assets/{EyeOff-9_-SJWcU.js → EyeOff-D3iBtnD1.js} +1 -1
- package/dist/client/assets/{File02-bFwU_wEK.js → File02-CqU_tyTM.js} +1 -1
- package/dist/client/assets/{File06-CU5oU1OI.js → File06-B23HFdp6.js} +1 -1
- package/dist/client/assets/{FilterLines-BaTxnUjH.js → FilterLines-B4Jg_hkv.js} +1 -1
- package/dist/client/assets/{Globe01-DUjsFcPS.js → Globe01-BAfb6FiF.js} +1 -1
- package/dist/client/assets/{Globe02-k3_A41kp.js → Globe02-DAjgLqHS.js} +1 -1
- package/dist/client/assets/{Grid01-DBOkAm2V.js → Grid01-B7q4cvPD.js} +1 -1
- package/dist/client/assets/{Hash02-gqJDwuju.js → Hash02-BPlWtian.js} +1 -1
- package/dist/client/assets/{Home02-DfEb-Myv.js → Home02-BYbFBx09.js} +1 -1
- package/dist/client/assets/{Image01-I9pAeT0N.js → Image01-C62qGXSk.js} +1 -1
- package/dist/client/assets/{Inbox01-BgDmihAV.js → Inbox01-BF4_faho.js} +1 -1
- package/dist/client/assets/{InfoCircle-LX1SVC24.js → InfoCircle-DhO0vGS4.js} +1 -1
- package/dist/client/assets/{Key01-DAjAUWfr.js → Key01-Bfc7gsTd.js} +1 -1
- package/dist/client/assets/{LayersTwo01-C-XZtFtv.js → LayersTwo01-CsbV79W9.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BvuIBX8d.js → LayoutLeft-BjhMzXil.js} +1 -1
- package/dist/client/assets/{Link01-q2vhCqdM.js → Link01-CBvOA17k.js} +1 -1
- package/dist/client/assets/{LinkExternal01-QGWpvftd.js → LinkExternal01-v1Fp9c9j.js} +1 -1
- package/dist/client/assets/{List-CuV23QYs.js → List-DxiRK8pO.js} +1 -1
- package/dist/client/assets/{Loading01-BNn4YU_K.js → Loading01-CDOurw-F.js} +1 -1
- package/dist/client/assets/{Lock01-DJQX15kR.js → Lock01-jAI5MKWg.js} +1 -1
- package/dist/client/assets/{Play-C7yKo0dH.js → Play-DSE8IZVS.js} +1 -1
- package/dist/client/assets/{Plus-CT_Gcwl2.js → Plus-OTc7Ql1V.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-uL9q48A4.js → RefreshCcw01-QnfLSKau.js} +1 -1
- package/dist/client/assets/{Save01-CuwI4Bxq.js → Save01-Df_qJsfN.js} +1 -1
- package/dist/client/assets/{SearchMd-BLeX5weN.js → SearchMd-D6jy19cO.js} +1 -1
- package/dist/client/assets/{Settings01-2AkYiqYr.js → Settings01-Bl2wNagM.js} +1 -1
- package/dist/client/assets/{Shield01-D6IOCC-Z.js → Shield01-B145EOAd.js} +1 -1
- package/dist/client/assets/{Terminal-Dlvh4GS2.js → Terminal-D3ILbCbK.js} +1 -1
- package/dist/client/assets/{Tool01-CjSIsyxE.js → Tool01-BBVRBzC0.js} +1 -1
- package/dist/client/assets/{Trash01-YPQczxci.js → Trash01-DhGTBhjv.js} +1 -1
- package/dist/client/assets/{Upload01-BlEN4mwB.js → Upload01-DvtQC2yf.js} +1 -1
- package/dist/client/assets/{Users03-B7X28dbt.js → Users03-B2n8Cd76.js} +1 -1
- package/dist/client/assets/{X-B_f76BPZ.js → X-DVxsAMCH.js} +1 -1
- package/dist/client/assets/{XAxis-Du5m1KMx.js → XAxis-D14vbkR0.js} +1 -1
- package/dist/client/assets/{XCircle-DDLf4PgL.js → XCircle-l3Ck-71_.js} +1 -1
- package/dist/client/assets/{XClose-eeK1fS1n.js → XClose-C8g1LxXV.js} +1 -1
- package/dist/client/assets/{Zap-DHey7Hu_.js → Zap-DUVjsAS1.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-D6uKmygR.js → agent-connections-preview-D0-1Au_l.js} +1 -1
- package/dist/client/assets/agent-detail-BALBko9m.js +2 -0
- package/dist/client/assets/agents-BuGtmP_d.js +1 -0
- package/dist/client/assets/ai-providers-logos-NSo4Ckh1.js +1 -0
- package/dist/client/assets/{alert-dialog-BVglQjyM.js → alert-dialog-DfOenbUZ.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bfllc4Ni.js → auth-catchall-BAl96W8M.js} +1 -1
- package/dist/client/assets/automation-detail-D16eCAb7.js +1 -0
- package/dist/client/assets/automations-UpOWNkQ6.js +1 -0
- package/dist/client/assets/{avatar-OE2URZfM.js → avatar-DexhTB4g.js} +1 -1
- package/dist/client/assets/{badge-CAg946Xk.js → badge-C7XTRm7k.js} +1 -1
- package/dist/client/assets/{binder-DTBFGqjl.js → binder--omYMrhv.js} +1 -1
- package/dist/client/assets/{breadcrumb-aP02JuZO.js → breadcrumb-h9Dq7GJ0.js} +1 -1
- package/dist/client/assets/{card-RQxLVCBk.js → card-Cm-keK-z.js} +1 -1
- package/dist/client/assets/{chart-D9IwJUjP.js → chart-BkIsuiHb.js} +1 -1
- package/dist/client/assets/{checkbox-DLsMmmhu.js → checkbox-B92JdB3t.js} +1 -1
- package/dist/client/assets/{collapsible-CGr-TiAc.js → collapsible-B5VFLcG-.js} +1 -1
- package/dist/client/assets/{collection-detail-CZQpkHig.js → collection-detail-BUpBhGP1.js} +2 -2
- package/dist/client/assets/{collection-display-button-VOymjalV.js → collection-display-button-CEqdF8O7.js} +1 -1
- package/dist/client/assets/{collection-search-62vwaqdq.js → collection-search-CPQlTmfx.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DPJfuSg9.js → collection-table-wrapper-BVpN3w_L.js} +1 -1
- package/dist/client/assets/{collection-tabs-FJx5TF4Z.js → collection-tabs-DwGvAiHF.js} +1 -1
- package/dist/client/assets/{command-ChmbB2jp.js → command-BYr1e0yf.js} +1 -1
- package/dist/client/assets/connect-DKqC06uo.js +1 -0
- package/dist/client/assets/{connection-card-D9I87KkT.js → connection-card-BDqdYEuX.js} +1 -1
- package/dist/client/assets/connection-detail-CHMgcK2a.js +1 -0
- package/dist/client/assets/{connection-status-D_iX92lK.js → connection-status-B854Axgl.js} +1 -1
- package/dist/client/assets/connections-DxOgNXy0.js +1 -0
- package/dist/client/assets/{constants-XtX-WKGm.js → constants-BZUBXkLq.js} +1 -1
- package/dist/client/assets/constants-DgbSVhNJ.js +1 -0
- package/dist/client/assets/{context-CtrnP3HC.js → context-GHqlq7Gd.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DlsDrfHE.js → create-organization-dialog-Cum8PmLv.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BV-JjiBR.js → create-project-dialog-d10TQ9K8.js} +1 -1
- package/dist/client/assets/{danger-B3KgXwQ9.js → danger-qmT_QFAs.js} +1 -1
- package/dist/client/assets/{danger-zone-C_4VhnMp.js → danger-zone-daxj8FQE.js} +1 -1
- package/dist/client/assets/{dependencies-BHUeYRA7.js → dependencies-sz-4aCSB.js} +1 -1
- package/dist/client/assets/{dialog-_XYw8lZC.js → dialog-PlqYdiap.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DzFMEBVS.js → dropdown-menu-V8gWmDzD.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-PDo9TaOG.js +1 -0
- package/dist/client/assets/{editable-task-title-B7Ktbs3r.js → editable-task-title-CXa2sXGX.js} +1 -1
- package/dist/client/assets/{empty-state-D4GX29pL.js → empty-state-BUpyINsX.js} +1 -1
- package/dist/client/assets/{empty-state-AMuFIqs3.js → empty-state-CADB2xYt.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DTKmdK-v.js → env-vars-editor-Crsr3jiO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CS_Bn7Ri.js → extract-connection-data-CBWW8njI.js} +1 -1
- package/dist/client/assets/{file-browser-OSAi_CZb.js → file-browser-Ba38jp_3.js} +2 -2
- package/dist/client/assets/{form-BN7_f2uj.js → form-CnUcVXlu.js} +1 -1
- package/dist/client/assets/{general-B9J0F1Xq.js → general-D78WAnZa.js} +1 -1
- package/dist/client/assets/{grid-view-BH674f3N.js → grid-view-D92iM48j.js} +1 -1
- package/dist/client/assets/{home-Dam4fMEZ.js → home-Dh3Zkl7g.js} +1 -1
- package/dist/client/assets/{index-zjV4p_E5.js → index-AtuNXtl1.js} +1 -1
- package/dist/client/assets/{index-CuSj4QrF.js → index-BAS3V89m.js} +1 -1
- package/dist/client/assets/index-BG9x5ELw.js +25 -0
- package/dist/client/assets/index-Bs-gkatC.js +1 -0
- package/dist/client/assets/{index-Cn8BPdHZ.js → index-CMdtjEkH.js} +1 -1
- package/dist/client/assets/{index-CcA_QriT.js → index-Ce1KA469.js} +1 -1
- package/dist/client/assets/index-Ci8WAd55.css +1 -0
- package/dist/client/assets/{index-C-NLwTON.js → index-D0LkSlcd.js} +1 -1
- package/dist/client/assets/{index-DxP-spTj.js → index-DDOXVfmG.js} +1 -1
- package/dist/client/assets/{index-Da9ggy60.js → index-DINW__d9.js} +1 -1
- package/dist/client/assets/{index-DsOJvxnb.js → index-SkQC2bL2.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-BE0Fq7u7.js → infiniteQueryObserver-dFlgfKVl.js} +1 -1
- package/dist/client/assets/{input-CUT8DBv1.js → input-C4xXFdLa.js} +1 -1
- package/dist/client/assets/{integration-icon-CVxvM4fR.js → integration-icon-9nN5AvVn.js} +1 -1
- package/dist/client/assets/{label-iPw5smAw.js → label-B5UIAzjB.js} +1 -1
- package/dist/client/assets/layout-C93ItuDu.js +1 -0
- package/dist/client/assets/{layout-C2ZnDBkW.js → layout-DIeoK390.js} +1 -1
- package/dist/client/assets/{login-DJvdi7W3.js → login-Cum9TENA.js} +1 -1
- package/dist/client/assets/{logo-upload-DlKQk0GB.js → logo-upload-HuBGdFvy.js} +1 -1
- package/dist/client/assets/{markdown-CKKBcXcE.js → markdown-C7LUMDS1.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-IX_OR3wW.js → mcp-app-renderer-8UT29L5G.js} +1 -1
- package/dist/client/assets/{mcp-server-card-Cq5E9kuT.js → mcp-server-card--KsSGXj4.js} +1 -1
- package/dist/client/assets/mcp-server-detail-DpFZrrxK.js +2 -0
- package/dist/client/assets/members-Cv4ALw5c.js +3 -0
- package/dist/client/assets/{monaco-editor-J8rInsT2.js → monaco-editor-CGQB1ouQ.js} +1 -1
- package/dist/client/assets/monitoring-dashboard-edit-_8LF_BxB.js +1 -0
- package/dist/client/assets/{monitoring-dashboard-view-Dt4aILCV.js → monitoring-dashboard-view-CZdUWDWw.js} +2 -2
- package/dist/client/assets/monitoring-jUgSe2al.js +4 -0
- package/dist/client/assets/{monitoring-stats-row-Dx_W_1nT.js → monitoring-stats-row-DOJg3snj.js} +1 -1
- package/dist/client/assets/{oauth-callback-COUada1q.js → oauth-callback-DUHDiUnV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CqS-ybCD.js → oauth-callback-ai-provider-DJ-b74-1.js} +1 -1
- package/dist/client/assets/org-ai-providers-DUCq5EUw.js +1 -0
- package/dist/client/assets/page-DAq05p7G.js +1 -0
- package/dist/client/assets/page-SgyDrWHD.js +1 -0
- package/dist/client/assets/{plugin-empty-state-CRLH-_5S.js → plugin-empty-state-CrnlpA9V.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Dt2dvxD9.js → plugin-empty-state-Dnds-DCV.js} +1 -1
- package/dist/client/assets/{plugin-header-DLDBKovk.js → plugin-header-C1XYEeTv.js} +1 -1
- package/dist/client/assets/{plugin-header-CkWzqJkZ.js → plugin-header-CIduSygp.js} +1 -1
- package/dist/client/assets/plugins-CJcJdSWL.js +1 -0
- package/dist/client/assets/{popover-CF3EN_0o.js → popover-U_QlVu0r.js} +1 -1
- package/dist/client/assets/project-app-view-D9t5-mJm.js +1 -0
- package/dist/client/assets/project-layout-BL0jttJZ.js +1 -0
- package/dist/client/assets/{project-plugins-DRIvSpW5.js → project-plugins-By0aRQeH.js} +1 -1
- package/dist/client/assets/projects-list-C2BO1TYf.js +1 -0
- package/dist/client/assets/{registry-layout-MGTBGYDW.js → registry-layout-CNpSd9I3.js} +1 -1
- package/dist/client/assets/{registry-utils-Cd3t_Kmp.js → registry-utils-Bi8LTB_e.js} +1 -1
- package/dist/client/assets/{reports-layout-Cu0HmCBt.js → reports-layout-DH4L5-lG.js} +1 -1
- package/dist/client/assets/{reset-password-Dwr8terU.js → reset-password-BiJO11OF.js} +1 -1
- package/dist/client/assets/{resizable-D4LJctEl.js → resizable-XfUJo45G.js} +1 -1
- package/dist/client/assets/{save-actions-MzYbolsq.js → save-actions-AenTNPs2.js} +1 -1
- package/dist/client/assets/{scroll-area-B5XbONJS.js → scroll-area-BvqSXnHA.js} +1 -1
- package/dist/client/assets/{select-DRPG5csU.js → select-Bqr12jkn.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-B8NgSgPI.js → select-virtual-mcp-DorfgjZR.js} +1 -1
- package/dist/client/assets/{sheet-BQuKOEiL.js → sheet-D7MnTm5h.js} +1 -1
- package/dist/client/assets/shell-layout-F6dMRYN1.js +3 -0
- package/dist/client/assets/{sidebar-settings-BqDjI96r.js → sidebar-settings-ZSwNsZur.js} +1 -1
- package/dist/client/assets/{skeleton-DJFpR-1P.js → skeleton-xiE088f2.js} +1 -1
- package/dist/client/assets/{spinner-CqAVfcvO.js → spinner-Bt_p6wlU.js} +1 -1
- package/dist/client/assets/{store-invite-JCf8JSic.js → store-invite-BxsZ0zsl.js} +1 -1
- package/dist/client/assets/{switch-BQjzAGvm.js → switch-BIAgKxiJ.js} +1 -1
- package/dist/client/assets/{table-DJbHB5IL.js → table-c-SrSmwK.js} +1 -1
- package/dist/client/assets/{tabs-CkPDQzeX.js → tabs-CytiJeE2.js} +1 -1
- package/dist/client/assets/{task-status-wkv2GdSY.js → task-status-9RY3Ya8o.js} +16 -16
- package/dist/client/assets/tasks-C43Ik9tC.js +1 -0
- package/dist/client/assets/{tasks-panel-TN0GeEUK.js → tasks-panel-CftcenZ4.js} +1 -1
- package/dist/client/assets/{textarea-CTzX43MZ.js → textarea-Buug1Hxe.js} +1 -1
- package/dist/client/assets/{time-range-picker-DNJ6dRiN.js → time-range-picker-BlD0TDtN.js} +1 -1
- package/dist/client/assets/{toggle-group-y2h19HHT.js → toggle-group-abCGptw4.js} +1 -1
- package/dist/client/assets/{tools-list-Db7zzadA.js → tools-list-BdA1jEJI.js} +1 -1
- package/dist/client/assets/{tooltip-XyKE4lZa.js → tooltip-Ckpai_jH.js} +1 -1
- package/dist/client/assets/{topbar-portal-D3fRQWai.js → topbar-portal-B-Tb-3gt.js} +1 -1
- package/dist/client/assets/{types-B3niHy47.js → types-CUEMI47Y.js} +1 -1
- package/dist/client/assets/{use-automations-C4CL-jAO.js → use-automations-Cw8FAF0H.js} +1 -1
- package/dist/client/assets/{use-binding-BfjFWpEn.js → use-binding-f1akiPTf.js} +1 -1
- package/dist/client/assets/{use-collections-DSWhP4jg.js → use-collections-C3CSj681.js} +1 -1
- package/dist/client/assets/{use-connection-DmR852Js.js → use-connection-DSkVzqSP.js} +1 -1
- package/dist/client/assets/{use-copy-dSR0w-bG.js → use-copy-F9tiQWTi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DXWAjide.js → use-create-virtual-mcp-C5n2ShE6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CvaIKLMy.js → use-infinite-scroll-C1Dhvj0C.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-_FQYQGQx.js → use-install-from-registry-BQfcs7M8.js} +1 -1
- package/dist/client/assets/{use-list-state-Ck8sSm9J.js → use-list-state-Djxe5eyh.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C-XU_-dc.js → use-mcp-prompts-D5tu2gbi.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-Bxkx1Ub1.js → use-mcp-resources-D0eHe68n.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXmfFmar.js → use-mcp-tools-DTZxAm-y.js} +1 -1
- package/dist/client/assets/{use-members-B-Cx3SpJ.js → use-members-DdPysVve.js} +1 -1
- package/dist/client/assets/{use-mobile-O8KVzGuv.js → use-mobile-DqlomLIB.js} +1 -1
- package/dist/client/assets/{use-project-Bg5pX2Ab.js → use-project-Cdk7AuZE.js} +1 -1
- package/dist/client/assets/{use-store-discovery-DPE_0zuT.js → use-store-discovery-C_al4z4H.js} +1 -1
- package/dist/client/assets/{use-view-mode-ve-Q_Sd0.js → use-view-mode-Ag3VBJ77.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C9XdHCA_.js → use-virtual-mcp-V0XoWMM_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BXEdoCXW.js +1 -0
- package/dist/client/assets/{useMutation-B_cFG709.js → useMutation-CXgAMvoC.js} +1 -1
- package/dist/client/assets/useQuery-CtOvMPbo.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Ds_6ilsi.js +1 -0
- package/dist/client/assets/{user-rS26WEu1.js → user-C2BDT4Rq.js} +1 -1
- package/dist/client/assets/workflow-Bp2ajWVc.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +243 -243
- package/dist/server/node_modules/async-exit-hook/CHANGELOG.md +62 -0
- package/dist/server/node_modules/async-exit-hook/index.js +171 -0
- package/dist/server/node_modules/async-exit-hook/license +21 -0
- package/dist/server/node_modules/async-exit-hook/package.json +66 -0
- package/dist/server/node_modules/async-exit-hook/readme.md +118 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
- package/dist/server/node_modules/postgres-array/index.js +97 -0
- package/dist/server/node_modules/{pg/LICENSE → postgres-array/license} +6 -6
- package/dist/server/node_modules/postgres-array/package.json +35 -0
- package/dist/server/node_modules/postgres-array/readme.md +43 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/postgres-date/license +21 -0
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/server.js +217 -217
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-BS4g93cA.js +0 -2
- package/dist/client/assets/agents-BuWI7PBX.js +0 -1
- package/dist/client/assets/ai-providers-logos-W57Qm-EN.js +0 -1
- package/dist/client/assets/automation-detail-DNo-sbc_.js +0 -1
- package/dist/client/assets/automations-CCXftgU_.js +0 -1
- package/dist/client/assets/circle-alert-DCE_cWKa.js +0 -1
- package/dist/client/assets/connect-Cak7aHsQ.js +0 -1
- package/dist/client/assets/connection-detail-ZRvu6X4P.js +0 -1
- package/dist/client/assets/connections-Bi0oPT3Y.js +0 -1
- package/dist/client/assets/constants-B4Swgi3d.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-b0Zt6Dxk.js +0 -1
- package/dist/client/assets/index-D5cL24p_.css +0 -1
- package/dist/client/assets/index-MKlLgXIW.js +0 -25
- package/dist/client/assets/index-X4FDee1r.js +0 -1
- package/dist/client/assets/layout-CA_pUlCy.js +0 -1
- package/dist/client/assets/mcp-server-detail-CTGb-hF0.js +0 -2
- package/dist/client/assets/members-CYtrIFR5.js +0 -3
- package/dist/client/assets/monitoring-dashboard-edit-6gWIXCOX.js +0 -1
- package/dist/client/assets/monitoring-gb_hJ2kW.js +0 -4
- package/dist/client/assets/org-ai-providers-BDwPbfg4.js +0 -1
- package/dist/client/assets/page-BrXIXidh.js +0 -1
- package/dist/client/assets/page-s-fs9Bly.js +0 -1
- package/dist/client/assets/plugins-DkI_FXfU.js +0 -1
- package/dist/client/assets/project-app-view-Boof680i.js +0 -1
- package/dist/client/assets/project-layout-CxwbtNi5.js +0 -1
- package/dist/client/assets/projects-list-DmvsbHJl.js +0 -1
- package/dist/client/assets/shell-layout-ZGvfzjfQ.js +0 -3
- package/dist/client/assets/tasks-zu-x8h5W.js +0 -1
- package/dist/client/assets/use-llm-BkLbMZPM.js +0 -1
- package/dist/client/assets/use-local-storage-CxC8ozOe.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DEfXPFTs.js +0 -1
- package/dist/client/assets/useQuery-D2ShO4od.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CT40dICu.js +0 -1
- package/dist/client/assets/workflow-C4-p-dLU.js +0 -1
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as O,f as st,j as s,y as ue,w as Je,o as ms,n as Ge,e as at,u as me,x as _t,t as fs,q as ps,K as mt,B as de,c7 as Pt,O as Ie,P as It,S as Ze,g as xs,av as hs}from"./index-DsOJvxnb.js";import{u as Et}from"./use-project-Bg5pX2Ab.js";import{D as Ot,a as gs,b as vs,c as Dt,d as Lt}from"./dialog-_XYw8lZC.js";import{i as ys}from"./X-B_f76BPZ.js";import{S as ne}from"./skeleton-DJFpR-1P.js";import{i as bs,u as js,a as Ns,O as Ss}from"./org-ai-providers-BDwPbfg4.js";import{A as Tt}from"./avatar-OE2URZfM.js";import{t as ws,i as rt}from"./Coins01-D7lfLTbO.js";import{t as Cs}from"./Settings01-2AkYiqYr.js";import{i as As}from"./Zap-DHey7Hu_.js";import{a as ks,T as _s,b as Ps,c as Is}from"./tooltip-XyKE4lZa.js";import{i as Es}from"./Check-BfKCyKXX.js";import{a as Os}from"./Copy01-CIUDy0Hr.js";import{S as De}from"./switch-BQjzAGvm.js";import{S as Ds,a as Ls,d as We,c as Ts}from"./select-DRPG5csU.js";import{i as zs}from"./Code01-CoTQP8pZ.js";import{s as zt}from"./RefreshCcw01-uL9q48A4.js";import{i as $s}from"./Shield01-D6IOCC-Z.js";import{u as Ms}from"./useMutation-B_cFG709.js";import{a as Bs,F as Fe,b as Re,c as Ue,d as Ke,f as Ve,e as Gs}from"./form-BN7_f2uj.js";import{I as Pe}from"./input-CUT8DBv1.js";import{L as Ws}from"./logo-upload-DlKQk0GB.js";import{P as Fs}from"./project-plugins-DRIvSpW5.js";import{ag as Rs,ah as Us,ai as Ks,M as ie,r as lt,D as $t,u as Me,t as fe,aj as ft,ak as pt,Z as Mt,al as Bt,am as Gt,H as nt,c as Be,s as it,an as Vs,ao as Ys,e as Wt,ap as ot,aq as ct,f as Ft,ar as Hs,i as Rt,h as xt,g as qs,as as Xs,p as Qs,R as Js,S as Zs,j as ea,at as ta,k as Ut,l as sa,n as aa,q as ra,au as la,m as na,o as ia,v as oa,L as Le,G as ca,w as ht,x as gt,z as da,a6 as Kt,J as ua,A as Ne,y as ma,av as fa,B as pa,E as xa,F as ha,aw as Ye,ax as Te,ay as J,a2 as Vt,az as ga,aA as va,aB as ya,aa as ba,aC as ja,aD as Na,ab as Sa,aE as wa,aF as Ca,aG as Aa,af as ka,I as _a,K as Pa,C as Ia,a as Ea,b as Oa}from"./chart-D9IwJUjP.js";import{L as ke}from"./label-iPw5smAw.js";import{B as Da}from"./badge-CAg946Xk.js";import{a as La,T as He,b as qe,c as Ta}from"./tabs-CkPDQzeX.js";import{i as za}from"./AlertCircle-De9oqjty.js";import{s as Yt}from"./Plus-CT_Gcwl2.js";import{u as Ae,a as dt,K as $a}from"./constants-XtX-WKGm.js";import{b as Ma}from"./use-connection-DmR852Js.js";import{b as oe,a as Ht}from"./use-mcp-tools-BXmfFmar.js";import{u as Ba}from"./use-members-B-Cx3SpJ.js";import{c as Ga,A as Wa}from"./use-binding-BfjFWpEn.js";import{a as qt,d as _e,g as Fa,A as vt,D as Ra,b as Ua,C as Ka,X as Va}from"./XAxis-Du5m1KMx.js";import"./useQuery-D2ShO4od.js";import"./use-local-storage-CxC8ozOe.js";import"./EyeOff-9_-SJWcU.js";import"./Eye-JuDcZhJz.js";import"./Key01-DAjAUWfr.js";import"./Trash01-YPQczxci.js";import"./card-RQxLVCBk.js";import"./popover-CF3EN_0o.js";import"./use-llm-BkLbMZPM.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-zjV4p_E5.js";import"./ChevronUp-1s_S3eDF.js";import"./ChevronDown-BHMaRWRt.js";import"./Upload01-BlEN4mwB.js";import"./Container-DwxLlgWA.js";import"./use-install-from-registry-_FQYQGQx.js";import"./extract-connection-data-CS_Bn7Ri.js";import"./constants-B4Swgi3d.js";import"./registry-utils-Cd3t_Kmp.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BNn4YU_K.js";import"./index-Cn8BPdHZ.js";import"./use-collections-DSWhP4jg.js";import"./binder-DTBFGqjl.js";const Xt=({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"}));Xt.displayName="Bell01";function Ya(t){const e=O.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(Cs,{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 x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.general",label:"General",icon:s.jsx(ws,{size:14})},e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.plugins",label:"Features",icon:s.jsx(As,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(bs,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[x,p,g,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[12]=y):y=e[12];const w=y;let j;e[13]===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:"Account"}),e[13]=j):j=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:[j,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 S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=S):S=e[18];let N;e[19]!==r||e[20]!==a?(N=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[S,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]=N):N=e[21];let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.175.1"]})}),e[22]=A):A=e[22];let k;return e[23]!==b||e[24]!==N?(k=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,N,A]}),e[23]=b,e[24]=N,e[25]=k):k=e[25],k}function Ha(){const t=O.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 x;t[8]!==h?(x=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=x):x=t[9];let p;t[10]!==f||t[11]!==x?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,x]}),t[10]=f,t[11]=x,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,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 j=l?.id;let b;t[18]!==j?(b=s.jsx("span",{className:"font-mono text-sm",children:j}),t[18]=j,t[19]=b):b=t[19];let S;t[20]!==r?(S=r?s.jsx(Es,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Os,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=S):S=t[21];let N;t[22]!==o||t[23]!==b||t[24]!==S?(N=s.jsx(ks,{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,S]})}),t[22]=o,t[23]=b,t[24]=S,t[25]=N):N=t[25];let A;t[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(_s,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=A):A=t[26];let k;t[27]!==N?(k=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(Ps,{children:s.jsxs(Is,{children:[N,A]})})]})]}),t[27]=N,t[28]=k):k=t[28];let C;return t[29]!==k||t[30]!==g?(C=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,k]}),t[29]=k,t[30]=g,t[31]=C):C=t[31],C}function Oe(t){const e=O.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?S=>{(S.key==="Enter"||S.key===" ")&&(S.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 x;e[5]!==r?(x=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=x):x=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=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]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let w;e[14]!==y||e[15]!==x?(w=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[x,y]}),e[14]=y,e[15]=x,e[16]=w):w=e[16];let j;e[17]!==n?(j=s.jsx("div",{onClick:qa,className:"shrink-0",children:n}),e[17]=n,e[18]=j):j=e[18];let b;return e[19]!==d||e[20]!==w||e[21]!==j||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,j]}),e[19]=d,e[20]=w,e[21]=j,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=O.c(47),[e,r]=js();let a;t[0]!==r?(a=async _=>{if(_&&await Notification.requestPermission()!=="granted"){Je.error("Notifications denied. Please enable them in your browser settings."),r(Ja);return}r(E=>({...E,enableNotifications:_}))},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(zs,{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=_=>r(E=>({...E,devMode:_})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(De,{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(Oe,{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(Xt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(Oe,{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(De,{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(zt,{size:16}),t[18]=h):h=t[18];let x;t[19]!==r?(x=()=>r(Xa),t[19]=r,t[20]=x):x=t[20];let p;t[21]!==r?(p=_=>r(E=>({...E,experimentalAutomations:_})),t[21]=r,t[22]=p):p=t[22];let g;t[23]!==e.experimentalAutomations||t[24]!==p?(g=s.jsx(De,{checked:e.experimentalAutomations,onCheckedChange:p}),t[23]=e.experimentalAutomations,t[24]=p,t[25]=g):g=t[25];let y;t[26]!==x||t[27]!==g?(y=s.jsx(Oe,{icon:h,label:"Experimental: Automations",description:"Enable the Automations feature in the sidebar. This is an experimental feature under active development.",onClick:x,control:g}),t[26]=x,t[27]=g,t[28]=y):y=t[28];let w;t[29]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx($s,{size:16}),t[29]=w):w=t[29];let j;t[30]!==r?(j=_=>r(E=>({...E,toolApprovalLevel:_})),t[30]=r,t[31]=j):j=t[31];let b;t[32]===Symbol.for("react.memo_cache_sentinel")?(b={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[32]=b):b=t[32];const S=b[e.toolApprovalLevel];let N;t[33]!==S?(N=s.jsx(Ls,{className:"w-36",children:s.jsx("span",{children:S})}),t[33]=S,t[34]=N):N=t[34];let A;t[35]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(We,{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[35]=A):A=t[35];let k;t[36]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(We,{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[36]=k):k=t[36];let C;t[37]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs(Ts,{children:[A,k,s.jsx(We,{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[37]=C):C=t[37];let P;t[38]!==e.toolApprovalLevel||t[39]!==j||t[40]!==N?(P=s.jsx(Oe,{icon:w,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ds,{value:e.toolApprovalLevel,onValueChange:j,children:[N,C]})}),t[38]=e.toolApprovalLevel,t[39]=j,t[40]=N,t[41]=P):P=t[41];let D;return t[42]!==y||t[43]!==P||t[44]!==c||t[45]!==f?(D=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,y,P]})]}),t[42]=y,t[43]=P,t[44]=c,t[45]=f,t[46]=D):D=t[46],D}function Xa(t){return{...t,experimentalAutomations:!t.experimentalAutomations}}function Qa(t){return{...t,devMode:!t.devMode}}function Ja(t){return{...t,enableNotifications:!1}}const Za=ms({name:Ge().min(1,"Name is required").max(255,"Name is too long"),slug:Ge().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:Ge().optional()});function er(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=fs({resolver:ps(Za),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Ms({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)}),Je.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=>{Je.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(Bs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:i.control,name:"name",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Slug"}),s.jsx(Ke,{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(Gs,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(Ws,{value:c.value,onChange:c.onChange,name:i.watch("name"),disabled:l})}),s.jsx(Ve,{})]})}),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 tr(){const t=O.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(er,{})]}),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++]))}},sr=["x1","y1","x2","y2","key"],ar=["offset"],rr=["xAxisId","yAxisId"],lr=["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){nr(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 nr(t,e,r){return(e=ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ir(t){var e=or(t,"string");return typeof e=="symbol"?e:e+""}function or(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 ze(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}var dr=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=ze(r,sr),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,h=ze(u,ar);a=v.createElement("line",pe({},h,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function ur(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=ze(t,rr),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 mr(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=ze(t,lr),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 fr(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],x=h==null,p=x?l+i-u:h-u;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:p,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 pr(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],x=h==null,p=x?l+i-u:h-u;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:p,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 xr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Bt(qt(Z(Z(Z({},_e),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},hr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Bt(qt(Z(Z(Z({},_e),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},gr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Jt(t){var e=Rs(),r=Us(),a=Ks(),l=Z(Z({},lt(t,gr)),{},{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,x=Me(),p=fe(C=>ft(C,"xAxis",n,x)),g=fe(C=>ft(C,"yAxis",i,x));if(!pt(m)||!pt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||xr,w=l.horizontalCoordinatesGenerator||hr,{horizontalPoints:j,verticalPoints:b}=l;if((!j||!j.length)&&typeof w=="function"){var S=f&&f.length,N=w({yAxis:g?Z(Z({},g),{},{ticks:S?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},S?!0:u);bt(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}if((!b||!b.length)&&typeof y=="function"){var A=h&&h.length,k=y({xAxis:p?Z(Z({},p),{},{ticks:A?h:p.ticks}):void 0,width:e??m,height:r??c,offset:a},A?!0:u);bt(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(b=k)}return v.createElement(Mt,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(dr,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(fr,pe({},l,{horizontalPoints:j})),v.createElement(pr,pe({},l,{verticalPoints:b})),v.createElement(ur,pe({},l,{offset:a,horizontalPoints:j,xAxis:p,yAxis:g})),v.createElement(mr,pe({},l,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Jt.displayName="CartesianGrid";var Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ss=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),vr=Be([it,Zt,ts,es,ss],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),yr=(t,e)=>e,as=Be([qs,yr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),rs=t=>{var e=it(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},br=(t,e)=>{var r=rs(t);return r==="yAxis"?ct(t,e):ot(t,e)},jr=(t,e,r)=>Xs(t,rs(t),br(t,e),r),Nr=Be([as,jr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Hs(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]])}}}),Sr=Be([it,Zt,ts,es,ss,Nr,Vs,vr,as,Ys],(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,x;if(h&&h.length>0?x=h:x=c?.slice(u,f+1),x!=null)return Rr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:x,chartBaseValue:m,bandSize:o})}}),wr=["id"],Cr=["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 ls(t,e){if(t==null)return{};var r,a,l=Ar(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 Ar(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=_r(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _r(t){var e=Pr(t,"string");return typeof e=="symbol"?e:e+""}function Pr(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 $e(t,e){return t&&t!=="none"?t:e}var Ir=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:$e(a,l),value:Ut(r,e),payload:t}]},Er=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:aa,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Ut(i,e),hide:o,type:m,color:$e(a,n),unit:d,graphicalItemId:c}};return v.createElement(sa,{tooltipEntrySettings:u})});function Or(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(Ra,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Dr(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=ls(n,wr),h=nt(f),x=ha(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Le,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ye,xe({},x,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Or,{points:e,props:f,clipPathId:l}))}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.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(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 Tr(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(!Te(o)||!Te(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 zr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Lr,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Tr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function $r(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,x=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),p=da(x,"recharts-area-"),g=Kt(),[y,w]=v.useState(!1),j=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),w(!1)},[h]),S=v.useCallback(()=>{typeof f=="function"&&f(),w(!0)},[f]);if(g==null)return null;var N=l.current,A=n.current;return v.createElement(Dr,{showLabels:j,points:i},a.children,v.createElement(ua,{animationId:p,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:S,key:p},k=>{if(N){var C=N.length/i.length,P=k===1?i:i.map((_,E)=>{var T=Math.floor(E*C);if(N[T]){var L=N[T];return Se(Se({},_),{},{x:Ne(L.x,_.x,k),y:Ne(L.y,_.y,k)})}return _}),D;return ie(o)?D=Ne(A,o,k):ma(o)||fa(o)?D=Ne(A,0,k):D=o.map((_,E)=>{var T=Math.floor(E*C);if(Array.isArray(A)&&A[T]){var L=A[T];return Se(Se({},_),{},{x:Ne(L.x,_.x,k),y:Ne(L.y,_.y,k)})}return _}),k>0&&(l.current=P,n.current=D),v.createElement(St,{points:P,baseLine:D,needClip:e,clipPathId:r,props:a})}return k>0&&(l.current=i,n.current=o),v.createElement(Le,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(zr,{alpha:k,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Le,{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 Mr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement($r,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class Br 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:x}=this.props;if(e)return null;var p=Pt("recharts-area",l),g=f,{r:y,strokeWidth:w}=Fa(r),j=oa(r),b=y*2+w,S=o?"url(#clipPath-".concat(j?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:x},v.createElement(Le,{className:p},o&&v.createElement("defs",null,v.createElement(ca,{clipPathId:g,xAxisId:d,yAxisId:m}),!j&&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(Mr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(vt,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(h)&&v.createElement(vt,{points:h,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}}var Gr={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:$t.area};function Wr(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:x,yAxisId:p}=t,g=ls(t,Cr),y=ra(),w=la(),{needClip:j}=na(x,p),b=Me(),{points:S,isRange:N,baseLine:A}=(e=fe(E=>Sr(E,t.id,b)))!==null&&e!==void 0?e:{},k=ia();if(y!=="horizontal"&&y!=="vertical"||k==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:C,width:P,x:D,y:_}=k;return!S||!S.length?null:v.createElement(Br,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:A,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:C,hide:c,layout:y,isAnimationActive:u,isRange:N,legendType:f,needClip:j,points:S,stroke:h,width:P,left:D,top:_,xAxisId:x,yAxisId:p}))}var Fr=(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 Rr(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,x=l&&l.length,p=Fr(n,i,r,o,d),g=n==="horizontal",y=!1,w=m.map((b,S)=>{var N,A,k,C;if(x)C=l[c+S];else{var P=ht(b,a);Array.isArray(P)?(C=P,y=!0):C=[p,P]}var D=(N=(A=C)===null||A===void 0?void 0:A[1])!==null&&N!==void 0?N:null,_=D==null||x&&!e&&ht(b,a)==null;if(g){var E;return{x:gt({axis:o,ticks:u,bandSize:h,entry:b,index:S}),y:_?null:(E=d.scale.map(D))!==null&&E!==void 0?E:null,value:C,payload:b}}return{x:_?null:(k=o.scale.map(D))!==null&&k!==void 0?k:null,y:gt({axis:d,ticks:f,bandSize:h,entry:b,index:S}),value:C,payload:b}}),j;return x||y?j=w.map(b=>{var S,N=Array.isArray(b.value)?b.value[0]:null;if(g){var A;return{x:b.x,y:N!=null&&b.y!=null&&(A=d.scale.map(N))!==null&&A!==void 0?A:null,payload:b.payload}}return{x:N!=null&&(S=o.scale.map(N))!==null&&S!==void 0?S:null,y:b.y,payload:b.payload}}):j=g?d.scale.map(p):o.scale.map(p),{points:w,baseLine:j??0,isRange:y}}function Ur(t){var e=lt(t,Gr),r=Me();return v.createElement(Js,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Zs,{legendPayload:Ir(e)}),v.createElement(Er,{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(ea,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:ta(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Wr,xe({},e,{id:a}))))}var ns=v.memo(Ur,Qs);ns.displayName="Area";var Kr=["type"],Vr=["dangerouslySetInnerHTML","ticks","scale"],Yr=["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){Hr(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 Hr(t,e,r){return(e=qr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qr(t){var e=Xr(t,"string");return typeof e=="symbol"?e:e+""}function Xr(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 Jr(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,n=tt(t,Kr),i=ka(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(ga(o)):r.current!==o&&e(va({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ya(r.current)),r.current=null)},[e]),null}function Zr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(ba),d=Me(),m=Vt(),c="yAxis",u=fe(N=>ja(N,e)),f=fe(N=>Na(N,e)),h=fe(N=>Sa(N,c,e,d)),x=fe(N=>wa(N,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Ca(l)||v.isValidElement(l)||x==null)){var N=n.current;if(N){var A=N.getCalculatedWidth();Math.round(u.width)!==Math.round(A)&&m(Aa({id:e,width:A}))}}},[h,u,m,l,e,a,x]),u==null||f==null||x==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,w=tt(t,Vr),{id:j,scale:b}=x,S=tt(x,Yr);return v.createElement(Ka,et({},w,S,{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 el={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:_e.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:_e.tickLine,tickSize:_e.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},tl=t=>{var e=lt(t,el);return v.createElement(v.Fragment,null,v.createElement(Jr,{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(Zr,e))},is=v.memo(tl,Ua);is.displayName="YAxis";var sl=["axis"],al=v.forwardRef((t,e)=>v.createElement(_a,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sl,tooltipPayloadSearcher:Pa,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 os="gateway-chip-period";function rl(){try{const t=localStorage.getItem(os);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function ll(t){try{localStorage.setItem(os,t)}catch{}}const nl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},il={daily:"daily",weekly:"weekly",monthly:"monthly"},ol=[5,10,25,50,100],cl=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function dl(t){const e=O.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,x]=v.useState(null),[p,g]=v.useState(null),[y,w]=v.useState(o??"none");let j;e[0]!==l||e[1]!==d.id?(j={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=j):j=e[2];const b=Ae(j);let S;e[3]!==b?(S={client:b},e[3]=b,e[4]=S):S=e[4];const{mutate:N,isPending:A}=Ht(S),k=_t(),C=i==="postpaid";let P;e[5]!==u?(P=u?Number.parseFloat(u):null,e[5]=u,e[6]=P):P=e[6];const _=m??P,E=y==="none"?null:y,T=C&&_!=null&&_===n&&E===o;let L;e[7]!==b?(L=$a.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=L):L=e[8];const G=L;let V;e[9]!==G||e[10]!==k?(V=async()=>{await k.invalidateQueries({queryKey:G,exact:!0}),await k.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=k,e[11]=V):V=e[11];const R=V;let z,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==C||e[17]!==y||e[18]!==N||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),N({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?x(te.checkout_url):z()},onError:re=>{g(re.message??"Failed to update limit.")}})},z=()=>{c(null),f(""),x(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]=N,e[19]=a,e[20]=R,e[21]=z,e[22]=$):(z=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(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(vs,{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]!==p||e[37]!==$||e[38]!==A||e[39]!==C||e[40]!==T||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(ke,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:ol.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(ke,{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(ke,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:cl.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)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),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:A||!_||_<=0||T,className:"gap-2",children:A?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=p,e[37]=$,e[38]=A,e[39]=C,e[40]=T,e[41]=y,e[42]=m,e[43]=F):F=e[43];let X;e[44]!==W||e[45]!==F?(X=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=X):X=e[46];let se;return e[47]!==z||e[48]!==r||e[49]!==X?(se=s.jsx(Lt,{open:r,onOpenChange:z,children:X}),e[47]=z,e[48]=r,e[49]=X,e[50]=se):se=e[50],se}function ul(t){const e=O.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 x;e[12]!==r.resetsBeforeDepletion?(x=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]=x):x=e[13];const p=nl[r.confidence];let g;e[14]!==p?(g=s.jsx(Da,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==h||e[20]!==x?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,h,x,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=h,e[20]=x,e[21]=y):y=e[21],y}function ml(t){const e=O.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 x;e[9]!==d||e[10]!==a.total||e[11]!==l?(x=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(zt,{size:10}),il[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=x):x=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==h||e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,h,x,p]}),e[15]=h,e[16]=x,e[17]=p,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 j;e[20]!==n||e[21]!==w?(j=s.jsxs(de,{onClick:n,variant:"outline",className:"gap-2",children:[y,w]}),e[20]=n,e[21]=w,e[22]=j):j=e[22];let b;e[23]!==j||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25];let S;e[26]!==d||e[27]!==a.reset||e[28]!==c?(S=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]=S):S=e[29];let N;e[30]!==o||e[31]!==i?(N=s.jsx(cs,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=N):N=e[32];let A;return e[33]!==b||e[34]!==S||e[35]!==N?(A=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,S,N]}),e[33]=b,e[34]=S,e[35]=N,e[36]=A):A=e[36],A}function fl(t){const e=O.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 x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{size:16}),e[10]=x):x=e[10];let p;e[11]!==n?(p=s.jsxs(de,{onClick:n,className:"gap-2 px-5",children:[x,"Add Credit"]}),e[11]=n,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,p]}),e[13]=h,e[14]=p,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(ul,{estimation:l}),e[20]=l,e[21]=w):w=e[21];let j;e[22]!==o||e[23]!==i?(j=s.jsx(cs,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=j):j=e[24];let b;return e[25]!==w||e[26]!==j||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,j]}),e[25]=w,e[26]=j,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function cs(t){const e=O.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??""),[x,p]=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 j=Ae(w);let b;e[3]!==j?(b={client:j},e[3]=j,e[4]=b):b=e[4];const{mutate:S,isPending:N}=Ht(b),A=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let k;e[5]!==f||e[6]!==d||e[7]!==S||e[8]!==c?(k=()=>{y(null),p(!1);const Q=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(Q)||Q<=0){y("Threshold must be a positive number.");return}S({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:Q,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=S,e[8]=c,e[9]=k):k=e[9];const C=k,P=l==="postpaid"?"Usage Alert":"Low-Balance Alert",D=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>o(!0),e[10]=Q):Q=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(za,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==P?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:P}),e[12]=P,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:Q,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]!==P?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:P}),e[28]=P,e[29]=_):_=e[29];let E;e[30]!==D?(E=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:D}),e[30]=D,e[31]=E):E=e[31];let T;e[32]!==_||e[33]!==E?(T=s.jsxs("div",{children:[_,E]}),e[32]=_,e[33]=E,e[34]=T):T=e[34];let L;e[35]!==d?(L=s.jsx(De,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=L):L=e[36];let G;e[37]!==T||e[38]!==L?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[T,L]}),e[37]=T,e[38]=L,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 z=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==z?($=s.jsx(ke,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:z}),e[42]=z,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=Q=>u(Q.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(ke,{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=Q=>h(Q.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 X;e[58]!==g?(X=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=X):X=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==X?(se=s.jsxs("div",{className:R,children:[F,X]}),e[60]=R,e[61]=F,e[62]=X,e[63]=se):se=e[63];let B;e[64]!==x?(B=x&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=x,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=N||!A,te=N?"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 I;return e[74]!==se||e[75]!==ce||e[76]!==G?(I=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]=I):I=e[77],I}const pl={cost:{label:"Cost",color:"var(--chart-1)"}};function xl(){const t=O.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=Ae(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 x;t[13]!==o||t[14]!==h?(x={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=x):x=t[15];const{data:p}=oe(x);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:j}=oe(w);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let S;t[24]!==b?(S=b.map(jl),t[24]=b,t[25]=S):S=t[25];const N=S;let A;if(t[26]!==p?.value||t[27]!==N||t[28]!==j?.groups||t[29]!==u?.timeseries||t[30]!==r){const k=(u?.timeseries??[]).reduce(bl,0),C=p?.value??0,P=(j?.groups??[]).filter(yl).sort(vl).slice(0,5),D=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 E=K(k);let T;t[33]!==E?(T=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:E}),t[33]=E,t[34]=T):T=t[34];let L;t[35]!==D?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:D}),t[35]=D,t[36]=L):L=t[36];let G;t[37]!==T||t[38]!==L?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[T,L]}),t[37]=T,t[38]=L,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 z;t[44]!==G||t[45]!==R?(z=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,R]}),t[44]=G,t[45]=R,t[46]=z):z=t[46];let $;t[47]!==r?($=s.jsx(ds,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==z||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[z,$]}),t[49]=z,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==N?(H=N.length>0?s.jsx(Ia,{config:pl,className:"h-[200px] w-full",children:s.jsxs(al,{data:N,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(Jt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Va,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(is,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:gl}),s.jsx(Ea,{content:s.jsx(Oa,{formatter:hl})}),s.jsx(ns,{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]=N,t[53]=H):H=t[53],A=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,P.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:P.map((M,U)=>{const q=k>0?Math.min(M.value/k*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]=p?.value,t[27]=N,t[28]=j?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=A}else A=t[31];return A}function hl(t){return K(t)}function gl(t){return`$${t}`}function vl(t,e){return e.value-t.value}function yl(t){return t.value>0}function bl(t,e){return t+e.value}function jl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function Nl(){const t=O.c(6),[e,r]=v.useState(rl);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),ll(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 Xe(t){const e=O.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 x;e[6]!==h?(x={width:h},e[6]=h,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==x?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:x})}),e[8]=f,e[9]=x,e[10]=p):p=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]!==p||e[17]!==g||e[18]!==y?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[u,p,g,y]}),e[15]=u,e[16]=p,e[17]=g,e[18]=y,e[19]=w):w=e[19],w}function Qe(t){const e=O.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 At={"7d":"7 days","30d":"30 days","90d":"90 days"};function ds(t){const e=O.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(At),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:At[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function kt(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 Sl(){const t=O.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Ba(),i=n?.data?.members??[],o=new Map(i.map(Pl));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=Ae(d),c=I=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:I.fn,...I.groupByColumn&&{groupByColumn:I.groupByColumn},...I.limit&&{limit:I.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:x}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:p,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:j,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let S;t[2]===Symbol.for("react.memo_cache_sentinel")?(S={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=S):S=t[2];const{data:N,isLoading:A}=oe(c(S));if(f||x||g||w||b||A){let I;t[3]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-8 w-48"}),t[3]=I):I=t[3];let Q;return t[4]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("div",{className:"flex flex-col gap-4",children:[I,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(_l)})]}),t[4]=Q):Q=t[4],Q}const C=kt(u?.groups??[],h?.groups??[]),P=kt(p?.groups??[],y?.groups??[]).map(I=>({...I,key:o.get(I.key)??I.key})),D=N?.groups??[],_=new Map((j?.groups??[]).map(kl)),E=D.map(I=>({name:I.key,calls:I.value,cost:_.get(I.key)??0})).sort(Al).slice(0,20),T=C.reduce(Cl,0),L=C.reduce(wl,0),G=C[0]?.cost??1,V=P[0]?.cost??1,R=E[0]?.calls??1;let z;t[5]!==r?(z=s.jsx(ds,{period:r,onPeriodChange:a}),t[5]=r,t[6]=z):z=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=C.length===0,H=C.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},I.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=P.length===0,ee=P.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},I.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 X=Qe,se="Top Tools",B=E.length===0,ae="space-y-2.5",re=E.slice(0,8).map(I=>s.jsx(Xe,{label:I.name,value:I.calls.toLocaleString(),subValue:I.cost>0?K(I.cost):void 0,maxValue:R,color:"bg-chart-3"},I.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]!==X||t[20]!==B||t[21]!==te?(le=s.jsx(X,{title:se,empty:B,children:te}),t[19]=X,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(T)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:L.toLocaleString()})]})]}),z]}),ce]})}function wl(t,e){return t+e.calls}function Cl(t,e){return t+e.cost}function Al(t,e){return e.calls-t.calls}function kl(t){return[t.key,t.value]}function _l(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Pl(t){return[t.userId,t.user.name??t.user.email]}function Il(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 El(){const t=O.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=Ae(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 S;return t[9]===Symbol.for("react.memo_cache_sentinel")?(S=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]=S):S=t[9],S}let x,p,g,y,w;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const S=Il(d?.timeseries??[],f?.timeseries??[]);w="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=x):x=t[17],p="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=S.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:S.map(Ol)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=x,t[13]=p,t[14]=g,t[15]=y,t[16]=w}else x=t[12],p=t[13],g=t[14],y=t[15],w=t[16];let j;t[19]!==p||t[20]!==g||t[21]!==y?(j=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=j):j=t[22];let b;return t[23]!==x||t[24]!==j||t[25]!==w?(b=s.jsxs("div",{className:w,children:[x,j]}),t[23]=x,t[24]=j,t[25]=w,t[26]=b):b=t[26],b}function Ol(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 Dl(t){const e=O.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=Ae(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:Ll},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let P;return e[6]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=P):P=e[6],P}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,x=c.usage,p=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 j=w,b=c.limit,S=p==="postpaid"&&(h==null||h===0);let N;e[9]!==j||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==x?(N=p==="postpaid"?s.jsx(ml,{usage:x,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:j}):s.jsx(fl,{available:f,total:h,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:j}),e[9]=j,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=x,e[18]=N):N=e[18];let A;e[19]!==S?(A=S&&s.jsx(Nl,{}),e[19]=S,e[20]=A):A=e[20];let k;e[21]!==p||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(k=s.jsx(dl,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:h,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=k):k=e[26];let C;return e[27]!==N||e[28]!==A||e[29]!==k?(C=s.jsxs(s.Fragment,{children:[N,A,k]}),e[27]=N,e[28]=A,e[29]=k,e[30]=C):C=e[30],C}function Ll(t){return t.structuredContent}function Tl(t){const e=O.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(La,{variant:"underline",children:[s.jsx(He,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(He,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(He,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(Dl,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(xl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(qe,{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(Sl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(qe,{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(El,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(qe,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==h?(x=s.jsxs(s.Fragment,{children:[n,s.jsxs(Ta,{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]=x):x=e[19],x}function zl(){const t=O.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 $l(){const t=O.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 Ml 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($l,{}):this.props.children}}function Bl(){const t=O.c(4),e=Ma();let r;t[0]!==e?(r=e.find(Gl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Tl,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Gl(t){return Ga(t,Wa)}function Wl(){const t=O.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(Ml,{children:s.jsx(v.Suspense,{fallback:s.jsx(zl,{}),children:s.jsx(Bl,{})})})}),t[0]=e):e=t[0],e}function us(){const t=O.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 Fl(t){const e=O.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(us,{}),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 Rl(t){const e=O.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(tr,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fl,{projectSlug:Ie,children:s.jsx(Fs,{})}),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(Ss,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Wl,{}),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 Ul(){const t=O.c(24),{isOpen:e,activeSection:r,open:a,close:l}=Ns();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(ys,{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(us,{}),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(Rl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let x;t[14]!==u||t[15]!==h?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[u,h]}),t[14]=u,t[15]=h,t[16]=x):x=t[16];let p;t[17]!==d||t[18]!==x?(p=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,x]})]}),t[17]=d,t[18]=x,t[19]=p):p=t[19];let g;return t[20]!==e||t[21]!==n||t[22]!==p?(g=s.jsx(Lt,{open:e,onOpenChange:n,children:p}),t[20]=e,t[21]=n,t[22]=p,t[23]=g):g=t[23],g}function Kl(t){const e=O.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 Vl(t){const e=O.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 Yl(){const t=O.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ze,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==l||t[4]!==n?(p=s.jsx(Kl,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=p):p=t[5],p}if(!i){let p;return t[6]!==l||t[7]!==n?(p=s.jsx(Vl,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=p):p=t[8],p}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(Ze,{}),children:s.jsx(hs,{})}),h=s.jsx(Ul,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let x;return t[20]!==u||t[21]!==a?(x=s.jsxs(It,{org:a,project:u,children:[f,h]}),t[20]=u,t[21]=a,t[22]=x):x=t[22],x}function ti(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(Yl,{})}),t[0]=e):e=t[0],e}export{ti as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bi as G,c as O,u as H,y as J,j as s,J as M,r as I,e as V,B as R,O as U}from"./index-DsOJvxnb.js";import{a as q}from"./use-project-Bg5pX2Ab.js";import{P as D}from"./index-X4FDee1r.js";import{C as F}from"./collection-search-62vwaqdq.js";import{A as K}from"./avatar-OE2URZfM.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-D4GX29pL.js";import{C as W}from"./create-project-dialog-BV-JjiBR.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-aP02JuZO.js";import"./useQuery-D2ShO4od.js";import"./constants-XtX-WKGm.js";import"./use-local-storage-CxC8ozOe.js";import"./useMutation-B_cFG709.js";import"./tooltip-XyKE4lZa.js";import"./index-zjV4p_E5.js";import"./Loading01-BNn4YU_K.js";import"./SearchMd-BLeX5weN.js";import"./input-CUT8DBv1.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-_XYw8lZC.js";import"./X-B_f76BPZ.js";import"./form-BN7_f2uj.js";import"./label-iPw5smAw.js";import"./textarea-CTzX43MZ.js";import"./Check-BfKCyKXX.js";import"./ChevronRight-1g9z-Z5h.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=J("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(M,{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}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=V();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(F,{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,3 +0,0 @@
|
|
|
1
|
-
import{r as P,c as z,j as s,E as Qe,u as ze,y as I,e as Ze,au as Xe,L as We,ch as _t,bj as kt,O as Q,as as Ct,U as wt,_ as $t,g as it,f as Se,w as Ne,ci as zt,bN as It,x as Pt,B as Ge,A as At,S as nt,k as Et,m as Ot,N as Tt,v as Mt,aw as Be,K as Dt,av as lt,P as Rt}from"./index-DsOJvxnb.js";import{C as ie,c as Lt,i as Ut,d as Ht}from"./task-status-wkv2GdSY.js";import{I as Bt}from"./integration-icon-CVxvM4fR.js";import{u as ot,P as je}from"./index-X4FDee1r.js";import{d as Ft,u as Wt}from"./constants-XtX-WKGm.js";import{n as Ke}from"./CheckDone01-ZekLHdFZ.js";import{n as Gt}from"./ChevronLeft-0cpA2yNq.js";import{i as Kt}from"./Loading01-BNn4YU_K.js";import{s as Le}from"./Plus-CT_Gcwl2.js";import{t as Je}from"./Users03-B7X28dbt.js";import{i as tt}from"./X-B_f76BPZ.js";import{E as Vt,C as qt}from"./editable-task-title-B7Ktbs3r.js";import{T as Yt}from"./tasks-panel-TN0GeEUK.js";import{a as Qt}from"./use-llm-BkLbMZPM.js";import{a as Zt}from"./context-CtrnP3HC.js";import{C as rt}from"./create-project-dialog-BV-JjiBR.js";import{c as Xt,b as Jt,D as es,d as ts}from"./dialog-_XYw8lZC.js";import{n as ss}from"./Container-DwxLlgWA.js";import{e as is}from"./Dataflow03-T9TmjQN-.js";import{a as ns}from"./Home02-DfEb-Myv.js";import{i as Ve}from"./LayoutLeft-BvuIBX8d.js";import{s as ls}from"./RefreshCcw01-uL9q48A4.js";import{t as Ue}from"./Settings01-2AkYiqYr.js";import{u as os,a as at}from"./org-ai-providers-BDwPbfg4.js";import{u as ct,a as dt}from"./use-project-Bg5pX2Ab.js";import{u as rs}from"./use-mobile-O8KVzGuv.js";import{d as as,b as cs,S as ds,a as ms,c as fs}from"./sheet-BQuKOEiL.js";import{b as us,T as ps,a as xs,c as hs}from"./tooltip-XyKE4lZa.js";import{S as le}from"./skeleton-DJFpR-1P.js";import{n as $e}from"./LinkExternal01-QGWpvftd.js";import{t as mt}from"./ChevronDown-BHMaRWRt.js";import{A as Ie}from"./avatar-OE2URZfM.js";import{c as ne,f as gs,e as bs,b as ft,D as ut,a as pt,h as He,d as js}from"./dropdown-menu-DzFMEBVS.js";import{t as vs,i as ys}from"./Coins01-D7lfLTbO.js";import{i as Pe}from"./Check-BfKCyKXX.js";import{C as Ns}from"./create-organization-dialog-DlsDrfHE.js";import{a as Ss}from"./Copy01-CIUDy0Hr.js";import{i as _s}from"./File06-CU5oU1OI.js";import{i as ks}from"./Globe01-DUjsFcPS.js";import{i as Cs}from"./Shield01-D6IOCC-Z.js";import{a as ws,P as $s,b as zs}from"./popover-CF3EN_0o.js";import{n as st}from"./Inbox01-BgDmihAV.js";import{s as Is}from"./XClose-eeK1fS1n.js";import{b as Ps}from"./use-connection-DmR852Js.js";import{b as As}from"./use-mcp-tools-BXmfFmar.js";import{c as Es,A as Os}from"./use-binding-BfjFWpEn.js";import{C as Ts,b as Ms,c as Ds}from"./collapsible-CGr-TiAc.js";import{i as Rs}from"./ChevronRight-1g9z-Z5h.js";import{u as et}from"./use-local-storage-CxC8ozOe.js";import{a as Ls,R as xt,b as Us}from"./resizable-D4LJctEl.js";import"./spinner-CqAVfcvO.js";import"./use-mcp-prompts-C-XU_-dc.js";import"./useQuery-D2ShO4od.js";import"./form-BN7_f2uj.js";import"./label-iPw5smAw.js";import"./input-CUT8DBv1.js";import"./index-CuSj4QrF.js";import"./usage-B8rgFVXq.js";import"./ArrowUp-C6Q-EpUw.js";import"./Edit01-Dw-lPBk-.js";import"./Lock01-DJQX15kR.js";import"./XCircle-DDLf4PgL.js";import"./AlertCircle-De9oqjty.js";import"./select-DRPG5csU.js";import"./ChevronUp-1s_S3eDF.js";import"./index-zjV4p_E5.js";import"./ArrowLeft-CPWCs_Od.js";import"./use-copy-dSR0w-bG.js";import"./tabs-CkPDQzeX.js";import"./badge-CAg946Xk.js";import"./Code01-CoTQP8pZ.js";import"./checkbox-DLsMmmhu.js";import"./AlignLeft-BaG4OcCg.js";import"./Image01-I9pAeT0N.js";import"./Key01-DAjAUWfr.js";import"./SearchMd-BLeX5weN.js";import"./Tool01-CjSIsyxE.js";import"./ai-providers-logos-W57Qm-EN.js";import"./select-virtual-mcp-B8NgSgPI.js";import"./use-virtual-mcp-C9XdHCA_.js";import"./use-collections-DSWhP4jg.js";import"./useMutation-B_cFG709.js";import"./use-create-virtual-mcp-DXWAjide.js";import"./use-mcp-resources-Bxkx1Ub1.js";import"./marked.esm-BaswSlok.js";import"./markdown-CKKBcXcE.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-IX_OR3wW.js";import"./types-B3niHy47.js";import"./Eye-JuDcZhJz.js";import"./Globe02-k3_A41kp.js";import"./LayersTwo01-C-XZtFtv.js";import"./Clock-rHd8cQAO.js";import"./Trash01-YPQczxci.js";import"./useSuspenseInfiniteQuery-CT40dICu.js";import"./infiniteQueryObserver-BE0Fq7u7.js";import"./CheckCircle-DiRi76qb.js";import"./collection-search-62vwaqdq.js";import"./user-rS26WEu1.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./decopilot-events-Brt4gAR6.js";import"./textarea-CTzX43MZ.js";import"./EyeOff-9_-SJWcU.js";import"./card-RQxLVCBk.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./alert-dialog-BVglQjyM.js";import"./binder-DTBFGqjl.js";import"./index-C-NLwTON.js";const ht=({size:t=24,color:e="currentColor",...i})=>P.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},P.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));ht.displayName="BarChart10";const gt=({size:t=24,color:e="currentColor",...i})=>P.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},P.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2m-1-5h.01M9 9h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-6.5-3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-6 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}));gt.displayName="FaceSmile";const bt=({size:t=24,color:e="currentColor",...i})=>P.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},P.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));bt.displayName="LogOut01";function Hs(){const t=z.c(70),{org:e}=ze(),[,i]=ot(),n=Qt(),{selectedVirtualMcp:l,isChatEmpty:o,activeTaskId:r,createTask:a,switchToTask:c,tasks:d}=Zt();let f;if(t[0]!==r||t[1]!==d){let D;t[3]!==r?(D=X=>X.id===r,t[3]=r,t[4]=D):D=t[4],f=d.find(D),t[0]=r,t[1]=d,t[2]=f}else f=t[2];const u=f,[m,x]=P.useState("chat"),[h,g]=P.useTransition();let j;t[5]!==e.id?(j=Ft(e.id),t[5]=e.id,t[6]=j):j=t[6];const b=l??j;let p;t[7]!==a?(p=()=>{g(()=>{a()})},t[7]=a,t[8]=p):p=t[8];const y=p;if(n?.providers?.length===0){let D;t[9]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(je.Header.Left,{className:"gap-2"}),t[9]=D):D=t[9];let X;t[10]!==i?(X=()=>i(!1),t[10]=i,t[11]=X):X=t[11];let ce;t[12]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(tt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=ce):ce=t[12];let se;t[13]!==X?(se=s.jsxs(je.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[D,s.jsx(je.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:X,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:ce})})]}),t[13]=X,t[14]=se):se=t[14];let fe;t[15]===Symbol.for("react.memo_cache_sentinel")?(fe=s.jsx(ie.Main,{className:"flex flex-col items-center",children:s.jsx(ie.EmptyState,{children:s.jsx(ie.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features."})})}),t[15]=fe):fe=t[15];let he;return t[16]!==se?(he=s.jsxs(ie,{className:"animate-in fade-in-0 duration-200",children:[se,fe]}),t[16]=se,t[17]=he):he=t[17],he}const k=m!=="chat"||h?"opacity-0 pointer-events-none":"opacity-100";let v;t[18]!==k?(v=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",k),t[18]=k,t[19]=v):v=t[19];let N;t[20]!==u||t[21]!==o?(N=!o&&u?.title&&s.jsx(Vt,{taskId:u.id,text:u.title,className:"text-sm font-medium text-foreground"}),t[20]=u,t[21]=o,t[22]=N):N=t[22];let w;t[23]!==N?(w=s.jsx(je.Header.Left,{className:"gap-2",children:N}),t[23]=N,t[24]=w):w=t[24];let $;t[25]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Le,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[25]=$):$=t[25];let S;t[26]!==y||t[27]!==h?(S=s.jsx("button",{type:"button",onClick:y,disabled:h,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:$}),t[26]=y,t[27]=h,t[28]=S):S=t[28];let A;t[29]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x("tasks"),t[29]=A):A=t[29];let O;t[30]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("button",{type:"button",onClick:A,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Tasks",children:s.jsx(Ke,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[30]=O):O=t[30];let T;t[31]!==i?(T=()=>i(!1),t[31]=i,t[32]=T):T=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(tt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=U):U=t[33];let R;t[34]!==T?(R=s.jsx("button",{type:"button",onClick:T,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:U}),t[34]=T,t[35]=R):R=t[35];let E;t[36]!==R||t[37]!==S?(E=s.jsxs(je.Header.Right,{className:"gap-1",children:[S,O,R]}),t[36]=R,t[37]=S,t[38]=E):E=t[38];let L;t[39]!==E||t[40]!==w?(L=s.jsxs(je.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[w,E]}),t[39]=E,t[40]=w,t[41]=L):L=t[41];let H;t[42]!==b||t[43]!==o?(H=s.jsx(ie.Main,{children:o?s.jsx(ie.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[s.jsx(Bt,{icon:b.icon,name:b.title,size:"lg",fallbackIcon:s.jsx(Je,{size:32}),className:"size-[60px]! rounded-[18px]!"}),s.jsx("h3",{className:"text-xl font-medium text-foreground",children:b.title}),s.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:b.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(ie.IceBreakers,{})]})}):s.jsx(ie.Messages,{})}),t[42]=b,t[43]=o,t[44]=H):H=t[44];let B;t[45]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ie.Footer,{children:s.jsx(ie.Input,{onOpenContextPanel:()=>x("context")})}),t[45]=B):B=t[45];let M;t[46]!==L||t[47]!==H||t[48]!==v?(M=s.jsxs("div",{className:v,children:[L,H,B]}),t[46]=L,t[47]=H,t[48]=v,t[49]=M):M=t[49];const W=m==="tasks"?"opacity-100":"opacity-0 pointer-events-none";let me;t[50]!==W?(me=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",W),t[50]=W,t[51]=me):me=t[51];let J;t[52]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(je.Header.Left,{className:"gap-2",children:s.jsx("span",{className:"text-sm font-normal text-foreground",children:"Tasks"})}),t[52]=J):J=t[52];let oe;t[53]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>x("chat"),t[53]=oe):oe=t[53];let re;t[54]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsxs(je.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[J,s.jsx(je.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:oe,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Back to chat",children:s.jsx(Gt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),t[54]=re):re=t[54];let ee;t[55]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Kt,{size:16,className:"animate-spin text-muted-foreground"})}),t[55]=ee):ee=t[55];let te;t[56]!==c?(te=s.jsx(Qe,{fallback:Bs,children:s.jsx(P.Suspense,{fallback:ee,children:s.jsx(Yt,{onTaskSelect:async D=>{await c(D),x("chat")}})})}),t[56]=c,t[57]=te):te=t[57];let F;t[58]!==me||t[59]!==te?(F=s.jsxs("div",{className:me,children:[re,te]}),t[58]=me,t[59]=te,t[60]=F):F=t[60];const Z=m==="context"?"opacity-100":"opacity-0 pointer-events-none";let K;t[61]!==Z?(K=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",Z),t[61]=Z,t[62]=K):K=t[62];let ae;t[63]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(qt,{back:!0,onClose:()=>x("chat")}),t[63]=ae):ae=t[63];let V;t[64]!==K?(V=s.jsx("div",{className:K,children:ae}),t[64]=K,t[65]=V):V=t[65];let q;return t[66]!==M||t[67]!==F||t[68]!==V?(q=s.jsxs(ie,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[M,F,V]}),t[66]=M,t[67]=F,t[68]=V,t[69]=q):q=t[69],q}function Bs(){return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Unable to load tasks"})})}function Fs(){const t=z.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie.Skeleton,{}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Qe,{fallback:e,children:s.jsx(P.Suspense,{fallback:s.jsx(ie.Skeleton,{}),children:s.jsx(Hs,{})})}),t[1]=i):i=t[1],i}function Ws(t){const e=z.c(5),{open:i,onOpenChange:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Jt,{children:s.jsx(es,{children:"Keyboard Shortcuts"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Xt,{className:"sm:max-w-md",children:[l,s.jsx("div",{className:"flex flex-col gap-4",children:Lt.map(Gs)})]}),e[1]=o):o=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx(ts,{open:i,onOpenChange:n,children:o}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Gs(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Ks)})]},t.label)}function Ks(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Vs)})]},t.description)}function Vs(t){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}function qs(){const t=z.c(58),{locator:e,org:i}=ze(),n=Ze(),l=Xe(),[o]=os(),{org:r,project:a}=We.parse(e),c=We.isOrgAdminProject(e),{data:d}=ct(i.id,a);let f;t[0]!==d?.enabledPlugins?(f=d?.enabledPlugins??[],t[0]=d?.enabledPlugins,t[1]=f):f=t[1];const u=f,m=d?.ui?.pinnedViews??[];let x;t[2]!==u?(x=C=>u.includes(C.pluginId),t[2]=u,t[3]=x):x=t[3];const h=_t.filter(x),g=l.location.pathname,j=`/${r}/${a}`,_=g===j||g===`${j}/`;let b;t[4]!==j||t[5]!==g?(b=C=>g.startsWith(`${j}/${C}`),t[4]=j,t[5]=g,t[6]=b):b=t[6];const p=b;let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ns,{}),t[7]=y):y=t[7];const k={key:"home",label:"Home",icon:y,isActive:_,onClick:()=>{_?window.dispatchEvent(new CustomEvent("reset-home-view")):n({to:"/$org/$project",params:{org:r,project:a}})}};let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{}),t[8]=v):v=t[8];const N={key:"tasks",label:"Tasks",icon:v,isActive:p("tasks"),onClick:()=>n({to:"/$org/$project/tasks",params:{org:r,project:Q}})};let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ss,{}),t[9]=w):w=t[9];const $={key:"mcps",label:"Connections",icon:w,isActive:p("mcps"),onClick:()=>n({to:"/$org/$project/mcps",params:{org:r,project:Q}})};let S;t[10]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ct,{}),t[10]=S):S=t[10];const A={key:"projects",label:"Projects",icon:S,isActive:p("projects"),onClick:()=>n({to:"/$org/$project/projects",params:{org:r,project:Q}})};let O;t[11]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Je,{}),t[11]=O):O=t[11];const T={key:"agents",label:"Agents",icon:O,isActive:p("agents"),onClick:()=>n({to:"/$org/$project/agents",params:{org:r,project:Q}})};let U;t[12]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(ls,{}),t[12]=U):U=t[12];const R={key:"automations",label:"Automations",icon:U,isActive:p("automations"),onClick:()=>n({to:"/$org/$project/automations",params:{org:r,project:Q}})};let E;t[13]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ht,{}),t[13]=E):E=t[13];const L={key:"monitoring",label:"Monitor",icon:E,isActive:p("monitoring"),onClick:()=>n({to:"/$org/$project/monitoring",params:{org:r,project:Q}})};let H;t[14]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(gt,{}),t[14]=H):H=t[14];const B={key:"members",label:"Members",icon:H,isActive:p("members"),onClick:()=>n({to:"/$org/$project/members",params:{org:r,project:Q}})},M=h.map(C=>({key:C.pluginId,label:C.label,icon:C.icon,isActive:p(C.pluginId),onClick:()=>n({to:"/$org/$project/$pluginId",params:{org:r,project:a,pluginId:C.pluginId}})}));let W;t[15]!==u?(W=C=>u.includes(C.pluginId),t[15]=u,t[16]=W):W=t[16];const J=kt.filter(W).map(C=>({type:"group",group:{id:`${C.pluginId}-${C.id}`,label:C.label,items:C.items.map((G,de)=>({key:`${C.pluginId}-${C.id}-${de}`,label:G.label,icon:G.icon,isActive:p(C.pluginId),onClick:()=>n({to:"/$org/$project/$pluginId",params:{org:r,project:a,pluginId:C.pluginId}})})),defaultExpanded:C.defaultExpanded??!0}})),oe=m.map(C=>({key:`app-${C.connectionId}-${C.toolName}`,label:C.label||C.toolName,icon:C.icon?s.jsx("img",{src:C.icon,alt:"",className:"size-4 rounded"}):s.jsx(Ve,{}),isActive:p(`apps/${C.connectionId}/${encodeURIComponent(C.toolName)}`),onClick:()=>n({to:"/$org/$project/apps/$connectionId/$toolName",params:{org:r,project:a,connectionId:C.connectionId,toolName:C.toolName}})}));let re;t[17]!==oe?(re=oe.length>0?{type:"group",group:{id:"apps",label:"Apps",items:oe,defaultExpanded:!0}}:null,t[17]=oe,t[18]=re):re=t[18];const ee=re;if(c){let C;t[19]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ue,{}),t[19]=C):C=t[19];let G;t[20]!==p?(G=p("settings"),t[20]=p,t[21]=G):G=t[21];let de;t[22]!==n||t[23]!==r?(de=()=>n({to:"/$org/$project/settings",params:{org:r,project:Q}}),t[22]=n,t[23]=r,t[24]=de):de=t[24];let ue;t[25]!==G||t[26]!==de?(ue={key:"settings",label:"Settings",icon:C,isActive:G,onClick:de},t[25]=G,t[26]=de,t[27]=ue):ue=t[27];const ye=ue,pe=[{type:"items",items:[k,N,A]},{type:"group",group:{id:"build",label:"Build",items:[...o.experimentalAutomations?[R]:[],T,$],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[L,B,ye],defaultExpanded:!0}}];if(M.length>0){let be;t[28]!==M?(be={type:"items",items:M},t[28]=M,t[29]=be):be=t[29],pe.push(be)}return J.length>0&&pe.push(...J),ee&&pe.push(ee),pe}let te;t[30]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Ke,{}),t[30]=te):te=t[30];let F;t[31]!==p?(F=p("tasks"),t[31]=p,t[32]=F):F=t[32];let Z;t[33]!==n||t[34]!==r||t[35]!==a?(Z=()=>n({to:"/$org/$project/tasks",params:{org:r,project:a}}),t[33]=n,t[34]=r,t[35]=a,t[36]=Z):Z=t[36];let K;t[37]!==F||t[38]!==Z?(K={key:"tasks",label:"Tasks",icon:te,isActive:F,onClick:Z},t[37]=F,t[38]=Z,t[39]=K):K=t[39];const ae=K;let V;t[40]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(is,{}),t[40]=V):V=t[40];let q;t[41]!==p?(q=p("workflows"),t[41]=p,t[42]=q):q=t[42];let D;t[43]!==n||t[44]!==r||t[45]!==a?(D=()=>n({to:"/$org/$project/workflows",params:{org:r,project:a}}),t[43]=n,t[44]=r,t[45]=a,t[46]=D):D=t[46];let X;t[47]!==q||t[48]!==D?(X={key:"workflows",label:"Workflows",icon:V,isActive:q,onClick:D},t[47]=q,t[48]=D,t[49]=X):X=t[49];const ce=X;let se;t[50]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(Ue,{}),t[50]=se):se=t[50];let fe;t[51]!==n||t[52]!==r||t[53]!==a?(fe={key:"configure",label:"Configure",icon:se,isActive:!1,isExternal:!0,onClick:()=>n({to:"/$org/$project/projects/$slug/settings/general",params:{org:r,project:Q,slug:a}})},t[51]=n,t[52]=r,t[53]=a,t[54]=fe):fe=t[54];const ge=[{type:"items",items:[k,ae,ce,fe]}];if(M.length>0){let C;t[55]===Symbol.for("react.memo_cache_sentinel")?(C={type:"divider"},t[55]=C):C=t[55],ge.push(C);let G;t[56]!==M?(G={type:"items",items:M},t[56]=M,t[57]=G):G=t[57],ge.push(G)}return J.length>0&&ge.push(...J),ee&&ge.push(ee),ge}const Ys="sidebar_state",Qs=3600*24*7,Zs="16rem",Xs="18rem",Js="3rem",ei="b",jt=P.createContext(null);function Fe(){const t=P.useContext(jt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function ti(t){const e=z.c(21),{defaultOpen:i,open:n,onOpenChange:l,children:o}=t,r=i===void 0?!0:i,a=rs(),[c,d]=P.useState(!1),[f,u]=P.useState(r),m=n??f;let x;e[0]!==m||e[1]!==l?(x=w=>{const $=typeof w=="function"?w(m):w;l?l($):u($),document.cookie=`${Ys}=${$}; path=/; max-age=${Qs}`},e[0]=m,e[1]=l,e[2]=x):x=e[2];const h=x;let g;e[3]!==a||e[4]!==h?(g=()=>a?d(ii):h(si),e[3]=a,e[4]=h,e[5]=g):g=e[5];const j=g;let _,b;e[6]!==j?(_=()=>{const w=$=>{if($.key===ei&&($.metaKey||$.ctrlKey)){const S=$.target;if(S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.isContentEditable)return;$.preventDefault(),j()}};return globalThis.addEventListener("keydown",w),()=>globalThis.removeEventListener("keydown",w)},b=[j],e[6]=j,e[7]=_,e[8]=b):(_=e[7],b=e[8]),P.useEffect(_,b);const p=m?"expanded":"collapsed";let y;e[9]!==a||e[10]!==m||e[11]!==c||e[12]!==h||e[13]!==p||e[14]!==j?(y={state:p,open:m,setOpen:h,isMobile:a,openMobile:c,setOpenMobile:d,toggleSidebar:j},e[9]=a,e[10]=m,e[11]=c,e[12]=h,e[13]=p,e[14]=j,e[15]=y):y=e[15];const k=y;let v;e[16]!==o?(v=s.jsx(us,{delayDuration:0,children:o}),e[16]=o,e[17]=v):v=e[17];let N;return e[18]!==k||e[19]!==v?(N=s.jsx(jt.Provider,{value:k,children:v}),e[18]=k,e[19]=v,e[20]=N):N=e[20],N}function si(t){return!t}function ii(t){return!t}function ni(t){const e=z.c(14);let i,n,l,o;e[0]!==t?({className:n,style:o,children:i,...l}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=l,e[4]=o):(i=e[1],n=e[2],l=e[3],o=e[4]);let r;e[5]!==o?(r={"--sidebar-width":Zs,"--sidebar-width-icon":Js,...o},e[5]=o,e[6]=r):r=e[6];const a=r;let c;e[7]!==n?(c=I("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",n),e[7]=n,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c?(d=s.jsx("div",{"data-slot":"sidebar-wrapper",style:a,className:c,...l,children:i}),e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=d):d=e[13],d}function li(t){const e=z.c(42);let i,n,l,o,r,a;e[0]!==t?({side:o,variant:r,collapsible:a,className:n,children:i,...l}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=l,e[4]=o,e[5]=r,e[6]=a):(i=e[1],n=e[2],l=e[3],o=e[4],r=e[5],a=e[6]);const c=o===void 0?"left":o,d=r===void 0?"sidebar":r,f=a===void 0?"offcanvas":a,{isMobile:u,state:m,openMobile:x,setOpenMobile:h}=Fe();if(f==="none"){let v;e[7]!==n?(v=I("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),e[7]=n,e[8]=v):v=e[8];let N;return e[9]!==i||e[10]!==l||e[11]!==v?(N=s.jsx("div",{"data-slot":"sidebar",className:v,...l,children:i}),e[9]=i,e[10]=l,e[11]=v,e[12]=N):N=e[12],N}if(u){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={"--sidebar-width":Xs},e[13]=v):v=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(cs,{className:"sr-only",children:[s.jsx(ds,{children:"Sidebar"}),s.jsx(ms,{children:"Displays the mobile sidebar."})]}),e[14]=N):N=e[14];let w;e[15]!==i?(w=s.jsx("div",{className:"flex h-full w-full flex-col",children:i}),e[15]=i,e[16]=w):w=e[16];let $;e[17]!==c||e[18]!==w?($=s.jsxs(fs,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:v,side:c,children:[N,w]}),e[17]=c,e[18]=w,e[19]=$):$=e[19];let S;return e[20]!==x||e[21]!==l||e[22]!==h||e[23]!==$?(S=s.jsx(as,{open:x,onOpenChange:h,...l,children:$}),e[20]=x,e[21]=l,e[22]=h,e[23]=$,e[24]=S):S=e[24],S}const g=d==="floating"||d==="inset"?"data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"data-[collapsible=icon]:w-(--sidebar-width-icon)";let j;e[25]!==g?(j=I("group peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","w-(--sidebar-width) transition-[width] duration-300 ease-[var(--ease-out-quart)]","data-[collapsible=offcanvas]:w-0",g),e[25]=g,e[26]=j):j=e[26];const _=m==="collapsed"?f:"";let b;e[27]!==n?(b=I("flex flex-col h-full w-(--sidebar-width)",n),e[27]=n,e[28]=b):b=e[28];let p;e[29]!==i?(p=s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i}),e[29]=i,e[30]=p):p=e[30];let y;e[31]!==l||e[32]!==b||e[33]!==p?(y=s.jsx("div",{"data-slot":"sidebar-container",className:b,...l,children:p}),e[31]=l,e[32]=b,e[33]=p,e[34]=y):y=e[34];let k;return e[35]!==c||e[36]!==m||e[37]!==j||e[38]!==_||e[39]!==y||e[40]!==d?(k=s.jsx("div",{className:j,"data-state":m,"data-collapsible":_,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:y}),e[35]=c,e[36]=m,e[37]=j,e[38]=_,e[39]=y,e[40]=d,e[41]=k):k=e[41],k}function oi(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("main",{"data-slot":"sidebar-inset",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function vt(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("flex flex-col gap-2 p-2",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function ri(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("flex flex-col gap-2 p-2",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function ai(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("h-4 m-0! w-full",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-sidebar":"separator",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function ci(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function Ae(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function Ee(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("w-full text-sm",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function ve(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("flex w-full min-w-0 flex-col gap-1",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function xe(t){const e=z.c(8);let i,n;e[0]!==t?({className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let l;e[3]!==i?(l=I("group/menu-item relative",i),e[3]=i,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==l?(o=s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=o):o=e[7],o}const di=$t("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-0 pr-0.5 pl-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Oe(t){const e=z.c(28);let i,n,l,o,r,a,c;e[0]!==t?({asChild:l,isActive:o,variant:r,size:a,tooltip:c,className:i,...n}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=l,e[4]=o,e[5]=r,e[6]=a,e[7]=c):(i=e[1],n=e[2],l=e[3],o=e[4],r=e[5],a=e[6],c=e[7]);const d=l===void 0?!1:l,f=o===void 0?!1:o,u=r===void 0?"default":r,m=a===void 0?"default":a,x=d?wt:"button",{isMobile:h,state:g}=Fe();let j;e[8]!==i||e[9]!==m||e[10]!==u?(j=I(di({variant:u,size:m}),i),e[8]=i,e[9]=m,e[10]=u,e[11]=j):j=e[11];let _;e[12]!==x||e[13]!==f||e[14]!==n||e[15]!==m||e[16]!==j?(_=s.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":m,"data-active":f,className:j,...n}),e[12]=x,e[13]=f,e[14]=n,e[15]=m,e[16]=j,e[17]=_):_=e[17];const b=_;if(!c)return b;if(typeof c=="string"){let N;e[18]!==c?(N={children:c},e[18]=c,e[19]=N):N=e[19],c=N}let p;e[20]!==b?(p=s.jsx(xs,{asChild:!0,children:b}),e[20]=b,e[21]=p):p=e[21];const y=g!=="collapsed"||h;let k;e[22]!==y||e[23]!==c?(k=s.jsx(ps,{side:"right",align:"center",hidden:y,...c}),e[22]=y,e[23]=c,e[24]=k):k=e[24];let v;return e[25]!==p||e[26]!==k?(v=s.jsxs(hs,{children:[p,k]}),e[25]=p,e[26]=k,e[27]=v):v=e[27],v}function mi(t){const e=z.c(11),{label:i,children:n,defaultExpanded:l}=t,o=l===void 0?!0:l,[r,a]=P.useState(o),{state:c}=Fe(),d=c==="collapsed";let f;e[0]!==r||e[1]!==d||e[2]!==i?(f=d?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(ve,{children:s.jsx(xe,{children:s.jsxs(Oe,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>a(!r),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i}),s.jsx(mt,{size:12,className:I("text-muted-foreground transition-transform duration-200",!r&&"-rotate-90")})]})})}),e[0]=r,e[1]=d,e[2]=i,e[3]=f):f=e[3];let u;e[4]!==n||e[5]!==r||e[6]!==d?(u=(d||r)&&s.jsx(Ee,{children:s.jsx(ve,{className:"gap-0.5",children:n})}),e[4]=n,e[5]=r,e[6]=d,e[7]=u):u=e[7];let m;return e[8]!==f||e[9]!==u?(m=s.jsxs(Ae,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[f,u]}),e[8]=f,e[9]=u,e[10]=m):m=e[10],m}function yt(t){const e=z.c(22),{item:i}=t,n=i.key,l=i.onClick,o=i.isActive,r=i.label,a=i.isExternal&&"group/external";let c;e[0]!==a?(c=I(a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==i.icon?(d=s.jsx("span",{className:"[&>svg]:size-4",children:i.icon}),e[2]=i.icon,e[3]=d):d=e[3];const f=i.isExternal&&"group-hover/external:underline underline-offset-2";let u;e[4]!==f?(u=I("truncate group-data-[collapsible=icon]:hidden",f),e[4]=f,e[5]=u):u=e[5];let m;e[6]!==i.label||e[7]!==u?(m=s.jsx("span",{className:u,children:i.label}),e[6]=i.label,e[7]=u,e[8]=m):m=e[8];let x;e[9]!==i.isExternal?(x=i.isExternal&&s.jsx($e,{size:12,className:"ml-auto mr-1 shrink-0 opacity-0 group-hover/external:opacity-60 transition-opacity group-data-[collapsible=icon]:hidden"}),e[9]=i.isExternal,e[10]=x):x=e[10];let h;e[11]!==i.isActive||e[12]!==i.label||e[13]!==i.onClick||e[14]!==m||e[15]!==x||e[16]!==c||e[17]!==d?(h=s.jsxs(Oe,{onClick:l,isActive:o,tooltip:r,className:c,children:[d,m,x]}),e[11]=i.isActive,e[12]=i.label,e[13]=i.onClick,e[14]=m,e[15]=x,e[16]=c,e[17]=d,e[18]=h):h=e[18];let g;return e[19]!==i.key||e[20]!==h?(g=s.jsx(xe,{children:h},n),e[19]=i.key,e[20]=h,e[21]=g):g=e[21],g}function fi(t){const e=z.c(12),{section:i}=t;switch(i.type){case"divider":{let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ai,{className:"my-2"}),e[0]=n):n=e[0],n}case"spacer":{let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex-1"}),e[1]=n):n=e[1],n}case"group":{const n=i.group.label,l=i.group.defaultExpanded;let o;e[2]!==i.group.items?(o=i.group.items.map(pi),e[2]=i.group.items,e[3]=o):o=e[3];let r;return e[4]!==i.group.defaultExpanded||e[5]!==i.group.label||e[6]!==o?(r=s.jsx(mi,{label:n,defaultExpanded:l,children:o}),e[4]=i.group.defaultExpanded,e[5]=i.group.label,e[6]=o,e[7]=r):r=e[7],r}case"items":{let n;e[8]!==i.items?(n=i.items.map(ui),e[8]=i.items,e[9]=n):n=e[9];let l;return e[10]!==n?(l=s.jsx(Ae,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ee,{children:s.jsx(ve,{className:"gap-0.5",children:n})})}),e[10]=n,e[11]=l):l=e[11],l}}}function ui(t){return s.jsx(yt,{item:t},t.key)}function pi(t){return s.jsx(yt,{item:t},t.key)}function Nt(t){const e=z.c(14),{sections:i,header:n,footer:l,additionalContent:o,variant:r,collapsible:a,contentClassName:c}=t,d=r===void 0?"sidebar":r,f=a===void 0?"icon":a;let u;e[0]!==c?(u=I("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",c),e[0]=c,e[1]=u):u=e[1];let m;e[2]!==i?(m=i.map(xi),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==o||e[5]!==u||e[6]!==m?(x=s.jsxs(ci,{className:u,children:[m,o]}),e[4]=o,e[5]=u,e[6]=m,e[7]=x):x=e[7];let h;return e[8]!==f||e[9]!==l||e[10]!==n||e[11]!==x||e[12]!==d?(h=s.jsxs(li,{variant:d,collapsible:f,children:[n,x,l]}),e[8]=f,e[9]=l,e[10]=n,e[11]=x,e[12]=d,e[13]=h):h=e[13],h}function xi(t,e){return s.jsx(fi,{section:t},e)}Nt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,i)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(le,{className:"h-full bg-sidebar-accent rounded-md"})},i))})};function hi(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(le,{className:"h-8 w-full rounded-lg"}),s.jsx(le,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function gi(t){const e=z.c(12),{organizationId:i,currentProjectSlug:n,onSelect:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={suspense:!0},e[0]=o):o=e[0];const{data:r}=dt(i,o);let a,c;if(e[1]!==n||e[2]!==l||e[3]!==r){c=Symbol.for("react.early_return_sentinel");e:{const f=r?.filter(bi)??[];if(f.length===0){let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=m):m=e[6],c=m;break e}let u;e[7]!==n||e[8]!==l?(u=m=>{const x=n===m.slug,h=m.ui?.themeColor??"#3B82F6";return s.jsxs(ne,{className:I("gap-2.5",x&&"bg-accent"),onClick:()=>l(m.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:m.ui?.icon?void 0:{backgroundColor:h},children:m.ui?.icon?s.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:m.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:m.name}),x&&s.jsx(Pe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},m.id)},e[7]=n,e[8]=l,e[9]=u):u=e[9],a=f.map(u)}e[1]=n,e[2]=l,e[3]=r,e[4]=a,e[5]=c}else a=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let d;return e[10]!==a?(d=s.jsx(s.Fragment,{children:a}),e[10]=a,e[11]=d):d=e[11],d}function bi(t){return t.slug!==Q}function ji(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);const i=Math.abs(e)%360;return{backgroundColor:`hsl(${i} 55% 70%)`,color:`hsl(${i} 55% 20%)`}}function qe(t){const e=z.c(96),{isCollapsed:i,onCreateProject:n}=t,l=i===void 0?!1:i;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const{org:r,project:a}=it(o),{data:c}=Se.useListOrganizations(),d=Ze(),f=c?.find(Y=>Y.slug===r),[u,m]=P.useState(!1),x=a===Q,{data:h}=ct(f?.id??"",x?"":a??"");let g;e[1]!==r?(g=(Y,Re)=>Y.slug===r?-1:Re.slug===r?1:Y.name.localeCompare(Re.name),e[1]=r,e[2]=g):g=e[2];const j=[...c??[]].sort(g);let _;e[3]!==d||e[4]!==r?(_=()=>{r&&d({to:"/$org/$project",params:{org:r,project:Q}})},e[3]=d,e[4]=r,e[5]=_):_=e[5];const b=_;let p;e[6]!==d||e[7]!==r?(p=Y=>{r&&d({to:"/$org/$project",params:{org:r,project:Y}})},e[6]=d,e[7]=r,e[8]=p):p=e[8];const y=p;let k;e[9]!==d?(k=Y=>{d({to:"/$org/$project",params:{org:Y,project:Q}})},e[9]=d,e[10]=k):k=e[10];const v=k;let N;e[11]!==n?(N=n?()=>n():void 0,e[11]=n,e[12]=N):N=e[12];const w=N;let $;e[13]!==d||e[14]!==r||e[15]!==a?($=()=>{if(!r||!a)return;const Y=a===Q;d({to:"/$org/$project",params:{org:r,project:a},search:Re=>({...Re,settings:Y?"org.general":`project:${a}:general`})})},e[13]=d,e[14]=r,e[15]=a,e[16]=$):$=e[16];const S=$,A=ut,O=l?"w-auto pr-1.5":"w-full";let T;e[17]!==O?(T=I("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",O),e[17]=O,e[18]=T):T=e[18];const U=x?s.jsx("div",{className:I("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",l?"size-6":"size-8"),style:f?.logo?void 0:ji(f?.name??""),children:f?.logo?s.jsx("img",{src:f.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:I("font-semibold leading-none",l?"text-[9px]":"text-xs"),children:(f?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:I("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",l?"size-6":"size-8"),style:h?.ui?.icon?void 0:{backgroundColor:h?.ui?.themeColor??"#60a5fa"},children:h?.ui?.icon?s.jsx("img",{src:h.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:I("font-semibold text-white",l?"text-xs":"text-lg"),children:(h?.name??a??"?").charAt(0).toUpperCase()})});let R;e[19]!==f?.name||e[20]!==h?.name||e[21]!==l||e[22]!==x||e[23]!==a?(R=!l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:f?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:x?"Studio":h?.name??a??""})]}),s.jsx(Ut,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[19]=f?.name,e[20]=h?.name,e[21]=l,e[22]=x,e[23]=a,e[24]=R):R=e[24];let E;e[25]!==T||e[26]!==U||e[27]!==R?(E=s.jsx(pt,{asChild:!0,children:s.jsxs("button",{type:"button",className:T,children:[U,R]})}),e[25]=T,e[26]=U,e[27]=R,e[28]=E):E=e[28];const L=ft,H="start",B="bottom",M="w-64 flex flex-col gap-0.5",W=vi,me=x&&"bg-accent";let J;e[29]!==me?(J=I("gap-2.5",me),e[29]=me,e[30]=J):J=e[30];const oe=f?.logo??"",re=f?.name??"";let ee;e[31]!==oe||e[32]!==re?(ee=s.jsx(Ie,{url:oe,fallback:re,size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),e[31]=oe,e[32]=re,e[33]=ee):ee=e[33];const te=f?.name;let F;e[34]!==te?(F=s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",te]}),e[34]=te,e[35]=F):F=e[35];let Z;e[36]!==x?(Z=x&&s.jsx(Pe,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[36]=x,e[37]=Z):Z=e[37];let K;e[38]!==b||e[39]!==J||e[40]!==ee||e[41]!==F||e[42]!==Z?(K=s.jsxs(ne,{className:J,onClick:b,children:[ee,F,Z]}),e[38]=b,e[39]=J,e[40]=ee,e[41]=F,e[42]=Z,e[43]=K):K=e[43];let ae;e[44]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),e[44]=ae):ae=e[44];let V;e[45]!==f||e[46]!==y||e[47]!==r||e[48]!==a?(V=f&&s.jsx(P.Suspense,{fallback:s.jsx(hi,{}),children:s.jsx(gi,{organizationId:f.id,currentProjectSlug:a,orgSlug:r??"",onSelect:y})}),e[45]=f,e[46]=y,e[47]=r,e[48]=a,e[49]=V):V=e[49];let q;e[50]!==w?(q=w&&s.jsxs(ne,{className:"gap-2.5",onClick:w,children:[s.jsx(Le,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),e[50]=w,e[51]=q):q=e[51];let D;e[52]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(He,{}),e[52]=D):D=e[52];const X=bs;let ce;e[53]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsxs(js,{className:"gap-2.5",children:[s.jsx(vs,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),e[53]=ce):ce=e[53];const se=gs,fe="w-48 flex flex-col gap-0.5";let he;e[54]!==v||e[55]!==r?(he=Y=>s.jsxs(ne,{className:I("gap-2.5",Y.slug===r&&"bg-accent"),onClick:()=>v(Y.slug),children:[s.jsx(Ie,{url:Y.logo??"",fallback:Y.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:Y.name}),Y.slug===r&&s.jsx(Pe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},Y.id),e[54]=v,e[55]=r,e[56]=he):he=e[56];const Te=j.map(he);let ge;e[57]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx(He,{}),e[57]=ge):ge=e[57];let C;e[58]!==m?(C=()=>m(!0),e[58]=m,e[59]=C):C=e[59];let G,de;e[60]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Le,{size:14,className:"shrink-0 text-muted-foreground"}),de=s.jsx("span",{children:"Create organization"}),e[60]=G,e[61]=de):(G=e[60],de=e[61]);let ue;e[62]!==C?(ue=s.jsxs(ne,{className:"gap-2.5",onClick:C,children:[G,de]}),e[62]=C,e[63]=ue):ue=e[63];let ye;e[64]!==se||e[65]!==Te||e[66]!==ue?(ye=s.jsxs(se,{className:fe,children:[Te,ge,ue]}),e[64]=se,e[65]=Te,e[66]=ue,e[67]=ye):ye=e[67];let pe;e[68]!==X||e[69]!==ce||e[70]!==ye?(pe=s.jsxs(X,{children:[ce,ye]}),e[68]=X,e[69]=ce,e[70]=ye,e[71]=pe):pe=e[71];let be,Me;e[72]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Ue,{size:14,className:"shrink-0 text-muted-foreground"}),Me=s.jsx("span",{children:"Settings"}),e[72]=be,e[73]=Me):(be=e[72],Me=e[73]);let _e;e[74]!==S?(_e=s.jsxs(ne,{className:"gap-2.5",onClick:S,children:[be,Me]}),e[74]=S,e[75]=_e):_e=e[75];let ke;e[76]!==L||e[77]!==W||e[78]!==K||e[79]!==ae||e[80]!==V||e[81]!==q||e[82]!==D||e[83]!==pe||e[84]!==_e?(ke=s.jsxs(L,{align:H,side:B,className:M,onCloseAutoFocus:W,children:[K,ae,V,q,D,pe,_e]}),e[76]=L,e[77]=W,e[78]=K,e[79]=ae,e[80]=V,e[81]=q,e[82]=D,e[83]=pe,e[84]=_e,e[85]=ke):ke=e[85];let Ce;e[86]!==A||e[87]!==E||e[88]!==ke?(Ce=s.jsxs(A,{children:[E,ke]}),e[86]=A,e[87]=E,e[88]=ke,e[89]=Ce):Ce=e[89];let we;e[90]!==u||e[91]!==m?(we=s.jsx(Ns,{open:u,onOpenChange:m}),e[90]=u,e[91]=m,e[92]=we):we=e[92];let De;return e[93]!==Ce||e[94]!==we?(De=s.jsxs(s.Fragment,{children:[Ce,we]}),e[93]=Ce,e[94]=we,e[95]=De):De=e[95],De}function vi(t){return t.preventDefault()}qe.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(le,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(le,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function Ye(t){const e=z.c(4),{onCreateProject:i}=t,{state:n,toggleSidebar:l}=Fe(),o=n==="collapsed";let r;return e[0]!==o||e[1]!==i||e[2]!==l?(r=s.jsx(vt,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(ve,{children:s.jsx(xe,{children:o?s.jsxs("div",{className:"flex flex-col w-full gap-0.5",children:[s.jsx(qe,{isCollapsed:!0,onCreateProject:i}),s.jsx(Oe,{onClick:l,tooltip:"Expand sidebar",children:s.jsx(Ve,{})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(qe,{isCollapsed:!1,onCreateProject:i})}),s.jsx(Oe,{onClick:l,tooltip:"Collapse sidebar",className:"size-7 shrink-0",children:s.jsx(Ve,{})})]})})})}),e[0]=o,e[1]=i,e[2]=l,e[3]=r):r=e[3],r}Ye.Skeleton=function(){return s.jsx(vt,{className:"px-3",children:s.jsx(ve,{children:s.jsx(xe,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(le,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(le,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsx("div",{className:"flex items-center gap-0.5",children:s.jsx(le,{className:"size-7 rounded-lg bg-sidebar-accent"})})]})})})})};function yi(t){const e=z.c(50),{user:i,userImage:n}=t,{open:l}=at(),[o,r]=P.useState(!1);let a;e[0]!==i.email||e[1]!==i.id||e[2]!==i.name?(a=()=>{const W=`ID: ${i.id}
|
|
2
|
-
Name: ${i.name||"N/A"}
|
|
3
|
-
Email: ${i.email}`;navigator.clipboard.writeText(W),r(!0),Ne.success("User info copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=i.email,e[1]=i.id,e[2]=i.name,e[3]=a):a=e[3];const c=a,d=i.name||i.email||"U";let f;e[4]!==d||e[5]!==n?(f=s.jsx(Ie,{url:n,fallback:d,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=d,e[5]=n,e[6]=f):f=e[6];const u=i.name||"User";let m;e[7]!==u?(m=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:u})}),e[7]=u,e[8]=m):m=e[8];let x;e[9]!==f||e[10]!==m?(x=s.jsx(pt,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[f,m]})}),e[9]=f,e[10]=m,e[11]=x):x=e[11];const h=i.name||i.email||"U";let g;e[12]!==h||e[13]!==n?(g=s.jsx(Ie,{url:n,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=h,e[13]=n,e[14]=g):g=e[14];const j=i.name||"User";let _;e[15]!==j?(_=s.jsx("div",{className:"text-sm font-medium truncate",children:j}),e[15]=j,e[16]=_):_=e[16];let b;e[17]!==i.email?(b=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:i.email}),e[17]=i.email,e[18]=b):b=e[18];let p;e[19]!==_||e[20]!==b?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,b]}),e[19]=_,e[20]=b,e[21]=p):p=e[21];let y;e[22]!==o?(y=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:o?s.jsx(Pe,{size:14,className:"text-green-600"}):s.jsx(Ss,{size:14,className:"text-muted-foreground"})}),e[22]=o,e[23]=y):y=e[23];let k;e[24]!==c||e[25]!==p||e[26]!==y||e[27]!==g?(k=s.jsxs(ne,{onClick:c,className:"gap-2.5 group",children:[g,p,y]}),e[24]=c,e[25]=p,e[26]=y,e[27]=g,e[28]=k):k=e[28];let v;e[29]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(He,{}),e[29]=v):v=e[29];let N;e[30]!==l?(N=()=>l("account.preferences"),e[30]=l,e[31]=N):N=e[31];let w,$;e[32]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Ue,{size:14,className:"shrink-0 text-muted-foreground"}),$=s.jsx("span",{children:"Settings"}),e[32]=w,e[33]=$):(w=e[32],$=e[33]);let S;e[34]!==N?(S=s.jsxs(ne,{className:"gap-2.5",onClick:N,children:[w,$]}),e[34]=N,e[35]=S):S=e[35];let A;e[36]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ne,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(_s,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx($e,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=A):A=e[36];let O;e[37]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ne,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Cs,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx($e,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=O):O=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(ne,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(zt,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx($e,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=T):T=e[38];let U;e[39]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(ne,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Je,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx($e,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=U):U=e[39];let R,E;e[40]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ne,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ks,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx($e,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),E=s.jsx(He,{}),e[40]=R,e[41]=E):(R=e[40],E=e[41]);let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs(ne,{className:"gap-2.5",onClick:Ni,children:[s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=L):L=e[42];let H;e[43]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx("div",{className:"px-2 py-1.5",children:s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.175.1"]})}),e[43]=H):H=e[43];let B;e[44]!==k||e[45]!==S?(B=s.jsxs(ft,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:Si,children:[k,v,S,A,O,T,U,R,E,L,H]}),e[44]=k,e[45]=S,e[46]=B):B=e[46];let M;return e[47]!==B||e[48]!==x?(M=s.jsxs(ut,{children:[x,B]}),e[47]=B,e[48]=x,e[49]=M):M=e[49],M}function Ni(){return Se.signOut()}function Si(t){return t.preventDefault()}function St(){const t=z.c(7),{data:e}=Se.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ie,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const i=e.user,n=i.name??void 0;let l;t[1]!==n||t[2]!==i?(l={...i,name:n},t[1]=n,t[2]=i,t[3]=l):l=t[3];const o=l,r=i.image;let a;return t[4]!==r||t[5]!==o?(a=s.jsx(yi,{user:o,userImage:r}),t[4]=r,t[5]=o,t[6]=a):a=t[6],a}function _i({invitation:t}){const[e,i]=P.useState(!1),[n,l]=P.useState(!1),o=Pt(),r=async()=>{i(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)Ne.error(c.error.message),i(!1);else{const d=await Se.organization.setActive({organizationId:t.organizationId});Ne.success("Invitation accepted!");const f=d?.data?.slug;window.location.href=f?`/${f}`:"/"}}catch{Ne.error("Failed to accept invitation"),i(!1)}},a=async()=>{l(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(Ne.error(c.error.message),l(!1)):(Ne.success("Invitation declined"),o.invalidateQueries())}catch{Ne.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Ge,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:r,disabled:e||n,"aria-label":"Accept invitation",children:s.jsx(Pe,{size:14})}),s.jsx(Ge,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||n,"aria-label":"Decline invitation",children:s.jsx(Is,{size:14})})]})]})}function ki(){const t=P.useContext(It),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(n=>n.status==="pending"&&new Date(n.expiresAt)>new Date)}class Ci extends P.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,i){}render(){return this.state.hasError?null:this.props.children}}const wi="gateway-chip-period";function $i(){try{const t=localStorage.getItem(wi);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function zi(t,e){if(!e||e<=0)return"text-foreground/70";const i=t/e;return i<=.05?"text-destructive":i<=.2?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ii(t){return t>=90?"text-destructive":t>=70?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Pi(t){const e=z.c(42),{connectionId:i}=t,{open:n}=at(),{org:l}=ze();let o;e[0]!==i||e[1]!==l.id?(o={connectionId:i,orgId:l.id},e[0]=i,e[1]=l.id,e[2]=o):o=e[2];const r=Wt(o);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={},e[3]=a):a=e[3];let c;e[4]!==r?(c={client:r,toolName:"GATEWAY_USAGE",toolArguments:a,staleTime:6e4,select:Ai},e[4]=r,e[5]=c):c=e[5];const{data:d}=As(c),f=d?.billing.mode??"prepaid",u=d?.limit.total??null,m=d?.limit.remaining??0;let x;e[6]!==d?.usage?(x=d?.usage??{total:0,daily:0,weekly:0,monthly:0},e[6]=d?.usage,e[7]=x):x=e[7];const h=x;let g,j,_,b,p,y,k;if(e[8]!==f||e[9]!==g||e[10]!==m||e[11]!==u||e[12]!==n||e[13]!==h){let w;if(f==="prepaid"){g="Credits";let S;e[21]!==m?(S=m.toFixed(2),e[21]=m,e[22]=S):S=e[22],j=`$${S}`,w=zi(m,u)}else if(u!=null&&u>0){const S=u-m;let A;e[23]!==u||e[24]!==S?(A=Math.round(S/u*100),e[23]=u,e[24]=S,e[25]=A):A=e[25];const O=Math.min(100,A);g="Usage",j=`${O}%`,w=Ii(O)}else{const S=$i(),A=S==="daily"?h.daily:S==="weekly"?h.weekly:h.monthly,O=S==="daily"?"/day":S==="weekly"?"/wk":"/mo";g="Usage";let T;e[26]!==A?(T=A.toFixed(2),e[26]=A,e[27]=T):T=e[27],j=`$${T}${O}`,w="text-foreground/70"}b="button",e[28]!==n?(p=()=>n("org.billing"),e[28]=n,e[29]=p):p=e[29],y="group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors";let $;e[30]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ys,{size:13,className:"text-muted-foreground/60 shrink-0"}),e[30]=$):$=e[30],e[31]!==g?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[$,s.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[31]=g,e[32]=k):k=e[32],_=I("text-xs font-medium tabular-nums",w),e[8]=f,e[9]=g,e[10]=m,e[11]=u,e[12]=n,e[13]=h,e[14]=_,e[15]=b,e[16]=p,e[17]=y,e[18]=k,e[19]=g,e[20]=j}else _=e[14],b=e[15],p=e[16],y=e[17],k=e[18],g=e[19],j=e[20];let v;e[33]!==_||e[34]!==j?(v=s.jsx("span",{className:_,children:j}),e[33]=_,e[34]=j,e[35]=v):v=e[35];let N;return e[36]!==v||e[37]!==b||e[38]!==p||e[39]!==y||e[40]!==k?(N=s.jsxs("button",{type:b,onClick:p,className:y,children:[k,v]}),e[36]=v,e[37]=b,e[38]=p,e[39]=y,e[40]=k,e[41]=N):N=e[41],N}function Ai(t){return t.structuredContent}function Ei(){const t=z.c(4),e=Ps();let i;t[0]!==e?(i=e.find(Oi),t[0]=e,t[1]=i):i=t[1];const n=i;if(!n?.id)return null;let l;return t[2]!==n.id?(l=s.jsx(Pi,{connectionId:n.id}),t[2]=n.id,t[3]=l):l=t[3],l}function Oi(t){return Es(t,Os)}function Ti(){const t=z.c(13),e=ki();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ci,{children:s.jsx(P.Suspense,{fallback:null,children:s.jsx(Ei,{})})}),t[0]=i):i=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(St,{})}),t[1]=n):n=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($s,{asChild:!0,children:s.jsx(Ge,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(st,{size:16})})}),t[2]=l):l=t[2];let o;t[3]!==e.length?(o=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=o):o=t[4];let r;t[5]!==o?(r=s.jsxs("div",{className:"relative",children:[l,o]}),t[5]=o,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[7]=a):a=t[7];let c;t[8]!==e?(c=s.jsxs(ws,{side:"right",align:"end",sideOffset:24,className:"w-[400px] p-0 h-[650px] flex flex-col",children:[a,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(st,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Mi)})]}),t[8]=e,t[9]=c):c=t[9];let d;return t[10]!==r||t[11]!==c?(d=s.jsxs(ri,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[i,s.jsx(ve,{children:s.jsx(xe,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[n,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(zs,{children:[r,c]})})]})})})]}),t[10]=r,t[11]=c,t[12]=d):d=t[12],d}function Mi(t){return s.jsx(_i,{invitation:t},t.id)}function Di(t){const e=z.c(11),{project:i}=t,n=i.ui?.themeColor??"#60a5fa";if(i.ui?.icon){let c;return e[0]!==i.ui.icon?(c=s.jsx("img",{src:i.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=i.ui.icon,e[1]=c):c=e[1],c}let l;e[2]!==n?(l={backgroundColor:n},e[2]=n,e[3]=l):l=e[3];let o;e[4]!==i.name?(o=i.name.charAt(0).toUpperCase(),e[4]=i.name,e[5]=o):o=e[5];let r;e[6]!==o?(r=s.jsx("span",{className:"text-[10px] font-medium text-white",children:o}),e[6]=o,e[7]=r):r=e[7];let a;return e[8]!==l||e[9]!==r?(a=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:l,children:r}),e[8]=l,e[9]=r,e[10]=a):a=e[10],a}function Ri(t){const e=z.c(14),{project:i}=t,n=Ze(),{org:l}=ze();let o;e[0]!==n||e[1]!==l.slug||e[2]!==i.slug?(o=()=>{n({to:"/$org/$project",params:{org:l.slug,project:i.slug}})},e[0]=n,e[1]=l.slug,e[2]=i.slug,e[3]=o):o=e[3];let r;e[4]!==i?(r=s.jsx(Di,{project:i}),e[4]=i,e[5]=r):r=e[5];let a;e[6]!==i.name?(a=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:i.name}),e[6]=i.name,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Rs,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=c):c=e[8];let d;return e[9]!==i.name||e[10]!==o||e[11]!==r||e[12]!==a?(d=s.jsx(xe,{children:s.jsxs(Oe,{onClick:o,tooltip:i.name,children:[r,a,c]})}),e[9]=i.name,e[10]=o,e[11]=r,e[12]=a,e[13]=d):d=e[13],d}function Li(){const t=z.c(55),{org:e}=ze(),{data:i,isLoading:n}=dt(e.id),[l,o]=P.useState(!0),[r,a]=P.useState(!1);let c,d,f,u,m,x,h,g,j,_,b,p,y;if(t[0]!==n||t[1]!==l||t[2]!==i){y=Symbol.for("react.early_return_sentinel");e:{const T=i?.filter(Hi)??[];if(n){let M;t[16]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(xe,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(le,{className:"h-4 w-4 rounded"}),s.jsx(le,{className:"h-4 flex-1"})]})}),t[16]=M):M=t[16];let W;t[17]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ae,{className:"py-0 px-0",children:s.jsx(Ee,{children:s.jsxs(ve,{className:"gap-0.5",children:[M,s.jsx(xe,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(le,{className:"h-4 w-4 rounded"}),s.jsx(le,{className:"h-4 flex-1"})]})})]})})}),t[17]=W):W=t[17],y=W;break e}p="group/projects-section mt-2",m=Ts,_=l,b=o,u=Ae,j="py-0 px-0",f=Ee,d=ve,h="gap-0.5";let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=U):U=t[18];const R=!l&&"-rotate-90";let E;t[19]!==R?(E=I("text-muted-foreground shrink-0 transition-transform duration-200",R),t[19]=R,t[20]=E):E=t[20];let L;t[21]!==E?(L=s.jsx(Ms,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[U,s.jsx(mt,{size:12,className:E})]})}),t[21]=E,t[22]=L):L=t[22];let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>a(!0),t[23]=H):H=t[23];let B;t[24]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("button",{type:"button",onClick:H,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(Le,{size:16})}),t[24]=B):B=t[24],t[25]!==L?(g=s.jsx(xe,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[L,B]})}),t[25]=L,t[26]=g):g=t[26],c=Ds,x=T.length===0?s.jsx(xe,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):T.map(Ui)}t[0]=n,t[1]=l,t[2]=i,t[3]=c,t[4]=d,t[5]=f,t[6]=u,t[7]=m,t[8]=x,t[9]=h,t[10]=g,t[11]=j,t[12]=_,t[13]=b,t[14]=p,t[15]=y}else c=t[3],d=t[4],f=t[5],u=t[6],m=t[7],x=t[8],h=t[9],g=t[10],j=t[11],_=t[12],b=t[13],p=t[14],y=t[15];if(y!==Symbol.for("react.early_return_sentinel"))return y;let k;t[27]!==c||t[28]!==x?(k=s.jsx(c,{children:x}),t[27]=c,t[28]=x,t[29]=k):k=t[29];let v;t[30]!==d||t[31]!==h||t[32]!==g||t[33]!==k?(v=s.jsxs(d,{className:h,children:[g,k]}),t[30]=d,t[31]=h,t[32]=g,t[33]=k,t[34]=v):v=t[34];let N;t[35]!==f||t[36]!==v?(N=s.jsx(f,{children:v}),t[35]=f,t[36]=v,t[37]=N):N=t[37];let w;t[38]!==u||t[39]!==N||t[40]!==j?(w=s.jsx(u,{className:j,children:N}),t[38]=u,t[39]=N,t[40]=j,t[41]=w):w=t[41];let $;t[42]!==m||t[43]!==w||t[44]!==_||t[45]!==b?($=s.jsx(m,{open:_,onOpenChange:b,children:w}),t[42]=m,t[43]=w,t[44]=_,t[45]=b,t[46]=$):$=t[46];let S;t[47]!==$||t[48]!==p?(S=s.jsx("div",{className:p,children:$}),t[47]=$,t[48]=p,t[49]=S):S=t[49];let A;t[50]!==r?(A=s.jsx(rt,{open:r,onOpenChange:a}),t[50]=r,t[51]=A):A=t[51];let O;return t[52]!==S||t[53]!==A?(O=s.jsxs(s.Fragment,{children:[S,A]}),t[52]=S,t[53]=A,t[54]=O):O=t[54],O}function Ui(t){return s.jsx(Ri,{project:t},t.id)}function Hi(t){return t.slug!==Q}function Bi(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(P.Suspense,{fallback:s.jsx(Ae,{className:"py-0 px-0",children:s.jsx(Ee,{children:s.jsx(ve,{className:"gap-0.5",children:s.jsx(xe,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(le,{className:"h-4 w-4 rounded"}),s.jsx(le,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Li,{})}),t[0]=e):e=t[0],e}function Fi(t){const e=z.c(12),{onCreateProject:i}=t,n=qs(),{locator:l}=ze();let o;e[0]!==l?(o=We.isOrgAdminProject(l),e[0]=l,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ye.Skeleton,{}),e[2]=a):a=e[2];let c;e[3]!==i?(c=s.jsx(P.Suspense,{fallback:a,children:s.jsx(Ye,{onCreateProject:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ti,{}),e[5]=d):d=e[5];let f;e[6]!==r?(f=r?s.jsx(Qe,{children:s.jsx(P.Suspense,{fallback:null,children:s.jsx(Bi,{})})}):null,e[6]=r,e[7]=f):f=e[7];let u;return e[8]!==n||e[9]!==c||e[10]!==f?(u=s.jsx(Nt,{sections:n,header:c,footer:d,additionalContent:f}),e[8]=n,e[9]=c,e[10]=f,e[11]=u):u=e[11],u}function Wi(){const t=z.c(5),i=Xe().location.href;let n;t[0]!==i?(n=i==="/login"||i.startsWith("/login?"),t[0]=i,t[1]=n):n=t[1];const l=n;let o;if(t[2]!==i||t[3]!==l){const r=l?{}:{next:i};o=s.jsx(Tt,{to:"/login",search:r,replace:!0}),t[2]=i,t[3]=l,t[4]=o}else o=t[4];return o}function Gi(t){const e=z.c(6),{children:i}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(At,{children:s.jsx(nt,{})}),e[0]=n):n=e[0];let l;e[1]!==i?(l=s.jsx(Et,{children:i}),e[1]=i,e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ot,{children:s.jsx(Wi,{})}),e[3]=o):o=e[3];let r;return e[4]!==l?(r=s.jsxs(s.Fragment,{children:[n,l,o]}),e[4]=l,e[5]=r):r=e[5],r}function Ki(t){const e=z.c(10),{children:i,className:n}=t,[,l]=P.useTransition();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Be.decoChatPanelWidth(),e[0]=o):o=e[0];const[r,a]=et(o,30);let c;e[1]!==a?(c=m=>l(()=>a(m)),e[1]=a,e[2]=c):c=e[2];const d=c;let f;e[3]!==n?(f=I("min-w-0",n),e[3]=n,e[4]=f):f=e[4];let u;return e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==f?(u=s.jsx(xt,{defaultSize:r,minSize:20,className:f,onResize:d,children:i}),e[5]=r,e[6]=i,e[7]=d,e[8]=f,e[9]=u):u=e[9],u}function Vi(t){const e=z.c(5),{children:i}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Be.sidebarOpen(),e[0]=n):n=e[0];const[l,o]=et(n,!0);let r;return e[1]!==i||e[2]!==o||e[3]!==l?(r=s.jsx(ti,{open:l,onOpenChange:o,children:i}),e[1]=i,e[2]=o,e[3]=l,e[4]=r):r=e[4],r}function qi(t){const e=z.c(23),{isHomeRoute:i,onCreateProject:n}=t,[l]=ot();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Be.decoChatPanelWidth(),e[0]=o):o=e[0];const[r]=et(o,30),a=`${r}cqi`;let c;e[1]!==a?(c={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":a},e[1]=a,e[2]=c):c=e[2];const d=c;let f;e[3]!==n?(f=s.jsx(Fi,{onCreateProject:n}),e[3]=n,e[4]=f):f=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={background:"transparent",containerType:"inline-size"},e[5]=u):u=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={overflow:"visible"},e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x={overflow:"visible"},e[7]=x):x=e[7];const h=l&&"rounded-tr-[0.75rem] border-r";let g;e[8]!==h?(g=I("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",h),e[8]=h,e[9]=g):g=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(lt,{})}),e[10]=j):j=e[10];let _;e[11]!==g?(_=s.jsx(xt,{className:"min-w-0 flex flex-col",style:x,children:s.jsx("div",{className:g,children:j})}),e[11]=g,e[12]=_):_=e[12];let b;e[13]!==l||e[14]!==i?(b=!i&&s.jsxs(s.Fragment,{children:[s.jsx(Ls,{className:"bg-sidebar"}),s.jsx(Ki,{className:I("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",l?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx(Fs,{})})})})]}),e[13]=l,e[14]=i,e[15]=b):b=e[15];let p;e[16]!==_||e[17]!==b?(p=s.jsx(oi,{className:"pt-1.5",style:u,children:s.jsxs(Us,{direction:"horizontal",className:"h-full",style:m,children:[_,b]})}),e[16]=_,e[17]=b,e[18]=p):p=e[18];let y;return e[19]!==p||e[20]!==d||e[21]!==f?(y=s.jsxs(ni,{className:"flex-1 bg-sidebar",style:d,children:[f,p]}),e[19]=p,e[20]=d,e[21]=f,e[22]=y):y=e[22],y}function Yi(){const{org:t,project:e}=it({strict:!1}),i=Xe(),[n,l]=P.useState(!1),[o,r]=P.useState(!1);P.useEffect(()=>{const u=m=>{Ht(m)&&m.code==="KeyK"&&(m.preventDefault(),r(!0))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]);const a=i.location.pathname===`/${t}/${e}`||i.location.pathname===`/${t}/${e}/`,c=e??Q,{data:d}=Mt({queryKey:Dt.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:u}=await Se.organization.setActive({organizationSlug:t});return u&&localStorage.setItem(Be.lastOrgSlug(),t),{org:u,project:{slug:c,isOrgAdmin:c===Q}}},gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1});if(!d)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(St,{})})}),s.jsx(lt,{})]});if(!d.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const f={...d,project:{...d.project,slug:c,isOrgAdmin:c===Q}};return s.jsxs(Rt,{...f,children:[s.jsx(Vi,{children:s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",children:s.jsx(ie.Provider,{children:s.jsx(qi,{isHomeRoute:a,onCreateProject:()=>l(!0)})})})}),s.jsx(rt,{open:n,onOpenChange:l}),s.jsx(Ws,{open:o,onOpenChange:r})]})}function Xl(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Gi,{children:s.jsx(P.Suspense,{fallback:s.jsx(nt,{}),children:s.jsx(Yi,{})})}),t[0]=e):e=t[0],e}export{Xl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,j as r,E as d,r as f,u as x,e as j}from"./index-DsOJvxnb.js";import{T as h}from"./tasks-panel-TN0GeEUK.js";import{P as e}from"./index-X4FDee1r.js";import{B as g,a as b,b as T,c as k}from"./breadcrumb-aP02JuZO.js";import{i as B}from"./Loading01-BNn4YU_K.js";import{u as S}from"./context-CtrnP3HC.js";import"./task-status-wkv2GdSY.js";import"./popover-CF3EN_0o.js";import"./skeleton-DJFpR-1P.js";import"./spinner-CqAVfcvO.js";import"./tooltip-XyKE4lZa.js";import"./index-zjV4p_E5.js";import"./constants-XtX-WKGm.js";import"./use-mcp-prompts-C-XU_-dc.js";import"./useQuery-D2ShO4od.js";import"./dialog-_XYw8lZC.js";import"./X-B_f76BPZ.js";import"./form-BN7_f2uj.js";import"./label-iPw5smAw.js";import"./input-CUT8DBv1.js";import"./index-CuSj4QrF.js";import"./usage-B8rgFVXq.js";import"./ArrowUp-C6Q-EpUw.js";import"./ChevronDown-BHMaRWRt.js";import"./Edit01-Dw-lPBk-.js";import"./Lock01-DJQX15kR.js";import"./Users03-B7X28dbt.js";import"./XCircle-DDLf4PgL.js";import"./AlertCircle-De9oqjty.js";import"./select-DRPG5csU.js";import"./ChevronUp-1s_S3eDF.js";import"./Check-BfKCyKXX.js";import"./org-ai-providers-BDwPbfg4.js";import"./use-local-storage-CxC8ozOe.js";import"./useMutation-B_cFG709.js";import"./EyeOff-9_-SJWcU.js";import"./Eye-JuDcZhJz.js";import"./Key01-DAjAUWfr.js";import"./Trash01-YPQczxci.js";import"./card-RQxLVCBk.js";import"./avatar-OE2URZfM.js";import"./use-llm-BkLbMZPM.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowLeft-CPWCs_Od.js";import"./use-copy-dSR0w-bG.js";import"./tabs-CkPDQzeX.js";import"./badge-CAg946Xk.js";import"./collapsible-CGr-TiAc.js";import"./index-C-NLwTON.js";import"./Code01-CoTQP8pZ.js";import"./checkbox-DLsMmmhu.js";import"./AlignLeft-BaG4OcCg.js";import"./Image01-I9pAeT0N.js";import"./RefreshCcw01-uL9q48A4.js";import"./SearchMd-BLeX5weN.js";import"./Settings01-2AkYiqYr.js";import"./Tool01-CjSIsyxE.js";import"./ai-providers-logos-W57Qm-EN.js";import"./select-virtual-mcp-B8NgSgPI.js";import"./integration-icon-CVxvM4fR.js";import"./Container-DwxLlgWA.js";import"./use-virtual-mcp-C9XdHCA_.js";import"./use-collections-DSWhP4jg.js";import"./use-create-virtual-mcp-DXWAjide.js";import"./use-mcp-resources-Bxkx1Ub1.js";import"./ChevronRight-1g9z-Z5h.js";import"./Copy01-CIUDy0Hr.js";import"./marked.esm-BaswSlok.js";import"./markdown-CKKBcXcE.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-IX_OR3wW.js";import"./types-B3niHy47.js";import"./Globe02-k3_A41kp.js";import"./LayersTwo01-C-XZtFtv.js";import"./XClose-eeK1fS1n.js";import"./Clock-rHd8cQAO.js";import"./useSuspenseInfiniteQuery-CT40dICu.js";import"./infiniteQueryObserver-BE0Fq7u7.js";import"./CheckCircle-DiRi76qb.js";import"./collection-search-62vwaqdq.js";import"./user-rS26WEu1.js";import"./format-time-CMKyl-GC.js";import"./Plus-CT_Gcwl2.js";import"./dropdown-menu-DzFMEBVS.js";import"./decopilot-events-Brt4gAR6.js";function v(){const t=n.c(8),{org:o,project:s}=x(),a=j(),{switchToTask:c}=S();let i;t[0]!==a||t[1]!==o.slug||t[2]!==s.slug||t[3]!==c?(i=async u=>{await c(u),a({to:"/$org/$project",params:{org:o.slug,project:s.slug}})},t[0]=a,t[1]=o.slug,t[2]=s.slug,t[3]=c,t[4]=i):i=t[4];const l=i;let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(e.Header,{children:r.jsx(e.Header.Left,{children:r.jsx(g,{children:r.jsx(b,{children:r.jsx(T,{children:r.jsx(k,{children:"Tasks"})})})})})}),t[5]=m):m=t[5];let p;return t[6]!==l?(p=r.jsxs(e,{children:[m,r.jsx(e.Content,{children:r.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r.jsx(h,{onTaskSelect:l})})})]}),t[6]=l,t[7]=p):p=t[7],p}function ir(){const t=n.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(d,{children:r.jsx(f.Suspense,{fallback:r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(B,{size:32,className:"animate-spin text-muted-foreground"})}),children:r.jsx(v,{})})}),t[0]=o):o=t[0],o}export{ir as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as m,u as P,v as T,K as g}from"./index-DsOJvxnb.js";import{u as L}from"./useQuery-D2ShO4od.js";import{a as S,u as _}from"./constants-XtX-WKGm.js";function R(){const t=m.c(9),{locator:e,org:c}=P();let n;t[0]!==c.id?(n={connectionId:S,orgId:c.id},t[0]=c.id,t[1]=n):n=t[1];const r=_(n);let o;t[2]!==e?(o=g.aiProviders(e),t[2]=e,t[3]=o):o=t[3];let s;t[4]!==r?(s=async()=>(await r.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,t[4]=r,t[5]=s):s=t[5];let l;t[6]!==o||t[7]!==s?(l={queryKey:o,staleTime:1/0,queryFn:s},t[6]=o,t[7]=s,t[8]=l):l=t[8];const{data:i}=T(l);return i}function p(){const t=m.c(11),{locator:e,org:c}=P();let n;t[0]!==c.id?(n={connectionId:S,orgId:c.id},t[0]=c.id,t[1]=n):n=t[1];const r=_(n);let o;t[2]!==e?(o=g.aiProviderKeys(e),t[2]=e,t[3]=o):o=t[3];let s;t[4]!==r?(s=async()=>(await r.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null,t[4]=r,t[5]=s):s=t[5];let l;t[6]!==o||t[7]!==s?(l={queryKey:o,staleTime:6e4,queryFn:s},t[6]=o,t[7]=s,t[8]=l):l=t[8];const{data:i}=T(l);let a;return t[9]!==i?.keys?(a=i?.keys??[],t[9]=i?.keys,t[10]=a):a=t[10],a}function q(t){const e=m.c(17),{locator:c,org:n}=P();let r;e[0]!==n.id?(r={connectionId:S,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=_(r);let s;e[2]!==t||e[3]!==c?(s=g.aiProviderModels(c,t??""),e[2]=t,e[3]=c,e[4]=s):s=e[4];const l=!!t;let i;e[5]!==o||e[6]!==t?(i=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[5]=o,e[6]=t,e[7]=i):i=e[7];let a;e[8]!==s||e[9]!==l||e[10]!==i?(a={queryKey:s,enabled:l,staleTime:6e4,queryFn:i},e[8]=s,e[9]=l,e[10]=i,e[11]=a):a=e[11];const{data:u,isLoading:I}=L(a);let d;e[12]!==u?.models?(d=u?.models??[],e[12]=u?.models,e[13]=d):d=e[13];const y=!!t&&I;let f;return e[14]!==d||e[15]!==y?(f={models:d,isLoading:y},e[14]=d,e[15]=y,e[16]=f):f=e[16],f}function C(t){const e=m.c(13),{locator:c,org:n}=P();let r;e[0]!==n.id?(r={connectionId:S,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=_(r);let s;e[2]!==t||e[3]!==c?(s=g.aiProviderModels(c,t),e[2]=t,e[3]=c,e[4]=s):s=e[4];let l;e[5]!==o||e[6]!==t?(l=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[5]=o,e[6]=t,e[7]=l):l=e[7];let i;e[8]!==s||e[9]!==l?(i={queryKey:s,staleTime:6e4,queryFn:l},e[8]=s,e[9]=l,e[10]=i):i=e[10];const{data:a}=T(i);let u;return e[11]!==a?.models?(u=a?.models??[],e[11]=a?.models,e[12]=u):u=e[12],u}export{R as a,p as b,C as c,q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,x as D}from"./index-DsOJvxnb.js";import{u as F}from"./useQuery-D2ShO4od.js";import{u as J}from"./useMutation-B_cFG709.js";function N(e){try{return JSON.parse(e)}catch{return}}function d(e,s){const t=localStorage.getItem(e),o=t?N(t):void 0,c=typeof s=="function"?s(o):o??s;if(o===void 0||c!==o)try{const n=JSON.stringify(c);localStorage.setItem(e,n)}catch{}return c}function L(e,s){const t=q.c(25),o=D();let c;t[0]!==e?(c=["localStorage",e],t[0]=e,t[1]=c):c=t[1];const n=c;let a,i;t[2]!==s||t[3]!==e?(a=()=>d(e,s),i=()=>d(e,s),t[2]=s,t[3]=e,t[4]=a,t[5]=i):(a=t[4],i=t[5]);let f;t[6]!==n||t[7]!==a||t[8]!==i?(f={queryKey:n,queryFn:a,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=n,t[7]=a,t[8]=i,t[9]=f):f=t[9];const{data:v}=F(f);let u;t[10]!==e?(u=async r=>{const I=JSON.stringify(r);return localStorage.setItem(e,I),r},t[10]=e,t[11]=u):u=t[11];let l;t[12]!==o||t[13]!==n?(l=r=>{o.setQueryData(n,r)},t[12]=o,t[13]=n,t[14]=l):l=t[14];let m;t[15]!==u||t[16]!==l?(m={mutationFn:u,onSuccess:l},t[15]=u,t[16]=l,t[17]=m):m=t[17];const p=J(m);let g;t[18]!==p||t[19]!==o||t[20]!==n?(g=r=>{const I=o.getQueryData(n),Q=typeof r=="function"?r(I):r;p.mutate(Q)},t[18]=p,t[19]=o,t[20]=n,t[21]=g):g=t[21];const y=g,x=v;let S;return t[22]!==y||t[23]!==x?(S=[x,y],t[22]=y,t[23]=x,t[24]=S):S=t[24],S}export{L as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-BE0Fq7u7.js";import{Y as i}from"./index-DsOJvxnb.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as u,$ as s}from"./index-DsOJvxnb.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-BE0Fq7u7.js";import{Y as u,Z as n}from"./index-DsOJvxnb.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as oe,j as t,B as fe,e as dt,f as ut,u as Te,r as mt,O as ke,w as Ee,x as pt,K as Le}from"./index-DsOJvxnb.js";import{u as Ge,a as Ve}from"./constants-XtX-WKGm.js";import{g as ze}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-VOymjalV.js";import{C as ft}from"./collection-search-62vwaqdq.js";import{C as ht}from"./card-RQxLVCBk.js";import{I as Je}from"./integration-icon-CVxvM4fR.js";import{D as Qe,a as Ye,b as Xe,c as k}from"./dropdown-menu-DzFMEBVS.js";import{a as Ze}from"./Copy01-CIUDy0Hr.js";import{i as et}from"./DotsVertical-Y8XpM2B_.js";import{i as tt}from"./Edit01-Dw-lPBk-.js";import{s as st}from"./Eye-JuDcZhJz.js";import{s as ot}from"./Trash01-YPQczxci.js";import{C as xt}from"./collection-table-wrapper-DPJfuSg9.js";import{E as Fe}from"./empty-state-AMuFIqs3.js";import{n as Ke}from"./Inbox01-BgDmihAV.js";import{U as gt}from"./user-rS26WEu1.js";import{E as it}from"./empty-state-D4GX29pL.js";import{u as jt}from"./use-list-state-Ck8sSm9J.js";import{B as bt}from"./constants-B4Swgi3d.js";import{A as Ct,h as yt,c as vt,b as Nt,d as wt,e as _t,a as Pt,f as St}from"./alert-dialog-BVglQjyM.js";import{u as Dt,e as It}from"./use-collections-DSWhP4jg.js";import{s as At}from"./Plus-CT_Gcwl2.js";import{V as Tt}from"./layout-C2ZnDBkW.js";import{u as Et}from"./useMutation-B_cFG709.js";import{P as $}from"./index-X4FDee1r.js";import{B as Me,a as Ue,b as We,c as Be}from"./breadcrumb-aP02JuZO.js";import{e as Ot}from"./Dataflow03-T9TmjQN-.js";import"./ArrowDown-PFFBPH3j.js";import"./ArrowUp-C6Q-EpUw.js";import"./Check-BfKCyKXX.js";import"./Grid01-DBOkAm2V.js";import"./List-CuV23QYs.js";import"./tooltip-XyKE4lZa.js";import"./index-zjV4p_E5.js";import"./badge-CAg946Xk.js";import"./Loading01-BNn4YU_K.js";import"./SearchMd-BLeX5weN.js";import"./input-CUT8DBv1.js";import"./Container-DwxLlgWA.js";import"./ChevronRight-1g9z-Z5h.js";import"./table-DJbHB5IL.js";import"./avatar-OE2URZfM.js";import"./useQuery-D2ShO4od.js";import"./use-view-mode-ve-Q_Sd0.js";import"./use-mobile-O8KVzGuv.js";import"./use-local-storage-CxC8ozOe.js";function $t(o,e){const s=o.properties||{};for(const n in s){const l=s[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const a=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of a)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function kt(o){const e=oe.c(25),{item:s,schema:a,actions:n}=o;let l;e[0]!==s||e[1]!==a?(l=$t(a,s),e[0]=s,e[1]=a,e[2]=l):l=e[2];const r=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==n?(f=n&&Object.keys(n).length>0,e[3]=n,e[4]=f):f=e[4];const i=f;let m;e[5]!==r||e[6]!==s.title?(m=t.jsx(Je,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=m):m=e[7];let h;e[8]!==s.title?(h=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=h):h=e[9];const d=c||"No description";let u;e[10]!==d?(u=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=u):u=e[11];let b;e[12]!==h||e[13]!==u?(b=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[h,u]}),e[12]=h,e[13]=u,e[14]=b):b=e[14];let _;e[15]!==m||e[16]!==b?(_=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,b]}),e[15]=m,e[16]=b,e[17]=_):_=e[17];let p;e[18]!==n||e[19]!==i||e[20]!==s?(p=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Kt,onMouseDown:Ft,children:t.jsxs(Qe,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(fe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(et,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:Lt,children:[n.open&&t.jsxs(k,{onClick:x=>{x.stopPropagation(),n.open?.(s)},children:[t.jsx(st,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:x=>{x.stopPropagation(),n.edit?.(s)},children:[t.jsx(tt,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:x=>{x.stopPropagation(),n.duplicate?.(s)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:x=>{x.stopPropagation(),n.delete?.(s)},children:[t.jsx(ot,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=i,e[20]=s,e[21]=p):p=e[21];let C;return e[22]!==_||e[23]!==p?(C=t.jsxs(ht,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[_,p]}),e[22]=_,e[23]=p,e[24]=C):C=e[24],C}function Lt(o){return o.stopPropagation()}function zt(o){return o.stopPropagation()}function Ft(o){return o.stopPropagation()}function Kt(o){return o.stopPropagation()}const Mt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Ut(o){return Object.keys(o).find(e=>Mt.includes(e.toLowerCase()))}function nt(o,e){return Object.keys(o.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Wt(o){const e=oe.c(30),{data:s,schema:a,viewMode:n,search:l,sortKey:r,sortDirection:c,onSort:f,actions:i,onItemClick:m,headerActions:h,emptyState:d,readOnly:u,columns:b,hideToolbar:_,sortableFields:p}=o,C=c===void 0?"asc":c,x=f===void 0?Gt:f;let y;e[0]!==i?(y=i===void 0?{}:i,e[0]=i,e[1]=y):y=e[1];const E=y,v=m===void 0?Ht:m,L=h===void 0?null:h,O=d===void 0?null:d,D=u===void 0?!1:u,g=b===void 0?void 0:b,S=_===void 0?!1:_,N=p===void 0?void 0:p;let I;e[2]!==g||e[3]!==a||e[4]!==N?(I=g?g.filter(Rt).filter(T=>!N||N.includes(T.id)).map(Bt):nt(a,N),e[2]=g,e[3]=a,e[4]=N,e[5]=I):I=e[5];const z=I;let P;e[6]!==L||e[7]!==S||e[8]!==x||e[9]!==C||e[10]!==r||e[11]!==z?(P=!S&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:L}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{sortKey:r,sortDirection:C,onSort:x,sortOptions:z})})]})}),e[6]=L,e[7]=S,e[8]=x,e[9]=C,e[10]=r,e[11]=z,e[12]=P):P=e[12];let w;e[13]!==E||e[14]!==g||e[15]!==s||e[16]!==O||e[17]!==v||e[18]!==x||e[19]!==D||e[20]!==a||e[21]!==l||e[22]!==C||e[23]!==r||e[24]!==N||e[25]!==n?(w=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:O||t.jsx(Fe,{icon:t.jsx(Ke,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(T=>t.jsx("div",{onClick:()=>v?.(T),className:"cursor-pointer h-full",children:t.jsx(kt,{item:T,schema:a,readOnly:D,actions:E})},T.id))})}):t.jsx(xt,{columns:Jt(g,a,N,E),data:s,sortKey:r,sortDirection:C,onSort:x,onRowClick:v,emptyState:O||t.jsx(Fe,{icon:t.jsx(Ke,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}),e[13]=E,e[14]=g,e[15]=s,e[16]=O,e[17]=v,e[18]=x,e[19]=D,e[20]=a,e[21]=l,e[22]=C,e[23]=r,e[24]=N,e[25]=n,e[26]=w):w=e[26];let A;return e[27]!==P||e[28]!==w?(A=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[P,w]}),e[27]=P,e[28]=w,e[29]=A):A=e[29],A}function Bt(o){return{id:o.id,label:typeof o.header=="string"?o.header:o.id}}function Rt(o){return o.sortable!==!1}function Ht(){}function Gt(){}function Vt(o){return{id:"actions",header:"",render:e=>t.jsxs(Qe,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(et,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:s=>s.stopPropagation(),children:[o.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),o.open?.(e)},children:[t.jsx(st,{size:16}),"Open"]}),o.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),o.edit?.(e)},children:[t.jsx(tt,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),o.duplicate?.(e)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),o.delete?.(e)},children:[t.jsx(ot,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function rt(o){const e=o.type;return Array.isArray(e)?e.every(s=>rt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function qt(o,e){const s=o.properties||{},a=Object.keys(s).filter(i=>{const m=s[i];return m&&rt(m)}),n=Ut(s),l=[],r=new Set;n&&a.includes(n)&&(l.push(n),r.add(n));const c=["title","description","updated_at","updated_by"];for(const i of c)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=a.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,m)=>i.localeCompare(m));for(const i of f)l.push(i),r.add(i);for(const i of Re)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const m=s[i],h=e?e.includes(i):!["id"].includes(i);return i===n?{id:i,header:"",render:d=>{const u=d[i];return t.jsx(Je,{icon:u,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:d=>{const u=d[i];return u==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(u)})},sortable:h,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const u=d[i];return u?t.jsx(gt,{id:String(u),size:"xs"}):"—"},sortable:h,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const u=d[i];return u?t.jsx("span",{className:"block truncate max-w-full",children:new Date(u).toLocaleDateString()}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const u=d[i];return u==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(u)})},sortable:h,cellClassName:"max-w-[200px]"}})}function Jt(o,e,s,a){const n=o||qt(e,s);return n.some(c=>c.id==="actions")?n:Object.keys(a).length>0?[...n,Vt(a)]:n}function Qt(o){const e=oe.c(111),{connectionId:s,org:a,activeCollection:n}=o,l=n.name,r=n.schema??bt,c=n.hasCreateTool,f=n.hasUpdateTool,i=n.hasDeleteTool,m=dt(),{data:h}=ut.useSession(),d=h?.user?.id||"unknown",{org:u}=Te();let b;e[0]!==s||e[1]!==u.id?(b={connectionId:s,orgId:u.id},e[0]=s,e[1]=u.id,e[2]=b):b=e[2];const _=Ge(b),p=Dt(s,l,_),C=`${s}-${l}`;let x;e[3]!==a||e[4]!==C?(x={namespace:a,resource:C,defaultSortKey:"updated_at"},e[3]=a,e[4]=C,e[5]=x):x=e[5];const{search:y,searchTerm:E,setSearch:v,viewMode:L,setViewMode:O,sortKey:D,sortDirection:g,handleSort:S}=jt(x);let N;e[6]!==E||e[7]!==g||e[8]!==D?(N={searchTerm:E,sortKey:D,sortDirection:g},e[6]=E,e[7]=g,e[8]=D,e[9]=N):N=e[9];const I=It(s,l,_,N),z=!c&&!f&&!i;let P;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==a?(P=j=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:a,project:ke,connectionId:s,collectionName:l,itemId:j.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=a,e[14]=P):P=e[14];const w=P;let A;e[15]!==p.create||e[16]!==d?(A=async j=>{const pe=new Date().toISOString();await p.create.mutateAsync({...j,id:ze("conn"),title:`${j.title} (Copy)`,created_at:pe,updated_at:pe,created_by:d,updated_by:d})},e[15]=p.create,e[16]=d,e[17]=A):A=e[17];const T=A,[F,he]=mt.useState(null);let ie;e[18]===Symbol.for("react.memo_cache_sentinel")?(ie=j=>{he(j)},e[18]=ie):ie=e[18];const lt=ie;let K;e[19]!==w||e[20]!==f?(K=f&&{edit:w},e[19]=w,e[20]=f,e[21]=K):K=e[21];let M;e[22]!==T||e[23]!==c?(M=c&&{duplicate:T},e[22]=T,e[23]=c,e[24]=M):M=e[24];let U;e[25]!==i?(U=i&&{delete:lt},e[25]=i,e[26]=U):U=e[26];let ne;e[27]!==U||e[28]!==K||e[29]!==M?(ne={...K,...M,...U},e[27]=U,e[28]=K,e[29]=M,e[30]=ne):ne=e[30];const xe=ne;let re;e[31]!==p.delete||e[32]!==F?(re=async()=>{F&&(await p.delete.mutateAsync(F.id),he(null))},e[31]=p.delete,e[32]=F,e[33]=re):re=e[33];const ge=re;let le;e[34]!==p.create||e[35]!==l||e[36]!==s||e[37]!==c||e[38]!==m||e[39]!==a||e[40]!==d?(le=async()=>{if(!c){Ee.error("Create operation is not available for this collection");return}const j=new Date().toISOString(),pe={id:ze("conn"),title:"New Item",description:"A brief description of the item",created_at:j,updated_at:j,created_by:d,updated_by:d};try{const Ae=await p.create.mutateAsync(pe);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:a,project:ke,connectionId:s,collectionName:l,itemId:Ae.id}})}catch(Ae){console.error("Failed to create item:",Ae)}},e[34]=p.create,e[35]=l,e[36]=s,e[37]=c,e[38]=m,e[39]=a,e[40]=d,e[41]=le):le=e[41];const je=le;let ae;e[42]!==r?(ae=nt(r),e[42]=r,e[43]=ae):ae=e[43];const be=ae,Oe=(I?.length??0)>0,at=c&&Oe,ct=c&&!Oe&&!y;let ce;e[44]!==p.create||e[45]!==je||e[46]!==c?(ce=c?t.jsxs(fe,{onClick:je,size:"sm",disabled:p.create.isPending,className:"h-7",children:[t.jsx(At,{className:"mr-2 h-4 w-4"}),p.create.isPending?"Creating...":"Create"]}):null,e[44]=p.create,e[45]=je,e[46]=c,e[47]=ce):ce=e[47];const $e=ce,Ce=D;let W;e[48]!==S||e[49]!==g||e[50]!==be||e[51]!==Ce?(W=t.jsx(qe,{sortKey:Ce,sortDirection:g,onSort:S,sortOptions:be}),e[48]=S,e[49]=g,e[50]=be,e[51]=Ce,e[52]=W):W=e[52];const ye=at&&$e;let B;e[53]!==W||e[54]!==ye?(B=t.jsxs(Tt,{children:[W,ye]}),e[53]=W,e[54]=ye,e[55]=B):B=e[55];const ve=`Search ${l}...`;let R;e[56]!==v?(R=j=>{j.key==="Escape"&&(v(""),j.target.blur())},e[56]=v,e[57]=R):R=e[57];let H;e[58]!==y||e[59]!==v||e[60]!==ve||e[61]!==R?(H=t.jsx(ft,{value:y,onChange:v,placeholder:ve,onKeyDown:R}),e[58]=y,e[59]=v,e[60]=ve,e[61]=R,e[62]=H):H=e[62];let G;e[63]!==I?(G=I??[],e[63]=I,e[64]=G):G=e[64];const Ne=D;let V;e[65]!==w?(V=j=>w(j),e[65]=w,e[66]=V):V=e[66];const we="No items found",_e=y?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=ct?$e:void 0;let q;e[67]!==we||e[68]!==_e||e[69]!==Pe?(q=t.jsx(it,{image:null,title:we,description:_e,actions:Pe}),e[67]=we,e[68]=_e,e[69]=Pe,e[70]=q):q=e[70];let J;e[71]!==S||e[72]!==z||e[73]!==xe||e[74]!==r||e[75]!==y||e[76]!==v||e[77]!==O||e[78]!==g||e[79]!==G||e[80]!==Ne||e[81]!==V||e[82]!==q||e[83]!==L?(J=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Wt,{hideToolbar:!0,data:G,schema:r,viewMode:L,onViewModeChange:O,search:y,onSearchChange:v,sortKey:Ne,sortDirection:g,onSort:S,actions:xe,onItemClick:V,readOnly:z,emptyState:q})}),e[71]=S,e[72]=z,e[73]=xe,e[74]=r,e[75]=y,e[76]=v,e[77]=O,e[78]=g,e[79]=G,e[80]=Ne,e[81]=V,e[82]=q,e[83]=L,e[84]=J):J=e[84];let Q;e[85]!==H||e[86]!==J?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[H,J]}),e[85]=H,e[86]=J,e[87]=Q):Q=e[87];const Se=!!F;let de;e[88]===Symbol.for("react.memo_cache_sentinel")?(de=j=>{j||he(null)},e[88]=de):de=e[88];let ue;e[89]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(vt,{children:"Delete item?"}),e[89]=ue):ue=e[89];const De=F?.title;let Y;e[90]!==De?(Y=t.jsxs(Nt,{children:[ue,t.jsxs(wt,{children:['Are you sure you want to delete "',De,'"? This action cannot be undone.']})]}),e[90]=De,e[91]=Y):Y=e[91];let X;e[92]!==p.delete.isPending?(X=t.jsx(Ct,{disabled:p.delete.isPending,children:"Cancel"}),e[92]=p.delete.isPending,e[93]=X):X=e[93];const Ie=p.delete.isPending?"Deleting...":"Delete";let Z;e[94]!==p.delete.isPending||e[95]!==ge||e[96]!==Ie?(Z=t.jsx(yt,{onClick:ge,disabled:p.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),e[94]=p.delete.isPending,e[95]=ge,e[96]=Ie,e[97]=Z):Z=e[97];let ee;e[98]!==X||e[99]!==Z?(ee=t.jsxs(_t,{children:[X,Z]}),e[98]=X,e[99]=Z,e[100]=ee):ee=e[100];let te;e[101]!==Y||e[102]!==ee?(te=t.jsxs(Pt,{children:[Y,ee]}),e[101]=Y,e[102]=ee,e[103]=te):te=e[103];let se;e[104]!==Se||e[105]!==te?(se=t.jsx(St,{open:Se,onOpenChange:de,children:te}),e[104]=Se,e[105]=te,e[106]=se):se=e[106];let me;return e[107]!==B||e[108]!==Q||e[109]!==se?(me=t.jsxs(t.Fragment,{children:[B,Q,se]}),e[107]=B,e[108]=Q,e[109]=se,e[110]=me):me=e[110],me}function Yt(){const o=oe.c(12),{org:e,project:s}=Te(),a=pt();let n;o[0]!==e.id?(n={connectionId:Ve,orgId:e.id},o[0]=e.id,o[1]=n):n=o[1];const l=Ge(n);let r;o[2]!==l||o[3]!==s?(r=async m=>{const h=s.enabledPlugins??[];if(h.includes(m))return;const d=[...h,m],u=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:s.id,enabledPlugins:d}});return u.structuredContent??u},o[2]=l,o[3]=s,o[4]=r):r=o[4];let c;o[5]!==e.id||o[6]!==s||o[7]!==a?(c=()=>{a.invalidateQueries({queryKey:Le.project(e.id,s.slug)}),a.invalidateQueries({queryKey:Le.projects(e.id)})},o[5]=e.id,o[6]=s,o[7]=a,o[8]=c):c=o[8];let f;return o[9]!==r||o[10]!==c?(f={mutationFn:r,onSuccess:c,onError:Xt},o[9]=r,o[10]=c,o[11]=f):f=o[11],Et(f)}function Xt(o){Ee.error("Failed to enable plugin: "+(o instanceof Error?o.message:"Unknown error"))}function Zt(o){const e=oe.c(12),{pluginId:s,title:a,description:n,icon:l}=o,r=Yt();let c;e[0]!==r||e[1]!==s?(c=async()=>{try{await r.mutateAsync(s),Ee.success("Plugin enabled!")}catch{}},e[0]=r,e[1]=s,e[2]=c):c=e[2];const f=c,i=l??null,m=r.isPending?"Enabling…":"Enable plugin";let h;e[3]!==r.isPending||e[4]!==f||e[5]!==m?(h=t.jsx(fe,{onClick:f,disabled:r.isPending,children:m}),e[3]=r.isPending,e[4]=f,e[5]=m,e[6]=h):h=e[6];let d;return e[7]!==n||e[8]!==i||e[9]!==h||e[10]!==a?(d=t.jsx(it,{image:i,title:a,description:n,actions:h}),e[7]=n,e[8]=i,e[9]=h,e[10]=a,e[11]=d):d=e[11],d}const He="workflows",es={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function Js(){const o=oe.c(5),{project:e,org:s}=Te();if(!(e.enabledPlugins??[]).includes(He)){let c;o[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx($.Header,{children:t.jsx($.Header.Left,{children:t.jsx(Me,{children:t.jsx(Ue,{children:t.jsx(We,{children:t.jsx(Be,{children:"Workflows"})})})})})}),o[0]=c):c=o[0];let f;return o[1]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs($,{children:[c,t.jsx($.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(Zt,{pluginId:He,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(Ot,{className:"size-8 text-muted-foreground"})})})})})]}),o[1]=f):f=o[1],f}let l;o[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx($.Header,{children:t.jsx($.Header.Left,{children:t.jsx(Me,{children:t.jsx(Ue,{children:t.jsx(We,{children:t.jsx(Be,{children:"Workflows"})})})})})}),o[2]=l):l=o[2];let r;return o[3]!==s.slug?(r=t.jsxs($,{children:[l,t.jsx($.Content,{children:t.jsx(Qt,{connectionId:Ve,org:s.slug,activeCollection:es})})]}),o[3]=s.slug,o[4]=r):r=o[4],r}export{Js as default};
|