@kern0x1b/penstock-cli 26.10.5 → 26.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-account-C8EHysMH.js → chunk-account-CMvFjqGw.js} +1 -1
- package/dist/{chunk-agentFailure-piRAFLGH.js → chunk-agentFailure-BiU8hJ-k.js} +1 -1
- package/dist/{chunk-agentLaunch-C5Uo40vv.js → chunk-agentLaunch-CRWlfuXv.js} +1 -1
- package/dist/{chunk-agentServe-4O0syoYQ.js → chunk-agentServe-M3jzEiHj.js} +1 -1
- package/dist/{chunk-analyze-Brxlb4U1.js → chunk-analyze-CCZJQpbU.js} +1 -1
- package/dist/chunk-analyze-D_2dPr5n.js +1 -0
- package/dist/chunk-apply-Dmo_XdOA.js +1 -0
- package/dist/{chunk-bot-I4kuhjyv.js → chunk-bot-51CfGKVL.js} +3 -3
- package/dist/chunk-codeFactSet-BqEOkvBS.js +1 -0
- package/dist/{chunk-codeIndex-CzENd6hG.js → chunk-codeIndex-olvCG85q.js} +1 -1
- package/dist/{chunk-codeLinks-D-gzUjYv.js → chunk-codeLinks-DW721PAt.js} +1 -1
- package/dist/chunk-codeLinks-S_BEJVPa.js +1 -0
- package/dist/{chunk-command-BctoT00W.js → chunk-command-B-7DfFou.js} +1 -1
- package/dist/chunk-command-CyUljAAc.js +1 -0
- package/dist/{chunk-command-Jl1msVwF.js → chunk-command-D7WS1aRl.js} +1 -1
- package/dist/chunk-commands-CMEkVxle.js +1 -0
- package/dist/{chunk-compose-BV9Jg348.js → chunk-compose-DCAQQndd.js} +1 -1
- package/dist/{chunk-connectors-CVfz5pSg.js → chunk-connectors-DG6IqkGl.js} +1 -1
- package/dist/{chunk-connectors-eXPldvkc.js → chunk-connectors-UpMjbdpU.js} +1 -1
- package/dist/{chunk-context-DPJmldqg.js → chunk-context-B-5CZFAT.js} +1 -1
- package/dist/{chunk-convert-B1sgT9kl.js → chunk-convert-B7srqZpZ.js} +1 -1
- package/dist/chunk-deploy-CGLF2dB1.js +1 -0
- package/dist/{chunk-deploy-DOXu2-8q.js → chunk-deploy-Clj9f2y-.js} +1 -1
- package/dist/chunk-diagram-CIy-F5iz.js +1 -0
- package/dist/{chunk-diagram-BaVwLa4h.js → chunk-diagram-DYoeuAJx.js} +1 -1
- package/dist/{chunk-diagramDefects-7UG_Iwsr.js → chunk-diagramDefects-DlVCfZci.js} +1 -1
- package/dist/{chunk-diagrams-6suPQBVQ.js → chunk-diagrams-wnFsPOKv.js} +1 -1
- package/dist/{chunk-diff-D1m_eKvv.js → chunk-diff-BJ2sJwcs.js} +1 -1
- package/dist/chunk-diff-BelMuQhT.js +1 -0
- package/dist/chunk-dispatch-CescmVW-.js +6 -0
- package/dist/{chunk-docs-CwY3Ce9M.js → chunk-docs-DzOiA9zg.js} +4 -4
- package/dist/{chunk-doctor-m0mnVdDE.js → chunk-doctor-GDNwRCg3.js} +1 -1
- package/dist/{chunk-drawing-shRfnrs9.js → chunk-drawing-C2qewK8L.js} +1 -1
- package/dist/{chunk-editPreview-BgH1JVOD.js → chunk-editPreview-DGu4slO6.js} +1 -1
- package/dist/chunk-export-CDFdw7Eh.js +1 -0
- package/dist/{chunk-export-D5kPD4Or.js → chunk-export-DP1Hab-_.js} +1 -1
- package/dist/{chunk-facts-DA3Y-k9a.js → chunk-facts-CfA8qH5b.js} +1 -1
- package/dist/{chunk-failure-BsimkHy_.js → chunk-failure-BK7fu4Yo.js} +1 -1
- package/dist/{chunk-features-BfRg2kR5.js → chunk-features-CiC2Yoej.js} +1 -1
- package/dist/chunk-features-Dq1Gvqp3.js +1 -0
- package/dist/chunk-folders-BO8qUHUV.js +1 -0
- package/dist/{chunk-folders-13vx0i0n.js → chunk-folders-yTMgOqLo.js} +1 -1
- package/dist/chunk-formChecks-BOiD8Idv.js +1 -0
- package/dist/chunk-help-DKtpVSxI.js +85 -0
- package/dist/chunk-importCommand-_CnKIoNk.js +1 -0
- package/dist/{chunk-init-AIh_7yE0.js → chunk-init-3zEab7KI.js} +3 -3
- package/dist/chunk-license-Cvnp1Aee.js +1 -0
- package/dist/{chunk-license-x3oHbKe2.js → chunk-license-DU4P8P8A.js} +1 -1
- package/dist/{chunk-lint-C_fAcLIg.js → chunk-lint-Df2davEY.js} +1 -1
- package/dist/{chunk-load-BVJUBU5S.js → chunk-load-CRmIvn7e.js} +1 -1
- package/dist/chunk-main-BY7JEoe1.js +1 -0
- package/dist/chunk-mcp-DKX2xT8d.js +77 -0
- package/dist/{chunk-mcpLaunch-C13ViiIP.js → chunk-mcpLaunch-DpDE0hW-.js} +1 -1
- package/dist/chunk-migrate-BaNzQNyD.js +2 -0
- package/dist/chunk-migrate-DcxIkacG.js +1 -0
- package/dist/{chunk-penstockCli-CqiOKC75.js → chunk-penstockCli-B0_wWDGy.js} +1 -1
- package/dist/chunk-plural-Di3FH8HP.js +1 -0
- package/dist/{chunk-pr-tC3-PSNM.js → chunk-pr-DXs1coaS.js} +1 -1
- package/dist/{chunk-project-qT-Fk_Rz.js → chunk-project-BS-4dy5o.js} +1 -1
- package/dist/{chunk-report-CDz78nCI.js → chunk-report-CtkTRSGT.js} +1 -1
- package/dist/{chunk-review-BqZSohXR.js → chunk-review-WIpFGKkc.js} +1 -1
- package/dist/{chunk-rules-DJlL7K_Q.js → chunk-rules-CoJAmvwu.js} +1 -1
- package/dist/{chunk-security-5SU-bq3A.js → chunk-security-BKVRwb6V.js} +10 -10
- package/dist/{chunk-share-YSewfw3F.js → chunk-share-B3W30sbt.js} +3 -3
- package/dist/chunk-src-CxTpK8wk.js +890 -0
- package/dist/{chunk-stages-C-nhLoBW.js → chunk-stages-Gm5BZUp5.js} +1 -1
- package/dist/chunk-status-X9Ny-Nu8.js +1 -0
- package/dist/{chunk-systemError-B-1nL94i.js → chunk-systemError-F6bMRwXU.js} +1 -1
- package/dist/chunk-systemError-cGwrYkmo.js +1 -0
- package/dist/{chunk-table-CJtiXv0e.js → chunk-table-B2WTbpMl.js} +1 -1
- package/dist/chunk-taskTest-B3gfOti1.js +1 -0
- package/dist/{chunk-taskTest-4rIxp0rL.js → chunk-taskTest-D-WDCLD5.js} +2 -2
- package/dist/{chunk-templates-Bxe3J0qy.js → chunk-templates-BdsiNRJ3.js} +1 -1
- package/dist/chunk-testCases-ba8k3BJD.js +4 -0
- package/dist/chunk-testCases-gXzkCxF5.js +1 -0
- package/dist/chunk-tests-BLBZ1eh2.js +1 -0
- package/dist/chunk-tests-DxL0JMtB.js +23 -0
- package/dist/chunk-translator-BAjzyPKE.js +22 -0
- package/dist/{chunk-trust-u1vZ6Yk0.js → chunk-trust-Ci9pDa27.js} +1 -1
- package/dist/{chunk-trust-yKw_pXRj.js → chunk-trust-DlJIoKs8.js} +1 -1
- package/dist/{chunk-workerVariables-CCLcoR0U.js → chunk-workerVariables-BnLSud8o.js} +1 -1
- package/dist/{chunk-wrapper-AJWl6ru-.js → chunk-wrapper-DqqRt0FZ.js} +1 -1
- package/dist/chunk-wrapper-E_u1_-Db.js +1 -0
- package/dist/locales/de.json +103 -2
- package/dist/locales/es.json +103 -2
- package/dist/locales/fr.json +103 -2
- package/dist/locales/ja.json +103 -2
- package/dist/locales/ko.json +103 -2
- package/dist/locales/pt-BR.json +103 -2
- package/dist/locales/ru.json +103 -2
- package/dist/locales/zh.json +103 -2
- package/dist/penstock.js +1 -1
- package/dist/web/assets/{AgentSettings-C3Er_rlW.js → AgentSettings-4B4hSxBk.js} +1 -1
- package/dist/web/assets/{AgentsDialog-Bo7kikb6.js → AgentsDialog-C32ALLtE.js} +1 -1
- package/dist/web/assets/{BpmnCanvas-Dw5zgCN3.js → BpmnCanvas-CZOJiq6t.js} +1 -1
- package/dist/web/assets/{BpmnDocument-CuU0biX9.js → BpmnDocument-BNLfXWLG.js} +4 -4
- package/dist/web/assets/{ConflictDialog-GxZ-d8SK.js → ConflictDialog-mUJYs1zz.js} +1 -1
- package/dist/web/assets/{DiffDocument-Bh3hFmmi.js → DiffDocument-C7csJl3x.js} +1 -1
- package/dist/web/assets/{DmnDocument-C8HpJAcE.js → DmnDocument-B2dyX49k.js} +1 -1
- package/dist/web/assets/{FormDocument-CH-4KB3x.js → FormDocument-ChSqEPE5.js} +1 -1
- package/dist/web/assets/{FormStepView-DraPVoAN.js → FormStepView-j4C0Qovo.js} +1 -1
- package/dist/web/assets/{GraphAwareLayoutService-C8J8YHJI.js → GraphAwareLayoutService-DD2iXfXi.js} +1 -1
- package/dist/web/assets/{NewFileDialog-j09JqpPj.js → NewFileDialog-eeIqqmXc.js} +1 -1
- package/dist/web/assets/{QuickOpen-CeBhsCzA.js → QuickOpen-C0I0FRt2.js} +1 -1
- package/dist/web/assets/{ScriptPane-DDikZDv6.js → ScriptPane-BAvcgLWX.js} +2 -2
- package/dist/web/assets/{ScriptRunDialog-DdzJ0pvT.js → ScriptRunDialog-DLlMiJiK.js} +1 -1
- package/dist/web/assets/{SettingsDialog-JUc5zUR9.js → SettingsDialog-C3ts5aiN.js} +1 -1
- package/dist/web/assets/{ShortcutsDialog-DECqWPNE.js → ShortcutsDialog-DVV504pS.js} +1 -1
- package/dist/web/assets/{SourceDocument-X8ajUcxM.js → SourceDocument-DRgUPazk.js} +1 -1
- package/dist/web/assets/{TextDocument-0z7qojAh.js → TextDocument-Bm0sPjft.js} +1 -1
- package/dist/web/assets/{UnreadableFileLayer-D3G59F4u.js → UnreadableFileLayer-DbW33CnE.js} +1 -1
- package/dist/web/assets/{UploadDialog-CiahYkTc.js → UploadDialog-BSl3zFNn.js} +1 -1
- package/dist/web/assets/{apply-HqvoGwLE.js → apply-B3FkgxjU.js} +1 -1
- package/dist/web/assets/{bpmnTheme-cOvp4qFc.js → bpmnTheme-C3HdVV1D.js} +1 -1
- package/dist/web/assets/bridgeInstance-BZBhe5hF.js +851 -0
- package/dist/web/assets/{commands-nPznxvPp.js → commands-DHPxsavW.js} +1 -1
- package/dist/web/assets/de-BH_bnU4H.js +1 -0
- package/dist/web/assets/{dialog-CtGB1LHI.js → dialog-LcHsiQKJ.js} +1 -1
- package/dist/web/assets/{diff-NgYeO98t.js → diff-bpdDl0KE.js} +1 -1
- package/dist/web/assets/{documentBridge-QW0IZ9Bq.js → documentBridge-4fZNBdp4.js} +2 -2
- package/dist/web/assets/{documents-KeXEdK1U.js → documents-FOVGbYYF.js} +1 -1
- package/dist/web/assets/{duplicate-DNPpPVse.js → duplicate-CdCuOnUl.js} +1 -1
- package/dist/web/assets/{engines-DU0BfbYM.js → engines-C884tl-T.js} +1 -1
- package/dist/web/assets/es-D7v7zkxC.js +1 -0
- package/dist/web/assets/{formChecks-sU20kKkU.js → formChecks-Bvuzw2sb.js} +1 -1
- package/dist/web/assets/fr-CuzAJTai.js +1 -0
- package/dist/web/assets/frontend-Y1MvD_Uo.js +1 -0
- package/dist/web/assets/httpHost-CnF86WJB.js +1 -0
- package/dist/web/assets/{index.es-BqVUpGyA.js → index.es-0rLw__5_.js} +1 -1
- package/dist/web/assets/{index.es-DqkfrvWI.js → index.es-BP1Cc_0e.js} +1 -1
- package/dist/web/assets/{intelligence-Ck_Q9upa.js → intelligence-E2EBYhHr.js} +1 -1
- package/dist/web/assets/ja-BgElyPpa.js +1 -0
- package/dist/web/assets/{jspdf.es.min-CM3S4IDt.js → jspdf.es.min-BSRrqhq_.js} +3 -3
- package/dist/web/assets/ko-j1Oi9MKH.js +1 -0
- package/dist/web/assets/{lib-DAKOOgix.js → lib-De3fPoUi.js} +1 -1
- package/dist/web/assets/{platform-CkWAyNst.js → platform-CjEV0T5t.js} +1 -1
- package/dist/web/assets/{preferences-nBrFGN89.js → preferences-CmXdxfFo.js} +1 -1
- package/dist/web/assets/pt-BR-CRWG2th4.js +1 -0
- package/dist/web/assets/ru-KJyuYSUL.js +1 -0
- package/dist/web/assets/{run-B3YvrVeP.js → run-B9EUa035.js} +1 -1
- package/dist/web/assets/{samples-BVuIm-bu.js → samples-03zukOEM.js} +1 -1
- package/dist/web/assets/{testCaseRuns-DYKnccnc.js → testCaseRuns-BYhJPipg.js} +1 -1
- package/dist/web/assets/translator-OIpY8kTG.js +1 -0
- package/dist/web/assets/{ui-3pEQJ50t.js → ui-BLMlfdD3.js} +1 -1
- package/dist/web/assets/{useTrace-BAXnn0Bt.js → useTrace-Cr28sh4A.js} +1 -1
- package/dist/web/assets/{web-B2zkonPE.js → web-Q9VZNxQi.js} +5 -5
- package/dist/web/assets/zh-CukDLcVz.js +1 -0
- package/dist/web/index.html +19 -19
- package/package.json +1 -1
- package/dist/chunk-analyze-CUxuBgNS.js +0 -1
- package/dist/chunk-apply-BAMwoXG9.js +0 -1
- package/dist/chunk-baseline-DvS2S0am.js +0 -1
- package/dist/chunk-codeFactSet-DOOlbIIj.js +0 -1
- package/dist/chunk-codeLinks-DLxEBWPi.js +0 -1
- package/dist/chunk-command-BR4memGJ.js +0 -1
- package/dist/chunk-commands-CeRlfHY-.js +0 -1
- package/dist/chunk-deploy-C4KJK-tw.js +0 -1
- package/dist/chunk-diagram-CCA1-fT5.js +0 -1
- package/dist/chunk-diff-BC8gZX5w.js +0 -1
- package/dist/chunk-dispatch-CW2CJI0C.js +0 -6
- package/dist/chunk-export-9AWsr5ai.js +0 -1
- package/dist/chunk-features-BwnwB6jL.js +0 -1
- package/dist/chunk-folders-C1Nes4Ap.js +0 -1
- package/dist/chunk-formChecks-acRgARZ3.js +0 -1
- package/dist/chunk-help-CFhmAhz8.js +0 -85
- package/dist/chunk-importCommand-5SJxu2k4.js +0 -1
- package/dist/chunk-license-B_To2110.js +0 -1
- package/dist/chunk-main-D3S4Xr__.js +0 -1
- package/dist/chunk-mcp-ByMCWlXC.js +0 -76
- package/dist/chunk-migrate-CLQ-hrae.js +0 -1
- package/dist/chunk-migrate-CVUR1K7f.js +0 -1
- package/dist/chunk-plural-Bq_4vgOr.js +0 -1
- package/dist/chunk-src-BLyg_6UX.js +0 -879
- package/dist/chunk-status-DgeSOz3A.js +0 -1
- package/dist/chunk-systemError-2me5k57V.js +0 -1
- package/dist/chunk-taskTest-rng12v_b.js +0 -1
- package/dist/chunk-testCases-CwQ-Mi7L.js +0 -1
- package/dist/chunk-testCases-xculyxH_.js +0 -4
- package/dist/chunk-tests-C-kNQNpq.js +0 -1
- package/dist/chunk-tests-C3XJ9LMT.js +0 -23
- package/dist/chunk-translator-BFUJmSkR.js +0 -21
- package/dist/chunk-wrapper-Bxz1Lgp5.js +0 -1
- package/dist/web/assets/bridgeInstance-DQk-c8L1.js +0 -850
- package/dist/web/assets/de-Dj813wjn.js +0 -1
- package/dist/web/assets/es-CyJDEw4H.js +0 -1
- package/dist/web/assets/fr-B1lqrd3d.js +0 -1
- package/dist/web/assets/frontend-caI7mOAL.js +0 -1
- package/dist/web/assets/httpHost-Dqit__mm.js +0 -1
- package/dist/web/assets/ja-BUAM_DzQ.js +0 -1
- package/dist/web/assets/ko-7l4EjTF9.js +0 -1
- package/dist/web/assets/pt-BR-CxxRL7kF.js +0 -1
- package/dist/web/assets/ru-C4gbkVXL.js +0 -1
- package/dist/web/assets/translator-B2N3PQBL.js +0 -1
- package/dist/web/assets/zh-DIYPlVjz.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-B8BYMn-z.js";import{a as t,n,s as r}from"./translator-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-B8BYMn-z.js";import{a as t,n,s as r}from"./translator-OIpY8kTG.js";import{a as i,i as a,s as o}from"./dist-CHluRwHI.js";import{a as s,n as c,r as l}from"./dist-TNwbKIWT.js";function libsTranslate(e,i){let a=t(n()).libs[e];return r(a??e,i)}var u={translate:[`value`,libsTranslate]},d=e(((e,t)=>{(function(){var e={}.hasOwnProperty;function classNames(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=appendClass(e,parseValue(n)))}return e}function parseValue(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return classNames.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var n=``;for(var r in t)e.call(t,r)&&t[r]&&(n=appendClass(n,r));return n}function appendClass(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(classNames.default=classNames,t.exports=classNames):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return classNames}):window.classNames=classNames})()}));s();var f={"{":123,"}":125},isClosingFeelScope=(e,t=0)=>{let n=e.peek(t)===f[`}`],r=e.peek(t+1)===f[`}`];return n&&r||e.peek(t)===-1},p=new c((e,t)=>{let n=0;for(;!isClosingFeelScope(e,n);)n++;n>0&&(e.advance(n),e.acceptToken(2))}),isClosingTextScope=(e,t=0)=>{let n=e.peek(t)===f[`{`],r=e.peek(t+1)===f[`{`];return n&&r||e.peek(t)===-1},m=new c((e,t)=>{let n=0;for(;!isClosingTextScope(e,n);)n++;n>0&&(e.advance(n),e.acceptToken(3))}),h=new c((e,t)=>{let n=0;for(;e.peek(n)!==-1;)n++;n>0&&(e.advance(n),e.acceptToken(1))});a();var g=i({ConditionalSpanner:o.special(o.bracket),ConditionalSpannerClose:o.special(o.bracket),ConditionalSpannerCloseNl:o.special(o.bracket),LoopSpanner:o.special(o.bracket),LoopSpannerClose:o.special(o.bracket),LoopSpannerCloseNl:o.special(o.bracket),EmptyInsert:o.special(o.bracket),Insert:o.special(o.bracket)});s();var _=l.deserialize({version:14,states:"$bOQOaOOOfOXO'#CbOOO`'#Cm'#CmOqOWO'#CcOvOWO'#CfOOO`'#Cp'#CpOOO`'#Ci'#CiO{OaO'#ClO!jOSOOQOOOOOO!oOPO,58{O!tOXO,58|OOO`,58|,58|O!|OQO,58}O#ROQO,59QOOO`-E6g-E6gOOO`1G.g1G.gO#WOPO1G.gOOO`1G.h1G.hO#]OaO1G.iO#qOaO1G.lOOO`7+$R7+$RO$VOPO7+$TO$_OPO7+$WOOO`<<Go<<GoOOO`<<Gr<<Gr",stateData:"$g~ORUO_WObPOeROgSO^`P~OQYO_ZOc[O~OQ]O~OQ^O~ORUObPOeROgSO^`XW`XX`XZ`X[`X~OPXO~Oc`O~OQaOcbO~OfcO~OfdO~OceO~ORUObPOeROgSOW`PX`P~ORUObPOeROgSOZ`P[`P~OWhOXhO~OZiO[iO~O",goto:`!ZePPPPPfflPPlPPrPPz!TPP!TXQOVcdXTOVcdUVOcdR_VQXOQfcRgdXUOVcd`,nodeNames:`⚠ Feel FeelBlock SimpleTextBlock Feelers Insert EmptyInsert ConditionalSpanner ConditionalSpannerClose ConditionalSpannerCloseNl LoopSpanner LoopSpannerClose LoopSpannerCloseNl`,maxTerm:23,propSources:[g],skippedNodes:[0],repeatNodeCount:1,tokenData:"%X~RR!_!`[#o#pa#q#r$r~aO_~~dP#o#pg~lQb~str!P!Q!{~uQ#]#^{#`#a!^~!OP#Y#Z!R~!UPpq!X~!^Oe~~!aP#c#d!d~!gP#c#d!j~!mP#d#e!p~!sPpq!v~!{Og~~#OQ#]#^#U#`#a#u~#XP#Y#Z#[~#_P#q#r#b~#eP#q#r#h~#mPW~YZ#p~#uOX~~#xP#c#d#{~$OP#c#d$R~$UP#d#e$X~$[P#q#r$_~$bP#q#r$e~$jPZ~YZ$m~$rO[~R$uP#q#r$xR%PPcPfQYZ%SQ%XOfQ",tokenizers:[0,1,h,p,m],topRules:{Feelers:[0,4]},tokenPrec:0});function buildSimpleTree(e,t){let n=[{name:`Root`,children:[]}],isLeafNode=e=>[`SimpleTextBlock`,`Feel`,`FeelBlock`].includes(e.type.name);return e.iterate({enter:e=>{let r={name:e.type.name,children:[]};isLeafNode(e)&&(r.content=t.slice(e.from,e.to)),n.push(r)},leave:e=>{let t=n.pop(),r=n[n.length-1];t.parent=r,r.children.push(t)}}),n[0].children[0]}export{libsTranslate as a,u as i,_ as n,d as r,buildSimpleTree as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ed25519-DTYhEcYX.js","./rolldown-runtime-B8BYMn-z.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import"./rolldown-runtime-B8BYMn-z.js";import{_ as e,d as t,m as n,r,u as i}from"./vendor-NJP34MHU.js";import{i as a}from"./translator-B2N3PQBL.js";import{t as o}from"./preload-helper-VRuDKI9K.js";import{A as s,B as c,D as l,E as u,F as d,L as f,M as p,O as m,P as h,R as g,S as _,T as v,V as y,_ as b,a as x,b as ee,c as te,d as ne,f as S,g as C,h as w,i as T,j as E,k as D,o as O,p as k,r as A,s as j,u as M,w as N,y as P,z as F}from"./frontend-caI7mOAL.js";import{Qt as I,n as L}from"./bridgeInstance-DQk-c8L1.js";import{n as R}from"./dialog-CtGB1LHI.js";import{a as z,i as B,t as V}from"./httpHost-Dqit__mm.js";function codeNamesOf(e){let t={};for(let{kind:n,value:r}of e)t[n]=[...t[n]??[],r];return t}var re=`Penstock`,H=/<([a-zA-Z0-9_.-]+:)?definitions\b(?:[^>"']|"[^"]*"|'[^']*')*>/;function setAttribute(e,t,n){let r=e.replace(RegExp(`\\s${t}\\s*=\\s*(?:"[^"]*"|'[^']*')`),``);return n===null?r:r.replace(/(\/?)>$/,(e,r)=>` ${t}="${I(n)}"${r}>`)}function stampExporter(e,t){let n=H.exec(e);if(!n)return e;let r=n[0],i=setAttribute(setAttribute(r,`exporterVersion`,t||null),`exporter`,re);return e.slice(0,n.index)+i+e.slice(n.index+r.length)}function claimsOf(e){if(!e||typeof e!=`object`||e.v!==1||e.tier!==`pro`&&e.tier!==`team`||e.source!==`activation`&&e.source!==`trial`&&e.source!==`pipeline`||typeof e.machine!=`string`||!Number.isFinite(e.iat)||!Number.isFinite(e.exp))return null;for(let t of[`keyId`,`activationId`])if(e[t]!==void 0&&typeof e[t]!=`string`)return null;return e.trialStart!==void 0&&!Number.isFinite(e.trialStart)?null:e}var U=[{id:`k-2026-10`,key:`oyaZ47qT9fgTkP_iQDb-rscHvyUIY4BwAWAbNwmZnIc`}],W=864e5,G=/^[A-Za-z0-9_-]+$/,K=32,q=64;function decode(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}async function nativeVerify(e,t,n){try{let r=await crypto.subtle.importKey(`raw`,e,`Ed25519`,!1,[`verify`]);return await crypto.subtle.verify(`Ed25519`,r,n,t)}catch(e){return e instanceof DOMException&&e.name===`NotSupportedError`&&null}}async function scriptVerify(e,t,n){try{let{verifyAsync:r}=await o(async()=>{let{verifyAsync:e}=await import(`./ed25519-DTYhEcYX.js`);return{verifyAsync:e}},__vite__mapDeps([0,1]),import.meta.url);return await r(n,t,e)}catch{return!1}}async function verifyEd25519(e,t,n,r=`native`){if(e.length!==K||n.length!==q)return!1;if(r===`native`){let r=await nativeVerify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(n));if(r!==null)return r}return scriptVerify(e,t,n)}async function verifyLicenseToken(e,t){if(typeof e!=`string`)return{status:`invalid`,reason:`malformed`};let n=e.split(`.`);if(n.length!==2||!G.test(n[0])||!G.test(n[1]))return{status:`invalid`,reason:`malformed`};let r;try{r=decode(n[1])}catch{return{status:`invalid`,reason:`malformed`}}let i=new TextEncoder().encode(n[0]),a=!1;for(let e of t.keys??U){let n;try{n=decode(e.key)}catch{continue}if(await verifyEd25519(n,i,r,t.engine)){a=!0;break}}if(!a)return{status:`invalid`,reason:`signature`};let o;try{o=claimsOf(JSON.parse(new TextDecoder().decode(decode(n[0]))))}catch{o=null}return o?o.machine===t.machine?o.iat*1e3>t.now+W?{status:`invalid`,reason:`future`}:!Number.isFinite(t.now)||t.now>=o.exp*1e3?{status:`expired`,claims:o}:{status:`valid`,claims:o}:{status:`invalid`,reason:`machine`}:{status:`invalid`,reason:`malformed`}}async function tokenTier(e,t,n={}){if(!e||!t)return`FREE`;let r=await verifyLicenseToken(e,{machine:t,now:n.now??Date.now(),keys:n.keys});return r.status!==`valid`||r.claims.source===`pipeline`?`FREE`:r.claims.tier===`team`?`TEAM`:`PRO`}async function verifiedLicense(e,t={}){return e?{tier:await tokenTier(e.token,e.machine,t),detail:e.detail,trialDaysLeft:e.trialDaysLeft}:null}var AgentsFailure=class extends Error{status;constructor(e,t){super(e),this.status=t}};function statusOf(e){return e?.response?.status??null}async function answered(e){try{return await e}catch(e){throw new AgentsFailure(await z(e),statusOf(e))}}function reasonOf(e){return e?{key:e.key,params:e.params??{},detail:e.detail}:null}function entryOf(e){return{id:e.id,name:e.name,version:e.version??null,description:e.description,website:e.website??null,repository:e.repository??null,license:e.license??null,icon:e.icon??null,source:e.source,installed:e.installed,installedVia:e.installedVia??null,installedVersion:e.installedVersion??null,updateAvailable:e.updateAvailable,enabled:e.enabled,how:e.how,blocked:e.blocked??null,install:e.install??null,job:e.job?{kind:e.job.kind,state:e.job.state,percent:e.job.percent??null,error:reasonOf(e.job.error)}:null,options:e.options?{readAt:e.options.readAt,options:e.options.options.map(e=>({id:e.id,name:e.name,category:e.category??null,current:e.current,values:e.values.map(e=>({id:e.id,name:e.name}))}))}:null,chosen:e.chosen??{}}}function catalogOf(e){return{agents:e.agents.map(entryOf),updated:e.updated??null,source:e.source,stale:e.stale,node:e.node,uv:e.uv,busy:e.busy,refreshError:reasonOf(e.refreshError)}}function httpAgentsHost(e){return{catalog:async()=>catalogOf(await answered(e.getAgentCatalog())),refresh:async()=>catalogOf(await answered(e.refreshAgentCatalog())),install:async t=>entryOf(await answered(e.installAgent({agentId:t}))),uninstall:async t=>entryOf(await answered(e.uninstallAgent({agentId:t}))),turn:async(t,n)=>entryOf(await answered(e.turnAgent({agentId:t,turnAgentRequest:{enabled:n}}))),refreshModels:async t=>entryOf(await answered(e.refreshAgentModels({agentId:t}))),choose:async(t,n,r)=>entryOf(await answered(e.chooseAgentOption({agentId:t,chooseAgentOptionRequest:{category:n,value:r}}))),openSettings:async()=>{try{return await e.openAgentSettings(),!0}catch(e){if(statusOf(e)===501)return!1;throw new AgentsFailure(await z(e),statusOf(e))}}}}function coreTypesOf(e){return(e??[]).map(e=>{let t=e.kind===ne.ENUM?`enum`:`class`;return{name:e.name,kind:t,fields:e.fields.map(e=>({name:e.name,type:e.type??null,serialised:e.serialised})),constants:e.constants,extends:e._extends??null,open:e.open}})}function inputOf(e){return{name:e.name,type:e.type,...e.choices?{choices:e.choices}:{}}}function workerOf(e){return{binding:e.binding,value:e.value,engine:e.engine,source:e.source,name:e.name,className:e.className??null,packageName:e.packageName??null,inputs:e.inputs.map(inputOf),outputs:e.outputs.map(inputOf),errors:e.errors,file:e.file,line:e.line,offset:e.offset,end:e.end}}function classOf(e){return{path:e.path,offset:e.offset,end:e.end,line:e.line,className:e.className,packageName:e.packageName??null,shape:e.shape,reads:e.reads,writes:e.writes,errors:e.errors.map(e=>({code:e.code,...e.message===void 0?{}:{message:e.message}})),usesBusinessKey:e.usesBusinessKey,usesEngineServices:e.usesEngineServices,readsAllVariables:e.readsAllVariables}}function codeStructureOf(e){return{workers:e.workers.map(workerOf),classes:e.classes.map(classOf),camunda7Imports:e.camunda7Imports.map(e=>({path:e.path,names:e.names}))}}var SaveRefused=class extends Error{name=`SaveRefused`};function isSaveRefused(e){return e instanceof Error&&e.name===`SaveRefused`}var J=250,Y=18e5/J;function waitFor(e,t){return new Promise(n=>{if(t?.aborted){n();return}let finish=()=>{clearTimeout(r),t?.removeEventListener(`abort`,finish),n()},r=setTimeout(finish,e);t?.addEventListener(`abort`,finish,{once:!0})})}async function awaitChoice(e,t,n=e=>waitFor(J,e),r){let i=e??{answer:`CANCEL`};for(let e=0;i?.answer===`PENDING`&&e<7200&&(await n(r),!r?.aborted);e+=1)i=await t()??{answer:`CANCEL`};return i?.answer===`PENDING`&&console.error(r?.aborted?a(`app.platform.theConversionPreviewWasGiven`):a(`app.platform.theConversionPreviewStayedUnanswered`,{seconds:Math.round(Y*J/1e3)})),i?.answer===`CONVERT`&&i.folder?{choice:`CONVERT`,folder:i.folder,replace:i.replace===!0}:{choice:`CANCEL`,folder:``,replace:!1}}var X=/\.(bpmn(\.xml|20\.xml)?|dmn|form)$/i;function baseOf(e){return((e??``).split(/[\\/]/).pop()??``).replace(X,``)}function exportFileName(e,t,n){let r=(t??``).replace(/^\.+/,``),i=baseOf(e)||n||`untitled`;return r?`${i}.${r}`:i}var Z={ERROR:`error`,INFO:`info`},ie=15e3;function Notification({id:e,message:n,type:o,action:s,onClose:c}){i(()=>{let t=setTimeout(()=>{c(e)},ie);return()=>clearTimeout(t)},[e,c]);let l=t(t=>{t?.preventDefault?.(),c(e)},[e,c]);return r(`div`,{className:`notification ${o}`,role:o===Z.ERROR?`alert`:`status`,"aria-live":o===Z.ERROR?`assertive`:`polite`,children:[r(`span`,{className:`notification-message`,children:n}),s&&r(`button`,{className:`notification-action`,onClick:()=>{try{s.run()}catch(e){console.error(e)}c(e)},children:s.label}),r(`button`,{className:`notification-close`,onClick:l,"aria-label":a(`app.notifications.closeNotification`),title:a(`app.common.close`),children:r(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:r(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]})}function NotificationContainer({notifications:e,onClose:t}){return r(`div`,{className:`notification-container`,children:(Array.isArray(e)?e:[]).map(e=>r(Notification,{id:e.id,message:e.message,action:e.action,type:e.type,onClose:t},e.id))})}var ae=5,NotificationManager=class{container=null;notifications=[];constructor(){this.initContainer()}initContainer(){if(typeof document>`u`)return;let e=document.getElementById(`notification-root`);e?this.container=e:document.body&&(this.container=document.createElement(`div`),this.container.id=`notification-root`,document.body.appendChild(this.container))}show(e,t=Z.INFO,n){let r=typeof e==`string`?e:String(e??``),i=`notification-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,a={id:i,message:r,type:t,timestamp:Date.now(),action:n};return this.notifications.length>=ae&&this.notifications.shift(),this.notifications=[...this.notifications,a],this.renderNotifications(),i}success(e){return this.show(e,Z.INFO)}error(e,t){return this.show(e,Z.ERROR,t)}info(e,t){return this.show(e,Z.INFO,t)}hide=e=>{this.notifications=this.notifications.filter(t=>t.id!==e),this.renderNotifications()};clear(){this.notifications=[],this.renderNotifications()}renderNotifications(){if(this.container||this.initContainer(),this.container)try{n(e(NotificationContainer,{notifications:this.notifications,onClose:this.hide}),this.container)}catch{}}},Q=new NotificationManager,oe={preDeploy:v.PRE_DEPLOY,postDeploy:v.POST_DEPLOY},$=400,HttpPlatformBridge=class{configApi;scriptApi;clipboardApi;fileChooserApi;fileSaverApi;fileReaderApi;previewApi;diffApi;deploymentApi;navigationApi;projectApi;viewApi;hostApi;licenseApi;themeApi;preferencesApi;connectorsApi;actionsApi;agentApi;actionsRefused=!1;config;constructor(e,t){let n=new c({basePath:e??void 0??`http://localhost:8080`,headers:{"Content-Type":`application/json`},fetchApi:t});this.config=n,this.configApi=new d(n),this.scriptApi=new te(n),this.clipboardApi=new f(n),this.fileChooserApi=new D(n),this.fileSaverApi=new l(n),this.fileReaderApi=new m(n),this.previewApi=new C(n),this.diffApi=new E(n),this.deploymentApi=new p(n),this.navigationApi=new P(n),this.projectApi=new M(n),this.viewApi=new T(n),this.hostApi=new _(n),this.licenseApi=new ee(n),this.themeApi=new j(n),this.preferencesApi=new b(n),this.connectorsApi=new h(n),this.actionsApi=new F(n),this.agentApi=new g(n)}async openDiff(e){await this.diffApi.openDiff({openDiffRequest:{title:e.title,path:e.path,before:e.before??``,after:e.after}})}agentHost(){return V(this.agentApi)}agentsHost(){return httpAgentsHost(this.agentApi)}async getConfig(){try{return await this.configApi.getConfig()}catch(e){return console.error(`Failed to get config:`,e),null}}async getPreviewDiff(){return this.previewApi.getPreviewDiff()}async getDeployTargets(e){try{let t=await this.deploymentApi.getDeployTargets({resource:e});return{active:t?.active??null,targets:Array.isArray(t?.targets)?t.targets:[]}}catch{return{active:null,targets:[]}}}async getDeploymentSettings(e){return this.deploymentApi.getDeploymentSettings({profile:e??void 0})}async saveDeploymentSettings(e){return this.deploymentApi.saveDeploymentSettings({deploymentSettings:e})}async saveConfig(e){let t={engine:e.engine,scriptType:e.scriptType,elementTemplates:e.elementTemplates??[]};await this.configApi.saveConfig({configSaveRequest:t})}getBpmnXml(){return window.appConfig?.bpmnXml??null}getBpmnFilePath(){return window.appConfig?.bpmnFilePath??null}async saveBpmnXml(e){let t=window.appConfig?.bpmnFilePath;if(!t)throw Error(`BPMN file path not configured`);let n=window.appConfig?.pluginVersion;try{await this.fileSaverApi.saveFile({fileSaveRequest:{path:t,content:stampExporter(e,n??``),isBase64:!1}})}catch(e){throw await refusalOf(e)??e}}async getClipboard(){try{return(await this.clipboardApi.getClipboard())?.text??null}catch(e){return console.error(`Failed to get clipboard:`,e),null}}async readClipboardNow(){return(await this.clipboardApi.getClipboard())?.text||null}async saveClipboard(e){if(e)try{await this.clipboardApi.saveClipboard({clipboardDto:{text:e}})}catch(e){console.error(`Failed to save clipboard:`,e)}}async saveClipboardImage(e){if(!e)return!1;try{return await this.clipboardApi.saveClipboardImage({clipboardImageDto:{png:e}}),!0}catch(e){return console.error(`Failed to save the image to the clipboard:`,e),!1}}async navigateToClass(e,t=`JAVA_CLASS`){if(!e)return!1;try{return await this.navigationApi.navigateToClass({classNavigationRequest:{reference:e,kind:t}}),!0}catch(e){return console.error(`Failed to open the class:`,e),!1}}async getProjectFiles(){try{let e=await this.projectApi.getProjectFiles();return{root:e?.root??``,files:e?.files??[],reports:e?.reports??[],sources:e?.sources,testCases:e?.testCases,templates:e?.templates}}catch{return{root:``,files:[],reports:[]}}}async findWorkerVariables(){try{let e=await this.projectApi.findWorkerVariables(),t=e?.variableChecks;return{variables:e?.variables??[],fetches:e?.fetches??[],implicitJobTypes:e?.implicitJobTypes??[],types:coreTypesOf(e?.types),variableChecks:t&&{check:t.check,inputs:t.inputs,entitled:t.entitled},clientFacts:e?.clientFacts}}catch(e){return console.error(`Penstock could not read the variables the code writes:`,e),{variables:[],fetches:[],implicitJobTypes:[]}}}async findCode(e,t=!1,n=!1){try{let r=await this.projectApi.findCode({codeQuery:{subjects:e.map(e=>({kind:w[e.kind],value:e.value})),names:t,facts:n}}),i=new Map,a=new Map;return(r?.results??[]).forEach(e=>{let t=`${e.kind}:${e.value}`;i.set(t,(e?.links??[]).map(e=>({handle:e.handle,label:e.label,icon:e.icon,implements:e.implementation,test:e.test,declaration:e.declaration}))),a.set(t,(e.places??[]).map(e=>({file:e.path,line:e.line,offset:e.offset})))}),{precise:r?.precise??!1,links:i,places:a,names:t?codeNamesOf(r?.names??[]):void 0,structure:r?.facts?codeStructureOf(r.facts):void 0,clientFacts:r?.clientFacts}}catch(e){return console.error(`Penstock could not find the code:`,e),{precise:!1,links:new Map}}}async publishCodeLenses(e){try{let t=(e.workers??[]).map(e=>({...e,kind:w[e.kind]}));await this.viewApi.publishCodeLenses({codeLenses:{workers:t,processes:e.processes??[]}})}catch(e){console.warn(`Failed to publish code lenses:`,e)}}async publishToolWindow(e,t){try{let action=e=>({...e,keys:e.keys&&O[e.keys]}),node=e=>({...e,expand:e.expand&&x[e.expand],actions:e.actions?.map(action),children:e.children?.map(node)});await this.viewApi.publishToolWindow({toolWindowModel:{roots:(e??[]).map(node),toolbar:(t??[]).map(action)}})}catch(e){console.warn(`Failed to publish tool window:`,e)}}async publishActions(e){try{await this.actionsApi.publishActions({publishedActions:{actions:e}})}catch(e){this.actionsRefused||console.warn(`The host did not take the list of actions:`,e),this.actionsRefused=!0}}onRunAction(e){let t=window;return t.penstockRunAction=e,()=>{t.penstockRunAction===e&&delete t.penstockRunAction}}async getDebugState(){try{return(await this.hostApi.getDebugState())?.positions??[]}catch{return[]}}async revealElement(e,t){try{await this.hostApi.revealElement({revealRequest:{path:e,elementId:t}})}catch(e){console.warn(`Failed to reveal element:`,e)}}async openAsText(e,t){try{await this.hostApi.revealElement({revealRequest:{path:e,text:!0,line:t}})}catch(e){console.warn(`Failed to open as text:`,e)}}async openCode(e,t,n){try{await this.hostApi.openCode({codeHandles:{handles:e,title:t,usages:n}})}catch(e){console.warn(`Failed to open code:`,e)}}async runTestHandles(e,t,n){try{await this.hostApi.runTestHandles({testHandles:{handles:e,title:t,debug:n}})}catch(e){console.warn(`Failed to run test handles:`,e)}}async askEngine(e,t,n,r){try{let i=await this.hostApi.askEngine({engineRequest:{profile:e,resource:n,method:u[t.method],path:t.path,body:t.body,parts:t.parts,testRun:r}});return{status:i.status,body:i.body}}catch(e){return{status:0,body:await z(e)}}}hookRunsInBackground=!0;async runHook(e,t,n,r,i){try{let a=await this.hostApi.runHook({hookRequest:{stage:oe[e],resources:t,profile:n,resource:r}});return await this.untilHookEnds(e,a.run,i)}catch(t){return{ok:!1,lines:[`hook ${e}: ${await z(t)}`]}}}async untilHookEnds(e,t,n){for(;;){if(n?.signal?.aborted)return await this.hostApi.cancelHook({run:t}).catch(()=>void 0),{ok:!1,lines:[a(`app.deploy.hookCancelled`,{stage:e})]};let r=await this.hostApi.hookState({run:t});if(r.status===N.RUNNING)n?.onLines?.(r.lines),await new Promise(e=>setTimeout(e,$));else return{ok:r.ok,lines:r.lines}}}async recordDeployment(e,t){await this.hostApi.recordDeployment({deploymentRecord:{profile:e,resources:t}})}async confirmWithUser(e){try{return(await this.hostApi.confirmWithUser({hostQuestion:e})).accepted}catch(e){return console.error(`Penstock could not ask the host to confirm:`,e),!1}}async getDialogButtonOrder(){try{return R((await this.hostApi.getDialogButtonOrder()).primary)}catch(e){return B(e)||console.error(`Failed to read the dialog button order:`,e),R(null)}}async previewMigration(e,t){return awaitChoice(await this.hostApi.previewMigration({migrationPreview:e}),async()=>this.hostApi.getMigrationAnswer(),void 0,t)}async sendTestOutput(e,t,n){try{await this.hostApi.sendTestOutput({testOutput:{run:e,lines:t,finished:n}})}catch(e){console.warn(`Failed to send test output:`,e)}}async saveRunTrace(e,t,n){try{return(await this.hostApi.saveRunTrace({runTrace:{runId:e,name:t,content:n}}))?.path??``}catch(e){throw console.warn(`Failed to save run trace:`,e),e}}async openExternalLink(e){try{await this.hostApi.openExternalLink({externalLink:{url:e}})}catch(e){console.warn(`Failed to open external link:`,e)}}async notifyUser(e,t){try{await this.hostApi.notifyUser({hostMessage:{text:e,error:t}})}catch(n){console.warn(`Failed to notify user:`,n),t?Q.error(e):Q.info(e)}}async offerLinkedRename(e){try{let t=await this.hostApi.offerLinkedRename({linkedRenameOffer:e});return{places:t?.places??0,offered:t?.offered??!1,summary:t?.summary,detail:t?.detail}}catch{return{places:0,offered:!1}}}async reportSnapshot(e){try{let t=(e??[]).map(e=>({...e,kind:w[e.kind]}));await this.projectApi.reportSnapshot({projectSnapshot:{targets:t}})}catch(e){console.warn(`Failed to report snapshot:`,e)}}async reportFindings(e){try{await this.projectApi.reportFindings({projectFindings:{checked:(e??[]).map(e=>({path:e.path,stamp:e.stamp,findings:(e.findings??[]).map(e=>({...e,family:se[e.family],severity:e.severity===`error`?k.ERROR:k.WARNING}))}))}})}catch(e){console.warn(`Failed to report findings:`,e)}}async getLicense(){try{let e=await this.licenseApi.getLicense(),t=await verifiedLicense(e);return t&&{...e,tier:t.tier,token:null}}catch(e){return console.error(`Failed to read the licence:`,e),null}}async getTheme(){try{return await this.themeApi.getTheme()}catch(e){return console.error(`Failed to read the look and feel's colours:`,e),null}}async getPreferences(){try{return await this.preferencesApi.getPreferences()}catch(e){return console.error(`Failed to read the preferences:`,e),null}}async savePreferences(e){try{await this.preferencesApi.savePreferences({preferences:e})}catch(e){console.error(`Failed to save the preferences:`,e)}}async requestFeature(e){try{let t=await this.licenseApi.requestFeature({featureRequest:{feature:e}});if(t.allowed!==!0)return!1;let n=await this.licenseApi.getLicense();return await tokenTier(t.token,n.machine)!==`FREE`}catch(e){return console.error(`Failed to ask for a feature:`,e),!1}}async showLicenceOffer(e,t){try{return(await this.licenseApi.showLicenceOffer({licenceOfferRequest:{reason:e,surface:t}})).opened===!0}catch(e){return console.error(`Failed to open the licence screen:`,e),!1}}async openScriptFile(e,t,n,r,i,a){try{let o={scriptFormat:e,scriptValue:t,slot:n,title:r,variables:i,diagramPath:a};await this.scriptApi.createScript({scriptCreateRequest:o})}catch(e){console.error(`Failed to open script file:`,e)}}async reportScriptSlot(e,t){try{await this.scriptApi.reportScriptSlot({scriptSlotValue:{slot:e,value:t}})}catch(e){console.error(`Failed to report the script to its tab:`,e)}}async readFile(e){return(await this.fileReaderApi.readFile({fileReadRequest:{path:e}})).content}async readFileBytes(e){return base64ToUint8((await this.fileReaderApi.readFile({fileReadRequest:{path:e,asBase64:!0}})).content)}async readFileIfPresent(e){try{return await this.readFile(e)}catch(e){if(e instanceof y&&e.response.status===404)return null;throw e}}async createProjectFiles(e,t){await this.fileSaverApi.createProjectFiles({createProjectFilesRequest:{root:e,files:t}})}async saveFile(e,t,n){try{await this.fileSaverApi.saveFile({fileSaveRequest:{path:e,content:t,isBase64:n?.isBase64??!1}})}catch(e){throw Error(await z(e))}}async chooseFile(e,t){try{let n={title:t?.title??a(`app.files.saveTitle`,{extension:e.toUpperCase()}),description:t?.description,extension:e,mode:t?.mode===`open`?s.OPEN:s.SAVE,defaultFileName:t?.defaultFileName??exportFileName(this.getBpmnFilePath(),e,a(`app.export.untitledFile`)),defaultDirectory:t?.defaultDirectory,selectFiles:t?.selectFiles,selectFolders:t?.selectFolders,multiSelect:t?.multiSelect,recursive:t?.recursive},r=await this.fileChooserApi.chooseFile({fileChooserRequest:n});return r?.success&&r.paths?.length?r.paths[0]:null}catch(e){return console.error(`Failed to choose file:`,e),null}}async exportSvg(e){try{let t=await this.chooseFile(`svg`,{title:a(`app.files.exportAs`,{format:`SVG`}),mode:`save`});t&&await this.saveFile(t,e)}catch(e){throw console.error(`Failed to export SVG:`,e),e}}async exportPng(e){try{let t=await this.chooseFile(`png`,{title:a(`app.files.exportAs`,{format:`PNG`}),mode:`save`});if(t){let n=await blobToBase64(e);await this.saveFile(t,n,{isBase64:!0})}}catch(e){throw console.error(`Failed to export PNG:`,e),e}}async exportPdf(e){try{let t=await this.chooseFile(`pdf`,{title:a(`app.files.exportAs`,{format:`PDF`}),mode:`save`});if(t){let n=await blobToBase64(e);await this.saveFile(t,n,{isBase64:!0})}}catch(e){throw console.error(`Failed to export PDF:`,e),e}}async fetchConnectorUrl(e){try{let t=await this.connectorsApi.fetchConnectorUrl({connectorFetchRequest:{url:e}});return{status:t?.status??500,body:base64ToUint8(t?.body),failure:t?.failure??null}}catch(e){return{status:500,body:new Uint8Array,failure:await z(e)}}}async connectorFile(e,t,n,r){try{let i=await this.connectorsApi.connectorFile({connectorFileRequest:{op:e,path:t,content:n==null?void 0:uint8ToBase64(n),dest:r}});return{content:i?.content==null?null:base64ToUint8(i.content),entries:i?.entries??null,pathExists:i?.pathExists??null}}catch(e){throw Error(await connectorFailure(e))}}dispose(){}};function uint8ToBase64(e){if(!e||e.length===0)return``;let t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode(...e.subarray(n,n+32768)));return btoa(t.join(``))}function base64ToUint8(e){if(!e)return new Uint8Array;try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch{return new Uint8Array}}async function refusalOf(e){if(!(e instanceof y)||e.response.status!==400)return null;let t=await e.response.json().catch(()=>null);return typeof t?.message==`string`&&t.message!==``?new SaveRefused(t.message):null}async function connectorFailure(e){if(e instanceof y){let t=await e.response.json().catch(()=>null);return typeof t?.message==`string`?t.message:a(`app.files.connectorsFailed`,{status:e.response.status})}return e instanceof Error?e.message:String(e)}function blobToBase64(e){return new Promise((t,n)=>{if(!e){n(Error(`Nothing to save`));return}let r=new FileReader;r.onerror=()=>n(r.error??Error(`Could not read the picture`)),r.onloadend=()=>{if(r.error||typeof r.result!=`string`)return;let e=r.result.split(`,`);t(e.length>1?e[1]:e[0])};try{r.readAsDataURL(e)}catch(e){n(e)}})}var se={drawing:S.DRAWING,bpmnlint:S.BPMNLINT,compat:S.COMPAT,engine:S.ENGINE,table:S.TABLE,form:S.FORM,file:S.FILE},ce=new Set([`compare`,`codeBridge`]);function offeredByDefault(e){return!ce.has(e)}function hostSupports(e,t){return e?.supports?e.supports(t):offeredByDefault(t)}function isHostResponse(e){let t=e;return typeof t?.id==`number`&&typeof t.status==`number`}function hostFetch(e,t){let n=new Map,r=0,i=!1,listener=e=>{isHostResponse(e.data)&&n.get(e.data.id)?.answer(e.data)};return t.addEventListener(`message`,listener),{fetch:(t,o)=>new Promise((s,c)=>{if(i){c(Error(a(`app.platform.theHostConnectionIsClosed`)));return}let l=++r,u=o?.signal??void 0;if(u?.aborted){c(new DOMException(a(`app.platform.theRequestWasCancelled`),`AbortError`));return}let d;try{d=new URL(t,`http://host`)}catch{c(Error(a(`app.platform.theRequestWasCancelled`)));return}let onAbort=()=>{n.delete(l);try{e.postMessage({cancel:l})}catch{}c(new DOMException(a(`app.platform.theRequestWasCancelled`),`AbortError`))};u?.addEventListener(`abort`,onAbort,{once:!0}),n.set(l,{answer:e=>{n.delete(l),u?.removeEventListener(`abort`,onAbort),s(new Response(e.body,{status:e.status}))},close:()=>{u?.removeEventListener(`abort`,onAbort),c(Error(a(`app.platform.theHostConnectionIsClosed`)))}});let f={};try{f=Object.fromEntries(new Headers(o?.headers).entries())}catch{}try{e.postMessage({id:l,method:o?.method??`GET`,path:d.pathname,query:d.search,headers:f,body:typeof o?.body==`string`?o.body:null})}catch(e){n.delete(l),c(e instanceof Error?e:Error(String(e)))}}),dispose:()=>{i=!0,t.removeEventListener(`message`,listener);let e=[...n.values()];n.clear(),e.forEach(e=>e.close())}}}var le=new Set([`vscode-light`,`vscode-high-contrast-light`]);function themeOf(e){if(!e)return`dark`;let t=e.dataset?.vscodeThemeKind;return t?le.has(t)?`light`:`dark`:e.classList.contains(`vscode-light`)||e.classList.contains(`vscode-high-contrast-light`)?`light`:`dark`}function signatureOf(e){let t=e.documentElement.style;return[e.body?.dataset?.vscodeThemeKind??``,e.body?.dataset?.vscodeThemeId??``,t.getPropertyValue(`--vscode-editor-background`),t.getPropertyValue(`--vscode-editor-foreground`),t.getPropertyValue(`--vscode-focusBorder`)].join(`|`)}function watchHostTheme(e,t,n,r=50){let i=signatureOf(e),a,settle=()=>{a=void 0;let t=signatureOf(e);t!==i&&(i=t,n(themeOf(e.body)))},o=new t(()=>{a!==void 0&&clearTimeout(a),a=setTimeout(settle,r)});return e.body&&o.observe(e.body,{attributes:!0,attributeFilter:[`class`,`data-vscode-theme-kind`,`data-vscode-theme-id`]}),o.observe(e.documentElement,{attributes:!0,attributeFilter:[`style`]}),()=>{a!==void 0&&clearTimeout(a),o.disconnect()}}function resolveVsCodeApi(){let e=typeof window<`u`?window:globalThis;return e.__vscodeApi?e.__vscodeApi:typeof e.acquireVsCodeApi==`function`?(e.__vscodeApi=e.acquireVsCodeApi(),e.__vscodeApi):typeof acquireVsCodeApi==`function`?(e.__vscodeApi=acquireVsCodeApi(),e.__vscodeApi):{postMessage:()=>{},getState:()=>void 0,setState:()=>{}}}var ue=1e3,de=new Set([`editorTheme`]),VscodePlatformBridge=class extends HttpPlatformBridge{transport;vscodeApi;stopController=new AbortController;stopWatchingTheme=null;documentListeners=new Set;actionHandlers=new Set;runTraceListeners=new Set;lastSent=null;constructor(e,t){let n=hostFetch(e??resolveVsCodeApi(),t??(typeof window<`u`?window:globalThis));super(`http://host`,n.fetch),this.transport=n,this.vscodeApi=new A(this.config),typeof document<`u`&&typeof MutationObserver<`u`&&(this.stopWatchingTheme=watchHostTheme(document,MutationObserver,e=>{window.setTheme?.(e)})),this.pumpEvents()}async pumpEvents(){let e=this.stopController.signal;for(;!e.aborted;)try{this.handleEvent(await this.vscodeApi.nextHostEvent({signal:e}))}catch{if(e.aborted)return;await new Promise(e=>setTimeout(e,ue))}}supports(e){return!de.has(e)&&offeredByDefault(e)}async saveClipboardImage(e){if(!e)return!1;let t=typeof navigator<`u`?navigator.clipboard:void 0;if(!t||typeof ClipboardItem>`u`)return!1;try{let n=Uint8Array.from(atob(e),e=>e.charCodeAt(0));return await t.write([new ClipboardItem({"image/png":new Blob([n],{type:`image/png`})})]),!0}catch(e){return console.error(`Failed to put the image on the clipboard:`,e),!1}}handleEvent(e){if(!e||!e.type)return;let t=typeof window<`u`?window:globalThis;switch(e.type){case`revealElement`:typeof t.revealElement==`function`?t.revealElement(e.elementId):t.pendingReveal=e.elementId;return;case`documentReload`:if(e.xml===this.lastSent)return;this.lastSent=null,t.appConfig&&(t.appConfig.bpmnXml=e.xml),this.documentListeners.forEach(t=>{try{t(e.xml)}catch(e){console.error(`Document listener error:`,e)}});return;case`scriptSlotChanged`:try{t.scriptSlotChanged?.(e.slot,e.value)}catch{}return;case`scriptTabsChanged`:try{t.scriptTabsChanged?.(e.slots)}catch{}return;case`debugPosition`:typeof t.showDebugPosition==`function`?t.showDebugPosition(e):t.pendingDebug=e;return;case`debugCleared`:t.pendingDebug=void 0,typeof t.clearDebugPosition==`function`&&t.clearDebugPosition();return;case`codeChanged`:try{typeof t.codeChanged==`function`&&t.codeChanged()}catch{}return;case`runAction`:this.actionHandlers.forEach(t=>{try{t(e.id)}catch(e){console.error(`Action handler error:`,e)}});return;case`openRunTrace`:this.runTraceListeners.forEach(t=>{try{t(e.path)}catch(e){console.error(`Run trace listener error:`,e)}});return;case`projectChanged`:try{t.coverageChanged?.()}catch{}return;case`openChat`:typeof t.penstockOpenChat==`function`?t.penstockOpenChat(e.chatId):t.pendingOpenChat=e.chatId;return}}onDocumentChanged(e){return this.documentListeners.add(e),()=>this.documentListeners.delete(e)}onRunTrace(e){return this.runTraceListeners.add(e),()=>this.runTraceListeners.delete(e)}onRunAction(e){return this.actionHandlers.add(e),()=>this.actionHandlers.delete(e)}async undo(){await this.vscodeApi.undo()}async redo(){await this.vscodeApi.redo()}async saveBpmnXml(e){let t=typeof window<`u`?window:globalThis;t.appConfig&&(t.appConfig.bpmnXml=e),this.lastSent=e,await this.vscodeApi.saveDocumentText({documentText:{xml:e}})}async getTheme(){return null}async reportFindings(){}dispose(){try{this.stopController.abort()}catch{}try{this.stopWatchingTheme?.()}catch{}this.stopWatchingTheme=null;try{this.transport.dispose()}catch{}this.documentListeners.clear(),this.actionHandlers.clear(),this.runTraceListeners.clear()}};function runsInVsCode(){if(typeof window>`u`)return!1;let e=window;return typeof e.acquireVsCodeApi==`function`||!!e.__vscodeApi}L(()=>runsInVsCode()?new VscodePlatformBridge:new HttpPlatformBridge);export{isSaveRefused as a,exportFileName as i,HttpPlatformBridge as n,verifiedLicense as o,Q as r,stampExporter as s,hostSupports as t};
|
|
2
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{_ as e,d as t,m as n,r,u as i}from"./vendor-NJP34MHU.js";import{i as a}from"./translator-OIpY8kTG.js";import{t as o}from"./preload-helper-VRuDKI9K.js";import{A as s,B as c,D as l,E as u,F as d,L as f,M as p,O as m,P as h,R as g,S as _,T as v,V as y,_ as b,a as x,b as ee,c as te,d as ne,f as S,g as C,h as w,i as T,j as E,k as D,o as O,p as k,r as A,s as j,u as M,w as N,y as P,z as F}from"./frontend-Y1MvD_Uo.js";import{Qt as I,n as L}from"./bridgeInstance-BZBhe5hF.js";import{n as R}from"./dialog-LcHsiQKJ.js";import{a as z,i as B,t as V}from"./httpHost-CnF86WJB.js";function codeNamesOf(e){let t={};for(let{kind:n,value:r}of e)t[n]=[...t[n]??[],r];return t}var re=`Penstock`,H=/<([a-zA-Z0-9_.-]+:)?definitions\b(?:[^>"']|"[^"]*"|'[^']*')*>/;function setAttribute(e,t,n){let r=e.replace(RegExp(`\\s${t}\\s*=\\s*(?:"[^"]*"|'[^']*')`),``);return n===null?r:r.replace(/(\/?)>$/,(e,r)=>` ${t}="${I(n)}"${r}>`)}function stampExporter(e,t){let n=H.exec(e);if(!n)return e;let r=n[0],i=setAttribute(setAttribute(r,`exporterVersion`,t||null),`exporter`,re);return e.slice(0,n.index)+i+e.slice(n.index+r.length)}function claimsOf(e){if(!e||typeof e!=`object`||e.v!==1||e.tier!==`pro`&&e.tier!==`team`||e.source!==`activation`&&e.source!==`trial`&&e.source!==`pipeline`||typeof e.machine!=`string`||!Number.isFinite(e.iat)||!Number.isFinite(e.exp))return null;for(let t of[`keyId`,`activationId`])if(e[t]!==void 0&&typeof e[t]!=`string`)return null;return e.trialStart!==void 0&&!Number.isFinite(e.trialStart)?null:e}var U=[{id:`k-2026-10`,key:`oyaZ47qT9fgTkP_iQDb-rscHvyUIY4BwAWAbNwmZnIc`}],W=864e5,G=/^[A-Za-z0-9_-]+$/,K=32,q=64;function decode(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}async function nativeVerify(e,t,n){try{let r=await crypto.subtle.importKey(`raw`,e,`Ed25519`,!1,[`verify`]);return await crypto.subtle.verify(`Ed25519`,r,n,t)}catch(e){return e instanceof DOMException&&e.name===`NotSupportedError`&&null}}async function scriptVerify(e,t,n){try{let{verifyAsync:r}=await o(async()=>{let{verifyAsync:e}=await import(`./ed25519-DTYhEcYX.js`);return{verifyAsync:e}},__vite__mapDeps([0,1]),import.meta.url);return await r(n,t,e)}catch{return!1}}async function verifyEd25519(e,t,n,r=`native`){if(e.length!==K||n.length!==q)return!1;if(r===`native`){let r=await nativeVerify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(n));if(r!==null)return r}return scriptVerify(e,t,n)}async function verifyLicenseToken(e,t){if(typeof e!=`string`)return{status:`invalid`,reason:`malformed`};let n=e.split(`.`);if(n.length!==2||!G.test(n[0])||!G.test(n[1]))return{status:`invalid`,reason:`malformed`};let r;try{r=decode(n[1])}catch{return{status:`invalid`,reason:`malformed`}}let i=new TextEncoder().encode(n[0]),a=!1;for(let e of t.keys??U){let n;try{n=decode(e.key)}catch{continue}if(await verifyEd25519(n,i,r,t.engine)){a=!0;break}}if(!a)return{status:`invalid`,reason:`signature`};let o;try{o=claimsOf(JSON.parse(new TextDecoder().decode(decode(n[0]))))}catch{o=null}return o?o.machine===t.machine?o.iat*1e3>t.now+W?{status:`invalid`,reason:`future`}:!Number.isFinite(t.now)||t.now>=o.exp*1e3?{status:`expired`,claims:o}:{status:`valid`,claims:o}:{status:`invalid`,reason:`machine`}:{status:`invalid`,reason:`malformed`}}async function tokenTier(e,t,n={}){if(!e||!t)return`FREE`;let r=await verifyLicenseToken(e,{machine:t,now:n.now??Date.now(),keys:n.keys});return r.status!==`valid`||r.claims.source===`pipeline`?`FREE`:r.claims.tier===`team`?`TEAM`:`PRO`}async function verifiedLicense(e,t={}){return e?{tier:await tokenTier(e.token,e.machine,t),detail:e.detail,trialDaysLeft:e.trialDaysLeft}:null}var AgentsFailure=class extends Error{status;constructor(e,t){super(e),this.status=t}};function statusOf(e){return e?.response?.status??null}async function answered(e){try{return await e}catch(e){throw new AgentsFailure(await z(e),statusOf(e))}}function reasonOf(e){return e?{key:e.key,params:e.params??{},detail:e.detail}:null}function entryOf(e){return{id:e.id,name:e.name,version:e.version??null,description:e.description,website:e.website??null,repository:e.repository??null,license:e.license??null,icon:e.icon??null,source:e.source,installed:e.installed,installedVia:e.installedVia??null,installedVersion:e.installedVersion??null,updateAvailable:e.updateAvailable,enabled:e.enabled,how:e.how,blocked:e.blocked??null,install:e.install??null,job:e.job?{kind:e.job.kind,state:e.job.state,percent:e.job.percent??null,error:reasonOf(e.job.error)}:null,options:e.options?{readAt:e.options.readAt,options:e.options.options.map(e=>({id:e.id,name:e.name,category:e.category??null,current:e.current,values:e.values.map(e=>({id:e.id,name:e.name}))}))}:null,chosen:e.chosen??{}}}function catalogOf(e){return{agents:e.agents.map(entryOf),updated:e.updated??null,source:e.source,stale:e.stale,node:e.node,uv:e.uv,busy:e.busy,refreshError:reasonOf(e.refreshError)}}function httpAgentsHost(e){return{catalog:async()=>catalogOf(await answered(e.getAgentCatalog())),refresh:async()=>catalogOf(await answered(e.refreshAgentCatalog())),install:async t=>entryOf(await answered(e.installAgent({agentId:t}))),uninstall:async t=>entryOf(await answered(e.uninstallAgent({agentId:t}))),turn:async(t,n)=>entryOf(await answered(e.turnAgent({agentId:t,turnAgentRequest:{enabled:n}}))),refreshModels:async t=>entryOf(await answered(e.refreshAgentModels({agentId:t}))),choose:async(t,n,r)=>entryOf(await answered(e.chooseAgentOption({agentId:t,chooseAgentOptionRequest:{category:n,value:r}}))),openSettings:async()=>{try{return await e.openAgentSettings(),!0}catch(e){if(statusOf(e)===501)return!1;throw new AgentsFailure(await z(e),statusOf(e))}}}}function coreTypesOf(e){return(e??[]).map(e=>{let t=e.kind===ne.ENUM?`enum`:`class`;return{name:e.name,kind:t,fields:e.fields.map(e=>({name:e.name,type:e.type??null,serialised:e.serialised})),constants:e.constants,extends:e._extends??null,open:e.open}})}function inputOf(e){return{name:e.name,type:e.type,...e.choices?{choices:e.choices}:{}}}function workerOf(e){return{binding:e.binding,value:e.value,engine:e.engine,source:e.source,name:e.name,className:e.className??null,packageName:e.packageName??null,inputs:e.inputs.map(inputOf),outputs:e.outputs.map(inputOf),errors:e.errors,file:e.file,line:e.line,offset:e.offset,end:e.end}}function classOf(e){return{path:e.path,offset:e.offset,end:e.end,line:e.line,className:e.className,packageName:e.packageName??null,shape:e.shape,reads:e.reads,writes:e.writes,errors:e.errors.map(e=>({code:e.code,...e.message===void 0?{}:{message:e.message}})),usesBusinessKey:e.usesBusinessKey,usesEngineServices:e.usesEngineServices,readsAllVariables:e.readsAllVariables}}function codeStructureOf(e){return{workers:e.workers.map(workerOf),classes:e.classes.map(classOf),camunda7Imports:e.camunda7Imports.map(e=>({path:e.path,names:e.names}))}}var SaveRefused=class extends Error{name=`SaveRefused`};function isSaveRefused(e){return e instanceof Error&&e.name===`SaveRefused`}var J=250,Y=18e5/J;function waitFor(e,t){return new Promise(n=>{if(t?.aborted){n();return}let finish=()=>{clearTimeout(r),t?.removeEventListener(`abort`,finish),n()},r=setTimeout(finish,e);t?.addEventListener(`abort`,finish,{once:!0})})}async function awaitChoice(e,t,n=e=>waitFor(J,e),r){let i=e??{answer:`CANCEL`};for(let e=0;i?.answer===`PENDING`&&e<7200&&(await n(r),!r?.aborted);e+=1)i=await t()??{answer:`CANCEL`};return i?.answer===`PENDING`&&console.error(r?.aborted?a(`app.platform.theConversionPreviewWasGiven`):a(`app.platform.theConversionPreviewStayedUnanswered`,{seconds:Math.round(Y*J/1e3)})),i?.answer===`CONVERT`&&i.folder?{choice:`CONVERT`,folder:i.folder,replace:i.replace===!0}:{choice:`CANCEL`,folder:``,replace:!1}}var X=/\.(bpmn(\.xml|20\.xml)?|dmn|form)$/i;function baseOf(e){return((e??``).split(/[\\/]/).pop()??``).replace(X,``)}function exportFileName(e,t,n){let r=(t??``).replace(/^\.+/,``),i=baseOf(e)||n||`untitled`;return r?`${i}.${r}`:i}var Z={ERROR:`error`,INFO:`info`},ie=15e3;function Notification({id:e,message:n,type:o,action:s,onClose:c}){i(()=>{let t=setTimeout(()=>{c(e)},ie);return()=>clearTimeout(t)},[e,c]);let l=t(t=>{t?.preventDefault?.(),c(e)},[e,c]);return r(`div`,{className:`notification ${o}`,role:o===Z.ERROR?`alert`:`status`,"aria-live":o===Z.ERROR?`assertive`:`polite`,children:[r(`span`,{className:`notification-message`,children:n}),s&&r(`button`,{className:`notification-action`,onClick:()=>{try{s.run()}catch(e){console.error(e)}c(e)},children:s.label}),r(`button`,{className:`notification-close`,onClick:l,"aria-label":a(`app.notifications.closeNotification`),title:a(`app.common.close`),children:r(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:r(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]})}function NotificationContainer({notifications:e,onClose:t}){return r(`div`,{className:`notification-container`,children:(Array.isArray(e)?e:[]).map(e=>r(Notification,{id:e.id,message:e.message,action:e.action,type:e.type,onClose:t},e.id))})}var ae=5,NotificationManager=class{container=null;notifications=[];constructor(){this.initContainer()}initContainer(){if(typeof document>`u`)return;let e=document.getElementById(`notification-root`);e?this.container=e:document.body&&(this.container=document.createElement(`div`),this.container.id=`notification-root`,document.body.appendChild(this.container))}show(e,t=Z.INFO,n){let r=typeof e==`string`?e:String(e??``),i=`notification-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,a={id:i,message:r,type:t,timestamp:Date.now(),action:n};return this.notifications.length>=ae&&this.notifications.shift(),this.notifications=[...this.notifications,a],this.renderNotifications(),i}success(e){return this.show(e,Z.INFO)}error(e,t){return this.show(e,Z.ERROR,t)}info(e,t){return this.show(e,Z.INFO,t)}hide=e=>{this.notifications=this.notifications.filter(t=>t.id!==e),this.renderNotifications()};clear(){this.notifications=[],this.renderNotifications()}renderNotifications(){if(this.container||this.initContainer(),this.container)try{n(e(NotificationContainer,{notifications:this.notifications,onClose:this.hide}),this.container)}catch{}}},Q=new NotificationManager,oe={preDeploy:v.PRE_DEPLOY,postDeploy:v.POST_DEPLOY},$=400,HttpPlatformBridge=class{configApi;scriptApi;clipboardApi;fileChooserApi;fileSaverApi;fileReaderApi;previewApi;diffApi;deploymentApi;navigationApi;projectApi;viewApi;hostApi;licenseApi;themeApi;preferencesApi;connectorsApi;actionsApi;agentApi;actionsRefused=!1;config;constructor(e,t){let n=new c({basePath:e??void 0??`http://localhost:8080`,headers:{"Content-Type":`application/json`},fetchApi:t});this.config=n,this.configApi=new d(n),this.scriptApi=new te(n),this.clipboardApi=new f(n),this.fileChooserApi=new D(n),this.fileSaverApi=new l(n),this.fileReaderApi=new m(n),this.previewApi=new C(n),this.diffApi=new E(n),this.deploymentApi=new p(n),this.navigationApi=new P(n),this.projectApi=new M(n),this.viewApi=new T(n),this.hostApi=new _(n),this.licenseApi=new ee(n),this.themeApi=new j(n),this.preferencesApi=new b(n),this.connectorsApi=new h(n),this.actionsApi=new F(n),this.agentApi=new g(n)}async openDiff(e){await this.diffApi.openDiff({openDiffRequest:{title:e.title,path:e.path,before:e.before??``,after:e.after}})}agentHost(){return V(this.agentApi)}agentsHost(){return httpAgentsHost(this.agentApi)}async getConfig(){try{return await this.configApi.getConfig()}catch(e){return console.error(`Failed to get config:`,e),null}}async getPreviewDiff(){return this.previewApi.getPreviewDiff()}async getDeployTargets(e){try{let t=await this.deploymentApi.getDeployTargets({resource:e});return{active:t?.active??null,targets:Array.isArray(t?.targets)?t.targets:[]}}catch{return{active:null,targets:[]}}}async getDeploymentSettings(e){return this.deploymentApi.getDeploymentSettings({profile:e??void 0})}async saveDeploymentSettings(e){return this.deploymentApi.saveDeploymentSettings({deploymentSettings:e})}async saveConfig(e){let t={engine:e.engine,scriptType:e.scriptType,elementTemplates:e.elementTemplates??[]};await this.configApi.saveConfig({configSaveRequest:t})}getBpmnXml(){return window.appConfig?.bpmnXml??null}getBpmnFilePath(){return window.appConfig?.bpmnFilePath??null}async saveBpmnXml(e){let t=window.appConfig?.bpmnFilePath;if(!t)throw Error(`BPMN file path not configured`);let n=window.appConfig?.pluginVersion;try{await this.fileSaverApi.saveFile({fileSaveRequest:{path:t,content:stampExporter(e,n??``),isBase64:!1}})}catch(e){throw await refusalOf(e)??e}}async getClipboard(){try{return(await this.clipboardApi.getClipboard())?.text??null}catch(e){return console.error(`Failed to get clipboard:`,e),null}}async readClipboardNow(){return(await this.clipboardApi.getClipboard())?.text||null}async saveClipboard(e){if(e)try{await this.clipboardApi.saveClipboard({clipboardDto:{text:e}})}catch(e){console.error(`Failed to save clipboard:`,e)}}async saveClipboardImage(e){if(!e)return!1;try{return await this.clipboardApi.saveClipboardImage({clipboardImageDto:{png:e}}),!0}catch(e){return console.error(`Failed to save the image to the clipboard:`,e),!1}}async navigateToClass(e,t=`JAVA_CLASS`){if(!e)return!1;try{return await this.navigationApi.navigateToClass({classNavigationRequest:{reference:e,kind:t}}),!0}catch(e){return console.error(`Failed to open the class:`,e),!1}}async getProjectFiles(){try{let e=await this.projectApi.getProjectFiles();return{root:e?.root??``,files:e?.files??[],reports:e?.reports??[],sources:e?.sources,testCases:e?.testCases,templates:e?.templates}}catch{return{root:``,files:[],reports:[]}}}async findWorkerVariables(){try{let e=await this.projectApi.findWorkerVariables(),t=e?.variableChecks;return{variables:e?.variables??[],fetches:e?.fetches??[],implicitJobTypes:e?.implicitJobTypes??[],types:coreTypesOf(e?.types),variableChecks:t&&{check:t.check,inputs:t.inputs,entitled:t.entitled},clientFacts:e?.clientFacts}}catch(e){return console.error(`Penstock could not read the variables the code writes:`,e),{variables:[],fetches:[],implicitJobTypes:[]}}}async findCode(e,t=!1,n=!1){try{let r=await this.projectApi.findCode({codeQuery:{subjects:e.map(e=>({kind:w[e.kind],value:e.value})),names:t,facts:n}}),i=new Map,a=new Map;return(r?.results??[]).forEach(e=>{let t=`${e.kind}:${e.value}`;i.set(t,(e?.links??[]).map(e=>({handle:e.handle,label:e.label,icon:e.icon,implements:e.implementation,test:e.test,declaration:e.declaration}))),a.set(t,(e.places??[]).map(e=>({file:e.path,line:e.line,offset:e.offset})))}),{precise:r?.precise??!1,links:i,places:a,names:t?codeNamesOf(r?.names??[]):void 0,structure:r?.facts?codeStructureOf(r.facts):void 0,clientFacts:r?.clientFacts}}catch(e){return console.error(`Penstock could not find the code:`,e),{precise:!1,links:new Map}}}async publishCodeLenses(e){try{let t=(e.workers??[]).map(e=>({...e,kind:w[e.kind]}));await this.viewApi.publishCodeLenses({codeLenses:{workers:t,processes:e.processes??[]}})}catch(e){console.warn(`Failed to publish code lenses:`,e)}}async publishToolWindow(e,t){try{let action=e=>({...e,keys:e.keys&&O[e.keys]}),node=e=>({...e,expand:e.expand&&x[e.expand],actions:e.actions?.map(action),children:e.children?.map(node)});await this.viewApi.publishToolWindow({toolWindowModel:{roots:(e??[]).map(node),toolbar:(t??[]).map(action)}})}catch(e){console.warn(`Failed to publish tool window:`,e)}}async publishActions(e){try{await this.actionsApi.publishActions({publishedActions:{actions:e}})}catch(e){this.actionsRefused||console.warn(`The host did not take the list of actions:`,e),this.actionsRefused=!0}}onRunAction(e){let t=window;return t.penstockRunAction=e,()=>{t.penstockRunAction===e&&delete t.penstockRunAction}}async getDebugState(){try{return(await this.hostApi.getDebugState())?.positions??[]}catch{return[]}}async revealElement(e,t){try{await this.hostApi.revealElement({revealRequest:{path:e,elementId:t}})}catch(e){console.warn(`Failed to reveal element:`,e)}}async openAsText(e,t){try{await this.hostApi.revealElement({revealRequest:{path:e,text:!0,line:t}})}catch(e){console.warn(`Failed to open as text:`,e)}}async openCode(e,t,n){try{await this.hostApi.openCode({codeHandles:{handles:e,title:t,usages:n}})}catch(e){console.warn(`Failed to open code:`,e)}}async runTestHandles(e,t,n){try{await this.hostApi.runTestHandles({testHandles:{handles:e,title:t,debug:n}})}catch(e){console.warn(`Failed to run test handles:`,e)}}async askEngine(e,t,n,r){try{let i=await this.hostApi.askEngine({engineRequest:{profile:e,resource:n,method:u[t.method],path:t.path,body:t.body,parts:t.parts,testRun:r}});return{status:i.status,body:i.body}}catch(e){return{status:0,body:await z(e)}}}hookRunsInBackground=!0;async runHook(e,t,n,r,i){try{let a=await this.hostApi.runHook({hookRequest:{stage:oe[e],resources:t,profile:n,resource:r}});return await this.untilHookEnds(e,a.run,i)}catch(t){return{ok:!1,lines:[`hook ${e}: ${await z(t)}`]}}}async untilHookEnds(e,t,n){for(;;){if(n?.signal?.aborted)return await this.hostApi.cancelHook({run:t}).catch(()=>void 0),{ok:!1,lines:[a(`app.deploy.hookCancelled`,{stage:e})]};let r=await this.hostApi.hookState({run:t});if(r.status===N.RUNNING)n?.onLines?.(r.lines),await new Promise(e=>setTimeout(e,$));else return{ok:r.ok,lines:r.lines}}}async recordDeployment(e,t){await this.hostApi.recordDeployment({deploymentRecord:{profile:e,resources:t}})}async confirmWithUser(e){try{return(await this.hostApi.confirmWithUser({hostQuestion:e})).accepted}catch(e){return console.error(`Penstock could not ask the host to confirm:`,e),!1}}async getDialogButtonOrder(){try{return R((await this.hostApi.getDialogButtonOrder()).primary)}catch(e){return B(e)||console.error(`Failed to read the dialog button order:`,e),R(null)}}async previewMigration(e,t){return awaitChoice(await this.hostApi.previewMigration({migrationPreview:e}),async()=>this.hostApi.getMigrationAnswer(),void 0,t)}async sendTestOutput(e,t,n){try{await this.hostApi.sendTestOutput({testOutput:{run:e,lines:t,finished:n}})}catch(e){console.warn(`Failed to send test output:`,e)}}async saveRunTrace(e,t,n){try{return(await this.hostApi.saveRunTrace({runTrace:{runId:e,name:t,content:n}}))?.path??``}catch(e){throw console.warn(`Failed to save run trace:`,e),e}}async openExternalLink(e){try{await this.hostApi.openExternalLink({externalLink:{url:e}})}catch(e){console.warn(`Failed to open external link:`,e)}}async notifyUser(e,t){try{await this.hostApi.notifyUser({hostMessage:{text:e,error:t}})}catch(n){console.warn(`Failed to notify user:`,n),t?Q.error(e):Q.info(e)}}async offerLinkedRename(e){try{let t=await this.hostApi.offerLinkedRename({linkedRenameOffer:e});return{places:t?.places??0,offered:t?.offered??!1,summary:t?.summary,detail:t?.detail}}catch{return{places:0,offered:!1}}}async reportSnapshot(e){try{let t=(e??[]).map(e=>({...e,kind:w[e.kind]}));await this.projectApi.reportSnapshot({projectSnapshot:{targets:t}})}catch(e){console.warn(`Failed to report snapshot:`,e)}}async reportFindings(e){try{await this.projectApi.reportFindings({projectFindings:{checked:(e??[]).map(e=>({path:e.path,stamp:e.stamp,findings:(e.findings??[]).map(e=>({...e,family:se[e.family],severity:e.severity===`error`?k.ERROR:k.WARNING}))}))}})}catch(e){console.warn(`Failed to report findings:`,e)}}async getLicense(){try{let e=await this.licenseApi.getLicense(),t=await verifiedLicense(e);return t&&{...e,tier:t.tier,token:null}}catch(e){return console.error(`Failed to read the licence:`,e),null}}async getTheme(){try{return await this.themeApi.getTheme()}catch(e){return console.error(`Failed to read the look and feel's colours:`,e),null}}async getPreferences(){try{return await this.preferencesApi.getPreferences()}catch(e){return console.error(`Failed to read the preferences:`,e),null}}async savePreferences(e){try{await this.preferencesApi.savePreferences({preferences:e})}catch(e){console.error(`Failed to save the preferences:`,e)}}async requestFeature(e){try{let t=await this.licenseApi.requestFeature({featureRequest:{feature:e}});if(t.allowed!==!0)return!1;let n=await this.licenseApi.getLicense();return await tokenTier(t.token,n.machine)!==`FREE`}catch(e){return console.error(`Failed to ask for a feature:`,e),!1}}async showLicenceOffer(e,t){try{return(await this.licenseApi.showLicenceOffer({licenceOfferRequest:{reason:e,surface:t}})).opened===!0}catch(e){return console.error(`Failed to open the licence screen:`,e),!1}}async openScriptFile(e,t,n,r,i,a){try{let o={scriptFormat:e,scriptValue:t,slot:n,title:r,variables:i,diagramPath:a};await this.scriptApi.createScript({scriptCreateRequest:o})}catch(e){console.error(`Failed to open script file:`,e)}}async reportScriptSlot(e,t){try{await this.scriptApi.reportScriptSlot({scriptSlotValue:{slot:e,value:t}})}catch(e){console.error(`Failed to report the script to its tab:`,e)}}async readFile(e){return(await this.fileReaderApi.readFile({fileReadRequest:{path:e}})).content}async readFileBytes(e){return base64ToUint8((await this.fileReaderApi.readFile({fileReadRequest:{path:e,asBase64:!0}})).content)}async readFileIfPresent(e){try{return await this.readFile(e)}catch(e){if(e instanceof y&&e.response.status===404)return null;throw e}}async createProjectFiles(e,t){await this.fileSaverApi.createProjectFiles({createProjectFilesRequest:{root:e,files:t}})}async saveFile(e,t,n){try{await this.fileSaverApi.saveFile({fileSaveRequest:{path:e,content:t,isBase64:n?.isBase64??!1}})}catch(e){throw Error(await z(e))}}async chooseFile(e,t){try{let n={title:t?.title??a(`app.files.saveTitle`,{extension:e.toUpperCase()}),description:t?.description,extension:e,mode:t?.mode===`open`?s.OPEN:s.SAVE,defaultFileName:t?.defaultFileName??exportFileName(this.getBpmnFilePath(),e,a(`app.export.untitledFile`)),defaultDirectory:t?.defaultDirectory,selectFiles:t?.selectFiles,selectFolders:t?.selectFolders,multiSelect:t?.multiSelect,recursive:t?.recursive},r=await this.fileChooserApi.chooseFile({fileChooserRequest:n});return r?.success&&r.paths?.length?r.paths[0]:null}catch(e){return console.error(`Failed to choose file:`,e),null}}async exportSvg(e){try{let t=await this.chooseFile(`svg`,{title:a(`app.files.exportAs`,{format:`SVG`}),mode:`save`});t&&await this.saveFile(t,e)}catch(e){throw console.error(`Failed to export SVG:`,e),e}}async exportPng(e){try{let t=await this.chooseFile(`png`,{title:a(`app.files.exportAs`,{format:`PNG`}),mode:`save`});if(t){let n=await blobToBase64(e);await this.saveFile(t,n,{isBase64:!0})}}catch(e){throw console.error(`Failed to export PNG:`,e),e}}async exportPdf(e){try{let t=await this.chooseFile(`pdf`,{title:a(`app.files.exportAs`,{format:`PDF`}),mode:`save`});if(t){let n=await blobToBase64(e);await this.saveFile(t,n,{isBase64:!0})}}catch(e){throw console.error(`Failed to export PDF:`,e),e}}async fetchConnectorUrl(e){try{let t=await this.connectorsApi.fetchConnectorUrl({connectorFetchRequest:{url:e}});return{status:t?.status??500,body:base64ToUint8(t?.body),failure:t?.failure??null}}catch(e){return{status:500,body:new Uint8Array,failure:await z(e)}}}async connectorFile(e,t,n,r){try{let i=await this.connectorsApi.connectorFile({connectorFileRequest:{op:e,path:t,content:n==null?void 0:uint8ToBase64(n),dest:r}});return{content:i?.content==null?null:base64ToUint8(i.content),entries:i?.entries??null,pathExists:i?.pathExists??null}}catch(e){throw Error(await connectorFailure(e))}}dispose(){}};function uint8ToBase64(e){if(!e||e.length===0)return``;let t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode(...e.subarray(n,n+32768)));return btoa(t.join(``))}function base64ToUint8(e){if(!e)return new Uint8Array;try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch{return new Uint8Array}}async function refusalOf(e){if(!(e instanceof y)||e.response.status!==400)return null;let t=await e.response.json().catch(()=>null);return typeof t?.message==`string`&&t.message!==``?new SaveRefused(t.message):null}async function connectorFailure(e){if(e instanceof y){let t=await e.response.json().catch(()=>null);return typeof t?.message==`string`?t.message:a(`app.files.connectorsFailed`,{status:e.response.status})}return e instanceof Error?e.message:String(e)}function blobToBase64(e){return new Promise((t,n)=>{if(!e){n(Error(`Nothing to save`));return}let r=new FileReader;r.onerror=()=>n(r.error??Error(`Could not read the picture`)),r.onloadend=()=>{if(r.error||typeof r.result!=`string`)return;let e=r.result.split(`,`);t(e.length>1?e[1]:e[0])};try{r.readAsDataURL(e)}catch(e){n(e)}})}var se={drawing:S.DRAWING,bpmnlint:S.BPMNLINT,compat:S.COMPAT,engine:S.ENGINE,table:S.TABLE,form:S.FORM,file:S.FILE},ce=new Set([`compare`,`codeBridge`]);function offeredByDefault(e){return!ce.has(e)}function hostSupports(e,t){return e?.supports?e.supports(t):offeredByDefault(t)}function isHostResponse(e){let t=e;return typeof t?.id==`number`&&typeof t.status==`number`}function hostFetch(e,t){let n=new Map,r=0,i=!1,listener=e=>{isHostResponse(e.data)&&n.get(e.data.id)?.answer(e.data)};return t.addEventListener(`message`,listener),{fetch:(t,o)=>new Promise((s,c)=>{if(i){c(Error(a(`app.platform.theHostConnectionIsClosed`)));return}let l=++r,u=o?.signal??void 0;if(u?.aborted){c(new DOMException(a(`app.platform.theRequestWasCancelled`),`AbortError`));return}let d;try{d=new URL(t,`http://host`)}catch{c(Error(a(`app.platform.theRequestWasCancelled`)));return}let onAbort=()=>{n.delete(l);try{e.postMessage({cancel:l})}catch{}c(new DOMException(a(`app.platform.theRequestWasCancelled`),`AbortError`))};u?.addEventListener(`abort`,onAbort,{once:!0}),n.set(l,{answer:e=>{n.delete(l),u?.removeEventListener(`abort`,onAbort),s(new Response(e.body,{status:e.status}))},close:()=>{u?.removeEventListener(`abort`,onAbort),c(Error(a(`app.platform.theHostConnectionIsClosed`)))}});let f={};try{f=Object.fromEntries(new Headers(o?.headers).entries())}catch{}try{e.postMessage({id:l,method:o?.method??`GET`,path:d.pathname,query:d.search,headers:f,body:typeof o?.body==`string`?o.body:null})}catch(e){n.delete(l),c(e instanceof Error?e:Error(String(e)))}}),dispose:()=>{i=!0,t.removeEventListener(`message`,listener);let e=[...n.values()];n.clear(),e.forEach(e=>e.close())}}}var le=new Set([`vscode-light`,`vscode-high-contrast-light`]);function themeOf(e){if(!e)return`dark`;let t=e.dataset?.vscodeThemeKind;return t?le.has(t)?`light`:`dark`:e.classList.contains(`vscode-light`)||e.classList.contains(`vscode-high-contrast-light`)?`light`:`dark`}function signatureOf(e){let t=e.documentElement.style;return[e.body?.dataset?.vscodeThemeKind??``,e.body?.dataset?.vscodeThemeId??``,t.getPropertyValue(`--vscode-editor-background`),t.getPropertyValue(`--vscode-editor-foreground`),t.getPropertyValue(`--vscode-focusBorder`)].join(`|`)}function watchHostTheme(e,t,n,r=50){let i=signatureOf(e),a,settle=()=>{a=void 0;let t=signatureOf(e);t!==i&&(i=t,n(themeOf(e.body)))},o=new t(()=>{a!==void 0&&clearTimeout(a),a=setTimeout(settle,r)});return e.body&&o.observe(e.body,{attributes:!0,attributeFilter:[`class`,`data-vscode-theme-kind`,`data-vscode-theme-id`]}),o.observe(e.documentElement,{attributes:!0,attributeFilter:[`style`]}),()=>{a!==void 0&&clearTimeout(a),o.disconnect()}}function resolveVsCodeApi(){let e=typeof window<`u`?window:globalThis;return e.__vscodeApi?e.__vscodeApi:typeof e.acquireVsCodeApi==`function`?(e.__vscodeApi=e.acquireVsCodeApi(),e.__vscodeApi):typeof acquireVsCodeApi==`function`?(e.__vscodeApi=acquireVsCodeApi(),e.__vscodeApi):{postMessage:()=>{},getState:()=>void 0,setState:()=>{}}}var ue=1e3,de=new Set([`editorTheme`]),VscodePlatformBridge=class extends HttpPlatformBridge{transport;vscodeApi;stopController=new AbortController;stopWatchingTheme=null;documentListeners=new Set;actionHandlers=new Set;runTraceListeners=new Set;lastSent=null;constructor(e,t){let n=hostFetch(e??resolveVsCodeApi(),t??(typeof window<`u`?window:globalThis));super(`http://host`,n.fetch),this.transport=n,this.vscodeApi=new A(this.config),typeof document<`u`&&typeof MutationObserver<`u`&&(this.stopWatchingTheme=watchHostTheme(document,MutationObserver,e=>{window.setTheme?.(e)})),this.pumpEvents()}async pumpEvents(){let e=this.stopController.signal;for(;!e.aborted;)try{this.handleEvent(await this.vscodeApi.nextHostEvent({signal:e}))}catch{if(e.aborted)return;await new Promise(e=>setTimeout(e,ue))}}supports(e){return!de.has(e)&&offeredByDefault(e)}async saveClipboardImage(e){if(!e)return!1;let t=typeof navigator<`u`?navigator.clipboard:void 0;if(!t||typeof ClipboardItem>`u`)return!1;try{let n=Uint8Array.from(atob(e),e=>e.charCodeAt(0));return await t.write([new ClipboardItem({"image/png":new Blob([n],{type:`image/png`})})]),!0}catch(e){return console.error(`Failed to put the image on the clipboard:`,e),!1}}handleEvent(e){if(!e||!e.type)return;let t=typeof window<`u`?window:globalThis;switch(e.type){case`revealElement`:typeof t.revealElement==`function`?t.revealElement(e.elementId):t.pendingReveal=e.elementId;return;case`documentReload`:if(e.xml===this.lastSent)return;this.lastSent=null,t.appConfig&&(t.appConfig.bpmnXml=e.xml),this.documentListeners.forEach(t=>{try{t(e.xml)}catch(e){console.error(`Document listener error:`,e)}});return;case`scriptSlotChanged`:try{t.scriptSlotChanged?.(e.slot,e.value)}catch{}return;case`scriptTabsChanged`:try{t.scriptTabsChanged?.(e.slots)}catch{}return;case`debugPosition`:typeof t.showDebugPosition==`function`?t.showDebugPosition(e):t.pendingDebug=e;return;case`debugCleared`:t.pendingDebug=void 0,typeof t.clearDebugPosition==`function`&&t.clearDebugPosition();return;case`codeChanged`:try{typeof t.codeChanged==`function`&&t.codeChanged()}catch{}return;case`runAction`:this.actionHandlers.forEach(t=>{try{t(e.id)}catch(e){console.error(`Action handler error:`,e)}});return;case`openRunTrace`:this.runTraceListeners.forEach(t=>{try{t(e.path)}catch(e){console.error(`Run trace listener error:`,e)}});return;case`projectChanged`:try{t.coverageChanged?.()}catch{}return;case`openChat`:typeof t.penstockOpenChat==`function`?t.penstockOpenChat(e.chatId):t.pendingOpenChat=e.chatId;return}}onDocumentChanged(e){return this.documentListeners.add(e),()=>this.documentListeners.delete(e)}onRunTrace(e){return this.runTraceListeners.add(e),()=>this.runTraceListeners.delete(e)}onRunAction(e){return this.actionHandlers.add(e),()=>this.actionHandlers.delete(e)}async undo(){await this.vscodeApi.undo()}async redo(){await this.vscodeApi.redo()}async saveBpmnXml(e){let t=typeof window<`u`?window:globalThis;t.appConfig&&(t.appConfig.bpmnXml=e),this.lastSent=e,await this.vscodeApi.saveDocumentText({documentText:{xml:e}})}async getTheme(){return null}async reportFindings(){}dispose(){try{this.stopController.abort()}catch{}try{this.stopWatchingTheme?.()}catch{}this.stopWatchingTheme=null;try{this.transport.dispose()}catch{}this.documentListeners.clear(),this.actionHandlers.clear(),this.runTraceListeners.clear()}};function runsInVsCode(){if(typeof window>`u`)return!1;let e=window;return typeof e.acquireVsCodeApi==`function`||!!e.__vscodeApi}L(()=>runsInVsCode()?new VscodePlatformBridge:new HttpPlatformBridge);export{isSaveRefused as a,exportFileName as i,HttpPlatformBridge as n,verifiedLicense as o,Q as r,stampExporter as s,hostSupports as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-B8BYMn-z.js";import{t as e}from"./bridgeInstance-
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{t as e}from"./bridgeInstance-BZBhe5hF.js";var t=`penstock-toolbar-pinned`,n=`bpmn-editor-theme`,r=`bpmn-editor-theme-chosen`,i=`bpmn-editor-rendering`,a={toolbarPinned:[],toolbarUnpinned:[],rendering:null,recentActions:[]},o={...a},s=!1,c=Promise.resolve(),l=0,u=new Set;function legacy(){let e={};try{let n=JSON.parse(localStorage.getItem(t)??`null`);Array.isArray(n)&&(e.toolbarPinned=n.filter(e=>typeof e==`string`));let r=localStorage.getItem(i);r&&(e.rendering=r)}catch{return{}}return e}function forgetLegacy(){try{[t,n,r,i].forEach(e=>{try{localStorage.removeItem(e)}catch{}})}catch{}}async function loadPreferences(){try{let t=await e().getPreferences();s=t!==null,o={...a,...t??{}};let n=legacy();if(Object.keys(n).length===0||t===null)return;let r={};!o.toolbarPinned?.length&&n.toolbarPinned?.length&&(r.toolbarPinned=n.toolbarPinned),o.rendering==null&&n.rendering&&(r.rendering=n.rendering),o={...o,...r},Object.keys(r).length>0&&await persist(r),forgetLegacy()}catch{s=!1,o={...a}}}function preferencesAvailable(){return s}function preferences(){return o}function merged(e,t){let n={...a,...e,...t??{}};if(!t?.webSessions)return n;let r={...e.webSessions??{}};for(let[e,n]of Object.entries(t.webSessions))delete r[e],r[e]=n;return{...n,webSessions:r}}async function persist(t){try{let n=e(),r=await n.getPreferences();await n.savePreferences(merged(r??o,t))}catch(e){console.error(e)}}function updatePreferences(e){o=merged(o,e),[...u].forEach(e=>{try{e()}catch(e){console.error(e)}}),c=c.then(()=>persist(e)).catch(e=>{console.error(e)})}function onPreferencesChange(e){return u.add(e),()=>u.delete(e)}var d=[`toolbarPinned`,`toolbarUnpinned`,`rendering`,`theme`,`recentActions`,`sidebarWidth`,`sidebarByEditor`,`showCommentBadges`,`showCodeBadges`,`suggestNextBlock`,`suggestions`,`aiChat`,`agentSelected`,`agentsEnabled`,`agentOptions`];function sameChoice(e,t){return JSON.stringify(d.map(t=>e[t]))===JSON.stringify(d.map(e=>t[e]))}async function refreshPreferences(){if(!s)return;let t=++l;await c;try{let n=await e().getPreferences();if(n===null||t!==l)return;let r={...a,...n};if(sameChoice(r,o))return;o={...o,...r},[...u].forEach(e=>{try{e()}catch(e){console.error(e)}})}catch(e){console.error(e)}}function followPreferencesOnFocus(e=typeof window<`u`?window:null){if(!e||typeof e.addEventListener!=`function`)return()=>void 0;let refresh=()=>void refreshPreferences();try{e.addEventListener(`focus`,refresh),e.document?.addEventListener?.(`visibilitychange`,refresh)}catch{}return()=>{try{e.removeEventListener(`focus`,refresh),e.document?.removeEventListener?.(`visibilitychange`,refresh)}catch{}}}export{preferencesAvailable as a,preferences as i,loadPreferences as n,updatePreferences as o,onPreferencesChange as r,followPreferencesOnFocus as t};
|