@kern0x1b/penstock-cli 26.10.4 → 26.10.5
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 +1 -0
- package/dist/chunk-agentFailure-piRAFLGH.js +1 -0
- package/dist/chunk-agentLaunch-C5Uo40vv.js +1 -0
- package/dist/chunk-agentServe-4O0syoYQ.js +10 -0
- package/dist/chunk-analyze-Brxlb4U1.js +1 -0
- package/dist/chunk-analyze-CUxuBgNS.js +1 -0
- package/dist/chunk-apply-BAMwoXG9.js +1 -0
- package/dist/chunk-atomicWrite-C6J1gDtO.js +1 -0
- package/dist/chunk-baseline-DvS2S0am.js +1 -0
- package/dist/chunk-bot-I4kuhjyv.js +11 -0
- package/dist/chunk-cacheDirectory-7sa0970e.js +1 -0
- package/dist/chunk-codeFactSet-DOOlbIIj.js +1 -0
- package/dist/chunk-codeIndex-CzENd6hG.js +1 -0
- package/dist/chunk-codeLinks-D-gzUjYv.js +1 -0
- package/dist/chunk-codeLinks-DLxEBWPi.js +1 -0
- package/dist/chunk-command-BR4memGJ.js +1 -0
- package/dist/chunk-command-BctoT00W.js +5 -0
- package/dist/chunk-command-Jl1msVwF.js +1 -0
- package/dist/chunk-commands-CeRlfHY-.js +1 -0
- package/dist/chunk-compose-BV9Jg348.js +4 -0
- package/dist/chunk-connectors-CVfz5pSg.js +1 -0
- package/dist/chunk-connectors-eXPldvkc.js +2 -0
- package/dist/chunk-context-DPJmldqg.js +1 -0
- package/dist/chunk-convert-B1sgT9kl.js +1 -0
- package/dist/chunk-deploy-C4KJK-tw.js +1 -0
- package/dist/chunk-deploy-DOXu2-8q.js +2 -0
- package/dist/chunk-diagram-BaVwLa4h.js +1 -0
- package/dist/chunk-diagram-CCA1-fT5.js +1 -0
- package/dist/chunk-diagramDefects-7UG_Iwsr.js +1 -0
- package/dist/chunk-diagrams-6suPQBVQ.js +1 -0
- package/dist/chunk-diff-BC8gZX5w.js +1 -0
- package/dist/chunk-diff-D1m_eKvv.js +1 -0
- package/dist/chunk-diffModels-DYtf3au1.js +3 -0
- package/dist/chunk-dispatch-CW2CJI0C.js +6 -0
- package/dist/chunk-docs-CY6ICsip.js +1 -0
- package/dist/chunk-docs-CwY3Ce9M.js +30 -0
- package/dist/chunk-doctor-m0mnVdDE.js +1 -0
- package/dist/chunk-drawing-shRfnrs9.js +8 -0
- package/dist/chunk-editPreview-BgH1JVOD.js +1 -0
- package/dist/chunk-engine-CxgdJ2wO.js +1 -0
- package/dist/chunk-export-9AWsr5ai.js +1 -0
- package/dist/chunk-export-D5kPD4Or.js +20 -0
- package/dist/chunk-facts-DA3Y-k9a.js +1 -0
- package/dist/chunk-failure-BsimkHy_.js +1 -0
- package/dist/chunk-features-BfRg2kR5.js +1 -0
- package/dist/chunk-features-BwnwB6jL.js +1 -0
- package/dist/chunk-folders-13vx0i0n.js +1 -0
- package/dist/chunk-folders-C1Nes4Ap.js +1 -0
- package/dist/chunk-formChecks-acRgARZ3.js +1 -0
- package/dist/chunk-git-BOKyPQj7.js +3 -0
- package/dist/chunk-help-CFhmAhz8.js +85 -0
- package/dist/chunk-importCommand-5SJxu2k4.js +1 -0
- package/dist/chunk-init-AIh_7yE0.js +227 -0
- package/dist/chunk-license-B_To2110.js +1 -0
- package/dist/chunk-license-x3oHbKe2.js +1 -0
- package/dist/chunk-lint-C_fAcLIg.js +1 -0
- package/dist/chunk-load-BVJUBU5S.js +5 -0
- package/dist/chunk-main-D3S4Xr__.js +1 -0
- package/dist/chunk-mcp-ByMCWlXC.js +76 -0
- package/dist/chunk-mcpLaunch-C13ViiIP.js +592 -0
- package/dist/chunk-migrate-CLQ-hrae.js +1 -0
- package/dist/chunk-migrate-CVUR1K7f.js +1 -0
- package/dist/chunk-moddle-AjPH0QEc.js +1 -0
- package/dist/chunk-moddle-Dlk0NR-u.js +1 -0
- package/dist/chunk-own-CX-3lIbf.js +1 -0
- package/dist/chunk-penstockCli-CqiOKC75.js +1 -0
- package/dist/chunk-placeholderLayout-B18ekWmh.js +1 -0
- package/dist/chunk-plural-Bq_4vgOr.js +1 -0
- package/dist/chunk-pr-tC3-PSNM.js +1 -0
- package/dist/chunk-preferencesFile-F6bAlNrk.js +1 -0
- package/dist/chunk-project-qT-Fk_Rz.js +1 -0
- package/dist/chunk-report-CDz78nCI.js +1 -0
- package/dist/chunk-review-BqZSohXR.js +1 -0
- package/dist/chunk-rules-DJlL7K_Q.js +1 -0
- package/dist/chunk-security-5SU-bq3A.js +18 -0
- package/dist/chunk-share-YSewfw3F.js +239 -0
- package/dist/chunk-src-BLyg_6UX.js +879 -0
- package/dist/chunk-stages-C-nhLoBW.js +3 -0
- package/dist/chunk-status-DgeSOz3A.js +1 -0
- package/dist/chunk-systemError-2me5k57V.js +1 -0
- package/dist/chunk-systemError-B-1nL94i.js +1 -0
- package/dist/chunk-table-CJtiXv0e.js +1 -0
- package/dist/chunk-taskTest-4rIxp0rL.js +2 -0
- package/dist/chunk-taskTest-rng12v_b.js +1 -0
- package/dist/chunk-templates-Bxe3J0qy.js +1 -0
- package/dist/chunk-testCases-CwQ-Mi7L.js +1 -0
- package/dist/chunk-testCases-xculyxH_.js +4 -0
- package/dist/chunk-tests-C-kNQNpq.js +1 -0
- package/dist/chunk-tests-C3XJ9LMT.js +23 -0
- package/dist/chunk-translator-BFUJmSkR.js +21 -0
- package/dist/chunk-trust-u1vZ6Yk0.js +1 -0
- package/dist/chunk-trust-yKw_pXRj.js +1 -0
- package/dist/chunk-version-CdS8_QQd.js +1 -0
- package/dist/chunk-workerVariables-CCLcoR0U.js +1 -0
- package/dist/chunk-wrapper-AJWl6ru-.js +3 -0
- package/dist/chunk-wrapper-Bxz1Lgp5.js +1 -0
- package/dist/locales/de.json +9176 -0
- package/dist/locales/es.json +9176 -0
- package/dist/locales/fr.json +9176 -0
- package/dist/locales/ja.json +9023 -0
- package/dist/locales/ko.json +9023 -0
- package/dist/locales/pt-BR.json +9176 -0
- package/dist/locales/ru.json +9482 -0
- package/dist/locales/zh.json +9023 -0
- package/dist/penstock.js +1 -2363
- package/dist/web/assets/{AgentSettings-BvzT4Itb.js → AgentSettings-C3Er_rlW.js} +1 -1
- package/dist/web/assets/{AgentsDialog-BqY3wKcV.js → AgentsDialog-Bo7kikb6.js} +1 -1
- package/dist/web/assets/{BpmnCanvas-BTdM1l9l.js → BpmnCanvas-Dw5zgCN3.js} +3 -3
- package/dist/web/assets/{BpmnDocument-uifU3NGG.js → BpmnDocument-CuU0biX9.js} +4 -4
- package/dist/web/assets/{ConflictDialog-C4A9-Psr.js → ConflictDialog-GxZ-d8SK.js} +1 -1
- package/dist/web/assets/{DiffDocument-BMTSevd7.js → DiffDocument-Bh3hFmmi.js} +1 -1
- package/dist/web/assets/{DmnDocument-B8wWuhfX.js → DmnDocument-C8HpJAcE.js} +1 -1
- package/dist/web/assets/{FormDocument-bQ5VRsrh.js → FormDocument-CH-4KB3x.js} +1 -1
- package/dist/web/assets/{FormStepView-DbMCFSO1.js → FormStepView-DraPVoAN.js} +1 -1
- package/dist/web/assets/GraphAwareLayoutService-C8J8YHJI.js +21 -0
- package/dist/web/assets/NewFileDialog-j09JqpPj.js +47 -0
- package/dist/web/assets/{QuickOpen-mzlfRqvG.js → QuickOpen-CeBhsCzA.js} +1 -1
- package/dist/web/assets/{ScriptPane-C9q5wLfO.js → ScriptPane-DDikZDv6.js} +2 -2
- package/dist/web/assets/{ScriptRunDialog-Dm-_0H1Z.js → ScriptRunDialog-DdzJ0pvT.js} +1 -1
- package/dist/web/assets/{SettingsDialog-Bhwwtyg7.js → SettingsDialog-JUc5zUR9.js} +1 -1
- package/dist/web/assets/{ShortcutsDialog-BXP0h7Tp.js → ShortcutsDialog-DECqWPNE.js} +1 -1
- package/dist/web/assets/{SourceDocument-DgrNCprS.js → SourceDocument-X8ajUcxM.js} +1 -1
- package/dist/web/assets/{TextDocument-D8N0uaQa.js → TextDocument-0z7qojAh.js} +1 -1
- package/dist/web/assets/{UnreadableFileLayer-D2Rcxnt7.js → UnreadableFileLayer-D3G59F4u.js} +1 -1
- package/dist/web/assets/{UploadDialog-Dinga4TP.js → UploadDialog-CiahYkTc.js} +1 -1
- package/dist/web/assets/{apply-CzXxiRWK.js → apply-HqvoGwLE.js} +1 -1
- package/dist/web/assets/{bpmnTheme-db4tYvop.js → bpmnTheme-cOvp4qFc.js} +1 -1
- package/dist/web/assets/{bridgeInstance-BPwbITOf.js → bridgeInstance-DQk-c8L1.js} +1 -1
- package/dist/web/assets/{commands-BAnBjEk3.js → commands-nPznxvPp.js} +1 -1
- package/dist/web/assets/de-Dj813wjn.js +1 -0
- package/dist/web/assets/{dialog-KVjfqSrB.js → dialog-CtGB1LHI.js} +1 -1
- package/dist/web/assets/{diff-Cw0ENHJR.js → diff-NgYeO98t.js} +1 -1
- package/dist/web/assets/{documentBridge-D5SaBThP.js → documentBridge-QW0IZ9Bq.js} +2 -2
- package/dist/web/assets/{documents-Dkor36oS.js → documents-KeXEdK1U.js} +1 -1
- package/dist/web/assets/{duplicate-ud-StKuO.js → duplicate-DNPpPVse.js} +1 -1
- package/dist/web/assets/{engines-BQRXHtW8.js → engines-DU0BfbYM.js} +1 -1
- package/dist/web/assets/es-CyJDEw4H.js +1 -0
- package/dist/web/assets/{formChecks-DFrCuO4I.js → formChecks-sU20kKkU.js} +1 -1
- package/dist/web/assets/fr-B1lqrd3d.js +1 -0
- package/dist/web/assets/frontend-caI7mOAL.js +1 -0
- package/dist/web/assets/{httpHost-DX-P_FDg.js → httpHost-Dqit__mm.js} +1 -1
- package/dist/web/assets/{index.es-dFUgH_-g.js → index.es-BqVUpGyA.js} +1 -1
- package/dist/web/assets/{index.es-DR-czZl7.js → index.es-DqkfrvWI.js} +1 -1
- package/dist/web/assets/{intelligence-BkxcJMU_.js → intelligence-Ck_Q9upa.js} +1 -1
- package/dist/web/assets/ja-BUAM_DzQ.js +1 -0
- package/dist/web/assets/{jspdf.es.min-BMfOi0te.js → jspdf.es.min-CM3S4IDt.js} +3 -3
- package/dist/web/assets/ko-7l4EjTF9.js +1 -0
- package/dist/web/assets/{lib-C3uYnGWx.js → lib-DAKOOgix.js} +1 -1
- package/dist/web/assets/{platform-zEAtGnYc.js → platform-CkWAyNst.js} +1 -1
- package/dist/web/assets/{preferences-K6VRM9Ah.js → preferences-nBrFGN89.js} +1 -1
- package/dist/web/assets/pt-BR-CxxRL7kF.js +1 -0
- package/dist/web/assets/ru-C4gbkVXL.js +1 -0
- package/dist/web/assets/{run-fV7AmV4q.js → run-B3YvrVeP.js} +1 -1
- package/dist/web/assets/{samples-D-3Bquy_.js → samples-BVuIm-bu.js} +1 -1
- package/dist/web/assets/{testCaseRuns-C-0blM3d.js → testCaseRuns-DYKnccnc.js} +1 -1
- package/dist/web/assets/translator-B2N3PQBL.js +1 -0
- package/dist/web/assets/{ui-TBzvKaKQ.js → ui-3pEQJ50t.js} +1 -1
- package/dist/web/assets/{useTrace-BgpeAcQR.js → useTrace-BAXnn0Bt.js} +1 -1
- package/dist/web/assets/{web-qJCedJJw.js → web-B2zkonPE.js} +5 -5
- package/dist/web/assets/zh-DIYPlVjz.js +1 -0
- package/dist/web/index.html +19 -19
- package/package.json +1 -1
- package/dist/web/assets/GraphAwareLayoutService-CePcz6pL.js +0 -21
- package/dist/web/assets/NewFileDialog-DsoFURD9.js +0 -47
- package/dist/web/assets/de-Cd75cvcZ.js +0 -1
- package/dist/web/assets/es-D2PUEg_Z.js +0 -1
- package/dist/web/assets/fr-DkGYGarc.js +0 -1
- package/dist/web/assets/frontend-B05iyhCp.js +0 -1
- package/dist/web/assets/ja-De4NAvK-.js +0 -1
- package/dist/web/assets/ko-Ci27KQ5n.js +0 -1
- package/dist/web/assets/pt-BR-CNmIseZJ.js +0 -1
- package/dist/web/assets/ru-BtK7W4xW.js +0 -1
- package/dist/web/assets/translator-Dvvasoz-.js +0 -1
- package/dist/web/assets/zh-DxI_A5kC.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as t,i as r,n as a,o,r as s,t as u}from"./rolldown-runtime-B8BYMn-z.js";import{a as d,c as f,d as p,h,i as g,n as _,r as v,s as y,u as b}from"./vendor-NJP34MHU.js";import{i as x,n as S}from"./translator-Dvvasoz-.js";import{C,l as w,m as T,x as E}from"./frontend-B05iyhCp.js";import{Dn as D,Fn as O,Gn as k,In as ee,Jn as A,Kn as j,Mn as te,Nn as ne,Pn as re,Sn as M,Vt as ie,ct as ae,jn as N,lt as oe,qn as se,t as ce,ut as le,xn as ue}from"./bridgeInstance-BPwbITOf.js";import{A as de,C as fe,D as pe,F as me,L as he,M as ge,N as _e,O as ve,R as P,S as ye,T as be,_ as xe,a as Se,b as Ce,c as we,f as Te,g as Ee,h as De,i as Oe,k as ke,l as Ae,m as F,n as je,o as Me,p as Ne,r as Pe,s as I,t as L,u as R,v as Fe,w as Ie,x as Le,y as Re}from"./dist-CRJyslwo.js";import{t as ze}from"./dist-DgvQWhKm.js";import{A as Be,C as Ve,D as He,E as Ue,N as We,O as Ge,T as Ke,a as qe,j as Je,k as Ye,l as Xe}from"./moddle-CGpeSs3G.js";import{t as Ze}from"./dist-BqwyxNP3.js";import{t as Qe}from"./platform-zEAtGnYc.js";import{C as $e,D as et,E as tt,O as nt,T as rt,b as it,g as at,h as ot,p as st,s as ct,t as lt,w as ut,x as dt}from"./bpmnTheme-db4tYvop.js";import{u as ft}from"./ui-TBzvKaKQ.js";import{a as pt,i as mt,r as ht}from"./lib-C3uYnGWx.js";import{i as gt,o as _t}from"./preferences-K6VRM9Ah.js";import{$ as vt,$t as yt,A as bt,An as xt,At as St,B as Ct,Bt as wt,C as Tt,Cn as Et,Ct as Dt,D as Ot,Dn as kt,Dt as At,E as jt,En as Mt,Et as Nt,F as Pt,Fn as Ft,Ft as It,G as Lt,Gt as Rt,H as zt,Ht as Bt,I as Vt,In as Ht,It as Ut,J as Wt,Jt as Gt,K as Kt,Kt as qt,L as Jt,M as Yt,Mn as Xt,Mt as Zt,N as Qt,Nn as $t,Nt as en,O as tn,On as nn,Ot as rn,P as an,Pn as sn,Pt as cn,Q as ln,Qt as un,R as dn,Rt as pn,S as mn,Sn as hn,St as gn,T as _n,Tn as vn,Tt as yn,U as bn,Ut as xn,V as Sn,Vt as Cn,W as z,Wt as wn,X as Tn,Xt as En,Y as Dn,Yt as On,Z as kn,Zt as An,_ as jn,_n as Mn,_t as Nn,an as Pn,at as Fn,b as In,bn as Ln,bt as Rn,c as zn,cn as Bn,ct as Vn,d as Hn,dn as Un,dt as Wn,en as Gn,et as Kn,f as qn,fn as Jn,ft as Yn,g as Xn,gn as Zn,gt as Qn,h as $n,hn as er,ht as tr,i as nr,in as rr,it as B,j as ir,jn as ar,jt as sr,k as cr,kn as lr,kt as ur,l as dr,ln as fr,lt as pr,mn as mr,mt as hr,n as gr,nn as _r,nt as V,on as vr,ot as yr,p as br,pn as xr,pt as Sr,q as Cr,qt as wr,rn as Tr,rt as Er,sn as Dr,st as Or,tn as kr,tt as Ar,u as jr,un as Mr,ut as Nr,v as Pr,vn as Fr,vt as Ir,w as Lr,wn as Rr,wt as zr,x as Br,xn as Vr,xt as Hr,y as Ur,yn as Wr,yt as Gr,z as H,zt as Kr}from"./duplicate-ud-StKuO.js";import{$ as qr,$t as Jr,A as Yr,At as Xr,B as Zr,Bt as Qr,Ct as $r,D as ei,E as ti,Et as ni,F as ri,Ft as ii,Gt as ai,H as oi,Ht as si,I as ci,It as li,J as U,Jt as ui,K as W,Kt as di,L as fi,Lt as pi,M as mi,Mt as hi,N as gi,Nt as _i,O as vi,Ot as yi,P as bi,Pt as xi,Qt as Si,R as Ci,Rt as wi,S as Ti,St as Ei,T as Di,Tt as Oi,U as ki,V as Ai,Vt as ji,W as Mi,Wt as Ni,Xt as Pi,Y as G,Yt as Fi,_ as Ii,a as Li,bt as Ri,ct as zi,dt as Bi,et as Vi,f as Hi,ft as Ui,g as Wi,h as Gi,in as K,j as Ki,jt as qi,k as Ji,kt as Yi,lt as Xi,m as Zi,mt as Qi,nn as $i,nt as ea,o as ta,ot as na,p as ra,pt as ia,q as aa,qt as oa,r as sa,rn as ca,t as la,tn as ua,ut as da,v as q,vt as fa,w as pa,wt as ma,x as ha,xt as ga,y as _a,yt as va,z as ya,zt as ba}from"./Viewer-CZiVl0t6.js";import{a as xa,i as Sa,s as J}from"./dist-CHluRwHI.js";import{a as Ca,n as wa,r as Ta,t as Ea}from"./dist-TNwbKIWT.js";import{i as Da,n as Oa,r as ka,t as Aa}from"./stackblur-es-Djj-lnDR.js";import{I as ja,M as Ma,c as Na,ht as Pa,pt as Fa,t as Ia}from"./dist-CsBP6QjA.js";import{t as La}from"./array-move-Bc4mVEdq.js";import{t as Ra}from"./dist-Km3QNqlU.js";import{t as za}from"./groovy-DASguM_i.js";import{n as Ba}from"./dist-CnDXCEJ_.js";import{a as Va,c as Ha,f as Ua,i as Wa,l as Ga,m as Ka,p as qa,r as Ja,s as Ya,u as Xa}from"./apply-CzXxiRWK.js";import{n as Za,s as Qa}from"./dockLayout-CxOMo-Nl.js";F();function scriptWhatOf(t,r={}){switch(t){case`CONDITION`:case`FEEL_CONDITION`:return x(`app.scriptTab.condition`);case`EXECUTION_LISTENER`:return x(`app.scriptTab.executionListener`,{event:r.event??``});case`TASK_LISTENER`:return x(`app.scriptTab.taskListener`,{event:r.event??``});case`PARAMETER`:case`INPUT_MAPPING`:case`OUTPUT_MAPPING`:return r.parameter?.direction===`output`?x(`app.scriptTab.output`,{name:r.parameter.name}):x(`app.scriptTab.input`,{name:r.parameter?.name??``});case`TASK_BODY`:return x(`app.scriptTab.script`)}}function scriptTitle(t,r){return x(`app.scriptTab.title`,{name:t,what:r})}function scriptTitleOf(t){return scriptTitle(t.shared?x(`app.scriptTab.nameWithId`,{name:t.name,id:t.slot.elementId}):t.name,scriptWhatOf(t.slot.owner,t))}var $a=new Set(`String.string.str.CharSequence.char.Char.Character.Integer.int.Int.int32.int64.Long.long.Short.short.Byte.byte.Double.double.Float.float.float32.float64.decimal.Decimal.BigDecimal.BigInteger.Number.number.Boolean.boolean.bool.Date.LocalDate.LocalDateTime.LocalTime.OffsetDateTime.ZonedDateTime.Instant.Duration.UUID.Guid.DateTime.DateTimeOffset.TimeSpan.date.datetime.Time`.split(`.`)),eo=new Set([`List`,`ArrayList`,`LinkedList`,`Set`,`HashSet`,`LinkedHashSet`,`TreeSet`,`Collection`,`Iterable`,`Array`,`array`,`Optional`,`IList`,`IEnumerable`,`ICollection`,`IReadOnlyList`,`IReadOnlyCollection`,`Sequence`]),to=new Set([`null`,`undefined`,`None`,`nil`,``]);function splitTop(t,r){let a=[],o=0,s=0;for(let u=0;u<t.length;u+=1){let d=t[u];d===`<`||d===`[`||d===`(`?o+=1:d===`>`||d===`]`||d===`)`?--o:d===r&&o===0&&(a.push(t.slice(s,u)),s=u+1)}return a.push(t.slice(s)),a}function unwrap$1(t){let r=t.trim().replace(/^readonly\s+/,``).replace(/^[*&]+/,``).replace(/^["']|["']$/g,``).replace(/\?$/,``).trim(),a=r.split(`|`).map(t=>t.trim()).filter(t=>!to.has(t));return a.length===1?a[0]:a.length===0?``:r}r(unwrap$1,`unwrap`);function parse(t){if(t.endsWith(`[]`))return{base:`array`,args:[t.slice(0,-2)]};if(t.startsWith(`[]`))return{base:`array`,args:[t.slice(2)]};let r=/^([A-Za-z_][\w.]*)\s*[<[]([\s\S]*)[>\]]$/.exec(t);return r?{base:r[1],args:splitTop(r[2],`,`)}:{base:t,args:null}}function open$1(t){return{kind:`open`,name:t}}r(open$1,`open`);function declared(t,r,a,o){let s=r.get(t);if(!s||a>3||o.includes(t))return open$1(t);if(s.kind===`enum`)return{kind:`enum`,name:t,constants:s.constants};if(s.open)return open$1(t);let u=s.extends===null?void 0:r.get(s.extends);if(s.extends!==null&&(!u||u.kind!==`class`||u.open||u.extends!==null))return open$1(t);let d=s.fields,f=new Set(d.map(t=>t.name)),p=(u?.fields??[]).filter(t=>!f.has(t.name));return{kind:`object`,name:t,fields:[...d,...p].map(s=>({name:s.name,serialised:s.serialised,type:resolveType(s.type,r,a+1,[...o,t])}))}}function resolveType(t,r,a=1,o=[]){let s=unwrap$1(t??``);if(s===``)return open$1(``);let{base:u,args:d}=parse(s),f=u.slice(u.lastIndexOf(`.`)+1);return d!==null&&d.length===1&&eo.has(f)?{kind:`collection`,name:f,element:resolveType(d[0],r,a,o)}:d===null&&$a.has(f)?{kind:`scalar`,name:f}:declared(f,r,a,o)}function fieldNamed(t,r){return t.find(t=>t.name===r)??t.find(t=>/^[A-Z]/.test(t.name)&&t.name.charAt(0).toLowerCase()+t.name.slice(1)===r)}var no=new Set([`input`,`loop element`]);function visibleAt(t,r,a,o){return o.wholeProcess?r.elementId===a?no.has(r.where)||o.includeOwnCode===!0&&r.path!==void 0:!no.has(r.where)&&O(t,r.elementId,a):r.elementId===a&&r.path!==void 0}function knownVariable(t,r,a){let o=r.map(t=>({elementId:t.elementId,where:t.where,type:t.type??null,sample:t.sample??null,path:t.path??null,line:t.line??null,offset:t.offset??null})),s=[...new Set(o.map(t=>t.type))],u=s.filter(t=>t!==null);if(u.length>1)return{name:t,certainty:`ambiguous`,type:null,shape:resolveType(null,a),writers:o};if(u.length===1&&s.length===1){let r=resolveType(u[0],a);return{name:t,certainty:r.kind===`open`?`open`:`exact`,type:u[0],shape:r,writers:o}}return{name:t,certainty:`open`,type:null,shape:resolveType(null,a),writers:o}}function variablesAt(t,r,a){let o=new Map(t.types.map(t=>[t.name,t])),s=t.inputs??[],u=t.model.variables.filter(o=>o.writes&&visibleAt(t.order,o,r,a));return{variables:[...new Set([...u.map(t=>t.name),...a.wholeProcess?s:[]])].sort().map(t=>knownVariable(t,u.filter(r=>r.name===t),o)),startVariablesUnknown:s.length===0}}function namesOf$2(t){let r=new Map,visit=t=>{t?.id&&(r.set(t.id,typeof t.name==`string`&&t.name.trim()?t.name.trim():t.id),(t.flowElements??[]).forEach(visit))};return(t?.rootElements??[]).filter(t=>t.$type===`bpmn:Process`).forEach(t=>(t.flowElements??[]).forEach(visit)),r}r(namesOf$2,`namesOf`);function writerOf(t,r,a){return t.path===null?{label:r.get(t.elementId)??t.elementId,elementId:t.elementId,...a?{diagramPath:a}:{},...t.sample===null?{}:{sample:t.sample}}:{label:`${ue(t.path)}:${t.line??0}`,elementId:t.elementId,path:t.path,...t.line===null?{}:{line:t.line},...t.offset===null?{}:{offset:t.offset}}}function variableOf(t,r,a,o){return{name:t.name,...t.type===null?{}:{type:t.type},declaredByScript:se(a,t.name),writers:t.writers.map(t=>writerOf(t,r,o))}}function scriptContextOf(t,r,a){let o={variables:[...j(t.definitions).uses,...M(t.workers)]},s=ee(t.definitions).flows.get(r)?.target??r,u=variablesAt({model:o,order:re(t.definitions),types:t.workers?.types??[],inputs:t.inputs},s,{wholeProcess:!0}),d=namesOf$2(t.definitions);return u.variables.map(r=>variableOf(r,d,a,t.diagramPath))}var ro=/\b(?:byte|short|int|integer|long|float|double|number|bigdecimal|biginteger)\b/i,io=/\b(?:byte|short|int|integer|long|biginteger)\b/i,ao=/\b(?:bool|boolean)\b/i,oo=/^(?:list|set|collection|sequence|iterable|sortedset|array)$/i,so=/^(?:map|object|jsonnode|jsonobject|record|dictionary)$/i;function valueFor(t){if(!t)return`?`;let r=t.replace(/<.*$/,``).trim();return oo.test(r)||/\[\]$/.test(r)?[]:so.test(r)?{}:ao.test(r)?!1:io.test(r)||ro.test(r)?0:`?`}function exampleJson(t){return JSON.stringify(Object.fromEntries(t.map(t=>[t.name,valueFor(t.type)])),null,2)}function exampleInput(t,r,a,o){let s=new Map;(r?.variables??[]).filter(t=>t.elementId===a&&t.type).forEach(t=>s.set(t.name,t.type??null));let{uses:u}=j(t),d=new Set(u.filter(t=>t.writes&&t.elementId===a).map(t=>t.name)),f=new Set;return u.filter(t=>t.writes&&!d.has(t.name)).forEach(t=>{O(o,t.elementId,a)&&f.add(t.name)}),(r?.variables??[]).filter(t=>t.elementId===a&&!t.writes).forEach(t=>f.add(t.name)),[...f].sort().map(t=>({name:t,type:s.get(t)??null}))}var co=`camundaModeler:exampleOutputJson`,lo=[`serviceTask`,`sendTask`,`receiveTask`,`businessRuleTask`,`userTask`,`callActivity`],uo={JOB_TYPE:`JOB_TYPE`,TOPIC:`TOPIC`,JAVA_CLASS:`CLASS`,BEAN:`BEAN`};function elementSubjects(t){let r=new Map,add=(t,a)=>{let o=r.get(t);o?o.push(a):r.set(t,[a])},a=new Map(t.messages.map(t=>[t.id,t.name]));return t.workers.forEach(t=>add(t.elementId,{kind:uo[t.kind],value:t.value,...t.listener?{listener:t.listener}:{}})),t.calls.forEach(t=>add(t.elementId,{kind:`PROCESS`,value:t.calledProcessId})),t.decisionUses.forEach(t=>add(t.elementId,{kind:`DECISION`,value:t.decisionId})),t.messageUses.filter(t=>t.catches).forEach(t=>{let r=a.get(t.messageId);r&&add(t.elementId,{kind:`MESSAGE`,value:r})}),t.elements.filter(t=>lo.includes(t.type)||r.has(t.id)).map(t=>({elementId:t.id,elementType:t.type,label:t.label,bindings:r.get(t.id)??[]}))}function withRuntimeFacts(t,r){let{reached:a=null,paused:o}=r;return!a&&(!o||o.size===0)?t:t.map(t=>({...t,reached:a&&t.state!==`notApplicable`?a.has(t.elementId):t.reached,paused:o?.has(t.elementId)??t.paused}))}function isBadged(t){return t.state!==`notApplicable`&&lo.includes(t.elementType)}var fo=/^Focus process instance (.+)$/;function localised(t){if(typeof t!=`string`)return String(t??``);let r=fo.exec(t);return r?pt(`Focus process instance {id}`,{id:r[1]}):pt(t)}var po=`svg, [contenteditable]`;function localiseText(t){try{if(!t||typeof t.data!=`string`||t.parentElement?.closest(po))return;let r=t.data,a=r.trim();if(!a)return;let o=localised(a);o!==a&&(t.data=r.replace(a,o))}catch{}}var mo=[`title`,`aria-label`];function localiseLabels(t){try{if(!t||typeof t.getAttribute!=`function`||typeof t.setAttribute!=`function`||t.closest?.(po))return;for(let r of mo){let a=t.getAttribute(r);if(!a)continue;let o=localised(a);o!==a&&t.setAttribute(r,o)}}catch{}}function localiseTree(t){try{if(!t||typeof t.nodeType!=`number`)return;if(t.nodeType===Node.TEXT_NODE){localiseText(t);return}if(t.nodeType!==Node.ELEMENT_NODE)return;let r=t;if(localiseLabels(r),r.querySelectorAll?.(`[title], [aria-label]`).forEach(localiseLabels),typeof document<`u`&&typeof document.createTreeWalker==`function`){let t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(;t.nextNode();)localiseText(t.currentNode)}}catch{}}var TokenSimulationTranslator=class{static $inject=[`canvas`];constructor(t){try{if(!t||typeof t.getContainer!=`function`)return;let r=t.getContainer();if(!r||typeof r.nodeType!=`number`||(localiseTree(r),typeof MutationObserver!=`function`))return;new MutationObserver(t=>{try{for(let r of t)r.type===`attributes`?localiseLabels(r.target):r.type===`characterData`?localiseText(r.target):r.addedNodes.forEach(localiseTree)}catch{}}).observe(r,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:mo})}catch{}}},ho={__init__:[`tokenSimulationTranslator`],tokenSimulationTranslator:[`type`,TokenSimulationTranslator]};function BaseModeler(t){Mi.call(this,t),this.on(`import.parse.complete`,function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on(`diagram.destroy`,function(){this.get(`moddle`).ids.clear()},this)}K(BaseModeler,Mi),BaseModeler.prototype._createModdle=function(t){var r=Mi.prototype._createModdle.call(this,t);return r.ids=new Ze([32,36,1]),r},BaseModeler.prototype._collectIds=function(t,r){var a=t.$model.ids,o;for(o in a.clear(),r)a.claim(o,r[o])};var go=300;function KeepSelectionVisible(t,r,a){this._selectionWasVisible=!1;let o=Pe(()=>{this._selectionWasVisible=isSelectionVisible()},go);t.on(`canvas.viewbox.changed`,o),t.on(`selection.changed`,o),t.on(`diagram.destroy`,()=>{o.cancel()}),t.on(`canvas.resized`,()=>{var t=a.get();if(t.length&&this._selectionWasVisible&&!isSelectionVisible()){var o=r.getRootElement();r.scrollToElement(t.concat(o))}});function isSelectionVisible(){var t=a.get();if(!t.length)return!1;var o=ni(t),s=r.viewbox(),u=na(o),d=na(s);return u.left>=d.left&&u.right<=d.right&&u.top>=d.top&&u.bottom<=d.bottom}this._flush=o.flush}KeepSelectionVisible.$inject=[`eventBus`,`canvas`,`selection`];var _o={__init__:[`keepSelectionVisible`],__depends__:[sa],keepSelectionVisible:[`type`,KeepSelectionVisible]};function NavigatedViewer(t){la.call(this,t)}K(NavigatedViewer,la),NavigatedViewer.prototype._navigationModules=[_o,ar,nn,kt],NavigatedViewer.prototype._modules=[].concat(la.prototype._modules,NavigatedViewer.prototype._navigationModules);var vo={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
|
|
1
|
+
import{a as t,i as r,n as a,o,r as s,t as u}from"./rolldown-runtime-B8BYMn-z.js";import{a as d,c as f,d as p,h,i as g,n as _,r as v,s as y,u as b}from"./vendor-NJP34MHU.js";import{i as x,n as S}from"./translator-B2N3PQBL.js";import{C,l as w,m as T,x as E}from"./frontend-caI7mOAL.js";import{Dn as D,Fn as O,Gn as k,In as ee,Jn as A,Kn as j,Mn as te,Nn as ne,Pn as re,Sn as M,Vt as ie,ct as ae,jn as N,lt as oe,qn as se,t as ce,ut as le,xn as ue}from"./bridgeInstance-DQk-c8L1.js";import{A as de,C as fe,D as pe,F as me,L as he,M as ge,N as _e,O as ve,R as P,S as ye,T as be,_ as xe,a as Se,b as Ce,c as we,f as Te,g as Ee,h as De,i as Oe,k as ke,l as Ae,m as F,n as je,o as Me,p as Ne,r as Pe,s as I,t as L,u as R,v as Fe,w as Ie,x as Le,y as Re}from"./dist-CRJyslwo.js";import{t as ze}from"./dist-DgvQWhKm.js";import{A as Be,C as Ve,D as He,E as Ue,N as We,O as Ge,T as Ke,a as qe,j as Je,k as Ye,l as Xe}from"./moddle-CGpeSs3G.js";import{t as Ze}from"./dist-BqwyxNP3.js";import{t as Qe}from"./platform-CkWAyNst.js";import{C as $e,D as et,E as tt,O as nt,T as rt,b as it,g as at,h as ot,p as st,s as ct,t as lt,w as ut,x as dt}from"./bpmnTheme-cOvp4qFc.js";import{u as ft}from"./ui-3pEQJ50t.js";import{a as pt,i as mt,r as ht}from"./lib-DAKOOgix.js";import{i as gt,o as _t}from"./preferences-nBrFGN89.js";import{$ as vt,$t as yt,A as bt,An as xt,At as St,B as Ct,Bt as wt,C as Tt,Cn as Et,Ct as Dt,D as Ot,Dn as kt,Dt as At,E as jt,En as Mt,Et as Nt,F as Pt,Fn as Ft,Ft as It,G as Lt,Gt as Rt,H as zt,Ht as Bt,I as Vt,In as Ht,It as Ut,J as Wt,Jt as Gt,K as Kt,Kt as qt,L as Jt,M as Yt,Mn as Xt,Mt as Zt,N as Qt,Nn as $t,Nt as en,O as tn,On as nn,Ot as rn,P as an,Pn as sn,Pt as cn,Q as ln,Qt as un,R as dn,Rt as pn,S as mn,Sn as hn,St as gn,T as _n,Tn as vn,Tt as yn,U as bn,Ut as xn,V as Sn,Vt as Cn,W as z,Wt as wn,X as Tn,Xt as En,Y as Dn,Yt as On,Z as kn,Zt as An,_ as jn,_n as Mn,_t as Nn,an as Pn,at as Fn,b as In,bn as Ln,bt as Rn,c as zn,cn as Bn,ct as Vn,d as Hn,dn as Un,dt as Wn,en as Gn,et as Kn,f as qn,fn as Jn,ft as Yn,g as Xn,gn as Zn,gt as Qn,h as $n,hn as er,ht as tr,i as nr,in as rr,it as B,j as ir,jn as ar,jt as sr,k as cr,kn as lr,kt as ur,l as dr,ln as fr,lt as pr,mn as mr,mt as hr,n as gr,nn as _r,nt as V,on as vr,ot as yr,p as br,pn as xr,pt as Sr,q as Cr,qt as wr,rn as Tr,rt as Er,sn as Dr,st as Or,tn as kr,tt as Ar,u as jr,un as Mr,ut as Nr,v as Pr,vn as Fr,vt as Ir,w as Lr,wn as Rr,wt as zr,x as Br,xn as Vr,xt as Hr,y as Ur,yn as Wr,yt as Gr,z as H,zt as Kr}from"./duplicate-DNPpPVse.js";import{$ as qr,$t as Jr,A as Yr,At as Xr,B as Zr,Bt as Qr,Ct as $r,D as ei,E as ti,Et as ni,F as ri,Ft as ii,Gt as ai,H as oi,Ht as si,I as ci,It as li,J as U,Jt as ui,K as W,Kt as di,L as fi,Lt as pi,M as mi,Mt as hi,N as gi,Nt as _i,O as vi,Ot as yi,P as bi,Pt as xi,Qt as Si,R as Ci,Rt as wi,S as Ti,St as Ei,T as Di,Tt as Oi,U as ki,V as Ai,Vt as ji,W as Mi,Wt as Ni,Xt as Pi,Y as G,Yt as Fi,_ as Ii,a as Li,bt as Ri,ct as zi,dt as Bi,et as Vi,f as Hi,ft as Ui,g as Wi,h as Gi,in as K,j as Ki,jt as qi,k as Ji,kt as Yi,lt as Xi,m as Zi,mt as Qi,nn as $i,nt as ea,o as ta,ot as na,p as ra,pt as ia,q as aa,qt as oa,r as sa,rn as ca,t as la,tn as ua,ut as da,v as q,vt as fa,w as pa,wt as ma,x as ha,xt as ga,y as _a,yt as va,z as ya,zt as ba}from"./Viewer-CZiVl0t6.js";import{a as xa,i as Sa,s as J}from"./dist-CHluRwHI.js";import{a as Ca,n as wa,r as Ta,t as Ea}from"./dist-TNwbKIWT.js";import{i as Da,n as Oa,r as ka,t as Aa}from"./stackblur-es-Djj-lnDR.js";import{I as ja,M as Ma,c as Na,ht as Pa,pt as Fa,t as Ia}from"./dist-CsBP6QjA.js";import{t as La}from"./array-move-Bc4mVEdq.js";import{t as Ra}from"./dist-Km3QNqlU.js";import{t as za}from"./groovy-DASguM_i.js";import{n as Ba}from"./dist-CnDXCEJ_.js";import{a as Va,c as Ha,f as Ua,i as Wa,l as Ga,m as Ka,p as qa,r as Ja,s as Ya,u as Xa}from"./apply-HqvoGwLE.js";import{n as Za,s as Qa}from"./dockLayout-CxOMo-Nl.js";F();function scriptWhatOf(t,r={}){switch(t){case`CONDITION`:case`FEEL_CONDITION`:return x(`app.scriptTab.condition`);case`EXECUTION_LISTENER`:return x(`app.scriptTab.executionListener`,{event:r.event??``});case`TASK_LISTENER`:return x(`app.scriptTab.taskListener`,{event:r.event??``});case`PARAMETER`:case`INPUT_MAPPING`:case`OUTPUT_MAPPING`:return r.parameter?.direction===`output`?x(`app.scriptTab.output`,{name:r.parameter.name}):x(`app.scriptTab.input`,{name:r.parameter?.name??``});case`TASK_BODY`:return x(`app.scriptTab.script`)}}function scriptTitle(t,r){return x(`app.scriptTab.title`,{name:t,what:r})}function scriptTitleOf(t){return scriptTitle(t.shared?x(`app.scriptTab.nameWithId`,{name:t.name,id:t.slot.elementId}):t.name,scriptWhatOf(t.slot.owner,t))}var $a=new Set(`String.string.str.CharSequence.char.Char.Character.Integer.int.Int.int32.int64.Long.long.Short.short.Byte.byte.Double.double.Float.float.float32.float64.decimal.Decimal.BigDecimal.BigInteger.Number.number.Boolean.boolean.bool.Date.LocalDate.LocalDateTime.LocalTime.OffsetDateTime.ZonedDateTime.Instant.Duration.UUID.Guid.DateTime.DateTimeOffset.TimeSpan.date.datetime.Time`.split(`.`)),eo=new Set([`List`,`ArrayList`,`LinkedList`,`Set`,`HashSet`,`LinkedHashSet`,`TreeSet`,`Collection`,`Iterable`,`Array`,`array`,`Optional`,`IList`,`IEnumerable`,`ICollection`,`IReadOnlyList`,`IReadOnlyCollection`,`Sequence`]),to=new Set([`null`,`undefined`,`None`,`nil`,``]);function splitTop(t,r){let a=[],o=0,s=0;for(let u=0;u<t.length;u+=1){let d=t[u];d===`<`||d===`[`||d===`(`?o+=1:d===`>`||d===`]`||d===`)`?--o:d===r&&o===0&&(a.push(t.slice(s,u)),s=u+1)}return a.push(t.slice(s)),a}function unwrap$1(t){let r=t.trim().replace(/^readonly\s+/,``).replace(/^[*&]+/,``).replace(/^["']|["']$/g,``).replace(/\?$/,``).trim(),a=r.split(`|`).map(t=>t.trim()).filter(t=>!to.has(t));return a.length===1?a[0]:a.length===0?``:r}r(unwrap$1,`unwrap`);function parse(t){if(t.endsWith(`[]`))return{base:`array`,args:[t.slice(0,-2)]};if(t.startsWith(`[]`))return{base:`array`,args:[t.slice(2)]};let r=/^([A-Za-z_][\w.]*)\s*[<[]([\s\S]*)[>\]]$/.exec(t);return r?{base:r[1],args:splitTop(r[2],`,`)}:{base:t,args:null}}function open$1(t){return{kind:`open`,name:t}}r(open$1,`open`);function declared(t,r,a,o){let s=r.get(t);if(!s||a>3||o.includes(t))return open$1(t);if(s.kind===`enum`)return{kind:`enum`,name:t,constants:s.constants};if(s.open)return open$1(t);let u=s.extends===null?void 0:r.get(s.extends);if(s.extends!==null&&(!u||u.kind!==`class`||u.open||u.extends!==null))return open$1(t);let d=s.fields,f=new Set(d.map(t=>t.name)),p=(u?.fields??[]).filter(t=>!f.has(t.name));return{kind:`object`,name:t,fields:[...d,...p].map(s=>({name:s.name,serialised:s.serialised,type:resolveType(s.type,r,a+1,[...o,t])}))}}function resolveType(t,r,a=1,o=[]){let s=unwrap$1(t??``);if(s===``)return open$1(``);let{base:u,args:d}=parse(s),f=u.slice(u.lastIndexOf(`.`)+1);return d!==null&&d.length===1&&eo.has(f)?{kind:`collection`,name:f,element:resolveType(d[0],r,a,o)}:d===null&&$a.has(f)?{kind:`scalar`,name:f}:declared(f,r,a,o)}function fieldNamed(t,r){return t.find(t=>t.name===r)??t.find(t=>/^[A-Z]/.test(t.name)&&t.name.charAt(0).toLowerCase()+t.name.slice(1)===r)}var no=new Set([`input`,`loop element`]);function visibleAt(t,r,a,o){return o.wholeProcess?r.elementId===a?no.has(r.where)||o.includeOwnCode===!0&&r.path!==void 0:!no.has(r.where)&&O(t,r.elementId,a):r.elementId===a&&r.path!==void 0}function knownVariable(t,r,a){let o=r.map(t=>({elementId:t.elementId,where:t.where,type:t.type??null,sample:t.sample??null,path:t.path??null,line:t.line??null,offset:t.offset??null})),s=[...new Set(o.map(t=>t.type))],u=s.filter(t=>t!==null);if(u.length>1)return{name:t,certainty:`ambiguous`,type:null,shape:resolveType(null,a),writers:o};if(u.length===1&&s.length===1){let r=resolveType(u[0],a);return{name:t,certainty:r.kind===`open`?`open`:`exact`,type:u[0],shape:r,writers:o}}return{name:t,certainty:`open`,type:null,shape:resolveType(null,a),writers:o}}function variablesAt(t,r,a){let o=new Map(t.types.map(t=>[t.name,t])),s=t.inputs??[],u=t.model.variables.filter(o=>o.writes&&visibleAt(t.order,o,r,a));return{variables:[...new Set([...u.map(t=>t.name),...a.wholeProcess?s:[]])].sort().map(t=>knownVariable(t,u.filter(r=>r.name===t),o)),startVariablesUnknown:s.length===0}}function namesOf$2(t){let r=new Map,visit=t=>{t?.id&&(r.set(t.id,typeof t.name==`string`&&t.name.trim()?t.name.trim():t.id),(t.flowElements??[]).forEach(visit))};return(t?.rootElements??[]).filter(t=>t.$type===`bpmn:Process`).forEach(t=>(t.flowElements??[]).forEach(visit)),r}r(namesOf$2,`namesOf`);function writerOf(t,r,a){return t.path===null?{label:r.get(t.elementId)??t.elementId,elementId:t.elementId,...a?{diagramPath:a}:{},...t.sample===null?{}:{sample:t.sample}}:{label:`${ue(t.path)}:${t.line??0}`,elementId:t.elementId,path:t.path,...t.line===null?{}:{line:t.line},...t.offset===null?{}:{offset:t.offset}}}function variableOf(t,r,a,o){return{name:t.name,...t.type===null?{}:{type:t.type},declaredByScript:se(a,t.name),writers:t.writers.map(t=>writerOf(t,r,o))}}function scriptContextOf(t,r,a){let o={variables:[...j(t.definitions).uses,...M(t.workers)]},s=ee(t.definitions).flows.get(r)?.target??r,u=variablesAt({model:o,order:re(t.definitions),types:t.workers?.types??[],inputs:t.inputs},s,{wholeProcess:!0}),d=namesOf$2(t.definitions);return u.variables.map(r=>variableOf(r,d,a,t.diagramPath))}var ro=/\b(?:byte|short|int|integer|long|float|double|number|bigdecimal|biginteger)\b/i,io=/\b(?:byte|short|int|integer|long|biginteger)\b/i,ao=/\b(?:bool|boolean)\b/i,oo=/^(?:list|set|collection|sequence|iterable|sortedset|array)$/i,so=/^(?:map|object|jsonnode|jsonobject|record|dictionary)$/i;function valueFor(t){if(!t)return`?`;let r=t.replace(/<.*$/,``).trim();return oo.test(r)||/\[\]$/.test(r)?[]:so.test(r)?{}:ao.test(r)?!1:io.test(r)||ro.test(r)?0:`?`}function exampleJson(t){return JSON.stringify(Object.fromEntries(t.map(t=>[t.name,valueFor(t.type)])),null,2)}function exampleInput(t,r,a,o){let s=new Map;(r?.variables??[]).filter(t=>t.elementId===a&&t.type).forEach(t=>s.set(t.name,t.type??null));let{uses:u}=j(t),d=new Set(u.filter(t=>t.writes&&t.elementId===a).map(t=>t.name)),f=new Set;return u.filter(t=>t.writes&&!d.has(t.name)).forEach(t=>{O(o,t.elementId,a)&&f.add(t.name)}),(r?.variables??[]).filter(t=>t.elementId===a&&!t.writes).forEach(t=>f.add(t.name)),[...f].sort().map(t=>({name:t,type:s.get(t)??null}))}var co=`camundaModeler:exampleOutputJson`,lo=[`serviceTask`,`sendTask`,`receiveTask`,`businessRuleTask`,`userTask`,`callActivity`],uo={JOB_TYPE:`JOB_TYPE`,TOPIC:`TOPIC`,JAVA_CLASS:`CLASS`,BEAN:`BEAN`};function elementSubjects(t){let r=new Map,add=(t,a)=>{let o=r.get(t);o?o.push(a):r.set(t,[a])},a=new Map(t.messages.map(t=>[t.id,t.name]));return t.workers.forEach(t=>add(t.elementId,{kind:uo[t.kind],value:t.value,...t.listener?{listener:t.listener}:{}})),t.calls.forEach(t=>add(t.elementId,{kind:`PROCESS`,value:t.calledProcessId})),t.decisionUses.forEach(t=>add(t.elementId,{kind:`DECISION`,value:t.decisionId})),t.messageUses.filter(t=>t.catches).forEach(t=>{let r=a.get(t.messageId);r&&add(t.elementId,{kind:`MESSAGE`,value:r})}),t.elements.filter(t=>lo.includes(t.type)||r.has(t.id)).map(t=>({elementId:t.id,elementType:t.type,label:t.label,bindings:r.get(t.id)??[]}))}function withRuntimeFacts(t,r){let{reached:a=null,paused:o}=r;return!a&&(!o||o.size===0)?t:t.map(t=>({...t,reached:a&&t.state!==`notApplicable`?a.has(t.elementId):t.reached,paused:o?.has(t.elementId)??t.paused}))}function isBadged(t){return t.state!==`notApplicable`&&lo.includes(t.elementType)}var fo=/^Focus process instance (.+)$/;function localised(t){if(typeof t!=`string`)return String(t??``);let r=fo.exec(t);return r?pt(`Focus process instance {id}`,{id:r[1]}):pt(t)}var po=`svg, [contenteditable]`;function localiseText(t){try{if(!t||typeof t.data!=`string`||t.parentElement?.closest(po))return;let r=t.data,a=r.trim();if(!a)return;let o=localised(a);o!==a&&(t.data=r.replace(a,o))}catch{}}var mo=[`title`,`aria-label`];function localiseLabels(t){try{if(!t||typeof t.getAttribute!=`function`||typeof t.setAttribute!=`function`||t.closest?.(po))return;for(let r of mo){let a=t.getAttribute(r);if(!a)continue;let o=localised(a);o!==a&&t.setAttribute(r,o)}}catch{}}function localiseTree(t){try{if(!t||typeof t.nodeType!=`number`)return;if(t.nodeType===Node.TEXT_NODE){localiseText(t);return}if(t.nodeType!==Node.ELEMENT_NODE)return;let r=t;if(localiseLabels(r),r.querySelectorAll?.(`[title], [aria-label]`).forEach(localiseLabels),typeof document<`u`&&typeof document.createTreeWalker==`function`){let t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(;t.nextNode();)localiseText(t.currentNode)}}catch{}}var TokenSimulationTranslator=class{static $inject=[`canvas`];constructor(t){try{if(!t||typeof t.getContainer!=`function`)return;let r=t.getContainer();if(!r||typeof r.nodeType!=`number`||(localiseTree(r),typeof MutationObserver!=`function`))return;new MutationObserver(t=>{try{for(let r of t)r.type===`attributes`?localiseLabels(r.target):r.type===`characterData`?localiseText(r.target):r.addedNodes.forEach(localiseTree)}catch{}}).observe(r,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:mo})}catch{}}},ho={__init__:[`tokenSimulationTranslator`],tokenSimulationTranslator:[`type`,TokenSimulationTranslator]};function BaseModeler(t){Mi.call(this,t),this.on(`import.parse.complete`,function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on(`diagram.destroy`,function(){this.get(`moddle`).ids.clear()},this)}K(BaseModeler,Mi),BaseModeler.prototype._createModdle=function(t){var r=Mi.prototype._createModdle.call(this,t);return r.ids=new Ze([32,36,1]),r},BaseModeler.prototype._collectIds=function(t,r){var a=t.$model.ids,o;for(o in a.clear(),r)a.claim(o,r[o])};var go=300;function KeepSelectionVisible(t,r,a){this._selectionWasVisible=!1;let o=Pe(()=>{this._selectionWasVisible=isSelectionVisible()},go);t.on(`canvas.viewbox.changed`,o),t.on(`selection.changed`,o),t.on(`diagram.destroy`,()=>{o.cancel()}),t.on(`canvas.resized`,()=>{var t=a.get();if(t.length&&this._selectionWasVisible&&!isSelectionVisible()){var o=r.getRootElement();r.scrollToElement(t.concat(o))}});function isSelectionVisible(){var t=a.get();if(!t.length)return!1;var o=ni(t),s=r.viewbox(),u=na(o),d=na(s);return u.left>=d.left&&u.right<=d.right&&u.top>=d.top&&u.bottom<=d.bottom}this._flush=o.flush}KeepSelectionVisible.$inject=[`eventBus`,`canvas`,`selection`];var _o={__init__:[`keepSelectionVisible`],__depends__:[sa],keepSelectionVisible:[`type`,KeepSelectionVisible]};function NavigatedViewer(t){la.call(this,t)}K(NavigatedViewer,la),NavigatedViewer.prototype._navigationModules=[_o,ar,nn,kt],NavigatedViewer.prototype._modules=[].concat(la.prototype._modules,NavigatedViewer.prototype._navigationModules);var vo={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
|
|
2
2
|
<line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
3
|
<rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
4
|
<rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
@@ -1900,6 +1900,6 @@ get or else(null, null)
|
|
|
1900
1900
|
<span class="bts-label"></span> <span class="bts-toggle">${tO()}</span>
|
|
1901
1901
|
</div>
|
|
1902
1902
|
`),this._label=ua(`.bts-label`,this._container),this._label.textContent=this._translate(`Token Simulation`),this._toggle=ua(`.bts-toggle`,this._container),Jr.bind(this._container,`click`,()=>this.toggleMode()),this._canvas.getContainer().appendChild(this._container)},ToggleMode.prototype._toggleIcon=function(t){this._toggle.innerHTML=t?nO():tO()},ToggleMode.prototype.toggleMode=function(t=!this._active){if(t!==this._active){if(t)Fi(this._canvasParent).add(`simulation`),Fi(this._palette).add(`hidden`);else{Fi(this._canvasParent).remove(`simulation`),Fi(this._palette).remove(`hidden`);let t=this._selection.get();t.length===1&&this._contextPad.open(t[0])}this._toggleIcon(t),this._eventBus.fire(aD,{active:t}),this._active=t}},ToggleMode.$inject=[`eventBus`,`canvas`,`selection`,`contextPad`,`translate`];var ak={__init__:[`toggleMode`],toggleMode:[`type`,ToggleMode]};function EditorActions(t,r,a,o,s,u){var d=!1;s.register({toggleTokenSimulation:function(){r.toggleMode()}}),s.register({togglePauseTokenSimulation:function(){d&&a.toggle()}}),s.register({resetTokenSimulation:function(){d&&o.resetSimulation()}});let f=u.get(`log`,!1);f&&s.register({toggleTokenSimulationLog:function(){f.toggle()}}),t.on(aD,t=>{d=t.active})}EditorActions.$inject=[`eventBus`,`toggleMode`,`pauseSimulation`,`resetSimulation`,`editorActions`,`injector`];var ok={__init__:[`tokenSimulationEditorActions`],tokenSimulationEditorActions:[`type`,EditorActions]},sk=1e4;function KeyboardBindings(t,r){var a=r.get(`editorActions`,!1),o=r.get(`keyboard`,!1);if(!o||!a)return;var s=!1;function handleKeyEvent(t){if(isKey([`t`,`T`],t))return a.trigger(`toggleTokenSimulation`),!0;if(s){if(isKey([`l`,`L`],t))return a.trigger(`toggleTokenSimulationLog`),!0;if(isKey([` `,`Spacebar`],t))return a.trigger(`togglePauseTokenSimulation`),!0;if(isKey([`r`,`R`],t))return a.trigger(`resetTokenSimulation`),!0}}t.on(`keyboard.init`,function(){o.addListener(sk,function(t){var r=t.keyEvent;return handleKeyEvent(r)})}),t.on(aD,function(t){s=!!t.active})}KeyboardBindings.$inject=[`eventBus`,`injector`];function isKey(t,r){return t.indexOf(r.key)>-1}var ck={__depends__:[ZO,tk,ik,ak,ok,{__init__:[`tokenSimulationKeyboardBindings`],tokenSimulationKeyboardBindings:[`type`,KeyboardBindings]}]};function getScriptType$1(t){let r=W(t);if(r)return getScriptValue(r)===void 0?r?.get?.(`camunda:resource`)===void 0?void 0:`resource`:`script`}r(getScriptType$1,`getScriptType`);function getScriptFormat(t){return t?.get?.(`scriptFormat`)}function scriptWriteProperties(t,r,a,o){let s={[r]:a||``};return a&&o&&!getScriptFormat(t)&&(s.scriptFormat=o),s}function projectScriptFormat(){return(typeof window<`u`?window.appConfig?.scriptFormat:void 0)||void 0}function getScriptValue(t){if(t)return t?.get?.(getScriptProperty(t))}function getScriptProperty(t){return isScript(t)?`value`:`script`}function isScript(t){return!(!t||t.$type!==`camunda:Script`&&!U(t,`camunda:Script`))}function getConditionExpression(t){try{if(!t)return;let r=W(t);return r?U(r,`bpmn:SequenceFlow`)?r?.get?.(`conditionExpression`):getConditionalEventDefinition(r)?.get?.(`condition`):void 0}catch{return}}function conditionHolderOf(t){try{if(!t)return;let r=W(t);if(!r)return;if(U(r,`bpmn:SequenceFlow`))return{moddleElement:r,property:`conditionExpression`};let a=getConditionalEventDefinition(r);return a?{moddleElement:a,property:`condition`}:void 0}catch{return}}function conditionRemovalContext(t){if(!getConditionExpression(t))return;let r=conditionHolderOf(t);return r?{element:t,moddleElement:r.moddleElement,properties:{[r.property]:void 0}}:void 0}function getScriptType(t){try{let r=getConditionExpression(t);return r?r?.get?.(`camunda:resource`)===void 0?`script`:`resource`:void 0}catch{return}}function getScriptLanguage(t){try{return getConditionExpression(t)?.get?.(`language`)}catch{return}}function conditionWriteProperties(t,r,a){let o={body:r||``};return r&&a&&!t?.get?.(`language`)&&(o.language=a),o}function getConditionalEventDefinition(t){try{return t&&U(t,`bpmn:Event`)?getEventDefinition(t,`bpmn:ConditionalEventDefinition`):void 0}catch{return}}function getEventDefinition(t,r){try{let a=W(t)?.get?.(`eventDefinitions`)||[];return Array.isArray(a)?a.find(t=>{try{return U(t,r)}catch{return!1}}):void 0}catch{return}}Sa();var lk=`#e5c07b`,uk=`#e06c75`,dk=`#56b6c2`,fk=`#ffffff`,pk=`#abb2bf`,mk=`#7d8799`,hk=`#61afef`,gk=`#98c379`,_k=`#d19a66`,vk=`#c678dd`,yk=`#21252b`,bk=`#2c313a`,xk=`#282c34`,Sk=`#353a42`,Ck=`#3E4451`,wk=`#528bff`,Tk=ja.theme({"&":{color:pk,backgroundColor:xk},".cm-content":{caretColor:wk},".cm-cursor, .cm-dropCursor":{borderLeftColor:wk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ck},".cm-panels":{backgroundColor:yk,color:pk},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:xk,color:mk,border:`none`},".cm-activeLineGutter":{backgroundColor:bk},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:Sk},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Sk,borderBottomColor:Sk},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:bk,color:pk}}},{dark:!0}),Ek=Ia.define([{tag:J.keyword,color:vk},{tag:[J.name,J.deleted,J.character,J.propertyName,J.macroName],color:uk},{tag:[J.function(J.variableName),J.labelName],color:hk},{tag:[J.color,J.constant(J.name),J.standard(J.name)],color:_k},{tag:[J.definition(J.name),J.separator],color:pk},{tag:[J.typeName,J.className,J.number,J.changed,J.annotation,J.modifier,J.self,J.namespace],color:lk},{tag:[J.operator,J.operatorKeyword,J.url,J.escape,J.regexp,J.link,J.special(J.string)],color:dk},{tag:[J.meta,J.comment],color:mk},{tag:J.strong,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.link,color:mk,textDecoration:`underline`},{tag:J.heading,fontWeight:`bold`,color:uk},{tag:[J.atom,J.bool,J.special(J.variableName)],color:_k},{tag:[J.processingInstruction,J.string,J.inserted],color:gk},{tag:J.invalid,color:fk}]),Dk=[Tk,Ma(Ek)],Ok=Na.define(za);function getLanguageExtension(t){return t&&t===`groovy`?Ok:Ba()}var kk=`bpmn:Definitions`;function definitionsOf$2(t){let r=W(t);for(;r&&r.$type!==kk;)r=r.$parent;return r??void 0}r(definitionsOf$2,`definitionsOf`);async function codeWritersOf(t){if(!t?.findWorkerVariables)return null;try{return await t.findWorkerVariables()}catch(t){return console.error(`Penstock could not read the variables the code writes:`,t),null}}async function contextAt(t,r,a){let o=definitionsOf$2(t);return!o||!t?.id?[]:scriptContextOf({definitions:o,workers:await codeWritersOf(a),diagramPath:a?.getBpmnFilePath?.()??void 0},t.id,r)}async function scriptContextFor(t,r,a,o){return A(r)?contextAt(t,a,o):[]}function feelContextFor(t,r,a){return contextAt(t,r,a)}var Ak={[w.EXECUTION_LISTENER]:`camunda:ExecutionListener`,[w.TASK_LISTENER]:`camunda:TaskListener`},jk=`camunda:OutputParameter`,Mk=`zeebe:IoMapping`;function extensionValuesOf(t){return t?.extensionElements?.values??[]}function listenersOf(t,r){let a=Ak[r];return a?extensionValuesOf(t).filter(t=>t.$type===a):[]}function parametersOf(t){let r=extensionValuesOf(t).find(t=>t.$type===`camunda:InputOutput`);return[...r?.inputParameters??[],...r?.outputParameters??[]]}function mappingsOf(t,r){return extensionValuesOf(t).find(t=>t.$type===Mk)?.[r]??[]}function holdersOf(t,r){return t===w.PARAMETER?parametersOf(r):t===w.INPUT_MAPPING?mappingsOf(r,`inputParameters`):t===w.OUTPUT_MAPPING?mappingsOf(r,`outputParameters`):listenersOf(r,t)}function scriptOf(t,r){return t===w.PARAMETER?r?.definition:r?.script}function isFeelOwner(t){return t===w.FEEL_CONDITION||t===w.INPUT_MAPPING||t===w.OUTPUT_MAPPING}function isMappingOwner(t){return t===w.INPUT_MAPPING||t===w.OUTPUT_MAPPING}function holderOf$1(t,r,a){return t===w.TASK_BODY||t===w.CONDITION||t===w.FEEL_CONDITION?r:isMappingOwner(t)?a:a?.$parent}r(holderOf$1,`holderOf`);function scriptSlotOf(t,r,a){if(!t?.id||!r)return;if(r===w.TASK_BODY||r===w.CONDITION||r===w.FEEL_CONDITION)return{elementId:t.id,owner:r,index:0};let o=holdersOf(r,W(t)).indexOf(holderOf$1(r,W(t),a));return o<0?void 0:{elementId:t.id,owner:r,index:o}}function feelPlaceOf(t,r){if(!isFeelOwner(r.owner))return;let a=r.owner===w.FEEL_CONDITION?`body`:`source`,o=r.owner===w.FEEL_CONDITION?U(t,`bpmn:SequenceFlow`)?t.conditionExpression:void 0:holdersOf(r.owner,t)[r.index];return o&&String(o[a]??``).startsWith(`=`)?{holder:o,key:a}:void 0}function feelValueOf(t,r){let a=feelPlaceOf(W(t),r);return a?te(a.holder[a.key]):void 0}function feelTabOf(t,r,a){let o=W(t);if(feelPlaceOf(o,{elementId:t?.id,owner:r,index:a}))return scriptTabOf(t,r,r===w.FEEL_CONDITION?void 0:holdersOf(r,o)[a])}function scriptSlotKey(t){return`${t.elementId}\u0000${t.owner}\u0000${t.index}`}function partOf(t,r){let a=t.get(`elementRegistry`).get(r.elementId),o=a?W(a):void 0;if(!a||!o)return;let s=t.get(`commandStack`),update=(t,r)=>s.execute(`element.updateModdleProperties`,{element:a,moddleElement:t,properties:r});if(isFeelOwner(r.owner)){let t=feelPlaceOf(o,r);return t?{read:()=>te(t.holder[t.key]),write:r=>(update(t.holder,{[t.key]:N(r)}),!0)}:void 0}if(r.owner===w.TASK_BODY){if(!U(o,`bpmn:ScriptTask`))return;let t=getScriptProperty(o);return{read:()=>getScriptValue(o)??``,write:r=>(update(o,scriptWriteProperties(o,t,r,projectScriptFormat())),!0)}}if(r.owner===w.CONDITION){let t=getConditionExpression(a);return t?{read:()=>t.get?.(`body`)??``,write:r=>{if(!r){let t=conditionRemovalContext(a);return t&&update(t.moddleElement,t.properties),!0}return update(t,conditionWriteProperties(t,r,projectScriptFormat())),!0}}:void 0}let u=scriptOf(r.owner,holdersOf(r.owner,o)[r.index]);if(u)return{read:()=>u.value??``,write:t=>(update(u,scriptWriteProperties(u,`value`,t,projectScriptFormat())),!0)}}function readScriptSlot(t,r){return partOf(t,r)?.read()}function writeScriptSlot(t,r,a){return partOf(t,r)?.write(a)??!1}function definitionsOf$1(t){let r=t;for(;r&&r.$type!==`bpmn:Definitions`;)r=r.$parent;return r}r(definitionsOf$1,`definitionsOf`);function namesOf$1(t,r){return(t??[]).forEach(t=>{typeof t.name==`string`&&t.name.trim()&&r.push(t.name.trim()),namesOf$1(t.flowElements,r)}),r}r(namesOf$1,`namesOf`);function isNameShared(t,r){return(definitionsOf$1(t)?.rootElements??[]).flatMap(t=>namesOf$1(t.flowElements,[])).filter(t=>t===r).length>1}function nameOf(t,r){let a=typeof r?.name==`string`?r.name.trim():``;return a?isNameShared(r,a)?x(`app.scriptTab.nameWithId`,{name:a,id:t.id}):a:t.id}function whatOf(t,r){let a=t===w.PARAMETER?{name:r?.name??``,direction:r?.$type===jk?`output`:`input`}:void 0;return scriptWhatOf(t,{event:r?.event,parameter:a})}function scriptTabOf(t,r,a){let o=scriptSlotOf(t,r,a);if(!o||!r)return;let s=W(t),u=holderOf$1(r,s,a),d=ne(definitionsOf$1(s)).find(t=>sameSlot(t.slot,o));return{slot:o,title:d?scriptTitleOf(d):scriptTitle(nameOf(t,s),whatOf(r,u))}}function sameSlot(t,r){return t.elementId===r.elementId&&t.owner===r.owner&&t.index===r.index}var Nk=new Set,Pk=new Set;function setOpenScriptTabs(t){Nk=new Set(t.map(scriptSlotKey)),Pk.forEach(t=>t())}function useScriptTabOpen(t){let r=t?scriptSlotKey(t):void 0,[a,o]=Or(()=>r!==void 0&&Nk.has(r));return Vn(()=>{if(r===void 0)return;let update=()=>o(Nk.has(r));return Pk.add(update),update(),()=>{Pk.delete(update)}},[r]),a}function CodeMirrorEntry({id:t,label:r,element:a,getValue:o,setValue:s,isDark:u,scriptFormat:d,scriptTab:f}){let p=Fn(null),h=Fn(null),g=Fn(new Fa),_=Fn([]),v=useScriptTabOpen(f?.slot),y=Fn(s);y.current=s;let b=Fn(null),S=Fn(null),flushValue=()=>{if(b.current&&=(clearTimeout(b.current),null),S.current===null)return;let t=S.current;S.current=null,y.current(t)},openExternalFile=async()=>{try{if(!f)return;let t=h.current?.state.doc.toString()??``,r=d&&d!==``?d:`javascript`,o=ce(),s=await scriptContextFor(a,r,t,o);await o.openScriptFile(r,t,f.slot,f.title,s)}catch(t){console.error(`Penstock could not open the script in a new tab:`,t)}};return Vn(()=>{if(!p.current)return;let t=[Ra,getLanguageExtension(d),g.current.of(ja.editable.of(!v)),ja.updateListener.of(t=>{t.docChanged&&(S.current=t.state.doc.toString(),b.current&&clearTimeout(b.current),b.current=setTimeout(flushValue,400))})];u&&t.push(Dk),_.current=t;let r=String(o?.()??``),a=new ja({parent:p.current,state:Pa.create({doc:r,extensions:t})});return h.current=a,()=>{flushValue(),a.destroy(),h.current=null}},[d,a]),Vn(()=>{h.current?.dispatch({effects:g.current.reconfigure(ja.editable.of(!v))})},[v]),Vn(()=>{let t=h.current;if(!t||S.current!==null)return;let r=String(o?.()??``);t.state.doc.toString()!==r&&t.setState(Pa.create({doc:r,extensions:_.current}))}),V(`div`,{className:`bio-properties-panel-entry`,id:t,children:[V(`label`,{className:`bio-properties-panel-label`,children:[r]}),V(`div`,{ref:p,style:{marginBottom:`8px`},children:[]}),...v?[V(`p`,{className:`bio-properties-panel-description`,children:[x(`app.properties.scriptInTab`)]})]:[],...f&&Qe(ce(),`externalScripts`)?[V(`div`,{style:{marginTop:`4px`,display:`flex`,justifyContent:`center`},children:[V(`button`,{className:`edit-script-external-file-button`,onClick:openExternalFile,children:[x(v?`app.properties.showScriptTab`:`app.properties.editInNewTab`)]})]})]:[]]})}function Script({element:t,idPrefix:r,script:a,commandStack:o,translate:s,defaultFormat:u,owner:d}){let f=a||W(t),p=getScriptProperty(f),getValue=()=>getScriptValue(f)||``,setValue=r=>{try{o?.execute?.(`element.updateModdleProperties`,{element:t,moddleElement:f,properties:scriptWriteProperties(f,p,r,u)})}catch{}},h=getScriptFormat(f)||u,g=typeof window<`u`?window.appConfig:void 0,_=g?.isDarkMode||g?.isDraculaMode||!1,y={id:r+`scriptValue-`+t.id,label:s(`Script`),element:t,getValue,setValue,isDark:_,scriptFormat:h,scriptTab:scriptTabOf(t,d,a)};return v(`div`,{children:v(CodeMirrorEntry,{...y})})}function ConditionalScript({element:t,commandStack:r,translate:a,defaultFormat:o,owner:s}){let getValue=()=>getConditionExpression(t)?.get?.(`body`)??``,setValue=a=>{try{if(!a){let a=conditionRemovalContext(t);a&&r?.execute?.(`element.updateModdleProperties`,a);return}let s=getConditionExpression(t);if(!s)return;r?.execute?.(`element.updateModdleProperties`,{element:t,moddleElement:s,properties:conditionWriteProperties(s,a,o)})}catch{}},u=getScriptLanguage(t)||o,d=typeof window<`u`?window.appConfig:void 0,f=d?.isDarkMode||d?.isDraculaMode||!1,p={id:`conditionScriptValue-`+t.id,label:a(`Script`),element:t,getValue,setValue,isDark:f,scriptFormat:u,scriptTab:scriptTabOf(t,s)};return v(`div`,{children:v(CodeMirrorEntry,{...p})})}var Fk=`element.updateModdleProperties`,Ik=`element.updateProperties`,Lk=new Set([`bpmn:ExclusiveGateway`,`bpmn:InclusiveGateway`,`bpmn:ComplexGateway`,`bpmn:Task`,`bpmn:UserTask`,`bpmn:ServiceTask`,`bpmn:ScriptTask`,`bpmn:BusinessRuleTask`,`bpmn:SendTask`,`bpmn:ReceiveTask`,`bpmn:ManualTask`,`bpmn:CallActivity`,`bpmn:SubProcess`,`bpmn:Transaction`]);function update$2(t,r,a){return{cmd:Fk,context:{element:t,moddleElement:r,properties:a}}}r(update$2,`update`);function conditionalEventDefinitionOf(t){return t?.eventDefinitions?.find(t=>t.$type===`bpmn:ConditionalEventDefinition`)}function supportsCondition(t){if(!t)return!1;if(conditionalEventDefinitionOf(t))return!0;if(t.$type!==`bpmn:SequenceFlow`)return!1;let r=t.sourceRef;return!r?.$type||r.default===t?!1:Lk.has(r.$type)}function conditionOf(t){if(!t)return;let r=conditionalEventDefinitionOf(t);return r?r.condition:t.conditionExpression}function expressionHolder(t){let r=conditionalEventDefinitionOf(t);return r?{holder:r,property:`condition`}:{holder:t,property:`conditionExpression`}}function setConditionBody(t,r,a,o){if(!r)return[];let s=conditionOf(r),u=(o??``).trim();if(!u){if(!s)return[];let{holder:a,property:o}=expressionHolder(r);return[update$2(t,a,{[o]:void 0})]}if(s)return[update$2(t,s,{body:u})];let d=a.create(`bpmn:FormalExpression`,{body:u}),{holder:f,property:p}=expressionHolder(r);return d.$parent=f,[update$2(t,f,{[p]:d})]}function setConditionLanguage(t,r,a){if(!r)return[];let o=conditionOf(r);return o?[update$2(t,o,{language:(a??``).trim()||void 0})]:[]}function supportsCalledElement(t){return t?.$type===`bpmn:CallActivity`}function setCalledElement(t,r){return[{cmd:Ik,context:{element:t,properties:{calledElement:(r??``).trim()||void 0}}}]}function standardLoopOf(t){let r=t?.loopCharacteristics;return r?.$type===`bpmn:StandardLoopCharacteristics`?r:void 0}function isLoopMaximumValid(t){let r=(t??``).trim();return!r||/^\d+$/.test(r)}function setLoopMaximum(t,r,a){if(!r||!isLoopMaximumValid(a))return[];let o=(a??``).trim();return o?[update$2(t,r,{loopMaximum:Number(o)})]:[update$2(t,r,{loopMaximum:void 0})]}function setTestBefore(t,r,a){return r?[update$2(t,r,{testBefore:a||void 0})]:[]}function setLoopCondition(t,r,a,o){if(!r)return[];let s=(o??``).trim(),u=r.loopCondition;if(!s)return u?[update$2(t,r,{loopCondition:void 0})]:[];if(u)return[update$2(t,u,{body:s})];let d=a.create(`bpmn:FormalExpression`,{body:s});return d.$parent=r,[update$2(t,r,{loopCondition:d})]}function dataObjectOf(t){if(t?.$type===`bpmn:DataObjectReference`)return t.dataObjectRef}function setDataObjectCollection(t,r,a){return r?[update$2(t,r,{isCollection:!!a})]:[]}var Rk=`properties-panel.multi-command-executor`;function ConditionExpressionEntry({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`),u=useService(`bpmnFactory`),d=W(t)??{};return H({element:t,id:r,label:o(`Condition Expression`),getValue:()=>conditionOf(d)?.body??``,setValue:r=>{let o=setConditionBody(t,d,u,r??``);o.length&&a.execute(Rk,o)},debounce:s})}function FeelTabEntry({element:t,owner:r,index:a}){let o=feelTabOf(t,r,a),s=useScriptTabOpen(o?.slot);if(!o)return null;let openExternalFile=async()=>{try{let r=ce(),a=feelValueOf(t,o.slot)??``,s=await feelContextFor(t,a,r);await r.openScriptFile(`feel`,a,o.slot,o.title,s)}catch(t){console.error(`Penstock could not open the expression in a new tab:`,t)}};return v(`div`,{style:{marginTop:`4px`,display:`flex`,justifyContent:`center`},children:v(`button`,{type:`button`,className:`edit-script-external-file-button`,onClick:openExternalFile,children:x(s?`app.properties.showScriptTab`:`app.properties.editInNewTab`)})})}var ScriptPropertiesProvider=class{static $inject=[`propertiesPanel`,`commandStack`,`translate`];commandStack;translate;constructor(t,r,a){t.registerProvider(200,this),this.translate=a,this.commandStack=r}getGroups(t){return r=>{try{if(!Array.isArray(r))return[];let a=r.find(t=>t?.id===`CamundaPlatform__Script`);a&&getScriptType$1(t)===`script`&&this.decorateItem(a,this.commandStack,this.translate,w.TASK_BODY);let o=r.find(t=>t?.id===`CamundaPlatform__Condition`);o&&this.decorateConditionExpression(o);let s=r.find(t=>t?.id===`condition`);s&&this.decorateFeelCondition(s,t);let u=r.find(t=>t?.id===`inputs`);u&&this.decorateFeelMappings(u,t,w.INPUT_MAPPING);let d=r.find(t=>t?.id===`outputs`);d&&this.decorateFeelMappings(d,t,w.OUTPUT_MAPPING),o&&getScriptType(t)===`script`&&this.decorateConditional(o,this.commandStack,this.translate);let f=r.find(t=>t?.id===`CamundaPlatform__TaskListener`);f&&this.decorateGroup(f,this.commandStack,this.translate,w.TASK_LISTENER);let p=r.find(t=>t?.id===`CamundaPlatform__ExecutionListener`);p&&this.decorateGroup(p,this.commandStack,this.translate,w.EXECUTION_LISTENER);let h=r.find(t=>t?.id===`CamundaPlatform__Input`);h&&this.decorateGroup(h,this.commandStack,this.translate,w.PARAMETER);let g=r.find(t=>t?.id===`CamundaPlatform__Output`);return g&&this.decorateGroup(g,this.commandStack,this.translate,w.PARAMETER),r}catch{return r||[]}}}decorateConditionExpression(t){if(!Array.isArray(t?.entries))return;let r=t.entries.find(t=>t?.id===`conditionExpression`);r&&(r.component=ConditionExpressionEntry)}decorateFeelCondition(t,r){if(!Array.isArray(t?.entries)||!feelTabOf(r,w.FEEL_CONDITION,0))return;let a=t.entries.findIndex(t=>t?.id?.endsWith(`conditionExpression`));a>=0&&this.insertFeelTab(t.entries,a,r,w.FEEL_CONDITION,0)}decorateFeelMappings(t,r,a){Array.isArray(t?.items)&&t.items.forEach((t,o)=>{if(!Array.isArray(t?.entries)||!feelTabOf(r,a,o))return;let s=t.entries.findIndex(t=>t?.id?.endsWith(`-source`));s>=0&&this.insertFeelTab(t.entries,s,r,a,o)})}insertFeelTab(t,r,a,o,s){let u=`${t[r].id}-edit-in-tab`;t.some(t=>t?.id===u)||t.splice(r+1,0,{id:u,component:FeelTabEntry,element:a,owner:o,index:s})}decorateConditional(t,r,a){if(!Array.isArray(t?.entries))return;let o=t.entries.find(t=>t?.id===`conditionScriptValue`);o&&(o.commandStack=r,o.translate=a,o.component=ConditionalScript,o.defaultFormat=projectScriptFormat(),o.owner=w.CONDITION)}decorateItem(t,r,a,o){if(!Array.isArray(t?.entries))return;let s=t.entries.find(t=>t?.id?.endsWith(`scriptValue`));s&&(s.commandStack=r,s.translate=a,s.component=Script,s.defaultFormat=projectScriptFormat(),s.owner=o)}decorateGroup(t,r,a,o){Array.isArray(t?.items)&&t.items.forEach(t=>this.decorateItem(t,r,a,o))}},zk={__init__:[`scriptPropertiesProvider`],scriptPropertiesProvider:[`type`,ScriptPropertiesProvider]},Bk=new Set([`conditionExpression`,`condition`,`conditionScriptValue`,`script`,`scriptValue`,`inputs`,`outputs`,`inputPropagation`,`outputPropagation`,`completionCondition`]),Vk={conditionExpression:`condition`,condition:`condition`,conditionScriptValue:`condition`,inputs:`input`,outputs:`output`,inputPropagation:`input`,outputPropagation:`output`,completionCondition:`completion condition`,script:`script`,scriptValue:`script`};function processesOf(t){try{let r=t,a=new Set;for(;r?.parent&&!a.has(r);)a.add(r),r=r.parent;let o=r?.businessObject;return o?o.$type===`bpmn:Collaboration`?(Array.isArray(o.participants)?o.participants:[]).map(t=>t?.processRef).filter(Boolean):[o]:[]}catch{return[]}}function expressionsAround(t){try{return k({rootElements:processesOf(t)})}catch{return[]}}function tryExpression(t,r,a){try{let o=Vk[a];return!o||!Array.isArray(t)?``:t.find(t=>t&&t.elementId===r?.id&&t.where===o)?.expression??``}catch{return``}}function tryEntriesOf(t,r,a){if(!Array.isArray(t)||!Array.isArray(r)||r.length===0)return[];let o=[];try{t.forEach(t=>{(Array.isArray(t?.entries)?t.entries:[]).forEach(t=>{if(!t?.id||!Bk.has(t.id))return;let s=tryExpression(r,a,t.id);s&&o.push({id:`${t.id}-try`,expression:s})})})}catch{}return o}var Hk={instance:null,kind:null,ask:null,trying:null,results:new Map,run:null},Uk=new Set;function trialState(){return Hk}function publishTrial(t){Hk={...Hk,...t},Uk.forEach(t=>{try{t(Hk)}catch(t){console.error(`Trial watcher error:`,t)}})}function watchTrial(t){return Uk.add(t),()=>{Uk.delete(t)}}function outcomeText(t){if(!t)return``;if(t.problem)return t.problem;let r;try{r=t.result===null?`null`:typeof t.result==`string`?t.result:JSON.stringify(t.result)}catch{r=String(t.result)}return t.secret?x(`app.live.secretNotResolved`,{value:r}):r}function TryOnInstance({expression:t}){let[r,a]=Or(trialState());Vn(()=>watchTrial(a),[]);let o=r?.results?.get?.(t??``),s=r?.kind===`CAMUNDA_8`;return v(`div`,{class:`penstock-try`,children:[!r?.instance&&v(`p`,{class:`penstock-try__note`,children:x(`app.properties.pickAnInstanceToRunThis`)}),r?.instance&&!s&&v(`p`,{class:`penstock-try__note`,children:x(`app.properties.sevenCannotEvaluate`)}),r?.instance&&s&&t&&v(h,{children:[v(`button`,{type:`button`,class:`ui-button`,disabled:r.trying!==null,onClick:()=>{try{r?.run?.(t)?.catch?.(()=>void 0)}catch{}},children:r.trying===t?x(`app.live.trying`):x(`app.properties.tryOnInstance`)}),o&&v(`p`,{class:`penstock-try__outcome`,children:outcomeText(o)}),(o?.warnings??[]).map(t=>v(`p`,{class:`penstock-try__outcome penstock-try__outcome--warning`,children:t},t))]})]})}var TryOnInstanceProvider=class{static $inject=[`propertiesPanel`];constructor(t){t.registerProvider(150,this)}getGroups(t){return r=>{try{if(!Array.isArray(r))return[];let a=tryEntriesOf(r,expressionsAround(t),t);return a.length===0?r:r.map(t=>{if(!Array.isArray(t?.entries))return t;let r=[];return t.entries.forEach(t=>{if(!t)return;r.push(t);let o=a.find(r=>r.id===`${t.id}-try`);o&&r.push({id:o.id,component:TryOnInstance,expression:o.expression})}),{...t,entries:r}})}catch{return r||[]}}}},Wk={__init__:[`tryOnInstanceProvider`],tryOnInstanceProvider:[`type`,TryOnInstanceProvider]},Gk=`element.updateModdleProperties`,Kk=new Set([`bpmn:Task`,`bpmn:UserTask`,`bpmn:ServiceTask`,`bpmn:ScriptTask`,`bpmn:BusinessRuleTask`,`bpmn:SendTask`,`bpmn:ReceiveTask`,`bpmn:ManualTask`,`bpmn:CallActivity`,`bpmn:SubProcess`,`bpmn:Transaction`,`bpmn:AdHocSubProcess`,`bpmn:Process`]);function supportsIoSpecification(t){return!!t?.$type&&Kk.has(t.$type)}function getIoSpecification(t){return t?.ioSpecification}function getDataInputs(t){let r=getIoSpecification(t)?.dataInputs;return Array.isArray(r)?r:[]}function getDataOutputs(t){let r=getIoSpecification(t)?.dataOutputs;return Array.isArray(r)?r:[]}function ensureId(t,r,a){if(t.id)return;let o=new Set(r.map(t=>t.id).filter(Boolean)),s=r.length+1;for(;o.has(`${a}_${s}`);)s+=1;t.id=`${a}_${s}`}function update$1(t,r,a){return{cmd:Gk,context:{element:t,moddleElement:r,properties:a}}}r(update$1,`update`);function ensureIoSpecification(t,r,a,o){let s=r.ioSpecification;if(s)return s;let u=a.create(`bpmn:InputSet`,{name:`Inputs`,dataInputRefs:[]}),d=a.create(`bpmn:OutputSet`,{name:`Outputs`,dataOutputRefs:[]}),f=a.create(`bpmn:InputOutputSpecification`,{dataInputs:[],dataOutputs:[],inputSets:[u],outputSets:[d]});return u.$parent=f,d.$parent=f,f.$parent=r,ensureId(f,[],`InputOutputSpecification`),ensureId(u,[],`InputSet`),ensureId(d,[],`OutputSet`),o.push(update$1(t,r,{ioSpecification:f})),f}function addDataInput(t,r,a,o){if(!r)return[];let s=[],u=ensureIoSpecification(t,r,a,s),d=a.create(`bpmn:DataInput`,{name:o});d.$parent=u,ensureId(d,u.dataInputs??[],`DataInput`),s.push(update$1(t,u,{dataInputs:[...u.dataInputs??[],d]}));let f=(u.inputSets??[])[0];return f&&s.push(update$1(t,f,{dataInputRefs:[...f.dataInputRefs??[],d]})),s}function addDataOutput(t,r,a,o){if(!r)return[];let s=[],u=ensureIoSpecification(t,r,a,s),d=a.create(`bpmn:DataOutput`,{name:o});d.$parent=u,ensureId(d,u.dataOutputs??[],`DataOutput`),s.push(update$1(t,u,{dataOutputs:[...u.dataOutputs??[],d]}));let f=(u.outputSets??[])[0];return f&&s.push(update$1(t,f,{dataOutputRefs:[...f.dataOutputRefs??[],d]})),s}function removeFrom(t,r){return(t??[]).filter(t=>t!==r)}function dropEmptySpecification(t,r,a,o,s,u){o.length||s.length||u.push(update$1(t,r,{ioSpecification:void 0}))}function removeDataInput(t,r,a){if(!r)return[];let o=r.ioSpecification;if(!o)return[];let s=[],u=removeFrom(o.dataInputs,a);s.push(update$1(t,o,{dataInputs:u})),(o.inputSets??[]).forEach(r=>{(r.dataInputRefs??[]).includes(a)&&s.push(update$1(t,r,{dataInputRefs:removeFrom(r.dataInputRefs,a)}))});let d=r.dataInputAssociations??[],f=d.filter(t=>t.targetRef!==a);return f.length!==d.length&&s.push(update$1(t,r,{dataInputAssociations:f})),dropEmptySpecification(t,r,o,u,o.dataOutputs??[],s),s}function removeDataOutput(t,r,a){if(!r)return[];let o=r.ioSpecification;if(!o)return[];let s=[],u=removeFrom(o.dataOutputs,a);s.push(update$1(t,o,{dataOutputs:u})),(o.outputSets??[]).forEach(r=>{(r.dataOutputRefs??[]).includes(a)&&s.push(update$1(t,r,{dataOutputRefs:removeFrom(r.dataOutputRefs,a)}))});let d=r.dataOutputAssociations??[],f=[];return d.forEach(r=>{let o=r.sourceRef??[];if(!o.includes(a)){f.push(r);return}let u=removeFrom(o,a);u.length&&(s.push(update$1(t,r,{sourceRef:u})),f.push(r))}),f.length!==d.length&&s.push(update$1(t,r,{dataOutputAssociations:f})),dropEmptySpecification(t,r,o,o.dataInputs??[],u,s),s}function renameData(t,r,a){return[update$1(t,r,{name:a})]}function setCollection(t,r,a){return[update$1(t,r,{isCollection:a})]}var qk=`properties-panel.multi-command-executor`;function run$1(t,r){if(r&&r.length)try{t?.execute(qk,r)}catch{}}r(run$1,`run`);function Name({element:t,id:r,parameter:a}){let o=useService(`commandStack`),s=useService(`translate`),u=useService(`debounceInput`);return H({element:a,id:r,label:s(`Name`),getValue:()=>a.name??``,setValue:r=>run$1(o,renameData(t,a,r??``)),debounce:u})}function Collection({element:t,id:r,parameter:a}){let o=useService(`commandStack`),s=useService(`translate`);return jn({element:a,id:r,label:s(x(`app.properties.isACollection`)),getValue:()=>!!a.isCollection,setValue:r=>run$1(o,setCollection(t,a,!!r))})}function entriesFor(t,r,a){return[{id:`${a}-name`,component:Name,parameter:r,element:t,isEdited:z},{id:`${a}-collection`,component:Collection,parameter:r,element:t,isEdited:kn}]}function itemsFor(t,r,a){let o=W(t),s=r===`input`?getDataInputs(o):getDataOutputs(o),u=r===`input`?`dataInput`:`dataOutput`;return s.map((s,d)=>{let f=`${t.id}-${u}-${d}`;return{id:f,label:s.name||``,entries:entriesFor(t,s,f),autoFocusEntry:`${f}-name`,remove:u=>{u.stopPropagation(),run$1(a,r===`input`?removeDataInput(t,o,s):removeDataOutput(t,o,s))}}})}function addFor(t,r,a,o){return s=>{s.stopPropagation();let u=W(t),d=r===`input`?getDataInputs(u):getDataOutputs(u),f=`${r===`input`?`Input`:`Output`}_${d.length+1}`;run$1(a,r===`input`?addDataInput(t,u,o,f):addDataOutput(t,u,o,f))}}function ioGroups(t,r){if(!t||!r||!supportsIoSpecification(W(t)))return[];let a,translate=t=>t,o;try{a=r.get?.(`commandStack`),translate=r.get?.(`translate`)??translate,o=r.get?.(`bpmnFactory`)}catch{return[]}return[{id:`Penstock__DataInputs`,label:translate(`Inputs`),component:Qt,items:itemsFor(t,`input`,a),add:addFor(t,`input`,a,o)},{id:`Penstock__DataOutputs`,label:translate(`Outputs`),component:Qt,items:itemsFor(t,`output`,a),add:addFor(t,`output`,a,o)}]}var IoSpecificationProvider=class{static $inject=[`propertiesPanel`,`injector`];injector;constructor(t,r){this.injector=r,t.registerProvider(this)}getGroups(t){return r=>{try{return(r||[]).concat(ioGroups(t,this.injector))}catch{return r||[]}}}},Jk={__init__:[`ioSpecificationProvider`],ioSpecificationProvider:[`type`,IoSpecificationProvider]},Yk=`properties-panel.multi-command-executor`;function run(t,r){if(r&&r.length)try{t?.execute(Yk,r)}catch{}}function businessOf$1(t){return t?W(t)??{}:{}}r(businessOf$1,`businessOf`);function ConditionExpression({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`),u=useService(`bpmnFactory`),d=businessOf$1(t);return dn({element:t,id:r,label:o(`Expression`),rows:2,getValue:()=>conditionOf(d)?.body??``,setValue:r=>run(a,setConditionBody(t,d,u,r??``)),debounce:s})}function ConditionLanguage({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`),u=businessOf$1(t);return H({element:t,id:r,label:o(`Language`),description:o(x(`app.properties.leaveEmptyForTheEngine`)),getValue:()=>conditionOf(u)?.language??``,setValue:r=>run(a,setConditionLanguage(t,u,r??``)),debounce:s})}function CalledElement({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`);return H({element:t,id:r,label:o(x(`app.properties.calledElement`)),description:o(x(`app.properties.idOfTheProcessTo`)),getValue:()=>businessOf$1(t).calledElement??``,setValue:r=>run(a,setCalledElement(t,r??``)),debounce:s})}function LoopCondition({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`),u=useService(`bpmnFactory`),d=standardLoopOf(businessOf$1(t));return dn({element:t,id:r,label:o(x(`app.properties.loopCondition`)),rows:2,getValue:()=>d?.loopCondition?.body??``,setValue:r=>d&&run(a,setLoopCondition(t,d,u,r??``)),debounce:s})}function LoopMaximum({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=useService(`debounceInput`),u=standardLoopOf(businessOf$1(t)),[d,f]=Or(!1);Vn(()=>f(!1),[t.id]);let p=H({element:t,id:r,label:o(x(`app.properties.loopMaximum`)),getValue:()=>u?.loopMaximum===void 0?``:String(u.loopMaximum),setValue:r=>{f(!isLoopMaximumValid(r??``)),u&&run(a,setLoopMaximum(t,u,r??``))},debounce:s});return v(`div`,{class:d?`loop-maximum-field has-error`:`loop-maximum-field`,children:[p,d&&v(ft,{children:o(x(`app.properties.loopMaximumWholeNumber`))})]})}function TestBefore({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=standardLoopOf(businessOf$1(t));return jn({element:t,id:r,label:o(x(`app.properties.testBefore`)),getValue:()=>!!s?.testBefore,setValue:r=>s&&run(a,setTestBefore(t,s,!!r))})}function DataObjectCollection({element:t,id:r}){let a=useService(`commandStack`),o=useService(`translate`),s=dataObjectOf(businessOf$1(t));return jn({element:t,id:r,label:o(x(`app.properties.isACollection`)),getValue:()=>!!s?.isCollection,setValue:r=>s&&run(a,setDataObjectCollection(t,s,!!r))})}function classicGroups(t,r){if(!t||!r)return[];let a=businessOf$1(t),translate=t=>t;try{translate=r.get?.(`translate`)??translate}catch{}let o=[];return supportsCondition(a)&&o.push({id:`Penstock__Condition`,label:translate(`Condition`),component:tn,entries:[{id:`conditionExpression`,component:ConditionExpression,isEdited:Lt},{id:`conditionLanguage`,component:ConditionLanguage,isEdited:z}]}),supportsCalledElement(a)&&o.push({id:`Penstock__CalledElement`,label:translate(x(`app.properties.calledElement`)),component:tn,entries:[{id:`calledElement`,component:CalledElement,isEdited:z}]}),standardLoopOf(a)&&o.push({id:`Penstock__Loop`,label:translate(`Loop`),component:tn,entries:[{id:`loopCondition`,component:LoopCondition,isEdited:Lt},{id:`loopMaximum`,component:LoopMaximum,isEdited:z},{id:`loopTestBefore`,component:TestBefore,isEdited:kn}]}),dataObjectOf(a)&&o.push({id:`Penstock__DataObject`,label:translate(x(`app.properties.dataObject`)),component:tn,entries:[{id:`dataObjectCollection`,component:DataObjectCollection,isEdited:kn}]}),o}var ClassicPropertiesProvider=class{static $inject=[`propertiesPanel`,`injector`];injector;constructor(t,r){this.injector=r,t.registerProvider(this)}getGroups(t){return r=>{try{return(r||[]).concat(classicGroups(t,this.injector))}catch{return r||[]}}}},Xk={__init__:[`classicPropertiesProvider`],classicPropertiesProvider:[`type`,ClassicPropertiesProvider]};function attributesFor(t,r){return r?.$instanceOf?Ge(t).filter(t=>t.panel&&t.owners.some(t=>r.$instanceOf(t))):[]}function prefixed(t,r){return`${t}:${r.name}`}function textEntry(t,r){return function FlowableTextEntry({element:a,id:o}){let s=useService(`modeling`),u=useService(`translate`),d=useService(`debounceInput`),f=prefixed(t,r);return H({element:a,id:o,label:u(r.name),getValue:()=>W(a).get(f)??``,setValue:t=>s.updateProperties(a,{[f]:t||void 0}),debounce:d})}}function checkboxEntry(t,r){return function FlowableCheckboxEntry({element:a,id:o}){let s=useService(`modeling`),u=useService(`translate`),d=prefixed(t,r);return jn({element:a,id:o,label:u(r.name),getValue:()=>W(a).get(d)===!0,setValue:t=>s.updateProperties(a,{[d]:t?!0:void 0})})}}function flowableGroups(t,r){let a=attributesFor(t,r?W(r):null);return a.length?[{id:`Penstock__${t}`,label:Ve(t)?.label??t,component:tn,entries:a.map(r=>({id:`${t}-${r.name}`,component:r.panel===`checkbox`?checkboxEntry(t,r):textEntry(t,r),isEdited:r.panel===`checkbox`?kn:z}))}]:[]}function flowableModule(t){class FlowablePropertiesProvider{static $inject=[`propertiesPanel`];constructor(t){t.registerProvider(this)}getGroups(r){return a=>{try{return(a||[]).concat(flowableGroups(t,r))}catch{return a||[]}}}}return{__init__:[`flowablePropertiesProvider`],flowablePropertiesProvider:[`type`,FlowablePropertiesProvider]}}var Zk=[],Qk=new Set;function sameNames(t,r){return t.length===r.length&&t.every((t,a)=>t===r[a])}function setProjectVariables(t){let r=[...new Set(t.filter(t=>t.kind===`VARIABLE`).map(t=>t.value))].sort();sameNames(r,Zk)||(Zk=r,Qk.forEach(t=>t()))}function projectVariableNames(){return Zk}function subscribeProjectVariables(t){return Qk.add(t),()=>{Qk.delete(t)}}var ProjectVariableProvider=class extends VariableProvider{static $inject=[`variableResolver`,`eventBus`];constructor(t,r){super(t);let a=subscribeProjectVariables(()=>r.fire(`variables.changed`));r.on(`diagram.destroy`,a)}getVariables(t){if(t?.$type!==`bpmn:Process`)return[];let r=t.$parent?j(t.$parent).uses.map(t=>t.name):[];return[...new Set([...Zk,...r])].sort().map(t=>({name:t,type:`Any`,info:x(`app.properties.projectVariable`)}))}},$k={__init__:[`projectVariableProvider`],projectVariableProvider:[`type`,ProjectVariableProvider]},eA=new Map([[T.NOT_FOUND,{sentence:`app.clientFacts.sentence.notFound`,hint:`app.clientFacts.hint.install`}],[T.INCOMPATIBLE,{sentence:`app.clientFacts.sentence.incompatible`,hint:`app.clientFacts.hint.install`}],[T.UNTRUSTED,{sentence:`app.clientFacts.sentence.untrusted`,hint:`app.clientFacts.hint.trust`}],[T.FAILED,{sentence:`app.clientFacts.sentence.failed`,hint:`app.clientFacts.hint.check`}],[T.TIMED_OUT,{sentence:`app.clientFacts.sentence.timedOut`,hint:`app.clientFacts.hint.check`}],[T.TOO_LARGE,{sentence:`app.clientFacts.sentence.tooLarge`,hint:`app.clientFacts.hint.fewerFiles`}]]);function noticeOf(t){return t&&t.files>0?eA.get(t.status):void 0}function hasClientFactsNotice(t){return noticeOf(t)!==void 0}function ClientFactsNotice({facts:t}){let r=noticeOf(t);return!t||!r?null:v(`div`,{class:`ui-empty client-facts-notice`,children:[v(`p`,{class:`ui-empty__title`,children:x(r.sentence)}),v(`p`,{class:`ui-empty__hint`,children:x(r.hint)}),t.reason&&v(`p`,{class:`type-help client-facts-notice__reason`,children:t.reason})]})}var tA=`properties-panel.multi-command-executor`,nA=`element.updateModdleProperties`,rA=5e3,update=(t,r,a)=>({cmd:nA,context:{element:t,moddleElement:r,properties:a}}),iA=null;async function recentAnswer(){let t=Date.now();if(iA&&t-iA.at<rA)return iA.answer;try{let r=await ce()?.findWorkerVariables?.().catch(()=>null);return iA={at:t,answer:r??null},r??null}catch{return null}}function definitionsOf(t){let r=W(t),a=0;for(;r&&r.$type!==`bpmn:Definitions`&&a<100;)r=r.$parent,a+=1;return r?.$type===`bpmn:Definitions`?r:null}function ExampleOutputEntry({element:t,id:r}){let a=useService(`commandStack`),o=useService(`moddle`),s=useService(`elementRegistry`),[u,d]=Or(null),[f,p]=Or(void 0),[h,g]=Or(`{}`),[_,y]=Or(!1);Vn(()=>{let r=!0;d(null),p(void 0),y(!1);let a=definitionsOf(t);return a?(recentAnswer().then(o=>{if(r){p(o?.clientFacts);try{let r=exampleInput(a,o,t?.id,re(a));d(r??[]),g(exampleJson(r??[]))}catch{d([]),g(`{}`)}}}).catch(()=>{r&&(d([]),g(`{}`))}),()=>{r=!1}):(d([]),()=>{r=!1})},[t?.id]);let write=()=>{try{let r=s?.get?.(t?.id);if(!r)return;let u=W(r);if(!u)return;let d=Array.isArray(u.extensionElements?.values)?u.extensionElements.values:[],f=d.find(t=>t?.$type===`zeebe:Properties`),p=Array.isArray(f?.get?.(`properties`))?f.get(`properties`):[],g=p.find(t=>t?.get?.(`name`)===co),_=g??o.create(`zeebe:Property`,{name:`camundaModeler:exampleOutputJson`}),v=f??o.create(`zeebe:Properties`,{properties:[...p,_]});_.$parent=v;let b=f?d:[...d,v],x=o.create(`bpmn:ExtensionElements`,{values:b});b.forEach(t=>{t&&(t.$parent=x)});let S=[update(r,u,{extensionElements:x})];f?g||S.push(update(r,f,{properties:[...p,_]})):S.push(update(r,x,{values:[...d,v]})),S.push(update(r,_,{value:h})),a?.execute?.(tA,S),y(!0)}catch{}};return u===null?v(`div`,{class:`penstock-example-output penstock-example-output--hint`,children:x(`app.properties.readingWhatReachesThisStep`)}):u.length===0?hasClientFactsNotice(f)?v(ClientFactsNotice,{facts:f}):v(`div`,{class:`penstock-example-output penstock-example-output--hint`,children:x(`app.properties.nothingReachesThisStep`)}):v(`div`,{class:`penstock-example-output`,children:[v(`ul`,{class:`penstock-example-output__list`,children:u.map(t=>v(`li`,{children:[t.name,v(`em`,{children:[` `,t.type??x(`app.properties.anyValue`)]})]},t.name))}),v(`pre`,{class:`penstock-example-output__json`,children:h}),v(`button`,{type:`button`,class:`ui-button`,"data-entry-id":r,onClick:write,title:x(`app.properties.writeThisAsTheExample`),children:x(_?`app.properties.exampleOutputWritten`:`app.properties.writeExampleOutput`)})]})}var aA=`exampleOutputFromCode`,oA=50,ExampleOutputProvider=class{static $inject=[`propertiesPanel`,`injector`];constructor(t,r){t.registerProvider(oA,this)}getGroups(t){return t=>{let r=t.find(t=>t.id===`additionalDataGroup`);return r&&(r.entries=[...r.entries,{id:aA,component:ExampleOutputEntry}]),t}}},sA={__init__:[`exampleOutputProvider`],exampleOutputProvider:[`type`,ExampleOutputProvider]},cA=[`element.updateModdleProperties`,`element.updateProperties`],lA=[`name`,`text`],EmptyValues=class{static $inject=[`eventBus`,`commandStack`];constructor(t,r){for(let r of cA)t.on(`commandStack.${r}.preExecute`,1500,t=>{let r=t?.context?.properties;if(r&&typeof r==`object`)for(let t of Object.keys(r))r[t]===``&&(r[t]=void 0)});t.on(`commandStack.element.updateLabel.postExecute`,1500,t=>{let a=t?.context?.element,o=a?.businessObject;if(t?.context?.newLabel!==``||!o)return;let s={};for(let t of lA)o[t]===``&&(s[t]=void 0);Object.keys(s).length&&r.execute(`element.updateModdleProperties`,{element:a,moddleElement:o,properties:s})})}},uA={__init__:[`emptyValues`],emptyValues:[`type`,EmptyValues]},ConventionsBehaviour=class{static $inject=[`eventBus`,`modeling`,`elementRegistry`];constructor(t,r,a){let o=window.appConfig?.conventions??{};(o.ids?.fromName||o.defaults)&&(t.on(`commandStack.shape.create.postExecute`,500,t=>{let s=t.context?.shape;s?.businessObject&&(this.applyDefaults(r,o,s),this.applyId(r,a,o,s,s.businessObject.name??``))}),t.on(`commandStack.shape.replace.postExecute`,500,t=>{let s=t.context?.newShape;s?.businessObject&&(this.applyDefaults(r,o,s),this.applyId(r,a,o,s,s.businessObject.name??``))}),t.on(`commandStack.element.updateLabel.postExecute`,500,t=>{let s=t.context?.element;s?.businessObject&&this.applyId(r,a,o,s,t.context?.newLabel??``)}))}applyDefaults(t,r,a){if(!a?.businessObject)return;let o=Ua(r,a.businessObject.$type),s=Object.entries(o);s.length!==0&&t.updateProperties(a,Object.fromEntries(s))}applyId(t,r,a,o,s){if(!o?.businessObject)return;let u=qa(o.businessObject,s,a.ids??{});if(!u||u===o.businessObject.id)return;let d=Ka(u,t=>!!r.get(t)&&t!==o.businessObject.id);t.updateProperties(o,{id:d})}},dA={__init__:[`penstockConventions`],penstockConventions:[`type`,ConventionsBehaviour]},CollapseEventSubProcess=class{constructor(t,r){t.registerProvider(`bpmn-replace`,this),this.modeling=r}getPopupMenuEntries(t){if(U(t,`bpmn:SubProcess`)&&t.businessObject.triggeredByEvent)return{"collapse-event-subprocess":{label:`Event sub-process `+(Ai(t)?`(collapsed)`:`(expanded)`),className:`bpmn-icon-event-subprocess-expanded`,action:()=>this.toggleCollapse(t)}}}toggleCollapse(t){this.modeling.toggleCollapse(t)}};CollapseEventSubProcess.$inject=[`popupMenu`,`modeling`];var fA={__init__:[`eventSubProcessCollapse`],eventSubProcessCollapse:[`type`,CollapseEventSubProcess]},pA=new Set([`bpmn:ServiceTask`,`bpmn:SendTask`,`bpmn:BusinessRuleTask`,`bpmn:IntermediateThrowEvent`,`bpmn:EndEvent`]),mA=new Set([`bpmn:MessageEventDefinition`,`bpmn:TimerEventDefinition`,`bpmn:SignalEventDefinition`,`bpmn:ConditionalEventDefinition`]),hA=new Set([`bpmn:ReceiveTask`,`bpmn:UserTask`,`bpmn:EventBasedGateway`]);function read(t,r){if(t?.get)try{return t.get(`camunda:${r}`)}catch{return}}function boundariesOf(t){if(t.type===`label`)return;let r=t.businessObject,a=r.loopCharacteristics,o=r.eventDefinitions?.[0]?.$type,s=hA.has(t.type)||pA.has(t.type)&&read(r,`type`)===`external`||t.type===`bpmn:IntermediateCatchEvent`&&o!==void 0&&mA.has(o)||!!read(r,`asyncBefore`)||!!read(a,`asyncBefore`),u=!!read(r,`asyncAfter`)||!!read(a,`asyncAfter`);return s||u?{before:s,after:u}:void 0}function sides(t,r,a){let o=t.y+a<=r.y,s=t.y-a>=r.y+r.height,u=t.x+a<=r.x,d=t.x-a>=r.x+r.width,f=o?`top`:s?`bottom`:null,p=u?`left`:d?`right`:null;return p&&f?`${f}-${p}`:p??f??`intersect`}var gA=x(`app.transactionBoundaries.transactionBoundaryTheEngineCommits`),_A=3,vA=20;function boundaryPlacement(t,r){let a=sides(r,t,-7);return a===`intersect`&&(a=sides(r,t,-20)),/left/.test(a)?{position:{left:-3,top:r.y-t.y-vA/2},width:_A,height:vA}:/right/.test(a)?{position:{right:t.x+t.width-r.x,top:r.y-t.y-vA/2},width:_A,height:vA}:a===`top`?{position:{left:r.x-t.x-vA/2,top:-3},width:vA,height:_A}:a===`bottom`?{position:{bottom:0,left:r.x-t.x-vA/2},width:vA,height:_A}:null}function boundaryPoints(t,r){let a=[],o=t.y+t.height/2;if(r.before){let r=t.incoming.filter(t=>t.type===`bpmn:SequenceFlow`);r.length>0?a.push(...r.map(t=>t.waypoints[t.waypoints.length-1])):a.push({x:t.x,y:o})}if(r.after){let r=t.outgoing.filter(t=>t.type===`bpmn:SequenceFlow`);r.length>0?a.push(...r.map(t=>t.waypoints[0])):a.push({x:t.x+t.width,y:o})}return a}var yA=`transaction-boundaries`,TransactionBoundaries=class{static $inject=[`elementRegistry`,`overlays`,`eventBus`];active=!1;registry;overlays;constructor(t,r,a){this.registry=t,this.overlays=r;try{a?.on?.([`elements.changed`,`import.done`],()=>{this.active&&this.draw()})}catch{}}draw(){if(typeof document<`u`)try{this.overlays?.remove?.({type:yA}),this.registry?.forEach?.(t=>{try{let r=boundariesOf(t);if(!r)return;for(let a of boundaryPoints(t,r)){let r=boundaryPlacement(t,a);if(!r)continue;let o=document.createElement(`div`);o.className=`transaction-boundary`,o.title=gA,o.style.width=`${r.width}px`,o.style.height=`${r.height}px`,this.overlays?.add?.(t,yA,{position:r.position,html:o})}}catch{}})}catch(t){console.error(t)}}show(){this.active=!0,this.draw()}hide(){this.active=!1;try{this.overlays?.remove?.({type:yA})}catch{}}toggle(){return this.active?this.hide():this.show(),this.active}},bA={__init__:[`transactionBoundaries`],transactionBoundaries:[`type`,TransactionBoundaries]},xA=`element.updateModdleProperties`,SA=`penstock:Comments`,CA=`penstock:Comment`,wA=`Comment_`;function holderOf(t){let r=t?.extensionElements?.values;return Array.isArray(r)?r.find(t=>t?.$type===SA):void 0}function commentsOf(t){let r=holderOf(t)?.comment;return Array.isArray(r)?[...r]:[]}function openComments(t){return commentsOf(t).filter(t=>t&&t.resolved!==!0)}function openCount(t){return openComments(t).length}function elementLabel(t){try{let r=t?.businessObject?.get?.(`name`);return(typeof r==`string`?r.trim():``)||`${(t?.businessObject?.$type??t?.type??`Element`).replace(/^bpmn:/,``)} ${t?.id??``}`.trim()}catch{return`${t?.id??`Element`}`.trim()}}function commentedElements(t){return Array.isArray(t)?t.filter(Boolean).map(t=>{let r=commentsOf(t?.businessObject);return{id:t?.id??``,label:elementLabel(t),open:r.filter(t=>t&&t.resolved!==!0),resolved:r.filter(t=>t&&t.resolved===!0)}}).filter(t=>t.open.length+t.resolved.length>0).sort((t,r)=>r.open.length-t.open.length||r.resolved.length-t.resolved.length||t.label.localeCompare(r.label)):[]}function openCommentTotal(t){return Array.isArray(t)?t.reduce((t,r)=>t+(r?openCount(r.businessObject):0),0):0}function isOwnComment(t,r){return!!r&&!!t&&t.author===r}function commentAuthor(t){return t?.gitUserName??``}function supportsComments(t){let r=t?.$type;return!r||r===`bpmn:Label`?!1:r.startsWith(`bpmn:`)&&!r.startsWith(`bpmndi:`)}function propsOf(t,r={}){let a={...t,...r};return delete a.$type,delete a.$parent,a.author===``&&delete a.author,a.text===``&&delete a.text,Object.fromEntries(Object.entries(a).filter(([,t])=>t!==void 0))}function copyOf(t,r,a={}){return t.create(CA,propsOf(r,a))}function nextId(t){let r=new Set((t??[]).map(t=>t?.id).filter(Boolean)),a=(t??[]).length+1;for(;r.has(`${wA}${a}`);)a+=1;return`${wA}${a}`}function extensionWith(t,r,a){if(!t)return;let o=Array.isArray(t.extensionElements?.values)?t.extensionElements.values:[],s=o.findIndex(t=>t?.$type===SA),u=o.filter(t=>t?.$type!==SA);if(a.length||u.length)return a.length&&(s>=0?u.splice(s,0,r.create(SA,{comment:a})):u.push(r.create(SA,{comment:a}))),r.create(`bpmn:ExtensionElements`,{values:u})}function command(t,r,a,o){return r?[{cmd:xA,context:{element:t,moddleElement:r,properties:{extensionElements:extensionWith(r,a,o)}}}]:[]}function addComment(t,r,a,o,s){if(!r)return[];let u=commentsOf(r),d=s instanceof Date&&!Number.isNaN(s.getTime())?s.toISOString():new Date().toISOString(),f=copyOf(a,{id:nextId(u),author:o?.author??``,date:d,text:o?.text??``});return command(t,r,a,[...u,f])}function changed(t,r,a,o,s){return command(t,r,a,commentsOf(r).map(t=>t===o?copyOf(a,t,s):t))}function setCommentText(t,r,a,o,s){return changed(t,r,a,o,{text:s})}function setCommentResolved(t,r,a,o,s){return changed(t,r,a,o,{resolved:s})}function removeComment(t,r,a,o){return command(t,r,a,commentsOf(r).filter(t=>t!==o))}var TA={rendering(){return gt()?.rendering===`sketchy`?`sketchy`:`default`},setRendering(t){_t({rendering:t})},commentBadges(){return gt()?.showCommentBadges!==!1},setCommentBadges(t){_t({showCommentBadges:t})},codeBadges(){return gt()?.showCodeBadges!==!1},setCodeBadges(t){_t({showCodeBadges:t})}},EA=`penstock-comment`,DA=/Task$|SubProcess$|CallActivity$|Transaction$|Group$|Lane$/,OA=r(()=>TA.commentBadges(),`shown`),open=()=>void 0;function setCommentBadgeOpener(t){open=t}function commentBadgeTitle(t){return x(`app.comments.openCommentCount`,{count:t})}function commentBadgePosition(t){let r=t?.businessObject?.$type??t?.type??``;return DA.test(r)?{bottom:-12,right:3}:{bottom:-12,right:-6}}var CommentBadges=class{static $inject=[`elementRegistry`,`overlays`,`eventBus`];registry;overlays;eventBus;redraw=()=>this.refresh();constructor(t,r,a){this.registry=t,this.overlays=r,this.eventBus=a,a?.on?.([`elements.changed`,`import.done`,`commandStack.changed`],this.redraw)}destroy(){try{this.eventBus?.off?.([`elements.changed`,`import.done`,`commandStack.changed`],this.redraw)}catch{}try{this.overlays?.remove?.({type:EA})}catch{}}refresh(){try{this.overlays?.remove?.({type:EA})}catch{}if(OA())try{this.registry?.forEach?.(t=>{if(t)try{let r=openCount(t.businessObject);if(!r)return;let a=document.createElement(`button`);a.type=`button`,a.className=`penstock-comment-badge`,a.textContent=String(r),a.setAttribute(`title`,x(`app.comments.openTheComments`,{title:commentBadgeTitle(r)})),a.setAttribute(`aria-label`,x(`app.comments.commentsOf`,{comments:commentBadgeTitle(r),element:elementLabel(t)})),a.addEventListener(`click`,r=>{if(r.stopPropagation(),t.id)try{open(t.id)}catch{}}),this.overlays?.add?.(t,EA,{position:commentBadgePosition(t),html:a})}catch{}})}catch{}}},kA={__init__:[`commentBadges`],commentBadges:[`type`,CommentBadges]},AA={phase:`idle`,proposalId:null,items:[],focus:-1,announcement:``,patchFindings:[],comments:[],queued:0},jA=[`calledElement`,`processId`,`decisionRef`,`decisionId`,`formKey`,`formId`],MA=[`jobType`,`topic`,`class`,`delegateExpression`,`expression`,`retries`];function kindOf(t){switch(t.op){case`add`:return`add`;case`connect`:return`connect`;case`remove`:return`remove`;case`move`:return`move`;case`set`:{let r=Object.keys(t.properties);return r.length>0&&r.every(t=>t===`name`)?`rename`:r.length>0&&r.every(t=>t===`condition`)?`condition`:r.length>0&&r.every(t=>jA.includes(t))?`reference`:r.length>0&&r.every(t=>MA.includes(t))?`worker`:`change`}}}var NA={add:()=>x(`app.ghost.chip.add`),connect:()=>x(`app.ghost.chip.connect`),remove:()=>x(`app.ghost.chip.remove`),rename:()=>x(`app.ghost.chip.rename`),move:()=>x(`app.ghost.chip.move`),condition:()=>x(`app.ghost.chip.condition`),reference:()=>x(`app.ghost.chip.reference`),worker:()=>x(`app.ghost.chip.worker`),change:()=>x(`app.ghost.chip.change`)};function chipFor(t){return NA[t]()}function subjectOf(t,r){let a=r(t);return{type:a?ie(a.type):``,name:a?.name||t}}function firstValue(t){let[r]=Object.values(t.properties);return typeof r==`string`||typeof r==`number`||typeof r==`boolean`?String(r):``}function labelFor(t,r,a){let o=kindOf(t);switch(t.op){case`add`:{let a=r.added[0];return x(`app.ghost.item.add`,{type:ie(a?.type??`bpmn:${t.element}`),name:t.name||a?.id||``})}case`connect`:return x(`app.ghost.item.connect`,{from:subjectOf(t.from,a).name,to:subjectOf(t.to,a).name});case`remove`:{let o=r.removed.find(r=>r.id===t.id)??r.removed[0],s=o?{type:ie(o.type),name:o.name||o.id}:subjectOf(t.id,a);return x(`app.ghost.item.remove`,s)}case`move`:return x(`app.ghost.item.move`,subjectOf(t.id,a));case`set`:{let r=subjectOf(t.id,a);return o===`rename`?x(`app.ghost.item.rename`,{...r,value:firstValue(t)}):o===`condition`?x(`app.ghost.item.condition`,{...r,value:firstValue(t)}):Object.keys(t.properties).length===1?x(`app.ghost.item.setOne`,{...r,key:Object.keys(t.properties)[0],value:firstValue(t)}):x(`app.ghost.item.setMany`,{...r,keys:Object.keys(t.properties).join(`, `)})}}}function idsOf(t){return t.operation.op===`add`?[...t.added.map(t=>t.id),...t.addedFlows.map(t=>t.id)]:t.operation.op===`connect`?t.addedFlows.map(t=>t.id):t.operation.op===`remove`?t.removed.map(t=>t.id):t.operation.op===`move`?t.moved.map(t=>t.id):t.changed.map(t=>t.id)}function itemsOf(t,r,a){let o=Wa(t.operations);return t.operations.map((t,s)=>{let u=r.effects[s],d=r.steps[s],f=kindOf(t);return{index:s,operation:t,kind:f,label:labelFor(t,u,a),chip:chipFor(f),elementIds:idsOf(u),decision:`pending`,check:{status:d.status,messages:d.findings.map(t=>t.message),...d.error?{error:d.error}:{},...d.skipped?{skipped:!0}:{}},needs:o[s],effect:u}})}function startReview(t,r,a,o,s={}){let u=itemsOf(r,a,o),d=u.findIndex(t=>!blocked(t));return{...AA,phase:u.length===0?`done`:`review`,proposalId:t,...s,items:u,focus:d>=0?d:u.length>0?0:-1,patchFindings:a.patchFindings.map(t=>t.message)}}function blocked(t){return!!t.check.error}function pending(t){return t.items.filter(t=>t.decision===`pending`)}function acceptable(t){return pending(t).filter(t=>!blocked(t))}function plannedFor(t,r){let a=t.items.map(t=>t.operation);return Ja(a,[r]).filter(r=>t.items[r].decision!==`accepted`)}function acceptBlockers(t,r){return plannedFor(t,r).map(r=>t.items[r]).filter(t=>blocked(t)||t.decision===`rejected`)}function decide(t,r,a){let o=new Set(r),s=t.items.map(t=>o.has(t.index)?{...t,decision:a}:t),u={...t,items:s},d=pending(u);return{...u,phase:d.length===0?`done`:t.phase,focus:d.length===0||d.some(r=>r.index===t.focus)?t.focus:nearest(d,t.focus).index}}function rejectionOf(t,r){return Va(t.items.map(t=>t.operation),[r]).filter(r=>t.items[r].decision===`pending`)}function nearest(t,r){return t.find(t=>t.index>r)??t[0]}function step(t,r){let a=pending(t);if(a.length===0)return t;let o=a.findIndex(r=>r.index===t.focus),s=o<0?r===1?0:a.length-1:(o+r+a.length)%a.length;return{...t,focus:a[s].index}}function focusOn(t,r){return t.items[r]?{...t,focus:r}:t}function counts(t){let r=pending(t);return{total:t.items.length,pending:r.length,accepted:t.items.filter(t=>t.decision===`accepted`).length,rejected:t.items.filter(t=>t.decision===`rejected`).length,attention:r.filter(t=>t.check.status!==`ok`).length}}var PA={left:0,bottom:0},FA=24;function viewFor(t,r,a=PA){let o=t.scale&&t.scale>0?t.scale:1,s=t.width*o,u=t.height*o;if(!Number.isFinite(s)||s<=0||u<=0)return null;let d=Math.min(a.left+FA,s/2),f=Math.max(s-(a.right??0)-FA,d+1),p=FA,h=Math.max(u-a.bottom-FA,25),g={left:(r.x-t.x)*o,top:(r.y-t.y)*o,right:(r.x+r.width-t.x)*o,bottom:(r.y+r.height-t.y)*o};if(g.left>=d&&g.top>=p&&g.right<=f&&g.bottom<=h)return null;let _=Math.min(o,(f-d)/Math.max(r.width,1),(h-p)/Math.max(r.height,1)),v=r.x+r.width/2,y=r.y+r.height/2;return{x:v-(d+f)/2/_,y:y-(p+h)/2/_,width:s/_,height:u/_}}var IA=`http://www.w3.org/2000/svg`,LA=`penstock-ghosts`,RA=400,zA=16,BA=6.7,VA=14,HA=3;function node(t,r={},a){let o=document.createElementNS(IA,t);for(let[t,a]of Object.entries(r))o.setAttribute(t,String(a));return a&&o.setAttribute(`class`,a),o}function words(t){let r=[],a=``;for(let o of t.split(/\s+/).filter(Boolean))a&&`${a} ${o}`.length>VA?(r.push(a),a=o):a=a?`${a} ${o}`:o;a&&r.push(a);let o=r.slice(0,HA);return r.length>HA&&(o[2]=`${o[2].slice(0,13)}…`),o.map(t=>t.length>18?`${t.slice(0,17)}…`:t)}function outline(t,r,a){let{x:o,y:s,width:u,height:d}=r;return/Event$/.test(t)?node(`circle`,{cx:o+u/2,cy:s+d/2,r:u/2},a):/Gateway$/.test(t)?node(`polygon`,{points:[`${o+u/2},${s}`,`${o+u},${s+d/2}`,`${o+u/2},${s+d}`,`${o},${s+d/2}`].join(` `)},a):node(`rect`,{x:o,y:s,width:u,height:d,rx:t===`bpmn:SubProcess`?14:10},a)}function path(t,r,a){let o=node(`path`,{d:t.map((t,r)=>`${r===0?`M`:`L`}${t.x},${t.y}`).join(` `)},r);return a!==null&&o.setAttribute(`marker-end`,`url(#${a})`),o}function chip(t,r,a){let o=Math.round(t.length*BA+10),s=node(`g`,{transform:`translate(${Math.round(r.x)},${Math.round(r.y)})`},`ghost__chip ${a}`);s.append(node(`rect`,{x:0,y:0,width:o,height:zA,rx:4},`ghost__chip-box`));let u=node(`text`,{x:5,y:11.5},`ghost__chip-text type-badge`);return u.textContent=t,s.append(u),s}function badge(t,r){let a=blocked(t)?`error`:t.check.status,o=node(`g`,{transform:`translate(${Math.round(r.x)},${Math.round(r.y)})`},`ghost__badge ghost__badge--${a}`);o.append(node(`circle`,{cx:0,cy:0,r:9},`ghost__badge-disc`));let s=a===`ok`?`M-4,0.5 L-1.2,3.3 L4,-2.8`:a===`warning`?`M0,-4.5 L0,1 M0,4 L0,4.2`:`M-3.5,-3.5 L3.5,3.5 M3.5,-3.5 L-3.5,3.5`;o.append(node(`path`,{d:s},`ghost__badge-glyph`));let u=node(`title`);return u.textContent=t.check.error??(t.check.messages.length>0?t.check.messages.join(`
|
|
1903
|
-
`):x(`app.ghost.check.passed`)),o.append(u),o}function label(t,r,a){if(!a)return null;let o=!/Event$|Gateway$/.test(t),s=words(a),u=node(`text`,{"text-anchor":`middle`},`ghost__name type-tooltip`),d=r.x+r.width/2,f=o?r.y+r.height/2-(s.length-1)*14/2+4:r.y+r.height+16;return s.forEach((t,r)=>{let a=node(`tspan`,{x:d,y:f+r*14});a.textContent=t,u.append(a)}),u}function middleOf(t){let r=Math.max(0,Math.floor((t.length-1)/2)),a=t[r],o=t[r+1]??a;return{x:(a.x+o.x)/2,y:(a.y+o.y)/2}}function unite(t){if(t.length===0)return null;let r=Math.min(...t.map(t=>t.x)),a=Math.min(...t.map(t=>t.y)),o=Math.max(...t.map(t=>t.x+t.width)),s=Math.max(...t.map(t=>t.y+t.height));return{x:r,y:a,width:o-r,height:s-a}}function boundsOfPoints(t){let r=t.map(t=>t.x),a=t.map(t=>t.y);return{x:Math.min(...r),y:Math.min(...a),width:Math.max(...r)-Math.min(...r),height:Math.max(...a)-Math.min(...a)}}var UA=`penstock-ghost-arrow`;function boundsOfElement(t,r){let a=t.get(r);return a?a.waypoints&&a.waypoints.length>1?boundsOfPoints(a.waypoints):typeof a.x==`number`?{x:a.x,y:a.y??0,width:a.width??0,height:a.height??0}:null:null}function ghostDefs(t){let r=node(`defs`),a=node(`marker`,{id:t,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`});return a.append(node(`path`,{d:`M0,1 L9,5 L0,9 z`},`ghost__arrow`)),r.append(a),r}function renderGhost(t,r,a){let o=node(`g`,{"data-ghost-index":t.index,"data-ghost-kind":t.kind},`ghost ghost--${t.kind}${r.focused?` ghost--focus`:``}${blocked(t)?` ghost--blocked`:``}`),s=t.effect,u=null,d=null;for(let t of s.added){if(!t.bounds)continue;o.append(outline(t.type,t.bounds,`ghost__shape`));let r=label(t.type,t.bounds,t.name??``);r&&o.append(r),u={x:t.bounds.x,y:t.bounds.y-zA-4},d={x:t.bounds.x+t.bounds.width,y:t.bounds.y}}for(let t of s.addedFlows)if(!(!t.waypoints||t.waypoints.length<2)&&(o.append(path(t.waypoints,`ghost__flow`,r.arrowId)),!u)){let r=middleOf(t.waypoints);u={x:r.x+4,y:r.y-zA-4},d={x:r.x,y:r.y}}for(let r of s.removed)if(r.bounds){o.append(outline(r.type,r.bounds,`ghost__shape ghost__shape--removed`));let{x:a,y:f,width:p,height:h}=r.bounds;o.append(path([{x:a-4,y:f+h+4},{x:a+p+4,y:f-4}],`ghost__strike`,null)),u&&r.id!==s.operation.op||(u={x:a,y:f-zA-4}),(!d||s.operation.op===`remove`&&r.id===t.elementIds[0])&&(d={x:a+p,y:f})}else if(r.waypoints&&r.waypoints.length>1&&(o.append(path(r.waypoints,`ghost__flow ghost__flow--removed`,null)),!u)){let t=middleOf(r.waypoints);u={x:t.x+4,y:t.y-zA-4},d=t}for(let t of s.moved.slice(0,1)){let s=a.get(t.id)?.businessObject?.$type??`bpmn:Task`;o.append(outline(s,t.to,`ghost__shape`));let f={x:t.from.x+t.from.width/2,y:t.from.y+t.from.height/2},p={x:t.to.x+t.to.width/2,y:t.to.y+t.to.height/2};o.append(path([f,p],`ghost__trail`,r.arrowId)),u={x:t.to.x,y:t.to.y-zA-4},d={x:t.to.x+t.to.width,y:t.to.y}}for(let t of s.changed){let r=boundsOfElement(a,t.id)??t.bounds;if(!r)continue;let s=a.get(t.id);if(s?.waypoints&&s.waypoints.length>1){o.append(path(s.waypoints,`ghost__flow ghost__flow--changed`,null));let t=middleOf(s.waypoints);u={x:t.x+4,y:t.y-zA-4},d=t}else{let t={x:r.x-4,y:r.y-4,width:r.width+8,height:r.height+8};o.append(node(`rect`,{...t,rx:12},`ghost__frame`)),u={x:t.x,y:t.y-zA-2},d={x:t.x+t.width,y:t.y}}}return u&&o.append(chip(t.chip,u,`ghost__chip--${t.kind}`)),d&&r.badge&&o.append(badge(t,d)),o}var GhostLayer=class{static $inject=[`canvas`,`elementRegistry`,`eventBus`];canvas;registry;eventBus;items=[];focus=-1;cover=PA;picker=()=>void 0;group=null;redraw=()=>this.draw();constructor(t,r,a){this.canvas=t,this.registry=r,this.eventBus=a,a.on([`import.done`,`elements.changed`],this.redraw)}destroy(){this.eventBus.off([`import.done`,`elements.changed`],this.redraw),this.group?.replaceChildren()}onPick(t){this.picker=t}show(t,r){this.items=t,this.focus=r,this.draw()}clear(){this.items=[],this.focus=-1,this.group?.replaceChildren()}boundsOf(t){let r=this.items.find(r=>r.index===t);return r?this.areaOf(r):null}setCover(t){this.cover=t}reveal(t){let r=this.boundsOf(t);r&&this.bring(r)}revealAll(){let t=unite(this.items.map(t=>this.areaOf(t)).filter(t=>t!==null));t&&this.bring(t)}bring(t){let r=viewFor(this.canvas.viewbox(),t,this.cover);r&&this.canvas.viewbox(r)}areaOf(t){let r=[],a=t.effect;for(let t of[...a.added,...a.removed])t.bounds&&r.push(t.bounds);for(let t of[...a.addedFlows,...a.removed])t.waypoints&&t.waypoints.length>1&&r.push(boundsOfPoints(t.waypoints));for(let t of a.moved.slice(0,1))r.push(t.to,t.from);for(let t of a.changed){let a=boundsOfElement(this.registry,t.id)??t.bounds;a&&r.push(a)}return a.operation.op===`connect`&&r.length===0?null:unite(r)}ensureGroup(){let t=this.canvas.getLayer(LA,RA);return this.group!==t&&(this.group=t,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`class`,`${t.getAttribute(`class`)??``} ghost-layer`.trim())),t}draw(){let t=this.ensureGroup();t.replaceChildren();let r=this.items.filter(t=>t.decision===`pending`);if(r.length!==0){t.append(ghostDefs(UA));for(let a of r){let r=renderGhost(a,{focused:a.index===this.focus,badge:!0,arrowId:UA},this.registry);r.addEventListener(`click`,t=>{t.stopPropagation(),this.picker(a.index)}),t.append(r)}}}},WA=`penstock.applyPatch`;function shapeOf(t,r){let a=t.get(r);if(!a||a.type===`label`)throw new Ha(x(`app.cli.edit.noSuchElement`,{id:r}));return a}var ApplyPatchHandler=class{static $inject=[`modeling`,`elementRegistry`,`elementFactory`,`bpmnFactory`,`moddle`];services;constructor(t,r,a,o,s){this.services={modeling:t,registry:r,elementFactory:a,bpmnFactory:o,moddle:s}}preExecute(t){t.created=[];for(let r of t.effects)this.run(r,t)}properties(){return{modeling:this.services.modeling,moddle:this.services.moddle}}run(t,r){let{modeling:a,registry:o,elementFactory:s,bpmnFactory:u}=this.services,d=t.operation;switch(d.op){case`add`:{let f=shapeOf(o,d.after),p=t.added[0],h=t.addedFlows[0],g=Ga[d.element].type,_={id:p.id};d.name&&(_.name=d.name);let v=s.createShape({type:g,businessObject:u.create(g,_),...d.event?{eventDefinitionType:Xa[d.event]}:{}}),y=p.bounds,b=a.createShape(v,{x:y.x+y.width/2,y:y.y+y.height/2},f.parent);a.connect(f,b,{type:`bpmn:SequenceFlow`,businessObject:u.create(`bpmn:SequenceFlow`,{id:h.id})}),d.properties&&Ya(this.properties(),r.engine,b,d.properties),r.created?.push(b.id,h.id);return}case`connect`:{let s=shapeOf(o,d.from),f=shapeOf(o,d.to),p=t.addedFlows[0],h=a.connect(s,f,{type:`bpmn:SequenceFlow`,businessObject:u.create(`bpmn:SequenceFlow`,{id:p.id})});d.name&&a.updateProperties(h,{name:d.name}),d.condition&&Ya(this.properties(),r.engine,h,{condition:d.condition}),r.created?.push(h.id);return}case`set`:Ya(this.properties(),r.engine,shapeOf(o,d.id),d.properties);return;case`remove`:{let t=shapeOf(o,d.id),r=[...t.incoming??[],...t.outgoing??[]];a.removeElements(t.waypoints?[t]:[...new Set(r),t]);return}case`move`:a.moveElements([shapeOf(o,d.id)],{x:d.dx,y:d.dy});return}}},PatchApplier=class{static $inject=[`commandStack`];commandStack;constructor(t){this.commandStack=t,t.registerHandler(WA,ApplyPatchHandler)}apply(t,r){if(t.length===0)return[];let a={effects:t,engine:r};return this.commandStack.execute(WA,a),a.created??[]}},GA={__init__:[`ghostLayer`,`patchApplier`],ghostLayer:[`type`,GhostLayer],patchApplier:[`type`,PatchApplier]},KA=`penstock-next-block`,qA=401,JA=`penstock-next-block-arrow`;function suggestedType(t){return ie(t.steps[0].added[0]?.type??``)}function itemOf(t){let r=t.patch.operations[0],a=t.steps[0];return{index:0,operation:r,kind:kindOf(r),label:labelFor(r,a,()=>void 0),chip:x(`app.nextBlock.chip`,{type:suggestedType(t)}),elementIds:idsOf(a),decision:`pending`,check:{status:`ok`,messages:[]},needs:[],effect:a}}var NextBlockLayer=class{static $inject=[`canvas`,`elementRegistry`];canvas;registry;group=null;constructor(t,r){this.canvas=t,this.registry=r}show(t){this.ensureGroup().replaceChildren(ghostDefs(JA),renderGhost(itemOf(t),{focused:!1,badge:!1,arrowId:JA},this.registry))}hide(){this.group?.replaceChildren()}destroy(){this.hide()}ensureGroup(){let t=this.canvas.getLayer(KA,qA);return this.group!==t&&(this.group=t,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`class`,`${t.getAttribute(`class`)??``} ghost-layer next-block-layer`.trim())),t}},YA={__init__:[`nextBlockLayer`],nextBlockLayer:[`type`,NextBlockLayer]},XA={statuses:new Map,paused:new Set,card:null,actions:null},ZA=new Set;function change(t){XA={...XA,...t},ZA.forEach(t=>t())}function codeBridgeState(){return XA}function watchCodeBridge(t){return ZA.add(t),()=>ZA.delete(t)}function setCodeStatuses(t){let r=new Map(t.map(t=>[t.elementId,t]));change({statuses:r,card:XA.card&&r.has(XA.card.elementId)?XA.card:null})}function setCodePaused(t){let r=new Map;XA.statuses.forEach((a,o)=>r.set(o,{...a,paused:t.has(o)})),change({paused:t,statuses:r})}function setCodeActions(t){change({actions:t})}function showCodeCard(t){let r=XA.card;r&&r.elementId===t.elementId&&r.anchor===t.anchor&&r.pinned===t.pinned||change({card:t})}function hideCodeCard(){XA.card&&change({card:null})}function resetCodeBridge(){XA={statuses:new Map,paused:new Set,card:null,actions:null},ZA.forEach(t=>t())}function kindLabel(t){switch(t){case`JOB_TYPE`:return x(`app.codeBridge.kindJobType`);case`TOPIC`:return x(`app.codeBridge.kindTopic`);case`CLASS`:return x(`app.codeBridge.kindClass`);case`BEAN`:return x(`app.codeBridge.kindBean`);case`MESSAGE`:return x(`app.codeBridge.kindMessage`);case`PROCESS`:return x(`app.codeBridge.kindProcess`);case`DECISION`:return x(`app.codeBridge.kindDecision`)}}function openLabel(t,r){switch(t){case`PROCESS`:return x(`app.codeBridge.openProcess`);case`DECISION`:return x(`app.codeBridge.openDecision`);default:return r?x(`app.codeBridge.openPlace`,{where:r}):x(`app.codeBridge.openCode`)}}function fileName(t){return t.split(/[\\/]/).pop()??t}function whereOf(t){return t.kind===`PROCESS`||t.kind===`DECISION`?fileName(t.file):`${fileName(t.file)}:${t.line}`}function stateLabel(t){switch(t.state){case`bound`:return x(`app.codeBridge.stateBound`);case`missing`:return x(`app.codeBridge.stateMissing`);case`ambiguous`:return x(`app.codeBridge.stateAmbiguous`);default:return``}}function leadBinding(t){return t.bindings.find(r=>r.state===t.state)??t.bindings[0]}function badgeLabel(t){let r=leadBinding(t),a=r?.value??t.label,o=t.label;return t.state===`missing`?x(`app.codeBridge.badgeMissing`,{element:o,name:a}):t.state===`ambiguous`?x(`app.codeBridge.badgeAmbiguous`,{element:o,count:r?.anchors.length??0,name:a}):x(`app.codeBridge.badgeBound`,{element:o,where:t.anchors[0]?whereOf(t.anchors[0]):a})}function detailLines(t){return t.state===`missing`?[x(`app.codeBridge.missingDetail`,{name:t.value}),...t.near?[x(`app.codeBridge.missingNear`,{near:t.near})]:[]]:t.state===`ambiguous`?[x(`app.codeBridge.ambiguousDetail`,{name:t.value})]:[]}function reachedElements(t){if(!t||t.reach.size===0)return null;let r=new Set;return t.reach.forEach(t=>t.all.elements.forEach(t=>r.add(t))),r}var QA=/\.(java|kt|kts|groovy|scala)$/,$A=/\.(js|mjs|cjs|ts)$/,ej=/\.py$/;function stubLanguage(t){let r=0,a=0,o=0;for(let s of t)QA.test(s.file)?r+=1:$A.test(s.file)?a+=1:ej.test(s.file)&&(o+=1);return o>r&&o>a?`python`:a>r?`node`:`spring`}function stubTemplateFor(t,r){if(t.state!==`missing`)return null;let a=t.bindings.find(t=>t.state===`missing`&&(t.kind===`JOB_TYPE`||t.kind===`TOPIC`));if(!a)return null;let o=a.kind===`JOB_TYPE`?`zeebe:taskDefinition`:`camunda:topic`;return r.find(t=>t?.id&&t.elementType?.[o]===a.value)??null}var tj=300,nj=200,rj=400,ij,aj,oj=0,sj=null;function cancelCardHide(){window.clearTimeout(aj),aj=void 0}function cancelCardShow(){window.clearTimeout(ij),ij=void 0}function hoverCard(t,r){cancelCardHide(),cancelCardShow(),ij=window.setTimeout(()=>showCodeCard({elementId:t,anchor:r,pinned:!1}),tj)}function focusCard(t,r){r===sj&&Date.now()<oj||(cancelCardHide(),cancelCardShow(),showCodeCard({elementId:t,anchor:r,pinned:!1}))}function pinCard(t,r){cancelCardHide(),cancelCardShow(),showCodeCard({elementId:t,anchor:r,pinned:!0})}function leaveCard(){cancelCardShow(),cancelCardHide(),!codeBridgeState().card?.pinned&&(aj=window.setTimeout(hideCodeCard,nj))}function closeCard(){oj=Date.now()+rj,sj=codeBridgeState().card?.anchor??null,cancelCardShow(),cancelCardHide(),hideCodeCard()}var cj=`penstock-code`,lj=`http://www.w3.org/2000/svg`,uj=`M5.5 4L2 8l3.5 4M10.5 4L14 8l-3.5 4`,shown=()=>TA.codeBadges();function codeBadgePosition(){return{bottom:-12,left:3}}function icon(){let t=document.createElementNS(lj,`svg`);t.setAttribute(`viewBox`,`0 0 16 16`),t.setAttribute(`width`,`12`),t.setAttribute(`height`,`12`),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,`currentColor`),t.setAttribute(`stroke-width`,`1`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`stroke-linejoin`,`round`),t.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(lj,`path`);return r.setAttribute(`d`,uj),t.appendChild(r),t}function codeBadgeElement(t){let r=document.createElement(`button`);if(r.type=`button`,r.className=`penstock-code-badge type-badge penstock-code-badge--${t.state}`,r.setAttribute(`aria-label`,badgeLabel(t)),r.setAttribute(`aria-haspopup`,`dialog`),r.appendChild(icon()),t.state!==`bound`){let a=document.createElement(`span`);a.className=`penstock-code-badge__mark`,a.textContent=t.state===`ambiguous`?String(t.anchors.length):`?`,r.appendChild(a)}return r.addEventListener(`pointerenter`,()=>hoverCard(t.elementId,r)),r.addEventListener(`pointerleave`,leaveCard),r.addEventListener(`focus`,()=>focusCard(t.elementId,r)),r.addEventListener(`blur`,leaveCard),r.addEventListener(`click`,a=>{a.stopPropagation(),pinCard(t.elementId,r)}),r.addEventListener(`keydown`,t=>{t.key===`Escape`&&(t.stopPropagation(),closeCard())}),r}var CodeBadges=class{static $inject=[`elementRegistry`,`overlays`,`eventBus`];registry;overlays;eventBus;redraw=()=>this.refresh();drawn=null;stop;constructor(t,r,a){this.registry=t,this.overlays=r,this.eventBus=a,a?.on?.([`import.done`],this.redraw),this.stop=watchCodeBridge(()=>{codeBridgeState().statuses!==this.drawn&&this.refresh()}),this.refresh()}destroy(){this.stop();try{this.eventBus?.off?.([`import.done`],this.redraw)}catch{}try{this.overlays?.remove?.({type:cj})}catch{}}refresh(){try{this.overlays?.remove?.({type:cj})}catch{}if(!shown())return;this.drawn=codeBridgeState().statuses;let t=new Map;codeBridgeState().statuses.forEach(r=>{if(isBadged(r))try{let a=this.registry?.get?.(r.elementId);if(!a)return;let o=codeBadgeElement(r);this.overlays?.add?.(a,cj,{position:codeBadgePosition(),html:o}),t.set(r.elementId,o)}catch{}});let r=codeBridgeState().card,a=r?t.get(r.elementId):void 0;r&&a&&r.anchor!==a&&showCodeCard({...r,anchor:a})}},dj={__init__:[`codeBadges`],codeBadges:[`type`,CodeBadges]};function CodeBridgeEntry({element:t}){let[r,a]=Or(codeBridgeState());Vn(()=>watchCodeBridge(()=>a(codeBridgeState())),[]);let o=t?.id?r.statuses.get(t.id):void 0;if(!o||o.state===`notApplicable`)return null;let s=r.actions,u=leadBinding(o),d=s?.stubFor(o)??null,open=t=>s?.open(t);return v(`div`,{class:`penstock-code-entry`,children:[v(`p`,{class:`penstock-code-entry__state type-dialog-title${o.state===`missing`?` penstock-code-entry__state--missing`:``}`,children:[stateLabel(o),u&&` · ${kindLabel(u.kind)} ${u.value}`]}),u&&detailLines(u).map(t=>v(`p`,{class:`penstock-code-entry__note type-help`,children:t},t)),v(`div`,{class:`penstock-code-entry__actions`,children:[(u?.anchors??[]).slice(0,3).map(t=>v(`button`,{type:`button`,class:`ui-button`,onClick:()=>open(t),children:openLabel(t.kind,whereOf(t))},`${t.file}:${t.line}`)),d&&v(`button`,{type:`button`,class:`ui-button`,onClick:()=>s?.createStub(o),children:x(`app.codeBridge.createStub`)})]})]})}var fj=120,CodeBridgeProvider=class{static $inject=[`propertiesPanel`,`eventBus`];propertiesPanel;shownFor=new Set;constructor(t,r){this.propertiesPanel=t,t.registerProvider(fj,this);let a=watchCodeBridge(()=>{let t=new Set;codeBridgeState().statuses.forEach(r=>{isBadged(r)&&t.add(r.elementId)});let r=t.size===this.shownFor.size&&[...t].every(t=>this.shownFor.has(t));if(this.shownFor=t,!r)try{this.propertiesPanel._update?.()}catch{}});r?.on?.(`diagram.destroy`,a)}getGroups(t){return r=>{try{if(!Array.isArray(r)||!t?.id)return r;let a=codeBridgeState().statuses.get(t.id);if(!a||!isBadged(a))return r;let o={id:`codeBridge`,label:x(`app.codeBridge.groupTitle`),entries:[{id:`codeBridge`,element:t,component:CodeBridgeEntry}]},s=r.findIndex(t=>t.id===`general`);return[...r.slice(0,s+1),o,...r.slice(s+1)]}catch{return r||[]}}}},pj={__init__:[`codeBridgeProvider`],codeBridgeProvider:[`type`,CodeBridgeProvider]},traced=()=>void 0;function setTracePadHandler(t){traced=t}var TraceContextPadProvider=class{static $inject=[`contextPad`];constructor(t){t.registerProvider(1500,this)}getContextPadEntries(t){return ct(t?.businessObject)?r=>({...r,"trace-paths":{className:`penstock-context-pad-trace`,title:x(`app.tracePaths.tracePaths`),html:`<div class="entry" draggable="true">${ot}</div>`,action:{click:(r,a)=>{traced(a??t),r?.stopPropagation?.()}}}}):t=>t}},mj={__init__:[`traceContextPadProvider`],traceContextPadProvider:[`type`,TraceContextPadProvider]},hj={name:`Penstock`,uri:`https://github.com/kern0x1b/penstock-release/ns/comments/1.0`,prefix:`penstock`,xml:{tagAlias:`lowerCase`},types:[{name:`Comments`,superClass:[`Element`],properties:[{name:`comment`,type:`Comment`,isMany:!0}]},{name:`Comment`,superClass:[`Element`],properties:[{name:`id`,type:`String`,isAttr:!0},{name:`author`,type:`String`,isAttr:!0},{name:`date`,type:`String`,isAttr:!0},{name:`resolved`,type:`Boolean`,isAttr:!0},{name:`text`,type:`String`,isBody:!0}]}]},gj=`@camunda/zeebe-element-templates-json-schema`;function isRecord(t){return typeof t==`object`&&!!t&&!Array.isArray(t)}function isText(t){return typeof t==`string`}function schemaReasons(t,r){if(r!==`camunda-8`)return[];let a=t.$schema;return a?!isText(a)||!a.includes(gj)?[x(`app.templates.rejected.schemaOther`)]:[]:[x(`app.templates.rejected.schemaMissing`)]}function reasonsOf(t,r){if(!isRecord(t))return[x(`app.templates.rejected.notAnObject`)];let{elementType:a,appliesTo:o}=t,s=schemaReasons(t,r);return a!=null&&!(isRecord(a)&&isText(a.value))&&s.push(x(`app.templates.rejected.elementType`)),o!=null&&!(Array.isArray(o)&&o.every(isText))&&s.push(x(`app.templates.rejected.appliesTo`)),s}function splitTemplates(t,r){let a={loadable:[],unloadable:[]};for(let o of t){let t=reasonsOf(o,r);t.length===0?a.loadable.push(o):a.unloadable.push({template:o,reasons:t})}return a}var _j=/^template\(id: <[^>]*>, name: <[^>]*>\): /;function identityOf(t){let r=typeof t==`object`&&t?t:{},a=typeof r.id==`string`?r.id:``;return{name:typeof r.name==`string`&&r.name!==``?r.name:a,id:a,version:typeof r.version==`number`?r.version:null}}function keyOf(t){let{id:r,version:a}=identityOf(t);return`${r}@${a??`_`}`}var TemplateRejections=class{static $inject=[`eventBus`,`elementTemplates`];reasons=new Map;elementTemplates;constructor(t,r){this.elementTemplates=r,t.on(`elementTemplates.errors`,({errors:t})=>{let r=new Map;for(let a of t){if(!a.template)continue;let t=keyOf(a.template);r.set(t,[...r.get(t)??[],a.message.replace(_j,``)])}r.forEach((t,r)=>this.reasons.set(r,t))})}rejected(t){return t.filter(t=>typeof t==`object`&&!!t).filter(t=>{let{id:r,version:a}=identityOf(t);return!this.elementTemplates.get(r,a??void 0)}).map(t=>({...identityOf(t),reasons:this.reasons.get(keyOf(t))??[x(`app.templates.rejected.unexplained`)]}))}},vj={__init__:[`templateRejections`],templateRejections:[`type`,TemplateRejections]};function getCommonOptions(t){let r=window.appConfig,a={alignToOrigin:{alignOnSave:!1,offset:150,tolerance:50},linting:{active:!0,bpmnlint:builtinSetup(null)}};t.propertiesPanelContainer&&(a.propertiesPanel={parent:t.propertiesPanelContainer}),a.textRenderer={defaultStyle:lt.defaultStyle},a.rendering=r?.isSketchyMode?`sketchy`:`default`;let o=$n();return a.bpmnRenderer={defaultFillColor:o.fill,defaultStrokeColor:o.stroke},a}function getCommonModules(){return[mt,dE,ck,ho,jg,dA,uA,fA,Ou,Au,kA,GA,YA,dj,qn,mj,ME,br,NE,FE]}function createBpmnModeler(t){at();let r=window.appConfig,a=getCommonOptions(t),o=getCommonModules(),s=Ve(r?.engine),u=s?.family===`camunda-7`,d=s?.family===`camunda-8`,f=s?.key===`operaton`,p=Array.isArray(r?.elementTemplatesContent)?r.elementTemplatesContent:[],h={container:t.container,...a,taskResizingEnabled:!0,elementTemplates:splitTemplates(p,s?.family??null).loadable};if(u){let t=[...o,eT,zk,Wk,pj,bA,vj],r={penstock:hj};return f&&(t.push(uu),r.camunda=du),new Modeler$1({...h,additionalModules:t,moddleExtensions:r})}if(d)return new Modeler({...h,additionalModules:[...o,sA,eT,Jw,zk,Wk,pj,vj,$k],moddleExtensions:{penstock:hj}});let g=s?.family===`flowable`||s?.family===`activiti`?s.family:null;return new Modeler$3({...h,additionalModules:[...o,z_,Z_,Jk,Xk,...g?[flowableModule(g)]:[],Wk,pj,BC,Qn,j_],moddleExtensions:{penstock:hj,...g?{[g]:Ke(g)}:{}}})}var yj=/^\$\{(.+)\}$/,bj=/^[A-Za-z_$][A-Za-z0-9_$]*/,xj=new Set([`camunda:ExecutionListener`,`camunda:TaskListener`]);function looksLikeClassName(t){if(!t.includes(`.`))return!1;let r=t.split(`.`);if(r.some(t=>t.length===0))return!1;let a=r[r.length-1];return/^[A-Z][A-Za-z0-9_$]*$/.test(a)}function classOf(t){let r=t?.trim();return r?{kind:`JAVA_CLASS`,value:r,label:r.slice(r.lastIndexOf(`.`)+1)}:null}function unwrap(t){let r=t?.trim();if(!r)return null;let a=yj.exec(r);return a?a[1].trim():r}function fromDelegate(t){let r=unwrap(t);if(!r)return null;if(looksLikeClassName(r))return classOf(r);let a=bj.exec(r)?.[0];return!a||a!==r?null:{kind:`BEAN`,value:a,label:a}}function fromExpression(t){let r=unwrap(t);if(!r)return null;let a=bj.exec(r)?.[0];return!a||a===r||!r.slice(a.length).startsWith(`.`)||/^[A-Z]/.test(a)?null:{kind:`BEAN`,value:a,label:a}}function fromEntry(t){return t?classOf(t.class)??fromDelegate(t.delegateExpression)??fromExpression(t.expression):null}function classReferenceOf(t){if(!t)return null;let r=classOf(t.class)??fromDelegate(t.delegateExpression)??fromExpression(t.expression)??classOf(t.variableMappingClass)??fromDelegate(t.variableMappingDelegateExpression);if(r)return r;for(let r of t.eventDefinitions??[]){let t=fromEntry(r);if(t)return t}for(let r of t.extensionElements?.values??[]){if(r.$type===`zeebe:TaskDefinition`){let t=r.type?.trim();if(t&&!t.startsWith(`=`))return{kind:`JOB_TYPE`,value:t,label:t};continue}if(!xj.has(r.$type??``))continue;let t=fromEntry(r);if(t)return t}return null}async function reimportKeepingView(t,r){let a=t.get(`canvas`),o=t.get(`selection`,!1),{x:s,y:u,width:d,height:f}=a.viewbox(),p=a.getRootElement()?.id,h=(o?.get()??[]).map(t=>t.id);await t.importXML(r);let g=t.get(`elementRegistry`),_=p?g.get(p):void 0;_&&a.getRootElement()?.id!==_.id&&a.setRootElement(_),a.viewbox({x:s,y:u,width:d,height:f});let v=h.map(t=>g.get(t)).filter(t=>!!t);v.length>0&&o?.select(v)}var Sj=100,Cj={width:100,height:80},wj=160,Tj=120,Ej=60,Dj=10,Oj=8;function layeredPlacement(t,r){let a=new Map(t.map(t=>[t.id,0])),o=new Map(t.map(t=>[t.id,[]])),s=new Map(t.map(t=>[t.id,0]));for(let t of r)a.has(t.source)&&a.has(t.target)&&(o.get(t.source)?.push(t.target),s.set(t.target,(s.get(t.target)??0)+1));let u=t.filter(t=>s.get(t.id)===0).map(t=>t.id);for(let t=0;t<u.length;t+=1){let r=u[t];for(let t of o.get(r)??[])a.set(t,Math.max(a.get(t)??0,(a.get(r)??0)+1)),s.set(t,(s.get(t)??0)-1),s.get(t)===0&&u.push(t)}let d=new Map;for(let r of t){let t=a.get(r.id)??0,o=d.get(t)??[];o.push(r.id),d.set(t,o)}let f=[];for(let t of[...d.keys()].sort((t,r)=>t-r)){let r=d.get(t)??[];for(let t=0;t<r.length;t+=Dj)f.push(r.slice(t,t+Dj))}let p=[];f.forEach((t,r)=>{let a=Math.floor(r/Oj);p[a]=Math.max(p[a]??0,t.length)});let h=[],g=Sj;p.forEach((t,r)=>{h[r]=g,g+=t*Tj+Ej});let _=new Map(t.map(t=>[t.id,t])),v=new Map;return f.forEach((t,r)=>{let a=Math.floor(r/Oj),o=r%Oj;t.forEach((t,r)=>{let{width:s,height:u}=_.get(t)??{width:Cj.width,height:Cj.height};v.set(t,{x:Sj+o*wj+(Cj.width-s)/2,y:h[a]+r*Tj+(Cj.height-u)/2})})}),v}var kj=/<(?:[\w.-]+:)?BPMNShape[\s>/]/;function hasDiagramInterchange(t){return kj.test(t)}function sizeOf(t){return t.$instanceOf(`bpmn:Event`)?{width:36,height:36}:t.$instanceOf(`bpmn:Gateway`)||t.$instanceOf(`bpmn:DataStoreReference`)?{width:50,height:50}:t.$instanceOf(`bpmn:DataObjectReference`)?{width:36,height:50}:{width:100,height:80}}function nodesOf(t,r,a){for(let o of t.flowElements??[])o.$instanceOf(`bpmn:SequenceFlow`)?a.push(o):(o.$instanceOf(`bpmn:FlowNode`)||o.$instanceOf(`bpmn:DataObjectReference`)||o.$instanceOf(`bpmn:DataStoreReference`))&&(r.push(o),o.$instanceOf(`bpmn:FlowElementsContainer`)&&nodesOf(o,r,a))}function centreOf(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function edgeToward(t,r){let a=centreOf(t),o=r.x-a.x,s=r.y-a.y;if(o===0&&s===0)return a;let u=Math.min(o===0?1/0:t.width/2/Math.abs(o),s===0?1/0:t.height/2/Math.abs(s));return{x:a.x+o*u,y:a.y+s*u}}async function withPlaceholderInterchange(t){if(hasDiagramInterchange(t))return t;let r=new ze,{rootElement:a}=await r.fromXML(t),o=a.rootElements??[],s=o.filter(t=>t.$instanceOf(`bpmn:Process`));if(s.length===0)return t;let u=o.find(t=>t.$instanceOf(`bpmn:Collaboration`)),d=[],f=[];for(let t of s)nodesOf(t,d,f);let p=layeredPlacement(d.map(t=>({id:t.id,...sizeOf(t)})),f.map(t=>({source:t.sourceRef?.id??``,target:t.targetRef?.id??``}))),h=[],g=r.create(`bpmndi:BPMNPlane`,{id:`Penstock_plane`,bpmnElement:u??s[0],planeElement:h}),_=new Map;d.forEach(t=>{let{width:a,height:o}=sizeOf(t),{x:s,y:u}=p.get(t.id)??{x:0,y:0},d={x:s,y:u,width:a,height:o};_.set(t.id,d),h.push(r.create(`bpmndi:BPMNShape`,{id:`${t.id}_di`,bpmnElement:t,bounds:r.create(`dc:Bounds`,d)}))});for(let t of f){let a=_.get(t.sourceRef?.id),o=_.get(t.targetRef?.id);if(!a||!o)continue;let s=edgeToward(a,centreOf(o)),u=edgeToward(o,centreOf(a));h.push(r.create(`bpmndi:BPMNEdge`,{id:`${t.id}_di`,bpmnElement:t,waypoint:[r.create(`dc:Point`,s),r.create(`dc:Point`,u)]}))}let v=r.create(`bpmndi:BPMNDiagram`,{id:`Penstock_diagram`,plane:g});a.diagrams=[...a.diagrams??[],v];let{xml:y}=await r.toXML(a,{format:!0});return y}async function drawableXml(t){if(hasDiagramInterchange(t))return{xml:t,placed:!1};try{return{xml:await withPlaceholderInterchange(t),placed:!0}}catch{return{xml:t,placed:!1}}}function watchEdits(t,r){let a=0,changed=()=>{a===0&&r()};return t.on(`commandStack.changed`,changed),{quietly:async t=>{a+=1;try{return await t()}finally{--a}},dispose:()=>t.off(`commandStack.changed`,changed)}}function ContextMenu({position:t,items:r,onClose:a,visible:o}){let s=g(null);if(b(()=>{if(!o)return;let handleClickOutside=t=>{s.current&&!s.current.contains(t.target)&&a()},handleEscape=t=>{t.key===`Escape`&&a()};return document.addEventListener(`mousedown`,handleClickOutside),document.addEventListener(`keydown`,handleEscape),()=>{document.removeEventListener(`mousedown`,handleClickOutside),document.removeEventListener(`keydown`,handleEscape)}},[o,a]),b(()=>{o&&s.current&&s.current.querySelector(`.context-menu-item:not(.disabled)`)?.focus()},[o]),y(()=>{if(!o||!s.current)return;let r=s.current,a=r.offsetWidth,u=r.offsetHeight,d=window.innerWidth,f=window.innerHeight,{x:p,y:h}=t;p+a>d&&(p=Math.max(10,d-a-10)),h+u>f&&(h=Math.max(10,f-u-10)),p<10&&(p=10),h<10&&(h=10),r.style.left=`${p}px`,r.style.top=`${h}px`},[t,o]),!o)return null;let handleItemClick=t=>{if(t.disabled)return;let r=s.current?.closest(`.resource-editor`)??void 0,o=Qa(`.djs-container svg`,r);t.action(),a(),o?.focus({preventScroll:!0})},focusSibling=(t,r)=>{let a=Array.from(s.current?.querySelectorAll(`.context-menu-item:not(.disabled)`)??[]),o=a.indexOf(t);o!==-1&&a.length!==0&&a[(o+r+a.length)%a.length].focus()},handleItemKeyDown=(t,r)=>{t.key===`Enter`||t.key===` `?(t.preventDefault(),handleItemClick(r)):t.key===`ArrowDown`?(t.preventDefault(),focusSibling(t.currentTarget,1)):t.key===`ArrowUp`&&(t.preventDefault(),focusSibling(t.currentTarget,-1))};return v(`div`,{ref:s,class:`context-menu`,role:`menu`,style:{position:`fixed`,left:`${t.x}px`,top:`${t.y}px`},children:r.map(t=>t.divider?v(`div`,{class:`context-menu-separator`,role:`separator`},t.id):v(`div`,{class:`context-menu-item ${t.disabled?`disabled`:``}`,role:`menuitem`,tabIndex:t.disabled?-1:0,"aria-disabled":t.disabled||void 0,onClick:()=>handleItemClick(t),onKeyDown:r=>handleItemKeyDown(r,t),children:[t.icon&&v(`div`,{class:`context-menu-icon`,children:t.icon}),v(`div`,{class:`context-menu-label`,children:t.label}),t.shortcut&&v(`div`,{class:`context-menu-shortcut`,children:t.shortcut})]},t.id))})}function createHoverGate(){let t=null,r=!1,cancel=()=>{t!==null&&clearTimeout(t),t=null};return{schedule(a,o){cancel(),!r&&(t=setTimeout(()=>{t=null,r||a()},o))},cancel,block(){r=!0,cancel()},release(){r=!1}}}function contextPadLeft({container:t,target:r,padWidth:a,margin:o,obstacleLeft:s}){let u=Number.isFinite(a)&&a>0?a:42,d=Number.isFinite(o)&&o>=0?o:0,f=Number.isFinite(r.right)?r.right:0,p=Number.isFinite(r.left)?r.left:0,h=Number.isFinite(t.left)?t.left:0,g=Number.isFinite(t.right)?t.right:0,_=s!==void 0&&Number.isFinite(s)?s:void 0,v=f-h+d,y=_===void 0?g:Math.min(g,_);return h+v+u<=y?Math.max(0,v):Math.max(p-h-u-d,0)}function fitContextPad(t){let r=t.get(`canvas`),a=t.get(`contextPad`,!1),o=t.get(`elementRegistry`),s=t.get(`eventBus`);if(!r||!a||!o||!s||!a._container)return()=>{};let u=null,d=!1,reposition=t=>{if(!u||d)return;let a=o.getGraphics(u);if(!a)return;let s=r.getContainer().getBoundingClientRect(),f=a.getBoundingClientRect(),p=t.getBoundingClientRect().width||42,h=r.getContainer().closest(`.resource-editor`)?.querySelector(`.sidebar.is-drawer`)??document.querySelector(`.sidebar.is-drawer`),g=h?h.getBoundingClientRect().left:void 0,_=`${contextPadLeft({container:s,target:f,padWidth:p,margin:8*r.zoom(),obstacleLeft:g})}px`;t.style.left!==_&&(d=!0,t.style.left=_,d=!1)},f=new MutationObserver(t=>{for(let r of t){let t=r.target;t.classList&&t.classList.contains(`djs-context-pad`)&&t.classList.contains(`open`)&&reposition(t)}});f.observe(a._container,{attributes:!0,attributeFilter:[`style`],subtree:!0});let handleOpen=t=>{u=Array.isArray(t.current.target)?null:t.current.target;let r=a._container.querySelector(`.djs-context-pad.open`);r&&reposition(r)},handleClose=()=>{u=null};return s.on(`contextPad.open`,handleOpen),s.on(`contextPad.close`,handleClose),()=>{f.disconnect(),s.off(`contextPad.open`,handleOpen),s.off(`contextPad.close`,handleClose)}}function attribute(t,r){let a=t?.get?.(r)??t?.$attrs?.[r];return typeof a==`string`&&a.trim()?a:void 0}function extensions(t){return t?.extensionElements?.values??[]}function of(t,r,a){return a&&a.trim()?[{kind:r,value:a}]:[]}function namesOf(t){let r=t,a=r?.$type;if(a===`bpmn:Message`)return of(r,`MESSAGE`,r.name);if(a===`bpmn:Signal`)return of(r,`SIGNAL`,r.name);if(a===`bpmn:Error`)return of(r,`ERROR`,r.errorCode);let o=extensions(r),s=o.find(t=>t?.$type===`zeebe:TaskDefinition`),u=o.find(t=>t?.$type===`zeebe:CalledElement`),d=o.find(t=>t?.$type===`zeebe:CalledDecision`),f=o.find(t=>t?.$type===`zeebe:FormDefinition`),p=o.filter(t=>typeof t?.$type==`string`&&t.$type.endsWith(`Listeners`));return[...of(r,`MESSAGE`,r?.messageRef?.name),...of(r,`SIGNAL`,r?.signalRef?.name),...of(r,`JOB_TYPE`,s?.type),...p.flatMap(t=>of(t,`JOB_TYPE`,t.type)),...of(r,`TOPIC`,attribute(r,`camunda:topic`)),...of(r,`CLASS`,attribute(r,`camunda:class`)),...of(r,`BEAN`,D(attribute(r,`camunda:delegateExpression`)??``)),...of(r,`PROCESS`,typeof r?.calledElement==`string`?r.calledElement:void 0),...of(r,`PROCESS`,u?.processId),...of(r,`DECISION`,attribute(r,`camunda:decisionRef`)),...of(r,`DECISION`,d?.decisionId),...of(r,`FORM`,attribute(r,`camunda:formKey`)),...of(r,`FORM`,attribute(r,`camunda:formRef`)),...of(r,`FORM`,f?.formId),...of(r,`FORM`,f?.formKey)]}function changesBetween(t,r){let a=new Map(t.map(t=>[t.kind,t.value]));return r.filter(t=>{let r=a.get(t.kind);return!!r&&r!==t.value}).map(t=>({kind:t.kind,from:a.get(t.kind),to:t.value}))}function onceKey(t=500){let r=new Set;return a=>!r.has(a)&&(r.add(a),r.size>t&&r.delete(r.values().next().value),!0)}var Aj=[`commandStack.element.updateProperties.execute`,`commandStack.element.updateModdleProperties.execute`],jj=[`commandStack.element.updateProperties.executed`,`commandStack.element.updateModdleProperties.executed`],elementOf=t=>t?.context?.element,businessOf=t=>elementOf(t)?.businessObject;function watchLinkedRenames(t,r){let a=new Map,o=onceKey(),take=t=>{let r=elementOf(t);r?.id&&a.set(r.id,namesOf(businessOf(t)))},report=t=>{let s=elementOf(t);if(!s?.id)return;let u=a.get(s.id);a.delete(s.id),u&&changesBetween(u,namesOf(businessOf(t))).forEach(t=>{if(!o(`${s.id}:${t.kind}:${t.from}:${t.to}`))return;let a=r();if(!a)return;let u=ce();u.offerLinkedRename&&u.requestFeature(E.CODE_LINKS).then(t=>t?u:null).then(r=>r?.offerLinkedRename?.({kind:C[t.kind],from:t.from,to:t.to,path:a})).catch(t=>console.warn(`The host did not take the rename offer`,t))})},s=[...Aj.map(t=>[t,take]),...jj.map(t=>[t,report])];return s.forEach(([r,a])=>t.on(r,a)),()=>s.forEach(([r,a])=>t.off(r,a))}var Mj=`...`,Nj=3,Pj=30,Fj=50;function truncate(t,r){return t.length>r?`${t.substring(0,r-3)}${Mj}`:t}function ElementTooltip({elementInfo:t,position:r,visible:a,facts:o}){let[s,u]=f(!1),[d,p]=f(null),_=g(null),S=g(!1);if(b(()=>{if(a&&t)u(!0),S.current=!1;else{let t=setTimeout(()=>{u(!1),p(null)},150);return()=>clearTimeout(t)}},[a,t]),y(()=>{let t=_.current;if(!t||!a||!r||S.current)return;S.current=!0;let o=t.getBoundingClientRect(),s=window.innerWidth,u=window.innerHeight,d=r.elementWidth||100,f=r.elementHeight||80,h=r.x,g=r.y,v=h,y=g,b=`right`,x=h-d/2,C=h+d/2,w=g-f/2,T=g+f/2,E=C+12,D=w;if(E+o.width+16<=s&&D>=16&&D+o.height<=u-16)v=E,y=Math.max(16,Math.min(D,u-o.height-16)),b=`right`;else{let t=x-o.width-12,r=w;if(t>=16&&r>=16&&r+o.height<=u-16)v=t,y=Math.max(16,Math.min(r,u-o.height-16)),b=`left`;else{let t=x,r=T+12;if(r+o.height<=u-16&&t>=16&&t+o.width<=s-16)v=Math.max(16,Math.min(t,s-o.width-16)),y=r,b=`bottom`;else{let t=x,r=w-o.height-12;r>=16&&t>=16&&t+o.width<=s-16?(v=Math.max(16,Math.min(t,s-o.width-16)),y=r,b=`top`):(v=Math.min(E,s-o.width-16),y=Math.max(16,Math.min(D,u-o.height-16)),b=`right`)}}}p({x:v,y,side:b})},[s,a,r]),!s||!t||!r)return null;let C=d||{x:r.x,y:r.y,side:`right`},formatElementType=t=>t.replace(/^bpmn:/,``).replace(/([A-Z])/g,` $1`).trim(),getInputOutputParameters=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=[],o=[],s=r.ioSpecification;if(s){let t=s.dataInputs||[],r=s.dataOutputs||[];t.forEach(t=>{a.push({name:t.name||t.id,value:t.value||t.default})}),r.forEach(t=>{o.push({name:t.name||t.id,value:t.value||t.default})})}if(r.extensionElements?.values&&r.extensionElements.values.forEach(t=>{t.$type===`zeebe:IoMapping`&&(t.inputParameters&&t.inputParameters.forEach(t=>{a.push({name:t.target||t.name,value:t.source||t.value})}),t.outputParameters&&t.outputParameters.forEach(t=>{o.push({name:t.target||t.name,value:t.source||t.value})})),t.$type===`camunda:InputOutput`&&(t.inputParameters&&t.inputParameters.forEach(t=>{a.push({name:t.name,value:t.value||t.definition})}),t.outputParameters&&t.outputParameters.forEach(t=>{o.push({name:t.name,value:t.value||t.definition})}))}),r.properties&&r.properties.forEach(t=>{t.name&&t.value&&a.push({name:t.name,value:t.value})}),a.length===0&&o.length===0)return null;let params=(t,r)=>v(`div`,{className:`element-tooltip-subsection`,children:[v(`div`,{className:`element-tooltip-subsection-title`,children:r}),t.slice(0,Nj).map((t,r)=>v(`div`,{className:`element-tooltip-param`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.name,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value?truncate(t.value,Pj):x(`app.tooltip.notSet`)})]},r)),t.length>Nj&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.length-Nj})})]});return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inputOutputParameters`)}),a.length>0&¶ms(a,x(`app.tooltip.in`,{number:a.length})),o.length>0&¶ms(o,x(`app.tooltip.out`,{number:o.length}))]})},getTypeSpecificInfo=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=t.type.replace(`bpmn:`,``);if(a===`ScriptTask`&&r.script){let t=r.script.split(`
|
|
1903
|
+
`):x(`app.ghost.check.passed`)),o.append(u),o}function label(t,r,a){if(!a)return null;let o=!/Event$|Gateway$/.test(t),s=words(a),u=node(`text`,{"text-anchor":`middle`},`ghost__name type-tooltip`),d=r.x+r.width/2,f=o?r.y+r.height/2-(s.length-1)*14/2+4:r.y+r.height+16;return s.forEach((t,r)=>{let a=node(`tspan`,{x:d,y:f+r*14});a.textContent=t,u.append(a)}),u}function middleOf(t){let r=Math.max(0,Math.floor((t.length-1)/2)),a=t[r],o=t[r+1]??a;return{x:(a.x+o.x)/2,y:(a.y+o.y)/2}}function unite(t){if(t.length===0)return null;let r=Math.min(...t.map(t=>t.x)),a=Math.min(...t.map(t=>t.y)),o=Math.max(...t.map(t=>t.x+t.width)),s=Math.max(...t.map(t=>t.y+t.height));return{x:r,y:a,width:o-r,height:s-a}}function boundsOfPoints(t){let r=t.map(t=>t.x),a=t.map(t=>t.y);return{x:Math.min(...r),y:Math.min(...a),width:Math.max(...r)-Math.min(...r),height:Math.max(...a)-Math.min(...a)}}var UA=`penstock-ghost-arrow`;function boundsOfElement(t,r){let a=t.get(r);return a?a.waypoints&&a.waypoints.length>1?boundsOfPoints(a.waypoints):typeof a.x==`number`?{x:a.x,y:a.y??0,width:a.width??0,height:a.height??0}:null:null}function ghostDefs(t){let r=node(`defs`),a=node(`marker`,{id:t,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`});return a.append(node(`path`,{d:`M0,1 L9,5 L0,9 z`},`ghost__arrow`)),r.append(a),r}function renderGhost(t,r,a){let o=node(`g`,{"data-ghost-index":t.index,"data-ghost-kind":t.kind},`ghost ghost--${t.kind}${r.focused?` ghost--focus`:``}${blocked(t)?` ghost--blocked`:``}`),s=t.effect,u=null,d=null;for(let t of s.added){if(!t.bounds)continue;o.append(outline(t.type,t.bounds,`ghost__shape`));let r=label(t.type,t.bounds,t.name??``);r&&o.append(r),u={x:t.bounds.x,y:t.bounds.y-zA-4},d={x:t.bounds.x+t.bounds.width,y:t.bounds.y}}for(let t of s.addedFlows)if(!(!t.waypoints||t.waypoints.length<2)&&(o.append(path(t.waypoints,`ghost__flow`,r.arrowId)),!u)){let r=middleOf(t.waypoints);u={x:r.x+4,y:r.y-zA-4},d={x:r.x,y:r.y}}for(let r of s.removed)if(r.bounds){o.append(outline(r.type,r.bounds,`ghost__shape ghost__shape--removed`));let{x:a,y:f,width:p,height:h}=r.bounds;o.append(path([{x:a-4,y:f+h+4},{x:a+p+4,y:f-4}],`ghost__strike`,null)),u&&r.id!==s.operation.op||(u={x:a,y:f-zA-4}),(!d||s.operation.op===`remove`&&r.id===t.elementIds[0])&&(d={x:a+p,y:f})}else if(r.waypoints&&r.waypoints.length>1&&(o.append(path(r.waypoints,`ghost__flow ghost__flow--removed`,null)),!u)){let t=middleOf(r.waypoints);u={x:t.x+4,y:t.y-zA-4},d=t}for(let t of s.moved.slice(0,1)){let s=a.get(t.id)?.businessObject?.$type??`bpmn:Task`;o.append(outline(s,t.to,`ghost__shape`));let f={x:t.from.x+t.from.width/2,y:t.from.y+t.from.height/2},p={x:t.to.x+t.to.width/2,y:t.to.y+t.to.height/2};o.append(path([f,p],`ghost__trail`,r.arrowId)),u={x:t.to.x,y:t.to.y-zA-4},d={x:t.to.x+t.to.width,y:t.to.y}}for(let t of s.changed){let r=boundsOfElement(a,t.id)??t.bounds;if(!r)continue;let s=a.get(t.id);if(s?.waypoints&&s.waypoints.length>1){o.append(path(s.waypoints,`ghost__flow ghost__flow--changed`,null));let t=middleOf(s.waypoints);u={x:t.x+4,y:t.y-zA-4},d=t}else{let t={x:r.x-4,y:r.y-4,width:r.width+8,height:r.height+8};o.append(node(`rect`,{...t,rx:12},`ghost__frame`)),u={x:t.x,y:t.y-zA-2},d={x:t.x+t.width,y:t.y}}}return u&&o.append(chip(t.chip,u,`ghost__chip--${t.kind}`)),d&&r.badge&&o.append(badge(t,d)),o}var GhostLayer=class{static $inject=[`canvas`,`elementRegistry`,`eventBus`];canvas;registry;eventBus;items=[];focus=-1;cover=PA;picker=()=>void 0;group=null;redraw=()=>this.draw();constructor(t,r,a){this.canvas=t,this.registry=r,this.eventBus=a,a.on([`import.done`,`elements.changed`],this.redraw)}destroy(){this.eventBus.off([`import.done`,`elements.changed`],this.redraw),this.group?.replaceChildren()}onPick(t){this.picker=t}show(t,r){this.items=t,this.focus=r,this.draw()}clear(){this.items=[],this.focus=-1,this.group?.replaceChildren()}boundsOf(t){let r=this.items.find(r=>r.index===t);return r?this.areaOf(r):null}setCover(t){this.cover=t}reveal(t){let r=this.boundsOf(t);r&&this.bring(r)}revealAll(){let t=unite(this.items.map(t=>this.areaOf(t)).filter(t=>t!==null));t&&this.bring(t)}bring(t){let r=viewFor(this.canvas.viewbox(),t,this.cover);r&&this.canvas.viewbox(r)}areaOf(t){let r=[],a=t.effect;for(let t of[...a.added,...a.removed])t.bounds&&r.push(t.bounds);for(let t of[...a.addedFlows,...a.removed])t.waypoints&&t.waypoints.length>1&&r.push(boundsOfPoints(t.waypoints));for(let t of a.moved.slice(0,1))r.push(t.to,t.from);for(let t of a.changed){let a=boundsOfElement(this.registry,t.id)??t.bounds;a&&r.push(a)}return a.operation.op===`connect`&&r.length===0?null:unite(r)}ensureGroup(){let t=this.canvas.getLayer(LA,RA);return this.group!==t&&(this.group=t,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`class`,`${t.getAttribute(`class`)??``} ghost-layer`.trim())),t}draw(){let t=this.ensureGroup();t.replaceChildren();let r=this.items.filter(t=>t.decision===`pending`);if(r.length!==0){t.append(ghostDefs(UA));for(let a of r){let r=renderGhost(a,{focused:a.index===this.focus,badge:!0,arrowId:UA},this.registry);r.addEventListener(`click`,t=>{t.stopPropagation(),this.picker(a.index)}),t.append(r)}}}},WA=`penstock.applyPatch`;function shapeOf(t,r){let a=t.get(r);if(!a||a.type===`label`)throw new Ha(x(`app.cli.edit.noSuchElement`,{id:r}));return a}var ApplyPatchHandler=class{static $inject=[`modeling`,`elementRegistry`,`elementFactory`,`bpmnFactory`,`moddle`];services;constructor(t,r,a,o,s){this.services={modeling:t,registry:r,elementFactory:a,bpmnFactory:o,moddle:s}}preExecute(t){t.created=[];for(let r of t.effects)this.run(r,t)}properties(){return{modeling:this.services.modeling,moddle:this.services.moddle}}run(t,r){let{modeling:a,registry:o,elementFactory:s,bpmnFactory:u}=this.services,d=t.operation;switch(d.op){case`add`:{let f=shapeOf(o,d.after),p=t.added[0],h=t.addedFlows[0],g=Ga[d.element].type,_={id:p.id};d.name&&(_.name=d.name);let v=s.createShape({type:g,businessObject:u.create(g,_),...d.event?{eventDefinitionType:Xa[d.event]}:{}}),y=p.bounds,b=a.createShape(v,{x:y.x+y.width/2,y:y.y+y.height/2},f.parent);a.connect(f,b,{type:`bpmn:SequenceFlow`,businessObject:u.create(`bpmn:SequenceFlow`,{id:h.id})}),d.properties&&Ya(this.properties(),r.engine,b,d.properties),r.created?.push(b.id,h.id);return}case`connect`:{let s=shapeOf(o,d.from),f=shapeOf(o,d.to),p=t.addedFlows[0],h=a.connect(s,f,{type:`bpmn:SequenceFlow`,businessObject:u.create(`bpmn:SequenceFlow`,{id:p.id})});d.name&&a.updateProperties(h,{name:d.name}),d.condition&&Ya(this.properties(),r.engine,h,{condition:d.condition}),r.created?.push(h.id);return}case`set`:Ya(this.properties(),r.engine,shapeOf(o,d.id),d.properties);return;case`remove`:{let t=shapeOf(o,d.id),r=[...t.incoming??[],...t.outgoing??[]];a.removeElements(t.waypoints?[t]:[...new Set(r),t]);return}case`move`:a.moveElements([shapeOf(o,d.id)],{x:d.dx,y:d.dy});return}}},PatchApplier=class{static $inject=[`commandStack`];commandStack;constructor(t){this.commandStack=t,t.registerHandler(WA,ApplyPatchHandler)}apply(t,r){if(t.length===0)return[];let a={effects:t,engine:r};return this.commandStack.execute(WA,a),a.created??[]}},GA={__init__:[`ghostLayer`,`patchApplier`],ghostLayer:[`type`,GhostLayer],patchApplier:[`type`,PatchApplier]},KA=`penstock-next-block`,qA=401,JA=`penstock-next-block-arrow`;function suggestedType(t){return ie(t.steps[0].added[0]?.type??``)}function itemOf(t){let r=t.patch.operations[0],a=t.steps[0];return{index:0,operation:r,kind:kindOf(r),label:labelFor(r,a,()=>void 0),chip:x(`app.nextBlock.chip`,{type:suggestedType(t)}),elementIds:idsOf(a),decision:`pending`,check:{status:`ok`,messages:[]},needs:[],effect:a}}var NextBlockLayer=class{static $inject=[`canvas`,`elementRegistry`];canvas;registry;group=null;constructor(t,r){this.canvas=t,this.registry=r}show(t){this.ensureGroup().replaceChildren(ghostDefs(JA),renderGhost(itemOf(t),{focused:!1,badge:!1,arrowId:JA},this.registry))}hide(){this.group?.replaceChildren()}destroy(){this.hide()}ensureGroup(){let t=this.canvas.getLayer(KA,qA);return this.group!==t&&(this.group=t,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`class`,`${t.getAttribute(`class`)??``} ghost-layer next-block-layer`.trim())),t}},YA={__init__:[`nextBlockLayer`],nextBlockLayer:[`type`,NextBlockLayer]},XA={statuses:new Map,paused:new Set,card:null,actions:null},ZA=new Set;function change(t){XA={...XA,...t},ZA.forEach(t=>t())}function codeBridgeState(){return XA}function watchCodeBridge(t){return ZA.add(t),()=>ZA.delete(t)}function setCodeStatuses(t){let r=new Map(t.map(t=>[t.elementId,t]));change({statuses:r,card:XA.card&&r.has(XA.card.elementId)?XA.card:null})}function setCodePaused(t){let r=new Map;XA.statuses.forEach((a,o)=>r.set(o,{...a,paused:t.has(o)})),change({paused:t,statuses:r})}function setCodeActions(t){change({actions:t})}function showCodeCard(t){let r=XA.card;r&&r.elementId===t.elementId&&r.anchor===t.anchor&&r.pinned===t.pinned||change({card:t})}function hideCodeCard(){XA.card&&change({card:null})}function resetCodeBridge(){XA={statuses:new Map,paused:new Set,card:null,actions:null},ZA.forEach(t=>t())}function kindLabel(t){switch(t){case`JOB_TYPE`:return x(`app.codeBridge.kindJobType`);case`TOPIC`:return x(`app.codeBridge.kindTopic`);case`CLASS`:return x(`app.codeBridge.kindClass`);case`BEAN`:return x(`app.codeBridge.kindBean`);case`MESSAGE`:return x(`app.codeBridge.kindMessage`);case`PROCESS`:return x(`app.codeBridge.kindProcess`);case`DECISION`:return x(`app.codeBridge.kindDecision`)}}function openLabel(t,r){switch(t){case`PROCESS`:return x(`app.codeBridge.openProcess`);case`DECISION`:return x(`app.codeBridge.openDecision`);default:return r?x(`app.codeBridge.openPlace`,{where:r}):x(`app.codeBridge.openCode`)}}function fileName(t){return t.split(/[\\/]/).pop()??t}function whereOf(t){return t.kind===`PROCESS`||t.kind===`DECISION`?fileName(t.file):`${fileName(t.file)}:${t.line}`}function stateLabel(t){switch(t.state){case`bound`:return x(`app.codeBridge.stateBound`);case`missing`:return x(`app.codeBridge.stateMissing`);case`ambiguous`:return x(`app.codeBridge.stateAmbiguous`);default:return``}}function leadBinding(t){return t.bindings.find(r=>r.state===t.state)??t.bindings[0]}function badgeLabel(t){let r=leadBinding(t),a=r?.value??t.label,o=t.label;return t.state===`missing`?x(`app.codeBridge.badgeMissing`,{element:o,name:a}):t.state===`ambiguous`?x(`app.codeBridge.badgeAmbiguous`,{element:o,count:r?.anchors.length??0,name:a}):x(`app.codeBridge.badgeBound`,{element:o,where:t.anchors[0]?whereOf(t.anchors[0]):a})}function detailLines(t){return t.state===`missing`?[x(`app.codeBridge.missingDetail`,{name:t.value}),...t.near?[x(`app.codeBridge.missingNear`,{near:t.near})]:[]]:t.state===`ambiguous`?[x(`app.codeBridge.ambiguousDetail`,{name:t.value})]:[]}function reachedElements(t){if(!t||t.reach.size===0)return null;let r=new Set;return t.reach.forEach(t=>t.all.elements.forEach(t=>r.add(t))),r}var QA=/\.(java|kt|kts|groovy|scala)$/,$A=/\.(js|mjs|cjs|ts)$/,ej=/\.py$/;function stubLanguage(t){let r=0,a=0,o=0;for(let s of t)QA.test(s.file)?r+=1:$A.test(s.file)?a+=1:ej.test(s.file)&&(o+=1);return o>r&&o>a?`python`:a>r?`node`:`spring`}function stubTemplateFor(t,r){if(t.state!==`missing`)return null;let a=t.bindings.find(t=>t.state===`missing`&&(t.kind===`JOB_TYPE`||t.kind===`TOPIC`));if(!a)return null;let o=a.kind===`JOB_TYPE`?`zeebe:taskDefinition`:`camunda:topic`;return r.find(t=>t?.id&&t.elementType?.[o]===a.value)??null}var tj=300,nj=200,rj=400,ij,aj,oj=0,sj=null;function cancelCardHide(){window.clearTimeout(aj),aj=void 0}function cancelCardShow(){window.clearTimeout(ij),ij=void 0}function hoverCard(t,r){cancelCardHide(),cancelCardShow(),ij=window.setTimeout(()=>showCodeCard({elementId:t,anchor:r,pinned:!1}),tj)}function focusCard(t,r){r===sj&&Date.now()<oj||(cancelCardHide(),cancelCardShow(),showCodeCard({elementId:t,anchor:r,pinned:!1}))}function pinCard(t,r){cancelCardHide(),cancelCardShow(),showCodeCard({elementId:t,anchor:r,pinned:!0})}function leaveCard(){cancelCardShow(),cancelCardHide(),!codeBridgeState().card?.pinned&&(aj=window.setTimeout(hideCodeCard,nj))}function closeCard(){oj=Date.now()+rj,sj=codeBridgeState().card?.anchor??null,cancelCardShow(),cancelCardHide(),hideCodeCard()}var cj=`penstock-code`,lj=`http://www.w3.org/2000/svg`,uj=`M5.5 4L2 8l3.5 4M10.5 4L14 8l-3.5 4`,shown=()=>TA.codeBadges();function codeBadgePosition(){return{bottom:-12,left:3}}function icon(){let t=document.createElementNS(lj,`svg`);t.setAttribute(`viewBox`,`0 0 16 16`),t.setAttribute(`width`,`12`),t.setAttribute(`height`,`12`),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,`currentColor`),t.setAttribute(`stroke-width`,`1`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`stroke-linejoin`,`round`),t.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(lj,`path`);return r.setAttribute(`d`,uj),t.appendChild(r),t}function codeBadgeElement(t){let r=document.createElement(`button`);if(r.type=`button`,r.className=`penstock-code-badge type-badge penstock-code-badge--${t.state}`,r.setAttribute(`aria-label`,badgeLabel(t)),r.setAttribute(`aria-haspopup`,`dialog`),r.appendChild(icon()),t.state!==`bound`){let a=document.createElement(`span`);a.className=`penstock-code-badge__mark`,a.textContent=t.state===`ambiguous`?String(t.anchors.length):`?`,r.appendChild(a)}return r.addEventListener(`pointerenter`,()=>hoverCard(t.elementId,r)),r.addEventListener(`pointerleave`,leaveCard),r.addEventListener(`focus`,()=>focusCard(t.elementId,r)),r.addEventListener(`blur`,leaveCard),r.addEventListener(`click`,a=>{a.stopPropagation(),pinCard(t.elementId,r)}),r.addEventListener(`keydown`,t=>{t.key===`Escape`&&(t.stopPropagation(),closeCard())}),r}var CodeBadges=class{static $inject=[`elementRegistry`,`overlays`,`eventBus`];registry;overlays;eventBus;redraw=()=>this.refresh();drawn=null;stop;constructor(t,r,a){this.registry=t,this.overlays=r,this.eventBus=a,a?.on?.([`import.done`],this.redraw),this.stop=watchCodeBridge(()=>{codeBridgeState().statuses!==this.drawn&&this.refresh()}),this.refresh()}destroy(){this.stop();try{this.eventBus?.off?.([`import.done`],this.redraw)}catch{}try{this.overlays?.remove?.({type:cj})}catch{}}refresh(){try{this.overlays?.remove?.({type:cj})}catch{}if(!shown())return;this.drawn=codeBridgeState().statuses;let t=new Map;codeBridgeState().statuses.forEach(r=>{if(isBadged(r))try{let a=this.registry?.get?.(r.elementId);if(!a)return;let o=codeBadgeElement(r);this.overlays?.add?.(a,cj,{position:codeBadgePosition(),html:o}),t.set(r.elementId,o)}catch{}});let r=codeBridgeState().card,a=r?t.get(r.elementId):void 0;r&&a&&r.anchor!==a&&showCodeCard({...r,anchor:a})}},dj={__init__:[`codeBadges`],codeBadges:[`type`,CodeBadges]};function CodeBridgeEntry({element:t}){let[r,a]=Or(codeBridgeState());Vn(()=>watchCodeBridge(()=>a(codeBridgeState())),[]);let o=t?.id?r.statuses.get(t.id):void 0;if(!o||o.state===`notApplicable`)return null;let s=r.actions,u=leadBinding(o),d=s?.stubFor(o)??null,open=t=>s?.open(t);return v(`div`,{class:`penstock-code-entry`,children:[v(`p`,{class:`penstock-code-entry__state type-dialog-title${o.state===`missing`?` penstock-code-entry__state--missing`:``}`,children:[stateLabel(o),u&&` · ${kindLabel(u.kind)} ${u.value}`]}),u&&detailLines(u).map(t=>v(`p`,{class:`penstock-code-entry__note type-help`,children:t},t)),v(`div`,{class:`penstock-code-entry__actions`,children:[(u?.anchors??[]).slice(0,3).map(t=>v(`button`,{type:`button`,class:`ui-button`,onClick:()=>open(t),children:openLabel(t.kind,whereOf(t))},`${t.file}:${t.line}`)),d&&v(`button`,{type:`button`,class:`ui-button`,onClick:()=>s?.createStub(o),children:x(`app.codeBridge.createStub`)})]})]})}var fj=120,CodeBridgeProvider=class{static $inject=[`propertiesPanel`,`eventBus`];propertiesPanel;shownFor=new Set;constructor(t,r){this.propertiesPanel=t,t.registerProvider(fj,this);let a=watchCodeBridge(()=>{let t=new Set;codeBridgeState().statuses.forEach(r=>{isBadged(r)&&t.add(r.elementId)});let r=t.size===this.shownFor.size&&[...t].every(t=>this.shownFor.has(t));if(this.shownFor=t,!r)try{this.propertiesPanel._update?.()}catch{}});r?.on?.(`diagram.destroy`,a)}getGroups(t){return r=>{try{if(!Array.isArray(r)||!t?.id)return r;let a=codeBridgeState().statuses.get(t.id);if(!a||!isBadged(a))return r;let o={id:`codeBridge`,label:x(`app.codeBridge.groupTitle`),entries:[{id:`codeBridge`,element:t,component:CodeBridgeEntry}]},s=r.findIndex(t=>t.id===`general`);return[...r.slice(0,s+1),o,...r.slice(s+1)]}catch{return r||[]}}}},pj={__init__:[`codeBridgeProvider`],codeBridgeProvider:[`type`,CodeBridgeProvider]},traced=()=>void 0;function setTracePadHandler(t){traced=t}var TraceContextPadProvider=class{static $inject=[`contextPad`];constructor(t){t.registerProvider(1500,this)}getContextPadEntries(t){return ct(t?.businessObject)?r=>({...r,"trace-paths":{className:`penstock-context-pad-trace`,title:x(`app.tracePaths.tracePaths`),html:`<div class="entry" draggable="true">${ot}</div>`,action:{click:(r,a)=>{traced(a??t),r?.stopPropagation?.()}}}}):t=>t}},mj={__init__:[`traceContextPadProvider`],traceContextPadProvider:[`type`,TraceContextPadProvider]},hj={"start-event":`create.start-event`,"intermediate-event":`create.intermediate-event`,"end-event":`create.end-event`,gateway:`create.exclusive-gateway`,task:`create.task`,"data-object":`create.data-object`,"data-store":`create.data-store`,"sub-process":`create.subprocess-expanded`,participant:`create.participant-expanded`,group:`create.group`};Object.keys(hj);function paletteOf(t){if(!Array.isArray(t))return null;let r=t.filter(t=>typeof t==`string`&&Object.hasOwn(hj,t));return r.length===0?null:[...new Set(r)]}function reducePalette(t,r){let a=paletteOf(r);if(a===null)return t;let o=new Set(Object.entries(hj).filter(([t])=>!a.includes(t)).map(([,t])=>t));for(let r of o)delete t[r];return t}var ReducedPalette=class{static $inject=[`palette`];constructor(t){let r=window.appConfig?.palette??null;t.registerProvider(500,{getPaletteEntries:()=>t=>reducePalette(t,r)})}},gj={__init__:[`reducedPalette`],reducedPalette:[`type`,ReducedPalette]},_j={name:`Penstock`,uri:`https://github.com/kern0x1b/penstock-release/ns/comments/1.0`,prefix:`penstock`,xml:{tagAlias:`lowerCase`},types:[{name:`Comments`,superClass:[`Element`],properties:[{name:`comment`,type:`Comment`,isMany:!0}]},{name:`Comment`,superClass:[`Element`],properties:[{name:`id`,type:`String`,isAttr:!0},{name:`author`,type:`String`,isAttr:!0},{name:`date`,type:`String`,isAttr:!0},{name:`resolved`,type:`Boolean`,isAttr:!0},{name:`text`,type:`String`,isBody:!0}]}]},vj=`@camunda/zeebe-element-templates-json-schema`;function isRecord(t){return typeof t==`object`&&!!t&&!Array.isArray(t)}function isText(t){return typeof t==`string`}function schemaReasons(t,r){if(r!==`camunda-8`)return[];let a=t.$schema;return a?!isText(a)||!a.includes(vj)?[x(`app.templates.rejected.schemaOther`)]:[]:[x(`app.templates.rejected.schemaMissing`)]}function reasonsOf(t,r){if(!isRecord(t))return[x(`app.templates.rejected.notAnObject`)];let{elementType:a,appliesTo:o}=t,s=schemaReasons(t,r);return a!=null&&!(isRecord(a)&&isText(a.value))&&s.push(x(`app.templates.rejected.elementType`)),o!=null&&!(Array.isArray(o)&&o.every(isText))&&s.push(x(`app.templates.rejected.appliesTo`)),s}function splitTemplates(t,r){let a={loadable:[],unloadable:[]};for(let o of t){let t=reasonsOf(o,r);t.length===0?a.loadable.push(o):a.unloadable.push({template:o,reasons:t})}return a}var yj=/^template\(id: <[^>]*>, name: <[^>]*>\): /;function identityOf(t){let r=typeof t==`object`&&t?t:{},a=typeof r.id==`string`?r.id:``;return{name:typeof r.name==`string`&&r.name!==``?r.name:a,id:a,version:typeof r.version==`number`?r.version:null}}function keyOf(t){let{id:r,version:a}=identityOf(t);return`${r}@${a??`_`}`}var TemplateRejections=class{static $inject=[`eventBus`,`elementTemplates`];reasons=new Map;elementTemplates;constructor(t,r){this.elementTemplates=r,t.on(`elementTemplates.errors`,({errors:t})=>{let r=new Map;for(let a of t){if(!a.template)continue;let t=keyOf(a.template);r.set(t,[...r.get(t)??[],a.message.replace(yj,``)])}r.forEach((t,r)=>this.reasons.set(r,t))})}rejected(t){return t.filter(t=>typeof t==`object`&&!!t).filter(t=>{let{id:r,version:a}=identityOf(t);return!this.elementTemplates.get(r,a??void 0)}).map(t=>({...identityOf(t),reasons:this.reasons.get(keyOf(t))??[x(`app.templates.rejected.unexplained`)]}))}},bj={__init__:[`templateRejections`],templateRejections:[`type`,TemplateRejections]};function getCommonOptions(t){let r=window.appConfig,a={alignToOrigin:{alignOnSave:!1,offset:150,tolerance:50},linting:{active:!0,bpmnlint:builtinSetup(null)}};t.propertiesPanelContainer&&(a.propertiesPanel={parent:t.propertiesPanelContainer}),a.textRenderer={defaultStyle:lt.defaultStyle},a.rendering=r?.isSketchyMode?`sketchy`:`default`;let o=$n();return a.bpmnRenderer={defaultFillColor:o.fill,defaultStrokeColor:o.stroke},a}function getCommonModules(){return[mt,dE,ck,ho,jg,dA,uA,fA,Ou,Au,kA,GA,YA,dj,qn,gj,mj,ME,br,NE,FE]}function createBpmnModeler(t){at();let r=window.appConfig,a=getCommonOptions(t),o=getCommonModules(),s=Ve(r?.engine),u=s?.family===`camunda-7`,d=s?.family===`camunda-8`,f=s?.key===`operaton`,p=Array.isArray(r?.elementTemplatesContent)?r.elementTemplatesContent:[],h={container:t.container,...a,taskResizingEnabled:!0,elementTemplates:splitTemplates(p,s?.family??null).loadable};if(u){let t=[...o,eT,zk,Wk,pj,bA,bj],r={penstock:_j};return f&&(t.push(uu),r.camunda=du),new Modeler$1({...h,additionalModules:t,moddleExtensions:r})}if(d)return new Modeler({...h,additionalModules:[...o,sA,eT,Jw,zk,Wk,pj,bj,$k],moddleExtensions:{penstock:_j}});let g=s?.family===`flowable`||s?.family===`activiti`?s.family:null;return new Modeler$3({...h,additionalModules:[...o,z_,Z_,Jk,Xk,...g?[flowableModule(g)]:[],Wk,pj,BC,Qn,j_],moddleExtensions:{penstock:_j,...g?{[g]:Ke(g)}:{}}})}var xj=/^\$\{(.+)\}$/,Sj=/^[A-Za-z_$][A-Za-z0-9_$]*/,Cj=new Set([`camunda:ExecutionListener`,`camunda:TaskListener`]);function looksLikeClassName(t){if(!t.includes(`.`))return!1;let r=t.split(`.`);if(r.some(t=>t.length===0))return!1;let a=r[r.length-1];return/^[A-Z][A-Za-z0-9_$]*$/.test(a)}function classOf(t){let r=t?.trim();return r?{kind:`JAVA_CLASS`,value:r,label:r.slice(r.lastIndexOf(`.`)+1)}:null}function unwrap(t){let r=t?.trim();if(!r)return null;let a=xj.exec(r);return a?a[1].trim():r}function fromDelegate(t){let r=unwrap(t);if(!r)return null;if(looksLikeClassName(r))return classOf(r);let a=Sj.exec(r)?.[0];return!a||a!==r?null:{kind:`BEAN`,value:a,label:a}}function fromExpression(t){let r=unwrap(t);if(!r)return null;let a=Sj.exec(r)?.[0];return!a||a===r||!r.slice(a.length).startsWith(`.`)||/^[A-Z]/.test(a)?null:{kind:`BEAN`,value:a,label:a}}function fromEntry(t){return t?classOf(t.class)??fromDelegate(t.delegateExpression)??fromExpression(t.expression):null}function classReferenceOf(t){if(!t)return null;let r=classOf(t.class)??fromDelegate(t.delegateExpression)??fromExpression(t.expression)??classOf(t.variableMappingClass)??fromDelegate(t.variableMappingDelegateExpression);if(r)return r;for(let r of t.eventDefinitions??[]){let t=fromEntry(r);if(t)return t}for(let r of t.extensionElements?.values??[]){if(r.$type===`zeebe:TaskDefinition`){let t=r.type?.trim();if(t&&!t.startsWith(`=`))return{kind:`JOB_TYPE`,value:t,label:t};continue}if(!Cj.has(r.$type??``))continue;let t=fromEntry(r);if(t)return t}return null}async function reimportKeepingView(t,r){let a=t.get(`canvas`),o=t.get(`selection`,!1),{x:s,y:u,width:d,height:f}=a.viewbox(),p=a.getRootElement()?.id,h=(o?.get()??[]).map(t=>t.id);await t.importXML(r);let g=t.get(`elementRegistry`),_=p?g.get(p):void 0;_&&a.getRootElement()?.id!==_.id&&a.setRootElement(_),a.viewbox({x:s,y:u,width:d,height:f});let v=h.map(t=>g.get(t)).filter(t=>!!t);v.length>0&&o?.select(v)}var wj=100,Tj={width:100,height:80},Ej=160,Dj=120,Oj=60,kj=10,Aj=8;function layeredPlacement(t,r){let a=new Map(t.map(t=>[t.id,0])),o=new Map(t.map(t=>[t.id,[]])),s=new Map(t.map(t=>[t.id,0]));for(let t of r)a.has(t.source)&&a.has(t.target)&&(o.get(t.source)?.push(t.target),s.set(t.target,(s.get(t.target)??0)+1));let u=t.filter(t=>s.get(t.id)===0).map(t=>t.id);for(let t=0;t<u.length;t+=1){let r=u[t];for(let t of o.get(r)??[])a.set(t,Math.max(a.get(t)??0,(a.get(r)??0)+1)),s.set(t,(s.get(t)??0)-1),s.get(t)===0&&u.push(t)}let d=new Map;for(let r of t){let t=a.get(r.id)??0,o=d.get(t)??[];o.push(r.id),d.set(t,o)}let f=[];for(let t of[...d.keys()].sort((t,r)=>t-r)){let r=d.get(t)??[];for(let t=0;t<r.length;t+=kj)f.push(r.slice(t,t+kj))}let p=[];f.forEach((t,r)=>{let a=Math.floor(r/Aj);p[a]=Math.max(p[a]??0,t.length)});let h=[],g=wj;p.forEach((t,r)=>{h[r]=g,g+=t*Dj+Oj});let _=new Map(t.map(t=>[t.id,t])),v=new Map;return f.forEach((t,r)=>{let a=Math.floor(r/Aj),o=r%Aj;t.forEach((t,r)=>{let{width:s,height:u}=_.get(t)??{width:Tj.width,height:Tj.height};v.set(t,{x:wj+o*Ej+(Tj.width-s)/2,y:h[a]+r*Dj+(Tj.height-u)/2})})}),v}var jj=/<(?:[\w.-]+:)?BPMNShape[\s>/]/;function hasDiagramInterchange(t){return jj.test(t)}function sizeOf(t){return t.$instanceOf(`bpmn:Event`)?{width:36,height:36}:t.$instanceOf(`bpmn:Gateway`)||t.$instanceOf(`bpmn:DataStoreReference`)?{width:50,height:50}:t.$instanceOf(`bpmn:DataObjectReference`)?{width:36,height:50}:{width:100,height:80}}function nodesOf(t,r,a){for(let o of t.flowElements??[])o.$instanceOf(`bpmn:SequenceFlow`)?a.push(o):(o.$instanceOf(`bpmn:FlowNode`)||o.$instanceOf(`bpmn:DataObjectReference`)||o.$instanceOf(`bpmn:DataStoreReference`))&&(r.push(o),o.$instanceOf(`bpmn:FlowElementsContainer`)&&nodesOf(o,r,a))}function centreOf(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function edgeToward(t,r){let a=centreOf(t),o=r.x-a.x,s=r.y-a.y;if(o===0&&s===0)return a;let u=Math.min(o===0?1/0:t.width/2/Math.abs(o),s===0?1/0:t.height/2/Math.abs(s));return{x:a.x+o*u,y:a.y+s*u}}async function withPlaceholderInterchange(t){if(hasDiagramInterchange(t))return t;let r=new ze,{rootElement:a}=await r.fromXML(t),o=a.rootElements??[],s=o.filter(t=>t.$instanceOf(`bpmn:Process`));if(s.length===0)return t;let u=o.find(t=>t.$instanceOf(`bpmn:Collaboration`)),d=[],f=[];for(let t of s)nodesOf(t,d,f);let p=layeredPlacement(d.map(t=>({id:t.id,...sizeOf(t)})),f.map(t=>({source:t.sourceRef?.id??``,target:t.targetRef?.id??``}))),h=[],g=r.create(`bpmndi:BPMNPlane`,{id:`Penstock_plane`,bpmnElement:u??s[0],planeElement:h}),_=new Map;d.forEach(t=>{let{width:a,height:o}=sizeOf(t),{x:s,y:u}=p.get(t.id)??{x:0,y:0},d={x:s,y:u,width:a,height:o};_.set(t.id,d),h.push(r.create(`bpmndi:BPMNShape`,{id:`${t.id}_di`,bpmnElement:t,bounds:r.create(`dc:Bounds`,d)}))});for(let t of f){let a=_.get(t.sourceRef?.id),o=_.get(t.targetRef?.id);if(!a||!o)continue;let s=edgeToward(a,centreOf(o)),u=edgeToward(o,centreOf(a));h.push(r.create(`bpmndi:BPMNEdge`,{id:`${t.id}_di`,bpmnElement:t,waypoint:[r.create(`dc:Point`,s),r.create(`dc:Point`,u)]}))}let v=r.create(`bpmndi:BPMNDiagram`,{id:`Penstock_diagram`,plane:g});a.diagrams=[...a.diagrams??[],v];let{xml:y}=await r.toXML(a,{format:!0});return y}async function drawableXml(t){if(hasDiagramInterchange(t))return{xml:t,placed:!1};try{return{xml:await withPlaceholderInterchange(t),placed:!0}}catch{return{xml:t,placed:!1}}}function watchEdits(t,r){let a=0,changed=()=>{a===0&&r()};return t.on(`commandStack.changed`,changed),{quietly:async t=>{a+=1;try{return await t()}finally{--a}},dispose:()=>t.off(`commandStack.changed`,changed)}}function ContextMenu({position:t,items:r,onClose:a,visible:o}){let s=g(null);if(b(()=>{if(!o)return;let handleClickOutside=t=>{s.current&&!s.current.contains(t.target)&&a()},handleEscape=t=>{t.key===`Escape`&&a()};return document.addEventListener(`mousedown`,handleClickOutside),document.addEventListener(`keydown`,handleEscape),()=>{document.removeEventListener(`mousedown`,handleClickOutside),document.removeEventListener(`keydown`,handleEscape)}},[o,a]),b(()=>{o&&s.current&&s.current.querySelector(`.context-menu-item:not(.disabled)`)?.focus()},[o]),y(()=>{if(!o||!s.current)return;let r=s.current,a=r.offsetWidth,u=r.offsetHeight,d=window.innerWidth,f=window.innerHeight,{x:p,y:h}=t;p+a>d&&(p=Math.max(10,d-a-10)),h+u>f&&(h=Math.max(10,f-u-10)),p<10&&(p=10),h<10&&(h=10),r.style.left=`${p}px`,r.style.top=`${h}px`},[t,o]),!o)return null;let handleItemClick=t=>{if(t.disabled)return;let r=s.current?.closest(`.resource-editor`)??void 0,o=Qa(`.djs-container svg`,r);t.action(),a(),o?.focus({preventScroll:!0})},focusSibling=(t,r)=>{let a=Array.from(s.current?.querySelectorAll(`.context-menu-item:not(.disabled)`)??[]),o=a.indexOf(t);o!==-1&&a.length!==0&&a[(o+r+a.length)%a.length].focus()},handleItemKeyDown=(t,r)=>{t.key===`Enter`||t.key===` `?(t.preventDefault(),handleItemClick(r)):t.key===`ArrowDown`?(t.preventDefault(),focusSibling(t.currentTarget,1)):t.key===`ArrowUp`&&(t.preventDefault(),focusSibling(t.currentTarget,-1))};return v(`div`,{ref:s,class:`context-menu`,role:`menu`,style:{position:`fixed`,left:`${t.x}px`,top:`${t.y}px`},children:r.map(t=>t.divider?v(`div`,{class:`context-menu-separator`,role:`separator`},t.id):v(`div`,{class:`context-menu-item ${t.disabled?`disabled`:``}`,role:`menuitem`,tabIndex:t.disabled?-1:0,"aria-disabled":t.disabled||void 0,onClick:()=>handleItemClick(t),onKeyDown:r=>handleItemKeyDown(r,t),children:[t.icon&&v(`div`,{class:`context-menu-icon`,children:t.icon}),v(`div`,{class:`context-menu-label`,children:t.label}),t.shortcut&&v(`div`,{class:`context-menu-shortcut`,children:t.shortcut})]},t.id))})}function createHoverGate(){let t=null,r=!1,cancel=()=>{t!==null&&clearTimeout(t),t=null};return{schedule(a,o){cancel(),!r&&(t=setTimeout(()=>{t=null,r||a()},o))},cancel,block(){r=!0,cancel()},release(){r=!1}}}function contextPadLeft({container:t,target:r,padWidth:a,margin:o,obstacleLeft:s}){let u=Number.isFinite(a)&&a>0?a:42,d=Number.isFinite(o)&&o>=0?o:0,f=Number.isFinite(r.right)?r.right:0,p=Number.isFinite(r.left)?r.left:0,h=Number.isFinite(t.left)?t.left:0,g=Number.isFinite(t.right)?t.right:0,_=s!==void 0&&Number.isFinite(s)?s:void 0,v=f-h+d,y=_===void 0?g:Math.min(g,_);return h+v+u<=y?Math.max(0,v):Math.max(p-h-u-d,0)}function fitContextPad(t){let r=t.get(`canvas`),a=t.get(`contextPad`,!1),o=t.get(`elementRegistry`),s=t.get(`eventBus`);if(!r||!a||!o||!s||!a._container)return()=>{};let u=null,d=!1,reposition=t=>{if(!u||d)return;let a=o.getGraphics(u);if(!a)return;let s=r.getContainer().getBoundingClientRect(),f=a.getBoundingClientRect(),p=t.getBoundingClientRect().width||42,h=r.getContainer().closest(`.resource-editor`)?.querySelector(`.sidebar.is-drawer`)??document.querySelector(`.sidebar.is-drawer`),g=h?h.getBoundingClientRect().left:void 0,_=`${contextPadLeft({container:s,target:f,padWidth:p,margin:8*r.zoom(),obstacleLeft:g})}px`;t.style.left!==_&&(d=!0,t.style.left=_,d=!1)},f=new MutationObserver(t=>{for(let r of t){let t=r.target;t.classList&&t.classList.contains(`djs-context-pad`)&&t.classList.contains(`open`)&&reposition(t)}});f.observe(a._container,{attributes:!0,attributeFilter:[`style`],subtree:!0});let handleOpen=t=>{u=Array.isArray(t.current.target)?null:t.current.target;let r=a._container.querySelector(`.djs-context-pad.open`);r&&reposition(r)},handleClose=()=>{u=null};return s.on(`contextPad.open`,handleOpen),s.on(`contextPad.close`,handleClose),()=>{f.disconnect(),s.off(`contextPad.open`,handleOpen),s.off(`contextPad.close`,handleClose)}}function attribute(t,r){let a=t?.get?.(r)??t?.$attrs?.[r];return typeof a==`string`&&a.trim()?a:void 0}function extensions(t){return t?.extensionElements?.values??[]}function of(t,r,a){return a&&a.trim()?[{kind:r,value:a}]:[]}function namesOf(t){let r=t,a=r?.$type;if(a===`bpmn:Message`)return of(r,`MESSAGE`,r.name);if(a===`bpmn:Signal`)return of(r,`SIGNAL`,r.name);if(a===`bpmn:Error`)return of(r,`ERROR`,r.errorCode);let o=extensions(r),s=o.find(t=>t?.$type===`zeebe:TaskDefinition`),u=o.find(t=>t?.$type===`zeebe:CalledElement`),d=o.find(t=>t?.$type===`zeebe:CalledDecision`),f=o.find(t=>t?.$type===`zeebe:FormDefinition`),p=o.filter(t=>typeof t?.$type==`string`&&t.$type.endsWith(`Listeners`));return[...of(r,`MESSAGE`,r?.messageRef?.name),...of(r,`SIGNAL`,r?.signalRef?.name),...of(r,`JOB_TYPE`,s?.type),...p.flatMap(t=>of(t,`JOB_TYPE`,t.type)),...of(r,`TOPIC`,attribute(r,`camunda:topic`)),...of(r,`CLASS`,attribute(r,`camunda:class`)),...of(r,`BEAN`,D(attribute(r,`camunda:delegateExpression`)??``)),...of(r,`PROCESS`,typeof r?.calledElement==`string`?r.calledElement:void 0),...of(r,`PROCESS`,u?.processId),...of(r,`DECISION`,attribute(r,`camunda:decisionRef`)),...of(r,`DECISION`,d?.decisionId),...of(r,`FORM`,attribute(r,`camunda:formKey`)),...of(r,`FORM`,attribute(r,`camunda:formRef`)),...of(r,`FORM`,f?.formId),...of(r,`FORM`,f?.formKey)]}function changesBetween(t,r){let a=new Map(t.map(t=>[t.kind,t.value]));return r.filter(t=>{let r=a.get(t.kind);return!!r&&r!==t.value}).map(t=>({kind:t.kind,from:a.get(t.kind),to:t.value}))}function onceKey(t=500){let r=new Set;return a=>!r.has(a)&&(r.add(a),r.size>t&&r.delete(r.values().next().value),!0)}var Mj=[`commandStack.element.updateProperties.execute`,`commandStack.element.updateModdleProperties.execute`],Nj=[`commandStack.element.updateProperties.executed`,`commandStack.element.updateModdleProperties.executed`],elementOf=t=>t?.context?.element,businessOf=t=>elementOf(t)?.businessObject;function watchLinkedRenames(t,r){let a=new Map,o=onceKey(),take=t=>{let r=elementOf(t);r?.id&&a.set(r.id,namesOf(businessOf(t)))},report=t=>{let s=elementOf(t);if(!s?.id)return;let u=a.get(s.id);a.delete(s.id),u&&changesBetween(u,namesOf(businessOf(t))).forEach(t=>{if(!o(`${s.id}:${t.kind}:${t.from}:${t.to}`))return;let a=r();if(!a)return;let u=ce();u.offerLinkedRename&&u.requestFeature(E.CODE_LINKS).then(t=>t?u:null).then(r=>r?.offerLinkedRename?.({kind:C[t.kind],from:t.from,to:t.to,path:a})).catch(t=>console.warn(`The host did not take the rename offer`,t))})},s=[...Mj.map(t=>[t,take]),...Nj.map(t=>[t,report])];return s.forEach(([r,a])=>t.on(r,a)),()=>s.forEach(([r,a])=>t.off(r,a))}var Pj=`...`,Fj=3,Ij=30,Lj=50;function truncate(t,r){return t.length>r?`${t.substring(0,r-3)}${Pj}`:t}function ElementTooltip({elementInfo:t,position:r,visible:a,facts:o}){let[s,u]=f(!1),[d,p]=f(null),_=g(null),S=g(!1);if(b(()=>{if(a&&t)u(!0),S.current=!1;else{let t=setTimeout(()=>{u(!1),p(null)},150);return()=>clearTimeout(t)}},[a,t]),y(()=>{let t=_.current;if(!t||!a||!r||S.current)return;S.current=!0;let o=t.getBoundingClientRect(),s=window.innerWidth,u=window.innerHeight,d=r.elementWidth||100,f=r.elementHeight||80,h=r.x,g=r.y,v=h,y=g,b=`right`,x=h-d/2,C=h+d/2,w=g-f/2,T=g+f/2,E=C+12,D=w;if(E+o.width+16<=s&&D>=16&&D+o.height<=u-16)v=E,y=Math.max(16,Math.min(D,u-o.height-16)),b=`right`;else{let t=x-o.width-12,r=w;if(t>=16&&r>=16&&r+o.height<=u-16)v=t,y=Math.max(16,Math.min(r,u-o.height-16)),b=`left`;else{let t=x,r=T+12;if(r+o.height<=u-16&&t>=16&&t+o.width<=s-16)v=Math.max(16,Math.min(t,s-o.width-16)),y=r,b=`bottom`;else{let t=x,r=w-o.height-12;r>=16&&t>=16&&t+o.width<=s-16?(v=Math.max(16,Math.min(t,s-o.width-16)),y=r,b=`top`):(v=Math.min(E,s-o.width-16),y=Math.max(16,Math.min(D,u-o.height-16)),b=`right`)}}}p({x:v,y,side:b})},[s,a,r]),!s||!t||!r)return null;let C=d||{x:r.x,y:r.y,side:`right`},formatElementType=t=>t.replace(/^bpmn:/,``).replace(/([A-Z])/g,` $1`).trim(),getInputOutputParameters=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=[],o=[],s=r.ioSpecification;if(s){let t=s.dataInputs||[],r=s.dataOutputs||[];t.forEach(t=>{a.push({name:t.name||t.id,value:t.value||t.default})}),r.forEach(t=>{o.push({name:t.name||t.id,value:t.value||t.default})})}if(r.extensionElements?.values&&r.extensionElements.values.forEach(t=>{t.$type===`zeebe:IoMapping`&&(t.inputParameters&&t.inputParameters.forEach(t=>{a.push({name:t.target||t.name,value:t.source||t.value})}),t.outputParameters&&t.outputParameters.forEach(t=>{o.push({name:t.target||t.name,value:t.source||t.value})})),t.$type===`camunda:InputOutput`&&(t.inputParameters&&t.inputParameters.forEach(t=>{a.push({name:t.name,value:t.value||t.definition})}),t.outputParameters&&t.outputParameters.forEach(t=>{o.push({name:t.name,value:t.value||t.definition})}))}),r.properties&&r.properties.forEach(t=>{t.name&&t.value&&a.push({name:t.name,value:t.value})}),a.length===0&&o.length===0)return null;let params=(t,r)=>v(`div`,{className:`element-tooltip-subsection`,children:[v(`div`,{className:`element-tooltip-subsection-title`,children:r}),t.slice(0,Fj).map((t,r)=>v(`div`,{className:`element-tooltip-param`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.name,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value?truncate(t.value,Ij):x(`app.tooltip.notSet`)})]},r)),t.length>Fj&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.length-Fj})})]});return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inputOutputParameters`)}),a.length>0&¶ms(a,x(`app.tooltip.in`,{number:a.length})),o.length>0&¶ms(o,x(`app.tooltip.out`,{number:o.length}))]})},getTypeSpecificInfo=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=t.type.replace(`bpmn:`,``);if(a===`ScriptTask`&&r.script){let t=r.script.split(`
|
|
1904
1904
|
`).filter(t=>t.trim()),a=t.slice(0,2).join(`
|
|
1905
|
-
`);return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.script`)}),v(`div`,{className:`element-tooltip-code`,children:[a,t.length>2&&v(`div`,{className:`element-tooltip-code-more`,children:`...`})]})]})}if(a===`SubProcess`&&r.flowElements){let t=r.flowElements.length;return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.subprocess`)}),v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:x(`app.tooltip.elements`)}),v(`span`,{className:`element-tooltip-value`,children:t})]})]})}if(a===`ServiceTask`){let t=[];if(r.implementation&&t.push({key:x(`app.tooltip.implementation`),value:r.implementation}),r.class&&t.push({key:x(`app.tooltip.class`),value:r.class}),r.delegateExpression&&t.push({key:x(`app.tooltip.delegate`),value:r.delegateExpression}),t.length>0)return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.serviceTask`)}),t.map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r))]})}if(a===`UserTask`){let t=[];if(r.assignee&&t.push({key:x(`app.tooltip.assignee`),value:r.assignee}),r.candidateGroups&&t.push({key:x(`app.tooltip.groups`),value:r.candidateGroups}),r.candidateUsers&&t.push({key:x(`app.tooltip.users`),value:r.candidateUsers}),t.length>0)return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.assignment`)}),t.map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r))]})}return null},getBusinessObjectProperties=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=[],o=[`id`,`name`,`$type`,`$parent`,`$descriptor`,`di`,`incoming`,`outgoing`,`flowElements`,`script`,`implementation`,`class`,`delegateExpression`,`assignee`,`candidateGroups`,`candidateUsers`,`ioSpecification`,`$attrs`,`$model`];return Object.keys(r).forEach(t=>{if(o.includes(t)||t.startsWith(`$`))return;let s=r[t];if(s==null||s===``||typeof s==`object`&&!Array.isArray(s))return;let u;u=typeof s==`boolean`?s?`true`:`false`:Array.isArray(s)?x(`app.tooltip.itemsCount`,{number:s.length}):String(s),u=truncate(u,Fj),a.push({key:t,value:u})}),a.length===0?null:v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.properties`)}),a.slice(0,5).map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r)),a.length>5&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:a.length-5})})]})},w=t.incoming&&t.incoming.length>0||t.outgoing&&t.outgoing.length>0;return v(`div`,{ref:_,className:`element-tooltip element-tooltip-${C.side} ${a?`element-tooltip-visible`:`element-tooltip-hidden`}`,style:{left:`${C.x}px`,top:`${C.y}px`},children:[v(`div`,{className:`element-tooltip-header`,children:[v(`div`,{className:`element-tooltip-type`,children:formatElementType(t.type)}),t.name&&v(`div`,{className:`element-tooltip-name`,children:t.name})]}),v(`div`,{className:`element-tooltip-body`,children:[v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:x(`app.tooltip.id`)}),v(`span`,{className:`element-tooltip-value-mono`,children:t.id})]}),o&&o.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inTheProject`)}),o.map(t=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.label,`:`]}),v(`span`,{className:t.warning?`element-tooltip-value element-tooltip-warning`:`element-tooltip-value`,children:t.value})]},t.label))]}),getTypeSpecificInfo(),getInputOutputParameters(),getBusinessObjectProperties(),w&&v(h,{children:[t.incoming&&t.incoming.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inOf`,{number:t.incoming.length})}),v(`div`,{className:`element-tooltip-connections`,children:[t.incoming.slice(0,3).map((t,r)=>v(`div`,{className:`element-tooltip-connection`,children:t.name||t.id},r)),t.incoming.length>3&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.incoming.length-3})})]})]}),t.outgoing&&t.outgoing.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.outOf`,{number:t.outgoing.length})}),v(`div`,{className:`element-tooltip-connections`,children:[t.outgoing.slice(0,3).map((t,r)=>v(`div`,{className:`element-tooltip-connection`,children:t.name||t.id},r)),t.outgoing.length>3&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.outgoing.length-3})})]})]})]})]})]})}function distanceToSegment(t,r,a,o,s,u){let d=s-a,f=u-o,p=d*d+f*f,h=p===0?0:((t-a)*d+(r-o)*f)/p;h=Math.max(0,Math.min(1,h));let g=a+h*d,_=o+h*f;return Math.hypot(t-g,r-_)}var Ij=_(function BpmnCanvas({xml:t,onXmlChange:r,onElementSelect:a,onError:o,onImportError:s,onDrawnWithoutLayout:u,onReady:_,modelerFactory:y,contextMenuEnabled:S=!0,propertiesPanelContainer:C,onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M},ie){let ae=g(null),N=g(null),oe=g(createHoverGate()),se=g(null),le=g(u);le.current=u;let ue=g(null),de=g(null),[fe,pe]=f({elementInfo:null,position:null,visible:!1}),[me,he]=f({visible:!1,position:{x:0,y:0},elementId:null}),[ge,_e]=f([]),ve=g({onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M});ve.current={onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M},b(()=>{me.visible||oe.current.release()},[me.visible]);let P=p(()=>{he(t=>({...t,visible:!1}))},[]);return d(ie,()=>({importXml:async t=>{N.current&&await N.current.importXML(t)},reloadXml:async t=>{if(N.current){let{xml:r,placed:a}=await drawableXml(t);await reimportKeepingView(N.current,r),a&&le.current?.()}},quietly:t=>se.current?se.current.quietly(t):t(),exportXml:async()=>{if(N.current){let{xml:t}=await N.current.saveXML({format:!0});return t}return``},exportSvg:async()=>{if(N.current){let{svg:t}=await st(N.current,()=>N.current.saveSVG());return t}return``},exportPng:async()=>{let t=N.current;if(t?.savePNG){let{png:r}=await st(t,()=>t.savePNG({quality:.95}));return r}return new Blob},exportPdf:async()=>{let t=N.current;if(t?.savePDF){let{pdf:r}=await st(t,()=>t.savePDF({format:`a4`}));return r}return new Blob},undo:()=>{N.current&&N.current.get(`commandStack`,!1)?.undo()},redo:()=>{N.current&&N.current.get(`commandStack`,!1)?.redo()},copy:()=>{let t=N.current;if(!t)return;let r=t.get(`selection`),a=t.get(`copyPaste`,!1),o=(r?.get()??[]).filter(Boolean);o.length!==0&&a&&a.copy(o)},paste:()=>{let t=N.current;t&&nr(t,ce()).catch(t=>console.error(`Failed to paste from the clipboard:`,t))},zoomIn:()=>{N.current?.get(`zoomScroll`,!1)?.stepZoom(1)},zoomOut:()=>{N.current?.get(`zoomScroll`,!1)?.stepZoom(-1)},resetView:()=>{N.current&&N.current.get(`canvas`)?.zoom(1)},fitToScreen:()=>{ue.current?.fit()},getModeler:()=>N.current}),[]),b(()=>{if(!ae.current)return;let u=y(ae.current);N.current=u;try{let t=u.get(`canvas`)?.getContainer();t&&!t.hasAttribute(`tabindex`)&&(t.setAttribute(`tabindex`,`0`),t.style.outline=`none`)}catch{}window.appConfig&&(window.appConfig.modeler=u);let handleCommandStackChanged=()=>{r&&N.current&&N.current.saveXML({format:!0}).then(({xml:t})=>{r(t)}).catch(t=>{o?.(t)})},handleSelectionChanged=t=>{if(a&&t&&typeof t==`object`&&`newSelection`in t){let r=t.newSelection[0];a(r?.id??null)}},d=de.current;de.current=null;let f=!1,p=!1,stopWatchingRenames=()=>void 0,h=Hn(u.get(`canvas`),{insetLeft:()=>{let t=ae.current?.querySelector(`.djs-palette`),r=ae.current?.getBoundingClientRect();return t&&r?t.getBoundingClientRect().right-r.left+16:0},insetBottom:()=>Za(ae.current),startOf:()=>{let t=u.get(`elementRegistry`,!1)?.filter(t=>t.type===`bpmn:StartEvent`)[0];return t?{x:t.x,y:t.y}:null}});ue.current=h;let g=fitContextPad(u),b=u.get(`keyboard`,!1);b&&jr(b,h.fit),gr(u);let C=0,w=new ResizeObserver(()=>{cancelAnimationFrame(C),C=requestAnimationFrame(()=>{u.get(`canvas`)?.resized?.()})});w.observe(ae.current);let handleResize=()=>{if(N.current){let t=N.current.get(`canvas`);t&&typeof t.resized==`function`&&t.resized()}},handleContextMenu=t=>{if(t.preventDefault(),t.stopPropagation(),!t.target.closest(`.bpmn-canvas-container`))return;let r=null;try{let a=u.get(`elementRegistry`),o=u.get(`canvas`),s=o.viewbox(),d=o.getContainer().getBoundingClientRect(),f=s.x+(t.clientX-d.left)/d.width*s.width,p=s.y+(t.clientY-d.top)/d.height*s.height,h=a.getAll(),g=6/(s.scale||1);for(let t=h.length-1;t>=0;t--){let a=h[t];if(a.type!==`bpmn:Process`&&a.type!==`bpmn:Collaboration`){if(a.waypoints){if(a.waypoints.some((t,r)=>{let o=a.waypoints[r+1];return o?distanceToSegment(f,p,t.x,t.y,o.x,o.y)<=g:!1})){r=a.id;break}}else if(typeof a.x==`number`&&typeof a.y==`number`&&typeof a.width==`number`&&typeof a.height==`number`&&f>=a.x&&f<=a.x+a.width&&p>=a.y&&p<=a.y+a.height){r=a.id;break}}}if(r){let t=u.get(`selection`);if(!t.get().map(t=>t.id).includes(r)){let o=a.get(r);o&&t.select(o)}}}catch(t){console.error(`Error in context menu:`,t)}let a=r!==null;try{a||=(u.get(`selection`)?.get()?.length??0)>0}catch{}let createIcon=t=>{let r={refresh:`<path d="M21.5 2v6h-6M2.5 22v-6h6"/><path d="M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2"/>`,undo:`<path d="M3 7v6h6"/><path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"/>`,redo:`<path d="M21 7v6h-6"/><path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"/>`,copy:`<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><rect x="8" y="2" width="8" height="4" rx="1" ry="1"/>`,paste:`<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M9 9h6"/>`,delete:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/>`,export:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>`,"goto-class":`<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>`,"find-usages":`<circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/>`,"run-tests":`<path d="M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5Z"/>`,"debug-tests":`<rect x="7" y="8" width="10" height="12" rx="5"/><path d="M9 8V6a3 3 0 0 1 6 0v2M3 13h4M17 13h4M4 7l3 2M20 7l-3 2M4 19l3-2M20 19l-3-2"/>`,"auto-layout":`<rect x="16" y="16" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="9" y="2" width="6" height="6" rx="1"/><path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"/><path d="M12 12V8"/>`}[t]||`<circle cx="12" cy="12" r="1"/>`;return v(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,stroke:`currentColor`,fill:`none`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,dangerouslySetInnerHTML:{__html:r}})},o=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`Cmd`:`Ctrl`,s=[{id:`reload`,label:x(`app.common.reload`),icon:createIcon(`refresh`),action:()=>ve.current.onReload?.()},{id:`divider-1`,label:``,action:()=>{},divider:!0},{id:`undo`,label:x(`app.common.undo`),icon:createIcon(`undo`),action:()=>ve.current.onUndo?.(),shortcut:`${o}+Z`},{id:`redo`,label:x(`app.common.redo`),icon:createIcon(`redo`),action:()=>ve.current.onRedo?.(),shortcut:`${o}+Y`},{id:`divider-2`,label:``,action:()=>{},divider:!0},{id:`copy`,label:x(`app.common.copy`),icon:createIcon(`copy`),action:()=>ve.current.onCopy?.(),disabled:!a,shortcut:`${o}+C`},{id:`paste`,label:x(`app.common.paste`),icon:createIcon(`paste`),action:()=>ve.current.onPaste?.(),shortcut:`${o}+V`},{id:`delete`,label:x(`app.common.delete`),icon:createIcon(`delete`),action:()=>ve.current.onDelete?.(),disabled:!a,shortcut:`Del`},{id:`divider-3`,label:``,action:()=>{},divider:!0},{id:`export`,label:x(`app.common.export`),icon:createIcon(`export`),action:()=>ve.current.onExport?.(),shortcut:`${o}+Shift+C`}],d=r?classReferenceOf(u.get(`elementRegistry`).get(r)?.businessObject):null,f=u.get(`canvas`).getRootElement(),p=r??(f?.type===`bpmn:Process`?f.id:null);(d||p)&&s.push({id:`divider-goto`,label:``,action:()=>{},divider:!0}),d?s.push({id:`goto-class`,label:x(`app.canvas.goTo`,{label:d.label}),icon:createIcon(`goto-class`),action:()=>ve.current.onNavigateToClass?.(d.value,d.kind)}):r&&ve.current.hasImplementation?.(r)&&s.push({id:`goto-implementation`,label:x(`app.canvas.goToImplementation`),icon:createIcon(`goto-class`),action:()=>ve.current.onOpenImplementation?.(r)}),p&&ve.current.onFindCodeUsages&&s.push({id:`find-usages`,label:x(`app.canvas.findUsagesInCode`),icon:createIcon(`find-usages`),action:()=>ve.current.onFindCodeUsages?.(p)}),p&&ve.current.onRunTests&&s.push({id:`run-tests`,label:x(`app.canvas.runTests`),icon:createIcon(`run-tests`),action:()=>ve.current.onRunTests?.(p,!1)},{id:`debug-tests`,label:x(`app.canvas.debugTests`),icon:createIcon(`debug-tests`),action:()=>ve.current.onRunTests?.(p,!0)}),oe.current.block(),pe({elementInfo:null,position:null,visible:!1}),_e(s),he({visible:!0,position:{x:t.clientX,y:t.clientY},elementId:r})},T=u.get(`canvas`)?.getContainer();T&&S&&T.addEventListener(`contextmenu`,handleContextMenu);let handleElementMouseEnter=t=>{if(!t.element||!N.current)return;let r=t.element;r.id&&r.type!==`label`&&!r.labelTarget&&(r.waypoints||r.type?.includes(`Connection`)||r.type?.includes(`SequenceFlow`)||r.type!==`bpmn:Process`&&r.type!==`bpmn:Collaboration`&&oe.current.schedule(()=>{try{let a=(N.current?.get(`elementRegistry`))?.get(r.id);if(!a||!a.businessObject)return;let o=a.businessObject,s={id:a.id,type:o.$type||`Unknown`,name:o.name,incoming:(a.incoming||[]).map(t=>({id:t.id,name:t.businessObject?.name})),outgoing:(a.outgoing||[]).map(t=>({id:t.id,name:t.businessObject?.name})),businessObject:o},u=t.gfx;if(u){let t=u.getBoundingClientRect(),a={x:t.left+t.width/2,y:t.top+t.height/2,elementWidth:t.width,elementHeight:t.height};pe({elementInfo:s,position:a,visible:!0,facts:ve.current.factsOf?.(r.id)})}}catch(t){console.error(`Error showing element tooltip:`,t)}},500))},handleElementMouseLeave=()=>{oe.current.cancel(),pe({elementInfo:null,position:null,visible:!1})},handleCanvasEvent=()=>{handleElementMouseLeave()};stopWatchingRenames=watchLinkedRenames(u,()=>window.appConfig?.bpmnFilePath??``),u.on(`element.hover`,handleElementMouseEnter),u.on(`element.out`,handleElementMouseLeave),u.on(`canvas.viewbox.changed`,handleCanvasEvent),u.on(`element.click`,handleCanvasEvent);let E=watchEdits(u.get(`eventBus`),handleCommandStackChanged);return se.current=E,u.on(`selection.changed`,handleSelectionChanged),window.addEventListener(`resize`,handleResize),t?drawableXml(t).then(({xml:t,placed:r})=>u.importXML(t).then(()=>r)).then(t=>{p||(f=!0,d?dr(u.get(`canvas`,!1),u.get(`selection`,!1),u.get(`elementRegistry`,!1),d):h.firstView(),t&&le.current?.(),_?.())},t=>{p||(s??o)?.(t)}).catch(t=>{p||o?.(t)}):_?.(),()=>{oe.current.cancel(),T&&T.removeEventListener(`contextmenu`,handleContextMenu),stopWatchingRenames(),u.off(`element.hover`,handleElementMouseEnter),u.off(`element.out`,handleElementMouseLeave),u.off(`canvas.viewbox.changed`,handleCanvasEvent),u.off(`element.click`,handleCanvasEvent),E.dispose(),se.current=null,u.off(`selection.changed`,handleSelectionChanged),window.removeEventListener(`resize`,handleResize),g(),p=!0,cancelAnimationFrame(C),w.disconnect(),ue.current=null,f&&(de.current=zn(u.get(`canvas`,!1),u.get(`selection`,!1))),u.destroy(),N.current=null}},[y,C,r,a,o,s,_]),v(h,{children:[v(`div`,{ref:ae,class:`bpmn-canvas-container`,style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,position:`relative`}}),v(ContextMenu,{visible:me.visible,position:me.position,items:ge,onClose:P}),v(ElementTooltip,{elementInfo:fe.elementInfo,position:fe.position,visible:fe.visible,facts:fe.facts})]})});export{projectVariableNames as $,counts as A,addComment as B,watchCodeBridge as C,localiseLabels as Ct,acceptBlockers as D,variablesAt as Dt,AA as E,withRuntimeFacts as Et,rejectionOf as F,isOwnComment as G,commentedElements as H,startReview as I,setCommentResolved as J,openCommentTotal as K,step as L,focusOn as M,pending as N,acceptable as O,fieldNamed as Ot,plannedFor as P,hasClientFactsNotice as Q,setCommentBadgeOpener as R,setCodeStatuses as S,Modeler$3 as St,PA as T,elementSubjects as Tt,commentsOf as U,commentAuthor as V,elementLabel as W,supportsComments as X,setCommentText as Y,ClientFactsNotice as Z,whereOf as _,alignPillWithCard as _t,setTracePadHandler as a,scriptSlotKey as at,setCodeActions as b,countLine as bt,leaveCard as c,Modeler as ct,leadBinding as d,builtinSetup as dt,setProjectVariables as et,openLabel as f,bundledSetup as ft,stubTemplateFor as g,runRules as gt,stubLanguage as h,ruleFamilyOf as ht,splitTemplates as i,readScriptSlot as it,decide as j,blocked as k,detailLines as l,Modeler$1 as lt,stateLabel as m,dropCoveredByDrawing as mt,createBpmnModeler as n,publishTrial as nt,cancelCardHide as o,writeScriptSlot as ot,reachedElements as p,withCompatRules as pt,removeComment as q,identityOf as r,setOpenScriptTabs as rt,closeCard as s,ME as st,Ij as t,subscribeProjectVariables as tt,kindLabel as u,Jw as ut,codeBridgeState as v,pillLabel as vt,suggestedType as w,localiseTree as wt,setCodePaused as x,countsOf as xt,resetCodeBridge as y,cardSummary as yt,TA as z};
|
|
1905
|
+
`);return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.script`)}),v(`div`,{className:`element-tooltip-code`,children:[a,t.length>2&&v(`div`,{className:`element-tooltip-code-more`,children:`...`})]})]})}if(a===`SubProcess`&&r.flowElements){let t=r.flowElements.length;return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.subprocess`)}),v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:x(`app.tooltip.elements`)}),v(`span`,{className:`element-tooltip-value`,children:t})]})]})}if(a===`ServiceTask`){let t=[];if(r.implementation&&t.push({key:x(`app.tooltip.implementation`),value:r.implementation}),r.class&&t.push({key:x(`app.tooltip.class`),value:r.class}),r.delegateExpression&&t.push({key:x(`app.tooltip.delegate`),value:r.delegateExpression}),t.length>0)return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.serviceTask`)}),t.map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r))]})}if(a===`UserTask`){let t=[];if(r.assignee&&t.push({key:x(`app.tooltip.assignee`),value:r.assignee}),r.candidateGroups&&t.push({key:x(`app.tooltip.groups`),value:r.candidateGroups}),r.candidateUsers&&t.push({key:x(`app.tooltip.users`),value:r.candidateUsers}),t.length>0)return v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.assignment`)}),t.map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r))]})}return null},getBusinessObjectProperties=()=>{if(!t.businessObject)return null;let r=t.businessObject,a=[],o=[`id`,`name`,`$type`,`$parent`,`$descriptor`,`di`,`incoming`,`outgoing`,`flowElements`,`script`,`implementation`,`class`,`delegateExpression`,`assignee`,`candidateGroups`,`candidateUsers`,`ioSpecification`,`$attrs`,`$model`];return Object.keys(r).forEach(t=>{if(o.includes(t)||t.startsWith(`$`))return;let s=r[t];if(s==null||s===``||typeof s==`object`&&!Array.isArray(s))return;let u;u=typeof s==`boolean`?s?`true`:`false`:Array.isArray(s)?x(`app.tooltip.itemsCount`,{number:s.length}):String(s),u=truncate(u,Lj),a.push({key:t,value:u})}),a.length===0?null:v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.properties`)}),a.slice(0,5).map((t,r)=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.key,`:`]}),v(`span`,{className:`element-tooltip-value-mono`,children:t.value})]},r)),a.length>5&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:a.length-5})})]})},w=t.incoming&&t.incoming.length>0||t.outgoing&&t.outgoing.length>0;return v(`div`,{ref:_,className:`element-tooltip element-tooltip-${C.side} ${a?`element-tooltip-visible`:`element-tooltip-hidden`}`,style:{left:`${C.x}px`,top:`${C.y}px`},children:[v(`div`,{className:`element-tooltip-header`,children:[v(`div`,{className:`element-tooltip-type`,children:formatElementType(t.type)}),t.name&&v(`div`,{className:`element-tooltip-name`,children:t.name})]}),v(`div`,{className:`element-tooltip-body`,children:[v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:x(`app.tooltip.id`)}),v(`span`,{className:`element-tooltip-value-mono`,children:t.id})]}),o&&o.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inTheProject`)}),o.map(t=>v(`div`,{className:`element-tooltip-info-item`,children:[v(`span`,{className:`element-tooltip-label`,children:[t.label,`:`]}),v(`span`,{className:t.warning?`element-tooltip-value element-tooltip-warning`:`element-tooltip-value`,children:t.value})]},t.label))]}),getTypeSpecificInfo(),getInputOutputParameters(),getBusinessObjectProperties(),w&&v(h,{children:[t.incoming&&t.incoming.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.inOf`,{number:t.incoming.length})}),v(`div`,{className:`element-tooltip-connections`,children:[t.incoming.slice(0,3).map((t,r)=>v(`div`,{className:`element-tooltip-connection`,children:t.name||t.id},r)),t.incoming.length>3&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.incoming.length-3})})]})]}),t.outgoing&&t.outgoing.length>0&&v(`div`,{className:`element-tooltip-section`,children:[v(`div`,{className:`element-tooltip-section-title`,children:x(`app.tooltip.outOf`,{number:t.outgoing.length})}),v(`div`,{className:`element-tooltip-connections`,children:[t.outgoing.slice(0,3).map((t,r)=>v(`div`,{className:`element-tooltip-connection`,children:t.name||t.id},r)),t.outgoing.length>3&&v(`div`,{className:`element-tooltip-more`,children:x(`app.common.more`,{number:t.outgoing.length-3})})]})]})]})]})]})}function distanceToSegment(t,r,a,o,s,u){let d=s-a,f=u-o,p=d*d+f*f,h=p===0?0:((t-a)*d+(r-o)*f)/p;h=Math.max(0,Math.min(1,h));let g=a+h*d,_=o+h*f;return Math.hypot(t-g,r-_)}var Rj=_(function BpmnCanvas({xml:t,onXmlChange:r,onElementSelect:a,onError:o,onImportError:s,onDrawnWithoutLayout:u,onReady:_,modelerFactory:y,contextMenuEnabled:S=!0,propertiesPanelContainer:C,onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M},ie){let ae=g(null),N=g(null),oe=g(createHoverGate()),se=g(null),le=g(u);le.current=u;let ue=g(null),de=g(null),[fe,pe]=f({elementInfo:null,position:null,visible:!1}),[me,he]=f({visible:!1,position:{x:0,y:0},elementId:null}),[ge,_e]=f([]),ve=g({onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M});ve.current={onReload:w,onUndo:T,onRedo:E,onCopy:D,onPaste:O,onDelete:k,onExport:ee,onNavigateToClass:A,onFindCodeUsages:j,onRunTests:te,onOpenImplementation:ne,factsOf:re,hasImplementation:M},b(()=>{me.visible||oe.current.release()},[me.visible]);let P=p(()=>{he(t=>({...t,visible:!1}))},[]);return d(ie,()=>({importXml:async t=>{N.current&&await N.current.importXML(t)},reloadXml:async t=>{if(N.current){let{xml:r,placed:a}=await drawableXml(t);await reimportKeepingView(N.current,r),a&&le.current?.()}},quietly:t=>se.current?se.current.quietly(t):t(),exportXml:async()=>{if(N.current){let{xml:t}=await N.current.saveXML({format:!0});return t}return``},exportSvg:async()=>{if(N.current){let{svg:t}=await st(N.current,()=>N.current.saveSVG());return t}return``},exportPng:async()=>{let t=N.current;if(t?.savePNG){let{png:r}=await st(t,()=>t.savePNG({quality:.95}));return r}return new Blob},exportPdf:async()=>{let t=N.current;if(t?.savePDF){let{pdf:r}=await st(t,()=>t.savePDF({format:`a4`}));return r}return new Blob},undo:()=>{N.current&&N.current.get(`commandStack`,!1)?.undo()},redo:()=>{N.current&&N.current.get(`commandStack`,!1)?.redo()},copy:()=>{let t=N.current;if(!t)return;let r=t.get(`selection`),a=t.get(`copyPaste`,!1),o=(r?.get()??[]).filter(Boolean);o.length!==0&&a&&a.copy(o)},paste:()=>{let t=N.current;t&&nr(t,ce()).catch(t=>console.error(`Failed to paste from the clipboard:`,t))},zoomIn:()=>{N.current?.get(`zoomScroll`,!1)?.stepZoom(1)},zoomOut:()=>{N.current?.get(`zoomScroll`,!1)?.stepZoom(-1)},resetView:()=>{N.current&&N.current.get(`canvas`)?.zoom(1)},fitToScreen:()=>{ue.current?.fit()},getModeler:()=>N.current}),[]),b(()=>{if(!ae.current)return;let u=y(ae.current);N.current=u;try{let t=u.get(`canvas`)?.getContainer();t&&!t.hasAttribute(`tabindex`)&&(t.setAttribute(`tabindex`,`0`),t.style.outline=`none`)}catch{}window.appConfig&&(window.appConfig.modeler=u);let handleCommandStackChanged=()=>{r&&N.current&&N.current.saveXML({format:!0}).then(({xml:t})=>{r(t)}).catch(t=>{o?.(t)})},handleSelectionChanged=t=>{if(a&&t&&typeof t==`object`&&`newSelection`in t){let r=t.newSelection[0];a(r?.id??null)}},d=de.current;de.current=null;let f=!1,p=!1,stopWatchingRenames=()=>void 0,h=Hn(u.get(`canvas`),{insetLeft:()=>{let t=ae.current?.querySelector(`.djs-palette`),r=ae.current?.getBoundingClientRect();return t&&r?t.getBoundingClientRect().right-r.left+16:0},insetBottom:()=>Za(ae.current),startOf:()=>{let t=u.get(`elementRegistry`,!1)?.filter(t=>t.type===`bpmn:StartEvent`)[0];return t?{x:t.x,y:t.y}:null}});ue.current=h;let g=fitContextPad(u),b=u.get(`keyboard`,!1);b&&jr(b,h.fit),gr(u);let C=0,w=new ResizeObserver(()=>{cancelAnimationFrame(C),C=requestAnimationFrame(()=>{u.get(`canvas`)?.resized?.()})});w.observe(ae.current);let handleResize=()=>{if(N.current){let t=N.current.get(`canvas`);t&&typeof t.resized==`function`&&t.resized()}},handleContextMenu=t=>{if(t.preventDefault(),t.stopPropagation(),!t.target.closest(`.bpmn-canvas-container`))return;let r=null;try{let a=u.get(`elementRegistry`),o=u.get(`canvas`),s=o.viewbox(),d=o.getContainer().getBoundingClientRect(),f=s.x+(t.clientX-d.left)/d.width*s.width,p=s.y+(t.clientY-d.top)/d.height*s.height,h=a.getAll(),g=6/(s.scale||1);for(let t=h.length-1;t>=0;t--){let a=h[t];if(a.type!==`bpmn:Process`&&a.type!==`bpmn:Collaboration`){if(a.waypoints){if(a.waypoints.some((t,r)=>{let o=a.waypoints[r+1];return o?distanceToSegment(f,p,t.x,t.y,o.x,o.y)<=g:!1})){r=a.id;break}}else if(typeof a.x==`number`&&typeof a.y==`number`&&typeof a.width==`number`&&typeof a.height==`number`&&f>=a.x&&f<=a.x+a.width&&p>=a.y&&p<=a.y+a.height){r=a.id;break}}}if(r){let t=u.get(`selection`);if(!t.get().map(t=>t.id).includes(r)){let o=a.get(r);o&&t.select(o)}}}catch(t){console.error(`Error in context menu:`,t)}let a=r!==null;try{a||=(u.get(`selection`)?.get()?.length??0)>0}catch{}let createIcon=t=>{let r={refresh:`<path d="M21.5 2v6h-6M2.5 22v-6h6"/><path d="M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2"/>`,undo:`<path d="M3 7v6h6"/><path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"/>`,redo:`<path d="M21 7v6h-6"/><path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"/>`,copy:`<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><rect x="8" y="2" width="8" height="4" rx="1" ry="1"/>`,paste:`<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M9 9h6"/>`,delete:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/>`,export:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>`,"goto-class":`<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>`,"find-usages":`<circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/>`,"run-tests":`<path d="M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5Z"/>`,"debug-tests":`<rect x="7" y="8" width="10" height="12" rx="5"/><path d="M9 8V6a3 3 0 0 1 6 0v2M3 13h4M17 13h4M4 7l3 2M20 7l-3 2M4 19l3-2M20 19l-3-2"/>`,"auto-layout":`<rect x="16" y="16" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="9" y="2" width="6" height="6" rx="1"/><path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"/><path d="M12 12V8"/>`}[t]||`<circle cx="12" cy="12" r="1"/>`;return v(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,stroke:`currentColor`,fill:`none`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,dangerouslySetInnerHTML:{__html:r}})},o=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`Cmd`:`Ctrl`,s=[{id:`reload`,label:x(`app.common.reload`),icon:createIcon(`refresh`),action:()=>ve.current.onReload?.()},{id:`divider-1`,label:``,action:()=>{},divider:!0},{id:`undo`,label:x(`app.common.undo`),icon:createIcon(`undo`),action:()=>ve.current.onUndo?.(),shortcut:`${o}+Z`},{id:`redo`,label:x(`app.common.redo`),icon:createIcon(`redo`),action:()=>ve.current.onRedo?.(),shortcut:`${o}+Y`},{id:`divider-2`,label:``,action:()=>{},divider:!0},{id:`copy`,label:x(`app.common.copy`),icon:createIcon(`copy`),action:()=>ve.current.onCopy?.(),disabled:!a,shortcut:`${o}+C`},{id:`paste`,label:x(`app.common.paste`),icon:createIcon(`paste`),action:()=>ve.current.onPaste?.(),shortcut:`${o}+V`},{id:`delete`,label:x(`app.common.delete`),icon:createIcon(`delete`),action:()=>ve.current.onDelete?.(),disabled:!a,shortcut:`Del`},{id:`divider-3`,label:``,action:()=>{},divider:!0},{id:`export`,label:x(`app.common.export`),icon:createIcon(`export`),action:()=>ve.current.onExport?.(),shortcut:`${o}+Shift+C`}],d=r?classReferenceOf(u.get(`elementRegistry`).get(r)?.businessObject):null,f=u.get(`canvas`).getRootElement(),p=r??(f?.type===`bpmn:Process`?f.id:null);(d||p)&&s.push({id:`divider-goto`,label:``,action:()=>{},divider:!0}),d?s.push({id:`goto-class`,label:x(`app.canvas.goTo`,{label:d.label}),icon:createIcon(`goto-class`),action:()=>ve.current.onNavigateToClass?.(d.value,d.kind)}):r&&ve.current.hasImplementation?.(r)&&s.push({id:`goto-implementation`,label:x(`app.canvas.goToImplementation`),icon:createIcon(`goto-class`),action:()=>ve.current.onOpenImplementation?.(r)}),p&&ve.current.onFindCodeUsages&&s.push({id:`find-usages`,label:x(`app.canvas.findUsagesInCode`),icon:createIcon(`find-usages`),action:()=>ve.current.onFindCodeUsages?.(p)}),p&&ve.current.onRunTests&&s.push({id:`run-tests`,label:x(`app.canvas.runTests`),icon:createIcon(`run-tests`),action:()=>ve.current.onRunTests?.(p,!1)},{id:`debug-tests`,label:x(`app.canvas.debugTests`),icon:createIcon(`debug-tests`),action:()=>ve.current.onRunTests?.(p,!0)}),oe.current.block(),pe({elementInfo:null,position:null,visible:!1}),_e(s),he({visible:!0,position:{x:t.clientX,y:t.clientY},elementId:r})},T=u.get(`canvas`)?.getContainer();T&&S&&T.addEventListener(`contextmenu`,handleContextMenu);let handleElementMouseEnter=t=>{if(!t.element||!N.current)return;let r=t.element;r.id&&r.type!==`label`&&!r.labelTarget&&(r.waypoints||r.type?.includes(`Connection`)||r.type?.includes(`SequenceFlow`)||r.type!==`bpmn:Process`&&r.type!==`bpmn:Collaboration`&&oe.current.schedule(()=>{try{let a=(N.current?.get(`elementRegistry`))?.get(r.id);if(!a||!a.businessObject)return;let o=a.businessObject,s={id:a.id,type:o.$type||`Unknown`,name:o.name,incoming:(a.incoming||[]).map(t=>({id:t.id,name:t.businessObject?.name})),outgoing:(a.outgoing||[]).map(t=>({id:t.id,name:t.businessObject?.name})),businessObject:o},u=t.gfx;if(u){let t=u.getBoundingClientRect(),a={x:t.left+t.width/2,y:t.top+t.height/2,elementWidth:t.width,elementHeight:t.height};pe({elementInfo:s,position:a,visible:!0,facts:ve.current.factsOf?.(r.id)})}}catch(t){console.error(`Error showing element tooltip:`,t)}},500))},handleElementMouseLeave=()=>{oe.current.cancel(),pe({elementInfo:null,position:null,visible:!1})},handleCanvasEvent=()=>{handleElementMouseLeave()};stopWatchingRenames=watchLinkedRenames(u,()=>window.appConfig?.bpmnFilePath??``),u.on(`element.hover`,handleElementMouseEnter),u.on(`element.out`,handleElementMouseLeave),u.on(`canvas.viewbox.changed`,handleCanvasEvent),u.on(`element.click`,handleCanvasEvent);let E=watchEdits(u.get(`eventBus`),handleCommandStackChanged);return se.current=E,u.on(`selection.changed`,handleSelectionChanged),window.addEventListener(`resize`,handleResize),t?drawableXml(t).then(({xml:t,placed:r})=>u.importXML(t).then(()=>r)).then(t=>{p||(f=!0,d?dr(u.get(`canvas`,!1),u.get(`selection`,!1),u.get(`elementRegistry`,!1),d):h.firstView(),t&&le.current?.(),_?.())},t=>{p||(s??o)?.(t)}).catch(t=>{p||o?.(t)}):_?.(),()=>{oe.current.cancel(),T&&T.removeEventListener(`contextmenu`,handleContextMenu),stopWatchingRenames(),u.off(`element.hover`,handleElementMouseEnter),u.off(`element.out`,handleElementMouseLeave),u.off(`canvas.viewbox.changed`,handleCanvasEvent),u.off(`element.click`,handleCanvasEvent),E.dispose(),se.current=null,u.off(`selection.changed`,handleSelectionChanged),window.removeEventListener(`resize`,handleResize),g(),p=!0,cancelAnimationFrame(C),w.disconnect(),ue.current=null,f&&(de.current=zn(u.get(`canvas`,!1),u.get(`selection`,!1))),u.destroy(),N.current=null}},[y,C,r,a,o,s,_]),v(h,{children:[v(`div`,{ref:ae,class:`bpmn-canvas-container`,style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,position:`relative`}}),v(ContextMenu,{visible:me.visible,position:me.position,items:ge,onClose:P}),v(ElementTooltip,{elementInfo:fe.elementInfo,position:fe.position,visible:fe.visible,facts:fe.facts})]})});export{projectVariableNames as $,counts as A,addComment as B,watchCodeBridge as C,localiseLabels as Ct,acceptBlockers as D,variablesAt as Dt,AA as E,withRuntimeFacts as Et,rejectionOf as F,isOwnComment as G,commentedElements as H,startReview as I,setCommentResolved as J,openCommentTotal as K,step as L,focusOn as M,pending as N,acceptable as O,fieldNamed as Ot,plannedFor as P,hasClientFactsNotice as Q,setCommentBadgeOpener as R,setCodeStatuses as S,Modeler$3 as St,PA as T,elementSubjects as Tt,commentsOf as U,commentAuthor as V,elementLabel as W,supportsComments as X,setCommentText as Y,ClientFactsNotice as Z,whereOf as _,alignPillWithCard as _t,setTracePadHandler as a,scriptSlotKey as at,setCodeActions as b,countLine as bt,leaveCard as c,Modeler as ct,leadBinding as d,builtinSetup as dt,setProjectVariables as et,openLabel as f,bundledSetup as ft,stubTemplateFor as g,runRules as gt,stubLanguage as h,ruleFamilyOf as ht,splitTemplates as i,readScriptSlot as it,decide as j,blocked as k,detailLines as l,Modeler$1 as lt,stateLabel as m,dropCoveredByDrawing as mt,createBpmnModeler as n,publishTrial as nt,cancelCardHide as o,writeScriptSlot as ot,reachedElements as p,withCompatRules as pt,removeComment as q,identityOf as r,setOpenScriptTabs as rt,closeCard as s,ME as st,Rj as t,subscribeProjectVariables as tt,kindLabel as u,Jw as ut,codeBridgeState as v,pillLabel as vt,suggestedType as w,localiseTree as wt,setCodePaused as x,countsOf as xt,resetCodeBridge as y,cardSummary as yt,TA as z};
|