decocms 4.622.0 → 4.622.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/AlertCircle-xosAEaLd.js +1 -0
- package/dist/client/assets/AreaChart-BL_nidm2.js +1 -0
- package/dist/client/assets/ArrowLeft-s_BV961r.js +1 -0
- package/dist/client/assets/ArrowRight-BoIkS6P4.js +1 -0
- package/dist/client/assets/ArrowUp-D4g_D7TY.js +1 -0
- package/dist/client/assets/BookOpen01-CuhzPAzU.js +1 -0
- package/dist/client/assets/CartesianChart-BKp0t2Tg.js +1 -0
- package/dist/client/assets/CategoricalChart-CAfWRlnl.js +33 -0
- package/dist/client/assets/CheckCircle-BKxt6JEi.js +1 -0
- package/dist/client/assets/ChevronDown-DIkHoN0o.js +1 -0
- package/dist/client/assets/ChevronSelectorVertical-TYlaEGrJ.js +1 -0
- package/dist/client/assets/ChevronUp-D61VSyxy.js +1 -0
- package/dist/client/assets/CreditCard01-7wh2SPUT.js +1 -0
- package/dist/client/assets/Eye-C0bB50C2.js +1 -0
- package/dist/client/assets/File02-Bf99ynSR.js +1 -0
- package/dist/client/assets/Fingerprint04-DeU3ipCm.js +1 -0
- package/dist/client/assets/Flag01-covUodPa.js +1 -0
- package/dist/client/assets/Globe04-DMmZoyet.js +1 -0
- package/dist/client/assets/Image01-BeGbQ3TX.js +1 -0
- package/dist/client/assets/Key01-Bu_xE8-A.js +1 -0
- package/dist/client/assets/LayoutLeft-CZDdpuNu.js +1 -0
- package/dist/client/assets/LinkBroken01-5IFNWpUM.js +1 -0
- package/dist/client/assets/MessageCircle01-MNDoLPzV.js +1 -0
- package/dist/client/assets/Minus-BXX2vBX8.js +1 -0
- package/dist/client/assets/Monitor01-CbmKbBlb.js +1 -0
- package/dist/client/assets/Play-mrw71pF0.js +1 -0
- package/dist/client/assets/Plus-BfHy14x9.js +1 -0
- package/dist/client/assets/ReferenceLine-DmnB-QtF.js +1 -0
- package/dist/client/assets/SearchMd-BrgKf_9M.js +1 -0
- package/dist/client/assets/ShoppingBag01-BP5VxAH1.js +1 -0
- package/dist/client/assets/Sun-6h__um8m.js +1 -0
- package/dist/client/assets/SwitchHorizontal01-kFmqIycT.js +1 -0
- package/dist/client/assets/Tool01-DOLqbPpg.js +1 -0
- package/dist/client/assets/Tooltip-B0rAI9Yx.js +1 -0
- package/dist/client/assets/Trash01-BKEk-Z9e.js +1 -0
- package/dist/client/assets/Upload01-m7-hvqhV.js +1 -0
- package/dist/client/assets/UserCheck01-D1hKwgA_.js +1 -0
- package/dist/client/assets/UserSquare-n5hmrVRJ.js +1 -0
- package/dist/client/assets/Users01-NuJAuUFJ.js +1 -0
- package/dist/client/assets/XClose-BjM1NE1O.js +1 -0
- package/dist/client/assets/Zap-RQlM8QGU.js +1 -0
- package/dist/client/assets/access-gate-Deebjbup.js +1 -0
- package/dist/client/assets/add-connection-dialog-BRti6Mfo.js +1 -0
- package/dist/client/assets/agent-app-D3xHS_9O.js +1 -0
- package/dist/client/assets/agent-assets-Bp6dDaDt.js +1 -0
- package/dist/client/assets/agent-automation-C_qYQV44.js +20 -0
- package/dist/client/assets/agent-automations-CO7P8tvo.js +1 -0
- package/dist/client/assets/agent-blog-CvFKRW3f.js +2 -0
- package/dist/client/assets/agent-blog-post-_6s7Pcys.js +2 -0
- package/dist/client/assets/agent-business-case-rnzjeF8I.js +1 -0
- package/dist/client/assets/agent-calendar-hbVli6LU.js +1 -0
- package/dist/client/assets/agent-capabilities-DVhTikaW.js +1 -0
- package/dist/client/assets/agent-connect-sources-P5XVVRxS.js +1 -0
- package/dist/client/assets/agent-deck-CeZ0YMQG.js +1 -0
- package/dist/client/assets/agent-e2e-BVXabYmD.js +1 -0
- package/dist/client/assets/agent-experiments-DP0bZBPv.js +1 -0
- package/dist/client/assets/agent-file-BZCiTwT5.js +1 -0
- package/dist/client/assets/agent-hosting-kuSMLTin.js +1 -0
- package/dist/client/assets/agent-icon-BZMMR_QJ.js +1 -0
- package/dist/client/assets/agent-library-YnAJPOyd.js +1 -0
- package/dist/client/assets/agent-library-file-C0Uek82F.js +1 -0
- package/dist/client/assets/agent-overview-88wLavNi.js +1 -0
- package/dist/client/assets/agent-releases-B_agBW4U.js +3 -0
- package/dist/client/assets/agent-settings-CCQvvroG.js +1 -0
- package/dist/client/assets/agent-site-editor-DCdX-loI.js +16 -0
- package/dist/client/assets/agent-site-editor-code-Cu1LKhQ6.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CXL_jLch.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CxsUhdV_.js +1 -0
- package/dist/client/assets/agent-view-Bfp9D7se.js +1 -0
- package/dist/client/assets/agent-view-guard-ClFaVsNU.js +1 -0
- package/dist/client/assets/ai-providers-C0Spriv9.js +1 -0
- package/dist/client/assets/alert-C6OJD9mX.js +1 -0
- package/dist/client/assets/analytics-sections-HQhRq0qQ.js +1 -0
- package/dist/client/assets/api-keys-D3K4VQOC.js +1 -0
- package/dist/client/assets/api-keys-j0vbSuXw.js +1 -0
- package/dist/client/assets/app-editor-VOfrN3Zv.js +1 -0
- package/dist/client/assets/asset-utils-C15DH2bd.js +1 -0
- package/dist/client/assets/auth-CvnIsI04.js +1 -0
- package/dist/client/assets/auth-catchall-OA4Phs8O.js +1 -0
- package/dist/client/assets/auth-entry-DU-xKCrE.js +1 -0
- package/dist/client/assets/auth-split-layout-C81mAOmm.js +1 -0
- package/dist/client/assets/authenticate-and-persist-oauth-DaemhuPP.js +1 -0
- package/dist/client/assets/automation-list-row-CITSpiPp.js +1 -0
- package/dist/client/assets/automation-runs-t9taWemJ.js +1 -0
- package/dist/client/assets/automations-CcUm6ASD.js +1 -0
- package/dist/client/assets/badge-CIeWzjRT.js +1 -0
- package/dist/client/assets/block-document-DR5QT5Ed.js +3 -0
- package/dist/client/assets/blocks-preview-workspace-context-DR3LaAem.js +1 -0
- package/dist/client/assets/blocks-tab-states-BRGzD1lP.js +1 -0
- package/dist/client/assets/blog-preview-url-3SNzFsIK.js +1 -0
- package/dist/client/assets/blog-schema-NHj4GGMp.js +1 -0
- package/dist/client/assets/blog-source-gate-CCNho2Fm.js +1 -0
- package/dist/client/assets/blog-view-gate-BJWMoPhM.js +1 -0
- package/dist/client/assets/buckets-BFmZcW4K.js +1 -0
- package/dist/client/assets/build-improve-prompt-doc-BbAfPRhf.js +2 -0
- package/dist/client/assets/calendar-BioP8p-0.js +1 -0
- package/dist/client/assets/capability-load-error-BaDj2tkD.js +1 -0
- package/dist/client/assets/category-editor-BnsWop9k.js +1 -0
- package/dist/client/assets/category-tree-DPLQbdyM.js +18 -0
- package/dist/client/assets/chart-D8fbfT9z.js +13 -0
- package/dist/client/assets/chat-context-B57JGGXD.js +43 -0
- package/dist/client/assets/chat-draft-Csnb7GK_.js +1 -0
- package/dist/client/assets/checkbox-Oe_bUdt-.js +1 -0
- package/dist/client/assets/choose-editor-Big1y9Z7.js +1 -0
- package/dist/client/assets/cli-auth-success-4k1rQvu7.js +1 -0
- package/dist/client/assets/cms-settings-editor-DFjR5KPk.js +1 -0
- package/dist/client/assets/cms-store-drafts-DZYQtMgR.js +1 -0
- package/dist/client/assets/collapsible-BLrLgxvu.js +1 -0
- package/dist/client/assets/collection-detail-BU-wU37A.js +1 -0
- package/dist/client/assets/collection-display-button-6WFdz7np.js +1 -0
- package/dist/client/assets/collection-search-BQ9RmMTt.js +1 -0
- package/dist/client/assets/collection-table-wrapper-CQwajQ_4.js +1 -0
- package/dist/client/assets/collection-tabs-DOWocMGj.js +1 -0
- package/dist/client/assets/combobox-ClMHsWKf.js +1 -0
- package/dist/client/assets/command-Cos_TZ64.js +1 -0
- package/dist/client/assets/companion-mcps-section-BZFO7Fxb.js +1 -0
- package/dist/client/assets/config-BzidGPpX.js +1 -0
- package/dist/client/assets/connect-c8K_jL8B.js +9 -0
- package/dist/client/assets/connect-key-_dDwJeT2.js +1 -0
- package/dist/client/assets/connect-layout-DbFA138P.js +1 -0
- package/dist/client/assets/connect-source-dialog-2zWZKTK_.js +1 -0
- package/dist/client/assets/connection-BOiIeHWp.js +1 -0
- package/dist/client/assets/connection-card-5lJ3I9hk.js +1 -0
- package/dist/client/assets/connection-detail-BiLC8CJT.js +1 -0
- package/dist/client/assets/connection-form-helpers-C_TW2m1s.js +1 -0
- package/dist/client/assets/connection-slug-CEHz23mv.js +1 -0
- package/dist/client/assets/connections-BSrd3oIr.js +1 -0
- package/dist/client/assets/content-changes-FNFX2_bZ.js +1 -0
- package/dist/client/assets/content-tab-CSIu28gH.js +19 -0
- package/dist/client/assets/context-DnTd3ohD.js +1 -0
- package/dist/client/assets/context-menu-CdSXYKkv.js +1 -0
- package/dist/client/assets/context-shell-CkgLZQKQ.js +37 -0
- package/dist/client/assets/create-organization-dialog-BrxhdYKj.js +1 -0
- package/dist/client/assets/daily-pulse-BZb9-coL.js +1 -0
- package/dist/client/assets/device-hint-uUOlaNmd.js +1 -0
- package/dist/client/assets/discover-CxsnCQHg.js +1 -0
- package/dist/client/assets/domain-settings-Docq4pGC.js +1 -0
- package/dist/client/assets/drawer-D2axrXOY.js +1 -0
- package/dist/client/assets/editor-DGJpDety.js +11 -0
- package/dist/client/assets/editor-classes-XpYTxIiz.js +1 -0
- package/dist/client/assets/empty-state-CJc774IL.js +1 -0
- package/dist/client/assets/empty-state-D812T-Mt.js +1 -0
- package/dist/client/assets/experiments-tab-choice-goOLK7WE.js +1 -0
- package/dist/client/assets/extract-connection-data-CRkACtpa.js +1 -0
- package/dist/client/assets/feature-gate-D2dFefK7.js +1 -0
- package/dist/client/assets/feature-paywall-B2eIjeFg.js +1 -0
- package/dist/client/assets/file-explorer-8zdWjtbz.js +2 -0
- package/dist/client/assets/file-preview-JlNoEdzq.js +1 -0
- package/dist/client/assets/file-share-button-CY6ezckh.js +3 -0
- package/dist/client/assets/file-type-icon-C1mOEwCr.js +1 -0
- package/dist/client/assets/folder-icon-DubDNIpr.js +1 -0
- package/dist/client/assets/form-UA4ZfiDn.js +1 -0
- package/dist/client/assets/frame-navigation-BhLwtoCH.js +1 -0
- package/dist/client/assets/gateway-client-q0fGAtPo.js +1 -0
- package/dist/client/assets/general-Dc5sPGH_.js +1 -0
- package/dist/client/assets/github-icon-pW3AxBE2.js +1 -0
- package/dist/client/assets/held-block-view-Ffbaz9ft.js +3 -0
- package/dist/client/assets/home-nWZTCy--.js +1 -0
- package/dist/client/assets/home-overview-C9bxwmTD.js +1 -0
- package/dist/client/assets/hosted-reconcile-C3Nz5iSn.js +1 -0
- package/dist/client/assets/icon-button-BeOwu42o.js +1 -0
- package/dist/client/assets/index-3XPmP0KD.js +1 -0
- package/dist/client/assets/index-B2VfmBS0.js +69 -0
- package/dist/client/assets/index-BD4h7BSu.js +1 -0
- package/dist/client/assets/index-Cdi-Ldg8.js +273 -0
- package/dist/client/assets/index-CpyELSlc.js +1 -0
- package/dist/client/assets/index-D3MIBDEq.js +15 -0
- package/dist/client/assets/index-D55A1a2f.js +4 -0
- package/dist/client/assets/index-DOdWDmdN.js +4 -0
- package/dist/client/assets/index-DYXbN-l9.js +26 -0
- package/dist/client/assets/index-DYenlRl-.js +1 -0
- package/dist/client/assets/index-DcVhO2Af.js +5 -0
- package/dist/client/assets/index-DsG5KK7Q.js +1 -0
- package/dist/client/assets/index-Du4hWrNz.js +1 -0
- package/dist/client/assets/index-Dx6x4q1w.js +1 -0
- package/dist/client/assets/index-Dy9vlvDP.js +1 -0
- package/dist/client/assets/index-KvaEJOWj.js +1 -0
- package/dist/client/assets/index-UZPD-9ga.js +1 -0
- package/dist/client/assets/index-W5RoTrCZ.js +1 -0
- package/dist/client/assets/index-redirect-CJ4Qgtjj.js +1 -0
- package/dist/client/assets/infiniteQueryObserver-BleoIULP.js +1 -0
- package/dist/client/assets/infra-billing-CUAweYMM.js +1 -0
- package/dist/client/assets/input-BpI93aX7.js +17 -0
- package/dist/client/assets/input-CsSO0np1.js +1 -0
- package/dist/client/assets/integration-icon-Drf54WUO.js +1 -0
- package/dist/client/assets/item-actions-C0Ln6nkJ.js +1 -0
- package/dist/client/assets/jira-icon-DwJcS_go.js +1 -0
- package/dist/client/assets/label-ChY9Byh0.js +1 -0
- package/dist/client/assets/layout-D9byrehX.js +1 -0
- package/dist/client/assets/legacy-admin-welcome-dialog-DN-Or5F5.js +1 -0
- package/dist/client/assets/legacy-agents-deep-XKnfADPK.js +1 -0
- package/dist/client/assets/legacy-content-CAaGkiig.js +4 -0
- package/dist/client/assets/legacy-main-redirect-BVOK53Qs.js +1 -0
- package/dist/client/assets/library-Dd-XIrUM.js +1 -0
- package/dist/client/assets/library-tab-DXBp162L.js +162 -0
- package/dist/client/assets/login-CUsNaJCz.js +1 -0
- package/dist/client/assets/markdown-Dv__bH9G.js +93 -0
- package/dist/client/assets/mcp-app-renderer-DeBDKYlI.js +11 -0
- package/dist/client/assets/mcp-oauth-DBU5ziI3.js +1 -0
- package/dist/client/assets/mcp-oauth-jS3lIIsR.js +1 -0
- package/dist/client/assets/members-N-UeQK0K.js +1 -0
- package/dist/client/assets/memory-DqQXd03E.js +7 -0
- package/dist/client/assets/mock-board-COC01_Yz.js +10 -0
- package/dist/client/assets/monaco-editor-BJOiPOqK.js +9 -0
- package/dist/client/assets/monitoring-N82Vdhe_.js +2 -0
- package/dist/client/assets/monitoring-stats-row-BB-xpDXp.js +1 -0
- package/dist/client/assets/multi-select-ab44oN8C.js +1 -0
- package/dist/client/assets/mustache-2nLRsql9.js +4 -0
- package/dist/client/assets/named-rule-step-fxBoVyTf.js +1 -0
- package/dist/client/assets/named-rule-view-Blop-mfz.js +1 -0
- package/dist/client/assets/new-project-dialog-Bm8AoHrl.js +1 -0
- package/dist/client/assets/new-project-store-B3BdUURt.js +1 -0
- package/dist/client/assets/oauth-callback-BQbCmAPS.js +1 -0
- package/dist/client/assets/oauth-callback-ai-provider-BmURj5yr.js +1 -0
- package/dist/client/assets/oauth-consent-DVM6ZXZ-.js +1 -0
- package/dist/client/assets/onboarding-Dn1O0qwP.js +1 -0
- package/dist/client/assets/openai-conversation-5aGLGlHN.js +3 -0
- package/dist/client/assets/optimistic-project-sidebar-views-D_JiZIA7.js +1 -0
- package/dist/client/assets/order-monitor-day-DX2OGb3Z.js +1 -0
- package/dist/client/assets/organization-choice-enMTu-bk.js +1 -0
- package/dist/client/assets/orgs-5Ms0C7mU.js +1 -0
- package/dist/client/assets/own-accounts-section-Dg_vjqV1.js +1 -0
- package/dist/client/assets/pair-DCJ8mYMb.js +48 -0
- package/dist/client/assets/parse-sections-BW6uv4VK.js +4 -0
- package/dist/client/assets/plan-ladder-Cu4p20uS.js +1 -0
- package/dist/client/assets/plan-oohE-5Ud.js +1 -0
- package/dist/client/assets/plan-page-d5XLzcCi.js +6 -0
- package/dist/client/assets/plan-usage-card-yCzU-SVy.js +6 -0
- package/dist/client/assets/popover-C8oVHQrg.js +1 -0
- package/dist/client/assets/post-calendar-Cb9CEYxQ.js +1 -0
- package/dist/client/assets/post-editor-Ti8rflkc.js +2 -0
- package/dist/client/assets/preview-content-BTv_KCDY.js +1 -0
- package/dist/client/assets/preview-dialog-BwmCc8TN.js +1 -0
- package/dist/client/assets/preview-panel-BAEW-u26.js +1 -0
- package/dist/client/assets/preview-tab-inacG_8E.js +557 -0
- package/dist/client/assets/primitives-DxszQMwM.js +1 -0
- package/dist/client/assets/product-picker-dialog-BMqSdwuE.js +1 -0
- package/dist/client/assets/profile-BO1ioLhO.js +1 -0
- package/dist/client/assets/project-app-view-CtxJFHSp.js +1 -0
- package/dist/client/assets/project-apps-TD7NdJEg.js +1 -0
- package/dist/client/assets/project-icon-nOFVZOiX.js +1 -0
- package/dist/client/assets/project-index-C2Blu8T-.js +1 -0
- package/dist/client/assets/project-reports-DjfZbYuw.js +1 -0
- package/dist/client/assets/project-tasks-D9jCfqJP.js +1 -0
- package/dist/client/assets/projects-empty-state-rrZsictf.js +1 -0
- package/dist/client/assets/projects-wjhh4b2F.js +1 -0
- package/dist/client/assets/prompts-BSu83VTa.js +1 -0
- package/dist/client/assets/record-editor-B7O1PmqZ.js +1 -0
- package/dist/client/assets/redirect-editor-Ct4ejzqu.js +1 -0
- package/dist/client/assets/reports-7rncih93.js +1 -0
- package/dist/client/assets/reports-CZhcy59_.js +3 -0
- package/dist/client/assets/reports-onboarding-jb89khVx.js +1 -0
- package/dist/client/assets/reports-tab-BOhp4OQ1.js +2 -0
- package/dist/client/assets/repositories-CGUWttv1.js +1 -0
- package/dist/client/assets/repositories-DV4BwNnU.js +1 -0
- package/dist/client/assets/repository-binding-6XbvXAcD.js +1 -0
- package/dist/client/assets/repository-picker-BP31XB9K.js +1 -0
- package/dist/client/assets/require-capability-DZY2vK8Y.js +1 -0
- package/dist/client/assets/required-auth-layout-DSes7vPo.js +1 -0
- package/dist/client/assets/reset-password-DTr5b9jo.js +1 -0
- package/dist/client/assets/resizable-DtYPg1cS.js +1 -0
- package/dist/client/assets/resolve-tab-icon-BEl9jY-0.js +1 -0
- package/dist/client/assets/review-settings-BkYREPpd.js +1 -0
- package/dist/client/assets/role-color-DN57xP4h.js +1 -0
- package/dist/client/assets/roles-DN2RX5en.js +1 -0
- package/dist/client/assets/route-7YRLPYLu.js +1 -0
- package/dist/client/assets/route-BOwZPlPd.js +1 -0
- package/dist/client/assets/route-Cm_-PH6G.js +1 -0
- package/dist/client/assets/route-page-header-FL3qwgzC.js +1 -0
- package/dist/client/assets/sandbox-git-api-CvZm4Ih1.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-DtRbGFIb.js +1 -0
- package/dist/client/assets/save-status-CUMO1vfv.js +1 -0
- package/dist/client/assets/schema-B7wLug5Z.js +1 -0
- package/dist/client/assets/schema-piMU2aDx.js +1 -0
- package/dist/client/assets/scroll-area-xrLBWH10.js +1 -0
- package/dist/client/assets/search-input-D7kGzsJ3.js +1 -0
- package/dist/client/assets/search-toggle-4jeRGC__.js +1 -0
- package/dist/client/assets/secret-picker-BQNOxxHS.js +1 -0
- package/dist/client/assets/secrets-Bk4q8jjr.js +1 -0
- package/dist/client/assets/section-array-field-DQPnV_AR.js +1 -0
- package/dist/client/assets/sections-BZXAOtKQ.js +1 -0
- package/dist/client/assets/sections-editor-DF7w1PWU.js +1 -0
- package/dist/client/assets/select-mLiWqUqQ.js +1 -0
- package/dist/client/assets/select-model-D9ouY6PP.js +1 -0
- package/dist/client/assets/seo-editor-vszxMFSG.js +1 -0
- package/dist/client/assets/separator-BKw-ZLtc.js +1 -0
- package/dist/client/assets/session-runtime-B-X2j6mK.js +1 -0
- package/dist/client/assets/settings-tab-BpSSpXCa.js +1 -0
- package/dist/client/assets/sheet-V9G9MKD_.js +1 -0
- package/dist/client/assets/shell-layout-aMr2_JYj.js +1 -0
- package/dist/client/assets/site-draft-actions-D7_bzyRO.js +7 -0
- package/dist/client/assets/site-draft-view-DjdsGDwM.js +1 -0
- package/dist/client/assets/site-editor-CsxEfLOw.js +1 -0
- package/dist/client/assets/site-editor-toast-dw1Pn_Dx.js +1 -0
- package/dist/client/assets/skills-DGtHAHAm.js +1 -0
- package/dist/client/assets/slider-Hmd9IxOX.js +1 -0
- package/dist/client/assets/sortable.esm-C6EwAxqy.js +1 -0
- package/dist/client/assets/sso-BVMprU4t.js +1 -0
- package/dist/client/assets/suggestion-DiN8e3O2.js +2 -0
- package/dist/client/assets/super-agent-icon-Cv2SkWEI.js +1 -0
- package/dist/client/assets/switch-C-msOQel.js +1 -0
- package/dist/client/assets/synced-repos-7kbPQ_lo.js +1 -0
- package/dist/client/assets/tab-icon-glyph-DVCsBFWB.js +1 -0
- package/dist/client/assets/table-D4bwd7tG.js +1 -0
- package/dist/client/assets/tabs-C6-jqCYP.js +1 -0
- package/dist/client/assets/task-board-aZEvWLsI.js +1 -0
- package/dist/client/assets/task-key-BjOTOW3y.js +5 -0
- package/dist/client/assets/task-route-yQe8kENc.js +1 -0
- package/dist/client/assets/task-status-B2rRCaGt.js +1 -0
- package/dist/client/assets/taskboard-analytics-C3WbMJp5.js +1 -0
- package/dist/client/assets/tasks-GTm5tSNR.js +4 -0
- package/dist/client/assets/tasks-hFmiVR4w.js +1 -0
- package/dist/client/assets/textarea--AVkwPvk.js +1 -0
- package/dist/client/assets/thread-analytics-zilazIia.js +1 -0
- package/dist/client/assets/thread-button-GINDMz1x.js +1 -0
- package/dist/client/assets/thread-intent-D0jCxjRo.js +15 -0
- package/dist/client/assets/thread-route-BRnKSjX8.js +1 -0
- package/dist/client/assets/thread-route-BrDRfI1Z.js +1 -0
- package/dist/client/assets/thread-sheet-body-Bi3jjGgj.js +1 -0
- package/dist/client/assets/time-range-picker-C4CQ_8V_.js +1 -0
- package/dist/client/assets/toggle-group-Bt99dpwe.js +1 -0
- package/dist/client/assets/tool-set-selector-IWP5bAeB.js +1 -0
- package/dist/client/assets/toolbar-icon-button-B201FBVH.js +1 -0
- package/dist/client/assets/tooltip-DQ0KlQ_6.js +1 -0
- package/dist/client/assets/tooltipContext-Cy-djwXr.js +1 -0
- package/dist/client/assets/track-Ba7sL2ey.js +1 -0
- package/dist/client/assets/types-BDlmg_WH.js +77 -0
- package/dist/client/assets/url-slug-Caxjze8n.js +1 -0
- package/dist/client/assets/usage-stats-CYjGdZ2U.js +141 -0
- package/dist/client/assets/use-ai-providers-DFecqYxb.js +1 -0
- package/dist/client/assets/use-api-keys-ByK3ztdl.js +1 -0
- package/dist/client/assets/use-apply-named-rule-CudFPluy.js +1 -0
- package/dist/client/assets/use-ask-in-chat-B5CWC5Ok.js +1 -0
- package/dist/client/assets/use-automations-CMgkgtfS.js +1 -0
- package/dist/client/assets/use-autosave-BLYEqkPN.js +1 -0
- package/dist/client/assets/use-blocks-v8-project-DiOBim9I.js +1 -0
- package/dist/client/assets/use-blog-view-BWs861dA.js +1 -0
- package/dist/client/assets/use-chat-layout-state-Bny7cjy4.js +1 -0
- package/dist/client/assets/use-cms-publish-actions-uZLWeOhJ.js +10 -0
- package/dist/client/assets/use-connect-companion-DsJAPed1.js +1 -0
- package/dist/client/assets/use-connection-JBI1rS5M.js +1 -0
- package/dist/client/assets/use-content-sync-B3Q-IEBL.js +1 -0
- package/dist/client/assets/use-copy-VPhtJFz_.js +1 -0
- package/dist/client/assets/use-current-view-D_kbHiwq.js +1 -0
- package/dist/client/assets/use-date-fns-locale-4Nxz4-V8.js +1 -0
- package/dist/client/assets/use-debounced-autosave-DW-WRCOS.js +1 -0
- package/dist/client/assets/use-debounced-value-CPqtQjku.js +1 -0
- package/dist/client/assets/use-deco-credits-BEpMzfhg.js +1 -0
- package/dist/client/assets/use-decopilot-events-D_Q7X953.js +1 -0
- package/dist/client/assets/use-delete-block-RxQmjBMS.js +1 -0
- package/dist/client/assets/use-delete-connection-DldqsElg.js +1 -0
- package/dist/client/assets/use-deployment-admin--gqHVRuO.js +1 -0
- package/dist/client/assets/use-entitlements-ByDJr900.js +1 -0
- package/dist/client/assets/use-fast-preview-draft-url-6vFB2DcW.js +1 -0
- package/dist/client/assets/use-file-configs-CBOpfPja.js +1 -0
- package/dist/client/assets/use-id-selection-CigEQpod.js +1 -0
- package/dist/client/assets/use-in-settings-CqQlGm69.js +1 -0
- package/dist/client/assets/use-inbox-feed-DspkzReR.js +1 -0
- package/dist/client/assets/use-infinite-scroll-OASH4IJn.js +1 -0
- package/dist/client/assets/use-join-requests-9KSsZ7h7.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-Gch5efpY.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-h6lxdgXh.js +1 -0
- package/dist/client/assets/use-mcp-client-DUPhaqI5.js +10 -0
- package/dist/client/assets/use-mcp-prompts-Cu6bA1zM.js +1 -0
- package/dist/client/assets/use-mcp-tools-BbvfyEqw.js +1 -0
- package/dist/client/assets/use-mobile-CUIjg5eg.js +1 -0
- package/dist/client/assets/use-move-blocks-Dr2ivqEX.js +1 -0
- package/dist/client/assets/use-navigate-to-agent-auqVYVQq.js +1 -0
- package/dist/client/assets/use-org-fs-mzJda8BT.js +1 -0
- package/dist/client/assets/use-org-notice-B7jRz0LR.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-6IMB7KmW.js +1 -0
- package/dist/client/assets/use-org-sso-CofrLYLm.js +1 -0
- package/dist/client/assets/use-organization-settings-C2ZgOw0L.js +1 -0
- package/dist/client/assets/use-panel-navigate-gxWgO54K.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-Cbn_yrc6.js +1 -0
- package/dist/client/assets/use-project-scope-D8nlb73E.js +1 -0
- package/dist/client/assets/use-recent-apps-Rc7BNVLA.js +1 -0
- package/dist/client/assets/use-reports-diagnostic-Cy9ShZK6.js +1 -0
- package/dist/client/assets/use-sandbox-events-69MPy-zM.js +2 -0
- package/dist/client/assets/use-secrets-OrZEwpu-.js +1 -0
- package/dist/client/assets/use-section-preview-base-DRNiUqaU.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-MMY2Rys1.js +1 -0
- package/dist/client/assets/use-tags-BVyIhEps.js +1 -0
- package/dist/client/assets/use-task-board-analytics-C-0rx5tM.js +1 -0
- package/dist/client/assets/use-task-board-item-prs-CLUxVift.js +1 -0
- package/dist/client/assets/use-task-board-items-CjdkGXzx.js +1 -0
- package/dist/client/assets/use-task-board-prompts--8zOxB9H.js +1 -0
- package/dist/client/assets/use-task-metadata-ByirHWtB.js +1 -0
- package/dist/client/assets/use-thread-outputs-CZ2ZFBWZ.js +1 -0
- package/dist/client/assets/use-view-draft-kind-DhH4-fSh.js +1 -0
- package/dist/client/assets/use-voice-input-B2QeFfLu.js +1 -0
- package/dist/client/assets/useInfiniteQuery-B9iLSNQU.js +1 -0
- package/dist/client/assets/useQueries-J_W9MBoN.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Bshhqoph.js +1 -0
- package/dist/client/assets/users-BCUy9nKO.js +1 -0
- package/dist/client/assets/utils-DUQl0AEe.js +4 -0
- package/dist/client/assets/variant-calendar-XQKSBmNA.js +1 -0
- package/dist/client/assets/variant-matcher-override-D63pJ9Ve.js +1 -0
- package/dist/client/assets/view-header-DTdoSSky.js +1 -0
- package/dist/client/assets/virtual-mcp-D8yER0ha.js +1 -0
- package/dist/client/assets/watch-sse-pool-BNxDzPla.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AlertCircle-zs-4VsZH.js +0 -1
- package/dist/client/assets/AreaChart-BqJdUyPN.js +0 -1
- package/dist/client/assets/ArrowLeft-C6W2V0Wz.js +0 -1
- package/dist/client/assets/ArrowRight-KrRhtVTs.js +0 -1
- package/dist/client/assets/ArrowUp-Dee6sHNv.js +0 -1
- package/dist/client/assets/BookOpen01-CbTlL5fO.js +0 -1
- package/dist/client/assets/CartesianChart-euJHunXT.js +0 -1
- package/dist/client/assets/CategoricalChart-CArIOb7V.js +0 -33
- package/dist/client/assets/CheckCircle-COSnGnjh.js +0 -1
- package/dist/client/assets/ChevronDown-CNsLQB9X.js +0 -1
- package/dist/client/assets/ChevronSelectorVertical-Bcno_AMM.js +0 -1
- package/dist/client/assets/ChevronUp-BIDp2ptm.js +0 -1
- package/dist/client/assets/CreditCard01-DpMmVef7.js +0 -1
- package/dist/client/assets/Eye-C8IBFOJ4.js +0 -1
- package/dist/client/assets/File02-BPE81X6H.js +0 -1
- package/dist/client/assets/Fingerprint04-D2sxs8Jp.js +0 -1
- package/dist/client/assets/Flag01-DJexopqk.js +0 -1
- package/dist/client/assets/Globe04-CFnmWCFT.js +0 -1
- package/dist/client/assets/Image01-BQ_N_-hp.js +0 -1
- package/dist/client/assets/Key01-YbIqec_5.js +0 -1
- package/dist/client/assets/LayoutLeft-B398oVOF.js +0 -1
- package/dist/client/assets/LinkBroken01-JnPrABUL.js +0 -1
- package/dist/client/assets/MessageCircle01-xkB-KYwl.js +0 -1
- package/dist/client/assets/Minus-CeSa2hYk.js +0 -1
- package/dist/client/assets/Monitor01-vFwnyrQW.js +0 -1
- package/dist/client/assets/Play-CMB9KZlr.js +0 -1
- package/dist/client/assets/Plus-T4a-gWso.js +0 -1
- package/dist/client/assets/ReferenceLine-DBT_Xb_r.js +0 -1
- package/dist/client/assets/SearchMd-DEhP1OXm.js +0 -1
- package/dist/client/assets/ShoppingBag01-Dmv3_STe.js +0 -1
- package/dist/client/assets/Sun-BUcQiIPl.js +0 -1
- package/dist/client/assets/SwitchHorizontal01-CyqXFb8X.js +0 -1
- package/dist/client/assets/Tool01-XkpyIGeg.js +0 -1
- package/dist/client/assets/Tooltip-DfRxYwmq.js +0 -1
- package/dist/client/assets/Trash01-57nd_Led.js +0 -1
- package/dist/client/assets/Upload01-puJlDWvm.js +0 -1
- package/dist/client/assets/UserCheck01-Cf1MRytQ.js +0 -1
- package/dist/client/assets/UserSquare-Bxa1cuC8.js +0 -1
- package/dist/client/assets/Users01-ktVAj2Ya.js +0 -1
- package/dist/client/assets/XClose-C0dMm0LD.js +0 -1
- package/dist/client/assets/Zap-Bp9tzS_i.js +0 -1
- package/dist/client/assets/access-gate-Bde09VYu.js +0 -1
- package/dist/client/assets/add-connection-dialog-2481_pjY.js +0 -1
- package/dist/client/assets/agent-app-BsIHnsy3.js +0 -1
- package/dist/client/assets/agent-assets-BYdxh-AY.js +0 -1
- package/dist/client/assets/agent-automation-OQJpZnZG.js +0 -20
- package/dist/client/assets/agent-automations-BOIOvAOU.js +0 -1
- package/dist/client/assets/agent-blog-D3Vj_z7q.js +0 -2
- package/dist/client/assets/agent-blog-post-DyKkYJQO.js +0 -2
- package/dist/client/assets/agent-business-case-CRx0aRFr.js +0 -1
- package/dist/client/assets/agent-calendar-B28Mjfsg.js +0 -1
- package/dist/client/assets/agent-capabilities-BXuVa2AT.js +0 -1
- package/dist/client/assets/agent-connect-sources-DLqtyZsJ.js +0 -1
- package/dist/client/assets/agent-deck-JLzTNq7u.js +0 -1
- package/dist/client/assets/agent-e2e-CCbeY7tE.js +0 -1
- package/dist/client/assets/agent-experiments-D4jWOqlO.js +0 -1
- package/dist/client/assets/agent-file-DMhA2fSf.js +0 -1
- package/dist/client/assets/agent-hosting-BwJE9L3o.js +0 -1
- package/dist/client/assets/agent-icon-CQr8igXA.js +0 -1
- package/dist/client/assets/agent-library-D__mndff.js +0 -1
- package/dist/client/assets/agent-library-file-DJ5_nqJ7.js +0 -1
- package/dist/client/assets/agent-overview-Cimskqoo.js +0 -1
- package/dist/client/assets/agent-releases-BWOUYCL8.js +0 -3
- package/dist/client/assets/agent-settings-BXC1CfmE.js +0 -1
- package/dist/client/assets/agent-site-editor-DhZ_vpnc.js +0 -16
- package/dist/client/assets/agent-site-editor-code-U0L3Bj0_.js +0 -2
- package/dist/client/assets/agent-site-editor-content-M-YAoLLH.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-ySISkHL-.js +0 -1
- package/dist/client/assets/agent-view-CfESc9ia.js +0 -1
- package/dist/client/assets/agent-view-guard-DZYwAeNh.js +0 -1
- package/dist/client/assets/ai-providers-CqpV3C1V.js +0 -1
- package/dist/client/assets/alert-DSaL78AL.js +0 -1
- package/dist/client/assets/analytics-sections-TEC5MPzk.js +0 -1
- package/dist/client/assets/api-keys-CoC2dv_0.js +0 -1
- package/dist/client/assets/api-keys-wnrwKzIy.js +0 -1
- package/dist/client/assets/app-editor-BiXfIJP4.js +0 -1
- package/dist/client/assets/asset-utils-KFwxVdDm.js +0 -1
- package/dist/client/assets/auth-BgrYkUnI.js +0 -1
- package/dist/client/assets/auth-catchall-mzWcFf4a.js +0 -1
- package/dist/client/assets/auth-entry-DpsIwGkR.js +0 -1
- package/dist/client/assets/auth-split-layout-D5uj6LZc.js +0 -1
- package/dist/client/assets/authenticate-and-persist-oauth-B48YSuL-.js +0 -1
- package/dist/client/assets/automation-list-row-N1F5xcxd.js +0 -1
- package/dist/client/assets/automation-runs-DEW6t1DG.js +0 -1
- package/dist/client/assets/automations-BrAg0C5O.js +0 -1
- package/dist/client/assets/badge-Dc2CiE9F.js +0 -1
- package/dist/client/assets/block-document-ldf6G-hR.js +0 -3
- package/dist/client/assets/blocks-preview-workspace-context-DjpSqFsz.js +0 -1
- package/dist/client/assets/blocks-tab-states-CH65ZuMR.js +0 -1
- package/dist/client/assets/blog-preview-url-9_QxFNI8.js +0 -1
- package/dist/client/assets/blog-schema-CP1SDehI.js +0 -1
- package/dist/client/assets/blog-source-gate-Bh4EkBw9.js +0 -1
- package/dist/client/assets/blog-view-gate-BAEmNabZ.js +0 -1
- package/dist/client/assets/buckets-Beoxnsfw.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-Dt06kt3u.js +0 -2
- package/dist/client/assets/calendar-oaD7GIMY.js +0 -1
- package/dist/client/assets/capability-load-error-BPr28tsy.js +0 -1
- package/dist/client/assets/category-editor-xfctzdTg.js +0 -1
- package/dist/client/assets/category-tree-DaQvlJrH.js +0 -18
- package/dist/client/assets/chart-D-ACSGiF.js +0 -13
- package/dist/client/assets/chat-context-BTezEUIM.js +0 -43
- package/dist/client/assets/chat-draft-BdLnDNOX.js +0 -1
- package/dist/client/assets/checkbox-29nVCrNH.js +0 -1
- package/dist/client/assets/choose-editor-BIOUzwn7.js +0 -1
- package/dist/client/assets/cli-auth-success-Cbvnr7MM.js +0 -1
- package/dist/client/assets/cms-settings-editor-LOmqRqSu.js +0 -1
- package/dist/client/assets/cms-store-drafts-DHWVVAjz.js +0 -1
- package/dist/client/assets/collapsible-3XVKS3uw.js +0 -1
- package/dist/client/assets/collection-detail-Ci4PaZDZ.js +0 -1
- package/dist/client/assets/collection-display-button-M5aJUo3o.js +0 -1
- package/dist/client/assets/collection-search-iDX69NsY.js +0 -1
- package/dist/client/assets/collection-table-wrapper-DUXNrlj0.js +0 -1
- package/dist/client/assets/collection-tabs-Btzyx4la.js +0 -1
- package/dist/client/assets/combobox-CGjprg9s.js +0 -1
- package/dist/client/assets/command-ytn_tnST.js +0 -1
- package/dist/client/assets/companion-mcps-section-BZwowdx4.js +0 -1
- package/dist/client/assets/config-Bd79MTdh.js +0 -1
- package/dist/client/assets/connect-D6K3BOuu.js +0 -9
- package/dist/client/assets/connect-key-BgyRg9_8.js +0 -1
- package/dist/client/assets/connect-layout-CHffhcM0.js +0 -1
- package/dist/client/assets/connect-source-dialog-BrkeXVaf.js +0 -1
- package/dist/client/assets/connection-BcmeUmb6.js +0 -1
- package/dist/client/assets/connection-card-9KWWOsyf.js +0 -1
- package/dist/client/assets/connection-detail-CvpjGRKo.js +0 -1
- package/dist/client/assets/connection-form-helpers-DyPpXtcN.js +0 -1
- package/dist/client/assets/connection-slug-CITEG2zd.js +0 -1
- package/dist/client/assets/connections-_zwIIJ2v.js +0 -1
- package/dist/client/assets/content-changes-CNE9At5r.js +0 -1
- package/dist/client/assets/content-tab-BiBzF0EH.js +0 -19
- package/dist/client/assets/context-XiHOjzpF.js +0 -1
- package/dist/client/assets/context-menu-Bj3D0el2.js +0 -1
- package/dist/client/assets/context-shell-CxA0zyG6.js +0 -37
- package/dist/client/assets/create-organization-dialog-DsUazB1H.js +0 -1
- package/dist/client/assets/daily-pulse-_gDmSKnX.js +0 -1
- package/dist/client/assets/delete-copy-CeNI6mL4.js +0 -4
- package/dist/client/assets/device-hint-DvcUYNDc.js +0 -1
- package/dist/client/assets/discover-Ck-PA83R.js +0 -1
- package/dist/client/assets/domain-settings-CZXf4SXI.js +0 -1
- package/dist/client/assets/drawer-DqVxP8Jv.js +0 -1
- package/dist/client/assets/editor-DfvbkBkA.js +0 -11
- package/dist/client/assets/editor-classes-CrWfM1MO.js +0 -1
- package/dist/client/assets/empty-state-BCAKng4r.js +0 -1
- package/dist/client/assets/empty-state-BuApx5zE.js +0 -1
- package/dist/client/assets/experiments-tab-choice-CrtVzTZA.js +0 -1
- package/dist/client/assets/extract-connection-data-B4yl9vIy.js +0 -1
- package/dist/client/assets/feature-gate-mqgWP6c4.js +0 -1
- package/dist/client/assets/feature-paywall-B54yMXCw.js +0 -1
- package/dist/client/assets/file-explorer-BoRe4nLO.js +0 -2
- package/dist/client/assets/file-preview-CNB-KC8v.js +0 -1
- package/dist/client/assets/file-share-button-Cy_9rI2b.js +0 -3
- package/dist/client/assets/file-type-icon-Bx89indJ.js +0 -1
- package/dist/client/assets/folder-icon-DUpHLnVa.js +0 -1
- package/dist/client/assets/form-BaNm1ncd.js +0 -1
- package/dist/client/assets/frame-navigation-B224U8Y_.js +0 -1
- package/dist/client/assets/gateway-client-bpMJMTjo.js +0 -1
- package/dist/client/assets/general-5CYgVBPS.js +0 -1
- package/dist/client/assets/github-icon-BpIeoUa2.js +0 -1
- package/dist/client/assets/held-block-view-D72TIWbg.js +0 -3
- package/dist/client/assets/home-CsRZFTku.js +0 -1
- package/dist/client/assets/home-overview-B5P57iaw.js +0 -1
- package/dist/client/assets/hosted-reconcile-C45iSGuX.js +0 -1
- package/dist/client/assets/icon-button-Dbv0tgir.js +0 -1
- package/dist/client/assets/index-BAuQgwYT.js +0 -1
- package/dist/client/assets/index-BGjxecA_.js +0 -15
- package/dist/client/assets/index-BMmgvdyP.js +0 -273
- package/dist/client/assets/index-BX6V8n33.js +0 -26
- package/dist/client/assets/index-BhMBQY03.js +0 -5
- package/dist/client/assets/index-BppUTz25.js +0 -1
- package/dist/client/assets/index-Bt2hcW3a.js +0 -4
- package/dist/client/assets/index-CExQfe9w.js +0 -1
- package/dist/client/assets/index-CP8cgaO3.js +0 -1
- package/dist/client/assets/index-CayOD16X.js +0 -1
- package/dist/client/assets/index-CdgMBpv2.js +0 -1
- package/dist/client/assets/index-ChVfhev5.js +0 -1
- package/dist/client/assets/index-Cwm3EyiD.js +0 -69
- package/dist/client/assets/index-D2apPugj.js +0 -1
- package/dist/client/assets/index-DB_Dn83c.js +0 -4
- package/dist/client/assets/index-DgmYGyM_.js +0 -1
- package/dist/client/assets/index-Dz6Au5o9.js +0 -1
- package/dist/client/assets/index-redirect-BuEDvQ8L.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-DC9OQ0m9.js +0 -1
- package/dist/client/assets/infra-billing-BI93EPBe.js +0 -1
- package/dist/client/assets/input-B920MtH-.js +0 -17
- package/dist/client/assets/input-DZhb5gtf.js +0 -1
- package/dist/client/assets/integration-icon-yZavC8dD.js +0 -1
- package/dist/client/assets/item-actions-BNADkYVK.js +0 -1
- package/dist/client/assets/jira-icon-B2ILXL5z.js +0 -1
- package/dist/client/assets/label-BsdPbIgn.js +0 -1
- package/dist/client/assets/layout-DucMG4HI.js +0 -1
- package/dist/client/assets/legacy-admin-welcome-dialog-CM6EIPbl.js +0 -1
- package/dist/client/assets/legacy-agents-deep-12lm0zGE.js +0 -1
- package/dist/client/assets/legacy-main-redirect-Cx7uczmy.js +0 -1
- package/dist/client/assets/library-D7y0iNOc.js +0 -1
- package/dist/client/assets/library-tab-BFZxpvsQ.js +0 -162
- package/dist/client/assets/login-W9rMHAzJ.js +0 -1
- package/dist/client/assets/markdown-D8V7Sgds.js +0 -93
- package/dist/client/assets/mcp-app-renderer-6BfN4jr_.js +0 -11
- package/dist/client/assets/mcp-oauth-CV_BFPFK.js +0 -1
- package/dist/client/assets/mcp-oauth-oZ6ObBXt.js +0 -1
- package/dist/client/assets/members-DA1VMkyL.js +0 -1
- package/dist/client/assets/memory-CpT3jFpR.js +0 -7
- package/dist/client/assets/mock-board-DhiEwpvi.js +0 -10
- package/dist/client/assets/monaco-editor-BHijSa_4.js +0 -9
- package/dist/client/assets/monitoring-BLbOknPH.js +0 -2
- package/dist/client/assets/monitoring-stats-row-CQs9NuZd.js +0 -1
- package/dist/client/assets/multi-select-C7NTvkrm.js +0 -1
- package/dist/client/assets/mustache-D7kq_Yqj.js +0 -4
- package/dist/client/assets/named-rule-step-kZSRS2dP.js +0 -1
- package/dist/client/assets/named-rule-view-BhbqwO4a.js +0 -1
- package/dist/client/assets/new-project-dialog-CvLgVi1-.js +0 -1
- package/dist/client/assets/new-project-store-CWyQMqrI.js +0 -1
- package/dist/client/assets/oauth-callback-BvhhBsQz.js +0 -1
- package/dist/client/assets/oauth-callback-ai-provider-XKzosB85.js +0 -1
- package/dist/client/assets/oauth-consent-DEpUn2te.js +0 -1
- package/dist/client/assets/onboarding-iRoED3QV.js +0 -1
- package/dist/client/assets/openai-conversation-D8RSnFpd.js +0 -3
- package/dist/client/assets/optimistic-project-sidebar-views-6oKfsAsw.js +0 -1
- package/dist/client/assets/order-monitor-day-CVt1HaIA.js +0 -1
- package/dist/client/assets/organization-choice-BCsBjf7I.js +0 -1
- package/dist/client/assets/orgs-Da42b86J.js +0 -1
- package/dist/client/assets/own-accounts-section-DEperHet.js +0 -1
- package/dist/client/assets/pair-DEUaOPDK.js +0 -48
- package/dist/client/assets/parse-sections-BB68bRGp.js +0 -4
- package/dist/client/assets/plan-CxtLu9wT.js +0 -1
- package/dist/client/assets/plan-ladder-i18YlQV6.js +0 -1
- package/dist/client/assets/plan-page-C_l5wK4D.js +0 -6
- package/dist/client/assets/plan-usage-card-IkpVS8ea.js +0 -6
- package/dist/client/assets/popover-CKMvJYaH.js +0 -1
- package/dist/client/assets/post-calendar-42sHEuRx.js +0 -1
- package/dist/client/assets/post-editor-ColELUaT.js +0 -2
- package/dist/client/assets/preview-content-Bv6qPjyh.js +0 -1
- package/dist/client/assets/preview-dialog-BuwKwjMK.js +0 -1
- package/dist/client/assets/preview-panel-DSz621Cs.js +0 -1
- package/dist/client/assets/preview-tab-CFHKxx-p.js +0 -557
- package/dist/client/assets/primitives-Bq_3Wf-F.js +0 -1
- package/dist/client/assets/product-picker-dialog-B8dooJYV.js +0 -1
- package/dist/client/assets/profile-9GFbHJcp.js +0 -1
- package/dist/client/assets/project-app-view-BQ1CAB4E.js +0 -1
- package/dist/client/assets/project-apps-BB_IT0O4.js +0 -1
- package/dist/client/assets/project-icon-CILSP45k.js +0 -1
- package/dist/client/assets/project-index-D61H4EqW.js +0 -1
- package/dist/client/assets/project-reports-CKBtbiia.js +0 -1
- package/dist/client/assets/project-tasks-BaEZY4A1.js +0 -1
- package/dist/client/assets/projects-C22YMJHR.js +0 -1
- package/dist/client/assets/projects-empty-state-Cf86B9rH.js +0 -1
- package/dist/client/assets/prompts-Cp_kGeWz.js +0 -1
- package/dist/client/assets/record-editor-Du5DKM3i.js +0 -1
- package/dist/client/assets/redirect-editor-DyM0niUo.js +0 -1
- package/dist/client/assets/reports-BpRTWO1W.js +0 -1
- package/dist/client/assets/reports-onboarding-CeNgniZp.js +0 -1
- package/dist/client/assets/reports-tMovwGp_.js +0 -3
- package/dist/client/assets/reports-tab-BFrGNtx7.js +0 -2
- package/dist/client/assets/repositories-D-AVXLcC.js +0 -1
- package/dist/client/assets/repositories-DbEf0xxS.js +0 -1
- package/dist/client/assets/repository-binding-CLXJrD2F.js +0 -1
- package/dist/client/assets/repository-picker-BwrS_UEr.js +0 -1
- package/dist/client/assets/require-capability-BkfUGtJ4.js +0 -1
- package/dist/client/assets/required-auth-layout-BEVFmsHo.js +0 -1
- package/dist/client/assets/reset-password-ChOWZdKi.js +0 -1
- package/dist/client/assets/resizable-Cq7yFaMK.js +0 -1
- package/dist/client/assets/resolve-tab-icon-Bme8i971.js +0 -1
- package/dist/client/assets/review-settings-Dpc0SWV9.js +0 -1
- package/dist/client/assets/role-color-vHx_DAVI.js +0 -1
- package/dist/client/assets/roles-BX-2fwsw.js +0 -1
- package/dist/client/assets/route-C_DrCiSk.js +0 -1
- package/dist/client/assets/route-MWqHbops.js +0 -1
- package/dist/client/assets/route-NgHZ55sL.js +0 -1
- package/dist/client/assets/route-page-header-Dy5tce6D.js +0 -1
- package/dist/client/assets/sandbox-git-api-C3a7TLkx.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-D3H00c3v.js +0 -1
- package/dist/client/assets/save-status-q5Dh_h2L.js +0 -1
- package/dist/client/assets/schema-BYOuoNw0.js +0 -1
- package/dist/client/assets/schema-CVPWx_yq.js +0 -1
- package/dist/client/assets/scroll-area-CfhdnDFt.js +0 -1
- package/dist/client/assets/search-input-CRRC_fWB.js +0 -1
- package/dist/client/assets/search-toggle-DZ2_2vgS.js +0 -1
- package/dist/client/assets/secret-picker-DlGRU-W3.js +0 -1
- package/dist/client/assets/secrets-ClhyBGRJ.js +0 -1
- package/dist/client/assets/section-array-field-rwGu-Qtr.js +0 -1
- package/dist/client/assets/sections-FOH8L8Lj.js +0 -1
- package/dist/client/assets/sections-editor-BNh4K-LH.js +0 -1
- package/dist/client/assets/select-Di5ANHUA.js +0 -1
- package/dist/client/assets/select-model-D5MRe0ZA.js +0 -1
- package/dist/client/assets/seo-editor-DTv-SJUd.js +0 -1
- package/dist/client/assets/separator-CO3x7tuo.js +0 -1
- package/dist/client/assets/session-runtime-ClRShm8T.js +0 -1
- package/dist/client/assets/settings-tab-B6QE6RyR.js +0 -1
- package/dist/client/assets/sheet-CFau8JoI.js +0 -1
- package/dist/client/assets/shell-layout-G2iXBjw3.js +0 -1
- package/dist/client/assets/site-draft-actions-Tq4wYUsu.js +0 -7
- package/dist/client/assets/site-draft-view-BuAhhomp.js +0 -1
- package/dist/client/assets/site-editor-BpVrO5I3.js +0 -1
- package/dist/client/assets/site-editor-toast-Coqou6or.js +0 -1
- package/dist/client/assets/skills-DXpwwG_L.js +0 -1
- package/dist/client/assets/slider-D8kQwdg9.js +0 -1
- package/dist/client/assets/sortable.esm-CEKuuK2i.js +0 -1
- package/dist/client/assets/sso-BXOx3buW.js +0 -1
- package/dist/client/assets/suggestion-C9J_wxr2.js +0 -2
- package/dist/client/assets/super-agent-icon-xHVDQIeV.js +0 -1
- package/dist/client/assets/switch-C_NPIZ5s.js +0 -1
- package/dist/client/assets/synced-repos-y1pbyNVO.js +0 -1
- package/dist/client/assets/tab-icon-glyph-B1LxUXUa.js +0 -1
- package/dist/client/assets/table-C0MdJiMz.js +0 -1
- package/dist/client/assets/tabs-CBGIDsQ6.js +0 -1
- package/dist/client/assets/task-board-g92HFb2J.js +0 -1
- package/dist/client/assets/task-key-CPvb47F-.js +0 -5
- package/dist/client/assets/task-route-BrlW4p8V.js +0 -1
- package/dist/client/assets/task-status-Dr_Gxqv3.js +0 -1
- package/dist/client/assets/taskboard-analytics-BoxYGZIv.js +0 -1
- package/dist/client/assets/tasks-B9bumv8s.js +0 -1
- package/dist/client/assets/tasks-BPM2YYB6.js +0 -4
- package/dist/client/assets/textarea-Cvk1urHb.js +0 -1
- package/dist/client/assets/thread-analytics-DRQdXilR.js +0 -1
- package/dist/client/assets/thread-button-7-27_BzH.js +0 -1
- package/dist/client/assets/thread-intent-Cu3cd8uc.js +0 -15
- package/dist/client/assets/thread-route-CB-N9w0l.js +0 -1
- package/dist/client/assets/thread-route-D-baj20o.js +0 -1
- package/dist/client/assets/thread-sheet-body-CRPIpLbZ.js +0 -1
- package/dist/client/assets/time-range-picker-Cd_RKSqA.js +0 -1
- package/dist/client/assets/toggle-group-DtbUkQGD.js +0 -1
- package/dist/client/assets/tool-set-selector-CYQ6kPG7.js +0 -1
- package/dist/client/assets/toolbar-icon-button-BQYtg1BA.js +0 -1
- package/dist/client/assets/tooltip-onAt6mjf.js +0 -1
- package/dist/client/assets/tooltipContext-JevyhW8a.js +0 -1
- package/dist/client/assets/track-DlyW4w72.js +0 -1
- package/dist/client/assets/types-B0-EO3Nz.js +0 -77
- package/dist/client/assets/url-slug-DBrcBZs3.js +0 -1
- package/dist/client/assets/usage-stats-C2NScOkv.js +0 -141
- package/dist/client/assets/use-ai-providers-DqbAZoXL.js +0 -1
- package/dist/client/assets/use-api-keys-SB8nK55B.js +0 -1
- package/dist/client/assets/use-apply-named-rule-CUSu9Nmp.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CBmnPyLe.js +0 -1
- package/dist/client/assets/use-automations-DraCvvb5.js +0 -1
- package/dist/client/assets/use-autosave-CIXPUT0Y.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-b59Z7CJU.js +0 -1
- package/dist/client/assets/use-blog-view-DfO2XREC.js +0 -1
- package/dist/client/assets/use-chat-layout-state-DRdyp_S-.js +0 -1
- package/dist/client/assets/use-cms-publish-actions-f6twx8VR.js +0 -10
- package/dist/client/assets/use-connect-companion-BbqIpor1.js +0 -1
- package/dist/client/assets/use-connection-DDQwEkLl.js +0 -1
- package/dist/client/assets/use-content-sync-BK8UJ--A.js +0 -1
- package/dist/client/assets/use-copy-AklJlq6l.js +0 -1
- package/dist/client/assets/use-current-view-CPSxcL3G.js +0 -1
- package/dist/client/assets/use-date-fns-locale-C6VxBk8K.js +0 -1
- package/dist/client/assets/use-debounced-autosave-B0kz-rMN.js +0 -1
- package/dist/client/assets/use-debounced-value-C0m9d99A.js +0 -1
- package/dist/client/assets/use-deco-credits-7oQsseQ9.js +0 -1
- package/dist/client/assets/use-decopilot-events-DV_tbPtl.js +0 -1
- package/dist/client/assets/use-delete-block-DCxtUQOn.js +0 -1
- package/dist/client/assets/use-delete-connection-DXaUCvqe.js +0 -1
- package/dist/client/assets/use-deployment-admin-BljDa5Bu.js +0 -1
- package/dist/client/assets/use-entitlements-BAwQwBa5.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-CVWsv9CY.js +0 -1
- package/dist/client/assets/use-file-configs-D7b25syW.js +0 -1
- package/dist/client/assets/use-id-selection-COm6_IAg.js +0 -1
- package/dist/client/assets/use-in-settings-BeNAckmx.js +0 -1
- package/dist/client/assets/use-inbox-feed-D03ErDaq.js +0 -1
- package/dist/client/assets/use-infinite-scroll-C4Z2ynmw.js +0 -1
- package/dist/client/assets/use-join-requests-DbnRA27e.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-WmnkoW-U.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-B_4XtG5u.js +0 -1
- package/dist/client/assets/use-mcp-client-D-cTJfDR.js +0 -10
- package/dist/client/assets/use-mcp-prompts-B-75xSaN.js +0 -1
- package/dist/client/assets/use-mcp-tools-EqIk5sWe.js +0 -1
- package/dist/client/assets/use-mobile-0mea_Z-0.js +0 -1
- package/dist/client/assets/use-move-blocks-DM1425zY.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-D-E94JGh.js +0 -1
- package/dist/client/assets/use-never-published-CMjfqWp4.js +0 -1
- package/dist/client/assets/use-org-fs-CiPkuCLc.js +0 -1
- package/dist/client/assets/use-org-notice-BVOjQvwT.js +0 -1
- package/dist/client/assets/use-org-repo-syncs-DEKQsTB4.js +0 -1
- package/dist/client/assets/use-org-sso-CGwCAGCo.js +0 -1
- package/dist/client/assets/use-organization-settings-C__c5w3v.js +0 -1
- package/dist/client/assets/use-panel-navigate-5WEiNzDG.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-Cu22oXrh.js +0 -1
- package/dist/client/assets/use-project-scope-DRrw6nxr.js +0 -1
- package/dist/client/assets/use-recent-apps-C-t1e-Ku.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-BICw9GAF.js +0 -1
- package/dist/client/assets/use-sandbox-events-DnkkMJds.js +0 -2
- package/dist/client/assets/use-secrets-D6650Sy-.js +0 -1
- package/dist/client/assets/use-section-preview-base-DT5e4pyX.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-Cfg9nZE8.js +0 -1
- package/dist/client/assets/use-tags-Og9trWKN.js +0 -1
- package/dist/client/assets/use-task-board-analytics-BLI3sTZK.js +0 -1
- package/dist/client/assets/use-task-board-item-prs-DeMf4M18.js +0 -1
- package/dist/client/assets/use-task-board-items-Ci7e8zOt.js +0 -1
- package/dist/client/assets/use-task-board-prompts-BtG_cTBL.js +0 -1
- package/dist/client/assets/use-task-metadata-CmH5A72m.js +0 -1
- package/dist/client/assets/use-thread-outputs-C3j8E_0I.js +0 -1
- package/dist/client/assets/use-view-draft-kind-Cn-cuGlE.js +0 -1
- package/dist/client/assets/use-voice-input-3XxheJL_.js +0 -1
- package/dist/client/assets/useInfiniteQuery-fo1UgepG.js +0 -1
- package/dist/client/assets/useQueries-Clz1ECPW.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BG0LO28C.js +0 -1
- package/dist/client/assets/users-BqP7_SVW.js +0 -1
- package/dist/client/assets/utils-BWtGOAbe.js +0 -4
- package/dist/client/assets/variant-calendar-VOOk6HE5.js +0 -1
- package/dist/client/assets/variant-matcher-override-DVQvWv8V.js +0 -1
- package/dist/client/assets/view-header-J91fl_Ku.js +0 -1
- package/dist/client/assets/virtual-mcp-BExHFzN_.js +0 -1
- package/dist/client/assets/watch-sse-pool-C17fWLa7.js +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-5aGLGlHN.js","assets/index-Cdi-Ldg8.js","assets/index-jg-Sa77q.css","assets/usage-stats-CYjGdZ2U.js","assets/utils-CVEq3hMx.js","assets/markdown-Dv__bH9G.js","assets/use-copy-VPhtJFz_.js","assets/agent-icon-BZMMR_QJ.js","assets/AlertCircle-xosAEaLd.js","assets/UserCheck01-D1hKwgA_.js","assets/Tool01-DOLqbPpg.js","assets/ArrowUp-D4g_D7TY.js","assets/ArrowLeft-s_BV961r.js","assets/ArrowRight-BoIkS6P4.js","assets/BookOpen01-CuhzPAzU.js","assets/Globe04-DMmZoyet.js","assets/CheckCircle-BKxt6JEi.js","assets/ChevronDown-DIkHoN0o.js","assets/ChevronSelectorVertical-TYlaEGrJ.js","assets/ChevronUp-D61VSyxy.js","assets/UserSquare-n5hmrVRJ.js","assets/LinkBroken01-5IFNWpUM.js","assets/CreditCard01-7wh2SPUT.js","assets/File02-Bf99ynSR.js","assets/MessageCircle01-MNDoLPzV.js","assets/SwitchHorizontal01-kFmqIycT.js","assets/Eye-C0bB50C2.js","assets/Fingerprint04-DeU3ipCm.js","assets/Flag01-covUodPa.js","assets/Image01-BeGbQ3TX.js","assets/Key01-Bu_xE8-A.js","assets/LayoutLeft-CZDdpuNu.js","assets/Minus-BXX2vBX8.js","assets/Monitor01-CbmKbBlb.js","assets/Sun-6h__um8m.js","assets/Play-mrw71pF0.js","assets/Plus-BfHy14x9.js","assets/SearchMd-BrgKf_9M.js","assets/ShoppingBag01-BP5VxAH1.js","assets/Trash01-BKEk-Z9e.js","assets/Upload01-m7-hvqhV.js","assets/Users01-NuJAuUFJ.js","assets/XClose-BjM1NE1O.js","assets/Zap-RQlM8QGU.js","assets/chat-context-B57JGGXD.js","assets/use-panel-navigate-gxWgO54K.js","assets/thread-route-BRnKSjX8.js","assets/use-project-scope-D8nlb73E.js","assets/repository-binding-6XbvXAcD.js","assets/use-mcp-client-DUPhaqI5.js","assets/auth-CvnIsI04.js","assets/use-view-draft-kind-DhH4-fSh.js","assets/use-blog-view-BWs861dA.js","assets/use-organization-settings-C2ZgOw0L.js","assets/schema-piMU2aDx.js","assets/task-board-aZEvWLsI.js","assets/thread-intent-D0jCxjRo.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BNxDzPla.js","assets/session-runtime-B-X2j6mK.js","assets/use-entitlements-ByDJr900.js","assets/use-ai-providers-DFecqYxb.js","assets/use-current-view-D_kbHiwq.js","assets/use-in-settings-CqQlGm69.js","assets/use-decopilot-events-D_Q7X953.js","assets/use-org-fs-mzJda8BT.js","assets/useInfiniteQuery-B9iLSNQU.js","assets/infiniteQueryObserver-BleoIULP.js","assets/use-mobile-CUIjg5eg.js","assets/tooltip-DQ0KlQ_6.js","assets/index-UZPD-9ga.js","assets/gateway-client-q0fGAtPo.js","assets/form-UA4ZfiDn.js","assets/label-ChY9Byh0.js","assets/icon-button-BeOwu42o.js","assets/file-type-icon-C1mOEwCr.js","assets/chat-draft-Csnb7GK_.js","assets/use-voice-input-B2QeFfLu.js","assets/popover-C8oVHQrg.js","assets/drawer-D2axrXOY.js","assets/index-D55A1a2f.js","assets/checkbox-Oe_bUdt-.js","assets/select-mLiWqUqQ.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/tabs-C6-jqCYP.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-BEpMzfhg.js","assets/toggle-group-Bt99dpwe.js","assets/input-CsSO0np1.js","assets/suggestion-DiN8e3O2.js","assets/use-mcp-prompts-Cu6bA1zM.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-B2eIjeFg.js","assets/plan-ladder-Cu4p20uS.js","assets/add-connection-dialog-BRti6Mfo.js","assets/collection-search-BQ9RmMTt.js","assets/extract-connection-data-CRkACtpa.js","assets/metadata-D72DunRR.js","assets/connection-BOiIeHWp.js","assets/url-slug-Caxjze8n.js","assets/connection-card-5lJ3I9hk.js","assets/connection-slug-CEHz23mv.js","assets/integration-icon-Drf54WUO.js","assets/textarea--AVkwPvk.js","assets/use-connection-JBI1rS5M.js","assets/schema-B7wLug5Z.js","assets/connection-form-helpers-C_TW2m1s.js","assets/authenticate-and-persist-oauth-DaemhuPP.js","assets/mcp-oauth-jS3lIIsR.js","assets/mcp-oauth-DBU5ziI3.js","assets/collection-tabs-DOWocMGj.js","assets/badge-CIeWzjRT.js","assets/use-infinite-scroll-OASH4IJn.js","assets/useSuspenseInfiniteQuery-Bshhqoph.js","assets/use-task-board-items-CjdkGXzx.js","assets/use-chat-layout-state-Bny7cjy4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{fp as _e,c as D,b as q,r as R,m as z,j as n,b8 as He,aJ as ie,bF as St,aK as oe,cs as De,B as W,aI as xs,aH as vs,dD as bs,ct as As,J as be,eb as ys,gi as ye,gj as it,cK as js,an as ws,e as ks,I as Cs,t as Se,E as te,a6 as Ne,d as Je,a_ as Nt,x as Ss,aW as Ns,w as Is,v as Ts,D as _s,ey as Ds,a7 as Ms,K as Ps,i as Es,_ as Rs,X as Us,Z as Ls,Y as xe,as as rt,aq as lt,ar as Vt,h as Fs,bz as Os,by as zs,aF as $s,av as Bs,dC as Ks,dH as ve,bn as qs,dJ as Qs,bb as ct,gk as Ws,a as Ys,au as Gs,aw as Hs,aY as Qe,eR as Js,o as Zs,cy as Xs,cz as en,b3 as tn,ai as It}from"./index-Cdi-Ldg8.js";import{i as Tt,k as sn,j as nn,p as _t,P as on,q as an,S as rn}from"./usage-stats-CYjGdZ2U.js";import{A as ln,I as Vn,Z as Dt,aC as We,g as cn,e as dn,aH as un,a6 as Mt,aI as Pt,aF as pn,L as hn,aJ as fn}from"./agent-icon-BZMMR_QJ.js";import{s as Et}from"./XClose-BjM1NE1O.js";import{I as mn}from"./icon-button-BeOwu42o.js";import{F as gn}from"./file-type-icon-C1mOEwCr.js";import{u as xn}from"./use-current-view-D_kbHiwq.js";import{b as Me,I as vn,J as bn,c as Le,d as Fe,p as An,K as yn,M as jn,N as wn,u as Rt,f as kn,s as Cn,e as Sn}from"./chat-context-B57JGGXD.js";import{b as Nn}from"./repository-binding-6XbvXAcD.js";import{A as In,w as Tn}from"./use-view-draft-kind-DhH4-fSh.js";import{n as _n,z as Dn,p as Mn,b as Pn,w as En,j as Rn}from"./thread-intent-D0jCxjRo.js";import{r as dt,i as Un,c as Ln,w as Fn,H as On}from"./chat-draft-Csnb7GK_.js";import{u as zn,a as $n,T as Bn}from"./use-voice-input-B2QeFfLu.js";import{i as Ut}from"./ArrowRight-BoIkS6P4.js";import{i as Lt}from"./ArrowUp-D4g_D7TY.js";import{n as Ft}from"./BookOpen01-CuhzPAzU.js";import{a as Ot}from"./Image01-BeGbQ3TX.js";import{k as Kn}from"./UserSquare-n5hmrVRJ.js";import{i as qn}from"./Upload01-m7-hvqhV.js";import{i as Qn}from"./AlertCircle-xosAEaLd.js";import{a as Ye,b as Ze,d as Xe,f as et,F as zt}from"./form-UA4ZfiDn.js";import{c as Wn,S as Yn,b as Gn,a as Hn,d as Jn}from"./select-mLiWqUqQ.js";import{t as Oe,h as $t}from"./UserCheck01-D1hKwgA_.js";import{t as Zn}from"./ChevronDown-DIkHoN0o.js";import{T as Bt,a as Kt,c as qt}from"./tooltip-DQ0KlQ_6.js";import{i as Xn}from"./ArrowLeft-s_BV961r.js";import{c as eo,b as to}from"./tabs-C6-jqCYP.js";import{c as ze,f as so}from"./use-entitlements-ByDJr900.js";import{u as no}from"./use-deco-credits-BEpMzfhg.js";import{a as ut,T as oo}from"./toggle-group-Bt99dpwe.js";import{s as ao,d as io,g as pt,a as ro}from"./gateway-client-q0fGAtPo.js";import{t as lo}from"./utils-CVEq3hMx.js";import{m as tt,g as Vo,b as co}from"./index-D55A1a2f.js";import{p as Qt,u as uo,T as po,a as ho,U as fo}from"./input-CsSO0np1.js";import{a as mo}from"./use-mcp-client-DUPhaqI5.js";import{l as go,g as xo}from"./use-mcp-prompts-Cu6bA1zM.js";import{s as ht}from"./Plus-BfHy14x9.js";import"./suggestion-DiN8e3O2.js";import{p as vo,q as bo}from"./question-004-sINsf4GQ.js";import{F as ft}from"./feature-paywall-B2eIjeFg.js";import{A as Ao}from"./add-connection-dialog-BRti6Mfo.js";import{u as yo}from"./use-organization-settings-C2ZgOw0L.js";import{b as jo}from"./use-task-board-items-CjdkGXzx.js";import{u as wo}from"./use-mobile-CUIjg5eg.js";import{r as ko}from"./use-chat-layout-state-Bny7cjy4.js";const Co=_e("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const So=_e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const No=_e("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Io=_e("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const To=_e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Ke="cubic-bezier(0.645, 0.045, 0.355, 1)",ur=44,_o={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},Do={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Mo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ge(t){const e=D.c(69),{icon:s,label:o,count:a,title:i,footerLeft:r,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,h=q(),[f,m]=R.useState(d),[x,v]=R.useState(!1);let g;e[0]!==c?(g=()=>{v(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const b=g;if(x)return null;const j=Do[p],A=_o[p];let w;e[2]!==j||e[3]!==A?(w=z("relative flex flex-col rounded-xl bg-background border shadow-soft","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(Po),e[5]=y):y=e[5];const k=f&&"rounded-b-none",S=!f&&"rounded-b-xl";let _;e[6]!==k||e[7]!==S?(_=z("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent transition-colors rounded-t-xl",k,S),e[6]=k,e[7]=S,e[8]=_):_=e[8];const N=Mo[p];let I;e[9]!==N?(I=z("shrink-0",N),e[9]=N,e[10]=I):I=e[10];let T;e[11]!==s||e[12]!==I?(T=n.jsx("span",{className:I,children:s}),e[11]=s,e[12]=I,e[13]=T):T=e[13];let E;e[14]!==o?(E=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=E):E=e[15];let U;e[16]!==a?(U=a?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:a}):null,e[16]=a,e[17]=U):U=e[17];const L=f?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==L?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Zn,{size:16,style:{transform:L,transition:`transform 180ms ${Ke}`}})}),e[18]=L,e[19]=M):M=e[19];let B;e[20]!==h?(B=h("chat.collapsibleHighlight.closeLabel"),e[20]=h,e[21]=B):B=e[21];let K;e[22]!==h?(K=h("chat.collapsibleHighlight.closeTitle"),e[22]=h,e[23]=K):K=e[23];let H,F;e[24]!==b?(H=re=>{re.stopPropagation(),b()},F=re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),re.stopPropagation(),b())},e[24]=b,e[25]=H,e[26]=F):(H=e[25],F=e[26]);let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(He,{size:16}),e[27]=Y):Y=e[27];let P;e[28]!==B||e[29]!==K||e[30]!==H||e[31]!==F?(P=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":B,title:K,onClick:H,onKeyDown:F,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:Y}),e[28]=B,e[29]=K,e[30]=H,e[31]=F,e[32]=P):P=e[32];let J;e[33]!==f||e[34]!==T||e[35]!==E||e[36]!==U||e[37]!==M||e[38]!==P||e[39]!==_?(J=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:y,className:_,children:[T,E,U,M,P]}),e[33]=f,e[34]=T,e[35]=E,e[36]=U,e[37]=M,e[38]=P,e[39]=_,e[40]=J):J=e[40];const X=f?"1fr":"0fr";let ee;e[41]!==X?(ee={display:"grid",gridTemplateRows:X,transition:`grid-template-rows 180ms ${Ke}`},e[41]=X,e[42]=ee):ee=e[42];let Q;e[43]===Symbol.for("react.memo_cache_sentinel")?(Q={overflow:"hidden",minHeight:0},e[43]=Q):Q=e[43];const C=f?1:0;let O;e[44]!==C?(O={opacity:C,transition:`opacity 120ms ${Ke}`,maxHeight:"60vh"},e[44]=C,e[45]=O):O=e[45];let G;e[46]!==i?(G=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=G):G=e[47];let Z;e[48]!==V||e[49]!==i?(Z=V?n.jsx("div",{className:z("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=Z):Z=e[50];let ae;e[51]!==G||e[52]!==Z?(ae=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[G,Z]}),e[51]=G,e[52]=Z,e[53]=ae):ae=e[53];let Ve;e[54]!==r||e[55]!==l?(Ve=r||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:r}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=r,e[55]=l,e[56]=Ve):Ve=e[56];let ce;e[57]!==O||e[58]!==ae||e[59]!==Ve?(ce=n.jsx("div",{style:Q,children:n.jsxs("div",{className:"flex flex-col",style:O,children:[ae,Ve]})}),e[57]=O,e[58]=ae,e[59]=Ve,e[60]=ce):ce=e[60];let se;e[61]!==ee||e[62]!==ce?(se=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:ee,children:ce}),e[61]=ee,e[62]=ce,e[63]=se):se=e[63];let le;return e[64]!==J||e[65]!==se||e[66]!==w||e[67]!==p?(le=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:w,children:[J,se]}),e[64]=J,e[65]=se,e[66]=w,e[67]=p,e[68]=le):le=e[68],le}function Po(t){return!t}const Eo=ie({content:oe().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:De(["pending","in_progress","completed"]),activeForm:oe().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Wt=ie({todos:St(Eo)}),Ro="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";_n({description:Ro,inputSchema:Dn(Wt),execute:async({todos:t})=>({ok:!0,count:t.length})});const Uo="tool-todo_write",Lo=new Set(["input-available","output-available"]);function Fo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let a=o.length-1;a>=0;a--){const i=o[a];if(i.type!==Uo||typeof i.state!="string"||!Lo.has(i.state))continue;const r=Wt.safeParse(i.input);if(r.success)return r.data.todos}}return[]}function Yt(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:lo(ao(o)),input:s.input})}return e}function Gt(t){return t.at(-1)}function Ht(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Oo(t){return t?t.message.startsWith("[CREDITS]"):!1}const zo={isCreditExhausted:!1,planRefusal:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function $o(t){const{messages:e,error:s,finishReason:o,isStreaming:a,isWaitingForApprovals:i}=t;if(!a&&s&&Oo(s))return{...zo,isCreditExhausted:!0};const r=e.at(-1),l=r?.role==="assistant"?r.parts:[],V=l,u=!!V.filter(A=>A.type==="tool-user_ask").filter(A=>A.state!=="output-available").length,c=V.some(Tt),p=Ht(l),h=Yt(V),f=Fo(e),m=a?null:Mn(s),x=!a&&!!s&&!m,v=h.length>0||a&&i,g=p.length>0,j=!a&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||g||c))&&!x;return{isCreditExhausted:!1,planRefusal:m,hasTodos:f.length>0,showError:x,showWarning:j,hasApprovals:v,hasPlans:g,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:f}}function Jt(){const t=D.c(6),{messages:e,error:s,finishReason:o,isStreaming:a,isWaitingForApprovals:i}=Me(),r=s??null,l=o??null;let V;return t[0]!==a||t[1]!==i||t[2]!==e||t[3]!==r||t[4]!==l?(V=$o({messages:e,error:r,finishReason:l,isStreaming:a,isWaitingForApprovals:i}),t[0]=a,t[1]=i,t[2]=e,t[3]=r,t[4]=l,t[5]=V):V=t[5],V}function pr(){const t=Jt(),e=ze("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const mt="start-task",Bo=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
|
+
|
|
4
|
+
1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
|
|
5
|
+
2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
|
|
6
|
+
3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
|
|
7
|
+
4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
|
|
8
|
+
|
|
9
|
+
The report follows.`;function Ko(t){return{...t,content:[{type:"paragraph",content:[sn({id:mt,name:mt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:Bo}}]})]},...t.content??[]]}}function gt(t){const e=D.c(14),{icon:s,inset:o,label:a,title:i,dismissLabel:r,onDismiss:l}=t,V=o?"pl-1":"pl-2.5";let d;e[0]!==V?(d=z("surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 text-xs text-foreground",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=n.jsx("span",{className:"truncate",children:a}),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Et,{size:12}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l?(p=n.jsx(mn,{label:r,size:"icon-sm",onClick:l,children:c}),e[5]=r,e[6]=l,e[7]=p):p=e[7];let h;return e[8]!==s||e[9]!==d||e[10]!==u||e[11]!==p||e[12]!==i?(h=n.jsxs("span",{className:d,title:i,children:[s,u,p]}),e[8]=s,e[9]=d,e[10]=u,e[11]=p,e[12]=i,e[13]=h):h=e[13],h}function qo(){const t=D.c(13),e=q(),s=xn(),o=vn();if(!s&&!o)return null;const a=s?s.project&&!s.isHome?`${s.project.title} · ${s.title}`:s.title:"";let i;t[0]!==o?(i=o?bn(o.path):"",t[0]=o,t[1]=i):i=t[1];const r=i;let l;t[2]!==e||t[3]!==s||t[4]!==a?(l=s&&n.jsx(gt,{icon:s.project?n.jsx(ln,{icon:s.project.icon??null,name:s.project.title,size:"xs"}):n.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}),inset:!!s.project,label:a,title:e("chat.input.viewContext",{name:a}),dismissLabel:e("chat.input.viewDismiss"),onDismiss:s.dismiss}),t[2]=e,t[3]=s,t[4]=a,t[5]=l):l=t[5];let V;t[6]!==r||t[7]!==o||t[8]!==e?(V=o&&n.jsx(gt,{icon:n.jsx(gn,{filename:r,className:"h-4 w-3 shrink-0"}),label:r,title:e("chat.input.openFileContext",{name:r}),dismissLabel:e("chat.input.openFileDismiss"),onDismiss:o.dismiss}),t[6]=r,t[7]=o,t[8]=e,t[9]=V):V=t[9];let d;return t[10]!==l||t[11]!==V?(d=n.jsxs("div",{className:"flex min-w-0 flex-wrap gap-1.5 px-3 pt-3",children:[l,V]}),t[10]=l,t[11]=V,t[12]=d):d=t[12],d}function Qo(t){return{autosend:In,sidepanel:!0,...t?{mainpanel:!1}:{}}}function Wo(t){const e=D.c(30),{current:s,total:o,onPrev:a,onNext:i}=t,r=q();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=z("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==r?(u=r("chat.pagination.previousLabel"),e[2]=r,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Xn,{size:14}),e[4]=c):c=e[4];let p;e[5]!==a||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:a,disabled:l,className:d,"aria-label":u,children:c}),e[5]=a,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const h=s+1;let f;e[10]!==r||e[11]!==h||e[12]!==o?(f=r("chat.pagination.counter",{current:h,total:o}),e[10]=r,e[11]=h,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==f?(m=n.jsx("span",{className:"tabular-nums text-xs",children:f}),e[14]=f,e[15]=m):m=e[15];const x=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==v?(g=z("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=g):g=e[17];let b;e[18]!==r?(b=r("chat.pagination.nextLabel"),e[18]=r,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ut,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==x||e[23]!==g||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:x,className:g,"aria-label":b,children:j}),e[21]=i,e[22]=x,e[23]=g,e[24]=b,e[25]=A):A=e[25];let w;return e[26]!==A||e[27]!==p||e[28]!==m?(w=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,A]}),e[26]=A,e[27]=p,e[28]=m,e[29]=w):w=e[29],w}function Zt(t){const e=D.c(8),{currentIndex:s,total:o,onPrev:a,onNext:i,extraLeft:r}=t;let l;e[0]!==s||e[1]!==i||e[2]!==a||e[3]!==o?(l=n.jsx(Wo,{current:s,total:o,onPrev:a,onNext:i}),e[0]=s,e[1]=i,e[2]=a,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==r||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,r]}),e[5]=r,e[6]=l,e[7]=V):V=e[7],V}function Yo(t){const e=D.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:a,onAdvanceOrSubmit:i,submitLabel:r,nextLabel:l}=t,u=o?r===void 0?"Submit":r:l===void 0?"Next":l,c=o?s:!a,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let h;e[0]!==c||e[1]!==i?(h=()=>{c||i()},e[0]=c,e[1]=i,e[2]=h):h=e[2];const f=c&&"opacity-50 cursor-not-allowed";let m;e[3]!==f?(m=z("h-7 px-2.5 text-xs",f),e[3]=f,e[4]=m):m=e[4];let x;e[5]!==c||e[6]!==u||e[7]!==h||e[8]!==m?(x=n.jsx(W,{type:"button",size:"sm","aria-disabled":c,onClick:h,className:m,children:u}),e[5]=c,e[6]=u,e[7]=h,e[8]=m,e[9]=x):x=e[9];const v=x;if(!p)return v;let g;e[10]!==v?(g=n.jsx(Bt,{asChild:!0,children:v}),e[10]=v,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Kt,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==g||e[15]!==b?(j=n.jsxs(qt,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=j):j=e[16],j}function Xt(t,e,s){return t.findIndex(o=>e(o)===s)}function xt(t,e,s,o){return t.length===0?!1:t.every(a=>o(s[e(a)]))}function vt(t,e,s,o,a){if(t.length===0)return null;const i=Xt(t,e,a);for(let r=1;r<=t.length;r++){const l=t[(i+r)%t.length];if(!l)continue;const V=e(l);if(V!==a&&!o(s[V]))return V}return null}function Go(t){return!t.isStreaming&&t.allAnswered}function es(t){const{parts:e,partKey:s,schema:o,defaultValues:a,isStreaming:i,hasAnswer:r,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=R.useState(V),[c,p]=R.useState(!1),h=xs({resolver:vs(o),defaultValues:a}),f=h.watch(),m=Xt(e,s,d),x=m>=0?e[m]:void 0,v=r(f[d]),g=xt(e,s,f,r),b=Go({isStreaming:i,allAnswered:g}),j=()=>{if(m>0){const N=e[m-1];N&&u(s(N))}},A=()=>{if(m>=0&&m<e.length-1){const N=e[m+1];N&&u(s(N))}},w=()=>{const N=h.getValues(),I=vt(e,s,N,r,d);I&&u(I)},y=()=>{h.handleSubmit(N=>{const I=N;for(const T of e)l(T,I[s(T)])})()},k=R.useRef(y);k.current=y;const S=()=>{b&&(p(!1),k.current())},_=()=>{const N=h.getValues();if(xt(e,s,N,r)){if(i){p(!0);return}p(!1),k.current()}else{const I=vt(e,s,N,r,d);I&&u(I)}};return R.useEffect(()=>{if(c&&!i){if(!g){p(!1);return}p(!1),k.current()}},[c,i,g]),{form:h,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:x,isCurrentAnswered:v,isAllAnswered:g,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:w,submit:S,submitOrAdvance:_}}const ts="chat.approval.defaultDenyReason";function ss(t){const e=D.c(36),{onYolo:s}=t,o=q(),[a,i]=be();let r,l,V,d,u,c,p,h,f;if(e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==o){const j=ye.find(y=>y.value===a.toolApprovalLevel)??ye[0];let A;e[13]!==s||e[14]!==a||e[15]!==i?(A=y=>{const k=y,S=a.toolApprovalLevel??"readonly";i({...a,toolApprovalLevel:k}),k==="auto"&&s(S)},e[13]=s,e[14]=a,e[15]=i,e[16]=A):A=e[16];const w=A;V=Yn,h=a.toolApprovalLevel,f=w,l=Gn,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent h-7 gap-1",p=Ho,r=Hn,d=o(j.shortKey),e[0]=s,e[1]=a,e[2]=i,e[3]=o,e[4]=r,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=h,e[12]=f}else r=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],h=e[11],f=e[12];let m;e[17]!==r||e[18]!==d?(m=n.jsx(r,{children:d}),e[17]=r,e[18]=d,e[19]=m):m=e[19];let x;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==m?(x=n.jsx(l,{size:u,className:c,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=m,e[25]=x):x=e[25];let v;e[26]!==o?(v=ye.map(j=>n.jsx(Wn,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=v):v=e[27];let g;e[28]!==v?(g=n.jsx(Jn,{children:v}),e[28]=v,e[29]=g):g=e[29];let b;return e[30]!==V||e[31]!==g||e[32]!==h||e[33]!==f||e[34]!==x?(b=n.jsxs(V,{value:h,onValueChange:f,children:[x,g]}),e[30]=V,e[31]=g,e[32]=h,e[33]=f,e[34]=x,e[35]=b):b=e[35],b}function Ho(t){return t.stopPropagation()}function ns(t){const e=D.c(8),{input:s}=t,o=q();if(s==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let l;return e[2]!==r?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3],l}let a;try{let r;e[4]!==s?(r=JSON.stringify(s,null,2),e[4]=s,e[5]=r):r=e[5],a=r}catch{a=String(s)}let i;return e[6]!==a?(i=n.jsx("div",{className:"px-4",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a})}),e[6]=a,e[7]=i):i=e[7],i}function Jo(t){const e=D.c(38),{approval:s,onRespond:o}=t,a=q(),[i]=be(),r=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==r||e[2]!==o||e[3]!==a?(l=()=>o(s.approvalId,!1,a(ts),r),e[0]=s.approvalId,e[1]=r,e[2]=o,e[3]=a,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==r||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,r),e[5]=s.approvalId,e[6]=r,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=S=>o(s.approvalId,!0,void 0,S),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let h;e[12]!==p?(h=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ss,{onYolo:p})}),e[12]=p,e[13]=h):h=e[13];const f=h;let m;e[14]!==a?(m=a("chat.approval.denyButton"),e[14]=a,e[15]=m):m=e[15];let x;e[16]!==V||e[17]!==m?(x=n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:V,children:m}),e[16]=V,e[17]=m,e[18]=x):x=e[18];let v;e[19]!==a?(v=a("chat.approval.acceptButton"),e[19]=a,e[20]=v):v=e[20];let g;e[21]!==u||e[22]!==v?(g=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=g):g=e[23];let b;e[24]!==x||e[25]!==g?(b=n.jsxs(n.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Oe,{size:14}),e[27]=A):A=e[27];let w;e[28]!==a?(w=a("chat.approval.needsApproval"),e[28]=a,e[29]=w):w=e[29];let y;e[30]!==s.input?(y=n.jsx(ns,{input:s.input}),e[30]=s.input,e[31]=y):y=e[31];let k;return e[32]!==s.friendlyName||e[33]!==f||e[34]!==j||e[35]!==w||e[36]!==y?(k=n.jsx(ge,{icon:A,label:w,title:s.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:j,children:y}),e[32]=s.friendlyName,e[33]=f,e[34]=j,e[35]=w,e[36]=y,e[37]=k):k=e[37],k}const Zo=bs(oe(),ie({approved:As().optional(),levelOverride:De(["auto","readonly"]).optional()}));function Xo(t){const e=D.c(46),{approvals:s,isStreaming:o,onRespond:a}=t,i=q(),[r]=be(),l=r.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(sa)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==a||e[4]!==i?(u=(I,T)=>{const E=T;typeof E?.approved=="boolean"&&a(I.approvalId,E.approved,E.approved===!1?i(ts):void 0,E.levelOverride??l)},e[2]=l,e[3]=a,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:ta,schema:Zo,defaultValues:d,isStreaming:o,hasAnswer:ea,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=es(c);let h;e[11]!==s||e[12]!==p?(h=I=>{p.form.reset(Object.fromEntries(s.map(T=>[T.approvalId,{approved:!0,levelOverride:I}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=h):h=e[13];const f=h,m=p.currentPart,x=p.form;let v;e[14]!==p?(v=I=>{I.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Oe,{size:14}),e[16]=g):g=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const j=m?.friendlyName??"";let A;e[20]!==f?(A=n.jsx(ss,{onYolo:f}),e[20]=f,e[21]=A):A=e[21];let w;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(w=n.jsx(Zt,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:A}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=A,e[27]=w):w=e[27];let y;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(y=m?n.jsx(na,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=y):y=e[31];let k;e[32]!==m?(k=m?n.jsx(ns,{input:m.input}):null,e[32]=m,e[33]=k):k=e[33];let S;e[34]!==w||e[35]!==y||e[36]!==k||e[37]!==b||e[38]!==j?(S=n.jsx(ge,{icon:g,label:b,title:j,defaultExpanded:!0,footerLeft:w,footerRight:y,children:k}),e[34]=w,e[35]=y,e[36]=k,e[37]=b,e[38]=j,e[39]=S):S=e[39];let _;e[40]!==S||e[41]!==v?(_=n.jsx("form",{onSubmit:v,children:S}),e[40]=S,e[41]=v,e[42]=_):_=e[42];let N;return e[43]!==p.form||e[44]!==_?(N=n.jsx(Ye,{...x,children:_}),e[43]=p.form,e[44]=_,e[45]=N):N=e[45],N}function ea(t){return typeof t?.approved=="boolean"}function ta(t){return t.approvalId}function sa(t){return[t.approvalId,{approved:void 0}]}function na(t){const e=D.c(7),{approvalId:s,control:o,onChange:a}=t,i=q(),r=`${s}.approved`;let l;e[0]!==a||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(W,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),a()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(W,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),a()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=a,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==r||e[5]!==l?(V=n.jsx(ys,{control:o,name:r,render:l}),e[3]=o,e[4]=r,e[5]=l,e[6]=V):V=e[6],V}function oa(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Oe,{className:"size-5 text-muted-foreground animate-pulse motion-reduce:animate-none"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function aa(t){const e=D.c(8),{approvals:s,isStreaming:o,onRespond:a}=t;if(o&&s.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(oa,{}),e[0]=r):r=e[0],r}if(s.length===0)return null;if(s.length===1){const r=s[0];if(!r)return null;let l;return e[1]!==a||e[2]!==r?(l=n.jsx(Jo,{approval:r,onRespond:a}),e[1]=a,e[2]=r,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==a?(i=n.jsx(Xo,{approvals:s,isStreaming:o,onRespond:a}),e[4]=s,e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ia(t){const e=D.c(28),{plan:s,onApprove:o,onDismiss:a}=t,i=q();let r;e[0]!==o||e[1]!==s.plan?(r=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=r):r=e[2];const l=r;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==a||e[6]!==V?(d=n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:a,children:V}),e[5]=a,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const h=p;let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($t,{size:14}),e[16]=f):f=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=e[18];let x;e[19]!==i?(x=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=x):x=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(nn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let g;return e[23]!==h||e[24]!==v||e[25]!==m||e[26]!==x?(g=n.jsx(ge,{icon:f,label:m,title:x,defaultExpanded:!0,footerRight:h,children:v}),e[23]=h,e[24]=v,e[25]=m,e[26]=x,e[27]=g):g=e[27],g}function ra(t){const e=D.c(6),{plans:s,onApprove:o,onDismiss:a}=t;let i;e[0]!==s?(i=Gt(s),e[0]=s,e[1]=i):i=e[1];const r=i;if(!r)return null;let l;return e[2]!==r||e[3]!==o||e[4]!==a?(l=n.jsx(ia,{plan:r,onApprove:o,onDismiss:a}),e[2]=r,e[3]=o,e[4]=a,e[5]=l):l=e[5],l}function os(t){return t?"response"in t?t.response:t.option??t.draft:""}const bt=ie({response:oe().min(1,"Response is required")}),la=ie({option:oe().nullable(),draft:oe()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Va=ie({response:De(["yes","no"])});function ca(t){switch(t.type){case"text":return bt;case"choice":return la;case"confirm":return Va;default:return bt}}function da(t){const e={};for(const s of t)e[s.toolCallId]=ca(s.input);return ie(e)}function ua(t){const e=D.c(7),{control:s,name:o,placeholder:a}=t,i=q();let r;e[0]!==a||e[1]!==i?(r=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(Ze,{children:[n.jsx(Xe,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Dt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:a||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(et,{})]})},e[0]=a,e[1]=i,e[2]=r):r=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==r?(l=n.jsx(zt,{control:s,name:o,render:r}),e[3]=s,e[4]=o,e[5]=r,e[6]=l):l=e[6],l}function as(t,e){const s=D.c(4);let o,a;s[0]!==t||s[1]!==e?(o=()=>{const i=r=>{if(js(r.target)||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},a=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=a):(o=s[2],a=s[3]),R.useEffect(o,a)}function pa(t){const e=D.c(51),{control:s,name:o,options:a}=t,i=q(),r=`${o}.option`;let l;e[0]!==s||e[1]!==r?(l={control:s,name:r,defaultValue:null},e[0]=s,e[1]=r,e[2]=l):l=e[2];const{field:V}=it(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=it(u),p=V.value,h=c.value??"";let f;if(e[6]!==V||e[7]!==a?(f=L=>{const M=a[L];M!=null&&V.onChange(M)},e[6]=V,e[7]=a,e[8]=f):f=e[8],as(a.length,f),a.length===0)return null;const m=p===null;let x;e[9]!==i?(x=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=x):x=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==a||e[14]!==i){let L;e[16]!==V||e[17]!==p||e[18]!==i?(L=(M,B)=>{const K=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:z("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",K&&"bg-accent/50",!K&&"hover:bg-accent"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",K?"bg-chart-1 text-white":"bg-muted text-foreground"),children:B+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${B}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=L):L=e[19],v=a.map(L),e[11]=V,e[12]=p,e[13]=a,e[14]=i,e[15]=v}else v=e[15];const g=m&&"bg-accent/50",b=!m&&"hover:bg-accent";let j;e[20]!==g||e[21]!==b?(j=z("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,b),e[20]=g,e[21]=b,e[22]=j):j=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Dt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const w=m?h:"";let y;e[24]!==c||e[25]!==V||e[26]!==p?(y=L=>{c.onChange(L.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=y):y=e[27];let k;e[28]!==V||e[29]!==p?(k=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=k):k=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let _;e[33]!==i?(_=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=_):_=e[34];let N;e[35]!==w||e[36]!==y||e[37]!==k||e[38]!==S||e[39]!==_?(N=n.jsx("input",{type:"text",value:w,onChange:y,onFocus:k,placeholder:S,"aria-label":_,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=k,e[38]=S,e[39]=_,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==N?(I=n.jsxs("label",{className:j,children:[A,N]}),e[41]=j,e[42]=N,e[43]=I):I=e[43];let T;e[44]!==I||e[45]!==x||e[46]!==v?(T=n.jsx(Xe,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[v,I]})}),e[44]=I,e[45]=x,e[46]=v,e[47]=T):T=e[47];let E;e[48]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(et,{}),e[48]=E):E=e[48];let U;return e[49]!==T?(U=n.jsxs(Ze,{children:[T,E]}),e[49]=T,e[50]=U):U=e[50],U}function ha(t){const e=D.c(8),{control:s,name:o}=t,a=q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const r=i,l=R.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(r[c]??"")},e[1]=V):V=e[1],as(r.length,V);let d;e[2]!==a?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(Ze,{children:[n.jsx(Xe,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":a("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(h=>{const f=p.value===h;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(h),className:z("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",f&&"bg-accent/50",!f&&"hover:bg-accent"),"aria-label":a("chat.userAskQuestion.confirmValue",{value:a(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0",f?"bg-chart-1 text-white":"bg-muted text-foreground"),children:h==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:a(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)})]},h)})})}),n.jsx(et,{})]})},e[2]=a,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(zt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function At(t){const e=D.c(13),{input:s,control:o,toolCallId:a}=t;switch(s.type){case"text":{const i=`${a}.response`;let r;return e[0]!==o||e[1]!==s.default||e[2]!==i?(r=n.jsx(ua,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=r):r=e[3],r}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const r=i;let l;return e[6]!==o||e[7]!==r||e[8]!==a?(l=n.jsx(pa,{control:o,name:a,options:r}),e[6]=o,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}case"confirm":{const i=`${a}.response`;let r;return e[10]!==o||e[11]!==i?(r=n.jsx(ha,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=r):r=e[12],r}default:return null}}function fa(t){const e=D.c(91),{parts:s,isStreaming:o,onSubmit:a}=t;let i;e[0]!==s?(i=da(s.map(va)),e[0]=s,e[1]=i):i=e[1];const r=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(xa)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==a?(d=(F,Y)=>{const P=os(Y);P&&a(F,P)},e[4]=a,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==r||e[10]!==d?(u={parts:s,partKey:ga,schema:r,defaultValues:V,isStreaming:o,hasAnswer:ma,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=r,e[10]=d,e[11]=u):u=e[11];const c=es(u),p=c.currentPart,h=q();let f;e[12]!==p||e[13]!==c||e[14]!==h?(f=()=>{const F=p;if(!F)return;const Y=h("chat.userAskQuestion.skipMessage"),P=F.toolCallId;F.input?.type==="choice"?(c.form.setValue(`${P}.option`,null),c.form.setValue(`${P}.draft`,Y)):c.form.setValue(`${P}.response`,Y),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=h,e[15]=f):f=e[15];const m=f;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(x=n.jsx(Zt,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=x):x=e[20];const v=x;let g;e[21]!==h?(g=h("chat.userAskQuestion.skip"),e[21]=h,e[22]=g):g=e[22];let b;e[23]!==m||e[24]!==g?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:g}),e[23]=m,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(j=n.jsx(Yo,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const w=A;if(s.length===1){const F=s[0];if(!F?.input)return null;const Y=c.form;let P;e[34]!==c?(P=ae=>{ae.preventDefault(),c.submit()},e[34]=c,e[35]=P):P=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx(We,{size:14}),e[36]=J):J=e[36];let X;e[37]!==h?(X=h("chat.userAskQuestion.questionPending"),e[37]=h,e[38]=X):X=e[38];let ee;e[39]!==F.input?.prompt||e[40]!==h?(ee=F.input?.prompt??h("chat.userAskQuestion.question"),e[39]=F.input?.prompt,e[40]=h,e[41]=ee):ee=e[41];const Q=F.input;let C;e[42]!==c.form.control||e[43]!==F.toolCallId||e[44]!==Q?(C=n.jsx(At,{input:Q,control:c.form.control,toolCallId:F.toolCallId}),e[42]=c.form.control,e[43]=F.toolCallId,e[44]=Q,e[45]=C):C=e[45];let O;e[46]!==w||e[47]!==X||e[48]!==ee||e[49]!==C?(O=n.jsx(ge,{icon:J,label:X,title:ee,defaultExpanded:!0,footerRight:w,children:C}),e[46]=w,e[47]=X,e[48]=ee,e[49]=C,e[50]=O):O=e[50];let G;e[51]!==P||e[52]!==O?(G=n.jsx("form",{onSubmit:P,autoComplete:"off",children:O}),e[51]=P,e[52]=O,e[53]=G):G=e[53];let Z;return e[54]!==c.form||e[55]!==G?(Z=n.jsx(Ye,{...Y,children:G}),e[54]=c.form,e[55]=G,e[56]=Z):Z=e[56],Z}const y=c.form;let k;e[57]!==c?(k=F=>{F.preventDefault(),c.submit()},e[57]=c,e[58]=k):k=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(We,{size:14}),e[59]=S):S=e[59];let _;e[60]!==h?(_=h("chat.userAskQuestion.questionPending"),e[60]=h,e[61]=_):_=e[61];const N=c.currentIndex+1;let I;e[62]!==s.length||e[63]!==h||e[64]!==N?(I=h("chat.userAskQuestion.questionCount",{current:N,total:s.length}),e[62]=s.length,e[63]=h,e[64]=N,e[65]=I):I=e[65];let T;e[66]!==p?.input?.prompt||e[67]!==h?(T=p?.input?.prompt??h("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=h,e[68]=T):T=e[68];const E=c.activeKey,U=c.setActiveKey;let L;if(e[69]!==c.form||e[70]!==s){let F;e[72]!==c.form?(F=Y=>n.jsx(eo,{value:Y.toolCallId,className:"mt-0",children:n.jsx(At,{input:Y.input,control:c.form.control,toolCallId:Y.toolCallId})},Y.toolCallId),e[72]=c.form,e[73]=F):F=e[73],L=s.map(F),e[69]=c.form,e[70]=s,e[71]=L}else L=e[71];let M;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==L?(M=n.jsx(to,{value:E,onValueChange:U,children:L}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=L,e[77]=M):M=e[77];let B;e[78]!==v||e[79]!==w||e[80]!==_||e[81]!==I||e[82]!==T||e[83]!==M?(B=n.jsx(ge,{icon:S,label:_,count:I,title:T,defaultExpanded:!0,footerLeft:v,footerRight:w,children:M}),e[78]=v,e[79]=w,e[80]=_,e[81]=I,e[82]=T,e[83]=M,e[84]=B):B=e[84];let K;e[85]!==k||e[86]!==B?(K=n.jsx("form",{onSubmit:k,autoComplete:"off",children:B}),e[85]=k,e[86]=B,e[87]=K):K=e[87];let H;return e[88]!==c.form||e[89]!==K?(H=n.jsx(Ye,{...y,children:K}),e[88]=c.form,e[89]=K,e[90]=H):H=e[90],H}function ma(t){return!!os(t)}function ga(t){return t.toolCallId}function xa(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function va(t){return{toolCallId:t.toolCallId,input:t.input}}function ba(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground animate-pulse motion-reduce:animate-none"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function is(t){const e=D.c(7),{userAskParts:s,isStreaming:o,onSubmit:a}=t;let i;e[0]!==s?(i=s.filter(Aa),e[0]=s,e[1]=i):i=e[1];const r=i;if(r.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(ba,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==a||e[5]!==r?(l=n.jsx(fa,{parts:r,isStreaming:o,onSubmit:a}),e[3]=o,e[4]=a,e[5]=r,e[6]=l):l=e[6],l}function Aa(t){return t.state==="input-available"}function ya(t){const e=D.c(33),{parts:s,isStreaming:o,onRespond:a}=t,i=q();let r;e[0]!==s?(r=s.at(-1),e[0]=s,e[1]=r):r=e[1];const l=r,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx($t,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==a||e[6]!==l?(p=()=>a(l,!1),e[5]=a,e[6]=l,e[7]=p):p=e[7];let h;e[8]!==i?(h=i("chat.suggestTask.notNow"),e[8]=i,e[9]=h):h=e[9];let f;e[10]!==o||e[11]!==p||e[12]!==h?(f=n.jsx(W,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:h}),e[10]=o,e[11]=p,e[12]=h,e[13]=f):f=e[13];let m;e[14]!==a||e[15]!==l?(m=()=>a(l,!0),e[14]=a,e[15]=l,e[16]=m):m=e[16];let x;e[17]!==i?(x=i("chat.suggestTask.create"),e[17]=i,e[18]=x):x=e[18];let v;e[19]!==o||e[20]!==m||e[21]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:m,children:x}),e[19]=o,e[20]=m,e[21]=x,e[22]=v):v=e[22];let g;e[23]!==v||e[24]!==f?(g=n.jsxs(n.Fragment,{children:[f,v]}),e[23]=v,e[24]=f,e[25]=g):g=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let j;return e[28]!==V.title||e[29]!==g||e[30]!==b||e[31]!==u?(j=n.jsx(ge,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:g,children:b}),e[28]=V.title,e[29]=g,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function ja(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[a]=e;return a&&e.length===1?{icon:"in_progress",activity:a.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function wa(t){const e=D.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=ja(s),e[0]=s,e[1]=o):o=e[1];const a=o;let i;e[2]!==a.icon?(i=n.jsx(Na,{status:a.icon}),e[2]=a.icon,e[3]=i):i=e[3];const r=a.activity,l=a.progress;let V;e[4]!==s?(V=s.map(ka),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==a.activity||e[9]!==a.progress||e[10]!==i||e[11]!==d?(u=n.jsx(ge,{icon:i,label:r,count:l,defaultExpanded:!1,children:d}),e[8]=a.activity,e[9]=a.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function ka(t,e){return n.jsx(Ca,{todo:t},e)}function Ca(t){const e=D.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let r;e[0]!==s.status?(r=n.jsx(Sa,{status:s.status}),e[0]=s.status,e[1]=r):r=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=z("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let h;return e[11]!==r||e[12]!==p?(h=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent transition-colors",children:[r,p]}),e[11]=r,e[12]=p,e[13]=h):h=e[13],h}function Sa(t){const e=D.c(4),{status:s}=t,o=s==="completed"?"true":void 0,a=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=i):i=e[0];let r;return e[1]!==o||e[2]!==a?(r=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":a,"aria-hidden":"true",children:i}),e[1]=o,e[2]=a,e[3]=r):r=e[3],r}function Na(t){const e=D.c(13),{status:s}=t,o=q();if(s==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==r?(V=n.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=r,e[4]=V):V=e[4],V}if(s==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let l;return e[7]!==r?(l=n.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=l):l=e[8],l}let a;e[9]!==o?(a=o("chat.todoStatus.pending"),e[9]=o,e[10]=a):a=e[10];let i;return e[11]!==a?(i=n.jsx("span",{"aria-label":a,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=a,e[12]=i):i=e[12],i}const Ia={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},Ta={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function _a(t){const e=D.c(46),{source:s,onDone:o}=t,a=q(),i=ws(),[r]=be(),[l,V]=R.useState(r.language==="pt-BR"?"brl":"usd"),[d,u]=R.useState(""),[c,p]=R.useState(!1),h=l==="brl"?"R$":"$";let f;e[0]!==l||e[1]!==i?(f=async M=>{const{url:B}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return B},e[0]=l,e[1]=i,e[2]=f):f=e[2];let m;e[3]!==o?(m=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=m):m=e[4];let x;e[5]!==a?(x=M=>{Se.error(a("credits.topUp.failed",{message:M.message}))},e[5]=a,e[6]=x):x=e[6];let v;e[7]!==f||e[8]!==m||e[9]!==x?(v={mutationFn:f,onSuccess:m,onError:x},e[7]=f,e[8]=m,e[9]=x,e[10]=v):v=e[10];const{mutate:g,isPending:b}=ks(v);let j;e[11]!==l||e[12]!==s||e[13]!==g?(j=(M,B)=>{te("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:B,source:s}),g(M)},e[11]=l,e[12]=s,e[13]=g,e[14]=j):j=e[14];const A=j,w=parseFloat(d),y=!isNaN(w)&&w>=1;let k,S,_;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=M=>{M&&V(M)},S=n.jsx(ut,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),_=n.jsx(ut,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=k,e[16]=S,e[17]=_):(k=e[15],S=e[16],_=e[17]);let N;e[18]!==l?(N=n.jsx("div",{className:"mb-4",children:n.jsxs(oo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:k,children:[S,_]})}),e[18]=l,e[19]=N):N=e[19];const I=Ia[l];let T;if(e[20]!==A||e[21]!==h||e[22]!==b||e[23]!==a||e[24]!==I){let M;e[26]!==A||e[27]!==h||e[28]!==b||e[29]!==a?(M=B=>{const{dollars:K,labelKey:H}=B;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(K*100,Ta[H]??"preset"),className:z("relative flex flex-col items-center gap-1 py-5 surface surface-interactive cursor-pointer","disabled:opacity-50 disabled:cursor-wait"),children:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[h,K]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a(H)})]},K)},e[26]=A,e[27]=h,e[28]=b,e[29]=a,e[30]=M):M=e[30],T=I.map(M),e[20]=A,e[21]=h,e[22]=b,e[23]=a,e[24]=I,e[25]=T}else T=e[25];let E;e[31]!==T?(E=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:T}),e[31]=T,e[32]=E):E=e[32];let U;e[33]!==A||e[34]!==h||e[35]!==d||e[36]!==w||e[37]!==y||e[38]!==b||e[39]!==c||e[40]!==a?(U=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),n.jsx(Cs,{type:"number",min:"1",step:"1",placeholder:a("credits.topUp.customPlaceholder"),value:d,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{size:"lg",disabled:!y||b,onClick:()=>A(Math.round(w*100),"custom"),children:a(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:a("credits.topUp.enterCustom")}),e[33]=A,e[34]=h,e[35]=d,e[36]=w,e[37]=y,e[38]=b,e[39]=c,e[40]=a,e[41]=U):U=e[41];let L;return e[42]!==E||e[43]!==U||e[44]!==N?(L=n.jsxs("div",{children:[N,E,U]}),e[42]=E,e[43]=U,e[44]=N,e[45]=L):L=e[45],L}const Da=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Ma(t){const e=D.c(47),{onDismiss:s}=t,{org:o}=Ne(),a=Je(),{decoKeyId:i}=no(),r=q(),l=ze("credits");let V,d;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),R.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=I=>!I&&s?.(),e[3]=s,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.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"}),e[7]=h):h=e[7];let f;e[8]!==r?(f=r("chat.creditsExhaustedBanner.title"),e[8]=r,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Ss,{className:"text-xl font-semibold tracking-tight",children:f}),e[10]=f,e[11]=m):m=e[11];let x;e[12]!==r?(x=r("chat.creditsExhaustedBanner.description"),e[12]=r,e[13]=x):x=e[13];let v;e[14]!==x?(v=n.jsx(Ns,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=v):v=e[15];let g;e[16]!==v||e[17]!==m?(g=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Is,{className:"relative gap-4",children:[h,n.jsxs("div",{children:[m,v]})]})]}),e[16]=v,e[17]=m,e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==r?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"surface p-5",children:n.jsx(_a,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Da.map(I=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(Nt,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:r(I)})]},I))})]}),e[19]=i,e[20]=s,e[21]=r,e[22]=b):b=e[22];let j;e[23]!==r?(j=r("chat.creditsExhaustedBanner.dismiss"),e[23]=r,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let w;e[28]!==a||e[29]!==s||e[30]!==o.slug?(w=()=>{a({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=a,e[29]=s,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==r?(y=r("chat.creditsExhaustedBanner.manageProviders"),e[32]=r,e[33]=y):y=e[33];let k;e[34]!==w||e[35]!==y?(k=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=k):k=e[36];let S;e[37]!==A||e[38]!==k?(S=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,k]}),e[37]=A,e[38]=k,e[39]=S):S=e[39];let _;e[40]!==g||e[41]!==b||e[42]!==S?(_=n.jsxs(Ts,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Pa,children:[g,b,S]}),e[40]=g,e[41]=b,e[42]=S,e[43]=_):_=e[43];let N;return e[44]!==_||e[45]!==u?(N=n.jsx(_s,{open:!0,onOpenChange:u,children:_}),e[44]=_,e[45]=u,e[46]=N):N=e[46],N}function Pa(t){return t.preventDefault()}const Ea={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function yt(t){const e=D.c(21),{kind:s,onDismiss:o}=t,a=q(),i=Je(),{org:r}=Ne(),{label:l,title:V}=Ea[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(cn,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==a?(u=a(l),e[1]=l,e[2]=a,e[3]=u):u=e[3];let c;e[4]!==a||e[5]!==V?(c=a(V),e[4]=a,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==r.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:r.slug}}),o()},e[7]=i,e[8]=o,e[9]=r.slug,e[10]=p):p=e[10];let h;e[11]!==a?(h=a("chat.planRefused.seePlans"),e[11]=a,e[12]=h):h=e[12];let f;e[13]!==p||e[14]!==h?(f=n.jsx(W,{size:"sm",className:"h-7 text-xs",onClick:p,children:h}),e[13]=p,e[14]=h,e[15]=f):f=e[15];let m;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==f?(m=n.jsx(ge,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:f}),e[16]=o,e[17]=u,e[18]=c,e[19]=f,e[20]=m):m=e[20],m}function rs(t){const e=Ra(t);if(e!==null){const d=rs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),a=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),r=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return a||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:r?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Ra(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:a}=s,i=typeof o=="string"?o:a;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}function Ua(t){const e=D.c(10);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{voiceMode:o}=s,a=o===void 0?!1:o,[i]=be(),{virtualMcpId:r}=Le(),{chatMode:l,requestTier:V}=Fe();let d;e[2]!==i.toolApprovalLevel?(d=i.toolApprovalLevel??Ds(),e[2]=i.toolApprovalLevel,e[3]=d):d=e[3];const u=d;let c;return e[4]!==l||e[5]!==u||e[6]!==V||e[7]!==r||e[8]!==a?(c=p=>({...a?{voiceMode:!0}:{},tier:V,mode:l,toolApprovalLevel:p===void 0?u:p,agent:r?{id:r}:void 0}),e[4]=l,e[5]=u,e[6]=V,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}const La={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ue(t){const e=D.c(29),s=q(),{variant:o,onDismiss:a}=t,i=o==="error";let r;e[0]!==i||e[1]!==s?(r=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=r):r=e[2];const l=r,V=i?Qn:Ms;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const g=La[t.finishReason];return g?s(g):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?rs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:h}=c;let f;e[11]!==V?(f=n.jsx(V,{size:14}),e[11]=V,e[12]=f):f=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?n.jsx(W,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(W,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=m):m=e[17];let x;e[18]!==h||e[19]!==s?(x=h?n.jsxs("details",{className:"group mx-4",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[n.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(h).then(()=>Se.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Se.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(dn,{className:"size-3.5"})}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:h})]})]}):null,e[18]=h,e[19]=s,e[20]=x):x=e[20];let v;return e[21]!==l||e[22]!==a||e[23]!==p||e[24]!==f||e[25]!==m||e[26]!==x||e[27]!==o?(v=n.jsx(ge,{icon:f,label:l,title:p,defaultExpanded:!0,variant:o,onClose:a,footerRight:m,children:x}),e[21]=l,e[22]=a,e[23]=p,e[24]=f,e[25]=m,e[26]=x,e[27]=o,e[28]=v):v=e[28],v}function Pe(t){const e=D.c(64);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:a}=s,i=o===void 0?!1:o,r=a===void 0?!1:a,l=q(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:h,submit:f,sendMessage:m}=Me(),[x,v]=be(),{virtualMcpId:g,createTaskWithMessage:b}=Le(),{setChatMode:j}=Fe(),A=ze("credits");let w;e[2]!==r?(w={voiceMode:r},e[2]=r,e[3]=w):w=e[3];const y=Ua(w),k=p.at(-1),S=k?.role==="assistant"?k.parts:[],_=S.filter($a),N=S.filter(Tt),I=Ht(S),T=Yt(S);let E;e[4]!==V||e[5]!==m||e[6]!==l?(E=()=>{if(V){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};m(fe)}},e[4]=V,e[5]=m,e[6]=l,e[7]=E):E=e[7];const U=E;let L;e[8]!==m||e[9]!==l?(L=()=>{const ne={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(ne)},e[8]=m,e[9]=l,e[10]=L):L=e[10];const M=L;let B;e[11]!==y||e[12]!==f?(B=(ne,fe)=>{f({kind:"toolOutput",toolCallId:ne.toolCallId,output:{response:fe}},y())},e[11]=y,e[12]=f,e[13]=B):B=e[13];const K=B;let H;e[14]!==y||e[15]!==f?(H=(ne,fe)=>{f({kind:"toolOutput",toolCallId:ne.toolCallId,output:{accepted:fe}},y())},e[14]=y,e[15]=f,e[16]=H):H=e[16];const F=H;let Y;e[17]!==b||e[18]!==x||e[19]!==j||e[20]!==v||e[21]!==l||e[22]!==g?(Y=ne=>{j("default"),v({...x,toolApprovalLevel:"auto"}),b({virtualMcpId:g,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:ne})}]}})},e[17]=b,e[18]=x,e[19]=j,e[20]=v,e[21]=l,e[22]=g,e[23]=Y):Y=e[23];const P=Y,J=za;let X;e[24]!==y||e[25]!==f?(X=(ne,fe,$e,Ee)=>{f({kind:"approval",approvalId:ne,approved:fe,...$e?{reason:$e}:{}},y(Ee))},e[24]=y,e[25]=f,e[26]=X):X=e[26];const ee=X,Q=Jt();if(Q.isCreditExhausted){let ne;return e[27]!==A||e[28]!==d||e[29]!==i?(ne=A?n.jsx(Ma,{onDismiss:d}):n.jsx("div",{className:z(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(yt,{kind:"ai_budget_exhausted",onDismiss:d})}),e[27]=A,e[28]=d,e[29]=i,e[30]=ne):ne=e[30],ne}const{showError:C,showWarning:O,hasApprovals:G}=Q,Z=_.map(Oa).join("|"),ae=Gt(I)?.toolCallId??"",Ve=T.map(Fa).join("|"),ce=!i&&"absolute bottom-full left-0 right-0";let se;e[31]!==ce?(se=z(ce),e[31]=ce,e[32]=se):se=e[32];let le;e[33]!==Q.todos?(le=n.jsx(wa,{todos:Q.todos}),e[33]=Q.todos,e[34]=le):le=e[34];let re;e[35]!==d||e[36]!==Q.planRefusal?(re=Q.planRefusal&&n.jsx(yt,{kind:Q.planRefusal,onDismiss:d}),e[35]=d,e[36]=Q.planRefusal,e[37]=re):re=e[37];let pe;e[38]!==d||e[39]!==V||e[40]!==U||e[41]!==C?(pe=C&&n.jsx(Ue,{variant:"error",error:V,onDismiss:d,onFixInChat:U}),e[38]=d,e[39]=V,e[40]=U,e[41]=C,e[42]=pe):pe=e[42];let de;e[43]!==c||e[44]!==u||e[45]!==M||e[46]!==O?(de=O&&n.jsx(Ue,{variant:"warning",finishReason:u,onDismiss:c,onContinue:M}),e[43]=c,e[44]=u,e[45]=M,e[46]=O,e[47]=de):de=e[47];const je=G&&n.jsx(aa,{approvals:T,isStreaming:h,onRespond:ee},Ve),ue=Q.hasPlans&&n.jsx(ra,{plans:I,isStreaming:h,onApprove:P,onDismiss:J},ae),Ae=Q.hasTaskSuggestion&&n.jsx(ya,{parts:N,isStreaming:h,onRespond:F},N.at(-1)?.toolCallId??"");let he;e[48]!==Q.isWaitingForUserInput||e[49]!==K||e[50]!==h||e[51]!==Z||e[52]!==_?(he=Q.isWaitingForUserInput&&n.jsx(is,{userAskParts:_,isStreaming:h,onSubmit:K},Z),e[48]=Q.isWaitingForUserInput,e[49]=K,e[50]=h,e[51]=Z,e[52]=_,e[53]=he):he=e[53];let we;return e[54]!==se||e[55]!==le||e[56]!==re||e[57]!==pe||e[58]!==de||e[59]!==je||e[60]!==ue||e[61]!==Ae||e[62]!==he?(we=n.jsxs("div",{className:se,children:[le,re,pe,de,je,ue,Ae,he]}),e[54]=se,e[55]=le,e[56]=re,e[57]=pe,e[58]=de,e[59]=je,e[60]=ue,e[61]=Ae,e[62]=he,e[63]=we):we=e[63],we}function Fa(t){return t.approvalId}function Oa(t){return t.toolCallId}function za(){document.querySelector("[data-chat-input]")?.focus()}function $a(t){return t.type==="tool-user_ask"}Pe.Error=function(e){return n.jsx(Ue,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Pe.Warning=function(e){return n.jsx(Ue,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Pe.UserAskQuestion=is;function ls(t){const e=D.c(8),{taskId:s}=t,o=q(),a=An(s),i=yn(a),r=jn(),{stop:l,removeLocalMessage:V}=Me();if(i.length===0)return null;const d="mb-2 flex flex-col items-end gap-3 px-2.5";let u;e[0]!==r||e[1]!==V||e[2]!==l||e[3]!==o||e[4]!==s?(u=(h,f)=>n.jsxs("div",{className:"flex max-w-[85%] flex-col items-end",children:[n.jsx("div",{className:"min-w-0 rounded-2xl border border-dashed border-border px-4 py-2.5 text-sm wrap-break-word text-muted-foreground",children:h.text}),n.jsxs("div",{className:"mt-1 flex items-center gap-1 text-sm text-muted-foreground",children:[n.jsx("span",{className:"mr-1 select-none",children:new Date(h.enqueuedAt).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}),f===0&&n.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5 text-xs text-muted-foreground",onClick:()=>{l()},children:[n.jsx(Lt,{size:12}),o("chat.queueTray.sendNow")]}),n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6 text-muted-foreground",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(s,h.messageId).then(m=>{m&&(wn(s,h.messageId),V(h.messageId))})},children:n.jsx(Et,{className:"size-3.5"})})]})]},h.messageId),e[0]=r,e[1]=V,e[2]=l,e[3]=o,e[4]=s,e[5]=u):u=e[5];const c=i.map(u);let p;return e[6]!==c?(p=n.jsx("div",{className:d,children:c}),e[6]=c,e[7]=p):p=e[7],p}function Vs(t){const e=D.c(3),[s]=be();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&vo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ba={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},Ka=$s.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),qa=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Qa(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:qa.map(Wa)}),t[0]=e):e=t[0],e}function Wa(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Ya({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:a,onUnsupportedFile:i}){const r=q(),[l,V]=R.useState(!1),d=Vs(Ba),{org:u}=Ne(),{editor:c}=_t(),p=R.useRef(null),h=tt(o),f=()=>{!h||a||(V(!1),p.current?.click())},m=async C=>{const O=C.target.files;if(!O||O.length===0||!c)return;const G=Array.from(O);try{let Z=c.state.selection.from;for(const ae of G)await Qt(c,o??null,ae,Z,i,r),Z=c.state.selection.to}finally{p.current&&(p.current.value="")}},x=mo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Ps.virtualMcpPrompts(s,u.id),{data:g,isLoading:b}=Es({queryKey:v,queryFn:()=>go(x),staleTime:6e4,enabled:l&&!!x}),j=g?.prompts??[],[A,w]=R.useState(null),{chatMode:y,setChatMode:k}=Fe(),[S,_]=be(),N=Rt()?.lockedHarness!=="claude-code",I=ye.find(C=>C.value===S.toolApprovalLevel)??ye[0],T=r(I.shortKey),E=C=>{const O=ye.find(G=>G.value===C);if(O){if(O.value===S.toolApprovalLevel){V(!1);return}d(),te("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:O.value,source:"tools_popover"}),_({...S,toolApprovalLevel:O.value}),V(!1)}},U=y==="plan",L=()=>{d();const C=U?"default":"plan";te("chat_mode_changed",{from_mode:y,to_mode:C,source:"tools_popover"}),k(C),V(!1)},M=()=>{e(),V(!1)},B=async(C,O)=>{if(!c||!x)return;const G=pt(C._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const ae=await xo(x,C.name,O);an(c,Z,{id:C.name,name:ro(C.name,G),metadata:ae.messages,char:"/",kind:"prompt",args:O})}catch{Se.error(r("chat.toolsPopover.failedLoadPrompt"))}},K=async C=>{V(!1);const O=!!(C.arguments&&C.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:C.name,with_arguments:O}),O){w(C);return}await B(C)},H=async C=>{A&&(await B(A,C),w(null))},F=()=>{d();const C=y==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:y,to_mode:C,source:"tools_popover"}),k(C),V(!1)},Y=()=>{d();const C=y==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:y,to_mode:C,source:"tools_popover"}),k(C),V(!1)},P=()=>{d();const C=y==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:y,to_mode:C,source:"tools_popover"}),k(C),V(!1)},J=y==="gen-image",X=y==="web-search",ee=y==="deep-research",Q=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:Vo(o??null),className:"hidden",onChange:m,disabled:a});return n.jsxs(n.Fragment,{children:[Q,n.jsxs(Rs,{open:l,onOpenChange:C=>{C&&!l&&te("chat_tools_popover_opened",{chat_mode:y}),V(C)},children:[n.jsx(Us,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[480px]/chat-bottom:gap-1.5"),children:[n.jsx(un,{size:14}),n.jsx("span",{className:z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[480px]/chat-bottom:max-w-24 @[480px]/chat-bottom:opacity-100"),children:r("chat.toolsPopover.tools")})]})}),n.jsxs(Ls,{align:"start",className:"w-56 p-1.5 space-y-1",children:[h?n.jsxs(xe,{onClick:f,disabled:a,children:[n.jsx(ht,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):n.jsxs(qt,{children:[n.jsx(Bt,{asChild:!0,children:n.jsxs(xe,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:C=>C.preventDefault(),children:[n.jsx(ht,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),n.jsx(Kt,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(xe,{onClick:L,className:z(U&&"text-special"),children:[n.jsx(Ft,{size:16,className:z(U&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),n.jsx("span",{className:z("text-xs text-muted-foreground",U&&"text-special font-medium"),children:Ka})]}),n.jsxs(xe,{onClick:F,className:z(J&&"text-special"),children:[n.jsx(Ot,{size:16,className:z(J&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),J&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(xe,{onClick:Y,className:z(X&&"text-special"),children:[n.jsx(Mt,{size:16,className:z(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(xe,{onClick:P,className:z(ee&&"text-special"),children:[n.jsx(Pt,{size:16,className:z(ee&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),ee&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(rt,{children:[n.jsxs(lt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),n.jsx(Vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Fs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):j.map(C=>n.jsxs(xe,{onClick:()=>K(C),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:C.title||io(C.name,pt(C._meta))}),C.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:C.description})]},C.name))})]}),N&&n.jsxs(rt,{children:[n.jsxs(lt,{className:"gap-2",children:[n.jsx(Oe,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:T})]}),n.jsx(Vt,{className:"w-48 p-1.5",children:n.jsx(Os,{value:S.toolApprovalLevel,onValueChange:E,children:ye.map(C=>n.jsx(zs,{value:C.value,children:r(C.labelKey)},C.value))})})]}),n.jsxs(xe,{onClick:M,children:[n.jsx(pn,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),n.jsx(R.Suspense,{children:n.jsx(Qa,{})})]})]})]}),n.jsx(on,{prompt:A,setPrompt:w,onSubmit:H})]})}const Ga=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Ha(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:Ga.map(Ja)}),t[0]=e):e=t[0],e}function Ja(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Za(t){const e=D.c(10),{onClick:s}=t,o=q();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=z("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let r;e[3]!==i?(r=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=r):r=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ha,{}),V=n.jsx(Bs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==r?(d=n.jsxs("button",{type:"button",onClick:s,className:a,children:[r,l,V]}),e[7]=s,e[8]=r,e[9]=d):d=e[9],d}function Xa(t){const e=D.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(ei),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==o?(a=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=a):a=e[3],a}function ei(t,e){return n.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}const Te=12e3,jt=ie({token:oe(),expiresAt:qs()});Qs("provider",[ie({provider:ve("elevenlabs"),conversationToken:oe().min(1)}),ie({provider:ve("openai"),transport:ve("webrtc")})]);const ti=Ks([jt.extend({provider:ve("elevenlabs").default("elevenlabs"),conversationToken:oe().min(1)}),jt.extend({provider:ve("openai"),transport:ve("webrtc")})]);ie({token:oe().min(1).max(4096),text:oe().trim().min(1).max(Te)});const cs=ie({request:oe().trim().min(1).max(Te)}),Ge=5e3;St(ie({role:De(["user","agent"]),text:oe().min(1).max(Ge)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=Ge,{message:"Voice transcript is too long"});function hr(t){const e=[];let s=Ge;for(const o of t.slice(-60).reverse()){if(s<=0)break;const a=o.text.slice(-s);e.unshift({role:o.role,text:a}),s-=a.length}return e}ie({token:oe().min(1).max(4096),sdp:oe().min(1).max(1e5),language:De(["en","pt"]).default("en")}).strict();const si=ie({sdp:oe().min(1).max(1e5)});async function ni(t,e,s,o,a){if(t.provider==="openai"){const{startOpenAIConversation:l}=await ct(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-5aGLGlHN.js");return{startOpenAIConversation:V}},__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,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118]));return l(a,s,o)}const{Conversation:i}=await ct(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const r=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=cs.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await r.endSession(),o.throwIfAborted()),{endSession:()=>r.endSession(),setMicMuted:l=>r.setMicMuted(l),getOutputVolume:()=>r.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?r.sendContextualUpdate(V):r.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
|
+
${V}
|
|
11
|
+
Briefly report this update. Do not delegate it as new work.`)}}}const oi=ie({background:ve(!0),status:ve("started"),jobId:oe().min(1)}),ai=ie({item:ie({id:oe().min(1),title:oe(),status:oe()})}),ii=t=>`${t}:react-msg`;function ds(t,e){const s=t.findIndex(a=>a.id===e&&a.role==="user");if(s<0)return null;const o=[];for(const a of t.slice(s+1))if(!a.metadata?.subtaskJobId){if(a.role==="user")break;a.role==="assistant"&&o.push(a)}return o}function wt(t,e){const s=[],o=[];for(const a of ds(t,e)??[])for(const i of a.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const r=i.type;if(r==="tool-subtask"){const l=oi.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(r==="tool-TASK_BOARD_ITEM_CREATE"){const l=ai.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function kt(t,e){const s=ds(t,e);if(!s)return null;const o=s.at(-1);if(!o||o.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const a=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(a?.type!=="text")return"";if(a.state==="streaming")return null;const i=a.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Te)return i;const r=i.slice(0,Te-1);return`${r.slice(0,r.lastIndexOf(" "))}…`}class ri{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,o])=>this.state[s]===o)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
|
|
12
|
+
${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const o of this.jobs.values()){if(!o.accepted||o.result!==void 0)continue;if(o.background){this.collectBackground(o,s);continue}const a=e.messages.findIndex(l=>l.id===o.messageId);if(a<0)continue;const i=a>=0&&e.messages.slice(a+1).some(l=>l.role==="user");if(s&&!i)continue;let r;if(!s&&!i&&(e.error||e.status==="error"))r="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))r=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=kt(e.messages,o.messageId);if(l===null)continue;r=l;const V=wt(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,r||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const o=this.bindings?.messages??[],a=[];for(const i of e.background??[]){const r=ii(i),l=o.findIndex(u=>u.id===r);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const d=kt(o,r);if(d===null)return;this.track(wt(o,r).tasks),a.push(d)}this.finish(e,a.filter(Boolean).join(`
|
|
13
|
+
`)||"The background work finished without a final text response. Do not infer that the requested change succeeded.")}finish(e,s){e.result=s,this.report(JSON.stringify({requestId:e.messageId,request:e.delegationId?void 0:e.request,result:s}),e.delegationId)}track(e){for(const s of e)this.tasks.has(s.id)||this.tasks.set(s.id,this.boardUpdates.get(s.id)??s)}publishWorkStatus(){const e=JSON.stringify(this.status());e!==this.lastWorkStatus&&(this.lastWorkStatus=e,this.conversation?.publishUpdate({delivery:"context",contextId:"studio-work",text:e}))}taskUpdated=e=>{const s={id:e.id,title:e.title,status:e.status};this.boardUpdates.delete(e.id),this.boardUpdates.set(e.id,s);for(const a of this.boardUpdates.keys()){if(this.boardUpdates.size<=200)break;this.boardUpdates.delete(a)}const o=this.tasks.get(e.id);!o||!this.conversation||o.status===e.status||(this.tasks.set(e.id,s),this.report(JSON.stringify({task:e.title,status:e.status})),this.publishWorkStatus())};taskDeleted=e=>{const s=this.tasks.get(e);!s||!this.conversation||(this.tasks.delete(e),this.report(JSON.stringify({task:s.title,status:"deleted"})),this.publishWorkStatus())};report(e,s){const o={text:e,delegationId:s,delivery:"context"};this.conversation?.publishUpdate(o),this.announcements.push({...o,delivery:"announce"})}flushAnnouncements(){if(!(!this.conversation||!this.announcements.length||this.userSpeaking||this.state.phase!=="listening"||Date.now()-this.lastActivity<1800)){this.lastActivity=Date.now();for(const e of this.announcements.splice(0))this.conversation.publishUpdate(e)}}delegate=async e=>{if(this.utterance===0&&!e.delegationId)return{status:"rejected",reason:"Wait for a spoken user request before delegating work."};const s=cs.safeParse(e);if(!s.success)return{status:"rejected",reason:"A complete, non-empty request is required."};if(this.jobs.size>=40)return{status:"rejected",reason:"This voice session has reached its request limit. Continue in the text chat."};const o=s.data.request,a=[...this.jobs.values()].find(V=>e.delegationId?V.delegationId===e.delegationId:V.utterance===this.utterance||V.request===o&&V.result===void 0);if(a)return{status:a.result!==void 0?"finished":a.accepted?"accepted":"submitting",requestId:a.messageId,result:a.result?.slice(0,2e3),note:"This utterance already has a work request; do not submit it again."};const i=this.generation,r={messageId:crypto.randomUUID(),utterance:this.utterance,request:o,accepted:!1,delegationId:e.delegationId};this.jobs.set(r.messageId,r);const l=this.dispatchQueue.then(async()=>i!==this.generation||!this.conversation?!1:this.bindings?.sendVoiceMessage?.(r.messageId,o,e.transcript)??!1);this.dispatchQueue=l.catch(()=>{});try{const V=await l;return i!==this.generation?{status:"disconnected"}:V?(r.accepted=!0,this.collectResults(),{status:"accepted",requestId:r.messageId,note:"Work is running or queued in Studio. Keep conversing. A background event will supply its actual result."}):(this.jobs.delete(r.messageId),{status:"rejected",reason:"Studio did not accept the request. No work has been confirmed."})}catch{return this.jobs.delete(r.messageId),{status:"rejected",reason:"Studio could not accept the request. Do not claim it started."}}};async start(){if(this.state.phase!=="idle"&&this.state.phase!=="error")return;this.stop();const e=++this.generation,s=new AbortController;this.startupAbort=s;const o=()=>e===this.generation;this.patch({phase:"connecting",error:null,muted:!1});try{if(await this.cleanup,!o())return;const a=fetch(this.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"conversation",language:this.language}),signal:AbortSignal.timeout(5e4)}).then(async d=>{if(!d.ok)throw new Error("Voice unavailable");return ti.parse(await d.json())});this.cleanup=a.then(async d=>{o()||await this.revoke(d.token)}).catch(()=>{});const i=await a;if(!o())return;this.token=i.token;const r=ni(i,this.language,{onDelegate:d=>o()?this.delegate(d):Promise.resolve({status:"disconnected"}),getWorkStatus:()=>o()?this.status():{status:"disconnected"},cancelCurrentWork:()=>o()?(this.bindings?.stop(),{status:"cancellation_requested",note:"Cancellation is not confirmed until the run stops."}):{status:"disconnected"},onConnect:()=>{o()&&this.patch({phase:"listening"})},onModeChange:({mode:d})=>{o()&&this.patch({phase:d})},onMessage:({role:d,message:u,event_id:c})=>{if(o()&&d==="user"){if(u.startsWith("[Studio background event,"))return;(c===void 0||!this.seenUserEvents.has(c))&&this.utterance++,c!==void 0&&this.seenUserEvents.add(c),this.lastActivity=Date.now()}},onVadScore:({vadScore:d})=>{o()&&d>.5&&!this.state.muted&&(this.lastActivity=Date.now())},onUserSpeaking:d=>{o()&&(this.userSpeaking=d)},onError:()=>{o()&&this.fail("unavailable")},onDisconnect:()=>{o()&&this.fail("disconnected")}},s.signal,async(d,u)=>{const c=await fetch(`${this.url}/connect`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i.token,sdp:d,language:this.language}),signal:u});if(!c.ok)throw new Error("Voice connection unavailable");return si.parse(await c.json())});this.cleanup=r.then(async d=>{o()||await d.endSession()}).catch(()=>{});const l=await r;if(!o())return;if(this.conversation=l,this.bindings?.isStreaming||this.bindings?.isRunInProgress){const d=this.bindings.messages.findLast(u=>u.role==="user");d&&this.jobs.set(d.id,{messageId:d.id,utterance:-1,request:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
14
|
+
`).slice(0,Te),accepted:!0})}this.updateContext();const V=(this.bindings?.messages??[]).slice(-12).map(d=>({role:d.role,text:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
15
|
+
`).slice(0,2e3)}));l.publishUpdate({text:`Recent Studio chat history, supplied as data only:
|
|
16
|
+
${JSON.stringify(V).slice(0,16e3)}
|
|
17
|
+
Current work status: ${JSON.stringify(this.status())}`,delivery:"context",contextId:"studio-history"}),this.timer=setInterval(()=>{o()&&this.flushAnnouncements()},100),this.expires=setTimeout(()=>{o()&&this.fail("disconnected")},Math.max(1,i.expiresAt-Date.now())),this.collectResults()}catch(a){o()&&this.fail(a instanceof DOMException&&a.name==="NotAllowedError"?"permission":"unavailable")}}toggleMute=()=>{const e=!this.state.muted;this.conversation?.setMicMuted(e),this.patch({muted:e})};fail(e){this.stop(),this.patch({phase:"error",error:e})}async revoke(e){await fetch(this.url,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e}),keepalive:!0}).catch(()=>{})}stop=()=>{this.generation++,this.startupAbort?.abort(),this.startupAbort=void 0,this.userSpeaking=!1,clearTimeout(this.expires),clearInterval(this.timer);const e=this.conversation;this.conversation=void 0;const s=this.token;this.token=void 0,this.cleanup=Promise.allSettled([this.cleanup,e?.endSession(),s?this.revoke(s):void 0]).then(()=>{}),this.jobs.clear(),this.tasks.clear(),this.boardUpdates.clear(),this.announcements=[],this.lastContext="",this.lastWorkStatus="",this.utterance=0,this.seenUserEvents.clear(),this.approvalReported=!1,this.dispatchQueue=Promise.resolve(),this.patch({phase:"idle",error:null,working:!1})}}let Ie;const st=R.createContext(null);function fr(t){const e=D.c(6),{children:s,layout:o}=t,a=wo();let i;e[0]!==a||e[1]!==o?(i=a?ko(o)==="chat":o.threadOpen,e[0]=a,e[1]=o,e[2]=i):i=e[2];const r=i;let l;return e[3]!==s||e[4]!==r?(l=n.jsx(li,{visible:r,children:s}),e[3]=s,e[4]=r,e[5]=l):l=e[5],l}function Ct(t,e){return new ri(`/api/${encodeURIComponent(t)}/threads/${encodeURIComponent(e??"")}/voice/sessions`,Ws()==="pt-BR"?"pt":"en")}function li(t){const e=D.c(36),{children:s,visible:o}=t,{org:a}=Ne(),{taskId:i,createTask:r,activeTask:l}=Le(),d=yo("voice_mode")&&!l?.metadata?.read_only,u=`${a.id}:${i??"new"}`;let c;e[0]!==a.slug||e[1]!==u||e[2]!==i?(c=()=>({key:u,session:Ct(a.slug,i)}),e[0]=a.slug,e[1]=u,e[2]=i,e[3]=c):c=e[3];const[p,h]=R.useState(c);p.key!==u&&h({key:u,session:Ct(a.slug,i)});const{session:f}=p;let m,x;e[4]!==d||e[5]!==f||e[6]!==o?(m=()=>{(!d||!o)&&f.stop()},x=[f,d,o],e[4]=d,e[5]=f,e[6]=o,e[7]=m,e[8]=x):(m=e[7],x=e[8]),R.useLayoutEffect(m,x);let v;e[9]!==f?(v=()=>f.getSnapshot().phase!=="idle",e[9]=f,e[10]=v):v=e[10];const g=R.useSyncExternalStore(f.subscribe,v);let b;e[11]!==g||e[12]!==a.slug||e[13]!==f.taskDeleted||e[14]!==f.taskUpdated?(b={orgSlug:a.slug,enabled:g,onUpdate:f.taskUpdated,onDelete:f.taskDeleted},e[11]=g,e[12]=a.slug,e[13]=f.taskDeleted,e[14]=f.taskUpdated,e[15]=b):b=e[15],jo(b);let j;e[16]!==r||e[17]!==d||e[18]!==a.id||e[19]!==f||e[20]!==i?(j=()=>{if(d){if(!i){const S=r();Ie={orgId:a.id,threadId:S,expires:Date.now()+3e4};return}f.start()}},e[16]=r,e[17]=d,e[18]=a.id,e[19]=f,e[20]=i,e[21]=j):j=e[21];const A=j;let w;e[22]!==d||e[23]!==f||e[24]!==A?(w={session:f,enabled:d,start:A},e[22]=d,e[23]=f,e[24]=A,e[25]=w):w=e[25];let y;e[26]!==p.key||e[27]!==d||e[28]!==a.id||e[29]!==f||e[30]!==i?(y=n.jsx(Vi,{session:f,enabled:d,orgId:a.id,taskId:i},p.key),e[26]=p.key,e[27]=d,e[28]=a.id,e[29]=f,e[30]=i,e[31]=y):y=e[31];let k;return e[32]!==s||e[33]!==w||e[34]!==y?(k=n.jsxs(st,{value:w,children:[y,s]}),e[32]=s,e[33]=w,e[34]=y,e[35]=k):k=e[35],k}function Vi(t){const e=D.c(6),{session:s,enabled:o,orgId:a,taskId:i}=t;let r;e[0]!==o||e[1]!==a||e[2]!==s||e[3]!==i?(r=()=>d=>{if(o&&i&&Ie?.orgId===a&&Ie.threadId===i){const c=Ie.expires>Date.now();Ie=void 0,c&&s.start()}const u=()=>s.stop();return window.addEventListener("pagehide",u),()=>{window.removeEventListener("pagehide",u),s.stop()}},e[0]=o,e[1]=a,e[2]=s,e[3]=i,e[4]=r):r=e[4];const[l]=R.useState(r);let V;return e[5]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx("div",{className:"contents",ref:l}),e[5]=V):V=e[5],V}function mr(t){const e=D.c(4),{children:s}=t,o=R.useContext(st),a=Me();let i,r;return e[0]!==o||e[1]!==a?(i=()=>{o?.session.updateBindings(a,o.enabled)},r=[o,a],e[0]=o,e[1]=a,e[2]=i,e[3]=r):(i=e[2],r=e[3]),R.useLayoutEffect(i,r),s}function us(){const t=D.c(4),e=R.useContext(st),s=R.useSyncExternalStore(e?.session.subscribe??ci,e?.session.getSnapshot??di),o=s?.phase!==void 0&&s.phase!=="idle";let a;return t[0]!==e||t[1]!==s||t[2]!==o?(a={active:o,context:e,snapshot:s},t[0]=e,t[1]=s,t[2]=o,t[3]=a):a=t[3],a}const ci=()=>()=>{},di=()=>null;function ui(){const t=D.c(9),e=q(),{context:s}=us();if(!s?.enabled||!navigator.mediaDevices?.getUserMedia)return null;const o=s.start;let a;t[0]!==e?(a=e("chat.voice.start"),t[0]=e,t[1]=a):a=t[1];let i;t[2]!==e?(i=e("chat.voice.start"),t[2]=e,t[3]=i):i=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Co,{size:18}),t[4]=r):r=t[4];let l;return t[5]!==s.start||t[6]!==a||t[7]!==i?(l=n.jsx(W,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:o,"aria-label":a,title:i,children:r}),t[5]=s.start,t[6]=a,t[7]=i,t[8]=l):l=t[8],l}function pi({session:t,phase:e,muted:s}){const[o]=R.useState(()=>a=>{if(!a||matchMedia("(prefers-reduced-motion: reduce)").matches)return;let i=0,r=requestAnimationFrame(function l(){const V=Math.min(1,t.outputVolume());i+=(V-i)*(V>i?.55:.12),a.style.setProperty("--voice-level",i.toFixed(3)),r=requestAnimationFrame(l)});return()=>cancelAnimationFrame(r)});return n.jsx("div",{ref:o,className:"studio-voice-orb","data-phase":e,"data-muted":s,"aria-hidden":"true"})}function gr(){const t=D.c(65),e=q(),{taskId:s}=Le(),o=Me(),{context:a,snapshot:i,active:r}=us();if(!r||!a||!i)return null;const{session:l}=a;let V;t[0]!==i.error||t[1]!==i.muted||t[2]!==i.phase||t[3]!==e?(V=i.error?e(`chat.voice.${i.error}`):i.muted?e("chat.voice.muted"):e(`chat.voice.${i.phase}`),t[0]=i.error,t[1]=i.muted,t[2]=i.phase,t[3]=e,t[4]=V):V=t[4];const d=V;let u;t[5]!==e?(u=e("chat.voice.title"),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==i.muted||t[9]!==i.phase?(c=n.jsx(pi,{session:l,phase:i.phase,muted:i.muted}),t[7]=l,t[8]=i.muted,t[9]=i.phase,t[10]=c):c=t[10];let p;t[11]!==d?(p=n.jsx("p",{role:"status",className:"max-w-sm text-center text-sm text-muted-foreground",children:d}),t[11]=d,t[12]=p):p=t[12];let h;t[13]!==i.working||t[14]!==e?(h=i.working&&n.jsx("p",{className:"text-center text-xs text-muted-foreground",children:e("chat.voice.backgroundWork")}),t[13]=i.working,t[14]=e,t[15]=h):h=t[15];let f;t[16]!==a.start||t[17]!==i.phase||t[18]!==e?(f=i.phase==="error"&&n.jsx(W,{variant:"outline",onClick:a.start,children:e("chat.voice.retry")}),t[16]=a.start,t[17]=i.phase,t[18]=e,t[19]=f):f=t[19];let m;t[20]!==c||t[21]!==p||t[22]!==h||t[23]!==f?(m=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto px-6 py-8",children:[c,p,h,f]}),t[20]=c,t[21]=p,t[22]=h,t[23]=f,t[24]=m):m=t[24];let x;t[25]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Pe,{inline:!0,voiceMode:!0}),t[25]=x):x=t[25];let v;t[26]!==s?(v=s&&n.jsx(ls,{taskId:s}),t[26]=s,t[27]=v):v=t[27];let g;t[28]!==v?(g=n.jsxs("div",{className:"max-h-[55%] shrink-0 overflow-y-auto px-3",children:[x,v]}),t[28]=v,t[29]=g):g=t[29];const b=i.phase==="connecting"||i.phase==="error",j=i.muted?"chat.voice.unmute":"chat.voice.mute";let A;t[30]!==e||t[31]!==j?(A=e(j),t[30]=e,t[31]=j,t[32]=A):A=t[32];const w=i.muted?"chat.voice.unmute":"chat.voice.mute";let y;t[33]!==e||t[34]!==w?(y=e(w),t[33]=e,t[34]=w,t[35]=y):y=t[35];let k;t[36]!==i.muted?(k=i.muted?n.jsx(No,{size:18}):n.jsx(Io,{size:18}),t[36]=i.muted,t[37]=k):k=t[37];let S;t[38]!==l.toggleMute||t[39]!==i.muted||t[40]!==b||t[41]!==A||t[42]!==y||t[43]!==k?(S=n.jsx(W,{variant:"outline",size:"icon",disabled:b,"aria-label":A,title:y,"aria-pressed":i.muted,onClick:l.toggleMute,children:k}),t[38]=l.toggleMute,t[39]=i.muted,t[40]=b,t[41]=A,t[42]=y,t[43]=k,t[44]=S):S=t[44];const _=l.stop;let N;t[45]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(So,{size:16}),t[45]=N):N=t[45];let I;t[46]!==e?(I=e("chat.voice.backToChat"),t[46]=e,t[47]=I):I=t[47];let T;t[48]!==l.stop||t[49]!==I?(T=n.jsxs(W,{variant:"outline",onClick:_,children:[N,I]}),t[48]=l.stop,t[49]=I,t[50]=T):T=t[50];let E;t[51]!==o.isRunInProgress||t[52]!==o.isStreaming||t[53]!==o.stop||t[54]!==e?(E=(o.isStreaming||o.isRunInProgress)&&n.jsx(W,{variant:"outline",size:"icon","aria-label":e("chat.voice.stopWork"),title:e("chat.voice.stopWork"),onClick:o.stop,children:n.jsx(To,{size:16})}),t[51]=o.isRunInProgress,t[52]=o.isStreaming,t[53]=o.stop,t[54]=e,t[55]=E):E=t[55];let U;t[56]!==S||t[57]!==T||t[58]!==E?(U=n.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-3 px-4 py-6",children:[S,T,E]}),t[56]=S,t[57]=T,t[58]=E,t[59]=U):U=t[59];let L;return t[60]!==u||t[61]!==U||t[62]!==m||t[63]!==g?(L=n.jsxs("section",{"aria-label":u,className:"absolute inset-0 flex min-h-0 flex-col bg-background",children:[m,g,U]}),t[60]=u,t[61]=U,t[62]=m,t[63]=g,t[64]=L):L=t[64],L}function hi(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function qe(t){const e=D.c(7),{message:s,icon:o}=t;let a;e[0]!==o?(a=o??n.jsx(It,{size:14,className:"shrink-0"}),e[0]=o,e[1]=a):a=e[1];const i=s??"";let r;e[2]!==i?(r=n.jsx("span",{className:"text-sm",children:i}),e[2]=i,e[3]=r):r=e[3];let l;return e[4]!==a||e[5]!==r?(l=n.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[a,r]}),e[4]=a,e[5]=r,e[6]=l):l=e[6],l}function fi(t,e,s){const o=D.c(7),{editor:a}=_t(),i=q(),[r,l]=R.useState(!1),V=R.useRef(0);let d,u;return o[0]!==s||o[1]!==a||o[2]!==e||o[3]!==t||o[4]!==i?(d=()=>{const c=m=>{m.dataTransfer?.types.includes("Files")&&(m.preventDefault(),V.current=V.current+1,l(!0))},p=m=>{m.preventDefault(),V.current=Math.max(0,V.current-1),V.current===0&&l(!1)},h=mi,f=m=>{if(V.current=0,l(!1),m.defaultPrevented||(m.preventDefault(),s||!a||!t||!tt(t)))return;const x=m.dataTransfer?.files;if(!x||x.length===0)return;const v=Array.from(x);(async()=>{let g=a.state.selection.from;for(const b of v)await Qt(a,t,b,g,e,i),g=a.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",p),window.addEventListener("dragover",h),window.addEventListener("drop",f),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",p),window.removeEventListener("dragover",h),window.removeEventListener("drop",f)}},u=[a,t,e,i,s],o[0]=s,o[1]=a,o[2]=e,o[3]=t,o[4]=i,o[5]=d,o[6]=u):(d=o[5],u=o[6]),R.useEffect(d,u),r}function mi(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function gi(t){const e=D.c(14),{selectedModel:s}=t,o=q();let a,i,r;if(e[0]!==s||e[1]!==o){const{parts:d}=co(s);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qn,{size:24}),e[5]=r):r=e[5],a="text-sm font-medium";let u;e[6]!==o?(u=c=>o(c),e[6]=o,e[7]=u):u=e[7],i=o("chat.input.dropFilesHere",{fileTypes:d.map(u).join(", ")}),e[0]=s,e[1]=o,e[2]=a,e[3]=i,e[4]=r}else a=e[2],i=e[3],r=e[4];let l;e[8]!==a||e[9]!==i?(l=n.jsx("span",{className:a,children:i}),e[8]=a,e[9]=i,e[10]=l):l=e[10];let V;return e[11]!==r||e[12]!==l?(V=n.jsxs(n.Fragment,{children:[r,l]}),e[11]=r,e[12]=l,e[13]=V):V=e[13],V}function xi(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(It,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs(n.Fragment,{children:[s,n.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function vi(t){const e=D.c(11),{selectedModel:s,onUnsupportedFile:o,disabled:a}=t,i=fi(s,o,a);let r;e[0]!==s?(r=tt(s),e[0]=s,e[1]=r):r=e[1];const l=r,V=i?"opacity-100":"opacity-0 pointer-events-none",d=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==V||e[3]!==d?(u=z("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",V,d),e[2]=V,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==l?(c=l?n.jsx(gi,{selectedModel:s}):n.jsx(xi,{}),e[5]=s,e[6]=l,e[7]=c):c=e[7];let p;return e[8]!==u||e[9]!==c?(p=n.jsx("div",{className:u,children:c}),e[8]=u,e[9]=c,e[10]=p):p=e[10],p}function Re(t){const e=D.c(14),{onClick:s,label:o,icon:a,colorClass:i,maxWidthClass:r}=t;let l;e[0]!==i?(l=z("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",i),e[0]=i,e[1]=l):l=e[1];let V;e[2]!==r?(V=z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[480px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=V):V=e[3];let d;e[4]!==o||e[5]!==V?(d=n.jsx("span",{className:V,children:o}),e[4]=o,e[5]=V,e[6]=d):d=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(He,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=u):u=e[7];let c;return e[8]!==a||e[9]!==o||e[10]!==s||e[11]!==l||e[12]!==d?(c=n.jsxs("button",{type:"button",onClick:s,title:o,"aria-label":o,className:l,children:[a,d,u]}),e[8]=a,e[9]=o,e[10]=s,e[11]=l,e[12]=d,e[13]=c):c=e[13],c}function bi(){const t=Je(),{org:e,locator:s}=Ne(),{create:o}=Pn();return async({tiptapDoc:a,virtualMcp:i,taskIntake:r=!1})=>{const l=crypto.randomUUID(),V=i?.id??Qe(e.id).id,d=r?void 0:"sandbox";Tn(sessionStorage,s,l,{tiptapDoc:r&&a?Ko(a):a}),En(sessionStorage,s,l,{runtime:d});try{await o({id:l,virtual_mcp_id:V,...d?{runtime:d}:{}}),Rn(sessionStorage,s,l)}catch{}const u=Qo(r);Xs(t,en({org:e.slug,agentId:V,superAgentId:Qe(e.id).id}),{search:()=>({...u,thread:l}),replace:!1})}}function xr({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:s=!1,taskHint:o=!0}){const a=q(),i=kn(),r=Rt(),l=i?.messages??[],V=i?.isStreaming??!1,d=i?.isRunInProgress??!1,u=i?.stop??(()=>{}),c=r?.taskId??"",p=c||On,h=bi(),{selectedModel:f,selectedVirtualMcp:m,isModelsLoading:x,tiptapDocRef:v,imageModel:g,webSearchModel:b,deepResearchModel:j,chatMode:A,setChatMode:w}=Fe(),{data:y}=Ys.useSession(),k=y?.user?.id,{org:S,locator:_}=Ne(),[N,I]=Gs(Hs.homeTaskMode(_),!0),T=s&&N,E=Qe(S.id).id,U=Nn(m?.id),L=zn(U?.id).runtime==="cms",M=Vs(bo),[B,K]=R.useState(!1),{unsupportedFile:H,onUnsupportedFile:F,clearUnsupportedFile:Y}=uo(),P=$n(),J=R.useRef(void 0),X=async()=>{J.current=se;const $=await P.startRecording();te("chat_voice_started",{thread_id:c,outcome:$==="recording"?"started":$==="unsupported"?"unsupported":$==="permission-denied"?"permission_denied":"unknown"})},ee=()=>{te("chat_voice_confirmed",{thread_id:c});const $=P.stopRecording();ue.current?.syncVoiceText(J.current,$),ue.current?.focus()},Q=()=>{te("chat_voice_cancelled",{thread_id:c}),P.cancelRecording(),ue.current?.restoreContent(J.current)};R.useEffect(()=>{if(P.status!=="recording")return;const $=(P.transcript+(P.interimTranscript?" "+P.interimTranscript:"")).trim();ue.current?.syncVoiceText(J.current,$)},[P.transcript,P.interimTranscript,P.status]);const C=r?.activeTask??null,O=C?.created_by,G=!!(k&&O&&O!==k),{data:Z}=Js({enabled:G}),ae=(Z?.data?.members??[]).find($=>$.userId===O),Ve=ae?.user?.name??ae?.user?.email?.split("@")[0]??null,ce=Cn(C?.harness_id),[se,le]=R.useState(()=>dt(sessionStorage,_,p)??void 0),re=$=>{le($),v.current=$,Fn(sessionStorage,_,p,$,{onQuotaExceeded:({docSizeBytes:me})=>{te("chat_draft_quota_exceeded",{thread_id:c||null,doc_size_bytes:me}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},pe=R.useRef(c);if(pe.current!==c){pe.current=c;const $=dt(sessionStorage,_,p)??void 0;le($),v.current=$}const de=[...l].reverse().find($=>$.role==="assistant")?.metadata,je=de?.modelLimits?.contextWindow??(!de?.models?.thinking||de.models.thinking.id===f?.modelId?f?.limits?.contextWindow:void 0),ue=R.useRef(null),Ae=R.useRef(!1),he=R.useRef(!1),we=A==="plan",ne=$=>{M(),te("chat_mode_changed",{from_mode:$,to_mode:"default",source:"pill_dismiss"}),w("default")};R.useEffect(()=>{const $=me=>{tn(me)&&me.code==="KeyL"&&(me.preventDefault(),me.shiftKey&&w(A==="plan"?"default":"plan"),ue.current?.focus())};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[A,w]);const fe=Sn(l),Ee=[...l].reverse().find($=>$.role==="assistant"&&$.metadata?.usage)?.metadata?.usage?.contextTokens??0,ps=ze("chat"),hs=so(),[fs,nt]=R.useState(!1),[ms,ot]=R.useState(!1),gs=!x&&!Un(se),ke=hi({hasDraft:gs,isStreaming:V,isRunInProgress:d}),Be=ke==="send",Ce=ke==="stop",at=$=>{if($?.preventDefault(),!ps){nt(!0);return}if(hs){ot(!0);return}if(ke==="send"&&se){if(te("chat_message_sent",{thread_id:c||null,mode:A,model_id:f?.modelId??null,model_provider:f?.providerId??null,virtual_mcp_id:m?.id??null,submission:$?"button_or_enter":"programmatic"}),i){if(i.isSendInFlight()){Se.info(a("chat.input.stillSendingPreviousMessage"));return}i.sendMessage(se)}else{if(Ae.current){Se.info(a("chat.input.stillSendingPreviousMessage"));return}Ae.current=!0,T&&te("task_report_submitted",{source:"home"}),h({tiptapDoc:se,virtualMcp:T?null:m,taskIntake:T}).finally(()=>{Ae.current=!1})}Ln(sessionStorage,_,p),re(void 0)}else ke==="stop"&&(te("chat_message_stopped",{thread_id:c}),u())};if(G)return n.jsx(qe,{message:Ve?a("chat.input.readOnlyOthersChatNamed",{name:Ve}):a("chat.input.readOnlyOthersChat"),icon:Ve?n.jsx(Zs,{shape:"circle",size:"2xs",url:ae?.user?.image??void 0,fallback:Ve}):void 0});if(C?.metadata?.read_only)return n.jsx(qe,{message:a("chat.input.readOnlyThread")});if(ce)return n.jsx(qe,{message:a("chat.input.codingAgentUnavailable")});if(L&&r){const $=()=>{const me=r.createTask({runtime:"sandbox"});te("coding_session_started",{thread_id:me})};return n.jsxs("button",{type:"button",onClick:$,className:"group flex w-full items-center gap-3 rounded-2xl bg-background/60 px-4 py-3.5 text-left shadow-edge backdrop-blur-sm transition-colors hover:bg-background/90 focus-ring",children:[n.jsx(hn,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:a("chat.fastPreview.startCodingSession")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.fastPreview.chatNeedsSession")})]}),n.jsx(Ut,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return n.jsxs(n.Fragment,{children:[fs&&n.jsx(ft,{feature:"chat",onDismiss:()=>nt(!1)}),ms&&n.jsx(ft,{feature:"chat",copy:{title:a("chat.input.allowanceExhaustedTitle")},onDismiss:()=>ot(!1)}),n.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:n.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&n.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),i&&r&&n.jsx(Pe,{}),i&&r&&c?n.jsx(ls,{taskId:c}):null,n.jsx(po,{tiptapDoc:se,setTiptapDoc:re,disabled:P.status==="recording",enterToSubmit:!0,placeholder:a(T?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:at,suggestionOpenRef:he,children:n.jsxs("form",{onSubmit:at,className:z("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted shadow-edge overflow-hidden"),children:[n.jsx(vi,{selectedModel:f,onUnsupportedFile:F,disabled:P.status==="recording"}),n.jsx(qo,{}),n.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:n.jsx(ho,{ref:ue,disabled:P.status==="recording",virtualMcpId:m?.id??E,showFileUploader:!0,selectedModel:f,onUnsupportedFile:F,suggestionOpenRef:he})}),n.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:P.status==="recording"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n.jsx(Xa,{data:P.waveformData.slice(0,28)}),n.jsx("button",{type:"button",onClick:Q,className:"flex items-center justify-center size-8 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground transition-colors","aria-label":a("chat.input.cancelRecording"),children:n.jsx(He,{size:16})}),n.jsx("button",{type:"button",onClick:ee,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":a("chat.input.useTranscription"),children:n.jsx(Nt,{size:16})})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s&&n.jsx(W,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>I(!N),className:"h-8",children:a("chat.input.taskMode")}),n.jsx(Ya,{disabled:!1,onOpenConnections:()=>{te("connections_dialog_opened",{source:"tools_popover",mode:"add"}),K(!0)},virtualMcpId:m?.id??E,selectedModel:f,isStreaming:V,onUnsupportedFile:F}),we&&n.jsx(Re,{onClick:()=>ne("plan"),label:a("chat.input.planMode"),icon:n.jsx(Ft,{size:14,className:"shrink-0"}),colorClass:"text-brand-purple-dark dark:text-brand-purple hover:bg-brand-purple/10",maxWidthClass:"@[480px]/chat-bottom:max-w-32"}),A==="gen-image"&&g&&n.jsx(Re,{onClick:()=>ne("gen-image"),label:a("chat.input.createImage"),icon:n.jsx(Ot,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&b&&n.jsx(Re,{onClick:()=>ne("web-search"),label:a("chat.input.webSearch"),icon:n.jsx(Mt,{size:14,className:"shrink-0"}),colorClass:"text-brand-blue-dark dark:text-brand-blue hover:bg-brand-blue/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&j&&n.jsx(Re,{onClick:()=>ne("deep-research"),label:a("chat.input.deepResearch"),icon:n.jsx(Pt,{size:14,className:"shrink-0"}),colorClass:"text-brand-blue-dark dark:text-brand-blue hover:bg-brand-blue/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),je&&Ee>0&&n.jsx(rn,{usage:fe,totalTokens:Ee,contextWindow:je,onOpenContextPanel:t})]}),n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx(Bn,{}),n.jsx(ui,{}),P.isSupported&&n.jsx(W,{type:"button",onClick:X,disabled:!1,variant:"ghost",size:"icon",className:z("transition-colors",P.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:P.status==="permission-denied"?a("chat.input.microphoneAccessDenied"):a("chat.input.voiceInput"),"aria-label":P.status==="permission-denied"?a("chat.input.microphoneAccessDenied"):a("chat.input.voiceInput"),children:n.jsx(Kn,{size:18})}),n.jsx(W,{type:Ce?"button":"submit",onClick:$=>{Ce&&($.preventDefault(),$.stopPropagation(),u())},variant:Be||Ce?"default":"ghost",size:T?"sm":"icon",disabled:!Be&&!Ce,className:z(T?"h-8 px-3 transition-all @max-[479px]/chat-bottom:w-8 @max-[479px]/chat-bottom:px-0":"size-8 transition-all",!Be&&!Ce&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:a(ke==="stop"?V?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":a(ke==="stop"?V?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessage"),children:Ce?n.jsx(fn,{size:20}):n.jsxs(n.Fragment,{children:[T&&n.jsx("span",{className:"hidden @[480px]/chat-bottom:inline",children:a("chat.input.startTask")}),n.jsx(Lt,{size:20})]})})]})]})})]})},c),T&&o&&n.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:a("chat.input.taskHint")}),e&&n.jsx(Za,{onClick:()=>{te("connections_banner_clicked",{source:"home_chat_input"}),te("connections_dialog_opened",{source:"home_banner",mode:"add"}),K(!0)}})]})}),n.jsx(Ao,{mode:"browse",open:B,onOpenChange:K,defaultTab:"all"}),n.jsx(fo,{info:H,onClose:Y})]})}export{mr as C,ur as H,_a as T,gr as V,fr as a,xr as b,Ma as c,pr as d,Ua as e,Te as f,hr as g,us as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as B,r as S,b as G,j as h,t as A,a7 as ye,x as xe,aW as we,w as ke,B as be,v as Ce,D as Se,q as le,a6 as ce,K as Y,E as Q,gp as ue,gq as re,gr as H,m as _e}from"./index-Cdi-Ldg8.js";import{S as de,s as Pe}from"./suggestion-DiN8e3O2.js";import{O as Fe,v as Ie,B as De,q as z,Q as ve,P as ne,U as je,k as Me,a as Ee,V as Le,p as Re,C as Ae,l as Ne,n as Te,F as Qe,E as Oe}from"./usage-stats-CYjGdZ2U.js";import{aK as Ue}from"./agent-icon-BZMMR_QJ.js";import"./chat-context-B57JGGXD.js";import{m as $e,i as qe,b as Ke}from"./index-D55A1a2f.js";import{u as me}from"./use-mcp-client-DUPhaqI5.js";import{u as He}from"./repository-binding-6XbvXAcD.js";import{g as se,a as fe}from"./gateway-client-q0fGAtPo.js";import{l as oe,g as pe}from"./use-mcp-prompts-Cu6bA1zM.js";import{f as ze,b as Be}from"./use-org-fs-mzJda8BT.js";async function Je(t,e,r,s,i,o){if(!$e(e)){A.error("Selected model does not support file uploads");return}const l=r.type||"application/octet-stream";if(!qe(l,e)){const g=Ke(e).parts.map(m=>o(m)).join(", "),w=e?.title??"This model";i?i({fileName:r.name,modelName:w,accepted:g}):A.error(`"${r.name}" can't be attached`,{description:`${w} accepts ${g}.`});return}const c=10*1024*1024;if(r.size>c){A.error(`File "${r.name}" exceeds 10MB limit`);return}try{const g=new FileReader,w=new Promise((n,u)=>{g.onload=()=>{const d=g.result;if(typeof d!="string"){u(new Error("Failed to read file as data URL"));return}const b=d.includes(",")?d.split(",")[1]??d:d;n(b)},g.onerror=u});g.readAsDataURL(r);const m=await w,p={id:crypto.randomUUID(),name:r.name,mimeType:r.type||"application/octet-stream",size:r.size,data:m};Fe(t,{from:s,to:s},p)}catch(g){console.error("Failed to process file:",g),A.error(`Failed to load file "${r.name}"`)}}function Ve(t,e,r,s){if(r)return!1;const i=e.dataTransfer?.files;if(!i||i.length===0)return!1;const o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;e.preventDefault();const l=Array.from(i);return(async()=>{let c=o.pos;for(const g of l)await s(g,c),c=t.state.selection.to})(),!0}function We(t){const e=B.c(9),{editor:r,selectedModel:s,onUnsupportedFile:i}=t,o=G(),l=S.useRef(Ye);let c,g;e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o?(c=()=>{l.current=async(p,n)=>{await Je(r,s,p,n,i,o)}},g=[r,s,i,o],e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=c,e[5]=g):(c=e[4],g=e[5]),S.useEffect(c,g);let w,m;return e[6]!==r?(w=()=>{if(r?.isDestroyed)return;const p=new Ie("fileDropHandler");r.state.plugins.find(d=>d.spec.key===p)&&r.unregisterPlugin(p);const u=new De({key:p,props:{handleDrop:(d,b,F,P)=>Ve(d,b,P,(_,v)=>l.current(_,v)),handlePaste:(d,b)=>{const F=b.clipboardData?.items;if(!F)return!1;const P=Array.from(F).filter(Xe);return P.length===0?!1:(b.preventDefault(),(async()=>{let _=d.state.selection.from;for(const v of P){const D=v.getAsFile();D&&(await l.current?.(D,_),_=d.state.selection.to)}})(),!0)}}});return r.registerPlugin(u),()=>{r?.isDestroyed||r.unregisterPlugin(p)}},m=[r],e[6]=r,e[7]=w,e[8]=m):(w=e[7],m=e[8]),S.useEffect(w,m),null}function Xe(t){return t.kind==="file"}function Ye(){return Promise.resolve()}function Ct(t){const e=B.c(43),{info:r,onClose:s}=t,i=G(),o=r!==null;let l;e[0]!==s?(l=j=>!j&&s(),e[0]=s,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=c):c=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=g):g=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(ye,{size:18})}),e[4]=w):w=e[4];let m;e[5]!==i?(m=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=m):m=e[6];let p;e[7]!==m?(p=h.jsx(xe,{className:"text-xl font-semibold tracking-tight",children:m}),e[7]=m,e[8]=p):p=e[8];const n=r?.fileName;let u;e[9]!==n?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",n,"”"]}),e[9]=n,e[10]=u):u=e[10];let d;e[11]!==i?(d=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=d):d=e[12];let b;e[13]!==d||e[14]!==u?(b=h.jsxs(we,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",d]}),e[13]=d,e[14]=u,e[15]=b):b=e[15];let F;e[16]!==b||e[17]!==p?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[g,h.jsxs(ke,{className:"relative gap-4",children:[w,h.jsxs("div",{children:[p,b]})]})]}),e[16]=b,e[17]=p,e[18]=F):F=e[18];const P=r?.modelName??"";let _;e[19]!==i||e[20]!==P?(_=i("chat.uploader.accepts",{modelName:P}),e[19]=i,e[20]=P,e[21]=_):_=e[21];let v;e[22]!==_?(v=h.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:_}),e[22]=_,e[23]=v):v=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx(Ue,{size:14,className:"text-muted-foreground"}),e[24]=D):D=e[24];const E=r?.accepted;let I;e[25]!==E?(I=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[D,h.jsx("span",{className:"capitalize",children:E})]}),e[25]=E,e[26]=I):I=e[26];let a;e[27]!==v||e[28]!==I?(a=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"surface p-4",children:[v,I]})}),e[27]=v,e[28]=I,e[29]=a):a=e[29];let f;e[30]!==i?(f=i("chat.uploader.gotIt"),e[30]=i,e[31]=f):f=e[31];let x;e[32]!==s||e[33]!==f?(x=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(be,{onClick:s,children:f})}),e[32]=s,e[33]=f,e[34]=x):x=e[34];let C;e[35]!==F||e[36]!==a||e[37]!==x?(C=h.jsxs(Ce,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ge,children:[F,a,x]}),e[35]=F,e[36]=a,e[37]=x,e[38]=C):C=e[38];let M;return e[39]!==o||e[40]!==l||e[41]!==C?(M=h.jsx(Se,{open:o,onOpenChange:l,children:C}),e[39]=o,e[40]=l,e[41]=C,e[42]=M):M=e[42],M}function Ge(t){return t.preventDefault()}function St(){const t=B.c(3),[e,r]=S.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>r(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:r,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}function he(t,e){return e||t}const Ze=t=>{const e=B.c(50),{editor:r,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),l=le(),{org:c}=ce(),g=He();let w;e[0]!==c.id||e[1]!==c.slug||e[2]!==s?(w={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=c.id,e[1]=c.slug,e[2]=s,e[3]=w):w=e[3];const m=me(w);let p;e[4]!==c.id||e[5]!==s?(p=Y.virtualMcpResources(s,c.id),e[4]=c.id,e[5]=s,e[6]=p):p=e[6];const n=p,[u,d]=S.useState("categories");let b;e[7]!==u?(b=()=>u,e[7]=u,e[8]=b):b=e[8];const F=S.useEffectEvent(b),P=S.useRef(null),_=S.useRef(!1),v=s??"default";let D;e[9]!==u||e[10]!==c.id||e[11]!==v?(D=["at-mention",c.id,v,u],e[9]=u,e[10]=c.id,e[11]=v,e[12]=D):D=e[12];const E=D;let I;e[13]!==o?(I=o("chat.mentionAt.agentsTitle"),e[13]=o,e[14]=I):I=e[14];let a;e[15]!==o?(a=o("chat.mentionAt.agentsDescription"),e[15]=o,e[16]=a):a=e[16];let f;e[17]!==I||e[18]!==a?(f={name:"agents",title:I,description:a,kind:"category",drillable:!0},e[17]=I,e[18]=a,e[19]=f):f=e[19];let x;e[20]!==o?(x=o("chat.mentionAt.resourcesTitle"),e[20]=o,e[21]=x):x=e[21];let C;e[22]!==o?(C=o("chat.mentionAt.resourcesDescription"),e[22]=o,e[23]=C):C=e[23];let M;e[24]!==C||e[25]!==x?(M={name:"resources",title:x,description:C,kind:"category",drillable:!0},e[24]=C,e[25]=x,e[26]=M):M=e[26];let j;e[27]!==M||e[28]!==f?(j=[f,M],e[27]=M,e[28]=f,e[29]=j):j=e[29];const $=j;let O;e[30]!==m||e[31]!==r||e[32]!==o?(O=async U=>{const{item:k,range:K}=U;if(Q("chat_picker_item_selected",{picker:"@",item_kind:k.kind,item_name:k.name}),k.kind!=="category"&&(_.current=!0),k.kind==="category")return d(k.name==="agents"?"agents":"resources"),!1;if(k.kind==="agent"&&k.agentId){z(r,K,{id:k.agentId,name:k.name,metadata:{agentId:k.agentId,title:k.name},char:"@"}),d("categories");return}if(k.kind==="resource"&&k.uri&&m){try{const T=await ue(m,k.uri);z(r,K,{id:k.uri,name:k.uri,metadata:T.contents,char:"@"})}catch(T){console.error("[at-mention] Failed to fetch resource:",T),A.error(o("chat.mentionAt.failedToLoadResource"))}d("categories");return}},e[30]=m,e[31]=r,e[32]=o,e[33]=O):O=e[33];const q=O;let y;e[34]!==g||e[35]!==$||e[36]!==m||e[37]!==F||e[38]!==l||e[39]!==n||e[40]!==s?(y=async U=>{const{query:k}=U,K=F();if(K==="categories"){if(!k.trim())return $;const L=k.toLowerCase(),R=g.filter(N=>N.status==="active"&&(!N.id||!re(N.id))&&N.id!==s&&(N.title.toLowerCase().includes(L)||N.description?.toLowerCase().includes(L))).map(et),X=await(async()=>{if(!m)return[];let N=l.getQueryData(n);return N||(N=await l.fetchQuery({queryKey:n,queryFn:()=>H(m),staleTime:6e4})),(N?.resources??[]).filter(te=>te.uri.toLowerCase().includes(L)||te.name?.toLowerCase().includes(L)||te.description?.toLowerCase().includes(L)).map(tt)})();return[...R,...X]}if(K==="agents"){let L=g.filter(R=>R.status==="active"&&(!R.id||!re(R.id))&&R.id!==s);if(k.trim()){const R=k.toLowerCase();L=L.filter(X=>X.title.toLowerCase().includes(R)||X.description?.toLowerCase().includes(R))}return L.map(st)}if(!m)return[];let T=l.getQueryData(n);T?l.fetchQuery({queryKey:n,queryFn:()=>H(m),staleTime:6e4}).catch(rt):T=await l.fetchQuery({queryKey:n,queryFn:()=>H(m),staleTime:6e4});let W=T?.resources??[];if(k.trim()){const L=k.toLowerCase();W=W.filter(R=>R.uri.toLowerCase().includes(L)||R.name?.toLowerCase().includes(L)||R.description?.toLowerCase().includes(L))}return W.map(nt)},e[34]=g,e[35]=$,e[36]=m,e[37]=F,e[38]=l,e[39]=n,e[40]=s,e[41]=y):y=e[41];const Z=y;let J;e[42]!==i?(J=U=>{if(i&&(i.current=U),U)P.current=Date.now(),_.current=!1,Q("chat_picker_opened",{picker:"@"});else{const k=P.current;Q("chat_picker_closed",{picker:"@",outcome:_.current?"selected":"dismissed",duration_ms:k?Date.now()-k:null}),P.current=null,d("categories")}},e[42]=i,e[43]=J):J=e[43];const ee=J;let V;return e[44]!==r||e[45]!==Z||e[46]!==q||e[47]!==ee||e[48]!==E?(V=h.jsx(de,{editor:r,char:"@",pluginKey:"atDropdownMenu",queryKey:E,queryFn:Z,onSelect:q,onOpenChange:ee}),e[44]=r,e[45]=Z,e[46]=q,e[47]=ee,e[48]=E,e[49]=V):V=e[49],V};function et(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function tt(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}function st(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function rt(){}function nt(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function ie(t,e,r,s,i,o,l){try{const c=await pe(r,s,o);z(t,e,{id:s,name:fe(s,i),metadata:c.messages,char:"/",kind:"prompt",args:o})}catch(c){console.error("[slash] Failed to fetch prompt:",c),A.error(l.t("chat.mentionSlash.failedLoadPrompt"))}}async function ot(t,e,r,s,i){try{const o=await ue(r,s);z(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),A.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function it(t,e,r,s,i){try{const{files:o,omittedPaths:l}=await ze(r,s.volume,s.path),c={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:l};z(t,e,{id:s.id,name:s.name,metadata:c,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),A.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const at=({editor:t,virtualMcpId:e,suggestionOpenRef:r})=>{const s=G(),i=le(),{org:o}=ce(),l=me({connectionId:e,orgId:o.id,orgSlug:o.slug}),c=Y.virtualMcpPrompts(e,o.id),g=Y.virtualMcpResources(e,o.id),w=Y.slashSkills(o.id),m=["slash-mention",o.id,e??"default"],[p,n]=S.useState(null),[u,d]=S.useState(null),b=ve(t);b&&(b.onEditChip=async a=>{if(l)try{const x=(await ae(i,c,l)).find(C=>C.name===a.promptId);if(!x?.arguments||x.arguments.length===0)return;d({...a,prompt:x})}catch(f){console.error("[slash] Failed to load prompt for editing:",f),A.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=S.useRef(null),P=S.useRef(!1),_=async({item:a,range:f})=>{if(Q("chat_picker_item_selected",{picker:"/",item_kind:a.kind,item_name:a.name}),P.current=!0,!!l)if(a.kind==="prompt"){if(a.arguments&&a.arguments.length>0){n({range:f,item:a});return}const x=se(a._meta);await ie(t,f,l,a.name,x,void 0,{t:s})}else a.kind==="skill"?a.skill&&await it(t,f,o.slug,a.skill,{t:s}):a.uri&&await ot(t,f,l,a.uri,{t:s})},v=async a=>{if(!p||!l)return;const{range:f,item:x}=p,C=se(x._meta);await ie(t,f,l,x.name,C,a,{t:s}),n(null)},D=async a=>{if(!(!u||!l)){if(!je(t,u.pos,u.promptId)){A.error(s("chat.mentionSlash.failedUpdatePrompt")),d(null);return}try{const f=await pe(l,u.promptId,a),x=se(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Me({id:u.promptId,name:fe(u.promptId,x),metadata:f.messages,char:"/",kind:"prompt",args:a})).run(),Q("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(f){console.error("[slash] Failed to update prompt:",f),A.error(s("chat.mentionSlash.failedUpdatePrompt"))}d(null)}},E=async a=>{const{query:f}=a;if(!l)return[];const[x,C,M]=await Promise.all([ae(i,c,l),ct(i,g,l),lt(i,w,o.slug)]),j=f.trim().toLowerCase(),$=(x??[]).filter(y=>!j||y.name.toLowerCase().includes(j)||y.title?.toLowerCase().includes(j)||y.description?.toLowerCase().includes(j)).map(y=>({name:y.name,title:y.title,description:y.description,kind:"prompt",arguments:y.arguments,_meta:y._meta})),O=(C??[]).filter(y=>!j||y.uri.toLowerCase().includes(j)||y.name?.toLowerCase().includes(j)||y.description?.toLowerCase().includes(j)).map(y=>({name:y.name??y.uri,title:y.name,description:y.description,kind:"resource",uri:y.uri})),q=(M??[]).filter(y=>!j||y.name.toLowerCase().includes(j)||y.id.toLowerCase().includes(j)||y.description?.toLowerCase().includes(j)).map(y=>({name:y.name,title:y.name,description:y.description??void 0,kind:"skill",skill:y}));return[...$,...O,...q]},I=p?.item.kind==="prompt"?{name:p.item.name,title:p.item.title,arguments:p.item.arguments,description:p.item.description,_meta:p.item._meta}:null;return h.jsxs(h.Fragment,{children:[h.jsx(de,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:m,queryFn:E,onSelect:_,onOpenChange:a=>{if(r&&(r.current=a),a)F.current=Date.now(),P.current=!1,Q("chat_picker_opened",{picker:"/"});else{const f=F.current;Q("chat_picker_closed",{picker:"/",outcome:P.current?"selected":"dismissed",duration_ms:f?Date.now()-f:null}),F.current=null}}}),h.jsx(ne,{prompt:I,setPrompt:()=>n(null),onSubmit:v}),h.jsx(ne,{prompt:u?.prompt??null,setPrompt:()=>d(null),onSubmit:D,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ae(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function lt(t,e,r){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Be(r),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function ct(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>H(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>H(r),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ge="Ask anything, / for prompts & skills, @ for agents & resources...";function ut(t){return[Ne,Pe.configure({placeholder:()=>t.current??ge,showOnlyWhenEditable:!1}),Te,Qe]}function _t({tiptapDoc:t,setTiptapDoc:e,disabled:r=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:l,children:c}){const g=S.useRef(o),w=S.useRef(e),m=S.useRef(s),p=S.useRef(i),n=Ee({extensions:ut(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ge,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[14px] max-md:text-base p-[18px]"},handleKeyDown:(u,d)=>d.key==="Enter"&&!d.shiftKey&&m.current&&!l?.current?(d.preventDefault(),g.current?.(),!0):!1},onUpdate:({editor:u})=>{w.current(u?.getJSON())}});return S.useEffect(()=>{n?.setEditable(!r)},[n,r]),S.useEffect(()=>{g.current=o},[o]),S.useEffect(()=>{w.current=e},[e]),S.useEffect(()=>{m.current=s},[s]),S.useEffect(()=>{p.current=i},[i]),S.useEffect(()=>{if(!n||n.isDestroyed)return;const u=JSON.stringify(n.getJSON()),d=JSON.stringify(t||{type:"doc",content:[]});u!==d&&n.commands.setContent(t||{type:"doc",content:[]})},[n,t]),h.jsx(Le.Provider,{value:{editor:n},children:c})}function Pt(t){const e=B.c(29),{disabled:r,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:l,suggestionOpenRef:c,ref:g,className:w}=t,m=r===void 0?!1:r,p=i===void 0?!1:i,{editor:n}=Re();let u,d;if(e[0]!==n?(u=()=>({focus:()=>{n?.commands.focus()},clear:()=>{n?.commands.clearContent(!0)},appendText:x=>{if(!n)return;const C=n.state.doc.textContent.trim()==="";n.commands.focus("end"),C||n.commands.insertContent(" "),n.commands.insertContent(x)},syncVoiceText:(x,C)=>{if(n&&(n.commands.setContent(x||{type:"doc",content:[]}),C)){n.commands.focus("end");const M=n.state.doc.textContent.trim().length>0;n.commands.insertContent({type:"text",text:M?" "+C:C})}},restoreContent:x=>{n&&n.commands.setContent(x||{type:"doc",content:[]})}}),d=[n],e[0]=n,e[1]=u,e[2]=d):(u=e[1],d=e[2]),S.useImperativeHandle(g??null,u,d),!n)return null;const b=m&&"cursor-not-allowed opacity-70",F=m&&"[&_.ProseMirror]:cursor-not-allowed";let P;e[3]!==w||e[4]!==b||e[5]!==F?(P=_e("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",w,Ae,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",b,F),e[3]=w,e[4]=b,e[5]=F,e[6]=P):P=e[6];let _;e[7]!==n||e[8]!==P?(_=h.jsx(Oe,{editor:n,className:P}),e[7]=n,e[8]=P,e[9]=_):_=e[9];const v=s??null;let D;e[10]!==n||e[11]!==c||e[12]!==v?(D=h.jsx(S.Suspense,{fallback:null,children:h.jsx(at,{editor:n,virtualMcpId:v,suggestionOpenRef:c})}),e[10]=n,e[11]=c,e[12]=v,e[13]=D):D=e[13];const E=s??null;let I;e[14]!==n||e[15]!==c||e[16]!==E?(I=h.jsx(S.Suspense,{fallback:null,children:h.jsx(Ze,{editor:n,virtualMcpId:E,suggestionOpenRef:c})}),e[14]=n,e[15]=c,e[16]=E,e[17]=I):I=e[17];let a;e[18]!==m||e[19]!==n||e[20]!==l||e[21]!==o||e[22]!==p?(a=p&&o&&!m?h.jsx(We,{editor:n,selectedModel:o,onUnsupportedFile:l}):null,e[18]=m,e[19]=n,e[20]=l,e[21]=o,e[22]=p,e[23]=a):a=e[23];let f;return e[24]!==D||e[25]!==I||e[26]!==a||e[27]!==_?(f=h.jsxs(h.Fragment,{children:[_,D,I,a]}),e[24]=D,e[25]=I,e[26]=a,e[27]=_,e[28]=f):f=e[28],f}export{_t as T,Ct as U,Pt as a,Je as p,St as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as k,j as h,r as C,m as L}from"./index-Cdi-Ldg8.js";import{n as Z}from"./LinkBroken01-5IFNWpUM.js";import{A as y}from"./agent-icon-BZMMR_QJ.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as H,j as t,m as M,r as R,b as q,bx as Nn,D as cs,v as ds,w as Gs,x as us,aW as Hs,I as kn,y as Us,B as le,an as wn,bj as ms,t as re,by as it,a$ as lt,X as Ut,bz as Ds,Z as Vt,_ as Wt,b8 as Vs,aX as Cn,Y as ie,av as Sn,bt as Pn,ax as is,ap as Tn}from"./index-Cdi-Ldg8.js";import{s as Dn}from"./date-utils-CrvIKg-s.js";import{D as _n,e as Bn,t as Ws,v as An,w as Ln,F as zn,x as Fn,y as $n,z as _s,A as Ys,G as xs,H as En,I as fs,J as On,K as In,L as rt,M as Qs,N as Rn,O as Mn,P as Bs,Q as js,R as Kn,T as Xs,U as Gn,a as Hn}from"./category-tree-DPLQbdyM.js";import{i as Yt}from"./AlertCircle-xosAEaLd.js";import{W as Un,X as Vn,F as Zs,e as ys,n as Wn,Q as Yn,L as Qn,Y as Xn}from"./agent-icon-BZMMR_QJ.js";import{i as Zn}from"./CheckCircle-BKxt6JEi.js";import{t as ps}from"./ChevronDown-DIkHoN0o.js";import{i as qn}from"./SwitchHorizontal01-kFmqIycT.js";import{i as gs,d as qs}from"./UserCheck01-D1hKwgA_.js";import{s as hs,a as Jn,e as ea}from"./UserSquare-n5hmrVRJ.js";import{s as ta}from"./Plus-BfHy14x9.js";import{s as vs}from"./Trash01-BKEk-Z9e.js";import{i as rs}from"./Upload01-m7-hvqhV.js";import{B as Ns}from"./badge-CIeWzjRT.js";import{E as sa}from"./empty-state-D812T-Mt.js";import{C as ks}from"./checkbox-Oe_bUdt-.js";import{b as Js,u as na,a as aa,d as As,D as oa,l as la,c as ia,i as ra,p as ca,s as da}from"./legacy-content-CAaGkiig.js";import{u as ua}from"./use-ai-providers-DFecqYxb.js";import{r as ma,L as xa,u as en,a as fa}from"./index-CpyELSlc.js";import{u as pa}from"./use-move-blocks-Dr2ivqEX.js";import{H as ga}from"./hosted-reconcile-C3Nz5iSn.js";import{u as ha}from"./site-editor-toast-dw1Pn_Dx.js";import{b as ba}from"./repository-binding-6XbvXAcD.js";import{m as ja}from"./match-site-slug-config-B47_xZCi.js";import{L as Gt}from"./label-ChY9Byh0.js";import{T as Ls}from"./textarea--AVkwPvk.js";import{u as ya}from"./use-file-configs-CBOpfPja.js";import{P as zs,s as oe,a as Qt}from"./primitives-DxszQMwM.js";import{MonacoCodeEditor as va}from"./monaco-editor-BJOiPOqK.js";import{T as et,a as tt,c as st}from"./tooltip-DQ0KlQ_6.js";import{b as Na}from"./Tool01-DOLqbPpg.js";function Lo(d){const e=H.c(6),{hasItems:s,emptyLabel:n,emptyHint:l}=d;let r;e[0]!==l||e[1]!==n||e[2]!==s?(r=s?"No results match your search.":t.jsxs(t.Fragment,{children:[t.jsx("div",{children:n}),t.jsx("div",{className:"mt-1 text-muted-foreground/80",children:l})]}),e[0]=l,e[1]=n,e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==r?(a=t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=a):a=e[5],a}function zo(d){const e=H.c(18),{icon:s,label:n,count:l,mark:r,active:a,onClick:i,indent:x,"aria-current":u}=d,c=x&&"pl-6",p=a?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground";let g;e[0]!==c||e[1]!==p?(g=M("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",c,p),e[0]=c,e[1]=p,e[2]=g):g=e[2];let m;e[3]!==s?(m=t.jsx(s,{size:16,className:"shrink-0"}),e[3]=s,e[4]=m):m=e[4];let o;e[5]!==n?(o=t.jsx("span",{className:"flex-1 truncate",children:n}),e[5]=n,e[6]=o):o=e[6];let b;e[7]!==a||e[8]!==l?(b=l!==void 0&&t.jsx("span",{className:M("shrink-0 text-xs tabular-nums",a?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[7]=a,e[8]=l,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==r||e[12]!==i||e[13]!==g||e[14]!==m||e[15]!==o||e[16]!==b?(y=t.jsxs("button",{type:"button",onClick:i,"aria-current":u,className:g,children:[m,o,r,b]}),e[10]=u,e[11]=r,e[12]=i,e[13]=g,e[14]=m,e[15]=o,e[16]=b,e[17]=y):y=e[17],y}function Fo(d){const e=H.c(5),{icon:s,label:n}=d;let l;e[0]!==s?(l=s&&t.jsx(s,{size:13,className:"shrink-0"}),e[0]=s,e[1]=l):l=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[l,n]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}function $o(d,e){const[s,n]=R.useState(d);return d!==null&&(d.title!==s?.title||d.description!==s?.description)&&n(d),d??(e?s:null)}function Xt(d){const e=String(d.getMonth()+1).padStart(2,"0"),s=String(d.getDate()).padStart(2,"0");return`${d.getFullYear()}-${e}-${s}`}const tn=/^(\d{4})-(\d{2})-(\d{2})$/;function Zt(d){const e=d.trim();if(!e)return null;const s=tn.exec(e);if(s){const l=Number(s[1]),r=Number(s[2])-1,a=Number(s[3]),i=new Date(l,r,a);return i.getMonth()===r&&i.getDate()===a?i:null}const n=new Date(e);return Number.isNaN(n.getTime())?null:Dn(n)}function Eo(d,{legacyContent:e=!1}={}){const s=new Date(d.getFullYear(),d.getMonth(),d.getDate(),_n);return{...Bn("posts",{legacyContent:e}),status:"scheduled",scheduledDatetime:s.toISOString(),date:Xt(d)}}function ka(d){if(typeof d!="string")return null;const e=d.trim();if(!e)return null;if(tn.test(e))return Zt(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function Oo(d,e){const s=ka(d.scheduledDatetime);if(!s)return null;const n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),l={...d,scheduledDatetime:n.toISOString()};return(typeof d.date=="string"?d.date:"")===Xt(s)&&(l.date=Xt(n)),l}function wa(d){return Zt(d.scheduledDatetime)??Zt(d.date)}function Io(d){const e=new Map,s=[];for(const l of d){const r={post:l,scheduled:Zt(l.scheduledDatetime)!==null},a=wa(l);if(!a){s.push(r);continue}const i=Xt(a),x=e.get(i);x?x.push(r):e.set(i,[r])}const n=(l,r)=>Number(r.scheduled)-Number(l.scheduled)||l.post.title.localeCompare(r.post.title);for(const l of e.values())l.sort(n);return s.sort(n),{byDay:e,undated:s}}const Ht=[{id:"campaign",label:"sandbox.generatePost.stepCampaign"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Ca=[1,2,3],Sa={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Pa({virtualMcpId:d,open:e,onOpenChange:s,decofile:n,hasAi:l,onGenerate:r}){const a=q(),i=ya(),x=ba(d),u=ja(i.data?.configs??[],Nn(x),x?.metadata?.assetStorageConfigId)?.id,[c,p]=R.useState("campaign"),[g,m]=R.useState(""),[o,b]=R.useState(""),[y,w]=R.useState(""),[C,S]=R.useState(""),[N,T]=R.useState(1),{merged:_}=Ws(n),P=An(_),h=Ln(n).filter(v=>v.status!=="finished"),k=h.find(v=>v.key===g),B=n[zn],L=Fn($n(B?.formats)),$=()=>{p("campaign"),m(""),b(""),w(""),S(""),T(1)},D=v=>{s(v),v||$()},A=Ht.findIndex(v=>v.id===c),F=c==="campaign"?!!k:c==="format"?o.trim().length>0&&y.trim().length>0:!0,E=c==="extra",O=()=>{k&&(r({campaign:k,format:{name:o.trim(),value:y.trim()},extraInstructions:C.trim()||void 0,count:N,fileConfigId:ma(i.data?.configs??[],u,typeof window<"u"?window.localStorage.getItem(xa):null)??void 0}),D(!1))};return t.jsx(cs,{open:e,onOpenChange:D,children:t.jsxs(ds,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[t.jsxs(Gs,{children:[t.jsx(us,{children:a("sandbox.generatePost.title")}),t.jsx(Hs,{children:a("sandbox.generatePost.subtitle")})]}),P.length>0?t.jsx("p",{className:"text-sm text-muted-foreground",children:a("sandbox.generatePost.blockedBrand",{fields:P.map(v=>a(Sa[v])).join(", ")})}):t.jsxs(t.Fragment,{children:[t.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:Ht.map((v,K)=>t.jsx("li",{className:M("rounded-md px-2 py-1",K===A?"bg-primary text-primary-foreground":K<A?"text-foreground":"text-muted-foreground"),children:a(v.label)},v.id))}),t.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[c==="campaign"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.campaignHint")}),h.length===0?t.jsx("p",{className:"rounded-lg border border-dashed px-3 py-6 text-center text-sm text-muted-foreground",children:a("sandbox.generatePost.noCampaigns")}):t.jsx(Ta,{campaigns:h,chosen:g,onChoose:m})]}),c==="format"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.formatHint")}),t.jsx(zs,{options:L.map(v=>v.name),value:o,onChange:v=>{b(v),w(L.find(K=>K.name===v)?.value??"")}}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Gt,{htmlFor:"generate-format-name",children:a("sandbox.generatePost.formatNameLabel")}),t.jsx(kn,{id:"generate-format-name",value:o,onChange:v=>b(v.target.value),placeholder:a("sandbox.generatePost.formatNamePlaceholder")})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Gt,{htmlFor:"generate-format-value",children:a("sandbox.generatePost.formatValueLabel")}),t.jsx(Ls,{id:"generate-format-value",value:y,onChange:v=>w(v.target.value),placeholder:a("sandbox.generatePost.formatValuePlaceholder"),rows:4})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.formatBlocksHint")})]}),c==="extra"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Gt,{htmlFor:"generate-extra",children:a("sandbox.generatePost.extraLabel")}),t.jsx(Ls,{id:"generate-extra",value:C,onChange:v=>S(v.target.value),placeholder:a("sandbox.generatePost.extraPlaceholder"),rows:4})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Gt,{children:a("sandbox.generatePost.countLabel")}),t.jsx(zs,{options:Ca.map(String),value:String(N),onChange:v=>T(Number(v)||1)}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.countHint")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.coverHint")})]})]}),t.jsxs(Us,{className:"shrink-0 sm:justify-between",children:[t.jsx(le,{type:"button",variant:"outline",disabled:A===0,onClick:()=>p(Ht[A-1].id),children:a("sandbox.generatePost.back")}),E?t.jsxs(le,{type:"button",disabled:!l,onClick:O,children:[t.jsx(hs,{size:14}),a("sandbox.generatePost.generate",{count:String(N)})]}):t.jsx(le,{type:"button",disabled:!F,onClick:()=>p(Ht[A+1].id),children:a("sandbox.generatePost.next")})]})]})]})})}function Ta(d){const e=H.c(11),{campaigns:s,chosen:n,onChoose:l}=d,r=q();let a;if(e[0]!==s||e[1]!==n||e[2]!==l||e[3]!==r){let x;e[5]!==n||e[6]!==l||e[7]!==r?(x=u=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>l(u.key),className:M("w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",n===u.key&&"border-primary"),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:u.name||r("sandbox.campaigns.untitled")}),t.jsx(Ns,{variant:"outline",size:"sm",className:"shrink-0",children:u.intent.products.length>0?r("sandbox.generatePost.campaignProducts",{count:String(u.intent.products.length)}):r("sandbox.generatePost.campaignNoProducts")})]}),u.trigger.note&&t.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:u.trigger.note})]})},u.key),e[5]=n,e[6]=l,e[7]=r,e[8]=x):x=e[8],a=s.map(x),e[0]=s,e[1]=n,e[2]=l,e[3]=r,e[4]=a}else a=e[4];let i;return e[9]!==a?(i=t.jsx("ul",{className:"space-y-1.5",children:a}),e[9]=a,e[10]=i):i=e[10],i}function Da(d){const e=[];for(let s=0;e.length<Bs;s+=1){const n=e.length;for(const l of d){const r=l.images?.[s];if(r&&(e.push(r),e.length>=Bs))return e}if(e.length===n)break}return e}const _a={"no-store-data":"sandbox.generatePost.gapNoStoreData","sections-dropped":"sandbox.generatePost.gapSectionsDropped","no-bucket":"sandbox.generatePost.gapNoBucket","no-image-model":"sandbox.generatePost.gapNoImageModel","images-failed":"sandbox.generatePost.gapImagesFailed","drafts-failed":"sandbox.generatePost.gapDraftsFailed"};function Ba({orgSlug:d,virtualMcpId:e,branch:s,decofile:n,meta:l,onStarted:r}){const a=q(),i=wn(),x=Js(),u=en({orgSlug:d,virtualMcpId:e,branch:s});return async c=>{const p={campaignKey:c.campaign.key,format:c.format,brief:c.campaign.trigger.note},g=_s(Ys({title:c.campaign.name,planning:p,now:new Date}),"generating",new Date),m=Array.from({length:c.count},()=>ms(xs())),{merged:o}=Ws(n),b=En(o),y=fs(n,"categories").map(({payload:h})=>({name:oe(h.name),slug:oe(h.slug)})).filter(h=>h.slug),w=On(n),C=In(c.format,l,n,{hideDefaults:x}),S=Object.fromEntries(C.map(h=>[h.name,h.example])),N=async(h,k=m.length)=>{for(const B of m.slice(h,k))try{await u.mutateAsync({blockKey:B,data:rt(B,_s(g,"draft",new Date))})}catch(L){console.warn("[generatePost] could not reset a card",L)}},T=async(h,k)=>{if(!k.fileConfigId||h.length===0)return new Map;try{const B=await i.call("BLOG_POST_ILLUSTRATE",{requests:h.map((L,$)=>({id:String($),prompt:L.cover.prompt,alt:L.cover.alt})),productImages:Da(k.campaign.intent.products),companyName:b.companyName??"",fileConfigId:k.fileConfigId});return new Map(B.images.map(L=>[L.id,L.url]))}catch(B){return console.warn("[generatePost] illustrating failed",B),new Map}};let _=0;try{for(const h of m)await u.mutateAsync({blockKey:h,data:rt(h,g)}),_+=1}catch(h){await N(0,_),re.error(h instanceof Error?h.message:a("sandbox.generatePost.failed"));return}r?.(m);let P=0;try{const h=await i.call("BLOG_SITE_GROUND",{virtualMcpId:e,purpose:"post",focus:`${c.campaign.name}: ${c.campaign.trigger.note}`,language:b.language}).catch(D=>{console.warn("[generatePost] grounding failed",D)}),k=await i.call("BLOG_POST_DRAFT",{virtualMcpId:e,grounding:h?{report:h.report,outcome:h.outcome}:void 0,brand:{companyName:b.companyName,description:b.description,language:b.language,storeUrl:b.storeUrl,targetAudience:b.targetAudience,tone:b.tone,dos:b.dos,avoid:b.avoid,vocabulary:b.vocabulary,voiceExamples:b.voiceExamples},campaign:{name:c.campaign.name,period:c.campaign.period,trigger:c.campaign.trigger,intent:{objective:c.campaign.intent.objective,targets:c.campaign.intent.targets,products:c.campaign.intent.products,keywords:c.campaign.intent.keywords},guardrails:c.campaign.guardrails},format:c.format,blocks:C,categories:y,authors:w.map(({name:D,email:A})=>({name:D,email:A})),extraInstructions:c.extraInstructions?.trim()||void 0,count:c.count}),B=await T(k.posts,c),L=Qs(l,{hideDefaults:x}),$=Rn(n).map(D=>D.slug);for(const[D,A]of k.posts.entries()){const F=m[D];if(!F)break;const E=Mn({draft:{...A,cover:{...A.cover,url:B.get(String(D))??""}},resolveTypes:L,productShapes:S,categories:y,authors:w,planning:p,takenSlugs:$,now:new Date});$.push(oe(E.slug)),await u.mutateAsync({blockKey:F,data:rt(F,E)}),P=D+1}await N(P),k.posts.length>0&&re.success(a("sandbox.generatePost.done",{count:String(k.posts.length)}));for(const D of k.gaps)re.warning(a(_a[D.code],{count:D.count??0}))}catch(h){await N(P),re.error(h instanceof Error?h.message:a("sandbox.generatePost.failed"))}}}const Fs="__all__",$s={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},Aa={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},Es="status:";function Os(d){if(!d.startsWith(Es))return null;const e=d.slice(Es.length);return js.includes(e)?e:null}const Is=R.forwardRef(function(e,s){const n=H.c(20);let l,r,a,i,x;n[0]!==e?({icon:l,active:r,value:x,className:a,...i}=e,n[0]=e,n[1]=l,n[2]=r,n[3]=a,n[4]=i,n[5]=x):(l=n[1],r=n[2],a=n[3],i=n[4],x=n[5]);const u=r?"text-foreground":"text-muted-foreground";let c;n[6]!==a||n[7]!==u?(c=M("gap-1 px-1.5 text-xs",u,a),n[6]=a,n[7]=u,n[8]=c):c=n[8];let p;n[9]!==l?(p=t.jsx(l,{size:14,className:"shrink-0"}),n[9]=l,n[10]=p):p=n[10];let g;n[11]!==x?(g=x&&t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x}),n[11]=x,n[12]=g):g=n[12];let m;n[13]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ps,{size:12,className:"shrink-0 opacity-60"}),n[13]=m):m=n[13];let o;return n[14]!==i||n[15]!==s||n[16]!==c||n[17]!==p||n[18]!==g?(o=t.jsxs(le,{ref:s,type:"button",variant:"ghost",size:"sm",className:c,...i,children:[p,g,m]}),n[14]=i,n[15]=s,n[16]=c,n[17]=p,n[18]=g,n[19]=o):o=n[19],o});function ws(d){const e=H.c(2),{count:s}=d;let n;return e[0]!==s?(n=t.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function La(d){const e=H.c(19),{value:s,onChange:n}=d,l=q();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Jn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=r):r=e[0];let a;e[1]!==n?(a=g=>n(g.target.value),e[1]=n,e[2]=a):a=e[2];let i;e[3]!==l?(i=l("sandbox.postToolbar.searchPlaceholder"),e[3]=l,e[4]=i):i=e[4];let x;e[5]!==l?(x=l("sandbox.postToolbar.searchAriaLabel"),e[5]=l,e[6]=x):x=e[6];let u;e[7]!==a||e[8]!==i||e[9]!==x||e[10]!==s?(u=t.jsx("input",{type:"text",value:s,onChange:a,placeholder:i,"aria-label":x,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=a,e[8]=i,e[9]=x,e[10]=s,e[11]=u):u=e[11];let c;e[12]!==n||e[13]!==l||e[14]!==s?(c=s&&t.jsx(sn,{label:l("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=l,e[14]=s,e[15]=c):c=e[15];let p;return e[16]!==u||e[17]!==c?(p=t.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[r,u,c]}),e[16]=u,e[17]=c,e[18]=p):p=e[18],p}function za(d){const e=H.c(100),{categories:s,authors:n,statusCounts:l,categoryFilter:r,authorFilter:a,statusFilter:i,sort:x,onCategoryFilterChange:u,onAuthorFilterChange:c,onStatusFilterChange:p,onSortChange:g}=d,m=q();let o;if(e[0]!==s||e[1]!==r){let z;e[3]!==r?(z=me=>me.slug===r,e[3]=r,e[4]=z):z=e[4],o=s.find(z),e[0]=s,e[1]=r,e[2]=o}else o=e[2];const b=o;let y;if(e[5]!==a||e[6]!==n){let z;e[8]!==a?(z=me=>me.email===a,e[8]=a,e[9]=z):z=e[9],y=n.find(z),e[5]=a,e[6]=n,e[7]=y}else y=e[7];const w=y,C=!!(r||a||i);let S;e[10]!==w?.name||e[11]!==b?.name||e[12]!==i||e[13]!==m?(S=b?.name??w?.name??m(i?Qt[i]:"sandbox.postToolbar.filterLabel"),e[10]=w?.name,e[11]=b?.name,e[12]=i,e[13]=m,e[14]=S):S=e[14];const N=S,T=r?`cat:${r}`:a?`author:${a}`:i?`status:${i}`:Fs;let _;e[15]!==c||e[16]!==u||e[17]!==p?(_=()=>{u(null),c(null),p(null)},e[15]=c,e[16]=u,e[17]=p,e[18]=_):_=e[18];const P=_;let h;e[19]!==P||e[20]!==c||e[21]!==u||e[22]!==p?(h=z=>{z.startsWith("cat:")?(c(null),p(null),u(z.slice(4))):z.startsWith("author:")?(u(null),p(null),c(z.slice(7))):Os(z)?(u(null),c(null),p(Os(z))):P()},e[19]=P,e[20]=c,e[21]=u,e[22]=p,e[23]=h):h=e[23];const k=h;let B;e[24]!==N||e[25]!==C?(B=t.jsx(Ut,{asChild:!0,children:t.jsx(Is,{icon:Un,active:C,value:N,className:"min-w-0 shrink"})}),e[24]=N,e[25]=C,e[26]=B):B=e[26];let L;e[27]!==m?(L=m("sandbox.postToolbar.filterBy"),e[27]=m,e[28]=L):L=e[28];let $;e[29]!==L?($=t.jsx(lt,{children:L}),e[29]=L,e[30]=$):$=e[30];let D;e[31]!==m?(D=m("sandbox.postToolbar.allPosts"),e[31]=m,e[32]=D):D=e[32];let A;e[33]!==D?(A=t.jsx(it,{value:Fs,children:D}),e[33]=D,e[34]=A):A=e[34];let F;e[35]!==m?(F=m("sandbox.postToolbar.statusLabel"),e[35]=m,e[36]=F):F=e[36];let E;e[37]!==F?(E=t.jsx(lt,{className:"text-muted-foreground/70",children:F}),e[37]=F,e[38]=E):E=e[38];let O;e[39]!==l||e[40]!==m?(O=js.map(z=>t.jsxs(it,{value:`status:${z}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:m(Qt[z])}),t.jsx(ws,{count:l[z]??0})]},`status:${z}`)),e[39]=l,e[40]=m,e[41]=O):O=e[41];let v;e[42]!==s.length||e[43]!==m?(v=s.length>0&&t.jsx(lt,{className:"text-muted-foreground/70",children:m("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=m,e[44]=v):v=e[44];let K;e[45]!==s?(K=s.map($a),e[45]=s,e[46]=K):K=e[46];let U;e[47]!==n.length||e[48]!==m?(U=n.length>0&&t.jsx(lt,{className:"text-muted-foreground/70",children:m("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=m,e[49]=U):U=e[49];let Y;e[50]!==n?(Y=n.map(Fa),e[50]=n,e[51]=Y):Y=e[51];let V;e[52]!==T||e[53]!==k||e[54]!==A||e[55]!==E||e[56]!==O||e[57]!==v||e[58]!==K||e[59]!==U||e[60]!==Y?(V=t.jsxs(Ds,{value:T,onValueChange:k,children:[A,E,O,v,K,U,Y]}),e[52]=T,e[53]=k,e[54]=A,e[55]=E,e[56]=O,e[57]=v,e[58]=K,e[59]=U,e[60]=Y,e[61]=V):V=e[61];let X;e[62]!==V||e[63]!==$?(X=t.jsxs(Vt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[$,V]}),e[62]=V,e[63]=$,e[64]=X):X=e[64];let J;e[65]!==X||e[66]!==B?(J=t.jsxs(Wt,{children:[B,X]}),e[65]=X,e[66]=B,e[67]=J):J=e[67];let te;e[68]!==P||e[69]!==C||e[70]!==m?(te=C&&t.jsx(sn,{label:m("sandbox.postToolbar.clearFilter"),onClick:P}),e[68]=P,e[69]=C,e[70]=m,e[71]=te):te=e[71];const fe=Aa[x];let Q;e[72]!==m||e[73]!==fe?(Q=m(fe),e[72]=m,e[73]=fe,e[74]=Q):Q=e[74];let se;e[75]!==Q?(se=t.jsx(Ut,{asChild:!0,children:t.jsx(Is,{icon:Vn,active:!0,value:Q})}),e[75]=Q,e[76]=se):se=e[76];let ue;e[77]!==m?(ue=m("sandbox.postToolbar.sortBy"),e[77]=m,e[78]=ue):ue=e[78];let ne;e[79]!==ue?(ne=t.jsx(lt,{children:ue}),e[79]=ue,e[80]=ne):ne=e[80];let Z;e[81]!==g?(Z=z=>g(z),e[81]=g,e[82]=Z):Z=e[82];let pe;e[83]===Symbol.for("react.memo_cache_sentinel")?(pe=Object.keys($s),e[83]=pe):pe=e[83];let ce;e[84]!==m?(ce=pe.map(z=>t.jsx(it,{value:z,children:m($s[z])},z)),e[84]=m,e[85]=ce):ce=e[85];let ae;e[86]!==x||e[87]!==Z||e[88]!==ce?(ae=t.jsx(Ds,{value:x,onValueChange:Z,children:ce}),e[86]=x,e[87]=Z,e[88]=ce,e[89]=ae):ae=e[89];let de;e[90]!==ne||e[91]!==ae?(de=t.jsxs(Vt,{align:"end",className:"w-44",children:[ne,ae]}),e[90]=ne,e[91]=ae,e[92]=de):de=e[92];let W;e[93]!==se||e[94]!==de?(W=t.jsx("div",{className:"ml-auto shrink-0",children:t.jsxs(Wt,{children:[se,de]})}),e[93]=se,e[94]=de,e[95]=W):W=e[95];let ee;return e[96]!==J||e[97]!==te||e[98]!==W?(ee=t.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[J,te,W]}),e[96]=J,e[97]=te,e[98]=W,e[99]=ee):ee=e[99],ee}function Fa(d){return t.jsxs(it,{value:`author:${d.email}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.name}),t.jsx(ws,{count:d.count})]},`author:${d.email}`)}function $a(d){return t.jsxs(it,{value:`cat:${d.slug}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.name}),t.jsx(ws,{count:d.count})]},`cat:${d.slug}`)}function sn(d){const e=H.c(4),{label:s,onClick:n}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Vs,{size:12}),e[0]=l):l=e[0];let r;return e[1]!==s||e[2]!==n?(r=t.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer rounded-lg",children:l}),e[1]=s,e[2]=n,e[3]=r):r=e[3],r}function Ea(d){const e=H.c(18),{checked:s,disabled:n,onToggle:l}=d,r=q();let a;e[0]!==l?(a=()=>l(),e[0]=l,e[1]=a):a=e[1];let i;e[2]!==s||e[3]!==r?(i=r(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=r,e[4]=i):i=e[4];let x;e[5]!==s||e[6]!==n||e[7]!==a||e[8]!==i?(x=t.jsx(et,{asChild:!0,children:t.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Oa,children:t.jsx(ks,{checked:s,disabled:n,onCheckedChange:a,"aria-label":i})})}),e[5]=s,e[6]=n,e[7]=a,e[8]=i,e[9]=x):x=e[9];let u;e[10]!==s||e[11]!==r?(u=r(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=r,e[12]=u):u=e[12];let c;e[13]!==u?(c=t.jsx(tt,{side:"bottom",children:u}),e[13]=u,e[14]=c):c=e[14];let p;return e[15]!==x||e[16]!==c?(p=t.jsxs(st,{children:[x,c]}),e[15]=x,e[16]=c,e[17]=p):p=e[17],p}function Oa(d){return d.stopPropagation()}function Ia(d){const e=H.c(42),{count:s,allSelected:n,onToggleSelectAll:l,onArchive:r,onExit:a}=d,i=q();let x;e[0]!==n||e[1]!==l?(x=t.jsx(Ea,{checked:n,onToggle:l}),e[0]=n,e[1]=l,e[2]=x):x=e[2];let u;e[3]!==s||e[4]!==i?(u=i("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==u?(c=t.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=c):c=e[7];const p=s===0;let g;e[8]!==i?(g=i("sandbox.postToolbar.archiveSelectedPosts"),e[8]=i,e[9]=g):g=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Cn,{size:14}),e[10]=m):m=e[10];let o;e[11]!==r||e[12]!==p||e[13]!==g?(o=t.jsx(et,{asChild:!0,children:t.jsx(le,{type:"button",variant:"ghost",size:"icon-sm",disabled:p,onClick:r,"aria-label":g,children:m})}),e[11]=r,e[12]=p,e[13]=g,e[14]=o):o=e[14];let b;e[15]!==i?(b=i("sandbox.postToolbar.archiveSelected"),e[15]=i,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(tt,{side:"bottom",children:b}),e[17]=b,e[18]=y):y=e[18];let w;e[19]!==o||e[20]!==y?(w=t.jsxs(st,{children:[o,y]}),e[19]=o,e[20]=y,e[21]=w):w=e[21];let C;e[22]!==i?(C=i("sandbox.postToolbar.exitSelection"),e[22]=i,e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Vs,{size:14}),e[24]=S):S=e[24];let N;e[25]!==a||e[26]!==C?(N=t.jsx(et,{asChild:!0,children:t.jsx(le,{type:"button",variant:"ghost",size:"icon-sm",onClick:a,"aria-label":C,children:S})}),e[25]=a,e[26]=C,e[27]=N):N=e[27];let T;e[28]!==i?(T=i("sandbox.postToolbar.exitSelection"),e[28]=i,e[29]=T):T=e[29];let _;e[30]!==T?(_=t.jsx(tt,{side:"bottom",children:T}),e[30]=T,e[31]=_):_=e[31];let P;e[32]!==N||e[33]!==_?(P=t.jsxs(st,{children:[N,_]}),e[32]=N,e[33]=_,e[34]=P):P=e[34];let h;e[35]!==w||e[36]!==P?(h=t.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[w,P]}),e[35]=w,e[36]=P,e[37]=h):h=e[37];let k;return e[38]!==x||e[39]!==h||e[40]!==c?(k=t.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[x,c,h]}),e[38]=x,e[39]=h,e[40]=c,e[41]=k):k=e[41],k}const Ra={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},bs="generating",Ma=[bs,...js.filter(d=>d!==bs)],Rs=d=>d.scheduledDatetime||d.date||"",Ka=(d,e)=>Rs(e).localeCompare(Rs(d)),Ms=d=>d==="scheduled"||d==="published",nn="application/x-post-key";function Ro(d){const e=H.c(191),{orgSlug:s,virtualMcpId:n,branch:l,decofile:r,view:a,selectedKey:i,onViewChange:x,onOpen:u,onClose:c,move:p,meta:g,renderDetail:m}=d,o=q();let b;e[0]!==l||e[1]!==s||e[2]!==n?(b={orgSlug:s,virtualMcpId:n,branch:l},e[0]=l,e[1]=s,e[2]=n,e[3]=b):b=e[3];const y=en(b),w=ua().length>0,C=na(),S=Js(),N=aa(n),T=C&&!N,[_,P]=R.useState(null),[h,k]=R.useState(!1),[B,L]=R.useState(!1),[$,D]=R.useState(!1),[A,F]=R.useState(""),E=R.useRef(null);let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={},e[4]=O):O=e[4];const[v,K]=R.useState(O);let U;e[5]!==v?(U=(f,j)=>v[f]??j,e[5]=v,e[6]=U):U=e[6];const Y=U;let V;e[7]===Symbol.for("react.memo_cache_sentinel")?(V=(f,j)=>K(I=>({...I,[f]:j})),e[7]=V):V=e[7];const X=V;let J;e[8]!==u?(J=f=>{const j=f[0];j&&u(j)},e[8]=u,e[9]=J):J=e[9];let te;e[10]!==l||e[11]!==r||e[12]!==g||e[13]!==s||e[14]!==J||e[15]!==n?(te={orgSlug:s,virtualMcpId:n,branch:l,decofile:r,meta:g,onStarted:J},e[10]=l,e[11]=r,e[12]=g,e[13]=s,e[14]=J,e[15]=n,e[16]=te):te=e[16];const fe=Ba(te),Q=Kn(r);let se;e[17]!==r?(se=f=>Hn(r[f],"posts"),e[17]=r,e[18]=se):se=e[18];const ue=se;let ne;e[19]!==l||e[20]!==s||e[21]!==n?(ne={orgSlug:s,virtualMcpId:n,branch:l},e[19]=l,e[20]=s,e[21]=n,e[22]=ne):ne=e[22];const Z=pa(ne),pe=ha(n,l),ce=pe.kind==="protocol"&&pe.source==="github";let ae;e[23]!==l||e[24]!==s||e[25]!==n?(ae={orgSlug:s,virtualMcpId:n,branch:l},e[23]=l,e[24]=s,e[25]=n,e[26]=ae):ae=e[26];const de=fa(ae),[W,ee]=R.useState(null),z=Q.filter(Qa);let me;e[27]!==Z||e[28]!==c||e[29]!==i||e[30]!==o?(me=async f=>{try{await Z.move({writes:{},deletes:f})}catch(j){const I=j;return I instanceof ga||re.error(I instanceof Error?I.message:o("sandbox.postEditor.deletePostFailed")),!1}return i&&f.includes(i)&&c?.(),!0},e[27]=Z,e[28]=c,e[29]=i,e[30]=o,e[31]=me):me=e[31];const Cs=me,qt=async()=>{if(W?.kind==="post"){const{post:f}=W;await Cs([f.key])&&re.success(o("sandbox.postEditor.deletePostSuccess",{title:f.title}))}else if(W?.kind==="archived"){const f=z.filter(j=>!p.isMoving(j.key)).map(Ya);f.length>0&&await Cs(f)&&re.success(o("sandbox.postBoard.deletedArchived",{count:String(f.length)}))}ee(null)},Jt=W?.kind==="archived"?{title:o("sandbox.postBoard.deleteArchivedConfirmTitle"),description:o(As("archivedPosts",ce,{neverPublished:z.every(f=>de(f.key))}),{count:String(z.length)}),confirmLabel:o("sandbox.postBoard.deleteArchivedConfirm")}:{title:o("sandbox.postEditor.deletePostConfirmTitle"),description:W?o(As("post",ce,{neverPublished:de(W.post.key),live:Ms(W.post.status)}),{title:W.post.title}):"",confirmLabel:o("sandbox.postEditor.deletePost")},[nt,on]=R.useState(null),[at,ln]=R.useState(null),[ot,rn]=R.useState(null),[he,cn]=R.useState("date-desc"),[Ss,dn]=R.useState("");let ct;e[32]===Symbol.for("react.memo_cache_sentinel")?(ct=new Set,e[32]=ct):ct=e[32];const[ge,dt]=R.useState(ct),un=Q.reduce(Wa,{}),Ps=f=>{const j=new Map;for(const I of Q)for(const xe of f(I))j.set(xe,(j.get(xe)??0)+1);return j},mn=Ps(Va),xn=Ps(Ua),fn=fs(r,"categories").map(f=>{const{payload:j}=f;return{slug:oe(j.slug),name:oe(j.name)||oe(j.slug),count:mn.get(oe(j.slug))??0}}),pn=fs(r,"authors").map(f=>{const{payload:j}=f;return{email:oe(j.email),name:oe(j.name)||oe(j.email),count:xn.get(oe(j.email))??0}}),es=Ss.trim().toLowerCase();let ut;e[33]!==nt?(ut=f=>!nt||f.categorySlugs.includes(nt),e[33]=nt,e[34]=ut):ut=e[34];let mt;e[35]!==at?(mt=f=>!at||f.authorEmails.includes(at),e[35]=at,e[36]=mt):mt=e[36];let xt;e[37]!==ot?(xt=f=>!ot||f.status===ot,e[37]=ot,e[38]=xt):xt=e[38];let ft;e[39]!==he?(ft=(f,j)=>{if(he==="az")return f.title.localeCompare(j.title);if(he==="za")return j.title.localeCompare(f.title);const I=(f.scheduledDatetime||f.date).localeCompare(j.scheduledDatetime||j.date);return he==="date-asc"?I:-I},e[39]=he,e[40]=ft):ft=e[40];const be=Q.filter(ut).filter(mt).filter(xt).filter(f=>!es||f.title.toLowerCase().includes(es)||f.slug.toLowerCase().includes(es)).sort(ft),ts=i&&Q.some(f=>f.key===i)?i:be[0]?.key??null,Ts=ge.size>0;let pt;e[41]===Symbol.for("react.memo_cache_sentinel")?(pt=f=>dt(j=>{const I=new Set(j);return I.delete(f)||I.add(f),I}),e[41]=pt):pt=e[41];const gn=pt,hn=()=>dt(f=>be.every(j=>f.has(j.key))?new Set:new Set(be.map(Ha)));let gt;e[42]!==p||e[43]!==ge||e[44]!==o?(gt=async()=>{let f=0;for(const j of ge)await p.apply(j,"archived")&&(f=f+1);dt(new Set),f>0&&re.success(o("sandbox.postBoard.archived"))},e[42]=p,e[43]=ge,e[44]=o,e[45]=gt):gt=e[45];const bn=gt;let ht;e[46]!==p?(ht=(f,j)=>{P(null),p.apply(j,f)},e[46]=p,e[47]=ht):ht=e[47];const jn=ht;let bt;e[48]!==N||e[49]!==u||e[50]!==y?(bt=()=>{const f=ms(xs()),j=Ys({title:"",now:new Date,legacyContent:N});y.mutate({blockKey:f,data:rt(f,j)}),u(f)},e[48]=N,e[49]=u,e[50]=y,e[51]=bt):bt=e[51];const jt=bt;let yt;e[52]!==S||e[53]!==N||e[54]!==g?(yt=f=>{if(N){const{title:xe,content:G}=ra(f);return G||xe.trim()?{title:xe,body:{content:G}}:null}const j=ca(f),I=da(j.sections,Qs(g,{hideDefaults:S}));return I.length>0||j.title.trim()?{title:j.title,body:{sections:I}}:null},e[52]=S,e[53]=N,e[54]=g,e[55]=yt):yt=e[55];const yn=yt,vn=()=>{const f=yn(A);if(!f){re.error(o("sandbox.postBoard.importEmpty"));return}const j=ms(xs()),I=ia({...f,takenSlugs:Q.map(Ga).filter(Boolean),now:new Date});y.mutate({blockKey:j,data:rt(j,I)}),D(!1),F(""),re.success(o("sandbox.postBoard.imported")),u(j)},ss=a==="list";let je;e[56]!==x?(je=()=>x("list"),e[56]=x,e[57]=je):je=e[57];let vt;e[58]===Symbol.for("react.memo_cache_sentinel")?(vt=t.jsx(qn,{size:14}),e[58]=vt):vt=e[58];let ye;e[59]!==o?(ye=o("sandbox.postBoard.viewList"),e[59]=o,e[60]=ye):ye=e[60];let ve;e[61]!==ss||e[62]!==je||e[63]!==ye?(ve=t.jsx(Ks,{active:ss,onClick:je,icon:vt,label:ye}),e[61]=ss,e[62]=je,e[63]=ye,e[64]=ve):ve=e[64];const ns=a==="board";let Ne;e[65]!==x?(Ne=()=>x("board"),e[65]=x,e[66]=Ne):Ne=e[66];let Nt;e[67]===Symbol.for("react.memo_cache_sentinel")?(Nt=t.jsx(Wn,{size:14}),e[67]=Nt):Nt=e[67];let ke;e[68]!==o?(ke=o("sandbox.postBoard.viewBoard"),e[68]=o,e[69]=ke):ke=e[69];let we;e[70]!==ns||e[71]!==Ne||e[72]!==ke?(we=t.jsx(Ks,{active:ns,onClick:Ne,icon:Nt,label:ke}),e[70]=ns,e[71]=Ne,e[72]=ke,e[73]=we):we=e[73];let kt;e[74]!==ve||e[75]!==we?(kt=t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[ve,we]})}),e[74]=ve,e[75]=we,e[76]=kt):kt=e[76];let wt;e[77]===Symbol.for("react.memo_cache_sentinel")?(wt=t.jsx(ta,{size:14}),e[77]=wt):wt=e[77];let Ce;e[78]!==o?(Ce=o("sandbox.postBoard.newPost"),e[78]=o,e[79]=Ce):Ce=e[79];let Ct;e[80]===Symbol.for("react.memo_cache_sentinel")?(Ct=t.jsx(ps,{size:14}),e[80]=Ct):Ct=e[80];let Se;e[81]!==Ce?(Se=t.jsx(Ut,{asChild:!0,children:t.jsxs(le,{type:"button",size:"sm",children:[wt,Ce,Ct]})}),e[81]=Ce,e[82]=Se):Se=e[82];let Pe;e[83]!==T||e[84]!==o?(Pe=T&&t.jsxs(ie,{onClick:()=>L(!0),children:[t.jsx(hs,{size:14}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:o("sandbox.postBoard.newPostGenerate")}),t.jsx("span",{className:"text-xs text-muted-foreground",children:o("sandbox.postBoard.newPostGenerateHint")})]})]}),e[83]=T,e[84]=o,e[85]=Pe):Pe=e[85];let St;e[86]===Symbol.for("react.memo_cache_sentinel")?(St=t.jsx(ea,{size:14}),e[86]=St):St=e[86];let Te;e[87]!==o?(Te=o("sandbox.postBoard.newPostWrite"),e[87]=o,e[88]=Te):Te=e[88];let De;e[89]!==Te?(De=t.jsx("span",{children:Te}),e[89]=Te,e[90]=De):De=e[90];let _e;e[91]!==o?(_e=o("sandbox.postBoard.newPostWriteHint"),e[91]=o,e[92]=_e):_e=e[92];let Be;e[93]!==_e?(Be=t.jsx("span",{className:"text-xs text-muted-foreground",children:_e}),e[93]=_e,e[94]=Be):Be=e[94];let Ae;e[95]!==De||e[96]!==Be?(Ae=t.jsxs("div",{className:"flex flex-col",children:[De,Be]}),e[95]=De,e[96]=Be,e[97]=Ae):Ae=e[97];let Le;e[98]!==Ae||e[99]!==jt?(Le=t.jsxs(ie,{onClick:jt,children:[St,Ae]}),e[98]=Ae,e[99]=jt,e[100]=Le):Le=e[100];let Pt,Tt;e[101]===Symbol.for("react.memo_cache_sentinel")?(Pt=()=>D(!0),Tt=t.jsx(rs,{size:14}),e[101]=Pt,e[102]=Tt):(Pt=e[101],Tt=e[102]);let ze;e[103]!==o?(ze=o("sandbox.postBoard.importContent"),e[103]=o,e[104]=ze):ze=e[104];let Fe;e[105]!==ze?(Fe=t.jsx("span",{children:ze}),e[105]=ze,e[106]=Fe):Fe=e[106];let $e;e[107]!==o?($e=o("sandbox.postBoard.importContentHint"),e[107]=o,e[108]=$e):$e=e[108];let Ee;e[109]!==$e?(Ee=t.jsx("span",{className:"text-xs text-muted-foreground",children:$e}),e[109]=$e,e[110]=Ee):Ee=e[110];let Oe;e[111]!==Fe||e[112]!==Ee?(Oe=t.jsxs(ie,{onClick:Pt,children:[Tt,t.jsxs("div",{className:"flex flex-col",children:[Fe,Ee]})]}),e[111]=Fe,e[112]=Ee,e[113]=Oe):Oe=e[113];let Ie;e[114]!==Pe||e[115]!==Le||e[116]!==Oe?(Ie=t.jsxs(Vt,{align:"end",className:"w-56",children:[Pe,Le,Oe]}),e[114]=Pe,e[115]=Le,e[116]=Oe,e[117]=Ie):Ie=e[117];let Dt;e[118]!==Se||e[119]!==Ie?(Dt=t.jsxs(Wt,{children:[Se,Ie]}),e[118]=Se,e[119]=Ie,e[120]=Dt):Dt=e[120];let _t;e[121]!==T||e[122]!==r||e[123]!==B||e[124]!==fe||e[125]!==w||e[126]!==n?(_t=T&&t.jsx(Pa,{virtualMcpId:n,open:B,onOpenChange:L,decofile:r,hasAi:w,onGenerate:f=>{fe(f)}}),e[121]=T,e[122]=r,e[123]=B,e[124]=fe,e[125]=w,e[126]=n,e[127]=_t):_t=e[127];let Re;e[128]!==o?(Re=o("sandbox.postBoard.importTitle"),e[128]=o,e[129]=Re):Re=e[129];let Me;e[130]!==Re?(Me=t.jsx(us,{children:Re}),e[130]=Re,e[131]=Me):Me=e[131];let Ke;e[132]!==o?(Ke=o("sandbox.postBoard.importDescription"),e[132]=o,e[133]=Ke):Ke=e[133];let Ge;e[134]!==Ke?(Ge=t.jsx(Hs,{children:Ke}),e[134]=Ke,e[135]=Ge):Ge=e[135];let Bt;e[136]!==Me||e[137]!==Ge?(Bt=t.jsxs(Gs,{children:[Me,Ge]}),e[136]=Me,e[137]=Ge,e[138]=Bt):Bt=e[138];const as=la(A)?"html":"markdown";let At;e[139]===Symbol.for("react.memo_cache_sentinel")?(At=f=>F(f??""),e[139]=At):At=e[139];let He;e[140]!==A||e[141]!==as?(He=t.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:t.jsx(va,{code:A,language:as,height:"100%",autoFocus:!0,onChange:At})}),e[140]=A,e[141]=as,e[142]=He):He=e[142];let Lt;e[143]===Symbol.for("react.memo_cache_sentinel")?(Lt=t.jsx("input",{ref:E,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async f=>{const j=f.target.files?.[0];j&&F(await j.text()),f.target.value=""}}),e[143]=Lt):Lt=e[143];let zt,Ft;e[144]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>E.current?.click(),Ft=t.jsx(rs,{size:14}),e[144]=zt,e[145]=Ft):(zt=e[144],Ft=e[145]);let Ue;e[146]!==o?(Ue=o("sandbox.postBoard.importUpload"),e[146]=o,e[147]=Ue):Ue=e[147];let Ve;e[148]!==Ue?(Ve=t.jsxs(le,{type:"button",variant:"outline",size:"sm",onClick:zt,children:[Ft,Ue]}),e[148]=Ue,e[149]=Ve):Ve=e[149];let $t;e[150]!==He||e[151]!==Ve?($t=t.jsxs("div",{className:"space-y-3",children:[He,Lt,Ve]}),e[150]=He,e[151]=Ve,e[152]=$t):$t=e[152];let Et;e[153]!==A?(Et=A.trim(),e[153]=A,e[154]=Et):Et=e[154];let Ot;e[155]===Symbol.for("react.memo_cache_sentinel")?(Ot=t.jsx(rs,{size:14}),e[155]=Ot):Ot=e[155];let It;e[156]!==o?(It=o("sandbox.postBoard.importRun"),e[156]=o,e[157]=It):It=e[157];let Rt;e[158]!==h||e[159]!==c||e[160]!==m||e[161]!==i||e[162]!==a?(Rt=a==="board"&&i&&h&&m&&t.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:m(i,{expanded:!0,onToggleExpand:()=>k(!1),onClose:()=>{k(!1),c?.()}})}),e[158]=h,e[159]=c,e[160]=m,e[161]=i,e[162]=a,e[163]=Rt):Rt=e[163];const os=a==="board"&&!!i&&!h;let We;e[164]!==c?(We=f=>{f||(k(!1),c?.())},e[164]=c,e[165]=We):We=e[165];let Ye;e[166]!==o?(Ye=o("sandbox.collectionsSidebar.posts"),e[166]=o,e[167]=Ye):Ye=e[167];let Qe;e[168]!==Ye?(Qe=t.jsx(us,{className:"sr-only",children:Ye}),e[168]=Ye,e[169]=Qe):Qe=e[169];let Xe;e[170]!==c||e[171]!==m||e[172]!==i?(Xe=i&&m?t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(gs,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(i,{expanded:!1,onToggleExpand:()=>k(!0),onClose:()=>c?.()})}):null,e[170]=c,e[171]=m,e[172]=i,e[173]=Xe):Xe=e[173];let Ze;e[174]!==Qe||e[175]!==Xe?(Ze=t.jsxs(ds,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[Qe,Xe]}),e[174]=Qe,e[175]=Xe,e[176]=Ze):Ze=e[176];let Mt;e[177]!==os||e[178]!==We||e[179]!==Ze?(Mt=t.jsx(cs,{open:os,onOpenChange:We,children:Ze}),e[177]=os,e[178]=We,e[179]=Ze,e[180]=Mt):Mt=e[180];const ls=W!==null;let qe;e[181]!==ee?(qe=()=>ee(null),e[181]=ee,e[182]=qe):qe=e[182];let Je;e[183]!==qt?(Je=()=>{qt()},e[183]=qt,e[184]=Je):Je=e[184];let Kt;return e[185]!==Z.isPending||e[186]!==Jt||e[187]!==ls||e[188]!==qe||e[189]!==Je?(Kt=t.jsx(oa,{open:ls,onCancel:qe,onConfirm:Je,pending:Z.isPending,...Jt}),e[185]=Z.isPending,e[186]=Jt,e[187]=ls,e[188]=qe,e[189]=Je,e[190]=Kt):Kt=e[190],t.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[kt,t.jsxs("div",{className:"flex items-center gap-2",children:[Dt,_t,t.jsx(cs,{open:$,onOpenChange:D,children:t.jsxs(ds,{className:"max-h-[85vh] sm:max-w-2xl",children:[Bt,$t,t.jsx(Us,{children:t.jsxs(le,{type:"button",disabled:!Et,onClick:vn,children:[Ot,It]})})]})})]})]}),Q.length===0?t.jsx(sa,{className:"flex-1",icon:t.jsx(hs,{size:22}),title:o("sandbox.postBoard.emptyTitle"),description:o("sandbox.postBoard.emptyDescription"),buttonProps:{children:o("sandbox.postBoard.newPost"),onClick:jt}}):a==="board"?t.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:Ma.map(f=>{const j=o(Qt[f]),I=Q.filter(G=>G.status===f);Ms(f)&&I.sort(Ka);const xe=Y(f,I.length===0);return t.jsxs(R.Fragment,{children:[t.jsx("div",{onDragOver:G=>{G.preventDefault(),P(f)},onDragLeave:()=>P(G=>G===f?null:G),onDrop:G=>{G.preventDefault(),jn(f,G.dataTransfer.getData(nn))},className:M("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",xe?"w-11":"w-72",_===f&&"border-primary bg-primary/5"),children:xe?t.jsxs("button",{type:"button",onClick:()=>X(f,!1),"aria-label":o("sandbox.postBoard.expandLane",{lane:j}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[t.jsx(Sn,{size:14,className:"shrink-0"}),t.jsx("span",{className:"text-xs tabular-nums",children:I.length}),t.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:j})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[t.jsxs("button",{type:"button",onClick:()=>X(f,!0),"aria-label":o("sandbox.postBoard.collapseLane",{lane:j}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[t.jsx(ps,{size:14,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:j})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:I.length}),f==="archived"&&I.length>0&&t.jsx(le,{variant:"ghost-destructive",size:"icon-xs",type:"button",disabled:Z.isPending,"aria-label":o("sandbox.postBoard.deleteArchived"),title:o("sandbox.postBoard.deleteArchived"),onClick:()=>ee({kind:"archived"}),children:t.jsx(vs,{className:"size-3.25"})})]})]}),t.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:I.length===0?t.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:o("sandbox.postBoard.laneEmpty")}):I.map(G=>t.jsx(qa,{post:G,payload:ue(G.key),moving:p.isMoving(G.key),onOpen:()=>u(G.key),onDelete:Xs(G.status)?()=>ee({kind:"post",post:G}):void 0},G.key))})]})}),f===bs&&t.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},f)})}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:M("flex flex-col",m?"w-80 shrink-0 border-r":"min-w-0 flex-1"),children:[t.jsx(La,{value:Ss,onChange:dn}),Ts?t.jsx(Ia,{count:ge.size,allSelected:be.length>0&&be.every(f=>ge.has(f.key)),onToggleSelectAll:hn,onArchive:()=>{bn()},onExit:()=>dt(new Set)}):t.jsx(za,{categories:fn,authors:pn,statusCounts:un,categoryFilter:nt,authorFilter:at,statusFilter:ot,sort:he,onCategoryFilterChange:on,onAuthorFilterChange:ln,onStatusFilterChange:rn,onSortChange:cn}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(Xa,{posts:be,selectedKey:m?ts:null,selectionActive:Ts,selectedKeys:ge,onToggleSelect:gn,onOpen:u,isMoving:p.isMoving,onDelete:f=>ee({kind:"post",post:f})})})]}),m&&t.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ts?t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(gs,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(ts)}):t.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:o("sandbox.postBoard.selectPrompt")})})]}),Rt,Mt,Kt]})}function Ga(d){return d.slug}function Ha(d){return d.key}function Ua(d){return d.authorEmails}function Va(d){return d.categorySlugs}function Wa(d,e){return d[e.status]=(d[e.status]??0)+1,d}function Ya(d){return d.key}function Qa(d){return d.status==="archived"}function Ks(d){const e=H.c(7),{active:s,onClick:n,icon:l,label:r}=d,a=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let i;e[0]!==a?(i=M("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",a),e[0]=a,e[1]=i):i=e[1];let x;return e[2]!==l||e[3]!==r||e[4]!==n||e[5]!==i?(x=t.jsxs("button",{type:"button",onClick:n,className:i,children:[l,r]}),e[2]=l,e[3]=r,e[4]=n,e[5]=i,e[6]=x):x=e[6],x}function Xa(d){const e=H.c(23),{posts:s,selectedKey:n,selectionActive:l,selectedKeys:r,onToggleSelect:a,onOpen:i,isMoving:x,onDelete:u}=d,c=q();if(s.length===0){let m;e[0]!==c?(m=c("sandbox.postList.noMatches"),e[0]=c,e[1]=m):m=e[1];let o;return e[2]!==m?(o=t.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=o):o=e[3],o}let p;if(e[4]!==x||e[5]!==u||e[6]!==i||e[7]!==a||e[8]!==s||e[9]!==n||e[10]!==r||e[11]!==l){let m;e[13]!==x||e[14]!==u||e[15]!==i||e[16]!==a||e[17]!==n||e[18]!==r||e[19]!==l?(m=o=>t.jsx(Za,{post:o,selected:o.key===n,selectionActive:l,checked:r.has(o.key),onToggleSelect:()=>a(o.key),moving:x(o.key),onOpen:()=>i(o.key),onDelete:Xs(o.status)&&o.key!==n?()=>u(o):void 0},o.key),e[13]=x,e[14]=u,e[15]=i,e[16]=a,e[17]=n,e[18]=r,e[19]=l,e[20]=m):m=e[20],p=s.map(m),e[4]=x,e[5]=u,e[6]=i,e[7]=a,e[8]=s,e[9]=n,e[10]=r,e[11]=l,e[12]=p}else p=e[12];let g;return e[21]!==p?(g=t.jsx("ul",{className:"divide-y",children:p}),e[21]=p,e[22]=g):g=e[22],g}function Za(d){const e=H.c(60),{post:s,selected:n,selectionActive:l,checked:r,onToggleSelect:a,moving:i,onOpen:x,onDelete:u}=d,c=q(),p=s.status==="awaiting_review"&&s.missing.length>0,g=s.status==="scheduled"||s.status==="published",m=l||r?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let o;e[0]!==m?(o=M("absolute left-3 top-3 z-10 transition-opacity",m),e[0]=m,e[1]=o):o=e[1];let b;e[2]!==a?(b=()=>a(),e[2]=a,e[3]=b):b=e[3];let y;e[4]!==s.title||e[5]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=c,e[6]=y):y=e[6];let w;e[7]!==r||e[8]!==b||e[9]!==y?(w=t.jsx(ks,{checked:r,onCheckedChange:b,"aria-label":y}),e[7]=r,e[8]=b,e[9]=y,e[10]=w):w=e[10];let C;e[11]!==o||e[12]!==w?(C=t.jsx("span",{className:o,children:w}),e[11]=o,e[12]=w,e[13]=C):C=e[13];let S;e[14]!==i||e[15]!==u||e[16]!==l?(S=u&&!l&&t.jsx(an,{onDelete:u,disabled:i,className:"top-2.5"}),e[14]=i,e[15]=u,e[16]=l,e[17]=S):S=e[17];let N;e[18]!==x||e[19]!==a||e[20]!==l?(N=()=>l?a():x(),e[18]=x,e[19]=a,e[20]=l,e[21]=N):N=e[21];const T=n?"bg-accent text-accent-foreground":"bg-card hover:bg-accent";let _;e[22]!==T?(_=M("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",T),e[22]=T,e[23]=_):_=e[23];let P;e[24]!==s.title||e[25]!==c?(P=s.title||c("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=c,e[26]=P):P=e[26];let h;e[27]!==P?(h=t.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:P}),e[27]=P,e[28]=h):h=e[28];const k=Ra[s.status],B=Qt[s.status];let L;e[29]!==c||e[30]!==B?(L=c(B),e[29]=c,e[30]=B,e[31]=L):L=e[31];let $;e[32]!==k||e[33]!==L?($=t.jsx(Ns,{variant:k,className:"shrink-0",children:L}),e[32]=k,e[33]=L,e[34]=$):$=e[34];let D;e[35]!==p||e[36]!==s.missing?(D=p&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(Yt,{size:12}),s.missing.length]}),e[35]=p,e[36]=s.missing,e[37]=D):D=e[37];let A;e[38]!==s.duplicateTitle||e[39]!==c?(A=s.duplicateTitle&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:c("sandbox.postBoard.duplicateTitle"),children:[t.jsx(ys,{size:12,"aria-hidden":!0}),t.jsx("span",{className:"sr-only",children:c("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=c,e[40]=A):A=e[40];let F;e[41]!==g||e[42]!==s.date||e[43]!==s.scheduledDatetime?(F=g&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[t.jsx(Zs,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=g,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=F):F=e[44];let E;e[45]!==$||e[46]!==D||e[47]!==A||e[48]!==F?(E=t.jsxs("div",{className:"flex items-center gap-2",children:[$,D,A,F]}),e[45]=$,e[46]=D,e[47]=A,e[48]=F,e[49]=E):E=e[49];let O;e[50]!==n||e[51]!==_||e[52]!==h||e[53]!==E||e[54]!==N?(O=t.jsxs("button",{type:"button",onClick:N,"aria-current":n,className:_,children:[h,E]}),e[50]=n,e[51]=_,e[52]=h,e[53]=E,e[54]=N,e[55]=O):O=e[55];let v;return e[56]!==O||e[57]!==C||e[58]!==S?(v=t.jsxs("li",{className:"group/row relative",children:[C,S,O]}),e[56]=O,e[57]=C,e[58]=S,e[59]=v):v=e[59],v}function qa(d){const e=H.c(50),{post:s,payload:n,moving:l,onOpen:r,onDelete:a}=d,i=q(),x=s.status!=="generating"&&!l;let u;e[0]!==n?(u=Gn(n),e[0]=n,e[1]=u):u=e[1];const c=u,p=!x&&"opacity-80";let g;e[2]!==p?(g=M("group/card relative rounded-lg bg-card shadow-edge transition-shadow hover:shadow-lift",p),e[2]=p,e[3]=g):g=e[3];let m;e[4]!==l||e[5]!==a?(m=a&&t.jsx(an,{onDelete:a,disabled:l,className:"top-2"}),e[4]=l,e[5]=a,e[6]=m):m=e[6];let o;e[7]!==s.key?(o=L=>L.dataTransfer.setData(nn,s.key),e[7]=s.key,e[8]=o):o=e[8];const b=x?"cursor-grab active:cursor-grabbing":"cursor-pointer";let y;e[9]!==b?(y=M("block w-full p-3 text-left",b),e[9]=b,e[10]=y):y=e[10];let w;e[11]!==s.title||e[12]!==i?(w=s.title||i("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=i,e[13]=w):w=e[13];let C;e[14]!==w?(C=t.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:w}),e[14]=w,e[15]=C):C=e[15];let S;e[16]!==c||e[17]!==s.status?(S=s.status==="draft"&&c.format?.name&&t.jsx(Ns,{variant:"outline",className:"max-w-full truncate",children:c.format.name}),e[16]=c,e[17]=s.status,e[18]=S):S=e[18];let N;e[19]!==s.status||e[20]!==i?(N=s.status==="generating"&&t.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(gs,{size:12,className:"animate-spin"}),i("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=i,e[21]=N):N=e[21];let T;e[22]!==s.missing||e[23]!==s.status||e[24]!==i?(T=s.status==="awaiting_review"&&(s.missing.length>0?t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(Yt,{size:12}),i("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[t.jsx(Zn,{size:12}),i("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=i,e[25]=T):T=e[25];let _;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(_=(s.status==="scheduled"||s.status==="published")&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[t.jsx(Zs,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=_):_=e[29];let P;e[30]!==s.duplicateTitle||e[31]!==i?(P=s.duplicateTitle&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(ys,{size:12,"aria-hidden":!0}),i("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=i,e[32]=P):P=e[32];let h;e[33]!==S||e[34]!==N||e[35]!==T||e[36]!==_||e[37]!==P?(h=t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[S,N,T,_,P]}),e[33]=S,e[34]=N,e[35]=T,e[36]=_,e[37]=P,e[38]=h):h=e[38];let k;e[39]!==x||e[40]!==r||e[41]!==h||e[42]!==o||e[43]!==y||e[44]!==C?(k=t.jsxs("button",{type:"button",draggable:x,onDragStart:o,onClick:r,className:y,children:[C,h]}),e[39]=x,e[40]=r,e[41]=h,e[42]=o,e[43]=y,e[44]=C,e[45]=k):k=e[45];let B;return e[46]!==k||e[47]!==g||e[48]!==m?(B=t.jsxs("div",{className:g,children:[m,k]}),e[46]=k,e[47]=g,e[48]=m,e[49]=B):B=e[49],B}function an(d){const e=H.c(12),{onDelete:s,disabled:n,className:l}=d,r=q();let a;e[0]!==r?(a=r("sandbox.postBoard.delete"),e[0]=r,e[1]=a):a=e[1];const i=a;let x;e[2]!==s?(x=g=>{g.stopPropagation(),s()},e[2]=s,e[3]=x):x=e[3];let u;e[4]!==l?(u=M("absolute right-2 z-10 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[4]=l,e[5]=u):u=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(vs,{className:"size-3.25"}),e[6]=c):c=e[6];let p;return e[7]!==n||e[8]!==x||e[9]!==u||e[10]!==i?(p=t.jsx(le,{variant:"ghost-destructive",size:"icon-xs",type:"button",disabled:n,"aria-label":i,title:i,onClick:x,className:u,children:c}),e[7]=n,e[8]=x,e[9]=u,e[10]=i,e[11]=p):p=e[11],p}function Mo(d){const e=H.c(54),{icon:s,logoUrl:n,title:l,subtitle:r,active:a,accent:i,variantCount:x,trailing:u,selectable:c,selectionActive:p,selected:g,invalid:m,invalidReason:o,warning:b,warningReason:y,onToggleSelect:w,onClick:C,menu:S}=d,N=q(),T=i==="global";let _;e[0]!==s||e[1]!==a||e[2]!==T||e[3]!==n?(_=n?t.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):t.jsx("span",{className:M("flex size-8 shrink-0 items-center justify-center rounded-lg",T?"bg-global-section/15":"bg-muted"),children:t.jsx(s,{size:16,className:M("shrink-0",!T&&(a?"text-accent-foreground":"text-muted-foreground")),style:T?{color:Pn}:void 0})}),e[0]=s,e[1]=a,e[2]=T,e[3]=n,e[4]=_):_=e[4];const P=_,h=a?T?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":T?"hover:bg-global-section/10":"hover:bg-accent";let k;e[5]!==h?(k=M("group relative flex min-w-0 items-center rounded-md transition-colors",h),e[5]=h,e[6]=k):k=e[6];let B;e[7]!==w||e[8]!==c||e[9]!==g||e[10]!==p||e[11]!==N||e[12]!==l?(B=c&&t.jsx("span",{className:M("flex shrink-0 items-center pl-2.5 transition-opacity",g||p?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Ja,children:t.jsx(ks,{checked:g,onCheckedChange:()=>w?.(),"aria-label":N("sandbox.itemRow.selectItem",{title:l})})}),e[7]=w,e[8]=c,e[9]=g,e[10]=p,e[11]=N,e[12]=l,e[13]=B):B=e[13];const L=m&&!a&&"text-destructive";let $;e[14]!==L?($=M("block truncate text-sm font-medium",L),e[14]=L,e[15]=$):$=e[15];let D;e[16]!==$||e[17]!==l?(D=t.jsx("span",{className:$,children:l}),e[16]=$,e[17]=l,e[18]=D):D=e[18];const A=a?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==A?(F=M("block truncate text-xs",A),e[19]=A,e[20]=F):F=e[20];let E;e[21]!==r||e[22]!==F?(E=t.jsx("span",{className:F,children:r}),e[21]=r,e[22]=F,e[23]=E):E=e[23];let O;e[24]!==E||e[25]!==D?(O=t.jsxs("span",{className:"min-w-0 flex-1",children:[D,E]}),e[24]=E,e[25]=D,e[26]=O):O=e[26];let v;e[27]!==a||e[28]!==N||e[29]!==x?(v=x!==void 0&&x>1&&t.jsxs(st,{children:[t.jsx(et,{asChild:!0,children:t.jsxs("span",{className:M("flex shrink-0 items-center gap-1 text-xs font-medium",a?"text-accent-foreground/70":"text-muted-foreground"),children:[t.jsx(qs,{size:14}),x]})}),t.jsx(tt,{side:"bottom",children:N("sandbox.itemRow.variantCount",{count:x})})]}),e[27]=a,e[28]=N,e[29]=x,e[30]=v):v=e[30];let K;e[31]!==b||e[32]!==y?(K=b&&t.jsxs(st,{children:[t.jsx(et,{asChild:!0,children:t.jsx("span",{className:"flex shrink-0 items-center text-warning",children:t.jsx(Yt,{size:14})})}),y&&t.jsx(tt,{side:"bottom",children:y})]}),e[31]=b,e[32]=y,e[33]=K):K=e[33];let U;e[34]!==a||e[35]!==m||e[36]!==o?(U=m&&t.jsxs(st,{children:[t.jsx(et,{asChild:!0,children:t.jsx("span",{className:M("flex shrink-0 items-center",a?"text-accent-foreground":"text-destructive"),children:t.jsx(Yt,{size:14})})}),o&&t.jsx(tt,{side:"bottom",children:o})]}),e[34]=a,e[35]=m,e[36]=o,e[37]=U):U=e[37];let Y;e[38]!==C||e[39]!==P||e[40]!==O||e[41]!==v||e[42]!==K||e[43]!==U||e[44]!==u?(Y=t.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[P,O,v,K,U,u]}),e[38]=C,e[39]=P,e[40]=O,e[41]=v,e[42]=K,e[43]=U,e[44]=u,e[45]=Y):Y=e[45];let V;e[46]!==a||e[47]!==S?(V=S&&t.jsx("div",{className:M("pr-1 opacity-0 transition-opacity group-hover:opacity-100",a&&"opacity-100"),children:S}),e[46]=a,e[47]=S,e[48]=V):V=e[48];let X;return e[49]!==Y||e[50]!==V||e[51]!==k||e[52]!==B?(X=t.jsxs("div",{className:k,children:[B,Y,V]}),e[49]=Y,e[50]=V,e[51]=k,e[52]=B,e[53]=X):X=e[53],X}function Ja(d){return d.stopPropagation()}function Ko(d){const e=H.c(31),{onDuplicate:s,onRename:n,onAddVariant:l,onEditSeo:r,onViewJson:a,onDiscard:i,onDelete:x}=d,u=q();let c;e[0]!==u?(c=u("sandbox.itemActions.moreActions"),e[0]=u,e[1]=c):c=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Tn,{size:14}),e[2]=p):p=e[2];let g;e[3]!==c?(g=t.jsx(Ut,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":c,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:eo,children:p})}),e[3]=c,e[4]=g):g=e[4];let m;e[5]!==n||e[6]!==u?(m=n&&t.jsxs(ie,{onClick:n,children:[t.jsx(Na,{size:14}),u("sandbox.itemActions.rename")]}),e[5]=n,e[6]=u,e[7]=m):m=e[7];let o;e[8]!==s||e[9]!==u?(o=s&&t.jsxs(ie,{onClick:s,children:[t.jsx(ys,{size:14}),u("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=u,e[10]=o):o=e[10];let b;e[11]!==l||e[12]!==u?(b=l&&t.jsxs(t.Fragment,{children:[t.jsx(is,{}),t.jsxs(ie,{onClick:l,className:"cursor-pointer text-success focus:text-success",children:[t.jsx(qs,{size:14}),u("sandbox.itemActions.addVariant")]})]}),e[11]=l,e[12]=u,e[13]=b):b=e[13];let y;e[14]!==r||e[15]!==a||e[16]!==u?(y=(r||a)&&t.jsxs(t.Fragment,{children:[t.jsx(is,{}),r&&t.jsxs(ie,{onClick:r,children:[t.jsx(Yn,{size:14}),u("sandbox.itemActions.editSeo")]}),a&&t.jsxs(ie,{onClick:a,children:[t.jsx(Qn,{size:14}),u("sandbox.itemActions.viewJson")]})]}),e[14]=r,e[15]=a,e[16]=u,e[17]=y):y=e[17];let w;e[18]!==x||e[19]!==i||e[20]!==u?(w=(i||x)&&t.jsxs(t.Fragment,{children:[t.jsx(is,{}),i&&t.jsxs(ie,{onClick:i,children:[t.jsx(Xn,{size:14}),u("sandbox.itemActions.discardChanges")]}),x&&t.jsxs(ie,{onClick:x,className:"text-destructive focus:text-destructive",children:[t.jsx(vs,{size:14}),u("sandbox.itemActions.delete")]})]}),e[18]=x,e[19]=i,e[20]=u,e[21]=w):w=e[21];let C;e[22]!==m||e[23]!==o||e[24]!==b||e[25]!==y||e[26]!==w?(C=t.jsxs(Vt,{align:"end",className:"w-44",children:[m,o,b,y,w]}),e[22]=m,e[23]=o,e[24]=b,e[25]=y,e[26]=w,e[27]=C):C=e[27];let S;return e[28]!==g||e[29]!==C?(S=t.jsxs(Wt,{children:[g,C]}),e[28]=g,e[29]=C,e[30]=S):S=e[30],S}function eo(d){return d.stopPropagation()}export{zo as C,Mo as I,Lo as L,Ro as P,Ko as a,Fo as b,Xt as d,Io as g,Oo as r,Eo as s,$o as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,a6 as c,an as u,K as f,i as y,q as A,e as m,j as T}from"./index-Cdi-Ldg8.js";function R(){const t=r.c(7),{org:e}=c(),i=u();let n;t[0]!==e.id?(n=f.jiraIntegration(e.id),t[0]=e.id,t[1]=n):n=t[1];let s;t[2]!==i?(s=async()=>(await i.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=i,t[3]=s):s=t[3];let a;return t[4]!==n||t[5]!==s?(a={queryKey:n,queryFn:s},t[4]=n,t[5]=s,t[6]=a):a=t[6],y(a)}function _(){const t=r.c(8),{org:e}=c(),i=u(),n=A();let s;t[0]!==i?(s=async l=>(await i.call("JIRA_INTEGRATION_UPSERT",l)).integration,t[0]=i,t[1]=s):s=t[1];let a;t[2]!==e||t[3]!==n?(a=()=>n.invalidateQueries({queryKey:f.jiraIntegration(e.id)}),t[2]=e,t[3]=n,t[4]=a):a=t[4];let o;return t[5]!==s||t[6]!==a?(o={mutationFn:s,onSettled:a},t[5]=s,t[6]=a,t[7]=o):o=t[7],m(o)}function g(){const t=r.c(8),{org:e}=c(),i=u(),n=A();let s;t[0]!==i?(s=()=>i.call("JIRA_INTEGRATION_DELETE",{}),t[0]=i,t[1]=s):s=t[1];let a;t[2]!==e||t[3]!==n?(a=()=>n.invalidateQueries({queryKey:f.jiraIntegration(e.id)}),t[2]=e,t[3]=n,t[4]=a):a=t[4];let o;return t[5]!==s||t[6]!==a?(o={mutationFn:s,onSettled:a},t[5]=s,t[6]=a,t[7]=o):o=t[7],m(o)}function J(t,e){const i=r.c(10),n=e===void 0?"":e,{org:s}=c(),a=u();let o;i[0]!==s.id||i[1]!==n?(o=f.jiraBoards(s.id,n),i[0]=s.id,i[1]=n,i[2]=o):o=i[2];let l;i[3]!==n||i[4]!==a?(l=async()=>(await a.call("JIRA_BOARDS_LIST",n?{query:n}:{})).boards,i[3]=n,i[4]=a,i[5]=l):l=i[5];let d;return i[6]!==t||i[7]!==o||i[8]!==l?(d={queryKey:o,enabled:t,staleTime:6e4,queryFn:l},i[6]=t,i[7]=o,i[8]=l,i[9]=d):d=i[9],y(d)}function q(t){const e=r.c(10),{org:i}=c(),n=u();let s;e[0]!==t||e[1]!==i.id?(s=f.jiraBoardColumns(i.id,t),e[0]=t,e[1]=i.id,e[2]=s):s=e[2];const a=t!==null;let o;e[3]!==t||e[4]!==n?(o=async()=>(await n.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=n,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==a||e[8]!==o?(l={queryKey:s,enabled:a,staleTime:6e4,queryFn:o},e[6]=s,e[7]=a,e[8]=o,e[9]=l):l=e[9],y(l)}function S(){const t=r.c(7),{org:e}=c(),i=u();let n;t[0]!==e.id?(n=f.jiraAutomations(e.id),t[0]=e.id,t[1]=n):n=t[1];let s;t[2]!==i?(s=async()=>(await i.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=i,t[3]=s):s=t[3];let a;return t[4]!==n||t[5]!==s?(a={queryKey:n,queryFn:s},t[4]=n,t[5]=s,t[6]=a):a=t[6],y(a)}function j(){const t=r.c(8),{org:e}=c(),i=u(),n=A();let s;t[0]!==i?(s=async l=>(await i.call("JIRA_AUTOMATION_UPSERT",l)).automation,t[0]=i,t[1]=s):s=t[1];let a;t[2]!==e||t[3]!==n?(a=()=>n.invalidateQueries({queryKey:f.jiraAutomations(e.id)}),t[2]=e,t[3]=n,t[4]=a):a=t[4];let o;return t[5]!==s||t[6]!==a?(o={mutationFn:s,onSettled:a},t[5]=s,t[6]=a,t[7]=o):o=t[7],m(o)}function E(){const t=r.c(2),e=u();let i;return t[0]!==e?(i={mutationFn:n=>e.call("JIRA_RUN_START",n)},t[0]=e,t[1]=i):i=t[1],m(i)}function N(t){const e=r.c(4),{size:i,className:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=T.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=s):s=e[0];let a;return e[1]!==n||e[2]!==i?(a=T.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:n,children:s}),e[1]=n,e[2]=i,e[3]=a):a=e[3],a}export{N as J,R as a,S as b,j as c,_ as d,g as e,J as f,E as g,q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as n,m as r,j as i,c2 as p}from"./index-Cdi-Ldg8.js";function d(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{d as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,k as v,l as A,m as N}from"./index-Cdi-Ldg8.js";import{R}from"./required-auth-layout-DSes7vPo.js";import{u as T}from"./use-deployment-admin--gqHVRuO.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(o=>s.jsx(j,{to:o.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(o.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(o.labelKey)},o.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let n;return e[4]!==t?(n=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=n):n=e[5],n}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!a){let i;e[1]!==t?(i=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==i||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:i,description:l,action:c}),e[10]=i,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let n;e[14]!==t?(n=t("admin.layout.adminDashboard"),e[14]=t,e[15]=n):n=e[15];let o;e[16]!==n?(o=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:n})}),e[16]=n,e[17]=o):o=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==o?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[o,u,f]}),e[20]=o,e[21]=x):x=e[21],x}function P(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{P as default};
|