decocms 2.314.0 → 2.315.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-7o1P0zzm.js → AlertCircle-DBo9AAMH.js} +1 -1
- package/dist/client/assets/{Archive-DSPPL-j9.js → Archive-DmnBOtki.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-qDflnb8N.js → ArrowNarrowLeft-deV6RKN9.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C3mm8yK_.js → ArrowUpRight-CyleC_fI.js} +1 -1
- package/dist/client/assets/{Check-Dz5ZLQmL.js → Check-CWMsutx6.js} +1 -1
- package/dist/client/assets/{CheckCircle-A2guVcAG.js → CheckCircle-CtqrLFo6.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bau6LlOi.js → ChevronDown-DBDCamK8.js} +1 -1
- package/dist/client/assets/{ChevronRight-ChQ95U2k.js → ChevronRight-D0Db_yfd.js} +1 -1
- package/dist/client/assets/{ChevronUp-COL031vn.js → ChevronUp-Dx3CWQDk.js} +1 -1
- package/dist/client/assets/{Container-BcMn23kd.js → Container-RAn51RkG.js} +1 -1
- package/dist/client/assets/{DotsVertical-CII1YBBc.js → DotsVertical-D9jz1TQ0.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BCU3zX1U.js → LayoutLeft-Bz-byvkb.js} +1 -1
- package/dist/client/assets/{LinkExternal01-oqIx4SAa.js → LinkExternal01-C0Smk2lu.js} +1 -1
- package/dist/client/assets/{Lock01-CJ14jIMg.js → Lock01-IggrtR3m.js} +1 -1
- package/dist/client/assets/{Palette-g_FAi23c.js → Palette-Cg9Tm5aJ.js} +1 -1
- package/dist/client/assets/{Play-BZl-q_yI.js → Play-DW0LITiR.js} +1 -1
- package/dist/client/assets/{Plus-CKCuUTsd.js → Plus-Dhbk7Oxt.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-8Ibm16Pu.js → RefreshCcw01-CIoWX0oI.js} +1 -1
- package/dist/client/assets/{SearchMd-AJN6VuJg.js → SearchMd-1jGzATDG.js} +1 -1
- package/dist/client/assets/{Settings02-CDcaxP04.js → Settings02-DRIFxfHn.js} +1 -1
- package/dist/client/assets/{Shield01-D1Hywoy5.js → Shield01-5EtEh1c3.js} +1 -1
- package/dist/client/assets/{Star01-BcHjnr98.js → Star01-B3h6tOF6.js} +1 -1
- package/dist/client/assets/{Sun-hliFotLP.js → Sun-CkFgevjR.js} +1 -1
- package/dist/client/assets/{Tool01-bqF4BUeR.js → Tool01-D-ahtGaO.js} +1 -1
- package/dist/client/assets/{Trash01-BqVS-Vu_.js → Trash01-BERBzkhG.js} +1 -1
- package/dist/client/assets/{User01-B9MhRcqZ.js → User01-DHE4nBvX.js} +1 -1
- package/dist/client/assets/{Users03-oWGgz1_B.js → Users03-Cy-1ZCAV.js} +1 -1
- package/dist/client/assets/{X-Bs68LwBc.js → X-C1OoauoK.js} +1 -1
- package/dist/client/assets/{XCircle-H0Nc2jh5.js → XCircle-pEn9ROt8.js} +1 -1
- package/dist/client/assets/{XClose-Cilpzhqm.js → XClose-DzM42Vw-.js} +1 -1
- package/dist/client/assets/{Zap-DhYtqMa9.js → Zap-BNWDUN_3.js} +1 -1
- package/dist/client/assets/{ZapSquare-BmqW5YQ-.js → ZapSquare-D1rioSCt.js} +1 -1
- package/dist/client/assets/{accordion-CfzkzHFA.js → accordion-pCBdHp9x.js} +1 -1
- package/dist/client/assets/{agent-icon-kpWVPj85.js → agent-icon-uifQLn7r.js} +1 -1
- package/dist/client/assets/{agents-list-GApGpFoC.js → agents-list-BdIIZeGh.js} +1 -1
- package/dist/client/assets/ai-providers-Bhh9Y6Dv.js +1 -0
- package/dist/client/assets/{alert-dialog-DS13tR4C.js → alert-dialog-BkIzeg-f.js} +1 -1
- package/dist/client/assets/{auth-catchall-qIi1Yg3W.js → auth-catchall-Dk7BbFKA.js} +1 -1
- package/dist/client/assets/{automation-list-row-B5q6RXF7.js → automation-list-row-Bvgyi-LF.js} +1 -1
- package/dist/client/assets/{automations-C6LU_2_K.js → automations-CY-zZERQ.js} +1 -1
- package/dist/client/assets/{avatar-CmUFzi3F.js → avatar-Cz46we3J.js} +1 -1
- package/dist/client/assets/{badge-DTxL6xUH.js → badge-DlK7sduG.js} +1 -1
- package/dist/client/assets/{brand-context-CTWUekUV.js → brand-context-jzzqwWBQ.js} +1 -1
- package/dist/client/assets/{card-D-Cbo6xY.js → card-2xC00NeJ.js} +1 -1
- package/dist/client/assets/{chat-context-CdZvecT8.js → chat-context-ByfbtfrN.js} +1 -1
- package/dist/client/assets/{checkbox-DMz97A6W.js → checkbox-DsgKhADc.js} +1 -1
- package/dist/client/assets/{collection-detail-BfdHOcH7.js → collection-detail-C56pcSau.js} +1 -1
- package/dist/client/assets/{collection-display-button-CbYIYYup.js → collection-display-button-CI5u7nQD.js} +1 -1
- package/dist/client/assets/{collection-search-B43ATSBX.js → collection-search-NHcUUFC9.js} +1 -1
- package/dist/client/assets/{collection-search-DcN3WCBc.js → collection-search-yy57Ug8m.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ChYShKZS.js → collection-table-wrapper-qcm_l5Ey.js} +1 -1
- package/dist/client/assets/{collection-tabs-BygOMFvP.js → collection-tabs-CXdaxoaN.js} +1 -1
- package/dist/client/assets/{collections-BxKz1gM7.js → collections-Cjw9obtS.js} +1 -1
- package/dist/client/assets/{command-Bkkhvz88.js → command-DRyumRWB.js} +1 -1
- package/dist/client/assets/{connection-card-DwuPCVad.js → connection-card-Dk55kTl8.js} +1 -1
- package/dist/client/assets/{connection-detail-CrK0sm-c.js → connection-detail-DUP91Ojg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Zh2UA8De.js → connection-form-helpers-CyAEGoC0.js} +1 -1
- package/dist/client/assets/{connections-DjYU3SLo.js → connections-BOqrnzGe.js} +1 -1
- package/dist/client/assets/{constants-ZaDhARcT.js → constants-BayN-yld.js} +1 -1
- package/dist/client/assets/{constants-Pxhsjio1.js → constants-DB87On7u.js} +1 -1
- package/dist/client/assets/{dialog-C_Z_peKj.js → dialog-DwOIY1UM.js} +1 -1
- package/dist/client/assets/{domain-settings-9OZffLbB.js → domain-settings-15c_0wEz.js} +1 -1
- package/dist/client/assets/{drawer-Zoq78wzr.js → drawer-C_2I8f4S.js} +1 -1
- package/dist/client/assets/{dropdown-menu-D2TItq8w.js → dropdown-menu-CjlIX0cw.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BNQeiFD-.js → dynamic-plugin-layout-DYFXKOHu.js} +1 -1
- package/dist/client/assets/{empty-state-Nd37WS0U.js → empty-state-BBQwipf0.js} +1 -1
- package/dist/client/assets/{empty-state-DmNyyTs_.js → empty-state-CJUpyycw.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BrLjI2XN.js → extract-connection-data-CXWvMJKK.js} +1 -1
- package/dist/client/assets/{features-BMBXNzKR.js → features-B2B8fUD_.js} +1 -1
- package/dist/client/assets/{form-CHyUU2aZ.js → form-DuX6xbr5.js} +1 -1
- package/dist/client/assets/{general-BmNgsifZ.js → general-B3K7KcXe.js} +1 -1
- package/dist/client/assets/{index-4JTQs1c6.js → index-5CBkac_m.js} +1 -1
- package/dist/client/assets/{index-DNKOi0uM.js → index-BSQ56kKS.js} +1 -1
- package/dist/client/assets/{index-CzeuUc9U.css → index-Bo94M6wo.css} +1 -1
- package/dist/client/assets/{index-CKMzeZJu.js → index-Bs9l9sgs.js} +1 -1
- package/dist/client/assets/{index-DlEamKDn.js → index-C1tCttKh.js} +1 -1
- package/dist/client/assets/{index-IoVTnIlz.js → index-COMOhhst.js} +1 -1
- package/dist/client/assets/{index-LSlqVMbE.js → index-CodtVFa8.js} +1 -1
- package/dist/client/assets/{index-CNLaZeow.js → index-CpI01aVT.js} +1 -1
- package/dist/client/assets/{index-Br-Caa-t.js → index-CsD6nKsw.js} +3 -3
- package/dist/client/assets/{index-DILJMZJ-.js → index-D4K9PTQn.js} +1 -1
- package/dist/client/assets/{index-C677F7dG.js → index-DGUC54zs.js} +1 -1
- package/dist/client/assets/{index-CSmi-vs_.js → index-DOcAAsz8.js} +1 -1
- package/dist/client/assets/{index-lom4XGsv.js → index-DnB8sRlu.js} +1 -1
- package/dist/client/assets/{index-Ci4MsFGg.js → index-DyvHytn-.js} +1 -1
- package/dist/client/assets/{index-C98EzEx6.js → index-KerpDg0f.js} +1 -1
- package/dist/client/assets/{index-C_yGpzc7.js → index-iV247muO.js} +1 -1
- package/dist/client/assets/{index-DTTgUjL4.js → index-z6P4iLmn.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-B091eeMg.js → infiniteQueryObserver-DG4oU5QG.js} +1 -1
- package/dist/client/assets/{input-CjWKkTcV.js → input-DDq-8B8D.js} +1 -1
- package/dist/client/assets/{integration-icon-Daxcsp7E.js → integration-icon-nAICH2vf.js} +1 -1
- package/dist/client/assets/{label-CuUYxm88.js → label-Bkzo9n9W.js} +1 -1
- package/dist/client/assets/{layout-BeSp3Oh9.js → layout-hGgp6KcA.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-CwFVPVmY.js → lean-canvas-recruit-modal-Caab3ket.js} +1 -1
- package/dist/client/assets/{login-B9iFfUWB.js → login-DrUu9CAR.js} +1 -1
- package/dist/client/assets/{members-jW5-cfkB.js → members-B4BgapXa.js} +1 -1
- package/dist/client/assets/{monaco-editor-D_4gsArT.js → monaco-editor-Cf3iDvFI.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cd380L7N.js → monitoring-stats-row-BKSo1B8N.js} +1 -1
- package/dist/client/assets/{oauth-callback-BIIrmyR_.js → oauth-callback-C4APhxln.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Ct3x9lXY.js → oauth-callback-ai-provider-DqU9borq.js} +1 -1
- package/dist/client/assets/{onboarding-P0GSgrOf.js → onboarding-CWGzEGrE.js} +1 -1
- package/dist/client/assets/{org-layout-BJJDusCD.js → org-layout-CH2BSz6a.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-Ds6qy0vM.js → org-plugin-layout-BoB21QNL.js} +1 -1
- package/dist/client/assets/{pair-BFx5Qm41.js → pair-CsA-kA9X.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RSWe6UFb.js → plugin-empty-state-BQLMlF6o.js} +1 -1
- package/dist/client/assets/{plugin-header-CZW0YM31.js → plugin-header-DSRM-4yQ.js} +1 -1
- package/dist/client/assets/{plugin-layout-CKQPXqV_.js → plugin-layout-0l5aE9yu.js} +1 -1
- package/dist/client/assets/{popover-BsaIAZff.js → popover-D1LgcRgW.js} +1 -1
- package/dist/client/assets/{profile-DZGaisjJ.js → profile-_LtgicDY.js} +1 -1
- package/dist/client/assets/{project-app-view-DrCNkPvv.js → project-app-view-DCmHXwRc.js} +1 -1
- package/dist/client/assets/registry-Cg9k50mz.js +2 -0
- package/dist/client/assets/{registry-layout-BRdqsUee.js → registry-layout-D1Oo5n4g.js} +1 -1
- package/dist/client/assets/{required-auth-layout-d6mCY6f7.js → required-auth-layout-_LlHFgAQ.js} +1 -1
- package/dist/client/assets/{reset-password-BJIcH7kI.js → reset-password-BH07s9g0.js} +1 -1
- package/dist/client/assets/{roles--r_o8-6E.js → roles-BweIAPZg.js} +1 -1
- package/dist/client/assets/{scroll-area-QdubrRQt.js → scroll-area-DRfh3y2I.js} +1 -1
- package/dist/client/assets/{search-input-DQThAugc.js → search-input-LHp6WbZ8.js} +1 -1
- package/dist/client/assets/{select-Bc7FbSIp.js → select-DEYcF0JB.js} +1 -1
- package/dist/client/assets/select-model-BbmvZEL_.js +4 -0
- package/dist/client/assets/{settings-layout-BELegTve.js → settings-layout-Dg-MbJa4.js} +1 -1
- package/dist/client/assets/{settings-section-9_iK7u6X.js → settings-section-CnKm_zFi.js} +1 -1
- package/dist/client/assets/{shell-layout-Dp5_NwRV.js → shell-layout-BrapIdet.js} +1 -1
- package/dist/client/assets/{sidebar-DhPirxvV.js → sidebar-B9xBBJwp.js} +1 -1
- package/dist/client/assets/{skeleton-eCg5poGw.js → skeleton-BAst9SOO.js} +1 -1
- package/dist/client/assets/{spinner-Dxocm3j_.js → spinner-rKXgQqAk.js} +1 -1
- package/dist/client/assets/{sso-B4IKwnqS.js → sso-DW-lKH8S.js} +1 -1
- package/dist/client/assets/{store-DaysWhlR.js → store-ChsblA-_.js} +1 -1
- package/dist/client/assets/store-registry-DgSs_75r.js +2 -0
- package/dist/client/assets/{switch-B8o7MEY9.js → switch-CxAZv9yX.js} +1 -1
- package/dist/client/assets/{table-DYiQpBVl.js → table-BN6PHtUf.js} +1 -1
- package/dist/client/assets/{tabs-BCMGnbuG.js → tabs-DiNALrC0.js} +1 -1
- package/dist/client/assets/{task-status-C_2rdQW8.js → task-status-Bu4uKZob.js} +1 -1
- package/dist/client/assets/{textarea-C8ZFrqCw.js → textarea-CaaYBEq5.js} +1 -1
- package/dist/client/assets/{toggle-group-C-cIsKer.js → toggle-group-CLzH7VcU.js} +1 -1
- package/dist/client/assets/{tools-list-KDjJD9bB.js → tools-list-Bb9DL4-R.js} +1 -1
- package/dist/client/assets/{tooltip-3OBm7oI6.js → tooltip-Bw2Gbk6i.js} +1 -1
- package/dist/client/assets/{types-D4WcWxjq.js → types-BDSwKXoZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DvE8tTc0.js → use-ai-providers-dNlKFItH.js} +1 -1
- package/dist/client/assets/{use-collections-B_AeR68F.js → use-collections-DwzrzR7x.js} +1 -1
- package/dist/client/assets/{use-connection-fL8Bdy-2.js → use-connection-Cs4MqZHR.js} +1 -1
- package/dist/client/assets/{use-copy-BH9cfEYN.js → use-copy-D_36SjQe.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-vUi8t55-.js → use-create-virtual-mcp-DklejMow.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-IcGCZv-N.js → use-debounced-autosave-ePDNWMLl.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-1cGHr_e6.js → use-decopilot-events-BSdLD1zv.js} +1 -1
- package/dist/client/assets/{use-delete-connection-an2fbIpK.js → use-delete-connection-CnJi1BUf.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BLSqYlPF.js → use-infinite-scroll-BsRyX00I.js} +1 -1
- package/dist/client/assets/{use-list-state-aza5fd_3.js → use-list-state-qXvm0Rn6.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B4pwuY-v.js → use-mcp-tools-Bdf0_v40.js} +1 -1
- package/dist/client/assets/{use-members-B1BsOSEO.js → use-members-Dy9f9-ET.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B-DziSLT.js → use-navigate-to-agent-_FHkP3HP.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CQ4fKhJD.js → use-org-auth-client-Cyg62sX1.js} +1 -1
- package/dist/client/assets/{use-org-sso-DLgTKJXm.js → use-org-sso-D9MJvQ_s.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CnVpqv0t.js → use-organization-roles-DtglihXA.js} +1 -1
- package/dist/client/assets/{use-organization-settings-F4a6zVGw.js → use-organization-settings-oGq90ndm.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Dqv2-jKJ.js → use-registry-connections-BM5hIh0Z.js} +1 -1
- package/dist/client/assets/{use-status-sounds-u8Owkhk7.js → use-status-sounds-D_payzk4.js} +1 -1
- package/dist/client/assets/{use-tasks-C1EcT2Me.js → use-tasks-DjLQLna-.js} +1 -1
- package/dist/client/assets/{use-view-mode-DRlYzhbj.js → use-view-mode-BOjU5oCn.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CjWnWBVR.js → use-virtual-mcp-D0R2VmhD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dssa7ddx.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-g1_E19Vj.js +1 -0
- package/dist/client/assets/{user-BO8smULi.js → user-DR-uev4E.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-0NgrTiKE.js → view-mode-toggle-87gK3y50.js} +1 -1
- package/dist/client/assets/{workflow-j8cOJEmO.js → workflow-CHq9DO6y.js} +1 -1
- package/dist/client/assets/workflow-detail-CoEWiVrM.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/license +9 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/{postgres-array/license → xtend/LICENSE} +1 -2
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-BUwxJWPA.js +0 -1
- package/dist/client/assets/registry-ckfqFSXi.js +0 -2
- package/dist/client/assets/select-model-wWpcRuqG.js +0 -4
- package/dist/client/assets/store-registry-Cy1BNsop.js +0 -2
- package/dist/client/assets/useInfiniteQuery-fBvMjRX2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B0lprudQ.js +0 -1
- package/dist/client/assets/workflow-detail-D1bP-LWr.js +0 -1
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/license +0 -21
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xtend",
|
|
3
|
+
"version": "4.0.2",
|
|
4
|
+
"description": "extend like a boss",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"extend",
|
|
7
|
+
"merge",
|
|
8
|
+
"options",
|
|
9
|
+
"opts",
|
|
10
|
+
"object",
|
|
11
|
+
"array"
|
|
12
|
+
],
|
|
13
|
+
"author": "Raynos <raynos2@gmail.com>",
|
|
14
|
+
"repository": "git://github.com/Raynos/xtend.git",
|
|
15
|
+
"main": "immutable",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "node test"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"tape": "~1.1.0"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/Raynos/xtend",
|
|
24
|
+
"contributors": [
|
|
25
|
+
{
|
|
26
|
+
"name": "Jake Verbaten"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Matt Esch"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/Raynos/xtend/issues",
|
|
34
|
+
"email": "raynos2@gmail.com"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"testling": {
|
|
38
|
+
"files": "test.js",
|
|
39
|
+
"browsers": [
|
|
40
|
+
"ie/7..latest",
|
|
41
|
+
"firefox/16..latest",
|
|
42
|
+
"firefox/nightly",
|
|
43
|
+
"chrome/22..latest",
|
|
44
|
+
"chrome/canary",
|
|
45
|
+
"opera/12..latest",
|
|
46
|
+
"opera/next",
|
|
47
|
+
"safari/5.1..latest",
|
|
48
|
+
"ipad/6.0..latest",
|
|
49
|
+
"iphone/6.0..latest"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=0.4"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var test = require("tape")
|
|
2
|
+
var extend = require("./")
|
|
3
|
+
var mutableExtend = require("./mutable")
|
|
4
|
+
|
|
5
|
+
test("merge", function(assert) {
|
|
6
|
+
var a = { a: "foo" }
|
|
7
|
+
var b = { b: "bar" }
|
|
8
|
+
|
|
9
|
+
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
|
10
|
+
assert.end()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test("replace", function(assert) {
|
|
14
|
+
var a = { a: "foo" }
|
|
15
|
+
var b = { a: "bar" }
|
|
16
|
+
|
|
17
|
+
assert.deepEqual(extend(a, b), { a: "bar" })
|
|
18
|
+
assert.end()
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
test("undefined", function(assert) {
|
|
22
|
+
var a = { a: undefined }
|
|
23
|
+
var b = { b: "foo" }
|
|
24
|
+
|
|
25
|
+
assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
|
|
26
|
+
assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
|
|
27
|
+
assert.end()
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test("handle 0", function(assert) {
|
|
31
|
+
var a = { a: "default" }
|
|
32
|
+
var b = { a: 0 }
|
|
33
|
+
|
|
34
|
+
assert.deepEqual(extend(a, b), { a: 0 })
|
|
35
|
+
assert.deepEqual(extend(b, a), { a: "default" })
|
|
36
|
+
assert.end()
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test("is immutable", function (assert) {
|
|
40
|
+
var record = {}
|
|
41
|
+
|
|
42
|
+
extend(record, { foo: "bar" })
|
|
43
|
+
assert.equal(record.foo, undefined)
|
|
44
|
+
assert.end()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test("null as argument", function (assert) {
|
|
48
|
+
var a = { foo: "bar" }
|
|
49
|
+
var b = null
|
|
50
|
+
var c = void 0
|
|
51
|
+
|
|
52
|
+
assert.deepEqual(extend(b, a, c), { foo: "bar" })
|
|
53
|
+
assert.end()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test("mutable", function (assert) {
|
|
57
|
+
var a = { foo: "bar" }
|
|
58
|
+
|
|
59
|
+
mutableExtend(a, { bar: "baz" })
|
|
60
|
+
|
|
61
|
+
assert.equal(a.bar, "baz")
|
|
62
|
+
assert.end()
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
test("null prototype", function(assert) {
|
|
66
|
+
var a = { a: "foo" }
|
|
67
|
+
var b = Object.create(null)
|
|
68
|
+
b.b = "bar";
|
|
69
|
+
|
|
70
|
+
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
|
71
|
+
assert.end()
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
test("null prototype mutable", function (assert) {
|
|
75
|
+
var a = { foo: "bar" }
|
|
76
|
+
var b = Object.create(null)
|
|
77
|
+
b.bar = "baz";
|
|
78
|
+
|
|
79
|
+
mutableExtend(a, b)
|
|
80
|
+
|
|
81
|
+
assert.equal(a.bar, "baz")
|
|
82
|
+
assert.end()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
test("prototype pollution", function (assert) {
|
|
86
|
+
var a = {}
|
|
87
|
+
var maliciousPayload = '{"__proto__":{"oops":"It works!"}}'
|
|
88
|
+
|
|
89
|
+
assert.strictEqual(a.oops, undefined)
|
|
90
|
+
extend({}, maliciousPayload)
|
|
91
|
+
assert.strictEqual(a.oops, undefined)
|
|
92
|
+
assert.end()
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
test("prototype pollution mutable", function (assert) {
|
|
96
|
+
var a = {}
|
|
97
|
+
var maliciousPayload = '{"__proto__":{"oops":"It works!"}}'
|
|
98
|
+
|
|
99
|
+
assert.strictEqual(a.oops, undefined)
|
|
100
|
+
mutableExtend({}, maliciousPayload)
|
|
101
|
+
assert.strictEqual(a.oops, undefined)
|
|
102
|
+
assert.end()
|
|
103
|
+
})
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as W,J as v,aJ as ge,aH as fe,aZ as we,ap as Ne,aI as ve,e as L,D as Oe,z as ze,r as z,j as s,C as je,x as Z,M as Ae,s as de,o as he,a as oe,K as J,n as Le,c as _e,B as Q,t as De,E as qe}from"./index-DTTgUjL4.js";import{i as Ue}from"./AlertCircle-7o1P0zzm.js";import{P as ae}from"./index-IoVTnIlz.js";import{S as xe}from"./skeleton-eCg5poGw.js";import{b as pe,S as be,a as ye,d as Be}from"./settings-section-9_iK7u6X.js";import{u as re,a as ce,b as Ge}from"./use-ai-providers-DvE8tTc0.js";import{i as Ve}from"./CheckCircle-A2guVcAG.js";import{p as Qe}from"./chat-context-CdZvecT8.js";import{e as Ye,f as We}from"./use-organization-settings-F4a6zVGw.js";import{M as He,O as Je,C as ke}from"./select-model-wWpcRuqG.js";import{u as Ze}from"./use-debounced-autosave-IcGCZv-N.js";import{I as Xe}from"./input-CjWKkTcV.js";import{a as Ce,T as et}from"./toggle-group-C-cIsKer.js";import{b as Pe,c as Ee,d as Ke,f as $e,a as Fe,e as Me,g as Re,A as Te}from"./alert-dialog-DS13tR4C.js";import{S as me,u as ue}from"./constants-Pxhsjio1.js";import{E as tt}from"./empty-state-DmNyyTs_.js";import{s as st}from"./Plus-CKCuUTsd.js";import{i as it}from"./Check-Dz5ZLQmL.js";import{i as ot}from"./Tool01-bqF4BUeR.js";import{s as rt}from"./Trash01-BqVS-Vu_.js";import{i as nt}from"./X-Bs68LwBc.js";import{A as lt}from"./avatar-CmUFzi3F.js";import{f as at}from"./formatDistanceToNow-Cb2QZZJn.js";import"./sidebar-DhPirxvV.js";import"./LayoutLeft-BCU3zX1U.js";import"./tooltip-3OBm7oI6.js";import"./card-D-Cbo6xY.js";import"./ArrowUpRight-C3mm8yK_.js";import"./use-virtual-mcp-CjWnWBVR.js";import"./use-collections-B_AeR68F.js";import"./use-decopilot-events-1cGHr_e6.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-C1EcT2Me.js";import"./checkbox-DMz97A6W.js";import"./dialog-C_Z_peKj.js";import"./drawer-Zoq78wzr.js";import"./select-Bc7FbSIp.js";import"./ChevronDown-Bau6LlOi.js";import"./ChevronUp-COL031vn.js";import"./RefreshCcw01-8Ibm16Pu.js";import"./SearchMd-AJN6VuJg.js";import"./Settings02-CDcaxP04.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-DhYtqMa9.js";import"./spinner-Dxocm3j_.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./User01-B9MhRcqZ.js";import"./differenceInSeconds-NQ4PDo0z.js";W({title:v(),url:v(),icon:v()});W({registries:fe(v(),W({enabled:we()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ge(v()).describe("List of MCP app_name or app_id values to hide from the store.")});const ie=W({keyId:v(),modelId:v(),title:v().optional()}).nullable();Ne(["fast","smart","thinking","image","web_research"]);Ne(["fast","smart","thinking"]);const ct=W({tiers:W({fast:ie,smart:ie,thinking:ie,image:ie,web_research:ie})});W({ids:ge(v()).describe("Ordered list of agent ids to show on the home view. Mix of well-known template ids and custom virtual MCP ids.")});W({id:v().describe("Brand context ID"),name:v().describe("Company name"),domain:v().describe("Company domain (e.g. example.com)"),overview:v().describe("Company overview / description"),logo:v().nullable().optional().describe("Logo URL"),favicon:v().nullable().optional().describe("Favicon URL"),ogImage:v().nullable().optional().describe("OG image URL"),fonts:W({heading:v().optional().describe("Font family for headings"),body:v().optional().describe("Font family for body text"),code:v().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:W({primary:v().optional().describe("Primary brand color (hex)"),secondary:v().optional().describe("Secondary brand color (hex)"),accent:v().optional().describe("Accent / highlight color (hex)"),background:v().optional().describe("Background color (hex)"),foreground:v().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ge(fe(v(),ve())).nullable().optional().describe("Brand images"),metadata:fe(v(),ve()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:v().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:we().optional().describe("Whether this is the default brand for the organization")});const dt=e=>e.capabilities?.includes("image")===!0,mt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},Ie=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:dt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:mt}];function Se(e){const t=L.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:c}=e,r=re(),[l,u]=z.useState(i?.keyId??c);let x;t[0]!==i?(x=()=>{i?.keyId&&u(i.keyId)},t[0]=i,t[1]=x):x=t[1];const p=i?.keyId;let f;t[2]!==p?(f=[p],t[2]=p,t[3]=f):f=t[3],z.useEffect(x,f);const a=l??c;let g;t[4]!==a||t[5]!==r?(g=a?r.find(d=>d.id===a):null,t[4]=a,t[5]=r,t[6]=g):g=t[6];const S=g,{models:b,isLoading:_}=ce(o?a??void 0:void 0),k=o?_||b.some(o):!0;let C;t[7]!==i||t[8]!==S?.providerId?(C=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:S?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=S?.providerId,t[9]=C):C=t[9];const j=C;if(o&&!k){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=d=>u(d),t[11]=I):I=t[11];let y;t[12]!==a||t[13]!==n?(y=d=>{const A=d.keyId??a??"";u(A),n({keyId:A,modelId:d.modelId,title:d.title})},t[12]=a,t[13]=n,t[14]=y):y=t[14];let w;return t[15]!==a||t[16]!==o||t[17]!==j||t[18]!==y?(w=s.jsx(He,{variant:"bordered",placeholder:"Pick model",model:j,credentialId:a,filterModels:o,onCredentialChange:I,onModelChange:y}),t[15]=a,t[16]=o,t[17]=j,t[18]=y,t[19]=w):w=t[19],w}function ut(e){const t=L.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ae,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ve,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function ft(){const e=L.c(46),t=re(),i=Ye(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Oe(ct),e[0]=o):o=e[0];let c;e[1]!==i?(c={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=c):c=e[2];const r=ze(c),{mutate:l,isPending:u,isSuccess:x}=We(),p=r.formState.isDirty;let f;e[3]!==r||e[4]!==i||e[5]!==l?(f={delayMs:250,save:async()=>{const m=r.getValues();l(m,{onSuccess:()=>r.reset(m,{keepValues:!0}),onError:K=>{r.reset(i),Z.error(`Failed to save: ${K.message}`)}})}},e[3]=r,e[4]=i,e[5]=l,e[6]=f):f=e[6];const{schedule:a}=Ze(f),g=t[0],S=t[1],b=t[2],{models:_}=ce(g?.id),{models:k}=ce(S?.id),{models:C}=ce(b?.id);let j,I;e[7]!==r||e[8]!==n?(j=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=j,e[10]=I):(j=e[9],I=e[10]),z.useEffect(j,I);let y;e[11]!==t||e[12]!==r||e[13]!==g||e[14]!==S||e[15]!==b||e[16]!==_||e[17]!==k||e[18]!==C?(y=()=>{const m=r.getValues(),K=new Set(t.map(pt)),P={};g?.id&&(P[g.id]=_),S?.id&&(P[S.id]=k),b?.id&&(P[b.id]=C);const N=M=>M!=null&&!K.has(M.keyId),h={fast:N(m.tiers.fast)?null:m.tiers.fast,smart:N(m.tiers.smart)?null:m.tiers.smart,thinking:N(m.tiers.thinking)?null:m.tiers.thinking,image:N(m.tiers.image)?null:m.tiers.image,web_research:N(m.tiers.web_research)?null:m.tiers.web_research},T=!h.fast||!h.smart||!h.thinking||!h.image||!h.web_research,V=h.fast===m.tiers.fast&&h.smart===m.tiers.smart&&h.thinking===m.tiers.thinking&&h.image===m.tiers.image&&h.web_research===m.tiers.web_research;if(!T&&V)return;const F=Qe(t,P);r.reset({tiers:{fast:h.fast??F.chat.fast,smart:h.smart??F.chat.smart,thinking:h.thinking??F.chat.thinking,image:h.image??F.image,web_research:h.web_research??F.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=g,e[14]=S,e[15]=b,e[16]=_,e[17]=k,e[18]=C,e[19]=y):y=e[19];const w=g?.id,d=S?.id,A=b?.id;let q;e[20]!==t||e[21]!==r||e[22]!==_||e[23]!==k||e[24]!==C||e[25]!==w||e[26]!==d||e[27]!==A?(q=[r,t,_,k,C,w,d,A],e[20]=t,e[21]=r,e[22]=_,e[23]=k,e[24]=C,e[25]=w,e[26]=d,e[27]=A,e[28]=q):q=e[28],z.useEffect(y,q);let U;e[29]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("p",{className:"text-sm text-muted-foreground -mt-2 mb-2",children:"These models power chat, automations, and tools across your organization."}),e[29]=U):U=e[29];const G=x&&!p;let D;e[30]!==u||e[31]!==G?(D=s.jsx("div",{className:"flex items-center justify-end px-5 py-2",children:s.jsx(ut,{isPending:u,showSaved:G})}),e[30]=u,e[31]=G,e[32]=D):D=e[32];let E;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==a?(E=Ie.slice(0,3).map(m=>s.jsx(je,{control:r.control,name:`tiers.${m.key}`,render:K=>{const{field:P}=K;return s.jsx(pe,{title:m.label,description:m.description,action:s.jsx(Se,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:m.filter,onSlotChange:N=>{P.onChange(N),a()}})})}},m.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=a,e[36]=E):E=e[36];let O;e[37]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"h-px bg-border mx-5"}),e[37]=O):O=e[37];let $;e[38]!==t[0]?.id||e[39]!==r.control||e[40]!==a?($=Ie.slice(3).map(m=>s.jsx(je,{control:r.control,name:`tiers.${m.key}`,render:K=>{const{field:P}=K;return s.jsx(pe,{title:m.label,description:m.description,action:s.jsx(Se,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:m.filter,onSlotChange:N=>{P.onChange(N),a()}})})}},m.key)),e[38]=t[0]?.id,e[39]=r.control,e[40]=a,e[41]=$):$=e[41];let R;return e[42]!==D||e[43]!==E||e[44]!==$?(R=s.jsxs(be,{title:"Default models",headerClassName:"pl-0",children:[U,s.jsxs(ye,{children:[D,E,O,$]})]}),e[42]=D,e[43]=E,e[44]=$,e[45]=R):R=e[45],R}function pt(e){return e.id}const gt={usd:[10,20,100],brl:[50,100,500]};function ht(){const e=L.c(29),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),[o,c]=z.useState(!1),{mutate:r,isPending:l}=oe({mutationFn:async d=>{const A=await n.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:a}});if(A?.isError)throw new Error(A.content?.[0]?.text??"Failed to get top-up URL");return A.structuredContent?.url},onSuccess:bt,onError:xt}),[u,x]=z.useState(""),[p,f]=z.useState("usd"),a=p,g=parseFloat(u),S=!isNaN(g)&&g>=1,b=a==="brl"?"R$":"$";let _;e[3]!==f?(_=d=>{d&&f(d)},e[3]=f,e[4]=_):_=e[4];let k,C;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ce,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),C=s.jsx(Ce,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=k,e[6]=C):(k=e[5],C=e[6]);let j;e[7]!==a||e[8]!==_?(j=s.jsxs(et,{type:"single",variant:"outline",size:"default",value:a,onValueChange:_,children:[k,C]}),e[7]=a,e[8]=_,e[9]=j):j=e[9];let I;e[10]!==a||e[11]!==b||e[12]!==o||e[13]!==l||e[14]!==r?(I=!o&&s.jsxs(s.Fragment,{children:[gt[a].map(d=>s.jsxs(Q,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(d*100),children:[b,d]},d)),s.jsx(Q,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>c(!0),disabled:l,children:"Custom"})]}),e[10]=a,e[11]=b,e[12]=o,e[13]=l,e[14]=r,e[15]=I):I=e[15];let y;e[16]!==b||e[17]!==u||e[18]!==g||e[19]!==o||e[20]!==S||e[21]!==l||e[22]!==x||e[23]!==r?(y=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:b}),s.jsx(Xe,{type:"number",min:"1",step:"1",placeholder:"50",value:u,onChange:d=>x(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(Q,{className:"h-10",disabled:!S||l,onClick:()=>r(Math.round(g*100)),children:l?"...":"Add"}),s.jsx(Q,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{c(!1),x("")},children:"Cancel"})]}),e[16]=b,e[17]=u,e[18]=g,e[19]=o,e[20]=S,e[21]=l,e[22]=x,e[23]=r,e[24]=y):y=e[24];let w;return e[25]!==j||e[26]!==I||e[27]!==y?(w=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,I,y]})}),e[25]=j,e[26]=I,e[27]=y,e[28]=w):w=e[28],w}function xt(e){Z.error(`Top-up failed: ${e.message}`)}function bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function yt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function vt(){const e=L.c(61),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=he(),c=re();let r;e[3]!==c?(r=c.find(_t),e[3]=c,e[4]=r):r=e[4];const l=r,[u,x]=z.useState(!1);let p;e[5]!==n||e[6]!==l?(p=async()=>{l&&await n.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:l.id}})},e[5]=n,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==t.id||e[9]!==o?(f=()=>{o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway disconnected"),x(!1)},e[8]=t.id,e[9]=o,e[10]=f):f=e[10];let a;e[11]!==p||e[12]!==f?(a={mutationFn:p,onSuccess:f,onError:jt},e[11]=p,e[12]=f,e[13]=a):a=e[13];const{mutate:g,isPending:S}=oe(a);let b;e[14]!==t.id?(b=J.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=b):b=e[15];const _=!!l;let k;e[16]!==n?(k=async()=>{const X=await n.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return X?.isError?null:X.structuredContent??null},e[16]=n,e[17]=k):k=e[17];let C;e[18]!==b||e[19]!==_||e[20]!==k?(C={queryKey:b,enabled:_,staleTime:6e4,queryFn:k},e[18]=b,e[19]=_,e[20]=k,e[21]=C):C=e[21];const{data:j,isLoading:I,refetch:y,isFetching:w}=Le(C);if(!l)return null;const d=j?.balanceCents!=null?j.balanceCents/100:null;let A;e[22]!==d?(A=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=A):A=e[23];const q=A;let U;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=U):U=e[24];let G;e[25]===Symbol.for("react.memo_cache_sentinel")?(G=()=>x(!0),e[25]=G):G=e[25];let D;e[26]!==S?(D=s.jsxs("div",{className:"flex items-center justify-between",children:[U,s.jsx(Q,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:G,disabled:S,children:"Disconnect"})]}),e[26]=S,e[27]=D):D=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs(Pe,{children:[s.jsx(Ee,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ke,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=E):E=e[28];let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx($e,{children:"Cancel"}),e[29]=O):O=e[29];let $;e[30]!==g?($=s.jsxs(Fe,{children:[E,s.jsxs(Me,{children:[O,s.jsx(Re,{onClick:()=>g(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=g,e[31]=$):$=e[31];let R;e[32]!==u||e[33]!==$?(R=s.jsx(Te,{open:u,onOpenChange:x,children:$}),e[32]=u,e[33]=$,e[34]=R):R=e[34];let m;e[35]!==d||e[36]!==q||e[37]!==w||e[38]!==I?(m=I||w?s.jsx(xe,{className:"h-9 w-24"}):s.jsx("span",{className:_e("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&yt(d)),children:q}),e[35]=d,e[36]=q,e[37]=w,e[38]=I,e[39]=m):m=e[39];let K;e[40]!==y?(K=()=>y(),e[40]=y,e[41]=K):K=e[41];const P=w&&"animate-spin";let N;e[42]!==P?(N=_e(P),e[42]=P,e[43]=N):N=e[43];let h;e[44]!==N?(h=s.jsx(Ae,{size:14,className:N}),e[44]=N,e[45]=h):h=e[45];let T;e[46]!==w||e[47]!==K||e[48]!==h?(T=s.jsx("button",{type:"button",onClick:K,disabled:w,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:h}),e[46]=w,e[47]=K,e[48]=h,e[49]=T):T=e[49];let V;e[50]!==m||e[51]!==T?(V=s.jsxs("div",{className:"flex items-baseline gap-2",children:[m,T]}),e[50]=m,e[51]=T,e[52]=V):V=e[52];let F;e[53]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=F):F=e[53];let M;e[54]!==V?(M=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[V,F]}),e[54]=V,e[55]=M):M=e[55];let H;e[56]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(ht,{})]}),e[56]=H):H=e[56];let Y;return e[57]!==D||e[58]!==R||e[59]!==M?(Y=s.jsx(be,{title:"Deco AI Gateway",children:s.jsx(ye,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[D,R,M,H]})})}),e[57]=D,e[58]=R,e[59]=M,e[60]=Y):Y=e[60],Y}function jt(e){Z.error(`Failed to disconnect: ${e.message}`)}function _t(e){return e.providerId==="deco"}function kt(){const e=L.c(11),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=he();let c;e[3]!==n?(c=async()=>{const u=await n.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(u?.isError)throw new Error(u.content?.[0]?.text??"Key provisioning failed")},e[3]=n,e[4]=c):c=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{De("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let l;return e[8]!==c||e[9]!==r?(l={mutationFn:c,onSuccess:r,onError:Ct},e[8]=c,e[9]=r,e[10]=l):l=e[10],oe(l)}function Ct(e){De("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Z.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function It(){const e=L.c(8),{mutate:t,isPending:i}=kt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-8 shrink-0 rounded-md object-contain dark:bg-white dark:p-0.5"}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n,s.jsxs("div",{className:"min-w-0",children:[s.jsxs("p",{className:"text-sm font-medium",children:["Try Deco AI Gateway",s.jsx("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:"Access 100+ models with one connection — managed credits, no key juggling."})]})]}),e[1]=o):o=e[1];let c;e[2]!==t?(c=()=>t(),e[2]=t,e[3]=c):c=e[3];const r=i?"Connecting…":"Connect Deco";let l;return e[4]!==i||e[5]!==c||e[6]!==r?(l=s.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-muted/30 px-4 py-3",children:[o,s.jsx(Q,{size:"sm",variant:"outline",disabled:i,onClick:c,children:r})]}),e[4]=i,e[5]=c,e[6]=r,e[7]=l):l=e[7],l}function St(e){const t=L.c(2),{onConnectClick:i}=e;let n;return t[0]!==i?(n=s.jsx(tt,{title:"No AI providers connected",description:"Connect a provider to start using AI in your workspace.",actions:s.jsx(Q,{onClick:i,children:"Connect provider"})}),t[0]=i,t[1]=n):n=t[1],n}function wt(e){const t=L.c(70),{providerKey:i,provider:n}=e,{org:o}=de();let c;t[0]!==o.id||t[1]!==o.slug?(c={connectionId:me,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=c):c=t[2];const r=ue(c),l=he(),[u,x]=z.useState(!1),[p,f]=z.useState(!1),[a,g]=z.useState(i.label);let S;t[3]!==n.supportedMethods?(S=n.supportedMethods.includes("cli-activate"),t[3]=n.supportedMethods,t[4]=S):S=t[4];const b=S,_=n.id==="openai-compatible";let k;t[5]!==_||t[6]!==i.presetId?(k=_&&i.presetId?Je.find(B=>B.id===i.presetId):void 0,t[5]=_,t[6]=i.presetId,t[7]=k):k=t[7];const C=k,j=C?C.name:_?"Custom OpenAI-compatible":n.name,I=C?.logo??n.logo;let y;e:{if(b){y="Authenticated via CLI";break e}if(_){y=i.label;break e}const B=i.label;let le;t[8]!==i.createdAt?(le=at(new Date(i.createdAt)),t[8]=i.createdAt,t[9]=le):le=t[9],y=`${B} · added ${le} ago`}const w=y;let d;t[10]!==r||t[11]!==i.id?(d=async B=>{await r.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:i.id,label:B}})},t[10]=r,t[11]=i.id,t[12]=d):d=t[12];let A;t[13]!==o.id||t[14]!==l?(A=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),f(!1)},t[13]=o.id,t[14]=l,t[15]=A):A=t[15];let q;t[16]!==d||t[17]!==A?(q={mutationFn:d,onSuccess:A,onError:At},t[16]=d,t[17]=A,t[18]=q):q=t[18];const{mutate:U,isPending:G}=oe(q);let D;t[19]!==r||t[20]!==i.id?(D=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[19]=r,t[20]=i.id,t[21]=D):D=t[21];let E;t[22]!==o.id||t[23]!==i.id||t[24]!==l?(E=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),l.invalidateQueries({queryKey:J.aiProviders(o.id)}),l.invalidateQueries({queryKey:J.aiProviderModels(o.id,i.id)}),Z.success("Key deleted"),x(!1)},t[22]=o.id,t[23]=i.id,t[24]=l,t[25]=E):E=t[25];let O;t[26]!==D||t[27]!==E?(O={mutationFn:D,onSuccess:E,onError:Nt},t[26]=D,t[27]=E,t[28]=O):O=t[28];const{mutate:$,isPending:R}=oe(O);let m;t[29]!==i.label?(m=()=>{g(i.label),f(!0)},t[29]=i.label,t[30]=m):m=t[30];const K=m;let P;t[31]!==a||t[32]!==U?(P=()=>{const B=a.trim();B&&U(B)},t[31]=a,t[32]=U,t[33]=P):P=t[33];const N=P;let h;t[34]!==j||t[35]!==I?(h=I?s.jsx("img",{src:I,alt:j,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(lt,{fallback:j.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[34]=j,t[35]=I,t[36]=h):h=t[36];let T;t[37]!==j||t[38]!==a||t[39]!==p||t[40]!==N?(T=p?s.jsx("input",{autoFocus:!0,className:"font-medium bg-transparent border-b border-border outline-none w-full",value:a,onChange:B=>g(B.target.value),onKeyDown:B=>{B.key==="Enter"&&N(),B.key==="Escape"&&f(!1)}}):j,t[37]=j,t[38]=a,t[39]=p,t[40]=N,t[41]=T):T=t[41];const V=p?null:w;let F;t[42]!==a||t[43]!==p||t[44]!==b||t[45]!==R||t[46]!==G||t[47]!==K||t[48]!==N?(F=s.jsx("div",{className:"flex items-center gap-0.5",children:p?s.jsxs(s.Fragment,{children:[s.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",disabled:G||!a.trim(),onClick:N,children:s.jsx(it,{size:14})}),s.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>f(!1),children:s.jsx(nt,{size:14})})]}):s.jsxs(s.Fragment,{children:[!b&&s.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:K,children:s.jsx(ot,{size:14})}),s.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:R,onClick:()=>x(!0),children:s.jsx(rt,{size:14})})]})}),t[42]=a,t[43]=p,t[44]=b,t[45]=R,t[46]=G,t[47]=K,t[48]=N,t[49]=F):F=t[49];let M;t[50]!==h||t[51]!==T||t[52]!==V||t[53]!==F?(M=s.jsx(pe,{icon:h,title:T,description:V,action:F}),t[50]=h,t[51]=T,t[52]=V,t[53]=F,t[54]=M):M=t[54];let H;t[55]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ee,{children:"Delete API Key"}),t[55]=H):H=t[55];let Y;t[56]!==i.label?(Y=s.jsxs(Pe,{children:[H,s.jsxs(Ke,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[56]=i.label,t[57]=Y):Y=t[57];let X;t[58]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx($e,{children:"Cancel"}),t[58]=X):X=t[58];let ee;t[59]!==$?(ee=s.jsxs(Me,{children:[X,s.jsx(Re,{onClick:()=>$(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[59]=$,t[60]=ee):ee=t[60];let te;t[61]!==Y||t[62]!==ee?(te=s.jsxs(Fe,{children:[Y,ee]}),t[61]=Y,t[62]=ee,t[63]=te):te=t[63];let se;t[64]!==u||t[65]!==te?(se=s.jsx(Te,{open:u,onOpenChange:x,children:te}),t[64]=u,t[65]=te,t[66]=se):se=t[66];let ne;return t[67]!==M||t[68]!==se?(ne=s.jsxs(s.Fragment,{children:[M,se]}),t[67]=M,t[68]=se,t[69]=ne):ne=t[69],ne}function Nt(e){return Z.error(`Failed to delete key: ${e.message}`)}function At(){return Z.error("Failed to update key label")}function Dt(e){const t=L.c(11),{onConnectClick:i}=e,n=re(),o=Ge();let c;t[0]!==o?.providers?(c=o?.providers??[],t[0]=o?.providers,t[1]=c):c=t[1];const r=c;let l;if(t[2]!==n||t[3]!==i||t[4]!==r){let u;t[6]!==r?(u=a=>({key:a,provider:r.find(g=>g.id===a.providerId)}),t[6]=r,t[7]=u):u=t[7];const x=n.filter(Kt).map(u).filter(Et);let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(st,{size:14}),t[8]=p):p=t[8];let f;t[9]!==i?(f=s.jsxs(Q,{size:"sm",onClick:i,children:[p,"Connect provider"]}),t[9]=i,t[10]=f):f=t[10],l=s.jsx(be,{title:"Connected providers",headerClassName:"px-0",actions:f,children:x.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ye,{children:x.map(Pt)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=l}else l=t[5];return l}function Pt(e){const{key:t,provider:i}=e;return s.jsx(wt,{providerKey:t,provider:i},t.id)}function Et(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function $t(e){const t=L.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ue,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=L.c(14),t=re();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[c,r]=z.useState(!1);if(!o){let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(St,{onConnectClick:()=>r(!0)}),e[2]=a):a=e[2];let g;return e[3]!==c?(g=s.jsxs(s.Fragment,{children:[a,s.jsx(ke,{open:c,onOpenChange:r})]}),e[3]=c,e[4]=g):g=e[4],g}let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(z.Suspense,{fallback:s.jsx(xe,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[5]=l):l=e[5];let u;e[6]!==n?(u=n?s.jsx(vt,{}):s.jsx(It,{}),e[6]=n,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Dt,{onConnectClick:()=>r(!0)}),e[8]=x):x=e[8];let p;e[9]!==c?(p=s.jsx(ke,{open:c,onOpenChange:r}),e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==u||e[12]!==p?(f=s.jsxs(s.Fragment,{children:[l,u,x,p]}),e[11]=u,e[12]=p,e[13]=f):f=e[13],f}function Mt(e){return e.providerId==="deco"}function Rt(){const e=L.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ae.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{children:s.jsx(ae.Content,{children:s.jsx(ae.Body,{children:s.jsxs(Be,{children:[t,s.jsx(qe,{fallback:Tt,children:s.jsx(z.Suspense,{fallback:s.jsx(xe,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Tt(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Ks(){const e=L.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Rt,{}),e[0]=t):t=e[0],t}export{Ks as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BRdqsUee.js","assets/index-DTTgUjL4.js","assets/index-CzeuUc9U.css","assets/ArrowNarrowLeft-qDflnb8N.js","assets/CheckCircle-A2guVcAG.js","assets/Container-BcMn23kd.js","assets/Settings02-CDcaxP04.js","assets/XCircle-H0Nc2jh5.js","assets/constants-Pxhsjio1.js","assets/useInfiniteQuery-fBvMjRX2.js","assets/infiniteQueryObserver-B091eeMg.js","assets/badge-DTxL6xUH.js","assets/input-CjWKkTcV.js","assets/dropdown-menu-D2TItq8w.js","assets/Check-Dz5ZLQmL.js","assets/ChevronRight-ChQ95U2k.js","assets/DotsVertical-CII1YBBc.js","assets/table-DYiQpBVl.js","assets/toggle-group-C-cIsKer.js","assets/use-view-mode-DRlYzhbj.js","assets/tooltip-3OBm7oI6.js","assets/SearchMd-AJN6VuJg.js","assets/dialog-C_Z_peKj.js","assets/X-Bs68LwBc.js","assets/AlertCircle-7o1P0zzm.js","assets/alert-dialog-DS13tR4C.js","assets/card-D-Cbo6xY.js","assets/Trash01-BqVS-Vu_.js","assets/label-CuUYxm88.js","assets/select-Bc7FbSIp.js","assets/ChevronDown-Bau6LlOi.js","assets/ChevronUp-COL031vn.js","assets/switch-B8o7MEY9.js","assets/textarea-C8ZFrqCw.js","assets/RefreshCcw01-8Ibm16Pu.js","assets/checkbox-DMz97A6W.js","assets/LinkExternal01-oqIx4SAa.js","assets/use-copy-BH9cfEYN.js","assets/Plus-CKCuUTsd.js","assets/Play-BZl-q_yI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as a,j as t,r,l as i,_ as o}from"./index-DTTgUjL4.js";const n=r.lazy(()=>o(()=>import("./registry-layout-BRdqsUee.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])));function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(i,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(n,{})}),s[0]=e):e=s[0],e}export{c as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as R,ao as Ze,e as U,j as s,H as Oe,J as oe,s as re,o as xe,D as Ae,z as Te,a as ae,K as te,x as Q,B as J,t as X,u as et,c as me,n as tt,f as st,E as it,y as nt}from"./index-DTTgUjL4.js";import{C as lt}from"./checkbox-DMz97A6W.js";import{I as le}from"./input-CjWKkTcV.js";import{D as ze,b as Le,a as Re,c as rt,d as Pe,e as ot,h as at}from"./dialog-C_Z_peKj.js";import{g as ct,D as dt,a as mt,b as ut}from"./drawer-Zoq78wzr.js";import{u as ht}from"./tooltip-3OBm7oI6.js";import{S as ft,a as pt,b as xt,c as gt,d as vt}from"./select-Bc7FbSIp.js";import{S as W}from"./skeleton-eCg5poGw.js";import{c as bt,t as yt,b as jt,a as St,d as Nt}from"./Tool01-bqF4BUeR.js";import{b as Fe,s as $e,i as Ke,c as kt,a as wt}from"./RefreshCcw01-8Ibm16Pu.js";import{t as ye}from"./ChevronDown-Bau6LlOi.js";import{i as De,a as _t}from"./SearchMd-AJN6VuJg.js";import{a as It}from"./Settings02-CDcaxP04.js";import{b as Ue,u as Ct,a as Et}from"./use-ai-providers-DvE8tTc0.js";import{b as Be}from"./chat-context-CdZvecT8.js";import{g as ge}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Zap-DhYtqMa9.js";import{i as Ot}from"./AlertCircle-7o1P0zzm.js";import{S as je}from"./spinner-Dxocm3j_.js";import{S as ue,u as he}from"./constants-Pxhsjio1.js";import{A as At}from"./avatar-CmUFzi3F.js";import{S as fe,a as pe,b as Tt}from"./settings-section-9_iK7u6X.js";import{u as zt}from"./unwrap-tool-result-BYXdCQMg.js";function ie(i,e,t){let n=t.initialDeps??[],l,r=!0;function a(){var o,c,m;let u;t.key&&((o=t.debug)!=null&&o.call(t))&&(u=Date.now());const x=i();if(!(x.length!==n.length||x.some((g,v)=>n[v]!==g)))return l;n=x;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),l=e(...x),t.key&&((m=t.debug)!=null&&m.call(t))){const g=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-f)*100)/100,_=v/16,N=(k,C)=>{for(k=String(k);k.length<C;)k=" "+k;return k};console.info(`%c⏱ ${N(v,5)} /${N(g,5)} ms`,`
|
|
2
|
-
font-size: .6rem;
|
|
3
|
-
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(r&&t.skipInitialOnChange)&&t.onChange(l),r=!1,l}return a.updateDeps=o=>{n=o},a}function Se(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Lt=(i,e)=>Math.abs(i-e)<1.01,Rt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Ne=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Pt=i=>i,Ft=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=a=>{const{width:o,height:c}=a;e({width:Math.round(o),height:Math.round(c)})};if(l(Ne(t)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver(a=>{const o=()=>{const c=a[0];if(c?.borderBoxSize){const m=c.borderBoxSize[0];if(m){l({width:m.inlineSize,height:m.blockSize});return}}l(Ne(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return r.observe(t,{box:"border-box"}),()=>{r.unobserve(t)}},ke={passive:!0},we=typeof window>"u"?!0:"onscrollend"in window,Kt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const r=i.options.useScrollendEvent&&we?()=>{}:Rt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),a=u=>()=>{const{horizontal:x,isRtl:p}=i.options;l=x?t.scrollLeft*(p&&-1||1):t.scrollTop,r(),e(l,u)},o=a(!0),c=a(!1);t.addEventListener("scroll",o,ke);const m=i.options.useScrollendEvent&&we;return m&&t.addEventListener("scrollend",c,ke),()=>{t.removeEventListener("scroll",o),m&&t.removeEventListener("scrollend",c)}},Dt=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ut=(i,{adjustments:e=0,behavior:t},n)=>{var l,r;const a=i+e;(r=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||r.call(l,{[n.options.horizontal?"left":"top"]:a,behavior:t})};class Bt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(r=>{const a=()=>{const o=r.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,r,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var r;return(r=n())==null?void 0:r.observe(l,{box:"border-box"})},unobserve:l=>{var r;return(r=n())==null?void 0:r.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Pt,rangeExtractor:Ft,onChange:()=>{},measureElement:Dt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=r,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,r=new Map;for(let a=n-1;a>=0;a--){const o=t[a];if(l.has(o.lane))continue;const c=r.get(o.lane);if(c==null||o.end>c.end?r.set(o.lane,o):o.end<c.end&&l.set(o.lane,!0),l.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,r,a,o,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:c},m)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const x=this.measurementsCache.slice(0,u),p=new Array(o).fill(void 0);for(let f=0;f<u;f++){const g=x[f];g&&(p[g.lane]=f)}for(let f=u;f<t;f++){const g=r(f),v=this.laneAssignments.get(f);let _,N;const k=c==="estimate"||m.has(g);if(v!==void 0&&this.options.lanes>1){_=v;const d=p[_],h=d!==void 0?x[d]:void 0;N=h?h.end+this.options.gap:n+l}else{const d=this.options.lanes===1?x[f-1]:this.getFurthestMeasurement(x,f);N=d?d.end+this.options.gap:n+l,_=d?d.lane:f%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(f,_)}const C=m.get(g),w=typeof C=="number"?C:this.options.estimateSize(f),E=N+w;x[f]={index:f,start:N,size:w,end:E,key:g,lane:_},p[_]=f}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,r)=>this.range=t.length>0&&n>0?Wt({measurements:t,outerSize:n,scrollOffset:l,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,r,a)=>r===null||a===null?[]:t({startIndex:r,endIndex:a,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,l-r),o=Math.min(this.options.count-1,l+r);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),r=this.elementsCache.get(l);r!==t&&(r&&this.observer.unobserve(r),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const r=this.measurementsCache[t];if(!r)return;const a=this.itemSizeCache.get(r.key)??r.size,o=n-a;o!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let r=0,a=t.length;r<a;r++){const o=t[r],c=n[o];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Se(n[We(0,n.length-1,l=>Se(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),a=this.getScrollOffset();n==="auto"&&(n=t>=a+r?"end":"start"),n==="center"?t+=(l-r)/2:n==="end"&&(t-=r);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),r=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(n==="auto")if(a.end>=r+l-this.options.scrollPaddingEnd)n="end";else if(a.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const o=n==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,a.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const r=this.getOffsetForAlignment(t,n),a=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:a,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.getOffsetForIndex(t,n);if(!r)return;const[a,o]=r,c=this.now();this.scrollState={index:t,align:o,behavior:l,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,r=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:r,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const r=Array(this.options.lanes).fill(null);let a=n.length-1;for(;a>=0&&r.some(o=>o===null);){const o=n[a];r[o.lane]===null&&(r[o.lane]=o.end),a--}l=Math.max(...r.filter(o=>o!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,r=1,a=l!==this.scrollState.lastTargetOffset;if(!a&&Lt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const We=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,r=t(l);if(r<n)i=l+1;else if(r>n)e=l-1;else return l}return i>0?i-1:0};function Wt({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,r=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let a=We(0,l,r,t),o=a;if(n===1)for(;o<l&&i[o].end<t+e;)o++;else if(n>1){const c=Array(n).fill(0);for(;o<l&&c.some(u=>u<t+e);){const u=i[o];c[u.lane]=u.end,o++}const m=Array(n).fill(t+e);for(;a>=0&&m.some(u=>u>=t);){const u=i[a];m[u.lane]=u.start,a--}a=Math.max(0,a-a%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:a,endIndex:o}}const _e=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Vt({useFlushSync:i=!0,...e}){const t=R.useReducer(()=>({}),{})[1],n={...e,onChange:(r,a)=>{var o;i&&a?Ze.flushSync(t):t(),(o=e.onChange)==null||o.call(e,r,a)}},[l]=R.useState(()=>new Bt(n));return l.setOptions(n),_e(()=>l._didMount(),[]),_e(()=>l._willUpdate()),l}function Ht(i){return Vt({observeElementRect:$t,observeElementOffset:Kt,scrollToFn:Ut,...i})}const ce=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ce.find(e=>e.id===i)}function ne(i){const e=U.c(8),{logo:t,name:n,description:l,onClick:r}=i;let a;e[0]!==t||e[1]!==n?(a=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(At,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o;return e[3]!==l||e[4]!==n||e[5]!==r||e[6]!==a?(o=s.jsx(Tt,{onClick:r,icon:a,title:n,description:l}),e[3]=l,e[4]=n,e[5]=r,e[6]=a,e[7]=o):o=e[7],o}function qt(i){const e=U.c(36),{providers:t,onSelect:n}=i;let l;e[0]!==t?(l=t.find(Zt),e[0]=t,e[1]=l):l=e[1];const r=l;let a,o,c,m,u,x;if(e[2]!==r||e[3]!==n||e[4]!==t){const v=t.filter(Jt);let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_={openrouter:0,anthropic:1,google:2},e[11]=_):_=e[11];const N=_;let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=(j,M)=>{const I=N[j.id]??Number.MAX_SAFE_INTEGER,O=N[M.id]??Number.MAX_SAFE_INTEGER;return I-O},e[12]=k):k=e[12];const C=t.filter(Qt).sort(k);let w;e[13]!==t?(w=t.find(Xt),e[13]=t,e[14]=w):w=e[14];const E=w;let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=ce.find(Yt),e[15]=d):d=e[15];const h=d;m="flex flex-col gap-6",e[16]!==r||e[17]!==n?(u=r&&s.jsx(fe,{children:s.jsxs("div",{className:"relative rounded-xl border border-primary/30 bg-gradient-to-br from-primary/10 via-transparent to-primary/5 dark:from-primary/15 dark:to-primary/5 p-4",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-primary/5 to-transparent pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-primary mb-3 relative",children:"Recommended — start in seconds, pay as you go"}),s.jsx(pe,{className:"relative",children:s.jsx(ne,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[16]=r,e[17]=n,e[18]=u):u=e[18],x=v.length>0&&s.jsx(fe,{children:s.jsxs("div",{className:"relative rounded-xl border border-lime-400/30 bg-gradient-to-br from-lime-50/50 via-transparent to-yellow-50/30 dark:from-lime-950/20 dark:to-yellow-950/10 p-4",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-lime-400/5 to-yellow-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-lime-700 dark:text-lime-400 mb-3 relative",children:"Bring your Claude or ChatGPT subscription"}),s.jsx(pe,{className:"relative",children:v.map(j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"provider",provider:j})},j.id))})]})}),o=fe,a=pe;let b;e[19]!==n?(b=j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"provider",provider:j})},j.id),e[19]=n,e[20]=b):b=e[20];let S,y;e[21]!==n||e[22]!==E?(S=E&&h?[s.jsx(ne,{logo:h.logo,name:h.name,description:h.description,onClick:()=>n({kind:"openai-compatible",provider:E,preset:h})},h.id)]:[],y=E?[...ce.filter(Gt).map(j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"openai-compatible",provider:E,preset:j})},j.id)),s.jsx(ne,{logo:E.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:E,preset:null})},"custom")]:[],e[21]=n,e[22]=E,e[23]=S,e[24]=y):(S=e[23],y=e[24]),c=[...C.map(b),...S,...y],e[2]=r,e[3]=n,e[4]=t,e[5]=a,e[6]=o,e[7]=c,e[8]=m,e[9]=u,e[10]=x}else a=e[5],o=e[6],c=e[7],m=e[8],u=e[9],x=e[10];let p;e[25]!==a||e[26]!==c?(p=s.jsx(a,{children:c}),e[25]=a,e[26]=c,e[27]=p):p=e[27];let f;e[28]!==o||e[29]!==p?(f=s.jsx(o,{children:p}),e[28]=o,e[29]=p,e[30]=f):f=e[30];let g;return e[31]!==m||e[32]!==u||e[33]!==x||e[34]!==f?(g=s.jsxs("div",{className:m,children:[u,x,f]}),e[31]=m,e[32]=u,e[33]=x,e[34]=f,e[35]=g):g=e[35],g}function Gt(i){return i.id!=="openai"}function Yt(i){return i.id==="openai"}function Xt(i){return i.id==="openai-compatible"}function Qt(i){return i.id!=="deco"&&!i.supportedMethods.includes("cli-activate")&&i.id!=="openai-compatible"}function Jt(i){return i.id!=="deco"&&i.supportedMethods.includes("cli-activate")}function Zt(i){return i.id==="deco"}const es=Oe({label:oe().optional(),apiKey:oe().min(1,"API key is required")});function ts(i){const e=U.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:r}=re();let a;e[0]!==r.id||e[1]!==r.slug?(a={connectionId:ue,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=a):a=e[2];const o=he(a),c=xe(),[m,u]=R.useState(!1);let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x={resolver:Ae(es),defaultValues:{label:"",apiKey:""}},e[3]=x):x=e[3];const{register:p,handleSubmit:f,formState:g}=Te(x),{errors:v}=g;let _;e[4]!==o||e[5]!==t?(_=async B=>{await o.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:B.label||"Personal key",apiKey:B.apiKey}})},e[4]=o,e[5]=t,e[6]=_):_=e[6];let N;e[7]!==l||e[8]!==r.id||e[9]!==c?(N=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(r.id)}),c.invalidateQueries({queryKey:te.aiProviders(r.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=r.id,e[9]=c,e[10]=N):N=e[10];let k;e[11]!==_||e[12]!==N?(k={mutationFn:_,onSuccess:N,onError:ss},e[11]=_,e[12]=N,e[13]=k):k=e[13];const{mutate:C,isPending:w,error:E}=ae(k);let d;e[14]!==C?(d=B=>C(B),e[14]=C,e[15]=d):d=e[15];let h;e[16]!==f||e[17]!==d?(h=f(d),e[16]=f,e[17]=d,e[18]=h):h=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=b):b=e[19];let S;e[20]!==p?(S=p("label"),e[20]=p,e[21]=S):S=e[21];let y;e[22]!==S?(y=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[22]=S,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=j):j=e[24];const M=m?"text":"password";let I;e[25]!==p?(I=p("apiKey"),e[25]=p,e[26]=I):I=e[26];let O;e[27]!==M||e[28]!==I?(O=s.jsx(le,{type:M,placeholder:"sk-...",...I,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=M,e[28]=I,e[29]=O):O=e[29];let T;e[30]!==m?(T=()=>u(!m),e[30]=m,e[31]=T):T=e[31];let z;e[32]!==m?(z=m?s.jsx(Fe,{size:14}):s.jsx($e,{size:14}),e[32]=m,e[33]=z):z=e[33];let L;e[34]!==T||e[35]!==z?(L=s.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[34]=T,e[35]=z,e[36]=L):L=e[36];let H;e[37]!==O||e[38]!==L?(H=s.jsxs("div",{className:"relative",children:[O,L]}),e[37]=O,e[38]=L,e[39]=H):H=e[39];let P;e[40]!==v.apiKey?(P=v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message}),e[40]=v.apiKey,e[41]=P):P=e[41];let F;e[42]!==H||e[43]!==P?(F=s.jsxs("div",{className:"space-y-1",children:[j,H,P]}),e[42]=H,e[43]=P,e[44]=F):F=e[44];let $;e[45]!==E?($=E&&s.jsx("p",{className:"text-xs text-destructive",children:E.message}),e[45]=E,e[46]=$):$=e[46];let K;e[47]!==w||e[48]!==n?(K=s.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:w,children:"Cancel"}),e[47]=w,e[48]=n,e[49]=K):K=e[49];const q=w?"Saving...":"Save Key";let D;e[50]!==w||e[51]!==q?(D=s.jsx(J,{type:"submit",size:"sm",disabled:w,children:q}),e[50]=w,e[51]=q,e[52]=D):D=e[52];let V;e[53]!==K||e[54]!==D?(V=s.jsxs(ze,{children:[K,D]}),e[53]=K,e[54]=D,e[55]=V):V=e[55];let A;return e[56]!==y||e[57]!==F||e[58]!==$||e[59]!==V||e[60]!==h?(A=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[y,F,$,V]}),e[56]=y,e[57]=F,e[58]=$,e[59]=V,e[60]=h,e[61]=A):A=e[61],A}function ss(i){Q.error(`Failed to save key: ${i.message}`)}const is=Oe({label:oe().optional(),baseUrl:oe().min(1,"Base URL is required"),apiKey:oe().optional()});function ns(i){const e=U.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:r}=re();let a;e[0]!==r.id||e[1]!==r.slug?(a={connectionId:ue,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=a):a=e[2];const o=he(a),c=xe(),[m,u]=R.useState(!1);let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=Ae(is),e[3]=x):x=e[3];const p=t?.defaultBaseUrl??"";let f;e[4]!==p?(f={resolver:x,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[4]=p,e[5]=f):f=e[5];const{register:g,handleSubmit:v,formState:_}=Te(f),{errors:N}=_;let k;e[6]!==o||e[7]!==t?(k=async se=>{const Je=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await o.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Je,...t?{presetId:t.id}:{}}})},e[6]=o,e[7]=t,e[8]=k):k=e[8];let C;e[9]!==l||e[10]!==r.id||e[11]!==c?(C=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(r.id)}),c.invalidateQueries({queryKey:te.aiProviders(r.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=r.id,e[11]=c,e[12]=C):C=e[12];let w;e[13]!==k||e[14]!==C?(w={mutationFn:k,onSuccess:C,onError:ls},e[13]=k,e[14]=C,e[15]=w):w=e[15];const{mutate:E,isPending:d,error:h}=ae(w),b=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let y;e[16]!==E?(y=se=>E(se),e[16]=E,e[17]=y):y=e[17];let j;e[18]!==v||e[19]!==y?(j=v(y),e[18]=v,e[19]=y,e[20]=j):j=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=M):M=e[21];let I;e[22]!==g?(I=g("label"),e[22]=g,e[23]=I):I=e[23];let O;e[24]!==b||e[25]!==I?(O=s.jsxs("div",{className:"space-y-1",children:[M,s.jsx(le,{placeholder:b,...I,className:"h-8 text-sm"})]}),e[24]=b,e[25]=I,e[26]=O):O=e[26];let T;e[27]!==S||e[28]!==N||e[29]!==t?.defaultBaseUrl||e[30]!==g?(T=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...g("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...g("baseUrl"),className:"h-8 text-sm"}),N.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:N.baseUrl.message})]}),e[27]=S,e[28]=N,e[29]=t?.defaultBaseUrl,e[30]=g,e[31]=T):T=e[31];const z=t?.apiKeyRecommended?"recommended":"optional";let L;e[32]!==z?(L=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[32]=z,e[33]=L):L=e[33];const H=m?"text":"password";let P;e[34]!==g?(P=g("apiKey"),e[34]=g,e[35]=P):P=e[35];let F;e[36]!==H||e[37]!==P?(F=s.jsx(le,{type:H,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=H,e[37]=P,e[38]=F):F=e[38];let $;e[39]!==m?($=()=>u(!m),e[39]=m,e[40]=$):$=e[40];let K;e[41]!==m?(K=m?s.jsx(Fe,{size:14}):s.jsx($e,{size:14}),e[41]=m,e[42]=K):K=e[42];let q;e[43]!==$||e[44]!==K?(q=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:K}),e[43]=$,e[44]=K,e[45]=q):q=e[45];let D;e[46]!==F||e[47]!==q?(D=s.jsxs("div",{className:"relative",children:[F,q]}),e[46]=F,e[47]=q,e[48]=D):D=e[48];let V;e[49]!==L||e[50]!==D?(V=s.jsxs("div",{className:"space-y-1",children:[L,D]}),e[49]=L,e[50]=D,e[51]=V):V=e[51];let A;e[52]!==t?(A=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=A):A=e[53];let B;e[54]!==h?(B=h&&s.jsx("p",{className:"text-xs text-destructive",children:h.message}),e[54]=h,e[55]=B):B=e[55];let G;e[56]!==d||e[57]!==n?(G=s.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:d,children:"Cancel"}),e[56]=d,e[57]=n,e[58]=G):G=e[58];const Z=d?"Saving...":"Save Connection";let Y;e[59]!==d||e[60]!==Z?(Y=s.jsx(J,{type:"submit",size:"sm",disabled:d,children:Z}),e[59]=d,e[60]=Z,e[61]=Y):Y=e[61];let ee;e[62]!==G||e[63]!==Y?(ee=s.jsxs(ze,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=ee):ee=e[64];let de;return e[65]!==j||e[66]!==O||e[67]!==T||e[68]!==V||e[69]!==A||e[70]!==B||e[71]!==ee?(de=s.jsxs("form",{onSubmit:j,className:"space-y-3",children:[O,T,V,A,B,ee]}),e[65]=j,e[66]=O,e[67]=T,e[68]=V,e[69]=A,e[70]=B,e[71]=ee,e[72]=de):de=e[72],de}function ls(i){Q.error(`Failed to save connection: ${i.message}`)}const rs={kind:"closed"};function os(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"cli-pending":case"cli-error":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"select-cli":return i.kind!=="grid"?i:{kind:"cli-pending",providerId:e.providerId};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"cli-error":return i.kind!=="cli-pending"?i:{kind:"cli-error",providerId:i.providerId,error:e.error};case"retry-cli":return i.kind!=="cli-error"?i:{kind:"cli-pending",providerId:i.providerId};case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function as(i){switch(i.kind){case"form":case"oauth-pending":case"cli-pending":case"cli-error":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function cs({open:i,onOpenChange:e}){const n=Ue()?.providers??[],{org:l}=re(),r=he({connectionId:ue,orgId:l.id,orgSlug:l.slug}),a=xe(),[o,c]=R.useReducer(os,rs);R.useEffect(()=>{i&&o.kind==="closed"?c({type:"open"}):!i&&o.kind!=="closed"&&c({type:"close"})},[i,o.kind]);const m=()=>{c({type:"close"}),e(!1)},u=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(l.id)}),a.invalidateQueries({queryKey:te.aiProviders(l.id)})},{mutate:x}=ae({mutationFn:async({providerId:d,code:h,stateToken:b,label:S})=>{const y=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:d,code:h,stateToken:b,label:S}});if(y?.isError)throw new Error(y.content?.[0]?.text??"OAuth exchange failed");return d},onSuccess:d=>{X("ai_provider_oauth_succeeded",{provider_id:d}),u();const h=n.find(b=>b.id===d);Q.success(`${h?.name??"Provider"} connected successfully`),m()},onError:(d,h)=>{X("ai_provider_oauth_failed",{provider_id:h.providerId,error:d.message}),Q.error(`OAuth connection failed: ${d.message}`),c({type:"oauth-failed"})}}),{mutate:p}=ae({mutationFn:async d=>{const h=await r.callTool({name:"AI_PROVIDER_CLI_ACTIVATE",arguments:{providerId:d}});if(h?.isError)throw new Error(h.content?.[0]?.text??"CLI activation failed");return{providerId:d,...h.structuredContent}},onSuccess:d=>{if(!d?.activated){X("ai_provider_cli_activate_failed",{provider_id:d.providerId,error:d?.error??"unknown"}),c({type:"cli-error",error:d?.error??"CLI activation failed"});return}X("ai_provider_cli_activated",{provider_id:d.providerId}),u();const h=n.find(b=>b.id===d.providerId);Q.success(`${h?.name??"Provider"} activated`),m()},onError:(d,h)=>{X("ai_provider_cli_activate_failed",{provider_id:h,error:d.message}),c({type:"cli-error",error:d.message})}}),{mutate:f}=ae({mutationFn:async d=>{const h=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:d}});if(h?.isError)throw new Error(h.content?.[0]?.text??"Key provisioning failed");return d},onSuccess:d=>{X("ai_provider_provision_succeeded",{provider_id:d}),u();const h=n.find(b=>b.id===d);Q.success(`${h?.name??"Provider"} connected successfully`),m()},onError:(d,h)=>{X("ai_provider_provision_failed",{provider_id:h,error:d.message}),c({type:"provision-error",error:d.message})}}),g=async d=>{const{provider:h}=d,b=d.kind==="openai-compatible"?d.preset?.id??null:null,S=h.supportedMethods.includes("oauth-pkce"),y=h.supportedMethods.includes("cli-activate"),j=h.supportedMethods.includes("api-key");if(h.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:h.id,method:"provision"}),c({type:"select-provision",providerId:h.id}),f(h.id);return}if(y){X("ai_provider_connect_clicked",{provider_id:h.id,method:"cli-activate"}),c({type:"select-cli",providerId:h.id}),p(h.id);return}if(S){X("ai_provider_connect_clicked",{provider_id:h.id,method:"oauth-pkce"});try{const I=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:h.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!I.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");c({type:"select-oauth",providerId:h.id,stateToken:I.structuredContent.stateToken}),window.open(I.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(I){Q.error(`Failed to start OAuth: ${I instanceof Error?I.message:String(I)}`)}return}j&&(X("ai_provider_connect_clicked",{provider_id:h.id,...b!==null?{preset_id:b}:{},method:"api-key"}),c({type:"select-form",providerId:h.id,presetId:b}))},v=o.kind==="oauth-pending"?o.stateToken:null,_=o.kind==="oauth-pending"?o.providerId:null;R.useEffect(()=>{if(o.kind!=="oauth-pending")return;let d=!1;const h=o.stateToken,b=o.providerId,S=j=>{if(j.origin!==window.location.origin||j.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:M,stateToken:I}=j.data;if(I!==h){Q.error("Security check failed: State token mismatch"),c({type:"oauth-failed"});return}d=!0;const O=n.find(T=>T.id===b);x({providerId:b,code:M,stateToken:h,label:O?.name??b})};window.addEventListener("message",S);const y=setTimeout(()=>{d||(X("ai_provider_oauth_timeout",{provider_id:b}),c({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",S),clearTimeout(y)}},[o.kind,v,_,x]);const N=as(o),k=N?n.find(d=>d.id===N):null,w=(o.kind==="form"&&o.presetId?ce.find(d=>d.id===o.presetId):null)?.name??k?.name??"Connect an AI provider",E=o.kind!=="grid"&&o.kind!=="closed";return s.jsx(Le,{open:o.kind!=="closed",onOpenChange:d=>!d&&m(),children:s.jsxs(Re,{className:"sm:max-w-3xl",children:[s.jsxs(rt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[E&&s.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c({type:"back"}),children:s.jsx(Ke,{size:16})}),s.jsx(Pe,{children:w})]}),o.kind==="grid"&&s.jsx(ot,{children:"Pick a provider — we'll handle the rest."})]}),o.kind==="grid"&&s.jsx(qt,{providers:n,onSelect:g}),o.kind==="form"&&(o.providerId==="openai-compatible"?s.jsx(ns,{preset:o.presetId?ce.find(d=>d.id===o.presetId):void 0,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),m()}}):s.jsx(ts,{providerId:o.providerId,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),m()}})),o.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(je,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),(o.kind==="cli-pending"||o.kind==="provision-pending")&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(je,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o.kind==="cli-pending"?"Checking CLI…":"Connecting…"})]}),(o.kind==="cli-error"||o.kind==="provision-error")&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Ot,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:o.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(J,{variant:"outline",size:"sm",onClick:()=>c({type:"back"}),children:"Back"}),s.jsx(J,{size:"sm",onClick:()=>{o.kind==="cli-error"?(c({type:"retry-cli"}),p(o.providerId)):(c({type:"retry-provision"}),f(o.providerId))},children:"Retry"})]})]})]})})}function ds(){const i=U.c(10),{org:e}=re();let t;i[0]!==e.id||i[1]!==e.slug?(t={connectionId:ue,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=t):t=i[2];const n=he(t);let l;i[3]!==e.id?(l=te.defaultBrand(e.id),i[3]=e.id,i[4]=l):l=i[4];let r;i[5]!==n?(r=async()=>{const c=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),m=zt(c);return(Array.isArray(m?.items)?m.items:[]).find(ms)??null},i[5]=n,i[6]=r):r=i[6];let a;i[7]!==l||i[8]!==r?(a={queryKey:l,queryFn:r},i[7]=l,i[8]=r,i[9]=a):a=i[9];const{data:o}=tt(a);return o??null}function ms(i){return i.isDefault&&!i.archivedAt}function us(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function hs(i){const e=U.c(34);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:r}=re(),{localMode:a}=et(),o=ds(),[c,m]=R.useState(!1),u=r.name;let x;e[2]!==o?(x=o?us(o):null,e[2]=o,e[3]=x):x=e[3];const p=x,f=o?.favicon??o?.logo??null,g=n??(u?`${u} is ready for agents`:"Your agents are almost ready"),v=l??"Choose how to power your AI team.",_=!!(f||p);let N;e[4]!==p?(N=p?{backgroundColor:`${p}18`,borderColor:`${p}30`}:void 0,e[4]=p,e[5]=N):N=e[5];const k=N,C=_?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-gradient-to-br from-lime-100 to-yellow-50 dark:from-lime-900/30 dark:to-yellow-900/20 border border-lime-300/40 dark:border-lime-700/30";let w;e[6]!==f||e[7]!==p?(w=f?s.jsx("img",{src:f,alt:"",className:"size-7 rounded object-contain"}):s.jsx(Mt,{size:24,style:p?{color:p}:void 0,className:me(!p&&"text-lime-600 dark:text-lime-400")}),e[6]=f,e[7]=p,e[8]=w):w=e[8];let E;e[9]!==C||e[10]!==k||e[11]!==w?(E=s.jsx("div",{className:C,style:k,children:w}),e[9]=C,e[10]=k,e[11]=w,e[12]=E):E=e[12];let d;e[13]!==g?(d=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:g}),e[13]=g,e[14]=d):d=e[14];let h;e[15]!==v?(h=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:v}),e[15]=v,e[16]=h):h=e[16];let b;e[17]!==d||e[18]!==h?(b=s.jsxs("div",{className:"space-y-2",children:[d,h]}),e[17]=d,e[18]=h,e[19]=b):b=e[19];let S;e[20]!==E||e[21]!==b?(S=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[E,b]}),e[20]=E,e[21]=b,e[22]=S):S=e[22];let y;e[23]!==a?(y=a&&s.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Local models + use your existing AI provider"}),e[23]=a,e[24]=y):y=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(J,{onClick:()=>m(!0),children:"Connect AI provider"}),e[25]=j):j=e[25];let M;e[26]!==y?(M=s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[y,j]}),e[26]=y,e[27]=M):M=e[27];let I;e[28]!==c?(I=s.jsx(cs,{open:c,onOpenChange:m}),e[28]=c,e[29]=I):I=e[29];let O;return e[30]!==M||e[31]!==I||e[32]!==S?(O=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-2xl px-4",children:[S,M,I]}),e[30]=M,e[31]=I,e[32]=S,e[33]=O):O=e[33],O}function ve(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}const Ve=["smarter","faster","cheaper"],He={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},fs=[{tier:"smarter",prefixes:["claude-code:opus","anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","codex:gpt-5.4","codex:gpt-5.4-mini","codex:gpt-5.3-codex","codex:gpt-5.2-codex","codex:gpt-5.1-codex-max","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["claude-code:sonnet","anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","codex:gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["claude-code:haiku","google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],ps=fs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),xs=new Set(["google/gemini-2.5-pro"]),Ce=new Map;function gs(i){const e=Ce.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else e:for(const{tier:n,prefix:l}of ps)if(i.startsWith(l)){if(xs.has(l)&&i.length>l.length&&i[l.length]==="-"){const a=i[l.length+1];if(!a||!/\d/.test(a))continue e}t=n;break}return Ce.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=gs(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const qe="mesh:model-shortlist:",vs=new Set(["anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function bs(i){try{const e=localStorage.getItem(qe+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function ys(i,e){localStorage.setItem(qe+i,JSON.stringify([...e]))}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const Ss=["bg-destructive","bg-warning","bg-success","bg-success"],Ns=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function ws(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const _s={text:{icon:s.jsx(Nt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(St,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(kt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(jt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(yt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(De,{className:"size-3.5"}),label:"Web search"}};function Is(i){const e=U.c(5),{capability:t}=i;let n;e[0]!==t?(n=_s[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let r;return e[2]!==l.icon||e[3]!==l.label?(r=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=r):r=e[4],r}function Cs(i){const e=U.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=d):d=e[0],d}const r=t.costs?.input!=null?t.costs.input*1e6:null,a=t.costs?.output!=null?t.costs.output*1e6:null;let o;e[1]!==t?(o=ve(t),e[1]=t,e[2]=o):o=e[2];const{provider:c,displayName:m}=o;if(l){let d;e[3]!==t.limits?(d=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=d):d=e[4];let h;e[5]!==r?(h=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[5]=r,e[6]=h):h=e[6];let b;e[7]!==a?(b=a!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",a.toFixed(2)," / 1M"]})]}),e[7]=a,e[8]=b):b=e[8];let S;e[9]!==t.limits?(S=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=S):S=e[10];let y;return e[11]!==d||e[12]!==h||e[13]!==b||e[14]!==S?(y=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[d,h,b,S]}),e[11]=d,e[12]=h,e[13]=b,e[14]=S,e[15]=y):y=e[15],y}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let x;e[18]!==t.logo||e[19]!==t.title?(x=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=x):x=e[20];let p;e[21]!==m?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:m}),e[21]=m,e[22]=p):p=e[22];let f;e[23]!==x||e[24]!==p?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[x,p]}),e[23]=x,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let v;e[28]!==u||e[29]!==f||e[30]!==g?(v=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=v):v=e[31];let _;e[32]!==t.capabilities?(_=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Es)}),e[32]=t.capabilities,e[33]=_):_=e[33];let N;e[34]!==t.limits?(N=t.limits?.contextWindow&&(()=>{const{level:d,label:h,description:b}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(S=>s.jsx("div",{className:me("w-2 h-2 rounded-full",S<=d?Ss[d-1]:"bg-muted")},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:h}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",b]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=N):N=e[35];let k;e[36]!==t.limits?(k=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=k):k=e[37];let C;e[38]!==r||e[39]!==a?(C=(r!=null||a!=null)&&(()=>{const{level:d,label:h}=r!=null?ws(r):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),r!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(b=>s.jsx("span",{className:me("text-sm font-bold leading-none",b<=d?Ns[d-1]:"text-muted-foreground/20"),children:"$"},b))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:h})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]}),a!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",a.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=r,e[39]=a,e[40]=C):C=e[40];let w;e[41]!==N||e[42]!==k||e[43]!==C?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,k,C]}),e[41]=N,e[42]=k,e[43]=C,e[44]=w):w=e[44];let E;return e[45]!==w||e[46]!==v||e[47]!==_?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[v,_,w]}),e[45]=w,e[46]=v,e[47]=_,e[48]=E):E=e[48],E}function Es(i){return s.jsx(Is,{capability:i},i)}function Ms(i){const e=U.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ve(t),e[0]=t,e[1]=l):l=e[1];const{displayName:r,provider:a}=l;let o;e[2]!==t?(o=ge(t),e[2]=t,e[3]=o):o=e[3];const c=o;let m;e[4]!==t||e[5]!==n?(m=()=>n(t),e[4]=t,e[5]=n,e[6]=m):m=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let x;e[10]!==r?(x=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:r}),e[10]=r,e[11]=x):x=e[11];let p;e[12]!==a?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:a}),e[12]=a,e[13]=p):p=e[13];let f;e[14]!==x||e[15]!==p?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[x,p]}),e[14]=x,e[15]=p,e[16]=f):f=e[16];let g;return e[17]!==m||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:m,children:[u,f]}),e[17]=m,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function Os(i){const e=U.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(nt,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=r):r=e[1];const a=t?.message||"Could not fetch models from this provider.";let o;e[2]!==a?(o=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[a," Try another provider or retry."]})]}),e[2]=a,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(wt,{className:"size-3.5"}),e[4]=c):c=e[4];let m;e[5]!==n?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(J,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=m):m=e[6];let u;return e[7]!==o||e[8]!==m?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,o,m]}),e[7]=o,e[8]=m,e[9]=u):u=e[9],u}function As(){const i=U.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Ts)}),i[0]=e):e=i[0],e}function Ts(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(W,{className:"flex-1 h-4"}),s.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(i){const e=U.c(12),{label:t,models:n,onSelect:l,onHover:r}=i;if(n.length===0)return null;let a;e[0]!==t?(a=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=a):a=e[1];let o;if(e[2]!==n||e[3]!==r||e[4]!==l){let m;e[6]!==r||e[7]!==l?(m=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Ms,{model:u,onHover:r})},u.modelId),e[6]=r,e[7]=l,e[8]=m):m=e[8],o=n.map(m),e[2]=n,e[3]=r,e[4]=l,e[5]=o}else o=e[5];let c;return e[9]!==a||e[10]!==o?(c=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=c):c=e[11],c}function zs(i){const e=U.c(21),{model:t,isChecked:n,onToggle:l,onHover:r}=i,[a,o]=R.useState(n);a!==n&&o(n);let c;e[0]!==t?(c=ge(t),e[0]=t,e[1]=c):c=e[1];const m=c;let u;e[2]!==t||e[3]!==r?(u=()=>r(t),e[2]=t,e[3]=r,e[4]=u):u=e[4];let x;e[5]!==t.modelId||e[6]!==l?(x=()=>{o(Ls),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=x):x=e[7];let p;e[8]!==a||e[9]!==x?(p=s.jsx(lt,{checked:a,onCheckedChange:x}),e[8]=a,e[9]=x,e[10]=p):p=e[10];let f;e[11]!==m||e[12]!==t.title?(f=s.jsx("img",{src:m,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=m,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let v;return e[16]!==u||e[17]!==p||e[18]!==f||e[19]!==g?(v=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[p,f,g]}),e[16]=u,e[17]=p,e[18]=f,e[19]=g,e[20]=v):v=e[20],v}function Ls(i){return!i}function Rs(i){const e=[];for(const t of Ve)if(i[t].length>0){e.push({type:"header",label:He[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ps({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=R.useRef(null),r=Ht({count:i.length,getScrollElement:()=>l.current,estimateSize:a=>i[a]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:r.getTotalSize()},children:r.getVirtualItems().map(a=>{const o=i[a.index];return o?s.jsx("div",{"data-index":a.index,ref:r.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${a.start}px)`},children:o.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:o.label}):s.jsx(zs,{model:o.model,isChecked:e.has(o.model.modelId),onToggle:t,onHover:n})},a.key):null})})})}function Fs(i){const e=U.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:r,managing:a,onToggleManage:o,filterModels:c}=i,{models:m}=Et(t),u=c?m.filter(c):m.filter($s);let x;e[0]!==t?(x=()=>(t?bs(t):null)??vs,e[0]=t,e[1]=x):x=e[1];const[p,f]=R.useState(x),[,g]=R.useTransition();let v;e[2]!==t||e[3]!==g?(v=y=>{t&&g(()=>{f(j=>{const M=new Set(j);return M.has(y)?M.delete(y):M.add(y),ys(t,M),M})})},e[2]=t,e[3]=g,e[4]=v):v=e[4];const _=v,N=n.toLowerCase().trim(),k=y=>N?y.filter(j=>j.title.toLowerCase().includes(N)||j.modelId.toLowerCase().includes(N)):y;if(a){const y=Ee(k(u)),j=Rs(y);let M;e[5]!==p?(M=z=>p.has(z.modelId),e[5]=p,e[6]=M):M=e[6];const I=u.filter(M).length;let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ke,{size:14}),e[7]=O):O=e[7];let T;return e[8]!==o?(T=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[O,"Back"]}),e[8]=o,e[9]=T):T=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[I," selected"]})]}),s.jsx(Ps,{items:j,shortlistSet:p,onToggle:_,onHover:l})]})}let C;e[10]!==p?(C=y=>p.has(y.modelId),e[10]=p,e[11]=C):C=e[11];const w=u.filter(C),E=w.length>0?w:u,d=Ee(k(E));let h;e[12]!==d||e[13]!==l||e[14]!==r?(h=Ve.map(y=>s.jsx(Me,{label:He[y],models:d[y],onSelect:r,onHover:l},y)),e[12]=d,e[13]=l,e[14]=r,e[15]=h):h=e[15];let b;e[16]!==d.other||e[17]!==l||e[18]!==r?(b=s.jsx(Me,{label:"Other",models:d.other,onSelect:r,onHover:l}),e[16]=d.other,e[17]=l,e[18]=r,e[19]=b):b=e[19];let S;return e[20]!==h||e[21]!==b?(S=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[h,b]}),e[20]=h,e[21]=b,e[22]=S):S=e[22],S}function $s(i){return i.asyncResearch!==!0}function Ge(i){const e=U.c(19),{model:t,placeholder:n,isLoading:l}=i,r=n===void 0?"Select model":n;if(l===void 0?!1:l){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(W,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(W,{className:"w-16 h-3 hidden md:block"})]}),e[0]=v):v=e[0],v}if(!t){let v;e[1]!==r?(v=s.jsx("span",{className:"text-sm text-muted-foreground",children:r}),e[1]=r,e[2]=v):v=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=_):_=e[3];let N;return e[4]!==v?(N=s.jsxs("div",{className:"flex items-center gap-1.5",children:[v,_]}),e[4]=v,e[5]=N):N=e[5],N}let o;e[6]!==t?(o=ve(t),e[6]=t,e[7]=o):o=e[7];const{displayName:c}=o;let m;e[8]!==t?(m=ge(t),e[8]=t,e[9]=m):m=e[9];const u=m;let x;e[10]!==t.title||e[11]!==u?(x=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=x):x=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[x,p,f]}),e[16]=x,e[17]=p,e[18]=g):g=e[18],g}const Ks=["vision","image","file","audio","video"],Ye=["image/png","image/jpeg","image/gif","image/webp"],Xe=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function be(i){const e=i?.capabilities;return e?Ks.some(t=>e.includes(t)):!1}function vi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),r=t.includes("audio"),a=t.includes("video");return!!(n&&Ye.includes(i)||l&&i==="application/pdf"||r&&i.startsWith("audio/")||a&&i.startsWith("video/")||be(e)&&Xe.includes(i))}function bi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ye),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),be(i)&&t.push(...Xe),t.join(",")}function yi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),be(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}function Ds(){const i=U.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(W,{className:"size-4 shrink-0"}),s.jsx(W,{className:"flex-1 h-6"}),s.jsx(W,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Us)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(W,{className:"size-6 shrink-0"}),s.jsx(W,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(W,{className:"h-6 w-20 rounded-md"}),s.jsx(W,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let r;i[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(W,{className:"h-4 w-24"}),s.jsx(W,{className:"h-4 w-32"})]}),i[4]=r):r=i[4];let a;return i[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[r,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(W,{className:"h-4 w-16"}),s.jsx(W,{className:"h-4 w-40"})]})]})]})})]}),i[5]=a):a=i[5],a}function Us(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(W,{className:"flex-1 h-4"}),s.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Qe(i){const e=U.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:r,onModelChange:a,filterModels:o}=i,[c,m]=R.useState(null),[u,x]=R.useState(""),[p,f]=R.useState(!1),g=R.useRef(null),v=Ue(),_=Ct();let N;e[0]!==v?.providers?(N=Object.fromEntries((v?.providers??[]).map(Vs)),e[0]=v?.providers,e[1]=N):N=e[1];const k=N,C=st(),{org:w}=re();let E;e[2]!==l?(E=A=>{l(A),m(null)},e[2]=l,e[3]=E):E=e[3];const d=E;let h;e[4]!==n||e[5]!==t||e[6]!==a?(h=A=>{n&&(a(A),x(""),t())},e[4]=n,e[5]=t,e[6]=a,e[7]=h):h=e[7];const b=h;if(_.length===0){let A;return e[8]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(hs,{})}),e[8]=A):A=e[8],A}let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(De,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=S):S=e[9];const y=p?"Search all models...":"Search for a model...";let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=A=>x(A.target.value),e[10]=j):j=e[10];let M;e[11]!==u||e[12]!==y?(M=s.jsx(le,{ref:g,type:"text",placeholder:y,value:u,onChange:j,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=y,e[13]=M):M=e[13];let I;e[14]!==n||e[15]!==d||e[16]!==_||e[17]!==k?(I=_.length>0&&s.jsxs(ft,{value:n??"",onValueChange:d,children:[s.jsxs(pt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ws,children:[s.jsx(xt,{placeholder:"Key",children:(()=>{const A=_.find(ee=>ee.id===n),B=A?k[A.providerId]:void 0,G=Ie(A?.presetId),Z=G?.logo??B?.logo,Y=G?.name??B?.name??A?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Z?s.jsx("img",{src:Z,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(bt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(gt,{children:_.map(A=>{const B=k[A.providerId],G=Ie(A.presetId),Z=G?.logo??B?.logo,Y=G?.name??B?.name??A.providerId;return s.jsx(vt,{value:A.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Z?s.jsx("img",{src:Z,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",A.label]})]})},A.id)})})]}),e[14]=n,e[15]=d,e[16]=_,e[17]=k,e[18]=I):I=e[18];let O;e[19]!==M||e[20]!==I?(O=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[S,M,I]})}),e[19]=M,e[20]=I,e[21]=O):O=e[21];let T;e[22]!==n?(T=A=>{const{error:B,resetError:G}=A;return s.jsx(Os,{error:B,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=T):T=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(As,{}),e[24]=z):z=e[24];const L=n??void 0;let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=()=>f(Bs),e[25]=H):H=e[25];let P;e[26]!==o||e[27]!==b||e[28]!==p||e[29]!==u||e[30]!==L?(P=s.jsx(R.Suspense,{fallback:z,children:s.jsx(Fs,{keyId:L,searchTerm:u,onHover:m,onModelSelect:b,managing:p,onToggleManage:H,filterModels:o})}),e[26]=o,e[27]=b,e[28]=p,e[29]=u,e[30]=L,e[31]=P):P=e[31];let F;e[32]!==n||e[33]!==T||e[34]!==P?(F=s.jsx(it,{fallback:T,children:P},n),e[32]=n,e[33]=T,e[34]=P,e[35]=F):F=e[35];let $;e[36]!==p||e[37]!==C||e[38]!==w?($=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>R.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(It,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>C({to:"/$org/settings/ai-providers",params:{org:w.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(_t,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=C,e[38]=w,e[39]=$):$=e[39];let K;e[40]!==F||e[41]!==$||e[42]!==O?(K=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[O,F,$]}),e[40]=F,e[41]=$,e[42]=O,e[43]=K):K=e[43];const q=c??r??null;let D;e[44]!==q?(D=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Cs,{model:q})}),e[44]=q,e[45]=D):D=e[45];let V;return e[46]!==K||e[47]!==D?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[K,D]}),e[46]=K,e[47]=D,e[48]=V):V=e[48],V}function Bs(i){return!i}function Ws(i){return i.stopPropagation()}function Vs(i){return[i.id,i]}function Hs(i){const e=U.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:r,setModel:a}=Be();let o;e[0]!==l?(o=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==r?.modelId||e[4]!==a?(c=u=>{n&&(X("chat_model_changed",{from_model_id:r?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),a({...u,keyId:n}))},e[2]=n,e[3]=r?.modelId,e[4]=a,e[5]=c):c=e[5];let m;return e[6]!==n||e[7]!==t||e[8]!==r||e[9]!==o||e[10]!==c?(m=s.jsx(Qe,{onClose:t,credentialId:n,onCredentialChange:o,selectedModel:r,onModelChange:c}),e[6]=n,e[7]=t,e[8]=r,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function ji(i){const e=U.c(38),{variant:t,className:n,placeholder:l,model:r,isLoading:a,credentialId:o,onCredentialChange:c,onModelChange:m,filterModels:u}=i,x=t===void 0?"borderless":t,p=l===void 0?"Select model":l,[f,g]=R.useState(!1),v=m!==void 0,_=ht(),N=x==="borderless"?"ghost":"outline",k=x==="borderless"&&"md:border-none";let C;e[0]!==n||e[1]!==k?(C=me("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",k,n),e[0]=n,e[1]=k,e[2]=C):C=e[2];let w;e[3]!==a||e[4]!==r||e[5]!==p||e[6]!==v?(w=v?s.jsx(Ge,{model:r??null,placeholder:p,isLoading:a}):s.jsx(Gs,{placeholder:p}),e[3]=a,e[4]=r,e[5]=p,e[6]=v,e[7]=w):w=e[7];let E;e[8]!==N||e[9]!==C||e[10]!==w?(E=s.jsx(J,{variant:N,size:"sm",className:C,children:w}),e[8]=N,e[9]=C,e[10]=w,e[11]=E):E=e[11];const d=E;let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ds,{}),e[12]=h):h=e[12];let b;e[13]!==o||e[14]!==u||e[15]!==r||e[16]!==c||e[17]!==m||e[18]!==v?(b=s.jsx(R.Suspense,{fallback:h,children:v?s.jsx(Qe,{onClose:()=>g(!1),credentialId:o??null,onCredentialChange:c??qs,selectedModel:r??null,onModelChange:m,filterModels:u}):s.jsx(Hs,{onClose:()=>g(!1)})}),e[13]=o,e[14]=u,e[15]=r,e[16]=c,e[17]=m,e[18]=v,e[19]=b):b=e[19];const S=b;if(_){let O;e[20]!==d?(O=s.jsx(ct,{asChild:!0,children:d}),e[20]=d,e[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(dt,{className:"sr-only",children:"Select model"}),e[22]=T):T=e[22];let z;e[23]!==S?(z=s.jsxs(mt,{className:"p-0 flex flex-col max-h-[95vh]",children:[T,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:S})]}),e[23]=S,e[24]=z):z=e[24];let L;return e[25]!==f||e[26]!==O||e[27]!==z?(L=s.jsxs(ut,{open:f,onOpenChange:g,children:[O,z]}),e[25]=f,e[26]=O,e[27]=z,e[28]=L):L=e[28],L}let y;e[29]!==d?(y=s.jsx(at,{asChild:!0,children:d}),e[29]=d,e[30]=y):y=e[30];let j;e[31]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Pe,{className:"sr-only",children:"Select model"}),e[31]=j):j=e[31];let M;e[32]!==S?(M=s.jsxs(Re,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[j,S]}),e[32]=S,e[33]=M):M=e[33];let I;return e[34]!==f||e[35]!==y||e[36]!==M?(I=s.jsxs(Le,{open:f,onOpenChange:g,children:[y,M]}),e[34]=f,e[35]=y,e[36]=M,e[37]=I):I=e[37],I}function qs(){}function Gs(i){const e=U.c(4),{placeholder:t}=i,{selectedModel:n,isModelsLoading:l}=Be();let r;return e[0]!==l||e[1]!==n||e[2]!==t?(r=s.jsx(Ge,{model:n,placeholder:t,isLoading:l}),e[0]=l,e[1]=n,e[2]=t,e[3]=r):r=e[3],r}export{cs as C,ji as M,hs as N,ce as O,yi as a,bi as g,vi as i,be as m};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BRdqsUee.js","assets/index-DTTgUjL4.js","assets/index-CzeuUc9U.css","assets/ArrowNarrowLeft-qDflnb8N.js","assets/CheckCircle-A2guVcAG.js","assets/Container-BcMn23kd.js","assets/Settings02-CDcaxP04.js","assets/XCircle-H0Nc2jh5.js","assets/constants-Pxhsjio1.js","assets/useInfiniteQuery-fBvMjRX2.js","assets/infiniteQueryObserver-B091eeMg.js","assets/badge-DTxL6xUH.js","assets/input-CjWKkTcV.js","assets/dropdown-menu-D2TItq8w.js","assets/Check-Dz5ZLQmL.js","assets/ChevronRight-ChQ95U2k.js","assets/DotsVertical-CII1YBBc.js","assets/table-DYiQpBVl.js","assets/toggle-group-C-cIsKer.js","assets/use-view-mode-DRlYzhbj.js","assets/tooltip-3OBm7oI6.js","assets/SearchMd-AJN6VuJg.js","assets/dialog-C_Z_peKj.js","assets/X-Bs68LwBc.js","assets/AlertCircle-7o1P0zzm.js","assets/alert-dialog-DS13tR4C.js","assets/card-D-Cbo6xY.js","assets/Trash01-BqVS-Vu_.js","assets/label-CuUYxm88.js","assets/select-Bc7FbSIp.js","assets/ChevronDown-Bau6LlOi.js","assets/ChevronUp-COL031vn.js","assets/switch-B8o7MEY9.js","assets/textarea-C8ZFrqCw.js","assets/RefreshCcw01-8Ibm16Pu.js","assets/checkbox-DMz97A6W.js","assets/LinkExternal01-oqIx4SAa.js","assets/use-copy-BH9cfEYN.js","assets/Plus-CKCuUTsd.js","assets/Play-BZl-q_yI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as n,f as c,g as m,j as r,l as f,r as l,_ as u}from"./index-DTTgUjL4.js";const _=l.lazy(()=>u(()=>import("./registry-layout-BRdqsUee.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])));function x(){const e=n.c(5),o=c();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:i}=m(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==i?(a=r.jsx(l.Suspense,{fallback:s,children:r.jsx(_,{onBack:()=>o({to:"/$org/settings/store",params:{org:i}})})}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-B091eeMg.js";import{c1 as i}from"./index-DTTgUjL4.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-B091eeMg.js";import{c1 as u,c2 as n}from"./index-DTTgUjL4.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{e as s,g as l,j as o,l as a,E as n,r as c}from"./index-DTTgUjL4.js";import{a as f}from"./index-4JTQs1c6.js";import"./index-C_yGpzc7.js";import"./constants-Pxhsjio1.js";import"./collections-BxKz1gM7.js";import"./index-CNLaZeow.js";import"./use-virtual-mcp-CjWnWBVR.js";import"./use-collections-B_AeR68F.js";import"./monaco-editor-D_4gsArT.js";import"./spinner-Dxocm3j_.js";import"./accordion-CfzkzHFA.js";import"./agent-icon-kpWVPj85.js";import"./AlertCircle-7o1P0zzm.js";import"./Tool01-bqF4BUeR.js";import"./Archive-DSPPL-j9.js";import"./XClose-Cilpzhqm.js";import"./RefreshCcw01-8Ibm16Pu.js";import"./ArrowNarrowLeft-qDflnb8N.js";import"./XCircle-H0Nc2jh5.js";import"./ArrowUpRight-C3mm8yK_.js";import"./ZapSquare-BmqW5YQ-.js";import"./Users03-oWGgz1_B.js";import"./CheckCircle-A2guVcAG.js";import"./Check-Dz5ZLQmL.js";import"./ChevronDown-Bau6LlOi.js";import"./ChevronRight-ChQ95U2k.js";import"./ChevronUp-COL031vn.js";import"./DotsVertical-CII1YBBc.js";import"./Container-BcMn23kd.js";import"./Star01-BcHjnr98.js";import"./Palette-g_FAi23c.js";import"./SearchMd-AJN6VuJg.js";import"./LayoutLeft-BCU3zX1U.js";import"./LinkExternal01-oqIx4SAa.js";import"./Lock01-CJ14jIMg.js";import"./Sun-hliFotLP.js";import"./Play-BZl-q_yI.js";import"./Plus-CKCuUTsd.js";import"./Settings02-CDcaxP04.js";import"./Shield01-D1Hywoy5.js";import"./Trash01-BqVS-Vu_.js";import"./User01-B9MhRcqZ.js";import"./X-Bs68LwBc.js";import"./Zap-DhYtqMa9.js";import"./index-LSlqVMbE.js";import"./badge-DTxL6xUH.js";import"./select-Bc7FbSIp.js";import"./tooltip-3OBm7oI6.js";import"./view-mode-toggle-0NgrTiKE.js";import"./layout-BeSp3Oh9.js";import"./index-IoVTnIlz.js";import"./sidebar-DhPirxvV.js";import"./use-connection-fL8Bdy-2.js";import"./use-mcp-tools-B4pwuY-v.js";import"./dialog-C_Z_peKj.js";import"./index-CKMzeZJu.js";import"./dropdown-menu-D2TItq8w.js";import"./integration-icon-Daxcsp7E.js";import"./scroll-area-QdubrRQt.js";import"./index-C98EzEx6.js";import"./empty-state-Nd37WS0U.js";import"./create-sse-subscription-CxkOgzKf.js";import"./input-CjWKkTcV.js";function yt(){const t=s.c(4);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/workflows/$itemId"},t[0]=r):r=t[0];const{itemId:e}=l(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(a,{size:32,className:"animate-spin text-muted-foreground"})}),t[1]=i):i=t[1];const p=decodeURIComponent(e);let m;return t[2]!==p?(m=o.jsx(n,{children:o.jsx(c.Suspense,{fallback:i,children:o.jsx(f,{itemId:p})})}),t[2]=p,t[3]=m):m=t[3],m}export{yt as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Copyright © 2017, Charmander <~@charmander.me>
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
5
|
-
copyright notice and this permission notice appear in all copies.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
9
|
-
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[![Build status][ci image]][ci]
|
|
2
|
-
|
|
3
|
-
64-bit big-endian signed integer-to-string conversion designed for [pg][].
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
const readInt8 = require('pg-int8');
|
|
7
|
-
|
|
8
|
-
readInt8(Buffer.from([0, 1, 2, 3, 4, 5, 6, 7]))
|
|
9
|
-
// '283686952306183'
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[pg]: https://github.com/brianc/node-postgres
|
|
14
|
-
|
|
15
|
-
[ci]: https://travis-ci.org/charmander/pg-int8
|
|
16
|
-
[ci image]: https://api.travis-ci.org/charmander/pg-int8.svg
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// selected so (BASE - 1) * 0x100000000 + 0xffffffff is a safe integer
|
|
4
|
-
var BASE = 1000000;
|
|
5
|
-
|
|
6
|
-
function readInt8(buffer) {
|
|
7
|
-
var high = buffer.readInt32BE(0);
|
|
8
|
-
var low = buffer.readUInt32BE(4);
|
|
9
|
-
var sign = '';
|
|
10
|
-
|
|
11
|
-
if (high < 0) {
|
|
12
|
-
high = ~high + (low === 0);
|
|
13
|
-
low = (~low + 1) >>> 0;
|
|
14
|
-
sign = '-';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
var result = '';
|
|
18
|
-
var carry;
|
|
19
|
-
var t;
|
|
20
|
-
var digits;
|
|
21
|
-
var pad;
|
|
22
|
-
var l;
|
|
23
|
-
var i;
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
carry = high % BASE;
|
|
27
|
-
high = high / BASE >>> 0;
|
|
28
|
-
|
|
29
|
-
t = 0x100000000 * carry + low;
|
|
30
|
-
low = t / BASE >>> 0;
|
|
31
|
-
digits = '' + (t - BASE * low);
|
|
32
|
-
|
|
33
|
-
if (low === 0 && high === 0) {
|
|
34
|
-
return sign + digits + result;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
pad = '';
|
|
38
|
-
l = 6 - digits.length;
|
|
39
|
-
|
|
40
|
-
for (i = 0; i < l; i++) {
|
|
41
|
-
pad += '0';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
result = pad + digits + result;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
carry = high % BASE;
|
|
49
|
-
high = high / BASE >>> 0;
|
|
50
|
-
|
|
51
|
-
t = 0x100000000 * carry + low;
|
|
52
|
-
low = t / BASE >>> 0;
|
|
53
|
-
digits = '' + (t - BASE * low);
|
|
54
|
-
|
|
55
|
-
if (low === 0 && high === 0) {
|
|
56
|
-
return sign + digits + result;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
pad = '';
|
|
60
|
-
l = 6 - digits.length;
|
|
61
|
-
|
|
62
|
-
for (i = 0; i < l; i++) {
|
|
63
|
-
pad += '0';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
result = pad + digits + result;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
carry = high % BASE;
|
|
71
|
-
high = high / BASE >>> 0;
|
|
72
|
-
|
|
73
|
-
t = 0x100000000 * carry + low;
|
|
74
|
-
low = t / BASE >>> 0;
|
|
75
|
-
digits = '' + (t - BASE * low);
|
|
76
|
-
|
|
77
|
-
if (low === 0 && high === 0) {
|
|
78
|
-
return sign + digits + result;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
pad = '';
|
|
82
|
-
l = 6 - digits.length;
|
|
83
|
-
|
|
84
|
-
for (i = 0; i < l; i++) {
|
|
85
|
-
pad += '0';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
result = pad + digits + result;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
carry = high % BASE;
|
|
93
|
-
t = 0x100000000 * carry + low;
|
|
94
|
-
digits = '' + t % BASE;
|
|
95
|
-
|
|
96
|
-
return sign + digits + result;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
module.exports = readInt8;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pg-int8",
|
|
3
|
-
"version": "1.0.1",
|
|
4
|
-
"description": "64-bit big-endian signed integer-to-string conversion",
|
|
5
|
-
"bugs": "https://github.com/charmander/pg-int8/issues",
|
|
6
|
-
"license": "ISC",
|
|
7
|
-
"files": [
|
|
8
|
-
"index.js"
|
|
9
|
-
],
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/charmander/pg-int8"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "tap test"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@charmander/eslint-config-base": "1.0.2",
|
|
19
|
-
"tap": "10.7.3"
|
|
20
|
-
},
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=4.0.0"
|
|
23
|
-
}
|
|
24
|
-
}
|