@myagentroam/server 0.14.6 → 0.14.7
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/node_modules/@myagentroam/protocol/package.json +1 -1
- package/node_modules/@myagentroam/server-core/dist/conversation-template-publisher.js +10 -5
- package/node_modules/@myagentroam/server-core/dist/model-usage-store.d.ts +3 -2
- package/node_modules/@myagentroam/server-core/dist/model-usage-store.js +4 -4
- package/node_modules/@myagentroam/server-core/package.json +2 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-application.js +7 -6
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-models.d.ts +1 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-models.js +2 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-notifications.d.ts +1 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-notifications.js +1 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
- package/package.json +5 -5
- package/web/assets/{AuditManagementPage-DwvKvFBa.js → AuditManagementPage-Bjc4M2Lz.js} +1 -1
- package/web/assets/{BusyIndicator-D47nHa7A.js → BusyIndicator-5ngQiuWi.js} +1 -1
- package/web/assets/{CodeFileEditor-CX5yE3gR.js → CodeFileEditor-DfwjT3o3.js} +3 -3
- package/web/assets/{ConversationTemplateManagementPage-jVXczVi8.js → ConversationTemplateManagementPage-B9FSI-uq.js} +1 -1
- package/web/assets/{ConversationTemplateManagementPage-Cn2KitHn.js → ConversationTemplateManagementPage-HJQuIAiu.js} +1 -1
- package/web/assets/{EnterpriseUserManagementPage-DwSQUaiu.js → EnterpriseUserManagementPage-Bc6Yv_s0.js} +1 -1
- package/web/assets/{EnvironmentSecretManager-XpjrwRmN.js → EnvironmentSecretManager-BQNfVtI-.js} +1 -1
- package/web/assets/{FilePreviewLoading-qr43XfwQ.js → FilePreviewLoading-BpXuDpA6.js} +1 -1
- package/web/assets/{HtmlPreviewFrame-DVZyMN0m.js → HtmlPreviewFrame-CCn-QwE3.js} +3 -3
- package/web/assets/{LicenseManagementPage-Az9FK3w_.js → LicenseManagementPage-DraoD2Sp.js} +1 -1
- package/web/assets/{ManagementPagination-B1x1Th6n.js → ManagementPagination-D2HYEqCd.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-CciIt4SP.js → MarAgentModelManagementPage-0POo2FO3.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-CKGV87k3.css → MarAgentModelManagementPage-QlveLK_L.css} +1 -1
- package/web/assets/MarAgentModelManagementPage-U8U5si7b.js +1 -0
- package/web/assets/{MarIcon-BZ-1QXF7.js → MarIcon-DbZF7ZoI.js} +1 -1
- package/web/assets/{MarkdownFilePreview-BTH3bQe5.js → MarkdownFilePreview-BWZHVkC0.js} +2 -2
- package/web/assets/{McpDetailsDialog-BQ7nmTb6.js → McpDetailsDialog-CCKcaV2W.js} +1 -1
- package/web/assets/{McpSourceManagementPage-DBnJ68iH.js → McpSourceManagementPage-2AKgQ0PB.js} +1 -1
- package/web/assets/{McpSourceManagementPage-IqyRfh8Z.js → McpSourceManagementPage-BcvAHE_X.js} +1 -1
- package/web/assets/{NodeDetailsDialogs-6fL0EW1P.js → NodeDetailsDialogs-Dgm2nHLr.js} +1 -1
- package/web/assets/NodeManagementPage-B1naJTEW.js +1 -0
- package/web/assets/NodeManagementPage-RGPV-QG3.js +1 -0
- package/web/assets/{OAuthManagementPage-C1ZuJ4ot.js → OAuthManagementPage-D1SeJgYN.js} +1 -1
- package/web/assets/{OrganizationManagementPage-D-pMct6k.js → OrganizationManagementPage-B4pyJGRu.js} +1 -1
- package/web/assets/{RemoteDesktopPage-Dubp3DmW.js → RemoteDesktopPage-Dk9UgGjg.js} +1 -1
- package/web/assets/{ResourceManagementPanel-DqqUIfo4.js → ResourceManagementPanel-OXxqR5Oy.js} +1 -1
- package/web/assets/{ResourceManagementPanel.vue_vue_type_script_setup_true_lang-CLKKq6Gb.js → ResourceManagementPanel.vue_vue_type_script_setup_true_lang-DHZ9Uq8I.js} +1 -1
- package/web/assets/{SecretManagementPage-BXquNAef.js → SecretManagementPage-DNUa2r5G.js} +1 -1
- package/web/assets/SecretManagementPage-DP_bS09F.js +1 -0
- package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-CWFxmtxm.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-XoEzZmS4.js} +1 -1
- package/web/assets/{SessionSharePage-DJ0SHcc7.js → SessionSharePage-BHPq2vdq.js} +2 -2
- package/web/assets/{SettingsContent-8-yemo25.js → SettingsContent-BbbcTnDe.js} +1 -1
- package/web/assets/{SettingsContent-DhcCPjgc.js → SettingsContent-BqeRJl1U.js} +1 -1
- package/web/assets/SkillCenterPage-Cw8oUNIF.js +1 -0
- package/web/assets/{SkillCenterPage-CTzK5Ubb.js → SkillCenterPage-D800n8ez.js} +1 -1
- package/web/assets/{SkillDetailsDialog-u9K3q9r-.js → SkillDetailsDialog-Dnc1MDrL.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-CyNG8i2A.js → SkillSourceManagementPage-B66lCJj1.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-do9AOTry.js → SkillSourceManagementPage-Bt1x6sXo.js} +1 -1
- package/web/assets/{StandaloneFilePreviewPage-C7YdmM2F.js → StandaloneFilePreviewPage-Dy7L1vVj.js} +1 -1
- package/web/assets/{SystemConfigurationPage-B_NO4bX2.js → SystemConfigurationPage-COLP1KJ2.js} +1 -1
- package/web/assets/SystemConfigurationPage-Dfqo-UjA.js +1 -0
- package/web/assets/{SystemInformationPage-6R9WKkGx.js → SystemInformationPage-CufXtKbz.js} +1 -1
- package/web/assets/{TerminalTabView-Ct1ZvO_i.js → TerminalTabView-CgZvOQ0F.js} +1 -1
- package/web/assets/{WorkbenchPage-jF-9j756.js → WorkbenchPage-5HeULn-Z.js} +4 -4
- package/web/assets/WorkspaceManagementPage-D49wwQ_p.js +1 -0
- package/web/assets/WorkspaceManagementPage-Dm2cuaSR.js +1 -0
- package/web/assets/{_baseIteratee-tIDmp4ay.js → _baseIteratee-Bj5EHk2A.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-DyYgiyiz.js → abnfDiagram-VCTEODGH-COpw9t7L.js} +1 -1
- package/web/assets/{advancedFormat-B7-jeFQb.js → advancedFormat-Cjbf8Yk5.js} +1 -1
- package/web/assets/{arc-v3a9PME0.js → arc-EBVIc6m-.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-DETGNXND.js → architectureDiagram-5GKGNRK7-DJFN1qNx.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-AEf0IbxP.js → blockDiagram-OSKFZWR5-Bk2tTOBe.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-Bf0IwSh9.js → c4Diagram-7LVT6UL2-YxENblNZ.js} +1 -1
- package/web/assets/{catalog-ownership-service-Db9HzynV.js → catalog-ownership-service-CWawG1a5.js} +1 -1
- package/web/assets/{catalog-page-service-rXolQE-n.js → catalog-page-service-C496IXhe.js} +1 -1
- package/web/assets/channel-Blr16qe4.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-C7tpLm3v.js → chunk-2Q5K7J3B-CRKyJO32.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-CqF_G9RG.js → chunk-5VM5RSS4-DTCkZ4Ew.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-vMCnb1h_.js → chunk-F27PBJKO-hGoG3qN9.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-CHP0ohrj.js → chunk-HLEWEB6X-EdZfRKEA.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-B6kL3sba.js → chunk-JWPE2WC7-DVkC9VGo.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-DvMvtD24.js → chunk-POPQ4Y6H-C1k43Nbg.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-RaL3Yq0i.js → chunk-SVP7TREG-BNMkYwy0.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-DWxnobmm.js → chunk-XXDRQBXY-mFVREiaw.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-CsphN23u.js → chunk-ZLD2IHE6-D-Y5XWyl.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-CgMKm88L.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-CgMKm88L.js +1 -0
- package/web/assets/{conversation-history-ylB1Umkj.js → conversation-history-BJnCnWsO.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-BoD2lSHj.js → cose-bilkent-JH36ORCC-BQmmxQlD.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-DNtLQYP_.js → cynefin-OW5HDTMX-CPood6cS.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-Eh2xVdvM.js → cynefinDiagram-5FMLGOSQ-DmTC5J_j.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-Cgizrqhk.js → dagre-OS7QT2EB-Cly5s5UP.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-rceDmjfB.js → diagram-S7CK7UJ4-CM6Vdp1H.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-CF7xmRJa.js → diagram-UQ7AKVKN-CNsie4Rs.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-Duk_VSaT.js → diagram-VSXAHHWV-BwD9bO7i.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-REhlqoan.js → diagram-VX7I27RA-BayIXExT.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-Dc6Gz8aA.js → diagram-Z3DM3KII-BVdVqliB.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-DgMvWcN1.js → ebnfDiagram-PWID7BFC-Ds83HyB5.js} +1 -1
- package/web/assets/{el-alert-3GRzkg5J.js → el-alert-BvgrijUS.js} +1 -1
- package/web/assets/{el-cascader-B7gK9zYW.js → el-cascader-BmAEXGYo.js} +1 -1
- package/web/assets/{el-checkbox-D17hJ4Dr.js → el-checkbox-DFFxo6V9.js} +1 -1
- package/web/assets/{el-date-picker-BIOVMZLv.js → el-date-picker-ySQG9RiK.js} +1 -1
- package/web/assets/{el-descriptions-GRZDoZ0i.js → el-descriptions-C7fuLt4I.js} +1 -1
- package/web/assets/{el-form-item-G2_zDLCT.js → el-form-item-BpsaI53Z.js} +1 -1
- package/web/assets/{el-input-BmBr8IOJ.js → el-input-DXiJfMQi.js} +1 -1
- package/web/assets/{el-input-number-hCtuEo-6.js → el-input-number-DE8_TnDA.js} +1 -1
- package/web/assets/{el-radio-CALZyPzO.js → el-radio-DMosrAkv.js} +1 -1
- package/web/assets/{el-scrollbar-D7-PnASV.js → el-scrollbar-CAv8RTkM.js} +1 -1
- package/web/assets/{el-select-N0VzjsJx.js → el-select-BHkUpOhW.js} +1 -1
- package/web/assets/{el-switch-BZiHEAAG.js → el-switch-CAN1HFQF.js} +1 -1
- package/web/assets/{el-tab-pane-E82jkIBE.js → el-tab-pane-BMr5CBMK.js} +1 -1
- package/web/assets/{el-table-column-a9k9oena.js → el-table-column-VWc9MNal.js} +1 -1
- package/web/assets/{enterprise-management-service-Ca5sCU14.js → enterprise-management-service-L_NTO8eF.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-DyK6OuQy.js → erDiagram-2YWLMYGG-OE8nwrZg.js} +1 -1
- package/web/assets/{error-presentation-C444Bghw.js → error-presentation-VdWvFs_r.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-8d5CJWD0.js → flowDiagram-T62WH6J4-SHGxTNtA.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-DrJpW5gg.js → ganttDiagram-EL5Y4UJY-BlM7_IMM.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-BGDLuNtA.js → gitGraphDiagram-WWUBYQGX-C0kq63ZB.js} +1 -1
- package/web/assets/{hosted-conversation-template-client-1kkTUflR.js → hosted-conversation-template-client-C8MVXrUw.js} +1 -1
- package/web/assets/{index-CDtyYqCI.js → index-0X_wMhnr.js} +1 -1
- package/web/assets/{index-SDJII4Tt.js → index-BAjLl37Q.js} +1 -1
- package/web/assets/{index-CfrC_t0x.js → index-BLG22Z77.js} +1 -1
- package/web/assets/{index-Bi4SfeDh.js → index-BXIw-Frw.js} +1 -1
- package/web/assets/{index-BXP5Pqwr.js → index-BgwGEsTF.js} +1 -1
- package/web/assets/{index-DLxQWAtw.js → index-Bn6Pp8kc.js} +1 -1
- package/web/assets/{index-CZlqq65J.js → index-BnzyZCrG.js} +1 -1
- package/web/assets/{index-D9Ioc0ld.js → index-BvFCRJa6.js} +1 -1
- package/web/assets/{index-DDeIY6vG.js → index-BwlohDJk.js} +1 -1
- package/web/assets/{index-39PDceov.js → index-CGMHFy24.js} +1 -1
- package/web/assets/{index-aaa7fRaf.js → index-CRfd8ctY.js} +1 -1
- package/web/assets/{index-D0ITvz69.js → index-CRpphU_a.js} +1 -1
- package/web/assets/{index-BuEbXnWB.js → index-CazjjrF9.js} +1 -1
- package/web/assets/{index-BrpXnGwt.js → index-Cv0xTjlS.js} +1 -1
- package/web/assets/{index-DVDbTk_b.js → index-D4Hf-oO8.js} +1 -1
- package/web/assets/{index-CEtMeo_f.js → index-D6_JgE6L.js} +1 -1
- package/web/assets/{index-BcNRgbLT.js → index-DKcbjBLG.js} +1 -1
- package/web/assets/{index-2sC6fl3r.js → index-DP3logAf.js} +1 -1
- package/web/assets/{index-BLTGs0dA.js → index-DkFoMtS9.js} +4 -4
- package/web/assets/{index-IO8Mx71i.js → index-DkUh9ETl.js} +1 -1
- package/web/assets/{index-lyLJoNUu.js → index-DkoSS56t.js} +1 -1
- package/web/assets/{index-IDmjwhiP.js → index-DmYrp7CP.js} +1 -1
- package/web/assets/{index-DKxPneX-.js → index-DvKRv5dC.js} +1 -1
- package/web/assets/{index-C1YyXEp1.js → index-HswSPtc7.js} +1 -1
- package/web/assets/{index-8YEHeCbe.js → index-VcxS8uVm.js} +1 -1
- package/web/assets/{index-DvkEyszX.js → index-bNPhmNBO.js} +1 -1
- package/web/assets/{index-B7J8cVfC.js → index-kpSyhHbg.js} +1 -1
- package/web/assets/{index-CroIeogW.js → index-obLo13fs.js} +1 -1
- package/web/assets/{index-B9Bi-H_L.js → index-swPvmYPy.js} +1 -1
- package/web/assets/infoDiagram-FKFFQAWI-Dry3PHOl.js +2 -0
- package/web/assets/{isArrayLikeObject-BAE6hHmq.js → isArrayLikeObject-aUauz_pZ.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-BQkIAgKN.js → ishikawaDiagram-5VMMS53U-BsTy8BRe.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-DIC6bpv8.js → journeyDiagram-EYS64GPL-CqqipDxU.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-DlRasm82.js → kanban-definition-UXKFOSKX-DsINjii2.js} +1 -1
- package/web/assets/{layout-qik6URE7.js → layout-C8Ww8BYj.js} +1 -1
- package/web/assets/{linear-L6KFSlmC.js → linear-DtP-E9qO.js} +1 -1
- package/web/assets/{management-url-service-Be9DARgX.js → management-url-service-C-F8z4ZZ.js} +1 -1
- package/web/assets/{mcp-center-service-BFVNs07Q.js → mcp-center-service-COCMMq1q.js} +1 -1
- package/web/assets/{merge-B-oWpK7P.js → merge-ClMCzzY2.js} +1 -1
- package/web/assets/{mermaid.core-DULl0x41.js → mermaid.core-AyrJkBES.js} +5 -5
- package/web/assets/{message-box-service-DmUALwu3.js → message-box-service-Dd9NpeG9.js} +1 -1
- package/web/assets/{mindmap-definition-THT77NOG-Dm6hwkRt.js → mindmap-definition-THT77NOG-DTMCA3UL.js} +1 -1
- package/web/assets/{mobile-dialog-return-service-CI9iHfKa.js → mobile-dialog-return-service-CMPAsgq2.js} +1 -1
- package/web/assets/{oauth-callback-1Zec9MDq.js → oauth-callback--Mc7Au6a.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-Cl7Hib5u.js → pegDiagram-XKGWAZYB--mPRf37U.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-B7cz24St.js → pieDiagram-E7YTZNPT-C9MLjjja.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-BBYH4Qxi.js → quadrantDiagram-AXDQQJYC-DP0-8Qnb.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-RLil4WMv.js → railroadDiagram-O6MQD6OU-DysK1LQ1.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X-CecjjyuV.js → requirementDiagram-IS5BZ75X-DNsThtLq.js} +1 -1
- package/web/assets/{runner-presentation-CGI7Ox9r.js → runner-presentation-BOS6GbrS.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-KpbhbovW.js → sankeyDiagram-P5KCCOFB-DaL9QDpb.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-BRFJR6W3.js → sequenceDiagram-WJ2MYXX4-BFLRN1Pf.js} +1 -1
- package/web/assets/{session-share-client-service-COQl7VFx.js → session-share-client-service-BAr1i0tx.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-CLVK01BF.js → sizeCapture-INFHLROL-Cv9sChrn.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-t36Djonr.js → stateDiagram-XQSTLZYL-DVA-PWdq.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-B0lKQA-Y.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-CoI_Di03.js → swimlanes-V6O3JKXN-D7AqBrnR.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-BtqxM_Io.js +8 -0
- package/web/assets/{time-presentation-B_mK4Ifi.js → time-presentation-m0je1moW.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-CsnjmvdA.js → timeline-definition-24CTP7MA-DIafFCwT.js} +1 -1
- package/web/assets/{union-Dbsus4T0.js → union-BhZpN_Qj.js} +1 -1
- package/web/assets/{use-form-common-props-C9eiXbZV.js → use-form-common-props-aW2VizjT.js} +1 -1
- package/web/assets/{use-wheel-BLiVh0Kz.js → use-wheel-kYRrs2hR.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-BxiDVIcW.js → vennDiagram-4TSXK5OY-C7f2wY0K.js} +1 -1
- package/web/assets/{vnode-Cs3ifgnM.js → vnode-DGfvsa4i.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-Dj9M0Y8-.js → wardleyDiagram-VM6X3IG4-DnGu_d2A.js} +1 -1
- package/web/assets/{workbench-composer-interaction-controller-CZHX2ntY.js → workbench-composer-interaction-controller-qNSbHSc4.js} +1 -1
- package/web/assets/{workbench-live-service-D1Cn_e8S.js → workbench-live-service-gs9m6rpJ.js} +1 -1
- package/web/assets/{workbench-presentation-Bs79uL2L.js → workbench-presentation-Zlkjcytl.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-BI4QCv-D.js → xychartDiagram-S5SC5T6Z-Zp5mxcsw.js} +1 -1
- package/web/docs/404.html +1 -1
- package/web/docs/administration/account.html +2 -2
- package/web/docs/administration/audit.html +2 -2
- package/web/docs/administration/conversation-templates.html +2 -2
- package/web/docs/administration/email-notifications.html +2 -2
- package/web/docs/administration/license.html +2 -2
- package/web/docs/administration/nodes-workspaces.html +2 -2
- package/web/docs/administration/oauth.html +2 -2
- package/web/docs/administration/secrets.html +2 -2
- package/web/docs/administration/template-workspace-maintenance.html +2 -2
- package/web/docs/administration/users-organizations.html +2 -2
- package/web/docs/assets/{app.jHxie5i_.js → app.Dw8YP0uf.js} +1 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.MA84jIRe.js +1 -0
- package/web/docs/assets/chunks/{@localSearchIndexroot.Id7haRPZ.js → @localSearchIndexroot.BDKnbyEC.js} +1 -1
- package/web/docs/assets/chunks/{VPLocalSearchBox.Bp5TXaQ6.js → VPLocalSearchBox.B8C1EWJ8.js} +1 -1
- package/web/docs/assets/chunks/{theme.rCJWtMvS.js → theme.DfaaPix0.js} +2 -2
- package/web/docs/concepts/architecture.html +2 -2
- package/web/docs/concepts/data-and-security.html +2 -2
- package/web/docs/concepts/files-git-terminal.html +2 -2
- package/web/docs/concepts/node-and-workspace.html +2 -2
- package/web/docs/concepts/permissions-and-sharing.html +2 -2
- package/web/docs/concepts/runner-control.html +2 -2
- package/web/docs/concepts/secrets.html +2 -2
- package/web/docs/concepts/session-run-turn.html +2 -2
- package/web/docs/deployment/backup-restore.html +2 -2
- package/web/docs/deployment/network.html +2 -2
- package/web/docs/deployment/node-installation.html +2 -2
- package/web/docs/deployment/node-linux.html +2 -2
- package/web/docs/deployment/node-macos.html +2 -2
- package/web/docs/deployment/node-windows.html +2 -2
- package/web/docs/deployment/production.html +2 -2
- package/web/docs/deployment/security-checklist.html +2 -2
- package/web/docs/deployment/upgrade.html +2 -2
- package/web/docs/en-US/administration/account.html +2 -2
- package/web/docs/en-US/administration/audit.html +2 -2
- package/web/docs/en-US/administration/conversation-templates.html +2 -2
- package/web/docs/en-US/administration/email-notifications.html +2 -2
- package/web/docs/en-US/administration/license.html +2 -2
- package/web/docs/en-US/administration/nodes-workspaces.html +2 -2
- package/web/docs/en-US/administration/oauth.html +2 -2
- package/web/docs/en-US/administration/secrets.html +2 -2
- package/web/docs/en-US/administration/template-workspace-maintenance.html +2 -2
- package/web/docs/en-US/administration/users-organizations.html +2 -2
- package/web/docs/en-US/concepts/architecture.html +2 -2
- package/web/docs/en-US/concepts/data-and-security.html +2 -2
- package/web/docs/en-US/concepts/files-git-terminal.html +2 -2
- package/web/docs/en-US/concepts/node-and-workspace.html +2 -2
- package/web/docs/en-US/concepts/permissions-and-sharing.html +2 -2
- package/web/docs/en-US/concepts/runner-control.html +2 -2
- package/web/docs/en-US/concepts/secrets.html +2 -2
- package/web/docs/en-US/concepts/session-run-turn.html +2 -2
- package/web/docs/en-US/deployment/backup-restore.html +2 -2
- package/web/docs/en-US/deployment/network.html +2 -2
- package/web/docs/en-US/deployment/node-installation.html +2 -2
- package/web/docs/en-US/deployment/node-linux.html +2 -2
- package/web/docs/en-US/deployment/node-macos.html +2 -2
- package/web/docs/en-US/deployment/node-windows.html +2 -2
- package/web/docs/en-US/deployment/production.html +2 -2
- package/web/docs/en-US/deployment/security-checklist.html +2 -2
- package/web/docs/en-US/deployment/upgrade.html +2 -2
- package/web/docs/en-US/getting-started/connect-node.html +2 -2
- package/web/docs/en-US/getting-started/first-agent-session.html +2 -2
- package/web/docs/en-US/getting-started/first-login.html +2 -2
- package/web/docs/en-US/getting-started/next-steps.html +2 -2
- package/web/docs/en-US/getting-started/npm-quick-start.html +2 -2
- package/web/docs/en-US/getting-started/overview.html +2 -2
- package/web/docs/en-US/getting-started/prerequisites.html +2 -2
- package/web/docs/en-US/getting-started/register-workspace.html +2 -2
- package/web/docs/en-US/getting-started/server-installation.html +2 -2
- package/web/docs/en-US/operations/marctl.html +2 -2
- package/web/docs/en-US/reference/configuration.html +2 -2
- package/web/docs/en-US/reference/keyboard-shortcuts.html +2 -2
- package/web/docs/en-US/reference/limits.html +2 -2
- package/web/docs/en-US/reference/ports-paths-data.html +2 -2
- package/web/docs/en-US/reference/status-and-errors.html +2 -2
- package/web/docs/en-US/runners/claude-code.html +2 -2
- package/web/docs/en-US/runners/codex.html +2 -2
- package/web/docs/en-US/runners/mar-agent.html +2 -2
- package/web/docs/en-US/runners/opencode.html +2 -2
- package/web/docs/en-US/runners/overview.html +2 -2
- package/web/docs/en-US/runners/runner-troubleshooting.html +2 -2
- package/web/docs/en-US/troubleshooting/node-offline.html +2 -2
- package/web/docs/en-US/troubleshooting/quick-diagnosis.html +2 -2
- package/web/docs/en-US/troubleshooting/session-run.html +2 -2
- package/web/docs/en-US/troubleshooting/terminal.html +2 -2
- package/web/docs/en-US/troubleshooting/workspace-files.html +2 -2
- package/web/docs/en-US/workbench/composer.html +2 -2
- package/web/docs/en-US/workbench/context-and-plan.html +2 -2
- package/web/docs/en-US/workbench/conversation.html +2 -2
- package/web/docs/en-US/workbench/file-reference-and-attachment.html +2 -2
- package/web/docs/en-US/workbench/files.html +2 -2
- package/web/docs/en-US/workbench/git-changes.html +2 -2
- package/web/docs/en-US/workbench/git-history.html +2 -2
- package/web/docs/en-US/workbench/hosted-conversations.html +2 -2
- package/web/docs/en-US/workbench/mobile.html +2 -2
- package/web/docs/en-US/workbench/navigation.html +2 -2
- package/web/docs/en-US/workbench/remote-desktop.html +2 -2
- package/web/docs/en-US/workbench/sessions.html +2 -2
- package/web/docs/en-US/workbench/skills.html +2 -2
- package/web/docs/en-US/workbench/terminal.html +2 -2
- package/web/docs/getting-started/connect-node.html +2 -2
- package/web/docs/getting-started/first-agent-session.html +2 -2
- package/web/docs/getting-started/first-login.html +2 -2
- package/web/docs/getting-started/next-steps.html +2 -2
- package/web/docs/getting-started/npm-quick-start.html +2 -2
- package/web/docs/getting-started/overview.html +2 -2
- package/web/docs/getting-started/prerequisites.html +2 -2
- package/web/docs/getting-started/register-workspace.html +2 -2
- package/web/docs/getting-started/server-installation.html +2 -2
- package/web/docs/operations/marctl.html +2 -2
- package/web/docs/reference/configuration.html +2 -2
- package/web/docs/reference/keyboard-shortcuts.html +2 -2
- package/web/docs/reference/limits.html +2 -2
- package/web/docs/reference/ports-paths-data.html +2 -2
- package/web/docs/reference/status-and-errors.html +2 -2
- package/web/docs/runners/claude-code.html +2 -2
- package/web/docs/runners/codex.html +2 -2
- package/web/docs/runners/mar-agent.html +2 -2
- package/web/docs/runners/opencode.html +2 -2
- package/web/docs/runners/overview.html +2 -2
- package/web/docs/runners/runner-troubleshooting.html +2 -2
- package/web/docs/troubleshooting/node-offline.html +2 -2
- package/web/docs/troubleshooting/quick-diagnosis.html +2 -2
- package/web/docs/troubleshooting/session-run.html +2 -2
- package/web/docs/troubleshooting/terminal.html +2 -2
- package/web/docs/troubleshooting/workspace-files.html +2 -2
- package/web/docs/workbench/composer.html +2 -2
- package/web/docs/workbench/context-and-plan.html +2 -2
- package/web/docs/workbench/conversation.html +2 -2
- package/web/docs/workbench/file-reference-and-attachment.html +2 -2
- package/web/docs/workbench/files.html +2 -2
- package/web/docs/workbench/git-changes.html +2 -2
- package/web/docs/workbench/git-history.html +2 -2
- package/web/docs/workbench/hosted-conversations.html +2 -2
- package/web/docs/workbench/mobile.html +2 -2
- package/web/docs/workbench/navigation.html +2 -2
- package/web/docs/workbench/remote-desktop.html +2 -2
- package/web/docs/workbench/sessions.html +2 -2
- package/web/docs/workbench/skills.html +2 -2
- package/web/docs/workbench/terminal.html +2 -2
- package/web/index.html +2 -2
- package/web/service-worker.js +1 -1
- package/web/web-version.json +1 -1
- package/web/assets/MarAgentModelManagementPage-CnN85Ol5.js +0 -1
- package/web/assets/NodeManagementPage-7HPBZ4Gy.js +0 -1
- package/web/assets/NodeManagementPage-BHZ5qH5M.js +0 -1
- package/web/assets/SecretManagementPage-D9_i5kMo.js +0 -1
- package/web/assets/SkillCenterPage-pcYCkBaN.js +0 -1
- package/web/assets/SystemConfigurationPage-n3ktb63V.js +0 -1
- package/web/assets/WorkspaceManagementPage-BFktlfex.js +0 -1
- package/web/assets/WorkspaceManagementPage-DCxOSut1.js +0 -1
- package/web/assets/channel-C6r3DG80.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-Bjkpauz2.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-Bjkpauz2.js +0 -1
- package/web/assets/infoDiagram-FKFFQAWI-DxgyKJUB.js +0 -2
- package/web/assets/stateDiagram-v2-IH3M54BS-DY0UACp3.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-Zy_ic1zl.js +0 -8
- package/web/docs/assets/chunks/@localSearchIndexen-US.Dx6FH2nd.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as r,s as o}from"./flowDiagram-T62WH6J4-SHGxTNtA.js";import{_ as e}from"./mermaid.core-AyrJkBES.js";import"./index-DkFoMtS9.js";import"./chunk-5VM5RSS4-DTCkZ4Ew.js";import"./chunk-XXDRQBXY-mFVREiaw.js";import"./chunk-POPQ4Y6H-C1k43Nbg.js";import"./chunk-F27PBJKO-hGoG3qN9.js";import"./FilePreviewLoading-BpXuDpA6.js";import"./use-form-common-props-aW2VizjT.js";import"./el-scrollbar-CAv8RTkM.js";import"./el-input-DXiJfMQi.js";import"./mobile-dialog-return-service-CMPAsgq2.js";import"./BusyIndicator-5ngQiuWi.js";import"./channel-Blr16qe4.js";import"./isArrayLikeObject-aUauz_pZ.js";import"./_baseIteratee-Bj5EHk2A.js";import"./union-BhZpN_Qj.js";import"./_baseFindIndex-D7XfJLKM.js";var m=e(t=>`${o(t)}
|
|
2
|
+
.swimlane.cluster rect {
|
|
3
|
+
stroke: ${t.clusterBorder} !important;
|
|
4
|
+
}
|
|
5
|
+
[data-look="neo"].cluster rect {
|
|
6
|
+
filter: none;
|
|
7
|
+
}
|
|
8
|
+
`,"getStyles"),i=m,B=r({defaultLayout:"swimlane",styles:i});export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DkFoMtS9.js";function c(r,a){const t=new Date(r),e=a===void 0?{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds()}:Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(t).map(({type:n,value:s})=>[n,s])),o=n=>String(n).padStart(2,"0");return`${String(e.year).padStart(4,"0")}-${o(e.month)}-${o(e.day)} ${o(e.hour)}:${o(e.minute)}:${o(e.second)}`}function d(r){const a=Math.max(0,Math.floor(r/1e3)),t=a%60,e=Math.floor(a/60),o=e%60,n=Math.floor(e/60);return n>0?`${n}h ${o}m ${t}s`:o>0?`${o}m ${t}s`:`${t}s`}export{c as f,d as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-AyrJkBES.js";import{d as ot}from"./arc-EBVIc6m-.js";import"./index-DkFoMtS9.js";import"./FilePreviewLoading-BpXuDpA6.js";import"./use-form-common-props-aW2VizjT.js";import"./el-scrollbar-CAv8RTkM.js";import"./el-input-DXiJfMQi.js";import"./mobile-dialog-return-service-CMPAsgq2.js";import"./BusyIndicator-5ngQiuWi.js";import"./isArrayLikeObject-aUauz_pZ.js";import"./_baseIteratee-Bj5EHk2A.js";import"./union-BhZpN_Qj.js";import"./_baseFindIndex-D7XfJLKM.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),X=S[l[l.length-2]][l[l.length-1]],l.push(X);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bi as u,bj as g,bk as I,bl as w,bm as A}from"./index-
|
|
1
|
+
import{bi as u,bj as g,bk as I,bl as w,bm as A}from"./index-DkFoMtS9.js";import{b as m,i as p}from"./isArrayLikeObject-aUauz_pZ.js";import{b as x}from"./_baseFindIndex-D7XfJLKM.js";function N(){}function R(n){return n!==n}function S(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}function F(n,e,t){return e===e?S(n,e,t):x(n,R,t)}function O(n,e){var t=n==null?0:n.length;return!!t&&F(n,e,0)>-1}var d=1/0,j=u&&1/g(new u([,-0]))[1]==d?function(n){return new u(n)}:N,k=200;function v(n,e,t){var r=-1,o=O,h=n.length,b=!0,s=[],i=s;if(h>=k){var c=j(n);if(c)return g(c);b=!1,o=w,i=new I}else i=s;n:for(;++r<h;){var f=n[r],a=f;if(f=f!==0?f:0,b&&a===a){for(var l=i.length;l--;)if(i[l]===a)continue n;s.push(f)}else o(i,a,t)||(i!==s&&i.push(a),s.push(f))}return s}var T=m(function(n){return v(A(n,1,p,!0))});export{T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as r,O as f,P as l,Q as t,R as a,S as p,L as n,f as v}from"./index-
|
|
1
|
+
import{k as r,O as f,P as l,Q as t,R as a,S as p,L as n,f as v}from"./index-DkFoMtS9.js";const i=s=>{const e=f();return r(()=>e?.proxy?.$props?.[s])},b=(s,e={})=>{const o=v(void 0),m=e.prop?o:i("size"),u=e.global?o:l(),c=e.form?{size:void 0}:t(a,void 0),d=e.formItem?{size:void 0}:t(p,void 0);return r(()=>m.value||n(s)||d?.size||c?.size||u.value||"")},x=s=>{const e=i("disabled"),o=t(a,void 0);return r(()=>e.value??n(s)??o?.disabled??!1)};export{x as a,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as c}from"./index-
|
|
1
|
+
import{s as c}from"./index-DkFoMtS9.js";import{c as h,r as d}from"./el-input-DXiJfMQi.js";const F=({atEndEdge:n,atStartEdge:f,layout:i},u)=>{let l,r=0;const o=e=>e<0&&f.value||e>0&&n.value;return{hasReachedEdge:o,onWheel:e=>{h(l);let{deltaX:s,deltaY:t}=e;e.shiftKey&&t!==0&&(s=t,t=0);const a=i.value==="horizontal"?s:t;o(a)||(r+=a,!c()&&a!==0&&e.preventDefault(),l=d(()=>{u(r),r=0}))}}};export{F as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-DULl0x41.js";import"./index-BLTGs0dA.js";import"./FilePreviewLoading-qr43XfwQ.js";import"./use-form-common-props-C9eiXbZV.js";import"./el-scrollbar-D7-PnASV.js";import"./el-input-BmBr8IOJ.js";import"./mobile-dialog-return-service-CI9iHfKa.js";import"./BusyIndicator-D47nHa7A.js";import"./isArrayLikeObject-BAE6hHmq.js";import"./_baseIteratee-tIDmp4ay.js";import"./union-Dbsus4T0.js";import"./_baseFindIndex-D7XfJLKM.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),T=Math.atan2(f.x-p.x,f.y-p.y);let _=T-M;_<0&&(_+=2*Math.PI);const S=T-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const T=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(T),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(T),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,T){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let T=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<T&&(T=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Tt(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-AyrJkBES.js";import"./index-DkFoMtS9.js";import"./FilePreviewLoading-BpXuDpA6.js";import"./use-form-common-props-aW2VizjT.js";import"./el-scrollbar-CAv8RTkM.js";import"./el-input-DXiJfMQi.js";import"./mobile-dialog-return-service-CMPAsgq2.js";import"./BusyIndicator-5ngQiuWi.js";import"./isArrayLikeObject-aUauz_pZ.js";import"./_baseIteratee-Bj5EHk2A.js";import"./union-BhZpN_Qj.js";import"./_baseFindIndex-D7XfJLKM.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),T=Math.atan2(f.x-p.x,f.y-p.y);let _=T-M;_<0&&(_+=2*Math.PI);const S=T-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const T=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(T),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(T),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,T){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let T=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<T&&(T=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Tt(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as p,C as a,D as u,E as f,F as m,G as i,H as b}from"./index-
|
|
1
|
+
import{B as p,C as a,D as u,E as f,F as m,G as i,H as b}from"./index-DkFoMtS9.js";const c="utils/vue/vnode";function y(s){return a(s)&&s.type===u}const E=s=>{if(!a(s))return f(c,"[getNormalizedProps] must be a VNode"),{};const o=s.props||{},t=(a(s.type)?s.type.props:void 0)||{},e={};return Object.keys(t).forEach(r=>{m(t[r],"default")&&(e[r]=t[r].default)}),Object.keys(o).forEach(r=>{e[i(r)]=o[r]}),e},n=s=>{const o=p(s)?s:[s],t=[];return o.forEach(e=>{p(e)?t.push(...n(e)):a(e)&&e.component?.subTree?t.push(e,...n(e.component.subTree)):a(e)&&p(e.children)?t.push(...n(e.children)):a(e)&&e.shapeFlag===2?t.push(...n(e.type())):t.push(e)}),t};export{n as f,E as g,y as i};
|
package/web/assets/{wardleyDiagram-VM6X3IG4-Dj9M0Y8-.js → wardleyDiagram-VM6X3IG4-DnGu_d2A.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as Mt}from"./chunk-JWPE2WC7-DVkC9VGo.js";import{s as Nt,g as zt,q as Lt,p as Tt,a as At,b as Xt,_ as u,X as Et,A as Yt,D as J,l as Q,G as It,d as Bt,r as Ft,c as V}from"./mermaid.core-AyrJkBES.js";import{p as Rt}from"./cynefin-OW5HDTMX-CPood6cS.js";import"./index-DkFoMtS9.js";import"./FilePreviewLoading-BpXuDpA6.js";import"./use-form-common-props-aW2VizjT.js";import"./el-scrollbar-CAv8RTkM.js";import"./el-input-DXiJfMQi.js";import"./mobile-dialog-return-service-CMPAsgq2.js";import"./BusyIndicator-5ngQiuWi.js";import"./isArrayLikeObject-aUauz_pZ.js";import"./_baseIteratee-Bj5EHk2A.js";import"./union-BhZpN_Qj.js";import"./_baseFindIndex-D7XfJLKM.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:m}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,m,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),m=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const mt=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(mt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(wt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],w=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,w=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,w=f/x,P=-l/x,N=i+w*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,w=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:w}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),y=[];if(x.forEach((w,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);y.push(N)}),y.length>0){let w=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();w=Math.max(w,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=w+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as rt}from"./uuid-BmNSYLtZ.js";import{ax as Vo,am as Ko,eM as Tt,eN as Qo,m as we,ap as Yo,o as r,J as ie,K as ve,p as je,N as w,n as u,a6 as Ee,L as d,Y as m,Z as ce,a8 as wt,d5 as pn,k as te,cO as Jo,B as Xo,f as K,aF as Zo,au as ea,eO as ta,eP as na,eQ as Mt,eR as no,t as l,A as it,eS as oa,af as lt,e as Ye,eT as aa,w as xe,ab as Pe,eU as ia,M as Be,co as oo,eV as on,eW as sa,eX as $e,eY as ra,eZ as la,e_ as gn,r as ao,cp as ca,cz as io,aK as an,T as dt,ac as ze,a1 as He,X as T,a5 as hn,q as oe,V as be,H as le,at as so,_ as Ie,d0 as da,$ as Oe,e$ as yn,Q as kn,f0 as ua,e0 as ma,a0 as $t,dP as fa,as as vt,a3 as Se,aw as bn,e2 as va,f1 as pa,l as wn,c9 as ga,a4 as In,bx as Ve,aY as ha,aP as ya}from"./index-BLTGs0dA.js";import{l as En,i as ka,r as ba,a as wa,C as Cn,b as Sn,c as Tn,m as Ia,d as xn,e as Ct,f as pe,g as Ea,h as Ca,j as Sa,k as An,n as Bt,o as Ta,p as xa}from"./conversation-history-ylB1Umkj.js";import{E as Aa}from"./message-box-service-DmUALwu3.js";import{A as Rn,r as Ra,g as ro,E as lo,e as co,M as Pa,H as Pn,t as $a,B as $n,p as _a,h as xt,n as Et,o as sn,q as _n,F as Da}from"./FilePreviewLoading-qr43XfwQ.js";import{e as uo}from"./error-presentation-C444Bghw.js";import{a as Je,E as mo}from"./el-input-BmBr8IOJ.js";import{M as he}from"./MarIcon-BZ-1QXF7.js";import{B as st}from"./BusyIndicator-D47nHa7A.js";import{o as fo,a as La,E as Ma}from"./el-checkbox-D17hJ4Dr.js";import{a as Oa,E as Na}from"./el-radio-CALZyPzO.js";/* empty css */import{E as qa}from"./el-scrollbar-D7-PnASV.js";import{f as ot,p as Ot}from"./time-presentation-B_mK4Ifi.js";/* empty css */import{C as Ua,E as Ba,b as Fa,a as ja}from"./el-select-N0VzjsJx.js";/* empty css */import{E as vo,u as Kt,m as Qt}from"./mobile-dialog-return-service-CI9iHfKa.js";import{l as Dn,r as Ln}from"./runner-presentation-CGI7Ox9r.js";const Ha=Ko({...fo(Tt,["ariaLabel","gpuAcceleration","rawContent"]),placement:Rn.placement,tabindex:Rn.tabindex,effect:{...Tt.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...Tt.offset,default:void 0},persistent:{...Tt.persistent,default:!0}}),Ga={"update:visible":e=>Vo(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...fo(Qo,["gpuAcceleration"])});var Wa=we({name:"ElPopover",__name:"popover",props:Ha,emits:Ga,setup(e,{expose:t,emit:n}){const o=e,a=n,s=te(()=>{const R=pn.props;return Jo(o,Xo(R)?R:Object.keys(R))}),i=Yo("popover"),c=K(),f=te(()=>d(c)?.popperRef),g=te(()=>[{width:Zo(o.width)},o.popperStyle]),p=te(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),v=te(()=>o.transition===`${i.namespace.value}-fade-in-linear`),b=()=>{c.value?.hide()},C=()=>{a("before-enter")},q=()=>{a("before-leave")},_=()=>{a("after-enter")},M=()=>{a("update:visible",!1),a("after-leave")};return t({popperRef:f,hide:b}),(R,O)=>(r(),ie(d(pn),wt({ref_key:"tooltipRef",ref:c},s.value,{"aria-label":e.title,"popper-class":p.value,"popper-style":g.value,"gpu-acceleration":v.value,onBeforeShow:C,onBeforeHide:q,onShow:_,onHide:M}),{content:ve(()=>[e.title?(r(),u("div",{key:0,class:Ee(d(i).e("title")),role:"title"},m(e.title),3)):w("v-if",!0),je(R.$slots,"default",{hide:b},()=>[ce(m(e.content),1)])]),default:ve(()=>[R.$slots.reference?je(R.$slots,"reference",{key:0}):w("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),za=Wa;const Mn=(e,t)=>{const n=(t.arg||t.value)?.popperRef;n&&(n.triggerRef=e)};var Va={mounted(e,t){Mn(e,t)},updated(e,t){Mn(e,t)}};const Ka="popover",Qa=ta(Va,Ka),po=ea(za,{directive:Qa});function Fp(e,t,n,o=rt()){const a=na.parse({...t,id:o}),s=[...e,a],i=Mt("mar_references",{references:s});if(n.length+i.length+1>no)throw new Error("COMPOSER_TAG_INVALID");return s}function Yt(e){const t=e.customTitle?.trim();if(t)return t;const n=e.runnerTitle?.trim();return n===void 0||n===""||n==="Untitled session"||n.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):n}function go(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function jp(e){return!go(e)}function Hp(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function ho(e){return e.activity!==void 0?e.activity:"IDLE"}function Gp(e){return{RUNNING:l("generated.sessionPresentation.running"),IDLE:l("generated.sessionPresentation.ready")}[ho(e)]}function Ya(e){return{STARTING:l("generated.sessionPresentation.starting"),RUNNING:l("generated.sessionPresentation.running2"),SUCCEEDED:l("generated.sessionPresentation.completed"),FAILED:l("generated.sessionPresentation.failed"),CANCELLED:l("generated.sessionPresentation.cancelled"),INTERRUPTED:l("generated.sessionPresentation.interrupted"),LOST:l("generated.sessionPresentation.connectionLost")}[e]??e}const Ja=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function On(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function Xa(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.kind=="string"&&t.kind.length>0&&typeof t.status=="string"&&t.status.length>0}function Nt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.turnId=="string"&&t.turnId.length>0&&typeof t.sessionId=="string"&&t.sessionId.length>0&&(t.runId===null||typeof t.runId=="string"&&t.runId.length>0)&&typeof t.index=="number"&&Number.isInteger(t.index)&&t.index>=0&&typeof t.status=="string"&&Ja.has(t.status)&&Array.isArray(t.items)&&t.items.every(Xa)&&On(t.startedAt)&&On(t.completedAt)}function yo(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return;const n=e;if(!(n.unit!=="SEGMENT"||!Array.isArray(n.segments)||!n.segments.every(Nt)||new Set(n.segments.map(a=>a.sessionId)).size>1))return ct({unit:"SEGMENT",segments:n.segments,nextCursor:typeof n.nextCursor=="string"?n.nextCursor:null,...typeof n.snapshotSequence=="number"?{snapshotSequence:n.snapshotSequence}:t===void 0?{}:{snapshotSequence:t},...n.source==="official"||n.source==="native"||n.source==="runtime"?{source:n.source}:{},...typeof n.readAt=="number"?{readAt:n.readAt}:{},...typeof n.latestVisibleAt=="number"?{latestVisibleAt:n.latestVisibleAt}:{},...n.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ct(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const t=e;if(!t.segments.every(Nt))throw new Error("The conversation Segment response contains an invalid Segment.");return{...t,turns:t.segments.map(n=>({id:n.id,turnId:n.turnId,segmentIndex:n.index,sessionId:n.sessionId,runId:n.runId,status:n.status,...n.rewind===void 0?{}:{rewind:n.rewind},items:n.items,...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completedAt===void 0?{}:{completedAt:n.completedAt}}))}}function Ft(e,t){const n=[...e];for(const[o,a]of t.entries()){const s=n.findIndex(c=>c.id===a.id);if(s>=0){const c=n[s],f=a.rewind??(c.sessionId===a.sessionId?c.rewind:void 0);n.splice(s,1,f===void 0?a:{...a,rewind:f});continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=n.findIndex(g=>g.turnId===a.turnId&&g.segmentIndex!==void 0&&g.segmentIndex>a.segmentIndex),f=n.findLastIndex(g=>g.turnId===a.turnId);if(c>=0||f>=0){n.splice(c>=0?c:f+1,0,a);continue}}const i=t.slice(o+1).find(c=>n.some(f=>f.id===c.id));if(i!==void 0){n.splice(n.findIndex(c=>c.id===i.id),0,a);continue}n.push(a)}return n}function ko(e,t,n){const o=e.findLastIndex(i=>i.runId===t&&(n===void 0||(i.turnId??i.id)===n));if(o<0)return-1;const a=e[o].turnId??e[o].id;let s=o;for(const[i,c]of e.entries())c.runId===t&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[s].segmentIndex??-1)&&(s=i);return s}function Za(e,t,n){const o=ko(e,t);return e.map((a,s)=>s===o&&a.status!==n?{...a,status:n}:a)}function ei(e){let t,n,o,a,s,i=0,c=!1,f=!1,g=0;function p(){t!==void 0&&clearTimeout(t),o?.abort(new it("WATCH_CANCELLED","The watch was stopped or replaced.")),t=void 0,o=void 0,n=void 0,a=void 0,s=void 0,i=0,c=!1,f=!1,g=0}function v(){t!==void 0&&clearTimeout(t),t=void 0,c=!0}async function b(R,O,h){const I=setTimeout(()=>h.abort(new it("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(R,h.signal,O),o!==h||a!==R)return;s=Date.now(),i=0,f=!1,g=0}catch(k){if(o!==h||a!==R)return;const A=h.signal.aborted&&k instanceof Error&&k.name==="AbortError"?h.signal.reason:k;if(e.recovery!==void 0&&(O==="renew"||f)){e.recovery.onFailure(A),O==="initial"&&(g+=1),!c&&e.recovery.retryable(A)&&g<e.maxFailures?f=!0:(v(),e.onExpired());return}if(O==="initial")throw c=!0,i=0,s=void 0,A;i+=1;const B=s!==void 0&&Date.now()-s>=e.confirmationTimeoutMs;(i>=e.maxFailures||B)&&(e.onExpired(),i=0,s=void 0)}finally{clearTimeout(I)}}function C(R,O){if(c||n!==void 0||a!==R||!e.eligible(R))return n;const h=new AbortController;o=h;const I=b(R,O,h).finally(()=>{n===I&&(n=void 0,o=void 0,q(R))});return n=I,I}function q(R){t!==void 0&&clearTimeout(t),!(c||a!==R)&&(t=setTimeout(()=>{t=void 0,C(R,f?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function _(R,O=!1){if(!e.eligible(R)){p();return}if(a===R){if(n!==void 0)return n;if(t!==void 0)return}if(p(),c=!1,a=R,!O)return C(R,"initial");q(R)}function M(R){a===R&&(s=Date.now(),i=0)}return{start:_,pause:v,stop:p,confirm:M,isWatching:R=>a===R}}function Wp(e){const t=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),n=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,s,i,c,f,g;const p=lt();let v,b=0,C;function q(x=new it("WATCH_CANCELLED","The watch was stopped or replaced.")){const $=C;$!==void 0&&(C=void 0,g=void 0,$.removeAbortListener(),$.reject(x))}function _(x,$,P){return q(),new Promise((Y,ne)=>{const W=()=>{C?.watchId===$&&q(P?.reason instanceof Error?P.reason:new it("WATCH_CANCELLED","The watch was stopped or replaced."))};P?.addEventListener("abort",W,{once:!0}),C={sessionId:x,watchId:$,resolve:Y,reject:ne,removeAbortListener:()=>P?.removeEventListener("abort",W),events:[]},P?.aborted===!0&&W()})}function M(x){return n()&&e.selectedSessionId.value===x&&O(x)}function R(x){return O(x.id)}function O(x){return!x.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function h(x,$,P="renew"){if(!n())return;const Y=e.workspaceTarget.value?.nodeId,ne=e.workspaceTarget.value?.workspaceId,W=t();if(Y===void 0||ne===void 0||W===void 0||e.selectedSessionId.value!==x)return;P==="initial"?(p.value=void 0,o=rt().replace(/-/g,""),f=void 0,a=x,s=Y,i=ne):o??=rt().replace(/-/g,"");const H=o,X=P==="initial"?_(x,H,$):void 0;X?.catch(()=>{});let de=!1,ae;try{if(ae=await e.request(`/api/agent-sessions/${e.sessionPathId(x)}/watch`,{method:"POST",body:JSON.stringify({nodeId:Y,workspaceId:ne,workbenchConnectionId:W,watchId:H,mode:P,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...$===void 0?{}:{signal:$}}),de=!0,e.workspaceTarget.value?.nodeId!==Y||e.workspaceTarget.value?.workspaceId!==ne||e.selectedSessionId.value!==x||t()!==W||o!==H){C?.watchId===H&&q(),await X?.catch(()=>{});return}typeof ae?.nodeGeneration=="string"&&a===x&&(f=ae.nodeGeneration),await X}catch(re){throw C?.watchId===H&&q(),await X?.catch(()=>{}),de&&Ye(re)==="WATCH_REQUEST_TIMEOUT"?new it("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):re}}const I=ei({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:M,renew:(x,$,P)=>h(x,$,P),onExpired:e.refreshSnapshot});function k(x,$={}){if(!n())return;const P=t();if(a===x&&c!==P)return B(x,$.preserveFailures!==!0);a!==x&&(o=rt().replace(/-/g,""),f=void 0,$.preserveFailures!==!0&&(b=0),a=x,s=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=P);const Y=I.start(x,$.skipImmediateRenew===!0),ne=o,W=Y?.then(()=>{if(o!==ne||t()!==P)throw new it("WATCH_CANCELLED","The watch was stopped or replaced.")});return W?.catch(()=>{}),W}function A(){g=void 0,p.value=void 0,q();const x=a,$=o,P=s,Y=i,ne=c;a=void 0,s=void 0,i=void 0,c=void 0,o=void 0,f=void 0,b=0,v!==void 0&&clearTimeout(v),v=void 0,I.stop(),!(x===void 0||$===void 0||P===void 0||Y===void 0||ne===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(x)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:P,workspaceId:Y,workbenchConnectionId:ne,watchId:$,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function B(x,$=!0){const P=e.workspaceTarget.value,Y=o!==void 0&&f!==void 0&&c===t()&&s===P?.nodeId&&i===P?.workspaceId&&a===x?{id:o,generation:f}:void 0;return p.value=void 0,v!==void 0&&clearTimeout(v),v=void 0,q(),g=Y,I.stop(),a=void 0,s=void 0,i=void 0,c=void 0,o=void 0,f=void 0,$&&(b=0),k(x,{preserveFailures:!$})}function j(x){return B(x)??Promise.resolve()}function N(){v!==void 0&&clearTimeout(v),v=void 0,I.pause()}function Z(x){if(typeof x!="object"||x===null)return!1;const $=x,P=e.workspaceTarget.value,Y=$.type==="watch.session.event"&&C!==void 0&&g!==void 0&&$.watchId===g.id&&$.nodeGeneration===g.generation;if($.type!=="watch.session.snapshot"&&$.type!=="watch.session.event"||$.workbenchConnectionId!==t()||$.workbenchConnectionId!==c||$.nodeId!==P?.nodeId||$.nodeId!==s||$.workspaceId!==P?.workspaceId||$.workspaceId!==i||$.sessionId!==e.selectedSessionId.value||$.sessionId!==a||o===void 0||$.watchId!==o&&!Y||typeof $.nodeGeneration!="string"||f!==void 0&&$.nodeGeneration!==f)return!1;Y||(f??=$.nodeGeneration),b=0;const ne=a;if(ne===void 0)return!1;if($.type==="watch.session.event"){const ae=$.event;if(ae!==void 0&&typeof ae.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ae.category))&&"payload"in ae){const re={nodeId:$.nodeId,sequence:ae.sequence,category:ae.category,payload:ae.payload};C?.sessionId===ne&&C.watchId===o?C.events.push({event:re,generation:$.nodeGeneration}):e.applyEvent?.(re)}return!0}if($.payload===void 0)return!1;const W=$.payload,H=W.kind==="session-watch-snapshot"&&typeof W.sequence=="number"&&typeof W.session=="object"&&W.session!==null&&Array.isArray(W.runs)?W:void 0;if(H!==void 0){e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"session",payload:{session:H.session}});const ae=H.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ae);else for(const re of ae)e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"run",payload:{run:re}});typeof H.queue=="object"&&H.queue!==null&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"queue",payload:{sessionId:ne,queue:H.queue}},"initial"),"context"in H&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"session",payload:{sessionId:ne,context:H.context}}),H.performance!==void 0&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"conversation",payload:{sessionId:ne,performance:H.performance}})}const X=H?.conversation??$.payload,de=yo(X)??ct(X);if(C?.sessionId===ne&&C.watchId===o){const ae=C;C=void 0,g=void 0,ae.removeAbortListener(),e.applySnapshot(ne,de,$.historyReset===!0?"reset":"initial"),p.value={watchId:ae.watchId,nodeId:$.nodeId,workspaceId:$.workspaceId,sessionId:ne,connectionId:$.workbenchConnectionId};const re=typeof H?.sequence=="number"?H.sequence:de.snapshotSequence,V=new Set(de.turns.map(E=>E.id));for(const{event:E,generation:U}of ae.events){if(U!==$.nodeGeneration)continue;const Q=E.category==="conversation"?de.snapshotSequence??re:re;if(Q!==void 0&&E.sequence<=Q){if($.historyReset===!0||E.category!=="conversation")continue;const se=E.payload;if(se?.turn!==void 0||!Array.isArray(se?.segments))continue;const ee=se.segments.filter(ge=>typeof ge?.id=="string"&&!V.has(ge.id));ee.length>0&&e.applyEvent?.({...E,payload:{...se,segments:ee}});continue}e.applyEvent?.(E)}return ae.resolve(),!0}return Promise.resolve(e.applySnapshot(ne,de,$.historyReset===!0?"reset":"refresh")).then(ae=>{if(ae&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function D(x){if(x.type!=="watch.failed"||x.watchType!=="session"||x.watchId!==o||x.workbenchConnectionId!==t()||x.sessionId!==a||x.nodeId!==e.workspaceTarget.value?.nodeId||x.workspaceId!==i||typeof x.nodeGeneration!="string"||f!==void 0&&x.nodeGeneration!==f)return!1;f??=x.nodeGeneration;const $=a;return $===void 0?!0:C?.sessionId===$&&C.watchId===o?(q(new it(oa(x.code)?x.code:"SESSION_HISTORY_INITIAL_FAILED",typeof x.message=="string"&&x.message.length>0&&x.message.length<=1e3?x.message:"Unable to load the initial session snapshot.")),I.pause(),!0):b>=3?(A(),e.refreshSnapshot(),!0):(b+=1,I.pause(),v=setTimeout(()=>{v=void 0,e.selectedSessionId.value===$&&B($,!1)},Math.min(e.heartbeatMs,1e3*2**(b-1))),!0)}function J(){document.visibilityState!=="visible"&&A()}function S(x,$){x!==void 0&&$!==void 0&&x.id===e.selectedSessionId.value&&ho(x)==="RUNNING"&&$.id===x.id&&R($)&&k($.id)}return{hasInitialSessionSnapshot:x=>p.value!==void 0&&p.value.watchId===o&&p.value.nodeId===e.workspaceTarget.value?.nodeId&&p.value.workspaceId===e.workspaceTarget.value?.workspaceId&&p.value.sessionId===x&&e.selectedSessionId.value===x&&p.value.connectionId===t(),canWatchSessionHistory:x=>n()&&R(x),initializeSelectedSessionWatch:j,beginSelectedSessionWatch:k,restartSelectedSessionWatch:B,pauseSelectedSessionWatch:N,stopSelectedSessionWatch:A,reconcileWorkspaceSnapshot:S,handleEvent(x){return typeof x!="object"||x===null?!1:D(x)||Z(x)},handleSessionWatchVisibility:J}}const ti=new TextEncoder;function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Jt(e,t){if(e===t)return!0;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every((a,s)=>Jt(a,t[s]));if(!Nn(e)||!Nn(t))return!1;const n=Object.keys(e).filter(a=>e[a]!==void 0),o=Object.keys(t).filter(a=>t[a]!==void 0);return n.length===o.length&&n.every(a=>Object.hasOwn(t,a)&&Jt(e[a],t[a]))}function ni(e){const t=lt([]),n=K(null),o=oi({...e,turns:t,nextCursor:n});return{turns:t,nextCursor:n,projection:o}}function oi(e){const t=new Map,n=new Map,o=new Map;let a=0,s=0;const i=new Map;let c,f=!1;const g=e.scheduleTextDeltaFlush??(E=>{if(typeof requestAnimationFrame=="function"){const U=requestAnimationFrame(E);return()=>cancelAnimationFrame(U)}return queueMicrotask(E),()=>{}}),p=E=>`${E.sessionId}:${E.id}`,v=(E,U)=>`${p(E)}:${U}`;function b(E,U){if(U.length<E.length){const Q=new Set(U.map(ee=>p(ee))),se=new Set(U.map(ee=>ee.runId));for(const ee of E){if(Q.has(p(ee)))continue;t.delete(p(ee));const ge=`${p(ee)}:`;for(const Ae of n.keys())Ae.startsWith(ge)&&n.delete(Ae);Ct(ee)&&!se.has(ee.runId)&&o.delete(ee.runId)}}}function C(E){b(e.turns.value,E),e.turns.value=[...E]}function q(){C(e.limitHistory(e.turns.value))}function _(){return e.turns.value.length<=Cn?!1:(C(Sn(e.turns.value,xn)),e.nextCursor.value=null,!0)}function M(){Y(),n.clear(),t.clear(),o.clear(),s=0,a=0}function R(E){M()}function O(E,U){M(),e.turns.value=[...E],e.nextCursor.value=U}function h(E){const U=new Set(e.turns.value.map(Q=>Q.id));e.turns.value=e.limitHistory([...E.turns.filter(Q=>!U.has(Q.id)),...e.turns.value]),e.nextCursor.value=E.nextCursor}function I(E){$();const U=e.turns.value,Q=new Map(U.map(ee=>[p(ee),ee])),se=E.turns.map(ee=>{const ge=Q.get(p(ee));return ge!==void 0&&X(ee,E.snapshotSequence)?ge:ee});e.turns.value=e.limitHistory(Ft(U,se)),e.nextCursor.value=E.nextCursor}function k(){e.nextCursor.value=null}function A(E,U){e.turns.value=Za(e.turns.value,E,U)}function B(E,U){$();const Q=`${E}:`;for(const se of t.keys())se.startsWith(Q)&&t.delete(se);for(const se of n.keys())se.startsWith(Q)&&n.delete(se);for(const se of U)o.delete(se)}function j(E,U){if(U===void 0)return;a=Math.max(a,U);const Q=p(E);t.set(Q,Math.max(t.get(Q)??0,U))}function N(E,U){return ko(e.turns.value,E,U)}function Z(E,U){return U!==void 0&&U<=(o.get(E)??-1)}function D(E,U){const Q=typeof U.segmentId=="string"?U.segmentId:void 0,se=typeof U.turnId=="string"?U.turnId:void 0;if(Q===void 0){if(typeof U.itemId=="string"){const z=e.turns.value.findIndex(ke=>ke.runId===E&&(se===void 0||(ke.turnId??ke.id)===se)&&ke.items.some(Te=>Te.id===U.itemId));if(z>=0)return z}return N(E,se)}const ee=e.turns.value.findIndex(z=>z.id===Q&&(z.runId===E||z.runId===null));if(ee>=0)return e.turns.value[ee].runId===null&&(e.turns.value=e.turns.value.map((z,ke)=>ke===ee?{...z,runId:E}:z)),ee;if(se===void 0||typeof U.segmentIndex!="number"||!Number.isInteger(U.segmentIndex)||U.segmentIndex<0)return-1;$();const ge=N(E,se),Ae=ge>=0?ge:e.turns.value.findLastIndex(z=>z.turnId===se&&z.runId===null),ye=e.turns.value[Ae];if(ye===void 0)return-1;const F=U.segmentIndex;if(F<=(ye.segmentIndex??-1))return-1;const G={...ye,id:Q,turnId:se,runId:E,segmentIndex:F,items:[],startedAt:null,completedAt:null};return e.turns.value=Ft(e.turns.value,[{...ye,status:"SUCCEEDED"},G]),_()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(z=>z.id===Q&&z.runId===E)}function J(E,U,Q){if(Z(E,Q))return;const se=D(E,U),ee=e.turns.value[se];if(ee===void 0||ai(ee.status))return;const ge=typeof U.itemId=="string"?U.itemId:void 0,Ae=ge===void 0?void 0:ee.items.find(ye=>ye.id===ge&&ye.kind==="assistant_message");if(!(Ae!==void 0&&Rt(Ae.status))&&!(ge!==void 0&&Q!==void 0&&Q<=(n.get(v(ee,ge))??-1)))return{turnIndex:se,turn:ee}}function S(E,U,Q,se=Date.now()){$();const ee=pe(U);if(ee===void 0)return!1;const{itemId:ge,kind:Ae,status:ye}=ee;if(typeof ge!="string"||typeof Ae!="string"||typeof ye!="string"||Z(E,Q))return!1;const F=D(E,ee);if(F<0)return!1;const G=e.turns.value[F],z=G.items.findIndex(y=>y.id===ge),ke=z<0?void 0:G.items[z],Te=v(G,ge);if(Q!==void 0&&Q<=(n.get(Te)??Number.NEGATIVE_INFINITY)||ke!==void 0&&Rt(ke.status)&&!Rt(ye))return!1;const qe=At(se)?se:Date.now(),Ce=G.items.at(-1),Re=G.items.map(y=>y.id===Ce?.id&&y.kind==="assistant_message"&&y.status==="IN_PROGRESS"?{...y,status:"COMPLETED",completedAt:qe}:y),Le=At(ee.startedAt)?ee.startedAt:ke?.startedAt??qe,Ue=ee.completedAt===null?null:At(ee.completedAt)?ee.completedAt:Rt(ye)?ke?.completedAt??qe:ke?.completedAt??null,fe={id:ge,kind:Ae,status:ye,...ee.processGroup===void 0?{}:{processGroup:aa.parse(ee.processGroup)},...typeof ee.parentItemId=="string"?{parentItemId:ee.parentItemId}:{},startedAt:Le,completedAt:Ue,payload:Tn(ee.merge===!0&&ke!==void 0?Ia(ke.payload,ee.payload,ee.append):ee.payload)};return z<0?Re.push(fe):Re.splice(z,1,fe),e.turns.value=e.turns.value.map((y,L)=>L===F?{...y,items:Re,startedAt:y.startedAt??fe.startedAt}:y),Q!==void 0&&n.set(Te,Q),j(G,Q),q(),!0}function x(E,U,Q,se=Date.now()){const ee=pe(U),ge=ee?.text;if(typeof ge!="string"||ge.length===0||ee===void 0)return!1;const Ae=J(E,ee,Q);if(Ae===void 0)return!1;const{turnIndex:ye,turn:F}=Ae,G=typeof ee?.itemId=="string"?ee.itemId:void 0,z=F.items.at(-1),ke=G===void 0&&z?.kind==="assistant_message"&&z.status==="IN_PROGRESS",Te=G===void 0?ke?F.items.length-1:-1:F.items.findIndex(L=>L.id===G&&L.kind==="assistant_message"),qe=Te>=0?F.items[Te].id:G??`${E}:assistant:${Q??"live"}`,Ce=Te<0?void 0:F.items[Te],Re=v(F,qe);if(Q!==void 0&&Q<=(n.get(Re)??Number.NEGATIVE_INFINITY))return!1;const Le=pe(Ce?.payload),Ue=`${typeof Le?.text=="string"?Le.text:""}${ge}`,fe={id:qe,kind:"assistant_message",status:"IN_PROGRESS",startedAt:Ce?.startedAt??(At(se)?se:Date.now()),completedAt:null,payload:{...Le??{},...Tn({text:Ue}),format:"markdown",model:null}},y=[...F.items];return Te<0?y.push(fe):y.splice(Te,1,fe),e.turns.value=e.turns.value.map((L,ue)=>ue===ye?{...L,items:y,startedAt:L.startedAt??fe.startedAt}:L),Q!==void 0&&n.set(Re,Q),s+=ti.encode(ge).byteLength,s>=64*1024?(j(F,Q),q(),s=0,!0):(j(F,Q),!0)}function $(){c?.(),c=void 0,f=!1,P()}function P(){if(i.size===0)return;const E=[...i.values()];i.clear();for(const U of E)x(U.runId,U,U.sequence,U.createdAt)}function Y(){c?.(),c=void 0,f=!1,i.clear()}function ne(E,U,Q,se=Date.now()){const ee=pe(U),ge=ee?.text;if(typeof ge!="string"||ge.length===0)return!1;const Ae=ee!==void 0&&typeof ee.itemId=="string"?ee.itemId:void 0;if(ee===void 0)return!1;const ye=J(E,ee,Q);if(ye===void 0)return!1;const F=ye.turn,G=`${E}\0${F.id}\0${Ae??""}`,z=i.get(G);if(z!==void 0&&Q!==void 0&&Q<=(z.sequence??-1))return!1;if(z===void 0?i.set(G,{runId:E,...Ae===void 0?{}:{itemId:Ae},turnId:F.turnId??F.id,...F.segmentIndex===void 0?{}:{segmentId:F.id,segmentIndex:F.segmentIndex},text:ge,chunks:[{text:ge,sequence:Q}],...Q===void 0?{}:{sequence:Q},createdAt:se}):(z.text+=ge,z.chunks.push({text:ge,sequence:Q}),Q!==void 0&&(z.sequence=Q)),!f){f=!0;const ke=g(()=>{f=!1,c=void 0,P()});f?c=ke:ke()}return!0}function W(E,U){j(E,U),!(!Ct(E)||U===void 0)&&o.set(E.runId,Math.max(o.get(E.runId)??0,U))}function H(E){return E.snapshotSequence!==void 0&&E.snapshotSequence<a}function X(E,U){const Q=t.get(p(E));return Q!==void 0&&U!==void 0&&Q>U}function de(E,U){if($(),U!=="segment-update"&&H(E))return!1;const Q=e.turns.value,ee=E.turns.map(En),ge=new Map(Q.map(Ce=>[Ce.id,Ce])),Ae=ee.map(Ce=>{const Re=ge.get(Ce.id);if(Re===void 0)return j(Ce,E.snapshotSequence),Ce;if(X(Ce,E.snapshotSequence))return Re;j(Ce,E.snapshotSequence);const Le=Re.items.filter(ka);return Le.length===0?Ce:{...Ce,items:ba(Ce.items,Re.items,Le)}}),ye=wa(Ft(Q,Ae)),F=Q.at(-1)?.id,G=ye.findIndex(Ce=>Ce.id===F),ke=ye.slice(G+1).some(Ce=>!ge.has(Ce.id))&&ye.length>Cn,Te=e.limitHistory(ke?Sn(ye,xn):ye).map(Ce=>{const Re=ge.get(Ce.id);return Re!==void 0&&Jt(Re,Ce)?Re:Ce}),qe=Q.length!==Te.length||Q.some((Ce,Re)=>Ce!==Te[Re]);return b(ye,Te),ke&&(e.nextCursor.value=null),!ke&&e.nextCursor.value===null&&E.nextCursor!==null&&Te[0]?.id===E.turns[0]?.id&&(e.nextCursor.value=E.nextCursor),qe&&(e.turns.value=Te),ke&&e.onRecentWindowOverflow(),qe}function ae(E){return $(),H(E)?!1:(re(E),!0)}function re(E){const U=E.turns.map(En),Q=[...i.values()];M(),e.turns.value=e.limitHistory(U),e.nextCursor.value=E.nextCursor,a=E.snapshotSequence??0;for(const se of e.turns.value)W(se,E.snapshotSequence);for(const se of Q){const ee=E.snapshotSequence;if(ee===void 0)continue;const ge=se.chunks.filter(Ae=>Ae.sequence!==void 0&&Ae.sequence>ee);ge.length!==0&&x(se.runId,{...se,text:ge.map(Ae=>Ae.text).join("")},ge.at(-1).sequence,se.createdAt)}}function V(E){return $(),H(E)?!1:(re(E),!0)}return{resetHistory:M,restore:R,restoreWindow:O,mergeOlderPage:h,recoverWindow:I,clearCursor:k,syncRunStatus:A,clearSession:B,markLive:j,mergeItem:S,mergeTextDelta:ne,flushPendingTextDeltas:$,mergeLatest:de,replaceRecent:ae,replaceAuthoritative:V}}function At(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Rt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function ai(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function bo(e){const t=Xt(e);return t?.kind==="context_compaction"&&t.status==="COMPLETED"}function ii(e){const t=Xt(e),n=Xt(t?.payload);return bo(e)&&n?.retainedContext===!0}function zp(e,t){return bo(e)?ii(e)?null:t==null?t:{...t,usedTokens:0,percentage:0,...t.gcCount===void 0?{}:{gcCount:0},...t.gcCount===void 0&&t.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:t}function Vp(e){const{turns:t,nextCursor:n,projection:o}=ni({onRecentWindowOverflow:e,limitHistory:Ea});let a=0,s;const i=K(0);function c(){s!==void 0&&(clearTimeout(s.timer),s.resolve(),s=void 0)}function f(){c(),i.value+=1;const p=i.value;return new Promise(v=>{const b=setTimeout(()=>{s?.version===p&&(s=void 0,v())},1e4);s={version:p,resolve:v,timer:b}})}function g(p){s?.version===p&&c()}return{turns:t,nextCursor:n,projection:o,loadingInitial:K(!1),initialLoadFailed:K(!1),initialFailureCause:lt(),loadingOlder:K(!1),channelInput:K(""),channelToken:K(),contextUsage:K(),initialRenderVersion:i,beginInitialRender:f,confirmInitialRender:g,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function si(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function ri(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.workspaceId=="string"&&(e.runner==="codex"||e.runner==="claude-code"||e.runner==="opencode"||e.runner==="mar-agent")&&!e.id.startsWith("draft:")}function Kp(e){function t(a,s){const i=e.setNodeConnection?.(a,s);s&&i===!1&&e.onNodeConnected(a)}function n(a,s="event"){const i=pe(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){t(a.nodeId,i.connected);return}if(a.category==="workspace"&&i!==void 0){typeof i.workspaceId=="string"&&typeof i.topic=="string"&&e.invalidateWorkspace(a.nodeId,i.workspaceId,i.topic);return}if(a.category==="queue"&&i!==void 0){const{sessionId:v,queue:b}=i;if(typeof v=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof b=="object"&&b!==null){const C=e.selectedSession?.value,q=C?.id===v&&C.workspaceId===e.workspaceTarget.value?.workspaceId?C:e.sessions.value.find(_=>_.id===v&&_.workspaceId===e.workspaceTarget.value?.workspaceId);q!==void 0&&go(q)&&e.cacheQueue(a.nodeId,q.workspaceId,v,b,s),v===e.selectedSessionId.value&&e.mergeQueue(b,s)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const v=i.session;if(ri(v)){const b=v.id===e.selectedSessionId.value;b&&v.activity!==void 0&&v.activity!=="RUNNING"&&e.settleSessionRuns(v.id),e.mergeSessions([v]),b&&v.activity==="RUNNING"&&e.observeSessionRunning(v.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&si(i.run)){const v=i.run;if(e.syncTurnStatus(v.id,v.status,v.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(v),v.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const b=e.acceptRun(v);["STARTING","RUNNING","CANCELLING"].includes(b.status)&&e.openRun(v.id)}return}if(a.category!=="conversation"||i===void 0)return;if(i.performance!==void 0){a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&e.receivePerformance?.(i.sessionId,i.performance);return}const c=pe(i.item);if(c!==void 0&&typeof i.runId=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeItem(i.runId,c,a.sequence,typeof c.startedAt=="number"?c.startedAt:void 0);return}const f=pe(i.delta);if(f!==void 0&&typeof f.runId=="string"&&typeof f.itemId=="string"&&typeof f.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(f.runId,f,a.sequence,typeof f.createdAt=="number"?f.createdAt:void 0);return}const g=yo(i.snapshot,a.sequence);if(g!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const v=g.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);v!==void 0&&e.applyConversationSnapshot(v,g,"refresh");return}const p=i.turn;if(p===void 0&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&Array.isArray(i.segments)&&i.segments.every(v=>Nt(v)&&v.sessionId===i.sessionId)){const v=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});e.mergeTurns(v,"segment-update")&&v.turns.length===1&&e.cacheTurn(v.turns[0]);return}if(Ca(p)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(Nt))return;const v=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(v.length===0)return;for(const b of v)e.markLiveTurn(b,a.sequence),e.cacheTurn(b);p.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:v,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&n(a)}return{apply:n,applyBroadcast:o,updateNodeConnection:t}}function Qp(e){let t=!1,n=!1,o=0;const a=K("");function s(){o+=1,t=!1,n=!1,e.loadingOlder.value=!1,a.value=""}xe([e.workspaceTarget,e.selectedSessionId],s,{flush:"sync"});async function i(){await c(e.pageSize)}async function c(v){const b=e.workspaceTarget.value?.nodeId,C=e.selectedSessionId.value,q=e.nextCursor.value;if(b===void 0||C===void 0||q===null||e.loadingOlder.value||t)return;const _=o;e.loadingOlder.value=!0,a.value="";let M=q;try{let R;try{R=await f(b,C,v,M)}catch(h){if(Ye(h)!=="EVENT_CURSOR_INVALID")throw h;if(e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==M)return;const I=await g(b,C,M,_);if(I===void 0||e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==(I??M))return;if(I===null){const k=e.capturePrependAnchor();e.clearCursor(),await Pe(),o===_&&e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&e.nextCursor.value===null&&k();return}M=I,R=await f(b,C,v,M)}if(e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==M)return;const O=e.capturePrependAnchor();e.mergeOlderPage(R),await Pe(),o===_&&e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&O()}catch(R){e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&o===_&&e.nextCursor.value===M&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(R)}))}finally{o===_&&(e.loadingOlder.value=!1)}}async function f(v,b,C,q){const _=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${C}&cursor=${encodeURIComponent(q)}&unit=SEGMENT`);return ct(_)}async function g(v,b,C,q){const _=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),M=ct(_);if(e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b||o!==q||e.nextCursor.value!==C)return;const R=M.nextCursor===null?{...M,nextCursor:C}:M;if(e.recoverWindow(R),await Pe(),!(e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b||o!==q||e.nextCursor.value!==R.nextCursor))return M.nextCursor}async function p(){const v=e.workspaceTarget.value?.nodeId,b=e.selectedSessionId.value;if(v===void 0||b===void 0)return;if(t){n=!0;return}t=!0;let C=o;try{do{n=!1,C=++o,e.loadingOlder.value=!1,a.value="";const q=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),_=ct(q);if(o!==C||e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b)return;n||e.replaceRecent(_)}while(n)}catch{}finally{o===C&&(t=!1)}}return{resetWindow:s,olderHistoryError:a,loadOlderConversationTurns:i,refreshRecentConversationTurns:p}}const li=28,qn=48;function Yp(){const e=K(),t=K(!0),n=K(!1);let o,a,s,i=0,c;function f(h){e.value=h,o=h?.clientWidth,a=h?.clientHeight,s=h?.scrollHeight,i=h?.scrollTop??0,c=void 0}function g(h){const I=h.clientWidth!==o||h.clientHeight!==a||h.scrollHeight!==s;return o=h.clientWidth,a=h.clientHeight,s=h.scrollHeight,I}function p(h){const I=h.getBoundingClientRect(),k=h.ownerDocument.elementFromPoint(I.left+I.width/2,I.top+I.height/2);c=k!==null&&k!==h&&h.contains(k)?{element:k,top:k.getBoundingClientRect().top}:void 0}function v(h){const I=e.value;if(I===void 0||n.value)return;const k=g(I),A=c!==void 0&&I.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,B=!A&&I.scrollTop<i-1,j=!A&&I.scrollTop>i,N=I.scrollHeight-I.scrollTop-I.clientHeight;if(i=I.scrollTop,k&&(!B&&!j||t.value&&N<=1)){t.value?q():c===void 0&&p(I);return}t.value=!B&&(t.value||j)&&N<li,t.value?c=void 0:(B||j||c===void 0)&&p(I),B&&I.scrollTop<qn&&I.scrollHeight>I.clientHeight+qn&&h()}function b(){const h=e.value;h===void 0||!g(h)||!t.value||O()}function C(){const h=e.value;h!==void 0&&(t.value=!1,n.value=!1,g(h),i=h.scrollTop,p(h))}function q(){const h=e.value;h!==void 0&&(h.scrollTop=h.scrollHeight,i=h.scrollTop,t.value=!0,c=void 0)}function _(h){const I=e.value;if(I===void 0)return()=>{};const k=I.scrollHeight,A=I.scrollTop,B=h&&t.value;return()=>{if(!(e.value!==I||I.scrollTop!==A)){if(B){t.value&&(q(),g(I));return}I.scrollTop=A+(I.scrollHeight-k),i=I.scrollTop,g(I),t.value||p(I)}}}function M(){return _(!0)}function R(){return _(!1)}async function O(h=()=>!0){const I=e.value;I===void 0||!h()||(q(),await Pe(),!(e.value!==I||!t.value||!h())&&(q(),await new Promise(k=>requestAnimationFrame(()=>k())),!(e.value!==I||!t.value||!h())&&(q(),await new Promise(k=>setTimeout(k,50)),!(e.value!==I||!t.value||!h())&&q())))}return{element:e,following:t,positioningInitialConversation:n,setElement:f,handleScroll:v,handleResize:b,stopFollowing:C,scrollToLatest:q,captureRenderAnchor:M,capturePrependAnchor:R,scrollToLatestAfterLayout:O}}const ci=5e3;function Zt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function Jp(){const e=di(),t={};return{...e.bind(()=>t),clear:e.clear,transferSession:(n,o)=>e.transfer(t,t,n,o)}}function di(){let e=new WeakMap;const t=new Map,n=new Set,o=new WeakMap;function a(v){const b=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let C=t.get(b);return C===void 0&&(C={},t.set(b,C),o.set(C,b)),C}const s=K(0),i={};function c(v){let b=e.get(v);return b===void 0&&(b={slots:new Set([v]),tokens:lt([])},e.set(v,b)),b}function f(v){const b=te(()=>(s.value,c(v()??i)));function C(q,_,M=ci){const R=b.value;if(R.tokens.value.length!==0)return;const O={group:R,context:q,active:!0};function h(){return O.active?(O.active=!1,clearTimeout(O.timeout),n.delete(h),O.group.tokens.value=O.group.tokens.value.filter(I=>I!==O),!0):!1}return R.tokens.value=[...R.tokens.value,O],n.add(h),M!==null&&(O.timeout=setTimeout(()=>{h()&&_?.()},M)),h}return{pending:te(()=>b.value.tokens.value.length!==0),context:te(()=>b.value.tokens.value.find(q=>q.context!==void 0)?.context),begin:C}}function g(v,b,C,q,_=!1){const M=e.get(v);if(M===void 0)return;const R=e.get(b)??M;for(const O of M.tokens.value)O.context===Zt(C)&&(O.context=Zt(q)),O.group=R;if(R!==M){R.tokens.value=[...R.tokens.value,...M.tokens.value];for(const O of M.slots)e.set(O,R),R.slots.add(O)}else R.tokens.value=[...R.tokens.value];if(e.set(b,R),R.slots.add(b),_&&v!==b){e.delete(v),R.slots.delete(v);const O=o.get(v);O!==void 0&&t.get(O)===v&&t.delete(O)}s.value+=1}function p(){for(const v of n)v();t.clear(),e=new WeakMap,s.value+=1}return{bind:f,transfer:g,forTarget:a,clear:p}}const Xp="";function Zp(e,t=[]){const n=e??K(t);function o(f){if(n.value.some(p=>p.name===f.name))return!1;const g={name:f.name,source:f.source,skillFilePath:f.skillFilePath,available:!0};return n.value=[...n.value,g],!0}function a(f){n.value=n.value.filter(g=>g.name!==f)}function s(){n.value=[]}function i(f){n.value=f.filter(wo)}function c(f){const g=new Map(f.map(p=>[p.name,p]));n.value=n.value.map(p=>{const v=g.get(p.name);return v===void 0?{...p,available:!1}:{name:v.name,source:v.source,skillFilePath:v.skillFilePath,available:!0}})}return{tokens:n,select:o,remove:a,clear:s,restore:i,reconcile:c}}function ui(e,t,n=[]){const o=[t,e.length>0?Mt("mar_skills",{action:"use",instruction:ia,skills:e.map(a=>({name:a.name,source:a.source,path:a.skillFilePath}))}):"",n.length>0?Mt("mar_references",{references:[...n]}):""].filter(a=>a.length>0).join(`
|
|
1
|
+
import{c as rt}from"./uuid-BmNSYLtZ.js";import{ax as Vo,am as Ko,eM as Tt,eN as Qo,m as we,ap as Yo,o as r,J as ie,K as ve,p as je,N as w,n as u,a6 as Ee,L as d,Y as m,Z as ce,a8 as wt,d5 as pn,k as te,cO as Jo,B as Xo,f as K,aF as Zo,au as ea,eO as ta,eP as na,eQ as Mt,eR as no,t as l,A as it,eS as oa,af as lt,e as Ye,eT as aa,w as xe,ab as Pe,eU as ia,M as Be,co as oo,eV as on,eW as sa,eX as $e,eY as ra,eZ as la,e_ as gn,r as ao,cp as ca,cz as io,aK as an,T as dt,ac as ze,a1 as He,X as T,a5 as hn,q as oe,V as be,H as le,at as so,_ as Ie,d0 as da,$ as Oe,e$ as yn,Q as kn,f0 as ua,e0 as ma,a0 as $t,dP as fa,as as vt,a3 as Se,aw as bn,e2 as va,f1 as pa,l as wn,c9 as ga,a4 as In,bx as Ve,aY as ha,aP as ya}from"./index-DkFoMtS9.js";import{l as En,i as ka,r as ba,a as wa,C as Cn,b as Sn,c as Tn,m as Ia,d as xn,e as Ct,f as pe,g as Ea,h as Ca,j as Sa,k as An,n as Bt,o as Ta,p as xa}from"./conversation-history-BJnCnWsO.js";import{E as Aa}from"./message-box-service-Dd9NpeG9.js";import{A as Rn,r as Ra,g as ro,E as lo,e as co,M as Pa,H as Pn,t as $a,B as $n,p as _a,h as xt,n as Et,o as sn,q as _n,F as Da}from"./FilePreviewLoading-BpXuDpA6.js";import{e as uo}from"./error-presentation-VdWvFs_r.js";import{a as Je,E as mo}from"./el-input-DXiJfMQi.js";import{M as he}from"./MarIcon-DbZF7ZoI.js";import{B as st}from"./BusyIndicator-5ngQiuWi.js";import{o as fo,a as La,E as Ma}from"./el-checkbox-DFFxo6V9.js";import{a as Oa,E as Na}from"./el-radio-DMosrAkv.js";/* empty css */import{E as qa}from"./el-scrollbar-CAv8RTkM.js";import{f as ot,p as Ot}from"./time-presentation-m0je1moW.js";/* empty css */import{C as Ua,E as Ba,b as Fa,a as ja}from"./el-select-BHkUpOhW.js";/* empty css */import{E as vo,u as Kt,m as Qt}from"./mobile-dialog-return-service-CMPAsgq2.js";import{l as Dn,r as Ln}from"./runner-presentation-BOS6GbrS.js";const Ha=Ko({...fo(Tt,["ariaLabel","gpuAcceleration","rawContent"]),placement:Rn.placement,tabindex:Rn.tabindex,effect:{...Tt.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...Tt.offset,default:void 0},persistent:{...Tt.persistent,default:!0}}),Ga={"update:visible":e=>Vo(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...fo(Qo,["gpuAcceleration"])});var Wa=we({name:"ElPopover",__name:"popover",props:Ha,emits:Ga,setup(e,{expose:t,emit:n}){const o=e,a=n,s=te(()=>{const R=pn.props;return Jo(o,Xo(R)?R:Object.keys(R))}),i=Yo("popover"),c=K(),f=te(()=>d(c)?.popperRef),g=te(()=>[{width:Zo(o.width)},o.popperStyle]),p=te(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),v=te(()=>o.transition===`${i.namespace.value}-fade-in-linear`),b=()=>{c.value?.hide()},C=()=>{a("before-enter")},q=()=>{a("before-leave")},_=()=>{a("after-enter")},M=()=>{a("update:visible",!1),a("after-leave")};return t({popperRef:f,hide:b}),(R,O)=>(r(),ie(d(pn),wt({ref_key:"tooltipRef",ref:c},s.value,{"aria-label":e.title,"popper-class":p.value,"popper-style":g.value,"gpu-acceleration":v.value,onBeforeShow:C,onBeforeHide:q,onShow:_,onHide:M}),{content:ve(()=>[e.title?(r(),u("div",{key:0,class:Ee(d(i).e("title")),role:"title"},m(e.title),3)):w("v-if",!0),je(R.$slots,"default",{hide:b},()=>[ce(m(e.content),1)])]),default:ve(()=>[R.$slots.reference?je(R.$slots,"reference",{key:0}):w("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),za=Wa;const Mn=(e,t)=>{const n=(t.arg||t.value)?.popperRef;n&&(n.triggerRef=e)};var Va={mounted(e,t){Mn(e,t)},updated(e,t){Mn(e,t)}};const Ka="popover",Qa=ta(Va,Ka),po=ea(za,{directive:Qa});function Fp(e,t,n,o=rt()){const a=na.parse({...t,id:o}),s=[...e,a],i=Mt("mar_references",{references:s});if(n.length+i.length+1>no)throw new Error("COMPOSER_TAG_INVALID");return s}function Yt(e){const t=e.customTitle?.trim();if(t)return t;const n=e.runnerTitle?.trim();return n===void 0||n===""||n==="Untitled session"||n.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):n}function go(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function jp(e){return!go(e)}function Hp(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function ho(e){return e.activity!==void 0?e.activity:"IDLE"}function Gp(e){return{RUNNING:l("generated.sessionPresentation.running"),IDLE:l("generated.sessionPresentation.ready")}[ho(e)]}function Ya(e){return{STARTING:l("generated.sessionPresentation.starting"),RUNNING:l("generated.sessionPresentation.running2"),SUCCEEDED:l("generated.sessionPresentation.completed"),FAILED:l("generated.sessionPresentation.failed"),CANCELLED:l("generated.sessionPresentation.cancelled"),INTERRUPTED:l("generated.sessionPresentation.interrupted"),LOST:l("generated.sessionPresentation.connectionLost")}[e]??e}const Ja=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function On(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function Xa(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.kind=="string"&&t.kind.length>0&&typeof t.status=="string"&&t.status.length>0}function Nt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.turnId=="string"&&t.turnId.length>0&&typeof t.sessionId=="string"&&t.sessionId.length>0&&(t.runId===null||typeof t.runId=="string"&&t.runId.length>0)&&typeof t.index=="number"&&Number.isInteger(t.index)&&t.index>=0&&typeof t.status=="string"&&Ja.has(t.status)&&Array.isArray(t.items)&&t.items.every(Xa)&&On(t.startedAt)&&On(t.completedAt)}function yo(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return;const n=e;if(!(n.unit!=="SEGMENT"||!Array.isArray(n.segments)||!n.segments.every(Nt)||new Set(n.segments.map(a=>a.sessionId)).size>1))return ct({unit:"SEGMENT",segments:n.segments,nextCursor:typeof n.nextCursor=="string"?n.nextCursor:null,...typeof n.snapshotSequence=="number"?{snapshotSequence:n.snapshotSequence}:t===void 0?{}:{snapshotSequence:t},...n.source==="official"||n.source==="native"||n.source==="runtime"?{source:n.source}:{},...typeof n.readAt=="number"?{readAt:n.readAt}:{},...typeof n.latestVisibleAt=="number"?{latestVisibleAt:n.latestVisibleAt}:{},...n.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ct(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const t=e;if(!t.segments.every(Nt))throw new Error("The conversation Segment response contains an invalid Segment.");return{...t,turns:t.segments.map(n=>({id:n.id,turnId:n.turnId,segmentIndex:n.index,sessionId:n.sessionId,runId:n.runId,status:n.status,...n.rewind===void 0?{}:{rewind:n.rewind},items:n.items,...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completedAt===void 0?{}:{completedAt:n.completedAt}}))}}function Ft(e,t){const n=[...e];for(const[o,a]of t.entries()){const s=n.findIndex(c=>c.id===a.id);if(s>=0){const c=n[s],f=a.rewind??(c.sessionId===a.sessionId?c.rewind:void 0);n.splice(s,1,f===void 0?a:{...a,rewind:f});continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=n.findIndex(g=>g.turnId===a.turnId&&g.segmentIndex!==void 0&&g.segmentIndex>a.segmentIndex),f=n.findLastIndex(g=>g.turnId===a.turnId);if(c>=0||f>=0){n.splice(c>=0?c:f+1,0,a);continue}}const i=t.slice(o+1).find(c=>n.some(f=>f.id===c.id));if(i!==void 0){n.splice(n.findIndex(c=>c.id===i.id),0,a);continue}n.push(a)}return n}function ko(e,t,n){const o=e.findLastIndex(i=>i.runId===t&&(n===void 0||(i.turnId??i.id)===n));if(o<0)return-1;const a=e[o].turnId??e[o].id;let s=o;for(const[i,c]of e.entries())c.runId===t&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[s].segmentIndex??-1)&&(s=i);return s}function Za(e,t,n){const o=ko(e,t);return e.map((a,s)=>s===o&&a.status!==n?{...a,status:n}:a)}function ei(e){let t,n,o,a,s,i=0,c=!1,f=!1,g=0;function p(){t!==void 0&&clearTimeout(t),o?.abort(new it("WATCH_CANCELLED","The watch was stopped or replaced.")),t=void 0,o=void 0,n=void 0,a=void 0,s=void 0,i=0,c=!1,f=!1,g=0}function v(){t!==void 0&&clearTimeout(t),t=void 0,c=!0}async function b(R,O,h){const I=setTimeout(()=>h.abort(new it("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(R,h.signal,O),o!==h||a!==R)return;s=Date.now(),i=0,f=!1,g=0}catch(k){if(o!==h||a!==R)return;const A=h.signal.aborted&&k instanceof Error&&k.name==="AbortError"?h.signal.reason:k;if(e.recovery!==void 0&&(O==="renew"||f)){e.recovery.onFailure(A),O==="initial"&&(g+=1),!c&&e.recovery.retryable(A)&&g<e.maxFailures?f=!0:(v(),e.onExpired());return}if(O==="initial")throw c=!0,i=0,s=void 0,A;i+=1;const B=s!==void 0&&Date.now()-s>=e.confirmationTimeoutMs;(i>=e.maxFailures||B)&&(e.onExpired(),i=0,s=void 0)}finally{clearTimeout(I)}}function C(R,O){if(c||n!==void 0||a!==R||!e.eligible(R))return n;const h=new AbortController;o=h;const I=b(R,O,h).finally(()=>{n===I&&(n=void 0,o=void 0,q(R))});return n=I,I}function q(R){t!==void 0&&clearTimeout(t),!(c||a!==R)&&(t=setTimeout(()=>{t=void 0,C(R,f?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function _(R,O=!1){if(!e.eligible(R)){p();return}if(a===R){if(n!==void 0)return n;if(t!==void 0)return}if(p(),c=!1,a=R,!O)return C(R,"initial");q(R)}function M(R){a===R&&(s=Date.now(),i=0)}return{start:_,pause:v,stop:p,confirm:M,isWatching:R=>a===R}}function Wp(e){const t=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),n=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,s,i,c,f,g;const p=lt();let v,b=0,C;function q(x=new it("WATCH_CANCELLED","The watch was stopped or replaced.")){const $=C;$!==void 0&&(C=void 0,g=void 0,$.removeAbortListener(),$.reject(x))}function _(x,$,P){return q(),new Promise((Y,ne)=>{const W=()=>{C?.watchId===$&&q(P?.reason instanceof Error?P.reason:new it("WATCH_CANCELLED","The watch was stopped or replaced."))};P?.addEventListener("abort",W,{once:!0}),C={sessionId:x,watchId:$,resolve:Y,reject:ne,removeAbortListener:()=>P?.removeEventListener("abort",W),events:[]},P?.aborted===!0&&W()})}function M(x){return n()&&e.selectedSessionId.value===x&&O(x)}function R(x){return O(x.id)}function O(x){return!x.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function h(x,$,P="renew"){if(!n())return;const Y=e.workspaceTarget.value?.nodeId,ne=e.workspaceTarget.value?.workspaceId,W=t();if(Y===void 0||ne===void 0||W===void 0||e.selectedSessionId.value!==x)return;P==="initial"?(p.value=void 0,o=rt().replace(/-/g,""),f=void 0,a=x,s=Y,i=ne):o??=rt().replace(/-/g,"");const H=o,X=P==="initial"?_(x,H,$):void 0;X?.catch(()=>{});let de=!1,ae;try{if(ae=await e.request(`/api/agent-sessions/${e.sessionPathId(x)}/watch`,{method:"POST",body:JSON.stringify({nodeId:Y,workspaceId:ne,workbenchConnectionId:W,watchId:H,mode:P,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...$===void 0?{}:{signal:$}}),de=!0,e.workspaceTarget.value?.nodeId!==Y||e.workspaceTarget.value?.workspaceId!==ne||e.selectedSessionId.value!==x||t()!==W||o!==H){C?.watchId===H&&q(),await X?.catch(()=>{});return}typeof ae?.nodeGeneration=="string"&&a===x&&(f=ae.nodeGeneration),await X}catch(re){throw C?.watchId===H&&q(),await X?.catch(()=>{}),de&&Ye(re)==="WATCH_REQUEST_TIMEOUT"?new it("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):re}}const I=ei({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:M,renew:(x,$,P)=>h(x,$,P),onExpired:e.refreshSnapshot});function k(x,$={}){if(!n())return;const P=t();if(a===x&&c!==P)return B(x,$.preserveFailures!==!0);a!==x&&(o=rt().replace(/-/g,""),f=void 0,$.preserveFailures!==!0&&(b=0),a=x,s=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=P);const Y=I.start(x,$.skipImmediateRenew===!0),ne=o,W=Y?.then(()=>{if(o!==ne||t()!==P)throw new it("WATCH_CANCELLED","The watch was stopped or replaced.")});return W?.catch(()=>{}),W}function A(){g=void 0,p.value=void 0,q();const x=a,$=o,P=s,Y=i,ne=c;a=void 0,s=void 0,i=void 0,c=void 0,o=void 0,f=void 0,b=0,v!==void 0&&clearTimeout(v),v=void 0,I.stop(),!(x===void 0||$===void 0||P===void 0||Y===void 0||ne===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(x)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:P,workspaceId:Y,workbenchConnectionId:ne,watchId:$,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function B(x,$=!0){const P=e.workspaceTarget.value,Y=o!==void 0&&f!==void 0&&c===t()&&s===P?.nodeId&&i===P?.workspaceId&&a===x?{id:o,generation:f}:void 0;return p.value=void 0,v!==void 0&&clearTimeout(v),v=void 0,q(),g=Y,I.stop(),a=void 0,s=void 0,i=void 0,c=void 0,o=void 0,f=void 0,$&&(b=0),k(x,{preserveFailures:!$})}function j(x){return B(x)??Promise.resolve()}function N(){v!==void 0&&clearTimeout(v),v=void 0,I.pause()}function Z(x){if(typeof x!="object"||x===null)return!1;const $=x,P=e.workspaceTarget.value,Y=$.type==="watch.session.event"&&C!==void 0&&g!==void 0&&$.watchId===g.id&&$.nodeGeneration===g.generation;if($.type!=="watch.session.snapshot"&&$.type!=="watch.session.event"||$.workbenchConnectionId!==t()||$.workbenchConnectionId!==c||$.nodeId!==P?.nodeId||$.nodeId!==s||$.workspaceId!==P?.workspaceId||$.workspaceId!==i||$.sessionId!==e.selectedSessionId.value||$.sessionId!==a||o===void 0||$.watchId!==o&&!Y||typeof $.nodeGeneration!="string"||f!==void 0&&$.nodeGeneration!==f)return!1;Y||(f??=$.nodeGeneration),b=0;const ne=a;if(ne===void 0)return!1;if($.type==="watch.session.event"){const ae=$.event;if(ae!==void 0&&typeof ae.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ae.category))&&"payload"in ae){const re={nodeId:$.nodeId,sequence:ae.sequence,category:ae.category,payload:ae.payload};C?.sessionId===ne&&C.watchId===o?C.events.push({event:re,generation:$.nodeGeneration}):e.applyEvent?.(re)}return!0}if($.payload===void 0)return!1;const W=$.payload,H=W.kind==="session-watch-snapshot"&&typeof W.sequence=="number"&&typeof W.session=="object"&&W.session!==null&&Array.isArray(W.runs)?W:void 0;if(H!==void 0){e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"session",payload:{session:H.session}});const ae=H.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ae);else for(const re of ae)e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"run",payload:{run:re}});typeof H.queue=="object"&&H.queue!==null&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"queue",payload:{sessionId:ne,queue:H.queue}},"initial"),"context"in H&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"session",payload:{sessionId:ne,context:H.context}}),H.performance!==void 0&&e.applyEvent?.({nodeId:$.nodeId,sequence:H.sequence,category:"conversation",payload:{sessionId:ne,performance:H.performance}})}const X=H?.conversation??$.payload,de=yo(X)??ct(X);if(C?.sessionId===ne&&C.watchId===o){const ae=C;C=void 0,g=void 0,ae.removeAbortListener(),e.applySnapshot(ne,de,$.historyReset===!0?"reset":"initial"),p.value={watchId:ae.watchId,nodeId:$.nodeId,workspaceId:$.workspaceId,sessionId:ne,connectionId:$.workbenchConnectionId};const re=typeof H?.sequence=="number"?H.sequence:de.snapshotSequence,V=new Set(de.turns.map(E=>E.id));for(const{event:E,generation:U}of ae.events){if(U!==$.nodeGeneration)continue;const Q=E.category==="conversation"?de.snapshotSequence??re:re;if(Q!==void 0&&E.sequence<=Q){if($.historyReset===!0||E.category!=="conversation")continue;const se=E.payload;if(se?.turn!==void 0||!Array.isArray(se?.segments))continue;const ee=se.segments.filter(ge=>typeof ge?.id=="string"&&!V.has(ge.id));ee.length>0&&e.applyEvent?.({...E,payload:{...se,segments:ee}});continue}e.applyEvent?.(E)}return ae.resolve(),!0}return Promise.resolve(e.applySnapshot(ne,de,$.historyReset===!0?"reset":"refresh")).then(ae=>{if(ae&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function D(x){if(x.type!=="watch.failed"||x.watchType!=="session"||x.watchId!==o||x.workbenchConnectionId!==t()||x.sessionId!==a||x.nodeId!==e.workspaceTarget.value?.nodeId||x.workspaceId!==i||typeof x.nodeGeneration!="string"||f!==void 0&&x.nodeGeneration!==f)return!1;f??=x.nodeGeneration;const $=a;return $===void 0?!0:C?.sessionId===$&&C.watchId===o?(q(new it(oa(x.code)?x.code:"SESSION_HISTORY_INITIAL_FAILED",typeof x.message=="string"&&x.message.length>0&&x.message.length<=1e3?x.message:"Unable to load the initial session snapshot.")),I.pause(),!0):b>=3?(A(),e.refreshSnapshot(),!0):(b+=1,I.pause(),v=setTimeout(()=>{v=void 0,e.selectedSessionId.value===$&&B($,!1)},Math.min(e.heartbeatMs,1e3*2**(b-1))),!0)}function J(){document.visibilityState!=="visible"&&A()}function S(x,$){x!==void 0&&$!==void 0&&x.id===e.selectedSessionId.value&&ho(x)==="RUNNING"&&$.id===x.id&&R($)&&k($.id)}return{hasInitialSessionSnapshot:x=>p.value!==void 0&&p.value.watchId===o&&p.value.nodeId===e.workspaceTarget.value?.nodeId&&p.value.workspaceId===e.workspaceTarget.value?.workspaceId&&p.value.sessionId===x&&e.selectedSessionId.value===x&&p.value.connectionId===t(),canWatchSessionHistory:x=>n()&&R(x),initializeSelectedSessionWatch:j,beginSelectedSessionWatch:k,restartSelectedSessionWatch:B,pauseSelectedSessionWatch:N,stopSelectedSessionWatch:A,reconcileWorkspaceSnapshot:S,handleEvent(x){return typeof x!="object"||x===null?!1:D(x)||Z(x)},handleSessionWatchVisibility:J}}const ti=new TextEncoder;function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Jt(e,t){if(e===t)return!0;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every((a,s)=>Jt(a,t[s]));if(!Nn(e)||!Nn(t))return!1;const n=Object.keys(e).filter(a=>e[a]!==void 0),o=Object.keys(t).filter(a=>t[a]!==void 0);return n.length===o.length&&n.every(a=>Object.hasOwn(t,a)&&Jt(e[a],t[a]))}function ni(e){const t=lt([]),n=K(null),o=oi({...e,turns:t,nextCursor:n});return{turns:t,nextCursor:n,projection:o}}function oi(e){const t=new Map,n=new Map,o=new Map;let a=0,s=0;const i=new Map;let c,f=!1;const g=e.scheduleTextDeltaFlush??(E=>{if(typeof requestAnimationFrame=="function"){const U=requestAnimationFrame(E);return()=>cancelAnimationFrame(U)}return queueMicrotask(E),()=>{}}),p=E=>`${E.sessionId}:${E.id}`,v=(E,U)=>`${p(E)}:${U}`;function b(E,U){if(U.length<E.length){const Q=new Set(U.map(ee=>p(ee))),se=new Set(U.map(ee=>ee.runId));for(const ee of E){if(Q.has(p(ee)))continue;t.delete(p(ee));const ge=`${p(ee)}:`;for(const Ae of n.keys())Ae.startsWith(ge)&&n.delete(Ae);Ct(ee)&&!se.has(ee.runId)&&o.delete(ee.runId)}}}function C(E){b(e.turns.value,E),e.turns.value=[...E]}function q(){C(e.limitHistory(e.turns.value))}function _(){return e.turns.value.length<=Cn?!1:(C(Sn(e.turns.value,xn)),e.nextCursor.value=null,!0)}function M(){Y(),n.clear(),t.clear(),o.clear(),s=0,a=0}function R(E){M()}function O(E,U){M(),e.turns.value=[...E],e.nextCursor.value=U}function h(E){const U=new Set(e.turns.value.map(Q=>Q.id));e.turns.value=e.limitHistory([...E.turns.filter(Q=>!U.has(Q.id)),...e.turns.value]),e.nextCursor.value=E.nextCursor}function I(E){$();const U=e.turns.value,Q=new Map(U.map(ee=>[p(ee),ee])),se=E.turns.map(ee=>{const ge=Q.get(p(ee));return ge!==void 0&&X(ee,E.snapshotSequence)?ge:ee});e.turns.value=e.limitHistory(Ft(U,se)),e.nextCursor.value=E.nextCursor}function k(){e.nextCursor.value=null}function A(E,U){e.turns.value=Za(e.turns.value,E,U)}function B(E,U){$();const Q=`${E}:`;for(const se of t.keys())se.startsWith(Q)&&t.delete(se);for(const se of n.keys())se.startsWith(Q)&&n.delete(se);for(const se of U)o.delete(se)}function j(E,U){if(U===void 0)return;a=Math.max(a,U);const Q=p(E);t.set(Q,Math.max(t.get(Q)??0,U))}function N(E,U){return ko(e.turns.value,E,U)}function Z(E,U){return U!==void 0&&U<=(o.get(E)??-1)}function D(E,U){const Q=typeof U.segmentId=="string"?U.segmentId:void 0,se=typeof U.turnId=="string"?U.turnId:void 0;if(Q===void 0){if(typeof U.itemId=="string"){const z=e.turns.value.findIndex(ke=>ke.runId===E&&(se===void 0||(ke.turnId??ke.id)===se)&&ke.items.some(Te=>Te.id===U.itemId));if(z>=0)return z}return N(E,se)}const ee=e.turns.value.findIndex(z=>z.id===Q&&(z.runId===E||z.runId===null));if(ee>=0)return e.turns.value[ee].runId===null&&(e.turns.value=e.turns.value.map((z,ke)=>ke===ee?{...z,runId:E}:z)),ee;if(se===void 0||typeof U.segmentIndex!="number"||!Number.isInteger(U.segmentIndex)||U.segmentIndex<0)return-1;$();const ge=N(E,se),Ae=ge>=0?ge:e.turns.value.findLastIndex(z=>z.turnId===se&&z.runId===null),ye=e.turns.value[Ae];if(ye===void 0)return-1;const F=U.segmentIndex;if(F<=(ye.segmentIndex??-1))return-1;const G={...ye,id:Q,turnId:se,runId:E,segmentIndex:F,items:[],startedAt:null,completedAt:null};return e.turns.value=Ft(e.turns.value,[{...ye,status:"SUCCEEDED"},G]),_()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(z=>z.id===Q&&z.runId===E)}function J(E,U,Q){if(Z(E,Q))return;const se=D(E,U),ee=e.turns.value[se];if(ee===void 0||ai(ee.status))return;const ge=typeof U.itemId=="string"?U.itemId:void 0,Ae=ge===void 0?void 0:ee.items.find(ye=>ye.id===ge&&ye.kind==="assistant_message");if(!(Ae!==void 0&&Rt(Ae.status))&&!(ge!==void 0&&Q!==void 0&&Q<=(n.get(v(ee,ge))??-1)))return{turnIndex:se,turn:ee}}function S(E,U,Q,se=Date.now()){$();const ee=pe(U);if(ee===void 0)return!1;const{itemId:ge,kind:Ae,status:ye}=ee;if(typeof ge!="string"||typeof Ae!="string"||typeof ye!="string"||Z(E,Q))return!1;const F=D(E,ee);if(F<0)return!1;const G=e.turns.value[F],z=G.items.findIndex(y=>y.id===ge),ke=z<0?void 0:G.items[z],Te=v(G,ge);if(Q!==void 0&&Q<=(n.get(Te)??Number.NEGATIVE_INFINITY)||ke!==void 0&&Rt(ke.status)&&!Rt(ye))return!1;const qe=At(se)?se:Date.now(),Ce=G.items.at(-1),Re=G.items.map(y=>y.id===Ce?.id&&y.kind==="assistant_message"&&y.status==="IN_PROGRESS"?{...y,status:"COMPLETED",completedAt:qe}:y),Le=At(ee.startedAt)?ee.startedAt:ke?.startedAt??qe,Ue=ee.completedAt===null?null:At(ee.completedAt)?ee.completedAt:Rt(ye)?ke?.completedAt??qe:ke?.completedAt??null,fe={id:ge,kind:Ae,status:ye,...ee.processGroup===void 0?{}:{processGroup:aa.parse(ee.processGroup)},...typeof ee.parentItemId=="string"?{parentItemId:ee.parentItemId}:{},startedAt:Le,completedAt:Ue,payload:Tn(ee.merge===!0&&ke!==void 0?Ia(ke.payload,ee.payload,ee.append):ee.payload)};return z<0?Re.push(fe):Re.splice(z,1,fe),e.turns.value=e.turns.value.map((y,L)=>L===F?{...y,items:Re,startedAt:y.startedAt??fe.startedAt}:y),Q!==void 0&&n.set(Te,Q),j(G,Q),q(),!0}function x(E,U,Q,se=Date.now()){const ee=pe(U),ge=ee?.text;if(typeof ge!="string"||ge.length===0||ee===void 0)return!1;const Ae=J(E,ee,Q);if(Ae===void 0)return!1;const{turnIndex:ye,turn:F}=Ae,G=typeof ee?.itemId=="string"?ee.itemId:void 0,z=F.items.at(-1),ke=G===void 0&&z?.kind==="assistant_message"&&z.status==="IN_PROGRESS",Te=G===void 0?ke?F.items.length-1:-1:F.items.findIndex(L=>L.id===G&&L.kind==="assistant_message"),qe=Te>=0?F.items[Te].id:G??`${E}:assistant:${Q??"live"}`,Ce=Te<0?void 0:F.items[Te],Re=v(F,qe);if(Q!==void 0&&Q<=(n.get(Re)??Number.NEGATIVE_INFINITY))return!1;const Le=pe(Ce?.payload),Ue=`${typeof Le?.text=="string"?Le.text:""}${ge}`,fe={id:qe,kind:"assistant_message",status:"IN_PROGRESS",startedAt:Ce?.startedAt??(At(se)?se:Date.now()),completedAt:null,payload:{...Le??{},...Tn({text:Ue}),format:"markdown",model:null}},y=[...F.items];return Te<0?y.push(fe):y.splice(Te,1,fe),e.turns.value=e.turns.value.map((L,ue)=>ue===ye?{...L,items:y,startedAt:L.startedAt??fe.startedAt}:L),Q!==void 0&&n.set(Re,Q),s+=ti.encode(ge).byteLength,s>=64*1024?(j(F,Q),q(),s=0,!0):(j(F,Q),!0)}function $(){c?.(),c=void 0,f=!1,P()}function P(){if(i.size===0)return;const E=[...i.values()];i.clear();for(const U of E)x(U.runId,U,U.sequence,U.createdAt)}function Y(){c?.(),c=void 0,f=!1,i.clear()}function ne(E,U,Q,se=Date.now()){const ee=pe(U),ge=ee?.text;if(typeof ge!="string"||ge.length===0)return!1;const Ae=ee!==void 0&&typeof ee.itemId=="string"?ee.itemId:void 0;if(ee===void 0)return!1;const ye=J(E,ee,Q);if(ye===void 0)return!1;const F=ye.turn,G=`${E}\0${F.id}\0${Ae??""}`,z=i.get(G);if(z!==void 0&&Q!==void 0&&Q<=(z.sequence??-1))return!1;if(z===void 0?i.set(G,{runId:E,...Ae===void 0?{}:{itemId:Ae},turnId:F.turnId??F.id,...F.segmentIndex===void 0?{}:{segmentId:F.id,segmentIndex:F.segmentIndex},text:ge,chunks:[{text:ge,sequence:Q}],...Q===void 0?{}:{sequence:Q},createdAt:se}):(z.text+=ge,z.chunks.push({text:ge,sequence:Q}),Q!==void 0&&(z.sequence=Q)),!f){f=!0;const ke=g(()=>{f=!1,c=void 0,P()});f?c=ke:ke()}return!0}function W(E,U){j(E,U),!(!Ct(E)||U===void 0)&&o.set(E.runId,Math.max(o.get(E.runId)??0,U))}function H(E){return E.snapshotSequence!==void 0&&E.snapshotSequence<a}function X(E,U){const Q=t.get(p(E));return Q!==void 0&&U!==void 0&&Q>U}function de(E,U){if($(),U!=="segment-update"&&H(E))return!1;const Q=e.turns.value,ee=E.turns.map(En),ge=new Map(Q.map(Ce=>[Ce.id,Ce])),Ae=ee.map(Ce=>{const Re=ge.get(Ce.id);if(Re===void 0)return j(Ce,E.snapshotSequence),Ce;if(X(Ce,E.snapshotSequence))return Re;j(Ce,E.snapshotSequence);const Le=Re.items.filter(ka);return Le.length===0?Ce:{...Ce,items:ba(Ce.items,Re.items,Le)}}),ye=wa(Ft(Q,Ae)),F=Q.at(-1)?.id,G=ye.findIndex(Ce=>Ce.id===F),ke=ye.slice(G+1).some(Ce=>!ge.has(Ce.id))&&ye.length>Cn,Te=e.limitHistory(ke?Sn(ye,xn):ye).map(Ce=>{const Re=ge.get(Ce.id);return Re!==void 0&&Jt(Re,Ce)?Re:Ce}),qe=Q.length!==Te.length||Q.some((Ce,Re)=>Ce!==Te[Re]);return b(ye,Te),ke&&(e.nextCursor.value=null),!ke&&e.nextCursor.value===null&&E.nextCursor!==null&&Te[0]?.id===E.turns[0]?.id&&(e.nextCursor.value=E.nextCursor),qe&&(e.turns.value=Te),ke&&e.onRecentWindowOverflow(),qe}function ae(E){return $(),H(E)?!1:(re(E),!0)}function re(E){const U=E.turns.map(En),Q=[...i.values()];M(),e.turns.value=e.limitHistory(U),e.nextCursor.value=E.nextCursor,a=E.snapshotSequence??0;for(const se of e.turns.value)W(se,E.snapshotSequence);for(const se of Q){const ee=E.snapshotSequence;if(ee===void 0)continue;const ge=se.chunks.filter(Ae=>Ae.sequence!==void 0&&Ae.sequence>ee);ge.length!==0&&x(se.runId,{...se,text:ge.map(Ae=>Ae.text).join("")},ge.at(-1).sequence,se.createdAt)}}function V(E){return $(),H(E)?!1:(re(E),!0)}return{resetHistory:M,restore:R,restoreWindow:O,mergeOlderPage:h,recoverWindow:I,clearCursor:k,syncRunStatus:A,clearSession:B,markLive:j,mergeItem:S,mergeTextDelta:ne,flushPendingTextDeltas:$,mergeLatest:de,replaceRecent:ae,replaceAuthoritative:V}}function At(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Rt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function ai(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function bo(e){const t=Xt(e);return t?.kind==="context_compaction"&&t.status==="COMPLETED"}function ii(e){const t=Xt(e),n=Xt(t?.payload);return bo(e)&&n?.retainedContext===!0}function zp(e,t){return bo(e)?ii(e)?null:t==null?t:{...t,usedTokens:0,percentage:0,...t.gcCount===void 0?{}:{gcCount:0},...t.gcCount===void 0&&t.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:t}function Vp(e){const{turns:t,nextCursor:n,projection:o}=ni({onRecentWindowOverflow:e,limitHistory:Ea});let a=0,s;const i=K(0);function c(){s!==void 0&&(clearTimeout(s.timer),s.resolve(),s=void 0)}function f(){c(),i.value+=1;const p=i.value;return new Promise(v=>{const b=setTimeout(()=>{s?.version===p&&(s=void 0,v())},1e4);s={version:p,resolve:v,timer:b}})}function g(p){s?.version===p&&c()}return{turns:t,nextCursor:n,projection:o,loadingInitial:K(!1),initialLoadFailed:K(!1),initialFailureCause:lt(),loadingOlder:K(!1),channelInput:K(""),channelToken:K(),contextUsage:K(),initialRenderVersion:i,beginInitialRender:f,confirmInitialRender:g,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function si(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function ri(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.workspaceId=="string"&&(e.runner==="codex"||e.runner==="claude-code"||e.runner==="opencode"||e.runner==="mar-agent")&&!e.id.startsWith("draft:")}function Kp(e){function t(a,s){const i=e.setNodeConnection?.(a,s);s&&i===!1&&e.onNodeConnected(a)}function n(a,s="event"){const i=pe(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){t(a.nodeId,i.connected);return}if(a.category==="workspace"&&i!==void 0){typeof i.workspaceId=="string"&&typeof i.topic=="string"&&e.invalidateWorkspace(a.nodeId,i.workspaceId,i.topic);return}if(a.category==="queue"&&i!==void 0){const{sessionId:v,queue:b}=i;if(typeof v=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof b=="object"&&b!==null){const C=e.selectedSession?.value,q=C?.id===v&&C.workspaceId===e.workspaceTarget.value?.workspaceId?C:e.sessions.value.find(_=>_.id===v&&_.workspaceId===e.workspaceTarget.value?.workspaceId);q!==void 0&&go(q)&&e.cacheQueue(a.nodeId,q.workspaceId,v,b,s),v===e.selectedSessionId.value&&e.mergeQueue(b,s)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const v=i.session;if(ri(v)){const b=v.id===e.selectedSessionId.value;b&&v.activity!==void 0&&v.activity!=="RUNNING"&&e.settleSessionRuns(v.id),e.mergeSessions([v]),b&&v.activity==="RUNNING"&&e.observeSessionRunning(v.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&si(i.run)){const v=i.run;if(e.syncTurnStatus(v.id,v.status,v.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(v),v.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const b=e.acceptRun(v);["STARTING","RUNNING","CANCELLING"].includes(b.status)&&e.openRun(v.id)}return}if(a.category!=="conversation"||i===void 0)return;if(i.performance!==void 0){a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&e.receivePerformance?.(i.sessionId,i.performance);return}const c=pe(i.item);if(c!==void 0&&typeof i.runId=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeItem(i.runId,c,a.sequence,typeof c.startedAt=="number"?c.startedAt:void 0);return}const f=pe(i.delta);if(f!==void 0&&typeof f.runId=="string"&&typeof f.itemId=="string"&&typeof f.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(f.runId,f,a.sequence,typeof f.createdAt=="number"?f.createdAt:void 0);return}const g=yo(i.snapshot,a.sequence);if(g!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const v=g.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);v!==void 0&&e.applyConversationSnapshot(v,g,"refresh");return}const p=i.turn;if(p===void 0&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&Array.isArray(i.segments)&&i.segments.every(v=>Nt(v)&&v.sessionId===i.sessionId)){const v=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});e.mergeTurns(v,"segment-update")&&v.turns.length===1&&e.cacheTurn(v.turns[0]);return}if(Ca(p)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(Nt))return;const v=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(v.length===0)return;for(const b of v)e.markLiveTurn(b,a.sequence),e.cacheTurn(b);p.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:v,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&n(a)}return{apply:n,applyBroadcast:o,updateNodeConnection:t}}function Qp(e){let t=!1,n=!1,o=0;const a=K("");function s(){o+=1,t=!1,n=!1,e.loadingOlder.value=!1,a.value=""}xe([e.workspaceTarget,e.selectedSessionId],s,{flush:"sync"});async function i(){await c(e.pageSize)}async function c(v){const b=e.workspaceTarget.value?.nodeId,C=e.selectedSessionId.value,q=e.nextCursor.value;if(b===void 0||C===void 0||q===null||e.loadingOlder.value||t)return;const _=o;e.loadingOlder.value=!0,a.value="";let M=q;try{let R;try{R=await f(b,C,v,M)}catch(h){if(Ye(h)!=="EVENT_CURSOR_INVALID")throw h;if(e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==M)return;const I=await g(b,C,M,_);if(I===void 0||e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==(I??M))return;if(I===null){const k=e.capturePrependAnchor();e.clearCursor(),await Pe(),o===_&&e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&e.nextCursor.value===null&&k();return}M=I,R=await f(b,C,v,M)}if(e.workspaceTarget.value?.nodeId!==b||e.selectedSessionId.value!==C||o!==_||e.nextCursor.value!==M)return;const O=e.capturePrependAnchor();e.mergeOlderPage(R),await Pe(),o===_&&e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&O()}catch(R){e.workspaceTarget.value?.nodeId===b&&e.selectedSessionId.value===C&&o===_&&e.nextCursor.value===M&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(R)}))}finally{o===_&&(e.loadingOlder.value=!1)}}async function f(v,b,C,q){const _=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${C}&cursor=${encodeURIComponent(q)}&unit=SEGMENT`);return ct(_)}async function g(v,b,C,q){const _=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),M=ct(_);if(e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b||o!==q||e.nextCursor.value!==C)return;const R=M.nextCursor===null?{...M,nextCursor:C}:M;if(e.recoverWindow(R),await Pe(),!(e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b||o!==q||e.nextCursor.value!==R.nextCursor))return M.nextCursor}async function p(){const v=e.workspaceTarget.value?.nodeId,b=e.selectedSessionId.value;if(v===void 0||b===void 0)return;if(t){n=!0;return}t=!0;let C=o;try{do{n=!1,C=++o,e.loadingOlder.value=!1,a.value="";const q=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/turns?nodeId=${encodeURIComponent(v)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),_=ct(q);if(o!==C||e.workspaceTarget.value?.nodeId!==v||e.selectedSessionId.value!==b)return;n||e.replaceRecent(_)}while(n)}catch{}finally{o===C&&(t=!1)}}return{resetWindow:s,olderHistoryError:a,loadOlderConversationTurns:i,refreshRecentConversationTurns:p}}const li=28,qn=48;function Yp(){const e=K(),t=K(!0),n=K(!1);let o,a,s,i=0,c;function f(h){e.value=h,o=h?.clientWidth,a=h?.clientHeight,s=h?.scrollHeight,i=h?.scrollTop??0,c=void 0}function g(h){const I=h.clientWidth!==o||h.clientHeight!==a||h.scrollHeight!==s;return o=h.clientWidth,a=h.clientHeight,s=h.scrollHeight,I}function p(h){const I=h.getBoundingClientRect(),k=h.ownerDocument.elementFromPoint(I.left+I.width/2,I.top+I.height/2);c=k!==null&&k!==h&&h.contains(k)?{element:k,top:k.getBoundingClientRect().top}:void 0}function v(h){const I=e.value;if(I===void 0||n.value)return;const k=g(I),A=c!==void 0&&I.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,B=!A&&I.scrollTop<i-1,j=!A&&I.scrollTop>i,N=I.scrollHeight-I.scrollTop-I.clientHeight;if(i=I.scrollTop,k&&(!B&&!j||t.value&&N<=1)){t.value?q():c===void 0&&p(I);return}t.value=!B&&(t.value||j)&&N<li,t.value?c=void 0:(B||j||c===void 0)&&p(I),B&&I.scrollTop<qn&&I.scrollHeight>I.clientHeight+qn&&h()}function b(){const h=e.value;h===void 0||!g(h)||!t.value||O()}function C(){const h=e.value;h!==void 0&&(t.value=!1,n.value=!1,g(h),i=h.scrollTop,p(h))}function q(){const h=e.value;h!==void 0&&(h.scrollTop=h.scrollHeight,i=h.scrollTop,t.value=!0,c=void 0)}function _(h){const I=e.value;if(I===void 0)return()=>{};const k=I.scrollHeight,A=I.scrollTop,B=h&&t.value;return()=>{if(!(e.value!==I||I.scrollTop!==A)){if(B){t.value&&(q(),g(I));return}I.scrollTop=A+(I.scrollHeight-k),i=I.scrollTop,g(I),t.value||p(I)}}}function M(){return _(!0)}function R(){return _(!1)}async function O(h=()=>!0){const I=e.value;I===void 0||!h()||(q(),await Pe(),!(e.value!==I||!t.value||!h())&&(q(),await new Promise(k=>requestAnimationFrame(()=>k())),!(e.value!==I||!t.value||!h())&&(q(),await new Promise(k=>setTimeout(k,50)),!(e.value!==I||!t.value||!h())&&q())))}return{element:e,following:t,positioningInitialConversation:n,setElement:f,handleScroll:v,handleResize:b,stopFollowing:C,scrollToLatest:q,captureRenderAnchor:M,capturePrependAnchor:R,scrollToLatestAfterLayout:O}}const ci=5e3;function Zt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function Jp(){const e=di(),t={};return{...e.bind(()=>t),clear:e.clear,transferSession:(n,o)=>e.transfer(t,t,n,o)}}function di(){let e=new WeakMap;const t=new Map,n=new Set,o=new WeakMap;function a(v){const b=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let C=t.get(b);return C===void 0&&(C={},t.set(b,C),o.set(C,b)),C}const s=K(0),i={};function c(v){let b=e.get(v);return b===void 0&&(b={slots:new Set([v]),tokens:lt([])},e.set(v,b)),b}function f(v){const b=te(()=>(s.value,c(v()??i)));function C(q,_,M=ci){const R=b.value;if(R.tokens.value.length!==0)return;const O={group:R,context:q,active:!0};function h(){return O.active?(O.active=!1,clearTimeout(O.timeout),n.delete(h),O.group.tokens.value=O.group.tokens.value.filter(I=>I!==O),!0):!1}return R.tokens.value=[...R.tokens.value,O],n.add(h),M!==null&&(O.timeout=setTimeout(()=>{h()&&_?.()},M)),h}return{pending:te(()=>b.value.tokens.value.length!==0),context:te(()=>b.value.tokens.value.find(q=>q.context!==void 0)?.context),begin:C}}function g(v,b,C,q,_=!1){const M=e.get(v);if(M===void 0)return;const R=e.get(b)??M;for(const O of M.tokens.value)O.context===Zt(C)&&(O.context=Zt(q)),O.group=R;if(R!==M){R.tokens.value=[...R.tokens.value,...M.tokens.value];for(const O of M.slots)e.set(O,R),R.slots.add(O)}else R.tokens.value=[...R.tokens.value];if(e.set(b,R),R.slots.add(b),_&&v!==b){e.delete(v),R.slots.delete(v);const O=o.get(v);O!==void 0&&t.get(O)===v&&t.delete(O)}s.value+=1}function p(){for(const v of n)v();t.clear(),e=new WeakMap,s.value+=1}return{bind:f,transfer:g,forTarget:a,clear:p}}const Xp="";function Zp(e,t=[]){const n=e??K(t);function o(f){if(n.value.some(p=>p.name===f.name))return!1;const g={name:f.name,source:f.source,skillFilePath:f.skillFilePath,available:!0};return n.value=[...n.value,g],!0}function a(f){n.value=n.value.filter(g=>g.name!==f)}function s(){n.value=[]}function i(f){n.value=f.filter(wo)}function c(f){const g=new Map(f.map(p=>[p.name,p]));n.value=n.value.map(p=>{const v=g.get(p.name);return v===void 0?{...p,available:!1}:{name:v.name,source:v.source,skillFilePath:v.skillFilePath,available:!0}})}return{tokens:n,select:o,remove:a,clear:s,restore:i,reconcile:c}}function ui(e,t,n=[]){const o=[t,e.length>0?Mt("mar_skills",{action:"use",instruction:ia,skills:e.map(a=>({name:a.name,source:a.source,path:a.skillFilePath}))}):"",n.length>0?Mt("mar_references",{references:[...n]}):""].filter(a=>a.length>0).join(`
|
|
2
2
|
`).trim();if(o.length>no)throw new Error("COMPOSER_MESSAGE_TOO_LARGE");return o}function mi(e){return e.some(t=>!t.available)}function eg(e){return Array.isArray(e)?e.filter(wo):[]}function wo(e){return typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"&&e.name.length>0&&"source"in e&&(e.source==="NODE_HOME"||e.source==="WORKSPACE")&&"skillFilePath"in e&&typeof e.skillFilePath=="string"&&e.skillFilePath.length>0&&"available"in e&&typeof e.available=="boolean"}const Io=new Set(["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function Un(e){return e==="STARTING"?1:e==="RUNNING"?2:e==="CANCELLING"?3:Io.has(e)?4:-1}function Fe(e){return Io.has(e)}function jt(e,t){return e===void 0?t:e.version!==void 0&&t.version!==void 0&&e.version!==t.version?e.version>t.version?e:t:Un(e.status)>Un(t.status)?e:t}function fi(e,t){return e?.id??t.workspaceId}function vi(e,t){return e??(t?"QUEUE":"SEND")}function tg(e){const t=oo(),n=()=>t?.active!==!1;let o;const a=(i,c,f,g,p,v)=>JSON.stringify([i,c,f,g,p,v.map(b=>b.id)]);async function s(i,c=!1,f,g){if(!n()||e.workspaceTarget.value?.nodeId===void 0||!e.composerOpen.value||e.submissionAvailable?.()===!1)return;const p=e.workspaceTarget.value?.nodeId,v=e.workspaceTarget.value?.workspaceId,b=()=>e.workspaceTarget.value?.nodeId===p&&e.workspaceTarget.value?.workspaceId===v,C=e.captureDraft();if(C===void 0)return;const q=C.input,_=C.skillTokens,M=C.references,R=q.value,h=R.trim();if(g===void 0&&f===void 0&&mi(_.value)){e.notice(l("composer.skillUnavailable"),"warning");return}let I;try{I=g?.input??f??ui(_.value,q.value,M?.value)}catch(ae){e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(ae)}),"error",ae);return}const k=g?.command??(f===void 0?e.selectedCommand.value:void 0);if(k!==void 0&&e.commandAvailable?.(k)===!1||k===void 0&&I.length===0&&e.attachments.value.length===0)return;if(e.attachmentsPending.value&&k===void 0&&f===void 0){e.notice(l("generated.workbenchSessionMessageService.attachmentsAreStillUploadingOrFailedWait"),"warning");return}const A=vi(i,e.composerBusy.value),B=e.draftOpen.value||e.selectedSessionId.value?.startsWith("draft:")===!0,j=g?.input??(c&&k!==void 0?`/${k.id}`:I);if(B&&k!==void 0&&!(k.id==="fast"&&k.runner==="codex")){if(k.interaction==="IMMEDIATE_ACTION"||k.interaction==="DESTRUCTIVE_ACTION"){e.notice(l("generated.workbenchSessionMessageService.sendARegularMessageToCreateThe"),"warning");return}e.stageDraftCommand(k,j),c||(q.value="",C.persist()),g===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1);return}if(k?.interaction==="DESTRUCTIVE_ACTION"){const ae=e.selectedSessionId.value;try{await Aa.confirm(l("generated.workbenchSessionMessageService.clearSessionConfirmation"),l("generated.workbenchSessionMessageService.clearSession"),{closeIcon:Be("close"),icon:Be("warning"),type:"warning",confirmButtonText:l("generated.workbenchSessionMessageService.confirmClearSession"),cancelButtonText:l("generated.workbenchSessionMessageService.cancelClearSession"),confirmButtonClass:"el-button--danger"})}catch{return}if(ae===void 0||!b()||e.selectedSessionId.value!==ae||e.submissionAvailable?.()===!1||e.commandAvailable?.(k)===!1)return}const N=f===void 0?[...e.attachments.value]:[],Z=_.value,D=M?.value,J=e.selectedWorkspace.value;let S=!1,x,$,P;const Y=e.selectedSessionId.value,ne=e.beginSubmission(Zt(Y),()=>{n()&&e.workspaceTarget.value?.nodeId===p&&e.workspaceTarget.value?.workspaceId===v&&e.selectedSessionId.value===(x?.id??Y)&&e.notice(l("workbench.submissionTimedOut"),"warning")});if(ne===void 0)return;const W=C.retain?.(),H=ae=>{W!==void 0?W.settle(ae):(ae(),C.persist())},X=e.retainAttachments(k===void 0?N:[]);let de=!1;try{if(k?.id==="fast"&&k.runner==="codex"){const ye=await e.request("/api/runner-commands",{method:"POST",body:JSON.stringify({nodeId:p,runner:"codex",commandId:"fast",input:`/fast ${e.fastEnabled.value?"off":"on"}`})});ne()&&b()&&e.selectedSessionId.value===Y&&(e.fastEnabled.value=ye.enabled,!c&&q.value===R&&R.trim()===I&&H(()=>{q.value=""}),g===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}const ae=B;S=ae;const re=e.draftOpen.value?await e.draft?.create(e.temporaryTitle(h)):e.selectedSession.value;if(!n())return;if(re===void 0)throw new Error("SESSION_NOT_FOUND");if(x=re,ae&&re.id.startsWith("draft:")&&($=e.sessions.value.find(ye=>ye.id===re.id&&ye.workspaceId===re.workspaceId)),k!==void 0){await e.executeCommand(re,k,j),ne()&&(!c&&q.value===R&&R.trim()===I&&H(()=>{q.value=""}),g===void 0&&b()&&e.selectedSessionId.value===re.id&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}if(ae&&J===void 0)throw new Error(l("generated.workbenchSessionMessageService.selectAWorkspaceBeforeSendingAMessage"));const V=fi(J,re),E=a(p,V,re.id,I,A,N);o?.signature!==E&&(o=void 0);const U=o?.clientMessageId??rt();P={signature:E,clientMessageId:U},o=P,e.scrollToLatest();const Q=await e.request(ae?"/api/agent-sessions/start":`/api/agent-sessions/${e.sessionPathId(re.id)}/messages`,{method:"POST",body:JSON.stringify({nodeId:p,...ae?{workspaceId:V,runner:re.runner,cwd:J.path,modelId:re.modelId,effort:re.effort,access:re.access,...re.runnerTitle?{title:re.runnerTitle}:{},deferredCommands:e.deferredCommands.value.map(ye=>({commandId:ye.command.id,input:ye.input}))}:{workspaceId:V,...re.runner==="mar-agent"?{modelId:re.modelId}:{}},clientMessageId:U,content:I,deliveryIntent:A,computerUse:re.runner==="mar-agent",attachmentIds:N.map(ye=>ye.id)})});if(!n())return;e.consumeAttachments(N),ae&&C.createdSession?.(Q.session),o===P&&(o=void 0),ae&&b()&&e.selectedSessionId.value===re.id&&(e.deferredCommands.value=[]);const se=e.selectedSessionId.value,ee=b(),ge=ee&&se===re.id;if(re.id!==Q.session.id&&e.migrateSessionCache(p,re.workspaceId,re.id,Q.session.id,Q.session),ee&&e.replaceSession(re.id,Q.session),ae&&ee&&e.selectedSessionId.value===Q.session.id&&e.beginSessionWatch(Q.session.id),ge||ee&&se===Q.session.id){const ye=e.acceptRun({...Q.run,sessionId:Q.run.sessionId??Q.session.id});(Q.delivery===void 0||Q.delivery==="STARTED")&&!Fe(ye.status)&&e.openRun(Q.run.id)}else e.cacheRun(p,re.workspaceId,{...Q.run,sessionId:Q.run.sessionId??Q.session.id,workspaceId:Q.run.workspaceId??re.workspaceId});(ge||ee&&(se===Q.session.id||e.selectedSessionId.value===Q.session.id))&&e.scrollToLatestAfterLayout(),de=ne(),f===void 0&&q.value===R&&_.value===Z&&M?.value===D&&H(()=>{q.value="",_.value=[],M!==void 0&&(M.value=[])})}catch(ae){if(!n())return;if(o===P&&Ye(ae)!==void 0&&(o=void 0),de=ne(),S&&de){const re=$!==void 0&&e.sessions.value.includes($);b()&&re&&$!==void 0&&e.removeSessionExact($),b()&&re&&e.selectedSessionId.value===x?.id&&e.draft?.restore()}de&&e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(ae)}),"error",ae)}finally{W?.release(),X(),ne()}}return{send:s}}function ng(e){const t=oo(),n=a=>Ye(a)==="RUN_NOT_FOUND";async function o(){const a=e.workspaceTarget.value?.nodeId,s=e.workspaceTarget.value?.workspaceId,i=e.selectedSessionId.value;if(a===void 0||s===void 0||i===void 0)return;const c=e.currentRevision(),f=()=>t?.active!==!1&&e.workspaceTarget.value?.nodeId===a&&e.workspaceTarget.value.workspaceId===s&&e.selectedSessionId.value===i&&e.currentRevision()===c,g=e.activeRun.value,p=e.beginSubmission(`session:${i}`);if(p!==void 0){if(g===void 0){try{const v=await e.request(`/api/agent-sessions/${e.sessionPathId(i)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});f()&&(e.runService.mergeSnapshots([v.run]),e.selectedRunId.value=v.run.id)}catch(v){const b=p();f()&&!n(v)&&b&&e.notice(l("generated.workbenchRunControlService.runOperationDenied",{value0:e.errorMessage(v)}),"error",v)}finally{p()}return}try{const v=await e.request(`/api/agent-runs/${encodeURIComponent(g.id)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});f()&&v.run!==void 0&&e.runService.replaceExistingRun(v.run)}catch(v){const b=p();f()&&!n(v)&&b&&e.notice(l("generated.workbenchRunControlService.runOperationDenied2",{value0:e.errorMessage(v)}),"error",v)}finally{p()}}}return{stopActiveRun:o}}async function pi(e){return Ra(new Uint8Array(await e.arrayBuffer()))}const Bn=5*1024*1024,gi=16e6;function Eo(e){return["image/bmp","image/x-bmp","image/x-ms-bmp","image/x-windows-bmp"].includes(e.type)||(e.type===""||e.type==="application/octet-stream")&&/\.bmp$/iu.test(e.name)}async function hi(e){if(!Eo(e))return e;if(e.size===0||e.size>Bn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");let t;try{if(t=await createImageBitmap(e),t.width*t.height>gi)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d");if(o===null)throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");o.drawImage(t,0,0);const a=await new Promise(i=>n.toBlob(i,"image/png"));if(a===null||a.size===0||a.type!=="image/png")throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");if(a.size>Bn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");const s=/\.bmp$/iu.test(e.name)?e.name.replace(/\.bmp$/iu,".png"):`${e.name}.png`;return new File([a],s,{type:"image/png",lastModified:e.lastModified})}catch(n){throw Ye(n)==="COMPOSER_IMAGE_LIMIT_EXCEEDED"?n:new Error("COMPOSER_IMAGE_CONVERSION_FAILED")}finally{t?.close()}}const yi=5,ki=5*1024*1024,Fn=10*1024*1024,bi=512*1024;function og(e){const t=K([]);let n=new Map;const o=(D,J)=>D!==void 0&&J!==void 0&&D.nodeId===J.nodeId&&D.workspaceId===J.workspaceId&&D.pane===J.pane,a=(D,J="main")=>D===void 0?void 0:{nodeId:D.nodeId,workspaceId:D.workspaceId,pane:J},s=()=>a(e.context()),i=new Map,c=D=>JSON.stringify([D.nodeId,D.workspaceId,D.id]);function f(D){return D===void 0?[]:t.value.filter(J=>o(n.get(J.id),D))}const g=te(()=>f(s())),p=K(!1),v=K(),b=K(!1),C=new Map,q=new Map,_=D=>n.has(D.id);function M(D,J){for(const S of J){const x=f(D);if(x.length>=yi)return e.notice(l("generated.composerAttachmentService.theFirstMessageCanIncludeUpTo"),"warning");if(S.size===0||S.size>ki){e.notice(l("generated.composerAttachmentService.attachmentMustBeLargerThan0And",{value0:S.name}),"warning");continue}if(x.reduce((Y,ne)=>Y+ne.file.size,0)+S.size>Fn)return e.notice(l("generated.composerAttachmentService.totalAttachmentSizeCannotExceed10MiB"),"warning");if(D===void 0)return e.notice(l("generated.composerAttachmentService.selectAnOnlineWorkspaceBeforeAddingAttachments"),"warning");const P={id:rt(),file:S,nodeId:D.nodeId,workspaceId:D.workspaceId,previewUrl:S.type.startsWith("image/")?URL.createObjectURL(S):null,receivedBytes:0,status:"UPLOADING"};n.set(P.id,{...D}),t.value=[...t.value,P],j(P)}}function R(D){const J=t.value.find(S=>S.id===D);v.value?.id===D&&(b.value=!1),J?.previewUrl!==null&&J?.previewUrl!==void 0&&URL.revokeObjectURL(J.previewUrl),t.value=t.value.filter(S=>S.id!==D),n.delete(D),J!==void 0&&Z(J)}function O(D,J=!0){if(D===void 0)return;const S=f(D);S.some($=>$.id===v.value?.id)&&(b.value=!1);for(const $ of S)$.previewUrl!==null&&URL.revokeObjectURL($.previewUrl),J&&Z($),n.delete($.id);const x=new Set(S.map($=>$.id));t.value=t.value.filter($=>!x.has($.id))}function h(){b.value=!1,v.value=void 0,p.value=!1;for(const D of t.value)D.previewUrl!==null&&URL.revokeObjectURL(D.previewUrl),Z(D,!1);t.value=[],n=new Map}function I(D){const J=D.map(c);for(const x of J)i.set(x,(i.get(x)??0)+1);let S=!1;return()=>{if(!S){S=!0;for(const x of J){const $=i.get(x)-1;$===0?i.delete(x):i.set(x,$)}}}}function k(D){t.value=t.value.filter(J=>D.some(S=>S.id===J.id&&S.nodeId===J.nodeId&&S.workspaceId===J.workspaceId)?(v.value?.id===J.id&&(b.value=!1),J.previewUrl!==null&&URL.revokeObjectURL(J.previewUrl),n.delete(J.id),!1):!0)}function A(D){D.previewUrl!==null&&(v.value=D,b.value=!0)}function B(D,J="main"){const S=()=>a(D(),J);return{attachments:te(()=>f(S())),add:x=>M(S(),x),remove:x=>{o(n.get(x),S())&&R(x)},clear:(x=!0)=>O(S(),x)}}async function j(D){const J=n;try{if(Eo(D.file)){const P=await hi(D.file),Y=t.value.find(W=>W.id===D.id);if(Y===void 0)return;if(t.value.filter(W=>o(n.get(W.id),n.get(Y.id))).reduce((W,H)=>W+(H.id===Y.id?P.size:H.file.size),0)>Fn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");Y.file=P,D=Y}const S=e.direct?.generation(D.nodeId);if(S!==void 0){const P=new AbortController;C.set(D.id,P);try{if(!t.value.some(W=>W.id===D.id))throw new Error("UPLOAD_CANCELLED");D.transport="DIRECT";const Y=await pi(D.file);if(P.signal.aborted)throw new Error("UPLOAD_CANCELLED");await e.direct.upload({nodeId:D.nodeId,nodeGeneration:S,descriptor:{direction:"UPLOAD",resource:{kind:"WORKSPACE_FILE",workspaceId:D.workspaceId,path:D.file.name},fileName:D.file.name,size:D.file.size,sha256:Y,overwrite:!1,composerAttachment:{id:D.id,mime:D.file.type||"application/octet-stream"}},file:D.file,onProgress:W=>{D.receivedBytes=W},signal:P.signal});const ne=t.value.find(W=>W.id===D.id);ne!==void 0&&(ne.status="COMPLETED");return}catch{if(!t.value.some(Y=>Y.id===D.id))return;D.receivedBytes=0,D.transport="SERVER",D.directFallback=!0}finally{C.delete(D.id)}}D.transport="SERVER";const x=await e.request(`/api/workspaces/${encodeURIComponent(D.workspaceId)}/uploads`,{method:"POST",body:JSON.stringify({nodeId:D.nodeId,name:D.file.name,mime:D.file.type||"application/octet-stream",size:D.file.size,overwrite:!1,composerAttachmentId:D.id})});if(!t.value.some(P=>P.id===D.id)){J===n&&await Z({...D,uploadId:x.upload.uploadId});return}const $=t.value.find(P=>P.id===D.id);if($===void 0)return;for($.uploadId=x.upload.uploadId,$.receivedBytes=x.upload.receivedBytes;$.receivedBytes<$.file.size;){if(!_($))return;const P=$.receivedBytes,Y=$.file.slice(P,Math.min($.file.size,P+bi)),ne=await N($,P,Y);if(!_($))return;$.receivedBytes=ne.receivedBytes}if(!_($))return;if($.uploadId===void 0)throw new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED");await e.request(`/api/workspaces/${encodeURIComponent(D.workspaceId)}/uploads/${encodeURIComponent($.uploadId)}/complete`,{method:"POST",body:JSON.stringify({nodeId:D.nodeId})}),$.status="COMPLETED"}catch(S){const x=t.value.find($=>$.id===D.id);if(x===void 0)return;x.status="FAILED",x.error=uo(S),window.setTimeout(()=>R(D.id),1e3)}}async function N(D,J,S){let x,$=!1;for(let P=0;P<3;P+=1){if(!_(D))throw new Error("UPLOAD_CANCELLED");try{return await new Promise((Y,ne)=>{const W=new XMLHttpRequest;q.set(D.id,W);const H=`/api/workspaces/${encodeURIComponent(D.workspaceId)}/uploads/${encodeURIComponent(D.uploadId??"")}/chunks?nodeId=${encodeURIComponent(D.nodeId)}&offset=${J}`;W.open("POST",e.resourceUrl?.(H)??H),W.withCredentials=!0,W.setRequestHeader("content-type","application/octet-stream"),W.setRequestHeader("x-csrf-token",e.csrfToken.value),W.upload.onprogress=X=>{X.lengthComputable&&(D.receivedBytes=Math.min(D.file.size,J+X.loaded))},W.onerror=()=>ne(new Error("UPLOAD_NETWORK_FAILED")),W.onabort=()=>ne(new Error("UPLOAD_CANCELLED")),W.onload=()=>{if(!_(D)){ne(new Error("UPLOAD_CANCELLED"));return}if(W.status<200||W.status>=300){let X;try{X=JSON.parse(W.responseText).error?.code}catch{X=void 0}X==="UNAUTHENTICATED"&&e.onUnauthenticated(),ne(new Error(X??`REQUEST_FAILED_${W.status}`));return}try{const X=JSON.parse(W.responseText);if(!Number.isSafeInteger(X.upload?.receivedBytes))throw new Error("NODE_RESPONSE_INVALID");Y({receivedBytes:X.upload?.receivedBytes})}catch(X){ne(X)}},W.send(S)})}catch(Y){if(x=Y,!_(D)||Ye(Y)==="UPLOAD_CANCELLED"||Ye(Y)==="UNAUTHENTICATED")throw Y;if(Ye(Y)==="CSRF_INVALID"){if($)throw Y;$=!0,await e.renewCsrfToken()}D.receivedBytes=J}finally{q.delete(D.id)}}throw x instanceof Error?x:new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED")}async function Z(D,J=!0){if(C.get(D.id)?.abort(),C.delete(D.id),q.get(D.id)?.abort(),q.delete(D.id),!J||i.has(c(D)))return;const S=D.status==="COMPLETED"?D.id:D.uploadId;S!==void 0&&await e.request(`/api/workspaces/${encodeURIComponent(D.workspaceId)}/uploads/${encodeURIComponent(S)}/cancel`,{method:"POST",body:JSON.stringify({nodeId:D.nodeId})}).catch(()=>{})}return{attachments:g,dragging:p,preview:v,previewOpen:b,add:D=>M(s(),D),remove:R,clear:(D=!0)=>O(s(),D),clearAll:h,forTarget:B,retainForSubmission:I,consume:k,openPreview:A}}const Xe=new Set(["STARTING","RUNNING","CANCELLING"]);function ag(e){const t=K([]),n=K(),o=new Set,a=new Set,s=new Set,i=new Map;function c(h){const I=t.value.find(A=>A.id===h.id),k=jt(I,h);return t.value=[k,...t.value.filter(A=>A.id!==h.id)],k}function f(h){t.value=[...h]}function g(h){t.value=t.value.map(I=>I.id===h.id?h:I)}function p(h){const I=new Map(t.value.map(N=>[N.id,N])),k=new Set(h.map(N=>N.id));for(const N of h)Fe(N.status)&&i.delete(N.id);const B=h.filter(N=>!Xe.has(N.status)||!a.has(N.sessionId??"")&&!i.has(N.id)).map(N=>jt(I.get(N.id),N)),j=t.value.filter(N=>N.sessionId===e.value&&!k.has(N.id)&&Xe.has(N.status));t.value=[...j,...B];for(const N of t.value)N.sessionId!==void 0&&Xe.has(N.status)&&o.delete(N.sessionId)}function v(h,I){for(const S of h){const x=i.get(S.id);x!==void 0&&!x.requested&&x.sessionId===S.sessionId&&Xe.has(S.status)&&!s.has(x.sessionId)&&!a.has(x.sessionId)&&i.delete(S.id)}const k=new Map(I.map(S=>[S.id,S])),A=new Map(t.value.map(S=>[S.id,S])),B=new Set(h.map(S=>S.id)),j=t.value.filter(S=>{if(B.has(S.id))return!1;const x=k.get(S.id);return x===void 0||S.sessionId!==x.sessionId||S.workspaceId!==x.workspaceId||S.version!==x.version||S.status!==x.status||S.recoveryState!==x.recoveryState||S.clientMessageId!==x.clientMessageId||S.createdAt!==x.createdAt}),Z=h.filter(S=>!Xe.has(S.status)||!a.has(S.sessionId??"")&&!i.has(S.id)).map(S=>jt(A.get(S.id),S)),D=new Set(j.map(S=>S.id)),J=I.filter(S=>!B.has(S.id)&&!D.has(S.id));t.value=[...j,...Z],n.value!==void 0&&!t.value.some(S=>S.id===n.value&&Xe.has(S.status))&&(n.value=void 0);for(const S of h)Fe(S.status)&&i.delete(S.id);for(const S of J)i.delete(S.id);for(const S of t.value)S.sessionId!==void 0&&Xe.has(S.status)&&o.delete(S.sessionId)}function b(h,I){I!==void 0&&!o.has(h)||(o.add(h),I!==void 0&&(a.delete(h),i.set(I,{sessionId:h,requested:!0})))}function C(h){o.add(h),a.add(h),s.add(h);for(const I of i.values())I.sessionId===h&&(I.requested=!0)}function q(h,I=!1){const k=new Set(t.value.filter(A=>A.sessionId===h&&Xe.has(A.status)).map(A=>A.id));k.size>0&&(t.value=t.value.filter(A=>!k.has(A.id))),n.value!==void 0&&k.has(n.value)&&(n.value=void 0),k.size>0&&o.add(h),I&&C(h);for(const A of k)i.set(A,{sessionId:h,requested:s.has(h)||i.get(A)?.requested===!0});return k.size>0}function _(h){s.has(h)||o.delete(h)}function M(h){o.delete(h),a.delete(h),s.delete(h);for(const[I,k]of i)k.sessionId===h&&i.delete(I)}function R(h){o.delete(h),a.delete(h),s.delete(h)}function O(h){return h!==void 0&&o.has(h)}return{runs:t,selectedRunId:n,acceptRun:c,replaceRuns:f,replaceExistingRun:g,mergeSnapshots:p,mergeAuthoritativeSnapshot:v,markSessionInterrupted:b,markSessionInterruptionPending:C,settleSessionRuns:q,observeSessionRunning:_,clearSessionInterruption:M,resumeSessionAfterInterruption:R,sessionInterruptionSettled:O}}function ig(e){const t=K(),n=K(),o=e?.draft??K(),a=te({get:()=>o.value?.content??"",set:f=>{o.value!==void 0&&(o.value={...o.value,content:f},e?.persist())}});function s(f){if(n.value=f.queueItemId,o.value?.queueItemId===f.queueItemId)return;const g=on(f.content),p=g.flatMap(C=>C.kind==="text"?[C.text]:C.kind==="mar_steer"?[C.payload.message]:[]).join("").trim(),v=g.filter(C=>C.kind!=="text"&&C.kind!=="mar_steer"&&C.kind!=="mar_session_origin"&&C.kind!=="mar_channel").map(C=>C.raw).join(`
|
|
3
3
|
`),b=g.filter(C=>C.kind==="mar_session_origin"||C.kind==="mar_channel").map(C=>C.raw).join(`
|
|
4
4
|
`);o.value={queueItemId:f.queueItemId,content:p,tags:v,origin:b},e?.persist()}function i(){o.value?.queueItemId===n.value&&(o.value=void 0,e?.persist()),n.value=void 0}function c(){t.value=void 0,n.value=o.value?.queueItemId}return{draggingQueueItemId:t,editingQueueItemId:n,editingContent:a,startEditing:s,finishEditing:i,rebind:c,serializeEditedContent:f=>[o.value?.origin,f.trim(),o.value?.tags].filter(Boolean).join(`
|
package/web/assets/{workbench-live-service-D1Cn_e8S.js → workbench-live-service-gs9m6rpJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as J,a as U,b as q,c as _,d as B,f as x,g as j,h as G,i as V,j as F}from"./index-
|
|
1
|
+
import{r as J,a as U,b as q,c as _,d as B,f as x,g as j,h as G,i as V,j as F}from"./index-DkFoMtS9.js";const z=1e4;function K(n){const i=new Map,I=new Set;let s,o,l=500,k=!1,g,m,y=!1;const a=x(!1);let d,v,P=0;const f=new Map;function p(){v!==void 0&&clearInterval(v),v=void 0,f.clear()}function N(){if(s===void 0||s.readyState!==WebSocket.OPEN)return;if(f.size>0){w();return}const t=String(++P);f.set(t,performance.now()),s.send(JSON.stringify({type:"ping",id:t}))}function R(){p(),N(),v=setInterval(N,z)}function D(){const t=new URL(n.endpoint?.()??"/api/workbench/live",window.location.origin);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}function M(){}function E(){if(a.value)return Promise.resolve(!0);if(d===void 0){let t;d={promise:new Promise(c=>{t=c}),resolve:t}}return d.promise}function S(t){const e=d;d=void 0,e?.resolve(t)}function b(t){if(typeof t!="object"||t===null||Array.isArray(t))return;const e=t;if(e.type==="workbench.ready"&&typeof e.workbenchConnectionId=="string"&&typeof e.workbenchResumeToken=="string"){n.diagnostics?.setConnectionState("connected"),g=e.workbenchConnectionId,m=e.workbenchResumeToken;const r=e.resumed===!0;a.value=!0,n.onReady?.(g,r),S(!0),y&&n.onConnectionRestored?.(r),y&&r&&n.onReconnect(),y=!1,R();return}if(e.type==="pong"&&typeof e.id=="string"){const r=f.get(e.id);r!==void 0&&(f.delete(e.id),n.diagnostics?.setPingLatency?.(performance.now()-r));return}if(e.type==="watch.event"&&e.event!==void 0){n.onWatchEvent?.(e.event);return}if(typeof e.type=="string"&&e.type.startsWith("direct.")){const r=j.safeParse(e);if(!r.success){n.onInvalidMessage();return}n.onDirectMessage?.(r.data);return}if(typeof e.type=="string"&&e.type.startsWith("terminal.direct.")){const r=G.safeParse(e);if(!r.success){n.onInvalidMessage();return}n.onTerminalDirectMessage?.(r.data);return}if(typeof e.type=="string"&&e.type.startsWith("desktop.direct.")){const r=V.safeParse(e);r.success?n.onDesktopDirectMessage?.(r.data):n.onInvalidMessage();return}if(typeof e.type=="string"&&e.type.startsWith("desktop.relay.")){const r=F.safeParse(e);r.success?n.onDesktopRelayMessage?.(r.data):n.onInvalidMessage();return}if(n.onNotificationMessage?.(e))return;if(e.type==="resync-required"&&typeof e.nodeId=="string"){n.diagnostics?.resetActiveRuns(),i.delete(e.nodeId),n.onResyncRequired(e.nodeId);return}if(e.type==="node.upgrade"&&typeof e.nodeId=="string"){n.onNodeUpgrade?.(e.nodeId,e.snapshot);return}if(e.type==="node"&&typeof e.nodeId=="string"&&typeof e.connected=="boolean"){let r=!1;e.connected?I.delete(e.nodeId)&&(i.delete(e.nodeId),r=!0):(I.add(e.nodeId),i.delete(e.nodeId)),n.onNodeConnection(e.nodeId,e.connected),e.reason==="CONNECTION_REPLACED"&&(n.diagnostics?.resetActiveRuns(),i.delete(e.nodeId),n.onNodeReplaced(e.nodeId),r=!0),r&&n.onResyncRequired(e.nodeId);return}if(e.type!=="event"||typeof e.event!="object"||e.event===null)return;const c=e.event;if(typeof c.nodeId!="string"||!Number.isInteger(c.sequence)||typeof c.category!="string")return;const u=c.sequence;u<=(i.get(c.nodeId)??0)||(i.set(c.nodeId,u),n.onEvent(c))}function h(){if(!n.canConnect()||s!==void 0)return;n.diagnostics?.setConnectionState("connecting");const t=new WebSocket(D());s=t,t.addEventListener("open",()=>{if(s!==t)return;const e=k;k=!0,l=500,i.clear(),y=e,a.value=!1,t.send(JSON.stringify({type:"resume",...g===void 0?{}:{workbenchConnectionId:g},...m===void 0?{}:{workbenchResumeToken:m}}))}),t.addEventListener("message",e=>{if(s!==t)return;const c=performance.now(),u=String(e.data);let r;try{r=JSON.parse(u),b(r)}catch{n.onInvalidMessage()}finally{n.diagnostics?.observeFrame({payloadUtf16CodeUnits:u.length,durationMs:performance.now()-c,message:r})}}),t.addEventListener("close",e=>{if(s===t){if(s=void 0,a.value=!1,p(),n.diagnostics?.setConnectionState("disconnected"),e.code===4001&&e.reason==="UNAUTHENTICATED"){S(!1),n.onUnauthenticated(),n.onDisconnected?.();return}if(n.onDisconnected?.(),!n.canConnect()){S(!1);return}o=setTimeout(()=>{o=void 0,h()},l),l=Math.min(l*2,3e4)}})}function C(){o!==void 0&&clearTimeout(o),o=void 0;const t=s;s=void 0,a.value=!1,S(!1),p(),n.diagnostics?.setConnectionState("disconnected"),t?.close(1e3,"PAGE_CLOSED")}function w(){if(!n.canConnect())return;o!==void 0&&clearTimeout(o),o=void 0;const t=s;s=void 0,a.value=!1,p(),n.diagnostics?.setConnectionState("connecting"),t?.close(4e3,"PAGE_VISIBLE_RECONNECT"),h()}function O(t){const e=B.safeParse(t);return!e.success||!a.value||s===void 0||s.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function T(t){const e=_.safeParse(t);return!e.success||!a.value||s===void 0||s.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function W(t){const e=q.safeParse(t);return!e.success||!a.value||s?.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function A(t){const e=U.safeParse(t);return!e.success||!a.value||s?.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function L(t){a.value&&s?.readyState===WebSocket.OPEN&&s.send(JSON.stringify({type:"session-share.visitor",visitor:t}))}return{connected:J(a),waitForReady:E,restore:M,connect:h,reconnect:w,close:C,sendDirect:O,sendTerminalDirect:T,sendDesktopDirect:W,sendDesktopRelay:A,updateShareVisitor:L}}export{K as c};
|