@kern0x1b/penstock-cli 26.11.1 → 26.11.2
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/THIRD-PARTY-NOTICES.md +16 -16
- package/dist/chunk-account-BaYNvO18.js +1 -0
- package/dist/{chunk-agentLaunch-D21uPuMr.js → chunk-agentLaunch-BnrpVME4.js} +1 -1
- package/dist/chunk-agentServe-BeOh1rjE.js +10 -0
- package/dist/chunk-agents-CZJoU2u2.js +1 -0
- package/dist/chunk-agentsMigrate-DnrqoXNz.js +2 -0
- package/dist/{chunk-analyze-BG-rlggA.js → chunk-analyze-ClE2LBCj.js} +1 -1
- package/dist/chunk-analyze-DgQqzEgb.js +1 -0
- package/dist/{chunk-analyzeFlow-2cYPgjh-.js → chunk-analyzeFlow-F2ZFmJhv.js} +1 -1
- package/dist/chunk-apiTemplates-Cl_z63FA.js +1 -0
- package/dist/{chunk-bot-DlhStBoG.js → chunk-bot-C2k8yaXA.js} +5 -5
- package/dist/chunk-cmmnFindings-DKpYqUZN.js +1 -0
- package/dist/{chunk-codeFactSet-LxSnQy8K.js → chunk-codeFactSet-DiAYqvbb.js} +1 -1
- package/dist/{chunk-codeIndex-N1gnP_sW.js → chunk-codeIndex-vStNh6Bm.js} +1 -1
- package/dist/chunk-codeLinks-BVpn4_Sr.js +1 -0
- package/dist/chunk-codeLinks-BrGduhsm.js +1 -0
- package/dist/chunk-command-8s6m3ZUw.js +5 -0
- package/dist/chunk-command-aMxPQdiV.js +1 -0
- package/dist/chunk-command-vH1_y5F0.js +1 -0
- package/dist/chunk-commands-B8YVT41b.js +5 -0
- package/dist/{chunk-commands-DcjlDt7B.js → chunk-commands-CJCSznbv.js} +1 -1
- package/dist/chunk-compose-BUJTvoFX.js +4 -0
- package/dist/chunk-connections-Drr67X9U.js +1 -0
- package/dist/chunk-connectors-DcMqy0u8.js +1 -0
- package/dist/chunk-convert-Ce1MZmsE.js +3 -0
- package/dist/chunk-convert-FkMnlxyi.js +1 -0
- package/dist/chunk-deploy-BHg8pB9x.js +1 -0
- package/dist/chunk-deploy-DZgCTgaY.js +6 -0
- package/dist/{chunk-diagrams-BukAOL0g.js → chunk-diagrams-CtGMGTa8.js} +1 -1
- package/dist/chunk-diff-9hjavV6V.js +1 -0
- package/dist/chunk-diff-Dp3fUALc.js +1 -0
- package/dist/chunk-dispatch-o-eqJb9Y.js +7 -0
- package/dist/chunk-dmnTests-BOxutoRs.js +1 -0
- package/dist/{chunk-dmnTests-ChwX1YVo.js → chunk-dmnTests-BzNA-u2k.js} +1 -1
- package/dist/{chunk-docs-D7yEDpa4.js → chunk-docs-B3C3pZpY.js} +17 -17
- package/dist/chunk-doctor-CRxbsAm7.js +1 -0
- package/dist/{chunk-editPreview-CC2vwhIW.js → chunk-editPreview-DCUnMkTU.js} +1 -1
- package/dist/chunk-evidence-ny_2ltVe.js +23 -0
- package/dist/{chunk-examples-0HkF-frb.js → chunk-examples-BG0lGXcZ.js} +9 -9
- package/dist/chunk-export-Blwjf23H.js +1 -0
- package/dist/chunk-export-kt3sBTZu.js +20 -0
- package/dist/{chunk-facts-DSVaURw5.js → chunk-facts-Dl5lLriU.js} +1 -1
- package/dist/chunk-failure-BRyRvObj.js +1 -0
- package/dist/{chunk-file-BswMa3FN.js → chunk-file-1YhfNmPn.js} +1 -1
- package/dist/chunk-import-Dh3az4BC.js +6 -0
- package/dist/chunk-importCommand-Dhikkmo0.js +1 -0
- package/dist/chunk-incident-LJe2-ohi.js +1 -0
- package/dist/chunk-init-D34Q4YA8.js +227 -0
- package/dist/chunk-lint-CnEhoYRB.js +1 -0
- package/dist/{chunk-lsp-7vA_mIt1.js → chunk-lsp-BzeJkpmf.js} +1 -1
- package/dist/chunk-main-BZF-ErAx.js +1 -0
- package/dist/chunk-mcp-B_B9bet5.js +95 -0
- package/dist/{chunk-mcpLaunch-LyfmIF_Z.js → chunk-mcpLaunch-BS709697.js} +1 -1
- package/dist/chunk-migrate-DVfXC-iJ.js +1 -0
- package/dist/chunk-migrate-DwWg0k5_.js +16 -0
- package/dist/{chunk-migrateApply-CzOkgKhB.js → chunk-migrateApply-e8O9oZXP.js} +3 -3
- package/dist/chunk-migrateVerify-oIBf-PM3.js +1 -0
- package/dist/{chunk-model-f8AzYUK7.js → chunk-model-BulEKnY1.js} +2 -2
- package/dist/{chunk-parse-B-uKGDy-.js → chunk-parse-DiOcpdOU.js} +1 -1
- package/dist/{chunk-penstockCli-CKMvaZ0O.js → chunk-penstockCli-C41P_G7i.js} +1 -1
- package/dist/chunk-policy-BVb7c7G_.js +1 -0
- package/dist/chunk-policyGate-BOgKsqLq.js +2 -0
- package/dist/chunk-pr-1jKcTNnP.js +1 -0
- package/dist/{chunk-project-DBYOlYRi.js → chunk-project-COaBZhMt.js} +1 -1
- package/dist/chunk-project-lO_6DX8G.js +1 -0
- package/dist/chunk-promotion-CTMPjXjZ.js +2 -0
- package/dist/chunk-promotion-DDLrgBqZ.js +1 -0
- package/dist/{chunk-promotion-DchO6xoC.js → chunk-promotion-NeRj4uTP.js} +1 -1
- package/dist/chunk-receipt-C4NqnSkH.js +1 -0
- package/dist/chunk-receiptDeps-B7MehyHT.js +1 -0
- package/dist/chunk-receiptGate-BZCKCMTV.js +1 -0
- package/dist/chunk-receiptGate-DRcw327y.js +1 -0
- package/dist/{chunk-receiptSnapshot-B6ruXw8z.js → chunk-receiptSnapshot-CHSk3_4N.js} +1 -1
- package/dist/{chunk-receiptStore-Cy-L0H1u.js → chunk-receiptStore-DhROtI2h.js} +1 -1
- package/dist/chunk-refactor-CO3qyIEv.js +17 -0
- package/dist/chunk-refactor-CWeCOl7w.js +1 -0
- package/dist/{chunk-render-Ci5d6mg4.js → chunk-render-DZd5hScS.js} +1 -1
- package/dist/chunk-report-w7YZwhyg.js +1 -0
- package/dist/chunk-review-DYMgFDSy.js +1 -0
- package/dist/chunk-say-CP1IyOSv.js +1 -0
- package/dist/{chunk-security-VgKwtohm.js → chunk-security-pgip-kdY.js} +2 -2
- package/dist/chunk-serve-CKt2rO05.js +10 -0
- package/dist/{chunk-share-CBV2FuKq.js → chunk-share-rsL0itIM.js} +18 -18
- package/dist/chunk-stages-B2sBBxUc.js +3 -0
- package/dist/chunk-systemError-O3vQ8hLb.js +1 -0
- package/dist/chunk-systemError-n2E6isvg.js +1 -0
- package/dist/chunk-taskTest-DWoME1mY.js +2 -0
- package/dist/chunk-taskTest-JErgWO6t.js +1 -0
- package/dist/{chunk-templateDiagnostics-BwH7RNkz.js → chunk-templateDiagnostics-6txfKwas.js} +2 -2
- package/dist/chunk-templates-Y3xfCO_3.js +1 -0
- package/dist/chunk-testCases-BwimUfDC.js +4 -0
- package/dist/chunk-testCases-DO2Rkyvd.js +1 -0
- package/dist/chunk-tests-Cy325OGw.js +1 -0
- package/dist/chunk-tests-DNkORsqB.js +23 -0
- package/dist/{chunk-trust-DXcsUJaK.js → chunk-trust-DSX-k3by.js} +1 -1
- package/dist/{chunk-trust-DubjEjlN.js → chunk-trust-Di4EYPah.js} +1 -1
- package/dist/{chunk-variableChecks-KnECGMR3.js → chunk-variableChecks-CBDpmI4d.js} +1 -1
- package/dist/{chunk-workerVariables-CajAcbwl.js → chunk-workerVariables-CNnCRijJ.js} +1 -1
- package/dist/{chunk-workerVariables-DIDoUpHF.js → chunk-workerVariables-CulLc3YH.js} +1 -1
- package/dist/chunk-wrapper-CGYED7G2.js +1 -0
- package/dist/chunk-wrapper-CK7Xtes6.js +3 -0
- package/dist/grammars/web-tree-sitter.wasm +0 -0
- package/dist/penstock.js +1 -1
- package/dist/web/assets/{AgentSettings-Cn5Vcph3.js → AgentSettings-D24jOuht.js} +1 -1
- package/dist/web/assets/{AgentsDialog-C6WqzlxZ.js → AgentsDialog-BMWv3Gyk.js} +1 -1
- package/dist/web/assets/{AgentsDialog-dpbwVSxk.js → AgentsDialog-DbY2O6O5.js} +1 -1
- package/dist/web/assets/{AgentsTab-C34OhVkw.js → AgentsTab-D6LbK6sG.js} +2 -2
- package/dist/web/assets/{BpmnCanvas-yur9daZa.js → BpmnCanvas-BcQRQ2Br.js} +27 -27
- package/dist/web/assets/BpmnDocument-Ce5F4K1e.js +27 -0
- package/dist/web/assets/CmmnDocument-C_UlPowC.js +17 -0
- package/dist/web/assets/{ConflictDialog-Bb5kduaR.js → ConflictDialog-DfFp8F7n.js} +1 -1
- package/dist/web/assets/{ConnectionsDialog-qtF7yDFw.js → ConnectionsDialog-BaYtHD5h.js} +1 -1
- package/dist/web/assets/{DiffDocument-LHOif5Ac.js → DiffDocument-BOPdBEN3.js} +1 -1
- package/dist/web/assets/{DmnDocument-0f5uS67x.css → DmnDocument-DZ9u2uk2.css} +1 -1
- package/dist/web/assets/DmnDocument-vtnARy7Q.js +41 -0
- package/dist/web/assets/{DriftDialog-Chl6BX6k.js → DriftDialog-dIbCbSK2.js} +1 -1
- package/dist/web/assets/FormDocument-B0q8DF9v.css +1 -0
- package/dist/web/assets/FormDocument-DHBUBUzO.js +32 -0
- package/dist/web/assets/FormStepView-CbHb32_8.js +1 -0
- package/dist/web/assets/{GraphAwareLayoutService-wsos3yPD.js → GraphAwareLayoutService-C5N8K9dm.js} +1 -1
- package/dist/web/assets/{MigrationDialog-CBJU7Oe3.js → MigrationDialog-DA3Vrzgw.js} +1 -1
- package/dist/web/assets/{NewFileDialog-B7075LWG.js → NewFileDialog-Dev41oA1.js} +1 -1
- package/dist/web/assets/PolicyDialog-qR19Csji.js +1 -0
- package/dist/web/assets/{QuickOpen-DJQrI7Od.js → QuickOpen-ps-rMjiS.js} +1 -1
- package/dist/web/assets/ScriptPane-BQLMNYzc.js +2 -0
- package/dist/web/assets/{ScriptRunDialog-BwE4cXnp.js → ScriptRunDialog-YivjHB6j.js} +1 -1
- package/dist/web/assets/{SettingsDialog-c307wPsg.js → SettingsDialog-DI0vZ6Ay.js} +1 -1
- package/dist/web/assets/ShortcutsDialog-DLXnv4Vm.js +1 -0
- package/dist/web/assets/SourceDocument-Cj8cGsoS.js +1 -0
- package/dist/web/assets/TemplateDocument-BRyFsofH.js +7 -0
- package/dist/web/assets/TextDocument-DB2hEuMA.js +1 -0
- package/dist/web/assets/{UnreadableFileLayer-CUP_30X8.js → UnreadableFileLayer-CRW3MM7w.js} +1 -1
- package/dist/web/assets/{UploadDialog-CaVBOxUL.js → UploadDialog-D-X6GG98.js} +1 -1
- package/dist/web/assets/Viewer-BcpDlvg_.js +4 -0
- package/dist/web/assets/apply-Nsj6ek02.js +1 -0
- package/dist/web/assets/{bpmnTheme-CZ7xp4R5.js → bpmnTheme-pKgl9Mrn.js} +2 -2
- package/dist/web/assets/{data-ZauKnQ2Z.js → data-CdiToGOq.js} +2 -2
- package/dist/web/assets/{data-Da5Nxzev.js → data-wU6sw6RY.js} +1 -1
- package/dist/web/assets/{dialog-DSLu1Bbo.js → dialog-BDJ5dDiU.js} +1 -1
- package/dist/web/assets/{diff-C4hitkRR.js → diff-BhYqTg4l.js} +1 -1
- package/dist/web/assets/dist-27z6Phtg.js +23 -0
- package/dist/web/assets/{dist-CofBTWz1.js → dist-B7TL-7R3.js} +4 -4
- package/dist/web/assets/dist-BEpeEbIu.js +1 -0
- package/dist/web/assets/{dist-CYCbBoYQ.js → dist-BTf7NfeQ.js} +1 -1
- package/dist/web/assets/{dist-CJKVV2_S.js → dist-BqGv7f4M.js} +10 -10
- package/dist/web/assets/dist-C-q1IWjr.js +6 -0
- package/dist/web/assets/{dist-Blylfrak.js → dist-CJx_2eBF.js} +2 -2
- package/dist/web/assets/dist-COUY_jv5.js +1 -0
- package/dist/web/assets/{dist-DpDu6Wz_.js → dist-CWjAtsKe.js} +1 -1
- package/dist/web/assets/{dist-gb3IfUZi.js → dist-Cv8_A_95.js} +2 -2
- package/dist/web/assets/dist-DDE6BjgI.js +5 -0
- package/dist/web/assets/{dist-7VC_hKpw.js → dist-DDNYYQtV.js} +1 -1
- package/dist/web/assets/dist-DW-S9iZN.js +1 -0
- package/dist/web/assets/dist-OnU5n5o1.js +1 -0
- package/dist/web/assets/dmn-Cgoh6wXm.js +3 -0
- package/dist/web/assets/{documentBridge-1Eg7H9yI.js → documentBridge-CHw4XsZH.js} +3 -3
- package/dist/web/assets/{documents-LG-7CTrn.js → documents-CEtohzAC.js} +1 -1
- package/dist/web/assets/duplicate-D_ic-m62.js +342 -0
- package/dist/web/assets/{engines-DhO6OW1S.js → engines-lyEvb0pH.js} +1 -1
- package/dist/web/assets/{executable-BTarDLry.js → executable--4381_Lf.js} +1 -1
- package/dist/web/assets/{file-CIeVSOHy.js → file-BbVBUuIH.js} +1 -1
- package/dist/web/assets/formChecks-CSClH9sH.js +1 -0
- package/dist/web/assets/frontend-uXAWaalt.js +1 -0
- package/dist/web/assets/{httpHost-DBSjdVth.js → httpHost-C973OTRe.js} +1 -1
- package/dist/web/assets/{index.es-pigASDxC.js → index.es-CMvq8Bhe.js} +3 -3
- package/dist/web/assets/index.es-GbdJvMnO.js +78 -0
- package/dist/web/assets/{index.esm-CTLpq4ik.js → index.esm-Ba6q0zSu.js} +1 -1
- package/dist/web/assets/{intelligence-_1C71hkQ.js → intelligence-DNqJNmdB.js} +3 -3
- package/dist/web/assets/{jspdf.es.min-PgZzOmkT.js → jspdf.es.min-C0L4zezU.js} +6 -6
- package/dist/web/assets/{kind-X3_nabTt.js → kind-DDHnk6dW.js} +1 -1
- package/dist/web/assets/{lib-BmLAen_d.js → lib-DrkEMJ65.js} +1 -1
- package/dist/web/assets/{list-DovB9lWV.js → list-TmXvCwja.js} +1 -1
- package/dist/web/assets/{migrationHost-BcguK4K5.js → migrationHost-DCWBb3L6.js} +1 -1
- package/dist/web/assets/moddle-f0Q4Guwd.js +1 -0
- package/dist/web/assets/{model--Bj28IOj.js → model-afHgSxJs.js} +1 -1
- package/dist/web/assets/{nudges-UF9_cBuO.js → nudges-DPG3WpyV.js} +1 -1
- package/dist/web/assets/{open-C9Kt9JLw.js → open-Vkx72dYx.js} +1 -1
- package/dist/web/assets/platform-G53Cenyw.js +2 -0
- package/dist/web/assets/{preload-helper-VRuDKI9K.js → preload-helper-DExCAR_V.js} +1 -1
- package/dist/web/assets/{run-BZgz1U9U.js → run-BMfRBe5O.js} +1 -1
- package/dist/web/assets/samples-BL3jA_Vd.js +1 -0
- package/dist/web/assets/{say-WvEHqIbO.js → say-BkdZMivA.js} +1 -1
- package/dist/web/assets/{say-ChFGKK2E.js → say-C7KqKcFr.js} +1 -1
- package/dist/web/assets/{sections-N6WYk7b8.js → sections-LJKSRDTS.js} +1 -1
- package/dist/web/assets/sharedReader-BsXfiBT8.js +1 -0
- package/dist/web/assets/{source-frame-DcptKpVq.js → source-frame-DC4W0A5-.js} +2 -2
- package/dist/web/assets/{syntax-DW10Wzg4.js → syntax-00Hk6Xv7.js} +4 -4
- package/dist/web/assets/{template-CMl68jPp.js → template-BQP7ZXdK.js} +1 -1
- package/dist/web/assets/testCaseRuns-liAhWMg7.js +1 -0
- package/dist/web/assets/{trace-DLziNpe2.js → trace-DXQU2N_l.js} +1 -1
- package/dist/web/assets/{translator-DLDFsUlE.js → translator-BLCeE6UY.js} +1 -1
- package/dist/web/assets/ui-BLtm3Y1J.js +1 -0
- package/dist/web/assets/{useTrace-UYBskc2k.js → useTrace-dZdQ805W.js} +1 -1
- package/dist/web/assets/web-C4k0NLZ9.js +982 -0
- package/dist/web/assets/web-CnDpD6qy.css +1 -0
- package/dist/web/assets/{workerVariables-DURgyUbG.js → workerVariables-O6VqwDzr.js} +1 -1
- package/dist/web/assets/xml-DIWt4von.js +1 -0
- package/dist/web/index.html +39 -40
- package/package.json +5 -5
- package/dist/chunk-account-CpZu-RTg.js +0 -1
- package/dist/chunk-agentServe-BYRtgGGD.js +0 -10
- package/dist/chunk-agents-B9oxdPTA.js +0 -1
- package/dist/chunk-agentsMigrate-BV8TeRXq.js +0 -2
- package/dist/chunk-analyze-pgzR-Cx-.js +0 -1
- package/dist/chunk-apiTemplates-cU7C8vap.js +0 -1
- package/dist/chunk-cmmnFindings-S2TGSnEp.js +0 -1
- package/dist/chunk-codeLinks-C8N6e8k3.js +0 -1
- package/dist/chunk-codeLinks-o0a8tBGk.js +0 -1
- package/dist/chunk-command-Bqlbgo-2.js +0 -1
- package/dist/chunk-command-DT84ioJb.js +0 -5
- package/dist/chunk-command-DrGP2kg8.js +0 -1
- package/dist/chunk-commands-B4PoZbpX.js +0 -5
- package/dist/chunk-compose-CWKKVtN5.js +0 -4
- package/dist/chunk-connections-DQpKbIGD.js +0 -1
- package/dist/chunk-connectors-PtAvE91B.js +0 -1
- package/dist/chunk-convert-CpgtOlZk.js +0 -1
- package/dist/chunk-convert-HbFpg8ab.js +0 -3
- package/dist/chunk-deploy-l4MdFfn8.js +0 -6
- package/dist/chunk-deploy-qRaaKGZb.js +0 -1
- package/dist/chunk-diff-BhTFlCE3.js +0 -1
- package/dist/chunk-diff-kBF83vzM.js +0 -1
- package/dist/chunk-dispatch-BnO-QhMh.js +0 -7
- package/dist/chunk-dmnTests-0x_yUH6S.js +0 -1
- package/dist/chunk-doctor-BuHK1dTm.js +0 -1
- package/dist/chunk-evidence-oLw_C6j8.js +0 -23
- package/dist/chunk-export-cIFHDXug.js +0 -1
- package/dist/chunk-export-jBVxtmCH.js +0 -20
- package/dist/chunk-failure-D5brrYW2.js +0 -1
- package/dist/chunk-import-BBOe-5RZ.js +0 -6
- package/dist/chunk-importCommand-DRjYoljA.js +0 -1
- package/dist/chunk-incident-BK1h37CD.js +0 -1
- package/dist/chunk-init-_OALJuKm.js +0 -227
- package/dist/chunk-lint-7KJFxyCN.js +0 -1
- package/dist/chunk-main-Cw2JXCil.js +0 -1
- package/dist/chunk-mcp-K63bhqnF.js +0 -95
- package/dist/chunk-migrate-BMwBV5sc.js +0 -16
- package/dist/chunk-migrate-CxfVmKt0.js +0 -1
- package/dist/chunk-migrateVerify-DSEXSpfR.js +0 -1
- package/dist/chunk-policy-BX0Ftdws.js +0 -1
- package/dist/chunk-policyGate-dmcufnwB.js +0 -2
- package/dist/chunk-pr-ByrGcfam.js +0 -1
- package/dist/chunk-project-DA3KnAZH.js +0 -1
- package/dist/chunk-promotion-Boedyq43.js +0 -1
- package/dist/chunk-promotion-D8Ti-vxp.js +0 -2
- package/dist/chunk-receipt-CusJaqNn.js +0 -1
- package/dist/chunk-receiptDeps-oVbX156d.js +0 -1
- package/dist/chunk-receiptGate-DrGChj7i.js +0 -1
- package/dist/chunk-receiptGate-xldHKMyJ.js +0 -1
- package/dist/chunk-refactor-B1W_MGTp.js +0 -1
- package/dist/chunk-refactor-BJXxEtVs.js +0 -17
- package/dist/chunk-report-D9pM09Nu.js +0 -1
- package/dist/chunk-review-UcqS5AAi.js +0 -1
- package/dist/chunk-say-CYb4HeJD.js +0 -1
- package/dist/chunk-serve-Dmqen1yd.js +0 -10
- package/dist/chunk-stages-BTQJrAMF.js +0 -3
- package/dist/chunk-systemError-BYrMzp2o.js +0 -1
- package/dist/chunk-systemError-CXvnhNPK.js +0 -1
- package/dist/chunk-taskTest-9gMsx0zu.js +0 -2
- package/dist/chunk-taskTest-BjXYpG5p.js +0 -1
- package/dist/chunk-templates-D3ouIwHD.js +0 -1
- package/dist/chunk-testCases-9jwT_Y7z.js +0 -4
- package/dist/chunk-testCases-BcpBPg9L.js +0 -1
- package/dist/chunk-tests-CEEXnWOp.js +0 -23
- package/dist/chunk-tests-CRVosdWp.js +0 -1
- package/dist/chunk-wrapper-B2WnOIoB.js +0 -3
- package/dist/chunk-wrapper-DiKCKZti.js +0 -1
- package/dist/web/assets/BpmnDocument-C247Rqim.js +0 -27
- package/dist/web/assets/CmmnDocument-Dj48bsUd.js +0 -17
- package/dist/web/assets/DmnDocument-Cb9Zi9fS.js +0 -41
- package/dist/web/assets/FormDocument-DoZaxWd-.js +0 -32
- package/dist/web/assets/FormDocument-URLcKn84.css +0 -1
- package/dist/web/assets/FormStepView-D8MFcpeI.js +0 -1
- package/dist/web/assets/PolicyDialog-CGdglmDn.js +0 -1
- package/dist/web/assets/ScriptPane-T6M5f6fc.js +0 -2
- package/dist/web/assets/ShortcutsDialog-BAoL9EHu.js +0 -1
- package/dist/web/assets/SourceDocument-C9KIzBA5.js +0 -1
- package/dist/web/assets/TemplateDocument-CNt2turg.js +0 -7
- package/dist/web/assets/TextDocument-CtkHoEqN.js +0 -1
- package/dist/web/assets/Viewer-DZske1C5.js +0 -4
- package/dist/web/assets/apply-nnKP9HIM.js +0 -1
- package/dist/web/assets/dist--PmHUHDp.js +0 -1
- package/dist/web/assets/dist-BoPrKCf2.js +0 -5
- package/dist/web/assets/dist-C1m02xAO.js +0 -1
- package/dist/web/assets/dist-CLqJMzT-.js +0 -1
- package/dist/web/assets/dist-D3jqq0XS.js +0 -1
- package/dist/web/assets/dist-DA-9F0U9.js +0 -1
- package/dist/web/assets/dist-DojzF5q2.js +0 -6
- package/dist/web/assets/dist-yvjzrXXf.js +0 -23
- package/dist/web/assets/dmn-DwdcYXGr.js +0 -3
- package/dist/web/assets/duplicate-D-ilQqKz.js +0 -342
- package/dist/web/assets/formChecks-CGox1z7R.js +0 -1
- package/dist/web/assets/frontend-Qq5hBH0U.js +0 -1
- package/dist/web/assets/index.es-CcNNw3VB.js +0 -78
- package/dist/web/assets/moddle-DJxj0oEU.js +0 -1
- package/dist/web/assets/platform-BLPhsye9.js +0 -2
- package/dist/web/assets/samples-oeXBsJ9Y.js +0 -1
- package/dist/web/assets/sharedReader-Bopy7Uk9.js +0 -1
- package/dist/web/assets/testCaseRuns-B_XdqGFh.js +0 -1
- package/dist/web/assets/ui-BTKMbWYG.js +0 -1
- package/dist/web/assets/web-FzNBw1kZ.css +0 -1
- package/dist/web/assets/web-jPMZVwbQ.js +0 -982
- package/dist/web/assets/xml-DTgZ-B-l.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./testCaseRuns-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-B8BYMn-z.js";import{c as t,d as n,h as r,i,o as a,p as o,r as s,s as c,u as l}from"./vendor-NJP34MHU.js";import{i as u}from"./translator-DLDFsUlE.js";import{t as d}from"./preload-helper-VRuDKI9K.js";import{F as f}from"./frontend-Qq5hBH0U.js";import{r as p}from"./platform-BLPhsye9.js";import{i as m}from"./dialog-DSLu1Bbo.js";import{a as h,i as g,o as _}from"./xml-DTgZ-B-l.js";import{t as v}from"./bridgeInstance-qzSInqLW.js";import{d as y,l as b}from"./trace-DLziNpe2.js";import{_ as x,c as S,d as C,f as w,h as T,l as E,m as D,o as O,p as k,r as A,s as j,u as M}from"./ui-BTKMbWYG.js";import{i as N,o as P,r as F}from"./preferences-BcLlKYFq.js";import{_ as I,m as L,y as R}from"./descriptors-B5VIyY5g.js";import{m as ee}from"./testCaseRuns-B_XdqGFh.js";import{a as z,i as B,n as V,o as H,r as U,s as W,t as G}from"./shortcut-BRxHV_3d.js";import{v as te}from"./AgentSettings-Cn5Vcph3.js";import{t as ne}from"./typing-CXvbBSPr.js";import{a as re}from"./dockLayout-CxOMo-Nl.js";import{A as ie,B as ae,E as oe,Ft as se,H as ce,It as le,M as ue,N as de,O as fe,P as pe,Pt as me,Q as he,S as ge,St as _e,T as ve,V as K,Y as ye,at as be,b as xe,bt as Se,c as q,ct as Ce,d as we,dt as Te,ft as Ee,gt as De,ht as Oe,it as ke,j as Ae,k as je,lt as Me,mt as Ne,nt as Pe,ot as Fe,pt as Ie,q as J,r as Le,rt as Re,s as ze,st as Be,u as Ve,ut as He,v as Y,vt as Ue,w as We,x as Ge,xt as Ke,y as qe,yt as Je}from"./web-jPMZVwbQ.js";function toggleSidebarDef(){return{id:`toggle-sidebar`,title:`Sidebar`,section:`View`,icon:`panel-toggle`,keywords:[`inspector`,`properties`,`side panel`,`panel`],place:`bar`,slot:`end`,shortcut:H,keymap:!0,tooltip:`Sidebar`,run:e=>e.commands.toggleSidebar()}}function focusCanvasDef(){return{id:`focus-canvas`,title:`Focus canvas`,section:`View`,icon:`focus-canvas`,keywords:[`focus`,`canvas`,`hide`,`sidebars`,`full`,`zen`,`distraction`],place:`menu`,shortcut:B,keymap:!0,tooltip:`Hide the sidebars and show only the canvas; press again to show them`,run:e=>e.commands.focusCanvas()}}function undoDef(e){return{id:`undo`,l10n:`undo-long`,title:`Undo`,section:`Edit`,icon:`undo`,keywords:[],place:`bar`,listed:!1,slot:`lead`,tooltip:`Undo Last Operation`,enabled:e,run:e=>e.commands.undo()}}function redoDef(e){return{id:`redo`,l10n:`redo-long`,title:`Redo`,section:`Edit`,icon:`redo`,keywords:[],place:`bar`,listed:!1,slot:`lead`,tooltip:`Redo Last Operation`,enabled:e,run:e=>e.commands.redo()}}function shareDef(e){return{id:`share`,title:`Share as HTML…`,section:`Deploy & share`,icon:`share`,keywords:[`html`,`send`,`publish`,`offline`,`browser`,`export`],place:`menu`,tooltip:`One file that opens offline in any browser`,enabled:e,run:e=>e.commands.share()}}function documentationDef(){return{id:`open-documentation`,title:`Documentation`,section:`Help`,icon:`documentation`,keywords:[`docs`,`guide`,`help`,`manual`,`learn`,`website`],place:`menu`,tooltip:`Open the guide in your browser`,run:()=>E()}}var X=null;function showThemeChoice(){X?.()}function onShowThemeChoice(e){return X=e,()=>{X===e&&(X=null)}}function themeChoiceDef(){return{id:`editor-theme`,title:`Editor theme`,section:`View`,icon:`sun`,keywords:[`theme`,`light`,`dark`,`dracula`,`colours`,`colors`,`appearance`,`follow ide`],place:`menu`,tooltip:`Follow the IDE, or use Light, Dark or Dracula`,available:e=>!!e.commands?.chooseTheme,run:()=>showThemeChoice()}}var Z=null;function showKeyboardShortcuts(){Z?.()}function onShowKeyboardShortcuts(e){return Z=e,()=>{Z===e&&(Z=null)}}var Ye=`Shift+/`;function keyboardShortcutsDef(){return{id:`keyboard-shortcuts`,title:`Keyboard shortcuts`,section:`Help`,icon:`keyboard`,keywords:[`keys`,`shortcuts`,`bindings`,`key bindings`,`keyboard`,`hotkeys`,`help`,`cheat sheet`],place:`menu`,shortcut:Ye,tooltip:`Every shortcut in this editor`,run:()=>showKeyboardShortcuts()}}function compareDef(e){return{id:`compare-with-head`,title:`Compare with last commit`,section:`Check & run`,icon:`compare`,keywords:[`diff`,`git`,`changes`,`commit`,`head`,`versions`,`history`],place:`menu`,tooltip:`Show what changed since the last commit`,available:t=>!(!t.commands?.compareWithHead||e&&!e(t)),run:e=>e.commands.compareWithHead?.()}}function licenceDef(){return{id:`show-licence`,title:`Licence`,section:`Help`,icon:`licence`,keywords:[`license`,`pro`,`team`,`trial`,`activate`,`key`,`buy`,`plan`],place:`menu`,tooltip:`See the plan, enter a licence key or buy one`,available:e=>!!e.commands?.showLicence,run:e=>e.commands.showLicence?.()}}function refactorDef(){return{id:`refactor`,title:`Refactor…`,section:`Edit`,icon:`migration`,keywords:[`rename`,`refactor`,`variable`,`message`,`signal`,`error`,`job type`,`decision`,`form`,`process`,`extract`,`subprocess`,`call activity`],place:`menu`,tooltip:`Rename a variable, message, signal, error, job type, decision, form or process across the project, or extract part of a diagram into a call activity`,available:e=>!!e.commands?.openRefactor,run:e=>e.commands.openRefactor?.()}}function evidencePackDef(){return{id:`evidence-pack`,title:`Create evidence pack…`,section:`Deploy & share`,icon:`export`,keywords:[`audit`,`evidence`,`compliance`,`review`,`zip`,`seal`,`sha-256`,`package`],place:`menu`,tier:`Pro`,tooltip:`One reviewable package for an audit: the diagrams, the checks, the test results and what changed, with the SHA-256 of every file`,available:e=>!!e.commands?.createEvidencePack,run:e=>e.commands.createEvidencePack?.()}}function sayAction(e,t){let n=u(e);return n===e?t:n}function sayKeywords(e,t){let n=u(`app.actions.${e}.keywords`),r=n===`app.actions.${e}.keywords`?[]:n.split(`,`).map(e=>e.trim()).filter(Boolean);return r.length>0?[...t,...r]:t}var Xe={"Check & run":`checkRun`,"Layout & convert":`layoutConvert`,"Deploy & share":`deployShare`,View:`view`,File:`file`,Edit:`edit`,Help:`help`,Recent:`recent`};function saySection(e){return u(`app.actions.section.${Xe[e]??e}`)}function resolveActions(e,t){return e.map((e,t)=>({def:e,order:t})).filter(({def:e})=>e.available?.(t)??!0).map(({def:e,order:n})=>{let r=e.l10n??e.id,i=typeof e.tooltip==`function`?e.tooltip(t):e.tooltip&&sayAction(`app.actions.${r}.tooltip`,e.tooltip),a={id:e.id,title:sayAction(`app.actions.${r}.title`,e.title),section:e.section,icon:e.icon,keywords:sayKeywords(r,e.keywords),place:e.place,listed:e.listed??!0,slot:e.slot??`start`,order:n,enabled:e.enabled?.(t)??!0,run:()=>e.run(t)};if(e.presentation&&(a.presentation=e.presentation),e.shortcut&&(a.shortcut=e.shortcut),e.tier&&(a.tier=e.tier),i&&(a.tooltip=i),!a.enabled&&e.disabledReason){let n=e.disabledReason(t);n&&(a.disabledReason=n)}e.checked&&(a.checked=e.checked(t));let o=e.status?.(t);return o&&(a.status=o),e.popup&&(a.popup=e.popup(t)),e.menu&&(a.menu=e.menu(t).map(n=>({id:n.id,title:sayAction(`app.actions.${e.id}.menu.${n.id}.title`,n.title),icon:n.icon,...n.tooltip?{tooltip:sayAction(`app.actions.${e.id}.menu.${n.id}.tooltip`,n.tooltip)}:{},run:()=>n.run(t)}))),a})}var Ze=500,Qe=400,$e=300,et=200,tt=80,nt=12,rt=10,it=1,at=4;function startsWord(e,t){return t===0||!/[a-z0-9]/i.test(e[t-1])}function contiguous(e,t){let n=null;for(let r=t.indexOf(e);r>=0;r=t.indexOf(e,r+1)){let e=(r===0?Ze:startsWord(t,r)?Qe:$e)-Math.min(r,50)*.1;(n===null||e>n.score)&&(n={score:e,from:r})}return n===null?null:{score:n.score,at:Array.from({length:e.length},(e,t)=>n.from+t)}}function initials(e,t){let n=t.length,r=e.split(``).map(()=>Array(n).fill(-1/0)),i=e.split(``).map(()=>Array(n).fill(-1));for(let a=0;a<e.length;a++)for(let o=a;o<n;o++)if(t[o]===e[a]){if(a===0)startsWord(t,o)&&(r[a][o]=rt);else for(let e=a-1;e<o;e++){if(r[a-1][e]===-1/0)continue;let n=e===o-1;if(!n&&!startsWord(t,o))continue;let s=r[a-1][e]+rt+(n?nt:-Math.min(o-e-1,at)*it);s>r[a][o]&&(r[a][o]=s,i[a][o]=e)}}let a=e.length-1,o=-1;for(let e=0;e<n;e++)r[a][e]>(o<0?-1/0:r[a][o])&&(o=e);if(o<0||r[a][o]===-1/0)return null;let s=[];for(let e=a,t=o;e>=0;e--)s.unshift(t),t=i[e][t];return{score:et+r[a][o],at:s}}function inTitle(e,t){let n=t.toLowerCase();return contiguous(e,n)??initials(e,n)}function keyword(e,t){for(let n of t){let t=n.toLowerCase();if(t.startsWith(e)||t.split(/\s+/).some(t=>t.startsWith(e)))return tt}return 0}function merged(e){let t=[];for(let n of[...new Set(e)].sort((e,t)=>e-t)){let e=t[t.length-1];e&&e[1]===n?e[1]=n+1:t.push([n,n+1])}return t}function matchOf(e,t){let n=0,r=[];for(let i of t){let t=inTitle(i,e.title);if(t){n+=t.score,r.push(...t.at);continue}let a=keyword(i,e.keywords);if(a>0)n+=a;else return null}return{action:e,score:n,ranges:merged(r)}}function rankActions(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?e.map(e=>({action:e,score:0,ranges:[]})):e.map((e,t)=>({match:matchOf(e,n),order:t})).filter(e=>e.match!==null).sort((e,t)=>t.match.score-e.match.score||e.order-t.order).map(e=>e.match)}var ot=[`Check & run`,`Layout & convert`,`Deploy & share`,`View`,`File`,`Edit`,`Help`];function pushRecent(e,t){return[t,...e.filter(e=>e!==t)].slice(0,5)}function browseGroups(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=r.length>0?[{title:saySection(`Recent`),items:r}]:[];for(let t of ot){let n=e.filter(e=>e.section===t&&!i.has(e.id));n.length>0&&a.push({title:saySection(t),items:n})}return a}function moveSelection(e,t,n){return n===0?-1:((e+t)%n+n)%n}function publishedActions(e,t){return e.filter(e=>e.listed).map(e=>{let n=G(e.shortcut,t);return{id:e.id,title:e.title,section:e.section,enabled:e.enabled,...e.checked===void 0?{}:{checked:e.checked},...n?{shortcut:n}:{}}})}function trailingToDrop(e,t){let n=0,r=0;for(let i=e.length-1;i>=0&&n<t;--i)n+=e[i],r+=1;return r}function beginWidthDrag(e,t){let n=t?.target??(typeof window<`u`?window:null);if(!n||typeof n.addEventListener!=`function`)return()=>{};let r=Number.isFinite(e)?e:0,i=Number.isFinite(t.min)?t.min:0,a=Number.isFinite(t.max)?t.max:Math.max(i,1e3),o=Math.min(i,a),s=Math.max(i,a),c=Number.isFinite(t.width)?Math.min(s,Math.max(o,t.width)):o,l=!1,move=e=>{let n=Number.isFinite(e?.clientX)?e.clientX:0;c=Math.min(s,Math.max(o,t.width+r-n));try{t.onWidth?.(c)}catch{}},end=()=>{if(!l){stop();try{t.onCommit(c)}catch{}}};function stop(){if(!l){l=!0;try{n.removeEventListener(`pointermove`,move),n.removeEventListener(`pointerup`,end),n.removeEventListener(`pointercancel`,end)}catch{}}}try{n.addEventListener(`pointermove`,move),n.addEventListener(`pointerup`,end),n.addEventListener(`pointercancel`,end)}catch{}return stop}function EditableTitle({title:e,editable:n,problem:r,onProblem:a}){let[o,c]=t(!1),d=i(null),f=i(null);l(()=>{n.start&&(c(!0),n.onStarted?.())},[n.start]),l(()=>{o&&(d.current?.focus(),d.current?.select())},[o]);let close=()=>{c(!1),requestAnimationFrame(()=>f.current?.focus())},settle=(e,t)=>{a(e),!(e&&t)&&close()},finish=(t,r)=>{let i=d.current?.value??e;if(!t){a(null),close();return}let o=Ue(e,i);if(!o){settle(null,!1);return}let s=n.onCommit(o);s instanceof Promise?s.then(e=>settle(e,r)):settle(s,r)};return o?s(`input`,{ref:d,class:`sidebar__nav-field type-input`,"aria-label":n.label,"aria-invalid":r?!0:void 0,defaultValue:e,onBlur:()=>o&&finish(!0,!1),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),finish(!0,!0)):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),finish(!1,!1))}}):s(`button`,{ref:f,type:`button`,class:`sidebar__nav-title type-section-heading is-editable`,title:u(`app.sidebar.clickOrPressF2To`,{title:e}),"aria-label":u(`app.sidebar.pressF2OrEnterTo`,{title:e,label:n.label}),onClick:()=>c(!0),onKeyDown:e=>Ce(e.key)&&c(!0),children:e})}function NavRow({title:e,backLabel:n,onBack:i,editable:a,trailing:o}){let[c,l]=t(null);return s(r,{children:[s(`div`,{class:`sidebar__nav`,children:[s(`button`,{type:`button`,class:`sidebar__icon`,"aria-label":n,title:u(`app.common.back`),onClick:i,children:s(J,{name:`back`})}),a?s(EditableTitle,{title:e,editable:a,problem:c,onProblem:l}):s(`span`,{class:`sidebar__nav-title type-section-heading`,title:e,children:e}),o?s(`span`,{class:`sidebar__nav-actions`,children:o}):null]}),c&&s(`p`,{class:`penstock-review__issue is-mismatch`,role:`alert`,children:c})]})}var st=16,ct=28;function tabTitle(e){return u(`app.sidebar.tab.${e}`)}function sameIds(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function useFit$1(e,n,r){let[a,o]=t([]),s=i(new Map);return c(()=>{let t=e.current;if(!t||r===void 0||t.clientWidth===0)return;let i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,c=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0);for(let e of t.querySelectorAll(`:scope > [data-tab]`))s.current.set(e.getAttribute(`data-tab`)??``,e.offsetWidth);let l=Array.from(t.children).filter(e=>!e.hasAttribute(`data-tab`)&&!e.hasAttribute(`data-more`)).reduce((e,t)=>e+t.offsetWidth+a,0),u=be(n.map(e=>({id:e,width:(s.current.get(e)??ct)+a})),r,t.clientWidth-c-l,ct+a);o(e=>sameIds(e,u)?e:u)}),a}e(useFit$1,`useFit`);function Sidebar({tabs:e,api:n,badges:r={},statuses:a={},hidden:o=!1}){let{state:d,width:f,limits:p,drawer:m}=n,h=i(null),g=i(null),_=e.map(e=>e.id),v=e.find(e=>e.id===d.tab)??e[0],y=v?d.stacks[v.id]??[]:[],b=!d.hidden&&!(m&&d.collapsed),x=useFit$1(h,_,v?.id),[S,C]=t(!1),[w,T]=t(null);l(()=>{T(e=>e===v?.id?e:null)},[v?.id]);let E=i(null);if(c(()=>()=>{E.current?.(),E.current=null},[b]),d.hidden||o||!v)return null;if(m&&d.collapsed){let e=v.bar;return s(`div`,{class:`sidebar-bar`,role:`toolbar`,"aria-label":u(`app.sidebar.collapsedLabel`,{title:tabTitle(v.id)}),children:[e?s(e,{active:!0,views:y,width:f,push:e=>n.push(v.id,e),back:()=>n.back(v.id),reset:()=>n.reset(v.id)}):s(`span`,{class:`sidebar-bar__title`,children:tabTitle(v.id)}),s(`button`,{type:`button`,class:`sidebar__icon`,"aria-label":u(`app.sidebar.openTheSidebar`),title:u(`app.sidebar.openTheSidebar`),onClick:n.toggleCollapsed,children:s(J,{name:`expand`})})]})}let onTabKey=e=>{let t=Pe(_,v.id,e.key);t&&(e.preventDefault(),T(t),n.select(t),requestAnimationFrame(()=>{try{let e=typeof CSS<`u`&&CSS.escape?CSS.escape(t):t;h.current?.querySelector(`[data-tab="${e}"]`)?.focus()}catch{}}))},startDrag=e=>{e.preventDefault(),E.current?.(),E.current=beginWidthDrag(e.clientX,{width:f,min:p.min,max:p.max,onWidth:n.setWidth,onCommit:n.commitWidth})},onSeparatorKey=e=>{let t=e.key===`ArrowLeft`?st:e.key===`ArrowRight`?-16:0;if(t===0)return;e.preventDefault();let r=Math.min(p.max,Math.max(p.min,f+t));n.setWidth(r),n.commitWidth(r)},onBodyKey=e=>{e.key===`Escape`&&y.length>0&&!(e.target instanceof Element&&e.target.closest(`input, textarea, select`))&&(e.preventDefault(),n.back(v.id))},D=e.filter(e=>x.includes(e.id));return s(`aside`,{ref:g,class:`sidebar${m?` is-drawer`:``}`,style:{width:`${f}px`},"aria-label":u(`app.sidebar.sidebar`),children:[s(`div`,{class:`sidebar__separator`,role:`separator`,"aria-orientation":`vertical`,"aria-label":u(`app.sidebar.resizeTheSidebar`),"aria-valuenow":f,"aria-valuemin":p.min,"aria-valuemax":p.max,tabIndex:0,onPointerDown:startDrag,onDblClick:()=>{n.setWidth(null),n.commitWidth(null)},onKeyDown:onSeparatorKey}),s(`div`,{class:`sidebar__tabs`,role:`tablist`,"aria-label":u(`app.sidebar.sidebar`),ref:h,onKeyDown:onTabKey,children:[e.filter(e=>!x.includes(e.id)).map(e=>{let t=ke(r[e.id]),i=e.id===v.id,o=a[e.id],c=o?u(`app.sidebar.status.${o}`):null;return s(`button`,{type:`button`,role:`tab`,id:`sidebar-tab-${e.id}`,"data-tab":e.id,"aria-selected":i,"aria-controls":`sidebar-panel-${e.id}`,tabIndex:i?0:-1,class:`sidebar__tab type-sidebar-tab${i?` type-sidebar-tab-selected is-selected`:``}`,title:i?void 0:tabTitle(e.id),"aria-label":i?void 0:[tabTitle(e.id),t?Re(r[e.id]):null,c].filter(Boolean).join(`, `),onClick:()=>n.select(e.id),children:[s(J,{name:e.icon}),i&&s(`span`,{class:`sidebar__tab-label`,children:tabTitle(e.id)}),o===`working`&&s(`span`,{class:`sidebar__status is-working`,"aria-hidden":`true`,children:s(A,{})}),o===`waiting`&&s(`span`,{class:`sidebar__status is-waiting`,"aria-hidden":`true`}),t&&s(`span`,{class:`sidebar__badge`,"aria-label":Re(r[e.id]),children:t})]},e.id)}),D.length>0&&s(`div`,{class:`sidebar__more-wrap`,"data-more":!0,children:[s(`button`,{type:`button`,class:`sidebar__icon sidebar__more`,"aria-label":u(`app.sidebar.moreTabs`),title:u(`app.sidebar.moreTabs`),"aria-haspopup":`menu`,"aria-expanded":S,onClick:()=>C(e=>!e),onKeyDown:e=>{e.key===`Escape`&&C(!1)},children:s(J,{name:`more`})}),S&&s(`div`,{class:`sidebar__menu`,role:`menu`,"aria-label":u(`app.sidebar.moreTabs`),children:D.map(e=>s(`button`,{type:`button`,role:`menuitem`,class:`sidebar__menu-item type-sidebar-tab`,"data-tab-more":e.id,onClick:()=>{C(!1),n.select(e.id)},children:[s(J,{name:e.icon}),s(`span`,{children:tabTitle(e.id)})]},e.id))})]}),m&&s(`button`,{type:`button`,class:`sidebar__icon sidebar__collapse`,"aria-label":u(`app.sidebar.collapseTheSidebar`),title:u(`app.sidebar.collapseTheSidebar`),onClick:n.toggleCollapsed,children:s(J,{name:`close`})})]}),y.length>0&&!v.ownHeader&&s(NavRow,{title:y[y.length-1].title,backLabel:u(`app.sidebar.backTo`,{title:y.length>1?y[y.length-2].title:tabTitle(v.id)}),onBack:()=>n.back(v.id)}),s(`div`,{class:`sidebar__body`,"data-switch":w===v.id?`key`:`pointer`,onKeyDown:onBodyKey,children:e.map(e=>{let t=e.component,r=e.id===v.id;return s(`div`,{role:`tabpanel`,id:`sidebar-panel-${e.id}`,"aria-labelledby":`sidebar-tab-${e.id}`,class:`sidebar__panel${e.padded?` sidebar__content`:``}`,hidden:!r,children:s(t,{active:r,views:d.stacks[e.id]??[],width:f,push:t=>n.push(e.id,t),back:()=>n.back(e.id),reset:()=>n.reset(e.id)})},e.id)})})]})}var Q=1100;function useSidebar(e,r){let[o,s]=t(()=>Fe(N(),e,r)),[c,u]=t(Q),[d,f]=t(!1),[p,m]=t(null),h=i(null),g=n(e=>{if(h.current?.disconnect(),h.current=null,e){try{u(e.getBoundingClientRect().width||Q)}catch{u(Q)}typeof ResizeObserver<`u`&&(h.current=new ResizeObserver(()=>{if(e)try{u(e.getBoundingClientRect().width||Q)}catch{}}),h.current.observe(e))}},[]);l(()=>()=>{h.current?.disconnect(),h.current=null},[]);let _=i(Je(o,r,N())),v=n(e=>{let t=Je(e,r,_.current);if(JSON.stringify(t)!==JSON.stringify(_.current)){_.current=t;try{P(t)}catch{}}},[r]);l(()=>{v({...o,width:_.current.sidebarWidth??null})},[o.tab,o.hidden,o.collapsed]);let y=Be(c),b=o.tab,x=o.collapsed,S=i(y);S.current=y;let C=n(t=>{S.current?e.includes(t)&&(m({tab:t,collapsed:!1}),f(!0)):s(n=>Oe(n,e,t))},[e.join(`|`)]),w=n(()=>{S.current?f(e=>!e):s(Ke)},[]),T=n(()=>{S.current?m(e=>({tab:e?.tab??b,collapsed:!(e?.collapsed??x)})):s(Se)},[b,x]),E=n((e,t)=>s(n=>Ee(n,e,t)),[]),D=n(e=>s(t=>Te(t,e)),[]),O=n(e=>s(t=>Ie(t,e)),[]),k=n(e=>s(t=>({...t,width:e})),[]),A=i(o);A.current=o;let j=n(e=>v(e===void 0?A.current:{...A.current,width:e}),[v]),M=a(()=>y?{...o,tab:p?.tab??o.tab,collapsed:p?.collapsed??o.collapsed,hidden:!d}:o,[o,y,d,p]),F=De(M,y),I=i(null),L=n(t=>{if(F===t){let n=I.current;I.current=null,C(n&&e.includes(n)?n:e.find(e=>e!==t)??t)}else I.current=F??A.current.tab,C(t)},[F,C,e.join(`|`)]);return a(()=>({state:M,width:Ne(o.width,c),limits:_e(c),drawer:y,editorWidth:c,measure:g,select:C,toggle:w,toggleCollapsed:T,push:E,back:D,reset:O,setWidth:k,commitWidth:j,shownTab:F,pressTab:L}),[M,o.width,y,c,g,C,w,T,E,D,O,k,j,F,L])}function createPanelHost(){return document.createElement(`div`)}function PanelHost({host:e,id:t,class:n,shown:r}){let a=i(null);return c(()=>{t!==void 0&&(e.id=t),n!==void 0&&(e.className=n),r!==void 0&&(e.style.display=r?`block`:`none`)},[e,t,n,r]),c(()=>{let t=a.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),s(`div`,{ref:a,style:{display:`contents`}})}var lt={error:`M 339.07183,256.00001 463.66713,131.4047 c 15.28961,-15.2896 15.28961,-40.079175 0,-55.381227 l -27.6906,-27.690611 c -15.28961,-15.289602 -40.07917,-15.289602 -55.38123,0 L 256,172.92818 131.4047,48.332862 c -15.2896,-15.289602 -40.079177,-15.289602 -55.381228,0 L 48.332861,76.023473 c -15.2896,15.2896 -15.2896,40.079177 0,55.381227 L 172.92815,256.00001 48.332861,380.59531 c -15.2896,15.2896 -15.2896,40.07917 0,55.38123 l 27.690611,27.69061 c 15.289601,15.28959 40.091628,15.28959 55.381228,0 L 256,339.07184 380.5953,463.66715 c 15.2896,15.28959 40.09162,15.28959 55.38123,0 l 27.6906,-27.69061 c 15.28961,-15.2896 15.28961,-40.07918 0,-55.38123 z`,warning:`m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z`};function SeverityIcon({severity:e}){return s(`span`,{class:`severity severity--${e}`,role:`img`,"aria-label":u(e===`error`?`app.diagramCheck.error`:`app.diagramCheck.warning`),children:s(`svg`,{viewBox:`0 0 512 512`,"aria-hidden":`true`,children:s(`path`,{d:lt[e],fill:`currentColor`})})})}var ut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function rotate(e,t){return e>>>t|e<<32-t}function sha256Bytes(e){let t=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=e.length,r=new Uint8Array(n+9+63>>6<<6);r.set(e),r[n]=128;let i=new DataView(r.buffer);i.setUint32(r.length-8,Math.floor(n/536870912),!1),i.setUint32(r.length-4,n<<3>>>0,!1);let a=new Uint32Array(64);for(let e=0;e<r.length;e+=64){for(let t=0;t<16;t+=1)a[t]=i.getUint32(e+t*4,!1);for(let e=16;e<64;e+=1){let t=a[e-15],n=a[e-2],r=rotate(t,7)^rotate(t,18)^t>>>3,i=rotate(n,17)^rotate(n,19)^n>>>10;a[e]=a[e-16]+r+a[e-7]+i>>>0}let[n,r,o,s,c,l,u,d]=t;for(let e=0;e<64;e+=1){let t=rotate(c,6)^rotate(c,11)^rotate(c,25),i=c&l^~c&u,f=d+t+i+ut[e]+a[e]>>>0,p=(rotate(n,2)^rotate(n,13)^rotate(n,22))+(n&r^n&o^r&o)>>>0;d=u,u=l,l=c,c=s+f>>>0,s=o,o=r,r=n,n=f+p>>>0}t[0]+=n,t[1]+=r,t[2]+=o,t[3]+=s,t[4]+=c,t[5]+=l,t[6]+=u,t[7]+=d}let o=``;for(let e of t)o+=e.toString(16).padStart(8,`0`);return o}function sha256Text(e){return sha256Bytes(new TextEncoder().encode(e))}var dt=64;function lines(e){return e.replace(/^/,``).replace(/\r\n?/g,`
|
|
3
|
-
`)}function ordered(e){let t=[],n=[];if(e.children.forEach((e,r)=>{(e.local===`incoming`||e.local===`outgoing`)&&(t.push(r),n.push(e))}),n.length<2)return e.children;n.sort((e,t)=>{let n=`${e.local}|${e.text.trim()}`,r=`${t.local}|${t.text.trim()}`;return n<r?-1:+(n>r)});let r=[...e.children];return t.forEach((e,t)=>{r[e]=n[t]}),r}function canonicalXml(e){let t=_(lines(e)),n=[],r=[t];for(let e=r.pop();e!==void 0;e=r.pop()){if(typeof e==`string`){n.push(e);continue}let t=Object.keys(e.attrs).sort().map(t=>` ${t}="${g(e.attrs[t])}"`).join(``),i=e.text.trim();if(e.children.length===0&&i===``){n.push(`<${e.name}${t}/>`);continue}n.push(`<${e.name}${t}>`),i!==``&&n.push(g(i)),r.push(`</${e.name}>`);let a=ordered(e);for(let e=a.length-1;e>=0;--e)r.push(a[e])}return n.join(``)}function canonicalValue(e,t){if(t>dt)return null;if(typeof e!=`object`||!e)return JSON.stringify(e)??`null`;if(Array.isArray(e)){let n=[];for(let r of e){let e=canonicalValue(r,t+1);if(e===null)return null;n.push(e)}return`[${n.join(`,`)}]`}let n=e,r=[];for(let e of Object.keys(n).sort()){let i=canonicalValue(n[e],t+1);if(i===null)return null;r.push(`${JSON.stringify(e)}:${i}`)}return`{${r.join(`,`)}}`}function canonicalJson(e){let t=canonicalValue(JSON.parse(lines(e)),0);if(t===null)throw Error(`too deep`);return t}function contentHash(e,t){if(t.length>20971520)return{hash:sha256Text(`raw\n${lines(t)}`),readable:!1};try{return{hash:sha256Text(e===`form`?canonicalJson(t):canonicalXml(t)),readable:!0}}catch{return{hash:sha256Text(`raw\n${lines(t)}`),readable:!1}}}var $=100,ft=4,EngineReadRefused=class extends Error{unreachable;constructor(e,t=!1){super(e),this.name=`EngineReadRefused`,this.unreachable=t}};function reason(e,t){return e===0?new EngineReadRefused(u(`app.promotion.read.unreachable`,{reason:t.slice(0,200)}),!0):e===401||e===403?new EngineReadRefused(u(`app.promotion.read.credentials`,{status:e})):new EngineReadRefused(u(`app.promotion.read.status`,{status:e}))}async function json(e,t){let n=await e(t);if(n.status<200||n.status>=300)throw reason(n.status,n.body);try{return JSON.parse(n.body)}catch{throw new EngineReadRefused(u(`app.promotion.read.notJson`))}}function text(e){return typeof e==`string`&&e!==``?e:null}function versionOf(e){let t=Number(e??0);return Number.isFinite(t)?t:0}async function engineVersion(e,t){try{return text(e===`CAMUNDA_8`?(await json(t,{method:`GET`,path:`/topology`}))?.gatewayVersion:(await json(t,{method:`GET`,path:`/version`}))?.version)}catch(e){if(e instanceof EngineReadRefused&&e.unreachable)throw e;return null}}async function listCamunda7(e,t,n,r){let i=e===`process`?`/process-definition`:`/decision-definition`,a=n.tenantId?`&tenantIdIn=${encodeURIComponent(n.tenantId)}`:`&withoutTenantId=true`,o=[];for(let n=0;;n+=$){let s=await json(t,{method:`GET`,path:`${i}?latestVersion=true&sortBy=key&sortOrder=asc&firstResult=${n}&maxResults=${$}${a}`});if(!Array.isArray(s))throw new EngineReadRefused(u(`app.promotion.read.notJson`));for(let t of s){let n=text(t?.key),r=text(t?.id);n!==null&&r!==null&&o.push({kind:e,key:n,id:r,version:versionOf(t?.version),resource:text(t?.resource)})}if(o.length>r)throw new EngineReadRefused(u(`app.promotion.read.tooMany`,{limit:r}));if(s.length<$)return o}}async function listCamunda8(e,t,n,r){let i=e===`process`?`/process-definitions`:`/decision-definitions`,a=[],o=null;for(;;){let s=e===`process`?{isLatestVersion:!0}:{};n.tenantId&&(s.tenantId=n.tenantId);let c=o===null?{limit:$}:{limit:$,after:o},l=await json(t,{method:`POST`,path:`${i}/search`,body:JSON.stringify({filter:s,page:c})}),d=Array.isArray(l?.items)?l.items:[];for(let t of d){let n=text(e===`process`?t.processDefinitionId:t.decisionDefinitionId),r=text(e===`process`?t.processDefinitionKey:t.decisionDefinitionKey);n!==null&&r!==null&&a.push({kind:e,key:n,id:String(r),version:versionOf(t.version),resource:text(t.resourceName)})}if(a.length>r)throw new EngineReadRefused(u(`app.promotion.read.tooMany`,{limit:r}));let f=l?.page?.endCursor;if(d.length<$)return e===`process`?a:latestOfEach(a);if(typeof f!=`string`||f===``||f===o)throw new EngineReadRefused(u(`app.promotion.read.notJson`));o=f}}function latestOfEach(e){let t=new Map;for(let n of e){let e=t.get(n.key);(!e||n.version>e.version)&&t.set(n.key,n)}return[...t.values()]}async function resourceText(e,t,n){let r=encodeURIComponent(t.id);if(e===`CAMUNDA_8`){let e=await n({method:`GET`,path:`/${t.kind}-definitions/${r}/xml`});if(e.status<200||e.status>=300)throw reason(e.status,e.body);let i=e.body.trim();if(i.startsWith(`{`))try{let e=JSON.parse(i);if(typeof e.xml==`string`)return e.xml}catch{return e.body}return e.body}let i=await json(n,{method:`GET`,path:`/${t.kind}-definition/${r}/xml`}),a=t.kind===`process`?i?.bpmn20Xml:i?.dmnXml;if(typeof a!=`string`)throw new EngineReadRefused(u(`app.promotion.read.noResource`,{key:t.key}));return a}async function pool(e,t){let n=Array(e.length),r=0,run=async()=>{for(;;){let i=r;if(r+=1,i>=e.length)return;n[i]=await t(e[i])}};return await Promise.all(Array.from({length:Math.min(ft,e.length)},run)),n}async function readEngine(e,t,n={}){let r=n.maxDefinitions??2e3,i=e===`CAMUNDA_8`?listCamunda8:listCamunda7,a=await engineVersion(e,t),o=[...await i(`process`,t,n,r),...await i(`decision`,t,n,r)],s=n.wanted??null,c=o.filter(e=>s===null||s.has(`${e.kind}:${e.key}`));if(c.length>(n.maxFetched??400))throw new EngineReadRefused(u(`app.promotion.read.tooManyToRead`,{limit:n.maxFetched??400}));let l=new Map;return await pool(c,async n=>{let r=await resourceText(e,n,t);if(r.length>20971520)throw new EngineReadRefused(u(`app.promotion.read.tooLarge`,{key:n.key}));l.set(`${n.kind}:${n.key}`,contentHash(n.kind,r))}),{version:a,definitions:o.map(e=>{let t=l.get(`${e.kind}:${e.key}`);return{...e,hash:t?.hash??null,readable:t?.readable??!1}})}}function recordKey(e,t){return`${e}:${t}`}function localKeys(e){return new Set(e.resources.map(e=>recordKey(e.kind,e.key)))}function kindOfPath(e){return/\.bpmn$/i.test(e)||/\.bpmn20\.xml$/i.test(e)?`process`:/\.dmn$/i.test(e)||/\.dmn11\.xml$/i.test(e)?`decision`:/\.form$/i.test(e)?`form`:null}function keysOf(e,t){if(e===`form`)return[];try{let n=_(t.replace(/^/,``)),r=e===`process`?`process`:`decision`;return[n,...h(n,r)].filter(e=>e.local===r).filter(t=>e!==`process`||t.attrs.isExecutable!==`false`).map(e=>e.attrs.id).filter(e=>typeof e==`string`&&e!==``)}catch{return null}}function scanLocal(e){let t=[],n=[],r=new Map;for(let t of[...e].sort((e,t)=>e.path<t.path?-1:1)){let e=kindOfPath(t.path);if(e===null)continue;let{hash:i,readable:a}=contentHash(e,t.text),o=keysOf(e,t.text);if(n.push({file:t.path,kind:e,hash:i,readable:a&&o!==null,keys:o??[]}),e!==`form`&&o!==null)for(let n of o){let o={kind:e,key:n,file:t.path,hash:i,readable:a},s=`${o.kind}:${n}`;r.set(s,[...r.get(s)??[],o])}}let i=[];for(let e of r.values())t.push(e[0]),e.length>1&&i.push({kind:e[0].kind,key:e[0].key,files:e.map(e=>e.file)});return{resources:t,files:n,duplicates:i}}function unchangedFiles(e,t,n,r){let i=[],a=[];for(let o of r){let r=e.files.find(e=>e.file===o);if(r===void 0||!r.readable){a.push(o);continue}let s;if(r.kind===`form`)s=n[`form:${r.file}`]?.hash===r.hash;else{let n=e.resources.filter(e=>e.file===r.file);s=n.length>0&&n.length===r.keys.length&&n.every(e=>t.definitions.some(t=>t.kind===e.kind&&t.key===e.key&&t.hash===e.hash))}s?i.push({file:o,reason:u(`app.promotion.onlyChanged.unchanged`)}):a.push(o)}return{send:a,skipped:i,note:null}}async function unchangedOnEngine(e){let t=e.files.map(e=>e.path),n=scanLocal(e.files);if(n.resources.length===0)return unchangedFiles(n,{version:null,definitions:[]},e.records??{},t);try{return unchangedFiles(n,await readEngine(e.engine,e.ask,{tenantId:e.tenantId,wanted:localKeys(n)}),e.records??{},t)}catch(e){let n=e instanceof EngineReadRefused||e instanceof Error?e.message:String(e);return{send:t,skipped:[],note:u(`app.promotion.onlyChanged.notCompared`,{reason:n})}}}async function unchangedOf(e,t,n){if(!e.deployment||!I(String(e.engine)))return null;let r=v(),i=e.profile??null;return unchangedOnEngine({engine:e.engine,ask:e=>r.askEngine(i,e,n),tenantId:e.deployment.tenantId??null,files:t.map(e=>({path:e.name,text:e.content}))})}function protectedName(e){return e?.deployment?._protected===!0?e.profile??`default`:null}function usePinning(){let[,e]=t(0);l(()=>{try{return F(()=>e(e=>e+1))}catch{return}},[]);let n=N()||{},r=Array.isArray(n.toolbarPinned)?n.toolbarPinned:[],i=Array.isArray(n.toolbarUnpinned)?n.toolbarUnpinned:[],isPinned=e=>!e||!e.id?!1:e.place===`pinned`?!i.includes(e.id):r.includes(e.id),toggle=e=>{if(!e||!e.id)return;let flip=t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id];try{P(e.place===`pinned`?{toolbarUnpinned:flip(i)}:{toolbarPinned:flip(r)})}catch{}};return{isPinned,toggle}}function hostIsMac(){return typeof navigator<`u`&&typeof navigator?.platform==`string`&&V(navigator.platform)}var pt=`palette-list`,optionId=e=>`palette-option-${e}`;function Highlighted({title:e,ranges:t}){let n=typeof e==`string`?e:String(e??``),i=Array.isArray(t)?t:[];if(i.length===0)return s(r,{children:n});let a=[],o=0;return i.forEach(([e,t])=>{let i=Math.max(0,Math.min(n.length,Number.isFinite(e)?e:0)),c=Math.max(i,Math.min(n.length,Number.isFinite(t)?t:i));i>o&&a.push(s(r,{children:n.slice(o,i)})),a.push(s(`span`,{className:`palette__match`,children:n.slice(i,c)})),o=c}),o<n.length&&a.push(s(r,{children:n.slice(o)})),s(r,{children:a})}function Palette({entries:e,recent:n,pinning:r,locked:o,onRun:u,onClose:d,returnFocusTo:f}){let p=x(),[m,h]=t(``),[g,_]=t(0),v=i(null),y=i(null),b=hostIsMac(),S=a(()=>(Array.isArray(e)?e:[]).filter(Boolean).map(e=>({id:e.id,title:e.title,section:e.section,keywords:e.keywords,entry:e,ranges:[]})),[e]),C=m.trim().length>0,w=a(()=>{if(C){let e=rankActions(S,m).map(e=>({...e.action,ranges:e.ranges}));return e.length>0?[{title:``,items:e}]:[]}return browseGroups(S,Array.isArray(n)?n:[])},[S,n,m,C]),T=a(()=>(Array.isArray(w)?w:[]).flatMap(e=>Array.isArray(e?.items)?e.items:[]),[w]),E=T[g];l(()=>_(0),[m]),l(()=>{if(E)try{let e=typeof CSS<`u`&&CSS.escape?CSS.escape(optionId(E.id)):optionId(E.id);v.current?.querySelector(`#${e}`)?.scrollIntoView({block:`nearest`})}catch{}},[E?.id]),c(()=>{let e=y.current;if(!e)return;let t=f,n=[],r=e,i=0;for(;r&&r.parentElement&&i<50;){i+=1;let e=r.parentElement;for(let t of Array.from(e.children))t===r||t.hasAttribute(`inert`)||(t.setAttribute(`inert`,``),n.push(t));r=e}return()=>{n.forEach(e=>e.removeAttribute(`inert`));let r=document.activeElement,i=r!==null&&e.contains(r),a=r===null||r===document.body||!document.contains(r);if((i||a)&&t)try{t.focus()}catch{}}},[]);let run=e=>{if(e&&e.entry.enabled)try{u(e.entry)}catch{}},keys=e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),_(t=>moveSelection(t,e.key===`ArrowDown`?1:-1,T.length));else if(e.key===`Home`&&e.ctrlKey)e.preventDefault(),_(0);else if(e.key===`End`&&e.ctrlKey)e.preventDefault(),_(Math.max(0,T.length-1));else if(e.key===`Enter`){if(e.preventDefault(),e.shiftKey){if(E)try{r?.toggle?.(E.entry)}catch{}}else run(E)}else e.key===`Tab`&&e.preventDefault()},flatIndex=e=>T.findIndex(t=>t.id===e.id);return s(`div`,{ref:y,className:`palette-overlay`,onMouseDown:e=>{e.target===e.currentTarget&&d()},children:s(`div`,{className:`palette`,role:`dialog`,"aria-modal":`true`,"aria-label":p(`app.palette.label`),children:[s(`input`,{className:`palette__field`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":pt,"aria-autocomplete":`list`,"aria-activedescendant":E?optionId(E.id):void 0,"aria-describedby":`palette-hint`,placeholder:p(`app.palette.search`),spellcheck:!1,autoComplete:`off`,autoFocus:!0,value:m,onInput:e=>h(e.currentTarget.value),onKeyDown:keys,ref:e=>e?.focus()}),s(`span`,{id:`palette-hint`,className:`palette__hint`,children:p(`app.palette.hint`)}),s(`ul`,{className:`palette__list`,id:pt,role:`listbox`,"aria-label":p(`app.palette.actions`),ref:v,children:[w.map(e=>s(`li`,{role:`presentation`,className:`palette__group`,children:[e.title&&s(`div`,{className:`palette__heading`,role:`presentation`,children:e.title}),s(`ul`,{role:`group`,"aria-label":e.title||p(`app.palette.matches`,{count:e.items.length}),className:`palette__group`,children:e.items.map(e=>{let t=e.entry,n=!!r?.isPinned?.(t),i=t.place!==`bar`,a=G(t.shortcut,b);return s(`li`,{id:optionId(e.id),role:`option`,"aria-selected":flatIndex(e)===g,"aria-disabled":!t.enabled,"aria-checked":t.checked===void 0?void 0:t.checked,className:`palette__row${flatIndex(e)===g?` is-active`:``}`,"aria-label":t.tier?`${e.title}, Penstock ${t.tier}`:e.title,title:t.tooltip,onMouseMove:()=>_(flatIndex(e)),onClick:()=>run(e),children:[s(`span`,{className:`palette__icon`,children:s(Y,{name:t.icon})}),s(`span`,{className:`palette__title`,children:s(Highlighted,{title:e.title,ranges:e.ranges})}),C&&s(`span`,{className:`palette__section`,children:e.section}),t.tier&&s(`span`,{className:`palette__tier`,children:[o&&s(Y,{name:`lock`}),t.tier]}),a&&s(`span`,{className:`palette__shortcut`,children:a}),t.checked&&s(`span`,{className:`palette__check`,children:s(Y,{name:`check`})}),i&&s(`button`,{type:`button`,tabIndex:-1,"aria-hidden":`true`,className:n?`palette__pin is-pinned`:`palette__pin`,title:p(n?`app.palette.unpin`:`app.palette.pin`),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation();try{r?.toggle?.(t)}catch{}},children:s(Y,{name:`pin`})})]},e.id)})})]},e.title||`results`)),T.length===0&&s(`li`,{className:`palette__empty`,role:`presentation`,children:p(`app.palette.noMatch`,{query:m.trim()})})]})]})})}function useHostActions(e,t){let n=K(),r=i({actions:e,openPalette:t});r.current={actions:e,openPalette:t};let a=`[]`;try{a=JSON.stringify(publishedActions(Array.isArray(e)?e:[],hostIsMac()))}catch{a=`[]`}l(()=>{if(n)try{let e=v();e?.publishActions&&e.publishActions(JSON.parse(a)).catch(()=>{})}catch{}},[a,n]),l(()=>{if(n)try{let e=v();return e?.onRunAction?e.onRunAction(e=>{try{if(e===z.id){r.current.openPalette();return}let t=(Array.isArray(r.current.actions)?r.current.actions:[]).find(t=>t?.id===e);if(t?.enabled){let e=t.run();e&&typeof e.catch==`function`&&e.catch(e=>console.error(e))}}catch(e){console.error(e)}}):void 0}catch{return}},[n])}function isAction(e){return!(`type`in e)}function TextButton({entry:e,wrapped:t=!1}){let n=[`toolbar-button`,`type-toolbar-button`,`with-label`];return e.presentation===`primary`&&n.push(`primary`),e.checked&&n.push(`active`),s(`button`,{type:`button`,id:e.id,className:n.join(` `),onClick:e.run,disabled:!e.enabled,title:e.disabledReason??U(e.tooltip,e.title,e.shortcut,hostIsMac()),"aria-description":e.disabledReason,"aria-pressed":e.checked,"aria-haspopup":e.popup===void 0?void 0:`dialog`,"aria-expanded":e.popup,"data-droppable":!t&&e.presentation!==`primary`&&e.place!==`bar`?``:void 0,children:s(`span`,{className:`toolbar-button-label`,children:e.title})})}function inPalette(e){return isAction(e)&&e.listed}function usePopup(e,t,n,r){l(()=>{if(!e)return;let away=e=>{n.current?.contains(e.target)||t(!1)},keys=e=>{if(e.key===`Escape`&&t(!1),e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=Array.from(r.current?.querySelectorAll(`.toolbar-menu__item:not(:disabled)`)??[]);if(n.length===0)return;e.preventDefault();let i=n.indexOf(document.activeElement);n[e.key===`ArrowDown`?(i+1)%n.length:(i-1+n.length)%n.length].focus()};return document.addEventListener(`mousedown`,away),document.addEventListener(`keydown`,keys),r.current?.querySelector(`.toolbar-menu__item:not(:disabled)`)?.focus(),()=>{document.removeEventListener(`mousedown`,away),document.removeEventListener(`keydown`,keys)}},[e])}function SplitButton({entry:e,menu:n}){let[r,a]=t(!1),o=i(null),c=i(null);usePopup(r,a,o,c);let l=e.presentation===`primary`?` primary`:``;return s(`div`,{className:`toolbar-menu toolbar-split`,ref:o,"data-droppable":e.presentation!==`primary`&&e.place!==`bar`?``:void 0,children:[s(TextButton,{entry:e,wrapped:!0}),s(`button`,{type:`button`,className:`toolbar-button type-toolbar-button toolbar-split__more${l}${r?` active`:``}`,onClick:()=>a(e=>!e),title:u(`app.toolbar.moreWaysTo`,{title:e.title.toLowerCase()}),"aria-label":u(`app.toolbar.moreWaysTo`,{title:e.title.toLowerCase()}),"aria-haspopup":`menu`,"aria-expanded":r,children:s(`span`,{className:`toolbar-button-icon`,role:`presentation`,children:s(Y,{name:`chevron`})})}),r&&s(`div`,{className:`toolbar-menu__list toolbar-menu__list--end`,role:`menu`,ref:c,children:n.map(e=>s(`div`,{className:`toolbar-menu__row`,children:s(`button`,{type:`button`,id:e.id,role:`menuitem`,className:`toolbar-menu__item`,title:e.tooltip,onClick:()=>{a(!1),e.run()},children:[s(Y,{name:e.icon}),s(`span`,{className:`toolbar-menu__label`,children:e.title})]})},e.id))})]})}function PaletteTrigger({open:e,onOpen:t,trigger:n}){let r=u(`app.toolbar.moreActionsHint`,{shortcut:G(z.shortcut,hostIsMac())});return s(`button`,{type:`button`,id:`toolbar-more`,ref:n,className:e?`toolbar-button type-toolbar-button active`:`toolbar-button type-toolbar-button`,onClick:t,title:r,"aria-label":u(`app.toolbar.moreActions`),"aria-haspopup":`dialog`,"aria-expanded":e,children:s(`span`,{className:`toolbar-button-icon`,role:`presentation`,children:s(Y,{name:`more`})})})}function Action({entry:e}){return e.menu&&e.menu.length>0?s(SplitButton,{entry:e,menu:e.menu}):e.presentation===`text`||e.presentation===`primary`?s(TextButton,{entry:e}):s(qe,{id:e.id,label:e.title,icon:e.icon,action:e.run,disabled:!e.enabled,tooltip:e.disabledReason??U(e.tooltip,e.title,e.shortcut,hostIsMac()),description:e.disabledReason,isActive:e.checked,checked:e.checked,status:e.status})}function useLocked(e){let[n,r]=t(!1);return l(()=>{if(!e)return;let t=!0;try{v()?.getLicense?.()?.then(e=>t&&r(!ye(e)))?.catch(()=>void 0)}catch{}return()=>{t=!1}},[e]),n}function useRecent(){let[,e]=t(0);l(()=>{try{return F(()=>e(e=>e+1))}catch{return}},[]);let n=N()?.recentActions;return Array.isArray(n)?n:[]}var mt=4;function useFit(e){let t=n(()=>{let t=e.current;if(!t)return;let n=Array.from(t.querySelectorAll(`[data-droppable]`));n.forEach(e=>{e.style.display=``});let r=t.scrollWidth-t.clientWidth;if(r<=0)return;let i=trailingToDrop(n.map(e=>e.offsetWidth+mt),r);n.slice(n.length-i).forEach(e=>{e.style.display=`none`})},[e]);c(t),l(()=>{let n=e.current;if(!n||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(t);return r.observe(n),()=>r.disconnect()},[t,e])}function Toolbar({items:e,visible:r=!0,className:a=``}){let o=usePinning(),c=i(null);useFit(c);let[u,d]=t(!1),f=i(null),p=i(null),m=useLocked(u),h=useRecent(),g=e.filter(isAction),_=e.filter(inPalette).sort((e,t)=>e.order-t.order),v=n(()=>{let e=document.activeElement;p.current=e instanceof HTMLElement&&e!==document.body?e:f.current,d(!0)},[]),y=n(()=>{d(!1)},[]),b=_.length>0;useHostActions(g,v);let x=K();l(()=>{if(!b||!x)return;let keys=e=>{W(e,z.shortcut,hostIsMac())&&(e.preventDefault(),u||v())};return document.addEventListener(`keydown`,keys),()=>document.removeEventListener(`keydown`,keys)},[b,u,v,x]);let S=n(e=>{if(y(),e){try{P({recentActions:pushRecent(N()?.recentActions??[],e.id)})}catch{}setTimeout(()=>{try{e.run()}catch(e){console.error(`Error executing toolbar action:`,e)}},0)}},[y]);if(!r)return null;let C=e.some(e=>`type`in e&&e.type===`overflow`)||!b?e:[...e,{type:`overflow`}];return s(`div`,{className:`toolbar ${a}`.trim(),ref:c,children:[C.map((e,t)=>isAction(e)?e.place===`menu`||e.place===`pinned`&&!o.isPinned(e)?null:s(Action,{entry:e},e.id):e.type===`separator`?s(`div`,{className:`toolbar-separator`},`sep-${t}`):e.type===`spacer`?s(`div`,{className:`toolbar-spacer`},`spacer-${t}`):b?[..._.filter(e=>e.place===`menu`&&o.isPinned(e)).map(e=>s(TextButton,{entry:{...e,id:`pinned-${e.id}`,title:e.title.replace(/…$/,``)}},`pinned-${e.id}`)),s(PaletteTrigger,{open:u,onOpen:v,trigger:f},`overflow`)]:null),u&&s(Palette,{entries:_,recent:h,pinning:o,locked:m,onRun:S,onClose:y,returnFocusTo:p.current})]})}function connectionActions(e){let t={id:`save-deploy`,label:u(`app.deploy.saveAndDeploy`),deploy:!0,role:e===`edit`?`secondary`:`primary`};return e===`edit`?[{id:`save`,label:u(`app.common.save`),deploy:!1,role:`primary`},t]:[t]}var ht=[`url`,`username`,`password`,`clientId`,`clientSecret`,`tokenUrl`];function isWebAddress(e){try{return/^https?:$/.test(new URL(e).protocol)}catch{return!1}}function connectionErrors(e){let t={},n=e.authType??`none`;return isWebAddress(e.url??``)||(t.url=u(`app.deploy.addressScheme`)),n===`basic`&&(e.username?.trim()||(t.username=u(`app.deploy.enterTheUserNameTo`)),!e.password&&!e.passwordSaved&&(t.password=u(`app.deploy.enterThePasswordToSign`))),n===`oauth`&&(e.clientId?.trim()||(t.clientId=u(`app.deploy.enterTheClientId`)),!e.clientSecret&&!e.clientSecretSaved&&(t.clientSecret=u(`app.deploy.enterTheClientSecret`)),isWebAddress(e.tokenUrl??``)||(t.tokenUrl=u(`app.deploy.tokenAddressScheme`))),t}var gt={none:[],basic:[`username`,`password`],oauth:[`clientId`,`clientSecret`,`tokenUrl`,`audience`]};function connectionFieldsOf(e){return gt[e??`none`]??[]}function firstInvalid(e){return ht.find(t=>t in e)??null}var _t=Object.values(f),vt=m(`http://localhost:8080/engine-rest`),yt=m(`http://localhost:8088`),bt=m(`https://login.cloud.camunda.io/oauth/token`);function ConnectionDialog({profile:e,engine:n,opened:r,onClose:i,onSaved:a}){let[o,c]=t({profile:e}),[d,f]=t(!1),[p,m]=t(!1),[h,g]=t(null),_=O();l(()=>{let t=!1;return v().getDeploymentSettings(e).then(n=>{t||c({...n,profile:e})}).catch(e=>console.error(`Failed to read the connection settings:`,e)).finally(()=>{t||f(!0)}),()=>{t=!0}},[e]),l(()=>{d&&document.querySelector(`.ui-dialog__body input`)?.focus()},[d]);let y=o.authType??`none`,set=e=>c(t=>({...t,...e})),b=connectionErrors(o),save=async e=>{if(_.submit(),firstInvalid(b))requestAnimationFrame(()=>document.querySelector(`.ui-dialog [aria-invalid="true"]`)?.focus());else{m(!0),g(null);try{await v().saveDeploymentSettings(o),a(e)}catch(e){g(u(`app.deploy.unableToSaveTheConnection`,{failure:ee(e)}))}finally{m(!1)}}},field=(e,t,n={})=>s(C,{label:e,hint:n.hint,optional:n.optional,error:_.errorOf(t,b[t]??null),children:e=>s(`input`,{...e,type:n.type??`text`,value:o[t]??``,placeholder:n.placeholder,disabled:!d||p,onInput:e=>set({[t]:e.target.value}),onBlur:()=>_.touch(t)})}),x=connectionActions(r),S=x.find(e=>e.role===`primary`)??x[0];return s(D,{title:u(`app.deploy.engineConnection`),subtitle:`${L(n)} · ${q({profile:e})}`,size:`medium`,onClose:i,onSubmit:()=>void save(S.deploy),footer:s(T,{actions:[{id:`cancel`,label:u(`app.common.cancel`),role:`cancel`,onClick:i,disabled:p},...x.map(e=>({id:e.id,label:e.label,role:e.role,onClick:()=>void save(e.deploy),disabled:!d,busy:p}))]}),children:[field(u(`app.deploy.engineAddress`),`url`,{placeholder:R(n)?yt:vt,hint:u(`app.deploy.keptInPenstockLocalYaml`)}),s(C,{label:u(`app.deploy.signIn`),group:`radiogroup`,children:e=>s(`div`,{...e,class:`ui-choice-group`,children:_t.map(e=>s(`label`,{class:`ui-choice`,children:[s(`input`,{type:`radio`,name:`auth`,checked:y===e,disabled:!d||p,onChange:()=>{_.reveal(connectionFieldsOf(e)),set({authType:e})}}),s(`span`,{children:u(e===`none`?`app.deploy.notNeeded`:e===`basic`?`app.deploy.userAndPassword`:`app.deploy.oauthClient`)})]},e))})}),y===`basic`&&field(u(`app.deploy.user`),`username`),y===`basic`&&field(u(`app.deploy.password`),`password`,{type:`password`,hint:o.passwordSaved?u(`app.deploy.savedInTheIdeS`):u(`app.deploy.keptInTheIdeS`)}),y===`oauth`&&field(u(`app.deploy.clientId`),`clientId`),y===`oauth`&&field(u(`app.deploy.clientSecret`),`clientSecret`,{type:`password`,hint:o.clientSecretSaved?u(`app.deploy.savedInTheIdeS`):u(`app.deploy.keptInTheIdeS`)}),y===`oauth`&&field(u(`app.deploy.tokenAddress`),`tokenUrl`,{placeholder:bt}),y===`oauth`&&field(u(`app.deploy.audience`),`audience`,{optional:!0}),s(`p`,{class:`ui-field__hint`,children:u(`app.deploy.nameTenantAndTheRest`)}),h&&s(w,{children:h})]})}var xt=4;function sentFiles(e){return e.length>xt?{names:e.slice(0,xt),more:e.length-xt}:{names:e,more:0}}function hookLines(e){let[t,...n]=e;return{command:t??u(`app.deploy.runningTheDeployHook`),said:n.filter(e=>e.trim().length>0)}}function deployPopover(e,t){let n=e?.targets??[],r=n.find(e=>(e.profile??null)===t)??null,i=r?.ready===!0;return{profiles:n.map(e=>({value:e.profile??null,label:e.profile??`default`})),chooseProfile:n.length>1,target:r,address:r?.url??null,canDeploy:i,action:u(i?`app.deploy.deploy`:`app.deploy.setUpConnection`)}}function DeployPopover({deploy:e}){let[n,i]=t(e.targets?.active??null),[a,o]=t(null),[c,d]=t(!0),[f,p]=t(``),m=deployPopover(e.targets,n),h=sentFiles(a??[]),g=ce(`deploy`),_=e.running,v=hookLines(_?.lines??[]);l(()=>{let t=!1;return e.filesToSend().then(e=>!t&&o(e)).catch(()=>!t&&o([])),()=>{t=!0}},[]);let y=protectedName(m.target),b=y===null||f.trim()===y,run=()=>{e.deployTo(n,{onlyChanged:c,confirmed:b})},edit=()=>{e.edit(n)};return s(M,{anchor:g,label:u(`app.deploy.deploy`),onClose:e.closePopover,width:352,class:`deploy-popover`,children:[s(`h3`,{class:`ui-popover__title`,children:u(`app.deploy.deploy`)}),m.chooseProfile&&s(C,{label:u(`app.deploy.profile`),layout:`top`,children:e=>s(`select`,{...e,value:n??``,onChange:e=>i(e.target.value||null),children:m.profiles.map(e=>s(`option`,{value:e.value??``,children:e.label},e.value??`default`))})}),s(`dl`,{class:`ui-popover__facts`,children:[s(`dt`,{children:u(`app.deploy.engineAddress`)}),s(`dd`,{children:m.address??u(`app.deploy.notSetYet`)}),s(`dt`,{children:u(`app.deploy.whatWillBeSent`)}),s(`dd`,{children:[a===null&&u(`app.deploy.readingTheDiagram`),a!==null&&h.names.length===0&&u(`app.deploy.nothingToDeploy`),h.names.map(e=>s(`span`,{class:`ui-popover__file`,children:e},e)),h.more>0&&s(`span`,{class:`ui-popover__file`,children:u(`app.deploy.andNMore`,{number:h.more})})]}),m.canDeploy&&s(r,{children:[s(`dt`,{children:u(`app.promotion.deploy.onlyChanged`)}),s(`dd`,{children:s(`label`,{class:`ui-popover__check`,children:[s(`input`,{type:`checkbox`,checked:c,onChange:e=>d(e.target.checked)}),s(`span`,{children:u(`app.promotion.deploy.onlyChangedHint`)})]})})]}),_&&s(r,{children:[s(`dt`,{children:u(`app.deploy.deployHook`)}),s(`dd`,{"aria-busy":`true`,children:[s(`span`,{class:`ui-popover__file`,children:v.command}),v.said.map(e=>s(`span`,{class:`ui-popover__file`,children:e},e))]})]})]}),y!==null&&m.canDeploy&&s(C,{label:u(`app.promotion.deploy.confirmLabel`,{name:y}),layout:`top`,hint:u(`app.promotion.deploy.protectedHint`,{name:y}),children:e=>s(`input`,{...e,type:`text`,value:f,autocomplete:`off`,onInput:e=>p(e.target.value)})}),s(`div`,{class:`ui-popover__actions`,children:s(k,{actions:[..._&&_.cancellable?[{id:`cancel`,label:u(`app.common.cancel`),role:`cancel`,onClick:e.cancelDeploy}]:[],...m.canDeploy&&!_?[{id:`edit`,label:u(`app.deploy.editConnection`),role:`secondary`,onClick:edit}]:[],{id:`deploy`,label:m.action,role:`primary`,onClick:run,busy:_!==null,disabled:_!==null||m.target===null&&e.targets!==null||m.canDeploy&&!b}]})})]})}function DeployLayer({deploy:e,engine:t}){return s(r,{children:[e.popover&&s(DeployPopover,{deploy:e}),e.editing&&s(ConnectionDialog,{profile:e.editing.profile??null,engine:t,onClose:e.closeEditor,opened:e.editingFor,onSaved:t=>void e.saved(t)})]})}function deployFailure(e){return{message:e.message,editConnection:e.status===401||e.status===403}}function useDeploy(e,r){let[a,o]=t(null),[s,c]=t(null),[f,m]=t(`deploy`),[h,g]=t(!1),[_,y]=t(null),b=i(null),x=i(!0),S=n((e,t)=>{g(!1),m(e),c(t)},[]),C=n(async()=>{try{let e=await v().getDeployTargets();return x.current&&o(e),e}catch(e){return console.error(`Failed to read the deployment targets:`,e),null}},[]);l(()=>(x.current=!0,C(),()=>{x.current=!1,b.current?.abort()}),[C]);let find=(e,t)=>e?.targets?.find(e=>(e?.profile??null)===t)??{profile:t,ready:!1},w=n(async t=>{let n=window.appConfig?.bpmnFilePath,r=n?await d(()=>import(`./testCaseRuns-B_XdqGFh.js`).then(e=>e.p).then(e=>e.resourcesOf(n,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).catch(()=>null):null;return r&&r.length>0?r.map(e=>({name:e.name,content:e.content})):[{name:e,content:t}]},[e]),T=n(async()=>{try{let e=await r();return e?(await w(e)).map(e=>e.name):[]}catch{return[]}},[r,w]),E=n(async(t,n={})=>{let i;try{i=await r()}catch(e){p.error(u(`app.deploy.unableToDeploy`,{reason:e instanceof Error?e.message:String(e)}));return}if(!i){p.error(u(`app.deploy.nothingInToDeploy`,{fileName:e}));return}let a=protectedName(t);if(a!==null&&n.confirmed!==!0){g(!0),p.error(u(`app.promotion.deploy.protectedNothingSent`,{name:a}));return}let o=await w(i);if(n.onlyChanged!==!1){let e=await unchangedOf(t,o).catch(()=>null);if(e&&e.skipped.length>0){if(e.send.length===0){p.info(u(`app.promotion.deploy.nothingToSend`,{target:t.url??q(t),names:e.skipped.map(e=>e.file).join(`, `)}));return}o=o.filter(t=>e.send.includes(t.name))}e?.note&&p.info(e.note)}let s=p.info(u(`app.deploy.deployingTo`,{fileName:e,target:q(t)})),c=new AbortController;b.current=c,y({lines:[],cancellable:v().hookRunsInBackground===!0});let l=null,d=``;try{l=await ze(t,o,void 0,{signal:c.signal,onLines:e=>y(t=>t&&{...t,lines:e})})}catch(e){d=e instanceof Error?e.message:String(e)}finally{p.hide(s)}if(b.current=null,y(null),!l)p.error(u(`app.deploy.unableToDeploy`,{reason:d}));else if(c.signal.aborted)p.info(u(`app.deploy.deployToCancelled`,{target:q(t)}));else if(l.ok)p.success(u(`app.deploy.succeededOn`,{message:l.message,target:t.url??q(t)}));else{let e=deployFailure(l);p.error(e.message,e.editConnection?{label:u(`app.deploy.editConnection2`),run:()=>S(`deploy`,t)}:void 0)}},[r,e,w,S]),D=n(async(e,t={})=>{let n=find(a??await C(),e);n.ready?await E(n,t):S(`deploy`,n)},[a,C,E,S]),O=n(async e=>{let t=s?.profile??null;c(null);let n=find(await C(),t);e&&n.ready&&await E(n,{confirmed:!1})},[s,C,E]);return{targets:a,running:_,cancelDeploy:n(()=>b.current?.abort(),[]),editing:s,editingFor:f,popover:h,togglePopover:()=>g(e=>!e),closePopover:()=>g(!1),filesToSend:T,deployTo:D,edit:e=>S(`edit`,find(a,e)),closeEditor:()=>c(null),saved:O}}function deployState(e){return{active:e?.targets?.active??null,targets:(e?.targets?.targets??[]).map(e=>({profile:e?.profile??null,label:q(e),url:e?.url})),popover:e?.popover??!1,open:e?.togglePopover??(()=>{}),deployTo:t=>void e?.deployTo?.(t),edit:t=>e?.edit?.(t)}}var St=4;function problemTally(e){return u(`app.problems.tally`,{count:e})}function CheckCard({title:e,tally:t,isError:n,findings:r,moreCount:i,clean:a,onRecheck:o,onClose:c,onShowAll:l,onPick:d}){let f=Array.isArray(r)?r:[],p=i===void 0?f.slice(0,St):f,m=i??Math.max(0,f.length-p.length),h=Le();return p.length===0&&m===0&&!n&&a?s(`aside`,{class:`diagram-check diagram-check--clean`,"aria-label":e,"aria-description":h?`${a} ${h}`:a,"aria-live":`polite`,title:h?`${a} ${h}`:a,children:[s(`svg`,{class:`diagram-check__ok`,viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:s(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})}),s(`span`,{class:`diagram-check__tally is-clean`,children:u(`app.diagramCheck.noProblemsFound`)}),s(`button`,{type:`button`,class:`ui-button`,onClick:o,title:u(`app.common.checkAgain`),children:u(`app.common.recheck`)})]}):s(`aside`,{class:`diagram-check`,"aria-label":e,"aria-live":`polite`,children:[s(`header`,{class:`diagram-check__bar`,children:[s(`span`,{class:`diagram-check__title`,children:e}),s(`span`,{class:n?`diagram-check__tally is-error`:`diagram-check__tally`,children:t}),s(`button`,{type:`button`,class:`ui-button`,onClick:o,title:u(`app.common.checkAgain`),children:u(`app.common.recheck`)}),s(`button`,{type:`button`,class:`diagram-check__close`,onClick:c,title:u(`app.editorShell.close`,{title:e.toLowerCase()}),"aria-label":u(`app.editorShell.close`,{title:e.toLowerCase()}),children:s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"aria-hidden":`true`,children:s(`path`,{d:`M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5`})})}),h&&s(`span`,{class:`diagram-check__policy`,children:h})]}),s(`div`,{class:`diagram-check__body`,children:p.length>0&&s(`ul`,{class:`diagram-check__list diagram-check__summary`,children:p.map((e,t)=>e?s(`li`,{children:s(`button`,{type:`button`,class:e.severity?`diagram-check__row has-severity`:`diagram-check__row`,onClick:()=>d(t),children:[e.severity&&s(SeverityIcon,{severity:e.severity}),s(`span`,{class:`diagram-check__row-text`,children:[s(`span`,{class:`diagram-check__row-title`,children:e.title}),s(`span`,{class:`diagram-check__row-where diagram-check__row-where--wrap`,children:e.detail})]})]})},t):null)})}),(p.length>0||m>0)&&s(`footer`,{class:`diagram-check__more`,children:s(`button`,{type:`button`,class:`diagram-check__link`,onClick:l,children:m>0?u(`app.editorShell.showAllMore`,{more:m}):u(`app.common.showAll`)})})]})}var Ct=u(`app.tracePaths.tracePaths`);function TraceCard({label:e,before:t,after:n,followMessages:i,showMessages:a,open:o,onToggle:c,onFollowMessages:l,onClose:d}){let f=b(e,t,n);return s(r,{children:[s(`button`,{type:`button`,class:o?`trace-pill is-open`:`trace-pill`,"aria-expanded":o,"aria-label":f,title:f,onClick:c,children:[s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:y}}),s(`span`,{class:`trace-pill__counts`,children:`${t} → ${n}`})]}),o&&s(`aside`,{class:`diagram-check trace-card`,"aria-label":Ct,children:[s(`div`,{class:`trace-card__row`,children:[s(`span`,{class:`trace-card__tally`,children:f}),s(`button`,{type:`button`,class:`trace-card__close`,onClick:d,title:u(`app.tracePaths.closeTrace`),"aria-label":u(`app.tracePaths.closeTrace`),children:s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,stroke:`currentColor`,fill:`none`,"stroke-width":`1.5`,"stroke-linecap":`round`,"aria-hidden":`true`,children:s(`path`,{d:`M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5`})})})]}),a&&s(`label`,{class:`trace-card__option`,children:[s(`input`,{type:`checkbox`,checked:i,onChange:e=>l(e.currentTarget.checked)}),u(`app.tracePaths.followMessageFlows`)]})]})]})}var wt=[`Canvas`,`Modeling`,`Edit`,`Penstock`],Tt={undo:{keys:[`Mod+Z`],action:`undo`},redo:{keys:[`Mod+Y`,`Mod+Shift+Y`,`Mod+Shift+Z`],action:`redo`},cut:{keys:[`Mod+X`],action:`cut`},copy:{keys:[`Mod+C`],action:`copy`},paste:{keys:[`Mod+V`],action:`paste`},duplicate:{keys:[`Mod+D`],action:`duplicate`},remove:{keys:[`Backspace`,`Delete`],action:`removeSelection`}},Et={selectAll:{keys:[`Mod+A`],action:`selectElements`},find:{keys:[`Mod+F`],action:`find`},zoomIn:{keys:[`Mod+=`],action:`stepZoom`},zoomOut:{keys:[`Mod+-`],action:`stepZoom`},fit:{keys:[`Mod+0`],action:`zoom`},pan:{keys:[`Mod+Arrow`],action:`moveCanvas`},moveSelection:{keys:[`Arrow`],action:`moveSelection`}},row=(e,t,n)=>({id:e,group:t,...n}),Dt=[`selectAll`,`find`,`zoomIn`,`zoomOut`,`fit`,`pan`,`moveSelection`].map(e=>row(`canvas-${e}`,`Canvas`,Et[e])),Ot=[`undo`,`redo`,`cut`,`copy`,`paste`,`duplicate`,`remove`].map(e=>row(`edit-${e}`,`Edit`,Tt[e])),kt={bpmn:{canvas:[...Dt,row(`model-space-tool`,`Modeling`,{keys:[`S`],action:`spaceTool`}),row(`model-lasso`,`Modeling`,{keys:[`L`],action:`lassoTool`}),row(`model-hand`,`Modeling`,{keys:[`H`],action:`handTool`}),row(`model-connect`,`Modeling`,{keys:[`C`],action:`globalConnectTool`}),row(`model-direct-edit`,`Modeling`,{keys:[`E`],action:`directEditing`}),row(`model-replace`,`Modeling`,{keys:[`R`],action:`replaceElement`}),...Ot],drd:[],table:[],form:[]},dmn:{canvas:[],drd:[...Dt,row(`model-lasso`,`Modeling`,{keys:[`L`],action:`lassoTool`}),row(`model-hand`,`Modeling`,{keys:[`H`],action:`handTool`}),row(`model-direct-edit`,`Modeling`,{keys:[`E`],action:`directEditing`}),...Ot],table:[],form:[]},form:{canvas:[],drd:[],table:[],form:[row(`edit-undo`,`Edit`,Tt.undo),row(`edit-redo`,`Edit`,Tt.redo)]}};function libraryRows(e,t){return(kt[e]?.[t]??[]).map(e=>({...e,label:u(`app.shortcuts.row.${e.id}`)}))}function penstockRows(e=[]){return[{id:`penstock-palette`,label:u(`app.shortcuts.row.penstock-palette`),group:`Penstock`,keys:[z.shortcut]},...(e??[]).filter(e=>e?.id&&e?.shortcut).map(e=>({id:`penstock-${e.id}`,label:e.title??``,group:`Penstock`,keys:[String(e.shortcut)],action:e.id}))]}function shortcutRows(e=[],t,n){return penstockRows(e).reduce((e,t)=>{let n=e.findIndex(e=>(e?.keys??[]).some(e=>(t?.keys??[]).includes(e)));if(n<0)return[...e,t];let r={...e[n],...t.action?{action:t.action}:{}};return[...e.slice(0,n),r,...e.slice(n+1)]},[...libraryRows(t,n)])}function shortcutSections(e=[],t,n){let r=shortcutRows(e,t,n);return wt.map(e=>({group:e,rows:r.filter(t=>t.group===e)})).filter(e=>e.rows.length>0)}function splitSections(e=[]){let t=e??[],n=t.reduce((e,t)=>e+(t?.rows?.length??0),0)/2,r=[],i=0;for(let e of t)if(e){if(i>=n&&r.length>0)break;r.push(e),i+=e.rows?.length??0}return[r,t.filter(e=>!r.includes(e))]}function rowMatches(e,t,n){return e?(e.label??``).toLowerCase().includes(t)?!0:(e.keys??[]).some(e=>(e??``).toLowerCase().includes(t)||(G(e,n)??``).toLowerCase().includes(t)):!1}function filterShortcutSections(e=[],t=``,n=!1){let r=(t??``).trim().toLowerCase(),i=e??[];return r?i.map(e=>({group:e.group,rows:(e.rows??[]).filter(e=>rowMatches(e,r,n))})).filter(e=>e.rows.length>0):[...i]}function KeyboardShortcutsDialog({editor:e,mode:n,actions:r,onClose:i}){let[o,c]=t(``),l=hostIsMac(),d=a(()=>filterShortcutSections(shortcutSections(r,e,n),o,l),[r,e,n,o,l]),[f,p]=a(()=>splitSections(d),[d]);return s(D,{title:u(`app.shortcuts.title`),size:`large`,initialFocus:`title`,onClose:i,class:`keyboard-shortcuts-dialog`,footer:s(T,{actions:[{id:`close`,label:u(`app.common.close`),role:`primary`,onClick:i}]}),children:[s(`input`,{class:`ui-input type-input keyboard-shortcuts__search`,type:`text`,"aria-label":u(`app.shortcuts.search`),placeholder:u(`app.shortcuts.search`),value:o,onInput:e=>c(e.target.value)}),d.length===0?s(j,{title:u(`app.shortcuts.noMatch`),hint:u(`app.shortcuts.noMatchHint`)}):s(`div`,{class:`keyboard-shortcuts__list`,children:[f,p].map(e=>s(`div`,{class:`keyboard-shortcuts__column`,children:e.map(e=>s(`section`,{class:`keyboard-shortcuts__group`,children:[s(`h3`,{class:`type-section-heading keyboard-shortcuts__group-title`,children:u(`app.shortcuts.group.${e.group}`)}),e.rows.map(e=>s(`div`,{class:`keyboard-shortcuts__row`,children:[s(`span`,{class:`type-body keyboard-shortcuts__label`,children:e.label}),s(`span`,{class:`keyboard-shortcuts__keys`,children:e.keys.map(e=>s(`kbd`,{class:`type-code keyboard-shortcuts__key`,children:G(e,l)},e))})]},e.id))]},e.group))},e.length===0?`right`:e[0].group))})]})}var At=`#js-properties-panel, #dmn-properties-panel, .sidebar-properties`;function blockedBy(e){try{if(ne(e))return!0;let t=e;return typeof t?.closest==`function`&&!!t.closest(At)}catch{return!1}}function KeyboardShortcutsLayer({editor:e,mode:n,actions:r}){let[i,a]=t(!1),o=K();return l(()=>{if(o)try{let e=onShowKeyboardShortcuts(()=>a(!0));return()=>e?.()}catch{return}},[o]),l(()=>{if(!o)return;let listener=e=>{i||e.defaultPrevented||W(e,`Shift+/`,hostIsMac())&&(blockedBy(e.target)||(e.preventDefault(),a(!0)))};return document.addEventListener(`keydown`,listener,!0),()=>document.removeEventListener(`keydown`,listener,!0)},[i,o]),i?s(KeyboardShortcutsDialog,{editor:e,mode:n,actions:r,onClose:()=>a(!1)}):null}function label(e){return u(`app.themeChoice.${e}`)}function ThemeChoiceLayer(){let[e,n]=t(!1),[r,i]=t(le()),a=K(),o=ce(`toolbar-more`);if(l(()=>{if(!a)return;let e=onShowThemeChoice(()=>{i(le()),n(!0)});return()=>e()},[a]),!e)return null;let pick=e=>{se(e),i(e)};return s(M,{anchor:o,label:u(`app.themeChoice.title`),onClose:()=>n(!1),width:240,class:`theme-choice`,children:[s(`h3`,{class:`ui-popover__title`,children:u(`app.themeChoice.title`)}),s(`div`,{role:`radiogroup`,"aria-label":u(`app.themeChoice.title`),class:`theme-choice__list`,children:me.map(e=>s(`label`,{class:`theme-choice__row type-body`,children:[s(`input`,{type:`radio`,name:`editor-theme`,value:e,checked:r===e,tabIndex:r===e?0:-1,onChange:()=>pick(e)}),s(`span`,{children:label(e)})]},e))})]})}function useDocumentationLink(e){l(()=>S(t=>{Promise.resolve().then(()=>e(t)).catch(()=>{window.open(t,`_blank`,`noopener,noreferrer`)})}),[e])}var ErrorBoundary=class extends o{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e){console.error(e)}handleReload=()=>{this.props.onReload?this.props.onReload():window.location.reload()};render(){return this.state.hasError?s(`div`,{class:`editor-error-boundary`,role:`alert`,children:s(j,{title:u(`app.startup.theEditorCouldNotStart`),hint:u(`app.startup.retryingReloadsTheEditorAnd`),actions:[{label:u(`app.common.reload`),run:this.handleReload}]})}):this.props.children}};function useCornerLayout(e){let[n,r]=t(!1);return l(()=>{let t=e.current;if(!t)return;let publish=()=>{let e=ue(t);t.style.setProperty(`--corner-height`,`${e.height}px`),t.style.setProperty(`--dock-inset`,`${e.dock}px`),t.style.setProperty(`--input-inset`,`${e.input}px`),t.style.setProperty(`--corner-left`,`${e.left}px`),t.style.setProperty(`--corner-covered-left`,`${e.coveredLeft}px`),t.style.setProperty(`--corner-bottom`,`${e.bottom}px`),t.style.setProperty(`--corner-trace-left`,`${e.traceLeft}px`),r(e.folded)};publish();let n=de(t,[],publish),i=re(t,publish);return window.addEventListener(`resize`,publish),()=>{n(),i(),window.removeEventListener(`resize`,publish),t.style.removeProperty(`--corner-height`),t.style.removeProperty(`--dock-inset`),t.style.removeProperty(`--input-inset`),t.style.removeProperty(`--corner-left`),t.style.removeProperty(`--corner-covered-left`),t.style.removeProperty(`--corner-bottom`),t.style.removeProperty(`--corner-trace-left`)}},[e]),n}function isSmallCanvas(e,t){return e<720||t<560}function paletteCollapsed({preference:e,small:t,openedWhileSmall:n}){return e===!0||t&&!n}var jt=`palette-island__head`,Mt=`palette-island__toggle`,Nt=new WeakMap,Pt=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 4 6 8l4 4" /></svg>`;function headOf(e){let t=e.querySelector(`:scope > .${jt} > .${Mt}`);if(t)return t;let n=document.createElement(`div`);n.className=jt;let r=document.createElement(`button`);return r.type=`button`,r.className=Mt,r.innerHTML=Pt,r.addEventListener(`click`,()=>Nt.get(r)?.()),n.appendChild(r),e.insertBefore(n,e.firstChild),r}function syncPaletteHeads(e,t,n){e.querySelectorAll(Ae).forEach(e=>{let r=headOf(e);Nt.set(r,n);let i=u(t?`app.editorShell.openPalette`:`app.editorShell.collapsePalette`);r.setAttribute(`aria-label`,i),r.setAttribute(`aria-expanded`,String(!t)),r.title=i})}function usePaletteIsland(e){let[r,i]=t(()=>N().paletteCollapsed??null),[a,o]=t(!1),[s,c]=t(!1);l(()=>{let t=e.current;if(!t)return;let measure=()=>{let e=t.getBoundingClientRect();o(isSmallCanvas(e.width,e.height))};if(measure(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(measure);return n.observe(t),()=>n.disconnect()},[e]);let u=paletteCollapsed({preference:r,small:a,openedWhileSmall:s}),d=n(()=>{let e=!u;i(e),c(!e&&a),P({paletteCollapsed:e})},[u,a]);return l(()=>{let t=e.current;if(!t)return;let sync=()=>syncPaletteHeads(t,u,d);if(sync(),typeof MutationObserver>`u`)return;let n=new MutationObserver(sync);return n.observe(t,{childList:!0,subtree:!0}),()=>n.disconnect()},[e,u,d]),{collapsed:u,toggle:d}}function EditorShell({className:e,toolbarItems:r,tabs:a,sidebar:o,badges:c,notice:d,check:f,trace:p,timeline:m,statusShown:h,deploy:g,assistant:_,counts:y,shortcuts:b,edit:x,children:S,onReload:C}){let w=K(),T=i(Symbol(`editor`)),E=(b?.actions??[]).filter(e=>e.enabled).map(e=>e.id).join(`,`),D=c?.problems,O=y?.scenarios,k=y?.waiting;l(()=>{if(w)return xe(T.current,{problems:D,scenarios:O,waiting:k,actions:E===``?[]:E.split(`,`)}),()=>Ge(T.current)},[w,D,O?.passed,O?.all,k,E]);let A=i(x);A.current=x,l(()=>{if(w)return he(T.current,()=>A.current??{})},[w]),useDocumentationLink(e=>v().openExternalLink(e));let j=i(null),M=i(null),N=useCornerLayout(j),P=usePaletteIsland(j),F=Ve();we();let[I,L]=t(!1),R=f!==void 0,ee=n(()=>{I||f?.onClose(),L(!I)},[I,f?.onClose]);l(()=>{R&&L(!1)},[R]);let z=R||I;l(()=>{if(!z)return;let escape=e=>{e.key===`Escape`&&(I?L(!1):f?.onClose())};return document.addEventListener(`keydown`,escape),()=>document.removeEventListener(`keydown`,escape)},[z,I,f?.onClose]);let B=_?.key??null,V=te(ge()),H=We(B),U=oe(B),W=i(U);l(()=>{W.current!==U&&(W.current=U,o.select(je.id))},[U]);let G=V.chatTab&&o.shownTab===je.id;ve(B,G);let ne=a.filter(e=>e.needs!==`ai-chat`||V.chatTab),re=[f||h?`editor-canvas diagram-check-open`:`editor-canvas`,p?p.showMessages?`has-trace-card`:`has-trace-card is-one-row`:``,N?`is-corner-folded`:``,P.collapsed?`is-palette-collapsed`:``].filter(Boolean).join(` `);return s(ErrorBoundary,{onReload:C,children:s(ae,{value:M,children:s(`div`,{class:`resource-editor ${e}`,ref:M,children:[s(`div`,{class:`editor-shell`,ref:o.measure,children:[s(`div`,{class:`editor-main`,children:[s(`div`,{id:`toolbar-container`,class:`app-toolbar`,style:{flexShrink:0},children:s(Toolbar,{items:r})}),d&&s(`div`,{class:`resource-editor__notice`,role:`status`,children:[s(`span`,{children:d.text}),d.action&&s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.action.run,children:d.action.label}),d.secondary&&s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.secondary.run,children:d.secondary.label}),s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.dismiss,children:u(`app.dmnMode.gotIt`)})]}),s(`div`,{id:`js-canvas`,class:re,ref:j,children:[S,p&&s(TraceCard,{...p,open:I,onToggle:ee}),f&&s(CheckCard,{...f}),_&&s(ie,{editor:_,hidden:G})]}),m]}),s(fe.Provider,{value:_??null,children:s(Sidebar,{tabs:ne,api:o,badges:c,statuses:H?{[je.id]:H}:void 0,hidden:F})})]}),_&&s(pe,{editor:_}),g&&s(DeployLayer,{deploy:g.deploy,engine:g.engine}),b&&s(KeyboardShortcutsLayer,{...b}),s(ThemeChoiceLayer,{})]})})})}var Ft=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function useSidebarToggle(e){let t=i(null),r=K(),a=n(()=>{let n=Date.now();Me(t.current,n)||(t.current=n,e())},[e]);return l(()=>{if(!r)return;let onKey=e=>{He(e,Ft)&&(e.preventDefault(),a())};return window.addEventListener(`keydown`,onKey),()=>window.removeEventListener(`keydown`,onKey)},[a,r]),a}function toolbarLayout(e,t={}){let n=Array.isArray(e)?e.filter(Boolean):[],inSlot=e=>n.filter(t=>t?.slot===e),r=inSlot(`view`),i=inSlot(`lead`),a=inSlot(`start`),o=inSlot(`end`);return t?.overflow===`right`?[...r,...i,...a,{type:`spacer`},{type:`overflow`},...o]:[...i,...i.length>0?[{type:`separator`}]:[],...r,...a,{type:`overflow`},{type:`spacer`},...o]}function revealers(e){let t=e.registerRevealer;return t?t.bind(e):void 0}function documentBridge(e,t){let n=Object.create(e);return Object.assign(n,{getBpmnFilePath:()=>t.path,getBpmnXml:()=>t.initialText,saveBpmnXml:async e=>t.edit(e),onDocumentChanged:e=>t.onReload(e),onRevealElement:n=>revealers(e)?.(t.path,n)??(()=>{}),openScriptFile:(n,r,i,a,o,s=t.path)=>e.openScriptFile(n,r,i,a,o,s)}),n}export{showThemeChoice as C,shareDef as D,redoDef as E,toggleSidebarDef as O,themeChoiceDef as S,focusCanvasDef as T,compareDef as _,problemTally as a,refactorDef as b,hostIsMac as c,SeverityIcon as d,PanelHost as f,resolveActions as g,NavRow as h,EditorShell as i,undoDef as k,protectedName as l,useSidebar as m,toolbarLayout as n,deployState as o,createPanelHost as p,useSidebarToggle as r,useDeploy as s,documentBridge as t,unchangedOnEngine as u,evidencePackDef as v,documentationDef as w,keyboardShortcutsDef as x,licenceDef as y};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./testCaseRuns-liAhWMg7.js","./rolldown-runtime-B8BYMn-z.js","./frontend-uXAWaalt.js","./moddle-f0Q4Guwd.js","./dist-B7TL-7R3.js","./dist-CRJyslwo.js","./dist-BT_v6mN5.js","./descriptors-B5VIyY5g.js","./xml-DIWt4von.js","./translator-BLCeE6UY.js","./preload-helper-DExCAR_V.js","./file-BbVBUuIH.js","./steps-BB_6M1MU.js","./engines-lyEvb0pH.js","./list-TmXvCwja.js","./say-C7KqKcFr.js","./docs-B2ZDPeJU.js","./bridgeInstance-qzSInqLW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-B8BYMn-z.js";import{c as t,d as n,h as r,i,o as a,p as o,r as s,s as c,u as l}from"./vendor-NJP34MHU.js";import{i as u}from"./translator-BLCeE6UY.js";import{t as d}from"./preload-helper-DExCAR_V.js";import{F as f}from"./frontend-uXAWaalt.js";import{r as p}from"./platform-G53Cenyw.js";import{i as m}from"./dialog-BDJ5dDiU.js";import{a as h,i as g,o as _}from"./xml-DIWt4von.js";import{t as v}from"./bridgeInstance-qzSInqLW.js";import{d as y,l as b}from"./trace-DXQU2N_l.js";import{_ as x,c as S,d as C,f as w,h as T,l as E,m as D,o as O,p as k,r as A,s as j,u as M}from"./ui-BLtm3Y1J.js";import{i as N,o as P,r as F}from"./preferences-BcLlKYFq.js";import{_ as I,m as L,y as R}from"./descriptors-B5VIyY5g.js";import{m as ee}from"./testCaseRuns-liAhWMg7.js";import{a as z,i as B,n as V,o as H,r as U,s as W,t as G}from"./shortcut-BRxHV_3d.js";import{v as te}from"./AgentSettings-D24jOuht.js";import{t as ne}from"./typing-CXvbBSPr.js";import{a as re}from"./dockLayout-CxOMo-Nl.js";import{A as ie,B as ae,E as oe,Ft as se,H as ce,It as le,M as ue,N as de,O as fe,P as pe,Pt as me,Q as he,S as ge,St as _e,T as ve,V as K,Y as ye,at as be,b as xe,bt as Se,c as q,ct as Ce,d as we,dt as Te,ft as Ee,gt as De,ht as Oe,it as ke,j as Ae,k as je,lt as Me,mt as Ne,nt as Pe,ot as Fe,pt as Ie,q as J,r as Le,rt as Re,s as ze,st as Be,u as Ve,ut as He,v as Y,vt as Ue,w as We,x as Ge,xt as Ke,y as qe,yt as Je}from"./web-C4k0NLZ9.js";function toggleSidebarDef(){return{id:`toggle-sidebar`,title:`Sidebar`,section:`View`,icon:`panel-toggle`,keywords:[`inspector`,`properties`,`side panel`,`panel`],place:`bar`,slot:`end`,shortcut:H,keymap:!0,tooltip:`Sidebar`,run:e=>e.commands.toggleSidebar()}}function focusCanvasDef(){return{id:`focus-canvas`,title:`Focus canvas`,section:`View`,icon:`focus-canvas`,keywords:[`focus`,`canvas`,`hide`,`sidebars`,`full`,`zen`,`distraction`],place:`menu`,shortcut:B,keymap:!0,tooltip:`Hide the sidebars and show only the canvas; press again to show them`,run:e=>e.commands.focusCanvas()}}function undoDef(e){return{id:`undo`,l10n:`undo-long`,title:`Undo`,section:`Edit`,icon:`undo`,keywords:[],place:`bar`,listed:!1,slot:`lead`,tooltip:`Undo Last Operation`,enabled:e,run:e=>e.commands.undo()}}function redoDef(e){return{id:`redo`,l10n:`redo-long`,title:`Redo`,section:`Edit`,icon:`redo`,keywords:[],place:`bar`,listed:!1,slot:`lead`,tooltip:`Redo Last Operation`,enabled:e,run:e=>e.commands.redo()}}function shareDef(e){return{id:`share`,title:`Share as HTML…`,section:`Deploy & share`,icon:`share`,keywords:[`html`,`send`,`publish`,`offline`,`browser`,`export`],place:`menu`,tooltip:`One file that opens offline in any browser`,enabled:e,run:e=>e.commands.share()}}function documentationDef(){return{id:`open-documentation`,title:`Documentation`,section:`Help`,icon:`documentation`,keywords:[`docs`,`guide`,`help`,`manual`,`learn`,`website`],place:`menu`,tooltip:`Open the guide in your browser`,run:()=>E()}}var X=null;function showThemeChoice(){X?.()}function onShowThemeChoice(e){return X=e,()=>{X===e&&(X=null)}}function themeChoiceDef(){return{id:`editor-theme`,title:`Editor theme`,section:`View`,icon:`sun`,keywords:[`theme`,`light`,`dark`,`dracula`,`colours`,`colors`,`appearance`,`follow ide`],place:`menu`,tooltip:`Follow the IDE, or use Light, Dark or Dracula`,available:e=>!!e.commands?.chooseTheme,run:()=>showThemeChoice()}}var Z=null;function showKeyboardShortcuts(){Z?.()}function onShowKeyboardShortcuts(e){return Z=e,()=>{Z===e&&(Z=null)}}var Ye=`Shift+/`;function keyboardShortcutsDef(){return{id:`keyboard-shortcuts`,title:`Keyboard shortcuts`,section:`Help`,icon:`keyboard`,keywords:[`keys`,`shortcuts`,`bindings`,`key bindings`,`keyboard`,`hotkeys`,`help`,`cheat sheet`],place:`menu`,shortcut:Ye,tooltip:`Every shortcut in this editor`,run:()=>showKeyboardShortcuts()}}function compareDef(e){return{id:`compare-with-head`,title:`Compare with last commit`,section:`Check & run`,icon:`compare`,keywords:[`diff`,`git`,`changes`,`commit`,`head`,`versions`,`history`],place:`menu`,tooltip:`Show what changed since the last commit`,available:t=>!(!t.commands?.compareWithHead||e&&!e(t)),run:e=>e.commands.compareWithHead?.()}}function licenceDef(){return{id:`show-licence`,title:`Licence`,section:`Help`,icon:`licence`,keywords:[`license`,`pro`,`team`,`trial`,`activate`,`key`,`buy`,`plan`],place:`menu`,tooltip:`See the plan, enter a licence key or buy one`,available:e=>!!e.commands?.showLicence,run:e=>e.commands.showLicence?.()}}function refactorDef(){return{id:`refactor`,title:`Refactor…`,section:`Edit`,icon:`migration`,keywords:[`rename`,`refactor`,`variable`,`message`,`signal`,`error`,`job type`,`decision`,`form`,`process`,`extract`,`subprocess`,`call activity`],place:`menu`,tooltip:`Rename a variable, message, signal, error, job type, decision, form or process across the project, or extract part of a diagram into a call activity`,available:e=>!!e.commands?.openRefactor,run:e=>e.commands.openRefactor?.()}}function evidencePackDef(){return{id:`evidence-pack`,title:`Create evidence pack…`,section:`Deploy & share`,icon:`export`,keywords:[`audit`,`evidence`,`compliance`,`review`,`zip`,`seal`,`sha-256`,`package`],place:`menu`,tier:`Pro`,tooltip:`One reviewable package for an audit: the diagrams, the checks, the test results and what changed, with the SHA-256 of every file`,available:e=>!!e.commands?.createEvidencePack,run:e=>e.commands.createEvidencePack?.()}}function sayAction(e,t){let n=u(e);return n===e?t:n}function sayKeywords(e,t){let n=u(`app.actions.${e}.keywords`),r=n===`app.actions.${e}.keywords`?[]:n.split(`,`).map(e=>e.trim()).filter(Boolean);return r.length>0?[...t,...r]:t}var Xe={"Check & run":`checkRun`,"Layout & convert":`layoutConvert`,"Deploy & share":`deployShare`,View:`view`,File:`file`,Edit:`edit`,Help:`help`,Recent:`recent`};function saySection(e){return u(`app.actions.section.${Xe[e]??e}`)}function resolveActions(e,t){return e.map((e,t)=>({def:e,order:t})).filter(({def:e})=>e.available?.(t)??!0).map(({def:e,order:n})=>{let r=e.l10n??e.id,i=typeof e.tooltip==`function`?e.tooltip(t):e.tooltip&&sayAction(`app.actions.${r}.tooltip`,e.tooltip),a={id:e.id,title:sayAction(`app.actions.${r}.title`,e.title),section:e.section,icon:e.icon,keywords:sayKeywords(r,e.keywords),place:e.place,listed:e.listed??!0,slot:e.slot??`start`,order:n,enabled:e.enabled?.(t)??!0,run:()=>e.run(t)};if(e.presentation&&(a.presentation=e.presentation),e.shortcut&&(a.shortcut=e.shortcut),e.tier&&(a.tier=e.tier),i&&(a.tooltip=i),!a.enabled&&e.disabledReason){let n=e.disabledReason(t);n&&(a.disabledReason=n)}e.checked&&(a.checked=e.checked(t));let o=e.status?.(t);return o&&(a.status=o),e.popup&&(a.popup=e.popup(t)),e.menu&&(a.menu=e.menu(t).map(n=>({id:n.id,title:sayAction(`app.actions.${e.id}.menu.${n.id}.title`,n.title),icon:n.icon,...n.tooltip?{tooltip:sayAction(`app.actions.${e.id}.menu.${n.id}.tooltip`,n.tooltip)}:{},run:()=>n.run(t)}))),a})}var Ze=500,Qe=400,$e=300,et=200,tt=80,nt=12,rt=10,it=1,at=4;function startsWord(e,t){return t===0||!/[a-z0-9]/i.test(e[t-1])}function contiguous(e,t){let n=null;for(let r=t.indexOf(e);r>=0;r=t.indexOf(e,r+1)){let e=(r===0?Ze:startsWord(t,r)?Qe:$e)-Math.min(r,50)*.1;(n===null||e>n.score)&&(n={score:e,from:r})}return n===null?null:{score:n.score,at:Array.from({length:e.length},(e,t)=>n.from+t)}}function initials(e,t){let n=t.length,r=e.split(``).map(()=>Array(n).fill(-1/0)),i=e.split(``).map(()=>Array(n).fill(-1));for(let a=0;a<e.length;a++)for(let o=a;o<n;o++)if(t[o]===e[a]){if(a===0)startsWord(t,o)&&(r[a][o]=rt);else for(let e=a-1;e<o;e++){if(r[a-1][e]===-1/0)continue;let n=e===o-1;if(!n&&!startsWord(t,o))continue;let s=r[a-1][e]+rt+(n?nt:-Math.min(o-e-1,at)*it);s>r[a][o]&&(r[a][o]=s,i[a][o]=e)}}let a=e.length-1,o=-1;for(let e=0;e<n;e++)r[a][e]>(o<0?-1/0:r[a][o])&&(o=e);if(o<0||r[a][o]===-1/0)return null;let s=[];for(let e=a,t=o;e>=0;e--)s.unshift(t),t=i[e][t];return{score:et+r[a][o],at:s}}function inTitle(e,t){let n=t.toLowerCase();return contiguous(e,n)??initials(e,n)}function keyword(e,t){for(let n of t){let t=n.toLowerCase();if(t.startsWith(e)||t.split(/\s+/).some(t=>t.startsWith(e)))return tt}return 0}function merged(e){let t=[];for(let n of[...new Set(e)].sort((e,t)=>e-t)){let e=t[t.length-1];e&&e[1]===n?e[1]=n+1:t.push([n,n+1])}return t}function matchOf(e,t){let n=0,r=[];for(let i of t){let t=inTitle(i,e.title);if(t){n+=t.score,r.push(...t.at);continue}let a=keyword(i,e.keywords);if(a>0)n+=a;else return null}return{action:e,score:n,ranges:merged(r)}}function rankActions(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?e.map(e=>({action:e,score:0,ranges:[]})):e.map((e,t)=>({match:matchOf(e,n),order:t})).filter(e=>e.match!==null).sort((e,t)=>t.match.score-e.match.score||e.order-t.order).map(e=>e.match)}var ot=[`Check & run`,`Layout & convert`,`Deploy & share`,`View`,`File`,`Edit`,`Help`];function pushRecent(e,t){return[t,...e.filter(e=>e!==t)].slice(0,5)}function browseGroups(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=r.length>0?[{title:saySection(`Recent`),items:r}]:[];for(let t of ot){let n=e.filter(e=>e.section===t&&!i.has(e.id));n.length>0&&a.push({title:saySection(t),items:n})}return a}function moveSelection(e,t,n){return n===0?-1:((e+t)%n+n)%n}function publishedActions(e,t){return e.filter(e=>e.listed).map(e=>{let n=G(e.shortcut,t);return{id:e.id,title:e.title,section:e.section,enabled:e.enabled,...e.checked===void 0?{}:{checked:e.checked},...n?{shortcut:n}:{}}})}function trailingToDrop(e,t){let n=0,r=0;for(let i=e.length-1;i>=0&&n<t;--i)n+=e[i],r+=1;return r}function beginWidthDrag(e,t){let n=t?.target??(typeof window<`u`?window:null);if(!n||typeof n.addEventListener!=`function`)return()=>{};let r=Number.isFinite(e)?e:0,i=Number.isFinite(t.min)?t.min:0,a=Number.isFinite(t.max)?t.max:Math.max(i,1e3),o=Math.min(i,a),s=Math.max(i,a),c=Number.isFinite(t.width)?Math.min(s,Math.max(o,t.width)):o,l=!1,move=e=>{let n=Number.isFinite(e?.clientX)?e.clientX:0;c=Math.min(s,Math.max(o,t.width+r-n));try{t.onWidth?.(c)}catch{}},end=()=>{if(!l){stop();try{t.onCommit(c)}catch{}}};function stop(){if(!l){l=!0;try{n.removeEventListener(`pointermove`,move),n.removeEventListener(`pointerup`,end),n.removeEventListener(`pointercancel`,end)}catch{}}}try{n.addEventListener(`pointermove`,move),n.addEventListener(`pointerup`,end),n.addEventListener(`pointercancel`,end)}catch{}return stop}function EditableTitle({title:e,editable:n,problem:r,onProblem:a}){let[o,c]=t(!1),d=i(null),f=i(null);l(()=>{n.start&&(c(!0),n.onStarted?.())},[n.start]),l(()=>{o&&(d.current?.focus(),d.current?.select())},[o]);let close=()=>{c(!1),requestAnimationFrame(()=>f.current?.focus())},settle=(e,t)=>{a(e),e&&t||close()},finish=(t,r)=>{let i=d.current?.value??e;if(!t){a(null),close();return}let o=Ue(e,i);if(!o){settle(null,!1);return}let s=n.onCommit(o);s instanceof Promise?s.then(e=>settle(e,r)):settle(s,r)};return o?s(`input`,{ref:d,class:`sidebar__nav-field type-input`,"aria-label":n.label,"aria-invalid":r?!0:void 0,defaultValue:e,onBlur:()=>o&&finish(!0,!1),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),finish(!0,!0)):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),finish(!1,!1))}}):s(`button`,{ref:f,type:`button`,class:`sidebar__nav-title type-section-heading is-editable`,title:u(`app.sidebar.clickOrPressF2To`,{title:e}),"aria-label":u(`app.sidebar.pressF2OrEnterTo`,{title:e,label:n.label}),onClick:()=>c(!0),onKeyDown:e=>Ce(e.key)&&c(!0),children:e})}function NavRow({title:e,backLabel:n,onBack:i,editable:a,trailing:o}){let[c,l]=t(null);return s(r,{children:[s(`div`,{class:`sidebar__nav`,children:[s(`button`,{type:`button`,class:`sidebar__icon`,"aria-label":n,title:u(`app.common.back`),onClick:i,children:s(J,{name:`back`})}),a?s(EditableTitle,{title:e,editable:a,problem:c,onProblem:l}):s(`span`,{class:`sidebar__nav-title type-section-heading`,title:e,children:e}),o?s(`span`,{class:`sidebar__nav-actions`,children:o}):null]}),c&&s(`p`,{class:`penstock-review__issue is-mismatch`,role:`alert`,children:c})]})}var st=16,ct=28;function tabTitle(e){return u(`app.sidebar.tab.${e}`)}function sameIds(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function useFit$1(e,n,r){let[a,o]=t([]),s=i(new Map);return c(()=>{let t=e.current;if(!t||r===void 0||t.clientWidth===0)return;let i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,c=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0);for(let e of t.querySelectorAll(`:scope > [data-tab]`))s.current.set(e.getAttribute(`data-tab`)??``,e.offsetWidth);let l=Array.from(t.children).filter(e=>!e.hasAttribute(`data-tab`)&&!e.hasAttribute(`data-more`)).reduce((e,t)=>e+t.offsetWidth+a,0),u=be(n.map(e=>({id:e,width:(s.current.get(e)??ct)+a})),r,t.clientWidth-c-l,ct+a);o(e=>sameIds(e,u)?e:u)}),a}e(useFit$1,`useFit`);function Sidebar({tabs:e,api:n,badges:r={},statuses:a={},hidden:o=!1}){let{state:d,width:f,limits:p,drawer:m}=n,h=i(null),g=i(null),_=e.map(e=>e.id),v=e.find(e=>e.id===d.tab)??e[0],y=v?d.stacks[v.id]??[]:[],b=!d.hidden&&!(m&&d.collapsed),x=useFit$1(h,_,v?.id),[S,C]=t(!1),[w,T]=t(null);l(()=>{T(e=>e===v?.id?e:null)},[v?.id]);let E=i(null);if(c(()=>()=>{E.current?.(),E.current=null},[b]),d.hidden||o||!v)return null;if(m&&d.collapsed){let e=v.bar;return s(`div`,{class:`sidebar-bar`,role:`toolbar`,"aria-label":u(`app.sidebar.collapsedLabel`,{title:tabTitle(v.id)}),children:[e?s(e,{active:!0,views:y,width:f,push:e=>n.push(v.id,e),back:()=>n.back(v.id),reset:()=>n.reset(v.id)}):s(`span`,{class:`sidebar-bar__title`,children:tabTitle(v.id)}),s(`button`,{type:`button`,class:`sidebar__icon`,"aria-label":u(`app.sidebar.openTheSidebar`),title:u(`app.sidebar.openTheSidebar`),onClick:n.toggleCollapsed,children:s(J,{name:`expand`})})]})}let onTabKey=e=>{let t=Pe(_,v.id,e.key);t&&(e.preventDefault(),T(t),n.select(t),requestAnimationFrame(()=>{try{let e=typeof CSS<`u`&&CSS.escape?CSS.escape(t):t;h.current?.querySelector(`[data-tab="${e}"]`)?.focus()}catch{}}))},startDrag=e=>{e.preventDefault(),E.current?.(),E.current=beginWidthDrag(e.clientX,{width:f,min:p.min,max:p.max,onWidth:n.setWidth,onCommit:n.commitWidth})},onSeparatorKey=e=>{let t=e.key===`ArrowLeft`?st:e.key===`ArrowRight`?-16:0;if(t===0)return;e.preventDefault();let r=Math.min(p.max,Math.max(p.min,f+t));n.setWidth(r),n.commitWidth(r)},onBodyKey=e=>{e.key===`Escape`&&y.length>0&&!(e.target instanceof Element&&e.target.closest(`input, textarea, select`))&&(e.preventDefault(),n.back(v.id))},D=e.filter(e=>x.includes(e.id));return s(`aside`,{ref:g,class:`sidebar${m?` is-drawer`:``}`,style:{width:`${f}px`},"aria-label":u(`app.sidebar.sidebar`),children:[s(`div`,{class:`sidebar__separator`,role:`separator`,"aria-orientation":`vertical`,"aria-label":u(`app.sidebar.resizeTheSidebar`),"aria-valuenow":f,"aria-valuemin":p.min,"aria-valuemax":p.max,tabIndex:0,onPointerDown:startDrag,onDblClick:()=>{n.setWidth(null),n.commitWidth(null)},onKeyDown:onSeparatorKey}),s(`div`,{class:`sidebar__tabs`,role:`tablist`,"aria-label":u(`app.sidebar.sidebar`),ref:h,onKeyDown:onTabKey,children:[e.filter(e=>!x.includes(e.id)).map(e=>{let t=ke(r[e.id]),i=e.id===v.id,o=a[e.id],c=o?u(`app.sidebar.status.${o}`):null;return s(`button`,{type:`button`,role:`tab`,id:`sidebar-tab-${e.id}`,"data-tab":e.id,"aria-selected":i,"aria-controls":`sidebar-panel-${e.id}`,tabIndex:i?0:-1,class:`sidebar__tab type-sidebar-tab${i?` type-sidebar-tab-selected is-selected`:``}`,title:i?void 0:tabTitle(e.id),"aria-label":i?void 0:[tabTitle(e.id),t?Re(r[e.id]):null,c].filter(Boolean).join(`, `),onClick:()=>n.select(e.id),children:[s(J,{name:e.icon}),i&&s(`span`,{class:`sidebar__tab-label`,children:tabTitle(e.id)}),o===`working`&&s(`span`,{class:`sidebar__status is-working`,"aria-hidden":`true`,children:s(A,{})}),o===`waiting`&&s(`span`,{class:`sidebar__status is-waiting`,"aria-hidden":`true`}),t&&s(`span`,{class:`sidebar__badge`,"aria-label":Re(r[e.id]),children:t})]},e.id)}),D.length>0&&s(`div`,{class:`sidebar__more-wrap`,"data-more":!0,children:[s(`button`,{type:`button`,class:`sidebar__icon sidebar__more`,"aria-label":u(`app.sidebar.moreTabs`),title:u(`app.sidebar.moreTabs`),"aria-haspopup":`menu`,"aria-expanded":S,onClick:()=>C(e=>!e),onKeyDown:e=>{e.key===`Escape`&&C(!1)},children:s(J,{name:`more`})}),S&&s(`div`,{class:`sidebar__menu`,role:`menu`,"aria-label":u(`app.sidebar.moreTabs`),children:D.map(e=>s(`button`,{type:`button`,role:`menuitem`,class:`sidebar__menu-item type-sidebar-tab`,"data-tab-more":e.id,onClick:()=>{C(!1),n.select(e.id)},children:[s(J,{name:e.icon}),s(`span`,{children:tabTitle(e.id)})]},e.id))})]}),m&&s(`button`,{type:`button`,class:`sidebar__icon sidebar__collapse`,"aria-label":u(`app.sidebar.collapseTheSidebar`),title:u(`app.sidebar.collapseTheSidebar`),onClick:n.toggleCollapsed,children:s(J,{name:`close`})})]}),y.length>0&&!v.ownHeader&&s(NavRow,{title:y[y.length-1].title,backLabel:u(`app.sidebar.backTo`,{title:y.length>1?y[y.length-2].title:tabTitle(v.id)}),onBack:()=>n.back(v.id)}),s(`div`,{class:`sidebar__body`,"data-switch":w===v.id?`key`:`pointer`,onKeyDown:onBodyKey,children:e.map(e=>{let t=e.component,r=e.id===v.id;return s(`div`,{role:`tabpanel`,id:`sidebar-panel-${e.id}`,"aria-labelledby":`sidebar-tab-${e.id}`,class:`sidebar__panel${e.padded?` sidebar__content`:``}`,hidden:!r,children:s(t,{active:r,views:d.stacks[e.id]??[],width:f,push:t=>n.push(e.id,t),back:()=>n.back(e.id),reset:()=>n.reset(e.id)})},e.id)})})]})}var Q=1100;function useSidebar(e,r){let[o,s]=t(()=>Fe(N(),e,r)),[c,u]=t(Q),[d,f]=t(!1),[p,m]=t(null),h=i(null),g=n(e=>{if(h.current?.disconnect(),h.current=null,e){try{u(e.getBoundingClientRect().width||Q)}catch{u(Q)}typeof ResizeObserver<`u`&&(h.current=new ResizeObserver(()=>{if(e)try{u(e.getBoundingClientRect().width||Q)}catch{}}),h.current.observe(e))}},[]);l(()=>()=>{h.current?.disconnect(),h.current=null},[]);let _=i(Je(o,r,N())),v=n(e=>{let t=Je(e,r,_.current);if(JSON.stringify(t)!==JSON.stringify(_.current)){_.current=t;try{P(t)}catch{}}},[r]);l(()=>{v({...o,width:_.current.sidebarWidth??null})},[o.tab,o.hidden,o.collapsed]);let y=Be(c),b=o.tab,x=o.collapsed,S=i(y);S.current=y;let C=n(t=>{S.current?e.includes(t)&&(m({tab:t,collapsed:!1}),f(!0)):s(n=>Oe(n,e,t))},[e.join(`|`)]),w=n(()=>{S.current?f(e=>!e):s(Ke)},[]),T=n(()=>{S.current?m(e=>({tab:e?.tab??b,collapsed:!(e?.collapsed??x)})):s(Se)},[b,x]),E=n((e,t)=>s(n=>Ee(n,e,t)),[]),D=n(e=>s(t=>Te(t,e)),[]),O=n(e=>s(t=>Ie(t,e)),[]),k=n(e=>s(t=>({...t,width:e})),[]),A=i(o);A.current=o;let j=n(e=>v(e===void 0?A.current:{...A.current,width:e}),[v]),M=a(()=>y?{...o,tab:p?.tab??o.tab,collapsed:p?.collapsed??o.collapsed,hidden:!d}:o,[o,y,d,p]),F=De(M,y),I=i(null),L=n(t=>{if(F===t){let n=I.current;I.current=null,C(n&&e.includes(n)?n:e.find(e=>e!==t)??t)}else I.current=F??A.current.tab,C(t)},[F,C,e.join(`|`)]);return a(()=>({state:M,width:Ne(o.width,c),limits:_e(c),drawer:y,editorWidth:c,measure:g,select:C,toggle:w,toggleCollapsed:T,push:E,back:D,reset:O,setWidth:k,commitWidth:j,shownTab:F,pressTab:L}),[M,o.width,y,c,g,C,w,T,E,D,O,k,j,F,L])}function createPanelHost(){return document.createElement(`div`)}function PanelHost({host:e,id:t,class:n,shown:r}){let a=i(null);return c(()=>{t!==void 0&&(e.id=t),n!==void 0&&(e.className=n),r!==void 0&&(e.style.display=r?`block`:`none`)},[e,t,n,r]),c(()=>{let t=a.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),s(`div`,{ref:a,style:{display:`contents`}})}var lt={error:`M 339.07183,256.00001 463.66713,131.4047 c 15.28961,-15.2896 15.28961,-40.079175 0,-55.381227 l -27.6906,-27.690611 c -15.28961,-15.289602 -40.07917,-15.289602 -55.38123,0 L 256,172.92818 131.4047,48.332862 c -15.2896,-15.289602 -40.079177,-15.289602 -55.381228,0 L 48.332861,76.023473 c -15.2896,15.2896 -15.2896,40.079177 0,55.381227 L 172.92815,256.00001 48.332861,380.59531 c -15.2896,15.2896 -15.2896,40.07917 0,55.38123 l 27.690611,27.69061 c 15.289601,15.28959 40.091628,15.28959 55.381228,0 L 256,339.07184 380.5953,463.66715 c 15.2896,15.28959 40.09162,15.28959 55.38123,0 l 27.6906,-27.69061 c 15.28961,-15.2896 15.28961,-40.07918 0,-55.38123 z`,warning:`m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z`};function SeverityIcon({severity:e}){return s(`span`,{class:`severity severity--${e}`,role:`img`,"aria-label":u(e===`error`?`app.diagramCheck.error`:`app.diagramCheck.warning`),children:s(`svg`,{viewBox:`0 0 512 512`,"aria-hidden":`true`,children:s(`path`,{d:lt[e],fill:`currentColor`})})})}var ut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function rotate(e,t){return e>>>t|e<<32-t}function sha256Bytes(e){let t=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=e.length,r=new Uint8Array(n+9+63>>6<<6);r.set(e),r[n]=128;let i=new DataView(r.buffer);i.setUint32(r.length-8,Math.floor(n/536870912),!1),i.setUint32(r.length-4,n<<3>>>0,!1);let a=new Uint32Array(64);for(let e=0;e<r.length;e+=64){for(let t=0;t<16;t+=1)a[t]=i.getUint32(e+t*4,!1);for(let e=16;e<64;e+=1){let t=a[e-15],n=a[e-2],r=rotate(t,7)^rotate(t,18)^t>>>3,i=rotate(n,17)^rotate(n,19)^n>>>10;a[e]=a[e-16]+r+a[e-7]+i>>>0}let[n,r,o,s,c,l,u,d]=t;for(let e=0;e<64;e+=1){let t=rotate(c,6)^rotate(c,11)^rotate(c,25),i=c&l^~c&u,f=d+t+i+ut[e]+a[e]>>>0,p=(rotate(n,2)^rotate(n,13)^rotate(n,22))+(n&r^n&o^r&o)>>>0;d=u,u=l,l=c,c=s+f>>>0,s=o,o=r,r=n,n=f+p>>>0}t[0]+=n,t[1]+=r,t[2]+=o,t[3]+=s,t[4]+=c,t[5]+=l,t[6]+=u,t[7]+=d}let o=``;for(let e of t)o+=e.toString(16).padStart(8,`0`);return o}function sha256Text(e){return sha256Bytes(new TextEncoder().encode(e))}var dt=64;function lines(e){return e.replace(/^/,``).replace(/\r\n?/g,`
|
|
3
|
+
`)}function ordered(e){let t=[],n=[];if(e.children.forEach((e,r)=>{(e.local===`incoming`||e.local===`outgoing`)&&(t.push(r),n.push(e))}),n.length<2)return e.children;n.sort((e,t)=>{let n=`${e.local}|${e.text.trim()}`,r=`${t.local}|${t.text.trim()}`;return n<r?-1:+(n>r)});let r=[...e.children];return t.forEach((e,t)=>{r[e]=n[t]}),r}function canonicalXml(e){let t=_(lines(e)),n=[],r=[t];for(let e=r.pop();e!==void 0;e=r.pop()){if(typeof e==`string`){n.push(e);continue}let t=Object.keys(e.attrs).sort().map(t=>` ${t}="${g(e.attrs[t])}"`).join(``),i=e.text.trim();if(e.children.length===0&&i===``){n.push(`<${e.name}${t}/>`);continue}n.push(`<${e.name}${t}>`),i!==``&&n.push(g(i)),r.push(`</${e.name}>`);let a=ordered(e);for(let e=a.length-1;e>=0;--e)r.push(a[e])}return n.join(``)}function canonicalValue(e,t){if(t>dt)return null;if(typeof e!=`object`||!e)return JSON.stringify(e)??`null`;if(Array.isArray(e)){let n=[];for(let r of e){let e=canonicalValue(r,t+1);if(e===null)return null;n.push(e)}return`[${n.join(`,`)}]`}let n=e,r=[];for(let e of Object.keys(n).sort()){let i=canonicalValue(n[e],t+1);if(i===null)return null;r.push(`${JSON.stringify(e)}:${i}`)}return`{${r.join(`,`)}}`}function canonicalJson(e){let t=canonicalValue(JSON.parse(lines(e)),0);if(t===null)throw Error(`too deep`);return t}function contentHash(e,t){if(t.length>20971520)return{hash:sha256Text(`raw\n${lines(t)}`),readable:!1};try{return{hash:sha256Text(e===`form`?canonicalJson(t):canonicalXml(t)),readable:!0}}catch{return{hash:sha256Text(`raw\n${lines(t)}`),readable:!1}}}var $=100,ft=4,EngineReadRefused=class extends Error{unreachable;constructor(e,t=!1){super(e),this.name=`EngineReadRefused`,this.unreachable=t}};function reason(e,t){return e===0?new EngineReadRefused(u(`app.promotion.read.unreachable`,{reason:t.slice(0,200)}),!0):e===401||e===403?new EngineReadRefused(u(`app.promotion.read.credentials`,{status:e})):new EngineReadRefused(u(`app.promotion.read.status`,{status:e}))}async function json(e,t){let n=await e(t);if(n.status<200||n.status>=300)throw reason(n.status,n.body);try{return JSON.parse(n.body)}catch{throw new EngineReadRefused(u(`app.promotion.read.notJson`))}}function text(e){return typeof e==`string`&&e!==``?e:null}function versionOf(e){let t=Number(e??0);return Number.isFinite(t)?t:0}async function engineVersion(e,t){try{return text(e===`CAMUNDA_8`?(await json(t,{method:`GET`,path:`/topology`}))?.gatewayVersion:(await json(t,{method:`GET`,path:`/version`}))?.version)}catch(e){if(e instanceof EngineReadRefused&&e.unreachable)throw e;return null}}async function listCamunda7(e,t,n,r){let i=e===`process`?`/process-definition`:`/decision-definition`,a=n.tenantId?`&tenantIdIn=${encodeURIComponent(n.tenantId)}`:`&withoutTenantId=true`,o=[];for(let n=0;;n+=$){let s=await json(t,{method:`GET`,path:`${i}?latestVersion=true&sortBy=key&sortOrder=asc&firstResult=${n}&maxResults=${$}${a}`});if(!Array.isArray(s))throw new EngineReadRefused(u(`app.promotion.read.notJson`));for(let t of s){let n=text(t?.key),r=text(t?.id);n!==null&&r!==null&&o.push({kind:e,key:n,id:r,version:versionOf(t?.version),resource:text(t?.resource)})}if(o.length>r)throw new EngineReadRefused(u(`app.promotion.read.tooMany`,{limit:r}));if(s.length<$)return o}}async function listCamunda8(e,t,n,r){let i=e===`process`?`/process-definitions`:`/decision-definitions`,a=[],o=null;for(;;){let s=e===`process`?{isLatestVersion:!0}:{};n.tenantId&&(s.tenantId=n.tenantId);let c=o===null?{limit:$}:{limit:$,after:o},l=await json(t,{method:`POST`,path:`${i}/search`,body:JSON.stringify({filter:s,page:c})}),d=Array.isArray(l?.items)?l.items:[];for(let t of d){let n=text(e===`process`?t.processDefinitionId:t.decisionDefinitionId),r=text(e===`process`?t.processDefinitionKey:t.decisionDefinitionKey);n!==null&&r!==null&&a.push({kind:e,key:n,id:String(r),version:versionOf(t.version),resource:text(t.resourceName)})}if(a.length>r)throw new EngineReadRefused(u(`app.promotion.read.tooMany`,{limit:r}));let f=l?.page?.endCursor;if(d.length<$)return e===`process`?a:latestOfEach(a);if(typeof f!=`string`||f===``||f===o)throw new EngineReadRefused(u(`app.promotion.read.notJson`));o=f}}function latestOfEach(e){let t=new Map;for(let n of e){let e=t.get(n.key);(!e||n.version>e.version)&&t.set(n.key,n)}return[...t.values()]}async function resourceText(e,t,n){let r=encodeURIComponent(t.id);if(e===`CAMUNDA_8`){let e=await n({method:`GET`,path:`/${t.kind}-definitions/${r}/xml`});if(e.status<200||e.status>=300)throw reason(e.status,e.body);let i=e.body.trim();if(i.startsWith(`{`))try{let e=JSON.parse(i);if(typeof e.xml==`string`)return e.xml}catch{return e.body}return e.body}let i=await json(n,{method:`GET`,path:`/${t.kind}-definition/${r}/xml`}),a=t.kind===`process`?i?.bpmn20Xml:i?.dmnXml;if(typeof a!=`string`)throw new EngineReadRefused(u(`app.promotion.read.noResource`,{key:t.key}));return a}async function pool(e,t){let n=Array(e.length),r=0,run=async()=>{for(;;){let i=r;if(r+=1,i>=e.length)return;n[i]=await t(e[i])}};return await Promise.all(Array.from({length:Math.min(ft,e.length)},run)),n}async function readEngine(e,t,n={}){let r=n.maxDefinitions??2e3,i=e===`CAMUNDA_8`?listCamunda8:listCamunda7,a=await engineVersion(e,t),o=[...await i(`process`,t,n,r),...await i(`decision`,t,n,r)],s=n.wanted??null,c=o.filter(e=>s===null||s.has(`${e.kind}:${e.key}`));if(c.length>(n.maxFetched??400))throw new EngineReadRefused(u(`app.promotion.read.tooManyToRead`,{limit:n.maxFetched??400}));let l=new Map;return await pool(c,async n=>{let r=await resourceText(e,n,t);if(r.length>20971520)throw new EngineReadRefused(u(`app.promotion.read.tooLarge`,{key:n.key}));l.set(`${n.kind}:${n.key}`,contentHash(n.kind,r))}),{version:a,definitions:o.map(e=>{let t=l.get(`${e.kind}:${e.key}`);return{...e,hash:t?.hash??null,readable:t?.readable??!1}})}}function recordKey(e,t){return`${e}:${t}`}function localKeys(e){return new Set(e.resources.map(e=>recordKey(e.kind,e.key)))}function kindOfPath(e){return/\.bpmn$/i.test(e)||/\.bpmn20\.xml$/i.test(e)?`process`:/\.dmn$/i.test(e)||/\.dmn11\.xml$/i.test(e)?`decision`:/\.form$/i.test(e)?`form`:null}function keysOf(e,t){if(e===`form`)return[];try{let n=_(t.replace(/^/,``)),r=e===`process`?`process`:`decision`;return[n,...h(n,r)].filter(e=>e.local===r).filter(t=>e!==`process`||t.attrs.isExecutable!==`false`).map(e=>e.attrs.id).filter(e=>typeof e==`string`&&e!==``)}catch{return null}}function scanLocal(e){let t=[],n=[],r=new Map;for(let t of[...e].sort((e,t)=>e.path<t.path?-1:1)){let e=kindOfPath(t.path);if(e===null)continue;let{hash:i,readable:a}=contentHash(e,t.text),o=keysOf(e,t.text);if(n.push({file:t.path,kind:e,hash:i,readable:a&&o!==null,keys:o??[]}),e!==`form`&&o!==null)for(let n of o){let o={kind:e,key:n,file:t.path,hash:i,readable:a},s=`${o.kind}:${n}`;r.set(s,[...r.get(s)??[],o])}}let i=[];for(let e of r.values())t.push(e[0]),e.length>1&&i.push({kind:e[0].kind,key:e[0].key,files:e.map(e=>e.file)});return{resources:t,files:n,duplicates:i}}function unchangedFiles(e,t,n,r){let i=[],a=[];for(let o of r){let r=e.files.find(e=>e.file===o);if(r===void 0||!r.readable){a.push(o);continue}let s;if(r.kind===`form`)s=n[`form:${r.file}`]?.hash===r.hash;else{let n=e.resources.filter(e=>e.file===r.file);s=n.length>0&&n.length===r.keys.length&&n.every(e=>t.definitions.some(t=>t.kind===e.kind&&t.key===e.key&&t.hash===e.hash))}s?i.push({file:o,reason:u(`app.promotion.onlyChanged.unchanged`)}):a.push(o)}return{send:a,skipped:i,note:null}}async function unchangedOnEngine(e){let t=e.files.map(e=>e.path),n=scanLocal(e.files);if(n.resources.length===0)return unchangedFiles(n,{version:null,definitions:[]},e.records??{},t);try{return unchangedFiles(n,await readEngine(e.engine,e.ask,{tenantId:e.tenantId,wanted:localKeys(n)}),e.records??{},t)}catch(e){let n=e instanceof EngineReadRefused||e instanceof Error?e.message:String(e);return{send:t,skipped:[],note:u(`app.promotion.onlyChanged.notCompared`,{reason:n})}}}async function unchangedOf(e,t,n){if(!e.deployment||!I(String(e.engine)))return null;let r=v(),i=e.profile??null;return unchangedOnEngine({engine:e.engine,ask:e=>r.askEngine(i,e,n),tenantId:e.deployment.tenantId??null,files:t.map(e=>({path:e.name,text:e.content}))})}function protectedName(e){return e?.deployment?._protected===!0?e.profile??`default`:null}function usePinning(){let[,e]=t(0);l(()=>{try{return F(()=>e(e=>e+1))}catch{return}},[]);let n=N()||{},r=Array.isArray(n.toolbarPinned)?n.toolbarPinned:[],i=Array.isArray(n.toolbarUnpinned)?n.toolbarUnpinned:[],isPinned=e=>!e||!e.id?!1:e.place===`pinned`?!i.includes(e.id):r.includes(e.id),toggle=e=>{if(!e||!e.id)return;let flip=t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id];try{P(e.place===`pinned`?{toolbarUnpinned:flip(i)}:{toolbarPinned:flip(r)})}catch{}};return{isPinned,toggle}}function hostIsMac(){return typeof navigator<`u`&&typeof navigator?.platform==`string`&&V(navigator.platform)}var pt=`palette-list`,optionId=e=>`palette-option-${e}`;function Highlighted({title:e,ranges:t}){let n=typeof e==`string`?e:String(e??``),i=Array.isArray(t)?t:[];if(i.length===0)return s(r,{children:n});let a=[],o=0;return i.forEach(([e,t])=>{let i=Math.max(0,Math.min(n.length,Number.isFinite(e)?e:0)),c=Math.max(i,Math.min(n.length,Number.isFinite(t)?t:i));i>o&&a.push(s(r,{children:n.slice(o,i)})),a.push(s(`span`,{className:`palette__match`,children:n.slice(i,c)})),o=c}),o<n.length&&a.push(s(r,{children:n.slice(o)})),s(r,{children:a})}function Palette({entries:e,recent:n,pinning:r,locked:o,onRun:u,onClose:d,returnFocusTo:f}){let p=x(),[m,h]=t(``),[g,_]=t(0),v=i(null),y=i(null),b=hostIsMac(),S=a(()=>(Array.isArray(e)?e:[]).filter(Boolean).map(e=>({id:e.id,title:e.title,section:e.section,keywords:e.keywords,entry:e,ranges:[]})),[e]),C=m.trim().length>0,w=a(()=>{if(C){let e=rankActions(S,m).map(e=>({...e.action,ranges:e.ranges}));return e.length>0?[{title:``,items:e}]:[]}return browseGroups(S,Array.isArray(n)?n:[])},[S,n,m,C]),T=a(()=>(Array.isArray(w)?w:[]).flatMap(e=>Array.isArray(e?.items)?e.items:[]),[w]),E=T[g];l(()=>_(0),[m]),l(()=>{if(E)try{let e=typeof CSS<`u`&&CSS.escape?CSS.escape(optionId(E.id)):optionId(E.id);v.current?.querySelector(`#${e}`)?.scrollIntoView({block:`nearest`})}catch{}},[E?.id]),c(()=>{let e=y.current;if(!e)return;let t=f,n=[],r=e,i=0;for(;r&&r.parentElement&&i<50;){i+=1;let e=r.parentElement;for(let t of Array.from(e.children))t===r||t.hasAttribute(`inert`)||(t.setAttribute(`inert`,``),n.push(t));r=e}return()=>{n.forEach(e=>e.removeAttribute(`inert`));let r=document.activeElement,i=r!==null&&e.contains(r),a=r===null||r===document.body||!document.contains(r);if((i||a)&&t)try{t.focus()}catch{}}},[]);let run=e=>{if(e&&e.entry.enabled)try{u(e.entry)}catch{}},keys=e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),_(t=>moveSelection(t,e.key===`ArrowDown`?1:-1,T.length));else if(e.key===`Home`&&e.ctrlKey)e.preventDefault(),_(0);else if(e.key===`End`&&e.ctrlKey)e.preventDefault(),_(Math.max(0,T.length-1));else if(e.key===`Enter`){if(e.preventDefault(),e.shiftKey){if(E)try{r?.toggle?.(E.entry)}catch{}}else run(E)}else e.key===`Tab`&&e.preventDefault()},flatIndex=e=>T.findIndex(t=>t.id===e.id);return s(`div`,{ref:y,className:`palette-overlay`,onMouseDown:e=>{e.target===e.currentTarget&&d()},children:s(`div`,{className:`palette`,role:`dialog`,"aria-modal":`true`,"aria-label":p(`app.palette.label`),children:[s(`input`,{className:`palette__field`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":pt,"aria-autocomplete":`list`,"aria-activedescendant":E?optionId(E.id):void 0,"aria-describedby":`palette-hint`,placeholder:p(`app.palette.search`),spellcheck:!1,autoComplete:`off`,autoFocus:!0,value:m,onInput:e=>h(e.currentTarget.value),onKeyDown:keys,ref:e=>e?.focus()}),s(`span`,{id:`palette-hint`,className:`palette__hint`,children:p(`app.palette.hint`)}),s(`ul`,{className:`palette__list`,id:pt,role:`listbox`,"aria-label":p(`app.palette.actions`),ref:v,children:[w.map(e=>s(`li`,{role:`presentation`,className:`palette__group`,children:[e.title&&s(`div`,{className:`palette__heading`,role:`presentation`,children:e.title}),s(`ul`,{role:`group`,"aria-label":e.title||p(`app.palette.matches`,{count:e.items.length}),className:`palette__group`,children:e.items.map(e=>{let t=e.entry,n=!!r?.isPinned?.(t),i=t.place!==`bar`,a=G(t.shortcut,b);return s(`li`,{id:optionId(e.id),role:`option`,"aria-selected":flatIndex(e)===g,"aria-disabled":!t.enabled,"aria-checked":t.checked===void 0?void 0:t.checked,className:`palette__row${flatIndex(e)===g?` is-active`:``}`,"aria-label":t.tier?`${e.title}, Penstock ${t.tier}`:e.title,title:t.tooltip,onMouseMove:()=>_(flatIndex(e)),onClick:()=>run(e),children:[s(`span`,{className:`palette__icon`,children:s(Y,{name:t.icon})}),s(`span`,{className:`palette__title`,children:s(Highlighted,{title:e.title,ranges:e.ranges})}),C&&s(`span`,{className:`palette__section`,children:e.section}),t.tier&&s(`span`,{className:`palette__tier`,children:[o&&s(Y,{name:`lock`}),t.tier]}),a&&s(`span`,{className:`palette__shortcut`,children:a}),t.checked&&s(`span`,{className:`palette__check`,children:s(Y,{name:`check`})}),i&&s(`button`,{type:`button`,tabIndex:-1,"aria-hidden":`true`,className:n?`palette__pin is-pinned`:`palette__pin`,title:p(n?`app.palette.unpin`:`app.palette.pin`),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation();try{r?.toggle?.(t)}catch{}},children:s(Y,{name:`pin`})})]},e.id)})})]},e.title||`results`)),T.length===0&&s(`li`,{className:`palette__empty`,role:`presentation`,children:p(`app.palette.noMatch`,{query:m.trim()})})]})]})})}function useHostActions(e,t){let n=K(),r=i({actions:e,openPalette:t});r.current={actions:e,openPalette:t};let a=`[]`;try{a=JSON.stringify(publishedActions(Array.isArray(e)?e:[],hostIsMac()))}catch{a=`[]`}l(()=>{if(n)try{let e=v();e?.publishActions&&e.publishActions(JSON.parse(a)).catch(()=>{})}catch{}},[a,n]),l(()=>{if(n)try{let e=v();return e?.onRunAction?e.onRunAction(e=>{try{if(e===z.id){r.current.openPalette();return}let t=(Array.isArray(r.current.actions)?r.current.actions:[]).find(t=>t?.id===e);if(t?.enabled){let e=t.run();e&&typeof e.catch==`function`&&e.catch(e=>console.error(e))}}catch(e){console.error(e)}}):void 0}catch{return}},[n])}function isAction(e){return!(`type`in e)}function TextButton({entry:e,wrapped:t=!1}){let n=[`toolbar-button`,`type-toolbar-button`,`with-label`];return e.presentation===`primary`&&n.push(`primary`),e.checked&&n.push(`active`),s(`button`,{type:`button`,id:e.id,className:n.join(` `),onClick:e.run,disabled:!e.enabled,title:e.disabledReason??U(e.tooltip,e.title,e.shortcut,hostIsMac()),"aria-description":e.disabledReason,"aria-pressed":e.checked,"aria-haspopup":e.popup===void 0?void 0:`dialog`,"aria-expanded":e.popup,"data-droppable":!t&&e.presentation!==`primary`&&e.place!==`bar`?``:void 0,children:s(`span`,{className:`toolbar-button-label`,children:e.title})})}function inPalette(e){return isAction(e)&&e.listed}function usePopup(e,t,n,r){l(()=>{if(!e)return;let away=e=>{n.current?.contains(e.target)||t(!1)},keys=e=>{if(e.key===`Escape`&&t(!1),e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=Array.from(r.current?.querySelectorAll(`.toolbar-menu__item:not(:disabled)`)??[]);if(n.length===0)return;e.preventDefault();let i=n.indexOf(document.activeElement);n[e.key===`ArrowDown`?(i+1)%n.length:(i-1+n.length)%n.length].focus()};return document.addEventListener(`mousedown`,away),document.addEventListener(`keydown`,keys),r.current?.querySelector(`.toolbar-menu__item:not(:disabled)`)?.focus(),()=>{document.removeEventListener(`mousedown`,away),document.removeEventListener(`keydown`,keys)}},[e])}function SplitButton({entry:e,menu:n}){let[r,a]=t(!1),o=i(null),c=i(null);usePopup(r,a,o,c);let l=e.presentation===`primary`?` primary`:``;return s(`div`,{className:`toolbar-menu toolbar-split`,ref:o,"data-droppable":e.presentation!==`primary`&&e.place!==`bar`?``:void 0,children:[s(TextButton,{entry:e,wrapped:!0}),s(`button`,{type:`button`,className:`toolbar-button type-toolbar-button toolbar-split__more${l}${r?` active`:``}`,onClick:()=>a(e=>!e),title:u(`app.toolbar.moreWaysTo`,{title:e.title.toLowerCase()}),"aria-label":u(`app.toolbar.moreWaysTo`,{title:e.title.toLowerCase()}),"aria-haspopup":`menu`,"aria-expanded":r,children:s(`span`,{className:`toolbar-button-icon`,role:`presentation`,children:s(Y,{name:`chevron`})})}),r&&s(`div`,{className:`toolbar-menu__list toolbar-menu__list--end`,role:`menu`,ref:c,children:n.map(e=>s(`div`,{className:`toolbar-menu__row`,children:s(`button`,{type:`button`,id:e.id,role:`menuitem`,className:`toolbar-menu__item`,title:e.tooltip,onClick:()=>{a(!1),e.run()},children:[s(Y,{name:e.icon}),s(`span`,{className:`toolbar-menu__label`,children:e.title})]})},e.id))})]})}function PaletteTrigger({open:e,onOpen:t,trigger:n}){let r=u(`app.toolbar.moreActionsHint`,{shortcut:G(z.shortcut,hostIsMac())});return s(`button`,{type:`button`,id:`toolbar-more`,ref:n,className:e?`toolbar-button type-toolbar-button active`:`toolbar-button type-toolbar-button`,onClick:t,title:r,"aria-label":u(`app.toolbar.moreActions`),"aria-haspopup":`dialog`,"aria-expanded":e,children:s(`span`,{className:`toolbar-button-icon`,role:`presentation`,children:s(Y,{name:`more`})})})}function Action({entry:e}){return e.menu&&e.menu.length>0?s(SplitButton,{entry:e,menu:e.menu}):e.presentation===`text`||e.presentation===`primary`?s(TextButton,{entry:e}):s(qe,{id:e.id,label:e.title,icon:e.icon,action:e.run,disabled:!e.enabled,tooltip:e.disabledReason??U(e.tooltip,e.title,e.shortcut,hostIsMac()),description:e.disabledReason,isActive:e.checked,checked:e.checked,status:e.status})}function useLocked(e){let[n,r]=t(!1);return l(()=>{if(!e)return;let t=!0;try{v()?.getLicense?.()?.then(e=>t&&r(!ye(e)))?.catch(()=>void 0)}catch{}return()=>{t=!1}},[e]),n}function useRecent(){let[,e]=t(0);l(()=>{try{return F(()=>e(e=>e+1))}catch{return}},[]);let n=N()?.recentActions;return Array.isArray(n)?n:[]}var mt=4;function useFit(e){let t=n(()=>{let t=e.current;if(!t)return;let n=Array.from(t.querySelectorAll(`[data-droppable]`));n.forEach(e=>{e.style.display=``});let r=t.scrollWidth-t.clientWidth;if(r<=0)return;let i=trailingToDrop(n.map(e=>e.offsetWidth+mt),r);n.slice(n.length-i).forEach(e=>{e.style.display=`none`})},[e]);c(t),l(()=>{let n=e.current;if(!n||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(t);return r.observe(n),()=>r.disconnect()},[t,e])}function Toolbar({items:e,visible:r=!0,className:a=``}){let o=usePinning(),c=i(null);useFit(c);let[u,d]=t(!1),f=i(null),p=i(null),m=useLocked(u),h=useRecent(),g=e.filter(isAction),_=e.filter(inPalette).sort((e,t)=>e.order-t.order),v=n(()=>{let e=document.activeElement;p.current=e instanceof HTMLElement&&e!==document.body?e:f.current,d(!0)},[]),y=n(()=>{d(!1)},[]),b=_.length>0;useHostActions(g,v);let x=K();l(()=>{if(!b||!x)return;let keys=e=>{W(e,z.shortcut,hostIsMac())&&(e.preventDefault(),u||v())};return document.addEventListener(`keydown`,keys),()=>document.removeEventListener(`keydown`,keys)},[b,u,v,x]);let S=n(e=>{if(y(),e){try{P({recentActions:pushRecent(N()?.recentActions??[],e.id)})}catch{}setTimeout(()=>{try{e.run()}catch(e){console.error(`Error executing toolbar action:`,e)}},0)}},[y]);if(!r)return null;let C=e.some(e=>`type`in e&&e.type===`overflow`)||!b?e:[...e,{type:`overflow`}];return s(`div`,{className:`toolbar ${a}`.trim(),ref:c,children:[C.map((e,t)=>isAction(e)?e.place===`menu`||e.place===`pinned`&&!o.isPinned(e)?null:s(Action,{entry:e},e.id):e.type===`separator`?s(`div`,{className:`toolbar-separator`},`sep-${t}`):e.type===`spacer`?s(`div`,{className:`toolbar-spacer`},`spacer-${t}`):b?[..._.filter(e=>e.place===`menu`&&o.isPinned(e)).map(e=>s(TextButton,{entry:{...e,id:`pinned-${e.id}`,title:e.title.replace(/…$/,``)}},`pinned-${e.id}`)),s(PaletteTrigger,{open:u,onOpen:v,trigger:f},`overflow`)]:null),u&&s(Palette,{entries:_,recent:h,pinning:o,locked:m,onRun:S,onClose:y,returnFocusTo:p.current})]})}function connectionActions(e){let t={id:`save-deploy`,label:u(`app.deploy.saveAndDeploy`),deploy:!0,role:e===`edit`?`secondary`:`primary`};return e===`edit`?[{id:`save`,label:u(`app.common.save`),deploy:!1,role:`primary`},t]:[t]}var ht=[`url`,`username`,`password`,`clientId`,`clientSecret`,`tokenUrl`];function isWebAddress(e){try{return/^https?:$/.test(new URL(e).protocol)}catch{return!1}}function connectionErrors(e){let t={},n=e.authType??`none`;return isWebAddress(e.url??``)||(t.url=u(`app.deploy.addressScheme`)),n===`basic`&&(e.username?.trim()||(t.username=u(`app.deploy.enterTheUserNameTo`)),!e.password&&!e.passwordSaved&&(t.password=u(`app.deploy.enterThePasswordToSign`))),n===`oauth`&&(e.clientId?.trim()||(t.clientId=u(`app.deploy.enterTheClientId`)),!e.clientSecret&&!e.clientSecretSaved&&(t.clientSecret=u(`app.deploy.enterTheClientSecret`)),isWebAddress(e.tokenUrl??``)||(t.tokenUrl=u(`app.deploy.tokenAddressScheme`))),t}var gt={none:[],basic:[`username`,`password`],oauth:[`clientId`,`clientSecret`,`tokenUrl`,`audience`]};function connectionFieldsOf(e){return gt[e??`none`]??[]}function firstInvalid(e){return ht.find(t=>t in e)??null}var _t=Object.values(f),vt=m(`http://localhost:8080/engine-rest`),yt=m(`http://localhost:8088`),bt=m(`https://login.cloud.camunda.io/oauth/token`);function ConnectionDialog({profile:e,engine:n,opened:r,onClose:i,onSaved:a}){let[o,c]=t({profile:e}),[d,f]=t(!1),[p,m]=t(!1),[h,g]=t(null),_=O();l(()=>{let t=!1;return v().getDeploymentSettings(e).then(n=>{t||c({...n,profile:e})}).catch(e=>console.error(`Failed to read the connection settings:`,e)).finally(()=>{t||f(!0)}),()=>{t=!0}},[e]),l(()=>{d&&document.querySelector(`.ui-dialog__body input`)?.focus()},[d]);let y=o.authType??`none`,set=e=>c(t=>({...t,...e})),b=connectionErrors(o),save=async e=>{if(_.submit(),firstInvalid(b))requestAnimationFrame(()=>document.querySelector(`.ui-dialog [aria-invalid="true"]`)?.focus());else{m(!0),g(null);try{await v().saveDeploymentSettings(o),a(e)}catch(e){g(u(`app.deploy.unableToSaveTheConnection`,{failure:ee(e)}))}finally{m(!1)}}},field=(e,t,n={})=>s(C,{label:e,hint:n.hint,optional:n.optional,error:_.errorOf(t,b[t]??null),children:e=>s(`input`,{...e,type:n.type??`text`,value:o[t]??``,placeholder:n.placeholder,disabled:!d||p,onInput:e=>set({[t]:e.target.value}),onBlur:()=>_.touch(t)})}),x=connectionActions(r),S=x.find(e=>e.role===`primary`)??x[0];return s(D,{title:u(`app.deploy.engineConnection`),subtitle:`${L(n)} · ${q({profile:e})}`,size:`medium`,onClose:i,onSubmit:()=>void save(S.deploy),footer:s(T,{actions:[{id:`cancel`,label:u(`app.common.cancel`),role:`cancel`,onClick:i,disabled:p},...x.map(e=>({id:e.id,label:e.label,role:e.role,onClick:()=>void save(e.deploy),disabled:!d,busy:p}))]}),children:[field(u(`app.deploy.engineAddress`),`url`,{placeholder:R(n)?yt:vt,hint:u(`app.deploy.keptInPenstockLocalYaml`)}),s(C,{label:u(`app.deploy.signIn`),group:`radiogroup`,children:e=>s(`div`,{...e,class:`ui-choice-group`,children:_t.map(e=>s(`label`,{class:`ui-choice`,children:[s(`input`,{type:`radio`,name:`auth`,checked:y===e,disabled:!d||p,onChange:()=>{_.reveal(connectionFieldsOf(e)),set({authType:e})}}),s(`span`,{children:u(e===`none`?`app.deploy.notNeeded`:e===`basic`?`app.deploy.userAndPassword`:`app.deploy.oauthClient`)})]},e))})}),y===`basic`&&field(u(`app.deploy.user`),`username`),y===`basic`&&field(u(`app.deploy.password`),`password`,{type:`password`,hint:o.passwordSaved?u(`app.deploy.savedInTheIdeS`):u(`app.deploy.keptInTheIdeS`)}),y===`oauth`&&field(u(`app.deploy.clientId`),`clientId`),y===`oauth`&&field(u(`app.deploy.clientSecret`),`clientSecret`,{type:`password`,hint:o.clientSecretSaved?u(`app.deploy.savedInTheIdeS`):u(`app.deploy.keptInTheIdeS`)}),y===`oauth`&&field(u(`app.deploy.tokenAddress`),`tokenUrl`,{placeholder:bt}),y===`oauth`&&field(u(`app.deploy.audience`),`audience`,{optional:!0}),s(`p`,{class:`ui-field__hint`,children:u(`app.deploy.nameTenantAndTheRest`)}),h&&s(w,{children:h})]})}var xt=4;function sentFiles(e){return e.length>xt?{names:e.slice(0,xt),more:e.length-xt}:{names:e,more:0}}function hookLines(e){let[t,...n]=e;return{command:t??u(`app.deploy.runningTheDeployHook`),said:n.filter(e=>e.trim().length>0)}}function deployPopover(e,t){let n=e?.targets??[],r=n.find(e=>(e.profile??null)===t)??null,i=r?.ready===!0;return{profiles:n.map(e=>({value:e.profile??null,label:e.profile??`default`})),chooseProfile:n.length>1,target:r,address:r?.url??null,canDeploy:i,action:u(i?`app.deploy.deploy`:`app.deploy.setUpConnection`)}}function DeployPopover({deploy:e}){let[n,i]=t(e.targets?.active??null),[a,o]=t(null),[c,d]=t(!0),[f,p]=t(``),m=deployPopover(e.targets,n),h=sentFiles(a??[]),g=ce(`deploy`),_=e.running,v=hookLines(_?.lines??[]);l(()=>{let t=!1;return e.filesToSend().then(e=>!t&&o(e)).catch(()=>!t&&o([])),()=>{t=!0}},[]);let y=protectedName(m.target),b=y===null||f.trim()===y,run=()=>{e.deployTo(n,{onlyChanged:c,confirmed:b})},edit=()=>{e.edit(n)};return s(M,{anchor:g,label:u(`app.deploy.deploy`),onClose:e.closePopover,width:352,class:`deploy-popover`,children:[s(`h3`,{class:`ui-popover__title`,children:u(`app.deploy.deploy`)}),m.chooseProfile&&s(C,{label:u(`app.deploy.profile`),layout:`top`,children:e=>s(`select`,{...e,value:n??``,onChange:e=>i(e.target.value||null),children:m.profiles.map(e=>s(`option`,{value:e.value??``,children:e.label},e.value??`default`))})}),s(`dl`,{class:`ui-popover__facts`,children:[s(`dt`,{children:u(`app.deploy.engineAddress`)}),s(`dd`,{children:m.address??u(`app.deploy.notSetYet`)}),s(`dt`,{children:u(`app.deploy.whatWillBeSent`)}),s(`dd`,{children:[a===null&&u(`app.deploy.readingTheDiagram`),a!==null&&h.names.length===0&&u(`app.deploy.nothingToDeploy`),h.names.map(e=>s(`span`,{class:`ui-popover__file`,children:e},e)),h.more>0&&s(`span`,{class:`ui-popover__file`,children:u(`app.deploy.andNMore`,{number:h.more})})]}),m.canDeploy&&s(r,{children:[s(`dt`,{children:u(`app.promotion.deploy.onlyChanged`)}),s(`dd`,{children:s(`label`,{class:`ui-popover__check`,children:[s(`input`,{type:`checkbox`,checked:c,onChange:e=>d(e.target.checked)}),s(`span`,{children:u(`app.promotion.deploy.onlyChangedHint`)})]})})]}),_&&s(r,{children:[s(`dt`,{children:u(`app.deploy.deployHook`)}),s(`dd`,{"aria-busy":`true`,children:[s(`span`,{class:`ui-popover__file`,children:v.command}),v.said.map(e=>s(`span`,{class:`ui-popover__file`,children:e},e))]})]})]}),y!==null&&m.canDeploy&&s(C,{label:u(`app.promotion.deploy.confirmLabel`,{name:y}),layout:`top`,hint:u(`app.promotion.deploy.protectedHint`,{name:y}),children:e=>s(`input`,{...e,type:`text`,value:f,autocomplete:`off`,onInput:e=>p(e.target.value)})}),s(`div`,{class:`ui-popover__actions`,children:s(k,{actions:[..._&&_.cancellable?[{id:`cancel`,label:u(`app.common.cancel`),role:`cancel`,onClick:e.cancelDeploy}]:[],...m.canDeploy&&!_?[{id:`edit`,label:u(`app.deploy.editConnection`),role:`secondary`,onClick:edit}]:[],{id:`deploy`,label:m.action,role:`primary`,onClick:run,busy:_!==null,disabled:_!==null||m.target===null&&e.targets!==null||m.canDeploy&&!b}]})})]})}function DeployLayer({deploy:e,engine:t}){return s(r,{children:[e.popover&&s(DeployPopover,{deploy:e}),e.editing&&s(ConnectionDialog,{profile:e.editing.profile??null,engine:t,onClose:e.closeEditor,opened:e.editingFor,onSaved:t=>void e.saved(t)})]})}function deployFailure(e){return{message:e.message,editConnection:e.status===401||e.status===403}}function useDeploy(e,r){let[a,o]=t(null),[s,c]=t(null),[f,m]=t(`deploy`),[h,g]=t(!1),[_,y]=t(null),b=i(null),x=i(!0),S=n((e,t)=>{g(!1),m(e),c(t)},[]),C=n(async()=>{try{let e=await v().getDeployTargets();return x.current&&o(e),e}catch(e){return console.error(`Failed to read the deployment targets:`,e),null}},[]);l(()=>(x.current=!0,C(),()=>{x.current=!1,b.current?.abort()}),[C]);let find=(e,t)=>e?.targets?.find(e=>(e?.profile??null)===t)??{profile:t,ready:!1},w=n(async t=>{let n=window.appConfig?.bpmnFilePath,r=n?await d(()=>import(`./testCaseRuns-liAhWMg7.js`).then(e=>e.p).then(e=>e.resourcesOf(n,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).catch(()=>null):null;return r&&r.length>0?r.map(e=>({name:e.name,content:e.content})):[{name:e,content:t}]},[e]),T=n(async()=>{try{let e=await r();return e?(await w(e)).map(e=>e.name):[]}catch{return[]}},[r,w]),E=n(async(t,n={})=>{let i;try{i=await r()}catch(e){p.error(u(`app.deploy.unableToDeploy`,{reason:e instanceof Error?e.message:String(e)}));return}if(!i){p.error(u(`app.deploy.nothingInToDeploy`,{fileName:e}));return}let a=protectedName(t);if(a!==null&&n.confirmed!==!0){g(!0),p.error(u(`app.promotion.deploy.protectedNothingSent`,{name:a}));return}let o=await w(i);if(n.onlyChanged!==!1){let e=await unchangedOf(t,o).catch(()=>null);if(e&&e.skipped.length>0){if(e.send.length===0){p.info(u(`app.promotion.deploy.nothingToSend`,{target:t.url??q(t),names:e.skipped.map(e=>e.file).join(`, `)}));return}o=o.filter(t=>e.send.includes(t.name))}e?.note&&p.info(e.note)}let s=p.info(u(`app.deploy.deployingTo`,{fileName:e,target:q(t)})),c=new AbortController;b.current=c,y({lines:[],cancellable:v().hookRunsInBackground===!0});let l=null,d=``;try{l=await ze(t,o,void 0,{signal:c.signal,onLines:e=>y(t=>t&&{...t,lines:e})})}catch(e){d=e instanceof Error?e.message:String(e)}finally{p.hide(s)}if(b.current=null,y(null),!l)p.error(u(`app.deploy.unableToDeploy`,{reason:d}));else if(c.signal.aborted)p.info(u(`app.deploy.deployToCancelled`,{target:q(t)}));else if(l.ok)p.success(u(`app.deploy.succeededOn`,{message:l.message,target:t.url??q(t)}));else{let e=deployFailure(l);p.error(e.message,e.editConnection?{label:u(`app.deploy.editConnection2`),run:()=>S(`deploy`,t)}:void 0)}},[r,e,w,S]),D=n(async(e,t={})=>{let n=find(a??await C(),e);n.ready?await E(n,t):S(`deploy`,n)},[a,C,E,S]),O=n(async e=>{let t=s?.profile??null;c(null);let n=find(await C(),t);e&&n.ready&&await E(n,{confirmed:!1})},[s,C,E]);return{targets:a,running:_,cancelDeploy:n(()=>b.current?.abort(),[]),editing:s,editingFor:f,popover:h,togglePopover:()=>g(e=>!e),closePopover:()=>g(!1),filesToSend:T,deployTo:D,edit:e=>S(`edit`,find(a,e)),closeEditor:()=>c(null),saved:O}}function deployState(e){return{active:e?.targets?.active??null,targets:(e?.targets?.targets??[]).map(e=>({profile:e?.profile??null,label:q(e),url:e?.url})),popover:e?.popover??!1,open:e?.togglePopover??(()=>{}),deployTo:t=>void e?.deployTo?.(t),edit:t=>e?.edit?.(t)}}var St=4;function problemTally(e){return u(`app.problems.tally`,{count:e})}function CheckCard({title:e,tally:t,isError:n,findings:r,moreCount:i,clean:a,onRecheck:o,onClose:c,onShowAll:l,onPick:d}){let f=Array.isArray(r)?r:[],p=i===void 0?f.slice(0,St):f,m=i??Math.max(0,f.length-p.length),h=Le();return p.length===0&&m===0&&!n&&a?s(`aside`,{class:`diagram-check diagram-check--clean`,"aria-label":e,"aria-description":h?`${a} ${h}`:a,"aria-live":`polite`,title:h?`${a} ${h}`:a,children:[s(`svg`,{class:`diagram-check__ok`,viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:s(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})}),s(`span`,{class:`diagram-check__tally is-clean`,children:u(`app.diagramCheck.noProblemsFound`)}),s(`button`,{type:`button`,class:`ui-button`,onClick:o,title:u(`app.common.checkAgain`),children:u(`app.common.recheck`)})]}):s(`aside`,{class:`diagram-check`,"aria-label":e,"aria-live":`polite`,children:[s(`header`,{class:`diagram-check__bar`,children:[s(`span`,{class:`diagram-check__title`,children:e}),s(`span`,{class:n?`diagram-check__tally is-error`:`diagram-check__tally`,children:t}),s(`button`,{type:`button`,class:`ui-button`,onClick:o,title:u(`app.common.checkAgain`),children:u(`app.common.recheck`)}),s(`button`,{type:`button`,class:`diagram-check__close`,onClick:c,title:u(`app.editorShell.close`,{title:e.toLowerCase()}),"aria-label":u(`app.editorShell.close`,{title:e.toLowerCase()}),children:s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"aria-hidden":`true`,children:s(`path`,{d:`M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5`})})}),h&&s(`span`,{class:`diagram-check__policy`,children:h})]}),s(`div`,{class:`diagram-check__body`,children:p.length>0&&s(`ul`,{class:`diagram-check__list diagram-check__summary`,children:p.map((e,t)=>e?s(`li`,{children:s(`button`,{type:`button`,class:e.severity?`diagram-check__row has-severity`:`diagram-check__row`,onClick:()=>d(t),children:[e.severity&&s(SeverityIcon,{severity:e.severity}),s(`span`,{class:`diagram-check__row-text`,children:[s(`span`,{class:`diagram-check__row-title`,children:e.title}),s(`span`,{class:`diagram-check__row-where diagram-check__row-where--wrap`,children:e.detail})]})]})},t):null)})}),(p.length>0||m>0)&&s(`footer`,{class:`diagram-check__more`,children:s(`button`,{type:`button`,class:`diagram-check__link`,onClick:l,children:m>0?u(`app.editorShell.showAllMore`,{more:m}):u(`app.common.showAll`)})})]})}var Ct=u(`app.tracePaths.tracePaths`);function TraceCard({label:e,before:t,after:n,followMessages:i,showMessages:a,open:o,onToggle:c,onFollowMessages:l,onClose:d}){let f=b(e,t,n);return s(r,{children:[s(`button`,{type:`button`,class:o?`trace-pill is-open`:`trace-pill`,"aria-expanded":o,"aria-label":f,title:f,onClick:c,children:[s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:y}}),s(`span`,{class:`trace-pill__counts`,children:`${t} → ${n}`})]}),o&&s(`aside`,{class:`diagram-check trace-card`,"aria-label":Ct,children:[s(`div`,{class:`trace-card__row`,children:[s(`span`,{class:`trace-card__tally`,children:f}),s(`button`,{type:`button`,class:`trace-card__close`,onClick:d,title:u(`app.tracePaths.closeTrace`),"aria-label":u(`app.tracePaths.closeTrace`),children:s(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,stroke:`currentColor`,fill:`none`,"stroke-width":`1.5`,"stroke-linecap":`round`,"aria-hidden":`true`,children:s(`path`,{d:`M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5`})})})]}),a&&s(`label`,{class:`trace-card__option`,children:[s(`input`,{type:`checkbox`,checked:i,onChange:e=>l(e.currentTarget.checked)}),u(`app.tracePaths.followMessageFlows`)]})]})]})}var wt=[`Canvas`,`Modeling`,`Edit`,`Penstock`],Tt={undo:{keys:[`Mod+Z`],action:`undo`},redo:{keys:[`Mod+Y`,`Mod+Shift+Y`,`Mod+Shift+Z`],action:`redo`},cut:{keys:[`Mod+X`],action:`cut`},copy:{keys:[`Mod+C`],action:`copy`},paste:{keys:[`Mod+V`],action:`paste`},duplicate:{keys:[`Mod+D`],action:`duplicate`},remove:{keys:[`Backspace`,`Delete`],action:`removeSelection`}},Et={selectAll:{keys:[`Mod+A`],action:`selectElements`},find:{keys:[`Mod+F`],action:`find`},zoomIn:{keys:[`Mod+=`],action:`stepZoom`},zoomOut:{keys:[`Mod+-`],action:`stepZoom`},fit:{keys:[`Mod+0`],action:`zoom`},pan:{keys:[`Mod+Arrow`],action:`moveCanvas`},moveSelection:{keys:[`Arrow`],action:`moveSelection`}},row=(e,t,n)=>({id:e,group:t,...n}),Dt=[`selectAll`,`find`,`zoomIn`,`zoomOut`,`fit`,`pan`,`moveSelection`].map(e=>row(`canvas-${e}`,`Canvas`,Et[e])),Ot=[`undo`,`redo`,`cut`,`copy`,`paste`,`duplicate`,`remove`].map(e=>row(`edit-${e}`,`Edit`,Tt[e])),kt={bpmn:{canvas:[...Dt,row(`model-space-tool`,`Modeling`,{keys:[`S`],action:`spaceTool`}),row(`model-lasso`,`Modeling`,{keys:[`L`],action:`lassoTool`}),row(`model-hand`,`Modeling`,{keys:[`H`],action:`handTool`}),row(`model-connect`,`Modeling`,{keys:[`C`],action:`globalConnectTool`}),row(`model-direct-edit`,`Modeling`,{keys:[`E`],action:`directEditing`}),row(`model-replace`,`Modeling`,{keys:[`R`],action:`replaceElement`}),...Ot],drd:[],table:[],form:[]},dmn:{canvas:[],drd:[...Dt,row(`model-lasso`,`Modeling`,{keys:[`L`],action:`lassoTool`}),row(`model-hand`,`Modeling`,{keys:[`H`],action:`handTool`}),row(`model-direct-edit`,`Modeling`,{keys:[`E`],action:`directEditing`}),...Ot],table:[],form:[]},form:{canvas:[],drd:[],table:[],form:[row(`edit-undo`,`Edit`,Tt.undo),row(`edit-redo`,`Edit`,Tt.redo)]}};function libraryRows(e,t){return(kt[e]?.[t]??[]).map(e=>({...e,label:u(`app.shortcuts.row.${e.id}`)}))}function penstockRows(e=[]){return[{id:`penstock-palette`,label:u(`app.shortcuts.row.penstock-palette`),group:`Penstock`,keys:[z.shortcut]},...(e??[]).filter(e=>e?.id&&e?.shortcut).map(e=>({id:`penstock-${e.id}`,label:e.title??``,group:`Penstock`,keys:[String(e.shortcut)],action:e.id}))]}function shortcutRows(e=[],t,n){return penstockRows(e).reduce((e,t)=>{let n=e.findIndex(e=>(e?.keys??[]).some(e=>(t?.keys??[]).includes(e)));if(n<0)return[...e,t];let r={...e[n],...t.action?{action:t.action}:{}};return[...e.slice(0,n),r,...e.slice(n+1)]},[...libraryRows(t,n)])}function shortcutSections(e=[],t,n){let r=shortcutRows(e,t,n);return wt.map(e=>({group:e,rows:r.filter(t=>t.group===e)})).filter(e=>e.rows.length>0)}function splitSections(e=[]){let t=e??[],n=t.reduce((e,t)=>e+(t?.rows?.length??0),0)/2,r=[],i=0;for(let e of t)if(e){if(i>=n&&r.length>0)break;r.push(e),i+=e.rows?.length??0}return[r,t.filter(e=>!r.includes(e))]}function rowMatches(e,t,n){return e?(e.label??``).toLowerCase().includes(t)?!0:(e.keys??[]).some(e=>(e??``).toLowerCase().includes(t)||(G(e,n)??``).toLowerCase().includes(t)):!1}function filterShortcutSections(e=[],t=``,n=!1){let r=(t??``).trim().toLowerCase(),i=e??[];return r?i.map(e=>({group:e.group,rows:(e.rows??[]).filter(e=>rowMatches(e,r,n))})).filter(e=>e.rows.length>0):[...i]}function KeyboardShortcutsDialog({editor:e,mode:n,actions:r,onClose:i}){let[o,c]=t(``),l=hostIsMac(),d=a(()=>filterShortcutSections(shortcutSections(r,e,n),o,l),[r,e,n,o,l]),[f,p]=a(()=>splitSections(d),[d]);return s(D,{title:u(`app.shortcuts.title`),size:`large`,initialFocus:`title`,onClose:i,class:`keyboard-shortcuts-dialog`,footer:s(T,{actions:[{id:`close`,label:u(`app.common.close`),role:`primary`,onClick:i}]}),children:[s(`input`,{class:`ui-input type-input keyboard-shortcuts__search`,type:`text`,"aria-label":u(`app.shortcuts.search`),placeholder:u(`app.shortcuts.search`),value:o,onInput:e=>c(e.target.value)}),d.length===0?s(j,{title:u(`app.shortcuts.noMatch`),hint:u(`app.shortcuts.noMatchHint`)}):s(`div`,{class:`keyboard-shortcuts__list`,children:[f,p].map(e=>s(`div`,{class:`keyboard-shortcuts__column`,children:e.map(e=>s(`section`,{class:`keyboard-shortcuts__group`,children:[s(`h3`,{class:`type-section-heading keyboard-shortcuts__group-title`,children:u(`app.shortcuts.group.${e.group}`)}),e.rows.map(e=>s(`div`,{class:`keyboard-shortcuts__row`,children:[s(`span`,{class:`type-body keyboard-shortcuts__label`,children:e.label}),s(`span`,{class:`keyboard-shortcuts__keys`,children:e.keys.map(e=>s(`kbd`,{class:`type-code keyboard-shortcuts__key`,children:G(e,l)},e))})]},e.id))]},e.group))},e.length===0?`right`:e[0].group))})]})}var At=`#js-properties-panel, #dmn-properties-panel, .sidebar-properties`;function blockedBy(e){try{if(ne(e))return!0;let t=e;return typeof t?.closest==`function`&&!!t.closest(At)}catch{return!1}}function KeyboardShortcutsLayer({editor:e,mode:n,actions:r}){let[i,a]=t(!1),o=K();return l(()=>{if(o)try{let e=onShowKeyboardShortcuts(()=>a(!0));return()=>e?.()}catch{return}},[o]),l(()=>{if(!o)return;let listener=e=>{i||e.defaultPrevented||W(e,`Shift+/`,hostIsMac())&&(blockedBy(e.target)||(e.preventDefault(),a(!0)))};return document.addEventListener(`keydown`,listener,!0),()=>document.removeEventListener(`keydown`,listener,!0)},[i,o]),i?s(KeyboardShortcutsDialog,{editor:e,mode:n,actions:r,onClose:()=>a(!1)}):null}function label(e){return u(`app.themeChoice.${e}`)}function ThemeChoiceLayer(){let[e,n]=t(!1),[r,i]=t(le()),a=K(),o=ce(`toolbar-more`);if(l(()=>{if(!a)return;let e=onShowThemeChoice(()=>{i(le()),n(!0)});return()=>e()},[a]),!e)return null;let pick=e=>{se(e),i(e)};return s(M,{anchor:o,label:u(`app.themeChoice.title`),onClose:()=>n(!1),width:240,class:`theme-choice`,children:[s(`h3`,{class:`ui-popover__title`,children:u(`app.themeChoice.title`)}),s(`div`,{role:`radiogroup`,"aria-label":u(`app.themeChoice.title`),class:`theme-choice__list`,children:me.map(e=>s(`label`,{class:`theme-choice__row type-body`,children:[s(`input`,{type:`radio`,name:`editor-theme`,value:e,checked:r===e,tabIndex:r===e?0:-1,onChange:()=>pick(e)}),s(`span`,{children:label(e)})]},e))})]})}function useDocumentationLink(e){l(()=>S(t=>{Promise.resolve().then(()=>e(t)).catch(()=>{window.open(t,`_blank`,`noopener,noreferrer`)})}),[e])}var ErrorBoundary=class extends o{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e){console.error(e)}handleReload=()=>{this.props.onReload?this.props.onReload():window.location.reload()};render(){return this.state.hasError?s(`div`,{class:`editor-error-boundary`,role:`alert`,children:s(j,{title:u(`app.startup.theEditorCouldNotStart`),hint:u(`app.startup.retryingReloadsTheEditorAnd`),actions:[{label:u(`app.common.reload`),run:this.handleReload}]})}):this.props.children}};function useCornerLayout(e){let[n,r]=t(!1);return l(()=>{let t=e.current;if(!t)return;let publish=()=>{let e=ue(t);t.style.setProperty(`--corner-height`,`${e.height}px`),t.style.setProperty(`--dock-inset`,`${e.dock}px`),t.style.setProperty(`--input-inset`,`${e.input}px`),t.style.setProperty(`--corner-left`,`${e.left}px`),t.style.setProperty(`--corner-covered-left`,`${e.coveredLeft}px`),t.style.setProperty(`--corner-bottom`,`${e.bottom}px`),t.style.setProperty(`--corner-trace-left`,`${e.traceLeft}px`),r(e.folded)};publish();let n=de(t,[],publish),i=re(t,publish);return window.addEventListener(`resize`,publish),()=>{n(),i(),window.removeEventListener(`resize`,publish),t.style.removeProperty(`--corner-height`),t.style.removeProperty(`--dock-inset`),t.style.removeProperty(`--input-inset`),t.style.removeProperty(`--corner-left`),t.style.removeProperty(`--corner-covered-left`),t.style.removeProperty(`--corner-bottom`),t.style.removeProperty(`--corner-trace-left`)}},[e]),n}function isSmallCanvas(e,t){return e<720||t<560}function paletteCollapsed({preference:e,small:t,openedWhileSmall:n}){return e===!0||t&&!n}var jt=`palette-island__head`,Mt=`palette-island__toggle`,Nt=new WeakMap,Pt=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 4 6 8l4 4" /></svg>`;function headOf(e){let t=e.querySelector(`:scope > .${jt} > .${Mt}`);if(t)return t;let n=document.createElement(`div`);n.className=jt;let r=document.createElement(`button`);return r.type=`button`,r.className=Mt,r.innerHTML=Pt,r.addEventListener(`click`,()=>Nt.get(r)?.()),n.appendChild(r),e.insertBefore(n,e.firstChild),r}function syncPaletteHeads(e,t,n){e.querySelectorAll(Ae).forEach(e=>{let r=headOf(e);Nt.set(r,n);let i=u(t?`app.editorShell.openPalette`:`app.editorShell.collapsePalette`);r.setAttribute(`aria-label`,i),r.setAttribute(`aria-expanded`,String(!t)),r.title=i})}function usePaletteIsland(e){let[r,i]=t(()=>N().paletteCollapsed??null),[a,o]=t(!1),[s,c]=t(!1);l(()=>{let t=e.current;if(!t)return;let measure=()=>{let e=t.getBoundingClientRect();o(isSmallCanvas(e.width,e.height))};if(measure(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(measure);return n.observe(t),()=>n.disconnect()},[e]);let u=paletteCollapsed({preference:r,small:a,openedWhileSmall:s}),d=n(()=>{let e=!u;i(e),c(!e&&a),P({paletteCollapsed:e})},[u,a]);return l(()=>{let t=e.current;if(!t)return;let sync=()=>syncPaletteHeads(t,u,d);if(sync(),typeof MutationObserver>`u`)return;let n=new MutationObserver(sync);return n.observe(t,{childList:!0,subtree:!0}),()=>n.disconnect()},[e,u,d]),{collapsed:u,toggle:d}}function EditorShell({className:e,toolbarItems:r,tabs:a,sidebar:o,badges:c,notice:d,check:f,trace:p,timeline:m,statusShown:h,deploy:g,assistant:_,counts:y,shortcuts:b,edit:x,children:S,onReload:C}){let w=K(),T=i(Symbol(`editor`)),E=(b?.actions??[]).filter(e=>e.enabled).map(e=>e.id).join(`,`),D=c?.problems,O=y?.scenarios,k=y?.waiting;l(()=>{if(w)return xe(T.current,{problems:D,scenarios:O,waiting:k,actions:E===``?[]:E.split(`,`)}),()=>Ge(T.current)},[w,D,O?.passed,O?.all,k,E]);let A=i(x);A.current=x,l(()=>{if(w)return he(T.current,()=>A.current??{})},[w]),useDocumentationLink(e=>v().openExternalLink(e));let j=i(null),M=i(null),N=useCornerLayout(j),P=usePaletteIsland(j),F=Ve();we();let[I,L]=t(!1),R=f!==void 0,ee=n(()=>{I||f?.onClose(),L(!I)},[I,f?.onClose]);l(()=>{R&&L(!1)},[R]);let z=R||I;l(()=>{if(!z)return;let escape=e=>{e.key===`Escape`&&(I?L(!1):f?.onClose())};return document.addEventListener(`keydown`,escape),()=>document.removeEventListener(`keydown`,escape)},[z,I,f?.onClose]);let B=_?.key??null,V=te(ge()),H=We(B),U=oe(B),W=i(U);l(()=>{W.current!==U&&(W.current=U,o.select(je.id))},[U]);let G=V.chatTab&&o.shownTab===je.id;ve(B,G);let ne=a.filter(e=>e.needs!==`ai-chat`||V.chatTab),re=[f||h?`editor-canvas diagram-check-open`:`editor-canvas`,p?p.showMessages?`has-trace-card`:`has-trace-card is-one-row`:``,N?`is-corner-folded`:``,P.collapsed?`is-palette-collapsed`:``].filter(Boolean).join(` `);return s(ErrorBoundary,{onReload:C,children:s(ae,{value:M,children:s(`div`,{class:`resource-editor ${e}`,ref:M,children:[s(`div`,{class:`editor-shell`,ref:o.measure,children:[s(`div`,{class:`editor-main`,children:[s(`div`,{id:`toolbar-container`,class:`app-toolbar`,style:{flexShrink:0},children:s(Toolbar,{items:r})}),d&&s(`div`,{class:`resource-editor__notice`,role:`status`,children:[s(`span`,{children:d.text}),d.action&&s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.action.run,children:d.action.label}),d.secondary&&s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.secondary.run,children:d.secondary.label}),s(`button`,{type:`button`,class:`resource-editor__notice-action`,onClick:d.dismiss,children:u(`app.dmnMode.gotIt`)})]}),s(`div`,{id:`js-canvas`,class:re,ref:j,children:[S,p&&s(TraceCard,{...p,open:I,onToggle:ee}),f&&s(CheckCard,{...f}),_&&s(ie,{editor:_,hidden:G})]}),m]}),s(fe.Provider,{value:_??null,children:s(Sidebar,{tabs:ne,api:o,badges:c,statuses:H?{[je.id]:H}:void 0,hidden:F})})]}),_&&s(pe,{editor:_}),g&&s(DeployLayer,{deploy:g.deploy,engine:g.engine}),b&&s(KeyboardShortcutsLayer,{...b}),s(ThemeChoiceLayer,{})]})})})}var Ft=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function useSidebarToggle(e){let t=i(null),r=K(),a=n(()=>{let n=Date.now();Me(t.current,n)||(t.current=n,e())},[e]);return l(()=>{if(!r)return;let onKey=e=>{He(e,Ft)&&(e.preventDefault(),a())};return window.addEventListener(`keydown`,onKey),()=>window.removeEventListener(`keydown`,onKey)},[a,r]),a}function toolbarLayout(e,t={}){let n=Array.isArray(e)?e.filter(Boolean):[],inSlot=e=>n.filter(t=>t?.slot===e),r=inSlot(`view`),i=inSlot(`lead`),a=inSlot(`start`),o=inSlot(`end`);return t?.overflow===`right`?[...r,...i,...a,{type:`spacer`},{type:`overflow`},...o]:[...i,...i.length>0?[{type:`separator`}]:[],...r,...a,{type:`overflow`},{type:`spacer`},...o]}function revealers(e){let t=e.registerRevealer;return t?t.bind(e):void 0}function documentBridge(e,t){let n=Object.create(e);return Object.assign(n,{getBpmnFilePath:()=>t.path,getBpmnXml:()=>t.initialText,saveBpmnXml:async e=>t.edit(e),onDocumentChanged:e=>t.onReload(e),onRevealElement:n=>revealers(e)?.(t.path,n)??(()=>{}),openScriptFile:(n,r,i,a,o,s=t.path)=>e.openScriptFile(n,r,i,a,o,s)}),n}export{showThemeChoice as C,shareDef as D,redoDef as E,toggleSidebarDef as O,themeChoiceDef as S,focusCanvasDef as T,compareDef as _,problemTally as a,refactorDef as b,hostIsMac as c,SeverityIcon as d,PanelHost as f,resolveActions as g,NavRow as h,EditorShell as i,undoDef as k,protectedName as l,useSidebar as m,toolbarLayout as n,deployState as o,createPanelHost as p,useSidebarToggle as r,useDeploy as s,documentBridge as t,unchangedOnEngine as u,evidencePackDef as v,documentationDef as w,keyboardShortcutsDef as x,licenceDef as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-DLDFsUlE.js";import{a as t,c as n,n as r,r as i,s as a,t as o,u as s}from"./files-DI8LgQfb.js";var c=3e4,l=3e4,u=30,d=6e4;function isDirty(e){return!!e&&e.phase===`ready`&&e.current!==e.baseline}function messageOf(t){return t instanceof Error&&t.message?t.message:typeof t==`string`&&t?t:e(`app.web.unknownFailure`)}function timed(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(Error(n)),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}function denied(e){return e?.response?.status===401}function missing(e){return e?.response?.status===404||/\b404\b|not found|no such file|does not exist/i.test(messageOf(e))}function refusedAsChanged(e){return e?.response?.status===409}var DocumentStore=class{host;notify;readTimeout;writeTimeout;listeners=new Set;reloads=new Map;writers=new Map;opening=new Map;drafts;secondMs;timers=new Map;attempts=new Map;autosaveSeconds=null;state={docs:new Map,order:[],active:null,listing:o,connection:`ok`,listed:!1,recent:[]};polling=null;constructor(e){this.host=e.host,this.notify=e.notify??(()=>void 0),this.readTimeout=e.readTimeoutMs??c,this.writeTimeout=e.writeTimeoutMs??l,this.drafts=e.drafts??null,this.secondMs=e.secondMs??1e3}snapshot(){return this.state}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}subscribeReload(e,t){let n=this.reloads.get(e);return n||(n=new Set,this.reloads.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.reloads.delete(e)}}doc(e){return this.state.docs.get(e)}readOnly(t){return timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`))}dirtyPaths(){return this.state.order.filter(e=>isDirty(this.state.docs.get(e)))}commit(e){this.state={...this.state,...e},[...this.listeners].forEach(e=>{try{e()}catch(e){console.error(`A store listener failed:`,e)}})}patch(e,t){let n=this.state.docs.get(e);if(!n)return;let r={...n,...t},i=new Map(this.state.docs);return i.set(e,r),this.commit({docs:i}),r}async refresh(){if(this.polling)return this.polling;let t=(async()=>{let t;try{t=n(await timed(this.host.list(),this.readTimeout,e(`app.web.serverTimeout`)))}catch(e){let t=denied(e)?`denied`:`lost`;this.state.connection!==t&&this.commit({connection:t}),console.warn(`The project could not be listed:`,e);return}let r=this.state.connection===`lost`,i=t.signature!==this.state.listing.signature||!this.state.listed;(i||r)&&this.commit({listing:t,listed:!0,connection:`ok`}),(i||r)&&await this.reconcile(t)})();return this.polling=t.finally(()=>{this.polling=null}),this.polling}async reconcile(n){let r=new Map(n.files.map(e=>[e.path,e]));for(let n of[...this.state.order]){let a=this.state.docs.get(n);if(!a||a.phase!==`ready`||t(a.kind))continue;let o=r.get(i(n));o?(a.disk===`deleted`&&this.patch(n,{disk:`in-sync`,stamp:null}),this.state.docs.get(n).stamp!==o.stamp&&await this.compareWithDisk(n,o.stamp)):a.disk!==`deleted`&&(this.patch(n,{disk:`deleted`,diskText:null}),this.notify(e(`app.web.deletedOnDisk`,{name:a.name}),!0))}}async compareWithDisk(t,n){let r;try{r=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`))}catch(e){missing(e)&&this.patch(t,{disk:`deleted`,diskText:null});return}let i=this.state.docs.get(t);i&&i.phase===`ready`&&(r===i.onDisk||r===i.baseline?this.patch(t,{stamp:n,disk:`in-sync`,diskText:null}):r===i.current?(this.patch(t,{stamp:n,baseline:r,onDisk:r,disk:`in-sync`,diskText:null}),this.syncDraft(t)):isDirty(i)||this.writers.get(t)?.running?(this.patch(t,{stamp:n,disk:`changed`,diskText:r}),this.notify(e(`app.web.changedOnDisk`,{name:i.name}),!0)):(this.adopt(t,r,n),this.notify(e(`app.web.reloadedFromDisk`,{name:i.name}))))}adopt(e,t,n){this.patch(e,{baseline:t,onDisk:t,current:t,stamp:n,disk:`in-sync`,diskText:null,saveError:null,revision:(this.state.docs.get(e)?.revision??0)+1}),this.syncDraft(e),this.reloads.get(e)?.forEach(e=>{try{e(t)}catch(e){console.error(`A document listener failed:`,e)}})}reloadFromDisk(e){let t=this.state.docs.get(e);if(!t||t.diskText===null)return;let n=this.entryOf(e);this.adopt(e,t.diskText,n?.stamp??t.stamp)}keepMine(e){let t=this.state.docs.get(e);if(!t)return;let n=this.state.listing.files.find(t=>t.path===e);this.patch(e,{disk:`in-sync`,baseline:t.diskText??t.baseline,onDisk:t.diskText??t.onDisk,diskText:null,stamp:n?.stamp??t.stamp}),this.syncDraft(e),this.scheduleAutosave(e)}async reload(t){try{let n=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`)),r=this.entryOf(t);return this.adopt(t,n,r?.stamp??null),!0}catch(n){return this.notify(e(`app.web.reloadFailed`,{name:r(t),reason:messageOf(n)}),!0),!1}}entryOf(e){let t=i(e);return this.state.listing.files.find(e=>e.path===t)}open(e,t,n){let o=this.state.docs.get(e);if(o)return this.activate(e),o.phase===`failed`?this.load(e):Promise.resolve();let c=t??a(e)??`template`,l=this.entryOf(e),u={path:e,rel:l?.rel??s(this.state.listing.root,i(e)),name:n??r(i(e)),kind:c,phase:`loading`,loadError:null,baseline:``,onDisk:``,current:``,stamp:l?.stamp??null,saving:!1,saveError:null,disk:`in-sync`,diskText:null,revision:0},d=new Map(this.state.docs);return d.set(e,u),this.commit({docs:d,order:[...this.state.order,e],active:e,recent:this.remembered(e)}),this.load(e)}load(t){let n=this.opening.get(t);if(n)return n;this.patch(t,{phase:`loading`,loadError:null});let r=(async()=>{try{let n=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`));if(!this.state.docs.has(t))return;let r=this.entryOf(t);this.patch(t,{phase:`ready`,baseline:n,onDisk:n,current:n,stamp:r?.stamp??this.state.docs.get(t)?.stamp??null,loadError:null})}catch(n){if(!this.state.docs.has(t))return;let r=missing(n)?e(`app.web.fileNotFound`):messageOf(n);this.patch(t,{phase:`failed`,loadError:r})}})().finally(()=>{this.opening.delete(t)});return this.opening.set(t,r),r}remembered(e){let t=this.state.docs.get(e)?.rel??this.state.listing.files.find(t=>t.path===e)?.rel??s(this.state.listing.root,e);return[t,...this.state.recent.filter(e=>e!==t)].slice(0,u)}activate(e){this.state.active!==e&&this.state.docs.has(e)&&this.commit({active:e,recent:this.remembered(e)})}setRecent(e){this.commit({recent:e.slice(0,u)})}move(e,t){let n=this.state.order.indexOf(e);if(n<0)return;let r=Math.max(0,Math.min(t,this.state.order.length-1));if(r===n)return;let i=[...this.state.order];i.splice(n,1),i.splice(r,0,e),this.commit({order:i})}close(e){if(!this.state.docs.has(e))return;let t=new Map(this.state.docs);t.delete(e);let n=this.state.order.indexOf(e),r=this.state.order.filter(t=>t!==e),i=this.state.active;i===e&&(i=r[Math.min(n,r.length-1)]??null),this.reloads.delete(e),this.writers.delete(e),this.opening.delete(e),this.forgetTimers(e),this.drafts?.drop(this.state.listing.root,e),this.commit({docs:t,order:r,active:i})}edit(e,t){let n=this.state.docs.get(e);n&&n.phase===`ready`&&n.current!==t&&(this.patch(e,{current:t,saveError:null}),this.syncDraft(e),this.scheduleAutosave(e))}syncDraft(e){let t=this.state.docs.get(e);if(!this.drafts||!t||t.phase!==`ready`)return;let n=this.state.listing.root;isDirty(t)?this.drafts.keep(n,{path:e,rel:t.rel,text:t.current,baseline:t.onDisk,stamp:t.stamp}):this.drafts.drop(n,e)}applyDraft(e,t){let n=this.state.docs.get(e);if(!n||n.phase!==`ready`||n.current===t.text)return!1;let r=n.onDisk!==t.baseline;return this.patch(e,{current:t.text,saveError:null,disk:r?`changed`:n.disk,diskText:r?n.onDisk:n.diskText,revision:n.revision+1}),this.reloads.get(e)?.forEach(e=>{try{e(t.text)}catch(e){console.error(`A document listener failed:`,e)}}),this.syncDraft(e),!0}adoptMissing(e,t,n){if(this.state.docs.has(e))return;let i={path:e,rel:s(this.state.listing.root,e),name:r(e),kind:t,phase:`ready`,loadError:null,baseline:n.baseline,onDisk:n.baseline,current:n.text,stamp:null,saving:!1,saveError:null,disk:`deleted`,diskText:null,revision:0},a=new Map(this.state.docs);a.set(e,i),this.commit({docs:a,order:[...this.state.order,e],active:e,recent:this.remembered(e)}),this.syncDraft(e)}setAutosave(e){this.autosaveSeconds=e!==null&&e>0?e:null;for(let e of[...this.timers.keys()])this.forgetTimers(e);if(this.autosaveSeconds!==null)for(let e of this.dirtyPaths())this.scheduleAutosave(e)}forgetTimers(e){let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e),this.attempts.delete(e)}scheduleAutosave(e,t){let n=this.timers.get(e);if(n&&clearTimeout(n),this.timers.delete(e),this.autosaveSeconds===null||!isDirty(this.state.docs.get(e)))return;let r=t??this.autosaveSeconds*this.secondMs,i=setTimeout(()=>{this.timers.delete(e),this.autosave(e)},r);this.timers.set(e,i)}async autosave(e){let t=this.state.docs.get(e);if(this.autosaveSeconds===null||!t||t.phase!==`ready`||!isDirty(t)||t.disk!==`in-sync`)return;let n=this.state.connection!==`ok`||!await this.save(e),r=this.state.docs.get(e);if(!r||!isDirty(r))this.attempts.delete(e);else if(r.disk===`in-sync`){if(n||r.saveError){let t=(this.attempts.get(e)??0)+1;this.attempts.set(e,t),this.scheduleAutosave(e,Math.min(this.autosaveSeconds*this.secondMs*2**Math.min(t,6),d))}else this.scheduleAutosave(e)}}save(e){let t=this.state.docs.get(e);if(!t||t.phase!==`ready`)return Promise.resolve(!1);let n=this.writers.get(e);if(n||(n={running:null,again:!1},this.writers.set(e,n)),n.running)return n.again=!0,n.running.then(()=>!isDirty(this.state.docs.get(e)));let r=n;return r.running=this.drain(e,r).finally(()=>{r.running=null}),r.running.then(()=>this.state.docs.has(e)&&!isDirty(this.state.docs.get(e)))}async drain(t,n){do{n.again=!1;let r=this.state.docs.get(t);if(!r||r.phase!==`ready`||r.current===r.baseline&&r.disk!==`deleted`||r.disk===`changed`||r.disk===`in-sync`&&!await this.unchangedOnDisk(t))return;let i=this.state.docs.get(t);if(!i||i.phase!==`ready`)return;let a=i.current;if(a===i.baseline&&i.disk!==`deleted`)return;this.patch(t,{saving:!0,saveError:null});let o;try{o=await timed(this.host.write(t,a,i.kind,i.disk===`deleted`?null:i.stamp),this.writeTimeout,e(`app.web.serverTimeout`))}catch(n){if(refusedAsChanged(n)){await this.refused(t);return}let i=messageOf(n);this.patch(t,{saving:!1,saveError:i}),this.notify(e(`app.web.saveFailed`,{name:r.name,reason:i}),!0);return}if(!this.state.docs.has(t))return;this.patch(t,{saving:!1,baseline:a,onDisk:o.stored,saveError:null,disk:`in-sync`,diskText:null,stamp:o.stamp}),this.syncDraft(t)}while(n.again);this.refresh()}async refused(e){this.patch(e,{saving:!1,disk:`changed`}),await this.refresh()}async unchangedOnDisk(e){await this.refresh();let t=this.state.docs.get(e);return!!t&&t.phase===`ready`&&t.disk!==`changed`}async saveAll(){return(await Promise.all(this.dirtyPaths().map(e=>this.save(e)))).every(Boolean)}async create(e,t){let n=this.state.listing.root;return await this.host.create(n,[{path:e,content:t}]),await this.refresh(),this.state.listing.files.find(t=>t.rel===e)?.path??``}};export{isDirty as n,DocumentStore as t};
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-BLCeE6UY.js";import{a as t,c as n,n as r,r as i,s as a,t as o,u as s}from"./files-DI8LgQfb.js";var c=3e4,l=3e4,u=30,d=6e4;function isDirty(e){return!!e&&e.phase===`ready`&&e.current!==e.baseline}function messageOf(t){return t instanceof Error&&t.message?t.message:typeof t==`string`&&t?t:e(`app.web.unknownFailure`)}function timed(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(Error(n)),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}function denied(e){return e?.response?.status===401}function missing(e){return e?.response?.status===404||/\b404\b|not found|no such file|does not exist/i.test(messageOf(e))}function refusedAsChanged(e){return e?.response?.status===409}var DocumentStore=class{host;notify;readTimeout;writeTimeout;listeners=new Set;reloads=new Map;writers=new Map;opening=new Map;drafts;secondMs;timers=new Map;attempts=new Map;autosaveSeconds=null;state={docs:new Map,order:[],active:null,listing:o,connection:`ok`,listed:!1,recent:[]};polling=null;constructor(e){this.host=e.host,this.notify=e.notify??(()=>void 0),this.readTimeout=e.readTimeoutMs??c,this.writeTimeout=e.writeTimeoutMs??l,this.drafts=e.drafts??null,this.secondMs=e.secondMs??1e3}snapshot(){return this.state}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}subscribeReload(e,t){let n=this.reloads.get(e);return n||(n=new Set,this.reloads.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.reloads.delete(e)}}doc(e){return this.state.docs.get(e)}readOnly(t){return timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`))}dirtyPaths(){return this.state.order.filter(e=>isDirty(this.state.docs.get(e)))}commit(e){this.state={...this.state,...e},[...this.listeners].forEach(e=>{try{e()}catch(e){console.error(`A store listener failed:`,e)}})}patch(e,t){let n=this.state.docs.get(e);if(!n)return;let r={...n,...t},i=new Map(this.state.docs);return i.set(e,r),this.commit({docs:i}),r}async refresh(){if(this.polling)return this.polling;let t=(async()=>{let t;try{t=n(await timed(this.host.list(),this.readTimeout,e(`app.web.serverTimeout`)))}catch(e){let t=denied(e)?`denied`:`lost`;this.state.connection!==t&&this.commit({connection:t}),console.warn(`The project could not be listed:`,e);return}let r=this.state.connection===`lost`,i=t.signature!==this.state.listing.signature||!this.state.listed;(i||r)&&this.commit({listing:t,listed:!0,connection:`ok`}),(i||r)&&await this.reconcile(t)})();return this.polling=t.finally(()=>{this.polling=null}),this.polling}async reconcile(n){let r=new Map(n.files.map(e=>[e.path,e]));for(let n of[...this.state.order]){let a=this.state.docs.get(n);if(!a||a.phase!==`ready`||t(a.kind))continue;let o=r.get(i(n));o?(a.disk===`deleted`&&this.patch(n,{disk:`in-sync`,stamp:null}),this.state.docs.get(n).stamp!==o.stamp&&await this.compareWithDisk(n,o.stamp)):a.disk!==`deleted`&&(this.patch(n,{disk:`deleted`,diskText:null}),this.notify(e(`app.web.deletedOnDisk`,{name:a.name}),!0))}}async compareWithDisk(t,n){let r;try{r=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`))}catch(e){missing(e)&&this.patch(t,{disk:`deleted`,diskText:null});return}let i=this.state.docs.get(t);i&&i.phase===`ready`&&(r===i.onDisk||r===i.baseline?this.patch(t,{stamp:n,disk:`in-sync`,diskText:null}):r===i.current?(this.patch(t,{stamp:n,baseline:r,onDisk:r,disk:`in-sync`,diskText:null}),this.syncDraft(t)):isDirty(i)||this.writers.get(t)?.running?(this.patch(t,{stamp:n,disk:`changed`,diskText:r}),this.notify(e(`app.web.changedOnDisk`,{name:i.name}),!0)):(this.adopt(t,r,n),this.notify(e(`app.web.reloadedFromDisk`,{name:i.name}))))}adopt(e,t,n){this.patch(e,{baseline:t,onDisk:t,current:t,stamp:n,disk:`in-sync`,diskText:null,saveError:null,revision:(this.state.docs.get(e)?.revision??0)+1}),this.syncDraft(e),this.reloads.get(e)?.forEach(e=>{try{e(t)}catch(e){console.error(`A document listener failed:`,e)}})}reloadFromDisk(e){let t=this.state.docs.get(e);if(!t||t.diskText===null)return;let n=this.entryOf(e);this.adopt(e,t.diskText,n?.stamp??t.stamp)}keepMine(e){let t=this.state.docs.get(e);if(!t)return;let n=this.state.listing.files.find(t=>t.path===e);this.patch(e,{disk:`in-sync`,baseline:t.diskText??t.baseline,onDisk:t.diskText??t.onDisk,diskText:null,stamp:n?.stamp??t.stamp}),this.syncDraft(e),this.scheduleAutosave(e)}async reload(t){try{let n=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`)),r=this.entryOf(t);return this.adopt(t,n,r?.stamp??null),!0}catch(n){return this.notify(e(`app.web.reloadFailed`,{name:r(t),reason:messageOf(n)}),!0),!1}}entryOf(e){let t=i(e);return this.state.listing.files.find(e=>e.path===t)}open(e,t,n){let o=this.state.docs.get(e);if(o)return this.activate(e),o.phase===`failed`?this.load(e):Promise.resolve();let c=t??a(e)??`template`,l=this.entryOf(e),u={path:e,rel:l?.rel??s(this.state.listing.root,i(e)),name:n??r(i(e)),kind:c,phase:`loading`,loadError:null,baseline:``,onDisk:``,current:``,stamp:l?.stamp??null,saving:!1,saveError:null,disk:`in-sync`,diskText:null,revision:0},d=new Map(this.state.docs);return d.set(e,u),this.commit({docs:d,order:[...this.state.order,e],active:e,recent:this.remembered(e)}),this.load(e)}load(t){let n=this.opening.get(t);if(n)return n;this.patch(t,{phase:`loading`,loadError:null});let r=(async()=>{try{let n=await timed(this.host.read(t),this.readTimeout,e(`app.web.serverTimeout`));if(!this.state.docs.has(t))return;let r=this.entryOf(t);this.patch(t,{phase:`ready`,baseline:n,onDisk:n,current:n,stamp:r?.stamp??this.state.docs.get(t)?.stamp??null,loadError:null})}catch(n){if(!this.state.docs.has(t))return;let r=missing(n)?e(`app.web.fileNotFound`):messageOf(n);this.patch(t,{phase:`failed`,loadError:r})}})().finally(()=>{this.opening.delete(t)});return this.opening.set(t,r),r}remembered(e){let t=this.state.docs.get(e)?.rel??this.state.listing.files.find(t=>t.path===e)?.rel??s(this.state.listing.root,e);return[t,...this.state.recent.filter(e=>e!==t)].slice(0,u)}activate(e){this.state.active!==e&&this.state.docs.has(e)&&this.commit({active:e,recent:this.remembered(e)})}setRecent(e){this.commit({recent:e.slice(0,u)})}move(e,t){let n=this.state.order.indexOf(e);if(n<0)return;let r=Math.max(0,Math.min(t,this.state.order.length-1));if(r===n)return;let i=[...this.state.order];i.splice(n,1),i.splice(r,0,e),this.commit({order:i})}close(e){if(!this.state.docs.has(e))return;let t=new Map(this.state.docs);t.delete(e);let n=this.state.order.indexOf(e),r=this.state.order.filter(t=>t!==e),i=this.state.active;i===e&&(i=r[Math.min(n,r.length-1)]??null),this.reloads.delete(e),this.writers.delete(e),this.opening.delete(e),this.forgetTimers(e),this.drafts?.drop(this.state.listing.root,e),this.commit({docs:t,order:r,active:i})}edit(e,t){let n=this.state.docs.get(e);n&&n.phase===`ready`&&n.current!==t&&(this.patch(e,{current:t,saveError:null}),this.syncDraft(e),this.scheduleAutosave(e))}syncDraft(e){let t=this.state.docs.get(e);if(!this.drafts||!t||t.phase!==`ready`)return;let n=this.state.listing.root;isDirty(t)?this.drafts.keep(n,{path:e,rel:t.rel,text:t.current,baseline:t.onDisk,stamp:t.stamp}):this.drafts.drop(n,e)}applyDraft(e,t){let n=this.state.docs.get(e);if(!n||n.phase!==`ready`||n.current===t.text)return!1;let r=n.onDisk!==t.baseline;return this.patch(e,{current:t.text,saveError:null,disk:r?`changed`:n.disk,diskText:r?n.onDisk:n.diskText,revision:n.revision+1}),this.reloads.get(e)?.forEach(e=>{try{e(t.text)}catch(e){console.error(`A document listener failed:`,e)}}),this.syncDraft(e),!0}adoptMissing(e,t,n){if(this.state.docs.has(e))return;let i={path:e,rel:s(this.state.listing.root,e),name:r(e),kind:t,phase:`ready`,loadError:null,baseline:n.baseline,onDisk:n.baseline,current:n.text,stamp:null,saving:!1,saveError:null,disk:`deleted`,diskText:null,revision:0},a=new Map(this.state.docs);a.set(e,i),this.commit({docs:a,order:[...this.state.order,e],active:e,recent:this.remembered(e)}),this.syncDraft(e)}setAutosave(e){this.autosaveSeconds=e!==null&&e>0?e:null;for(let e of[...this.timers.keys()])this.forgetTimers(e);if(this.autosaveSeconds!==null)for(let e of this.dirtyPaths())this.scheduleAutosave(e)}forgetTimers(e){let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e),this.attempts.delete(e)}scheduleAutosave(e,t){let n=this.timers.get(e);if(n&&clearTimeout(n),this.timers.delete(e),this.autosaveSeconds===null||!isDirty(this.state.docs.get(e)))return;let r=t??this.autosaveSeconds*this.secondMs,i=setTimeout(()=>{this.timers.delete(e),this.autosave(e)},r);this.timers.set(e,i)}async autosave(e){let t=this.state.docs.get(e);if(this.autosaveSeconds===null||!t||t.phase!==`ready`||!isDirty(t)||t.disk!==`in-sync`)return;let n=this.state.connection!==`ok`||!await this.save(e),r=this.state.docs.get(e);if(!r||!isDirty(r))this.attempts.delete(e);else if(r.disk===`in-sync`){if(n||r.saveError){let t=(this.attempts.get(e)??0)+1;this.attempts.set(e,t),this.scheduleAutosave(e,Math.min(this.autosaveSeconds*this.secondMs*2**Math.min(t,6),d))}else this.scheduleAutosave(e)}}save(e){let t=this.state.docs.get(e);if(!t||t.phase!==`ready`)return Promise.resolve(!1);let n=this.writers.get(e);if(n||(n={running:null,again:!1},this.writers.set(e,n)),n.running)return n.again=!0,n.running.then(()=>!isDirty(this.state.docs.get(e)));let r=n;return r.running=this.drain(e,r).finally(()=>{r.running=null}),r.running.then(()=>this.state.docs.has(e)&&!isDirty(this.state.docs.get(e)))}async drain(t,n){do{n.again=!1;let r=this.state.docs.get(t);if(!r||r.phase!==`ready`||r.current===r.baseline&&r.disk!==`deleted`||r.disk===`changed`||r.disk===`in-sync`&&!await this.unchangedOnDisk(t))return;let i=this.state.docs.get(t);if(!i||i.phase!==`ready`)return;let a=i.current;if(a===i.baseline&&i.disk!==`deleted`)return;this.patch(t,{saving:!0,saveError:null});let o;try{o=await timed(this.host.write(t,a,i.kind,i.disk===`deleted`?null:i.stamp),this.writeTimeout,e(`app.web.serverTimeout`))}catch(n){if(refusedAsChanged(n)){await this.refused(t);return}let i=messageOf(n);this.patch(t,{saving:!1,saveError:i}),this.notify(e(`app.web.saveFailed`,{name:r.name,reason:i}),!0);return}if(!this.state.docs.has(t))return;this.patch(t,{saving:!1,baseline:a,onDisk:o.stored,saveError:null,disk:`in-sync`,diskText:null,stamp:o.stamp}),this.syncDraft(t)}while(n.again);this.refresh()}async refused(e){this.patch(e,{saving:!1,disk:`changed`}),await this.refresh()}async unchangedOnDisk(e){await this.refresh();let t=this.state.docs.get(e);return!!t&&t.phase===`ready`&&t.disk!==`changed`}async saveAll(){return(await Promise.all(this.dirtyPaths().map(e=>this.save(e)))).every(Boolean)}async create(e,t){let n=this.state.listing.root;return await this.host.create(n,[{path:e,content:t}]),await this.refresh(),this.state.listing.files.find(t=>t.rel===e)?.path??``}};export{isDirty as n,DocumentStore as t};
|