@witlink/workflow 1.0.3 → 1.0.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.
@@ -1,26 +1,26 @@
1
- (function(yt,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],K):(yt=typeof globalThis<"u"?globalThis:yt||self,K(yt["witlink-workflow"]={},yt.es,yt.Vue,yt.pinia,yt.vueI18n,yt.Axios,yt.antDesignVue,yt.components))})(this,function(yt,K,h,_p,an,l_,st,Lo){"use strict";let $o=an.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function u_(e){e&&($o=e)}function p_(e,t){const n=$o.global.t;if(n)return n(e,t)}function f_(e){return h.getCurrentScope()?(h.onScopeDispose(e),!0):!1}const d_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const h_=Object.prototype.toString,m_=e=>h_.call(e)==="[object Object]",g_=()=>{};function v_(...e){if(e.length!==1)return h.toRef(...e);const t=e[0];return typeof t=="function"?h.readonly(h.customRef(()=>({get:t,set:g_}))):h.ref(t)}function y_(e,t){function n(...i){return new Promise((r,o)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(r).catch(o)})}return n}const bp=e=>e();function __(e=bp,t={}){const{initialState:n="active"}=t,i=v_(n==="active");function r(){i.value=!1}function o(){i.value=!0}const a=(...s)=>{i.value&&e(...s)};return{isActive:h.readonly(i),pause:r,resume:o,eventFilter:a}}function ec(e){return Array.isArray(e)?e:[e]}function b_(e){return h.getCurrentInstance()}function E_(e,t,n={}){const{eventFilter:i=bp,...r}=n;return h.watch(e,y_(i,t),r)}function x_(e,t,n={}){const{eventFilter:i,initialState:r="active",...o}=n,{eventFilter:a,pause:s,resume:c,isActive:l}=__(i,{initialState:r});return{stop:E_(e,t,{...o,eventFilter:a}),pause:s,resume:c,isActive:l}}function w_(e,t=!0,n){b_()?h.onMounted(e,n):t?e():h.nextTick(e)}function S_(e,t,n){return h.watch(e,t,{...n,immediate:!0})}const tc=d_?window:void 0;function C_(e){var t;const n=h.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Ep(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},i=(s,c,l,u)=>(s.addEventListener(c,l,u),()=>s.removeEventListener(c,l,u)),r=h.computed(()=>{const s=ec(h.toValue(e[0])).filter(c=>c!=null);return s.every(c=>typeof c!="string")?s:void 0}),o=S_(()=>{var s,c;return[(c=(s=r.value)==null?void 0:s.map(l=>C_(l)))!=null?c:[tc].filter(l=>l!=null),ec(h.toValue(r.value?e[1]:e[0])),ec(h.unref(r.value?e[2]:e[1])),h.toValue(r.value?e[3]:e[2])]},([s,c,l,u])=>{if(n(),!(s!=null&&s.length)||!(c!=null&&c.length)||!(l!=null&&l.length))return;const p=m_(u)?{...u}:u;t.push(...s.flatMap(f=>c.flatMap(d=>l.map(m=>i(f,d,m,p)))))},{flush:"post"}),a=()=>{o(),n()};return f_(n),a}const jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fo="__vueuse_ssr_handlers__",R_=T_();function T_(){return Fo in jo||(jo[Fo]=jo[Fo]||{}),jo[Fo]}function P_(e,t){return R_[e]||t}function A_(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const k_={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xp="vueuse-storage";function wp(e,t,n,i={}){var r;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:u,window:p=tc,eventFilter:f,onError:d=L=>{console.error(L)},initOnMounted:m}=i,v=(u?h.shallowRef:h.ref)(typeof t=="function"?t():t),g=h.computed(()=>h.toValue(e));if(!n)try{n=P_("getDefaultStorage",()=>{var L;return(L=tc)==null?void 0:L.localStorage})()}catch(L){d(L)}if(!n)return v;const w=h.toValue(t),C=A_(w),x=(r=i.serializer)!=null?r:k_[C],{pause:E,resume:S}=x_(v,()=>N(v.value),{flush:o,deep:a,eventFilter:f});h.watch(g,()=>O(),{flush:o}),p&&s&&w_(()=>{n instanceof Storage?Ep(p,"storage",O,{passive:!0}):Ep(p,xp,I),m&&O()}),m||O();function R(L,B){if(p){const z={key:g.value,oldValue:L,newValue:B,storageArea:n};p.dispatchEvent(n instanceof Storage?new StorageEvent("storage",z):new CustomEvent(xp,{detail:z}))}}function N(L){try{const B=n.getItem(g.value);if(L==null)R(B,null),n.removeItem(g.value);else{const z=x.write(L);B!==z&&(n.setItem(g.value,z),R(B,z))}}catch(B){d(B)}}function P(L){const B=L?L.newValue:n.getItem(g.value);if(B==null)return c&&w!=null&&n.setItem(g.value,x.write(w)),w;if(!L&&l){const z=x.read(B);return typeof l=="function"?l(z,w):C==="object"&&!Array.isArray(z)?{...w,...z}:z}else return typeof B!="string"?B:x.read(B)}function O(L){if(!(L&&L.storageArea!==n)){if(L&&L.key==null){v.value=w;return}if(!(L&&L.key!==g.value)){E();try{(L==null?void 0:L.newValue)!==x.write(v.value)&&(v.value=P(L))}catch(B){d(B)}finally{L?h.nextTick(S):S()}}}}function I(L){O(L.detail)}return v}const Rr=new Map;function D_(e){const t=h.getCurrentScope();function n(s){var c;const l=Rr.get(e)||new Set;l.add(s),Rr.set(e,l);const u=()=>r(s);return(c=t==null?void 0:t.cleanups)==null||c.push(u),u}function i(s){function c(...l){r(c),s(...l)}return n(c)}function r(s){const c=Rr.get(e);c&&(c.delete(s),c.size||o())}function o(){Rr.delete(e)}function a(s,c){var l;(l=Rr.get(e))==null||l.forEach(u=>u(s,c))}return{on:n,once:i,off:r,emit:a,reset:o}}const nc=l_.create({baseURL:"/wfapi",timeout:3e4});function M_(e){const n=wp("Access-Token",{}).value;let i;return typeof n=="string"?i=n:n&&(i=n.value),i&&(e.headers={...e.headers,"Access-Token":i}),e}function N_(e){const t=e.data;if(!(t instanceof Blob)&&(!t||t.code===void 0))st.message.error(t+"");else if(!(t instanceof Blob)&&t.code<0){let n=p_("err."+t.code);n===`err.${t.code}`&&(n=t.message?t.message:"unknow error"),st.message.error(n)}return e}function O_(e){if(e.response){const t=e.response.data;e.response.status===403?st.message.error(t.message):e.response.status===401&&st.message.error("Authorization verification failed")}else st.message.error(e+"");return Promise.reject(e)}nc.interceptors.request.use(M_,e=>Promise.reject(e)),nc.interceptors.response.use(N_,O_);function _t(e){return nc(e).then(t=>t.data)}const Ct={getLangInfo:e=>_t({url:"/system/api/auth/lang-info",method:"get",params:e}),getBusTypeTree:e=>_t({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:e}),getBusTypeTreeData:e=>_t({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:e}),getBpmnList:e=>_t({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:e}),switchBpmnStatus:e=>_t({url:"/workorder/api/flow/bpmn/switch",method:"post",params:e}),delBpmn:e=>_t({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:e}),getBpmnDetail:e=>_t({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:e}),getBpmnXml:e=>_t({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:e}),getLinkList:e=>_t({url:"/workorder/api/flow/link/public-search-list",method:"get",params:e}),getBranchTree:e=>_t({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:e}),getUserList:e=>_t({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:e}),getRoleList:e=>_t({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:e}),bpmnInsert:e=>_t({url:"/workorder/api/flow/bpmn/insert",method:"post",data:e}),bpmnUpdate:e=>_t({url:"/workorder/api/flow/bpmn/update",method:"post",data:e})},ic=_p.defineStore("wfApp",{state:()=>({lang:wp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(e){const t=this.lang;t&&($o.global.locale.value=t,this.localeMap[t]||Ct.getLangInfo({isoCode:t}).then(n=>{if(n.code===0){const i=n.result.detail;this.localeMap[t]=i,$o.global.mergeLocaleMessage(t,i),e&&(this.setLang(""),setTimeout(()=>{this.setLang(t)}))}}))},setLang(e){this.lang=e},setTheme(e){e&&(this.theme=e)},setupLangWatcher(){this.getLangInfo(!0),h.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),I_=h.defineComponent({__name:"index",setup(e){const t="wf",n=ic();return(i,r)=>{const o=K.App,a=K.ConfigProvider;return h.openBlock(),h.createBlock(a,{prefixCls:h.unref(t),theme:{token:h.unref(n).theme}},{default:h.withCtx(()=>[h.createVNode(o,null,{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function B_(e,t={immediate:!0}){const n=an.useI18n(),{t:i}=n,r=h.ref({}),o=[].concat(e);function a(){const l=o.map(u=>{const p=rc[u];if(Lo.isPromise(p))return p;if(p)return Promise.resolve([u,p]);const f=_t({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:u}}).then(d=>(rc[u]=d,[u,d]));return rc[u]=f,f});return Promise.all(l).then(u=>{u.forEach(p=>{const[f,d]=p;d&&d.code===0&&(r.value[f]=d.result)})})}h.watchEffect(()=>{const l=r.value;Object.keys(l).forEach(p=>{const f=l[p];for(const d in f){const m=`dct.${p}${d}`,v=i(m);f[d].text=v!==m?v:f[d].text}})}),t.immediate&&a();function s(l,u){const p=r.value[l];if(p&&u){const f=p[u];return f&&f.text?f.text:"-"}return"-"}function c(l){const u=r.value[l];return u?Object.keys(u).map(f=>({label:u[f].text,value:f})):[]}return[r,{fetchDict:a,toList:c,getDictLabel:s}]}const L_=h.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(e){const t=e,[n]=B_(t.type,{immediate:!0}),i=h.ref();h.watchEffect(()=>{let o="-";const a=n.value[t.type];if(a&&!Lo.isNullOrUndef(t.value))if(Lo.isString(t.value))o=t.value.split(",").filter(c=>c).map(c=>{var l;return(l=a[c])==null?void 0:l.text}).join("、")||"-";else{const s=a[t.value];o=(s==null?void 0:s.text)||"-"}i.value=o});const r=h.computed(()=>{if(t.dictClass)return`${t.dictClass} status${t.value}`});return(o,a)=>{const s=K.Tooltip;return e.showTooltip?(h.openBlock(),h.createBlock(s,{key:0,placement:"topLeft",title:h.unref(i)},{default:h.withCtx(()=>[h.createElementVNode("span",{class:h.normalizeClass(h.unref(r)),style:h.normalizeStyle(e.style)},h.toDisplayString(h.unref(i)),7)]),_:1},8,["title"])):(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass(h.unref(r)),style:h.normalizeStyle(e.style)},h.toDisplayString(h.unref(i)),7))}}}),oc="el",$_="is-",di=(e,t,n,i,r)=>{let o=`${e}-${t}`;return n&&(o+=`-${n}`),i&&(o+=`__${i}`),r&&(o+=`--${r}`),o},j_=Symbol("namespaceContextKey"),F_=e=>{const t=h.getCurrentInstance()?h.inject(j_,h.ref(oc)):h.ref(oc);return h.computed(()=>h.unref(t)||oc)},Sp=(e,t)=>{const n=F_();return{namespace:n,b:(v="")=>di(n.value,e,v,"",""),e:v=>v?di(n.value,e,"",v,""):"",m:v=>v?di(n.value,e,"","",v):"",be:(v,g)=>v&&g?di(n.value,e,v,g,""):"",em:(v,g)=>v&&g?di(n.value,e,"",v,g):"",bm:(v,g)=>v&&g?di(n.value,e,v,"",g):"",bem:(v,g,w)=>v&&g&&w?di(n.value,e,v,g,w):"",is:(v,...g)=>{const w=g.length>=1?g[0]:!0;return v&&w?`${$_}${v}`:""},cssVar:v=>{const g={};for(const w in v)v[w]&&(g[`--${n.value}-${w}`]=v[w]);return g},cssVarName:v=>`--${n.value}-${v}`,cssVarBlock:v=>{const g={};for(const w in v)v[w]&&(g[`--${n.value}-${e}-${w}`]=v[w]);return g},cssVarBlockName:v=>`--${n.value}-${e}-${v}`}};/**
1
+ (function(bt,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],U):(bt=typeof globalThis<"u"?globalThis:bt||self,U(bt["witlink-workflow"]={},bt.es,bt.Vue,bt.pinia,bt.vueI18n,bt.Axios,bt.antDesignVue,bt.components))})(this,function(bt,U,f,_p,Zt,c_,et,Lo){"use strict";let $o=Zt.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function l_(e){e&&($o=e)}function u_(e,t){const n=$o.global.t;if(n)return n(e,t)}function p_(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const f_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const d_=Object.prototype.toString,h_=e=>d_.call(e)==="[object Object]",m_=()=>{};function g_(...e){if(e.length!==1)return f.toRef(...e);const t=e[0];return typeof t=="function"?f.readonly(f.customRef(()=>({get:t,set:m_}))):f.ref(t)}function y_(e,t){function n(...i){return new Promise((r,o)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(r).catch(o)})}return n}const bp=e=>e();function v_(e=bp,t={}){const{initialState:n="active"}=t,i=g_(n==="active");function r(){i.value=!1}function o(){i.value=!0}const a=(...s)=>{i.value&&e(...s)};return{isActive:f.readonly(i),pause:r,resume:o,eventFilter:a}}function ec(e){return Array.isArray(e)?e:[e]}function __(e){return f.getCurrentInstance()}function b_(e,t,n={}){const{eventFilter:i=bp,...r}=n;return f.watch(e,y_(i,t),r)}function E_(e,t,n={}){const{eventFilter:i,initialState:r="active",...o}=n,{eventFilter:a,pause:s,resume:c,isActive:l}=v_(i,{initialState:r});return{stop:b_(e,t,{...o,eventFilter:a}),pause:s,resume:c,isActive:l}}function x_(e,t=!0,n){__()?f.onMounted(e,n):t?e():f.nextTick(e)}function w_(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const tc=f_?window:void 0;function S_(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Ep(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},i=(s,c,l,u)=>(s.addEventListener(c,l,u),()=>s.removeEventListener(c,l,u)),r=f.computed(()=>{const s=ec(f.toValue(e[0])).filter(c=>c!=null);return s.every(c=>typeof c!="string")?s:void 0}),o=w_(()=>{var s,c;return[(c=(s=r.value)==null?void 0:s.map(l=>S_(l)))!=null?c:[tc].filter(l=>l!=null),ec(f.toValue(r.value?e[1]:e[0])),ec(f.unref(r.value?e[2]:e[1])),f.toValue(r.value?e[3]:e[2])]},([s,c,l,u])=>{if(n(),!(s!=null&&s.length)||!(c!=null&&c.length)||!(l!=null&&l.length))return;const p=h_(u)?{...u}:u;t.push(...s.flatMap(d=>c.flatMap(h=>l.map(m=>i(d,h,m,p)))))},{flush:"post"}),a=()=>{o(),n()};return p_(n),a}const jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fo="__vueuse_ssr_handlers__",C_=R_();function R_(){return Fo in jo||(jo[Fo]=jo[Fo]||{}),jo[Fo]}function T_(e,t){return C_[e]||t}function P_(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const A_={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xp="vueuse-storage";function wp(e,t,n,i={}){var r;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:u,window:p=tc,eventFilter:d,onError:h=B=>{console.error(B)},initOnMounted:m}=i,y=(u?f.shallowRef:f.ref)(typeof t=="function"?t():t),g=f.computed(()=>f.toValue(e));if(!n)try{n=T_("getDefaultStorage",()=>{var B;return(B=tc)==null?void 0:B.localStorage})()}catch(B){h(B)}if(!n)return y;const w=f.toValue(t),C=P_(w),x=(r=i.serializer)!=null?r:A_[C],{pause:E,resume:S}=E_(y,()=>M(y.value),{flush:o,deep:a,eventFilter:d});f.watch(g,()=>I(),{flush:o}),p&&s&&x_(()=>{n instanceof Storage?Ep(p,"storage",I,{passive:!0}):Ep(p,xp,O),m&&I()}),m||I();function R(B,L){if(p){const H={key:g.value,oldValue:B,newValue:L,storageArea:n};p.dispatchEvent(n instanceof Storage?new StorageEvent("storage",H):new CustomEvent(xp,{detail:H}))}}function M(B){try{const L=n.getItem(g.value);if(B==null)R(L,null),n.removeItem(g.value);else{const H=x.write(B);L!==H&&(n.setItem(g.value,H),R(L,H))}}catch(L){h(L)}}function P(B){const L=B?B.newValue:n.getItem(g.value);if(L==null)return c&&w!=null&&n.setItem(g.value,x.write(w)),w;if(!B&&l){const H=x.read(L);return typeof l=="function"?l(H,w):C==="object"&&!Array.isArray(H)?{...w,...H}:H}else return typeof L!="string"?L:x.read(L)}function I(B){if(!(B&&B.storageArea!==n)){if(B&&B.key==null){y.value=w;return}if(!(B&&B.key!==g.value)){E();try{(B==null?void 0:B.newValue)!==x.write(y.value)&&(y.value=P(B))}catch(L){h(L)}finally{B?f.nextTick(S):S()}}}}function O(B){I(B.detail)}return y}const Rr=new Map;function k_(e){const t=f.getCurrentScope();function n(s){var c;const l=Rr.get(e)||new Set;l.add(s),Rr.set(e,l);const u=()=>r(s);return(c=t==null?void 0:t.cleanups)==null||c.push(u),u}function i(s){function c(...l){r(c),s(...l)}return n(c)}function r(s){const c=Rr.get(e);c&&(c.delete(s),c.size||o())}function o(){Rr.delete(e)}function a(s,c){var l;(l=Rr.get(e))==null||l.forEach(u=>u(s,c))}return{on:n,once:i,off:r,emit:a,reset:o}}const nc=c_.create({baseURL:"/cisapi",timeout:3e4});function D_(e){const n=wp("Access-Token",{}).value;let i;return typeof n=="string"?i=n:n&&(i=n.value),i&&(e.headers={...e.headers,"Access-Token":i}),e}function M_(e){const t=e.data;if(!(t instanceof Blob)&&(!t||t.code===void 0))et.message.error(t+"");else if(!(t instanceof Blob)&&t.code<0){let n=u_("err."+t.code);n===`err.${t.code}`&&(n=t.message?t.message:"unknow error"),et.message.error(n)}return e}function N_(e){if(e.response){const t=e.response.data;e.response.status===403?et.message.error(t.message):e.response.status===401&&et.message.error("Authorization verification failed")}else et.message.error(e+"");return Promise.reject(e)}nc.interceptors.request.use(D_,e=>Promise.reject(e)),nc.interceptors.response.use(M_,N_);function gt(e){return nc(e).then(t=>t.data)}const yt={getLangInfo:e=>gt({url:"/system/api/auth/lang-info",method:"get",params:e}),getBusTypeTree:e=>gt({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:e}),getBusTypeTreeData:e=>gt({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:e}),getBpmnList:e=>gt({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:e}),switchBpmnStatus:e=>gt({url:"/workorder/api/flow/bpmn/switch",method:"post",params:e}),delBpmn:e=>gt({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:e}),getBpmnDetail:e=>gt({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:e}),getBpmnXml:e=>gt({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:e}),getLinkList:e=>gt({url:"/workorder/api/flow/link/public-search-list",method:"get",params:e}),getBranchTree:e=>gt({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:e}),getUserList:e=>gt({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:e}),getRoleList:e=>gt({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:e}),bpmnInsert:e=>gt({url:"/workorder/api/flow/bpmn/insert",method:"post",data:e}),bpmnUpdate:e=>gt({url:"/workorder/api/flow/bpmn/update",method:"post",data:e}),getTemplateList:e=>gt({url:"/workorder/api/form-template/search-page",method:"get",params:e})},ic=_p.defineStore("wfApp",{state:()=>({lang:wp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(e){const t=this.lang;t&&($o.global.locale.value=t,this.localeMap[t]||yt.getLangInfo({isoCode:t}).then(n=>{if(n.code===0){const i=n.result.detail;this.localeMap[t]=i,$o.global.mergeLocaleMessage(t,i),e&&(this.setLang(""),setTimeout(()=>{this.setLang(t)}))}}))},setLang(e){this.lang=e},setTheme(e){e&&(this.theme=e)},setupLangWatcher(){this.getLangInfo(!0),f.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),O_=f.defineComponent({__name:"index",setup(e){const t="wf",n=ic();return(i,r)=>{const o=U.App,a=U.ConfigProvider;return f.openBlock(),f.createBlock(a,{prefixCls:f.unref(t),theme:{token:f.unref(n).theme}},{default:f.withCtx(()=>[f.createVNode(o,null,{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function I_(e,t={immediate:!0}){const n=Zt.useI18n(),{t:i}=n,r=f.ref({}),o=[].concat(e);function a(){const l=o.map(u=>{const p=rc[u];if(Lo.isPromise(p))return p;if(p)return Promise.resolve([u,p]);const d=gt({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:u}}).then(h=>(rc[u]=h,[u,h]));return rc[u]=d,d});return Promise.all(l).then(u=>{u.forEach(p=>{const[d,h]=p;h&&h.code===0&&(r.value[d]=h.result)})})}f.watchEffect(()=>{const l=r.value;Object.keys(l).forEach(p=>{const d=l[p];for(const h in d){const m=`dct.${p}${h}`,y=i(m);d[h].text=y!==m?y:d[h].text}})}),t.immediate&&a();function s(l,u){const p=r.value[l];if(p&&u){const d=p[u];return d&&d.text?d.text:"-"}return"-"}function c(l){const u=r.value[l];return u?Object.keys(u).map(d=>({label:u[d].text,value:d})):[]}return[r,{fetchDict:a,toList:c,getDictLabel:s}]}const B_=f.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(e){const t=e,[n]=I_(t.type,{immediate:!0}),i=f.ref();f.watchEffect(()=>{let o="-";const a=n.value[t.type];if(a&&!Lo.isNullOrUndef(t.value))if(Lo.isString(t.value))o=t.value.split(",").filter(c=>c).map(c=>{var l;return(l=a[c])==null?void 0:l.text}).join("、")||"-";else{const s=a[t.value];o=(s==null?void 0:s.text)||"-"}i.value=o});const r=f.computed(()=>{if(t.dictClass)return`${t.dictClass} status${t.value}`});return(o,a)=>{const s=U.Tooltip;return e.showTooltip?(f.openBlock(),f.createBlock(s,{key:0,placement:"topLeft",title:f.unref(i)},{default:f.withCtx(()=>[f.createElementVNode("span",{class:f.normalizeClass(f.unref(r)),style:f.normalizeStyle(e.style)},f.toDisplayString(f.unref(i)),7)]),_:1},8,["title"])):(f.openBlock(),f.createElementBlock("span",{key:1,class:f.normalizeClass(f.unref(r)),style:f.normalizeStyle(e.style)},f.toDisplayString(f.unref(i)),7))}}}),oc="el",L_="is-",hi=(e,t,n,i,r)=>{let o=`${e}-${t}`;return n&&(o+=`-${n}`),i&&(o+=`__${i}`),r&&(o+=`--${r}`),o},$_=Symbol("namespaceContextKey"),j_=e=>{const t=f.getCurrentInstance()?f.inject($_,f.ref(oc)):f.ref(oc);return f.computed(()=>f.unref(t)||oc)},Sp=(e,t)=>{const n=j_();return{namespace:n,b:(y="")=>hi(n.value,e,y,"",""),e:y=>y?hi(n.value,e,"",y,""):"",m:y=>y?hi(n.value,e,"","",y):"",be:(y,g)=>y&&g?hi(n.value,e,y,g,""):"",em:(y,g)=>y&&g?hi(n.value,e,"",y,g):"",bm:(y,g)=>y&&g?hi(n.value,e,y,"",g):"",bem:(y,g,w)=>y&&g&&w?hi(n.value,e,y,g,w):"",is:(y,...g)=>{const w=g.length>=1?g[0]:!0;return y&&w?`${L_}${y}`:""},cssVar:y=>{const g={};for(const w in y)y[w]&&(g[`--${n.value}-${w}`]=y[w]);return g},cssVarName:y=>`--${n.value}-${y}`,cssVarBlock:y=>{const g={};for(const w in y)y[w]&&(g[`--${n.value}-${e}-${w}`]=y[w]);return g},cssVarBlockName:y=>`--${n.value}-${e}-${y}`}};/**
2
2
  * @vue/shared v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const H_=Object.prototype.hasOwnProperty,Cp=(e,t)=>H_.call(e,t),ac=e=>typeof e=="string",sc=e=>e!==null&&typeof e=="object";var V_=typeof global=="object"&&global&&global.Object===Object&&global,z_=typeof self=="object"&&self&&self.Object===Object&&self,cc=V_||z_||Function("return this")(),Ln=cc.Symbol,Rp=Object.prototype,W_=Rp.hasOwnProperty,U_=Rp.toString,Tr=Ln?Ln.toStringTag:void 0;function G_(e){var t=W_.call(e,Tr),n=e[Tr];try{e[Tr]=void 0;var i=!0}catch{}var r=U_.call(e);return i&&(t?e[Tr]=n:delete e[Tr]),r}var K_=Object.prototype,q_=K_.toString;function Y_(e){return q_.call(e)}var X_="[object Null]",Z_="[object Undefined]",Tp=Ln?Ln.toStringTag:void 0;function lc(e){return e==null?e===void 0?Z_:X_:Tp&&Tp in Object(e)?G_(e):Y_(e)}function uc(e){return e!=null&&typeof e=="object"}var J_="[object Symbol]";function pc(e){return typeof e=="symbol"||uc(e)&&lc(e)==J_}function Q_(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var Pr=Array.isArray,Pp=Ln?Ln.prototype:void 0,Ap=Pp?Pp.toString:void 0;function kp(e){if(typeof e=="string")return e;if(Pr(e))return Q_(e,kp)+"";if(pc(e))return Ap?Ap.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ho(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function eb(e){return e}var tb="[object AsyncFunction]",nb="[object Function]",ib="[object GeneratorFunction]",rb="[object Proxy]";function ob(e){if(!Ho(e))return!1;var t=lc(e);return t==nb||t==ib||t==tb||t==rb}var fc=cc["__core-js_shared__"],Dp=function(){var e=/[^.]+$/.exec(fc&&fc.keys&&fc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ab(e){return!!Dp&&Dp in e}var sb=Function.prototype,cb=sb.toString;function lb(e){if(e!=null){try{return cb.call(e)}catch{}try{return e+""}catch{}}return""}var ub=/[\\^$.*+?()[\]{}|]/g,pb=/^\[object .+?Constructor\]$/,fb=Function.prototype,db=Object.prototype,hb=fb.toString,mb=db.hasOwnProperty,gb=RegExp("^"+hb.call(mb).replace(ub,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vb(e){if(!Ho(e)||ab(e))return!1;var t=ob(e)?gb:pb;return t.test(lb(e))}function yb(e,t){return e==null?void 0:e[t]}function dc(e,t){var n=yb(e,t);return vb(n)?n:void 0}function _b(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var bb=800,Eb=16,xb=Date.now;function wb(e){var t=0,n=0;return function(){var i=xb(),r=Eb-(i-n);if(n=i,r>0){if(++t>=bb)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Sb(e){return function(){return e}}var Vo=function(){try{var e=dc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Cb=Vo?function(e,t){return Vo(e,"toString",{configurable:!0,enumerable:!1,value:Sb(t),writable:!0})}:eb,Rb=wb(Cb),Tb=9007199254740991,Pb=/^(?:0|[1-9]\d*)$/;function Mp(e,t){var n=typeof e;return t=t??Tb,!!t&&(n=="number"||n!="symbol"&&Pb.test(e))&&e>-1&&e%1==0&&e<t}function Ab(e,t,n){t=="__proto__"&&Vo?Vo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Np(e,t){return e===t||e!==e&&t!==t}var kb=Object.prototype,Db=kb.hasOwnProperty;function Mb(e,t,n){var i=e[t];(!(Db.call(e,t)&&Np(i,n))||n===void 0&&!(t in e))&&Ab(e,t,n)}var Op=Math.max;function Nb(e,t,n){return t=Op(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=Op(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),_b(e,this,s)}}var Ob=9007199254740991;function Ib(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ob}var Bb="[object Arguments]";function Ip(e){return uc(e)&&lc(e)==Bb}var Bp=Object.prototype,Lb=Bp.hasOwnProperty,$b=Bp.propertyIsEnumerable,Lp=Ip(function(){return arguments}())?Ip:function(e){return uc(e)&&Lb.call(e,"callee")&&!$b.call(e,"callee")},jb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fb=/^\w*$/;function Hb(e,t){if(Pr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||pc(e)?!0:Fb.test(e)||!jb.test(e)||t!=null&&e in Object(t)}var Ar=dc(Object,"create");function Vb(){this.__data__=Ar?Ar(null):{},this.size=0}function zb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Wb="__lodash_hash_undefined__",Ub=Object.prototype,Gb=Ub.hasOwnProperty;function Kb(e){var t=this.__data__;if(Ar){var n=t[e];return n===Wb?void 0:n}return Gb.call(t,e)?t[e]:void 0}var qb=Object.prototype,Yb=qb.hasOwnProperty;function Xb(e){var t=this.__data__;return Ar?t[e]!==void 0:Yb.call(t,e)}var Zb="__lodash_hash_undefined__";function Jb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===void 0?Zb:t,this}function hi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}hi.prototype.clear=Vb,hi.prototype.delete=zb,hi.prototype.get=Kb,hi.prototype.has=Xb,hi.prototype.set=Jb;function Qb(){this.__data__=[],this.size=0}function zo(e,t){for(var n=e.length;n--;)if(Np(e[n][0],t))return n;return-1}var eE=Array.prototype,tE=eE.splice;function nE(e){var t=this.__data__,n=zo(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():tE.call(t,n,1),--this.size,!0}function iE(e){var t=this.__data__,n=zo(t,e);return n<0?void 0:t[n][1]}function rE(e){return zo(this.__data__,e)>-1}function oE(e,t){var n=this.__data__,i=zo(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Hi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Hi.prototype.clear=Qb,Hi.prototype.delete=nE,Hi.prototype.get=iE,Hi.prototype.has=rE,Hi.prototype.set=oE;var aE=dc(cc,"Map");function sE(){this.size=0,this.__data__={hash:new hi,map:new(aE||Hi),string:new hi}}function cE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wo(e,t){var n=e.__data__;return cE(t)?n[typeof t=="string"?"string":"hash"]:n.map}function lE(e){var t=Wo(this,e).delete(e);return this.size-=t?1:0,t}function uE(e){return Wo(this,e).get(e)}function pE(e){return Wo(this,e).has(e)}function fE(e,t){var n=Wo(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function mi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}mi.prototype.clear=sE,mi.prototype.delete=lE,mi.prototype.get=uE,mi.prototype.has=pE,mi.prototype.set=fE;var dE="Expected a function";function hc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(dE);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(hc.Cache||mi),n}hc.Cache=mi;var hE=500;function mE(e){var t=hc(e,function(i){return n.size===hE&&n.clear(),i}),n=t.cache;return t}var gE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vE=/\\(\\)?/g,yE=mE(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(gE,function(n,i,r,o){t.push(r?o.replace(vE,"$1"):i||n)}),t});function _E(e){return e==null?"":kp(e)}function Uo(e,t){return Pr(e)?e:Hb(e,t)?[e]:yE(_E(e))}function mc(e){if(typeof e=="string"||pc(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bE(e,t){t=Uo(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[mc(t[n++])];return n&&n==i?e:void 0}function EE(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var $p=Ln?Ln.isConcatSpreadable:void 0;function xE(e){return Pr(e)||Lp(e)||!!($p&&e&&e[$p])}function wE(e,t,n,i,r){var o=-1,a=e.length;for(n||(n=xE),r||(r=[]);++o<a;){var s=e[o];n(s)?EE(r,s):r[r.length]=s}return r}function SE(e){var t=e==null?0:e.length;return t?wE(e):[]}function CE(e){return Rb(Nb(e,void 0,SE),e+"")}function RE(e,t){return e!=null&&t in Object(e)}function TE(e,t,n){t=Uo(t,e);for(var i=-1,r=t.length,o=!1;++i<r;){var a=mc(t[i]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++i!=r?o:(r=e==null?0:e.length,!!r&&Ib(r)&&Mp(a,r)&&(Pr(e)||Lp(e)))}function PE(e,t){return e!=null&&TE(e,t,RE)}function AE(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i}function kE(e,t,n,i){if(!Ho(e))return e;t=Uo(t,e);for(var r=-1,o=t.length,a=o-1,s=e;s!=null&&++r<o;){var c=mc(t[r]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(r!=a){var u=s[c];l=void 0,l===void 0&&(l=Ho(u)?u:Mp(t[r+1])?[]:{})}Mb(s,c,l),s=s[c]}return e}function DE(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=bE(e,a);n(s,a)&&kE(o,Uo(a,e),s)}return o}function ME(e,t){return DE(e,t,function(n,i){return PE(e,i)})}var NE=CE(function(e,t){return e==null?{}:ME(e,t)});const Vi=e=>typeof e=="number",OE=e=>ac(e)?!Number.isNaN(Number(e)):!1;var jp;const gc=typeof window<"u",IE=e=>typeof e=="string",BE=()=>{};gc&&((jp=window==null?void 0:window.navigator)!=null&&jp.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Fp(e){return typeof e=="function"?e():h.unref(e)}function LE(e){return e}function Hp(e){return h.getCurrentScope()?(h.onScopeDispose(e),!0):!1}function $E(e,t=!0){h.getCurrentInstance()?h.onMounted(e):t?e():h.nextTick(e)}function Vp(e){var t;const n=Fp(e);return(t=n==null?void 0:n.$el)!=null?t:n}const zp=gc?window:void 0;function vc(...e){let t,n,i,r;if(IE(e[0])||Array.isArray(e[0])?([n,i,r]=e,t=zp):[t,n,i,r]=e,!t)return BE;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],a=()=>{o.forEach(u=>u()),o.length=0},s=(u,p,f,d)=>(u.addEventListener(p,f,d),()=>u.removeEventListener(p,f,d)),c=h.watch(()=>[Vp(t),Fp(r)],([u,p])=>{a(),u&&o.push(...n.flatMap(f=>i.map(d=>s(u,f,d,p))))},{immediate:!0,flush:"post"}),l=()=>{c(),a()};return Hp(l),l}function jE(e,t=!1){const n=h.ref(),i=()=>n.value=!!e();return i(),$E(i,t),n}const Wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Up="__vueuse_ssr_handlers__";Wp[Up]=Wp[Up]||{};var Gp=Object.getOwnPropertySymbols,FE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,VE=(e,t)=>{var n={};for(var i in e)FE.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&Gp)for(var i of Gp(e))t.indexOf(i)<0&&HE.call(e,i)&&(n[i]=e[i]);return n};function zE(e,t,n={}){const i=n,{window:r=zp}=i,o=VE(i,["window"]);let a;const s=jE(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},l=h.watch(()=>Vp(e),p=>{c(),s.value&&r&&p&&(a=new ResizeObserver(t),a.observe(p,o))},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return Hp(u),{isSupported:s,stop:u}}var Kp;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Kp||(Kp={}));var WE=Object.defineProperty,qp=Object.getOwnPropertySymbols,UE=Object.prototype.hasOwnProperty,GE=Object.prototype.propertyIsEnumerable,Yp=(e,t,n)=>t in e?WE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KE=(e,t)=>{for(var n in t||(t={}))UE.call(t,n)&&Yp(e,n,t[n]);if(qp)for(var n of qp(t))GE.call(t,n)&&Yp(e,n,t[n]);return e};KE({linear:LE},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class Xp extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function qE(e,t){throw new Xp(`[${e}] ${t}`)}function yc(e,t){if(process.env.NODE_ENV!=="production"){const n=ac(e)?new Xp(`[${e}] ${t}`):e;console.warn(n)}}const Zp="__epPropKey",YE=e=>e,XE=e=>sc(e)&&!!e[Zp],ZE=(e,t)=>{if(!sc(e)||XE(e))return e;const{values:n,required:i,default:r,type:o,validator:a}=e,c={type:o,required:!!i,validator:n||a?l=>{let u=!1,p=[];if(n&&(p=Array.from(n),Cp(e,"default")&&p.push(r),u||(u=p.includes(l))),a&&(u||(u=a(l))),!u&&p.length>0){const f=[...new Set(p)].map(d=>JSON.stringify(d)).join(", ");h.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(l)}.`)}return u}:void 0,[Zp]:!0};return Cp(e,"default")&&(c.default=r),c},Go=e=>AE(Object.entries(e).map(([t,n])=>[t,ZE(n,t)]));var _c=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const JE="utils/dom/style";function Jp(e,t="px"){if(!e)return"";if(Vi(e)||OE(e))return`${e}${t}`;if(ac(e))return e;yc(JE,"binding value must be a string or number")}const QE=(e,t)=>(e.install=n=>{for(const i of[e,...Object.values({})])n.component(i.name,i)},e),e0=Go({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),t0=e=>NE(e0,e),zi=4,n0={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},i0=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),bc=Symbol("scrollbarContextKey"),r0=Go({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),o0="Thumb";var Qp=_c(h.defineComponent({__name:"thumb",props:r0,setup(e){const t=e,n=h.inject(bc),i=Sp("scrollbar");n||qE(o0,"can not inject scrollbar context");const r=h.ref(),o=h.ref(),a=h.ref({}),s=h.ref(!1);let c=!1,l=!1,u=gc?document.onselectstart:null;const p=h.computed(()=>n0[t.vertical?"vertical":"horizontal"]),f=h.computed(()=>i0({size:t.size,move:t.move,bar:p.value})),d=h.computed(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/o.value[p.value.offset]),m=R=>{var N;if(R.stopPropagation(),R.ctrlKey||[1,2].includes(R.button))return;(N=window.getSelection())==null||N.removeAllRanges(),g(R);const P=R.currentTarget;P&&(a.value[p.value.axis]=P[p.value.offset]-(R[p.value.client]-P.getBoundingClientRect()[p.value.direction]))},v=R=>{if(!o.value||!r.value||!n.wrapElement)return;const N=Math.abs(R.target.getBoundingClientRect()[p.value.direction]-R[p.value.client]),P=o.value[p.value.offset]/2,O=(N-P)*100*d.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=O*n.wrapElement[p.value.scrollSize]/100},g=R=>{R.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u=document.onselectstart,document.onselectstart=()=>!1},w=R=>{if(!r.value||!o.value||c===!1)return;const N=a.value[p.value.axis];if(!N)return;const P=(r.value.getBoundingClientRect()[p.value.direction]-R[p.value.client])*-1,O=o.value[p.value.offset]-N,I=(P-O)*100*d.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=I*n.wrapElement[p.value.scrollSize]/100},C=()=>{c=!1,a.value[p.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S(),l&&(s.value=!1)},x=()=>{l=!1,s.value=!!t.size},E=()=>{l=!0,s.value=c};h.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",C)});const S=()=>{document.onselectstart!==u&&(document.onselectstart=u)};return vc(h.toRef(n,"scrollbarElement"),"mousemove",x),vc(h.toRef(n,"scrollbarElement"),"mouseleave",E),(R,N)=>(h.openBlock(),h.createBlock(h.Transition,{name:h.unref(i).b("fade"),persisted:""},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{ref_key:"instance",ref:r,class:h.normalizeClass([h.unref(i).e("bar"),h.unref(i).is(h.unref(p).key)]),onMousedown:v},[h.createElementVNode("div",{ref_key:"thumb",ref:o,class:h.normalizeClass(h.unref(i).e("thumb")),style:h.normalizeStyle(h.unref(f)),onMousedown:m},null,38)],34),[[h.vShow,R.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const a0=Go({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var s0=_c(h.defineComponent({__name:"bar",props:a0,setup(e,{expose:t}){const n=e,i=h.inject(bc),r=h.ref(0),o=h.ref(0),a=h.ref(""),s=h.ref(""),c=h.ref(1),l=h.ref(1);return t({handleScroll:f=>{if(f){const d=f.offsetHeight-zi,m=f.offsetWidth-zi;o.value=f.scrollTop*100/d*c.value,r.value=f.scrollLeft*100/m*l.value}},update:()=>{const f=i==null?void 0:i.wrapElement;if(!f)return;const d=f.offsetHeight-zi,m=f.offsetWidth-zi,v=d**2/f.scrollHeight,g=m**2/f.scrollWidth,w=Math.max(v,n.minSize),C=Math.max(g,n.minSize);c.value=v/(d-v)/(w/(d-w)),l.value=g/(m-g)/(C/(m-C)),s.value=w+zi<d?`${w}px`:"",a.value=C+zi<m?`${C}px`:""}}),(f,d)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(Qp,{move:r.value,ratio:l.value,size:a.value,always:f.always},null,8,["move","ratio","size","always"]),h.createVNode(Qp,{move:o.value,ratio:c.value,size:s.value,vertical:"",always:f.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const c0=Go({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:YE([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...t0(["ariaLabel","ariaOrientation"])}),l0={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Vi)},Ec="ElScrollbar",u0=h.defineComponent({name:Ec}),p0=h.defineComponent({...u0,props:c0,emits:l0,setup(e,{expose:t,emit:n}){const i=e,r=Sp("scrollbar");let o,a,s=0,c=0;const l=h.ref(),u=h.ref(),p=h.ref(),f=h.ref(),d=h.computed(()=>{const S={};return i.height&&(S.height=Jp(i.height)),i.maxHeight&&(S.maxHeight=Jp(i.maxHeight)),[i.wrapStyle,S]}),m=h.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),v=h.computed(()=>[r.e("view"),i.viewClass]),g=()=>{var S;u.value&&((S=f.value)==null||S.handleScroll(u.value),s=u.value.scrollTop,c=u.value.scrollLeft,n("scroll",{scrollTop:u.value.scrollTop,scrollLeft:u.value.scrollLeft}))};function w(S,R){sc(S)?u.value.scrollTo(S):Vi(S)&&Vi(R)&&u.value.scrollTo(S,R)}const C=S=>{if(!Vi(S)){yc(Ec,"value must be a number");return}u.value.scrollTop=S},x=S=>{if(!Vi(S)){yc(Ec,"value must be a number");return}u.value.scrollLeft=S},E=()=>{var S;(S=f.value)==null||S.update()};return h.watch(()=>i.noresize,S=>{S?(o==null||o(),a==null||a()):({stop:o}=zE(p,E),a=vc("resize",E))},{immediate:!0}),h.watch(()=>[i.maxHeight,i.height],()=>{i.native||h.nextTick(()=>{var S;E(),u.value&&((S=f.value)==null||S.handleScroll(u.value))})}),h.provide(bc,h.reactive({scrollbarElement:l,wrapElement:u})),h.onActivated(()=>{u.value&&(u.value.scrollTop=s,u.value.scrollLeft=c)}),h.onMounted(()=>{i.native||h.nextTick(()=>{E()})}),h.onUpdated(()=>E()),t({wrapRef:u,update:E,scrollTo:w,setScrollTop:C,setScrollLeft:x,handleScroll:g}),(S,R)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:h.normalizeClass(h.unref(r).b())},[h.createElementVNode("div",{ref_key:"wrapRef",ref:u,class:h.normalizeClass(h.unref(m)),style:h.normalizeStyle(h.unref(d)),tabindex:S.tabindex,onScroll:g},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:p,class:h.normalizeClass(h.unref(v)),style:h.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:h.withCtx(()=>[h.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?h.createCommentVNode("v-if",!0):(h.openBlock(),h.createBlock(s0,{key:0,ref_key:"barRef",ref:f,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var f0=_c(p0,[["__file","scrollbar.vue"]]);const ef=QE(f0),Ko=Symbol("wf-bus"),d0={class:"wrapper"},h0={class:"content"},m0=["textContent"],g0=h.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(e){const t=e,n=h.ref("1"),i=h.ref(),r=h.ref();function o(){var l;if(!((l=t.data)!=null&&l.code))return;const s=n.value,c={code:t.data.code,type:s};Ct.getBpmnDetail(c).then(u=>{u.code===0&&(s==="1"?i.value="data:image/png;base64,"+u.result:r.value=u.result)})}function a(){o()}return h.onMounted(()=>{o()}),(s,c)=>{const l=K.RadioButton,u=K.RadioGroup,p=K.Image;return h.openBlock(),h.createElementBlock("div",d0,[h.createVNode(u,{value:h.unref(n),"onUpdate:value":c[0]||(c[0]=f=>h.isRef(n)?n.value=f:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:h.withCtx(()=>[h.createVNode(l,{value:"1"},{default:h.withCtx(()=>c[1]||(c[1]=[h.createTextVNode("png")])),_:1}),h.createVNode(l,{value:"0"},{default:h.withCtx(()=>c[2]||(c[2]=[h.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),h.createElementVNode("div",h0,[h.unref(n)==="1"?(h.openBlock(),h.createBlock(p,{key:0,src:h.unref(i)},null,8,["src"])):(h.openBlock(),h.createElementBlock("span",{key:1,textContent:h.toDisplayString(h.unref(r))},null,8,m0))])])}}}),gi=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},v0=gi(g0,[["__scopeId","data-v-248c7b10"]]),y0={class:"panel-left"},_0={class:"title"},b0={class:"search-box"},E0={key:2,class:"btns-action"},x0=gi(h.defineComponent({__name:"BusTypeList",setup(e){const{t}=an.useI18n(),n=h.ref(),i=h.ref([]),r=h.ref([]),o=h.ref([]);function a(){var R;o.value=[],i.value=[],r.value=[],(R=f.value)==null||R.reset(),s()}function s(R){const N={sync:!0};n.value&&Object.assign(N,{description:n.value}),Ct.getBusTypeTree(N).then(P=>{var O;if(P.code===0){const I=P.result||[];o.value=I,I.length&&(i.value=[I[0].key],(O=I[0].children)!=null&&O.length&&(r.value=[I[0].children[0].key],d()))}})}const c=h.inject(Ko);function l(R,N){N.selected&&N.node.dataRef.isLeaf&&(r.value=R,d())}const u=h.ref([{title:t("bpmn.version"),dataIndex:"version",width:100},{title:t("bpmn.description"),dataIndex:"description",width:250},{title:t("bpmn.used"),dataIndex:"used",width:130},{title:t("bpmn.status"),dataIndex:"status",width:130},{title:t("bpmn.action"),key:"action",width:200,fixed:"right"}]);function p(R){const N={type:r.value[0]};return Object.assign(N,R),Ct.getBpmnList(N)}const f=h.ref(),d=()=>{var R;(R=f.value)==null||R.refresh()},{message:m,modal:v}=st.App.useApp();function g(R,N){v.confirm({title:t("button._006_msg1"),content:t(N==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const P={code:R.code,status:N};Ct.switchBpmnStatus(P).then(O=>{O.code===0&&(d(),m.success(t("common.successTip")))})}})}function w(){c.emit("changeComp",{comp:"BpmnEditPage",opType:"1",type:r.value[0]})}function C(R){c.emit("changeComp",{comp:"BpmnEditPage",opType:"2",code:R.code})}function x(R){c.emit("changeComp",{comp:"BpmnEditPage",opType:"3",type:r.value[0],code:R.code})}function E(R){v.confirm({title:t("button._006_msg1"),content:t("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const N={code:R.code};Ct.delBpmn(N).then(P=>{P.code===0&&(d(),m.success(t("common.successTip")))})}})}function S(R){v.info({title:t("wo_list.btn_chart"),content:h.h(v0,{data:R}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return h.onMounted(()=>{a(),h.onActivated(()=>{var R;(R=f.value)==null||R.loadData()})}),(R,N)=>{const P=K.InputSearch,O=K.Tree,I=K.Empty,L=ef,B=K.Button,z=K.Space,q=L_,Je=K.Switch,Ce=h.resolveComponent("a-table-ex"),pe=h.resolveComponent("wl-splitter"),Qe=h.resolveDirective("permission");return h.openBlock(),h.createBlock(pe,{bordered:!1},{left:h.withCtx(()=>[h.createElementVNode("div",y0,[h.createElementVNode("div",_0,h.toDisplayString(R.$t("bpmn.list_title")),1),h.createElementVNode("div",b0,[h.createVNode(P,{value:h.unref(n),"onUpdate:value":N[0]||(N[0]=Ie=>h.isRef(n)?n.value=Ie:null),placeholder:R.$t("bpmn.type_placeholder"),onSearch:a},null,8,["value","placeholder"])]),h.createVNode(L,{class:"tree-wrapper"},{default:h.withCtx(()=>{var Ie;return[(Ie=h.unref(o))!=null&&Ie.length?(h.openBlock(),h.createBlock(O,{key:0,expandedKeys:h.unref(i),"onUpdate:expandedKeys":N[1]||(N[1]=be=>h.isRef(i)?i.value=be:null),selectedKeys:h.unref(r),"tree-data":h.unref(o),showLine:!0,onSelect:l},null,8,["expandedKeys","selectedKeys","tree-data"])):(h.openBlock(),h.createBlock(I,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:h.withCtx(()=>[h.createVNode(z,{class:"ml-lg my-nm"},{default:h.withCtx(()=>[h.withDirectives((h.openBlock(),h.createBlock(B,{type:"primary",onClick:w},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.$t("bpmn.add_workflow")),1)]),_:1})),[[Qe,"002"]])]),_:1}),h.createVNode(Ce,{ref_key:"tableEx",ref:f,class:"table-query bordered mx-lg",columns:h.unref(u),scroll:{x:1100},loadData:p},{bodyCell:h.withCtx(({column:Ie,record:be,text:ze})=>[Ie.dataIndex==="used"?(h.openBlock(),h.createBlock(q,{key:0,type:"BPMN_USED",value:ze},null,8,["value"])):h.createCommentVNode("",!0),Ie.dataIndex==="status"?(h.openBlock(),h.createBlock(Je,{key:1,checked:ze,checkedValue:"0",unCheckedValue:"1",disabled:!h.unref(Lo.hasPermission)("006"),onChange:j=>g(be,j)},null,8,["checked","disabled","onChange"])):h.createCommentVNode("",!0),Ie.key==="action"?(h.openBlock(),h.createElementBlock("div",E0,[h.withDirectives((h.openBlock(),h.createBlock(B,{type:"link",onClick:j=>C(be)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[Qe,"003"]]),h.withDirectives((h.openBlock(),h.createBlock(B,{type:"link",onClick:j=>E(be)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[Qe,"004"]]),h.withDirectives((h.openBlock(),h.createBlock(B,{type:"link",onClick:j=>S(be)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[Qe,"005"]]),h.withDirectives((h.openBlock(),h.createBlock(B,{type:"link",onClick:j=>x(be)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[Qe,"002"]])])):h.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-7d08e693"]]);function Y(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function w0(e,t){return t={exports:{}},e(t,t.exports),t.exports}var S0=w0(function(e){var t=e.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;for(var a=r-Math.floor(r),s="",o=0;o<Math.floor(r);o++){var c=Math.floor(Math.random()*i).toString(i);s=c+s}if(a){var l=Math.pow(i,a),c=Math.floor(Math.random()*l).toString(i);s=c+s}var u=parseInt(s,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):s};t.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10)if(r)n+=r;else throw new Error("too many ID collisions, use more bits");var l=t(n,i)}while(Object.hasOwnProperty.call(a,l));return a[l]=s,l},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}});function sn(e){if(!(this instanceof sn))return new sn(e);e=e||[128,36,1],this._seed=e.length?S0.rack(e[0],e[1],e[2]):e}sn.prototype.next=function(e){return this._seed(e||!0)},sn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},sn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},sn.prototype.assigned=function(e){return this._seed.get(e)||!1},sn.prototype.unclaim=function(e){delete this._seed.hats[e]},sn.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function xc(e){return Array.prototype.concat.apply([],e)}const kr=Object.prototype.toString,C0=Object.prototype.hasOwnProperty;function vi(e){return e===void 0}function et(e){return e!==void 0}function Dr(e){return e==null}function oe(e){return kr.call(e)==="[object Array]"}function tt(e){return kr.call(e)==="[object Object]"}function ee(e){return kr.call(e)==="[object Number]"}function We(e){const t=kr.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Rt(e){return kr.call(e)==="[object String]"}function R0(e){if(!oe(e))throw new Error("must supply array")}function bt(e,t){return!Dr(e)&&C0.call(e,t)}function _e(e,t){const n=Xo(t);let i;return A(e,function(r,o){if(n(r,o))return i=r,!1}),i}function tf(e,t){const n=Xo(t);let i=oe(e)?-1:void 0;return A(e,function(r,o){if(n(r,o))return i=o,!1}),i}function ce(e,t){const n=Xo(t);let i=[];return A(e,function(r,o){n(r,o)&&i.push(r)}),i}function A(e,t){let n,i;if(vi(e))return;const r=oe(e)?D0:k0;for(let o in e)if(bt(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function T0(e,t){if(vi(e))return[];R0(e);const n=Xo(t);return e.filter(function(i,r){return!n(i,r)})}function Tt(e,t,n){return A(e,function(i,r){n=t(n,i,r)}),n}function yi(e,t){return!!Tt(e,function(n,i,r){return n&&t(i,r)},!0)}function $n(e,t){return!!_e(e,t)}function ct(e,t){let n=[];return A(e,function(i,r){n.push(t(i,r))}),n}function qo(e){return e&&Object.keys(e)||[]}function P0(e){return qo(e).length}function Yo(e){return ct(e,t=>t)}function Wi(e,t,n={}){return t=wc(t),A(e,function(i){let r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function nf(e,...t){e=wc(e);let n={};return A(t,r=>Wi(r,e,n)),ct(n,function(r,o){return r[0]})}const A0=nf;function cn(e,t){t=wc(t);let n=[];return A(e,function(i,r){let o=t(i,r),a={d:o,v:i};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),ct(n,i=>i.v)}function Zt(e){return function(t){return yi(e,function(n,i){return t[i]===n})}}function wc(e){return We(e)?e:t=>t[e]}function Xo(e){return We(e)?e:t=>t===e}function k0(e){return e}function D0(e){return Number(e)}function rf(e,t){let n,i,r,o;function a(p){let f=Date.now(),d=p?0:o+t-f;if(d>0)return s(d);e.apply(r,i),c()}function s(p){n=setTimeout(a,p)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(){n&&a(!0),c()}function u(...p){o=Date.now(),i=p,r=this,n||s(t)}return u.flush=l,u.cancel=c,u}function Et(e,t){return e.bind(t)}function D(e,...t){return Object.assign(e,...t)}function M0(e,t,n){let i=e;return A(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=i[r];et(a)&&Dr(s)&&(s=i[r]=isNaN(+a)?{}:[]),vi(a)?vi(n)?delete i[r]:i[r]=n:i=s}),e}function Jt(e,t){let n={},i=Object(e);return A(t,function(r){r in i&&(n[r]=e[r])}),n}function ln(e,t){let n={},i=Object(e);return A(i,function(r,o){t.indexOf(o)===-1&&(n[o]=r)}),n}function N0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in e)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(e)}const O0=Object.prototype.toString,I0=Object.prototype.hasOwnProperty;function B0(e){return e===void 0}function L0(e){return O0.call(e)==="[object Array]"}function $0(e,t){return I0.call(e,t)}function of(e,t){let n,i;if(B0(e))return;const r=L0(e)?F0:j0;for(let o in e)if($0(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function j0(e){return e}function F0(e){return Number(e)}function lt(e,...t){const n=e.style;return of(t,function(i){i&&of(i,function(r,o){n[o]=r})}),e}function ut(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const H0=Object.prototype.toString;function Ne(e){return new jn(e)}function jn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}jn.prototype.add=function(e){return this.list.add(e),this},jn.prototype.remove=function(e){return H0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},jn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},jn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},jn.prototype.array=function(){return Array.from(this.list)},jn.prototype.has=jn.prototype.contains=function(e){return this.list.contains(e)};function Zo(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Ui(e,t,n){var i=n?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}var Jo={},Qo,Sc,Cc;function af(){Qo=window.addEventListener?"addEventListener":"attachEvent",Sc=window.removeEventListener?"removeEventListener":"detachEvent",Cc=Qo!=="addEventListener"?"on":""}var V0=Jo.bind=function(e,t,n,i){return Qo||af(),e[Qo](Cc+t,n,i||!1),n},z0=Jo.unbind=function(e,t,n,i){return Sc||af(),e[Sc](Cc+t,n,i||!1),n},ae=N0({__proto__:null,bind:V0,unbind:z0,default:Jo},[Jo]),sf=["focus","blur"];function W0(e,t,n,i,r){return sf.indexOf(n)!==-1&&(r=!0),ae.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Ui(a,t,!0),o.delegateTarget&&i.call(e,o)},r)}function U0(e,t,n,i){return sf.indexOf(t)!==-1&&(i=!0),ae.unbind(e,t,n,i)}var Pt={bind:W0,unbind:U0},G0=K0,cf=!1,ea;typeof document<"u"&&(ea=document.createElement("div"),ea.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',cf=!ea.getElementsByTagName("link").length,ea=void 0);var Ue={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:cf?[1,"X<div>","</div>"]:[0,"",""]};Ue.td=Ue.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ue.option=Ue.optgroup=[1,'<select multiple="multiple">',"</select>"],Ue.thead=Ue.tbody=Ue.colgroup=Ue.caption=Ue.tfoot=[1,"<table>","</table>"],Ue.polyline=Ue.ellipse=Ue.polygon=Ue.circle=Ue.text=Ue.line=Ue.path=Ue.rect=Ue.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function K0(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Ue,i)?Ue[i]:Ue._default,o=r[0],a=r[1],s=r[2],c=t.createElement("div");for(c.innerHTML=a+e+s;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var l=t.createDocumentFragment();c.firstChild;)l.appendChild(c.removeChild(c.firstChild));return l}var Te=G0;function lf(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function xe(e,t){return t=t||document,t.querySelector(e)}function Rc(e,t){return t=t||document,t.querySelectorAll(e)}function un(e){e.parentNode&&e.parentNode.removeChild(e)}function q0(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Y0(e,t){return t.appendChild(q0(e,t))}function ie(e,t){return Y0(t,e),e}var Tc=2,uf={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Tc,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Tc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function X0(e,t){return uf[t]?e.style[t]:e.getAttributeNS(null,t)}function pf(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=uf[i];r?(r===Tc&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function Z0(e,t){var n=Object.keys(t),i,r;for(i=0,r;r=n[i];i++)pf(e,r,t[r])}function G(e,t,n){if(typeof t=="string")if(n!==void 0)pf(e,t,n);else return X0(e,t);else Z0(e,t);return e}const J0=Object.prototype.toString;function me(e){return new Fn(e)}function Fn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fn.prototype.add=function(e){return this.list.add(e),this},Fn.prototype.remove=function(e){return J0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Fn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Fn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Fn.prototype.array=function(){return Array.from(this.list)},Fn.prototype.has=Fn.prototype.contains=function(e){return this.list.contains(e)};function ta(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function ff(e){return e.cloneNode(!0)}var Pc={svg:"http://www.w3.org/2000/svg"},df='<svg xmlns="'+Pc.svg+'"';function Q0(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Pc.svg)===-1&&(e=df+e.substring(4)):(e=df+">"+e+"</svg>",t=!0);var n=ex(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function ex(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function X(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Q0(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Pc.svg,e),t&&G(n,t),n}var Ac=null;function hf(){return Ac===null&&(Ac=X("svg")),Ac}function mf(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function tx(e,t,n,i,r,o){var a=hf().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return mf(a,e);case 6:return mf(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function Mr(e){return hf().createSVGTransform()}var gf=/([&<>]{1})/g,nx=/([&<>\n\r"]{1})/g,ix={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function kc(e,t){function n(i,r){return ix[r]||r}return e.replace(t,n)}function vf(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(kc(e.textContent,gf));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(r=e.attributes,n=0,i=r.length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',kc(o.value,nx),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,i=a.length;n<i;++n)vf(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",kc(e.nodeValue,gf),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function rx(e){for(var t=e.firstChild,n=[];t;)vf(t,n),t=t.nextSibling;return n.join("")}function yf(e,t){return rx(e)}function Ge(e){var t=e.parentNode;return t&&t.removeChild(e),e}function ox(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ax(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(ox(e,i))}function Nr(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),ax(n,t)),n.consolidate()}const sx=/^class[ {]/;function cx(e){return sx.test(e.toString())}function Dc(e){return Array.isArray(e)}function Mc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function na(...e){e.length===1&&Dc(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const lx=/constructor\s*[^(]*\(\s*([^)]*)\)/m,ux=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,px=/\/\*([^*]*)\*\//m;function fx(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(cx(e)?lx:ux);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(i=>{const r=i.match(px);return(r&&r[1]||i).trim()})||[]}function _f(e,t){const n=t||{get:function(x,E){if(i.push(x),E===!1)return null;throw s(`No provider for "${x}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){const E=i.join(" -> ");return i.length=0,new Error(E?`${x} (Resolving: ${E})`:x)};function c(x,E){if(!r[x]&&x.includes(".")){const S=x.split(".");let R=c(S.shift());for(;S.length;)R=R[S.shift()];return R}if(Mc(o,x))return o[x];if(Mc(r,x)){if(i.indexOf(x)!==-1)throw i.push(x),s("Cannot resolve circular dependency!");return i.push(x),o[x]=r[x][0](r[x][1]),i.pop(),o[x]}return n.get(x,E)}function l(x,E){if(typeof E>"u"&&(E={}),typeof x!="function")if(Dc(x))x=na(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);const R=(x.$inject||fx(x)).map(N=>Mc(E,N)?E[N]:c(N));return{fn:x,dependencies:R}}function u(x){const{fn:E,dependencies:S}=l(x),R=Function.prototype.bind.call(E,null,...S);return new R}function p(x,E,S){const{fn:R,dependencies:N}=l(x,S);return R.apply(E,N)}function f(x){return na(E=>x.get(E))}function d(x,E){if(E&&E.length){const S=Object.create(null),R=Object.create(null),N=[],P=[],O=[];let I,L,B,z;for(let q in r)I=r[q],E.indexOf(q)!==-1&&(I[2]==="private"?(L=N.indexOf(I[3]),L===-1?(B=I[3].createChild([],E),z=f(B),N.push(I[3]),P.push(B),O.push(z),S[q]=[z,q,"private",B]):S[q]=[O[L],q,"private",P[L]]):S[q]=[I[2],I[1]],R[q]=!0),(I[2]==="factory"||I[2]==="type")&&I[1].$scope&&E.forEach(Je=>{I[1].$scope.indexOf(Je)!==-1&&(S[q]=[I[2],I[1]],R[Je]=!0)});E.forEach(q=>{if(!R[q])throw new Error('No provider for "'+q+'". Cannot use provider from the parent!')}),x.unshift(S)}return new _f(x,a)}const m={factory:p,type:u,value:function(x){return x}};function v(x,E){const S=x.__init__||[];return function(){S.forEach(R=>{typeof R=="string"?E.get(R):E.invoke(R)})}}function g(x){const E=x.__exports__;if(E){const S=x.__modules__,R=Object.keys(x).reduce((L,B)=>(B!=="__exports__"&&B!=="__modules__"&&B!=="__init__"&&B!=="__depends__"&&(L[B]=x[B]),L),Object.create(null)),N=(S||[]).concat(R),P=d(N),O=na(function(L){return P.get(L)});E.forEach(function(L){r[L]=[O,L,"private",P]});const I=(x.__init__||[]).slice();return I.unshift(function(){P.init()}),x=Object.assign({},x,{__init__:I}),v(x,P)}return Object.keys(x).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const R=x[S];if(R[2]==="private"){r[S]=R;return}const N=R[0],P=R[1];r[S]=[m[N],dx(N,P),N]}),v(x,a)}function w(x,E){return x.indexOf(E)!==-1||(x=(E.__depends__||[]).reduce(w,x),x.indexOf(E)!==-1)?x:x.concat(E)}function C(x){const E=x.reduce(w,[]).map(g);let S=!1;return function(){S||(S=!0,E.forEach(R=>R()))}}this.get=c,this.invoke=p,this.instantiate=u,this.createChild=d,this.init=C(e)}function dx(e,t){return e!=="value"&&Dc(t)&&(t=na(t.slice())),t}var hx=1e3;function bn(e,t){var n=this;t=t||hx,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}bn.prototype.canRender=function(e){},bn.prototype.drawShape=function(e,t){},bn.prototype.drawConnection=function(e,t){},bn.prototype.getShapePath=function(e){},bn.prototype.getConnectionPath=function(e){};function _i(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function mx(e){return["M",e.x,e.y]}function Nc(e){return["L",e.x,e.y]}function gx(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function vx(e,t){const n=e.length,i=[mx(e[0])];for(let r=1;r<n;r++){const o=e[r-1],a=e[r],s=e[r+1];if(!s||!t){i.push(Nc(a));continue}const c=Math.min(t,Oc(a.x-o.x,a.y-o.y),Oc(s.x-a.x,s.y-a.y));if(!c){i.push(Nc(a));continue}const l=ia(a,o,c),u=ia(a,o,c*.5),p=ia(a,s,c),f=ia(a,s,c*.5);i.push(Nc(l)),i.push(gx(u,f,p))}return i}function ia(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=Oc(i,r),a=n/o;return{x:e.x+i*a,y:e.y+r*a}}function Oc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ra(e,t,n){ee(t)&&(n=t,t=null),t||(t={});const i=X("path",t);return ee(n)&&(i.dataset.cornerRadius=String(n)),bf(i,e)}function bf(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return G(e,{d:_i(vx(t,n))}),e}function oa(e){return ce(e,function(t){return!_e(e,function(n){return n!==t&&Ef(t,n)})})}function Ef(e,t){if(t){if(e===t)return t;if(e.parent)return Ef(e.parent,t)}}function xf(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function bi(e,t,n){n=n||0,oe(e)||(e=[e]),A(e,function(i,r){var o=t(i,r,n);oe(o)&&o.length&&bi(o,t,n+1)})}function yx(e,t,n){var i=[],r=[];return bi(e,function(o,a,s){xf(i,o,t);var c=o.children;if(c&&xf(r,c,t))return c}),i}function Or(e,t){return yx(e,!t)}function _x(e,t,n){vi(t)&&(t=!0),tt(t)&&(n=t,t=!0),n=n||{};var i=Ir(n.allShapes),r=Ir(n.allConnections),o=Ir(n.enclosedElements),a=Ir(n.enclosedConnections),s=Ir(n.topLevel,t&&Wi(e,function(u){return u.id}));function c(u){s[u.source.id]&&s[u.target.id]&&(s[u.id]=[u]),i[u.source.id]&&i[u.target.id]&&(a[u.id]=o[u.id]=u),r[u.id]=u}function l(u){if(o[u.id]=u,u.waypoints)a[u.id]=r[u.id]=u;else return i[u.id]=u,A(u.incoming,c),A(u.outgoing,c),u.children}return bi(e,l),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Ke(e,t){t=!!t,oe(e)||(e=[e]);var n,i,r,o;return A(e,function(a){var s=a;a.waypoints&&!t&&(s=Ke(a.waypoints,!0));var c=s.x,l=s.y,u=s.height||0,p=s.width||0;(c<n||n===void 0)&&(n=c),(l<i||i===void 0)&&(i=l),(c+p>r||r===void 0)&&(r=c+p),(l+u>o||o===void 0)&&(o=l+u)}),{x:n,y:i,height:o-i,width:r-n}}function wf(e,t){var n={};return A(e,function(i){var r=i;r.waypoints&&(r=Ke(r)),!ee(t.y)&&r.x>t.x&&(n[i.id]=i),!ee(t.x)&&r.y>t.y&&(n[i.id]=i),r.x>t.x&&r.y>t.y&&(ee(t.width)&&ee(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!ee(t.width)||!ee(t.height))&&(n[i.id]=i)}),n}function Sf(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Cf(e){return!!(e&&e.isFrame)}function Ir(e,t){return D({},e||{},t||{})}var bx=1;function Hn(e,t){bn.call(this,e,bx),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Y(Hn,bn),Hn.prototype.canRender=function(){return!0},Hn.prototype.drawShape=function(t,n,i){var r=X("rect");return G(r,{x:0,y:0,width:n.width||0,height:n.height||0}),Cf(n)?G(r,D({},this.FRAME_STYLE,i||{})):G(r,D({},this.SHAPE_STYLE,i||{})),ie(t,r),r},Hn.prototype.drawConnection=function(t,n,i){var r=ra(n.waypoints,D({},this.CONNECTION_STYLE,i||{}));return ie(t,r),r},Hn.prototype.getShapePath=function(t){var n=t.x,i=t.y,r=t.width,o=t.height,a=[["M",n,i],["l",r,0],["l",0,o],["l",-r,0],["z"]];return _i(a)},Hn.prototype.getConnectionPath=function(t){var n=t.waypoints,i,r,o=[];for(i=0;r=n[i];i++)r=r.original||r,o.push([i===0?"M":"L",r.x,r.y]);return _i(o)},Hn.$inject=["eventBus","styles"];function Ex(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){var o=this.style(i,r);return D(o,{class:n})},this.style=function(n,i){!oe(n)&&!i&&(i=n,n=[]);var r=Tt(n,function(o,a){return D(o,e[a]||{})},{});return i?D(r,i):r},this.computeStyle=function(n,i,r){return oe(i)||(r=i,i=[]),t.style(i||[],D({},r,n||{}))}}const xx={__init__:["defaultRenderer"],defaultRenderer:["type",Hn],styles:["type",Ex]};function Le(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function qe(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n)return;if(n!==-1)e.splice(i,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ic(e,t){return!e||!t?-1:e.indexOf(t)}function Br(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bc(e,t,n,i){if(typeof i>"u"&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Br(e,t);return Math.abs(r/o)<=i}var wx=2;function En(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(Sx(r,n))return o;return!1}function Sx(e,t){const n=t[0];return yi(t,function(i){return Math.abs(n[e]-i[e])<=wx})}function Rf(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Lc(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Cx=/,?([a-z]),?/gi,Tf=parseFloat,$e=Math,Vn=$e.PI,pn=$e.min,fn=$e.max,Pf=$e.pow,zn=$e.abs,Rx=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Tx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,aa=Array.isArray||function(e){return e instanceof Array};function $c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lr(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)$c(e,n)&&(t[n]=Lr(e[n]));return t}function Px(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function Ax(e){function t(){var n=Array.prototype.slice.call(arguments,0),i=n.join("␀"),r=t.cache=t.cache||{},o=t.count=t.count||[];return $c(r,i)?(Px(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=e(...arguments),r[i])}return t}function kx(e){if(!e)return null;var t=Gi(e);if(t.arr)return Lr(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return aa(e)&&aa(e[0])&&(i=Lr(e)),i.length||String(e).replace(Rx,function(r,o,a){var s=[],c=o.toLowerCase();for(a.replace(Tx,function(l,u){u&&s.push(+u)}),c=="m"&&s.length>2&&(i.push([o,...s.splice(0,2)]),c="l",o=o=="m"?"l":"L");s.length>=n[c]&&(i.push([o,...s.splice(0,n[c])]),!!n[c]););}),i.toString=Gi.toString,t.arr=Lr(i),i}function Gi(e){var t=Gi.ps=Gi.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)$c(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function jc(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function Af(){return this.join(",").replace(Cx,"$1")}function sa(e){var t=Lr(e);return t.toString=Af,t}function kf(e,t,n,i,r,o,a,s,c){var l=1-c,u=Pf(l,3),p=Pf(l,2),f=c*c,d=f*c,m=u*e+p*3*c*n+l*3*c*c*r+d*a,v=u*t+p*3*c*i+l*3*c*c*o+d*s;return{x:ca(m),y:ca(v)}}function Df(e){var t=Ix(...e);return jc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Wn(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Dx(e,t){return e=jc(e),t=jc(t),Wn(t,e.x,e.y)||Wn(t,e.x2,e.y)||Wn(t,e.x,e.y2)||Wn(t,e.x2,e.y2)||Wn(e,t.x,t.y)||Wn(e,t.x2,t.y)||Wn(e,t.x,t.y2)||Wn(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Mf(e,t,n,i,r){var o=-3*t+9*n-9*i+3*r,a=e*o+6*t-12*n+6*i;return e*a-3*t+3*n}function Nf(e,t,n,i,r,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var l=c/2,u=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,m=0;m<u;m++){var v=l*p[m]+l,g=Mf(v,e,n,r,a),w=Mf(v,t,i,o,s),C=g*g+w*w;d+=f[m]*$e.sqrt(C)}return l*d}function Mx(e,t,n,i,r,o,a,s){if(!(fn(e,n)<pn(r,a)||pn(e,n)>fn(r,a)||fn(t,i)<pn(o,s)||pn(t,i)>fn(o,s))){var c=(e*i-t*n)*(r-a)-(e-n)*(r*s-o*a),l=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),u=(e-n)*(o-s)-(t-i)*(r-a);if(u){var p=ca(c/u),f=ca(l/u),d=+p.toFixed(2),m=+f.toFixed(2);if(!(d<+pn(e,n).toFixed(2)||d>+fn(e,n).toFixed(2)||d<+pn(r,a).toFixed(2)||d>+fn(r,a).toFixed(2)||m<+pn(t,i).toFixed(2)||m>+fn(t,i).toFixed(2)||m<+pn(o,s).toFixed(2)||m>+fn(o,s).toFixed(2)))return{x:p,y:f}}}}function ca(e){return Math.round(e*1e11)/1e11}function Nx(e,t,n){var i=Df(e),r=Df(t);if(!Dx(i,r))return[];for(var o=Nf(...e),a=Nf(...t),s=If(e)?1:~~(o/5)||1,c=If(t)?1:~~(a/5)||1,l=[],u=[],p={},f=[],d=0;d<s+1;d++){var m=kf(...e,d/s);l.push({x:m.x,y:m.y,t:d/s})}for(d=0;d<c+1;d++)m=kf(...t,d/c),u.push({x:m.x,y:m.y,t:d/c});for(d=0;d<s;d++)for(var v=0;v<c;v++){var g=l[d],w=l[d+1],C=u[v],x=u[v+1],E=zn(w.x-g.x)<.01?"y":"x",S=zn(x.x-C.x)<.01?"y":"x",R=Mx(g.x,g.y,w.x,w.y,C.x,C.y,x.x,x.y),N;if(R){if(N=R.x.toFixed(9)+"#"+R.y.toFixed(9),p[N])continue;p[N]=!0;var P=g.t+zn((R[E]-g[E])/(w[E]-g[E]))*(w.t-g.t),O=C.t+zn((R[S]-C[S])/(x[S]-C[S]))*(x.t-C.t);P>=0&&P<=1&&O>=0&&O<=1&&f.push({x:R.x,y:R.y,t1:P,t2:O})}}return f}function Of(e,t,n){e=$f(e),t=$f(t);for(var i,r,o,a,s,c,l,u,p,f,d=n?0:[],m=0,v=e.length;m<v;m++){var g=e[m];if(g[0]=="M")i=s=g[1],r=c=g[2];else{g[0]=="C"?(p=[i,r,...g.slice(1)],i=p[6],r=p[7]):(p=[i,r,i,r,s,c,s,c],i=s,r=c);for(var w=0,C=t.length;w<C;w++){var x=t[w];if(x[0]=="M")o=l=x[1],a=u=x[2];else{x[0]=="C"?(f=[o,a,...x.slice(1)],o=f[6],a=f[7]):(f=[o,a,o,a,l,u,l,u],o=l,a=u);var E=Nx(p,f);{for(var S=0,R=E.length;S<R;S++)E[S].segment1=m,E[S].segment2=w,E[S].bez1=p,E[S].bez2=f;d=d.concat(E)}}}}}return d}function Ox(e){var t=Gi(e);if(t.abs)return sa(t.abs);if((!aa(e)||!aa(e&&e[0]))&&(e=kx(e)),!e||!e.length)return[["M",0,0]];var n=[],i=0,r=0,o=0,a=0,s=0,c;e[0][0]=="M"&&(i=+e[0][1],r=+e[0][2],o=i,a=r,s++,n[0]=["M",i,r]);for(var l,u,p=s,f=e.length;p<f;p++){if(n.push(l=[]),u=e[p],c=u[0],c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case"A":l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5],l[6]=+u[6]+i,l[7]=+u[7]+r;break;case"V":l[1]=+u[1]+r;break;case"H":l[1]=+u[1]+i;break;case"M":o=+u[1]+i,a=+u[2]+r;default:for(var d=1,m=u.length;d<m;d++)l[d]=+u[d]+(d%2?i:r)}else for(var v=0,g=u.length;v<g;v++)l[v]=u[v];switch(c=c.toUpperCase(),l[0]){case"Z":i=+o,r=+a;break;case"H":i=l[1];break;case"V":r=l[1];break;case"M":o=l[l.length-2],a=l[l.length-1];default:i=l[l.length-2],r=l[l.length-1]}}return n.toString=Af,t.abs=sa(n),n}function If(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function la(e,t,n,i){return[e,t,n,i,n,i]}function Bf(e,t,n,i,r,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function Lf(e,t,n,i,r,o,a,s,c,l){var u=Vn*120/180,p=Vn/180*(+r||0),f=[],d,m=Ax(function(T,_,y){var k=T*$e.cos(y)-_*$e.sin(y),M=T*$e.sin(y)+_*$e.cos(y);return{x:k,y:M}});if(l)N=l[0],P=l[1],S=l[2],R=l[3];else{d=m(e,t,-p),e=d.x,t=d.y,d=m(s,c,-p),s=d.x,c=d.y;var v=(e-s)/2,g=(t-c)/2,w=v*v/(n*n)+g*g/(i*i);w>1&&(w=$e.sqrt(w),n=w*n,i=w*i);var C=n*n,x=i*i,E=(o==a?-1:1)*$e.sqrt(zn((C*x-C*g*g-x*v*v)/(C*g*g+x*v*v))),S=E*n*g/i+(e+s)/2,R=E*-i*v/n+(t+c)/2,N=$e.asin(((t-R)/i).toFixed(9)),P=$e.asin(((c-R)/i).toFixed(9));N=e<S?Vn-N:N,P=s<S?Vn-P:P,N<0&&(N=Vn*2+N),P<0&&(P=Vn*2+P),a&&N>P&&(N=N-Vn*2),!a&&P>N&&(P=P-Vn*2)}var O=P-N;if(zn(O)>u){var I=P,L=s,B=c;P=N+u*(a&&P>N?1:-1),s=S+n*$e.cos(P),c=R+i*$e.sin(P),f=Lf(s,c,n,i,r,0,a,L,B,[P,I,S,R])}O=P-N;var z=$e.cos(N),q=$e.sin(N),Je=$e.cos(P),Ce=$e.sin(P),pe=$e.tan(O/4),Qe=4/3*n*pe,Ie=4/3*i*pe,be=[e,t],ze=[e+Qe*q,t-Ie*z],j=[s+Qe*Ce,c-Ie*Je],V=[s,c];if(ze[0]=2*be[0]-ze[0],ze[1]=2*be[1]-ze[1],l)return[ze,j,V].concat(f);f=[ze,j,V].concat(f).join().split(",");for(var Z=[],he=0,St=f.length;he<St;he++)Z[he]=he%2?m(f[he-1],f[he],p).y:m(f[he],f[he+1],p).x;return Z}function Ix(e,t,n,i,r,o,a,s){for(var c=[],l=[[],[]],u,p,f,d,m,v,g,w,C=0;C<2;++C){if(C==0?(p=6*e-12*n+6*r,u=-3*e+9*n-9*r+3*a,f=3*n-3*e):(p=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*s,f=3*i-3*t),zn(u)<1e-12){if(zn(p)<1e-12)continue;d=-f/p,0<d&&d<1&&c.push(d);continue}g=p*p-4*f*u,w=$e.sqrt(g),!(g<0)&&(m=(-p+w)/(2*u),0<m&&m<1&&c.push(m),v=(-p-w)/(2*u),0<v&&v<1&&c.push(v))}for(var x=c.length,E=x,S;x--;)d=c[x],S=1-d,l[0][x]=S*S*S*e+3*S*S*d*n+3*S*d*d*r+d*d*d*a,l[1][x]=S*S*S*t+3*S*S*d*i+3*S*d*d*o+d*d*d*s;return l[0][E]=e,l[1][E]=t,l[0][E+1]=a,l[1][E+1]=s,l[0].length=l[1].length=E+2,{x0:pn(...l[0]),y0:pn(...l[1]),x1:fn(...l[0]),y1:fn(...l[1])}}function $f(e){var t=Gi(e);if(t.curve)return sa(t.curve);for(var n=Ox(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(d,m,v){var g,w;if(!d)return["C",m.x,m.y,m.x,m.y,m.x,m.y];switch(!(d[0]in{T:1,Q:1})&&(m.qx=m.qy=null),d[0]){case"M":m.X=d[1],m.Y=d[2];break;case"A":d=["C",...Lf(m.x,m.y,...d.slice(1))];break;case"S":v=="C"||v=="S"?(g=m.x*2-m.bx,w=m.y*2-m.by):(g=m.x,w=m.y),d=["C",g,w,...d.slice(1)];break;case"T":v=="Q"||v=="T"?(m.qx=m.x*2-m.qx,m.qy=m.y*2-m.qy):(m.qx=m.x,m.qy=m.y),d=["C",...Bf(m.x,m.y,m.qx,m.qy,d[1],d[2])];break;case"Q":m.qx=d[1],m.qy=d[2],d=["C",...Bf(m.x,m.y,d[1],d[2],d[3],d[4])];break;case"L":d=["C",...la(m.x,m.y,d[1],d[2])];break;case"H":d=["C",...la(m.x,m.y,d[1],m.y)];break;case"V":d=["C",...la(m.x,m.y,m.x,d[1])];break;case"Z":d=["C",...la(m.x,m.y,m.X,m.Y)];break}return d},o=function(d,m){if(d[m].length>7){d[m].shift();for(var v=d[m];v.length;)a[m]="A",d.splice(m++,0,["C",...v.splice(0,6)]);d.splice(m,1),u=n.length}},a=[],s="",c="",l=0,u=n.length;l<u;l++){n[l]&&(s=n[l][0]),s!="C"&&(a[l]=s,l&&(c=a[l-1])),n[l]=r(n[l],i,c),a[l]!="A"&&s=="C"&&(a[l]="C"),o(n,l);var p=n[l],f=p.length;i.x=p[f-2],i.y=p[f-1],i.bx=Tf(p[f-4])||i.x,i.by=Tf(p[f-3])||i.y}return t.curve=sa(n),n}function we(e){return tt(e)&&bt(e,"waypoints")}function ge(e){return tt(e)&&bt(e,"labelTarget")}function jf(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function xn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Q(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function ua(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Bx(e){return xn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Lx(e){for(var t=e.waypoints,n=t.reduce(function(l,u,p){var f=t[p-1];if(f){var d=l[l.length-1],m=d&&d.endLength||0,v=Fx(f,u);l.push({start:f,end:u,startLength:m,endLength:m+v,length:v})}return l},[]),i=n.reduce(function(l,u){return l+u.length},0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function te(e){return we(e)?Lx(e):Bx(e)}function pt(e,t,n){n=n||0,tt(n)||(n={x:n,y:n});var i=Q(e),r=Q(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,l=o?"top":s?"bottom":null,u=c?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Fc(e,t,n){var i=$x(e,t);return i.length===1||i.length===2&&Br(i[0],i[1])<1?xn(i[0]):i.length>1?(i=cn(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),xn(i[n?0:i.length-1])):null}function $x(e,t){return Of(e,t)}function jx(e){e=e.slice();for(var t=0,n,i,r;e[t];)n=e[t],i=e[t-1],r=e[t+1],Br(n,r)===0||Bc(i,r,n)?e.splice(t,1):t++;return e}function Fx(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pa(e,t){return Math.round(e*t)/t}function Ff(e){return ee(e)?e+"px":e}function Hx(e){for(;e.parent;)e=e.parent;return e}function Vx(e){e=D({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),lt(n,{position:"relative",overflow:"hidden",width:Ff(e.width),height:Ff(e.height)}),t.appendChild(n),n}function Hf(e,t,n){const i=X("g");me(i).add(t);const r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const zx="base",Vf=0,Wx=1,Ux={shape:["x","y","width","height"],connection:["waypoints"]};function ne(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}ne.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ne.prototype._init=function(e){const t=this._eventBus,n=this._container=Vx(e),i=this._svg=X("svg");G(i,{width:"100%",height:"100%"}),ut(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),ie(n,i);const r=this._viewport=Hf(i,"viewport");e.deferUpdate&&(this._viewboxChanged=rf(Et(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:r})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ne.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ne.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},ne.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=Sf(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ne.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},ne.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},ne.prototype.isFocused=function(){return this._focused},ne.prototype.getDefaultLayer=function(){return this.getLayer(zx,Vf)},ne.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ne.prototype._getChildIndex=function(e){return Tt(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},ne.prototype._createLayer=function(e,t){typeof t>"u"&&(t=Wx);const n=this._getChildIndex(t);return{group:Hf(this._viewport,"layer-"+e,n),index:t,visible:!0}},ne.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ne.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(Ge(n),t.visible=!1),n},ne.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ge(t.group))},ne.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ne.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Hx(e))||{}).rootElement:void 0},ne.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ne.prototype._findPlaneForRoot=function(e){return _e(this._planes,function(t){return t.rootElement===e})},ne.prototype.getContainer=function(){return this._container},ne.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(A([i.gfx,i.secondaryGfx],function(r){r&&(n?(e.markers.add(t),me(r).add(t)):(e.markers.delete(t),me(r).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ne.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ne.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ne.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},ne.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ne.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ne.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,Vf);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ne.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},ne.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ne.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},ne.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ne.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ne.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=Ux[e];if(!yi(n,function(r){return typeof t[r]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},ne.prototype._setParent=function(e,t,n){qe(t.children,e,n),e.parent=t},ne.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ne.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ne.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ne.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e),!!e)return r.fire(t+".remove",{element:e}),i.remove(e),Le(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ne.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ne.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ne.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ne.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ne.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ne.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,l;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const u=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nr(t,u)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Nr(t),r=a?a.matrix:tx(),s=pa(r.a,1e3),c=pa(-r.e||0,1e3),l=pa(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n},e;return e},ne.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=D({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),zf(t,n)}),{x:n.e,y:n.f}},ne.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Ke(e),o=Q(r),a=this.viewbox(),s=this.zoom();let c,l;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const u=Q(a);if(!(r.width<a.width&&r.height<a.height))c=r.x-a.x,l=r.y-a.y;else{const f=Math.max(0,o.right-u.right),d=Math.min(0,o.left-u.left),m=Math.max(0,o.bottom-u.bottom),v=Math.min(0,o.top-u.top);c=f||d,l=m||v}this.scroll({dx:-c*s,dy:-l*s})},ne.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,i;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),pa(i.a,1e3)};function zf(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ne.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ne.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,l,u;c=i.getCTM();const p=c.a;return t?(a=D(o,t),s=a.matrixTransform(c.inverse()),l=r.translate(s.x,s.y).scale(1/p*e).translate(-s.x,-s.y),u=c.multiply(l)):u=r.scale(e),zf(this._viewport,u),u},ne.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ne.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:i,y:r,width:o,height:a}},ne.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ki="data-element-id";function Nt(e){this._elements={},this._eventBus=e}Nt.$inject=["eventBus"],Nt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),G(t,Ki,i),n&&G(n,Ki,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Nt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(G(i.gfx,Ki,""),i.secondaryGfx&&G(i.secondaryGfx,Ki,""),delete t[n])},Nt.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Nt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&G(t,Ki,i),t},Nt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&G(e,Ki);var n=this._elements[t];return n&&n.element},Nt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Nt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=n[i],o=t[r],a=o.element,s=o.gfx;if(e(a,s))return a}},Nt.prototype.getAll=function(){return this.filter(function(e){return e})},Nt.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Nt.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Nt.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function Gx(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,r,i)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a>"u"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Kx(e){return e.__refs_collection===!0}function qx(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Wf(e,t,n){var i=Gx(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function Yx(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(o){if(o!==r){var a=r;r=null,a&&e.unset(a,i,n),r=o,e.set(r,i,n)}}})}function Lt(e,t){if(!(this instanceof Lt))return new Lt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Lt.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Wf(this,t,e):Yx(this,t,e)},Lt.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Kx(n)||Wf(this,t,e),n},Lt.prototype.ensureBound=function(e,t){qx(e,t)||this.bind(e,t)},Lt.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Lt.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Hc=new Lt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Uf=new Lt({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Gf=new Lt({name:"attachers",collection:!0},{name:"host"}),Kf=new Lt({name:"outgoing",collection:!0},{name:"source"}),qf=new Lt({name:"incoming",collection:!0},{name:"target"});function qi(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Hc.bind(this,"parent"),Uf.bind(this,"labels"),Kf.bind(this,"outgoing"),qf.bind(this,"incoming")}function $r(){qi.call(this),Hc.bind(this,"children"),Gf.bind(this,"host"),Gf.bind(this,"attachers")}Y($r,qi);function Yf(){qi.call(this),Hc.bind(this,"children")}Y(Yf,$r);function Xf(){$r.call(this),Uf.bind(this,"labelTarget")}Y(Xf,$r);function Zf(){qi.call(this),Kf.bind(this,"source"),qf.bind(this,"target")}Y(Zf,qi);var Xx={connection:Zf,shape:$r,label:Xf,root:Yf};function Zx(e,t){var n=Xx[e];if(!n)throw new Error("unknown type: <"+e+">");return D(new n,t)}function Jx(e){return e instanceof qi}function wn(){this._uid=12}wn.prototype.createRoot=function(e){return this.create("root",e)},wn.prototype.createLabel=function(e){return this.create("label",e)},wn.prototype.createShape=function(e){return this.create("shape",e)},wn.prototype.createConnection=function(e){return this.create("connection",e)},wn.prototype.create=function(e,t){return t=D({},t||{}),t.id||(t.id=e+"_"+this._uid++),Zx(e,t)};var fa="__fn",Jf=1e3,Qx=Array.prototype.slice;function At(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}At.prototype.on=function(e,t,n,i){if(e=oe(e)?e:[e],We(t)&&(i=n,n=t,t=Jf),!ee(t))throw new Error("priority must be a number");var r=n;i&&(r=Et(n,i),r[fa]=n[fa]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},At.prototype.once=function(e,t,n,i){var r=this;if(We(t)&&(i=n,n=t,t=Jf),!ee(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[fa]=n,this.on(e,t,o)},At.prototype.off=function(e,t){e=oe(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},At.prototype.createEvent=function(e){var t=new jr;return t.init(e),t},At.prototype.fire=function(e,t){var n,i,r,o;if(o=Qx.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof jr?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},At.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},At.prototype._destroy=function(){this._listeners={}},At.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},At.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=ew(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},At.prototype._addListener=function(e,t){var n=this._getListeners(e),i;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,i?i.next=t:this._setListeners(e,t);return}i=n,n=n.next}i.next=t},At.prototype._getListeners=function(e){return this._listeners[e]},At.prototype._setListeners=function(e,t){this._listeners[e]=t},At.prototype._removeListener=function(e,t){var n=this._getListeners(e),i,r,o;if(!t){this._setListeners(e,null);return}for(;n;)i=n.next,o=n.callback,(o===t||o[fa]===t)&&(r?r.next=i:this._setListeners(e,i)),r=n,n=i};function jr(){}jr.prototype.stopPropagation=function(){this.cancelBubble=!0},jr.prototype.preventDefault=function(){this.defaultPrevented=!0},jr.prototype.init=function(e){D(this,e||{})};function ew(e,t){return e.apply(null,t)}function Ei(e){return e.childNodes[0]}function tw(e){return e.parentNode.childNodes[1]}function da(e,t,n,i,r){var o=Mr();o.setTranslate(t,n);var a=Mr();a.setRotate(i||0,0,0);var s=Mr();s.setScale(1,1),Nr(e,[o,a,s])}function ot(e,t,n){var i=Mr();i.setTranslate(t,n),Nr(e,i)}function Qf(e,t){var n=Mr();n.setRotate(t,0,0),Nr(e,n)}function Ot(e,t){this._eventBus=e,this._elementRegistry=t}Ot.$inject=["eventBus","elementRegistry"],Ot.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=tw(t),n||(n=X("g"),me(n).add("djs-children"),ie(t.parentNode,n))):n=t,n},Ot.prototype._clear=function(e){var t=Ei(e);return Zo(t),t},Ot.prototype._createContainer=function(e,t,n,i){var r=X("g");me(r).add("djs-group"),typeof n<"u"?ed(r,t,t.childNodes[n]):ie(t,r);var o=X("g");me(o).add("djs-element"),me(o).add("djs-"+e),i&&me(o).add("djs-frame"),ie(r,o);var a=X("g");return me(a).add("djs-visual"),ie(o,a),o},Ot.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Cf(t))},Ot.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,i;i=Tt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),A(i,function(r){var o=r.children;if(o){var a=t._getChildrenContainer(r);A(o.slice().reverse(),function(s){var c=n.getGraphics(s);ed(c.parentNode,a)})}})},Ot.prototype.drawShape=function(e,t,n={}){var i=this._eventBus;return i.fire("render.shape",{gfx:e,element:t,attrs:n})},Ot.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Ot.prototype.drawConnection=function(e,t,n={}){var i=this._eventBus;return i.fire("render.connection",{gfx:e,element:t,attrs:n})},Ot.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Ot.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),ot(n,t.x,t.y);else if(e==="connection")this.drawConnection(i,t);else throw new Error("unknown type: "+e);t.hidden?G(n,"display","none"):G(n,"display","block")}},Ot.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Ge(t.parentNode)};function ed(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}const nw={__depends__:[xx],__init__:["canvas"],canvas:["type",ne],elementRegistry:["type",Nt],elementFactory:["type",wn],eventBus:["type",At],graphicsFactory:["type",Ot]};function iw(e){var t=new _f(e);return t.init(),t}function rw(e){e=e||{};var t={config:["value",e]},n=[t,nw].concat(e.modules||[]);return iw(n)}function Un(e,t){this._injector=t||rw(e),this.get("eventBus").fire("diagram.init")}Un.prototype.get=function(e,t){return this._injector.get(e,t)},Un.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Un.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Un.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function Vc(){}Vc.prototype.get=function(e){return this.$model.properties.get(this,e)},Vc.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function td(e,t){this.model=e,this.properties=t}td.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Vc.prototype);A(e.properties,function(a){!a.isMany&&a.default!==void 0&&(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),A(a,Et(function(s,c){this.set(c,s)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var ow={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},nd={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function zc(e,t){var n=nd[e];return n?n(t):t}function Wc(e){return!!ow[e]}function id(e){return!!nd[e]}function ft(e,t){var n=e.split(/:/),i,r;if(n.length===1)i=e,r=t;else if(n.length===2)i=n[1],r=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(r?r+":":"")+i,{name:e,prefix:r,localName:i}}function It(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}It.prototype.build=function(){return Jt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},It.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},It.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},It.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=ft(r[0],i),a=ft(r[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines},It.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},It.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},It.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},It.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},It.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},It.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},It.prototype.hasProperty=function(e){return this.propertiesByName[e]},It.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(A(e.properties,Et(function(o){o=D({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)};function Gn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,A(e,Et(this.registerPackage,this))}Gn.prototype.getPackage=function(e){return this.packageMap[e]},Gn.prototype.getPackages=function(){return this.packages},Gn.prototype.registerPackage=function(e){e=D({},e);var t=this.packageMap;rd(t,e,"prefix"),rd(t,e,"uri"),A(e.types,Et(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Gn.prototype.registerType=function(e,t){e=D({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:D(e.meta||{})});var n=ft(e.name,t.prefix),i=n.name,r={};A(e.properties,Et(function(o){var a=ft(o.name,n.prefix),s=a.name;Wc(o.type)||(o.type=ft(o.type,a.prefix).name),D(o,{ns:a,name:s}),r[s]=o},this)),D(e,{ns:n,name:i,propertiesByName:r}),A(e.extends,Et(function(o){var a=ft(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Gn.prototype.mapTypes=function(e,t,n){var i=Wc(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c,l){var u=ft(c,Wc(c)?"":e.prefix);r.mapTypes(u,t,l)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+e.name+">");A(i.superClass,n?a:s),t(i,!n),A(i.traits,a)},Gn.prototype.getEffectiveDescriptor=function(e){var t=ft(e),n=new It(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Gn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function rd(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function xi(e){this.model=e}xi.prototype.set=function(e,t,n){if(!Rt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;aw(n)?i?delete e[r]:delete e.$attrs[Uc(t)]:i?r in e?e[r]=n:od(e,i,n):e.$attrs[Uc(t)]=n},xi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Uc(t)];var i=n.name;return!e[i]&&n.isMany&&od(e,n,[]),e[i]},xi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=D({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},xi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},xi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},xi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw o;typeof console<"u"&&console.warn(o)}return null};function aw(e){return typeof e>"u"}function od(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Uc(e){return e.replace(/^:/,"")}function $t(e,t={}){this.properties=new xi(this),this.factory=new td(this,this.properties),this.registry=new Gn(e,this.properties),this.typeCache={},this.config=t}$t.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},$t.prototype.getType=function(e){var t=this.typeCache,n=Rt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},$t.prototype.createAny=function(e,t,n){var i=ft(e),r={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){M0(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),A(n,function(a,s){tt(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},$t.prototype.getPackage=function(e){return this.registry.getPackage(e)},$t.prototype.getPackages=function(){return this.registry.getPackages()},$t.prototype.getElementDescriptor=function(e){return e.$descriptor},$t.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},$t.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},$t.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ad=String.fromCharCode,sw=Object.prototype.hasOwnProperty,cw=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Fr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Fr).forEach(function(e){Fr[e.toUpperCase()]=Fr[e]});function lw(e,t,n,i){return i?sw.call(Fr,i)?Fr[i]:"&"+i+";":ad(t||parseInt(n,16))}function wi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(cw,lw):e}var sd="non-whitespace outside of root node";function Yi(e){return new Error(e)}function cd(e){return"missing namespace for prefix <"+e+">"}function ha(e){return{get:e,enumerable:!0}}function uw(e){var t={},n;for(n in e)t[n]=e[n];return t}function Gc(e){return e+"$uri"}function pw(e){var t={},n,i;for(n in e)i=e[n],t[i]=i,t[Gc(i)]=n;return t}function ld(){return{line:0,column:0}}function fw(e){throw e}function ud(e){if(!this)return new ud(e);var t=e&&e.proxy,n,i,r,o,a=fw,s,c,l,u,p=ld,f=!1,d=!1,m=null,v=!1,g;function w(E){E instanceof Error||(E=Yi(E)),m=E,a(E,p)}function C(E){s&&(E instanceof Error||(E=Yi(E)),s(E,p))}this.on=function(E,S){if(typeof S!="function")throw Yi("required args <name, cb>");switch(E){case"openTag":i=S;break;case"text":n=S;break;case"closeTag":r=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":u=S;break;case"question":l=S;break;case"comment":c=S;break;default:throw Yi("unsupported event: "+E)}return this},this.ns=function(E){if(typeof E>"u"&&(E={}),typeof E!="object")throw Yi("required args <nsMap={}>");var S={},R;for(R in E)S[R]=E[R];return d=!0,g=S,this},this.parse=function(E){if(typeof E!="string")throw Yi("required args <xml=string>");return m=null,x(E),p=ld,v=!1,m},this.stop=function(){v=!0};function x(E){var S=d?[]:null,R=d?pw(g):null,N,P=[],O=0,I=!1,L=!1,B=0,z=0,q,Je,Ce,pe,Qe,Ie,be,ze,j,V="",Z=0,he;function St(){if(he!==null)return he;var _,y,k,M=d&&R.xmlns,$=d&&f?[]:null,W=Z,J=V,de=J.length,Xe,Be,rt,Xt,Re,Bn={},Qs={},Bt,se,Ee;e:for(;W<de;W++)if(Bt=!1,se=J.charCodeAt(W),!(se===32||se<14&&se>8)){for((se<65||se>122||se>90&&se<97)&&se!==95&&se!==58&&(C("illegal first char attribute name"),Bt=!0),Ee=W+1;Ee<de;Ee++)if(se=J.charCodeAt(Ee),!(se>96&&se<123||se>64&&se<91||se>47&&se<59||se===46||se===45||se===95)){if(se===32||se<14&&se>8){C("missing attribute value"),W=Ee;continue e}if(se===61)break;C("illegal attribute name char"),Bt=!0}if(Re=J.substring(W,Ee),Re==="xmlns:xmlns"&&(C("illegal declaration of xmlns"),Bt=!0),se=J.charCodeAt(Ee+1),se===34)Ee=J.indexOf('"',W=Ee+2),Ee===-1&&(Ee=J.indexOf("'",W),Ee!==-1&&(C("attribute value quote missmatch"),Bt=!0));else if(se===39)Ee=J.indexOf("'",W=Ee+2),Ee===-1&&(Ee=J.indexOf('"',W),Ee!==-1&&(C("attribute value quote missmatch"),Bt=!0));else for(C("missing attribute value quotes"),Bt=!0,Ee=Ee+1;Ee<de&&(se=J.charCodeAt(Ee+1),!(se===32||se<14&&se>8));Ee++);for(Ee===-1&&(C("missing closing quotes"),Ee=de,Bt=!0),Bt||(rt=J.substring(W,Ee)),W=Ee;Ee+1<de&&(se=J.charCodeAt(Ee+1),!(se===32||se<14&&se>8));Ee++)W===Ee&&(C("illegal character after attribute end"),Bt=!0);if(W=Ee+1,Bt)continue e;if(Re in Qs){C("attribute <"+Re+"> already defined");continue}if(Qs[Re]=!0,!d){Bn[Re]=rt;continue}if(f){if(Be=Re==="xmlns"?"xmlns":Re.charCodeAt(0)===120&&Re.substr(0,6)==="xmlns:"?Re.substr(6):null,Be!==null){if(_=wi(rt),y=Gc(Be),Xt=g[_],!Xt){if(Be==="xmlns"||y in R&&R[y]!==_)do Xt="ns"+O++;while(typeof R[Xt]<"u");else Xt=Be;g[_]=Xt}R[Be]!==Xt&&(Xe||(R=uw(R),Xe=!0),R[Be]=Xt,Be==="xmlns"&&(R[Gc(Xt)]=_,M=Xt),R[y]=_),Bn[Re]=rt;continue}$.push(Re,rt);continue}if(se=Re.indexOf(":"),se===-1){Bn[Re]=rt;continue}if(!(k=R[Re.substring(0,se)])){C(cd(Re.substring(0,se)));continue}Re=M===k?Re.substr(se+1):k+Re.substr(se),Bn[Re]=rt}if(f)for(W=0,de=$.length;W<de;W++){if(Re=$[W++],rt=$[W],se=Re.indexOf(":"),se!==-1){if(!(k=R[Re.substring(0,se)])){C(cd(Re.substring(0,se)));continue}Re=M===k?Re.substr(se+1):k+Re.substr(se)}Bn[Re]=rt}return he=Bn}function T(){for(var _=/(\r\n|\r|\n)/g,y=0,k=0,M=0,$=z,W,J;B>=M&&(W=_.exec(E),!(!W||($=W[0].length+W.index,$>B)));)y+=1,M=$;return B==-1?(k=$,J=E.substring(z)):z===0?J=E.substring(z,B):(k=B-M,J=z==-1?E.substring(B):E.substring(B,z+1)),{data:J,line:y,column:k}}for(p=T,t&&(j=Object.create({},{name:ha(function(){return be}),originalName:ha(function(){return ze}),attrs:ha(St),ns:ha(function(){return R})}));z!==-1;){if(E.charCodeAt(z)===60?B=z:B=E.indexOf("<",z),B===-1){if(P.length)return w("unexpected end of file");if(z===0)return w("missing start tag");z<E.length&&E.substring(z).trim()&&C(sd);return}if(z!==B){if(P.length){if(n&&(n(E.substring(z,B),wi,p),v))return}else if(E.substring(z,B).trim()&&(C(sd),v))return}if(pe=E.charCodeAt(B+1),pe===33){if(Ce=E.charCodeAt(B+2),Ce===91&&E.substr(B+3,6)==="CDATA["){if(z=E.indexOf("]]>",B),z===-1)return w("unclosed cdata");if(o&&(o(E.substring(B+9,z),p),v))return;z+=3;continue}if(Ce===45&&E.charCodeAt(B+3)===45){if(z=E.indexOf("-->",B),z===-1)return w("unclosed comment");if(c&&(c(E.substring(B+4,z),wi,p),v))return;z+=3;continue}}if(pe===63){if(z=E.indexOf("?>",B),z===-1)return w("unclosed question");if(l&&(l(E.substring(B,z+2),p),v))return;z+=2;continue}for(q=B+1;;q++){if(Qe=E.charCodeAt(q),isNaN(Qe))return z=-1,w("unclosed tag");if(Qe===34)Ce=E.indexOf('"',q+1),q=Ce!==-1?Ce:q;else if(Qe===39)Ce=E.indexOf("'",q+1),q=Ce!==-1?Ce:q;else if(Qe===62){z=q;break}}if(pe===33){if(u&&(u(E.substring(B,z+1),wi,p),v))return;z+=1;continue}if(he={},pe===47){if(I=!1,L=!0,!P.length)return w("missing open tag");if(q=be=P.pop(),Ce=B+2+q.length,E.substring(B+2,Ce)!==q)return w("closing tag mismatch");for(;Ce<z;Ce++)if(pe=E.charCodeAt(Ce),!(pe===32||pe>8&&pe<14))return w("close tag")}else{if(E.charCodeAt(z-1)===47?(q=be=E.substring(B+1,z-1),I=!0,L=!0):(q=be=E.substring(B+1,z),I=!0,L=!1),!(pe>96&&pe<123||pe>64&&pe<91||pe===95||pe===58))return w("illegal first char nodeName");for(Ce=1,Je=q.length;Ce<Je;Ce++)if(pe=q.charCodeAt(Ce),!(pe>96&&pe<123||pe>64&&pe<91||pe>47&&pe<59||pe===45||pe===95||pe==46)){if(pe===32||pe<14&&pe>8){be=q.substring(0,Ce),he=null;break}return w("invalid nodeName")}L||P.push(be)}if(d){if(N=R,I&&(L||S.push(N),he===null&&(f=q.indexOf("xmlns",Ce)!==-1)&&(Z=Ce,V=q,St(),f=!1)),ze=be,pe=be.indexOf(":"),pe!==-1){if(Ie=R[be.substring(0,pe)],!Ie)return w("missing namespace on <"+ze+">");be=be.substr(pe+1)}else Ie=R.xmlns;Ie&&(be=Ie+":"+be)}if(I&&(Z=Ce,V=q,i&&(t?i(j,wi,L,p):i(be,St,wi,L,p),v)))return;if(L){if(r&&(r(t?j:be,wi,I,p),v))return;d&&(I?R=N:R=S.pop())}z+=1}}}function pd(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Kc={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},fd="property";function dd(e){return e.xml&&e.xml.serialize}function dw(e){const t=dd(e);return t!==fd&&(t||null)}function hw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hd(e,t){return pd(t)?e.prefix+":"+hw(e.localName):e.name}function mw(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&i.indexOf(r)===0?e.prefix+":"+i.slice(r.length):n}function gw(e,t,n){const i=ft(e,t.xmlns),r=`${t[i.prefix]||i.prefix}:${i.localName}`,o=ft(r);var a=n.getPackage(o.prefix);return mw(o,a)}function Kn(e){return new Error(e)}function Sn(e){return e.$descriptor}function vw(e){D(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Kn("expected element");var n=this.elementsById,i=Sn(t),r=i.idProperty,o;if(r&&(o=t.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw Kn("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Hr(){}Hr.prototype.handleEnd=function(){},Hr.prototype.handleText=function(){},Hr.prototype.handleNode=function(){};function qc(){}qc.prototype=Object.create(Hr.prototype),qc.prototype.handleNode=function(){return this};function Xi(){}Xi.prototype=Object.create(Hr.prototype),Xi.prototype.handleText=function(e){this.body=(this.body||"")+e};function Vr(e,t){this.property=e,this.context=t}Vr.prototype=Object.create(Xi.prototype),Vr.prototype.handleNode=function(e){if(this.element)throw Kn("expected no sub nodes");return this.element=this.createReference(e),this},Vr.prototype.handleEnd=function(){this.element.id=this.body},Vr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Yc(e,t){this.element=t,this.propertyDesc=e}Yc.prototype=Object.create(Xi.prototype),Yc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=zc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function ma(){}ma.prototype=Object.create(Xi.prototype),ma.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function gt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}gt.prototype=Object.create(ma.prototype),gt.prototype.addReference=function(e){this.context.addReference(e)},gt.prototype.handleText=function(e){var t=this.element,n=Sn(t),i=n.bodyProperty;if(!i)throw Kn("unexpected body text <"+e+">");Xi.prototype.handleText.call(this,e)},gt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Sn(t),i=n.bodyProperty;i&&e!==void 0&&(e=zc(i.type,e),t.set(i.name,e))},gt.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=Sn(n),r=this.context,o=new n({}),a=this.model,s;return A(t,function(c,l){var u=i.propertiesByName[l],p;u&&u.isReference?u.isMany?(p=c.split(" "),A(p,function(f){r.addReference({element:o,property:u.ns.name,id:f})})):r.addReference({element:o,property:u.ns.name,id:c}):(u?c=zc(u.type,c):l==="xmlns"?l=":"+l:(s=ft(l,i.ns.prefix),a.getPackage(s.prefix)&&r.addWarning({message:"unknown attribute <"+l+">",element:o,property:l,value:c})),o.set(l,c))}),o},gt.prototype.getPropertyForNode=function(e){var t=e.name,n=ft(t),i=this.type,r=this.model,o=Sn(i),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){const l=dw(s);if(l){const u=e.attributes[l];if(u){const p=gw(u,e.ns,r),f=r.getType(p);return D({},s,{effectiveType:Sn(f).name})}}return s}var c=r.getPackage(n.prefix);if(c){const l=hd(n,c),u=r.getType(l);if(s=_e(o.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&u.hasType(p.type)}),s)return D({},s,{effectiveType:Sn(u).name})}else if(s=_e(o.properties,function(l){return!l.isReference&&!l.isAttribute&&l.type==="Element"}),s)return s;throw Kn("unrecognized element <"+n.name+">")},gt.prototype.toString=function(){return"ElementDescriptor["+Sn(this.type).name+"]"},gt.prototype.valueHandler=function(e,t){return new Yc(e,t)},gt.prototype.referenceHandler=function(e){return new Vr(e,this.context)},gt.prototype.handler=function(e){return e==="Element"?new Zi(this.model,e,this.context):new gt(this.model,e,this.context)},gt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,id(n))return this.valueHandler(t,i);t.isReference?r=this.referenceHandler(t).handleNode(e):r=this.handler(n).handleNode(e);var o=r.element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(D(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function Xc(e,t,n){gt.call(this,e,t,n)}Xc.prototype=Object.create(gt.prototype),Xc.prototype.createElement=function(e){var t=e.name,n=ft(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&hd(n,o)||t;if(!r.hasType(a))throw Kn("unexpected element <"+e.originalName+">");return gt.prototype.createElement.call(this,e)};function Zi(e,t,n){this.model=e,this.context=n}Zi.prototype=Object.create(ma.prototype),Zi.prototype.createElement=function(e){var t=e.name,n=ft(t),i=n.prefix,r=e.ns[i+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},Zi.prototype.handleChild=function(e){var t=new Zi(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element,r;return i!==void 0&&(r=n.$children=n.$children||[],r.push(i),i.$parent=n),t},Zi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Zc(e){e instanceof $t&&(e={model:e}),D(this,{lax:!1},e)}Zc.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof gt?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new vw(D({},t,{rootHandler:i})),s=new ud({proxy:!0}),c=yw();i.context=a,c.push(i);function l(S,R,N){var P=R(),O=P.line,I=P.column,L=P.data;L.charAt(0)==="<"&&L.indexOf(" ")!==-1&&(L=L.slice(0,L.indexOf(" "))+">");var B="unparsable content "+(L?L+" ":"")+`detected
6
- line: `+O+`
7
- column: `+I+`
8
- nested error: `+S.message;if(N)return a.addWarning({message:B,error:S}),!0;throw Kn(B)}function u(S,R){return l(S,R,!0)}function p(){var S=a.elementsById,R=a.references,N,P;for(N=0;P=R[N];N++){var O=P.element,I=S[P.id],L=Sn(O).propertiesByName[P.property];if(I||a.addWarning({message:"unresolved reference <"+P.id+">",element:P.element,property:P.property,value:P.id}),L.isMany){var B=O.get(L.name),z=B.indexOf(P);z===-1&&(z=B.length),I?B[z]=I:B.splice(z,1)}else O.set(L.name,I)}}function f(){c.pop().handleEnd()}var d=/^<\?xml /i,m=/ encoding="([^"]+)"/i,v=/^utf-8$/i;function g(S){if(d.test(S)){var R=m.exec(S),N=R&&R[1];!N||v.test(N)||a.addWarning({message:"unsupported document encoding <"+N+">, falling back to UTF-8"})}}function w(S,R){var N=c.peek();try{c.push(N.handleNode(S))}catch(P){l(P,R,o)&&c.push(new qc)}}function C(S,R){try{c.peek().handleText(S)}catch(N){u(N,R)}}function x(S,R){S.trim()&&C(S,R)}var E=r.getPackages().reduce(function(S,R){return S[R.uri]=R.prefix,S},Object.entries(Kc).reduce(function(S,[R,N]){return S[N]=R,S},r.config&&r.config.nsMap||{}));return s.ns(E).on("openTag",function(S,R,N,P){var O=S.attrs||{},I=Object.keys(O).reduce(function(B,z){var q=R(O[z]);return B[z]=q,B},{}),L={name:S.name,originalName:S.originalName,attributes:I,ns:S.ns};w(L,P)}).on("question",g).on("closeTag",f).on("cdata",C).on("text",function(S,R,N){x(R(S),N)}).on("error",l).on("warn",u),new Promise(function(S,R){var N;try{s.parse(e),p()}catch(B){N=B}var P=i.element;!N&&!P&&(N=Kn("failed to parse document as <"+i.type.$descriptor.name+">"));var O=a.warnings,I=a.references,L=a.elementsById;return N?(N.warnings=O,R(N)):S({rootElement:P,elementsById:L,references:I,warnings:O})})},Zc.prototype.handler=function(e){return new Xc(this.model,e)};function yw(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var _w=`<?xml version="1.0" encoding="UTF-8"?>
9
- `,bw=/<|>|'|"|&|\n\r|\n/g,md=/<|>|&/g;function dn(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}dn.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},dn.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},dn.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},dn.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},dn.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},dn.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},dn.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri},dn.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},dn.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var i=this.getNSKey(n);return this.used[i]})};function Ew(e){return e.charAt(0).toLowerCase()+e.slice(1)}function xw(e,t){return pd(t)?Ew(e):e}function gd(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function vd(e){return Rt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function ww(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function Sw(e,t){return t.isGeneric?D({localName:t.ns.localName},e):D({localName:xw(t.ns.localName,t.$pkg)},e)}function Cw(e,t){return D({localName:t.ns.localName},e)}function Rw(e){var t=e.$descriptor;return ce(t.properties,function(n){var i=n.name;if(n.isVirtual||!bt(e,i))return!1;var r=e[i];return r===n.default||r===null?!1:n.isMany?r.length:!0})}var Tw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Pw={"<":"lt",">":"gt","&":"amp"};function yd(e,t,n){return e=Rt(e)?e:""+e,e.replace(t,function(i){return"&"+n[i]+";"})}function Aw(e){return yd(e,bw,Tw)}function kw(e){return yd(e,md,Pw)}function Dw(e){return ce(e,function(t){return t.isAttr})}function Mw(e){return ce(e,function(t){return!t.isAttr})}function Jc(e){this.tagName=e}Jc.prototype.build=function(e){return this.element=e,this},Jc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Si(){}Si.prototype.serializeValue=Si.prototype.serializeTo=function(e){e.append(this.escape?kw(this.value):this.value)},Si.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(md)!==-1&&(this.escape=!0),this};function Qc(e){this.tagName=e}gd(Qc,Si),Qc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function Pe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}Pe.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i,r,o=t.isGeneric;return o?i=this.parseGenericNsAttributes(e):i=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(r=Rw(e),this.parseAttributes(Dw(r)),this.parseContainments(Mw(r))),this.parseGenericAttributes(e,i),this},Pe.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Sw(t,e)},Pe.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Cw(t,e)},Pe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Pe.prototype.nsAttributeName=function(e){var t;if(Rt(e)?t=ft(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:D({localName:t.localName},n)},Pe.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))},Pe.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Si().build({type:"String"},t));var n=e.$children;n&&A(n,i=>{this.body.push(new Pe(this).build(i))})},Pe.prototype.parseNsAttribute=function(e,t,n){var i=e.$model,r=ft(t),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:n}),!r.prefix&&r.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},Pe.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return A(n,function(r,o){var a=t.parseNsAttribute(e,o,r);a&&i.push(a)}),i},Pe.prototype.parseGenericAttributes=function(e,t){var n=this;A(t,function(i){try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){typeof console<"u"&&console.warn(`missing namespace information for <${i.name}=${i.value}> on`,e,r)}})},Pe.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;A(e,function(r){var o=i.get(r.name),a=r.isReference,s=r.isMany;if(s||(o=[o]),r.isBody)n.push(new Si().build(r,o[0]));else if(id(r.type))A(o,function(l){n.push(new Qc(t.addTagName(t.nsPropertyTagName(r))).build(r,l))});else if(a)A(o,function(l){n.push(new Jc(t.addTagName(t.nsPropertyTagName(r))).build(l))});else{var c=dd(r);A(o,function(l){var u;c?c===fd?u=new Pe(t,r):u=new ga(t,r,c):u=new Pe(t),n.push(u.build(l))})}})},Pe.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,i;return t||(i=n&&n.getNamespaces(),e||!i?this.namespaces=t=new dn(i):t=i),t},Pe.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix,a=i.byUri(r);return(!a||n)&&i.add(e,t),i.mapPrefix(o,r),e},Pe.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),i=e.prefix,r=e.uri,o,a,s;if(!i&&!r)return{localName:e.localName};if(s=n.defaultUriByPrefix(i),r=r||s||n.uriByPrefix(i),!r)throw new Error("no namespace uri given for prefix <"+i+">");if(e=n.byUri(r),!e&&!i&&(e=this.logNamespace({uri:r},s===r,!0)),!e){for(o=i,a=1;n.uriByPrefix(o);)o=i+"_"+a++;e=this.logNamespace({prefix:o,uri:r},s===r)}return i&&n.mapPrefix(i,r),e},Pe.prototype.parseAttributes=function(e){var t=this,n=this.element;A(e,function(i){var r=n.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];A(r,function(a){o.push(a.id)}),r=o.join(" ")}t.addAttribute(t.nsAttributeName(i),r)})},Pe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),vd(e)},Pe.prototype.addAttribute=function(e,t){var n=this.attrs;Rt(t)&&(t=Aw(t));var i=tf(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Pe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=ww(n).concat(t)),A(t,function(i){e.append(" ").append(vd(i.name)).append('="').append(i.value).append('"')})},Pe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Si;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),A(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function ga(e,t,n){Pe.call(this,e,t),this.serialization=n}gd(ga,Pe),ga.prototype.parseNsAttributes=function(e){var t=Pe.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ga.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Nw(){this.value="",this.write=function(e){this.value+=e}}function Ow(e,t){var n=[""];this.append=function(i){return e.write(i),this},this.appendNewLine=function(){return t&&e.write(`
10
- `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Iw(e){e=D({format:!1,preamble:!0},e||{});function t(n,i){var r=i||new Nw,o=new Ow(r,e.format);e.preamble&&o.append(_w);var a=new Pe,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(Bw(s)),a.build(n).serializeTo(o),!i)return r.value}return{toXML:t}}function Bw(e){const t=e.config&&e.config.nsMap||{},n={};for(const i in Kc)n[i]=Kc[i];for(const i in t){const r=t[i];n[r]=i}for(const i of e.getPackages())n[i.prefix]=i.uri;return n}function va(e,t){$t.call(this,e,t)}va.prototype=Object.create($t.prototype),va.prototype.fromXML=function(e,t,n){Rt(t)||(n=t,t="bpmn:Definitions");var i=new Zc(D({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},va.prototype.toXML=function(e,t){var n=new Iw(t);return new Promise(function(i,r){try{var o=n.toXML(e);return i({xml:o})}catch(a){return r(a)}})};var Lw="BPMN20",$w="http://www.omg.org/spec/BPMN/20100524/MODEL",jw="bpmn",Fw=[],Hw=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],Vw=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],zw={tagAlias:"lowerCase",typePrefix:"t"},Ww={name:Lw,uri:$w,prefix:jw,associations:Fw,types:Hw,enumerations:Vw,xml:zw},Uw="BPMNDI",Gw="http://www.omg.org/spec/BPMN/20100524/DI",Kw="bpmndi",qw=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],Yw=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],Xw=[],Zw={name:Uw,uri:Gw,prefix:Kw,types:qw,enumerations:Yw,associations:Xw},Jw="DC",Qw="http://www.omg.org/spec/DD/20100524/DC",e1="dc",t1=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],n1=[],i1={name:Jw,uri:Qw,prefix:e1,types:t1,associations:n1},r1="DI",o1="http://www.omg.org/spec/DD/20100524/DI",a1="di",s1=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],c1=[],l1={tagAlias:"lowerCase"},u1={name:r1,uri:o1,prefix:a1,types:s1,associations:c1,xml:l1},p1="bpmn.io colors for BPMN",f1="http://bpmn.io/schema/bpmn/biocolor/1.0",d1="bioc",h1=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],m1=[],g1=[],v1={name:p1,uri:f1,prefix:d1,types:h1,enumerations:m1,associations:g1},y1="BPMN in Color",_1="http://www.omg.org/spec/BPMN/non-normative/color/1.0",b1="color",E1=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],x1=[],w1=[],S1={name:y1,uri:_1,prefix:b1,types:E1,enumerations:x1,associations:w1};const C1={bpmn:Ww,bpmndi:Zw,dc:i1,di:u1,bioc:v1,color:S1};function R1(e,t){const n=D({},C1,e);return new va(n,t)}function dt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var T1="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function _d(e){bt(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(T1)}})}function xt(e,t){return e.$instanceOf(t)}function P1(e){return _e(e.rootElements,function(t){return xt(t,"bpmn:Process")||xt(t,"bpmn:Collaboration")})}function A1(e){var t={},n=[],i={};function r(j,V){return function(Z){j(Z,V)}}function o(j){t[j.id]=j}function a(j){return t[j.id]}function s(j,V){var Z=j.gfx;if(Z)throw new Error(`already rendered ${dt(j)}`);return e.element(j,i[j.id],V)}function c(j,V){return e.root(j,i[j.id],V)}function l(j,V){try{var Z=i[j.id]&&s(j,V);return o(j),Z}catch(he){u(he.message,{element:j,error:he}),console.error(`failed to import ${dt(j)}`,he)}}function u(j,V){e.error(j,V)}var p=this.registerDi=function(V){var Z=V.bpmnElement;Z?i[Z.id]?u(`multiple DI elements defined for ${dt(Z)}`,{element:Z}):(i[Z.id]=V,_d(Z)):u(`no bpmnElement referenced in ${dt(V)}`,{element:V})};function f(j){d(j.plane)}function d(j){p(j),A(j.planeElement,m)}function m(j){p(j)}this.handleDefinitions=function(V,Z){var he=V.diagrams;if(Z&&he.indexOf(Z)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!Z&&he&&he.length&&(Z=he[0]),!Z)throw new Error("no diagram to display");i={},f(Z);var St=Z.plane;if(!St)throw new Error(`no plane for ${dt(Z)}`);var T=St.bpmnElement;if(!T)if(T=P1(V),T)u(`correcting missing bpmnElement on ${dt(St)} to ${dt(T)}`),St.bpmnElement=T,p(St);else throw new Error("no process or collaboration to display");var _=c(T,St);if(xt(T,"bpmn:Process")||xt(T,"bpmn:SubProcess"))g(T,_);else if(xt(T,"bpmn:Collaboration"))be(T,_),w(V.rootElements,_);else throw new Error(`unsupported bpmnElement for ${dt(St)}: ${dt(T)}`);v(n)};var v=this.handleDeferred=function(){for(var V;n.length;)V=n.shift(),V()};function g(j,V){pe(j,V),O(j.ioSpecification,V),P(j.artifacts,V),o(j)}function w(j,V){var Z=ce(j,function(he){return!a(he)&&xt(he,"bpmn:Process")&&he.laneSets});Z.forEach(r(g,V))}function C(j,V){l(j,V)}function x(j,V){A(j,r(C,V))}function E(j,V){l(j,V)}function S(j,V){l(j,V)}function R(j,V){l(j,V)}function N(j,V){l(j,V)}function P(j,V){A(j,function(Z){xt(Z,"bpmn:Association")?n.push(function(){N(Z,V)}):N(Z,V)})}function O(j,V){j&&(A(j.dataInputs,r(S,V)),A(j.dataOutputs,r(R,V)))}var I=this.handleSubProcess=function(V,Z){pe(V,Z),P(V.artifacts,Z)};function L(j,V){var Z=l(j,V);xt(j,"bpmn:SubProcess")&&I(j,Z||V),xt(j,"bpmn:Activity")&&O(j.ioSpecification,V),n.push(function(){A(j.dataInputAssociations,r(E,V)),A(j.dataOutputAssociations,r(E,V))})}function B(j,V){l(j,V)}function z(j,V){l(j,V)}function q(j,V){n.push(function(){var Z=l(j,V);j.childLaneSet&&Je(j.childLaneSet,Z||V),ze(j)})}function Je(j,V){A(j.lanes,r(q,V))}function Ce(j,V){A(j,r(Je,V))}function pe(j,V){Qe(j.flowElements,V),j.laneSets&&Ce(j.laneSets,V)}function Qe(j,V){A(j,function(Z){xt(Z,"bpmn:SequenceFlow")?n.push(function(){B(Z,V)}):xt(Z,"bpmn:BoundaryEvent")?n.unshift(function(){L(Z,V)}):xt(Z,"bpmn:FlowNode")?L(Z,V):xt(Z,"bpmn:DataObject")||(xt(Z,"bpmn:DataStoreReference")||xt(Z,"bpmn:DataObjectReference")?z(Z,V):u(`unrecognized flowElement ${dt(Z)} in context ${dt(V&&V.businessObject)}`,{element:Z,context:V}))})}function Ie(j,V){var Z=l(j,V),he=j.processRef;he&&g(he,Z||V)}function be(j,V){A(j.participants,r(Ie,V)),P(j.artifacts,V),n.push(function(){x(j.messageFlows,V)})}function ze(j){A(j.flowNodeRef,function(V){var Z=V.get("lanes");Z&&Z.push(j)})}}function b(e,t){var n=H(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function le(e,t){return $n(t,function(n){return b(e,n)})}function H(e){return e&&e.businessObject||e}function ve(e){return e&&e.di}function k1(e,t,n){var i,r,o,a,s=[];function c(l,u){var p={root:function(v,g){return i.add(v,g)},element:function(v,g,w){return i.add(v,g,w)},error:function(v,g){s.push({message:v,context:g})}},f=new A1(p);u=u||l.diagrams&&l.diagrams[0];var d=D1(l,u);if(!d)throw new Error("no diagram to display");A(d,function(v){f.handleDefinitions(l,v)});var m=u.plane.bpmnElement.id;o.setRootElement(o.findRoot(m+"_plane")||o.findRoot(m))}return new Promise(function(l,u){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),c(t,n),r.fire("import.render.complete",{error:a,warnings:s}),l({warnings:s})}catch(p){return p.warnings=s,u(p)}})}function D1(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,i=n;!b(n,"bpmn:Process")&&!b(n,"bpmn:Collaboration")&&(i=M1(n));var r;b(i,"bpmn:Collaboration")?r=i:r=_e(e.rootElements,function(l){if(b(l,"bpmn:Collaboration"))return _e(l.participants,function(u){return u.processRef===i})});var o=[i];r&&(o=ct(r.participants,function(l){return l.processRef}),o.push(r));var a=bd(o),s=[t],c=[n];return A(e.diagrams,function(l){if(l.plane){var u=l.plane.bpmnElement;a.indexOf(u)!==-1&&c.indexOf(u)===-1&&(s.push(l),c.push(u))}}),s}}function bd(e){var t=[];return A(e,function(n){n&&(t.push(n),t=t.concat(bd(n.flowElements)))}),t}function M1(e){for(var t=e;t;){if(b(t,"bpmn:Process"))return t;t=t.$parent}}var N1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Ed=N1,xd={verticalAlign:"middle"},wd={color:"#404040"},O1={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},I1={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},B1={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},L1='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Ed+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',hn;function $1(){hn=Te(L1),lt(hn,O1),lt(xe("svg",hn),xd),lt(xe(".backdrop",hn),I1),lt(xe(".notice",hn),B1),lt(xe(".link",hn),wd,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function j1(){hn||($1(),Pt.bind(hn,".backdrop","click",function(e){document.body.removeChild(hn)})),document.body.appendChild(hn)}function Ae(e){e=D({},H1,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),z1(this._container)}Y(Ae,Un),Ae.prototype.importXML=async function(t,n){const i=this;function r(a){return i.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(f){throw this._emit("import.parse.complete",{error:f}),f}let s=a.rootElement;const c=a.references,l=a.warnings,u=a.elementsById;o=o.concat(l),s=this._emit("import.parse.complete",r({error:null,definitions:s,elementsById:u,references:c,warnings:o}))||s;const p=await this.importDefinitions(s,n);return o=o.concat(p.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),ya(s,o),s=F1(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}},Ae.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},Ae.prototype.open=async function(t){const n=this._definitions;let i=t;if(!n){const o=new Error("no XML imported");throw ya(o,[]),o}if(typeof t=="string"&&(i=V1(n,t),!i)){const o=new Error("BPMNDiagram <"+t+"> not found");throw ya(o,[]),o}try{this.clear()}catch(o){throw ya(o,[]),o}const{warnings:r}=await k1(this,n,i);return{warnings:r}},Ae.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,i,r;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,r=(await this._moddle.toXML(n,t)).xml,r=this._emit("saveXML.serialized",{xml:r})||r}catch(a){i=a}const o=i?{error:i}:{xml:r};if(this._emit("saveXML.done",o),i)throw i;return o},Ae.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const i=this.get("canvas"),r=i.getActiveLayer(),o=xe(":scope > defs",i._svg),a=yf(r),s=o?"<defs>"+yf(o)+"</defs>":"",c=r.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const F_=Object.prototype.hasOwnProperty,Cp=(e,t)=>F_.call(e,t),ac=e=>typeof e=="string",sc=e=>e!==null&&typeof e=="object";var H_=typeof global=="object"&&global&&global.Object===Object&&global,V_=typeof self=="object"&&self&&self.Object===Object&&self,cc=H_||V_||Function("return this")(),Ln=cc.Symbol,Rp=Object.prototype,z_=Rp.hasOwnProperty,W_=Rp.toString,Tr=Ln?Ln.toStringTag:void 0;function U_(e){var t=z_.call(e,Tr),n=e[Tr];try{e[Tr]=void 0;var i=!0}catch{}var r=W_.call(e);return i&&(t?e[Tr]=n:delete e[Tr]),r}var G_=Object.prototype,K_=G_.toString;function q_(e){return K_.call(e)}var Y_="[object Null]",X_="[object Undefined]",Tp=Ln?Ln.toStringTag:void 0;function lc(e){return e==null?e===void 0?X_:Y_:Tp&&Tp in Object(e)?U_(e):q_(e)}function uc(e){return e!=null&&typeof e=="object"}var Z_="[object Symbol]";function pc(e){return typeof e=="symbol"||uc(e)&&lc(e)==Z_}function J_(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var Pr=Array.isArray,Pp=Ln?Ln.prototype:void 0,Ap=Pp?Pp.toString:void 0;function kp(e){if(typeof e=="string")return e;if(Pr(e))return J_(e,kp)+"";if(pc(e))return Ap?Ap.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ho(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Q_(e){return e}var eb="[object AsyncFunction]",tb="[object Function]",nb="[object GeneratorFunction]",ib="[object Proxy]";function rb(e){if(!Ho(e))return!1;var t=lc(e);return t==tb||t==nb||t==eb||t==ib}var fc=cc["__core-js_shared__"],Dp=function(){var e=/[^.]+$/.exec(fc&&fc.keys&&fc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ob(e){return!!Dp&&Dp in e}var ab=Function.prototype,sb=ab.toString;function cb(e){if(e!=null){try{return sb.call(e)}catch{}try{return e+""}catch{}}return""}var lb=/[\\^$.*+?()[\]{}|]/g,ub=/^\[object .+?Constructor\]$/,pb=Function.prototype,fb=Object.prototype,db=pb.toString,hb=fb.hasOwnProperty,mb=RegExp("^"+db.call(hb).replace(lb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gb(e){if(!Ho(e)||ob(e))return!1;var t=rb(e)?mb:ub;return t.test(cb(e))}function yb(e,t){return e==null?void 0:e[t]}function dc(e,t){var n=yb(e,t);return gb(n)?n:void 0}function vb(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var _b=800,bb=16,Eb=Date.now;function xb(e){var t=0,n=0;return function(){var i=Eb(),r=bb-(i-n);if(n=i,r>0){if(++t>=_b)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function wb(e){return function(){return e}}var Vo=function(){try{var e=dc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Sb=Vo?function(e,t){return Vo(e,"toString",{configurable:!0,enumerable:!1,value:wb(t),writable:!0})}:Q_,Cb=xb(Sb),Rb=9007199254740991,Tb=/^(?:0|[1-9]\d*)$/;function Mp(e,t){var n=typeof e;return t=t??Rb,!!t&&(n=="number"||n!="symbol"&&Tb.test(e))&&e>-1&&e%1==0&&e<t}function Pb(e,t,n){t=="__proto__"&&Vo?Vo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Np(e,t){return e===t||e!==e&&t!==t}var Ab=Object.prototype,kb=Ab.hasOwnProperty;function Db(e,t,n){var i=e[t];(!(kb.call(e,t)&&Np(i,n))||n===void 0&&!(t in e))&&Pb(e,t,n)}var Op=Math.max;function Mb(e,t,n){return t=Op(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=Op(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),vb(e,this,s)}}var Nb=9007199254740991;function Ob(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nb}var Ib="[object Arguments]";function Ip(e){return uc(e)&&lc(e)==Ib}var Bp=Object.prototype,Bb=Bp.hasOwnProperty,Lb=Bp.propertyIsEnumerable,Lp=Ip(function(){return arguments}())?Ip:function(e){return uc(e)&&Bb.call(e,"callee")&&!Lb.call(e,"callee")},$b=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jb=/^\w*$/;function Fb(e,t){if(Pr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||pc(e)?!0:jb.test(e)||!$b.test(e)||t!=null&&e in Object(t)}var Ar=dc(Object,"create");function Hb(){this.__data__=Ar?Ar(null):{},this.size=0}function Vb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zb="__lodash_hash_undefined__",Wb=Object.prototype,Ub=Wb.hasOwnProperty;function Gb(e){var t=this.__data__;if(Ar){var n=t[e];return n===zb?void 0:n}return Ub.call(t,e)?t[e]:void 0}var Kb=Object.prototype,qb=Kb.hasOwnProperty;function Yb(e){var t=this.__data__;return Ar?t[e]!==void 0:qb.call(t,e)}var Xb="__lodash_hash_undefined__";function Zb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===void 0?Xb:t,this}function mi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}mi.prototype.clear=Hb,mi.prototype.delete=Vb,mi.prototype.get=Gb,mi.prototype.has=Yb,mi.prototype.set=Zb;function Jb(){this.__data__=[],this.size=0}function zo(e,t){for(var n=e.length;n--;)if(Np(e[n][0],t))return n;return-1}var Qb=Array.prototype,eE=Qb.splice;function tE(e){var t=this.__data__,n=zo(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():eE.call(t,n,1),--this.size,!0}function nE(e){var t=this.__data__,n=zo(t,e);return n<0?void 0:t[n][1]}function iE(e){return zo(this.__data__,e)>-1}function rE(e,t){var n=this.__data__,i=zo(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Hi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Hi.prototype.clear=Jb,Hi.prototype.delete=tE,Hi.prototype.get=nE,Hi.prototype.has=iE,Hi.prototype.set=rE;var oE=dc(cc,"Map");function aE(){this.size=0,this.__data__={hash:new mi,map:new(oE||Hi),string:new mi}}function sE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wo(e,t){var n=e.__data__;return sE(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cE(e){var t=Wo(this,e).delete(e);return this.size-=t?1:0,t}function lE(e){return Wo(this,e).get(e)}function uE(e){return Wo(this,e).has(e)}function pE(e,t){var n=Wo(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function gi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}gi.prototype.clear=aE,gi.prototype.delete=cE,gi.prototype.get=lE,gi.prototype.has=uE,gi.prototype.set=pE;var fE="Expected a function";function hc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fE);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(hc.Cache||gi),n}hc.Cache=gi;var dE=500;function hE(e){var t=hc(e,function(i){return n.size===dE&&n.clear(),i}),n=t.cache;return t}var mE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gE=/\\(\\)?/g,yE=hE(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mE,function(n,i,r,o){t.push(r?o.replace(gE,"$1"):i||n)}),t});function vE(e){return e==null?"":kp(e)}function Uo(e,t){return Pr(e)?e:Fb(e,t)?[e]:yE(vE(e))}function mc(e){if(typeof e=="string"||pc(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _E(e,t){t=Uo(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[mc(t[n++])];return n&&n==i?e:void 0}function bE(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var $p=Ln?Ln.isConcatSpreadable:void 0;function EE(e){return Pr(e)||Lp(e)||!!($p&&e&&e[$p])}function xE(e,t,n,i,r){var o=-1,a=e.length;for(n||(n=EE),r||(r=[]);++o<a;){var s=e[o];n(s)?bE(r,s):r[r.length]=s}return r}function wE(e){var t=e==null?0:e.length;return t?xE(e):[]}function SE(e){return Cb(Mb(e,void 0,wE),e+"")}function CE(e,t){return e!=null&&t in Object(e)}function RE(e,t,n){t=Uo(t,e);for(var i=-1,r=t.length,o=!1;++i<r;){var a=mc(t[i]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++i!=r?o:(r=e==null?0:e.length,!!r&&Ob(r)&&Mp(a,r)&&(Pr(e)||Lp(e)))}function TE(e,t){return e!=null&&RE(e,t,CE)}function PE(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i}function AE(e,t,n,i){if(!Ho(e))return e;t=Uo(t,e);for(var r=-1,o=t.length,a=o-1,s=e;s!=null&&++r<o;){var c=mc(t[r]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(r!=a){var u=s[c];l=void 0,l===void 0&&(l=Ho(u)?u:Mp(t[r+1])?[]:{})}Db(s,c,l),s=s[c]}return e}function kE(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=_E(e,a);n(s,a)&&AE(o,Uo(a,e),s)}return o}function DE(e,t){return kE(e,t,function(n,i){return TE(e,i)})}var ME=SE(function(e,t){return e==null?{}:DE(e,t)});const Vi=e=>typeof e=="number",NE=e=>ac(e)?!Number.isNaN(Number(e)):!1;var jp;const gc=typeof window<"u",OE=e=>typeof e=="string",IE=()=>{};gc&&((jp=window==null?void 0:window.navigator)!=null&&jp.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Fp(e){return typeof e=="function"?e():f.unref(e)}function BE(e){return e}function Hp(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}function LE(e,t=!0){f.getCurrentInstance()?f.onMounted(e):t?e():f.nextTick(e)}function Vp(e){var t;const n=Fp(e);return(t=n==null?void 0:n.$el)!=null?t:n}const zp=gc?window:void 0;function yc(...e){let t,n,i,r;if(OE(e[0])||Array.isArray(e[0])?([n,i,r]=e,t=zp):[t,n,i,r]=e,!t)return IE;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],a=()=>{o.forEach(u=>u()),o.length=0},s=(u,p,d,h)=>(u.addEventListener(p,d,h),()=>u.removeEventListener(p,d,h)),c=f.watch(()=>[Vp(t),Fp(r)],([u,p])=>{a(),u&&o.push(...n.flatMap(d=>i.map(h=>s(u,d,h,p))))},{immediate:!0,flush:"post"}),l=()=>{c(),a()};return Hp(l),l}function $E(e,t=!1){const n=f.ref(),i=()=>n.value=!!e();return i(),LE(i,t),n}const Wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Up="__vueuse_ssr_handlers__";Wp[Up]=Wp[Up]||{};var Gp=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,HE=(e,t)=>{var n={};for(var i in e)jE.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&Gp)for(var i of Gp(e))t.indexOf(i)<0&&FE.call(e,i)&&(n[i]=e[i]);return n};function VE(e,t,n={}){const i=n,{window:r=zp}=i,o=HE(i,["window"]);let a;const s=$E(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},l=f.watch(()=>Vp(e),p=>{c(),s.value&&r&&p&&(a=new ResizeObserver(t),a.observe(p,o))},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return Hp(u),{isSupported:s,stop:u}}var Kp;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Kp||(Kp={}));var zE=Object.defineProperty,qp=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,Yp=(e,t,n)=>t in e?zE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GE=(e,t)=>{for(var n in t||(t={}))WE.call(t,n)&&Yp(e,n,t[n]);if(qp)for(var n of qp(t))UE.call(t,n)&&Yp(e,n,t[n]);return e};GE({linear:BE},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class Xp extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function KE(e,t){throw new Xp(`[${e}] ${t}`)}function vc(e,t){if(process.env.NODE_ENV!=="production"){const n=ac(e)?new Xp(`[${e}] ${t}`):e;console.warn(n)}}const Zp="__epPropKey",qE=e=>e,YE=e=>sc(e)&&!!e[Zp],XE=(e,t)=>{if(!sc(e)||YE(e))return e;const{values:n,required:i,default:r,type:o,validator:a}=e,c={type:o,required:!!i,validator:n||a?l=>{let u=!1,p=[];if(n&&(p=Array.from(n),Cp(e,"default")&&p.push(r),u||(u=p.includes(l))),a&&(u||(u=a(l))),!u&&p.length>0){const d=[...new Set(p)].map(h=>JSON.stringify(h)).join(", ");f.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(l)}.`)}return u}:void 0,[Zp]:!0};return Cp(e,"default")&&(c.default=r),c},Go=e=>PE(Object.entries(e).map(([t,n])=>[t,XE(n,t)]));var _c=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const ZE="utils/dom/style";function Jp(e,t="px"){if(!e)return"";if(Vi(e)||NE(e))return`${e}${t}`;if(ac(e))return e;vc(ZE,"binding value must be a string or number")}const JE=(e,t)=>(e.install=n=>{for(const i of[e,...Object.values({})])n.component(i.name,i)},e),QE=Go({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),e0=e=>ME(QE,e),zi=4,t0={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},n0=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),bc=Symbol("scrollbarContextKey"),i0=Go({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),r0="Thumb";var Qp=_c(f.defineComponent({__name:"thumb",props:i0,setup(e){const t=e,n=f.inject(bc),i=Sp("scrollbar");n||KE(r0,"can not inject scrollbar context");const r=f.ref(),o=f.ref(),a=f.ref({}),s=f.ref(!1);let c=!1,l=!1,u=gc?document.onselectstart:null;const p=f.computed(()=>t0[t.vertical?"vertical":"horizontal"]),d=f.computed(()=>n0({size:t.size,move:t.move,bar:p.value})),h=f.computed(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/o.value[p.value.offset]),m=R=>{var M;if(R.stopPropagation(),R.ctrlKey||[1,2].includes(R.button))return;(M=window.getSelection())==null||M.removeAllRanges(),g(R);const P=R.currentTarget;P&&(a.value[p.value.axis]=P[p.value.offset]-(R[p.value.client]-P.getBoundingClientRect()[p.value.direction]))},y=R=>{if(!o.value||!r.value||!n.wrapElement)return;const M=Math.abs(R.target.getBoundingClientRect()[p.value.direction]-R[p.value.client]),P=o.value[p.value.offset]/2,I=(M-P)*100*h.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=I*n.wrapElement[p.value.scrollSize]/100},g=R=>{R.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u=document.onselectstart,document.onselectstart=()=>!1},w=R=>{if(!r.value||!o.value||c===!1)return;const M=a.value[p.value.axis];if(!M)return;const P=(r.value.getBoundingClientRect()[p.value.direction]-R[p.value.client])*-1,I=o.value[p.value.offset]-M,O=(P-I)*100*h.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=O*n.wrapElement[p.value.scrollSize]/100},C=()=>{c=!1,a.value[p.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S(),l&&(s.value=!1)},x=()=>{l=!1,s.value=!!t.size},E=()=>{l=!0,s.value=c};f.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",C)});const S=()=>{document.onselectstart!==u&&(document.onselectstart=u)};return yc(f.toRef(n,"scrollbarElement"),"mousemove",x),yc(f.toRef(n,"scrollbarElement"),"mouseleave",E),(R,M)=>(f.openBlock(),f.createBlock(f.Transition,{name:f.unref(i).b("fade"),persisted:""},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",{ref_key:"instance",ref:r,class:f.normalizeClass([f.unref(i).e("bar"),f.unref(i).is(f.unref(p).key)]),onMousedown:y},[f.createElementVNode("div",{ref_key:"thumb",ref:o,class:f.normalizeClass(f.unref(i).e("thumb")),style:f.normalizeStyle(f.unref(d)),onMousedown:m},null,38)],34),[[f.vShow,R.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const o0=Go({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var a0=_c(f.defineComponent({__name:"bar",props:o0,setup(e,{expose:t}){const n=e,i=f.inject(bc),r=f.ref(0),o=f.ref(0),a=f.ref(""),s=f.ref(""),c=f.ref(1),l=f.ref(1);return t({handleScroll:d=>{if(d){const h=d.offsetHeight-zi,m=d.offsetWidth-zi;o.value=d.scrollTop*100/h*c.value,r.value=d.scrollLeft*100/m*l.value}},update:()=>{const d=i==null?void 0:i.wrapElement;if(!d)return;const h=d.offsetHeight-zi,m=d.offsetWidth-zi,y=h**2/d.scrollHeight,g=m**2/d.scrollWidth,w=Math.max(y,n.minSize),C=Math.max(g,n.minSize);c.value=y/(h-y)/(w/(h-w)),l.value=g/(m-g)/(C/(m-C)),s.value=w+zi<h?`${w}px`:"",a.value=C+zi<m?`${C}px`:""}}),(d,h)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(Qp,{move:r.value,ratio:l.value,size:a.value,always:d.always},null,8,["move","ratio","size","always"]),f.createVNode(Qp,{move:o.value,ratio:c.value,size:s.value,vertical:"",always:d.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const s0=Go({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:qE([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...e0(["ariaLabel","ariaOrientation"])}),c0={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Vi)},Ec="ElScrollbar",l0=f.defineComponent({name:Ec}),u0=f.defineComponent({...l0,props:s0,emits:c0,setup(e,{expose:t,emit:n}){const i=e,r=Sp("scrollbar");let o,a,s=0,c=0;const l=f.ref(),u=f.ref(),p=f.ref(),d=f.ref(),h=f.computed(()=>{const S={};return i.height&&(S.height=Jp(i.height)),i.maxHeight&&(S.maxHeight=Jp(i.maxHeight)),[i.wrapStyle,S]}),m=f.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),y=f.computed(()=>[r.e("view"),i.viewClass]),g=()=>{var S;u.value&&((S=d.value)==null||S.handleScroll(u.value),s=u.value.scrollTop,c=u.value.scrollLeft,n("scroll",{scrollTop:u.value.scrollTop,scrollLeft:u.value.scrollLeft}))};function w(S,R){sc(S)?u.value.scrollTo(S):Vi(S)&&Vi(R)&&u.value.scrollTo(S,R)}const C=S=>{if(!Vi(S)){vc(Ec,"value must be a number");return}u.value.scrollTop=S},x=S=>{if(!Vi(S)){vc(Ec,"value must be a number");return}u.value.scrollLeft=S},E=()=>{var S;(S=d.value)==null||S.update()};return f.watch(()=>i.noresize,S=>{S?(o==null||o(),a==null||a()):({stop:o}=VE(p,E),a=yc("resize",E))},{immediate:!0}),f.watch(()=>[i.maxHeight,i.height],()=>{i.native||f.nextTick(()=>{var S;E(),u.value&&((S=d.value)==null||S.handleScroll(u.value))})}),f.provide(bc,f.reactive({scrollbarElement:l,wrapElement:u})),f.onActivated(()=>{u.value&&(u.value.scrollTop=s,u.value.scrollLeft=c)}),f.onMounted(()=>{i.native||f.nextTick(()=>{E()})}),f.onUpdated(()=>E()),t({wrapRef:u,update:E,scrollTo:w,setScrollTop:C,setScrollLeft:x,handleScroll:g}),(S,R)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:f.normalizeClass(f.unref(r).b())},[f.createElementVNode("div",{ref_key:"wrapRef",ref:u,class:f.normalizeClass(f.unref(m)),style:f.normalizeStyle(f.unref(h)),tabindex:S.tabindex,onScroll:g},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:p,class:f.normalizeClass(f.unref(y)),style:f.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:f.withCtx(()=>[f.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?f.createCommentVNode("v-if",!0):(f.openBlock(),f.createBlock(a0,{key:0,ref_key:"barRef",ref:d,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var p0=_c(u0,[["__file","scrollbar.vue"]]);const ef=JE(p0),Ko=Symbol("wf-bus"),f0={class:"wrapper"},d0={class:"content"},h0=["textContent"],m0=f.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(e){const t=e,n=f.ref("1"),i=f.ref(),r=f.ref();function o(){var l;if(!((l=t.data)!=null&&l.code))return;const s=n.value,c={code:t.data.code,type:s};yt.getBpmnDetail(c).then(u=>{u.code===0&&(s==="1"?i.value="data:image/png;base64,"+u.result:r.value=u.result)})}function a(){o()}return f.onMounted(()=>{o()}),(s,c)=>{const l=U.RadioButton,u=U.RadioGroup,p=U.Image;return f.openBlock(),f.createElementBlock("div",f0,[f.createVNode(u,{value:f.unref(n),"onUpdate:value":c[0]||(c[0]=d=>f.isRef(n)?n.value=d:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:f.withCtx(()=>[f.createVNode(l,{value:"1"},{default:f.withCtx(()=>c[1]||(c[1]=[f.createTextVNode("png")])),_:1}),f.createVNode(l,{value:"0"},{default:f.withCtx(()=>c[2]||(c[2]=[f.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),f.createElementVNode("div",d0,[f.unref(n)==="1"?(f.openBlock(),f.createBlock(p,{key:0,src:f.unref(i)},null,8,["src"])):(f.openBlock(),f.createElementBlock("span",{key:1,textContent:f.toDisplayString(f.unref(r))},null,8,h0))])])}}}),$n=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},g0=$n(m0,[["__scopeId","data-v-248c7b10"]]),y0={class:"panel-left"},v0={class:"title"},_0={class:"search-box"},b0={key:2,class:"btns-action"},E0=$n(f.defineComponent({__name:"BusTypeList",setup(e){const{t}=Zt.useI18n(),n=f.ref(),i=f.ref([]),r=f.ref([]),o=f.ref([]);function a(){var R;o.value=[],i.value=[],r.value=[],(R=d.value)==null||R.reset(),s()}function s(R){const M={sync:!0};n.value&&Object.assign(M,{description:n.value}),yt.getBusTypeTree(M).then(P=>{var I;if(P.code===0){const O=P.result||[];o.value=O,O.length&&(i.value=[O[0].key],(I=O[0].children)!=null&&I.length&&(r.value=[O[0].children[0].key],h()))}})}const c=f.inject(Ko);function l(R,M){M.selected&&M.node.dataRef.isLeaf&&(r.value=R,h())}const u=f.ref([{title:t("bpmn.version"),dataIndex:"version",width:100},{title:t("bpmn.description"),dataIndex:"description",width:250},{title:t("bpmn.used"),dataIndex:"used",width:130},{title:t("bpmn.status"),dataIndex:"status",width:130},{title:t("bpmn.action"),key:"action",width:200,fixed:"right"}]);function p(R){const M={type:r.value[0]};return Object.assign(M,R),yt.getBpmnList(M)}const d=f.ref(),h=()=>{var R;(R=d.value)==null||R.refresh()},{message:m,modal:y}=et.App.useApp();function g(R,M){y.confirm({title:t("button._006_msg1"),content:t(M==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const P={code:R.code,status:M};yt.switchBpmnStatus(P).then(I=>{I.code===0&&(h(),m.success(t("common.successTip")))})}})}function w(){c.emit("changeComp",{comp:"BpmnEditPage",opType:"1",type:r.value[0]})}function C(R){c.emit("changeComp",{comp:"BpmnEditPage",opType:"2",code:R.code})}function x(R){c.emit("changeComp",{comp:"BpmnEditPage",opType:"3",type:r.value[0],code:R.code})}function E(R){y.confirm({title:t("button._006_msg1"),content:t("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const M={code:R.code};yt.delBpmn(M).then(P=>{P.code===0&&(h(),m.success(t("common.successTip")))})}})}function S(R){y.info({title:t("wo_list.btn_chart"),content:f.h(g0,{data:R}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return f.onMounted(()=>{a(),f.onActivated(()=>{var R;(R=d.value)==null||R.loadData()})}),(R,M)=>{const P=U.InputSearch,I=U.Tree,O=U.Empty,B=ef,L=U.Button,H=U.Space,G=B_,Be=U.Switch,xe=f.resolveComponent("a-table-ex"),pe=f.resolveComponent("wl-splitter"),Ue=f.resolveDirective("permission");return f.openBlock(),f.createBlock(pe,{bordered:!1},{left:f.withCtx(()=>[f.createElementVNode("div",y0,[f.createElementVNode("div",v0,f.toDisplayString(R.$t("bpmn.list_title")),1),f.createElementVNode("div",_0,[f.createVNode(P,{value:f.unref(n),"onUpdate:value":M[0]||(M[0]=be=>f.isRef(n)?n.value=be:null),placeholder:R.$t("bpmn.type_placeholder"),onSearch:a},null,8,["value","placeholder"])]),f.createVNode(B,{class:"tree-wrapper"},{default:f.withCtx(()=>{var be;return[(be=f.unref(o))!=null&&be.length?(f.openBlock(),f.createBlock(I,{key:0,expandedKeys:f.unref(i),"onUpdate:expandedKeys":M[1]||(M[1]=Ee=>f.isRef(i)?i.value=Ee:null),selectedKeys:f.unref(r),"tree-data":f.unref(o),showLine:!0,onSelect:l},null,8,["expandedKeys","selectedKeys","tree-data"])):(f.openBlock(),f.createBlock(O,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:f.withCtx(()=>[f.createVNode(H,{class:"ml-lg my-nm"},{default:f.withCtx(()=>[f.withDirectives((f.openBlock(),f.createBlock(L,{type:"primary",onClick:w},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(R.$t("bpmn.add_workflow")),1)]),_:1})),[[Ue,"002"]])]),_:1}),f.createVNode(xe,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-lg",columns:f.unref(u),scroll:{x:1100},loadData:p},{bodyCell:f.withCtx(({column:be,record:Ee,text:Le})=>[be.dataIndex==="used"?(f.openBlock(),f.createBlock(G,{key:0,type:"BPMN_USED",value:Le},null,8,["value"])):f.createCommentVNode("",!0),be.dataIndex==="status"?(f.openBlock(),f.createBlock(Be,{key:1,checked:Le,checkedValue:"0",unCheckedValue:"1",disabled:!f.unref(Lo.hasPermission)("006"),onChange:j=>g(Ee,j)},null,8,["checked","disabled","onChange"])):f.createCommentVNode("",!0),be.key==="action"?(f.openBlock(),f.createElementBlock("div",b0,[f.withDirectives((f.openBlock(),f.createBlock(L,{type:"link",onClick:j=>C(Ee)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(R.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[Ue,"003"]]),f.withDirectives((f.openBlock(),f.createBlock(L,{type:"link",onClick:j=>E(Ee)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(R.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[Ue,"004"]]),f.withDirectives((f.openBlock(),f.createBlock(L,{type:"link",onClick:j=>S(Ee)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(R.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[Ue,"005"]]),f.withDirectives((f.openBlock(),f.createBlock(L,{type:"link",onClick:j=>x(Ee)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(R.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[Ue,"002"]])])):f.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-7d08e693"]]);function Y(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function x0(e,t){return t={exports:{}},e(t,t.exports),t.exports}var w0=x0(function(e){var t=e.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;for(var a=r-Math.floor(r),s="",o=0;o<Math.floor(r);o++){var c=Math.floor(Math.random()*i).toString(i);s=c+s}if(a){var l=Math.pow(i,a),c=Math.floor(Math.random()*l).toString(i);s=c+s}var u=parseInt(s,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):s};t.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10)if(r)n+=r;else throw new Error("too many ID collisions, use more bits");var l=t(n,i)}while(Object.hasOwnProperty.call(a,l));return a[l]=s,l},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}});function sn(e){if(!(this instanceof sn))return new sn(e);e=e||[128,36,1],this._seed=e.length?w0.rack(e[0],e[1],e[2]):e}sn.prototype.next=function(e){return this._seed(e||!0)},sn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},sn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},sn.prototype.assigned=function(e){return this._seed.get(e)||!1},sn.prototype.unclaim=function(e){delete this._seed.hats[e]},sn.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function xc(e){return Array.prototype.concat.apply([],e)}const kr=Object.prototype.toString,S0=Object.prototype.hasOwnProperty;function yi(e){return e===void 0}function tt(e){return e!==void 0}function Dr(e){return e==null}function oe(e){return kr.call(e)==="[object Array]"}function nt(e){return kr.call(e)==="[object Object]"}function ee(e){return kr.call(e)==="[object Number]"}function Ge(e){const t=kr.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Rt(e){return kr.call(e)==="[object String]"}function C0(e){if(!oe(e))throw new Error("must supply array")}function Et(e,t){return!Dr(e)&&S0.call(e,t)}function _e(e,t){const n=Xo(t);let i;return A(e,function(r,o){if(n(r,o))return i=r,!1}),i}function tf(e,t){const n=Xo(t);let i=oe(e)?-1:void 0;return A(e,function(r,o){if(n(r,o))return i=o,!1}),i}function ce(e,t){const n=Xo(t);let i=[];return A(e,function(r,o){n(r,o)&&i.push(r)}),i}function A(e,t){let n,i;if(yi(e))return;const r=oe(e)?k0:A0;for(let o in e)if(Et(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function R0(e,t){if(yi(e))return[];C0(e);const n=Xo(t);return e.filter(function(i,r){return!n(i,r)})}function Tt(e,t,n){return A(e,function(i,r){n=t(n,i,r)}),n}function vi(e,t){return!!Tt(e,function(n,i,r){return n&&t(i,r)},!0)}function jn(e,t){return!!_e(e,t)}function ct(e,t){let n=[];return A(e,function(i,r){n.push(t(i,r))}),n}function qo(e){return e&&Object.keys(e)||[]}function T0(e){return qo(e).length}function Yo(e){return ct(e,t=>t)}function Wi(e,t,n={}){return t=wc(t),A(e,function(i){let r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function nf(e,...t){e=wc(e);let n={};return A(t,r=>Wi(r,e,n)),ct(n,function(r,o){return r[0]})}const P0=nf;function cn(e,t){t=wc(t);let n=[];return A(e,function(i,r){let o=t(i,r),a={d:o,v:i};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),ct(n,i=>i.v)}function Jt(e){return function(t){return vi(e,function(n,i){return t[i]===n})}}function wc(e){return Ge(e)?e:t=>t[e]}function Xo(e){return Ge(e)?e:t=>t===e}function A0(e){return e}function k0(e){return Number(e)}function rf(e,t){let n,i,r,o;function a(p){let d=Date.now(),h=p?0:o+t-d;if(h>0)return s(h);e.apply(r,i),c()}function s(p){n=setTimeout(a,p)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(){n&&a(!0),c()}function u(...p){o=Date.now(),i=p,r=this,n||s(t)}return u.flush=l,u.cancel=c,u}function xt(e,t){return e.bind(t)}function D(e,...t){return Object.assign(e,...t)}function D0(e,t,n){let i=e;return A(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=i[r];tt(a)&&Dr(s)&&(s=i[r]=isNaN(+a)?{}:[]),yi(a)?yi(n)?delete i[r]:i[r]=n:i=s}),e}function Qt(e,t){let n={},i=Object(e);return A(t,function(r){r in i&&(n[r]=e[r])}),n}function ln(e,t){let n={},i=Object(e);return A(i,function(r,o){t.indexOf(o)===-1&&(n[o]=r)}),n}function M0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in e)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(e)}const N0=Object.prototype.toString,O0=Object.prototype.hasOwnProperty;function I0(e){return e===void 0}function B0(e){return N0.call(e)==="[object Array]"}function L0(e,t){return O0.call(e,t)}function of(e,t){let n,i;if(I0(e))return;const r=B0(e)?j0:$0;for(let o in e)if(L0(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function $0(e){return e}function j0(e){return Number(e)}function lt(e,...t){const n=e.style;return of(t,function(i){i&&of(i,function(r,o){n[o]=r})}),e}function ut(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const F0=Object.prototype.toString;function Oe(e){return new Fn(e)}function Fn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fn.prototype.add=function(e){return this.list.add(e),this},Fn.prototype.remove=function(e){return F0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Fn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Fn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Fn.prototype.array=function(){return Array.from(this.list)},Fn.prototype.has=Fn.prototype.contains=function(e){return this.list.contains(e)};function Zo(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Ui(e,t,n){var i=n?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}var Jo={},Qo,Sc,Cc;function af(){Qo=window.addEventListener?"addEventListener":"attachEvent",Sc=window.removeEventListener?"removeEventListener":"detachEvent",Cc=Qo!=="addEventListener"?"on":""}var H0=Jo.bind=function(e,t,n,i){return Qo||af(),e[Qo](Cc+t,n,i||!1),n},V0=Jo.unbind=function(e,t,n,i){return Sc||af(),e[Sc](Cc+t,n,i||!1),n},ae=M0({__proto__:null,bind:H0,unbind:V0,default:Jo},[Jo]),sf=["focus","blur"];function z0(e,t,n,i,r){return sf.indexOf(n)!==-1&&(r=!0),ae.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Ui(a,t,!0),o.delegateTarget&&i.call(e,o)},r)}function W0(e,t,n,i){return sf.indexOf(t)!==-1&&(i=!0),ae.unbind(e,t,n,i)}var Pt={bind:z0,unbind:W0},U0=G0,cf=!1,ea;typeof document<"u"&&(ea=document.createElement("div"),ea.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',cf=!ea.getElementsByTagName("link").length,ea=void 0);var Ke={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:cf?[1,"X<div>","</div>"]:[0,"",""]};Ke.td=Ke.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ke.option=Ke.optgroup=[1,'<select multiple="multiple">',"</select>"],Ke.thead=Ke.tbody=Ke.colgroup=Ke.caption=Ke.tfoot=[1,"<table>","</table>"],Ke.polyline=Ke.ellipse=Ke.polygon=Ke.circle=Ke.text=Ke.line=Ke.path=Ke.rect=Ke.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function G0(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Ke,i)?Ke[i]:Ke._default,o=r[0],a=r[1],s=r[2],c=t.createElement("div");for(c.innerHTML=a+e+s;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var l=t.createDocumentFragment();c.firstChild;)l.appendChild(c.removeChild(c.firstChild));return l}var Pe=U0;function lf(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function Se(e,t){return t=t||document,t.querySelector(e)}function Rc(e,t){return t=t||document,t.querySelectorAll(e)}function un(e){e.parentNode&&e.parentNode.removeChild(e)}function K0(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function q0(e,t){return t.appendChild(K0(e,t))}function ie(e,t){return q0(t,e),e}var Tc=2,uf={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Tc,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Tc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Y0(e,t){return uf[t]?e.style[t]:e.getAttributeNS(null,t)}function pf(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=uf[i];r?(r===Tc&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function X0(e,t){var n=Object.keys(t),i,r;for(i=0,r;r=n[i];i++)pf(e,r,t[r])}function q(e,t,n){if(typeof t=="string")if(n!==void 0)pf(e,t,n);else return Y0(e,t);else X0(e,t);return e}const Z0=Object.prototype.toString;function me(e){return new Hn(e)}function Hn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Hn.prototype.add=function(e){return this.list.add(e),this},Hn.prototype.remove=function(e){return Z0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Hn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Hn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Hn.prototype.array=function(){return Array.from(this.list)},Hn.prototype.has=Hn.prototype.contains=function(e){return this.list.contains(e)};function ta(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function ff(e){return e.cloneNode(!0)}var Pc={svg:"http://www.w3.org/2000/svg"},df='<svg xmlns="'+Pc.svg+'"';function J0(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Pc.svg)===-1&&(e=df+e.substring(4)):(e=df+">"+e+"</svg>",t=!0);var n=Q0(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Q0(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function X(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=J0(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Pc.svg,e),t&&q(n,t),n}var Ac=null;function hf(){return Ac===null&&(Ac=X("svg")),Ac}function mf(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function ex(e,t,n,i,r,o){var a=hf().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return mf(a,e);case 6:return mf(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function Mr(e){return hf().createSVGTransform()}var gf=/([&<>]{1})/g,tx=/([&<>\n\r"]{1})/g,nx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function kc(e,t){function n(i,r){return nx[r]||r}return e.replace(t,n)}function yf(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(kc(e.textContent,gf));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(r=e.attributes,n=0,i=r.length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',kc(o.value,tx),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,i=a.length;n<i;++n)yf(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",kc(e.nodeValue,gf),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ix(e){for(var t=e.firstChild,n=[];t;)yf(t,n),t=t.nextSibling;return n.join("")}function vf(e,t){return ix(e)}function qe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function rx(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ox(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(rx(e,i))}function Nr(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),ox(n,t)),n.consolidate()}const ax=/^class[ {]/;function sx(e){return ax.test(e.toString())}function Dc(e){return Array.isArray(e)}function Mc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function na(...e){e.length===1&&Dc(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const cx=/constructor\s*[^(]*\(\s*([^)]*)\)/m,lx=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,ux=/\/\*([^*]*)\*\//m;function px(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(sx(e)?cx:lx);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(i=>{const r=i.match(ux);return(r&&r[1]||i).trim()})||[]}function _f(e,t){const n=t||{get:function(x,E){if(i.push(x),E===!1)return null;throw s(`No provider for "${x}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){const E=i.join(" -> ");return i.length=0,new Error(E?`${x} (Resolving: ${E})`:x)};function c(x,E){if(!r[x]&&x.includes(".")){const S=x.split(".");let R=c(S.shift());for(;S.length;)R=R[S.shift()];return R}if(Mc(o,x))return o[x];if(Mc(r,x)){if(i.indexOf(x)!==-1)throw i.push(x),s("Cannot resolve circular dependency!");return i.push(x),o[x]=r[x][0](r[x][1]),i.pop(),o[x]}return n.get(x,E)}function l(x,E){if(typeof E>"u"&&(E={}),typeof x!="function")if(Dc(x))x=na(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);const R=(x.$inject||px(x)).map(M=>Mc(E,M)?E[M]:c(M));return{fn:x,dependencies:R}}function u(x){const{fn:E,dependencies:S}=l(x),R=Function.prototype.bind.call(E,null,...S);return new R}function p(x,E,S){const{fn:R,dependencies:M}=l(x,S);return R.apply(E,M)}function d(x){return na(E=>x.get(E))}function h(x,E){if(E&&E.length){const S=Object.create(null),R=Object.create(null),M=[],P=[],I=[];let O,B,L,H;for(let G in r)O=r[G],E.indexOf(G)!==-1&&(O[2]==="private"?(B=M.indexOf(O[3]),B===-1?(L=O[3].createChild([],E),H=d(L),M.push(O[3]),P.push(L),I.push(H),S[G]=[H,G,"private",L]):S[G]=[I[B],G,"private",P[B]]):S[G]=[O[2],O[1]],R[G]=!0),(O[2]==="factory"||O[2]==="type")&&O[1].$scope&&E.forEach(Be=>{O[1].$scope.indexOf(Be)!==-1&&(S[G]=[O[2],O[1]],R[Be]=!0)});E.forEach(G=>{if(!R[G])throw new Error('No provider for "'+G+'". Cannot use provider from the parent!')}),x.unshift(S)}return new _f(x,a)}const m={factory:p,type:u,value:function(x){return x}};function y(x,E){const S=x.__init__||[];return function(){S.forEach(R=>{typeof R=="string"?E.get(R):E.invoke(R)})}}function g(x){const E=x.__exports__;if(E){const S=x.__modules__,R=Object.keys(x).reduce((B,L)=>(L!=="__exports__"&&L!=="__modules__"&&L!=="__init__"&&L!=="__depends__"&&(B[L]=x[L]),B),Object.create(null)),M=(S||[]).concat(R),P=h(M),I=na(function(B){return P.get(B)});E.forEach(function(B){r[B]=[I,B,"private",P]});const O=(x.__init__||[]).slice();return O.unshift(function(){P.init()}),x=Object.assign({},x,{__init__:O}),y(x,P)}return Object.keys(x).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const R=x[S];if(R[2]==="private"){r[S]=R;return}const M=R[0],P=R[1];r[S]=[m[M],fx(M,P),M]}),y(x,a)}function w(x,E){return x.indexOf(E)!==-1||(x=(E.__depends__||[]).reduce(w,x),x.indexOf(E)!==-1)?x:x.concat(E)}function C(x){const E=x.reduce(w,[]).map(g);let S=!1;return function(){S||(S=!0,E.forEach(R=>R()))}}this.get=c,this.invoke=p,this.instantiate=u,this.createChild=h,this.init=C(e)}function fx(e,t){return e!=="value"&&Dc(t)&&(t=na(t.slice())),t}var dx=1e3;function bn(e,t){var n=this;t=t||dx,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}bn.prototype.canRender=function(e){},bn.prototype.drawShape=function(e,t){},bn.prototype.drawConnection=function(e,t){},bn.prototype.getShapePath=function(e){},bn.prototype.getConnectionPath=function(e){};function _i(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function hx(e){return["M",e.x,e.y]}function Nc(e){return["L",e.x,e.y]}function mx(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function gx(e,t){const n=e.length,i=[hx(e[0])];for(let r=1;r<n;r++){const o=e[r-1],a=e[r],s=e[r+1];if(!s||!t){i.push(Nc(a));continue}const c=Math.min(t,Oc(a.x-o.x,a.y-o.y),Oc(s.x-a.x,s.y-a.y));if(!c){i.push(Nc(a));continue}const l=ia(a,o,c),u=ia(a,o,c*.5),p=ia(a,s,c),d=ia(a,s,c*.5);i.push(Nc(l)),i.push(mx(u,d,p))}return i}function ia(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=Oc(i,r),a=n/o;return{x:e.x+i*a,y:e.y+r*a}}function Oc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ra(e,t,n){ee(t)&&(n=t,t=null),t||(t={});const i=X("path",t);return ee(n)&&(i.dataset.cornerRadius=String(n)),bf(i,e)}function bf(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return q(e,{d:_i(gx(t,n))}),e}function oa(e){return ce(e,function(t){return!_e(e,function(n){return n!==t&&Ef(t,n)})})}function Ef(e,t){if(t){if(e===t)return t;if(e.parent)return Ef(e.parent,t)}}function xf(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function bi(e,t,n){n=n||0,oe(e)||(e=[e]),A(e,function(i,r){var o=t(i,r,n);oe(o)&&o.length&&bi(o,t,n+1)})}function yx(e,t,n){var i=[],r=[];return bi(e,function(o,a,s){xf(i,o,t);var c=o.children;if(c&&xf(r,c,t))return c}),i}function Or(e,t){return yx(e,!t)}function vx(e,t,n){yi(t)&&(t=!0),nt(t)&&(n=t,t=!0),n=n||{};var i=Ir(n.allShapes),r=Ir(n.allConnections),o=Ir(n.enclosedElements),a=Ir(n.enclosedConnections),s=Ir(n.topLevel,t&&Wi(e,function(u){return u.id}));function c(u){s[u.source.id]&&s[u.target.id]&&(s[u.id]=[u]),i[u.source.id]&&i[u.target.id]&&(a[u.id]=o[u.id]=u),r[u.id]=u}function l(u){if(o[u.id]=u,u.waypoints)a[u.id]=r[u.id]=u;else return i[u.id]=u,A(u.incoming,c),A(u.outgoing,c),u.children}return bi(e,l),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Ye(e,t){t=!!t,oe(e)||(e=[e]);var n,i,r,o;return A(e,function(a){var s=a;a.waypoints&&!t&&(s=Ye(a.waypoints,!0));var c=s.x,l=s.y,u=s.height||0,p=s.width||0;(c<n||n===void 0)&&(n=c),(l<i||i===void 0)&&(i=l),(c+p>r||r===void 0)&&(r=c+p),(l+u>o||o===void 0)&&(o=l+u)}),{x:n,y:i,height:o-i,width:r-n}}function wf(e,t){var n={};return A(e,function(i){var r=i;r.waypoints&&(r=Ye(r)),!ee(t.y)&&r.x>t.x&&(n[i.id]=i),!ee(t.x)&&r.y>t.y&&(n[i.id]=i),r.x>t.x&&r.y>t.y&&(ee(t.width)&&ee(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!ee(t.width)||!ee(t.height))&&(n[i.id]=i)}),n}function Sf(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Cf(e){return!!(e&&e.isFrame)}function Ir(e,t){return D({},e||{},t||{})}var _x=1;function Vn(e,t){bn.call(this,e,_x),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Y(Vn,bn),Vn.prototype.canRender=function(){return!0},Vn.prototype.drawShape=function(t,n,i){var r=X("rect");return q(r,{x:0,y:0,width:n.width||0,height:n.height||0}),Cf(n)?q(r,D({},this.FRAME_STYLE,i||{})):q(r,D({},this.SHAPE_STYLE,i||{})),ie(t,r),r},Vn.prototype.drawConnection=function(t,n,i){var r=ra(n.waypoints,D({},this.CONNECTION_STYLE,i||{}));return ie(t,r),r},Vn.prototype.getShapePath=function(t){var n=t.x,i=t.y,r=t.width,o=t.height,a=[["M",n,i],["l",r,0],["l",0,o],["l",-r,0],["z"]];return _i(a)},Vn.prototype.getConnectionPath=function(t){var n=t.waypoints,i,r,o=[];for(i=0;r=n[i];i++)r=r.original||r,o.push([i===0?"M":"L",r.x,r.y]);return _i(o)},Vn.$inject=["eventBus","styles"];function bx(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){var o=this.style(i,r);return D(o,{class:n})},this.style=function(n,i){!oe(n)&&!i&&(i=n,n=[]);var r=Tt(n,function(o,a){return D(o,e[a]||{})},{});return i?D(r,i):r},this.computeStyle=function(n,i,r){return oe(i)||(r=i,i=[]),t.style(i||[],D({},r,n||{}))}}const Ex={__init__:["defaultRenderer"],defaultRenderer:["type",Vn],styles:["type",bx]};function je(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Xe(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n)return;if(n!==-1)e.splice(i,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ic(e,t){return!e||!t?-1:e.indexOf(t)}function Br(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bc(e,t,n,i){if(typeof i>"u"&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Br(e,t);return Math.abs(r/o)<=i}var xx=2;function En(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(wx(r,n))return o;return!1}function wx(e,t){const n=t[0];return vi(t,function(i){return Math.abs(n[e]-i[e])<=xx})}function Rf(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Lc(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Sx=/,?([a-z]),?/gi,Tf=parseFloat,Fe=Math,zn=Fe.PI,pn=Fe.min,fn=Fe.max,Pf=Fe.pow,Wn=Fe.abs,Cx=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Rx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,aa=Array.isArray||function(e){return e instanceof Array};function $c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lr(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)$c(e,n)&&(t[n]=Lr(e[n]));return t}function Tx(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function Px(e){function t(){var n=Array.prototype.slice.call(arguments,0),i=n.join("␀"),r=t.cache=t.cache||{},o=t.count=t.count||[];return $c(r,i)?(Tx(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=e(...arguments),r[i])}return t}function Ax(e){if(!e)return null;var t=Gi(e);if(t.arr)return Lr(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return aa(e)&&aa(e[0])&&(i=Lr(e)),i.length||String(e).replace(Cx,function(r,o,a){var s=[],c=o.toLowerCase();for(a.replace(Rx,function(l,u){u&&s.push(+u)}),c=="m"&&s.length>2&&(i.push([o,...s.splice(0,2)]),c="l",o=o=="m"?"l":"L");s.length>=n[c]&&(i.push([o,...s.splice(0,n[c])]),!!n[c]););}),i.toString=Gi.toString,t.arr=Lr(i),i}function Gi(e){var t=Gi.ps=Gi.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)$c(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function jc(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function Af(){return this.join(",").replace(Sx,"$1")}function sa(e){var t=Lr(e);return t.toString=Af,t}function kf(e,t,n,i,r,o,a,s,c){var l=1-c,u=Pf(l,3),p=Pf(l,2),d=c*c,h=d*c,m=u*e+p*3*c*n+l*3*c*c*r+h*a,y=u*t+p*3*c*i+l*3*c*c*o+h*s;return{x:ca(m),y:ca(y)}}function Df(e){var t=Ox(...e);return jc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Un(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function kx(e,t){return e=jc(e),t=jc(t),Un(t,e.x,e.y)||Un(t,e.x2,e.y)||Un(t,e.x,e.y2)||Un(t,e.x2,e.y2)||Un(e,t.x,t.y)||Un(e,t.x2,t.y)||Un(e,t.x,t.y2)||Un(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Mf(e,t,n,i,r){var o=-3*t+9*n-9*i+3*r,a=e*o+6*t-12*n+6*i;return e*a-3*t+3*n}function Nf(e,t,n,i,r,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var l=c/2,u=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;m<u;m++){var y=l*p[m]+l,g=Mf(y,e,n,r,a),w=Mf(y,t,i,o,s),C=g*g+w*w;h+=d[m]*Fe.sqrt(C)}return l*h}function Dx(e,t,n,i,r,o,a,s){if(!(fn(e,n)<pn(r,a)||pn(e,n)>fn(r,a)||fn(t,i)<pn(o,s)||pn(t,i)>fn(o,s))){var c=(e*i-t*n)*(r-a)-(e-n)*(r*s-o*a),l=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),u=(e-n)*(o-s)-(t-i)*(r-a);if(u){var p=ca(c/u),d=ca(l/u),h=+p.toFixed(2),m=+d.toFixed(2);if(!(h<+pn(e,n).toFixed(2)||h>+fn(e,n).toFixed(2)||h<+pn(r,a).toFixed(2)||h>+fn(r,a).toFixed(2)||m<+pn(t,i).toFixed(2)||m>+fn(t,i).toFixed(2)||m<+pn(o,s).toFixed(2)||m>+fn(o,s).toFixed(2)))return{x:p,y:d}}}}function ca(e){return Math.round(e*1e11)/1e11}function Mx(e,t,n){var i=Df(e),r=Df(t);if(!kx(i,r))return[];for(var o=Nf(...e),a=Nf(...t),s=If(e)?1:~~(o/5)||1,c=If(t)?1:~~(a/5)||1,l=[],u=[],p={},d=[],h=0;h<s+1;h++){var m=kf(...e,h/s);l.push({x:m.x,y:m.y,t:h/s})}for(h=0;h<c+1;h++)m=kf(...t,h/c),u.push({x:m.x,y:m.y,t:h/c});for(h=0;h<s;h++)for(var y=0;y<c;y++){var g=l[h],w=l[h+1],C=u[y],x=u[y+1],E=Wn(w.x-g.x)<.01?"y":"x",S=Wn(x.x-C.x)<.01?"y":"x",R=Dx(g.x,g.y,w.x,w.y,C.x,C.y,x.x,x.y),M;if(R){if(M=R.x.toFixed(9)+"#"+R.y.toFixed(9),p[M])continue;p[M]=!0;var P=g.t+Wn((R[E]-g[E])/(w[E]-g[E]))*(w.t-g.t),I=C.t+Wn((R[S]-C[S])/(x[S]-C[S]))*(x.t-C.t);P>=0&&P<=1&&I>=0&&I<=1&&d.push({x:R.x,y:R.y,t1:P,t2:I})}}return d}function Of(e,t,n){e=$f(e),t=$f(t);for(var i,r,o,a,s,c,l,u,p,d,h=n?0:[],m=0,y=e.length;m<y;m++){var g=e[m];if(g[0]=="M")i=s=g[1],r=c=g[2];else{g[0]=="C"?(p=[i,r,...g.slice(1)],i=p[6],r=p[7]):(p=[i,r,i,r,s,c,s,c],i=s,r=c);for(var w=0,C=t.length;w<C;w++){var x=t[w];if(x[0]=="M")o=l=x[1],a=u=x[2];else{x[0]=="C"?(d=[o,a,...x.slice(1)],o=d[6],a=d[7]):(d=[o,a,o,a,l,u,l,u],o=l,a=u);var E=Mx(p,d);{for(var S=0,R=E.length;S<R;S++)E[S].segment1=m,E[S].segment2=w,E[S].bez1=p,E[S].bez2=d;h=h.concat(E)}}}}}return h}function Nx(e){var t=Gi(e);if(t.abs)return sa(t.abs);if((!aa(e)||!aa(e&&e[0]))&&(e=Ax(e)),!e||!e.length)return[["M",0,0]];var n=[],i=0,r=0,o=0,a=0,s=0,c;e[0][0]=="M"&&(i=+e[0][1],r=+e[0][2],o=i,a=r,s++,n[0]=["M",i,r]);for(var l,u,p=s,d=e.length;p<d;p++){if(n.push(l=[]),u=e[p],c=u[0],c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case"A":l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5],l[6]=+u[6]+i,l[7]=+u[7]+r;break;case"V":l[1]=+u[1]+r;break;case"H":l[1]=+u[1]+i;break;case"M":o=+u[1]+i,a=+u[2]+r;default:for(var h=1,m=u.length;h<m;h++)l[h]=+u[h]+(h%2?i:r)}else for(var y=0,g=u.length;y<g;y++)l[y]=u[y];switch(c=c.toUpperCase(),l[0]){case"Z":i=+o,r=+a;break;case"H":i=l[1];break;case"V":r=l[1];break;case"M":o=l[l.length-2],a=l[l.length-1];default:i=l[l.length-2],r=l[l.length-1]}}return n.toString=Af,t.abs=sa(n),n}function If(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function la(e,t,n,i){return[e,t,n,i,n,i]}function Bf(e,t,n,i,r,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function Lf(e,t,n,i,r,o,a,s,c,l){var u=zn*120/180,p=zn/180*(+r||0),d=[],h,m=Px(function(T,_,v){var k=T*Fe.cos(v)-_*Fe.sin(v),N=T*Fe.sin(v)+_*Fe.cos(v);return{x:k,y:N}});if(l)M=l[0],P=l[1],S=l[2],R=l[3];else{h=m(e,t,-p),e=h.x,t=h.y,h=m(s,c,-p),s=h.x,c=h.y;var y=(e-s)/2,g=(t-c)/2,w=y*y/(n*n)+g*g/(i*i);w>1&&(w=Fe.sqrt(w),n=w*n,i=w*i);var C=n*n,x=i*i,E=(o==a?-1:1)*Fe.sqrt(Wn((C*x-C*g*g-x*y*y)/(C*g*g+x*y*y))),S=E*n*g/i+(e+s)/2,R=E*-i*y/n+(t+c)/2,M=Fe.asin(((t-R)/i).toFixed(9)),P=Fe.asin(((c-R)/i).toFixed(9));M=e<S?zn-M:M,P=s<S?zn-P:P,M<0&&(M=zn*2+M),P<0&&(P=zn*2+P),a&&M>P&&(M=M-zn*2),!a&&P>M&&(P=P-zn*2)}var I=P-M;if(Wn(I)>u){var O=P,B=s,L=c;P=M+u*(a&&P>M?1:-1),s=S+n*Fe.cos(P),c=R+i*Fe.sin(P),d=Lf(s,c,n,i,r,0,a,B,L,[P,O,S,R])}I=P-M;var H=Fe.cos(M),G=Fe.sin(M),Be=Fe.cos(P),xe=Fe.sin(P),pe=Fe.tan(I/4),Ue=4/3*n*pe,be=4/3*i*pe,Ee=[e,t],Le=[e+Ue*G,t-be*H],j=[s+Ue*xe,c-be*Be],z=[s,c];if(Le[0]=2*Ee[0]-Le[0],Le[1]=2*Ee[1]-Le[1],l)return[Le,j,z].concat(d);d=[Le,j,z].concat(d).join().split(",");for(var Z=[],he=0,Ct=d.length;he<Ct;he++)Z[he]=he%2?m(d[he-1],d[he],p).y:m(d[he],d[he+1],p).x;return Z}function Ox(e,t,n,i,r,o,a,s){for(var c=[],l=[[],[]],u,p,d,h,m,y,g,w,C=0;C<2;++C){if(C==0?(p=6*e-12*n+6*r,u=-3*e+9*n-9*r+3*a,d=3*n-3*e):(p=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*s,d=3*i-3*t),Wn(u)<1e-12){if(Wn(p)<1e-12)continue;h=-d/p,0<h&&h<1&&c.push(h);continue}g=p*p-4*d*u,w=Fe.sqrt(g),!(g<0)&&(m=(-p+w)/(2*u),0<m&&m<1&&c.push(m),y=(-p-w)/(2*u),0<y&&y<1&&c.push(y))}for(var x=c.length,E=x,S;x--;)h=c[x],S=1-h,l[0][x]=S*S*S*e+3*S*S*h*n+3*S*h*h*r+h*h*h*a,l[1][x]=S*S*S*t+3*S*S*h*i+3*S*h*h*o+h*h*h*s;return l[0][E]=e,l[1][E]=t,l[0][E+1]=a,l[1][E+1]=s,l[0].length=l[1].length=E+2,{x0:pn(...l[0]),y0:pn(...l[1]),x1:fn(...l[0]),y1:fn(...l[1])}}function $f(e){var t=Gi(e);if(t.curve)return sa(t.curve);for(var n=Nx(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(h,m,y){var g,w;if(!h)return["C",m.x,m.y,m.x,m.y,m.x,m.y];switch(!(h[0]in{T:1,Q:1})&&(m.qx=m.qy=null),h[0]){case"M":m.X=h[1],m.Y=h[2];break;case"A":h=["C",...Lf(m.x,m.y,...h.slice(1))];break;case"S":y=="C"||y=="S"?(g=m.x*2-m.bx,w=m.y*2-m.by):(g=m.x,w=m.y),h=["C",g,w,...h.slice(1)];break;case"T":y=="Q"||y=="T"?(m.qx=m.x*2-m.qx,m.qy=m.y*2-m.qy):(m.qx=m.x,m.qy=m.y),h=["C",...Bf(m.x,m.y,m.qx,m.qy,h[1],h[2])];break;case"Q":m.qx=h[1],m.qy=h[2],h=["C",...Bf(m.x,m.y,h[1],h[2],h[3],h[4])];break;case"L":h=["C",...la(m.x,m.y,h[1],h[2])];break;case"H":h=["C",...la(m.x,m.y,h[1],m.y)];break;case"V":h=["C",...la(m.x,m.y,m.x,h[1])];break;case"Z":h=["C",...la(m.x,m.y,m.X,m.Y)];break}return h},o=function(h,m){if(h[m].length>7){h[m].shift();for(var y=h[m];y.length;)a[m]="A",h.splice(m++,0,["C",...y.splice(0,6)]);h.splice(m,1),u=n.length}},a=[],s="",c="",l=0,u=n.length;l<u;l++){n[l]&&(s=n[l][0]),s!="C"&&(a[l]=s,l&&(c=a[l-1])),n[l]=r(n[l],i,c),a[l]!="A"&&s=="C"&&(a[l]="C"),o(n,l);var p=n[l],d=p.length;i.x=p[d-2],i.y=p[d-1],i.bx=Tf(p[d-4])||i.x,i.by=Tf(p[d-3])||i.y}return t.curve=sa(n),n}function Ce(e){return nt(e)&&Et(e,"waypoints")}function ge(e){return nt(e)&&Et(e,"labelTarget")}function jf(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function xn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Q(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function ua(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Ix(e){return xn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Bx(e){for(var t=e.waypoints,n=t.reduce(function(l,u,p){var d=t[p-1];if(d){var h=l[l.length-1],m=h&&h.endLength||0,y=jx(d,u);l.push({start:d,end:u,startLength:m,endLength:m+y,length:y})}return l},[]),i=n.reduce(function(l,u){return l+u.length},0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function te(e){return Ce(e)?Bx(e):Ix(e)}function pt(e,t,n){n=n||0,nt(n)||(n={x:n,y:n});var i=Q(e),r=Q(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,l=o?"top":s?"bottom":null,u=c?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Fc(e,t,n){var i=Lx(e,t);return i.length===1||i.length===2&&Br(i[0],i[1])<1?xn(i[0]):i.length>1?(i=cn(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),xn(i[n?0:i.length-1])):null}function Lx(e,t){return Of(e,t)}function $x(e){e=e.slice();for(var t=0,n,i,r;e[t];)n=e[t],i=e[t-1],r=e[t+1],Br(n,r)===0||Bc(i,r,n)?e.splice(t,1):t++;return e}function jx(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pa(e,t){return Math.round(e*t)/t}function Ff(e){return ee(e)?e+"px":e}function Fx(e){for(;e.parent;)e=e.parent;return e}function Hx(e){e=D({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),lt(n,{position:"relative",overflow:"hidden",width:Ff(e.width),height:Ff(e.height)}),t.appendChild(n),n}function Hf(e,t,n){const i=X("g");me(i).add(t);const r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Vx="base",Vf=0,zx=1,Wx={shape:["x","y","width","height"],connection:["waypoints"]};function ne(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}ne.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ne.prototype._init=function(e){const t=this._eventBus,n=this._container=Hx(e),i=this._svg=X("svg");q(i,{width:"100%",height:"100%"}),ut(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),ie(n,i);const r=this._viewport=Hf(i,"viewport");e.deferUpdate&&(this._viewboxChanged=rf(xt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:r})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ne.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ne.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},ne.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=Sf(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ne.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},ne.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},ne.prototype.isFocused=function(){return this._focused},ne.prototype.getDefaultLayer=function(){return this.getLayer(Vx,Vf)},ne.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ne.prototype._getChildIndex=function(e){return Tt(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},ne.prototype._createLayer=function(e,t){typeof t>"u"&&(t=zx);const n=this._getChildIndex(t);return{group:Hf(this._viewport,"layer-"+e,n),index:t,visible:!0}},ne.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ne.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(qe(n),t.visible=!1),n},ne.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],qe(t.group))},ne.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ne.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Fx(e))||{}).rootElement:void 0},ne.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ne.prototype._findPlaneForRoot=function(e){return _e(this._planes,function(t){return t.rootElement===e})},ne.prototype.getContainer=function(){return this._container},ne.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(A([i.gfx,i.secondaryGfx],function(r){r&&(n?(e.markers.add(t),me(r).add(t)):(e.markers.delete(t),me(r).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ne.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ne.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ne.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},ne.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ne.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ne.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,Vf);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ne.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},ne.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ne.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},ne.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ne.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ne.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=Wx[e];if(!vi(n,function(r){return typeof t[r]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},ne.prototype._setParent=function(e,t,n){Xe(t.children,e,n),e.parent=t},ne.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ne.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ne.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ne.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e),!!e)return r.fire(t+".remove",{element:e}),i.remove(e),je(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ne.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ne.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ne.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ne.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ne.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ne.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,l;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const u=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nr(t,u)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Nr(t),r=a?a.matrix:ex(),s=pa(r.a,1e3),c=pa(-r.e||0,1e3),l=pa(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n},e;return e},ne.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=D({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),zf(t,n)}),{x:n.e,y:n.f}},ne.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Ye(e),o=Q(r),a=this.viewbox(),s=this.zoom();let c,l;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const u=Q(a);if(!(r.width<a.width&&r.height<a.height))c=r.x-a.x,l=r.y-a.y;else{const d=Math.max(0,o.right-u.right),h=Math.min(0,o.left-u.left),m=Math.max(0,o.bottom-u.bottom),y=Math.min(0,o.top-u.top);c=d||h,l=m||y}this.scroll({dx:-c*s,dy:-l*s})},ne.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,i;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),pa(i.a,1e3)};function zf(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ne.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ne.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,l,u;c=i.getCTM();const p=c.a;return t?(a=D(o,t),s=a.matrixTransform(c.inverse()),l=r.translate(s.x,s.y).scale(1/p*e).translate(-s.x,-s.y),u=c.multiply(l)):u=r.scale(e),zf(this._viewport,u),u},ne.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ne.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:i,y:r,width:o,height:a}},ne.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ki="data-element-id";function Nt(e){this._elements={},this._eventBus=e}Nt.$inject=["eventBus"],Nt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),q(t,Ki,i),n&&q(n,Ki,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Nt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(q(i.gfx,Ki,""),i.secondaryGfx&&q(i.secondaryGfx,Ki,""),delete t[n])},Nt.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Nt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&q(t,Ki,i),t},Nt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&q(e,Ki);var n=this._elements[t];return n&&n.element},Nt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Nt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=n[i],o=t[r],a=o.element,s=o.gfx;if(e(a,s))return a}},Nt.prototype.getAll=function(){return this.filter(function(e){return e})},Nt.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Nt.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Nt.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function Ux(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,r,i)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a>"u"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Gx(e){return e.__refs_collection===!0}function Kx(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Wf(e,t,n){var i=Ux(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function qx(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(o){if(o!==r){var a=r;r=null,a&&e.unset(a,i,n),r=o,e.set(r,i,n)}}})}function Lt(e,t){if(!(this instanceof Lt))return new Lt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Lt.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Wf(this,t,e):qx(this,t,e)},Lt.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Gx(n)||Wf(this,t,e),n},Lt.prototype.ensureBound=function(e,t){Kx(e,t)||this.bind(e,t)},Lt.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Lt.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Hc=new Lt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Uf=new Lt({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Gf=new Lt({name:"attachers",collection:!0},{name:"host"}),Kf=new Lt({name:"outgoing",collection:!0},{name:"source"}),qf=new Lt({name:"incoming",collection:!0},{name:"target"});function qi(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Hc.bind(this,"parent"),Uf.bind(this,"labels"),Kf.bind(this,"outgoing"),qf.bind(this,"incoming")}function $r(){qi.call(this),Hc.bind(this,"children"),Gf.bind(this,"host"),Gf.bind(this,"attachers")}Y($r,qi);function Yf(){qi.call(this),Hc.bind(this,"children")}Y(Yf,$r);function Xf(){$r.call(this),Uf.bind(this,"labelTarget")}Y(Xf,$r);function Zf(){qi.call(this),Kf.bind(this,"source"),qf.bind(this,"target")}Y(Zf,qi);var Yx={connection:Zf,shape:$r,label:Xf,root:Yf};function Xx(e,t){var n=Yx[e];if(!n)throw new Error("unknown type: <"+e+">");return D(new n,t)}function Zx(e){return e instanceof qi}function wn(){this._uid=12}wn.prototype.createRoot=function(e){return this.create("root",e)},wn.prototype.createLabel=function(e){return this.create("label",e)},wn.prototype.createShape=function(e){return this.create("shape",e)},wn.prototype.createConnection=function(e){return this.create("connection",e)},wn.prototype.create=function(e,t){return t=D({},t||{}),t.id||(t.id=e+"_"+this._uid++),Xx(e,t)};var fa="__fn",Jf=1e3,Jx=Array.prototype.slice;function At(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}At.prototype.on=function(e,t,n,i){if(e=oe(e)?e:[e],Ge(t)&&(i=n,n=t,t=Jf),!ee(t))throw new Error("priority must be a number");var r=n;i&&(r=xt(n,i),r[fa]=n[fa]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},At.prototype.once=function(e,t,n,i){var r=this;if(Ge(t)&&(i=n,n=t,t=Jf),!ee(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[fa]=n,this.on(e,t,o)},At.prototype.off=function(e,t){e=oe(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},At.prototype.createEvent=function(e){var t=new jr;return t.init(e),t},At.prototype.fire=function(e,t){var n,i,r,o;if(o=Jx.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof jr?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},At.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},At.prototype._destroy=function(){this._listeners={}},At.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},At.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=Qx(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},At.prototype._addListener=function(e,t){var n=this._getListeners(e),i;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,i?i.next=t:this._setListeners(e,t);return}i=n,n=n.next}i.next=t},At.prototype._getListeners=function(e){return this._listeners[e]},At.prototype._setListeners=function(e,t){this._listeners[e]=t},At.prototype._removeListener=function(e,t){var n=this._getListeners(e),i,r,o;if(!t){this._setListeners(e,null);return}for(;n;)i=n.next,o=n.callback,(o===t||o[fa]===t)&&(r?r.next=i:this._setListeners(e,i)),r=n,n=i};function jr(){}jr.prototype.stopPropagation=function(){this.cancelBubble=!0},jr.prototype.preventDefault=function(){this.defaultPrevented=!0},jr.prototype.init=function(e){D(this,e||{})};function Qx(e,t){return e.apply(null,t)}function Ei(e){return e.childNodes[0]}function ew(e){return e.parentNode.childNodes[1]}function da(e,t,n,i,r){var o=Mr();o.setTranslate(t,n);var a=Mr();a.setRotate(i||0,0,0);var s=Mr();s.setScale(1,1),Nr(e,[o,a,s])}function at(e,t,n){var i=Mr();i.setTranslate(t,n),Nr(e,i)}function Qf(e,t){var n=Mr();n.setRotate(t,0,0),Nr(e,n)}function Ot(e,t){this._eventBus=e,this._elementRegistry=t}Ot.$inject=["eventBus","elementRegistry"],Ot.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=ew(t),n||(n=X("g"),me(n).add("djs-children"),ie(t.parentNode,n))):n=t,n},Ot.prototype._clear=function(e){var t=Ei(e);return Zo(t),t},Ot.prototype._createContainer=function(e,t,n,i){var r=X("g");me(r).add("djs-group"),typeof n<"u"?ed(r,t,t.childNodes[n]):ie(t,r);var o=X("g");me(o).add("djs-element"),me(o).add("djs-"+e),i&&me(o).add("djs-frame"),ie(r,o);var a=X("g");return me(a).add("djs-visual"),ie(o,a),o},Ot.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Cf(t))},Ot.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,i;i=Tt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),A(i,function(r){var o=r.children;if(o){var a=t._getChildrenContainer(r);A(o.slice().reverse(),function(s){var c=n.getGraphics(s);ed(c.parentNode,a)})}})},Ot.prototype.drawShape=function(e,t,n={}){var i=this._eventBus;return i.fire("render.shape",{gfx:e,element:t,attrs:n})},Ot.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Ot.prototype.drawConnection=function(e,t,n={}){var i=this._eventBus;return i.fire("render.connection",{gfx:e,element:t,attrs:n})},Ot.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Ot.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),at(n,t.x,t.y);else if(e==="connection")this.drawConnection(i,t);else throw new Error("unknown type: "+e);t.hidden?q(n,"display","none"):q(n,"display","block")}},Ot.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);qe(t.parentNode)};function ed(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}const tw={__depends__:[Ex],__init__:["canvas"],canvas:["type",ne],elementRegistry:["type",Nt],elementFactory:["type",wn],eventBus:["type",At],graphicsFactory:["type",Ot]};function nw(e){var t=new _f(e);return t.init(),t}function iw(e){e=e||{};var t={config:["value",e]},n=[t,tw].concat(e.modules||[]);return nw(n)}function Gn(e,t){this._injector=t||iw(e),this.get("eventBus").fire("diagram.init")}Gn.prototype.get=function(e,t){return this._injector.get(e,t)},Gn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Gn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Gn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function Vc(){}Vc.prototype.get=function(e){return this.$model.properties.get(this,e)},Vc.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function td(e,t){this.model=e,this.properties=t}td.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Vc.prototype);A(e.properties,function(a){!a.isMany&&a.default!==void 0&&(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),A(a,xt(function(s,c){this.set(c,s)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var rw={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},nd={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function zc(e,t){var n=nd[e];return n?n(t):t}function Wc(e){return!!rw[e]}function id(e){return!!nd[e]}function ft(e,t){var n=e.split(/:/),i,r;if(n.length===1)i=e,r=t;else if(n.length===2)i=n[1],r=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(r?r+":":"")+i,{name:e,prefix:r,localName:i}}function It(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}It.prototype.build=function(){return Qt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},It.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},It.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},It.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=ft(r[0],i),a=ft(r[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines},It.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},It.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},It.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},It.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},It.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},It.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},It.prototype.hasProperty=function(e){return this.propertiesByName[e]},It.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(A(e.properties,xt(function(o){o=D({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)};function Kn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,A(e,xt(this.registerPackage,this))}Kn.prototype.getPackage=function(e){return this.packageMap[e]},Kn.prototype.getPackages=function(){return this.packages},Kn.prototype.registerPackage=function(e){e=D({},e);var t=this.packageMap;rd(t,e,"prefix"),rd(t,e,"uri"),A(e.types,xt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Kn.prototype.registerType=function(e,t){e=D({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:D(e.meta||{})});var n=ft(e.name,t.prefix),i=n.name,r={};A(e.properties,xt(function(o){var a=ft(o.name,n.prefix),s=a.name;Wc(o.type)||(o.type=ft(o.type,a.prefix).name),D(o,{ns:a,name:s}),r[s]=o},this)),D(e,{ns:n,name:i,propertiesByName:r}),A(e.extends,xt(function(o){var a=ft(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Kn.prototype.mapTypes=function(e,t,n){var i=Wc(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c,l){var u=ft(c,Wc(c)?"":e.prefix);r.mapTypes(u,t,l)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+e.name+">");A(i.superClass,n?a:s),t(i,!n),A(i.traits,a)},Kn.prototype.getEffectiveDescriptor=function(e){var t=ft(e),n=new It(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Kn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function rd(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function xi(e){this.model=e}xi.prototype.set=function(e,t,n){if(!Rt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;ow(n)?i?delete e[r]:delete e.$attrs[Uc(t)]:i?r in e?e[r]=n:od(e,i,n):e.$attrs[Uc(t)]=n},xi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Uc(t)];var i=n.name;return!e[i]&&n.isMany&&od(e,n,[]),e[i]},xi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=D({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},xi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},xi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},xi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw o;typeof console<"u"&&console.warn(o)}return null};function ow(e){return typeof e>"u"}function od(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Uc(e){return e.replace(/^:/,"")}function $t(e,t={}){this.properties=new xi(this),this.factory=new td(this,this.properties),this.registry=new Kn(e,this.properties),this.typeCache={},this.config=t}$t.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},$t.prototype.getType=function(e){var t=this.typeCache,n=Rt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},$t.prototype.createAny=function(e,t,n){var i=ft(e),r={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){D0(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),A(n,function(a,s){nt(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},$t.prototype.getPackage=function(e){return this.registry.getPackage(e)},$t.prototype.getPackages=function(){return this.registry.getPackages()},$t.prototype.getElementDescriptor=function(e){return e.$descriptor},$t.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},$t.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},$t.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ad=String.fromCharCode,aw=Object.prototype.hasOwnProperty,sw=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Fr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Fr).forEach(function(e){Fr[e.toUpperCase()]=Fr[e]});function cw(e,t,n,i){return i?aw.call(Fr,i)?Fr[i]:"&"+i+";":ad(t||parseInt(n,16))}function wi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(sw,cw):e}var sd="non-whitespace outside of root node";function Yi(e){return new Error(e)}function cd(e){return"missing namespace for prefix <"+e+">"}function ha(e){return{get:e,enumerable:!0}}function lw(e){var t={},n;for(n in e)t[n]=e[n];return t}function Gc(e){return e+"$uri"}function uw(e){var t={},n,i;for(n in e)i=e[n],t[i]=i,t[Gc(i)]=n;return t}function ld(){return{line:0,column:0}}function pw(e){throw e}function ud(e){if(!this)return new ud(e);var t=e&&e.proxy,n,i,r,o,a=pw,s,c,l,u,p=ld,d=!1,h=!1,m=null,y=!1,g;function w(E){E instanceof Error||(E=Yi(E)),m=E,a(E,p)}function C(E){s&&(E instanceof Error||(E=Yi(E)),s(E,p))}this.on=function(E,S){if(typeof S!="function")throw Yi("required args <name, cb>");switch(E){case"openTag":i=S;break;case"text":n=S;break;case"closeTag":r=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":u=S;break;case"question":l=S;break;case"comment":c=S;break;default:throw Yi("unsupported event: "+E)}return this},this.ns=function(E){if(typeof E>"u"&&(E={}),typeof E!="object")throw Yi("required args <nsMap={}>");var S={},R;for(R in E)S[R]=E[R];return h=!0,g=S,this},this.parse=function(E){if(typeof E!="string")throw Yi("required args <xml=string>");return m=null,x(E),p=ld,y=!1,m},this.stop=function(){y=!0};function x(E){var S=h?[]:null,R=h?uw(g):null,M,P=[],I=0,O=!1,B=!1,L=0,H=0,G,Be,xe,pe,Ue,be,Ee,Le,j,z="",Z=0,he;function Ct(){if(he!==null)return he;var _,v,k,N=h&&R.xmlns,$=h&&d?[]:null,W=Z,J=z,de=J.length,Je,$e,ot,Xt,Te,Bn={},Qs={},Bt,se,we;e:for(;W<de;W++)if(Bt=!1,se=J.charCodeAt(W),!(se===32||se<14&&se>8)){for((se<65||se>122||se>90&&se<97)&&se!==95&&se!==58&&(C("illegal first char attribute name"),Bt=!0),we=W+1;we<de;we++)if(se=J.charCodeAt(we),!(se>96&&se<123||se>64&&se<91||se>47&&se<59||se===46||se===45||se===95)){if(se===32||se<14&&se>8){C("missing attribute value"),W=we;continue e}if(se===61)break;C("illegal attribute name char"),Bt=!0}if(Te=J.substring(W,we),Te==="xmlns:xmlns"&&(C("illegal declaration of xmlns"),Bt=!0),se=J.charCodeAt(we+1),se===34)we=J.indexOf('"',W=we+2),we===-1&&(we=J.indexOf("'",W),we!==-1&&(C("attribute value quote missmatch"),Bt=!0));else if(se===39)we=J.indexOf("'",W=we+2),we===-1&&(we=J.indexOf('"',W),we!==-1&&(C("attribute value quote missmatch"),Bt=!0));else for(C("missing attribute value quotes"),Bt=!0,we=we+1;we<de&&(se=J.charCodeAt(we+1),!(se===32||se<14&&se>8));we++);for(we===-1&&(C("missing closing quotes"),we=de,Bt=!0),Bt||(ot=J.substring(W,we)),W=we;we+1<de&&(se=J.charCodeAt(we+1),!(se===32||se<14&&se>8));we++)W===we&&(C("illegal character after attribute end"),Bt=!0);if(W=we+1,Bt)continue e;if(Te in Qs){C("attribute <"+Te+"> already defined");continue}if(Qs[Te]=!0,!h){Bn[Te]=ot;continue}if(d){if($e=Te==="xmlns"?"xmlns":Te.charCodeAt(0)===120&&Te.substr(0,6)==="xmlns:"?Te.substr(6):null,$e!==null){if(_=wi(ot),v=Gc($e),Xt=g[_],!Xt){if($e==="xmlns"||v in R&&R[v]!==_)do Xt="ns"+I++;while(typeof R[Xt]<"u");else Xt=$e;g[_]=Xt}R[$e]!==Xt&&(Je||(R=lw(R),Je=!0),R[$e]=Xt,$e==="xmlns"&&(R[Gc(Xt)]=_,N=Xt),R[v]=_),Bn[Te]=ot;continue}$.push(Te,ot);continue}if(se=Te.indexOf(":"),se===-1){Bn[Te]=ot;continue}if(!(k=R[Te.substring(0,se)])){C(cd(Te.substring(0,se)));continue}Te=N===k?Te.substr(se+1):k+Te.substr(se),Bn[Te]=ot}if(d)for(W=0,de=$.length;W<de;W++){if(Te=$[W++],ot=$[W],se=Te.indexOf(":"),se!==-1){if(!(k=R[Te.substring(0,se)])){C(cd(Te.substring(0,se)));continue}Te=N===k?Te.substr(se+1):k+Te.substr(se)}Bn[Te]=ot}return he=Bn}function T(){for(var _=/(\r\n|\r|\n)/g,v=0,k=0,N=0,$=H,W,J;L>=N&&(W=_.exec(E),!(!W||($=W[0].length+W.index,$>L)));)v+=1,N=$;return L==-1?(k=$,J=E.substring(H)):H===0?J=E.substring(H,L):(k=L-N,J=H==-1?E.substring(L):E.substring(L,H+1)),{data:J,line:v,column:k}}for(p=T,t&&(j=Object.create({},{name:ha(function(){return Ee}),originalName:ha(function(){return Le}),attrs:ha(Ct),ns:ha(function(){return R})}));H!==-1;){if(E.charCodeAt(H)===60?L=H:L=E.indexOf("<",H),L===-1){if(P.length)return w("unexpected end of file");if(H===0)return w("missing start tag");H<E.length&&E.substring(H).trim()&&C(sd);return}if(H!==L){if(P.length){if(n&&(n(E.substring(H,L),wi,p),y))return}else if(E.substring(H,L).trim()&&(C(sd),y))return}if(pe=E.charCodeAt(L+1),pe===33){if(xe=E.charCodeAt(L+2),xe===91&&E.substr(L+3,6)==="CDATA["){if(H=E.indexOf("]]>",L),H===-1)return w("unclosed cdata");if(o&&(o(E.substring(L+9,H),p),y))return;H+=3;continue}if(xe===45&&E.charCodeAt(L+3)===45){if(H=E.indexOf("-->",L),H===-1)return w("unclosed comment");if(c&&(c(E.substring(L+4,H),wi,p),y))return;H+=3;continue}}if(pe===63){if(H=E.indexOf("?>",L),H===-1)return w("unclosed question");if(l&&(l(E.substring(L,H+2),p),y))return;H+=2;continue}for(G=L+1;;G++){if(Ue=E.charCodeAt(G),isNaN(Ue))return H=-1,w("unclosed tag");if(Ue===34)xe=E.indexOf('"',G+1),G=xe!==-1?xe:G;else if(Ue===39)xe=E.indexOf("'",G+1),G=xe!==-1?xe:G;else if(Ue===62){H=G;break}}if(pe===33){if(u&&(u(E.substring(L,H+1),wi,p),y))return;H+=1;continue}if(he={},pe===47){if(O=!1,B=!0,!P.length)return w("missing open tag");if(G=Ee=P.pop(),xe=L+2+G.length,E.substring(L+2,xe)!==G)return w("closing tag mismatch");for(;xe<H;xe++)if(pe=E.charCodeAt(xe),!(pe===32||pe>8&&pe<14))return w("close tag")}else{if(E.charCodeAt(H-1)===47?(G=Ee=E.substring(L+1,H-1),O=!0,B=!0):(G=Ee=E.substring(L+1,H),O=!0,B=!1),!(pe>96&&pe<123||pe>64&&pe<91||pe===95||pe===58))return w("illegal first char nodeName");for(xe=1,Be=G.length;xe<Be;xe++)if(pe=G.charCodeAt(xe),!(pe>96&&pe<123||pe>64&&pe<91||pe>47&&pe<59||pe===45||pe===95||pe==46)){if(pe===32||pe<14&&pe>8){Ee=G.substring(0,xe),he=null;break}return w("invalid nodeName")}B||P.push(Ee)}if(h){if(M=R,O&&(B||S.push(M),he===null&&(d=G.indexOf("xmlns",xe)!==-1)&&(Z=xe,z=G,Ct(),d=!1)),Le=Ee,pe=Ee.indexOf(":"),pe!==-1){if(be=R[Ee.substring(0,pe)],!be)return w("missing namespace on <"+Le+">");Ee=Ee.substr(pe+1)}else be=R.xmlns;be&&(Ee=be+":"+Ee)}if(O&&(Z=xe,z=G,i&&(t?i(j,wi,B,p):i(Ee,Ct,wi,B,p),y)))return;if(B){if(r&&(r(t?j:Ee,wi,O,p),y))return;h&&(O?R=M:R=S.pop())}H+=1}}}function pd(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Kc={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},fd="property";function dd(e){return e.xml&&e.xml.serialize}function fw(e){const t=dd(e);return t!==fd&&(t||null)}function dw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hd(e,t){return pd(t)?e.prefix+":"+dw(e.localName):e.name}function hw(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&i.indexOf(r)===0?e.prefix+":"+i.slice(r.length):n}function mw(e,t,n){const i=ft(e,t.xmlns),r=`${t[i.prefix]||i.prefix}:${i.localName}`,o=ft(r);var a=n.getPackage(o.prefix);return hw(o,a)}function qn(e){return new Error(e)}function Sn(e){return e.$descriptor}function gw(e){D(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw qn("expected element");var n=this.elementsById,i=Sn(t),r=i.idProperty,o;if(r&&(o=t.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw qn("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Hr(){}Hr.prototype.handleEnd=function(){},Hr.prototype.handleText=function(){},Hr.prototype.handleNode=function(){};function qc(){}qc.prototype=Object.create(Hr.prototype),qc.prototype.handleNode=function(){return this};function Xi(){}Xi.prototype=Object.create(Hr.prototype),Xi.prototype.handleText=function(e){this.body=(this.body||"")+e};function Vr(e,t){this.property=e,this.context=t}Vr.prototype=Object.create(Xi.prototype),Vr.prototype.handleNode=function(e){if(this.element)throw qn("expected no sub nodes");return this.element=this.createReference(e),this},Vr.prototype.handleEnd=function(){this.element.id=this.body},Vr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Yc(e,t){this.element=t,this.propertyDesc=e}Yc.prototype=Object.create(Xi.prototype),Yc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=zc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function ma(){}ma.prototype=Object.create(Xi.prototype),ma.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function vt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}vt.prototype=Object.create(ma.prototype),vt.prototype.addReference=function(e){this.context.addReference(e)},vt.prototype.handleText=function(e){var t=this.element,n=Sn(t),i=n.bodyProperty;if(!i)throw qn("unexpected body text <"+e+">");Xi.prototype.handleText.call(this,e)},vt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Sn(t),i=n.bodyProperty;i&&e!==void 0&&(e=zc(i.type,e),t.set(i.name,e))},vt.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=Sn(n),r=this.context,o=new n({}),a=this.model,s;return A(t,function(c,l){var u=i.propertiesByName[l],p;u&&u.isReference?u.isMany?(p=c.split(" "),A(p,function(d){r.addReference({element:o,property:u.ns.name,id:d})})):r.addReference({element:o,property:u.ns.name,id:c}):(u?c=zc(u.type,c):l==="xmlns"?l=":"+l:(s=ft(l,i.ns.prefix),a.getPackage(s.prefix)&&r.addWarning({message:"unknown attribute <"+l+">",element:o,property:l,value:c})),o.set(l,c))}),o},vt.prototype.getPropertyForNode=function(e){var t=e.name,n=ft(t),i=this.type,r=this.model,o=Sn(i),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){const l=fw(s);if(l){const u=e.attributes[l];if(u){const p=mw(u,e.ns,r),d=r.getType(p);return D({},s,{effectiveType:Sn(d).name})}}return s}var c=r.getPackage(n.prefix);if(c){const l=hd(n,c),u=r.getType(l);if(s=_e(o.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&u.hasType(p.type)}),s)return D({},s,{effectiveType:Sn(u).name})}else if(s=_e(o.properties,function(l){return!l.isReference&&!l.isAttribute&&l.type==="Element"}),s)return s;throw qn("unrecognized element <"+n.name+">")},vt.prototype.toString=function(){return"ElementDescriptor["+Sn(this.type).name+"]"},vt.prototype.valueHandler=function(e,t){return new Yc(e,t)},vt.prototype.referenceHandler=function(e){return new Vr(e,this.context)},vt.prototype.handler=function(e){return e==="Element"?new Zi(this.model,e,this.context):new vt(this.model,e,this.context)},vt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,id(n))return this.valueHandler(t,i);t.isReference?r=this.referenceHandler(t).handleNode(e):r=this.handler(n).handleNode(e);var o=r.element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(D(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function Xc(e,t,n){vt.call(this,e,t,n)}Xc.prototype=Object.create(vt.prototype),Xc.prototype.createElement=function(e){var t=e.name,n=ft(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&hd(n,o)||t;if(!r.hasType(a))throw qn("unexpected element <"+e.originalName+">");return vt.prototype.createElement.call(this,e)};function Zi(e,t,n){this.model=e,this.context=n}Zi.prototype=Object.create(ma.prototype),Zi.prototype.createElement=function(e){var t=e.name,n=ft(t),i=n.prefix,r=e.ns[i+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},Zi.prototype.handleChild=function(e){var t=new Zi(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element,r;return i!==void 0&&(r=n.$children=n.$children||[],r.push(i),i.$parent=n),t},Zi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Zc(e){e instanceof $t&&(e={model:e}),D(this,{lax:!1},e)}Zc.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof vt?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new gw(D({},t,{rootHandler:i})),s=new ud({proxy:!0}),c=yw();i.context=a,c.push(i);function l(S,R,M){var P=R(),I=P.line,O=P.column,B=P.data;B.charAt(0)==="<"&&B.indexOf(" ")!==-1&&(B=B.slice(0,B.indexOf(" "))+">");var L="unparsable content "+(B?B+" ":"")+`detected
6
+ line: `+I+`
7
+ column: `+O+`
8
+ nested error: `+S.message;if(M)return a.addWarning({message:L,error:S}),!0;throw qn(L)}function u(S,R){return l(S,R,!0)}function p(){var S=a.elementsById,R=a.references,M,P;for(M=0;P=R[M];M++){var I=P.element,O=S[P.id],B=Sn(I).propertiesByName[P.property];if(O||a.addWarning({message:"unresolved reference <"+P.id+">",element:P.element,property:P.property,value:P.id}),B.isMany){var L=I.get(B.name),H=L.indexOf(P);H===-1&&(H=L.length),O?L[H]=O:L.splice(H,1)}else I.set(B.name,O)}}function d(){c.pop().handleEnd()}var h=/^<\?xml /i,m=/ encoding="([^"]+)"/i,y=/^utf-8$/i;function g(S){if(h.test(S)){var R=m.exec(S),M=R&&R[1];!M||y.test(M)||a.addWarning({message:"unsupported document encoding <"+M+">, falling back to UTF-8"})}}function w(S,R){var M=c.peek();try{c.push(M.handleNode(S))}catch(P){l(P,R,o)&&c.push(new qc)}}function C(S,R){try{c.peek().handleText(S)}catch(M){u(M,R)}}function x(S,R){S.trim()&&C(S,R)}var E=r.getPackages().reduce(function(S,R){return S[R.uri]=R.prefix,S},Object.entries(Kc).reduce(function(S,[R,M]){return S[M]=R,S},r.config&&r.config.nsMap||{}));return s.ns(E).on("openTag",function(S,R,M,P){var I=S.attrs||{},O=Object.keys(I).reduce(function(L,H){var G=R(I[H]);return L[H]=G,L},{}),B={name:S.name,originalName:S.originalName,attributes:O,ns:S.ns};w(B,P)}).on("question",g).on("closeTag",d).on("cdata",C).on("text",function(S,R,M){x(R(S),M)}).on("error",l).on("warn",u),new Promise(function(S,R){var M;try{s.parse(e),p()}catch(L){M=L}var P=i.element;!M&&!P&&(M=qn("failed to parse document as <"+i.type.$descriptor.name+">"));var I=a.warnings,O=a.references,B=a.elementsById;return M?(M.warnings=I,R(M)):S({rootElement:P,elementsById:B,references:O,warnings:I})})},Zc.prototype.handler=function(e){return new Xc(this.model,e)};function yw(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var vw=`<?xml version="1.0" encoding="UTF-8"?>
9
+ `,_w=/<|>|'|"|&|\n\r|\n/g,md=/<|>|&/g;function dn(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}dn.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},dn.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},dn.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},dn.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},dn.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},dn.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},dn.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri},dn.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},dn.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var i=this.getNSKey(n);return this.used[i]})};function bw(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Ew(e,t){return pd(t)?bw(e):e}function gd(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function yd(e){return Rt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function xw(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function ww(e,t){return t.isGeneric?D({localName:t.ns.localName},e):D({localName:Ew(t.ns.localName,t.$pkg)},e)}function Sw(e,t){return D({localName:t.ns.localName},e)}function Cw(e){var t=e.$descriptor;return ce(t.properties,function(n){var i=n.name;if(n.isVirtual||!Et(e,i))return!1;var r=e[i];return r===n.default||r===null?!1:n.isMany?r.length:!0})}var Rw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Tw={"<":"lt",">":"gt","&":"amp"};function vd(e,t,n){return e=Rt(e)?e:""+e,e.replace(t,function(i){return"&"+n[i]+";"})}function Pw(e){return vd(e,_w,Rw)}function Aw(e){return vd(e,md,Tw)}function kw(e){return ce(e,function(t){return t.isAttr})}function Dw(e){return ce(e,function(t){return!t.isAttr})}function Jc(e){this.tagName=e}Jc.prototype.build=function(e){return this.element=e,this},Jc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Si(){}Si.prototype.serializeValue=Si.prototype.serializeTo=function(e){e.append(this.escape?Aw(this.value):this.value)},Si.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(md)!==-1&&(this.escape=!0),this};function Qc(e){this.tagName=e}gd(Qc,Si),Qc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function Ae(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}Ae.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i,r,o=t.isGeneric;return o?i=this.parseGenericNsAttributes(e):i=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(r=Cw(e),this.parseAttributes(kw(r)),this.parseContainments(Dw(r))),this.parseGenericAttributes(e,i),this},Ae.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return ww(t,e)},Ae.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Sw(t,e)},Ae.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ae.prototype.nsAttributeName=function(e){var t;if(Rt(e)?t=ft(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:D({localName:t.localName},n)},Ae.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))},Ae.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Si().build({type:"String"},t));var n=e.$children;n&&A(n,i=>{this.body.push(new Ae(this).build(i))})},Ae.prototype.parseNsAttribute=function(e,t,n){var i=e.$model,r=ft(t),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:n}),!r.prefix&&r.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},Ae.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return A(n,function(r,o){var a=t.parseNsAttribute(e,o,r);a&&i.push(a)}),i},Ae.prototype.parseGenericAttributes=function(e,t){var n=this;A(t,function(i){try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){typeof console<"u"&&console.warn(`missing namespace information for <${i.name}=${i.value}> on`,e,r)}})},Ae.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;A(e,function(r){var o=i.get(r.name),a=r.isReference,s=r.isMany;if(s||(o=[o]),r.isBody)n.push(new Si().build(r,o[0]));else if(id(r.type))A(o,function(l){n.push(new Qc(t.addTagName(t.nsPropertyTagName(r))).build(r,l))});else if(a)A(o,function(l){n.push(new Jc(t.addTagName(t.nsPropertyTagName(r))).build(l))});else{var c=dd(r);A(o,function(l){var u;c?c===fd?u=new Ae(t,r):u=new ga(t,r,c):u=new Ae(t),n.push(u.build(l))})}})},Ae.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,i;return t||(i=n&&n.getNamespaces(),e||!i?this.namespaces=t=new dn(i):t=i),t},Ae.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix,a=i.byUri(r);return(!a||n)&&i.add(e,t),i.mapPrefix(o,r),e},Ae.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),i=e.prefix,r=e.uri,o,a,s;if(!i&&!r)return{localName:e.localName};if(s=n.defaultUriByPrefix(i),r=r||s||n.uriByPrefix(i),!r)throw new Error("no namespace uri given for prefix <"+i+">");if(e=n.byUri(r),!e&&!i&&(e=this.logNamespace({uri:r},s===r,!0)),!e){for(o=i,a=1;n.uriByPrefix(o);)o=i+"_"+a++;e=this.logNamespace({prefix:o,uri:r},s===r)}return i&&n.mapPrefix(i,r),e},Ae.prototype.parseAttributes=function(e){var t=this,n=this.element;A(e,function(i){var r=n.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];A(r,function(a){o.push(a.id)}),r=o.join(" ")}t.addAttribute(t.nsAttributeName(i),r)})},Ae.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),yd(e)},Ae.prototype.addAttribute=function(e,t){var n=this.attrs;Rt(t)&&(t=Pw(t));var i=tf(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Ae.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=xw(n).concat(t)),A(t,function(i){e.append(" ").append(yd(i.name)).append('="').append(i.value).append('"')})},Ae.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Si;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),A(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function ga(e,t,n){Ae.call(this,e,t),this.serialization=n}gd(ga,Ae),ga.prototype.parseNsAttributes=function(e){var t=Ae.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ga.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Mw(){this.value="",this.write=function(e){this.value+=e}}function Nw(e,t){var n=[""];this.append=function(i){return e.write(i),this},this.appendNewLine=function(){return t&&e.write(`
10
+ `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Ow(e){e=D({format:!1,preamble:!0},e||{});function t(n,i){var r=i||new Mw,o=new Nw(r,e.format);e.preamble&&o.append(vw);var a=new Ae,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(Iw(s)),a.build(n).serializeTo(o),!i)return r.value}return{toXML:t}}function Iw(e){const t=e.config&&e.config.nsMap||{},n={};for(const i in Kc)n[i]=Kc[i];for(const i in t){const r=t[i];n[r]=i}for(const i of e.getPackages())n[i.prefix]=i.uri;return n}function ya(e,t){$t.call(this,e,t)}ya.prototype=Object.create($t.prototype),ya.prototype.fromXML=function(e,t,n){Rt(t)||(n=t,t="bpmn:Definitions");var i=new Zc(D({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ya.prototype.toXML=function(e,t){var n=new Ow(t);return new Promise(function(i,r){try{var o=n.toXML(e);return i({xml:o})}catch(a){return r(a)}})};var Bw="BPMN20",Lw="http://www.omg.org/spec/BPMN/20100524/MODEL",$w="bpmn",jw=[],Fw=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],Hw=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],Vw={tagAlias:"lowerCase",typePrefix:"t"},zw={name:Bw,uri:Lw,prefix:$w,associations:jw,types:Fw,enumerations:Hw,xml:Vw},Ww="BPMNDI",Uw="http://www.omg.org/spec/BPMN/20100524/DI",Gw="bpmndi",Kw=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],qw=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],Yw=[],Xw={name:Ww,uri:Uw,prefix:Gw,types:Kw,enumerations:qw,associations:Yw},Zw="DC",Jw="http://www.omg.org/spec/DD/20100524/DC",Qw="dc",e1=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],t1=[],n1={name:Zw,uri:Jw,prefix:Qw,types:e1,associations:t1},i1="DI",r1="http://www.omg.org/spec/DD/20100524/DI",o1="di",a1=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],s1=[],c1={tagAlias:"lowerCase"},l1={name:i1,uri:r1,prefix:o1,types:a1,associations:s1,xml:c1},u1="bpmn.io colors for BPMN",p1="http://bpmn.io/schema/bpmn/biocolor/1.0",f1="bioc",d1=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],h1=[],m1=[],g1={name:u1,uri:p1,prefix:f1,types:d1,enumerations:h1,associations:m1},y1="BPMN in Color",v1="http://www.omg.org/spec/BPMN/non-normative/color/1.0",_1="color",b1=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],E1=[],x1=[],w1={name:y1,uri:v1,prefix:_1,types:b1,enumerations:E1,associations:x1};const S1={bpmn:zw,bpmndi:Xw,dc:n1,di:l1,bioc:g1,color:w1};function C1(e,t){const n=D({},S1,e);return new ya(n,t)}function dt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var R1="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function _d(e){Et(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(R1)}})}function wt(e,t){return e.$instanceOf(t)}function T1(e){return _e(e.rootElements,function(t){return wt(t,"bpmn:Process")||wt(t,"bpmn:Collaboration")})}function P1(e){var t={},n=[],i={};function r(j,z){return function(Z){j(Z,z)}}function o(j){t[j.id]=j}function a(j){return t[j.id]}function s(j,z){var Z=j.gfx;if(Z)throw new Error(`already rendered ${dt(j)}`);return e.element(j,i[j.id],z)}function c(j,z){return e.root(j,i[j.id],z)}function l(j,z){try{var Z=i[j.id]&&s(j,z);return o(j),Z}catch(he){u(he.message,{element:j,error:he}),console.error(`failed to import ${dt(j)}`,he)}}function u(j,z){e.error(j,z)}var p=this.registerDi=function(z){var Z=z.bpmnElement;Z?i[Z.id]?u(`multiple DI elements defined for ${dt(Z)}`,{element:Z}):(i[Z.id]=z,_d(Z)):u(`no bpmnElement referenced in ${dt(z)}`,{element:z})};function d(j){h(j.plane)}function h(j){p(j),A(j.planeElement,m)}function m(j){p(j)}this.handleDefinitions=function(z,Z){var he=z.diagrams;if(Z&&he.indexOf(Z)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!Z&&he&&he.length&&(Z=he[0]),!Z)throw new Error("no diagram to display");i={},d(Z);var Ct=Z.plane;if(!Ct)throw new Error(`no plane for ${dt(Z)}`);var T=Ct.bpmnElement;if(!T)if(T=T1(z),T)u(`correcting missing bpmnElement on ${dt(Ct)} to ${dt(T)}`),Ct.bpmnElement=T,p(Ct);else throw new Error("no process or collaboration to display");var _=c(T,Ct);if(wt(T,"bpmn:Process")||wt(T,"bpmn:SubProcess"))g(T,_);else if(wt(T,"bpmn:Collaboration"))Ee(T,_),w(z.rootElements,_);else throw new Error(`unsupported bpmnElement for ${dt(Ct)}: ${dt(T)}`);y(n)};var y=this.handleDeferred=function(){for(var z;n.length;)z=n.shift(),z()};function g(j,z){pe(j,z),I(j.ioSpecification,z),P(j.artifacts,z),o(j)}function w(j,z){var Z=ce(j,function(he){return!a(he)&&wt(he,"bpmn:Process")&&he.laneSets});Z.forEach(r(g,z))}function C(j,z){l(j,z)}function x(j,z){A(j,r(C,z))}function E(j,z){l(j,z)}function S(j,z){l(j,z)}function R(j,z){l(j,z)}function M(j,z){l(j,z)}function P(j,z){A(j,function(Z){wt(Z,"bpmn:Association")?n.push(function(){M(Z,z)}):M(Z,z)})}function I(j,z){j&&(A(j.dataInputs,r(S,z)),A(j.dataOutputs,r(R,z)))}var O=this.handleSubProcess=function(z,Z){pe(z,Z),P(z.artifacts,Z)};function B(j,z){var Z=l(j,z);wt(j,"bpmn:SubProcess")&&O(j,Z||z),wt(j,"bpmn:Activity")&&I(j.ioSpecification,z),n.push(function(){A(j.dataInputAssociations,r(E,z)),A(j.dataOutputAssociations,r(E,z))})}function L(j,z){l(j,z)}function H(j,z){l(j,z)}function G(j,z){n.push(function(){var Z=l(j,z);j.childLaneSet&&Be(j.childLaneSet,Z||z),Le(j)})}function Be(j,z){A(j.lanes,r(G,z))}function xe(j,z){A(j,r(Be,z))}function pe(j,z){Ue(j.flowElements,z),j.laneSets&&xe(j.laneSets,z)}function Ue(j,z){A(j,function(Z){wt(Z,"bpmn:SequenceFlow")?n.push(function(){L(Z,z)}):wt(Z,"bpmn:BoundaryEvent")?n.unshift(function(){B(Z,z)}):wt(Z,"bpmn:FlowNode")?B(Z,z):wt(Z,"bpmn:DataObject")||(wt(Z,"bpmn:DataStoreReference")||wt(Z,"bpmn:DataObjectReference")?H(Z,z):u(`unrecognized flowElement ${dt(Z)} in context ${dt(z&&z.businessObject)}`,{element:Z,context:z}))})}function be(j,z){var Z=l(j,z),he=j.processRef;he&&g(he,Z||z)}function Ee(j,z){A(j.participants,r(be,z)),P(j.artifacts,z),n.push(function(){x(j.messageFlows,z)})}function Le(j){A(j.flowNodeRef,function(z){var Z=z.get("lanes");Z&&Z.push(j)})}}function b(e,t){var n=V(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function le(e,t){return jn(t,function(n){return b(e,n)})}function V(e){return e&&e.businessObject||e}function ye(e){return e&&e.di}function A1(e,t,n){var i,r,o,a,s=[];function c(l,u){var p={root:function(y,g){return i.add(y,g)},element:function(y,g,w){return i.add(y,g,w)},error:function(y,g){s.push({message:y,context:g})}},d=new P1(p);u=u||l.diagrams&&l.diagrams[0];var h=k1(l,u);if(!h)throw new Error("no diagram to display");A(h,function(y){d.handleDefinitions(l,y)});var m=u.plane.bpmnElement.id;o.setRootElement(o.findRoot(m+"_plane")||o.findRoot(m))}return new Promise(function(l,u){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),c(t,n),r.fire("import.render.complete",{error:a,warnings:s}),l({warnings:s})}catch(p){return p.warnings=s,u(p)}})}function k1(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,i=n;!b(n,"bpmn:Process")&&!b(n,"bpmn:Collaboration")&&(i=D1(n));var r;b(i,"bpmn:Collaboration")?r=i:r=_e(e.rootElements,function(l){if(b(l,"bpmn:Collaboration"))return _e(l.participants,function(u){return u.processRef===i})});var o=[i];r&&(o=ct(r.participants,function(l){return l.processRef}),o.push(r));var a=bd(o),s=[t],c=[n];return A(e.diagrams,function(l){if(l.plane){var u=l.plane.bpmnElement;a.indexOf(u)!==-1&&c.indexOf(u)===-1&&(s.push(l),c.push(u))}}),s}}function bd(e){var t=[];return A(e,function(n){n&&(t.push(n),t=t.concat(bd(n.flowElements)))}),t}function D1(e){for(var t=e;t;){if(b(t,"bpmn:Process"))return t;t=t.$parent}}var M1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Ed=M1,xd={verticalAlign:"middle"},wd={color:"#404040"},N1={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},O1={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},I1={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},B1='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Ed+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',hn;function L1(){hn=Pe(B1),lt(hn,N1),lt(Se("svg",hn),xd),lt(Se(".backdrop",hn),O1),lt(Se(".notice",hn),I1),lt(Se(".link",hn),wd,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function $1(){hn||(L1(),Pt.bind(hn,".backdrop","click",function(e){document.body.removeChild(hn)})),document.body.appendChild(hn)}function ke(e){e=D({},F1,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),V1(this._container)}Y(ke,Gn),ke.prototype.importXML=async function(t,n){const i=this;function r(a){return i.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(d){throw this._emit("import.parse.complete",{error:d}),d}let s=a.rootElement;const c=a.references,l=a.warnings,u=a.elementsById;o=o.concat(l),s=this._emit("import.parse.complete",r({error:null,definitions:s,elementsById:u,references:c,warnings:o}))||s;const p=await this.importDefinitions(s,n);return o=o.concat(p.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),va(s,o),s=j1(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}},ke.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},ke.prototype.open=async function(t){const n=this._definitions;let i=t;if(!n){const o=new Error("no XML imported");throw va(o,[]),o}if(typeof t=="string"&&(i=H1(n,t),!i)){const o=new Error("BPMNDiagram <"+t+"> not found");throw va(o,[]),o}try{this.clear()}catch(o){throw va(o,[]),o}const{warnings:r}=await A1(this,n,i);return{warnings:r}},ke.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,i,r;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,r=(await this._moddle.toXML(n,t)).xml,r=this._emit("saveXML.serialized",{xml:r})||r}catch(a){i=a}const o=i?{error:i}:{xml:r};if(this._emit("saveXML.done",o),i)throw i;return o},ke.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const i=this.get("canvas"),r=i.getActiveLayer(),o=Se(":scope > defs",i._svg),a=vf(r),s=o?"<defs>"+vf(o)+"</defs>":"",c=r.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
11
11
  <!-- created with bpmn-js / http://bpmn.io -->
12
12
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
13
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+s+a+"</svg>"}catch(i){n=i}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},Ae.prototype._setDefinitions=function(e){this._definitions=e},Ae.prototype.getModules=function(){return this._modules},Ae.prototype.clear=function(){this.getDefinitions()&&Un.prototype.clear.call(this)},Ae.prototype.destroy=function(){Un.prototype.destroy.call(this),un(this._container)},Ae.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Ae.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Ae.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=xe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Ae.prototype.getDefinitions=function(){return this._definitions},Ae.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Ae.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,i,r),s=D(ln(n,["additionalModules"]),{canvas:D({},n.canvas,{container:e}),modules:a});Un.call(this,s),n&&n.container&&this.attachTo(n.container)},Ae.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Ae.prototype._createContainer=function(e){const t=Te('<div class="bjs-container"></div>');return lt(t,{width:Sd(e.width),height:Sd(e.height),position:e.position}),t},Ae.prototype._createModdle=function(e){const t=D({},this._moddleExtensions,e.moddleExtensions);return new R1(t)},Ae.prototype._modules=[];function ya(e,t){return e.warnings=t,e}function F1(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const H1={width:"100%",height:"100%",position:"relative"};function Sd(e){return e+(ee(e)?"px":"")}function V1(e,t){return t&&_e(e.diagrams,function(n){return n.id===t})||null}function z1(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Ed+"</a>",i=Te(n);lt(xe("svg",i),xd),lt(i,wd,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(i),ae.bind(i,"click",function(r){j1(),r.preventDefault()})}function zr(e){Ae.call(this,e),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)}Y(zr,Ae),zr.prototype._createModdle=function(e){var t=Ae.prototype._createModdle.call(this,e);return t.ids=new sn([32,36,1]),t},zr.prototype._collectIds=function(e,t){var n=e.$model,i=n.ids,r;i.clear();for(r in t)i.claim(r,t[r])};function fe(e,t){return b(e,"bpmn:CallActivity")?!1:b(e,"bpmn:SubProcess")?(t=t||ve(e),t&&b(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):b(e,"bpmn:Participant")?!!H(e).processRef:!0}function Ze(e){if(!(!b(e,"bpmn:Participant")&&!b(e,"bpmn:Lane"))){var t=ve(e).isHorizontal;return t===void 0?!0:t}}function W1(e){return e&&H(e).isInterrupting!==!1}function ht(e){return e&&!!H(e).triggeredByEvent}function Ji(e,t){var n=H(e).eventDefinitions;return $n(n,function(i){return b(i,t)})}function U1(e){return Ji(e,"bpmn:ErrorEventDefinition")}function G1(e){return Ji(e,"bpmn:EscalationEventDefinition")}function K1(e){return Ji(e,"bpmn:CompensateEventDefinition")}var Wr={width:90,height:20},Cd=15;function Ci(e){return b(e,"bpmn:Event")||b(e,"bpmn:Gateway")||b(e,"bpmn:DataStoreReference")||b(e,"bpmn:DataObjectReference")||b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput")||b(e,"bpmn:SequenceFlow")||b(e,"bpmn:MessageFlow")||b(e,"bpmn:Group")}function _a(e){return ge(e.label)}function q1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Y1(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=Cd:a+=Cd,{x:a,y:s}}function Y1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function el(e){return e.waypoints?q1(e.waypoints):b(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Wr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Wr.height/2}}function X1(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Wr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=el(t),i=Wr),D({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Rd(e){if(b(e,"bpmn:FlowElement")||b(e,"bpmn:Participant")||b(e,"bpmn:Lane")||b(e,"bpmn:SequenceFlow")||b(e,"bpmn:MessageFlow")||b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput"))return"name";if(b(e,"bpmn:TextAnnotation"))return"text";if(b(e,"bpmn:Group"))return"categoryValueRef"}function Z1(e){var t=e.categoryValueRef;return t&&t.value||""}function Qt(e){var t=e.businessObject,n=Rd(t);if(n)return n==="categoryValueRef"?Z1(t):t[n]||""}function J1(e,t){var n=e.businessObject,i=Rd(n);if(i)if(i==="categoryValueRef"){if(!n[i])return e;n[i].value=t}else n[i]=t;return e}var tl="hsl(225, 10%, 15%)",Q1="white";function mn(e,t){return $n(e.eventDefinitions,function(n){return n.$type===t})}function eS(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function tS(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function ue(e,t,n){var i=ve(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||Q1}function U(e,t,n){var i=ve(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||tl}function Ur(e,t,n,i){var r=ve(e),o=r.get("label");return i||o&&o.get("color:color")||t||U(e,n)}function nS(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2,r=[["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return _i(r)}function iS(e,t){var n=e.x,i=e.y,r=e.width,o=e.height,a=[["M",n+t,i],["l",r-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-10,t],["l",t*2-r,0],["a",t,t,0,0,1,-10,-10],["l",0,t*2-o],["a",t,t,0,0,1,t,-10],["z"]];return _i(a)}function rS(e){var t=e.width,n=e.height,i=e.x,r=e.y,o=t/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return _i(s)}function oS(e){var t=e.x,n=e.y,i=e.width,r=e.height,o=[["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return _i(o)}function Gr(e,t={}){return{width:jt(e,t),height:kt(e,t)}}function jt(e,t={}){return bt(t,"width")?t.width:e.width}function kt(e,t={}){return bt(t,"height")?t.height:e.height}var aS=new sn,sS=10,ba=3,cS=1.5,Ea=10,Qi=.95,lS=1,uS=.25;function Ri(e,t,n,i,r,o,a){bn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function u(T){return n.computeStyle(T,{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2,fill:"white"})}function p(T){return n.computeStyle(T,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2})}function f(T,_){var{ref:y={x:0,y:0},scale:k=1,element:M,parentGfx:$=r._svg}=_,W=X("marker",{id:T,viewBox:"0 0 20 20",refX:y.x,refY:y.y,markerWidth:20*k,markerHeight:20*k,orient:"auto"});ie(W,M);var J=xe(":scope > defs",$);J||(J=X("defs"),ie($,J)),ie(J,W)}function d(T,_,y,k){var M=aS.nextPrefixed("marker-");return m(T,M,_,y,k),"url(#"+M+")"}function m(T,_,y,k,M){if(y==="sequenceflow-end"){var $=X("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:M,stroke:M,strokeWidth:1})});f(_,{element:$,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(y==="messageflow-start"){var W=X("circle",{cx:6,cy:6,r:3.5,...u({fill:k,stroke:M,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:W,ref:{x:6,y:6},parentGfx:T})}if(y==="messageflow-end"){var J=X("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:k,stroke:M,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:J,ref:{x:8.5,y:5},parentGfx:T})}if(y==="association-start"){var de=X("path",{d:"M 11 5 L 1 10 L 11 15",...p({fill:"none",stroke:M,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:de,ref:{x:1,y:10},scale:.5,parentGfx:T})}if(y==="association-end"){var Xe=X("path",{d:"M 1 5 L 11 10 L 1 15",...p({fill:"none",stroke:M,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:Xe,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(y==="conditional-flow-marker"){var Be=X("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:k,stroke:M})});f(_,{element:Be,ref:{x:-1,y:10},scale:.5,parentGfx:T})}if(y==="conditional-default-flow-marker"){var rt=X("path",{d:"M 6 4 L 10 16",...u({stroke:M,fill:"none"})});f(_,{element:rt,ref:{x:0,y:10},scale:.5,parentGfx:T})}}function v(T,_,y,k,M={}){tt(k)&&(M=k,k=0),k=k||0,M=u(M);var $=_/2,W=y/2,J=X("circle",{cx:$,cy:W,r:Math.round((_+y)/4-k),...M});return ie(T,J),J}function g(T,_,y,k,M,$){tt(M)&&($=M,M=0),M=M||0,$=u($);var W=X("rect",{x:M,y:M,width:_-M*2,height:y-M*2,rx:k,ry:k,...$});return ie(T,W),W}function w(T,_,y,k){var M=_/2,$=y/2,W=[{x:M,y:0},{x:_,y:$},{x:M,y},{x:0,y:$}],J=W.map(function(Xe){return Xe.x+","+Xe.y}).join(" ");k=u(k);var de=X("polygon",{...k,points:J});return ie(T,de),de}function C(T,_,y,k){y=p(y);var M=ra(_,y,k);return ie(T,M),M}function x(T,_,y){return C(T,_,y,5)}function E(T,_,y){y=p(y);var k=X("path",{...y,d:_});return ie(T,k),k}function S(T,_,y,k){return E(_,y,D({"data-marker":T},k))}function R(T){return St[T]}function N(T){return function(_,y,k){return R(T)(_,y,k)}}var P={"bpmn:MessageEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.235,my:.315}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill),W=k?ue(_,s,y.fill):U(_,c,y.stroke),J=E(T,M,{fill:$,stroke:W,strokeWidth:1});return J},"bpmn:TimerEventDefinition":function(T,_,y={}){var k=y.width||_.width,M=y.height||_.height,$=y.width?1:2,W=v(T,k,M,.2*M,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:$}),J=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:M,position:{mx:.5,my:.5}});E(T,J,{stroke:U(_,c,y.stroke),strokeWidth:$});for(var de=0;de<12;de++){var Xe=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:M,position:{mx:.5,my:.5}}),Be=k/2,rt=M/2;E(T,Xe,{strokeWidth:1,stroke:U(_,c,y.stroke),transform:"rotate("+de*30+","+rt+","+Be+")"})}return W},"bpmn:EscalationEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(T,_,y={}){var k=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.222}});return E(T,k,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.2,my:.722}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),$=k?U(_,c,y.stroke):"none",W=E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1});return Qf(W,45),W},"bpmn:CompensateEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.22,my:.5}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{strokeWidth:1,fill:$,stroke:U(_,c,y.stroke)})},"bpmn:MultipleEventDefinition":function(T,_,y={},k){var M=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.211,my:.36}}),$=k?U(_,c,y.stroke):ue(_,s,y.fill);return E(T,M,{fill:$,stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(T,_,y={}){var k=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.458,my:.194}});return E(T,k,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(T,_,y={}){var k=v(T,_.width,_.height,8,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:4});return k}};function O(T,_,y={},k){var M=H(T),$=eS(M),W=k||T;return M.get("eventDefinitions")&&M.get("eventDefinitions").length>1?M.get("parallelMultiple")?P["bpmn:ParallelMultipleEventDefinition"](_,W,y,$):P["bpmn:MultipleEventDefinition"](_,W,y,$):mn(M,"bpmn:MessageEventDefinition")?P["bpmn:MessageEventDefinition"](_,W,y,$):mn(M,"bpmn:TimerEventDefinition")?P["bpmn:TimerEventDefinition"](_,W,y,$):mn(M,"bpmn:ConditionalEventDefinition")?P["bpmn:ConditionalEventDefinition"](_,W,y,$):mn(M,"bpmn:SignalEventDefinition")?P["bpmn:SignalEventDefinition"](_,W,y,$):mn(M,"bpmn:EscalationEventDefinition")?P["bpmn:EscalationEventDefinition"](_,W,y,$):mn(M,"bpmn:LinkEventDefinition")?P["bpmn:LinkEventDefinition"](_,W,y,$):mn(M,"bpmn:ErrorEventDefinition")?P["bpmn:ErrorEventDefinition"](_,W,y,$):mn(M,"bpmn:CancelEventDefinition")?P["bpmn:CancelEventDefinition"](_,W,y,$):mn(M,"bpmn:CompensateEventDefinition")?P["bpmn:CompensateEventDefinition"](_,W,y,$):mn(M,"bpmn:TerminateEventDefinition")?P["bpmn:TerminateEventDefinition"](_,W,y,$):null}var I={ParticipantMultiplicityMarker:function(T,_,y={}){var k=jt(_,y),M=kt(_,y),$=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:M,position:{mx:(k/2-6)/k,my:(M-15)/M}});S("participant-multiplicity",T,$,{strokeWidth:2,fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})},SubProcessMarker:function(T,_,y={}){var k=g(T,14,14,0,{strokeWidth:1,fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)});ot(k,_.width/2-7.5,_.height-20);var M=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});S("sub-process",T,M,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})},ParallelMarker:function(T,_,y){var k=jt(_,y),M=kt(_,y),$=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:M,position:{mx:(k/2+y.parallel)/k,my:(M-20)/M}});S("parallel",T,$,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})},SequentialMarker:function(T,_,y){var k=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.seq)/_.width,my:(_.height-19)/_.height}});S("sequential",T,k,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})},CompensationMarker:function(T,_,y){var k=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.compensation)/_.width,my:(_.height-13)/_.height}});S("compensation",T,k,{strokeWidth:1,fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})},LoopMarker:function(T,_,y){var k=jt(_,y),M=kt(_,y),$=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:M,position:{mx:(k/2+y.loop)/k,my:(M-7)/M}});S("loop",T,$,{strokeWidth:1.5,fill:"none",stroke:U(_,c,y.stroke),strokeMiterlimit:.5})},AdhocMarker:function(T,_,y){var k=jt(_,y),M=kt(_,y),$=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:M,position:{mx:(k/2+y.adhoc)/k,my:(M-15)/M}});S("adhoc",T,$,{strokeWidth:1,fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke)})}};function L(T,_,y,k){I[T](_,y,k)}function B(T,_,y,k={}){k={fill:k.fill,stroke:k.stroke,width:jt(_,k),height:kt(_,k)};var M=H(_),$=y&&y.includes("SubProcessMarker");$?k={...k,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:k={...k,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},A(y,function(de){L(de,T,_,k)}),M.get("isForCompensation")&&L("CompensationMarker",T,_,k),b(M,"bpmn:AdHocSubProcess")&&L("AdhocMarker",T,_,k);var W=M.get("loopCharacteristics"),J=W&&W.get("isSequential");W&&(J===void 0&&L("LoopMarker",T,_,k),J===!1&&L("ParallelMarker",T,_,k),J===!0&&L("SequentialMarker",T,_,k))}function z(T,_,y={}){y=D({size:{width:100}},y);var k=o.createText(_||"",y);return me(k).add("djs-label"),ie(T,k),k}function q(T,_,y,k={}){var M=H(_),$=Gr({x:_.x,y:_.y,width:_.width,height:_.height},k);return z(T,M.name,{align:y,box:$,padding:7,style:{fill:Ur(_,l,c,k.stroke)}})}function Je(T,_,y={}){var k={width:90,height:30,x:_.width/2+_.x,y:_.height/2+_.y};return z(T,Qt(_),{box:k,fitBox:!0,style:D({},o.getExternalStyle(),{fill:Ur(_,l,c,y.stroke)})})}function Ce(T,_,y,k={}){var M=Ze(y),$=z(T,_,{box:{height:30,width:M?kt(y,k):jt(y,k)},align:"center-middle",style:{fill:Ur(y,l,c,k.stroke)}});if(M){var W=-1*kt(y,k);da($,0,-W,270)}}function pe(T,_,y={}){var{width:k,height:M}=Gr(_,y);return g(T,k,M,Ea,{...y,fill:ue(_,s,y.fill),fillOpacity:Qi,stroke:U(_,c,y.stroke)})}function Qe(T,_,y={}){var k=H(_),M=ue(_,s,y.fill),$=U(_,c,y.stroke);return(k.get("associationDirection")==="One"||k.get("associationDirection")==="Both")&&(y.markerEnd=d(T,"association-end",M,$)),k.get("associationDirection")==="Both"&&(y.markerStart=d(T,"association-start",M,$)),y=ye(y,["markerStart","markerEnd"]),x(T,_.waypoints,{...y,stroke:$,strokeDasharray:"0, 5"})}function Ie(T,_,y={}){var k=ue(_,s,y.fill),M=U(_,c,y.stroke),$=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),W=E(T,$,{fill:k,fillOpacity:Qi,stroke:M}),J=H(_);if(tS(J)){var de=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});E(T,de,{strokeWidth:2,fill:k,stroke:M})}return W}function be(T,_,y={}){return v(T,_.width,_.height,{fillOpacity:Qi,...y,fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)})}function ze(T,_,y={}){return w(T,_.width,_.height,{fill:ue(_,s,y.fill),fillOpacity:Qi,stroke:U(_,c,y.stroke)})}function j(T,_,y={}){var k=g(T,jt(_,y),kt(_,y),0,{fill:ue(_,s,y.fill),fillOpacity:y.fillOpacity||Qi,stroke:U(_,c,y.stroke),strokeWidth:1.5}),M=H(_);if(b(M,"bpmn:Lane")){var $=M.get("name");Ce(T,$,_,y)}return k}function V(T,_,y={}){var k=pe(T,_,y),M=fe(_);if(ht(_)&&(G(k,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!M)){var $=H(_).flowElements||[],W=$.filter(J=>b(J,"bpmn:StartEvent"));W.length===1&&Z(W[0],T,y,_)}return q(T,_,M?"center-top":"center-middle",y),M?B(T,_,void 0,y):B(T,_,["SubProcessMarker"],y),k}function Z(T,_,y,k){var M=22,$={fill:ue(k,s,y.fill),stroke:U(k,c,y.stroke),width:M,height:M},W=H(T).isInterrupting,J=W?0:3,de=W?1:1.2,Xe=20,Be=(M-Xe)/2,rt="translate("+Be+","+Be+")";v(_,Xe,Xe,{fill:$.fill,stroke:$.stroke,strokeWidth:de,strokeDasharray:J,transform:rt}),O(T,_,$,k)}function he(T,_,y={}){var k=pe(T,_,y);return q(T,_,"center-middle",y),B(T,_,void 0,y),k}var St=this.handlers={"bpmn:AdHocSubProcess":function(T,_,y={}){return fe(_)?y=ye(y,["fill","stroke","width","height"]):y=ye(y,["fill","stroke"]),V(T,_,y)},"bpmn:Association":function(T,_,y={}){return y=ye(y,["fill","stroke"]),Qe(T,_,y)},"bpmn:BoundaryEvent":function(T,_,y={}){var{renderIcon:k=!0}=y;y=ye(y,["fill","stroke"]);var M=H(_),$=M.get("cancelActivity");y={strokeWidth:1.5,fill:ue(_,s,y.fill),fillOpacity:lS,stroke:U(_,c,y.stroke)},$||(y.strokeDasharray="6");var W=be(T,_,y);return v(T,_.width,_.height,ba,{...y,fill:"none"}),k&&O(_,T,y),W},"bpmn:BusinessRuleTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y),M=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),$=E(T,M);G($,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1});var W=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),J=E(T,W);return G(J,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:CallActivity":function(T,_,y={}){return y=ye(y,["fill","stroke"]),V(T,_,{strokeWidth:5,...y})},"bpmn:ComplexGateway":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=ze(T,_,y),M=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return E(T,M,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:DataInput":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),M=Ie(T,_,y);return E(T,k,{fill:"none",stroke:U(_,c,y.stroke),strokeWidth:1}),M},"bpmn:DataInputAssociation":function(T,_,y={}){return y=ye(y,["fill","stroke"]),Qe(T,_,{...y,markerEnd:d(T,"association-end",ue(_,s,y.fill),U(_,c,y.stroke))})},"bpmn:DataObject":function(T,_,y={}){return y=ye(y,["fill","stroke"]),Ie(T,_,y)},"bpmn:DataObjectReference":N("bpmn:DataObject"),"bpmn:DataOutput":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),M=Ie(T,_,y);return E(T,k,{strokeWidth:1,fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke)}),M},"bpmn:DataOutputAssociation":function(T,_,y={}){return y=ye(y,["fill","stroke"]),Qe(T,_,{...y,markerEnd:d(T,"association-end",ue(_,s,y.fill),U(_,c,y.stroke))})},"bpmn:DataStoreReference":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return E(T,k,{fill:ue(_,s,y.fill),fillOpacity:Qi,stroke:U(_,c,y.stroke),strokeWidth:2})},"bpmn:EndEvent":function(T,_,y={}){var{renderIcon:k=!0}=y;y=ye(y,["fill","stroke"]);var M=be(T,_,{...y,strokeWidth:4});return k&&O(_,T,y),M},"bpmn:EventBasedGateway":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=H(_),M=ze(T,_,y);v(T,_.width,_.height,_.height*.2,{fill:ue(_,"none",y.fill),stroke:U(_,c,y.stroke),strokeWidth:1});var $=k.get("eventGatewayType"),W=!!k.get("instantiate");function J(){var Xe=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});E(T,Xe,{fill:"none",stroke:U(_,c,y.stroke),strokeWidth:2})}if($==="Parallel"){var de=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});E(T,de,{fill:"none",stroke:U(_,c,y.stroke),strokeWidth:1})}else $==="Exclusive"&&(W||v(T,_.width,_.height,_.height*.26,{fill:"none",stroke:U(_,c,y.stroke),strokeWidth:1}),J());return M},"bpmn:ExclusiveGateway":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=ze(T,_,y),M=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),$=ve(_);return $.get("isMarkerVisible")&&E(T,M,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:Gateway":function(T,_,y={}){return y=ye(y,["fill","stroke"]),ze(T,_,y)},"bpmn:Group":function(T,_,y={}){return y=ye(y,["fill","stroke","width","height"]),g(T,_.width,_.height,Ea,{stroke:U(_,c,y.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:jt(_,y),height:kt(_,y)})},"bpmn:InclusiveGateway":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=ze(T,_,y);return v(T,_.width,_.height,_.height*.24,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:2.5}),k},"bpmn:IntermediateEvent":function(T,_,y={}){var{renderIcon:k=!0}=y;y=ye(y,["fill","stroke"]);var M=be(T,_,{...y,strokeWidth:1.5});return v(T,_.width,_.height,ba,{fill:"none",stroke:U(_,c,y.stroke),strokeWidth:1.5}),k&&O(_,T,y),M},"bpmn:IntermediateCatchEvent":N("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":N("bpmn:IntermediateEvent"),"bpmn:Lane":function(T,_,y={}){return y=ye(y,["fill","stroke","width","height"]),j(T,_,{...y,fillOpacity:uS})},"bpmn:ManualTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y),M=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return E(T,M,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:.5}),k},"bpmn:MessageFlow":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=H(_),M=ve(_),$=ue(_,s,y.fill),W=U(_,c,y.stroke),J=x(T,_.waypoints,{markerEnd:d(T,"messageflow-end",$,W),markerStart:d(T,"messageflow-start",$,W),stroke:W,strokeDasharray:"10, 11",strokeWidth:1.5});if(k.get("messageRef")){var de=J.getPointAtLength(J.getTotalLength()/2),Xe=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:de.x,y:de.y}}),Be={strokeWidth:1};M.get("messageVisibleKind")==="initiating"?(Be.fill=$,Be.stroke=W):(Be.fill=W,Be.stroke=$);var rt=E(T,Xe,Be),Xt=k.get("messageRef"),Re=Xt.get("name"),Bn=z(T,Re,{align:"center-top",fitBox:!0,style:{fill:W}}),Qs=rt.getBBox(),Bt=Bn.getBBox(),se=de.x-Bt.width/2,Ee=de.y+Qs.height/2+sS;da(Bn,se,Ee,0)}return J},"bpmn:ParallelGateway":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=ze(T,_,y),M=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return E(T,M,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:Participant":function(T,_,y={}){y=ye(y,["fill","stroke","width","height"]);var k=j(T,_,y),M=fe(_),$=Ze(_),W=H(_),J=W.get("name");if(M){var de=$?[{x:30,y:0},{x:30,y:kt(_,y)}]:[{x:0,y:30},{x:jt(_,y),y:30}];C(T,de,{stroke:U(_,c,y.stroke),strokeWidth:cS}),Ce(T,J,_,y)}else{var Xe=Gr(_,y);$||(Xe.height=jt(_,y),Xe.width=kt(_,y));var Be=z(T,J,{box:Xe,align:"center-middle",style:{fill:Ur(_,l,c,y.stroke)}});if(!$){var rt=-1*kt(_,y);da(Be,0,-rt,270)}}return W.get("participantMultiplicity")&&L("ParticipantMultiplicityMarker",T,_,y),k},"bpmn:ReceiveTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=H(_),M=he(T,_,y),$;return k.get("instantiate")?(v(T,28,28,20*.22,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1}),$=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):$=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(T,$,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1}),M},"bpmn:ScriptTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y),M=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return E(T,M,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:SendTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y),M=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return E(T,M,{fill:U(_,c,y.stroke),stroke:ue(_,s,y.fill),strokeWidth:1}),k},"bpmn:SequenceFlow":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=ue(_,s,y.fill),M=U(_,c,y.stroke),$=x(T,_.waypoints,{markerEnd:d(T,"sequenceflow-end",k,M),stroke:M}),W=H(_),{source:J}=_;if(J){var de=H(J);W.get("conditionExpression")&&b(de,"bpmn:Activity")&&G($,{markerStart:d(T,"conditional-flow-marker",k,M)}),de.get("default")&&(b(de,"bpmn:Gateway")||b(de,"bpmn:Activity"))&&de.get("default")===W&&G($,{markerStart:d(T,"conditional-default-flow-marker",k,M)})}return $},"bpmn:ServiceTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y);v(T,10,10,{fill:ue(_,s,y.fill),stroke:"none",transform:"translate(6, 6)"});var M=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});E(T,M,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1}),v(T,10,10,{fill:ue(_,s,y.fill),stroke:"none",transform:"translate(11, 10)"});var $=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return E(T,$,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:1}),k},"bpmn:StartEvent":function(T,_,y={}){var{renderIcon:k=!0}=y;y=ye(y,["fill","stroke"]);var M=H(_);M.get("isInterrupting")||(y={...y,strokeDasharray:"6"});var $=be(T,_,y);return k&&O(_,T,y),$},"bpmn:SubProcess":function(T,_,y={}){return fe(_)?y=ye(y,["fill","stroke","width","height"]):y=ye(y,["fill","stroke"]),V(T,_,y)},"bpmn:Task":function(T,_,y={}){return y=ye(y,["fill","stroke"]),he(T,_,y)},"bpmn:TextAnnotation":function(T,_,y={}){y=ye(y,["fill","stroke","width","height"]);var{width:k,height:M}=Gr(_,y),$=g(T,k,M,0,0,{fill:"none",stroke:"none"}),W=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:M,position:{mx:0,my:0}});E(T,W,{stroke:U(_,c,y.stroke)});var J=H(_),de=J.get("text")||"";return z(T,de,{align:"left-top",box:Gr(_,y),padding:7,style:{fill:Ur(_,l,c,y.stroke)}}),$},"bpmn:Transaction":function(T,_,y={}){fe(_)?y=ye(y,["fill","stroke","width","height"]):y=ye(y,["fill","stroke"]);var k=V(T,_,{strokeWidth:1.5,...y}),M=n.style(["no-fill","no-events"],{stroke:U(_,c,y.stroke),strokeWidth:1.5}),$=fe(_);return $||(y={}),g(T,jt(_,y),kt(_,y),Ea-ba,ba,M),k},"bpmn:UserTask":function(T,_,y={}){y=ye(y,["fill","stroke"]);var k=he(T,_,y),M=15,$=12,W=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:M,y:$}});E(T,W,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:.5});var J=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:M,y:$}});E(T,J,{fill:ue(_,s,y.fill),stroke:U(_,c,y.stroke),strokeWidth:.5});var de=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:M,y:$}});return E(T,de,{fill:U(_,c,y.stroke),stroke:U(_,c,y.stroke),strokeWidth:.5}),k},label:function(T,_,y={}){return Je(T,_,y)}};this._drawPath=E,this._renderer=R}Y(Ri,bn),Ri.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ri.prototype.canRender=function(e){return b(e,"bpmn:BaseElement")},Ri.prototype.drawShape=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.drawConnection=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.getShapePath=function(e){return b(e,"bpmn:Event")?nS(e):b(e,"bpmn:Activity")?iS(e,Ea):b(e,"bpmn:Gateway")?rS(e):oS(e)};function ye(e,t=[]){return t.reduce((n,i)=>(e[i]&&(n[i]=e[i]),n),{})}var pS=0,fS={width:150,height:50};function dS(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function hS(e){return tt(e)?D({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function mS(e,t){t.textContent=e;var n;try{var i,r=e==="";return t.textContent=r?"dummy":e,n=t.getBBox(),i={width:n.width+n.x*2,height:n.height},r&&(i.width=0),i}catch(o){return console.log(o),{width:0,height:0}}}function gS(e,t,n){for(var i=e.shift(),r=i,o;;){if(o=mS(r,n),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(t)||r.length<2)return vS(e,r,i,o);r=_S(r,o.width,t)}}function vS(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var Td="­";function yS(e,t){var n=e.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(n.length>1)for(;i=n.shift();)if(i.length+o<t)r.push(i),o+=i.length;else{(i==="-"||i===Td)&&r.pop();break}var a=r[r.length-1];return a&&a===Td&&(r[r.length-1]="-"),r.join("")}function _S(e,t,n){var i=Math.max(e.length*(n/t),1),r=yS(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function bS(){var e=document.getElementById("helper-svg");return e||(e=X("svg"),G(e,{id:"helper-svg"}),lt(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function xa(e){this._config=D({},{size:fS,padding:pS,style:{},align:"center-top"},e||{})}xa.prototype.createText=function(e,t){return this.layoutText(e,t).element},xa.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xa.prototype.layoutText=function(e,t){var n=D({},this._config.size,t.box),i=D({},this._config.style,t.style),r=dS(t.align||this._config.align),o=hS(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=ES(i),c=e.split(/\u00AD?\r?\n/),l=[],u=n.width-o.left-o.right,p=X("text");G(p,{x:0,y:0}),G(p,i);var f=bS();for(ie(f,p);c.length;)l.push(gS(c,u,p));r.vertical==="middle"&&(o.top=o.bottom=0);var d=Tt(l,function(C,x,E){return C+(s||x.height)},0)+o.top+o.bottom,m=Tt(l,function(C,x,E){return x.width>C?x.width:C},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-d)/2),v-=(s||l[0].height)/4;var g=X("text");G(g,i),A(l,function(C){var x;switch(v+=s||C.height,r.horizontal){case"left":x=o.left;break;case"right":x=(a?m:u)-o.right-C.width;break;default:x=Math.max(((a?m:u)-C.width)/2+o.left,0)}var E=X("tspan");G(E,{x,y:v}),E.textContent=C.text,ie(g,E)}),Ge(p);var w={width:m,height:d};return{dimensions:w,element:g}};function ES(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var xS=12,wS=1.2,SS=30;function Pd(e){var t=D({fontFamily:"Arial, sans-serif",fontSize:xS,fontWeight:"normal",lineHeight:wS},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=D({},t,{fontSize:n},e&&e.externalStyle||{}),r=new xa({style:t});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(SS,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Pd.$inject=["config.textRenderer"];function CS(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var i=this.pathMap[t],r,o;n.abspos?(r=n.abspos.x,o=n.abspos.y):(r=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/i.height*n.yScaleFactor,c=n.containerWidth/i.width*n.xScaleFactor,l=0;l<i.heightElements.length;l++)a["y"+l]=i.heightElements[l]*s;for(var u=0;u<i.widthElements.length;u++)a["x"+u]=i.widthElements[u]*c}var p=AS(i.d,{mx:r,my:o,e:a});return p}}var RS=/\{([^{}]+)\}/g,TS=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function PS(e,t,n){var i=n;return t.replace(TS,function(r,o,a,s,c){o=o||s,i&&(o in i&&(i=i[o]),typeof i=="function"&&c&&(i=i()))}),i=(i==null||i==n?e:i)+"",i}function AS(e,t){return String(e).replace(RS,function(n,i){return PS(n,i,t)})}const kS={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ri],textRenderer:["type",Pd],pathMap:["type",CS]};function DS(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}const wa={translate:["value",DS]};function Sa(e,t,n){return D({id:e.id,type:e.$type,businessObject:e,di:t},n)}function MS(e,t,n){var i=e.waypoint;return!i||i.length<2?[te(t),te(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function Ad(e,t,n){return new Error(`element ${dt(t)} referenced by ${dt(e)}#${n} not yet drawn`)}function Cn(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}Cn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Cn.prototype.add=function(e,t,n){var i,r,o;if(b(t,"bpmndi:BPMNPlane")){var a=b(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Sa(e,t,a)),this._canvas.addRootElement(i)}else if(b(t,"bpmndi:BPMNShape")){var s=!fe(e,t),c=OS(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Sa(e,t,{collapsed:s,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),b(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),b(e,"bpmn:Lane")&&(o=0),b(e,"bpmn:DataStoreReference")&&(NS(n,te(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else if(b(t,"bpmndi:BPMNEdge")){var u=this._getSource(e),p=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Sa(e,t,{hidden:r,source:u,target:p,waypoints:MS(t,u,p)})),b(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}else throw new Error(`unknown di ${dt(t)} for element ${dt(e)}`);return Ci(e)&&Qt(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Cn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${dt(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw Ad(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),r.indexOf(t)===-1&&r.push(t)},Cn.prototype.addLabel=function(e,t,n){var i,r,o;return i=X1(t,n),r=Qt(n),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Sa(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Qt(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Cn.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i),n)return n;throw i?Ad(e,i,t+"Ref"):new Error(`${dt(e)}#${t} Ref not specified`)},Cn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Cn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Cn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function NS(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function OS(e){return b(e,"bpmn:Group")}const IS={__depends__:[kS,{__depends__:[wa],bpmnImporter:["type",Cn]}]};function Kr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Kr.prototype.next=function(){return this._prefix+ ++this._counter};var BS=new Kr("ov"),LS=500;function nt(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=BS,this._overlayDefaults=D({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=$S(n.getContainer()),this._init()}nt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],nt.prototype.get=function(e){if(Rt(e)&&(e={id:e}),Rt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?ce(t.overlays,Zt({type:e.type})):t.overlays.slice():[]}else return e.type?ce(this._overlays,Zt({type:e.type})):e.id?this._overlays[e.id]:null},nt.prototype.add=function(e,t,n){if(tt(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=D({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},nt.prototype.remove=function(e){var t=this.get(e)||[];oe(t)||(t=[t]);var n=this;A(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(un(i.html),un(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},nt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},nt.prototype.show=function(){Ca(this._overlayRoot)},nt.prototype.hide=function(){Ca(this._overlayRoot,!1)},nt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Zo(this._overlayRoot)},nt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Ke(t);i=o.x,r=o.y}kd(n,i,r),ut(e.html,"data-container-id",t.id)},nt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,i=e.element,r=t.left,o=t.top;if(t.right!==void 0){var a;i.waypoints?a=Ke(i).width:a=i.width,r=t.right*-1+a}if(t.bottom!==void 0){var s;i.waypoints?s=Ke(i).height:s=i.height,o=t.bottom*-1+s}kd(n,r||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},nt.prototype._createOverlayContainer=function(e){var t=Te('<div class="djs-overlays" />');lt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},nt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Dd(this._overlayRoot,n)},nt.prototype._getOverlayContainer=function(e,t){var n=_e(this._overlayContainers,function(i){return i.element===e});return!n&&!t?this._createOverlayContainer(e):n},nt.prototype._addOverlay=function(e){var t=e.id,n=e.element,i=e.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Rt(i)&&(i=Te(i)),o=this._getOverlayContainer(n),r=Te('<div class="djs-overlay" data-overlay-id="'+t+'">'),lt(r,{position:"absolute"}),r.appendChild(i),e.type&&Ne(r).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Ca(r,a===s),e.htmlContainer=r,o.overlays.push(e),o.html.appendChild(r),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},nt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(et(r)&&r>t.scale||et(o)&&o<t.scale))&&(c=!1),Ca(a,c),this._updateOverlayScale(e,t)},nt.prototype._updateOverlayScale=function(e,t){var n=e.scale,i,r,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(i=1,r=1):(i=n.min,r=n.max),et(i)&&t.scale<i&&(a=(1/t.scale||1)*i),et(r)&&t.scale>r&&(a=(1/t.scale||1)*r)),et(a)&&(s="scale("+a+","+a+")"),Dd(o,s)},nt.prototype._updateOverlaysVisibilty=function(e){var t=this;A(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},nt.prototype._init=function(){var e=this._eventBus,t=this;function n(i){t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}e.on("canvas.viewbox.changing",function(i){t.hide()}),e.on("canvas.viewbox.changed",function(i){n(i.viewbox)}),e.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=t.get({element:r});A(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(r);if(a){un(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",LS,function(i){var r=i.element,o=t._getOverlayContainer(r,!0);o&&(A(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(i){var r=t._getOverlayContainer(i.element,!0);r&&Ne(r.html)[i.add?"add":"remove"](i.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function $S(e){var t=Te('<div class="djs-overlay-container" />');return lt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function kd(e,t,n){lt(e,{left:t+"px",top:n+"px"})}function Ca(e,t){e.style.display=t===!1?"none":""}function Dd(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const Ra={__init__:["overlays"],overlays:["type",nt]};function Md(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(Sf(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Md.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const nl={__init__:["changeSupport"],changeSupport:["type",Md]};var jS=1e3;function F(e){this._eventBus=e}F.$inject=["eventBus"];function FS(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}F.prototype.on=function(e,t,n,i,r,o){if((We(t)||ee(t))&&(o=r,r=i,i=n,n=t,t=null),We(n)&&(o=r,r=i,i=n,n=jS),tt(r)&&(o=r,r=!1),!We(i))throw new Error("handlerFn must be a function");oe(e)||(e=[e]);var a=this._eventBus;A(e,function(s){var c=["commandStack",s,t].filter(function(l){return l}).join(".");a.on(c,n,r?FS(i,o):i,o)})},F.prototype.canExecute=Rn("canExecute"),F.prototype.preExecute=Rn("preExecute"),F.prototype.preExecuted=Rn("preExecuted"),F.prototype.execute=Rn("execute"),F.prototype.executed=Rn("executed"),F.prototype.postExecute=Rn("postExecute"),F.prototype.postExecuted=Rn("postExecuted"),F.prototype.revert=Rn("revert"),F.prototype.reverted=Rn("reverted");function Rn(e){return function(n,i,r,o,a){(We(n)||ee(n))&&(a=o,o=r,r=i,i=n,n=null),this.on(n,e,i,r,o,a)}}function il(e,t){t.invoke(F,this),this.executed(function(n){var i=n.context;i.rootElement?e.setRootElement(i.rootElement):i.rootElement=e.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&e.setRootElement(i.rootElement)})}Y(il,F),il.$inject=["canvas","injector"];const HS={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",il]};function qr(e){return CSS.escape(e)}var VS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Nd(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return VS[t]})}var Od="_plane";function Id(e){var t=e.id;return zS(t)}function Tn(e){var t=e.id;return b(e,"bpmn:SubProcess")?Bd(t):t}function Ti(e){return Bd(e)}function Ta(e){var t=ve(e);return b(t,"bpmndi:BPMNPlane")}function Bd(e){return e+Od}function zS(e){return e.replace(new RegExp(Od+"$"),"")}var WS="bjs-breadcrumbs-shown";function Ld(e,t,n){var i=Te('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Ne(r);r.appendChild(i);var a=[];e.on("element.changed",function(c){var l=c.element,u=H(l),p=_e(a,function(f){return f===u});p&&s()});function s(c){c&&(a=US(c));var l=a.flatMap(function(p){var f=n.findRoot(Tn(p))||n.findRoot(p.id);if(!f&&b(p,"bpmn:Process")){var d=t.find(function(g){var w=H(g);return w&&w.get("processRef")===p});f=d&&n.findRoot(d.id)}if(!f)return[];var m=Nd(p.name||p.id),v=Te('<li><span class="bjs-crumb"><a title="'+m+'">'+m+"</a></span></li>");return v.addEventListener("click",function(){n.setRootElement(f)}),v});i.innerHTML="";var u=l.length>1;o.toggle(WS,u),l.forEach(function(p){i.appendChild(p)})}e.on("root.set",function(c){s(c.element)})}Ld.$inject=["eventBus","elementRegistry","canvas"];function US(e){for(var t=H(e),n=[],i=t;i;i=i.$parent)(b(i,"bpmn:SubProcess")||b(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function $d(e,t){var n=null,i=new GS;e.on("root.set",function(r){var o=r.element,a=t.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!b(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,l=(a.y-s.y)*a.scale;(c!==0||l!==0)&&t.scroll({dx:c,dy:l}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}$d.$inject=["eventBus","canvas"];function GS(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var jd={x:180,y:160};function Pi(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}Pi.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(t._processToDiagramMap[i.plane.bpmnElement.id]=i)});var n=e.diagrams.filter(i=>i.plane).flatMap(i=>t._createNewDiagrams(i.plane));n.forEach(function(i){t._movePlaneElementsToOrigin(i.plane)})}},Pi.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;b(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),qS(a,e)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),r},Pi.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=KS(e),i={x:n.x-jd.x,y:n.y-jd.y};t.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Pi.prototype._moveToDiPlane=function(e,t){var n=Fd(e),i=n.plane.get("planeElement");i.splice(i.indexOf(e),1),t.get("planeElement").push(e)},Pi.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Pi.$inject=["eventBus","moddle"];function Fd(e){return b(e,"bpmndi:BPMNDiagram")?e:Fd(e.$parent)}function KS(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var i=Q(n.bounds);t.top=Math.min(i.top,t.top),t.left=Math.min(i.left,t.left)}}),ua(t)}function qS(e,t){var n=e.$parent;return!(!b(n,"bpmn:SubProcess")||n===t.bpmnElement||le(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Pa=250,YS='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',XS="bjs-drilldown-empty";function qn(e,t,n,i,r){F.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Y(qn,F),qn.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},qn.prototype._canDrillDown=function(e){var t=this._canvas;return b(e,"bpmn:SubProcess")&&t.findRoot(Tn(e))},qn.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=H(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Ne(i.html).toggle(XS,!r)}},qn.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=H(e),r=n.get({element:e,type:"drilldown"});r.length&&this._removeOverlay(e);var o=Te('<button type="button" class="bjs-drilldown">'+YS+"</button>"),a=i.get("name")||i.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(Tn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},qn.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},qn.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const ZS={__depends__:[Ra,nl,HS],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ld],drilldownCentering:["type",$d],drilldownOverlayBehavior:["type",qn],subprocessCompatibility:["type",Pi]};function Hd(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function er(e){return e.originalEvent||e.srcEvent}function rl(e){Hd(e),Hd(er(e))}function Ai(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Vd(){return/mac/i.test(navigator.platform)}function zd(e,t){return(er(e)||e).button===t}function Yn(e){return zd(e,0)}function JS(e){return zd(e,1)}function Yr(e){var t=er(e)||e;return Yn(e)?Vd()?t.metaKey:t.ctrlKey:!1}function Aa(e){var t=er(e)||e;return Yn(e)&&t.shiftKey}function QS(e){return!0}function ka(e){return Yn(e)||JS(e)}var Wd=500;function Ud(e,t,n){var i=this;function r(P,O,I){if(!s(P,O)){var L,B,z;I?B=t.getGraphics(I):(L=O.delegateTarget||O.target,L&&(B=L,I=t.get(B))),!(!B||!I)&&(z=e.fire(P,{element:I,gfx:B,originalEvent:O}),z===!1&&(O.stopPropagation(),O.preventDefault()))}}var o={};function a(P){return o[P]}function s(P,O){var I=l[P]||Yn;return!I(O)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":QS,"element.mousedown":ka,"element.mouseup":ka,"element.click":ka,"element.dblclick":ka};function u(P,O,I){var L=c[P];if(!L)throw new Error("unmapped DOM event name <"+P+">");return r(L,O,I)}var p="svg, .djs-element";function f(P,O,I,L){var B=o[I]=function(z){r(I,z)};L&&(l[I]=L),B.$delegate=Pt.bind(P,p,O,B)}function d(P,O,I){var L=a(I);L&&Pt.unbind(P,O,L.$delegate)}function m(P){A(c,function(O,I){f(P,I,O)})}function v(P){A(c,function(O,I){d(P,I,O)})}e.on("canvas.destroy",function(P){v(P.svg)}),e.on("canvas.init",function(P){m(P.svg)}),e.on(["shape.added","connection.added"],function(P){var O=P.element,I=P.gfx;e.fire("interactionEvents.createHit",{element:O,gfx:I})}),e.on(["shape.changed","connection.changed"],Wd,function(P){var O=P.element,I=P.gfx;e.fire("interactionEvents.updateHit",{element:O,gfx:I})}),e.on("interactionEvents.createHit",Wd,function(P){var O=P.element,I=P.gfx;i.createDefaultHit(O,I)}),e.on("interactionEvents.updateHit",function(P){var O=P.element,I=P.gfx;i.updateDefaultHit(O,I)});var g=S("djs-hit djs-hit-stroke"),w=S("djs-hit djs-hit-click-stroke"),C=S("djs-hit djs-hit-all"),x=S("djs-hit djs-hit-no-move"),E={all:C,"click-stroke":w,stroke:g,"no-move":x};function S(P,O){return O=D({stroke:"white",strokeWidth:15},O||{}),n.cls(P,["no-fill","no-border"],O)}function R(P,O){var I=E[O];if(!I)throw new Error("invalid hit type <"+O+">");return G(P,I),P}function N(P,O){ie(P,O)}this.removeHits=function(P){var O=Rc(".djs-hit",P);A(O,Ge)},this.createDefaultHit=function(P,O){var I=P.waypoints,L=P.isFrame,B;return I?this.createWaypointsHit(O,I):(B=L?"stroke":"all",this.createBoxHit(O,B,{width:P.width,height:P.height}))},this.createWaypointsHit=function(P,O){var I=ra(O);return R(I,"stroke"),N(P,I),I},this.createBoxHit=function(P,O,I){I=D({x:0,y:0},I);var L=X("rect");return R(L,O),G(L,I),N(P,L),L},this.updateDefaultHit=function(P,O){var I=xe(".djs-hit",O);if(I)return P.waypoints?bf(I,P.waypoints):G(I,{width:P.width,height:P.height}),I},this.fire=r,this.triggerMouseEvent=u,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Ud.$inject=["eventBus","elementRegistry","styles"];const Da={__init__:["interactionEvents"],interactionEvents:["type",Ud]};function tr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","root.set"],function(i){n.select(null)})}tr.$inject=["eventBus","canvas"],tr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},tr.prototype.get=function(){return this._selectedElements},tr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},tr.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();oe(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter(function(a){var s=r.findRoot(a);return o===s}),t?A(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Gd="hover",Kd="selected";function qd(e,t){this._canvas=e;function n(r,o){e.addMarker(r,o)}function i(r,o){e.removeMarker(r,o)}t.on("element.hover",function(r){n(r.element,Gd)}),t.on("element.out",function(r){i(r.element,Gd)}),t.on("selection.changed",function(r){function o(l){i(l,Kd)}function a(l){n(l,Kd)}var s=r.oldSelection,c=r.newSelection;A(s,function(l){c.indexOf(l)===-1&&o(l)}),A(c,function(l){s.indexOf(l)===-1&&a(l)})})}qd.$inject=["canvas","eventBus"];function Yd(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=o.hints||{},l=c.autoSelect;if(a){if(l===!1)return;oe(l)?t.select(l):t.select(s.filter(eC))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id),s=_e(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(r){if(Yn(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Aa(r);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Yd.$inject=["eventBus","selection","canvas","elementRegistry"];function eC(e){return!e.hidden}const en={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Da],selection:["type",tr],selectionVisuals:["type",qd],selectionBehavior:["type",Yd]};function Xn(e){Ae.call(this,e)}Y(Xn,Ae),Xn.prototype._modules=[IS,ZS,Ra,en,wa],Xn.prototype._moddleExtensions={};var tC=["c","C"],nC=["v","V"],iC=["y","Y"],Xd=["z","Z"];function rC(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ft(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function it(e,t){return e=oe(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function ol(e){return e.shiftKey}function oC(e){return Ft(e)&&it(tC,e)}function aC(e){return Ft(e)&&it(nC,e)}function sC(e){return Ft(e)&&!ol(e)&&it(Xd,e)}function cC(e){return Ft(e)&&(it(iC,e)||it(Xd,e)&&ol(e))}var Ma="keyboard.keydown",lC="keyboard.keyup",uC=1e3,Zd="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function vt(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Zd));var i=e&&e.bind!==!1;t.on("canvas.init",function(r){n._target=r.svg,i&&n.bind(),n._fire("init")})}vt.$inject=["config.keyboard","eventBus"],vt.prototype._keydownHandler=function(e){this._keyHandler(e,Ma)},vt.prototype._keyupHandler=function(e){this._keyHandler(e,lC)},vt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var i={keyEvent:e};n=this._eventBus.fire(t||Ma,i),n&&e.preventDefault()}},vt.prototype._isEventIgnored=function(e){return!1},vt.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Zd)),this.unbind(),e=this._node=this._target,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")},vt.prototype.getBinding=function(){return this._node},vt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null},vt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},vt.prototype.addListener=function(e,t,n){We(e)&&(n=t,t=e,e=uC),this._eventBus.on(n||Ma,e,t)},vt.prototype.removeListener=function(e,t){this._eventBus.off(t||Ma,e)},vt.prototype.hasModifier=rC,vt.prototype.isCmd=Ft,vt.prototype.isShift=ol,vt.prototype.isKey=it;var pC=500;function nr(e,t){var n=this;e.on("editorActions.init",pC,function(i){var r=i.editorActions;n.registerBindings(t,r)})}nr.$inject=["eventBus","keyboard"],nr.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){var r=i.keyEvent;if(sC(r))return t.trigger("undo"),!0}),n("redo",function(i){var r=i.keyEvent;if(cC(r))return t.trigger("redo"),!0}),n("copy",function(i){var r=i.keyEvent;if(oC(r))return t.trigger("copy"),!0}),n("paste",function(i){var r=i.keyEvent;if(aC(r))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(it(["+","Add","="],r)&&Ft(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(it(["-","Subtract"],r)&&Ft(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(it("0",r)&&Ft(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){var r=i.keyEvent;if(it(["Backspace","Delete","Del"],r))return t.trigger("removeSelection"),!0})};const al={__init__:["keyboard","keyboardBindings"],keyboard:["type",vt],keyboardBindings:["type",nr]};var fC={moveSpeed:50,moveSpeedAccelerated:200};function Jd(e,t,n){var i=this;this._config=D({},fC,e||{}),t.addListener(r);function r(o){var a=o.keyEvent,s=i._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,l;switch(a.key){case"ArrowLeft":case"Left":l="left";break;case"ArrowUp":case"Up":l="up";break;case"ArrowRight":case"Right":l="right";break;case"ArrowDown":case"Down":l="down";break}return i.moveCanvas({speed:c,direction:l}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,l=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=l;break;case"up":s=l;break;case"right":a=-l;break;case"down":s=-l;break}n.scroll({dx:a,dy:s})}}Jd.$inject=["config.keyboardMove","keyboard","canvas"];const Qd={__depends__:[al],__init__:["keyboardMove"],keyboardMove:["type",Jd]};var dC=/^djs-cursor-.*$/;function Na(e){var t=Ne(document.body);t.removeMatching(dC),e&&t.add("djs-cursor-"+e)}function eh(){Na(null)}var hC=5e3;function th(e,t){t=t||"element.click";function n(){return!1}return e.once(t,hC,n),function(){e.off(t,n)}}function Xr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function tn(e,t){return{x:e.x-t.x,y:e.y-t.y}}var mC=15;function nh(e,t){var n;function i(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)});function r(s){var c=n.start,l=n.button,u=Ai(s),p=tn(u,c);if(!n.dragging&&gC(p)>mC&&(n.dragging=!0,l===0&&th(e),Na("grab")),n.dragging){var f=n.last||n.start;p=tn(u,f),t.scroll({dx:p.x,dy:p.y}),n.last=u}s.preventDefault()}function o(s){ae.unbind(document,"mousemove",r),ae.unbind(document,"mouseup",o),n=null,eh()}function a(s){if(!Ui(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:Ai(s)},ae.bind(document,"mousemove",r),ae.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}nh.$inject=["eventBus","canvas"];function gC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const ih={__init__:["moveCanvas"],moveCanvas:["type",nh]};function sl(e){return Math.log(e)/Math.log(10)}function rh(e,t){var n=sl(e.min),i=sl(e.max),r=Math.abs(n)+Math.abs(i);return r/t}function vC(e,t){return Math.max(e.min,Math.min(e.max,t))}var yC=Math.sign||function(e){return e>=0?1:-1},cl={min:.2,max:4},oh=10,_C=.1,bC=.75;function gn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Et(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||bC;var i=this;t.on("canvas.focus.changed",function(r){i._init(r.focused&&e.enabled!==!1)})}gn.$inject=["config.zoomScroll","eventBus","canvas"],gn.prototype.scroll=function(t){this._canvas.scroll(t)},gn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},gn.prototype.zoom=function(t,n){var i=rh(cl,oh*2);this._totalDelta+=t,Math.abs(this._totalDelta)>_C&&(this._zoom(t,n,i),this._totalDelta=0)},gn.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var n=this._container;t.preventDefault();var i=t.ctrlKey||Vd()&&t.metaKey,r=t.shiftKey,o=-1*this._scale,a;if(i?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,i){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*yC(t.deltaY)*o,this.zoom(a,c)}else r?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}},gn.prototype.stepZoom=function(t,n){var i=rh(cl,oh);this._zoom(t,n,i)},gn.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=sl(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(vC(cl,s),t)},gn.prototype.toggle=function(t){var n=this._container,i=this._handleWheel,r=this._enabled;return typeof t>"u"&&(t=!r),r!==t&&ae[t?"bind":"unbind"](n,"wheel",i,!1),this._enabled=t,t},gn.prototype._init=function(e){this.toggle(e)};const ah={__init__:["zoomScroll"],zoomScroll:["type",gn]};function Zr(e){Xn.call(this,e)}Y(Zr,Xn),Zr.prototype._navigationModules=[Qd,ih,ah],Zr.prototype._modules=[].concat(Xn.prototype._modules,Zr.prototype._navigationModules);function ll(e){return e&&e[e.length-1]}function sh(e){return e.y}function ch(e){return e.x}var EC={left:ch,center:ch,right:function(e){return e.x+e.width},top:sh,middle:sh,bottom:function(e){return e.y+e.height}};function ir(e,t){this._modeling=e,this._rules=t}ir.$inject=["modeling","rules"],ir.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",i="width";return t.indexOf(e)!==-1&&(n="y",i="height"),{axis:n,dimension:i}},ir.prototype._isType=function(e,t){return t.indexOf(e)!==-1},ir.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),i=n.axis,r=n.dimension,o={},a={},s=!1,c,l,u;function p(f,d){return Math.round((f[i]+d[i]+d[r])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][i];else if(this._isType(e,["right","bottom"]))u=ll(t),o[e]=u[i]+u[r];else if(this._isType(e,["center","middle"])){if(A(t,function(f){var d=f[i]+Math.round(f[r]/2);a[d]?a[d].elements.push(f):a[d]={elements:[f],center:d}}),c=cn(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=ll(c).center,o;l=t[0],t=cn(t,function(f){return f[i]+f[r]}),u=ll(t),o[e]=p(l,u)}return o},ir.prototype.trigger=function(e,t){var n=this._modeling,i,r=ce(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),oe(i)&&(r=i),!(r.length<2||!i)){var o=EC[t],a=cn(r,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};const xC={__init__:["alignElements"],alignElements:["type",ir]},wC=new Kr;function rr(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}rr.$inject=["eventBus"],rr.prototype.schedule=function(e,t=wC.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},rr.prototype._schedule=function(e,t){const n=SC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(r){n.reject(r)}}catch(r){console.error("Scheduler#_schedule execution failed",r)}}),promise:n.promise}},rr.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},rr.prototype._cancel=function(e){clearTimeout(e.executionId)};function SC(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const CC={scheduler:["type",rr]};var RC="djs-element-hidden",Oa=".entry",TC=1e3,lh=8,PC=300;function je(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}je.$inject=["canvas","elementRegistry","eventBus","scheduler"],je.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?n.length===1?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=oe(r)?r:[r],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current,r=oe(i.target)?i.target:[i.target];r.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},je.prototype._createContainer=function(){var e=Te('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},je.prototype.registerProvider=function(e,t){t||(t=e,e=TC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},je.prototype.getEntries=function(e){var t=this._getProviders(),n=oe(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return A(t,function(r){if(We(r[n])){var o=r[n](e);We(o)?i=o(i):A(o,function(a,s){i[s]=a})}}),i},je.prototype.trigger=function(e,t,n){var i=this,r,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(r=ut(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){i._mouseout=i.triggerEntry(r,"hover",o,n)},PC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(r,e,o,n)},je.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(We(s)){if(t==="click")return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},je.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},je.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},je.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),i;A(t,function(r,o){var a=r.group||"default",s=Te(r.html||'<div class="entry" draggable="true"></div>'),c;ut(s,"data-action",o),c=xe("[data-group="+qr(a)+"]",n),c||(c=Te('<div class="group"></div>'),ut(c,"data-group",a),n.appendChild(c)),c.appendChild(s),r.className&&AC(s,r.className),r.title&&ut(s,"title",r.title),r.imageUrl&&(i=Te("<img>"),ut(i,"src",r.imageUrl),i.style.width="100%",i.style.height="100%",s.appendChild(i))}),Ne(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},je.prototype._createHtml=function(e){var t=this,n=Te('<div class="djs-context-pad"></div>');return Pt.bind(n,Oa,"click",function(i){t.trigger("click",i)}),Pt.bind(n,Oa,"dragstart",function(i){t.trigger("dragstart",i)}),Pt.bind(n,Oa,"mouseover",function(i){t.trigger("mouseover",i)}),Pt.bind(n,Oa,"mouseout",function(i){t.trigger("mouseout",i)}),ae.bind(n,"mousedown",function(i){i.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},je.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&DC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},je.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},je.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return oe(e)!==oe(n)?!1:oe(e)?e.length===n.length&&yi(e,function(i){return n.includes(i)}):n===e},je.prototype.isShown=function(){return this.isOpen()&&Ne(this._current.html).has("open")},je.prototype.show=function(){this.isOpen()&&(Ne(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},je.prototype.hide=function(){this.isOpen()&&(Ne(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},je.prototype._getPosition=function(e){if(!oe(e)&&we(e)){var t=this._canvas.viewbox(),n=kC(e),i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+lh*this._canvas.zoom(),top:r}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+lh*this._canvas.zoom(),top:s.top-a.top}},je.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(i){i in n&&(t.style[i]=n[i]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},je.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target,i=oe(n)?n:[n],r=i.some(function(o){return t._canvas.hasMarker(o,RC)});r?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},je.prototype._getTargetBounds=function(e){var t=this,n=oe(e)?e:[e],i=n.map(function(r){return t._canvas.getGraphics(r)});return i.reduce(function(r,o){const a=o.getBoundingClientRect();return r.top=Math.min(r.top,a.top),r.right=Math.max(r.right,a.right),r.bottom=Math.max(r.bottom,a.bottom),r.left=Math.min(r.left,a.left),r.x=r.left,r.y=r.top,r.width=r.right-r.left,r.height=r.bottom-r.top,r},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function AC(e,t){var n=Ne(e);t=oe(t)?t:t.split(/\s+/g),t.forEach(function(i){n.add(i)})}function kC(e){return e.waypoints[e.waypoints.length-1]}function DC(e,t){return e=oe(e)?e:[e],t=oe(t)?t:[t],e.length===t.length&&yi(e,function(n){return t.includes(n)})}const uh={__depends__:[Da,CC,Ra],contextPad:["type",je]};var Ia,ke,ph,ki,fh,dh,hh,mh,ul,pl,fl,Jr={},gh=[],MC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ba=Array.isArray;function Pn(e,t){for(var n in t)e[n]=t[n];return e}function dl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vh(e,t,n){var i,r,o,a={};for(o in t)o=="key"?i=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ia.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]==null&&(a[o]=e.defaultProps[o]);return La(e,a,i,r,null)}function La(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++ph,__i:-1,__u:0};return r==null&&ke.vnode!=null&&ke.vnode(o),o}function $a(e){return e.children}function ja(e,t){this.props=e,this.context=t}function or(e,t){if(t==null)return e.__?or(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?or(e):null}function yh(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return yh(e)}}function _h(e){(!e.__d&&(e.__d=!0)&&ki.push(e)&&!Fa.__r++||fh!=ke.debounceRendering)&&((fh=ke.debounceRendering)||dh)(Fa)}function Fa(){for(var e,t,n,i,r,o,a,s=1;ki.length;)ki.length>s&&ki.sort(hh),e=ki.shift(),s=ki.length,e.__d&&(n=void 0,r=(i=(t=e).__v).__e,o=[],a=[],t.__P&&((n=Pn({},i)).__v=i.__v+1,ke.vnode&&ke.vnode(n),hl(t.__P,n,i,t.__n,t.__P.namespaceURI,32&i.__u?[r]:null,o,r??or(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Sh(o,n,a),n.__e!=r&&yh(n)));Fa.__r=0}function bh(e,t,n,i,r,o,a,s,c,l,u){var p,f,d,m,v,g,w=i&&i.__k||gh,C=t.length;for(c=NC(n,t,w,c,C),p=0;p<C;p++)(d=n.__k[p])!=null&&(f=d.__i==-1?Jr:w[d.__i]||Jr,d.__i=p,g=hl(e,d,f,r,o,a,s,c,l,u),m=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ml(f.ref,null,d),u.push(d.ref,d.__c||m,d)),v==null&&m!=null&&(v=m),4&d.__u||f.__k===d.__k?c=Eh(d,c,e):typeof d.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),d.__u&=-7);return n.__e=v,c}function NC(e,t,n,i,r){var o,a,s,c,l,u=n.length,p=u,f=0;for(e.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=o+f,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?La(null,a,null,null,null):Ba(a)?La($a,{children:a},null,null,null):a.constructor==null&&a.__b>0?La(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(l=a.__i=OC(a,n,c,p))!=-1&&(p--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(r>u?f--:r<u&&f++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<u;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=or(s)),Rh(s,s));return i}function Eh(e,t,n){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Eh(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=or(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function OC(e,t,n,i){var r,o,a=e.key,s=e.type,c=t[n];if(c===null&&e.key==null||c&&a==c.key&&s==c.type&&(2&c.__u)==0)return n;if(i>(c!=null&&(2&c.__u)==0?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;){if(r>=0){if((c=t[r])&&(2&c.__u)==0&&a==c.key&&s==c.type)return r;r--}if(o<t.length){if((c=t[o])&&(2&c.__u)==0&&a==c.key&&s==c.type)return o;o++}}return-1}function xh(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||MC.test(t)?n:n+"px"}function Ha(e,t,n,i,r){var o;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||xh(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||xh(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(mh,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=ul,e.addEventListener(t,o?fl:pl,o)):e.removeEventListener(t,o?fl:pl,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function wh(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ul++;else if(t.t<n.u)return;return n(ke.event?ke.event(t):t)}}}function hl(e,t,n,i,r,o,a,s,c,l){var u,p,f,d,m,v,g,w,C,x,E,S,R,N,P,O,I,L=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(u=ke.__b)&&u(t);e:if(typeof L=="function")try{if(w=t.props,C="prototype"in L&&L.prototype.render,x=(u=L.contextType)&&i[u.__c],E=u?x?x.props.value:u.__:i,n.__c?g=(p=t.__c=n.__c).__=p.__E:(C?t.__c=p=new L(w,E):(t.__c=p=new ja(w,E),p.constructor=L,p.render=BC),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=E,p.__n=i,f=p.__d=!0,p.__h=[],p._sb=[]),C&&p.__s==null&&(p.__s=p.state),C&&L.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Pn({},p.__s)),Pn(p.__s,L.getDerivedStateFromProps(w,p.__s))),d=p.props,m=p.state,p.__v=t,f)C&&L.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),C&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(C&&L.getDerivedStateFromProps==null&&w!==d&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(w,E),!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(w,p.__s,E)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(p.props=w,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(B){B&&(B.__=t)}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(w,p.__s,E),C&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(d,m,v)})}if(p.context=E,p.props=w,p.__P=e,p.__e=!1,R=ke.__r,N=0,C){for(p.state=p.__s,p.__d=!1,R&&R(t),u=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,R&&R(t),u=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++N<25);p.state=p.__s,p.getChildContext!=null&&(i=Pn(Pn({},i),p.getChildContext())),C&&!f&&p.getSnapshotBeforeUpdate!=null&&(v=p.getSnapshotBeforeUpdate(d,m)),O=u,u!=null&&u.type===$a&&u.key==null&&(O=Ch(u.props.children)),s=bh(e,Ba(O)?O:[O],t,n,i,r,o,a,s,c,l),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),g&&(p.__E=p.__=null)}catch(B){if(t.__v=null,c||o!=null)if(B.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(I=o.length;I--;)dl(o[I]);else t.__e=n.__e,t.__k=n.__k;ke.__e(B,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=IC(n.__e,t,n,i,r,o,a,c,l);return(u=ke.diffed)&&u(t),128&t.__u?void 0:s}function Sh(e,t,n){for(var i=0;i<n.length;i++)ml(n[i],n[++i],n[++i]);ke.__c&&ke.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){ke.__e(o,r.__v)}})}function Ch(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Ba(e)?e.map(Ch):Pn({},e)}function IC(e,t,n,i,r,o,a,s,c){var l,u,p,f,d,m,v,g=n.props,w=t.props,C=t.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;l<o.length;l++)if((d=o[l])&&"setAttribute"in d==!!C&&(C?d.localName==C:d.nodeType==3)){e=d,o[l]=null;break}}if(e==null){if(C==null)return document.createTextNode(w);e=document.createElementNS(r,C,w.is&&w),s&&(ke.__m&&ke.__m(t,o),s=!1),o=null}if(C==null)g===w||s&&e.data==w||(e.data=w);else{if(o=o&&Ia.call(e.childNodes),g=n.props||Jr,!s&&o!=null)for(g={},l=0;l<e.attributes.length;l++)g[(d=e.attributes[l]).name]=d.value;for(l in g)if(d=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=d;else if(!(l in w)){if(l=="value"&&"defaultValue"in w||l=="checked"&&"defaultChecked"in w)continue;Ha(e,l,null,d,r)}}for(l in w)d=w[l],l=="children"?f=d:l=="dangerouslySetInnerHTML"?u=d:l=="value"?m=d:l=="checked"?v=d:s&&typeof d!="function"||g[l]===d||Ha(e,l,d,g[l],r);if(u)s||p&&(u.__html==p.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(p&&(e.innerHTML=""),bh(t.type=="template"?e.content:e,Ba(f)?f:[f],t,n,i,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&or(n,0),s,c),o!=null)for(l=o.length;l--;)dl(o[l]);s||(l="value",C=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[l]||C=="progress"&&!m||C=="option"&&m!=g[l])&&Ha(e,l,m,g[l],r),l="checked",v!=null&&v!=e[l]&&Ha(e,l,v,g[l],r))}return e}function ml(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(r){ke.__e(r,n)}}function Rh(e,t,n){var i,r;if(ke.unmount&&ke.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ml(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){ke.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Rh(i[r],t,n||typeof e.type!="function");n||dl(e.__e),e.__c=e.__=e.__e=void 0}function BC(e,t,n){return this.constructor(e,n)}function Th(e,t,n){var i,r,o,a;t==document&&(t=document.documentElement),ke.__&&ke.__(e,t),r=(i=!1)?null:t.__k,o=[],a=[],hl(t,e=t.__k=vh($a,null,[e]),r||Jr,Jr,t.namespaceURI,r?null:t.firstChild?Ia.call(t.childNodes):null,o,r?r.__e:t.firstChild,i,a),Sh(o,e,a)}Ia=gh.slice,ke={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},ph=0,ja.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Pn({},this.state),typeof e=="function"&&(e=e(Pn({},n),this.props)),e&&Pn(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_h(this))},ja.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_h(this))},ja.prototype.render=$a,ki=[],dh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,hh=function(e,t){return e.__v.__b-t.__v.__b},Fa.__r=0,mh=/(PointerCapture)$|Capture$/i,ul=0,pl=wh(!1),fl=wh(!0);var Ph=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];a===3?i[0]=s:a===4?i[1]=Object.assign(i[1]||{},s):a===5?(i[1]=i[1]||{})[t[++o]]=s:a===6?i[1][t[++o]]+=s+"":a?(r=e.apply(s,Ph(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},Ah=new Map;function LC(e){var t=Ah.get(this);return t||(t=new Map,Ah.set(this,t)),(t=Ph(this,t.get(e)||(t.set(e,t=function(n){for(var i,r,o=1,a="",s="",c=[0],l=function(f){o===1&&(f||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,f,a):o===3&&(f||a)?(c.push(3,f,a),o=2):o===2&&a==="..."&&f?c.push(4,f,0):o===2&&a&&!f?c.push(5,0,!0,a):o>=5&&((a||!f&&o===5)&&(c.push(o,0,a,r),o=6),f&&(c.push(o,f,0,r),o=6)),a=""},u=0;u<n.length;u++){u&&(o===1&&l(),l(u));for(var p=0;p<n[u].length;p++)i=n[u][p],o===1?i==="<"?(l(),c=[c],o=3):a+=i:o===4?a==="--"&&i===">"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(l(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[u][p+1]===">")?(l(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
14
- `||i==="\r"?(l(),o=2):a+=i),o===3&&a==="!--"&&(o=4,c=c[0])}return l(),c}(e)),t),arguments,[])).length>1?t:t[0]}var Oe=LC.bind(vh),ar,Fe,gl,kh,Qr=0,Dh=[],Ye=ke,Mh=Ye.__b,Nh=Ye.__r,Oh=Ye.diffed,Ih=Ye.__c,Bh=Ye.unmount,Lh=Ye.__;function Va(e,t){Ye.__h&&Ye.__h(Fe,e,Qr||t),Qr=0;var n=Fe.__H||(Fe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function vl(e){return Qr=1,$C(Fh,e)}function $C(e,t,n){var i=Va(ar++,2);if(i.t=e,!i.__c&&(i.__=[Fh(void 0,t),function(s){var c=i.__N?i.__N[0]:i.__[0],l=i.t(c,s);c!==l&&(i.__N=[l,i.__[1]],i.__c.setState({}))}],i.__c=Fe,!Fe.__f)){var r=function(s,c,l){if(!i.__c.__H)return!0;var u=i.__c.__H.__.filter(function(f){return!!f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,s,c,l);var p=i.__c.props!==s;return u.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(p=!0)}}),o&&o.call(this,s,c,l)||p};Fe.__f=!0;var o=Fe.shouldComponentUpdate,a=Fe.componentWillUpdate;Fe.componentWillUpdate=function(s,c,l){if(this.__e){var u=o;o=void 0,r(s,c,l),o=u}a&&a.call(this,s,c,l)},Fe.shouldComponentUpdate=r}return i.__N||i.__}function yl(e,t){var n=Va(ar++,3);!Ye.__s&&El(n.__H,t)&&(n.__=e,n.u=t,Fe.__H.__h.push(n))}function _l(e,t){var n=Va(ar++,4);!Ye.__s&&El(n.__H,t)&&(n.__=e,n.u=t,Fe.__h.push(n))}function $h(e){return Qr=5,sr(function(){return{current:e}},[])}function sr(e,t){var n=Va(ar++,7);return El(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function eo(e,t){return Qr=8,sr(function(){return e},t)}function jC(){for(var e;e=Dh.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(za),e.__H.__h.forEach(bl),e.__H.__h=[]}catch(t){e.__H.__h=[],Ye.__e(t,e.__v)}}Ye.__b=function(e){Fe=null,Mh&&Mh(e)},Ye.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Lh&&Lh(e,t)},Ye.__r=function(e){Nh&&Nh(e),ar=0;var t=(Fe=e.__c).__H;t&&(gl===Fe?(t.__h=[],Fe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(za),t.__h.forEach(bl),t.__h=[],ar=0)),gl=Fe},Ye.diffed=function(e){Oh&&Oh(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Dh.push(t)!==1&&kh===Ye.requestAnimationFrame||((kh=Ye.requestAnimationFrame)||FC)(jC)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),gl=Fe=null},Ye.__c=function(e,t){t.some(function(n){try{n.__h.forEach(za),n.__h=n.__h.filter(function(i){return!i.__||bl(i)})}catch(i){t.some(function(r){r.__h&&(r.__h=[])}),t=[],Ye.__e(i,n.__v)}}),Ih&&Ih(e,t)},Ye.unmount=function(e){Bh&&Bh(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{za(i)}catch(r){t=r}}),n.__H=void 0,t&&Ye.__e(t,n.__v))};var jh=typeof requestAnimationFrame=="function";function FC(e){var t,n=function(){clearTimeout(i),jh&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);jh&&(t=requestAnimationFrame(n))}function za(e){var t=Fe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Fe=t}function bl(e){var t=Fe;e.__c=e.__(),Fe=t}function El(e,t){return!e||e.length!==t.length||t.some(function(n,i){return n!==e[i]})}function Fh(e,t){return typeof t=="function"?t(e):t}function Hh(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hh(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Wa(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hh(e))&&(i&&(i+=" "),i+=t);return i}function HC(e){const{headerEntries:t,onSelect:n,selectedEntry:i,setSelectedEntry:r,title:o}=e,a=sr(()=>VC(t),[t]);return Oe`
13
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+s+a+"</svg>"}catch(i){n=i}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},ke.prototype._setDefinitions=function(e){this._definitions=e},ke.prototype.getModules=function(){return this._modules},ke.prototype.clear=function(){this.getDefinitions()&&Gn.prototype.clear.call(this)},ke.prototype.destroy=function(){Gn.prototype.destroy.call(this),un(this._container)},ke.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},ke.prototype.off=function(e,t){this.get("eventBus").off(e,t)},ke.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=Se(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},ke.prototype.getDefinitions=function(){return this._definitions},ke.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},ke.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,i,r),s=D(ln(n,["additionalModules"]),{canvas:D({},n.canvas,{container:e}),modules:a});Gn.call(this,s),n&&n.container&&this.attachTo(n.container)},ke.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},ke.prototype._createContainer=function(e){const t=Pe('<div class="bjs-container"></div>');return lt(t,{width:Sd(e.width),height:Sd(e.height),position:e.position}),t},ke.prototype._createModdle=function(e){const t=D({},this._moddleExtensions,e.moddleExtensions);return new C1(t)},ke.prototype._modules=[];function va(e,t){return e.warnings=t,e}function j1(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const F1={width:"100%",height:"100%",position:"relative"};function Sd(e){return e+(ee(e)?"px":"")}function H1(e,t){return t&&_e(e.diagrams,function(n){return n.id===t})||null}function V1(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Ed+"</a>",i=Pe(n);lt(Se("svg",i),xd),lt(i,wd,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(i),ae.bind(i,"click",function(r){$1(),r.preventDefault()})}function zr(e){ke.call(this,e),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)}Y(zr,ke),zr.prototype._createModdle=function(e){var t=ke.prototype._createModdle.call(this,e);return t.ids=new sn([32,36,1]),t},zr.prototype._collectIds=function(e,t){var n=e.$model,i=n.ids,r;i.clear();for(r in t)i.claim(r,t[r])};function fe(e,t){return b(e,"bpmn:CallActivity")?!1:b(e,"bpmn:SubProcess")?(t=t||ye(e),t&&b(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):b(e,"bpmn:Participant")?!!V(e).processRef:!0}function Qe(e){if(!(!b(e,"bpmn:Participant")&&!b(e,"bpmn:Lane"))){var t=ye(e).isHorizontal;return t===void 0?!0:t}}function z1(e){return e&&V(e).isInterrupting!==!1}function ht(e){return e&&!!V(e).triggeredByEvent}function Ji(e,t){var n=V(e).eventDefinitions;return jn(n,function(i){return b(i,t)})}function W1(e){return Ji(e,"bpmn:ErrorEventDefinition")}function U1(e){return Ji(e,"bpmn:EscalationEventDefinition")}function G1(e){return Ji(e,"bpmn:CompensateEventDefinition")}var Wr={width:90,height:20},Cd=15;function Ci(e){return b(e,"bpmn:Event")||b(e,"bpmn:Gateway")||b(e,"bpmn:DataStoreReference")||b(e,"bpmn:DataObjectReference")||b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput")||b(e,"bpmn:SequenceFlow")||b(e,"bpmn:MessageFlow")||b(e,"bpmn:Group")}function _a(e){return ge(e.label)}function K1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=q1(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=Cd:a+=Cd,{x:a,y:s}}function q1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function el(e){return e.waypoints?K1(e.waypoints):b(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Wr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Wr.height/2}}function Y1(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Wr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=el(t),i=Wr),D({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Rd(e){if(b(e,"bpmn:FlowElement")||b(e,"bpmn:Participant")||b(e,"bpmn:Lane")||b(e,"bpmn:SequenceFlow")||b(e,"bpmn:MessageFlow")||b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput"))return"name";if(b(e,"bpmn:TextAnnotation"))return"text";if(b(e,"bpmn:Group"))return"categoryValueRef"}function X1(e){var t=e.categoryValueRef;return t&&t.value||""}function en(e){var t=e.businessObject,n=Rd(t);if(n)return n==="categoryValueRef"?X1(t):t[n]||""}function Z1(e,t){var n=e.businessObject,i=Rd(n);if(i)if(i==="categoryValueRef"){if(!n[i])return e;n[i].value=t}else n[i]=t;return e}var tl="hsl(225, 10%, 15%)",J1="white";function mn(e,t){return jn(e.eventDefinitions,function(n){return n.$type===t})}function Q1(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function eS(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function ue(e,t,n){var i=ye(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||J1}function K(e,t,n){var i=ye(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||tl}function Ur(e,t,n,i){var r=ye(e),o=r.get("label");return i||o&&o.get("color:color")||t||K(e,n)}function tS(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2,r=[["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return _i(r)}function nS(e,t){var n=e.x,i=e.y,r=e.width,o=e.height,a=[["M",n+t,i],["l",r-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-10,t],["l",t*2-r,0],["a",t,t,0,0,1,-10,-10],["l",0,t*2-o],["a",t,t,0,0,1,t,-10],["z"]];return _i(a)}function iS(e){var t=e.width,n=e.height,i=e.x,r=e.y,o=t/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return _i(s)}function rS(e){var t=e.x,n=e.y,i=e.width,r=e.height,o=[["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return _i(o)}function Gr(e,t={}){return{width:jt(e,t),height:kt(e,t)}}function jt(e,t={}){return Et(t,"width")?t.width:e.width}function kt(e,t={}){return Et(t,"height")?t.height:e.height}var oS=new sn,aS=10,ba=3,sS=1.5,Ea=10,Qi=.95,cS=1,lS=.25;function Ri(e,t,n,i,r,o,a){bn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function u(T){return n.computeStyle(T,{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2,fill:"white"})}function p(T){return n.computeStyle(T,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2})}function d(T,_){var{ref:v={x:0,y:0},scale:k=1,element:N,parentGfx:$=r._svg}=_,W=X("marker",{id:T,viewBox:"0 0 20 20",refX:v.x,refY:v.y,markerWidth:20*k,markerHeight:20*k,orient:"auto"});ie(W,N);var J=Se(":scope > defs",$);J||(J=X("defs"),ie($,J)),ie(J,W)}function h(T,_,v,k){var N=oS.nextPrefixed("marker-");return m(T,N,_,v,k),"url(#"+N+")"}function m(T,_,v,k,N){if(v==="sequenceflow-end"){var $=X("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:N,stroke:N,strokeWidth:1})});d(_,{element:$,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(v==="messageflow-start"){var W=X("circle",{cx:6,cy:6,r:3.5,...u({fill:k,stroke:N,strokeWidth:1,strokeDasharray:[1e4,1]})});d(_,{element:W,ref:{x:6,y:6},parentGfx:T})}if(v==="messageflow-end"){var J=X("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:k,stroke:N,strokeWidth:1,strokeDasharray:[1e4,1]})});d(_,{element:J,ref:{x:8.5,y:5},parentGfx:T})}if(v==="association-start"){var de=X("path",{d:"M 11 5 L 1 10 L 11 15",...p({fill:"none",stroke:N,strokeWidth:1.5,strokeDasharray:[1e4,1]})});d(_,{element:de,ref:{x:1,y:10},scale:.5,parentGfx:T})}if(v==="association-end"){var Je=X("path",{d:"M 1 5 L 11 10 L 1 15",...p({fill:"none",stroke:N,strokeWidth:1.5,strokeDasharray:[1e4,1]})});d(_,{element:Je,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(v==="conditional-flow-marker"){var $e=X("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:k,stroke:N})});d(_,{element:$e,ref:{x:-1,y:10},scale:.5,parentGfx:T})}if(v==="conditional-default-flow-marker"){var ot=X("path",{d:"M 6 4 L 10 16",...u({stroke:N,fill:"none"})});d(_,{element:ot,ref:{x:0,y:10},scale:.5,parentGfx:T})}}function y(T,_,v,k,N={}){nt(k)&&(N=k,k=0),k=k||0,N=u(N);var $=_/2,W=v/2,J=X("circle",{cx:$,cy:W,r:Math.round((_+v)/4-k),...N});return ie(T,J),J}function g(T,_,v,k,N,$){nt(N)&&($=N,N=0),N=N||0,$=u($);var W=X("rect",{x:N,y:N,width:_-N*2,height:v-N*2,rx:k,ry:k,...$});return ie(T,W),W}function w(T,_,v,k){var N=_/2,$=v/2,W=[{x:N,y:0},{x:_,y:$},{x:N,y:v},{x:0,y:$}],J=W.map(function(Je){return Je.x+","+Je.y}).join(" ");k=u(k);var de=X("polygon",{...k,points:J});return ie(T,de),de}function C(T,_,v,k){v=p(v);var N=ra(_,v,k);return ie(T,N),N}function x(T,_,v){return C(T,_,v,5)}function E(T,_,v){v=p(v);var k=X("path",{...v,d:_});return ie(T,k),k}function S(T,_,v,k){return E(_,v,D({"data-marker":T},k))}function R(T){return Ct[T]}function M(T){return function(_,v,k){return R(T)(_,v,k)}}var P={"bpmn:MessageEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.235,my:.315}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill),W=k?ue(_,s,v.fill):K(_,c,v.stroke),J=E(T,N,{fill:$,stroke:W,strokeWidth:1});return J},"bpmn:TimerEventDefinition":function(T,_,v={}){var k=v.width||_.width,N=v.height||_.height,$=v.width?1:2,W=y(T,k,N,.2*N,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:$}),J=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:N,position:{mx:.5,my:.5}});E(T,J,{stroke:K(_,c,v.stroke),strokeWidth:$});for(var de=0;de<12;de++){var Je=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:N,position:{mx:.5,my:.5}}),$e=k/2,ot=N/2;E(T,Je,{strokeWidth:1,stroke:K(_,c,v.stroke),transform:"rotate("+de*30+","+ot+","+$e+")"})}return W},"bpmn:EscalationEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.2}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(T,_,v={}){var k=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.222}});return E(T,k,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.2,my:.722}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),$=k?K(_,c,v.stroke):"none",W=E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1});return Qf(W,45),W},"bpmn:CompensateEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.22,my:.5}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.2}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{strokeWidth:1,fill:$,stroke:K(_,c,v.stroke)})},"bpmn:MultipleEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.211,my:.36}}),$=k?K(_,c,v.stroke):ue(_,s,v.fill);return E(T,N,{fill:$,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(T,_,v={}){var k=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.458,my:.194}});return E(T,k,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(T,_,v={}){var k=y(T,_.width,_.height,8,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:4});return k}};function I(T,_,v={},k){var N=V(T),$=Q1(N),W=k||T;return N.get("eventDefinitions")&&N.get("eventDefinitions").length>1?N.get("parallelMultiple")?P["bpmn:ParallelMultipleEventDefinition"](_,W,v,$):P["bpmn:MultipleEventDefinition"](_,W,v,$):mn(N,"bpmn:MessageEventDefinition")?P["bpmn:MessageEventDefinition"](_,W,v,$):mn(N,"bpmn:TimerEventDefinition")?P["bpmn:TimerEventDefinition"](_,W,v,$):mn(N,"bpmn:ConditionalEventDefinition")?P["bpmn:ConditionalEventDefinition"](_,W,v,$):mn(N,"bpmn:SignalEventDefinition")?P["bpmn:SignalEventDefinition"](_,W,v,$):mn(N,"bpmn:EscalationEventDefinition")?P["bpmn:EscalationEventDefinition"](_,W,v,$):mn(N,"bpmn:LinkEventDefinition")?P["bpmn:LinkEventDefinition"](_,W,v,$):mn(N,"bpmn:ErrorEventDefinition")?P["bpmn:ErrorEventDefinition"](_,W,v,$):mn(N,"bpmn:CancelEventDefinition")?P["bpmn:CancelEventDefinition"](_,W,v,$):mn(N,"bpmn:CompensateEventDefinition")?P["bpmn:CompensateEventDefinition"](_,W,v,$):mn(N,"bpmn:TerminateEventDefinition")?P["bpmn:TerminateEventDefinition"](_,W,v,$):null}var O={ParticipantMultiplicityMarker:function(T,_,v={}){var k=jt(_,v),N=kt(_,v),$=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2-6)/k,my:(N-15)/N}});S("participant-multiplicity",T,$,{strokeWidth:2,fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})},SubProcessMarker:function(T,_,v={}){var k=g(T,14,14,0,{strokeWidth:1,fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)});at(k,_.width/2-7.5,_.height-20);var N=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});S("sub-process",T,N,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})},ParallelMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),$=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.parallel)/k,my:(N-20)/N}});S("parallel",T,$,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})},SequentialMarker:function(T,_,v){var k=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+v.seq)/_.width,my:(_.height-19)/_.height}});S("sequential",T,k,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})},CompensationMarker:function(T,_,v){var k=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+v.compensation)/_.width,my:(_.height-13)/_.height}});S("compensation",T,k,{strokeWidth:1,fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})},LoopMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),$=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.loop)/k,my:(N-7)/N}});S("loop",T,$,{strokeWidth:1.5,fill:"none",stroke:K(_,c,v.stroke),strokeMiterlimit:.5})},AdhocMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),$=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.adhoc)/k,my:(N-15)/N}});S("adhoc",T,$,{strokeWidth:1,fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke)})}};function B(T,_,v,k){O[T](_,v,k)}function L(T,_,v,k={}){k={fill:k.fill,stroke:k.stroke,width:jt(_,k),height:kt(_,k)};var N=V(_),$=v&&v.includes("SubProcessMarker");$?k={...k,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:k={...k,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},A(v,function(de){B(de,T,_,k)}),N.get("isForCompensation")&&B("CompensationMarker",T,_,k),b(N,"bpmn:AdHocSubProcess")&&B("AdhocMarker",T,_,k);var W=N.get("loopCharacteristics"),J=W&&W.get("isSequential");W&&(J===void 0&&B("LoopMarker",T,_,k),J===!1&&B("ParallelMarker",T,_,k),J===!0&&B("SequentialMarker",T,_,k))}function H(T,_,v={}){v=D({size:{width:100}},v);var k=o.createText(_||"",v);return me(k).add("djs-label"),ie(T,k),k}function G(T,_,v,k={}){var N=V(_),$=Gr({x:_.x,y:_.y,width:_.width,height:_.height},k);return H(T,N.name,{align:v,box:$,padding:7,style:{fill:Ur(_,l,c,k.stroke)}})}function Be(T,_,v={}){var k={width:90,height:30,x:_.width/2+_.x,y:_.height/2+_.y};return H(T,en(_),{box:k,fitBox:!0,style:D({},o.getExternalStyle(),{fill:Ur(_,l,c,v.stroke)})})}function xe(T,_,v,k={}){var N=Qe(v),$=H(T,_,{box:{height:30,width:N?kt(v,k):jt(v,k)},align:"center-middle",style:{fill:Ur(v,l,c,k.stroke)}});if(N){var W=-1*kt(v,k);da($,0,-W,270)}}function pe(T,_,v={}){var{width:k,height:N}=Gr(_,v);return g(T,k,N,Ea,{...v,fill:ue(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke)})}function Ue(T,_,v={}){var k=V(_),N=ue(_,s,v.fill),$=K(_,c,v.stroke);return(k.get("associationDirection")==="One"||k.get("associationDirection")==="Both")&&(v.markerEnd=h(T,"association-end",N,$)),k.get("associationDirection")==="Both"&&(v.markerStart=h(T,"association-start",N,$)),v=ve(v,["markerStart","markerEnd"]),x(T,_.waypoints,{...v,stroke:$,strokeDasharray:"0, 5"})}function be(T,_,v={}){var k=ue(_,s,v.fill),N=K(_,c,v.stroke),$=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),W=E(T,$,{fill:k,fillOpacity:Qi,stroke:N}),J=V(_);if(eS(J)){var de=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});E(T,de,{strokeWidth:2,fill:k,stroke:N})}return W}function Ee(T,_,v={}){return y(T,_.width,_.height,{fillOpacity:Qi,...v,fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)})}function Le(T,_,v={}){return w(T,_.width,_.height,{fill:ue(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke)})}function j(T,_,v={}){var k=g(T,jt(_,v),kt(_,v),0,{fill:ue(_,s,v.fill),fillOpacity:v.fillOpacity||Qi,stroke:K(_,c,v.stroke),strokeWidth:1.5}),N=V(_);if(b(N,"bpmn:Lane")){var $=N.get("name");xe(T,$,_,v)}return k}function z(T,_,v={}){var k=pe(T,_,v),N=fe(_);if(ht(_)&&(q(k,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!N)){var $=V(_).flowElements||[],W=$.filter(J=>b(J,"bpmn:StartEvent"));W.length===1&&Z(W[0],T,v,_)}return G(T,_,N?"center-top":"center-middle",v),N?L(T,_,void 0,v):L(T,_,["SubProcessMarker"],v),k}function Z(T,_,v,k){var N=22,$={fill:ue(k,s,v.fill),stroke:K(k,c,v.stroke),width:N,height:N},W=V(T).isInterrupting,J=W?0:3,de=W?1:1.2,Je=20,$e=(N-Je)/2,ot="translate("+$e+","+$e+")";y(_,Je,Je,{fill:$.fill,stroke:$.stroke,strokeWidth:de,strokeDasharray:J,transform:ot}),I(T,_,$,k)}function he(T,_,v={}){var k=pe(T,_,v);return G(T,_,"center-middle",v),L(T,_,void 0,v),k}var Ct=this.handlers={"bpmn:AdHocSubProcess":function(T,_,v={}){return fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]),z(T,_,v)},"bpmn:Association":function(T,_,v={}){return v=ve(v,["fill","stroke"]),Ue(T,_,v)},"bpmn:BoundaryEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=V(_),$=N.get("cancelActivity");v={strokeWidth:1.5,fill:ue(_,s,v.fill),fillOpacity:cS,stroke:K(_,c,v.stroke)},$||(v.strokeDasharray="6");var W=Ee(T,_,v);return y(T,_.width,_.height,ba,{...v,fill:"none"}),k&&I(_,T,v),W},"bpmn:BusinessRuleTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),$=E(T,N);q($,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1});var W=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),J=E(T,W);return q(J,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:CallActivity":function(T,_,v={}){return v=ve(v,["fill","stroke"]),z(T,_,{strokeWidth:5,...v})},"bpmn:ComplexGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Le(T,_,v),N=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return E(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:DataInput":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),N=be(T,_,v);return E(T,k,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1}),N},"bpmn:DataInputAssociation":function(T,_,v={}){return v=ve(v,["fill","stroke"]),Ue(T,_,{...v,markerEnd:h(T,"association-end",ue(_,s,v.fill),K(_,c,v.stroke))})},"bpmn:DataObject":function(T,_,v={}){return v=ve(v,["fill","stroke"]),be(T,_,v)},"bpmn:DataObjectReference":M("bpmn:DataObject"),"bpmn:DataOutput":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),N=be(T,_,v);return E(T,k,{strokeWidth:1,fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke)}),N},"bpmn:DataOutputAssociation":function(T,_,v={}){return v=ve(v,["fill","stroke"]),Ue(T,_,{...v,markerEnd:h(T,"association-end",ue(_,s,v.fill),K(_,c,v.stroke))})},"bpmn:DataStoreReference":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return E(T,k,{fill:ue(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke),strokeWidth:2})},"bpmn:EndEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=Ee(T,_,{...v,strokeWidth:4});return k&&I(_,T,v),N},"bpmn:EventBasedGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=V(_),N=Le(T,_,v);y(T,_.width,_.height,_.height*.2,{fill:ue(_,"none",v.fill),stroke:K(_,c,v.stroke),strokeWidth:1});var $=k.get("eventGatewayType"),W=!!k.get("instantiate");function J(){var Je=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});E(T,Je,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:2})}if($==="Parallel"){var de=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});E(T,de,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1})}else $==="Exclusive"&&(W||y(T,_.width,_.height,_.height*.26,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1}),J());return N},"bpmn:ExclusiveGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Le(T,_,v),N=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),$=ye(_);return $.get("isMarkerVisible")&&E(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:Gateway":function(T,_,v={}){return v=ve(v,["fill","stroke"]),Le(T,_,v)},"bpmn:Group":function(T,_,v={}){return v=ve(v,["fill","stroke","width","height"]),g(T,_.width,_.height,Ea,{stroke:K(_,c,v.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:jt(_,v),height:kt(_,v)})},"bpmn:InclusiveGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Le(T,_,v);return y(T,_.width,_.height,_.height*.24,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:2.5}),k},"bpmn:IntermediateEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=Ee(T,_,{...v,strokeWidth:1.5});return y(T,_.width,_.height,ba,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1.5}),k&&I(_,T,v),N},"bpmn:IntermediateCatchEvent":M("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":M("bpmn:IntermediateEvent"),"bpmn:Lane":function(T,_,v={}){return v=ve(v,["fill","stroke","width","height"]),j(T,_,{...v,fillOpacity:lS})},"bpmn:ManualTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return E(T,N,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5}),k},"bpmn:MessageFlow":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=V(_),N=ye(_),$=ue(_,s,v.fill),W=K(_,c,v.stroke),J=x(T,_.waypoints,{markerEnd:h(T,"messageflow-end",$,W),markerStart:h(T,"messageflow-start",$,W),stroke:W,strokeDasharray:"10, 11",strokeWidth:1.5});if(k.get("messageRef")){var de=J.getPointAtLength(J.getTotalLength()/2),Je=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:de.x,y:de.y}}),$e={strokeWidth:1};N.get("messageVisibleKind")==="initiating"?($e.fill=$,$e.stroke=W):($e.fill=W,$e.stroke=$);var ot=E(T,Je,$e),Xt=k.get("messageRef"),Te=Xt.get("name"),Bn=H(T,Te,{align:"center-top",fitBox:!0,style:{fill:W}}),Qs=ot.getBBox(),Bt=Bn.getBBox(),se=de.x-Bt.width/2,we=de.y+Qs.height/2+aS;da(Bn,se,we,0)}return J},"bpmn:ParallelGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Le(T,_,v),N=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return E(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:Participant":function(T,_,v={}){v=ve(v,["fill","stroke","width","height"]);var k=j(T,_,v),N=fe(_),$=Qe(_),W=V(_),J=W.get("name");if(N){var de=$?[{x:30,y:0},{x:30,y:kt(_,v)}]:[{x:0,y:30},{x:jt(_,v),y:30}];C(T,de,{stroke:K(_,c,v.stroke),strokeWidth:sS}),xe(T,J,_,v)}else{var Je=Gr(_,v);$||(Je.height=jt(_,v),Je.width=kt(_,v));var $e=H(T,J,{box:Je,align:"center-middle",style:{fill:Ur(_,l,c,v.stroke)}});if(!$){var ot=-1*kt(_,v);da($e,0,-ot,270)}}return W.get("participantMultiplicity")&&B("ParticipantMultiplicityMarker",T,_,v),k},"bpmn:ReceiveTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=V(_),N=he(T,_,v),$;return k.get("instantiate")?(y(T,28,28,20*.22,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),$=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):$=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(T,$,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),N},"bpmn:ScriptTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return E(T,N,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:SendTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return E(T,N,{fill:K(_,c,v.stroke),stroke:ue(_,s,v.fill),strokeWidth:1}),k},"bpmn:SequenceFlow":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=ue(_,s,v.fill),N=K(_,c,v.stroke),$=x(T,_.waypoints,{markerEnd:h(T,"sequenceflow-end",k,N),stroke:N}),W=V(_),{source:J}=_;if(J){var de=V(J);W.get("conditionExpression")&&b(de,"bpmn:Activity")&&q($,{markerStart:h(T,"conditional-flow-marker",k,N)}),de.get("default")&&(b(de,"bpmn:Gateway")||b(de,"bpmn:Activity"))&&de.get("default")===W&&q($,{markerStart:h(T,"conditional-default-flow-marker",k,N)})}return $},"bpmn:ServiceTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v);y(T,10,10,{fill:ue(_,s,v.fill),stroke:"none",transform:"translate(6, 6)"});var N=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});E(T,N,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),y(T,10,10,{fill:ue(_,s,v.fill),stroke:"none",transform:"translate(11, 10)"});var $=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return E(T,$,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:StartEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=V(_);N.get("isInterrupting")||(v={...v,strokeDasharray:"6"});var $=Ee(T,_,v);return k&&I(_,T,v),$},"bpmn:SubProcess":function(T,_,v={}){return fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]),z(T,_,v)},"bpmn:Task":function(T,_,v={}){return v=ve(v,["fill","stroke"]),he(T,_,v)},"bpmn:TextAnnotation":function(T,_,v={}){v=ve(v,["fill","stroke","width","height"]);var{width:k,height:N}=Gr(_,v),$=g(T,k,N,0,0,{fill:"none",stroke:"none"}),W=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:0,my:0}});E(T,W,{stroke:K(_,c,v.stroke)});var J=V(_),de=J.get("text")||"";return H(T,de,{align:"left-top",box:Gr(_,v),padding:7,style:{fill:Ur(_,l,c,v.stroke)}}),$},"bpmn:Transaction":function(T,_,v={}){fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]);var k=z(T,_,{strokeWidth:1.5,...v}),N=n.style(["no-fill","no-events"],{stroke:K(_,c,v.stroke),strokeWidth:1.5}),$=fe(_);return $||(v={}),g(T,jt(_,v),kt(_,v),Ea-ba,ba,N),k},"bpmn:UserTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=15,$=12,W=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:N,y:$}});E(T,W,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5});var J=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:N,y:$}});E(T,J,{fill:ue(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5});var de=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:N,y:$}});return E(T,de,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:.5}),k},label:function(T,_,v={}){return Be(T,_,v)}};this._drawPath=E,this._renderer=R}Y(Ri,bn),Ri.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ri.prototype.canRender=function(e){return b(e,"bpmn:BaseElement")},Ri.prototype.drawShape=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.drawConnection=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.getShapePath=function(e){return b(e,"bpmn:Event")?tS(e):b(e,"bpmn:Activity")?nS(e,Ea):b(e,"bpmn:Gateway")?iS(e):rS(e)};function ve(e,t=[]){return t.reduce((n,i)=>(e[i]&&(n[i]=e[i]),n),{})}var uS=0,pS={width:150,height:50};function fS(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function dS(e){return nt(e)?D({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function hS(e,t){t.textContent=e;var n;try{var i,r=e==="";return t.textContent=r?"dummy":e,n=t.getBBox(),i={width:n.width+n.x*2,height:n.height},r&&(i.width=0),i}catch(o){return console.log(o),{width:0,height:0}}}function mS(e,t,n){for(var i=e.shift(),r=i,o;;){if(o=hS(r,n),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(t)||r.length<2)return gS(e,r,i,o);r=vS(r,o.width,t)}}function gS(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var Td="­";function yS(e,t){var n=e.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(n.length>1)for(;i=n.shift();)if(i.length+o<t)r.push(i),o+=i.length;else{(i==="-"||i===Td)&&r.pop();break}var a=r[r.length-1];return a&&a===Td&&(r[r.length-1]="-"),r.join("")}function vS(e,t,n){var i=Math.max(e.length*(n/t),1),r=yS(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function _S(){var e=document.getElementById("helper-svg");return e||(e=X("svg"),q(e,{id:"helper-svg"}),lt(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function xa(e){this._config=D({},{size:pS,padding:uS,style:{},align:"center-top"},e||{})}xa.prototype.createText=function(e,t){return this.layoutText(e,t).element},xa.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xa.prototype.layoutText=function(e,t){var n=D({},this._config.size,t.box),i=D({},this._config.style,t.style),r=fS(t.align||this._config.align),o=dS(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=bS(i),c=e.split(/\u00AD?\r?\n/),l=[],u=n.width-o.left-o.right,p=X("text");q(p,{x:0,y:0}),q(p,i);var d=_S();for(ie(d,p);c.length;)l.push(mS(c,u,p));r.vertical==="middle"&&(o.top=o.bottom=0);var h=Tt(l,function(C,x,E){return C+(s||x.height)},0)+o.top+o.bottom,m=Tt(l,function(C,x,E){return x.width>C?x.width:C},0),y=o.top;r.vertical==="middle"&&(y+=(n.height-h)/2),y-=(s||l[0].height)/4;var g=X("text");q(g,i),A(l,function(C){var x;switch(y+=s||C.height,r.horizontal){case"left":x=o.left;break;case"right":x=(a?m:u)-o.right-C.width;break;default:x=Math.max(((a?m:u)-C.width)/2+o.left,0)}var E=X("tspan");q(E,{x,y}),E.textContent=C.text,ie(g,E)}),qe(p);var w={width:m,height:h};return{dimensions:w,element:g}};function bS(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var ES=12,xS=1.2,wS=30;function Pd(e){var t=D({fontFamily:"Arial, sans-serif",fontSize:ES,fontWeight:"normal",lineHeight:xS},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=D({},t,{fontSize:n},e&&e.externalStyle||{}),r=new xa({style:t});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(wS,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Pd.$inject=["config.textRenderer"];function SS(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var i=this.pathMap[t],r,o;n.abspos?(r=n.abspos.x,o=n.abspos.y):(r=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/i.height*n.yScaleFactor,c=n.containerWidth/i.width*n.xScaleFactor,l=0;l<i.heightElements.length;l++)a["y"+l]=i.heightElements[l]*s;for(var u=0;u<i.widthElements.length;u++)a["x"+u]=i.widthElements[u]*c}var p=PS(i.d,{mx:r,my:o,e:a});return p}}var CS=/\{([^{}]+)\}/g,RS=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function TS(e,t,n){var i=n;return t.replace(RS,function(r,o,a,s,c){o=o||s,i&&(o in i&&(i=i[o]),typeof i=="function"&&c&&(i=i()))}),i=(i==null||i==n?e:i)+"",i}function PS(e,t){return String(e).replace(CS,function(n,i){return TS(n,i,t)})}const AS={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ri],textRenderer:["type",Pd],pathMap:["type",SS]};function kS(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}const wa={translate:["value",kS]};function Sa(e,t,n){return D({id:e.id,type:e.$type,businessObject:e,di:t},n)}function DS(e,t,n){var i=e.waypoint;return!i||i.length<2?[te(t),te(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function Ad(e,t,n){return new Error(`element ${dt(t)} referenced by ${dt(e)}#${n} not yet drawn`)}function Cn(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}Cn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Cn.prototype.add=function(e,t,n){var i,r,o;if(b(t,"bpmndi:BPMNPlane")){var a=b(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Sa(e,t,a)),this._canvas.addRootElement(i)}else if(b(t,"bpmndi:BPMNShape")){var s=!fe(e,t),c=NS(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Sa(e,t,{collapsed:s,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),b(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),b(e,"bpmn:Lane")&&(o=0),b(e,"bpmn:DataStoreReference")&&(MS(n,te(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else if(b(t,"bpmndi:BPMNEdge")){var u=this._getSource(e),p=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Sa(e,t,{hidden:r,source:u,target:p,waypoints:DS(t,u,p)})),b(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}else throw new Error(`unknown di ${dt(t)} for element ${dt(e)}`);return Ci(e)&&en(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Cn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${dt(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw Ad(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),r.indexOf(t)===-1&&r.push(t)},Cn.prototype.addLabel=function(e,t,n){var i,r,o;return i=Y1(t,n),r=en(n),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Sa(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!en(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Cn.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i),n)return n;throw i?Ad(e,i,t+"Ref"):new Error(`${dt(e)}#${t} Ref not specified`)},Cn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Cn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Cn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function MS(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function NS(e){return b(e,"bpmn:Group")}const OS={__depends__:[AS,{__depends__:[wa],bpmnImporter:["type",Cn]}]};function Kr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Kr.prototype.next=function(){return this._prefix+ ++this._counter};var IS=new Kr("ov"),BS=500;function it(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=IS,this._overlayDefaults=D({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=LS(n.getContainer()),this._init()}it.$inject=["config.overlays","eventBus","canvas","elementRegistry"],it.prototype.get=function(e){if(Rt(e)&&(e={id:e}),Rt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?ce(t.overlays,Jt({type:e.type})):t.overlays.slice():[]}else return e.type?ce(this._overlays,Jt({type:e.type})):e.id?this._overlays[e.id]:null},it.prototype.add=function(e,t,n){if(nt(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=D({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},it.prototype.remove=function(e){var t=this.get(e)||[];oe(t)||(t=[t]);var n=this;A(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(un(i.html),un(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},it.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},it.prototype.show=function(){Ca(this._overlayRoot)},it.prototype.hide=function(){Ca(this._overlayRoot,!1)},it.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Zo(this._overlayRoot)},it.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Ye(t);i=o.x,r=o.y}kd(n,i,r),ut(e.html,"data-container-id",t.id)},it.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,i=e.element,r=t.left,o=t.top;if(t.right!==void 0){var a;i.waypoints?a=Ye(i).width:a=i.width,r=t.right*-1+a}if(t.bottom!==void 0){var s;i.waypoints?s=Ye(i).height:s=i.height,o=t.bottom*-1+s}kd(n,r||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},it.prototype._createOverlayContainer=function(e){var t=Pe('<div class="djs-overlays" />');lt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},it.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Dd(this._overlayRoot,n)},it.prototype._getOverlayContainer=function(e,t){var n=_e(this._overlayContainers,function(i){return i.element===e});return!n&&!t?this._createOverlayContainer(e):n},it.prototype._addOverlay=function(e){var t=e.id,n=e.element,i=e.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Rt(i)&&(i=Pe(i)),o=this._getOverlayContainer(n),r=Pe('<div class="djs-overlay" data-overlay-id="'+t+'">'),lt(r,{position:"absolute"}),r.appendChild(i),e.type&&Oe(r).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Ca(r,a===s),e.htmlContainer=r,o.overlays.push(e),o.html.appendChild(r),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},it.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(tt(r)&&r>t.scale||tt(o)&&o<t.scale))&&(c=!1),Ca(a,c),this._updateOverlayScale(e,t)},it.prototype._updateOverlayScale=function(e,t){var n=e.scale,i,r,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(i=1,r=1):(i=n.min,r=n.max),tt(i)&&t.scale<i&&(a=(1/t.scale||1)*i),tt(r)&&t.scale>r&&(a=(1/t.scale||1)*r)),tt(a)&&(s="scale("+a+","+a+")"),Dd(o,s)},it.prototype._updateOverlaysVisibilty=function(e){var t=this;A(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},it.prototype._init=function(){var e=this._eventBus,t=this;function n(i){t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}e.on("canvas.viewbox.changing",function(i){t.hide()}),e.on("canvas.viewbox.changed",function(i){n(i.viewbox)}),e.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=t.get({element:r});A(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(r);if(a){un(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",BS,function(i){var r=i.element,o=t._getOverlayContainer(r,!0);o&&(A(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(i){var r=t._getOverlayContainer(i.element,!0);r&&Oe(r.html)[i.add?"add":"remove"](i.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function LS(e){var t=Pe('<div class="djs-overlay-container" />');return lt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function kd(e,t,n){lt(e,{left:t+"px",top:n+"px"})}function Ca(e,t){e.style.display=t===!1?"none":""}function Dd(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const Ra={__init__:["overlays"],overlays:["type",it]};function Md(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(Sf(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Md.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const nl={__init__:["changeSupport"],changeSupport:["type",Md]};var $S=1e3;function F(e){this._eventBus=e}F.$inject=["eventBus"];function jS(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}F.prototype.on=function(e,t,n,i,r,o){if((Ge(t)||ee(t))&&(o=r,r=i,i=n,n=t,t=null),Ge(n)&&(o=r,r=i,i=n,n=$S),nt(r)&&(o=r,r=!1),!Ge(i))throw new Error("handlerFn must be a function");oe(e)||(e=[e]);var a=this._eventBus;A(e,function(s){var c=["commandStack",s,t].filter(function(l){return l}).join(".");a.on(c,n,r?jS(i,o):i,o)})},F.prototype.canExecute=Rn("canExecute"),F.prototype.preExecute=Rn("preExecute"),F.prototype.preExecuted=Rn("preExecuted"),F.prototype.execute=Rn("execute"),F.prototype.executed=Rn("executed"),F.prototype.postExecute=Rn("postExecute"),F.prototype.postExecuted=Rn("postExecuted"),F.prototype.revert=Rn("revert"),F.prototype.reverted=Rn("reverted");function Rn(e){return function(n,i,r,o,a){(Ge(n)||ee(n))&&(a=o,o=r,r=i,i=n,n=null),this.on(n,e,i,r,o,a)}}function il(e,t){t.invoke(F,this),this.executed(function(n){var i=n.context;i.rootElement?e.setRootElement(i.rootElement):i.rootElement=e.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&e.setRootElement(i.rootElement)})}Y(il,F),il.$inject=["canvas","injector"];const FS={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",il]};function qr(e){return CSS.escape(e)}var HS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Nd(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return HS[t]})}var Od="_plane";function Id(e){var t=e.id;return VS(t)}function Tn(e){var t=e.id;return b(e,"bpmn:SubProcess")?Bd(t):t}function Ti(e){return Bd(e)}function Ta(e){var t=ye(e);return b(t,"bpmndi:BPMNPlane")}function Bd(e){return e+Od}function VS(e){return e.replace(new RegExp(Od+"$"),"")}var zS="bjs-breadcrumbs-shown";function Ld(e,t,n){var i=Pe('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Oe(r);r.appendChild(i);var a=[];e.on("element.changed",function(c){var l=c.element,u=V(l),p=_e(a,function(d){return d===u});p&&s()});function s(c){c&&(a=WS(c));var l=a.flatMap(function(p){var d=n.findRoot(Tn(p))||n.findRoot(p.id);if(!d&&b(p,"bpmn:Process")){var h=t.find(function(g){var w=V(g);return w&&w.get("processRef")===p});d=h&&n.findRoot(h.id)}if(!d)return[];var m=Nd(p.name||p.id),y=Pe('<li><span class="bjs-crumb"><a title="'+m+'">'+m+"</a></span></li>");return y.addEventListener("click",function(){n.setRootElement(d)}),y});i.innerHTML="";var u=l.length>1;o.toggle(zS,u),l.forEach(function(p){i.appendChild(p)})}e.on("root.set",function(c){s(c.element)})}Ld.$inject=["eventBus","elementRegistry","canvas"];function WS(e){for(var t=V(e),n=[],i=t;i;i=i.$parent)(b(i,"bpmn:SubProcess")||b(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function $d(e,t){var n=null,i=new US;e.on("root.set",function(r){var o=r.element,a=t.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!b(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,l=(a.y-s.y)*a.scale;(c!==0||l!==0)&&t.scroll({dx:c,dy:l}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}$d.$inject=["eventBus","canvas"];function US(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var jd={x:180,y:160};function Pi(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}Pi.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(t._processToDiagramMap[i.plane.bpmnElement.id]=i)});var n=e.diagrams.filter(i=>i.plane).flatMap(i=>t._createNewDiagrams(i.plane));n.forEach(function(i){t._movePlaneElementsToOrigin(i.plane)})}},Pi.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;b(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),KS(a,e)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),r},Pi.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=GS(e),i={x:n.x-jd.x,y:n.y-jd.y};t.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Pi.prototype._moveToDiPlane=function(e,t){var n=Fd(e),i=n.plane.get("planeElement");i.splice(i.indexOf(e),1),t.get("planeElement").push(e)},Pi.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Pi.$inject=["eventBus","moddle"];function Fd(e){return b(e,"bpmndi:BPMNDiagram")?e:Fd(e.$parent)}function GS(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var i=Q(n.bounds);t.top=Math.min(i.top,t.top),t.left=Math.min(i.left,t.left)}}),ua(t)}function KS(e,t){var n=e.$parent;return!(!b(n,"bpmn:SubProcess")||n===t.bpmnElement||le(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Pa=250,qS='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',YS="bjs-drilldown-empty";function Yn(e,t,n,i,r){F.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Y(Yn,F),Yn.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Yn.prototype._canDrillDown=function(e){var t=this._canvas;return b(e,"bpmn:SubProcess")&&t.findRoot(Tn(e))},Yn.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=V(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Oe(i.html).toggle(YS,!r)}},Yn.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=V(e),r=n.get({element:e,type:"drilldown"});r.length&&this._removeOverlay(e);var o=Pe('<button type="button" class="bjs-drilldown">'+qS+"</button>"),a=i.get("name")||i.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(Tn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},Yn.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Yn.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const XS={__depends__:[Ra,nl,FS],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ld],drilldownCentering:["type",$d],drilldownOverlayBehavior:["type",Yn],subprocessCompatibility:["type",Pi]};function Hd(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function er(e){return e.originalEvent||e.srcEvent}function rl(e){Hd(e),Hd(er(e))}function Ai(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Vd(){return/mac/i.test(navigator.platform)}function zd(e,t){return(er(e)||e).button===t}function Xn(e){return zd(e,0)}function ZS(e){return zd(e,1)}function Yr(e){var t=er(e)||e;return Xn(e)?Vd()?t.metaKey:t.ctrlKey:!1}function Aa(e){var t=er(e)||e;return Xn(e)&&t.shiftKey}function JS(e){return!0}function ka(e){return Xn(e)||ZS(e)}var Wd=500;function Ud(e,t,n){var i=this;function r(P,I,O){if(!s(P,I)){var B,L,H;O?L=t.getGraphics(O):(B=I.delegateTarget||I.target,B&&(L=B,O=t.get(L))),!(!L||!O)&&(H=e.fire(P,{element:O,gfx:L,originalEvent:I}),H===!1&&(I.stopPropagation(),I.preventDefault()))}}var o={};function a(P){return o[P]}function s(P,I){var O=l[P]||Xn;return!O(I)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":JS,"element.mousedown":ka,"element.mouseup":ka,"element.click":ka,"element.dblclick":ka};function u(P,I,O){var B=c[P];if(!B)throw new Error("unmapped DOM event name <"+P+">");return r(B,I,O)}var p="svg, .djs-element";function d(P,I,O,B){var L=o[O]=function(H){r(O,H)};B&&(l[O]=B),L.$delegate=Pt.bind(P,p,I,L)}function h(P,I,O){var B=a(O);B&&Pt.unbind(P,I,B.$delegate)}function m(P){A(c,function(I,O){d(P,O,I)})}function y(P){A(c,function(I,O){h(P,O,I)})}e.on("canvas.destroy",function(P){y(P.svg)}),e.on("canvas.init",function(P){m(P.svg)}),e.on(["shape.added","connection.added"],function(P){var I=P.element,O=P.gfx;e.fire("interactionEvents.createHit",{element:I,gfx:O})}),e.on(["shape.changed","connection.changed"],Wd,function(P){var I=P.element,O=P.gfx;e.fire("interactionEvents.updateHit",{element:I,gfx:O})}),e.on("interactionEvents.createHit",Wd,function(P){var I=P.element,O=P.gfx;i.createDefaultHit(I,O)}),e.on("interactionEvents.updateHit",function(P){var I=P.element,O=P.gfx;i.updateDefaultHit(I,O)});var g=S("djs-hit djs-hit-stroke"),w=S("djs-hit djs-hit-click-stroke"),C=S("djs-hit djs-hit-all"),x=S("djs-hit djs-hit-no-move"),E={all:C,"click-stroke":w,stroke:g,"no-move":x};function S(P,I){return I=D({stroke:"white",strokeWidth:15},I||{}),n.cls(P,["no-fill","no-border"],I)}function R(P,I){var O=E[I];if(!O)throw new Error("invalid hit type <"+I+">");return q(P,O),P}function M(P,I){ie(P,I)}this.removeHits=function(P){var I=Rc(".djs-hit",P);A(I,qe)},this.createDefaultHit=function(P,I){var O=P.waypoints,B=P.isFrame,L;return O?this.createWaypointsHit(I,O):(L=B?"stroke":"all",this.createBoxHit(I,L,{width:P.width,height:P.height}))},this.createWaypointsHit=function(P,I){var O=ra(I);return R(O,"stroke"),M(P,O),O},this.createBoxHit=function(P,I,O){O=D({x:0,y:0},O);var B=X("rect");return R(B,I),q(B,O),M(P,B),B},this.updateDefaultHit=function(P,I){var O=Se(".djs-hit",I);if(O)return P.waypoints?bf(O,P.waypoints):q(O,{width:P.width,height:P.height}),O},this.fire=r,this.triggerMouseEvent=u,this.mouseHandler=a,this.registerEvent=d,this.unregisterEvent=h}Ud.$inject=["eventBus","elementRegistry","styles"];const Da={__init__:["interactionEvents"],interactionEvents:["type",Ud]};function tr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","root.set"],function(i){n.select(null)})}tr.$inject=["eventBus","canvas"],tr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},tr.prototype.get=function(){return this._selectedElements},tr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},tr.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();oe(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter(function(a){var s=r.findRoot(a);return o===s}),t?A(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Gd="hover",Kd="selected";function qd(e,t){this._canvas=e;function n(r,o){e.addMarker(r,o)}function i(r,o){e.removeMarker(r,o)}t.on("element.hover",function(r){n(r.element,Gd)}),t.on("element.out",function(r){i(r.element,Gd)}),t.on("selection.changed",function(r){function o(l){i(l,Kd)}function a(l){n(l,Kd)}var s=r.oldSelection,c=r.newSelection;A(s,function(l){c.indexOf(l)===-1&&o(l)}),A(c,function(l){s.indexOf(l)===-1&&a(l)})})}qd.$inject=["canvas","eventBus"];function Yd(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=o.hints||{},l=c.autoSelect;if(a){if(l===!1)return;oe(l)?t.select(l):t.select(s.filter(QS))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id),s=_e(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(r){if(Xn(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Aa(r);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Yd.$inject=["eventBus","selection","canvas","elementRegistry"];function QS(e){return!e.hidden}const tn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Da],selection:["type",tr],selectionVisuals:["type",qd],selectionBehavior:["type",Yd]};function Zn(e){ke.call(this,e)}Y(Zn,ke),Zn.prototype._modules=[OS,XS,Ra,tn,wa],Zn.prototype._moddleExtensions={};var eC=["c","C"],tC=["v","V"],nC=["y","Y"],Xd=["z","Z"];function iC(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ft(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function rt(e,t){return e=oe(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function ol(e){return e.shiftKey}function rC(e){return Ft(e)&&rt(eC,e)}function oC(e){return Ft(e)&&rt(tC,e)}function aC(e){return Ft(e)&&!ol(e)&&rt(Xd,e)}function sC(e){return Ft(e)&&(rt(nC,e)||rt(Xd,e)&&ol(e))}var Ma="keyboard.keydown",cC="keyboard.keyup",lC=1e3,Zd="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function _t(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Zd));var i=e&&e.bind!==!1;t.on("canvas.init",function(r){n._target=r.svg,i&&n.bind(),n._fire("init")})}_t.$inject=["config.keyboard","eventBus"],_t.prototype._keydownHandler=function(e){this._keyHandler(e,Ma)},_t.prototype._keyupHandler=function(e){this._keyHandler(e,cC)},_t.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var i={keyEvent:e};n=this._eventBus.fire(t||Ma,i),n&&e.preventDefault()}},_t.prototype._isEventIgnored=function(e){return!1},_t.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Zd)),this.unbind(),e=this._node=this._target,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")},_t.prototype.getBinding=function(){return this._node},_t.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null},_t.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},_t.prototype.addListener=function(e,t,n){Ge(e)&&(n=t,t=e,e=lC),this._eventBus.on(n||Ma,e,t)},_t.prototype.removeListener=function(e,t){this._eventBus.off(t||Ma,e)},_t.prototype.hasModifier=iC,_t.prototype.isCmd=Ft,_t.prototype.isShift=ol,_t.prototype.isKey=rt;var uC=500;function nr(e,t){var n=this;e.on("editorActions.init",uC,function(i){var r=i.editorActions;n.registerBindings(t,r)})}nr.$inject=["eventBus","keyboard"],nr.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){var r=i.keyEvent;if(aC(r))return t.trigger("undo"),!0}),n("redo",function(i){var r=i.keyEvent;if(sC(r))return t.trigger("redo"),!0}),n("copy",function(i){var r=i.keyEvent;if(rC(r))return t.trigger("copy"),!0}),n("paste",function(i){var r=i.keyEvent;if(oC(r))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(rt(["+","Add","="],r)&&Ft(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(rt(["-","Subtract"],r)&&Ft(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(rt("0",r)&&Ft(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){var r=i.keyEvent;if(rt(["Backspace","Delete","Del"],r))return t.trigger("removeSelection"),!0})};const al={__init__:["keyboard","keyboardBindings"],keyboard:["type",_t],keyboardBindings:["type",nr]};var pC={moveSpeed:50,moveSpeedAccelerated:200};function Jd(e,t,n){var i=this;this._config=D({},pC,e||{}),t.addListener(r);function r(o){var a=o.keyEvent,s=i._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,l;switch(a.key){case"ArrowLeft":case"Left":l="left";break;case"ArrowUp":case"Up":l="up";break;case"ArrowRight":case"Right":l="right";break;case"ArrowDown":case"Down":l="down";break}return i.moveCanvas({speed:c,direction:l}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,l=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=l;break;case"up":s=l;break;case"right":a=-l;break;case"down":s=-l;break}n.scroll({dx:a,dy:s})}}Jd.$inject=["config.keyboardMove","keyboard","canvas"];const Qd={__depends__:[al],__init__:["keyboardMove"],keyboardMove:["type",Jd]};var fC=/^djs-cursor-.*$/;function Na(e){var t=Oe(document.body);t.removeMatching(fC),e&&t.add("djs-cursor-"+e)}function eh(){Na(null)}var dC=5e3;function th(e,t){t=t||"element.click";function n(){return!1}return e.once(t,dC,n),function(){e.off(t,n)}}function Xr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}var hC=15;function nh(e,t){var n;function i(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)});function r(s){var c=n.start,l=n.button,u=Ai(s),p=nn(u,c);if(!n.dragging&&mC(p)>hC&&(n.dragging=!0,l===0&&th(e),Na("grab")),n.dragging){var d=n.last||n.start;p=nn(u,d),t.scroll({dx:p.x,dy:p.y}),n.last=u}s.preventDefault()}function o(s){ae.unbind(document,"mousemove",r),ae.unbind(document,"mouseup",o),n=null,eh()}function a(s){if(!Ui(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:Ai(s)},ae.bind(document,"mousemove",r),ae.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}nh.$inject=["eventBus","canvas"];function mC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const ih={__init__:["moveCanvas"],moveCanvas:["type",nh]};function sl(e){return Math.log(e)/Math.log(10)}function rh(e,t){var n=sl(e.min),i=sl(e.max),r=Math.abs(n)+Math.abs(i);return r/t}function gC(e,t){return Math.max(e.min,Math.min(e.max,t))}var yC=Math.sign||function(e){return e>=0?1:-1},cl={min:.2,max:4},oh=10,vC=.1,_C=.75;function gn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=xt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||_C;var i=this;t.on("canvas.focus.changed",function(r){i._init(r.focused&&e.enabled!==!1)})}gn.$inject=["config.zoomScroll","eventBus","canvas"],gn.prototype.scroll=function(t){this._canvas.scroll(t)},gn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},gn.prototype.zoom=function(t,n){var i=rh(cl,oh*2);this._totalDelta+=t,Math.abs(this._totalDelta)>vC&&(this._zoom(t,n,i),this._totalDelta=0)},gn.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var n=this._container;t.preventDefault();var i=t.ctrlKey||Vd()&&t.metaKey,r=t.shiftKey,o=-1*this._scale,a;if(i?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,i){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*yC(t.deltaY)*o,this.zoom(a,c)}else r?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}},gn.prototype.stepZoom=function(t,n){var i=rh(cl,oh);this._zoom(t,n,i)},gn.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=sl(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(gC(cl,s),t)},gn.prototype.toggle=function(t){var n=this._container,i=this._handleWheel,r=this._enabled;return typeof t>"u"&&(t=!r),r!==t&&ae[t?"bind":"unbind"](n,"wheel",i,!1),this._enabled=t,t},gn.prototype._init=function(e){this.toggle(e)};const ah={__init__:["zoomScroll"],zoomScroll:["type",gn]};function Zr(e){Zn.call(this,e)}Y(Zr,Zn),Zr.prototype._navigationModules=[Qd,ih,ah],Zr.prototype._modules=[].concat(Zn.prototype._modules,Zr.prototype._navigationModules);function ll(e){return e&&e[e.length-1]}function sh(e){return e.y}function ch(e){return e.x}var bC={left:ch,center:ch,right:function(e){return e.x+e.width},top:sh,middle:sh,bottom:function(e){return e.y+e.height}};function ir(e,t){this._modeling=e,this._rules=t}ir.$inject=["modeling","rules"],ir.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",i="width";return t.indexOf(e)!==-1&&(n="y",i="height"),{axis:n,dimension:i}},ir.prototype._isType=function(e,t){return t.indexOf(e)!==-1},ir.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),i=n.axis,r=n.dimension,o={},a={},s=!1,c,l,u;function p(d,h){return Math.round((d[i]+h[i]+h[r])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][i];else if(this._isType(e,["right","bottom"]))u=ll(t),o[e]=u[i]+u[r];else if(this._isType(e,["center","middle"])){if(A(t,function(d){var h=d[i]+Math.round(d[r]/2);a[h]?a[h].elements.push(d):a[h]={elements:[d],center:h}}),c=cn(a,function(d){return d.elements.length>1&&(s=!0),d.elements.length}),s)return o[e]=ll(c).center,o;l=t[0],t=cn(t,function(d){return d[i]+d[r]}),u=ll(t),o[e]=p(l,u)}return o},ir.prototype.trigger=function(e,t){var n=this._modeling,i,r=ce(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),oe(i)&&(r=i),!(r.length<2||!i)){var o=bC[t],a=cn(r,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};const EC={__init__:["alignElements"],alignElements:["type",ir]},xC=new Kr;function rr(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}rr.$inject=["eventBus"],rr.prototype.schedule=function(e,t=xC.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},rr.prototype._schedule=function(e,t){const n=wC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(r){n.reject(r)}}catch(r){console.error("Scheduler#_schedule execution failed",r)}}),promise:n.promise}},rr.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},rr.prototype._cancel=function(e){clearTimeout(e.executionId)};function wC(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const SC={scheduler:["type",rr]};var CC="djs-element-hidden",Oa=".entry",RC=1e3,lh=8,TC=300;function He(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}He.$inject=["canvas","elementRegistry","eventBus","scheduler"],He.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?n.length===1?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=oe(r)?r:[r],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current,r=oe(i.target)?i.target:[i.target];r.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},He.prototype._createContainer=function(){var e=Pe('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},He.prototype.registerProvider=function(e,t){t||(t=e,e=RC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},He.prototype.getEntries=function(e){var t=this._getProviders(),n=oe(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return A(t,function(r){if(Ge(r[n])){var o=r[n](e);Ge(o)?i=o(i):A(o,function(a,s){i[s]=a})}}),i},He.prototype.trigger=function(e,t,n){var i=this,r,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(r=ut(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){i._mouseout=i.triggerEntry(r,"hover",o,n)},TC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(r,e,o,n)},He.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Ge(s)){if(t==="click")return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},He.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},He.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},He.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),i;A(t,function(r,o){var a=r.group||"default",s=Pe(r.html||'<div class="entry" draggable="true"></div>'),c;ut(s,"data-action",o),c=Se("[data-group="+qr(a)+"]",n),c||(c=Pe('<div class="group"></div>'),ut(c,"data-group",a),n.appendChild(c)),c.appendChild(s),r.className&&PC(s,r.className),r.title&&ut(s,"title",r.title),r.imageUrl&&(i=Pe("<img>"),ut(i,"src",r.imageUrl),i.style.width="100%",i.style.height="100%",s.appendChild(i))}),Oe(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},He.prototype._createHtml=function(e){var t=this,n=Pe('<div class="djs-context-pad"></div>');return Pt.bind(n,Oa,"click",function(i){t.trigger("click",i)}),Pt.bind(n,Oa,"dragstart",function(i){t.trigger("dragstart",i)}),Pt.bind(n,Oa,"mouseover",function(i){t.trigger("mouseover",i)}),Pt.bind(n,Oa,"mouseout",function(i){t.trigger("mouseout",i)}),ae.bind(n,"mousedown",function(i){i.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},He.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&kC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},He.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},He.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return oe(e)!==oe(n)?!1:oe(e)?e.length===n.length&&vi(e,function(i){return n.includes(i)}):n===e},He.prototype.isShown=function(){return this.isOpen()&&Oe(this._current.html).has("open")},He.prototype.show=function(){this.isOpen()&&(Oe(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},He.prototype.hide=function(){this.isOpen()&&(Oe(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},He.prototype._getPosition=function(e){if(!oe(e)&&Ce(e)){var t=this._canvas.viewbox(),n=AC(e),i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+lh*this._canvas.zoom(),top:r}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+lh*this._canvas.zoom(),top:s.top-a.top}},He.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(i){i in n&&(t.style[i]=n[i]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},He.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target,i=oe(n)?n:[n],r=i.some(function(o){return t._canvas.hasMarker(o,CC)});r?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},He.prototype._getTargetBounds=function(e){var t=this,n=oe(e)?e:[e],i=n.map(function(r){return t._canvas.getGraphics(r)});return i.reduce(function(r,o){const a=o.getBoundingClientRect();return r.top=Math.min(r.top,a.top),r.right=Math.max(r.right,a.right),r.bottom=Math.max(r.bottom,a.bottom),r.left=Math.min(r.left,a.left),r.x=r.left,r.y=r.top,r.width=r.right-r.left,r.height=r.bottom-r.top,r},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function PC(e,t){var n=Oe(e);t=oe(t)?t:t.split(/\s+/g),t.forEach(function(i){n.add(i)})}function AC(e){return e.waypoints[e.waypoints.length-1]}function kC(e,t){return e=oe(e)?e:[e],t=oe(t)?t:[t],e.length===t.length&&vi(e,function(n){return t.includes(n)})}const uh={__depends__:[Da,SC,Ra],contextPad:["type",He]};var Ia,De,ph,ki,fh,dh,hh,mh,ul,pl,fl,Jr={},gh=[],DC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ba=Array.isArray;function Pn(e,t){for(var n in t)e[n]=t[n];return e}function dl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function yh(e,t,n){var i,r,o,a={};for(o in t)o=="key"?i=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ia.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]==null&&(a[o]=e.defaultProps[o]);return La(e,a,i,r,null)}function La(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++ph,__i:-1,__u:0};return r==null&&De.vnode!=null&&De.vnode(o),o}function $a(e){return e.children}function ja(e,t){this.props=e,this.context=t}function or(e,t){if(t==null)return e.__?or(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?or(e):null}function vh(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return vh(e)}}function _h(e){(!e.__d&&(e.__d=!0)&&ki.push(e)&&!Fa.__r++||fh!=De.debounceRendering)&&((fh=De.debounceRendering)||dh)(Fa)}function Fa(){for(var e,t,n,i,r,o,a,s=1;ki.length;)ki.length>s&&ki.sort(hh),e=ki.shift(),s=ki.length,e.__d&&(n=void 0,r=(i=(t=e).__v).__e,o=[],a=[],t.__P&&((n=Pn({},i)).__v=i.__v+1,De.vnode&&De.vnode(n),hl(t.__P,n,i,t.__n,t.__P.namespaceURI,32&i.__u?[r]:null,o,r??or(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Sh(o,n,a),n.__e!=r&&vh(n)));Fa.__r=0}function bh(e,t,n,i,r,o,a,s,c,l,u){var p,d,h,m,y,g,w=i&&i.__k||gh,C=t.length;for(c=MC(n,t,w,c,C),p=0;p<C;p++)(h=n.__k[p])!=null&&(d=h.__i==-1?Jr:w[h.__i]||Jr,h.__i=p,g=hl(e,h,d,r,o,a,s,c,l,u),m=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&ml(d.ref,null,h),u.push(h.ref,h.__c||m,h)),y==null&&m!=null&&(y=m),4&h.__u||d.__k===h.__k?c=Eh(h,c,e):typeof h.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),h.__u&=-7);return n.__e=y,c}function MC(e,t,n,i,r){var o,a,s,c,l,u=n.length,p=u,d=0;for(e.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=o+d,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?La(null,a,null,null,null):Ba(a)?La($a,{children:a},null,null,null):a.constructor==null&&a.__b>0?La(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(l=a.__i=NC(a,n,c,p))!=-1&&(p--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(r>u?d--:r<u&&d++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?d--:l==c+1?d++:(l>c?d--:d++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<u;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=or(s)),Rh(s,s));return i}function Eh(e,t,n){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Eh(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=or(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function NC(e,t,n,i){var r,o,a=e.key,s=e.type,c=t[n];if(c===null&&e.key==null||c&&a==c.key&&s==c.type&&(2&c.__u)==0)return n;if(i>(c!=null&&(2&c.__u)==0?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;){if(r>=0){if((c=t[r])&&(2&c.__u)==0&&a==c.key&&s==c.type)return r;r--}if(o<t.length){if((c=t[o])&&(2&c.__u)==0&&a==c.key&&s==c.type)return o;o++}}return-1}function xh(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||DC.test(t)?n:n+"px"}function Ha(e,t,n,i,r){var o;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||xh(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||xh(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(mh,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=ul,e.addEventListener(t,o?fl:pl,o)):e.removeEventListener(t,o?fl:pl,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function wh(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ul++;else if(t.t<n.u)return;return n(De.event?De.event(t):t)}}}function hl(e,t,n,i,r,o,a,s,c,l){var u,p,d,h,m,y,g,w,C,x,E,S,R,M,P,I,O,B=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(u=De.__b)&&u(t);e:if(typeof B=="function")try{if(w=t.props,C="prototype"in B&&B.prototype.render,x=(u=B.contextType)&&i[u.__c],E=u?x?x.props.value:u.__:i,n.__c?g=(p=t.__c=n.__c).__=p.__E:(C?t.__c=p=new B(w,E):(t.__c=p=new ja(w,E),p.constructor=B,p.render=IC),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=E,p.__n=i,d=p.__d=!0,p.__h=[],p._sb=[]),C&&p.__s==null&&(p.__s=p.state),C&&B.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Pn({},p.__s)),Pn(p.__s,B.getDerivedStateFromProps(w,p.__s))),h=p.props,m=p.state,p.__v=t,d)C&&B.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),C&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(C&&B.getDerivedStateFromProps==null&&w!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(w,E),!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(w,p.__s,E)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(p.props=w,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(L){L&&(L.__=t)}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(w,p.__s,E),C&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,m,y)})}if(p.context=E,p.props=w,p.__P=e,p.__e=!1,R=De.__r,M=0,C){for(p.state=p.__s,p.__d=!1,R&&R(t),u=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,R&&R(t),u=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++M<25);p.state=p.__s,p.getChildContext!=null&&(i=Pn(Pn({},i),p.getChildContext())),C&&!d&&p.getSnapshotBeforeUpdate!=null&&(y=p.getSnapshotBeforeUpdate(h,m)),I=u,u!=null&&u.type===$a&&u.key==null&&(I=Ch(u.props.children)),s=bh(e,Ba(I)?I:[I],t,n,i,r,o,a,s,c,l),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),g&&(p.__E=p.__=null)}catch(L){if(t.__v=null,c||o!=null)if(L.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(O=o.length;O--;)dl(o[O]);else t.__e=n.__e,t.__k=n.__k;De.__e(L,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=OC(n.__e,t,n,i,r,o,a,c,l);return(u=De.diffed)&&u(t),128&t.__u?void 0:s}function Sh(e,t,n){for(var i=0;i<n.length;i++)ml(n[i],n[++i],n[++i]);De.__c&&De.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){De.__e(o,r.__v)}})}function Ch(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Ba(e)?e.map(Ch):Pn({},e)}function OC(e,t,n,i,r,o,a,s,c){var l,u,p,d,h,m,y,g=n.props,w=t.props,C=t.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;l<o.length;l++)if((h=o[l])&&"setAttribute"in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,o[l]=null;break}}if(e==null){if(C==null)return document.createTextNode(w);e=document.createElementNS(r,C,w.is&&w),s&&(De.__m&&De.__m(t,o),s=!1),o=null}if(C==null)g===w||s&&e.data==w||(e.data=w);else{if(o=o&&Ia.call(e.childNodes),g=n.props||Jr,!s&&o!=null)for(g={},l=0;l<e.attributes.length;l++)g[(h=e.attributes[l]).name]=h.value;for(l in g)if(h=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=h;else if(!(l in w)){if(l=="value"&&"defaultValue"in w||l=="checked"&&"defaultChecked"in w)continue;Ha(e,l,null,h,r)}}for(l in w)h=w[l],l=="children"?d=h:l=="dangerouslySetInnerHTML"?u=h:l=="value"?m=h:l=="checked"?y=h:s&&typeof h!="function"||g[l]===h||Ha(e,l,h,g[l],r);if(u)s||p&&(u.__html==p.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(p&&(e.innerHTML=""),bh(t.type=="template"?e.content:e,Ba(d)?d:[d],t,n,i,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&or(n,0),s,c),o!=null)for(l=o.length;l--;)dl(o[l]);s||(l="value",C=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[l]||C=="progress"&&!m||C=="option"&&m!=g[l])&&Ha(e,l,m,g[l],r),l="checked",y!=null&&y!=e[l]&&Ha(e,l,y,g[l],r))}return e}function ml(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(r){De.__e(r,n)}}function Rh(e,t,n){var i,r;if(De.unmount&&De.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ml(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){De.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Rh(i[r],t,n||typeof e.type!="function");n||dl(e.__e),e.__c=e.__=e.__e=void 0}function IC(e,t,n){return this.constructor(e,n)}function Th(e,t,n){var i,r,o,a;t==document&&(t=document.documentElement),De.__&&De.__(e,t),r=(i=!1)?null:t.__k,o=[],a=[],hl(t,e=t.__k=yh($a,null,[e]),r||Jr,Jr,t.namespaceURI,r?null:t.firstChild?Ia.call(t.childNodes):null,o,r?r.__e:t.firstChild,i,a),Sh(o,e,a)}Ia=gh.slice,De={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},ph=0,ja.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Pn({},this.state),typeof e=="function"&&(e=e(Pn({},n),this.props)),e&&Pn(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_h(this))},ja.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_h(this))},ja.prototype.render=$a,ki=[],dh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,hh=function(e,t){return e.__v.__b-t.__v.__b},Fa.__r=0,mh=/(PointerCapture)$|Capture$/i,ul=0,pl=wh(!1),fl=wh(!0);var Ph=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];a===3?i[0]=s:a===4?i[1]=Object.assign(i[1]||{},s):a===5?(i[1]=i[1]||{})[t[++o]]=s:a===6?i[1][t[++o]]+=s+"":a?(r=e.apply(s,Ph(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},Ah=new Map;function BC(e){var t=Ah.get(this);return t||(t=new Map,Ah.set(this,t)),(t=Ph(this,t.get(e)||(t.set(e,t=function(n){for(var i,r,o=1,a="",s="",c=[0],l=function(d){o===1&&(d||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,d,a):o===3&&(d||a)?(c.push(3,d,a),o=2):o===2&&a==="..."&&d?c.push(4,d,0):o===2&&a&&!d?c.push(5,0,!0,a):o>=5&&((a||!d&&o===5)&&(c.push(o,0,a,r),o=6),d&&(c.push(o,d,0,r),o=6)),a=""},u=0;u<n.length;u++){u&&(o===1&&l(),l(u));for(var p=0;p<n[u].length;p++)i=n[u][p],o===1?i==="<"?(l(),c=[c],o=3):a+=i:o===4?a==="--"&&i===">"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(l(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[u][p+1]===">")?(l(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
14
+ `||i==="\r"?(l(),o=2):a+=i),o===3&&a==="!--"&&(o=4,c=c[0])}return l(),c}(e)),t),arguments,[])).length>1?t:t[0]}var Ie=BC.bind(yh),ar,Ve,gl,kh,Qr=0,Dh=[],Ze=De,Mh=Ze.__b,Nh=Ze.__r,Oh=Ze.diffed,Ih=Ze.__c,Bh=Ze.unmount,Lh=Ze.__;function Va(e,t){Ze.__h&&Ze.__h(Ve,e,Qr||t),Qr=0;var n=Ve.__H||(Ve.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function yl(e){return Qr=1,LC(Fh,e)}function LC(e,t,n){var i=Va(ar++,2);if(i.t=e,!i.__c&&(i.__=[Fh(void 0,t),function(s){var c=i.__N?i.__N[0]:i.__[0],l=i.t(c,s);c!==l&&(i.__N=[l,i.__[1]],i.__c.setState({}))}],i.__c=Ve,!Ve.__f)){var r=function(s,c,l){if(!i.__c.__H)return!0;var u=i.__c.__H.__.filter(function(d){return!!d.__c});if(u.every(function(d){return!d.__N}))return!o||o.call(this,s,c,l);var p=i.__c.props!==s;return u.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(p=!0)}}),o&&o.call(this,s,c,l)||p};Ve.__f=!0;var o=Ve.shouldComponentUpdate,a=Ve.componentWillUpdate;Ve.componentWillUpdate=function(s,c,l){if(this.__e){var u=o;o=void 0,r(s,c,l),o=u}a&&a.call(this,s,c,l)},Ve.shouldComponentUpdate=r}return i.__N||i.__}function vl(e,t){var n=Va(ar++,3);!Ze.__s&&El(n.__H,t)&&(n.__=e,n.u=t,Ve.__H.__h.push(n))}function _l(e,t){var n=Va(ar++,4);!Ze.__s&&El(n.__H,t)&&(n.__=e,n.u=t,Ve.__h.push(n))}function $h(e){return Qr=5,sr(function(){return{current:e}},[])}function sr(e,t){var n=Va(ar++,7);return El(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function eo(e,t){return Qr=8,sr(function(){return e},t)}function $C(){for(var e;e=Dh.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(za),e.__H.__h.forEach(bl),e.__H.__h=[]}catch(t){e.__H.__h=[],Ze.__e(t,e.__v)}}Ze.__b=function(e){Ve=null,Mh&&Mh(e)},Ze.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Lh&&Lh(e,t)},Ze.__r=function(e){Nh&&Nh(e),ar=0;var t=(Ve=e.__c).__H;t&&(gl===Ve?(t.__h=[],Ve.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(za),t.__h.forEach(bl),t.__h=[],ar=0)),gl=Ve},Ze.diffed=function(e){Oh&&Oh(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Dh.push(t)!==1&&kh===Ze.requestAnimationFrame||((kh=Ze.requestAnimationFrame)||jC)($C)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),gl=Ve=null},Ze.__c=function(e,t){t.some(function(n){try{n.__h.forEach(za),n.__h=n.__h.filter(function(i){return!i.__||bl(i)})}catch(i){t.some(function(r){r.__h&&(r.__h=[])}),t=[],Ze.__e(i,n.__v)}}),Ih&&Ih(e,t)},Ze.unmount=function(e){Bh&&Bh(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{za(i)}catch(r){t=r}}),n.__H=void 0,t&&Ze.__e(t,n.__v))};var jh=typeof requestAnimationFrame=="function";function jC(e){var t,n=function(){clearTimeout(i),jh&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);jh&&(t=requestAnimationFrame(n))}function za(e){var t=Ve,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ve=t}function bl(e){var t=Ve;e.__c=e.__(),Ve=t}function El(e,t){return!e||e.length!==t.length||t.some(function(n,i){return n!==e[i]})}function Fh(e,t){return typeof t=="function"?t(e):t}function Hh(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hh(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Wa(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hh(e))&&(i&&(i+=" "),i+=t);return i}function FC(e){const{headerEntries:t,onSelect:n,selectedEntry:i,setSelectedEntry:r,title:o}=e,a=sr(()=>HC(t),[t]);return Ie`
15
15
  <div class="djs-popup-header">
16
16
  <h3 class="djs-popup-title" title=${o}>${o}</h3>
17
- ${a.map(s=>Oe`
17
+ ${a.map(s=>Ie`
18
18
  <ul key=${s.id} class="djs-popup-header-group" data-header-group=${s.id}>
19
19
 
20
- ${s.entries.map(c=>Oe`
20
+ ${s.entries.map(c=>Ie`
21
21
  <li key=${c.id}>
22
22
  <${c.action?"button":"span"}
23
- class=${zC(c,c===i)}
23
+ class=${VC(c,c===i)}
24
24
  onClick=${l=>c.action&&n(l,c)}
25
25
  title=${c.title||c.label}
26
26
  data-id=${c.id}
@@ -29,8 +29,8 @@
29
29
  onFocus=${()=>c.action&&r(c)}
30
30
  onBlur=${()=>c.action&&r(null)}
31
31
  >
32
- ${c.imageUrl&&Oe`<img class="djs-popup-entry-icon" src=${c.imageUrl} alt="" />`||c.imageHtml&&Oe`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:c.imageHtml}} />`}
33
- ${c.label?Oe`
32
+ ${c.imageUrl&&Ie`<img class="djs-popup-entry-icon" src=${c.imageUrl} alt="" />`||c.imageHtml&&Ie`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:c.imageHtml}} />`}
33
+ ${c.label?Ie`
34
34
  <span class="djs-popup-label">${c.label}</span>
35
35
  `:null}
36
36
  </${c.action?"button":"span"}>
@@ -39,7 +39,7 @@
39
39
  </ul>
40
40
  `)}
41
41
  </div>
42
- `}function VC(e){return e.reduce((t,n)=>{const i=n.group||"default",r=t.find(o=>o.id===i);return r?r.entries.push(n):t.push({id:i,entries:[n]}),t},[])}function zC(e,t){return Wa("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function WC(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return Oe`
42
+ `}function HC(e){return e.reduce((t,n)=>{const i=n.group||"default",r=t.find(o=>o.id===i);return r?r.entries.push(n):t.push({id:i,entries:[n]}),t},[])}function VC(e,t){return Wa("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function zC(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return Ie`
43
43
  <li
44
44
  class=${Wa("entry",{selected:n})}
45
45
  data-id=${t.id}
@@ -57,15 +57,15 @@
57
57
  <span
58
58
  class=${Wa("djs-popup-entry-name",t.className)}
59
59
  >
60
- ${t.imageUrl&&Oe`<img class="djs-popup-entry-icon" src=${t.imageUrl} alt="" />`||t.imageHtml&&Oe`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:t.imageHtml}} />`}
60
+ ${t.imageUrl&&Ie`<img class="djs-popup-entry-icon" src=${t.imageUrl} alt="" />`||t.imageHtml&&Ie`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:t.imageHtml}} />`}
61
61
 
62
- ${t.label?Oe`
62
+ ${t.label?Ie`
63
63
  <span class="djs-popup-label">
64
64
  ${t.label}
65
65
  </span>
66
66
  `:null}
67
67
  </span>
68
- ${t.description&&Oe`
68
+ ${t.description&&Ie`
69
69
  <span
70
70
  class="djs-popup-entry-description"
71
71
  title=${t.description}
@@ -74,7 +74,7 @@
74
74
  </span>
75
75
  `}
76
76
  </div>
77
- ${t.documentationRef&&Oe`
77
+ ${t.documentationRef&&Ie`
78
78
  <div class="djs-popup-entry-docs">
79
79
  <a
80
80
  href="${t.documentationRef}"
@@ -90,17 +90,17 @@
90
90
  </div>
91
91
  `}
92
92
  </li>
93
- `}function UC(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=$h(),a=sr(()=>GC(i),[i]);return _l(()=>{const s=o.current;if(!s)return;const c=s.querySelector(".selected");c&&KC(c)},[t]),Oe`
93
+ `}function WC(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=$h(),a=sr(()=>UC(i),[i]);return _l(()=>{const s=o.current;if(!s)return;const c=s.querySelector(".selected");c&&GC(c)},[t]),Ie`
94
94
  <div class="djs-popup-results" ref=${o}>
95
- ${a.map(s=>Oe`
96
- ${s.name&&Oe`
95
+ ${a.map(s=>Ie`
96
+ ${s.name&&Ie`
97
97
  <div key=${s.id} class="entry-header" title=${s.name}>
98
98
  ${s.name}
99
99
  </div>
100
100
  `}
101
101
  <ul class="djs-popup-group" data-group=${s.id}>
102
- ${s.entries.map(c=>Oe`
103
- <${WC}
102
+ ${s.entries.map(c=>Ie`
103
+ <${zC}
104
104
  key=${c.id}
105
105
  entry=${c}
106
106
  selected=${c===t}
@@ -112,18 +112,18 @@
112
112
  </ul>
113
113
  `)}
114
114
  </div>
115
- `}function GC(e){const t=[],n=o=>t.find(a=>o.id===a.id),i=o=>!!n(o),r=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{const a=o.group?r(o.group):{id:"default"};i(a)?n(a).entries.push(o):t.push({...a,entries:[o]})}),t}function KC(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function qC(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:l,emptyPlaceholder:u,searchFn:p,entries:f,onOpened:d,onClosed:m}=e,v=sr(()=>et(l)?f.length>5:!1,[l,f]),[g,w]=vl(""),C=eo((B,z)=>{if(!v)return B;if(!z.trim())return B.filter(({rank:Je=0})=>Je>=0);const q=B.filter(({searchable:Je})=>Je!==!1);return p(q,z,{keys:["label","description","search"]}).map(({item:Je})=>Je)},[v]),[x,E]=vl(C(f,g)),[S,R]=vl(x[0]),N=eo(B=>{(!S||!B.includes(S))&&R(B[0]),E(B)},[S,E,R]);yl(()=>{N(C(f,g))},[g,f]);const P=eo(B=>{let q=x.indexOf(S)+B;q<0&&(q=x.length-1),q>=x.length&&(q=0),R(x[q])},[x,S,R]),O=eo(B=>{if(B.key==="Enter"&&S)return n(B,S);if(B.key==="ArrowUp")return P(-1),B.preventDefault();if(B.key==="ArrowDown")return P(1),B.preventDefault()},[n,S,P]),I=eo(B=>{lf(B.target,"input")&&w(()=>B.target.value)},[w]);yl(()=>(d(),()=>{m()}),[]);const L=sr(()=>a||r.length>0,[a,r]);return Oe`
115
+ `}function UC(e){const t=[],n=o=>t.find(a=>o.id===a.id),i=o=>!!n(o),r=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{const a=o.group?r(o.group):{id:"default"};i(a)?n(a).entries.push(o):t.push({...a,entries:[o]})}),t}function GC(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function KC(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:l,emptyPlaceholder:u,searchFn:p,entries:d,onOpened:h,onClosed:m}=e,y=sr(()=>tt(l)?d.length>5:!1,[l,d]),[g,w]=yl(""),C=eo((L,H)=>{if(!y)return L;if(!H.trim())return L.filter(({rank:Be=0})=>Be>=0);const G=L.filter(({searchable:Be})=>Be!==!1);return p(G,H,{keys:["label","description","search"]}).map(({item:Be})=>Be)},[y]),[x,E]=yl(C(d,g)),[S,R]=yl(x[0]),M=eo(L=>{(!S||!L.includes(S))&&R(L[0]),E(L)},[S,E,R]);vl(()=>{M(C(d,g))},[g,d]);const P=eo(L=>{let G=x.indexOf(S)+L;G<0&&(G=x.length-1),G>=x.length&&(G=0),R(x[G])},[x,S,R]),I=eo(L=>{if(L.key==="Enter"&&S)return n(L,S);if(L.key==="ArrowUp")return P(-1),L.preventDefault();if(L.key==="ArrowDown")return P(1),L.preventDefault()},[n,S,P]),O=eo(L=>{lf(L.target,"input")&&w(()=>L.target.value)},[w]);vl(()=>(h(),()=>{m()}),[]);const B=sr(()=>a||r.length>0,[a,r]);return Ie`
116
116
  <${Vh}
117
117
  onClose=${t}
118
- onKeyup=${I}
119
- onKeydown=${O}
118
+ onKeyup=${O}
119
+ onKeydown=${I}
120
120
  className=${i}
121
121
  position=${o}
122
122
  width=${s}
123
123
  scale=${c}
124
124
  >
125
- ${L&&Oe`
126
- <${HC}
125
+ ${B&&Ie`
126
+ <${FC}
127
127
  headerEntries=${r}
128
128
  onSelect=${n}
129
129
  selectedEntry=${S}
@@ -131,10 +131,10 @@
131
131
  title=${a}
132
132
  />
133
133
  `}
134
- ${f.length>0&&Oe`
134
+ ${d.length>0&&Ie`
135
135
  <div class="djs-popup-body">
136
136
 
137
- ${v&&Oe`
137
+ ${y&&Ie`
138
138
  <div class="djs-popup-search">
139
139
  <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
140
140
  <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
  `}
145
145
 
146
- <${UC}
146
+ <${WC}
147
147
  entries=${x}
148
148
  selectedEntry=${S}
149
149
  setSelectedEntry=${R}
@@ -151,14 +151,14 @@
151
151
  />
152
152
  </div>
153
153
  `}
154
- ${u&&x.length===0&&Oe`
155
- <div class="djs-popup-no-results">${We(u)?u(g):u}</div>
154
+ ${u&&x.length===0&&Ie`
155
+ <div class="djs-popup-no-results">${Ge(u)?u(g):u}</div>
156
156
  `}
157
157
  </${Vh}>
158
- `}function Vh(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,s=$h();return _l(()=>{if(typeof a!="function")return;const c=s.current,l=a(c);c.style.left=`${l.x}px`,c.style.top=`${l.y}px`},[s.current,a]),_l(()=>{const c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),yl(()=>{const c=u=>{if(u.key==="Escape")return u.preventDefault(),t()},l=u=>{if(!Ui(u.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",l),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",l)}},[]),Oe`
158
+ `}function Vh(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,s=$h();return _l(()=>{if(typeof a!="function")return;const c=s.current,l=a(c);c.style.left=`${l.x}px`,c.style.top=`${l.y}px`},[s.current,a]),_l(()=>{const c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),vl(()=>{const c=u=>{if(u.key==="Escape")return u.preventDefault(),t()},l=u=>{if(!Ui(u.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",l),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",l)}},[]),Ie`
159
159
  <div
160
160
  class=${Wa("djs-popup",r)}
161
- style=${YC(e)}
161
+ style=${qC(e)}
162
162
  onKeydown=${n}
163
163
  onKeyup=${i}
164
164
  ref=${s}
@@ -166,10 +166,10 @@
166
166
  >
167
167
  ${o}
168
168
  </div>
169
- `}function YC(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}var XC="data-id",zh=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],ZC=1e3;function De(e,t,n,i){this._eventBus=t,this._canvas=n,this._search=i,this._current=null;var r=et(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:r},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",o=>{const a=this.isOpen()&&this._current.target;o.element===a&&this.refresh()})}De.$inject=["config.popupMenu","eventBus","canvas","search"],De.prototype._render=function(){const{position:e,providerId:t,entries:n,headerEntries:i,emptyPlaceholder:r,options:o}=this._current,a=Object.entries(n).map(([f,d])=>({id:f,...d})),s=Object.entries(i).map(([f,d])=>({id:f,...d})),c=e&&(f=>this._ensureVisible(f,e)),l=this._updateScale(this._current.container);Th(Oe`
170
- <${qC}
171
- onClose=${f=>this.close(f)}
172
- onSelect=${(f,d,m)=>this.trigger(f,d,m)}
169
+ `}function qC(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}var YC="data-id",zh=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],XC=1e3;function Me(e,t,n,i){this._eventBus=t,this._canvas=n,this._search=i,this._current=null;var r=tt(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:r},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",o=>{const a=this.isOpen()&&this._current.target;o.element===a&&this.refresh()})}Me.$inject=["config.popupMenu","eventBus","canvas","search"],Me.prototype._render=function(){const{position:e,providerId:t,entries:n,headerEntries:i,emptyPlaceholder:r,options:o}=this._current,a=Object.entries(n).map(([d,h])=>({id:d,...h})),s=Object.entries(i).map(([d,h])=>({id:d,...h})),c=e&&(d=>this._ensureVisible(d,e)),l=this._updateScale(this._current.container);Th(Ie`
170
+ <${KC}
171
+ onClose=${d=>this.close(d)}
172
+ onSelect=${(d,h,m)=>this.trigger(d,h,m)}
173
173
  position=${c}
174
174
  className=${t}
175
175
  entries=${a}
@@ -181,7 +181,7 @@
181
181
  searchFn=${this._search}
182
182
  ...${{...o}}
183
183
  />
184
- `,this._current.container)},De.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:r,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},De.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:r}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()},De.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:i,headerEntries:r,emptyPlaceholder:o,empty:!(Object.keys(i).length||Object.keys(r).length)}},De.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},De.prototype.reset=function(){const e=this._current.container;Th(null,e),un(e)},De.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},De.prototype._onOpened=function(){this._emit("opened")},De.prototype._onClosed=function(){this._emit("closed")},De.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();const i=Te(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return n.appendChild(i),i},De.prototype._bindAutoClose=function(){this._eventBus.once(zh,this.close,this)},De.prototype._unbindAutoClose=function(){this._eventBus.off(zh,this.close,this)},De.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,i,r=e;return t!==!0&&(t===!1?(n=1,i=1):(n=t.min,i=t.max),et(n)&&e<n&&(r=n),et(i)&&e>i&&(r=i)),r},De.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y<i.height?(o=t.x,a=10):r.y&&(o=t.x,a=t.y-i.height),t.y<n.top&&(a=t.y+i.height),{x:o,y:a}},De.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length?!0:this._getContext(e,t).empty},De.prototype.registerProvider=function(e,t,n){n||(n=t,t=ZC),this._eventBus.on("popupMenu.getProviders."+e,t,function(i){i.providers.push(n)})},De.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},De.prototype._getEntries=function(e,t){var n={};return A(t,function(i){if(!i.getPopupMenuEntries){A(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=ln(o,["id"])});return}var r=i.getPopupMenuEntries(e);We(r)?n=r(n):A(r,function(o,a){n[a]=o})}),n},De.prototype._getHeaderEntries=function(e,t){var n={};return A(t,function(i){if(!i.getPopupMenuHeaderEntries){if(!i.getHeaderEntries)return;A(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=ln(o,["id"])});return}var r=i.getPopupMenuHeaderEntries(e);We(r)?n=r(n):A(r,function(o,a){n[a]=o})}),n},De.prototype._getEmptyPlaceholder=function(e){const t=e.find(n=>We(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},De.prototype.isOpen=function(){return!!this._current},De.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let r=Ui(e.delegateTarget||e.target,".entry",!0),o=ut(r,XC);t={id:o,...this._getEntry(o)}}const i=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(We(i)){if(n==="click")return i(e,t)}else if(i[n])return i[n](e,t)}},De.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function JC(e,t,n){const{keys:i}=n;if(t=t.trim().toLowerCase(),!t)throw new Error("<pattern> must not be empty");const r=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{const a=QC(o,r,i);return a?{item:o,tokens:a}:[]}).sort(eR(i))}function QC(e,t,n){const{matchedWords:i,tokens:r}=n.reduce((o,a)=>{const s=e[a],{tokens:c,matchedWords:l}=rR(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...l}}},{matchedWords:{},tokens:{}});return Object.keys(i).length!==t.length?null:r}function eR(e){return(t,n)=>{for(const i of e){const r=tR(t.tokens[i],n.tokens[i]);if(r!==0)return r;const o=iR(t.item[i],n.item[i]);if(o!==0)return o}return 0}}function tR(e,t){return Wh(t)-Wh(e)}function Wh(e){return e.reduce((t,n)=>t+nR(n),0)}function nR(e){const t=Math.log(e.value.length);return e.match?(e.start?e.end?131.9:7.87:e.wordStart?2.19:1)*t:-.07*t}function iR(e="",t=""){return e.localeCompare(t)}function rR(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],i={},r=t.map(oR),o=[`(?<all>${r.join("\\s+")})`,...r].join("|"),a=new RegExp(o,"ig");let s,c=0;for(;s=a.exec(e);){const[l]=s,u=s.index,p=s.index+l.length,f=u===0,d=p===e.length,m=!!s.groups.all,v=f||/\s/.test(e.charAt(u-1)),g=d||/\s/.test(e.charAt(p+1));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:l,index:s.index,match:!0,wordStart:v,wordEnd:g,start:f,end:d,all:m});const w=m?t:[l];for(const C of w)i[C.toLowerCase()]=!0;c=s.index+l.length}return c<e.length&&n.push({value:e.slice(c),index:c}),{tokens:n,matchedWords:i}}function oR(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}const Uh={search:["value",JC]},xl={__depends__:[Uh],__init__:["popupMenu"],popupMenu:["type",De]};var Gh={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
184
+ `,this._current.container)},Me.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:r,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},Me.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:r}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()},Me.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:i,headerEntries:r,emptyPlaceholder:o,empty:!(Object.keys(i).length||Object.keys(r).length)}},Me.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},Me.prototype.reset=function(){const e=this._current.container;Th(null,e),un(e)},Me.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},Me.prototype._onOpened=function(){this._emit("opened")},Me.prototype._onClosed=function(){this._emit("closed")},Me.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();const i=Pe(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return n.appendChild(i),i},Me.prototype._bindAutoClose=function(){this._eventBus.once(zh,this.close,this)},Me.prototype._unbindAutoClose=function(){this._eventBus.off(zh,this.close,this)},Me.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,i,r=e;return t!==!0&&(t===!1?(n=1,i=1):(n=t.min,i=t.max),tt(n)&&e<n&&(r=n),tt(i)&&e>i&&(r=i)),r},Me.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y<i.height?(o=t.x,a=10):r.y&&(o=t.x,a=t.y-i.height),t.y<n.top&&(a=t.y+i.height),{x:o,y:a}},Me.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length?!0:this._getContext(e,t).empty},Me.prototype.registerProvider=function(e,t,n){n||(n=t,t=XC),this._eventBus.on("popupMenu.getProviders."+e,t,function(i){i.providers.push(n)})},Me.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Me.prototype._getEntries=function(e,t){var n={};return A(t,function(i){if(!i.getPopupMenuEntries){A(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=ln(o,["id"])});return}var r=i.getPopupMenuEntries(e);Ge(r)?n=r(n):A(r,function(o,a){n[a]=o})}),n},Me.prototype._getHeaderEntries=function(e,t){var n={};return A(t,function(i){if(!i.getPopupMenuHeaderEntries){if(!i.getHeaderEntries)return;A(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=ln(o,["id"])});return}var r=i.getPopupMenuHeaderEntries(e);Ge(r)?n=r(n):A(r,function(o,a){n[a]=o})}),n},Me.prototype._getEmptyPlaceholder=function(e){const t=e.find(n=>Ge(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},Me.prototype.isOpen=function(){return!!this._current},Me.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let r=Ui(e.delegateTarget||e.target,".entry",!0),o=ut(r,YC);t={id:o,...this._getEntry(o)}}const i=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Ge(i)){if(n==="click")return i(e,t)}else if(i[n])return i[n](e,t)}},Me.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function ZC(e,t,n){const{keys:i}=n;if(t=t.trim().toLowerCase(),!t)throw new Error("<pattern> must not be empty");const r=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{const a=JC(o,r,i);return a?{item:o,tokens:a}:[]}).sort(QC(i))}function JC(e,t,n){const{matchedWords:i,tokens:r}=n.reduce((o,a)=>{const s=e[a],{tokens:c,matchedWords:l}=iR(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...l}}},{matchedWords:{},tokens:{}});return Object.keys(i).length!==t.length?null:r}function QC(e){return(t,n)=>{for(const i of e){const r=eR(t.tokens[i],n.tokens[i]);if(r!==0)return r;const o=nR(t.item[i],n.item[i]);if(o!==0)return o}return 0}}function eR(e,t){return Wh(t)-Wh(e)}function Wh(e){return e.reduce((t,n)=>t+tR(n),0)}function tR(e){const t=Math.log(e.value.length);return e.match?(e.start?e.end?131.9:7.87:e.wordStart?2.19:1)*t:-.07*t}function nR(e="",t=""){return e.localeCompare(t)}function iR(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],i={},r=t.map(rR),o=[`(?<all>${r.join("\\s+")})`,...r].join("|"),a=new RegExp(o,"ig");let s,c=0;for(;s=a.exec(e);){const[l]=s,u=s.index,p=s.index+l.length,d=u===0,h=p===e.length,m=!!s.groups.all,y=d||/\s/.test(e.charAt(u-1)),g=h||/\s/.test(e.charAt(p+1));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:l,index:s.index,match:!0,wordStart:y,wordEnd:g,start:d,end:h,all:m});const w=m?t:[l];for(const C of w)i[C.toLowerCase()]=!0;c=s.index+l.length}return c<e.length&&n.push({value:e.slice(c),index:c}),{tokens:n,matchedWords:i}}function rR(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}const Uh={search:["value",ZC]},xl={__depends__:[Uh],__init__:["popupMenu"],popupMenu:["type",Me]};var Gh={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
185
185
  <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
186
186
  <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
187
187
  <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
@@ -209,8 +209,8 @@
209
209
  <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
210
210
  <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
211
211
  <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
212
- </svg>`},aR=900;function cr(e,t,n,i){e.registerProvider(aR,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}cr.$inject=["contextPad","popupMenu","translate","canvas"],cr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},cr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},cr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${Gh.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);D(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},cr.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,i=n.getBoundingClientRect(),r={x:i.left,y:i.bottom+t};return r};var sR=["left","center","right","top","middle","bottom"];function to(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}to.$inject=["popupMenu","alignElements","translate","rules"],to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},to.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},to.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return A(sR,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Gh[o],action:function(){t.trigger(e,o),i.close()}}}),r};function Ht(e){F.call(this,e),this.init()}Ht.$inject=["eventBus"],Y(Ht,F),Ht.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,s){return n(o)},!0)})},Ht.prototype.init=function(){};function Ua(e){Ht.call(this,e)}Ua.$inject=["eventBus"],Y(Ua,Ht),Ua.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=ce(t,function(i){return!(i.waypoints||i.host||i.labelTarget)});return n=oa(n),n.length<2?!1:n})};const cR={__depends__:[xC,uh,xl],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",cr],alignElementsMenuProvider:["type",to],bpmnAlignElements:["type",Ua]};var lR=10,Kh=50,uR=250;function wl(e,t,n,i){for(var r;r=pR(e,n,t);)n=i(t,n,r);return n}function Sl(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,l=a.minDistance;c<0?r[o]=Math.min(i[o]+c-t[s]/2,n[o]-l+c):r[o]=Math.max(i[o]+i[s]+c+t[s]/2,n[o]+l+c)}}),r}}function pR(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=dR(e);return _e(r,function(o){if(o===n)return!1;var a=pt(o,i,lR);return a==="intersect"})}function fR(e,t){t||(t={});function n(m){return m.source===e?1:-1}var i=t.defaultDistance||Kh,r=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||uR,c=t.reference||"start";o||(o=gR);function l(m,v){return r==="n"?c==="start"?Q(m).top-Q(v).bottom:c==="center"?Q(m).top-te(v).y:Q(m).top-Q(v).top:r==="w"?c==="start"?Q(m).left-Q(v).right:c==="center"?Q(m).left-te(v).x:Q(m).left-Q(v).left:r==="s"?c==="start"?Q(v).top-Q(m).bottom:c==="center"?te(v).y-Q(m).bottom:Q(v).bottom-Q(m).bottom:c==="start"?Q(v).left-Q(m).right:c==="center"?te(v).x-Q(m).right:Q(v).right-Q(m).right}var u=e.incoming.filter(o).map(function(m){var v=a(m),g=v<0?l(m.source,e):l(e,m.source);return{id:m.source.id,distance:g,weight:v}}),p=e.outgoing.filter(o).map(function(m){var v=a(m),g=v>0?l(e,m.target):l(m.target,e);return{id:m.target.id,distance:g,weight:v}}),f=u.concat(p).reduce(function(m,v){return m[v.id+"__weight_"+v.weight]=v,m},{}),d=Tt(f,function(m,v){var g=v.distance,w=v.weight;return g<0||g>s||(m[String(g)]||(m[String(g)]=0),m[String(g)]+=1*w,(!m.distance||m[m.distance]<m[String(g)])&&(m.distance=g)),m},{});return d.distance||i}function dR(e){var t=Cl(e);return e.host&&(t=t.concat(Cl(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,i){return n.concat(Cl(i))},[]))),t}function Cl(e){return mR(e).concat(hR(e))}function hR(e){return e.incoming.map(function(t){return t.source})}function mR(e){return e.outgoing.map(function(t){return t.target})}function gR(){return!0}var vR=100;function qh(e,t,n){e.on("autoPlace",vR,function(i){var r=i.shape,o=i.source;return yR(o,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),s=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:s}),s}}qh.$inject=["eventBus","modeling","canvas"];function yR(e,t,n){n||(n={});var i=n.defaultDistance||Kh,r=te(e),o=Q(e);return{x:o.right+i+t.width/2,y:r.y}}function Yh(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Yh.$inject=["eventBus","selection"];const _R={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",qh],autoPlaceSelectionBehavior:["type",Yh]};function lr(e,t){for(Rt(t)&&(t=[t]);e=e.parent;)if(le(e,t))return e;return null}function Xh(e,t){var n=lr(e,"bpmn:Process");if(n)return!0;var i=["bpmn:Participant","bpmn:Lane"];if(n=lr(e,i),n)return Ze(n);if(le(e,i))return Ze(e);var r;for(r=H(e);r&&!b(r,"bpmn:Process");r=r.$parent);if(!t)return!0;var o=t.find(function(a){var s=H(a);return s&&s.get("processRef")===r});return o?Ze(o):!0}function Zh(e,t,n){var i=Xh(e,n);if(b(t,"bpmn:TextAnnotation"))return ER(e,t,i);if(le(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return xR(e,t,i);if(b(t,"bpmn:FlowNode"))return bR(e,t,i)}function bR(e,t,n){var i=Q(e),r=te(e),o=n?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},a=fR(e,{filter:function(d){return b(d,"bpmn:SequenceFlow")},direction:o.directionHint}),s=30,c=o.minDistance,l=o.baseOrientation;b(e,"bpmn:BoundaryEvent")&&(l=pt(e,e.host,-25),l.indexOf(o.boundaryOrientation)!==-1&&(s*=-1));var u=n?{x:i.right+a+t.width/2,y:r.y+Jh(l,c,o)}:{x:r.x+Jh(l,c,o),y:i.bottom+a+t.height/2},p={margin:s,minDistance:c},f=n?{y:p}:{x:p};return wl(e,t,u,Sl(f))}function Jh(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function ER(e,t,n){var i=Q(e),r=n?{x:i.right+t.width/2,y:i.top-50-t.height/2}:{x:i.right+50+t.width/2,y:i.bottom+t.height/2};we(e)&&(r=te(e),n?(r.x+=100,r.y-=50):(r.x+=100,r.y+=50));var o={margin:n?-30:30,minDistance:20},a=n?{y:o}:{x:o};return wl(e,t,r,Sl(a))}function xR(e,t,n){var i=Q(e),r=n?{x:i.right-10+t.width/2,y:i.bottom+40+t.width/2}:{x:i.left-40-t.width/2,y:i.bottom-10+t.height/2},o={margin:30,minDistance:30},a=n?{x:o}:{y:o};return wl(e,t,r,Sl(a))}function Qh(e,t){e.on("autoPlace",function(n){var i=n.shape,r=n.source;return Zh(r,i,t)})}Qh.$inject=["eventBus","elementRegistry"];const Rl={__depends__:[_R],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Qh]};function An(e,t,n,i){F.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,l=a.parent||a.newParent;s.autoResize!==!1&&r._expand([c],l)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=xc(Yo(a.closure.topLevel)),c=a.hints,l=c?c.autoResize:!0;if(l!==!1){var u=Wi(s,function(p){return p.parent.id});A(u,function(p,f){oe(l)&&(p=p.filter(function(d){return _e(l,Zt({id:d.id}))})),r._expand(p,f)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||r._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,l=c.parent;s&&s.autoResize===!1||l&&r._expand([c],l)})}An.$inject=["eventBus","elementRegistry","modeling","rules"],Y(An,F),An.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=Q(Ke(e)),o=Q(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),ua(D({},o,a))},An.prototype._expand=function(e,t){typeof t=="string"&&(t=this._elementRegistry.get(t));var n=this._rules.allowed("element.autoResize",{elements:e,target:t});if(n){var i=this._getOptimalBounds(e,t);if(wR(i,t)){var r=SR(Jt(t,["x","y","width","height"]),i);this.resize(t,i,{autoResize:r});var o=t.parent;o&&this._expand([t],o)}}},An.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},An.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},An.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function wR(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function SR(e,t){var n="";return e=Q(e),t=Q(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}function Ga(e){e.invoke(An,this)}Ga.$inject=["injector"],Y(Ga,An),Ga.prototype.resize=function(e,t,n){b(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function no(e){Ht.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}no.$inject=["eventBus"],Y(no,Ht),no.prototype.canResize=function(e,t){return!1};function Ka(e,t){no.call(this,e),this._modeling=t}Y(Ka,no),Ka.$inject=["eventBus","modeling"],Ka.prototype.canResize=function(e,t){if(b(t.di,"bpmndi:BPMNPlane")||!b(t,"bpmn:Participant")&&!b(t,"bpmn:Lane")&&!b(t,"bpmn:SubProcess"))return!1;var n=!0;return A(e,function(i){if(b(i,"bpmn:Lane")||ge(i)){n=!1;return}}),n};const CR={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ga],bpmnAutoResizeProvider:["type",Ka]};var em=1500;function tm(e,t,n){var i=this,r=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=i._findTargetGfx(s),l=c&&e.get(c);c&&l&&(a.stopPropagation(),r.hover({element:l,gfx:c}),r.move(s))}}r&&t.on("drag.start",function(a){t.once("drag.move",em,function(s){o(s)})}),function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",em,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})}(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=Ai(a),c=document.elementFromPoint(s.x,s.y),RR(c)}}tm.$inject=["elementRegistry","eventBus","injector"];function RR(e){return Ui(e,"svg, .djs-element",!0)}const TR={__init__:["hoverFix"],hoverFix:["type",tm]};var ur=Math.round,nm="djs-drag-active";function Di(e){e.preventDefault()}function PR(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function AR(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function im(e,t,n,i){var r={threshold:5,trapClick:!0},o;function a(x){var E=t.viewbox(),S=t._container.getBoundingClientRect();return{x:E.x+(x.x-S.left)/E.scale,y:E.y+(x.y-S.top)/E.scale}}function s(x,E){E=E||o;var S=e.createEvent(D({},E.payload,E.data,{isTouch:E.isTouch}));return e.fire("drag."+x,S)===!1?!1:e.fire(E.prefix+"."+x,S)}function c(x){var E=x.filter(function(S){return i.get(S.id)});E.length&&n.select(E)}function l(x,E){var S=o.payload,R=o.displacement,N=o.globalStart,P=Ai(x),O=tn(P,N),I=o.localStart,L=a(P),B=tn(L,I);if(!o.active&&(E||AR(O)>o.threshold)){if(D(S,{x:ur(I.x+R.x),y:ur(I.y+R.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return g();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&Na(o.cursor),t.addMarker(t.getRootElement(),nm)}rl(x),o.active&&(D(S,{x:ur(L.x+R.x),y:ur(L.y+R.y),dx:ur(B.x),dy:ur(B.y)},{originalEvent:x}),s("move"))}function u(x){var E,S=!0;o.active&&(x&&(o.payload.originalEvent=x,rl(x)),S=s("end")),S===!1&&s("rejected"),E=w(S!==!0),s("ended",E)}function p(x){it("Escape",x)&&(Di(x),g())}function f(x){var E;o.active&&(E=th(e),setTimeout(E,400),Di(x)),u(x)}function d(x){l(x)}function m(x){var E=o.payload;E.hoverGfx=x.gfx,E.hover=x.element,s("hover")}function v(x){s("out");var E=o.payload;E.hoverGfx=null,E.hover=null}function g(x){var E;if(o){var S=o.active;S&&s("cancel"),E=w(x),S&&s("canceled",E)}}function w(x){var E,S;s("cleanup"),eh(),o.trapClick?S=f:S=u,ae.unbind(document,"mousemove",l),ae.unbind(document,"dragstart",Di),ae.unbind(document,"selectstart",Di),ae.unbind(document,"mousedown",S,!0),ae.unbind(document,"mouseup",S,!0),ae.unbind(document,"keyup",p),ae.unbind(document,"touchstart",d,!0),ae.unbind(document,"touchcancel",g,!0),ae.unbind(document,"touchmove",l,!0),ae.unbind(document,"touchend",u,!0),e.off("element.hover",m),e.off("element.out",v),t.removeMarker(t.getRootElement(),nm);var R=o.payload.previousSelection;return x!==!1&&R&&!n.get().length&&c(R),E=o,o=null,E}function C(x,E,S,R){o&&g(!1),typeof E=="string"&&(R=S,S=E,E=null),R=D({},r,R||{});var N=R.data||{},P,O,I,L,B;R.trapClick?L=f:L=u,x?(P=er(x)||x,O=Ai(x),rl(x),P.type==="dragstart"&&Di(P)):(P=null,O={x:0,y:0}),I=a(O),E||(E=I),B=PR(P),o=D({prefix:S,data:N,payload:{},globalStart:O,displacement:tn(E,I),localStart:I,isTouch:B},R),R.manual||(B?(ae.bind(document,"touchstart",d,!0),ae.bind(document,"touchcancel",g,!0),ae.bind(document,"touchmove",l,!0),ae.bind(document,"touchend",u,!0)):(ae.bind(document,"mousemove",l),ae.bind(document,"dragstart",Di),ae.bind(document,"selectstart",Di),ae.bind(document,"mousedown",L,!0),ae.bind(document,"mouseup",L,!0)),ae.bind(document,"keyup",p),e.on("element.hover",m),e.on("element.out",v)),s("init"),R.autoActivate&&l(x,!0)}e.on("diagram.destroy",g),this.init=C,this.move=l,this.hover=m,this.out=v,this.end=u,this.cancel=g,this.context=function(){return o},this.setOptions=function(x){D(r,x)}}im.$inject=["eventBus","canvas","selection","elementRegistry"];const kn={__depends__:[TR,en],dragging:["type",im]};function pr(e,t,n){this._canvas=n,this._opts=D({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}pr.$inject=["config.autoScroll","eventBus","canvas"],pr.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)kR(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))};function kR(e,t,n){return t<e&&e<n}pr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},pr.prototype.setOptions=function(e){this._opts=D({},this._opts,e)},pr.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Ai(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const DR={__depends__:[kn],__init__:["autoScroll"],autoScroll:["type",pr]};function Tl(e){this._commandStack=e.get("commandStack",!1)}Tl.$inject=["injector"],Tl.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0?!0:n};const vn={__init__:["rules"],rules:["type",Tl]};var qa=Math.round,MR=Math.max;function NR(e,t){var n=e.x,i=e.y;return[["M",n,i],["m",0,-10],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function OR(e){var t=[];return e.forEach(function(n,i){t.push([i===0?"M":"L",n.x,n.y])}),t}var rm=10;function IR(e,t){var n,i;for(n=0;i=e[n];n++)if(Br(i,t)<=rm)return{point:e[n],bendpoint:!0,index:n};return null}function BR(e,t){var n=Of(NR(t,rm),OR(e)),i=n[0],r=n[n.length-1],o;return i?i!==r?i.segment2!==r.segment2?(o=MR(i.segment2,r.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:qa(i.x+r.x)/2,y:qa(i.y+r.y)/2},index:i.segment2}:{point:{x:qa(i.x),y:qa(i.y)},index:i.segment2}:null}function Pl(e,t){return IR(e,t)||BR(e,t)}function om(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function am(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function LR(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e}function $R(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],r=i[0].n*t[0]+i[1].n*t[1],o=i[0].lambda*t[0]+i[1].lambda*t[1];return-r/o}function Al(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=$R([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function sm(e,t){var n=Al(e,t),i={x:n.x-e.x,y:n.y-e.y};return om(i)}function Ya(e,t){return om({x:e.x-t.x,y:e.y-t.y})}var cm="djs-bendpoint",lm="djs-segment-dragger";function jR(e,t){var n=Ai(t),i=e._container.getBoundingClientRect(),r;r={x:i.left,y:i.top};var o=e.viewbox();return{x:o.x+(n.x-r.x)/o.scale,y:o.y+(n.y-r.y)/o.scale}}function kl(e,t,n){var i=jR(e,n),r=Pl(t,i);return r}function Dl(e,t){var n=X("g");me(n).add(cm),ie(e,n);var i=X("circle");G(i,{cx:0,cy:0,r:4}),me(i).add("djs-visual"),ie(n,i);var r=X("circle");return G(r,{cx:0,cy:0,r:10}),me(r).add("djs-hit"),ie(n,r),t&&me(n).add(t),n}function FR(e,t,n,i){var r=X("g");ie(e,r);var o=18,a=6,s=11,c=VR(t,n,i),l=a+s,u=X("rect");G(u,{x:-18/2,y:-6/2,width:o,height:a}),me(u).add("djs-visual"),ie(r,u);var p=X("rect");return G(p,{x:-c/2,y:-17/2,width:c,height:l}),me(p).add("djs-hit"),ie(r,p),Qf(r,i==="v"?90:0),r}function um(e,t,n){var i=X("g"),r=Lc(t,n),o=En(t,n);return ie(e,i),FR(i,t,n,o),me(i).add(lm),me(i).add(o==="h"?"horizontal":"vertical"),ot(i,r.x,r.y),i}function Ml(e){return Math.abs(Math.round(e*2/3))}function HR(e,t){var n=zR(e,t);return Al(e,n)}function VR(e,t,n){var i=t.x-e.x,r=t.y-e.y;return Ml(n==="h"?i:r)}function zR(e,t){for(var n=t.waypoints,i=1/0,r,o=0;o<n.length-1;o++){var a=n[o],s=n[o+1],c=sm(e,[a,s]);c<i&&(i=c,r=o)}return[n[r],n[r+1]]}function pm(e,t,n,i,r){function o(x,E,S){var R=x.index,N=x.point,P,O,I,L,B,z;return R<=0||x.bendpoint?!1:(P=E[R-1],O=E[R],I=Lc(P,O),L=En(P,O),B=Math.abs(N.x-I.x),z=Math.abs(N.y-I.y),L&&B<=S&&z<=S)}function a(x,E){var S=x.waypoints,R,N,P,O;return E.index<=0||E.bendpoint||(R={start:S[E.index-1],end:S[E.index]},N=En(R.start,R.end),!N)?null:(N==="h"?P=R.end.x-R.start.x:P=R.end.y-R.start.y,O=Ml(P)/2,O)}function s(x,E){var S=E.waypoints,R=kl(t,S,x),N;if(R)return N=a(E,R),o(R,S,N)?r.start(x,E,R.index):i.start(x,E,R.index,!R.bendpoint),!0}function c(x,E,S){ae.bind(x,E,function(R){n.triggerMouseEvent(E,R,S),R.stopPropagation()})}function l(x,E){var S=t.getLayer("overlays"),R=xe('.djs-bendpoints[data-element-id="'+qr(x.id)+'"]',S);return!R&&E&&(R=X("g"),G(R,{"data-element-id":x.id}),me(R).add("djs-bendpoints"),ie(S,R),c(R,"mousedown",x),c(R,"click",x),c(R,"dblclick",x)),R}function u(x,E){return xe('.djs-segment-dragger[data-segment-idx="'+x+'"]',E)}function p(x,E){E.waypoints.forEach(function(S,R){var N=Dl(x);ie(x,N),ot(N,S.x,S.y)}),Dl(x,"floating")}function f(x,E){for(var S=E.waypoints,R,N,P,O=1;O<S.length;O++)R=S[O-1],N=S[O],En(R,N)&&(P=um(x,R,N),G(P,{"data-segment-idx":O}),c(P,"mousemove",E))}function d(x){A(Rc("."+cm,x),function(E){Ge(E)})}function m(x){A(Rc("."+lm,x),function(E){Ge(E)})}function v(x){var E=l(x);return E||(E=l(x,!0),p(E,x),f(E,x)),E}function g(x){var E=l(x);E&&(m(E),d(E),f(E,x),p(E,x))}function w(x,E){var S=xe(".floating",x),R=E.point;S&&ot(S,R.x,R.y)}function C(x,E,S){var R=u(E.index,x),N=S[E.index-1],P=S[E.index],O=E.point,I=Lc(N,P),L=En(N,P),B,z;R&&(B=WR(R),z={x:O.x-I.x,y:O.y-I.y},L==="v"&&(z={x:z.y,y:z.x}),ot(B,z.x,z.y))}e.on("connection.changed",function(x){g(x.element)}),e.on("connection.remove",function(x){var E=l(x.element);E&&Ge(E)}),e.on("element.marker.update",function(x){var E=x.element,S;E.waypoints&&(S=v(E),x.add?me(S).add(x.marker):me(S).remove(x.marker))}),e.on("element.mousemove",function(x){var E=x.element,S=E.waypoints,R,N;if(S){if(R=l(E,!0),N=kl(t,S,x.originalEvent),!N)return;w(R,N),N.bendpoint||C(R,N,S)}}),e.on("element.mousedown",function(x){if(Yn(x)){var E=x.originalEvent,S=x.element;if(S.waypoints)return s(E,S)}}),e.on("selection.changed",function(x){var E=x.newSelection,S=E[0];S&&S.waypoints&&v(S)}),e.on("element.hover",function(x){var E=x.element;E.waypoints&&(v(E),n.registerEvent(x.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(x){n.unregisterEvent(x.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(x){var E=x.element,S=x.newId;if(E.waypoints){var R=l(E);R&&G(R,{"data-element-id":S})}}),this.addHandles=v,this.updateHandles=g,this.getBendpointsContainer=l,this.getSegmentDragger=u}pm.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function WR(e){return xe(".djs-visual",e)}var fm=Math.round,Mi="reconnectStart",Ni="reconnectEnd",io="updateWaypoints";function Nl(e,t,n,i,r,o){this._injector=e,this.start=function(a,s,c,l){var u=n.getGraphics(s),p=s.source,f=s.target,d=s.waypoints,m;!l&&c===0?m=Mi:!l&&c===d.length-1?m=Ni:m=io;var v=m===io?"connection.updateWaypoints":"connection.reconnect",g=r.allowed(v,{connection:s,source:p,target:f});g===!1&&(g=r.allowed(v,{connection:s,source:f,target:p})),g!==!1&&i.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:u,context:{allowed:g,bendpointIndex:c,connection:s,source:p,target:f,insert:l,type:m}}})},t.on("bendpoint.move.hover",function(a){var s=a.context,c=s.connection,l=c.source,u=c.target,p=a.hover,f=s.type;s.hover=p;var d;if(p){var m=f===io?"connection.updateWaypoints":"connection.reconnect";if(d=s.allowed=r.allowed(m,{connection:c,source:f===Mi?p:l,target:f===Ni?p:u}),d){s.source=f===Mi?p:l,s.target=f===Ni?p:u;return}d===!1&&(d=s.allowed=r.allowed(m,{connection:c,source:f===Ni?p:u,target:f===Mi?p:l})),d&&(s.source=f===Ni?p:u,s.target=f===Mi?p:l)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==io&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,l=s.bendpointIndex,u=s.connection,p=s.insert,f=u.waypoints.slice(),d=s.source,m=s.target,v=s.type,g=s.hints||{},w={x:fm(a.x),y:fm(a.y)};if(!c)return!1;v===io?(p?f.splice(l,0,w):f[l]=w,g.bendpointMove={insert:p,bendpointIndex:l},f=this.cropWaypoints(u,f),o.updateWaypoints(u,jx(f),g)):(v===Mi?(g.docking="source",Xa(s)&&(g.docking="target",g.newWaypoints=f.reverse())):v===Ni&&(g.docking="target",Xa(s)&&(g.docking="source",g.newWaypoints=f.reverse())),o.reconnect(u,d,m,w,g))},this)}Nl.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Nl.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};function Xa(e){var t=e.hover,n=e.source,i=e.target,r=e.type;if(r===Mi)return t&&i&&t===i&&n!==i;if(r===Ni)return t&&n&&t===n&&n!==i}var UR="reconnectStart",GR="reconnectEnd",dm="updateWaypoints",ro="connect-ok",Za="connect-not-ok",hm="connect-hover",mm="djs-updating",gm="djs-dragging",vm=1100;function ym(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,l=a.insert,u=c.waypoints,p=u.slice();a.waypoints=u,l&&p.splice(s,0,{x:o.x,y:o.y}),c.waypoints=p;var f=a.draggerGfx=Dl(i.getLayer("overlays"));me(f).add("djs-dragging"),i.addMarker(c,gm),i.addMarker(c,mm)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,l=a.type;if(c){if(i.addMarker(c,hm),l===dm)return;s?(i.removeMarker(c,Za),i.addMarker(c,ro)):s===!1&&(i.removeMarker(c,ro),i.addMarker(c,Za))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],vm,function(o){var a=o.context,s=a.hover,c=a.target;s&&(i.removeMarker(s,hm),i.removeMarker(s,c?ro:Za))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,l=a.draggerGfx,u=a.hover,p=a.type,f=a.connection,d=f.source,m=f.target,v=f.waypoints.slice(),g={x:o.x,y:o.y},w=a.hints||{},C={};r&&(w.connectionStart&&(C.connectionStart=w.connectionStart),w.connectionEnd&&(C.connectionEnd=w.connectionEnd),p===UR?Xa(a)?(C.connectionEnd=C.connectionEnd||g,C.source=m,C.target=u||d,v=v.reverse()):(C.connectionStart=C.connectionStart||g,C.source=u||d,C.target=m):p===GR?Xa(a)?(C.connectionStart=C.connectionStart||g,C.source=u||m,C.target=d,v=v.reverse()):(C.connectionEnd=C.connectionEnd||g,C.source=d,C.target=u||m):(C.noCropping=!0,C.noLayout=!0,v[c]=g),p===dm&&(v=e.cropWaypoints(f,v)),C.waypoints=v,r.drawPreview(a,s,C)),ot(l,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],vm,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,l=a.hover,u=a.target,p=a.waypoints;s.waypoints=p,Ge(c),i.removeMarker(s,mm),i.removeMarker(s,gm),l&&(i.removeMarker(l,ro),i.removeMarker(l,u?ro:Za)),r&&r.cleanUp(a)})}ym.$inject=["bendpointMove","injector","eventBus","canvas"];var _m="connect-hover",bm="djs-updating";function Em(e,t,n){return Ol(e,t,e[t]+n)}function Ol(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function KR(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]),a=20,s=Math.min(Math.max(o+a,e[i]),r-a);return Ol(t,i,s)}function xm(e){return e==="x"?"y":"x"}function wm(e,t,n){var i,r;return e.original?e.original:(i=te(t),r=xm(n),Ol(e,r,i[r]))}function Sm(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);this.start=function(p,f,d){var m,v=n.getGraphics(f),g=d-1,w=d,C=f.waypoints,x=C[g],E=C[w],S=kl(n,C,p),R,N,P;R=En(x,E),R&&(N=R==="v"?"x":"y",g===0&&(x=wm(x,f.source,N)),w===C.length-1&&(E=wm(E,f.target,N)),S?P=S.point:P={x:(x.x+E.x)/2,y:(x.y+E.y)/2},m={connection:f,segmentStartIndex:g,segmentEndIndex:w,segmentStart:x,segmentEnd:E,axis:N,dragPosition:P},i.init(p,P,"connectionSegment.move",{cursor:N==="x"?"resize-ew":"resize-ns",data:{connection:f,connectionGfx:v,context:m}}))};function s(p,f){if(!a)return f;var d=p.waypoints,m;return p.waypoints=f,m=a.getCroppedWaypoints(p),p.waypoints=d,m}function c(p){r.update("connection",p.connection,p.connectionGfx)}function l(p,f,d){var m=p.newWaypoints,v=p.segmentStartIndex+f,g=m[v],w=p.segmentEndIndex+f,C=m[w],x=xm(p.axis),E=KR(d,g,C,x);ot(p.draggerGfx,E.x,E.y)}function u(p,f){var d=0,m=p.filter(function(v,g){return Bc(p[g-1],p[g+1],v)?(d=g<=f?d-1:d,!1):!0});return{waypoints:m,segmentOffset:d}}t.on("connectionSegment.move.start",function(p){var f=p.context,d=p.connection,m=n.getLayer("overlays");f.originalWaypoints=d.waypoints.slice(),f.draggerGfx=um(m,f.segmentStart,f.segmentEnd),me(f.draggerGfx).add("djs-dragging"),n.addMarker(d,bm)}),t.on("connectionSegment.move.move",function(p){var f=p.context,d=f.connection,m=f.segmentStartIndex,v=f.segmentEndIndex,g=f.segmentStart,w=f.segmentEnd,C=f.axis,x=f.originalWaypoints.slice(),E=Em(g,C,p["d"+C]),S=Em(w,C,p["d"+C]),R=x.length,N=0;x[m]=E,x[v]=S;var P,O;m<2&&(P=pt(d.source,E),m===1?P==="intersect"&&(x.shift(),x[0]=E,N--):P!=="intersect"&&(x.unshift(g),N++)),v>R-3&&(O=pt(d.target,S),v===R-2?O==="intersect"&&(x.pop(),x[x.length-1]=S):O!=="intersect"&&x.push(w)),f.newWaypoints=d.waypoints=s(d,x),l(f,N,p),f.newSegmentStartIndex=m+N,c(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,_m)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var f=p.context.hover;f&&n.removeMarker(f,_m)}),t.on("connectionSegment.move.cleanup",function(p){var f=p.context,d=f.connection;f.draggerGfx&&Ge(f.draggerGfx),n.removeMarker(d,bm)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var f=p.context,d=f.connection;d.waypoints=f.originalWaypoints,c(p)}),t.on("connectionSegment.move.end",function(p){var f=p.context,d=f.connection,m=f.newWaypoints,v=f.newSegmentStartIndex;m=m.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var g=u(m,v),w=g.waypoints,C=s(d,w),x=g.segmentOffset,E={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:v+x}};o.updateWaypoints(d,C,E)})}Sm.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var qR=Math.abs,Cm=Math.round;function YR(e,t,n){n=n===void 0?10:n;var i,r;for(i=0;i<t.length;i++)if(r=t[i],qR(r-e)<=n)return r}function Rm(e){return{x:e.x,y:e.y}}function Tm(e){return{x:e.x+e.width,y:e.y+e.height}}function Vt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Cm(e.x+e.width/2),y:Cm(e.y+e.height/2)}}function fr(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function He(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Pm(e){return e.children||[]}var XR=Math.abs,Am=Math.round,Il=10;function km(e){function t(o,a){if(oe(o)){for(var s=o.length;s--;)if(XR(o[s]-a)<=Il)return o[s]}else{o=+o;var c=a%o;if(c<Il)return a-c;if(c>o-Il)return a-c+o}return a}function n(o,a){if(o.waypoints)return HR(a,o);if(o.width)return{x:Am(o.width/2+o.x),y:Am(o.height/2+o.y)}}function i(o){var a=o.context,s=a.snapPoints,c=a.connection,l=c.waypoints,u=a.segmentStart,p=a.segmentStartIndex,f=a.segmentEnd,d=a.segmentEndIndex,m=a.axis;if(s)return s;var v=[l[p-1],u,f,l[d+1]];return p<2&&v.unshift(n(c.source,o)),d>l.length-3&&v.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},A(v,function(g){g&&(g=g.original||g,m==="y"&&s.horizontal.push(g.y),m==="x"&&s.vertical.push(g.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=i(o),s=o.x,c=o.y,l,u;if(a){l=t(a.vertical,s),u=t(a.horizontal,c);var p=s-l,f=c-u;D(o,{dx:o.dx-p,dy:o.dy-f,x:l,y:u}),(p||a.vertical.indexOf(s)!==-1)&&He(o,"x",l),(f||a.horizontal.indexOf(c)!==-1)&&He(o,"y",u)}});function r(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var l=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},A(l,function(u){u&&(u=u.original||u,a.horizontal.push(u.y),a.vertical.push(u.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!we(s)||!c||!c.x||!c.y||(He(o,"x",c.x),He(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=r(a),c=a.hover,l=c&&n(c,o),u=o.x,p=o.y,f,d;if(s){f=t(l?s.vertical.concat([l.x]):s.vertical,u),d=t(l?s.horizontal.concat([l.y]):s.horizontal,p);var m=u-f,v=p-d;D(o,{dx:o.dx-m,dy:o.dy-v,x:o.x-m,y:o.y-v}),(m||s.vertical.indexOf(u)!==-1)&&He(o,"x",f),(v||s.horizontal.indexOf(p)!==-1)&&He(o,"y",d)}})}km.$inject=["eventBus"];const ZR={__depends__:[kn,vn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",pm],bendpointMove:["type",Nl],bendpointMovePreview:["type",ym],connectionSegmentMove:["type",Sm],bendpointSnapping:["type",km]};function Dm(e,t,n,i){function r(a,s){return i.allowed("connection.create",{source:a,target:s})}function o(a,s){return r(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,l=a.hover,u;if(s.hover=l,u=s.canExecute=r(c,l),!Dr(u)){if(u!==!1){s.source=c,s.target=l;return}u=s.canExecute=o(c,l),!Dr(u)&&u!==!1&&(s.source=l,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,l=s.connectionStart,u={x:a.x,y:a.y},p=s.source,f=s.target;if(!c)return!1;var d=null,m={connectionStart:Bl(s)?u:l,connectionEnd:Bl(s)?l:u};tt(c)&&(d=c),s.connection=n.connect(p,f,d,m)}),this.start=function(a,s,c,l){tt(c)||(l=c,c=te(s)),t.init(a,"connect",{autoActivate:l,data:{shape:s,context:{start:s,connectionStart:c}}})}}Dm.$inject=["eventBus","dragging","modeling","rules"];function Bl(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}var JR=1100,QR=900,Mm="connect-ok",Nm="connect-not-ok";function Om(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,l=o.start,u=o.startPosition,p=o.target,f=o.connectionStart||u,d=o.connectionEnd||{x:r.x,y:r.y},m=f,v=d;Bl(o)&&(m=d,v=f),i.drawPreview(o,a,{source:c||l,target:p||s,connectionStart:m,connectionEnd:v})}),t.on("connect.hover",QR,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?Mm:Nm)}),t.on(["connect.out","connect.cleanup"],JR,function(r){var o=r.hover;o&&(n.removeMarker(o,Mm),n.removeMarker(o,Nm))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Om.$inject=["injector","eventBus","canvas"];const Ll={__depends__:[en,vn,kn],__init__:["connectPreview"],connect:["type",Dm],connectPreview:["type",Om]};var eT="djs-dragger";function Dn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Dn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Dn.prototype.drawPreview=function(e,t,n){n=n||{};var i=e.connectionPreviewGfx,r=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,l=n.connectionEnd,u=n.noLayout,p=n.noCropping,f=n.noNoop,d,m=this;if(i||(i=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),ta(i),r||(r=e.getConnection=tT(function(v,g,w){return m.getConnection(v,g,w)})),t&&(d=r(t,o,a)),!d){!f&&this.drawNoopPreview(i,n);return}d.waypoints=s||[],this._layouter&&!u&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:l,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?te(o):c,a?te(a):l]),this._connectionDocking&&(o||a)&&!p&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(i,d,{stroke:"var(--element-dragger-color)"})},Dn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||te(n),o=t.connectionEnd||te(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);ie(e,s)},Dn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return e=n&&Fc(o,s,!0)||e,t=i&&Fc(a,s,!1)||t,[e,t]},Dn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Ge(e.connectionPreviewGfx)},Dn.prototype.getConnection=function(e){var t=nT(e);return this._elementFactory.createConnection(t)},Dn.prototype.createConnectionPreviewGfx=function(){var e=X("g");return G(e,{pointerEvents:"none"}),me(e).add(eT),ie(this._canvas.getActiveLayer(),e),e},Dn.prototype.createNoopConnection=function(e,t){return ra([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function tT(e){var t={};return function(n){var i=JSON.stringify(n),r=t[i];return r||(r=t[i]=e.apply(null,arguments)),r}}function nT(e){return tt(e)?e:{}}const iT={__init__:["connectionPreview"],connectionPreview:["type",Dn]},rT=new Kr("ps");var oT=["marker-start","marker-mid","marker-end"],aT=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Zn(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}Zn.$inject=["elementRegistry","eventBus","canvas","styles"],Zn.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},Zn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Zn.prototype.addDragger=function(e,t,n,i="djs-dragger"){n=n||this.getGfx(e);var r=ff(n),o=n.getBoundingClientRect();return this._cloneMarkers(Ei(r),i),G(r,this._styles.cls(i,[],{x:o.top,y:o.left})),ie(t,r),G(r,"data-preview-support-element-id",e.id),r},Zn.prototype.addFrame=function(e,t){var n=X("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ie(t,n),G(n,"data-preview-support-element-id",e.id),n},Zn.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;e.childNodes&&e.childNodes.forEach(r=>{i._cloneMarkers(r,t,n)}),uT(e)&&oT.forEach(function(r){if(G(e,r)){var o=sT(e,r,i._canvas.getContainer());o&&i._cloneMarker(n,e,o,r,t)}})},Zn.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,rT.next()].join("-"),a=xe("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||ff(n);s.id=o,me(s).add(r);var c=xe(":scope > defs",e);c||(c=X("defs"),ie(e,c)),ie(c,s);var l=lT(s.id);G(t,i,l)};function sT(e,t,n){var i=cT(G(e,t));return xe("marker#"+i,n||document)}function cT(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function lT(e){return"url(#"+e+")"}function uT(e){return aT.indexOf(e.nodeName)!==-1}const dr={__init__:["previewSupport"],previewSupport:["type",Zn]},Ja="complex-preview";class Im{constructor(t,n,i){this._canvas=t,this._graphicsFactory=n,this._previewSupport=i,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:i=[],removed:r=[],resized:o=[]}=t,a=this._canvas.getLayer(Ja);n.filter(s=>!pT(s)).forEach(s=>{let c;we(s)?(c=this._graphicsFactory._createContainer("connection",X("g")),this._graphicsFactory.drawConnection(Ei(c),s)):(c=this._graphicsFactory._createContainer("shape",X("g")),this._graphicsFactory.drawShape(Ei(c),s),ot(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),i.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);const l=this._previewSupport.addDragger(s,a);we(s)?ot(l,c.x,c.y):ot(l,s.x+c.x,s.y+c.y)}),r.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");const l=this._graphicsFactory._createContainer("shape",X("g"));this._graphicsFactory.drawShape(Ei(l),s,{width:c.width,height:c.height}),ot(l,c.x,c.y),this._previewSupport.addDragger(s,a,l)})}cleanUp(){ta(this._canvas.getLayer(Ja)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Ja)}hide(){this._canvas.hideLayer(Ja)}}Im.$inject=["canvas","graphicsFactory","previewSupport"];function pT(e){return e.hidden}const fT={__depends__:[dr],__init__:["complexPreview"],complexPreview:["type",Im]};var $l=["top","bottom","left","right"],Qa=10;function jl(e,t){F.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(r){var o=r.context,a=o.connection,s=a.source,c=a.target,l=o.hints||{};l.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(r){var o=r.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(r){var o=r.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(r){if(_a(r)&&!we(r)){var o=mT(r);o&&i(r,o)}}function i(r,o){var a=te(r),s=r.label,c=te(s);if(s.parent){var l=Q(r),u;switch(o){case"top":u={x:a.x,y:l.top-Qa-s.height/2};break;case"left":u={x:l.left-Qa-s.width/2,y:a.y};break;case"bottom":u={x:a.x,y:l.bottom+Qa+s.height/2};break;case"right":u={x:l.right+Qa+s.width/2,y:a.y};break}var p=tn(u,c);t.moveShape(s,p)}}}Y(jl,F),jl.$inject=["eventBus","modeling"];function dT(e){var t=e.host,n=te(e),i=pt(n,t),r;i.indexOf("-")>=0?r=i.split("-"):r=[i];var o=$l.filter(function(a){return r.indexOf(a)===-1});return o}function hT(e){var t=te(e),n=[].concat(e.incoming.map(function(i){return i.waypoints[i.waypoints.length-2]}),e.outgoing.map(function(i){return i.waypoints[1]})).map(function(i){return Bm(t,i)});return n}function mT(e){var t=te(e.label),n=te(e),i=Bm(n,t);if(gT(i)){var r=hT(e);if(e.host){var o=dT(e);r=r.concat(o)}var a=$l.filter(function(s){return r.indexOf(s)===-1});if(a.indexOf(i)===-1)return a[0]}}function Bm(e,t){return pt(t,e,5)}function gT(e){return $l.indexOf(e)!==-1}function Fl(e){F.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,i=t.shape;t.position||(b(i,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:t.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}Y(Fl,F),Fl.$inject=["eventBus"];function Hl(e,t){e.invoke(F,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape,o=ce(r.incoming.concat(r.outgoing),function(a){return b(a,"bpmn:Association")});A(o,function(a){t.moveConnection(a,{x:0,y:0},i)})},!0)}Y(Hl,F),Hl.$inject=["injector","modeling"];var Lm=500;function es(e,t){t.invoke(F,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Lm,function(i){var r=i.elements;r=r.filter(function(o){var a=o.host;return $m(o,a)}),r.length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",Lm,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];$m(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}es.$inject=["bpmnReplace","injector"],Y(es,F),es.prototype._replaceShape=function(e,t){var n=vT(e),i={type:"bpmn:BoundaryEvent",host:t};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,i,{layoutConnection:!1})};function vT(e){var t=H(e),n=t.eventDefinitions;return n&&n[0]}function $m(e,t){return!ge(e)&&le(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Vl(e,t){F.call(this,e);function n(i){return ce(i.attachers,function(r){return b(r,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);b(r,"bpmn:EventBasedGateway")&&b(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;b(r,"bpmn:Gateway")&&b(o,"bpmn:EventBasedGateway")&&A(o.outgoing,function(a){var s=a.target,c=n(s);b(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Vl.$inject=["eventBus","modeling"],Y(Vl,F);function zl(e,t,n){F.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",r,!0),this.postExecuted("connection.delete",i,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function i(g){const w=g.source,C=g.target;hr(w)&&oo(C)&&u(C)}function r(g){const w=g.connection,C=g.source,x=g.target;hr(C)&&ts(x)&&(l(x),f(C,[w]))}function o(g){const w=g.newTarget,C=g.oldSource,x=g.oldTarget;if(x!==w){const E=C;oo(x)&&u(x),hr(E)&&ts(w)&&l(w)}}function a(g){const{element:w}=g;oo(w)?(p(w),d(w)):ts(w)&&m(w)}function s(g){const{newData:w,oldShape:C}=g;if(hr(g.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:E})=>oo(E));x&&x.target&&(g._connectionTarget=x.target)}else if(!hr(g.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:E})=>ts(E));x&&x.target&&(g._connectionTarget=x.target),v(C)}}function c(g){const{_connectionTarget:w,newShape:C}=g;w&&t.connect(C,w)}function l(g){t.updateProperties(g,{isForCompensation:!0})}function u(g){t.updateProperties(g,{isForCompensation:void 0})}function p(g){for(const w of g.incoming)n.canConnect(w.source,g)||t.removeConnection(w);for(const w of g.outgoing)n.canConnect(g,w.target)||t.removeConnection(w)}function f(g,w){g.outgoing.filter(E=>b(E,"bpmn:Association")).filter(E=>oo(E.target)&&!w.includes(E)).forEach(E=>t.removeConnection(E))}function d(g){const w=g.attachers.slice();w.length&&t.removeElements(w)}function m(g){const w=g.incoming.filter(C=>hr(C.source));t.removeElements(w)}function v(g){const w=g.outgoing.filter(C=>b(C,"bpmn:SequenceFlow"));t.removeElements(w)}}Y(zl,F),zl.$inject=["eventBus","modeling","bpmnRules"];function oo(e){const t=H(e);return t&&t.get("isForCompensation")}function hr(e){return e&&b(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function ts(e){return e&&b(e,"bpmn:Activity")&&!ht(e)}function Wl(e){e.invoke(F,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;b(i,"bpmn:Lane")&&!b(r,"bpmn:Lane")&&(n.parent=lr(i,"bpmn:Participant"))})}Wl.$inject=["injector"],Y(Wl,F);function Ul(e,t){F.call(this,e),this.preExecute("shape.create",function(n){var i=n.context,r=i.shape;if(b(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Ul.$inject=["eventBus","bpmnFactory"],Y(Ul,F);var Gl=20,Kl=20,jm=30,ns=2e3;function ql(e,t,n){F.call(this,t),t.on(["create.start","shape.move.start"],ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement();if(!(!b(a,"bpmn:Participant")||!b(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(p){return!b(p,"bpmn:Group")&&!ge(p)&&!we(p)});if(c.length){var l=Ke(c),u=yT(a,l);D(a,u),o.createConstraints=_T(a,l)}}}),t.on("create.start",ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function l(u){u.element=s,u.gfx=c}b(a,"bpmn:Participant")&&b(s,"bpmn:Process")&&(t.on("element.hover",ns,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))});function i(){var r=e.getRootElement();return b(r,"bpmn:Collaboration")?r:n.makeCollaboration()}this.preExecute("elements.create",ns,function(r){var o=r.elements,a=r.parent,s=bT(o),c;s&&b(a,"bpmn:Process")&&(r.parent=i(),c=r.hints=r.hints||{},c.participant=s,c.process=a,c.processRef=H(s).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;b(a,"bpmn:Participant")&&b(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=H(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;a&&(!c||s===c)&&H(s).set("processRef",H(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,l=o.participant;a&&(!l||c===l)&&H(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var l=a.children.slice();c?s===c&&n.moveElements(l,{x:0,y:0},c):n.moveElements(l,{x:0,y:0},s)}},!0)}ql.$inject=["canvas","eventBus","modeling"],Y(ql,F);function yT(e,t){t={width:t.width+Gl*2+jm,height:t.height+Kl*2};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}function _T(e,t){return t=Q(t),{bottom:t.top+e.height/2-Kl,left:t.right-e.width/2+Gl,top:t.bottom-e.height/2+Kl,right:t.left+e.width/2-Gl-jm}}function bT(e){return _e(e,function(t){return b(t,"bpmn:Participant")})}var Fm="__targetRef_placeholder";function Yl(e,t){F.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Hm(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Hm(o));function n(a,s,c){var l=a.get("dataInputAssociations");return _e(l,function(u){return u!==c&&u.targetRef===s})}function i(a,s){var c=a.get("properties"),l=_e(c,function(u){return u.name===Fm});return!l&&s&&(l=t.create("bpmn:Property",{name:Fm}),qe(c,l)),l}function r(a,s){var c=i(a);c&&(n(a,c,s)||Le(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,l=c.businessObject,u=c.target,p=u&&u.businessObject,f=s.newTarget,d=f&&f.businessObject,m=s.oldTarget||s.target,v=m&&m.businessObject,g=c.businessObject,w;v&&v!==p&&r(v,l),d&&d!==p&&r(d,l),p?(w=i(p,!0),g.targetRef=w):g.targetRef=null}}Yl.$inject=["eventBus","bpmnFactory"],Y(Yl,F);function Hm(e){return function(t){var n=t.context,i=n.connection;if(b(i,"bpmn:DataInputAssociation"))return e(t)}}function is(e){this._bpmnUpdater=e}is.$inject=["bpmnUpdater"],is.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},is.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]};function Xl(e,t,n,i){F.call(this,i),t.registerHandler("dataStore.updateContainment",is);function r(){return n.filter(function(s){return b(s,"bpmn:Participant")&&H(s).processRef})[0]}function o(s){return s.children.filter(function(c){return b(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var l=s.businessObject||s;if(c=c||r(),c){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,dataStoreDi:ve(s),newSemanticParent:u.processRef||u,newDiParent:ve(c)})}}this.preExecute("shape.create",function(s){var c=s.context,l=c.shape;b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,l=c.shapes,u=l.filter(function(p){return b(p,"bpmn:DataStoreReference")});u.length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(p){return!b(p,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,l=c.shape,u=l.parent;b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&b(u,"bpmn:Collaboration")&&a(l)}),this.postExecute("shape.move",function(s){var c=s.context,l=c.shape,u=c.oldParent,p=l.parent;if(!b(u,"bpmn:Collaboration")&&b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&b(p,"bpmn:Collaboration")){var f=b(u,"bpmn:Participant")?u:xT(u,"bpmn:Participant");a(l,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,l=c.shape,u=e.getRootElement();le(l,["bpmn:Participant","bpmn:SubProcess"])&&b(u,"bpmn:Collaboration")&&o(u).filter(function(p){return ET(p,l)}).forEach(function(p){a(p)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,l=c.oldRoot,u=c.newRoot,p=o(l);p.forEach(function(f){b(u,"bpmn:Process")&&a(f,u)})})}Xl.$inject=["canvas","commandStack","elementRegistry","eventBus"],Y(Xl,F);function ET(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function xT(e,t){for(;e.parent;){if(b(e.parent,t))return e.parent;e=e.parent}}var rs=Math.max,os=Math.min,wT=20;function Vm(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function ST(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+r,o.height=e.height-r):t.indexOf("s")!==-1&&(o.height=e.height+r),t.indexOf("e")!==-1?o.width=e.width+i:t.indexOf("w")!==-1&&(o.x=e.x+i,o.width=e.width-i),o}function CT(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function as(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return ee(r)&&(i=(/top|left/.test(e)?os:rs)(i,r)),ee(o)&&(i=(/top|left/.test(e)?rs:os)(i,o)),i}function RT(e,t){if(!t)return e;var n=Q(e);return ua({top:as("top",n,t),right:as("right",n,t),bottom:as("bottom",n,t),left:as("left",n,t)})}function TT(e,t,n,i){var r=Q(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?Q(i):o,s={top:os(o.top,a.top),left:os(o.left,a.left),bottom:rs(o.bottom,a.bottom),right:rs(o.right,a.right)};return ua(s)}function ao(e,t){return typeof e<"u"?e:wT}function PT(e,t){var n,i,r,o;return typeof t=="object"?(n=ao(t.left),i=ao(t.right),r=ao(t.top),o=ao(t.bottom)):n=i=r=o=ao(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}function AT(e){return!(e.waypoints||e.type==="label")}function zm(e,t){var n;if(e.length===void 0?n=ce(e.children,AT):n=e,n.length)return PT(Ke(n),t)}var Jn=Math.abs;function kT(e,t){return Vm(Q(t),Q(e))}var DT=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],zt=30;function ss(e,t){return t=t||[],e.children.filter(function(n){b(n,"bpmn:Lane")&&(ss(n,t),t.push(n))}),t}function Qn(e){return e.children.filter(function(t){return b(t,"bpmn:Lane")})}function Wt(e){return lr(e,DT)||e}function MT(e,t){var n=Wt(e),i=b(n,"bpmn:Process")?[]:[n],r=ss(n,i),o=Q(e),a=Q(t),s=kT(e,t),c=[],l=Ze(e);return r.forEach(function(u){if(u!==e){var p=l?0:s.top,f=l?s.right:0,d=l?0:s.bottom,m=l?s.left:0,v=Q(u);s.top&&(Jn(v.bottom-o.top)<10&&(d=a.top-v.bottom),Jn(v.top-o.top)<5&&(p=a.top-v.top)),s.left&&(Jn(v.right-o.left)<10&&(f=a.left-v.right),Jn(v.left-o.left)<5&&(m=a.left-v.left)),s.bottom&&(Jn(v.top-o.bottom)<10&&(p=a.bottom-v.top),Jn(v.bottom-o.bottom)<5&&(d=a.bottom-v.bottom)),s.right&&(Jn(v.left-o.right)<10&&(m=a.right-v.left),Jn(v.right-o.right)<5&&(f=a.right-v.right)),(p||f||d||m)&&c.push({shape:u,newBounds:CT(u,{top:p,right:f,bottom:d,left:m})})}}),c}var NT=500;function Zl(e,t){F.call(this,e);function n(i,r){var o=Ze(i),a=Qn(r),s=[],c=[],l=[],u=[];if(bi(a,function(g){return o?g.y>i.y?c.push(g):s.push(g):g.x>i.x?u.push(g):l.push(g),g.children}),!!a.length){var p;o?c.length&&s.length?p=i.height/2:p=i.height:u.length&&l.length?p=i.width/2:p=i.width;var f,d,m,v;s.length&&(f=t.calculateAdjustments(s,"y",p,i.y-10),t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:p},"s")),c.length&&(d=t.calculateAdjustments(c,"y",-p,i.y+i.height+10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:-p},"n")),l.length&&(m=t.calculateAdjustments(l,"x",p,i.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:p,y:0},"e")),u.length&&(v=t.calculateAdjustments(u,"x",-p,i.x+i.width+10),t.makeSpace(v.movingShapes,v.resizingShapes,{x:-p,y:0},"w"))}}this.postExecuted("shape.delete",NT,function(i){var r=i.context,o=r.hints,a=r.shape,s=r.oldParent;b(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}Zl.$inject=["eventBus","spaceTool"],Y(Zl,F);var Wm=500;function cs(e,t){t.invoke(F,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Wm,function(i){var r=i.elements;r.filter(function(o){var a=o.host;return Um(o,a)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",Wm,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c=a.host;Um(a,IT(r,c)?c:o)&&(r[s]=n._replaceShape(a))})},!0)}cs.$inject=["bpmnReplace","injector"],Y(cs,F),cs.prototype._replaceShape=function(e){var t=OT(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function OT(e){var t=H(e),n=t.eventDefinitions;return n&&n[0]}function Um(e,t){return!ge(e)&&b(e,"bpmn:BoundaryEvent")&&!t}function IT(e,t){return e.indexOf(t)!==-1}function Jl(e,t,n){F.call(this,e);function i(r,o,a){var s=o.waypoints,c,l,u,p,f,d,m,v=r.outgoing.slice(),g=r.incoming.slice(),w;ee(a.width)?w=te(a):w=a;var C=Pl(s,w);if(C){if(c=s.slice(0,C.index),l=s.slice(C.index+(C.bendpoint?1:0)),!c.length||!l.length)return;u=C.bendpoint?s[C.index]:w,(c.length===1||!Gm(r,c[c.length-1]))&&c.push(Km(u)),(l.length===1||!Gm(r,l[0]))&&l.unshift(Km(u))}p=o.source,f=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||w),d=o),t.canConnect(r,f,o)&&(d?m=n.connect(r,f,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||w),m=o));var x=[].concat(d&&ce(g,function(E){return E.source===d.source})||[],m&&ce(v,function(E){return E.target===m.target})||[]);x.length&&n.removeElements(x)}this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(r.newParent=o=o.parent);var l=te(c),u={x:l.x+s.x,y:l.y+s.y},p=_e(o.children,function(f){var d=t.canInsert(a,f);return d&&Pl(f.waypoints,u)});p&&(r.targetFlow=p,r.position=u)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}Y(Jl,F),Jl.$inject=["eventBus","bpmnRules","modeling"];function Gm(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Km(e){return D({},e)}function Ql(e,t){F.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;if(!(s&&s.createElementsBehavior===!1)&&mr(r)){var c=[];b(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(l=>l!==r&&mr(l)):c=a.incoming.filter(l=>l!==r&&mr(l)&&b(l.source,"bpmn:EventBasedGateway")),c.forEach(function(l){t.removeConnection(l)})}}),this.preExecuted("shape.replace",function(n){var i=n.context,r=i.newShape;if(b(r,"bpmn:EventBasedGateway")){var o=r.outgoing.filter(mr).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(mr).forEach(function(s){const c=a.incoming.filter(mr).filter(function(l){return l.source===r});(s.source!==r||c.length>1)&&t.removeConnection(s)})})}})}Ql.$inject=["eventBus","modeling"],Y(Ql,F);function mr(e){return b(e,"bpmn:SequenceFlow")}var ls=1500,qm=2e3;function Ym(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],ls,function(i){var r=i.context,o=r.shape||i.shape,a=i.hover;b(a,"bpmn:Lane")&&!le(o,["bpmn:Lane","bpmn:Participant"])&&(i.hover=Wt(a),i.hoverGfx=e.getGraphics(i.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||le(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(i.hover=s,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],ls,function(i){var r=i.hover;b(r,"bpmn:Lane")&&(i.hover=Wt(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],ls,function(i){var r=i.context,o=i.hover,a=r.type;b(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=Wt(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],ls,function(i){var r=i.context,o=r.start;b(o,"bpmn:Lane")&&(r.start=Wt(o)||o)}),t.on("shape.move.start",qm,function(i){var r=i.shape;b(r,"bpmn:Lane")&&(i.shape=Wt(r)||r)}),t.on("spaceTool.move",qm,function(i){var r=i.hover;r&&b(r,"bpmn:Lane")&&(i.hover=Wt(r))})}Ym.$inject=["elementRegistry","eventBus","canvas"];function BT(e){return e.create("bpmn:Category")}function LT(e){return e.create("bpmn:CategoryValue")}function $T(e,t,n){return qe(t.get("categoryValue"),e),e.$parent=t,qe(n.get("rootElements"),t),t.$parent=n,e}function jT(e){var t=e.$parent;return t&&(Le(t.get("categoryValue"),e),e.$parent=null),e}function FT(e){var t=e.$parent;return t&&(Le(t.get("rootElements"),e),e.$parent=null),e}var Xm=770;function eu(e,t,n,i,r,o){r.invoke(F,this);function a(){return n.filter(function(m){return b(m,"bpmn:Group")})}function s(m,v){return m.some(function(g){var w=H(g),C=w.categoryValueRef&&w.categoryValueRef.$parent;return C===v})}function c(m,v){return m.some(function(g){var w=H(g);return w.categoryValueRef===v})}function l(m,v,g){var w=a().filter(function(C){return C.businessObject!==g});v&&!s(w,v)&&FT(v),m&&!c(w,m)&&jT(m)}function u(m,v){return $T(m,v,t.getDefinitions())}function p(m,v){var g=H(m),w=g.categoryValueRef;w||(w=g.categoryValueRef=v.categoryValue=v.categoryValue||LT(e));var C=w.$parent;C||(C=w.$parent=v.category=v.category||BT(e)),u(w,C,t.getDefinitions())}function f(m,v){var g=v.category,w=v.categoryValue,C=H(m);w?(C.categoryValueRef=null,l(w,g,C)):l(null,C.categoryValueRef.$parent,C)}this.execute("label.create",function(m){var v=m.context,g=v.labelTarget;b(g,"bpmn:Group")&&p(g,v)}),this.revert("label.create",function(m){var v=m.context,g=v.labelTarget;b(g,"bpmn:Group")&&f(g,v)}),this.execute("shape.delete",function(m){var v=m.context,g=v.shape,w=H(g);if(!(!b(g,"bpmn:Group")||g.labelTarget)){var C=v.categoryValue=w.categoryValueRef,x;C&&(x=v.category=C.$parent,l(C,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var v=m.context,g=v.shape;if(!(!b(g,"bpmn:Group")||g.labelTarget)){var w=v.category,C=v.categoryValue,x=H(g);C&&(x.categoryValueRef=C,u(C,w))}}),this.execute("shape.create",function(m){var v=m.context,g=v.shape;!b(g,"bpmn:Group")||g.labelTarget||H(g).categoryValueRef&&p(g,v)}),this.reverted("shape.create",function(m){var v=m.context,g=v.shape;!b(g,"bpmn:Group")||g.labelTarget||H(g).categoryValueRef&&f(g,v)});function d(m,v){var g=e.create(m.$type);return o.copyElement(m,g,null,v)}i.on("copyPaste.copyElement",Xm,function(m){var v=m.descriptor,g=m.element;if(!(!b(g,"bpmn:Group")||g.labelTarget)){var w=H(g);if(w.categoryValueRef){var C=w.categoryValueRef;v.categoryValue=d(C,!0),C.$parent&&(v.category=d(C.$parent,!0))}}}),i.on("copyPaste.pasteElement",Xm,function(m){var v=m.descriptor,g=v.businessObject,w=v.categoryValue,C=v.category;w&&(w=g.categoryValueRef=d(w)),C&&(w.$parent=d(C)),delete v.category,delete v.categoryValue})}eu.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],Y(eu,F);function tu(e,t,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y),r==0?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Zm(e){function t(i,r,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=tu(i,r,o,a),l=tu(i,r,o,s),u;c&&l?Jm(c,o)>Jm(l,o)?u=l:u=c:u=c||l,i.original=u}function n(i){var r=i.waypoints;t(r[0],r[1],te(i.source)),t(r[r.length-1],r[r.length-2],te(i.target))}e.on("bpmnElement.added",function(i){var r=i.element;r.waypoints&&n(r)})}Zm.$inject=["eventBus"];function Jm(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nu(e){F.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=H(i),o=ve(i);if(le(r,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}nu.$inject=["eventBus"],Y(nu,F);var Qm=Math.sqrt,eg=Math.min,HT=Math.max,tg=Math.abs;function ng(e){return Math.pow(e,2)}function so(e,t){return Qm(ng(e.x-t.x)+ng(e.y-t.y))}function VT(e,t){var n=0,i,r,o,a,s,c,l,u,p,f,d;for(n=0;n<t.length-1;n++){if(i=t[n],r=t[n+1],rg(i,r)?l=[i]:(o=so(e,i),a=so(e,r),c=eg(o,a),l=zT(i,r,e,c)),l.length<1)throw new Error("expected between [1, 2] circle -> line intersections");l.length===1&&(u={type:"bendpoint",position:l[0],segmentIndex:n,bendpointIndex:rg(i,l[0])?n:n+1}),l.length===2&&(s=UT(l[0],l[1]),u={type:"segment",position:s,segmentIndex:n,relativeLocation:so(i,s)/so(i,r)}),p=so(u.position,e),(!d||f>p)&&(d=u,f=p)}return d}function zT(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,l=r*a+o*s,u=a*a+s*s-i*i,p=l/c,f=u/c,d=p*p-f;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var m=Qm(d),v=-p+m,g=-p-m,w={x:e.x-r*v,y:e.y-o*v};if(d===0)return[w];var C={x:e.x-r*g,y:e.y-o*g};return[w,C].filter(function(x){return WT(x,e,t)})}function WT(e,t,n){return ig(e.x,t.x,n.x)&&ig(e.y,t.y,n.y)}function ig(e,t,n){return e>=eg(t,n)-us&&e<=HT(t,n)+us}function UT(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var us=.1;function rg(e,t){return tg(e.x-t.x)<=us&&tg(e.y-t.y)<=us}function GT(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c=i.bendpointMove.insert,l=i.bendpointMove.bendpointIndex,u;if(o===0)return r;if(r>=l&&(u=c?r+1:r-1),r<l&&(u=r,c&&n.type!=="bendpoint"&&l-1===r)){var p=ag(t,l);p<n.relativeLocation&&u++}return u}return o===0?r:i.connectionStart&&r===0?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function og(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=VT(e,n),c=s.segmentIndex,l=GT(n,t,s,i);if(l<0||l>t.length-2||l===null)return a;var u=sg(n,c),p=sg(t,l),f=s.position,d=qT(u,f),m=KT(u,p);if(s.type==="bendpoint"){var v=t.length-n.length,g=s.bendpointIndex,w=n[g];if(t.indexOf(w)!==-1)return a;if(v===0){var C=t[g];return r=C.x-s.position.x,o=C.y-s.position.y,{delta:{x:r,y:o},point:{x:e.x+r,y:e.y+o}}}v<0&&g!==0&&g<n.length-1&&(d=ag(n,g))}var x={x:(p[1].x-p[0].x)*d+p[0].x,y:(p[1].y-p[0].y)*d+p[0].y},E=LR({x:e.x-f.x,y:e.y-f.y},m);return r=x.x+E.x-e.x,o=x.y+E.y-e.y,{point:xn(x),delta:xn({x:r,y:o})}}function ag(e,t){var n=Ya(e[t-1],e[t]),i=Ya(e[t],e[t+1]),r=n/(n+i);return r}function KT(e,t){var n=am(e),i=am(t);return i-n}function sg(e,t){return[e[t],e[t+1]]}function qT(e,t){var n=Ya(e[0],e[1]),i=Ya(e[0],t);return n===0?0:i/n}function YT(e,t,n,i){var r=te(e);return og(r,t,n,i).delta}function co(e,t,n){var i=Xr(t),r=Xr(n),o=tn(e,i),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return xn({x:r.x+a.x,y:r.y+a.y})}function cg(e,t,n){var i=Xr(e),r=Xr(t),o=Xr(n),a=tn(e,i),s=tn(i,r),c=XT(i,t,n);if(c)return c;var l={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},u={x:o.x+l.x,y:o.y+l.y};return xn({x:u.x+a.x-e.x,y:u.y+a.y-e.y})}function XT(e,t,n){var i=Q(t),r=Q(n);if(ZT(i,r))return null;var o=pt(t,e),a,s,c;if(o==="top")a={x:0,y:r.bottom-i.bottom};else if(o==="bottom")a={x:0,y:r.top-i.top};else if(o==="right")a={x:r.left-i.left,y:0};else if(o==="left")a={x:r.right-i.right,y:0};else return null;return s={x:e.x+a.x,y:e.y+a.y},c=pt(n,s),c!==o?null:a}function ZT(e,t){return JT(e,t)||QT(e,t)}function JT(e,t){return e.right!==t.right&&e.left!==t.left}function QT(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var lg="name",ug="text";function iu(e,t,n,i){F.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",a=>{H(a.context.element)===a.context.moddleElement&&r(a)});function r(a){var s=a.context,c=s.element,l=s.properties;if(lg in l&&t.updateLabel(c,l[lg]),ug in l&&b(c,"bpmn:TextAnnotation")){var u=i.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},l[ug]||"");t.updateLabel(c,l.text,u)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var l=s.shape||s.connection;ge(l)||!Ci(l)||Qt(l)&&t.updateLabel(l,Qt(l))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,l=s.hints||{};c&&l.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,l=c.label,u=D({},s.hints),p=s.newWaypoints||c.waypoints,f=s.oldWaypoints;return typeof u.startChanged>"u"&&(u.startChanged=!!u.connectionStart),typeof u.endChanged>"u"&&(u.endChanged=!!u.connectionEnd),YT(l,p,f,u)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var l=s.connection,u=l.label,p;!u||!u.parent||(p=o(a),t.moveShape(u,p))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,l=s.oldShape,u=H(c);u&&Ci(u)&&l.label&&c.label&&(c.label.x=l.label.x,c.label.y=l.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.newBounds,u=s.oldBounds;if(_a(c)){var p=c.label,f=te(p),d=nP(u),m=tP(f,d),v=eP(m,u,l);t.moveShape(p,v)}})}Y(iu,F),iu.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function eP(e,t,n){var i=co(e,t,n);return xn(tn(i,e))}function tP(e,t){if(t.length){var n=iP(e,t);return Al(e,n)}}function nP(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function iP(e,t){var n=t.map(function(r){return{line:r,distance:sm(e,r)}}),i=cn(n,"distance");return i[0].line}function rP(e,t,n,i){return og(e,t,n,i).point}function ru(e,t){F.call(this,e);function n(i,r){var o=i.context,a=o.connection,s=D({},o.hints),c=o.newWaypoints||a.waypoints,l=o.oldWaypoints;return typeof s.startChanged>"u"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged>"u"&&(s.endChanged=!!s.connectionEnd),rP(r,c,l,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var l=c.waypoints[c.waypoints.length-1],u=n(i,l),p=[].concat(c.waypoints.slice(0,-1),[u]);t.updateWaypoints(c,p)}),a.forEach(function(c){var l=c.waypoints[0],u=n(i,l),p=[].concat([u],c.waypoints.slice(1));t.updateWaypoints(c,p)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(l){var u=l.waypoints[l.waypoints.length-1],p={x:u.x+c.x,y:u.y+c.y},f=[].concat(l.waypoints.slice(0,-1),[p]);t.updateWaypoints(l,f)}),a.forEach(function(l){var u=l.waypoints[0],p={x:u.x+c.x,y:u.y+c.y},f=[].concat([p],l.waypoints.slice(1));t.updateWaypoints(l,f)})})}Y(ru,F),ru.$inject=["eventBus","modeling"];function ps(e,t,n){var i=ds(e),r=fg(i,t),o=i[0];return r.length?r[r.length-1]:co(o.original||o,n,t)}function fs(e,t,n){var i=ds(e),r=fg(i,t),o=i[i.length-1];return r.length?r[0]:co(o.original||o,n,t)}function ou(e,t,n){var i=ds(e),r=pg(t,n),o=i[0];return co(o.original||o,r,t)}function au(e,t,n){var i=ds(e),r=pg(t,n),o=i[i.length-1];return co(o.original||o,r,t)}function pg(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ds(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function fg(e,t){var n=ct(e,aP);return ce(n,function(i){return oP(i,t)})}function oP(e,t){return pt(t,e,1)==="intersect"}function aP(e){return e.original||e}function su(e,t){F.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(sP(i,r)){var o=cP(i);o.incoming.forEach(function(a){var s=fs(a,r,i);t.reconnectEnd(a,r,s)}),o.outgoing.forEach(function(a){var s=ps(a,r,i);t.reconnectStart(a,r,s)})}},!0)}su.$inject=["eventBus","modeling"],Y(su,F);function sP(e,t){return b(e,"bpmn:Participant")&&fe(e)&&b(t,"bpmn:Participant")&&!fe(t)}function cP(e){var t=Or([e],!1),n=[],i=[];return t.forEach(function(r){r!==e&&(r.incoming.forEach(function(o){b(o,"bpmn:MessageFlow")&&n.push(o)}),r.outgoing.forEach(function(o){b(o,"bpmn:MessageFlow")&&i.push(o)}))},[]),{incoming:n,outgoing:i}}const lP=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function dg(e){const t=H(e);if(!b(t,"bpmn:BoundaryEvent")&&!(b(t,"bpmn:StartEvent")&&ht(t.$parent)))return!1;const n=t.get("eventDefinitions");return!n||!n.length?!1:lP.some(i=>b(n[0],i))}function hg(e){return b(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function cu(e,t){e.invoke(F,this),this.postExecuted("shape.replace",function(n){const i=n.context.oldShape,r=n.context.newShape,o=n.context.hints;if(!dg(r))return;const a=hg(r);if(o.targetElement&&o.targetElement[a]!==void 0)return;const c=H(i).get(a),l=H(r).get(a);c!==l&&t.updateProperties(r,{[a]:c})})}cu.$inject=["injector","modeling"],Y(cu,F);function lu(e,t){F.call(this,e),this.preExecute("shape.resize",function(n){var i=n.shape,r=ve(i),o=r&&r.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(i,o,{bounds:void 0})},!0)}Y(lu,F),lu.$inject=["eventBus","modeling"];function uu(e,t,n){F.call(this,e),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(!(r.incoming.length!==1||r.outgoing.length!==1)){var o=r.incoming[0],a=r.outgoing[0];if(!(!b(o,"bpmn:SequenceFlow")||!b(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=uP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}Y(uu,F),uu.$inject=["eventBus","bpmnRules","modeling"];function gr(e){return e.original||e}function uP(e,t){var n=tu(gr(e[e.length-2]),gr(e[e.length-1]),gr(t[1]),gr(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[gr(e[0]),gr(t[t.length-1])]}function pu(e,t){F.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;b(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;if(i&&!i.businessObject.participants.length){var r=t.makeProcess(),o=i.children.slice();t.moveElements(o,{x:0,y:0},r)}},!0)}pu.$inject=["eventBus","modeling"],Y(pu,F);function fu(e,t,n,i){F.call(this,e);var r=i.get("dragging",!1);function o(c){var l=c.source,u=c.target,p=c.parent;if(p){var f,d;b(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(l,u)||(d=!0),n.canConnectMessageFlow(l,u)&&(f="bpmn:MessageFlow")),b(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(l,u)||(d=!0),n.canConnectSequenceFlow(l,u)&&(f="bpmn:SequenceFlow")),d&&t.removeConnection(c),f&&t.connect(l,u,{type:f,waypoints:c.waypoints.slice()})}}function a(c){var l=c.context,u=l.connection,p=l.newSource||u.source,f=l.newTarget||u.target,d,m;d=n.canConnect(p,f),!(!d||d.type===u.type)&&(m=t.connect(p,f,{type:d.type,associationDirection:d.associationDirection,waypoints:u.waypoints.slice()}),u.parent&&t.removeConnection(u),l.connection=m,r&&s(u,m))}function s(c,l){var u=r.context(),p=u&&u.payload.previousSelection,f;!p||!p.length||(f=p.indexOf(c),f!==-1&&p.splice(f,1,l))}this.postExecuted("elements.move",function(c){var l=c.closure,u=l.allConnections;A(u,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var l=c.context,u=l.properties,p=l.element,f=p.businessObject,d;u.default&&(d=_e(p.outgoing,Zt({id:p.businessObject.default.id})),d&&t.updateProperties(d,{conditionExpression:void 0})),u.conditionExpression&&f.sourceRef.default===f&&t.updateProperties(p.source,{default:void 0})})}Y(fu,F),fu.$inject=["eventBus","modeling","bpmnRules","injector"];function hs(e,t,n,i,r,o){i.invoke(F,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,l=s.elements,u=Tt(l,function(p,f){var d=t.canReplace([f],f.host||f.parent||c);return d?p.concat(d.replacements):p},[]);u.length&&this._replaceElements(l,u)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,l=s.newHost,u=[];A(s.closure.topLevel,function(f){ht(f)?u=u.concat(f.children):u=u.concat(f)}),u.length===1&&l&&(c=l);var p=t.canReplace(u,c);p&&this._replaceElements(u,p.replacements,l)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape,u=c.attachers,p;u&&u.length&&(p=t.canReplace(u,l),this._replaceElements(u,p.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(l,{id:c.id})})}Y(hs,F),hs.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;A(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=i.replaceElement(s,a,{select:!1})}),t&&r.select(e)},hs.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var pP=1500,fP={width:140,height:120},du={width:300,height:60},hu={width:60,height:300},ms={width:300,height:150},gs={width:150,height:300},mg={width:140,height:120},gg={width:50,height:30};function vg(e){e.on("resize.start",pP,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(b(i,"bpmn:Lane")||b(i,"bpmn:Participant"))&&(n.resizeConstraints=vP(i,r,o)),b(i,"bpmn:SubProcess")&&fe(i)&&(n.minDimensions=mg),b(i,"bpmn:TextAnnotation")&&(n.minDimensions=gg)})}vg.$inject=["eventBus"];var ei=Math.abs,dP=Math.min,hP=Math.max;function yg(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function vr(e,t,n){return yg(e,t,n,dP)}function yr(e,t,n){return yg(e,t,n,hP)}var mP={top:20,left:50,right:20,bottom:20},gP={top:50,left:20,right:20,bottom:20};function vP(e,t,n){var i=Wt(e),r=!0,o=!0,a=ss(i,[i]),s=Q(e),c={},l={},u=Ze(e),p=u?du:hu;/n/.test(t)?l.top=s.bottom-p.height:/e/.test(t)?l.right=s.left+p.width:/s/.test(t)?l.bottom=s.top+p.height:/w/.test(t)&&(l.left=s.right-p.width),a.forEach(function(m){var v=Q(m);u?(v.top<s.top-10&&(r=!1),v.bottom>s.bottom+10&&(o=!1)):(v.left<s.left-10&&(r=!1),v.right>s.right+10&&(o=!1)),/n/.test(t)&&(n&&ei(s.top-v.bottom)<10&&yr(c,"top",v.top+p.height),ei(s.top-v.top)<5&&vr(l,"top",v.bottom-p.height)),/e/.test(t)&&(n&&ei(s.right-v.left)<10&&vr(c,"right",v.right-p.width),ei(s.right-v.right)<5&&yr(l,"right",v.left+p.width)),/s/.test(t)&&(n&&ei(s.bottom-v.top)<10&&vr(c,"bottom",v.bottom-p.height),ei(s.bottom-v.bottom)<5&&yr(l,"bottom",v.top+p.height)),/w/.test(t)&&(n&&ei(s.left-v.right)<10&&yr(c,"left",v.left+p.width),ei(s.left-v.left)<5&&vr(l,"left",v.right-p.width))});var f=i.children.filter(function(m){return!m.hidden&&!m.waypoints&&(b(m,"bpmn:FlowElement")||b(m,"bpmn:Artifact"))}),d=u?mP:gP;return f.forEach(function(m){var v=Q(m);/n/.test(t)&&(!u||r)&&vr(l,"top",v.top-d.top),/e/.test(t)&&(u||o)&&yr(l,"right",v.right+d.right),/s/.test(t)&&(!u||o)&&yr(l,"bottom",v.bottom+d.bottom),/w/.test(t)&&(u||r)&&vr(l,"left",v.left-d.left)}),{min:l,max:c}}var _g=1001;function bg(e,t){e.on("resize.start",_g+500,function(n){var i=n.context,r=i.shape;(b(r,"bpmn:Lane")||b(r,"bpmn:Participant"))&&(i.balanced=!Yr(n))}),e.on("resize.end",_g,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(b(r,"bpmn:Lane")||b(r,"bpmn:Participant"))return o&&(a=jf(a),t.resizeLane(r,a,i.balanced)),!1})}bg.$inject=["eventBus","modeling"];var yP=500;function mu(e,t,n,i,r){n.invoke(F,this);function o(u){return le(u,["bpmn:ReceiveTask","bpmn:SendTask"])||_P(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){var p=e.getDefinitions(),f=p.get("rootElements");return!!_e(f,Zt({id:u.id}))}function s(u){if(b(u,"bpmn:ErrorEventDefinition"))return"errorRef";if(b(u,"bpmn:EscalationEventDefinition"))return"escalationRef";if(b(u,"bpmn:MessageEventDefinition"))return"messageRef";if(b(u,"bpmn:SignalEventDefinition"))return"signalRef"}function c(u){if(le(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions"),f=p[0];return f.get(s(f))}function l(u,p){if(le(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.set("messageRef",p);var f=u.get("eventDefinitions"),d=f[0];return d.set(s(d),p)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.shape||u.element;if(o(p)){var f=H(p),d=c(f),m;d&&!a(d)&&(m=e.getDefinitions().get("rootElements"),qe(m,d),u.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.addedRootElement;if(p){var f=e.getDefinitions().get("rootElements");Le(f,p)}},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,f=u.element;if(!(f.labelTarget||!o(f))){var d=H(f),m=c(d);m&&(p.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",yP,function(u){var p=u.descriptor,f=p.businessObject,d=p.referencedRootElement;d&&(a(d)||(d=i.copyElement(d,r.create(d.$type))),l(f,d),delete p.referencedRootElement)})}mu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],Y(mu,F);function _P(e,t){return oe(t)||(t=[t]),$n(t,function(n){return Ji(e,n)})}var Eg=Math.max;function xg(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return A(n,function(a){var s=a.id;b(a,"bpmn:Participant")&&(o[s]=EP(a,i,r)),b(a,"bpmn:Lane")&&(o[s]=Ze(a)?du:hu),b(a,"bpmn:SubProcess")&&fe(a)&&(o[s]=mg),b(a,"bpmn:TextAnnotation")&&(o[s]=gg),b(a,"bpmn:Group")&&(o[s]=fP)}),o})}xg.$inject=["eventBus"];function bP(e){return e==="x"}function EP(e,t,n){var i=Ze(e);if(!SP(e))return i?ms:gs;var r=bP(t),o={};return r?i?o=ms:o={width:wP(e,n,r),height:gs.height}:i?o={width:ms.width,height:xP(e,n,r)}:o=gs,o}function xP(e,t,n){var i;return i=CP(e,t,n),Eg(ms.height,i)}function wP(e,t,n){var i;return i=RP(e,t,n),Eg(gs.width,i)}function SP(e){return!!Qn(e).length}function CP(e,t,n){var i=Qn(e),r;return r=gu(i,t,n),e.height-r.height+du.height}function RP(e,t,n){var i=Qn(e),r;return r=gu(i,t,n),e.width-r.width+hu.width}function gu(e,t,n){var i,r,o;for(i=0;i<e.length;i++)if(r=e[i],!n&&t>=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return o=Qn(r),o.length?gu(o,t,n):r}var wg=400,TP=600,Sg={x:180,y:160};function ti(e,t,n,i,r,o,a){F.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(p){return b(p,"bpmn:SubProcess")&&!fe(p)}function l(p){var f=p.shape,d=p.newRootElement,m=H(f);d=s._addDiagram(d||m),p.newRootElement=e.addRootElement(d)}function u(p){var f=p.shape,d=H(f);s._removeDiagram(d);var m=p.newRootElement=a.get(Tn(d));e.removeRootElement(m)}this.executed("shape.create",function(p){var f=p.shape;c(f)&&l(p)},!0),this.postExecuted("shape.create",function(p){var f=p.shape,d=p.newRootElement;!d||!f.children||(s._showRecursively(f.children),s._moveChildrenToShape(f,d))},!0),this.reverted("shape.create",function(p){var f=p.shape;c(f)&&u(p)},!0),this.preExecuted("shape.delete",function(p){var f=p.shape;if(c(f)){var d=a.get(Tn(f));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(p){var f=p.shape;c(f)&&u(p)},!0),this.reverted("shape.delete",function(p){var f=p.shape;c(f)&&l(p)},!0),this.preExecuted("shape.replace",function(p){var f=p.oldShape,d=p.newShape;!c(f)||!c(d)||(p.oldRoot=e.removeRootElement(Tn(f)))},!0),this.postExecuted("shape.replace",function(p){var f=p.newShape,d=p.oldRoot,m=e.findRoot(Tn(f));if(!(!d||!m)){var v=d.children;n.moveElements(v,{x:0,y:0},m)}},!0),this.executed("element.updateProperties",function(p){var f=p.element;if(b(f,"bpmn:SubProcess")){var d=p.properties,m=p.oldProperties,v=m.id,g=d.id;if(v!==g){if(Ta(f)){a.updateId(f,Ti(g)),a.updateId(v,g);return}var w=a.get(Ti(v));w&&a.updateId(Ti(v),Ti(g))}}},!0),this.reverted("element.updateProperties",function(p){var f=p.element;if(b(f,"bpmn:SubProcess")){var d=p.properties,m=p.oldProperties,v=m.id,g=d.id;if(v!==g){if(Ta(f)){a.updateId(f,Ti(v)),a.updateId(g,v);return}var w=a.get(Ti(g));w&&a.updateId(w,Ti(v))}}},!0),t.on("element.changed",function(p){var f=p.element;if(Ta(f)){var d=f,m=a.get(Id(d));!m||m===d||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",wg,function(p){var f=p.shape;b(f,"bpmn:SubProcess")&&(fe(f)?u(p):(l(p),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",wg,function(p){var f=p.shape;b(f,"bpmn:SubProcess")&&(fe(f)?u(p):(l(p),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",TP,function(p){var f=p.shape;if(b(f,"bpmn:SubProcess")){var d=p.newRootElement;d&&(fe(f)?s._moveChildrenToShape(d,f):s._moveChildrenToShape(f,d))}},!0),t.on("copyPaste.createTree",function(p){var f=p.element,d=p.children;if(c(f)){var m=Tn(f),v=a.get(m);v&&d.push.apply(d,v.children)}}),t.on("copyPaste.copyElement",function(p){var f=p.descriptor,d=p.element,m=p.elements,v=d.parent,g=b(ve(v),"bpmndi:BPMNPlane");if(g){var w=Id(v),C=_e(m,function(x){return x.id===w});C&&(f.parent=C.id)}}),t.on("copyPaste.pasteElement",function(p){var f=p.descriptor;f.parent&&(c(f.parent)||f.parent.hidden)&&(f.hidden=!0)})}Y(ti,F),ti.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,i=e.children,r;if(i){i=i.concat(i.reduce(function(l,u){return u.label&&u.label.parent!==e?l.concat(u.label):l},[]));var o=i.filter(function(l){return!l.hidden});if(!o.length){n.moveElements(i,{x:0,y:0},t,{autoResize:!1});return}var a=Ke(o);if(!t.x)r={x:Sg.x-a.x,y:Sg.y-a.y};else{var s=te(t),c=te(a);r={x:s.x-c.x,y:s.y-c.y}}n.moveElements(i,r,t,{autoResize:!1})}},ti.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(r){r.hidden=!!t,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||t)))}),i},ti.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e},ti.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:Tn(e),type:e.$type,di:i,businessObject:e,collapsed:!0});return o},ti.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,i=_e(n,function(r){return r.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(i),1),i},ti.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function vu(e,t){e.invoke(F,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(!(!b(r,"bpmn:SubProcess")||b(r,"bpmn:AdHocSubProcess")||!(b(i,"bpmn:Task")||b(i,"bpmn:CallActivity"))||!fe(r))){var o=PP(r);t.createShape({type:"bpmn:StartEvent"},o,r)}})}vu.$inject=["injector","modeling"],Y(vu,F);function PP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function yu(e){F.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;b(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&b(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}Y(yu,F),yu.$inject=["eventBus"];function _u(e,t){F.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(fe(i))return;var r=Or(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();A(s,function(l){o(l,!0)}),A(c,function(l){o(l,!1)})});function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?t.reconnectEnd(a,i,te(i)):t.reconnectStart(a,i,te(i)))}},!0)}Y(_u,F),_u.$inject=["eventBus","modeling"];var bu=500;function Eu(e,t,n){F.call(this,e);function i(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function r(a,s){var c=a.children,l=s,u,p;return u=AP(c).concat([a]),p=zm(u),p?(l.width=Math.max(p.width,l.width),l.height=Math.max(p.height,l.height),l.x=p.x+(p.width-l.width)/2,l.y=p.y+(p.height-l.height)/2):(l.x=a.x+(a.width-l.width)/2,l.y=a.y+(a.height-l.height)/2),l}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;b(c,"bpmn:SubProcess")&&(c.collapsed?ve(c).isExpanded=!1:(i(c.children),ve(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;c.collapsed?ve(c).isExpanded=!1:ve(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],bu,function(a){var s=a.context.shape,c=t.getDefaultSize(s),l;s.collapsed?l=o(s,c):l=r(s,c),n.resizeShape(s,l,null,{autoResize:s.collapsed?!1:"nwse"})})}Y(Eu,F),Eu.$inject=["eventBus","elementFactory","modeling"];function AP(e){return e.filter(function(t){return!t.hidden})}function xu(e,t,n,i){t.invoke(F,this),this.preExecute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.businessObject;ge(a)||(b(a,"bpmn:Participant")&&fe(a)&&n.ids.unclaim(s.processRef.id),i.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(r){var o=r.context,a=o.connection,s=a.businessObject;i.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement(),o=r.businessObject;b(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}Y(xu,F),xu.$inject=["canvas","injector","moddle","modeling"];function wu(e,t){F.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context,r=i.connection,o=r.source;kP(r,o)&&t.updateProperties(o,{default:null})})}Y(wu,F),wu.$inject=["eventBus","modeling"];function kP(e,t){if(!b(e,"bpmn:SequenceFlow"))return!1;var n=H(t),i=H(e);return n.get("default")===i}var DP=500,MP=5e3;function Su(e,t){F.call(this,e);var n;function i(){return n=n||new NP,n.enter(),n}function r(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,MP,function(s){i()}),this.postExecuted(a,DP,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,l=c.shape,u=r();l.labelTarget||(b(l,"bpmn:Lane")&&u.addLane(l),b(l,"bpmn:FlowNode")&&u.addFlowNode(l))})}Su.$inject=["eventBus","modeling"],Y(Su,F);function NP(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Cu(e,t){F.call(this,e),this.postExecuted("elements.create",function(n){const i=n.context,r=i.elements;for(const o of r)OP(o)&&!BP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}Y(Cu,F),Cu.$inject=["eventBus","modeling"];function OP(e){const t=H(e);return t&&t.isForCompensation}function IP(e){return e&&b(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function BP(e){return e.incoming.filter(n=>IP(n.source)).length>0}const LP={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",jl],appendBehavior:["type",Fl],associationBehavior:["type",Hl],attachEventBehavior:["type",es],boundaryEventBehavior:["type",Vl],compensateBoundaryEventBehaviour:["type",zl],createBehavior:["type",Wl],createDataObjectBehavior:["type",Ul],createParticipantBehavior:["type",ql],dataInputAssociationBehavior:["type",Yl],dataStoreBehavior:["type",Xl],deleteLaneBehavior:["type",Zl],detachEventBehavior:["type",cs],dropOnFlowBehavior:["type",Jl],eventBasedGatewayBehavior:["type",Ql],fixHoverBehavior:["type",Ym],groupBehavior:["type",eu],importDockingFix:["type",Zm],isHorizontalFix:["type",nu],labelBehavior:["type",iu],layoutConnectionBehavior:["type",ru],messageFlowBehavior:["type",su],nonInterruptingBehavior:["type",cu],removeElementBehavior:["type",uu],removeEmbeddedLabelBoundsBehavior:["type",lu],removeParticipantBehavior:["type",pu],replaceConnectionBehavior:["type",fu],replaceElementBehaviour:["type",hs],resizeBehavior:["type",vg],resizeLaneBehavior:["type",bg],rootElementReferenceBehavior:["type",mu],spaceToolBehavior:["type",xg],subProcessPlaneBehavior:["type",ti],subProcessStartEventBehavior:["type",vu],textAnnotationBehavior:["type",yu],toggleCollapseConnectionBehaviour:["type",_u],toggleElementCollapseBehaviour:["type",Eu],unclaimIdBehavior:["type",xu],unsetDefaultFlowBehavior:["type",wu],updateFlowNodeRefsBehavior:["type",Su],setCompensationActivityAfterPasteBehavior:["type",Cu]};function Cg(e,t){var n=pt(e,t,-15);return n!=="intersect"?n:null}function at(e){Ht.call(this,e)}Y(at,Ht),at.$inject=["eventBus"],at.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return $P(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return ys(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,i=e.target;return ys(n,i,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return Bg(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return we(i)&&!_s(t,i)?!1:yi(t,function(r){return we(r)?ys(r.source,r.target,r):r.host?lo(r,r.host,null,n):ku(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return lo(n,t,null,i)||Og(n,t,i)||Ig(n,t)||_s(n,t)}),this.addRule("shape.create",function(e){return ku(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return lo(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return Hg(n,t)})},at.prototype.canConnectMessageFlow=jg,at.prototype.canConnectSequenceFlow=Fg,at.prototype.canConnectDataAssociation=Du,at.prototype.canConnectAssociation=Lg,at.prototype.canConnectCompensationAssociation=$g,at.prototype.canMove=Ig,at.prototype.canAttach=lo,at.prototype.canReplace=Og,at.prototype.canDrop=_r,at.prototype.canInsert=_s,at.prototype.canCreate=ku,at.prototype.canConnect=ys,at.prototype.canResize=Bg,at.prototype.canCopy=Hg;function $P(e){return Ru(e)?null:le(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function Ru(e){return!e||ge(e)}function jP(e,t){return e===t}function Rg(e){do{if(b(e,"bpmn:Process"))return H(e);if(b(e,"bpmn:Participant"))return H(e).processRef||H(e)}while(e=e.parent)}function Tu(e){return b(e,"bpmn:TextAnnotation")}function Pu(e){return b(e,"bpmn:Group")&&!e.labelTarget}function Tg(e){return b(e,"bpmn:BoundaryEvent")&&yn(e,"bpmn:CompensateEventDefinition")}function vs(e){return H(e).isForCompensation}function FP(e,t){var n=Rg(e),i=Rg(t);return n===i}function HP(e){return b(e,"bpmn:InteractionNode")&&!b(e,"bpmn:BoundaryEvent")&&(!b(e,"bpmn:Event")||b(e,"bpmn:ThrowEvent")&&kg(e,"bpmn:MessageEventDefinition"))}function VP(e){return b(e,"bpmn:InteractionNode")&&!vs(e)&&(!b(e,"bpmn:Event")||b(e,"bpmn:CatchEvent")&&kg(e,"bpmn:MessageEventDefinition"))&&!(b(e,"bpmn:BoundaryEvent")&&!yn(e,"bpmn:MessageEventDefinition"))}function Pg(e){for(var t=e;t=t.parent;){if(b(t,"bpmn:FlowElementsContainer"))return H(t);if(b(t,"bpmn:Participant"))return H(t).processRef}return null}function Ag(e,t){var n=Pg(e),i=Pg(t);return n===i}function yn(e,t){var n=H(e);return!!_e(n.eventDefinitions||[],function(i){return b(i,t)})}function kg(e,t){var n=H(e);return(n.eventDefinitions||[]).every(function(i){return b(i,t)})}function zP(e){return b(e,"bpmn:FlowNode")&&!b(e,"bpmn:EndEvent")&&!ht(e)&&!(b(e,"bpmn:IntermediateThrowEvent")&&yn(e,"bpmn:LinkEventDefinition"))&&!Tg(e)&&!vs(e)}function WP(e){return b(e,"bpmn:FlowNode")&&!b(e,"bpmn:StartEvent")&&!b(e,"bpmn:BoundaryEvent")&&!ht(e)&&!(b(e,"bpmn:IntermediateCatchEvent")&&yn(e,"bpmn:LinkEventDefinition"))&&!vs(e)}function UP(e){return b(e,"bpmn:ReceiveTask")||b(e,"bpmn:IntermediateCatchEvent")&&(yn(e,"bpmn:MessageEventDefinition")||yn(e,"bpmn:TimerEventDefinition")||yn(e,"bpmn:ConditionalEventDefinition")||yn(e,"bpmn:SignalEventDefinition"))}function GP(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Au(e,t){var n=GP(t);return n.indexOf(e)!==-1}function ys(e,t,n){if(Ru(e)||Ru(t))return null;if(!b(n,"bpmn:DataAssociation")){if(jg(e,t))return{type:"bpmn:MessageFlow"};if(Fg(e,t))return{type:"bpmn:SequenceFlow"}}var i=Du(e,t);return i||($g(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Lg(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function _r(e,t){return ge(e)||Pu(e)?!0:b(t,"bpmn:Participant")&&!fe(t)?!1:b(e,"bpmn:Participant")?b(t,"bpmn:Process")||b(t,"bpmn:Collaboration"):le(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:b(e,"bpmn:Lane")?b(t,"bpmn:Participant")||b(t,"bpmn:Lane"):b(e,"bpmn:BoundaryEvent")&&!KP(e)?!1:b(e,"bpmn:FlowElement")&&!b(e,"bpmn:DataStoreReference")?b(t,"bpmn:FlowElementsContainer")?fe(t):le(t,["bpmn:Participant","bpmn:Lane"]):b(e,"bpmn:DataStoreReference")&&b(t,"bpmn:Collaboration")?$n(H(t).get("participants"),function(n){return!!n.get("processRef")}):le(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?le(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):b(e,"bpmn:MessageFlow")?b(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function KP(e){return H(e).cancelActivity&&(Dg(e)||Mg(e))}function qP(e){return!ge(e)&&b(e,"bpmn:BoundaryEvent")}function YP(e){return b(e,"bpmn:Lane")}function XP(e){return qP(e)||b(e,"bpmn:IntermediateThrowEvent")&&Dg(e)?!0:b(e,"bpmn:IntermediateCatchEvent")&&Mg(e)}function Dg(e){var t=H(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Mg(e){return Ng(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Ng(e,t){return t.some(function(n){return yn(e,n)})}function ZP(e){return b(e,"bpmn:ReceiveTask")&&_e(e.incoming,function(t){return b(t.source,"bpmn:EventBasedGateway")})}function lo(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return ge(r)||!XP(r)||ht(t)||!b(t,"bpmn:Activity")||vs(t)||i&&!Cg(i,t)||ZP(t)?!1:"attach"}function Og(e,t,n){if(!t)return!1;var i={replacements:[]};return A(e,function(r){ht(t)||b(r,"bpmn:StartEvent")&&r.type!=="label"&&_r(r,t)&&(W1(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(U1(r)||G1(r)||K1(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),Ng(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&b(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),b(t,"bpmn:Transaction")||yn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(b(r,"bpmn:EndEvent")&&_r(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),b(r,"bpmn:BoundaryEvent")&&lo(r,t,null,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),i.replacements.length?i:!1}function Ig(e,t){return $n(e,YP)?!1:t?e.every(function(n){return _r(n,t)}):!0}function ku(e,t,n,i){return t?ge(e)||Pu(e)?!0:jP(n,t)||n&&Au(n,t)?!1:_r(e,t)||_s(e,t):!1}function Bg(e,t){return b(e,"bpmn:SubProcess")?fe(e)&&(!t||t.width>=100&&t.height>=80):!!(b(e,"bpmn:Lane")||b(e,"bpmn:Participant")||Tu(e)||Pu(e))}function JP(e,t){var n=Tu(e),i=Tu(t);return(n||i)&&n!==i}function Lg(e,t){return Au(t,e)||Au(e,t)?!1:JP(e,t)?!0:!!Du(e,t)}function $g(e,t){return Ag(e,t)&&Tg(e)&&b(t,"bpmn:Activity")&&!eA(t,e)&&!ht(t)}function jg(e,t){return Vg(e)&&!Vg(t)?!1:HP(e)&&VP(t)&&!FP(e,t)}function Fg(e,t){return zP(e)&&WP(t)&&Ag(e,t)&&!(b(e,"bpmn:EventBasedGateway")&&!UP(t))}function Du(e,t){return le(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&le(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:le(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&le(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function _s(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:le(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(t)&&b(e,"bpmn:FlowNode")&&!b(e,"bpmn:BoundaryEvent")&&_r(e,t.parent)}function QP(e,t){return e&&t&&e.indexOf(t)!==-1}function Hg(e,t){return ge(t)?!0:!(b(t,"bpmn:Lane")&&!QP(e,t.parent))}function Vg(e){return lr(e,"bpmn:Process")||lr(e,"bpmn:Collaboration")}function eA(e,t){return e.attachers.includes(t)}const tA={__depends__:[vn],__init__:["bpmnRules"],bpmnRules:["type",at]};var nA=2e3;function zg(e,t){e.on("saveXML.start",nA,n);function n(){var i=t.getRootElements();A(i,function(r){var o=ve(r),a,s;a=Or([r],!1),a=ce(a,function(c){return c!==r&&!c.labelTarget}),s=ct(a,ve),o.set("planeElement",s)})}}zg.$inject=["eventBus","canvas"];const iA={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",zg]};function bs(e){F.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}bs.prototype.getOrdering=function(e,t){return null},Y(bs,F);function Mu(e,t){bs.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function i(a){if(a.labelTarget)return{level:10};var s=_e(n,function(c){return le(a,[c.type])});return s&&s.order||{level:1}}function r(a){var s=a.order;if(s||(a.order=s=i(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var l=s;l&&!le(l,c);)l=l.parent;if(!l)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return l}this.getOrdering=function(a,s){if(a.labelTarget||b(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=r(a);c.containers&&(s=o(a,s,c.containers));var l=s.children.indexOf(a),u=tf(s.children,function(p){return!a.labelTarget&&p.labelTarget?!1:c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:s}}}Mu.$inject=["eventBus","canvas"],Y(Mu,bs);const rA={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Mu]};function uo(){}uo.prototype.get=function(){return this._data},uo.prototype.set=function(e){this._data=e},uo.prototype.clear=function(){var e=this._data;return delete this._data,e},uo.prototype.isEmpty=function(){return!this._data};const oA={clipboard:["type",uo]};var aA="drop-ok",Wg="drop-not-ok",Ug="attach-ok",Gg="new-parent",Kg="create",sA=2e3;function qg(e,t,n,i,r){function o(c,l,u,p,f){if(!l)return!1;c=ce(c,function(C){var x=C.labelTarget;return!C.parent&&!(ge(C)&&c.indexOf(x)!==-1)});var d=_e(c,function(C){return!we(C)}),m=!1,v=!1,g=!1;Xg(c)&&(m=r.allowed("shape.attach",{position:u,shape:d,target:l})),m||(Xg(c)?g=r.allowed("shape.create",{position:u,shape:d,source:p,target:l}):g=r.allowed("elements.create",{elements:c,position:u,target:l}));var w=f.connectionTarget;return g||m?(d&&p&&(v=r.allowed("connection.create",{source:w===p?d:p,target:w===p?p:d,hints:{targetParent:l,targetAttach:m}})),{attach:m,connect:v}):g===null||m===null?null:!1}function a(c,l){[Ug,aA,Wg,Gg].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,f=l.source,d=l.hints||{};if(!p){l.canExecute=!1,l.target=null;return}Yg(c);var m={x:c.x,y:c.y},v=l.canExecute=p&&o(u,p,m,f,d);p&&v!==null&&(l.target=p,v&&v.attach?a(p,Ug):a(p,v?Gg:Wg))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&a(l,null)}),n.on("create.end",function(c){var l=c.context,u=l.source,p=l.shape,f=l.elements,d=l.target,m=l.canExecute,v=m&&m.attach,g=m&&m.connect,w=l.hints||{};if(m===!1||!d)return!1;Yg(c);var C={x:c.x,y:c.y};g?p=i.appendShape(u,p,C,d,{attach:v,connection:g===!0?{}:g,connectionTarget:w.connectionTarget}):(f=i.createElements(f,C,d,D({},w,{attach:v})),p=_e(f,function(x){return!we(x)})),D(l,{elements:f,shape:p}),D(c,{elements:f,shape:p})});function s(){var c=t.context();c&&c.prefix===Kg&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],sA,function(){n.off("elements.changed",s)})}),this.start=function(c,l,u){oe(l)||(l=[l]);var p=_e(l,function(m){return!we(m)});if(p){u=D({elements:l,hints:{},shape:p},u||{}),A(l,function(m){ee(m.x)||(m.x=0),ee(m.y)||(m.y=0)});var f=ce(l,function(m){return!m.hidden}),d=Ke(f);A(l,function(m){we(m)&&(m.waypoints=ct(m.waypoints,function(v){return{x:v.x-d.x-d.width/2,y:v.y-d.y-d.height/2}})),D(m,{x:m.x-d.x-d.width/2,y:m.y-d.y-d.height/2})}),t.init(c,Kg,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}qg.$inject=["canvas","dragging","eventBus","modeling","rules"];function Yg(e){var t=e.context,n=t.createConstraints;n&&(n.left&&(e.x=Math.max(e.x,n.left)),n.right&&(e.x=Math.min(e.x,n.right)),n.top&&(e.y=Math.max(e.y,n.top)),n.bottom&&(e.y=Math.min(e.y,n.bottom)))}function Xg(e){return e&&e.length===1&&!we(e[0])}var cA=750;function Zg(e,t,n,i,r){function o(a){var s=X("g");G(s,r.cls("djs-drag-group",["no-events"]));var c=X("g");return a.forEach(function(l){var u;l.hidden||(l.waypoints?(u=n._createContainer("connection",c),n.drawConnection(Ei(u),l)):(u=n._createContainer("shape",c),n.drawShape(Ei(u),l),ot(u,l.x,l.y)),i.addDragger(l,s,u))}),s}t.on("create.move",cA,function(a){var s=a.hover,c=a.context,l=c.elements,u=c.dragGroup;u||(u=c.dragGroup=o(l));var p;s?(u.parentNode||(p=e.getActiveLayer(),ie(p,u)),ot(u,a.x,a.y)):Ge(u)}),t.on("create.cleanup",function(a){var s=a.context,c=s.dragGroup;c&&Ge(c)})}Zg.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Es={__depends__:[kn,dr,vn,en],__init__:["create","createPreview"],create:["type",qg],createPreview:["type",Zg]};function Nu(e){var t=this;this._lastMoveEvent=null;function n(i){t._lastMoveEvent=i}e.on("canvas.init",function(i){var r=t._svg=i.svg;r.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Nu.$inject=["eventBus"],Nu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||lA(0,0)};function lA(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}const po={__init__:["mouse"],mouse:["type",Nu]};function nn(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(c){var l=c.descriptor,u=c.element,p=c.elements;l.priority=1,l.id=u.id;var f=_e(p,function(d){return d===u.parent});f&&(l.parent=u.parent.id),uA(u)&&(l.priority=2,l.host=u.host.id),we(u)&&(l.priority=3,l.source=u.source.id,l.target=u.target.id,l.waypoints=pA(u)),ge(u)&&(l.priority=4,l.labelTarget=u.labelTarget.id),A(["x","y","width","height"],function(d){ee(u[d])&&(l[d]=u[d])}),l.hidden=u.hidden,l.collapsed=u.collapsed}),r.on("copyPaste.pasteElements",function(c){var l=c.hints;D(l,{createElementsBehavior:!1})})}nn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],nn.prototype.copy=function(e){var t,n;return oe(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?n={}:n=this.createTree(oe(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},nn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},nn.prototype._paste=function(e,t,n,i){A(e,function(o){ee(o.x)||(o.x=0),ee(o.y)||(o.y=0)});var r=Ke(e);return A(e,function(o){we(o)&&(o.waypoints=ct(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),D(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,D({},i))},nn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return A(e,function(o,a){o=cn(o,"priority"),A(o,function(s){var c=D({},ln(s,["priority"]));i[s.parent]?c.parent=i[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:c});var l;if(we(c)){c.source=i[s.source],c.target=i[s.target],l=i[s.id]=t.createConnection(c),r.push(l);return}if(ge(c)){c.labelTarget=i[c.labelTarget],l=i[s.id]=t.createLabel(c),r.push(l);return}c.host&&(c.host=i[c.host]),l=i[s.id]=t.createShape(c),r.push(l)})}),r},nn.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(ln(e,["id"]));return t},nn.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(ln(e,["id"]));return t},nn.prototype.createShape=function(e){var t=this._elementFactory.createShape(ln(e,["id"]));return t},nn.prototype.hasRelations=function(e,t){var n,i,r;return!(we(e)&&(i=_e(t,Zt({id:e.source.id})),r=_e(t,Zt({id:e.target.id})),!i||!r)||ge(e)&&(n=_e(t,Zt({id:e.labelTarget.id})),!n))},nn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=oa(e);function a(l,u){return t.allowed("element.copy",{element:l,elements:u})}function s(l,u){var p=_e(r,function(f){return l===f.element});if(!p){r.push({element:l,depth:u});return}p.depth<u&&(r=c(p,r),r.push({element:p.element,depth:u}))}function c(l,u){var p=u.indexOf(l);return p!==-1&&u.splice(p,1),u}return bi(o,function(l,u,p){if(ge(l))return;A(l.labels,function(m){s(m,p)});function f(m){m&&m.length&&A(m,function(v){A(v.labels,function(g){s(g,p)}),s(v,p)})}A([l.attachers,l.incoming,l.outgoing],f),s(l,p);var d=[];return l.children&&(d=l.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:l,children:d}),d}),e=ct(r,function(l){return l.element}),r=ct(r,function(l){return l.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),r=cn(r,function(l){return l.descriptor.priority}),e=ct(r,function(l){return l.element}),A(r,function(l){var u=l.depth;if(!n.hasRelations(l.element,e)){Qg(l.element,e);return}if(!a(l.element,e)){Qg(l.element,e);return}i[u]||(i[u]=[]),i[u].push(l.descriptor)}),i};function uA(e){return!!e.host}function pA(e){return ct(e.waypoints,function(t){return t=Jg(t),t.original&&(t.original=Jg(t.original)),t})}function Jg(e){return D({},e)}function Qg(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}const fA={__depends__:[oA,Es,po,vn],__init__:["copyPaste"],copyPaste:["type",nn]};function Ou(e,t,n){oe(n)||(n=[n]),A(n,function(i){vi(e[i])||(t[i]=e[i])})}var Iu=750;function ev(e,t,n){function i(c,l){var u=e.create(c.$type);return n.copyElement(c,u,null,l)}t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element,p=H(u);if(ge(u))return l;var f=l.businessObject=i(p,!0),d=l.di=i(ve(u),!0);d.bpmnElement=f,Ou(f,l,"name"),Ou(d,l,"isExpanded"),p.default&&(l.default=p.default.id)});var r="-bpmn-js-refs";function o(c){return c[r]=c[r]||{}}function a(c,l){c[r]=l}function s(c,l,u){var p=H(c);return c.default&&(u[c.default]={element:p,property:"default"}),c.host&&(H(c).attachedToRef=H(l[c.host])),ln(u,Tt(u,function(f,d,m){var v=d.element,g=d.property;return m===c.id&&(v.set(g,p),f.push(c.id)),f},[]))}t.on("copyPaste.pasteElement",function(c){var l=c.cache,u=c.descriptor,p=u.businessObject,f=u.di;if(ge(u)){u.businessObject=H(l[u.labelTarget]),u.di=ve(l[u.labelTarget]);return}p=u.businessObject=i(p),f=u.di=i(f),f.bpmnElement=p,Ou(u,p,["isExpanded","name"]),u.type=p.$type}),t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element;if(b(u,"bpmn:Participant")){var p=H(u);p.processRef&&(l.processRef=i(p.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var l=c.descriptor,u=l.processRef;u&&(l.processRef=i(u))}),t.on("copyPaste.pasteElement",Iu,function(c){var l=c.cache,u=c.descriptor;a(l,s(u,l,o(l)))})}ev.$inject=["bpmnFactory","eventBus","moddleCopy"];var dA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function fo(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(!(!r||!r.length))return cn(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=tt(r)&&r.$descriptor,a=i.propertyName;if(a&&dA.indexOf(a)!==-1||a&&o&&!_e(o.properties,Zt({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r=i.property;if(hA(r,"bpmn:ExtensionElements")&&(!r.values||!r.values.length))return!1})}fo.$inject=["eventBus","bpmnFactory","moddle"],fo.prototype.copyElement=function(e,t,n,i=!1){var r=this;n&&!oe(n)&&(n=[n]),n=n||Bu(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return o===!1||(oe(o)&&(n=o),A(n,function(a){var s;bt(e,a)&&(s=e.get(a));var c=r.copyProperty(s,t,a,i);if(et(c)){var l=r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:a});l!==!1&&t.set(a,c)}})),t},fo.prototype.copyProperty=function(e,t,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(o!==!1){if(o)return tt(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference)return a.isId?e&&this._copyId(e,t,i):oe(e)?Tt(e,function(s,c){return o=r.copyProperty(c,t,n,i),o?s.concat(o):s},[]):tt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(o=r._bpmnFactory.create(e.$type),o.$parent=t,o=r.copyElement(e,o,null,i),o):e}},fo.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function Bu(e,t){return Tt(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}function hA(e,t){return e&&We(e.$instanceOf)&&e.$instanceOf(t)}const tv={__depends__:[fA],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ev],moddleCopy:["type",fo]};var nv=Math.round;function Lu(e,t){this._modeling=e,this._eventBus=t}Lu.$inject=["modeling","eventBus"],Lu.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,l=nv(s+o/2),u=nv(c+a/2),p=i.replaceShape(e,D({},t,{x:l,y:u,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:p,hints:n}),p};function iv(e,t){t.on("replace.end",500,function(n){const{newElement:i,hints:r={}}=n;r.select!==!1&&e.select(i)})}iv.$inject=["selection","eventBus"];const mA={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",iv],replace:["type",Lu]};function gA(e,t,n){oe(n)||(n=[n]),A(n,function(i){vi(e[i])||(t[i]=e[i])})}var vA=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function yA(e,t){var n=e&&bt(e,"collapsed")?e.collapsed:!fe(e),i;return t&&(bt(t,"collapsed")||bt(t,"isExpanded"))?i=bt(t,"collapsed")?t.collapsed:!t.isExpanded:i=n,n!==i}function rv(e,t,n,i,r,o){function a(s,c,l){l=l||{};var u=c.type,p=s.businessObject;if(xs(p)&&(u==="bpmn:SubProcess"||u==="bpmn:AdHocSubProcess")&&yA(s,c))return i.toggleCollapse(s),s;var f=e.create(u),d={type:u,businessObject:f};d.di={},u==="bpmn:ExclusiveGateway"&&(d.di.isMarkerVisible=!0),gA(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var m=Bu(p.$descriptor),v=Bu(f.$descriptor,!0),g=_A(m,v);D(f,Jt(c,vA));var w=ce(g,function(E){return E==="eventDefinitions"?ov(s,c.eventDefinitionType):E==="loopCharacteristics"?!ht(f):bt(f,E)||E==="processRef"&&c.isExpanded===!1||E==="triggeredByEvent"?!1:E==="isForCompensation"?!ht(f):!0});if(f=n.copyElement(p,f,w),c.eventDefinitionType&&(ov(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),b(p,"bpmn:Activity")){if(xs(p))d.isExpanded=fe(s);else if(c&&bt(c,"isExpanded")){d.isExpanded=c.isExpanded;var C=t.getDefaultSize(f,{isExpanded:d.isExpanded});d.width=C.width,d.height=C.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}fe(s)&&!b(p,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(xs(p)&&!xs(f)&&(l.moveChildren=!1),b(p,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var x=Ze(s);ve(s).isHorizontal||(ve(d).isHorizontal=x),d.width=x?s.width:t.getDefaultSize(d).width,d.height=x?t.getDefaultSize(d).height:s.height}return o.allowed("shape.resize",{shape:f})||(d.height=t.getDefaultSize(d).height,d.width=t.getDefaultSize(d).width),f.name=p.name,le(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&le(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=p.default),c.host&&!b(p,"bpmn:BoundaryEvent")&&b(f,"bpmn:BoundaryEvent")&&(d.host=c.host),(d.type==="bpmn:DataStoreReference"||d.type==="bpmn:DataObjectReference")&&(d.x=s.x+(s.width-d.width)/2),r.replaceElement(s,d,{...l,targetElement:c})}this.replaceElement=a}rv.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function xs(e){return b(e,"bpmn:SubProcess")}function ov(e,t){var n=H(e);return t&&n.get("eventDefinitions").some(function(i){return b(i,t)})}function _A(e,t){return e.filter(function(n){return t.includes(n)})}const av={__depends__:[tv,mA,en],bpmnReplace:["type",rv]};var bA=250;function Oi(e){this._eventBus=e,this._tools=[],this._active=null}Oi.$inject=["eventBus"],Oi.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},Oi.prototype.isActive=function(e){return e&&this._active===e},Oi.prototype.length=function(e){return this._tools.length},Oi.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Oi.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(r){var o=r.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),A(t,function(r){i.push(r+".ended"),i.push(r+".canceled")}),n.on(i,bA,function(r){this._active&&(EA(r)||this.setActive(null))},this)};function EA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Ui(t,'.group[data-group="tools"]')}const ws={__depends__:[kn],__init__:["toolManager"],toolManager:["type",Oi]};function xA(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function wA(e,t){var n=[];return A(e.concat(t),function(i){var r=i.incoming,o=i.outgoing;A(r.concat(o),function(a){var s=a.source,c=a.target;(ho(e,s)||ho(e,c)||ho(t,s)||ho(t,c))&&(ho(n,a)||n.push(a))})}),n}function ho(e,t){return e.indexOf(t)!==-1}function SA(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var $u=Math.abs,CA=Math.round,Mn={x:"width",y:"height"},sv="crosshair",ni={n:"top",w:"left",s:"bottom",e:"right"},RA=1500,Ss={n:"s",w:"e",s:"n",e:"w"},Cs=20;function Ut(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",RA,function(c){var l=c.context,u=l.initialized;u||(u=l.initialized=s.init(c,l)),u&&lv(c)}),n.on("spaceTool.end",function(c){var l=c.context,u=l.axis,p=l.direction,f=l.movingShapes,d=l.resizingShapes,m=l.start;if(l.initialized){lv(c);var v={x:0,y:0};v[u]=CA(c["d"+u]),s.makeSpace(f,d,v,p,m),n.once("spaceTool.ended",function(g){s.activateSelection(g.originalEvent,!0,!0)})}})}Ut.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Ut.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:sv,data:{context:{reactivate:n}},trapClick:!1})},Ut.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:sv,data:{context:{}}})},Ut.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Ut.prototype.init=function(e,t){var n=$u(e.dx)>$u(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if($u(i)<5)return!1;i<0&&(i*=-1),Yr(e)&&(i*=-1);var o=xA(n,i),a=this._canvas.getRootElement();!Aa(e)&&e.hover&&(a=e.hover);var s=[...Or(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),u=TA(c,n,o,r,l);return D(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:r}),Na("resize-"+(n==="x"?"ew":"ns")),!0},Ut.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function l(f){o.includes(f)||o.push(f);var d=f.label;d&&!o.includes(d)&&o.push(d)}function u(f){a.includes(f)||a.push(f)}A(e,function(f){if(!(!f.parent||ge(f))){if(we(f)){c.push(f);return}var d=f[t],m=d+f[Mn[t]];if(PA(f)&&(n>0&&te(f)[t]>i||n<0&&te(f)[t]<i)){s.push(f);return}if(n>0&&d>i||n<0&&m<i){l(f);return}if(d<i&&m>i&&r.allowed("shape.resize",{shape:f})){u(f);return}}}),A(o,function(f){var d=f.attachers;d&&A(d,function(m){l(m)})});var p=o.concat(a);return A(s,function(f){var d=f.host;Ii(p,d)&&l(f)}),p=o.concat(a),A(c,function(f){var d=f.source,m=f.target,v=f.label;Ii(p,d)&&Ii(p,m)&&v&&l(v)}),{movingShapes:o,resizingShapes:a}},Ut.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Ut.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function cv(e){return{top:e.top-Cs,right:e.right+Cs,bottom:e.bottom+Cs,left:e.left-Cs}}function lv(e){var t=e.context,n=t.spaceToolConstraints;if(n){var i,r;ee(n.left)&&(i=Math.max(e.x,n.left),e.dx=e.dx+i-e.x,e.x=i),ee(n.right)&&(i=Math.min(e.x,n.right),e.dx=e.dx+i-e.x,e.x=i),ee(n.top)&&(r=Math.max(e.y,n.top),e.dy=e.dy+r-e.y,e.y=r),ee(n.bottom)&&(r=Math.min(e.y,n.bottom),e.dy=e.dy+r-e.y,e.y=r)}}function TA(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,l;return A(a,function(u){var p=u.attachers,f=u.children,d=Q(u),m=ce(f,function(I){return!we(I)&&!ge(I)&&!Ii(o,I)&&!Ii(a,I)}),v=ce(f,function(I){return!we(I)&&!ge(I)&&Ii(o,I)}),g,w,C,x=[],E=[],S,R,N,P;m.length&&(w=cv(Q(Ke(m))),g=i-d[ni[n]]+w[ni[n]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),v.length&&(C=cv(Q(Ke(v))),g=i-C[ni[Ss[n]]]+d[ni[Ss[n]]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),p&&p.length&&(p.forEach(function(I){Ii(o,I)?x.push(I):E.push(I)}),x.length&&(S=Q(Ke(x.map(te))),R=d[ni[Ss[n]]]-(S[ni[Ss[n]]]-i)),E.length&&(N=Q(Ke(E.map(te))),P=N[ni[n]]-(d[ni[n]]-i)),n==="n"?(g=Math.min(R||1/0,P||1/0),s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=Math.min(R||1/0,P||1/0),s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=Math.max(R||-1/0,P||-1/0),s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=Math.max(R||-1/0,P||-1/0),s.left=c=ee(c)?Math.max(c,g):g));var O=r&&r[u.id];O&&(n==="n"?(g=i+u[Mn[t]]-O[Mn[t]],s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=i+u[Mn[t]]-O[Mn[t]],s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=i-u[Mn[t]]+O[Mn[t]],s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=i-u[Mn[t]]+O[Mn[t]],s.left=c=ee(c)?Math.max(c,g):g))}),s}}function Ii(e,t){return e.indexOf(t)!==-1}function PA(e){return!!e.host}var ju="djs-dragging",uv="djs-resizing",AA=250,Rs=Math.max;function pv(e,t,n,i,r){function o(a,s){A(a,function(c){r.addDragger(c,s),n.addMarker(c,ju)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,l={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},u=X("g");G(u,i.cls("djs-crosshair-group",["no-events"])),ie(s,u);var p=X("path");G(p,"d",l.x),me(p).add("djs-crosshair"),ie(u,p);var f=X("path");G(f,"d",l.y),me(f).add("djs-crosshair"),ie(u,f),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;ot(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Ge(c)}),e.on("spaceTool.move",AA,function(a){var s=a.context,c=s.line,l=s.axis,u=s.movingShapes,p=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var f=n.getLayer("space");c=X("path"),G(c,"d","M0,0 L0,0"),me(c).add("djs-crosshair"),ie(f,c),s.line=c;var d=X("g");G(d,i.cls("djs-drag-group",["no-events"])),ie(n.getActiveLayer(),d),o(u,d);var m=s.movingConnections=t.filter(function(E){var S=!1;A(u,function(O){A(O.outgoing,function(I){E===I&&(S=!0)})});var R=!1;A(u,function(O){A(O.incoming,function(I){E===I&&(R=!0)})});var N=!1;A(p,function(O){A(O.outgoing,function(I){E===I&&(N=!0)})});var P=!1;return A(p,function(O){A(O.incoming,function(I){E===I&&(P=!0)})}),we(E)&&(S||N)&&(R||P)});o(m,d),s.dragGroup=d}if(!s.frameGroup){var v=X("g");G(v,i.cls("djs-frame-group",["no-events"])),ie(n.getActiveLayer(),v);var g=[];A(p,function(E){var S=r.addFrame(E,v),R=S.getBBox();g.push({element:S,initialBounds:R}),n.addMarker(E,uv)}),s.frameGroup=v,s.frames=g}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};G(c,{d:w[l]});var C={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[C[s.axis]]=0,ot(s.dragGroup,x.x,x.y),A(s.frames,function(E){var S=E.element,R=E.initialBounds,N,P;s.direction==="e"?G(S,{width:Rs(R.width+x.x,5)}):(N=Rs(R.width-x.x,5),G(S,{width:N,x:R.x+R.width-N})),s.direction==="s"?G(S,{height:Rs(R.height+x.y,5)}):(P=Rs(R.height-x.y,5),G(S,{height:P,y:R.y+R.height-P}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,l=s.movingConnections,u=s.resizingShapes,p=s.line,f=s.dragGroup,d=s.frameGroup;A(c,function(m){n.removeMarker(m,ju)}),A(l,function(m){n.removeMarker(m,ju)}),f&&(Ge(p),Ge(f)),A(u,function(m){n.removeMarker(m,uv)}),d&&Ge(d)})}pv.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const kA={__init__:["spaceToolPreview"],__depends__:[kn,vn,ws,dr,po],spaceTool:["type",Ut],spaceToolPreview:["type",pv]};function Ts(e,t){e.invoke(Ut,this),this._canvas=t}Ts.$inject=["injector","canvas"],Y(Ts,Ut),Ts.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],a=[];o&&(a=Yo(wf(r.children.filter(l=>b(l,"bpmn:Artifact")),Ke(o))));const s=[...e,...a];var c=Ut.prototype.calculateAdjustments.call(this,s,t,n,i);return c.resizingShapes=c.resizingShapes.filter(function(l){return!(b(l,"bpmn:TextAnnotation")||DA(l)&&(t==="y"&&Ze(l)||t==="x"&&!Ze(l)))}),c};function DA(e){return b(e,"bpmn:Participant")&&!H(e).processRef}const fv={__depends__:[kA],spaceTool:["type",Ts]};function Me(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Me.$inject=["eventBus","injector"],Me.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Me.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Me.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Me.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Me.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Me.prototype.register=function(e,t){this._setHandler(e,t)},Me.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Me.prototype.canUndo=function(){return!!this._getUndoAction()},Me.prototype.canRedo=function(){return!!this._getRedoAction()},Me.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Me.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Me.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},Me.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Me.prototype._createId=function(){return this._uid++},Me.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Me.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Me.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Me.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:nf("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Me.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=oe(e)?e:[e],t.dirty=t.dirty.concat(e))},Me.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Me.prototype._revertedAction=function(e){this._stackIdx--},Me.prototype._getHandler=function(e){return this._handlerMap[e]},Me.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const MA={commandStack:["type",Me]};function ii(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var NA=250,dv=1400;function Fu(e,t,n){F.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",dv,function(r){var o=r.context,a=o.shapes,s=o.validatedShapes;o.shapes=hv(a),o.validatedShapes=hv(s)}),i&&t.on("shape.move.start",NA,function(r){var o=r.context,a=o.shapes,s=[];A(a,function(c){A(c.labels,function(l){!l.hidden&&o.shapes.indexOf(l)===-1&&s.push(l),c.labelTarget&&s.push(c)})}),A(s,function(c){i.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",dv,function(r){var o=r.context,a=o.closure,s=a.enclosedElements,c=[];A(s,function(l){A(l.labels,function(u){s[u.id]||c.push(u)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context,a=o.connection||o.shape;ii(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=Ic(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(qe(s.labels,a,c),a.labelTarget=s)})}Y(Fu,F),Fu.$inject=["injector","eventBus","modeling"];function hv(e){return ce(e,function(t){return e.indexOf(t.labelTarget)===-1})}const OA={__init__:["labelSupport"],labelSupport:["type",Fu]};var IA=251,mv=1401,gv="attach-ok";function Hu(e,t,n,i,r){F.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",mv,function(a){var s=a.context,c=s.shapes,l=s.validatedShapes;s.shapes=BA(c),s.validatedShapes=LA(l)}),o&&t.on("shape.move.start",IA,function(a){var s=a.context,c=s.shapes,l=Vu(c);A(l,function(u){o.makeDraggable(s,u,!0),A(u.labels,function(p){o.makeDraggable(s,p,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var l=c[0],u=l.host;u&&(n.addMarker(u,gv),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(u,gv)}))}}),this.preExecuted("elements.move",mv,function(a){var s=a.context,c=s.closure,l=s.shapes,u=Vu(l);A(u,function(p){c.add(p,c.topLevel[p.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,l=s.newHost,u;l&&c.length!==1||(l?u=c:u=ce(c,function(p){var f=p.host;return $A(p)&&!jA(c,f)}),A(u,function(p){r.updateAttachment(p,l)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;A(s,function(c){A(c.attachers,function(l){A(l.outgoing.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)}),A(l.incoming.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,l=s.host;l&&r.updateAttachment(c,l)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,l=s.newShape;ii(c.attachers,function(u){var p=i.allowed("elements.move",{target:l,shapes:[u]});p==="attach"?r.updateAttachment(u,l):r.removeShape(u)}),l.attachers.length&&A(l.attachers,function(u){var p=cg(u,c,l);r.moveShape(u,p,u.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.oldBounds,u=s.newBounds,p=c.attachers,f=s.hints||{};f.attachSupport!==!1&&A(p,function(d){var m=cg(d,l,u);r.moveShape(d,m,d.parent),A(d.labels,function(v){r.moveShape(v,m,v.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;ii(s.attachers,function(c){r.removeShape(c)}),s.host&&r.updateAttachment(s,null)})}Y(Hu,F),Hu.$inject=["injector","eventBus","canvas","rules","modeling"];function Vu(e){return xc(ct(e,function(t){return t.attachers||[]}))}function BA(e){var t=Vu(e);return A0("id",e,t)}function LA(e){var t=Wi(e,"id");return ce(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function $A(e){return!!e.host}function jA(e,t){return e.indexOf(t)!==-1}const FA={__depends__:[vn],__init__:["attachSupport"],attachSupport:["type",Hu]};function Gt(e){this._model=e}Gt.$inject=["moddle"],Gt.prototype._needsId=function(e){return le(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Gt.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;b(e,"bpmn:Activity")?t="Activity":b(e,"bpmn:Event")?t="Event":b(e,"bpmn:Gateway")?t="Gateway":le(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Gt.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Gt.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Gt.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",D({bpmnElement:e,bounds:this.createDiBounds()},t))},Gt.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Gt.prototype.createDiWaypoints=function(e){var t=this;return ct(e,function(n){return t.createDiWaypoint(n)})},Gt.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Jt(e,["x","y"]))},Gt.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",D({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Gt.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",D({bpmnElement:e},t))};function Dt(e,t,n){F.call(this,e),this._bpmnFactory=t;var i=this;function r(d){var m=d.context,v=m.hints||{},g;!m.cropped&&v.createElementsBehavior!==!1&&(g=m.connection,g.waypoints=n.getCroppedWaypoints(g),m.cropped=!0)}this.executed(["connection.layout","connection.create"],r),this.reverted(["connection.layout"],function(d){delete d.context.cropped});function o(d){var m=d.context;i.updateParent(m.shape||m.connection,m.oldParent)}function a(d){var m=d.context,v=m.shape||m.connection,g=m.parent||m.newParent;i.updateParent(v,g)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Mt(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Mt(a));function s(d){var m=d.context,v=m.oldRoot,g=v.children;A(g,function(w){b(w,"bpmn:BaseElement")&&i.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(d){var m=d.context.shape;b(m,"bpmn:BaseElement")&&i.updateBounds(m)}this.executed(["shape.move","shape.create","shape.resize"],Mt(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],Mt(function(d){d.context.shape.type!=="label"&&c(d)})),e.on("shape.changed",function(d){d.element.type==="label"&&c({context:{shape:d.element}})});function l(d){i.updateConnection(d.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Mt(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Mt(l));function u(d){i.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Mt(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Mt(u)),this.executed("connection.reconnect",Mt(function(d){var m=d.context,v=m.connection,g=m.oldSource,w=m.newSource,C=H(v),x=H(g),E=H(w);C.conditionExpression&&!le(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=C.conditionExpression,delete C.conditionExpression),g!==w&&x.default===C&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",Mt(function(d){var m=d.context,v=m.connection,g=m.oldSource,w=m.newSource,C=H(v),x=H(g),E=H(w);m.oldConditionExpression&&(C.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete E.default)}));function p(d){i.updateAttachment(d.context)}this.executed(["element.updateAttachment"],Mt(p)),this.reverted(["element.updateAttachment"],Mt(p)),this.executed("element.updateLabel",Mt(f)),this.reverted("element.updateLabel",Mt(f));function f(d){const{element:m}=d.context,v=Qt(m),g=ve(m),w=g&&g.get("label");Ci(m)||Ta(m)||(v&&!w?g.set("label",t.create("bpmndi:BPMNLabel")):!v&&w&&g.set("label",void 0))}}Y(Dt,F),Dt.$inject=["eventBus","bpmnFactory","connectionDocking"],Dt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Dt.prototype.updateParent=function(e,t){if(!ge(e)&&!(b(e,"bpmn:DataStoreReference")&&e.parent&&b(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=ve(e),o=n&&n.businessObject,a=ve(n);b(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),b(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),b(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(i,o),b(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Dt.prototype.updateBounds=function(e){var t=ve(e),n=VA(e);if(n){var i=tn(n,t.get("bounds"));D(n,{x:e.x+i.x,y:e.y+i.y})}var r=ge(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),D(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Dt.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var i,r;b(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),Le(i,e)),b(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),qe(r,e))}},Dt.prototype.updateDiConnection=function(e,t,n){var i=ve(e),r=ve(t),o=ve(n);i.sourceElement&&i.sourceElement.bpmnElement!==H(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==H(n)&&(i.targetElement=n&&o)},Dt.prototype.updateDiParent=function(e,t){if(t&&!b(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Le(n,e),e.$parent=null)}};function HA(e){for(;e&&!b(e,"bpmn:Definitions");)e=e.$parent;return e}Dt.prototype.getLaneSet=function(e){var t,n;return b(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(b(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)},Dt.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&!((b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput"))&&(b(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(b(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(b(e,"bpmn:FlowElement")){if(t){if(b(t,"bpmn:Participant"))t=t.processRef;else if(b(t,"bpmn:Lane"))do t=t.$parent.$parent;while(b(t,"bpmn:Lane"))}i="flowElements"}else if(b(e,"bpmn:Artifact")){for(;t&&!b(t,"bpmn:Process")&&!b(t,"bpmn:SubProcess")&&!b(t,"bpmn:Collaboration");)if(b(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;i="artifacts"}else if(b(e,"bpmn:MessageFlow"))i="messageFlows";else if(b(e,"bpmn:Participant")){i="participants";var r=e.processRef,o;r&&(o=HA(e.$parent||t),e.$parent&&(Le(o.get("rootElements"),r),r.$parent=null),t&&(qe(o.get("rootElements"),r),r.$parent=o))}else b(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":b(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(i),Le(a,e)),t?(a=t.get(i),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(i);Le(a,e),t&&(s||(s=[],t.set(i,s)),s.push(e))}}},Dt.prototype.updateConnectionWaypoints=function(e){var t=ve(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Dt.prototype.updateConnection=function(e){var t=e.connection,n=H(t),i=t.source,r=H(i),o=t.target,a=H(t.target),s;if(b(n,"bpmn:DataAssociation"))b(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=r,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):b(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||r,this.updateSemanticParent(n,r,s),n.targetRef=a);else{var c=b(n,"bpmn:SequenceFlow");n.sourceRef!==r&&(c&&(Le(n.sourceRef&&n.sourceRef.get("outgoing"),n),r&&r.get("outgoing")&&r.get("outgoing").push(n)),n.sourceRef=r),n.targetRef!==a&&(c&&(Le(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,i,o)},Dt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function Mt(e){return function(t){var n=t.context,i=n.shape||n.connection||n.element;b(i,"bpmn:BaseElement")&&e(t)}}function VA(e){if(b(e,"bpmn:Activity")){var t=ve(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function ri(e,t){wn.call(this),this._bpmnFactory=e,this._moddle=t}Y(ri,wn),ri.$inject=["bpmnFactory","moddle"],ri.prototype._baseCreate=wn.prototype.create,ri.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,D({type:"label",di:n},Wr,t))}return this.createElement(e,t)},ri.prototype.createElement=function(e,t){t=D({},t||{});var n,i=t.businessObject,r=t.di;if(!i){if(!t.type)throw new Error("no shape type specified");i=this._bpmnFactory.create(t.type),_d(i)}if(!WA(r)){var o=D({},r||{},{id:i.id+"_di"});e==="root"?r=this._bpmnFactory.createDiPlane(i,o):e==="connection"?r=this._bpmnFactory.createDiEdge(i,o):r=this._bpmnFactory.createDiShape(i,o)}b(i,"bpmn:Group")&&(t=D({isFrame:!0},t)),t=zA(i,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=zu(r,t,"isExpanded")),le(i,["bpmn:Lane","bpmn:Participant"])&&(t=zu(r,t,"isHorizontal")),b(i,"bpmn:SubProcess")&&(t.collapsed=!fe(i,r)),b(i,"bpmn:ExclusiveGateway")&&(bt(r,"isMarkerVisible")?r.isMarkerVisible===void 0&&(r.isMarkerVisible=!1):r.isMarkerVisible=!0),et(t.triggeredByEvent)&&(i.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),et(t.cancelActivity)&&(i.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=i.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=i,i.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(i,r),t=D({id:i.id},n,t,{businessObject:i,di:r}),this._baseCreate(e,t)},ri.prototype.getDefaultSize=function(e,t){var n=H(e);if(t=t||ve(e),b(n,"bpmn:SubProcess"))return fe(n,t)?{width:350,height:200}:{width:100,height:80};if(b(n,"bpmn:Task"))return{width:100,height:80};if(b(n,"bpmn:Gateway"))return{width:50,height:50};if(b(n,"bpmn:Event"))return{width:36,height:36};if(b(n,"bpmn:Participant")){var i=t.isHorizontal===void 0||t.isHorizontal===!0;return fe(n,t)?i?{width:600,height:250}:{width:250,height:600}:i?{width:400,height:60}:{width:60,height:400}}return b(n,"bpmn:Lane")?{width:400,height:100}:b(n,"bpmn:DataObjectReference")?{width:36,height:50}:b(n,"bpmn:DataStoreReference")?{width:50,height:50}:b(n,"bpmn:TextAnnotation")?{width:100,height:30}:b(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},ri.prototype.createParticipantShape=function(e){return tt(e)||(e={isExpanded:e}),e=D({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function zA(e,t,n){return A(n,function(i){t=zu(e,t,i)}),t}function zu(e,t,n){return t[n]===void 0?t:(e[n]=t[n],ln(t,[n]))}function WA(e){return le(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Ps(e,t){this._modeling=e,this._canvas=t}Ps.$inject=["modeling","canvas"],Ps.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;A(n,function(r){var o={x:0,y:0};et(i.left)?o.x=i.left-r.x:et(i.right)?o.x=i.right-r.width-r.x:et(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:et(i.top)?o.y=i.top-r.y:et(i.bottom)?o.y=i.bottom-r.height-r.y:et(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},Ps.prototype.postExecute=function(e){};function As(e){this._modeling=e}As.$inject=["modeling"],As.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},As.prototype.postExecute=function(e){var t=e.hints||{};UA(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function UA(e,t){return $n(e.outgoing,function(n){return n.target===t})}function ks(e,t){this._canvas=e,this._layouter=t}ks.$inject=["canvas","layouter"],ks.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},ks.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Ds=Math.round;function Wu(e){this._modeling=e}Wu.$inject=["modeling"],Wu.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;A(t,function(p){ee(p.x)||(p.x=0),ee(p.y)||(p.y=0)});var s=ce(t,function(p){return!p.hidden}),c=Ke(s);A(t,function(p){we(p)&&(p.waypoints=ct(p.waypoints,function(f){return{x:Ds(f.x-c.x-c.width/2+r.x),y:Ds(f.y-c.y-c.height/2+r.y)}})),D(p,{x:Ds(p.x-c.x-c.width/2+r.x),y:Ds(p.y-c.y-c.height/2+r.y)})});var l=oa(t),u={};A(t,function(p){if(we(p)){u[p.id]=ee(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);return}var f=D({},o);l.indexOf(p)===-1&&(f.autoResize=!1),ge(p)&&(f=ln(f,["attach"])),u[p.id]=ee(i)?a.createShape(p,Jt(p,["x","y","width","height"]),p.parent||n,i,f):a.createShape(p,Jt(p,["x","y","width","height"]),p.parent||n,f)}),e.elements=Yo(u)};var vv=Math.round;function oi(e){this._canvas=e}oi.$inject=["canvas"],oi.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?D(t,n):D(t,{x:n.x-vv(t.width/2),y:n.y-vv(t.height/2)}),this._canvas.addShape(t,i,r),t},oi.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function mo(e){oi.call(this,e)}Y(mo,oi),mo.$inject=["canvas"];var GA=oi.prototype.execute;mo.prototype.execute=function(e){var t=e.shape;return qA(t),t.labelTarget=e.labelTarget,GA.call(this,e)};var KA=oi.prototype.revert;mo.prototype.revert=function(e){return e.shape.labelTarget=null,KA.call(this,e)};function qA(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function go(e,t){this._canvas=e,this._modeling=t}go.$inject=["canvas","modeling"],go.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;ii(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ii(n.outgoing,function(i){t.removeConnection(i,{nested:!0})})},go.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ic(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},go.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,qe(n.children,t,i),this._canvas.addConnection(t,n),t};function Uu(e,t){this._modeling=e,this._elementRegistry=t}Uu.$inject=["modeling","elementRegistry"],Uu.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;A(i,function(r){n.get(r.id)&&(r.waypoints?t.removeConnection(r):t.removeShape(r))})};function vo(e,t){this._canvas=e,this._modeling=t}vo.$inject=["canvas","modeling"],vo.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;ii(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ii(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),ii(n.children,function(i){we(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},vo.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Ic(i.children,n),t.removeShape(n),n},vo.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return qe(i.children,n,r),t.addShape(n,i),n};function Ms(e){this._modeling=e}Ms.$inject=["modeling"];var yv={x:"y",y:"x"};Ms.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,w){g.range.min=Math.min(w[i],g.range.min),g.range.max=Math.max(w[i]+w[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}function l(g,w){var C={y:0};C[i]=g-a(w),C[i]&&(C[yv[i]]=0,t.moveElements([w],C,w.parent))}var u=n[0],p=s(n),f=n[p],d,m,v=0;A(n,function(g,w){var C,x,E;if(g.elements.length<2){w&&w!==n.length-1&&(o(g,g.elements[0]),v+=c(g.range));return}C=cn(g.elements,i),x=C[0],w===p&&(x=C[s(C)]),E=a(x),g.range=null,A(C,function(S){if(l(E,S),g.range===null){g.range={min:S[i],max:S[i]+S[r]};return}o(g,S)}),w&&w!==n.length-1&&(v+=c(g.range))}),m=Math.abs(f.range.min-u.range.max),d=Math.round((m-v)/(n.length-1)),!(d<n.length-1)&&A(n,function(g,w){var C={},x;g===u||g===f||(x=n[w-1],g.range.max=0,A(g.elements,function(E,S){C[yv[i]]=0,C[i]=x.range.max-E[i]+d,g.range.min!==E[i]&&(C[i]+=E[i]-g.range.min),C[i]&&t.moveElements([E],C,E.parent),g.range.max=Math.max(E[i]+E[r],S?g.range.max:0)}))})},Ms.prototype.postExecute=function(e){};function Ns(e,t){this._layouter=e,this._canvas=t}Ns.$inject=["layouter","canvas"],Ns.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return D(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Ns.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Gu(){}Gu.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Le(o.children,t),qe(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},Gu.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return Le(n.children,t),qe(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t};function Ku(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Ku.prototype.add=function(e,t){return this.addAll([e],t)},Ku.prototype.addAll=function(e,t){var n=_x(e,!!t,this);return D(this,n),this};function yo(e){this._modeling=e}yo.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},yo.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,l=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),A(a,function(p){o.moveShape(p,t,l[p.id]&&!u&&n,{recurse:!1,layout:!1})}),A(s,function(p){var f=!!a[p.source.id],d=!!a[p.target.id];c[p.id]&&f&&d?o.moveConnection(p,t,l[p.id]&&!u&&n):o.layoutConnection(p,{connectionStart:f&&ou(p,p.source,t),connectionEnd:d&&au(p,p.target,t)})})},yo.prototype.getClosure=function(e){return new Ku().addAll(e,!0)};function Os(e){this._helper=new yo(e)}Os.$inject=["modeling"],Os.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Os.prototype.postExecute=function(e){var t=e.hints,n;t&&t.primaryShape&&(n=t.primaryShape,t.oldParent=n.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,n)};function Bi(e){this._modeling=e,this._helper=new yo(e)}Bi.$inject=["modeling"],Bi.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=Jt(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Le(o.children,t),qe(i.children,t,r),D(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Bi.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&(A(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:au(o,t,n)})}),A(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:ou(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},Bi.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return qe(n.children,t,i),D(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Bi.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Bi.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function _o(e){this._modeling=e}_o.$inject=["modeling"],_o.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return oe(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},_o.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!i||o.docking==="source")&&(a.connectionStart=a.connectionStart||_v(oe(r)?r[0]:r)),i&&(!n||o.docking==="target")&&(a.connectionEnd=a.connectionEnd||_v(oe(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},_o.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r};function _v(e){return e.original||e}function Nn(e,t){this._modeling=e,this._rules=t}Nn.$inject=["modeling","rules"],Nn.prototype.preExecute=function(e){var t=this,n=this._modeling,i=this._rules,r=e.oldShape,o=e.newData,a=e.hints||{},s;function c(m,v,g){return i.allowed("connection.reconnect",{connection:g,source:m,target:v})}var l={x:o.x,y:o.y},u={x:r.x,y:r.y,width:r.width,height:r.height};s=e.newShape=e.newShape||t.createShape(o,l,r.parent,a),r.host&&n.updateAttachment(s,r.host);var p;a.moveChildren!==!1&&(p=r.children.slice(),n.moveElements(p,{x:0,y:0},s,a));var f=r.incoming.slice(),d=r.outgoing.slice();A(f,function(m){var v=m.source,g=c(v,s,m);g&&t.reconnectEnd(m,s,fs(m,s,u),a)}),A(d,function(m){var v=m.target,g=c(s,v,m);g&&t.reconnectStart(m,s,ps(m,s,u),a)})},Nn.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Nn.prototype.execute=function(e){},Nn.prototype.revert=function(e){},Nn.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Nn.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Nn.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)};function bo(e){this._modeling=e}bo.$inject=["modeling"],bo.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},bo.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds,r=e.hints||{};r.layout!==!1&&(A(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:fs(o,n,i)})}),A(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:ps(o,n,i)})}))},bo.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function ai(e){this._modeling=e}ai.$inject=["modeling"],ai.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),A(r,function(s){a[s.id]=XA(s)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(wA(i,r),t,n,o,i,r,a)},ai.prototype.execute=function(){},ai.prototype.revert=function(){},ai.prototype.moveShapes=function(e,t){var n=this;A(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},ai.prototype.resizeShapes=function(e,t,n){var i=this;A(e,function(r){var o=SA(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},ai.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);A(e,function(l){var u=l.source,p=l.target,f=YA(l),d=Ev(n),m={};si(c,u)&&si(c,p)?(f=ct(f,function(v){return xv(v,i,n)&&(v[d]=v[d]+t[d]),v.original&&xv(v.original,i,n)&&(v.original[d]=v.original[d]+t[d]),v}),s._modeling.updateWaypoints(l,f,{labelBehavior:!1})):(si(c,u)||si(c,p))&&(si(r,u)?m.connectionStart=ou(l,u,t):si(r,p)?m.connectionEnd=au(l,p,t):si(o,u)?m.connectionStart=ps(l,u,a[u.id]):si(o,p)&&(m.connectionEnd=fs(l,p,a[p.id])),s._modeling.layoutConnection(l,m))})};function bv(e){return D({},e)}function YA(e){return ct(e.waypoints,function(t){return t=bv(t),t.original&&(t.original=bv(t.original)),t})}function Ev(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function xv(e,t,n){var i=Ev(n);if(/e|s/.test(n))return e[i]>t;if(/n|w/.test(n))return e[i]<t}function si(e,t){return e.indexOf(t)!==-1}function XA(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function Is(e){this._modeling=e}Is.$inject=["modeling"],Is.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=wv(n),t.collapsed=!t.collapsed;var i=Sv(n,t.collapsed);return[t].concat(i)},Is.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=t.children,r=Cv(i,n);return t.collapsed=!t.collapsed,[t].concat(r)};function wv(e){var t={};return A(e,function(n){t[n.id]=n.hidden,n.children&&(t=D({},t,wv(n.children)))}),t}function Sv(e,t){var n=[];return A(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(Sv(i.children,i.collapsed||t)))}),n}function Cv(e,t){var n=[];return A(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(Cv(i.children,t)))}),n}function Bs(e){this._modeling=e}Bs.$inject=["modeling"],Bs.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Rv(i,t),Tv(n,t),t.host=n,t},Bs.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Rv(n,t),Tv(i,t,r),t};function Rv(e,t){return Le(e&&e.attachers,t)}function Tv(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),qe(i,t,n)}}function qu(){}qu.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},qu.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function Se(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}Se.$inject=["eventBus","elementFactory","commandStack"],Se.prototype.getHandlers=function(){return{"shape.append":As,"shape.create":oi,"shape.delete":vo,"shape.move":Bi,"shape.resize":bo,"shape.replace":Nn,"shape.toggleCollapse":Is,spaceTool:ai,"label.create":mo,"connection.create":ks,"connection.delete":go,"connection.move":Gu,"connection.layout":Ns,"connection.updateWaypoints":qu,"connection.reconnect":_o,"elements.create":Wu,"elements.move":Os,"elements.delete":Uu,"elements.distribute":Ms,"elements.align":Ps,"element.updateAttachment":Bs}},Se.prototype.registerHandlers=function(e){A(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Se.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Se.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Se.prototype.moveElements=function(e,t,n,i){i=i||{};var r=i.attach,o=n,a;r===!0?(a=n,o=n.parent):r===!1&&(a=null);var s={shapes:e,delta:t,newParent:o,newHost:a,hints:i};this._commandStack.execute("elements.move",s)},Se.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Se.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Se.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0),i=this._create("connection",i);var a={source:e,target:t,parent:r,parentIndex:n,connection:i,hints:o};return this._commandStack.execute("connection.create",a),a.connection},Se.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(r=i,i=void 0),r=r||{};var o=r.attach,a,s;e=this._create("shape",e),o?(a=n.parent,s=n):a=n;var c={position:t,shape:e,parent:a,parentIndex:i,host:s,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Se.prototype.createElements=function(e,t,n,i,r){oe(e)||(e=[e]),typeof i!="number"&&(r=i,i=void 0),r=r||{};var o={position:t,elements:e,parent:n,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements},Se.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Se.prototype.appendShape=function(e,t,n,i,r){r=r||{},t=this._create("shape",t);var o={source:e,position:n,target:i,shape:t,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Se.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Se.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Se.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Se.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Se.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Se.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Se.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Se.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Se.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Se.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Se.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,D(i,{docking:"source"}))},Se.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,D(i,{docking:"target"}))},Se.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Se.prototype._create=function(e,t){return Jx(t)?t:this._elementFactory.create(e,t)},Se.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function Eo(e){this._elementRegistry=e}Eo.$inject=["elementRegistry"],Eo.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||ZA(n,qo(i));return Pv(n,i),e.oldProperties=o,e.changed=r,r},Eo.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Pv(n,t),i},Eo.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return b(e,"bpmn:DataObject")?JA(e,t):[]};function ZA(e,t){return Tt(t,function(n,i){return n[i]=e.get(i),n},{})}function Pv(e,t){A(t,function(n,i){e.set(i,n)})}function JA(e,t){return t.filter(function(n){return b(n,"bpmn:DataObjectReference")&&H(n).dataObjectRef===e})}var xo="default",On="id",Av="di",QA={width:0,height:0};function wo(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}wo.$inject=["elementRegistry","moddle","modeling","textRenderer"],wo.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var i=this._elementRegistry,r=this._moddle.ids,o=t.businessObject,a=rk(e.properties),s=e.oldProperties||ek(t,a);return kv(a,o)&&(r.unclaim(o[On]),i.updateId(t,a[On]),r.claim(a[On],o)),xo in a&&(a[xo]&&n.push(i.get(a[xo].id)),o[xo]&&n.push(i.get(o[xo].id))),Dv(t,a),e.oldProperties=s,e.changed=n,n},wo.prototype.postExecute=function(e){var t=e.element,n=t.label,i=n&&H(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,QA)}},wo.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Dv(t,i),kv(n,r)&&(a.unclaim(n[On]),o.updateId(t,i[On]),a.claim(i[On],r)),e.changed};function kv(e,t){return On in e&&e[On]!==t[On]}function ek(e,t){var n=qo(t),i=e.businessObject,r=ve(e);return Tt(n,function(o,a){return a!==Av?o[a]=i.get(a):o[a]=tk(r,qo(t.di)),o},{})}function tk(e,t){return Tt(t,function(n,i){return n[i]=e&&e.get(i),n},{})}function Dv(e,t){var n=e.businessObject,i=ve(e);A(t,function(r,o){o!==Av?n.set(o,r):i&&nk(i,r)})}function nk(e,t){A(t,function(n,i){e.set(i,n)})}var ik=["default"];function rk(e){var t=D({},e);return ik.forEach(function(n){n in e&&(t[n]=H(t[n]))}),t}function Ls(e,t){this._canvas=e,this._modeling=t}Ls.$inject=["canvas","modeling"],Ls.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=ve(r);return t.setRootElement(n),t.removeRootElement(r),qe(a.rootElements,i),i.$parent=a,Le(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Ls.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=ve(n);return t.setRootElement(r),t.removeRootElement(n),Le(a.rootElements,i),i.$parent=null,qe(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]};function Yu(e,t){this._modeling=e,this._spaceTool=t}Yu.$inject=["modeling","spaceTool"],Yu.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=Wt(i),a=o===i,s=a?i:i.parent,c=Qn(s),l=Ze(i);if(l?r==="left"?r="top":r==="right"&&(r="bottom"):r==="top"?r="left":r==="bottom"&&(r="right"),!c.length){var u=l?{x:i.x+zt,y:i.y,width:i.width-zt,height:i.height}:{x:i.x,y:i.y+zt,width:i.width,height:i.height-zt};n.createShape({type:"bpmn:Lane",isHorizontal:l},u,s)}var p=[];bi(o,function(E){return p.push(E),E.label&&p.push(E.label),E===i?[]:ce(E.children,function(S){return S!==i})});var f,d,m,v,g;r==="top"?(f=-120,d=i.y,m=d+10,v="n",g="y"):r==="left"?(f=-120,d=i.x,m=d+10,v="w",g="x"):r==="bottom"?(f=120,d=i.y+i.height,m=d-10,v="s",g="y"):r==="right"&&(f=120,d=i.x+i.width,m=d-10,v="e",g="x");var w=t.calculateAdjustments(p,g,f,m),C=l?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,C,v,m);var x=l?{x:i.x+(a?zt:0),y:d-(r==="top"?120:0),width:i.width-(a?zt:0),height:120}:{x:d-(r==="left"?120:0),y:i.y+(a?zt:0),width:120,height:i.height-(a?zt:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:l},x,s)};function Xu(e){this._modeling=e}Xu.$inject=["modeling"],Xu.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=Qn(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var a=Ze(n),s=a?n.height:n.width,c=Math.round(s/i),l,u,p,f;for(f=0;f<i;f++)f===i-1?l=s-c*f:l=c,u=a?{x:n.x+zt,y:n.y+f*c,width:n.width-zt,height:l}:{x:n.x+f*c,y:n.y+zt,width:l,height:n.height-zt},f<o?t.resizeShape(r[f],u):(p={type:"bpmn:Lane",isHorizontal:a},t.createShape(p,u,n))};function So(e,t){this._modeling=e,this._spaceTool=t}So.$inject=["modeling","spaceTool"],So.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,i=e.balanced;i!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},So.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=MT(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},So.prototype.resizeSpace=function(e,t){var n=this._spaceTool,i=Q(e),r=Q(t),o=Vm(r,i),a=Wt(e),s=[],c=[];bi(a,function(m){return s.push(m),(b(m,"bpmn:Lane")||b(m,"bpmn:Participant"))&&c.push(m),m.children});var l,u,p,f,d;(o.bottom||o.top)&&(l=o.bottom||o.top,u=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),p=o.bottom?"s":"n",f=o.top>0||o.bottom<0?-l:l,d=n.calculateAdjustments(s,"y",f,u),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:l},p)),(o.left||o.right)&&(l=o.right||o.left,u=e.x+(o.right?e.width:0)+(o.right?-10:100),p=o.right?"e":"w",f=o.left>0||o.right<0?-l:l,d=n.calculateAdjustments(c,"x",f,u),n.makeSpace(d.movingShapes,d.resizingShapes,{x:l,y:0},p))};var Co="flowNodeRef",Zu="lanes";function Ro(e){this._elementRegistry=e}Ro.$inject=["elementRegistry"],Ro.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(u,p){var f=Q(p),d={x:u.x+u.width/2,y:u.y+u.height/2};return d.x>f.left&&d.x<f.right&&d.y>f.top&&d.y<f.bottom}function s(u){n.indexOf(u)===-1&&(o.push(u),n.push(u))}function c(u){var p=Wt(u);return r[p.id]||(r[p.id]=ss(p)),r[p.id]}function l(u){if(!u.parent)return[];var p=c(u);return p.filter(function(f){return a(u,f)}).map(function(f){return f.businessObject})}return t.forEach(function(u){var p=Wt(u);if(!(!p||n.indexOf(p)!==-1)){var f=p.children.filter(function(d){return b(d,"bpmn:FlowNode")});f.forEach(s),n.push(p)}}),e.forEach(s),o.forEach(function(u){var p=u.businessObject,f=p.get(Zu),d=f.slice(),m=l(u);i.push({flowNode:p,remove:d,add:m})}),t.forEach(function(u){var p=u.businessObject;u.parent||p.get(Co).forEach(function(f){i.push({flowNode:f,remove:[p],add:[]})})}),i},Ro.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.remove.forEach(function(o){Le(r,o),Le(o.get(Co),i)}),n.add.forEach(function(o){qe(r,o),qe(o.get(Co),i)})}),[]},Ro.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.add.forEach(function(o){Le(r,o),Le(o.get(Co),i)}),n.remove.forEach(function(o){qe(r,o),qe(o.get(Co),i)})}),[]};function $s(e){this._moddle=e}$s.$inject=["moddle"],$s.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.claim(n,i):t.unclaim(n),[]},$s.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.unclaim(n):t.claim(n,i),[]};var ok={fill:void 0,stroke:void 0};function Ju(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Rt(t)){var n=ak(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}Ju.$inject=["commandStack"],Ju.prototype.postExecute=function(e){var t=e.elements,n=e.colors||ok,i=this,r={};"fill"in n&&D(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&D(r,{"border-color":this._normalizeColor(n.stroke)}),A(t,function(o){var a=we(o)?Jt(r,["border-color"]):r,s=ve(o);if(sk(a),ge(o))i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:r["border-color"]}});else{if(!le(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};function ak(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}function sk(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var ck={width:0,height:0};function Mv(e,t,n){function i(c,l){var u=c.label||c,p=c.labelTarget||c;return J1(u,l),[u,p]}function r(c){var l=c.element,u=l.businessObject,p=c.newLabel;if(!ge(l)&&Ci(l)&&!_a(l)&&!Nv(p)){var f=7,d=el(l);d={x:d.x,y:d.y+f},e.createLabel(l,d,{id:u.id+"_label",businessObject:u,di:l.di})}}function o(c){return c.oldLabel=Qt(c.element),i(c.element,c.newLabel)}function a(c){return i(c.element,c.oldLabel)}function s(c){var l=c.element,u=l.label||l,p=c.newLabel,f=c.newBounds,d=c.hints||{};if(!(!ge(u)&&!b(u,"bpmn:TextAnnotation"))){if(ge(u)&&Nv(p)){d.removeShape!==!1&&e.removeShape(u,{unsetLabel:!1});return}var m=Qt(l);typeof f>"u"&&(f=t.getExternalLabelBounds(u,m)),f&&e.resizeShape(u,f,ck)}}this.preExecute=r,this.execute=o,this.revert=a,this.postExecute=s}Mv.$inject=["modeling","textRenderer","bpmnFactory"];function Nv(e){return!e||!e.trim()}function mt(e,t,n,i){Se.call(this,e,t,n),this._bpmnRules=i}Y(mt,Se),mt.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],mt.prototype.getHandlers=function(){var e=Se.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Eo,e["element.updateProperties"]=wo,e["canvas.updateRoot"]=Ls,e["lane.add"]=Yu,e["lane.resize"]=So,e["lane.split"]=Xu,e["lane.updateRefs"]=Ro,e["id.updateClaim"]=$s,e["element.setColor"]=Ju,e["element.updateLabel"]=Mv,e},mt.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},mt.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,i)},mt.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},mt.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},mt.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},mt.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},mt.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},mt.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},mt.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},mt.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},mt.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},mt.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},mt.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Ov(){}Ov.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||te(t.source||e.source),t.connectionEnd||te(t.target||e.target)]};var js=20,lk=5,Fs=Math.round,Iv=20,uk={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function pk(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function fk(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function Bv(e,t,n){var i=pt(t,e,lk),r=n.split(":")[0],o=Fs((t.x-e.x)/2+e.x),a=Fs((t.y-e.y)/2+e.y),s,c,l=fk(r,i),u=/h|r|l/.test(r),p=!1,f=!1;return l?(s=u?{x:o,y:e.y}:{x:e.x,y:a},c=u?"h:h":"v:v"):(p=pk(i,r),c=u?"h:v":"v:h",p?u?(f=a===e.y,s={x:e.x+js*(/l/.test(r)?-1:1),y:f?a+js:a}):(f=o===e.x,s={x:f?o+js:o,y:e.y+js*(/t/.test(r)?-1:1)}):s={x:o,y:a}),{waypoints:Qu(e,s,c).concat(s),directions:c,turnNextDirections:f}}function dk(e,t,n){return Bv(e,t,n)}function hk(e,t,n){var i=Bv(t,e,Lv(n));return{waypoints:i.waypoints.slice().reverse(),directions:Lv(i.directions),turnNextDirections:i.turnNextDirections}}function mk(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var r=n+":"+i,o=Qu(e.waypoints[e.waypoints.length-1],t.waypoints[0],r);return{waypoints:o,directions:r}}function Lv(e){return e.split(":").reverse().join(":")}function gk(e,t,n){var i=Fs((t.x-e.x)/2+e.x),r=Fs((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(n==="v:v")return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Qu(e,t,n){if(n=n||"h:h",!Ck(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(jv(n)){var i=dk(e,t,n),r=hk(e,t,n),o=mk(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return gk(e,t,n)}function vk(e,t,n){var i=Qu(e,t,n);return i.unshift(e),i.push(t),Hv(i)}function yk(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=T0(o,"straight")[0]||"h:h",s=uk[a]||0,c=pt(e,t,s),l=Sk(c,a);n=n||te(e),i=i||te(t);var u=l.split(":"),p=Fv(n,e,u[0],Rk(c)),f=Fv(i,t,u[1],c);return vk(p,f,l)}function _k(e,t,n,i,r,o){oe(n)&&(r=n,o=i,n=te(e),i=te(t)),o=D({preferredLayouts:[]},o),r=r||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&Ek(e,t,n,i,o),c||(c=o.connectionEnd&&wk(t,e,i,r),c)||(c=o.connectionStart&&xk(e,t,n,r),c)?c:!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:yk(e,t,n,i,o)}function bk(e,t,n){return e>=t&&e<=n}function $v(e,t,n){var i={x:"width",y:"height"};return bk(t[e],n[e],n[e]+n[i[e]])}function Ek(e,t,n,i,r){var o={},a,s;return s=pt(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),r.preserveDocking==="target"?$v(a,i,e)?(o[a]=i[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:i.x,y:i.y}]):null:$v(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y,original:{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y}}]):null):null}function xk(e,t,n,i){return ep(e,t,n,i)}function wk(e,t,n,i){var r=i.slice().reverse();return r=ep(e,t,n,r),r?r.reverse():null}function ep(e,t,n,i){function r(u){return u.length<3?!0:u.length>4?!1:!!_e(u,function(p,f){var d=u[f-1];return d&&Br(p,d)<3})}function o(u,p,f){var d=En(p,u);switch(d){case"v":return{x:f.x,y:u.y};case"h":return{x:u.x,y:f.y}}return{x:u.x,y:u.y}}function a(u,p,f){var d;for(d=u.length-2;d!==0;d--)if(Rf(u[d],p,Iv)||Rf(u[d],f,Iv))return u.slice(d);return u}if(r(i))return null;var s=i[0],c=i.slice(),l;return c[0]=n,c[1]=o(c[1],s,n),l=a(c,e,t),l!==c&&(c=ep(e,t,n,l)),c&&En(c)?null:c}function Sk(e,t){if(jv(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function Ck(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function jv(e){return e&&/t|r|b|l/.test(e)}function Rk(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function Fv(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Hv(e){return e.reduce(function(t,n,i){var r=t[t.length-1],o=e[i+1];return Bc(r,o,n,0)||t.push(n),t},[])}var Tk=-10,Pk=40,Ak={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},kk={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},tp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},To={top:"t",right:"r",bottom:"b",left:"l"};function Hs(e){this._elementRegistry=e}Y(Hs,Ov),Hs.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,i=t.target||e.target,r=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,l;if(o||(o=Vv(r&&r[0],n)),a||(a=Vv(r&&r[r.length-1],i)),(b(e,"bpmn:Association")||b(e,"bpmn:DataAssociation"))&&r&&!zv(n,i))return[].concat([o],r.slice(1,-1),[a]);var u=Xh(n,s)?Ak:kk;return b(e,"bpmn:MessageFlow")?c=Mk(n,i,u):(b(e,"bpmn:SequenceFlow")||zv(n,i))&&(n===i?c={preferredLayouts:$k(n,e,u)}:b(n,"bpmn:BoundaryEvent")?c={preferredLayouts:jk(n,i,a,u)}:Po(n)||Po(i)?c={preferredLayouts:u.subProcess,preserveDocking:Ok(n)}:b(n,"bpmn:Gateway")?c={preferredLayouts:u.fromGateway}:b(i,"bpmn:Gateway")?c={preferredLayouts:u.toGateway}:c={preferredLayouts:u.default}),c&&(c=D(c,t),l=Hv(_k(n,i,o,a,r,c))),l||[o,a]};function Dk(e){var t=e.host;return pt(te(e),t,Tk)}function Mk(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:Nk(e,t)}}function Nk(e,t){return b(t,"bpmn:Participant")?"source":b(e,"bpmn:Participant")?"target":Po(t)?"source":Po(e)||b(t,"bpmn:Event")?"target":b(e,"bpmn:Event")?"source":null}function Ok(e){return Po(e)?"target":"source"}function Vv(e,t){return e?e.original||e:te(t)}function zv(e,t){return b(t,"bpmn:Activity")&&b(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Po(e){return b(e,"bpmn:SubProcess")&&fe(e)}function Li(e,t){return e===t}function Ik(e,t){return t.indexOf(e)!==-1}function br(e){var t=/right|left/.exec(e);return t&&t[0]}function Er(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Wv(e,t){return tp[e]===t}function Bk(e,t){var n=br(e),i=tp[n];return t.indexOf(i)!==-1}function Lk(e,t){var n=Er(e),i=tp[n];return t.indexOf(i)!==-1}function Uv(e){return e==="right"||e==="left"}function $k(e,t,n){var i=t.waypoints,r=i&&i.length&&pt(i[0],e);return r==="top"?n.loop.fromTop:r==="right"?n.loop.fromRight:r==="left"?n.loop.fromLeft:n.loop.fromBottom}function jk(e,t,n,i){var r=te(e),o=te(t),a=Dk(e),s,c,l=Li(e.host,t),u=Ik(a,["top","right","bottom","left"]),p=pt(o,r,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?Fk(a,u,e,t,n,i):(s=Hk(a,p,u,i.isHorizontal),c=Vk(a,p,u,i.isHorizontal),[s+":"+c])}function Fk(e,t,n,i,r,o){var a=t?e:o.isHorizontal?Er(e):br(e),s=To[a],c;return t?Uv(e)?c=Gv("y",n,i,r)?"h":o.boundaryLoop.alternateHorizontalSide:c=Gv("x",n,i,r)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function Gv(e,t,n,i){var r=Pk;return!(np(e,i,n,r)||np(e,i,{x:n.x+n.width,y:n.y+n.height},r)||np(e,i,te(t),r))}function np(e,t,n,i){return Math.abs(t[e]-n[e])<i}function Hk(e,t,n,i){if(n)return To[e];var r=Er(e),o=br(e),a=Er(t),s=br(t);if(i){if(Li(r,a)||Wv(o,s))return To[r]}else if(Li(o,s)||Wv(r,a))return To[o];return To[i?o:r]}function Vk(e,t,n,i){return n?Uv(e)?Bk(e,t)||Li(e,t)?"h":"v":Lk(e,t)||Li(e,t)?"v":"h":i?Li(Er(e),Er(t))?"h":"v":Li(br(e),br(t))?"v":"h"}Hs.$inject=["elementRegistry"];function Kv(e){return D({original:e.point.original||e.point},e.actual)}function ci(e,t){this._elementRegistry=e,this._graphicsFactory=t}ci.$inject=["elementRegistry","graphicsFactory"],ci.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(Kv(i)),o.push(Kv(r)),o},ci.prototype.getDockingPoint=function(e,t,n){var i=e.waypoints,r,o,a;return r=n?0:i.length-1,o=i[r],a=this._getIntersection(t,e,n),{point:o,actual:a||o,idx:r}},ci.prototype._getIntersection=function(e,t,n){var i=this._getShapePath(e),r=this._getConnectionPath(t);return Fc(i,r,n)},ci.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},ci.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},ci.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const qv={__init__:["modeling","bpmnUpdater"],__depends__:[LP,tA,iA,rA,av,MA,OA,FA,en,nl,fv],bpmnFactory:["type",Gt],bpmnUpdater:["type",Dt],elementFactory:["type",ri],modeling:["type",mt],layouter:["type",Hs],connectionDocking:["type",ci]},Yv=Math.round;function Vs(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}Vs.prototype.create=function(e,t,n){const i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,l=o.createShape(D({type:t},n)),u=a.fire("autoPlace",{source:e,shape:l});if(!u)return;D(l,{x:u.x-Yv(l.width/2),y:u.y-Yv(l.height/2)});const p=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}});let f=null;p&&(f=o.createConnection(p),f.waypoints=s.layoutConnection(f,{source:e,target:l}),f.waypoints=r.getCroppedWaypoints(f,e,l)),i.create({created:[l,f].filter(d=>!Dr(d))})},Vs.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Vs.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const zk={__depends__:[Rl,fT,qv],__init__:["appendPreview"],appendPreview:["type",Vs]};var Xv=Math.min,Zv=Math.max;function ip(e){e.preventDefault()}function Ao(e){e.stopPropagation()}function Wk(e){return e.nodeType===Node.TEXT_NODE}function Uk(e){return[].slice.call(e)}function rn(e){this.container=e.container,this.parent=Te('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=xe("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Et(this.autoResize,this),this.handlePaste=Et(this.handlePaste,this)}rn.prototype.create=function(e,t,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},t=this.style=t||{};var c=Jt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);D(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Jt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return D(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&D(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),a.innerText=n,ae.bind(a,"keydown",this.keyHandler),ae.bind(a,"mousedown",Ao),ae.bind(a,"paste",r.handlePaste),i.autoResize&&ae.bind(a,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},rn.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var i;if(e.clipboardData?i=e.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),t.autoResize){var r=this.autoResize(n);r&&this.resizeHandler(r)}},rn.prototype.insertText=function(e){e=Gk(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},rn.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,i=t.endContainer,r=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=Uk(a.childNodes),c,l;if(Wk(a)){var u=n.textContent;n.textContent=u.substring(0,r)+e+u.substring(o),c=n,l=r+e.length}else if(n===this.content&&i===this.content){var p=document.createTextNode(e);this.content.insertBefore(p,s[r]),c=p,l=p.textContent.length}else{var f=s.indexOf(n),d=s.indexOf(i);s.forEach(function(m,v){v===f?m.textContent=n.textContent.substring(0,r)+e+i.textContent.substring(o):v>f&&v<=d&&un(m)}),c=n,l=r+e.length}c&&l!==void 0&&setTimeout(function(){self.setSelection(c,l)})},rn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},rn.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=Te('<div class="djs-direct-editing-resize-handle"></div>');var s,c,l,u,p=function(m){ip(m),Ao(m),s=m.clientX,c=m.clientY;var v=t.getBoundingClientRect();l=v.width,u=v.height,ae.bind(document,"mousemove",f),ae.bind(document,"mouseup",d)},f=function(m){ip(m),Ao(m);var v=Xv(Zv(l+m.clientX-s,i),o),g=Xv(Zv(u+m.clientY-c,r),a);t.style.width=v+"px",t.style.height=g+"px",e.resizeHandler({width:l,height:u,dx:m.clientX-s,dy:m.clientY-c})},d=function(m){ip(m),Ao(m),ae.unbind(document,"mousemove",f,!1),ae.unbind(document,"mouseup",d,!1)};ae.bind(n,"mousedown",p)}D(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},rn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ae.unbind(t,"keydown",this.keyHandler),ae.unbind(t,"mousedown",Ao),ae.unbind(t,"input",this.autoResize),ae.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),un(n)),un(e)},rn.prototype.getValue=function(){return this.content.innerText.trim()},rn.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},rn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)};function Gk(e){return e.replace(/\r\n|\r|\n/g,`
213
- `)}function Kt(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new rn({container:t.getContainer(),keyHandler:Et(this._handleKey,this),resizeHandler:Et(this._handleResize,this)})}Kt.$inject=["eventBus","canvas"],Kt.prototype.registerProvider=function(e){this._providers.push(e)},Kt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},Kt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Kt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Kt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},Kt.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=e.context.text;(r!==o||i.height!==n.height||i.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Kt.prototype.getValue=function(){return this._textbox.getValue()},Kt.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()},Kt.prototype._handleResize=function(e){this._fire("resize",e)},Kt.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=_e(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const Jv={__depends__:[Da],__init__:["directEditing"],directEditing:["type",Kt]};function Kk(e){return function(t){var n=t.target,i=H(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===fe(e);return!o||!a||!s||!c}}var qk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Yk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Xk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Zk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Jk=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Qk=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],eD=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],Qv=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],tD=Qv,ey=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],nD=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],iD=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],rD=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],oD=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],aD=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],sD=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],cD={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};const ty={"start-event-non-interrupting":`
212
+ </svg>`},oR=900;function cr(e,t,n,i){e.registerProvider(oR,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}cr.$inject=["contextPad","popupMenu","translate","canvas"],cr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},cr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},cr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${Gh.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);D(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},cr.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,i=n.getBoundingClientRect(),r={x:i.left,y:i.bottom+t};return r};var aR=["left","center","right","top","middle","bottom"];function to(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}to.$inject=["popupMenu","alignElements","translate","rules"],to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},to.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},to.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return A(aR,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Gh[o],action:function(){t.trigger(e,o),i.close()}}}),r};function Ht(e){F.call(this,e),this.init()}Ht.$inject=["eventBus"],Y(Ht,F),Ht.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,s){return n(o)},!0)})},Ht.prototype.init=function(){};function Ua(e){Ht.call(this,e)}Ua.$inject=["eventBus"],Y(Ua,Ht),Ua.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=ce(t,function(i){return!(i.waypoints||i.host||i.labelTarget)});return n=oa(n),n.length<2?!1:n})};const sR={__depends__:[EC,uh,xl],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",cr],alignElementsMenuProvider:["type",to],bpmnAlignElements:["type",Ua]};var cR=10,Kh=50,lR=250;function wl(e,t,n,i){for(var r;r=uR(e,n,t);)n=i(t,n,r);return n}function Sl(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,l=a.minDistance;c<0?r[o]=Math.min(i[o]+c-t[s]/2,n[o]-l+c):r[o]=Math.max(i[o]+i[s]+c+t[s]/2,n[o]+l+c)}}),r}}function uR(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=fR(e);return _e(r,function(o){if(o===n)return!1;var a=pt(o,i,cR);return a==="intersect"})}function pR(e,t){t||(t={});function n(m){return m.source===e?1:-1}var i=t.defaultDistance||Kh,r=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||lR,c=t.reference||"start";o||(o=mR);function l(m,y){return r==="n"?c==="start"?Q(m).top-Q(y).bottom:c==="center"?Q(m).top-te(y).y:Q(m).top-Q(y).top:r==="w"?c==="start"?Q(m).left-Q(y).right:c==="center"?Q(m).left-te(y).x:Q(m).left-Q(y).left:r==="s"?c==="start"?Q(y).top-Q(m).bottom:c==="center"?te(y).y-Q(m).bottom:Q(y).bottom-Q(m).bottom:c==="start"?Q(y).left-Q(m).right:c==="center"?te(y).x-Q(m).right:Q(y).right-Q(m).right}var u=e.incoming.filter(o).map(function(m){var y=a(m),g=y<0?l(m.source,e):l(e,m.source);return{id:m.source.id,distance:g,weight:y}}),p=e.outgoing.filter(o).map(function(m){var y=a(m),g=y>0?l(e,m.target):l(m.target,e);return{id:m.target.id,distance:g,weight:y}}),d=u.concat(p).reduce(function(m,y){return m[y.id+"__weight_"+y.weight]=y,m},{}),h=Tt(d,function(m,y){var g=y.distance,w=y.weight;return g<0||g>s||(m[String(g)]||(m[String(g)]=0),m[String(g)]+=1*w,(!m.distance||m[m.distance]<m[String(g)])&&(m.distance=g)),m},{});return h.distance||i}function fR(e){var t=Cl(e);return e.host&&(t=t.concat(Cl(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,i){return n.concat(Cl(i))},[]))),t}function Cl(e){return hR(e).concat(dR(e))}function dR(e){return e.incoming.map(function(t){return t.source})}function hR(e){return e.outgoing.map(function(t){return t.target})}function mR(){return!0}var gR=100;function qh(e,t,n){e.on("autoPlace",gR,function(i){var r=i.shape,o=i.source;return yR(o,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),s=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:s}),s}}qh.$inject=["eventBus","modeling","canvas"];function yR(e,t,n){n||(n={});var i=n.defaultDistance||Kh,r=te(e),o=Q(e);return{x:o.right+i+t.width/2,y:r.y}}function Yh(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Yh.$inject=["eventBus","selection"];const vR={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",qh],autoPlaceSelectionBehavior:["type",Yh]};function lr(e,t){for(Rt(t)&&(t=[t]);e=e.parent;)if(le(e,t))return e;return null}function Xh(e,t){var n=lr(e,"bpmn:Process");if(n)return!0;var i=["bpmn:Participant","bpmn:Lane"];if(n=lr(e,i),n)return Qe(n);if(le(e,i))return Qe(e);var r;for(r=V(e);r&&!b(r,"bpmn:Process");r=r.$parent);if(!t)return!0;var o=t.find(function(a){var s=V(a);return s&&s.get("processRef")===r});return o?Qe(o):!0}function Zh(e,t,n){var i=Xh(e,n);if(b(t,"bpmn:TextAnnotation"))return bR(e,t,i);if(le(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return ER(e,t,i);if(b(t,"bpmn:FlowNode"))return _R(e,t,i)}function _R(e,t,n){var i=Q(e),r=te(e),o=n?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},a=pR(e,{filter:function(h){return b(h,"bpmn:SequenceFlow")},direction:o.directionHint}),s=30,c=o.minDistance,l=o.baseOrientation;b(e,"bpmn:BoundaryEvent")&&(l=pt(e,e.host,-25),l.indexOf(o.boundaryOrientation)!==-1&&(s*=-1));var u=n?{x:i.right+a+t.width/2,y:r.y+Jh(l,c,o)}:{x:r.x+Jh(l,c,o),y:i.bottom+a+t.height/2},p={margin:s,minDistance:c},d=n?{y:p}:{x:p};return wl(e,t,u,Sl(d))}function Jh(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function bR(e,t,n){var i=Q(e),r=n?{x:i.right+t.width/2,y:i.top-50-t.height/2}:{x:i.right+50+t.width/2,y:i.bottom+t.height/2};Ce(e)&&(r=te(e),n?(r.x+=100,r.y-=50):(r.x+=100,r.y+=50));var o={margin:n?-30:30,minDistance:20},a=n?{y:o}:{x:o};return wl(e,t,r,Sl(a))}function ER(e,t,n){var i=Q(e),r=n?{x:i.right-10+t.width/2,y:i.bottom+40+t.width/2}:{x:i.left-40-t.width/2,y:i.bottom-10+t.height/2},o={margin:30,minDistance:30},a=n?{x:o}:{y:o};return wl(e,t,r,Sl(a))}function Qh(e,t){e.on("autoPlace",function(n){var i=n.shape,r=n.source;return Zh(r,i,t)})}Qh.$inject=["eventBus","elementRegistry"];const Rl={__depends__:[vR],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Qh]};function An(e,t,n,i){F.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,l=a.parent||a.newParent;s.autoResize!==!1&&r._expand([c],l)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=xc(Yo(a.closure.topLevel)),c=a.hints,l=c?c.autoResize:!0;if(l!==!1){var u=Wi(s,function(p){return p.parent.id});A(u,function(p,d){oe(l)&&(p=p.filter(function(h){return _e(l,Jt({id:h.id}))})),r._expand(p,d)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||r._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,l=c.parent;s&&s.autoResize===!1||l&&r._expand([c],l)})}An.$inject=["eventBus","elementRegistry","modeling","rules"],Y(An,F),An.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=Q(Ye(e)),o=Q(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),ua(D({},o,a))},An.prototype._expand=function(e,t){typeof t=="string"&&(t=this._elementRegistry.get(t));var n=this._rules.allowed("element.autoResize",{elements:e,target:t});if(n){var i=this._getOptimalBounds(e,t);if(xR(i,t)){var r=wR(Qt(t,["x","y","width","height"]),i);this.resize(t,i,{autoResize:r});var o=t.parent;o&&this._expand([t],o)}}},An.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},An.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},An.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function xR(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function wR(e,t){var n="";return e=Q(e),t=Q(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}function Ga(e){e.invoke(An,this)}Ga.$inject=["injector"],Y(Ga,An),Ga.prototype.resize=function(e,t,n){b(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function no(e){Ht.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}no.$inject=["eventBus"],Y(no,Ht),no.prototype.canResize=function(e,t){return!1};function Ka(e,t){no.call(this,e),this._modeling=t}Y(Ka,no),Ka.$inject=["eventBus","modeling"],Ka.prototype.canResize=function(e,t){if(b(t.di,"bpmndi:BPMNPlane")||!b(t,"bpmn:Participant")&&!b(t,"bpmn:Lane")&&!b(t,"bpmn:SubProcess"))return!1;var n=!0;return A(e,function(i){if(b(i,"bpmn:Lane")||ge(i)){n=!1;return}}),n};const SR={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ga],bpmnAutoResizeProvider:["type",Ka]};var em=1500;function tm(e,t,n){var i=this,r=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=i._findTargetGfx(s),l=c&&e.get(c);c&&l&&(a.stopPropagation(),r.hover({element:l,gfx:c}),r.move(s))}}r&&t.on("drag.start",function(a){t.once("drag.move",em,function(s){o(s)})}),function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",em,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})}(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=Ai(a),c=document.elementFromPoint(s.x,s.y),CR(c)}}tm.$inject=["elementRegistry","eventBus","injector"];function CR(e){return Ui(e,"svg, .djs-element",!0)}const RR={__init__:["hoverFix"],hoverFix:["type",tm]};var ur=Math.round,nm="djs-drag-active";function Di(e){e.preventDefault()}function TR(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function PR(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function im(e,t,n,i){var r={threshold:5,trapClick:!0},o;function a(x){var E=t.viewbox(),S=t._container.getBoundingClientRect();return{x:E.x+(x.x-S.left)/E.scale,y:E.y+(x.y-S.top)/E.scale}}function s(x,E){E=E||o;var S=e.createEvent(D({},E.payload,E.data,{isTouch:E.isTouch}));return e.fire("drag."+x,S)===!1?!1:e.fire(E.prefix+"."+x,S)}function c(x){var E=x.filter(function(S){return i.get(S.id)});E.length&&n.select(E)}function l(x,E){var S=o.payload,R=o.displacement,M=o.globalStart,P=Ai(x),I=nn(P,M),O=o.localStart,B=a(P),L=nn(B,O);if(!o.active&&(E||PR(I)>o.threshold)){if(D(S,{x:ur(O.x+R.x),y:ur(O.y+R.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return g();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&Na(o.cursor),t.addMarker(t.getRootElement(),nm)}rl(x),o.active&&(D(S,{x:ur(B.x+R.x),y:ur(B.y+R.y),dx:ur(L.x),dy:ur(L.y)},{originalEvent:x}),s("move"))}function u(x){var E,S=!0;o.active&&(x&&(o.payload.originalEvent=x,rl(x)),S=s("end")),S===!1&&s("rejected"),E=w(S!==!0),s("ended",E)}function p(x){rt("Escape",x)&&(Di(x),g())}function d(x){var E;o.active&&(E=th(e),setTimeout(E,400),Di(x)),u(x)}function h(x){l(x)}function m(x){var E=o.payload;E.hoverGfx=x.gfx,E.hover=x.element,s("hover")}function y(x){s("out");var E=o.payload;E.hoverGfx=null,E.hover=null}function g(x){var E;if(o){var S=o.active;S&&s("cancel"),E=w(x),S&&s("canceled",E)}}function w(x){var E,S;s("cleanup"),eh(),o.trapClick?S=d:S=u,ae.unbind(document,"mousemove",l),ae.unbind(document,"dragstart",Di),ae.unbind(document,"selectstart",Di),ae.unbind(document,"mousedown",S,!0),ae.unbind(document,"mouseup",S,!0),ae.unbind(document,"keyup",p),ae.unbind(document,"touchstart",h,!0),ae.unbind(document,"touchcancel",g,!0),ae.unbind(document,"touchmove",l,!0),ae.unbind(document,"touchend",u,!0),e.off("element.hover",m),e.off("element.out",y),t.removeMarker(t.getRootElement(),nm);var R=o.payload.previousSelection;return x!==!1&&R&&!n.get().length&&c(R),E=o,o=null,E}function C(x,E,S,R){o&&g(!1),typeof E=="string"&&(R=S,S=E,E=null),R=D({},r,R||{});var M=R.data||{},P,I,O,B,L;R.trapClick?B=d:B=u,x?(P=er(x)||x,I=Ai(x),rl(x),P.type==="dragstart"&&Di(P)):(P=null,I={x:0,y:0}),O=a(I),E||(E=O),L=TR(P),o=D({prefix:S,data:M,payload:{},globalStart:I,displacement:nn(E,O),localStart:O,isTouch:L},R),R.manual||(L?(ae.bind(document,"touchstart",h,!0),ae.bind(document,"touchcancel",g,!0),ae.bind(document,"touchmove",l,!0),ae.bind(document,"touchend",u,!0)):(ae.bind(document,"mousemove",l),ae.bind(document,"dragstart",Di),ae.bind(document,"selectstart",Di),ae.bind(document,"mousedown",B,!0),ae.bind(document,"mouseup",B,!0)),ae.bind(document,"keyup",p),e.on("element.hover",m),e.on("element.out",y)),s("init"),R.autoActivate&&l(x,!0)}e.on("diagram.destroy",g),this.init=C,this.move=l,this.hover=m,this.out=y,this.end=u,this.cancel=g,this.context=function(){return o},this.setOptions=function(x){D(r,x)}}im.$inject=["eventBus","canvas","selection","elementRegistry"];const kn={__depends__:[RR,tn],dragging:["type",im]};function pr(e,t,n){this._canvas=n,this._opts=D({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}pr.$inject=["config.autoScroll","eventBus","canvas"],pr.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)AR(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))};function AR(e,t,n){return t<e&&e<n}pr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},pr.prototype.setOptions=function(e){this._opts=D({},this._opts,e)},pr.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Ai(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const kR={__depends__:[kn],__init__:["autoScroll"],autoScroll:["type",pr]};function Tl(e){this._commandStack=e.get("commandStack",!1)}Tl.$inject=["injector"],Tl.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0?!0:n};const yn={__init__:["rules"],rules:["type",Tl]};var qa=Math.round,DR=Math.max;function MR(e,t){var n=e.x,i=e.y;return[["M",n,i],["m",0,-10],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function NR(e){var t=[];return e.forEach(function(n,i){t.push([i===0?"M":"L",n.x,n.y])}),t}var rm=10;function OR(e,t){var n,i;for(n=0;i=e[n];n++)if(Br(i,t)<=rm)return{point:e[n],bendpoint:!0,index:n};return null}function IR(e,t){var n=Of(MR(t,rm),NR(e)),i=n[0],r=n[n.length-1],o;return i?i!==r?i.segment2!==r.segment2?(o=DR(i.segment2,r.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:qa(i.x+r.x)/2,y:qa(i.y+r.y)/2},index:i.segment2}:{point:{x:qa(i.x),y:qa(i.y)},index:i.segment2}:null}function Pl(e,t){return OR(e,t)||IR(e,t)}function om(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function am(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function BR(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e}function LR(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],r=i[0].n*t[0]+i[1].n*t[1],o=i[0].lambda*t[0]+i[1].lambda*t[1];return-r/o}function Al(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=LR([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function sm(e,t){var n=Al(e,t),i={x:n.x-e.x,y:n.y-e.y};return om(i)}function Ya(e,t){return om({x:e.x-t.x,y:e.y-t.y})}var cm="djs-bendpoint",lm="djs-segment-dragger";function $R(e,t){var n=Ai(t),i=e._container.getBoundingClientRect(),r;r={x:i.left,y:i.top};var o=e.viewbox();return{x:o.x+(n.x-r.x)/o.scale,y:o.y+(n.y-r.y)/o.scale}}function kl(e,t,n){var i=$R(e,n),r=Pl(t,i);return r}function Dl(e,t){var n=X("g");me(n).add(cm),ie(e,n);var i=X("circle");q(i,{cx:0,cy:0,r:4}),me(i).add("djs-visual"),ie(n,i);var r=X("circle");return q(r,{cx:0,cy:0,r:10}),me(r).add("djs-hit"),ie(n,r),t&&me(n).add(t),n}function jR(e,t,n,i){var r=X("g");ie(e,r);var o=18,a=6,s=11,c=HR(t,n,i),l=a+s,u=X("rect");q(u,{x:-18/2,y:-6/2,width:o,height:a}),me(u).add("djs-visual"),ie(r,u);var p=X("rect");return q(p,{x:-c/2,y:-17/2,width:c,height:l}),me(p).add("djs-hit"),ie(r,p),Qf(r,i==="v"?90:0),r}function um(e,t,n){var i=X("g"),r=Lc(t,n),o=En(t,n);return ie(e,i),jR(i,t,n,o),me(i).add(lm),me(i).add(o==="h"?"horizontal":"vertical"),at(i,r.x,r.y),i}function Ml(e){return Math.abs(Math.round(e*2/3))}function FR(e,t){var n=VR(e,t);return Al(e,n)}function HR(e,t,n){var i=t.x-e.x,r=t.y-e.y;return Ml(n==="h"?i:r)}function VR(e,t){for(var n=t.waypoints,i=1/0,r,o=0;o<n.length-1;o++){var a=n[o],s=n[o+1],c=sm(e,[a,s]);c<i&&(i=c,r=o)}return[n[r],n[r+1]]}function pm(e,t,n,i,r){function o(x,E,S){var R=x.index,M=x.point,P,I,O,B,L,H;return R<=0||x.bendpoint?!1:(P=E[R-1],I=E[R],O=Lc(P,I),B=En(P,I),L=Math.abs(M.x-O.x),H=Math.abs(M.y-O.y),B&&L<=S&&H<=S)}function a(x,E){var S=x.waypoints,R,M,P,I;return E.index<=0||E.bendpoint||(R={start:S[E.index-1],end:S[E.index]},M=En(R.start,R.end),!M)?null:(M==="h"?P=R.end.x-R.start.x:P=R.end.y-R.start.y,I=Ml(P)/2,I)}function s(x,E){var S=E.waypoints,R=kl(t,S,x),M;if(R)return M=a(E,R),o(R,S,M)?r.start(x,E,R.index):i.start(x,E,R.index,!R.bendpoint),!0}function c(x,E,S){ae.bind(x,E,function(R){n.triggerMouseEvent(E,R,S),R.stopPropagation()})}function l(x,E){var S=t.getLayer("overlays"),R=Se('.djs-bendpoints[data-element-id="'+qr(x.id)+'"]',S);return!R&&E&&(R=X("g"),q(R,{"data-element-id":x.id}),me(R).add("djs-bendpoints"),ie(S,R),c(R,"mousedown",x),c(R,"click",x),c(R,"dblclick",x)),R}function u(x,E){return Se('.djs-segment-dragger[data-segment-idx="'+x+'"]',E)}function p(x,E){E.waypoints.forEach(function(S,R){var M=Dl(x);ie(x,M),at(M,S.x,S.y)}),Dl(x,"floating")}function d(x,E){for(var S=E.waypoints,R,M,P,I=1;I<S.length;I++)R=S[I-1],M=S[I],En(R,M)&&(P=um(x,R,M),q(P,{"data-segment-idx":I}),c(P,"mousemove",E))}function h(x){A(Rc("."+cm,x),function(E){qe(E)})}function m(x){A(Rc("."+lm,x),function(E){qe(E)})}function y(x){var E=l(x);return E||(E=l(x,!0),p(E,x),d(E,x)),E}function g(x){var E=l(x);E&&(m(E),h(E),d(E,x),p(E,x))}function w(x,E){var S=Se(".floating",x),R=E.point;S&&at(S,R.x,R.y)}function C(x,E,S){var R=u(E.index,x),M=S[E.index-1],P=S[E.index],I=E.point,O=Lc(M,P),B=En(M,P),L,H;R&&(L=zR(R),H={x:I.x-O.x,y:I.y-O.y},B==="v"&&(H={x:H.y,y:H.x}),at(L,H.x,H.y))}e.on("connection.changed",function(x){g(x.element)}),e.on("connection.remove",function(x){var E=l(x.element);E&&qe(E)}),e.on("element.marker.update",function(x){var E=x.element,S;E.waypoints&&(S=y(E),x.add?me(S).add(x.marker):me(S).remove(x.marker))}),e.on("element.mousemove",function(x){var E=x.element,S=E.waypoints,R,M;if(S){if(R=l(E,!0),M=kl(t,S,x.originalEvent),!M)return;w(R,M),M.bendpoint||C(R,M,S)}}),e.on("element.mousedown",function(x){if(Xn(x)){var E=x.originalEvent,S=x.element;if(S.waypoints)return s(E,S)}}),e.on("selection.changed",function(x){var E=x.newSelection,S=E[0];S&&S.waypoints&&y(S)}),e.on("element.hover",function(x){var E=x.element;E.waypoints&&(y(E),n.registerEvent(x.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(x){n.unregisterEvent(x.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(x){var E=x.element,S=x.newId;if(E.waypoints){var R=l(E);R&&q(R,{"data-element-id":S})}}),this.addHandles=y,this.updateHandles=g,this.getBendpointsContainer=l,this.getSegmentDragger=u}pm.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function zR(e){return Se(".djs-visual",e)}var fm=Math.round,Mi="reconnectStart",Ni="reconnectEnd",io="updateWaypoints";function Nl(e,t,n,i,r,o){this._injector=e,this.start=function(a,s,c,l){var u=n.getGraphics(s),p=s.source,d=s.target,h=s.waypoints,m;!l&&c===0?m=Mi:!l&&c===h.length-1?m=Ni:m=io;var y=m===io?"connection.updateWaypoints":"connection.reconnect",g=r.allowed(y,{connection:s,source:p,target:d});g===!1&&(g=r.allowed(y,{connection:s,source:d,target:p})),g!==!1&&i.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:u,context:{allowed:g,bendpointIndex:c,connection:s,source:p,target:d,insert:l,type:m}}})},t.on("bendpoint.move.hover",function(a){var s=a.context,c=s.connection,l=c.source,u=c.target,p=a.hover,d=s.type;s.hover=p;var h;if(p){var m=d===io?"connection.updateWaypoints":"connection.reconnect";if(h=s.allowed=r.allowed(m,{connection:c,source:d===Mi?p:l,target:d===Ni?p:u}),h){s.source=d===Mi?p:l,s.target=d===Ni?p:u;return}h===!1&&(h=s.allowed=r.allowed(m,{connection:c,source:d===Ni?p:u,target:d===Mi?p:l})),h&&(s.source=d===Ni?p:u,s.target=d===Mi?p:l)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==io&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,l=s.bendpointIndex,u=s.connection,p=s.insert,d=u.waypoints.slice(),h=s.source,m=s.target,y=s.type,g=s.hints||{},w={x:fm(a.x),y:fm(a.y)};if(!c)return!1;y===io?(p?d.splice(l,0,w):d[l]=w,g.bendpointMove={insert:p,bendpointIndex:l},d=this.cropWaypoints(u,d),o.updateWaypoints(u,$x(d),g)):(y===Mi?(g.docking="source",Xa(s)&&(g.docking="target",g.newWaypoints=d.reverse())):y===Ni&&(g.docking="target",Xa(s)&&(g.docking="source",g.newWaypoints=d.reverse())),o.reconnect(u,h,m,w,g))},this)}Nl.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Nl.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};function Xa(e){var t=e.hover,n=e.source,i=e.target,r=e.type;if(r===Mi)return t&&i&&t===i&&n!==i;if(r===Ni)return t&&n&&t===n&&n!==i}var WR="reconnectStart",UR="reconnectEnd",dm="updateWaypoints",ro="connect-ok",Za="connect-not-ok",hm="connect-hover",mm="djs-updating",gm="djs-dragging",ym=1100;function vm(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,l=a.insert,u=c.waypoints,p=u.slice();a.waypoints=u,l&&p.splice(s,0,{x:o.x,y:o.y}),c.waypoints=p;var d=a.draggerGfx=Dl(i.getLayer("overlays"));me(d).add("djs-dragging"),i.addMarker(c,gm),i.addMarker(c,mm)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,l=a.type;if(c){if(i.addMarker(c,hm),l===dm)return;s?(i.removeMarker(c,Za),i.addMarker(c,ro)):s===!1&&(i.removeMarker(c,ro),i.addMarker(c,Za))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],ym,function(o){var a=o.context,s=a.hover,c=a.target;s&&(i.removeMarker(s,hm),i.removeMarker(s,c?ro:Za))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,l=a.draggerGfx,u=a.hover,p=a.type,d=a.connection,h=d.source,m=d.target,y=d.waypoints.slice(),g={x:o.x,y:o.y},w=a.hints||{},C={};r&&(w.connectionStart&&(C.connectionStart=w.connectionStart),w.connectionEnd&&(C.connectionEnd=w.connectionEnd),p===WR?Xa(a)?(C.connectionEnd=C.connectionEnd||g,C.source=m,C.target=u||h,y=y.reverse()):(C.connectionStart=C.connectionStart||g,C.source=u||h,C.target=m):p===UR?Xa(a)?(C.connectionStart=C.connectionStart||g,C.source=u||m,C.target=h,y=y.reverse()):(C.connectionEnd=C.connectionEnd||g,C.source=h,C.target=u||m):(C.noCropping=!0,C.noLayout=!0,y[c]=g),p===dm&&(y=e.cropWaypoints(d,y)),C.waypoints=y,r.drawPreview(a,s,C)),at(l,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],ym,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,l=a.hover,u=a.target,p=a.waypoints;s.waypoints=p,qe(c),i.removeMarker(s,mm),i.removeMarker(s,gm),l&&(i.removeMarker(l,ro),i.removeMarker(l,u?ro:Za)),r&&r.cleanUp(a)})}vm.$inject=["bendpointMove","injector","eventBus","canvas"];var _m="connect-hover",bm="djs-updating";function Em(e,t,n){return Ol(e,t,e[t]+n)}function Ol(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function GR(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]),a=20,s=Math.min(Math.max(o+a,e[i]),r-a);return Ol(t,i,s)}function xm(e){return e==="x"?"y":"x"}function wm(e,t,n){var i,r;return e.original?e.original:(i=te(t),r=xm(n),Ol(e,r,i[r]))}function Sm(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);this.start=function(p,d,h){var m,y=n.getGraphics(d),g=h-1,w=h,C=d.waypoints,x=C[g],E=C[w],S=kl(n,C,p),R,M,P;R=En(x,E),R&&(M=R==="v"?"x":"y",g===0&&(x=wm(x,d.source,M)),w===C.length-1&&(E=wm(E,d.target,M)),S?P=S.point:P={x:(x.x+E.x)/2,y:(x.y+E.y)/2},m={connection:d,segmentStartIndex:g,segmentEndIndex:w,segmentStart:x,segmentEnd:E,axis:M,dragPosition:P},i.init(p,P,"connectionSegment.move",{cursor:M==="x"?"resize-ew":"resize-ns",data:{connection:d,connectionGfx:y,context:m}}))};function s(p,d){if(!a)return d;var h=p.waypoints,m;return p.waypoints=d,m=a.getCroppedWaypoints(p),p.waypoints=h,m}function c(p){r.update("connection",p.connection,p.connectionGfx)}function l(p,d,h){var m=p.newWaypoints,y=p.segmentStartIndex+d,g=m[y],w=p.segmentEndIndex+d,C=m[w],x=xm(p.axis),E=GR(h,g,C,x);at(p.draggerGfx,E.x,E.y)}function u(p,d){var h=0,m=p.filter(function(y,g){return Bc(p[g-1],p[g+1],y)?(h=g<=d?h-1:h,!1):!0});return{waypoints:m,segmentOffset:h}}t.on("connectionSegment.move.start",function(p){var d=p.context,h=p.connection,m=n.getLayer("overlays");d.originalWaypoints=h.waypoints.slice(),d.draggerGfx=um(m,d.segmentStart,d.segmentEnd),me(d.draggerGfx).add("djs-dragging"),n.addMarker(h,bm)}),t.on("connectionSegment.move.move",function(p){var d=p.context,h=d.connection,m=d.segmentStartIndex,y=d.segmentEndIndex,g=d.segmentStart,w=d.segmentEnd,C=d.axis,x=d.originalWaypoints.slice(),E=Em(g,C,p["d"+C]),S=Em(w,C,p["d"+C]),R=x.length,M=0;x[m]=E,x[y]=S;var P,I;m<2&&(P=pt(h.source,E),m===1?P==="intersect"&&(x.shift(),x[0]=E,M--):P!=="intersect"&&(x.unshift(g),M++)),y>R-3&&(I=pt(h.target,S),y===R-2?I==="intersect"&&(x.pop(),x[x.length-1]=S):I!=="intersect"&&x.push(w)),d.newWaypoints=h.waypoints=s(h,x),l(d,M,p),d.newSegmentStartIndex=m+M,c(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,_m)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,_m)}),t.on("connectionSegment.move.cleanup",function(p){var d=p.context,h=d.connection;d.draggerGfx&&qe(d.draggerGfx),n.removeMarker(h,bm)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context,h=d.connection;h.waypoints=d.originalWaypoints,c(p)}),t.on("connectionSegment.move.end",function(p){var d=p.context,h=d.connection,m=d.newWaypoints,y=d.newSegmentStartIndex;m=m.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var g=u(m,y),w=g.waypoints,C=s(h,w),x=g.segmentOffset,E={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:y+x}};o.updateWaypoints(h,C,E)})}Sm.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var KR=Math.abs,Cm=Math.round;function qR(e,t,n){n=n===void 0?10:n;var i,r;for(i=0;i<t.length;i++)if(r=t[i],KR(r-e)<=n)return r}function Rm(e){return{x:e.x,y:e.y}}function Tm(e){return{x:e.x+e.width,y:e.y+e.height}}function Vt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Cm(e.x+e.width/2),y:Cm(e.y+e.height/2)}}function fr(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function ze(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Pm(e){return e.children||[]}var YR=Math.abs,Am=Math.round,Il=10;function km(e){function t(o,a){if(oe(o)){for(var s=o.length;s--;)if(YR(o[s]-a)<=Il)return o[s]}else{o=+o;var c=a%o;if(c<Il)return a-c;if(c>o-Il)return a-c+o}return a}function n(o,a){if(o.waypoints)return FR(a,o);if(o.width)return{x:Am(o.width/2+o.x),y:Am(o.height/2+o.y)}}function i(o){var a=o.context,s=a.snapPoints,c=a.connection,l=c.waypoints,u=a.segmentStart,p=a.segmentStartIndex,d=a.segmentEnd,h=a.segmentEndIndex,m=a.axis;if(s)return s;var y=[l[p-1],u,d,l[h+1]];return p<2&&y.unshift(n(c.source,o)),h>l.length-3&&y.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},A(y,function(g){g&&(g=g.original||g,m==="y"&&s.horizontal.push(g.y),m==="x"&&s.vertical.push(g.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=i(o),s=o.x,c=o.y,l,u;if(a){l=t(a.vertical,s),u=t(a.horizontal,c);var p=s-l,d=c-u;D(o,{dx:o.dx-p,dy:o.dy-d,x:l,y:u}),(p||a.vertical.indexOf(s)!==-1)&&ze(o,"x",l),(d||a.horizontal.indexOf(c)!==-1)&&ze(o,"y",u)}});function r(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var l=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},A(l,function(u){u&&(u=u.original||u,a.horizontal.push(u.y),a.vertical.push(u.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!Ce(s)||!c||!c.x||!c.y||(ze(o,"x",c.x),ze(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=r(a),c=a.hover,l=c&&n(c,o),u=o.x,p=o.y,d,h;if(s){d=t(l?s.vertical.concat([l.x]):s.vertical,u),h=t(l?s.horizontal.concat([l.y]):s.horizontal,p);var m=u-d,y=p-h;D(o,{dx:o.dx-m,dy:o.dy-y,x:o.x-m,y:o.y-y}),(m||s.vertical.indexOf(u)!==-1)&&ze(o,"x",d),(y||s.horizontal.indexOf(p)!==-1)&&ze(o,"y",h)}})}km.$inject=["eventBus"];const XR={__depends__:[kn,yn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",pm],bendpointMove:["type",Nl],bendpointMovePreview:["type",vm],connectionSegmentMove:["type",Sm],bendpointSnapping:["type",km]};function Dm(e,t,n,i){function r(a,s){return i.allowed("connection.create",{source:a,target:s})}function o(a,s){return r(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,l=a.hover,u;if(s.hover=l,u=s.canExecute=r(c,l),!Dr(u)){if(u!==!1){s.source=c,s.target=l;return}u=s.canExecute=o(c,l),!Dr(u)&&u!==!1&&(s.source=l,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,l=s.connectionStart,u={x:a.x,y:a.y},p=s.source,d=s.target;if(!c)return!1;var h=null,m={connectionStart:Bl(s)?u:l,connectionEnd:Bl(s)?l:u};nt(c)&&(h=c),s.connection=n.connect(p,d,h,m)}),this.start=function(a,s,c,l){nt(c)||(l=c,c=te(s)),t.init(a,"connect",{autoActivate:l,data:{shape:s,context:{start:s,connectionStart:c}}})}}Dm.$inject=["eventBus","dragging","modeling","rules"];function Bl(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}var ZR=1100,JR=900,Mm="connect-ok",Nm="connect-not-ok";function Om(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,l=o.start,u=o.startPosition,p=o.target,d=o.connectionStart||u,h=o.connectionEnd||{x:r.x,y:r.y},m=d,y=h;Bl(o)&&(m=h,y=d),i.drawPreview(o,a,{source:c||l,target:p||s,connectionStart:m,connectionEnd:y})}),t.on("connect.hover",JR,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?Mm:Nm)}),t.on(["connect.out","connect.cleanup"],ZR,function(r){var o=r.hover;o&&(n.removeMarker(o,Mm),n.removeMarker(o,Nm))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Om.$inject=["injector","eventBus","canvas"];const Ll={__depends__:[tn,yn,kn],__init__:["connectPreview"],connect:["type",Dm],connectPreview:["type",Om]};var QR="djs-dragger";function Dn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Dn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Dn.prototype.drawPreview=function(e,t,n){n=n||{};var i=e.connectionPreviewGfx,r=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,l=n.connectionEnd,u=n.noLayout,p=n.noCropping,d=n.noNoop,h,m=this;if(i||(i=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),ta(i),r||(r=e.getConnection=eT(function(y,g,w){return m.getConnection(y,g,w)})),t&&(h=r(t,o,a)),!h){!d&&this.drawNoopPreview(i,n);return}h.waypoints=s||[],this._layouter&&!u&&(h.waypoints=this._layouter.layoutConnection(h,{source:o,target:a,connectionStart:c,connectionEnd:l,waypoints:n.waypoints||h.waypoints})),(!h.waypoints||!h.waypoints.length)&&(h.waypoints=[o?te(o):c,a?te(a):l]),this._connectionDocking&&(o||a)&&!p&&(h.waypoints=this._connectionDocking.getCroppedWaypoints(h,o,a)),this._graphicsFactory.drawConnection(i,h,{stroke:"var(--element-dragger-color)"})},Dn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||te(n),o=t.connectionEnd||te(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);ie(e,s)},Dn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return e=n&&Fc(o,s,!0)||e,t=i&&Fc(a,s,!1)||t,[e,t]},Dn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&qe(e.connectionPreviewGfx)},Dn.prototype.getConnection=function(e){var t=tT(e);return this._elementFactory.createConnection(t)},Dn.prototype.createConnectionPreviewGfx=function(){var e=X("g");return q(e,{pointerEvents:"none"}),me(e).add(QR),ie(this._canvas.getActiveLayer(),e),e},Dn.prototype.createNoopConnection=function(e,t){return ra([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function eT(e){var t={};return function(n){var i=JSON.stringify(n),r=t[i];return r||(r=t[i]=e.apply(null,arguments)),r}}function tT(e){return nt(e)?e:{}}const nT={__init__:["connectionPreview"],connectionPreview:["type",Dn]},iT=new Kr("ps");var rT=["marker-start","marker-mid","marker-end"],oT=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Jn(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}Jn.$inject=["elementRegistry","eventBus","canvas","styles"],Jn.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},Jn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Jn.prototype.addDragger=function(e,t,n,i="djs-dragger"){n=n||this.getGfx(e);var r=ff(n),o=n.getBoundingClientRect();return this._cloneMarkers(Ei(r),i),q(r,this._styles.cls(i,[],{x:o.top,y:o.left})),ie(t,r),q(r,"data-preview-support-element-id",e.id),r},Jn.prototype.addFrame=function(e,t){var n=X("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ie(t,n),q(n,"data-preview-support-element-id",e.id),n},Jn.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;e.childNodes&&e.childNodes.forEach(r=>{i._cloneMarkers(r,t,n)}),lT(e)&&rT.forEach(function(r){if(q(e,r)){var o=aT(e,r,i._canvas.getContainer());o&&i._cloneMarker(n,e,o,r,t)}})},Jn.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,iT.next()].join("-"),a=Se("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||ff(n);s.id=o,me(s).add(r);var c=Se(":scope > defs",e);c||(c=X("defs"),ie(e,c)),ie(c,s);var l=cT(s.id);q(t,i,l)};function aT(e,t,n){var i=sT(q(e,t));return Se("marker#"+i,n||document)}function sT(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function cT(e){return"url(#"+e+")"}function lT(e){return oT.indexOf(e.nodeName)!==-1}const dr={__init__:["previewSupport"],previewSupport:["type",Jn]},Ja="complex-preview";class Im{constructor(t,n,i){this._canvas=t,this._graphicsFactory=n,this._previewSupport=i,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:i=[],removed:r=[],resized:o=[]}=t,a=this._canvas.getLayer(Ja);n.filter(s=>!uT(s)).forEach(s=>{let c;Ce(s)?(c=this._graphicsFactory._createContainer("connection",X("g")),this._graphicsFactory.drawConnection(Ei(c),s)):(c=this._graphicsFactory._createContainer("shape",X("g")),this._graphicsFactory.drawShape(Ei(c),s),at(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),i.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);const l=this._previewSupport.addDragger(s,a);Ce(s)?at(l,c.x,c.y):at(l,s.x+c.x,s.y+c.y)}),r.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");const l=this._graphicsFactory._createContainer("shape",X("g"));this._graphicsFactory.drawShape(Ei(l),s,{width:c.width,height:c.height}),at(l,c.x,c.y),this._previewSupport.addDragger(s,a,l)})}cleanUp(){ta(this._canvas.getLayer(Ja)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Ja)}hide(){this._canvas.hideLayer(Ja)}}Im.$inject=["canvas","graphicsFactory","previewSupport"];function uT(e){return e.hidden}const pT={__depends__:[dr],__init__:["complexPreview"],complexPreview:["type",Im]};var $l=["top","bottom","left","right"],Qa=10;function jl(e,t){F.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(r){var o=r.context,a=o.connection,s=a.source,c=a.target,l=o.hints||{};l.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(r){var o=r.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(r){var o=r.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(r){if(_a(r)&&!Ce(r)){var o=hT(r);o&&i(r,o)}}function i(r,o){var a=te(r),s=r.label,c=te(s);if(s.parent){var l=Q(r),u;switch(o){case"top":u={x:a.x,y:l.top-Qa-s.height/2};break;case"left":u={x:l.left-Qa-s.width/2,y:a.y};break;case"bottom":u={x:a.x,y:l.bottom+Qa+s.height/2};break;case"right":u={x:l.right+Qa+s.width/2,y:a.y};break}var p=nn(u,c);t.moveShape(s,p)}}}Y(jl,F),jl.$inject=["eventBus","modeling"];function fT(e){var t=e.host,n=te(e),i=pt(n,t),r;i.indexOf("-")>=0?r=i.split("-"):r=[i];var o=$l.filter(function(a){return r.indexOf(a)===-1});return o}function dT(e){var t=te(e),n=[].concat(e.incoming.map(function(i){return i.waypoints[i.waypoints.length-2]}),e.outgoing.map(function(i){return i.waypoints[1]})).map(function(i){return Bm(t,i)});return n}function hT(e){var t=te(e.label),n=te(e),i=Bm(n,t);if(mT(i)){var r=dT(e);if(e.host){var o=fT(e);r=r.concat(o)}var a=$l.filter(function(s){return r.indexOf(s)===-1});if(a.indexOf(i)===-1)return a[0]}}function Bm(e,t){return pt(t,e,5)}function mT(e){return $l.indexOf(e)!==-1}function Fl(e){F.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,i=t.shape;t.position||(b(i,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:t.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}Y(Fl,F),Fl.$inject=["eventBus"];function Hl(e,t){e.invoke(F,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape,o=ce(r.incoming.concat(r.outgoing),function(a){return b(a,"bpmn:Association")});A(o,function(a){t.moveConnection(a,{x:0,y:0},i)})},!0)}Y(Hl,F),Hl.$inject=["injector","modeling"];var Lm=500;function es(e,t){t.invoke(F,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Lm,function(i){var r=i.elements;r=r.filter(function(o){var a=o.host;return $m(o,a)}),r.length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",Lm,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];$m(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}es.$inject=["bpmnReplace","injector"],Y(es,F),es.prototype._replaceShape=function(e,t){var n=gT(e),i={type:"bpmn:BoundaryEvent",host:t};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,i,{layoutConnection:!1})};function gT(e){var t=V(e),n=t.eventDefinitions;return n&&n[0]}function $m(e,t){return!ge(e)&&le(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Vl(e,t){F.call(this,e);function n(i){return ce(i.attachers,function(r){return b(r,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);b(r,"bpmn:EventBasedGateway")&&b(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;b(r,"bpmn:Gateway")&&b(o,"bpmn:EventBasedGateway")&&A(o.outgoing,function(a){var s=a.target,c=n(s);b(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Vl.$inject=["eventBus","modeling"],Y(Vl,F);function zl(e,t,n){F.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",r,!0),this.postExecuted("connection.delete",i,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function i(g){const w=g.source,C=g.target;hr(w)&&oo(C)&&u(C)}function r(g){const w=g.connection,C=g.source,x=g.target;hr(C)&&ts(x)&&(l(x),d(C,[w]))}function o(g){const w=g.newTarget,C=g.oldSource,x=g.oldTarget;if(x!==w){const E=C;oo(x)&&u(x),hr(E)&&ts(w)&&l(w)}}function a(g){const{element:w}=g;oo(w)?(p(w),h(w)):ts(w)&&m(w)}function s(g){const{newData:w,oldShape:C}=g;if(hr(g.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:E})=>oo(E));x&&x.target&&(g._connectionTarget=x.target)}else if(!hr(g.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:E})=>ts(E));x&&x.target&&(g._connectionTarget=x.target),y(C)}}function c(g){const{_connectionTarget:w,newShape:C}=g;w&&t.connect(C,w)}function l(g){t.updateProperties(g,{isForCompensation:!0})}function u(g){t.updateProperties(g,{isForCompensation:void 0})}function p(g){for(const w of g.incoming)n.canConnect(w.source,g)||t.removeConnection(w);for(const w of g.outgoing)n.canConnect(g,w.target)||t.removeConnection(w)}function d(g,w){g.outgoing.filter(E=>b(E,"bpmn:Association")).filter(E=>oo(E.target)&&!w.includes(E)).forEach(E=>t.removeConnection(E))}function h(g){const w=g.attachers.slice();w.length&&t.removeElements(w)}function m(g){const w=g.incoming.filter(C=>hr(C.source));t.removeElements(w)}function y(g){const w=g.outgoing.filter(C=>b(C,"bpmn:SequenceFlow"));t.removeElements(w)}}Y(zl,F),zl.$inject=["eventBus","modeling","bpmnRules"];function oo(e){const t=V(e);return t&&t.get("isForCompensation")}function hr(e){return e&&b(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function ts(e){return e&&b(e,"bpmn:Activity")&&!ht(e)}function Wl(e){e.invoke(F,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;b(i,"bpmn:Lane")&&!b(r,"bpmn:Lane")&&(n.parent=lr(i,"bpmn:Participant"))})}Wl.$inject=["injector"],Y(Wl,F);function Ul(e,t){F.call(this,e),this.preExecute("shape.create",function(n){var i=n.context,r=i.shape;if(b(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Ul.$inject=["eventBus","bpmnFactory"],Y(Ul,F);var Gl=20,Kl=20,jm=30,ns=2e3;function ql(e,t,n){F.call(this,t),t.on(["create.start","shape.move.start"],ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement();if(!(!b(a,"bpmn:Participant")||!b(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(p){return!b(p,"bpmn:Group")&&!ge(p)&&!Ce(p)});if(c.length){var l=Ye(c),u=yT(a,l);D(a,u),o.createConstraints=vT(a,l)}}}),t.on("create.start",ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function l(u){u.element=s,u.gfx=c}b(a,"bpmn:Participant")&&b(s,"bpmn:Process")&&(t.on("element.hover",ns,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))});function i(){var r=e.getRootElement();return b(r,"bpmn:Collaboration")?r:n.makeCollaboration()}this.preExecute("elements.create",ns,function(r){var o=r.elements,a=r.parent,s=_T(o),c;s&&b(a,"bpmn:Process")&&(r.parent=i(),c=r.hints=r.hints||{},c.participant=s,c.process=a,c.processRef=V(s).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;b(a,"bpmn:Participant")&&b(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=V(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;a&&(!c||s===c)&&V(s).set("processRef",V(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,l=o.participant;a&&(!l||c===l)&&V(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var l=a.children.slice();c?s===c&&n.moveElements(l,{x:0,y:0},c):n.moveElements(l,{x:0,y:0},s)}},!0)}ql.$inject=["canvas","eventBus","modeling"],Y(ql,F);function yT(e,t){t={width:t.width+Gl*2+jm,height:t.height+Kl*2};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}function vT(e,t){return t=Q(t),{bottom:t.top+e.height/2-Kl,left:t.right-e.width/2+Gl,top:t.bottom-e.height/2+Kl,right:t.left+e.width/2-Gl-jm}}function _T(e){return _e(e,function(t){return b(t,"bpmn:Participant")})}var Fm="__targetRef_placeholder";function Yl(e,t){F.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Hm(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Hm(o));function n(a,s,c){var l=a.get("dataInputAssociations");return _e(l,function(u){return u!==c&&u.targetRef===s})}function i(a,s){var c=a.get("properties"),l=_e(c,function(u){return u.name===Fm});return!l&&s&&(l=t.create("bpmn:Property",{name:Fm}),Xe(c,l)),l}function r(a,s){var c=i(a);c&&(n(a,c,s)||je(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,l=c.businessObject,u=c.target,p=u&&u.businessObject,d=s.newTarget,h=d&&d.businessObject,m=s.oldTarget||s.target,y=m&&m.businessObject,g=c.businessObject,w;y&&y!==p&&r(y,l),h&&h!==p&&r(h,l),p?(w=i(p,!0),g.targetRef=w):g.targetRef=null}}Yl.$inject=["eventBus","bpmnFactory"],Y(Yl,F);function Hm(e){return function(t){var n=t.context,i=n.connection;if(b(i,"bpmn:DataInputAssociation"))return e(t)}}function is(e){this._bpmnUpdater=e}is.$inject=["bpmnUpdater"],is.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},is.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]};function Xl(e,t,n,i){F.call(this,i),t.registerHandler("dataStore.updateContainment",is);function r(){return n.filter(function(s){return b(s,"bpmn:Participant")&&V(s).processRef})[0]}function o(s){return s.children.filter(function(c){return b(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var l=s.businessObject||s;if(c=c||r(),c){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,dataStoreDi:ye(s),newSemanticParent:u.processRef||u,newDiParent:ye(c)})}}this.preExecute("shape.create",function(s){var c=s.context,l=c.shape;b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,l=c.shapes,u=l.filter(function(p){return b(p,"bpmn:DataStoreReference")});u.length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(p){return!b(p,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,l=c.shape,u=l.parent;b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&b(u,"bpmn:Collaboration")&&a(l)}),this.postExecute("shape.move",function(s){var c=s.context,l=c.shape,u=c.oldParent,p=l.parent;if(!b(u,"bpmn:Collaboration")&&b(l,"bpmn:DataStoreReference")&&l.type!=="label"&&b(p,"bpmn:Collaboration")){var d=b(u,"bpmn:Participant")?u:ET(u,"bpmn:Participant");a(l,d)}}),this.postExecute("shape.delete",function(s){var c=s.context,l=c.shape,u=e.getRootElement();le(l,["bpmn:Participant","bpmn:SubProcess"])&&b(u,"bpmn:Collaboration")&&o(u).filter(function(p){return bT(p,l)}).forEach(function(p){a(p)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,l=c.oldRoot,u=c.newRoot,p=o(l);p.forEach(function(d){b(u,"bpmn:Process")&&a(d,u)})})}Xl.$inject=["canvas","commandStack","elementRegistry","eventBus"],Y(Xl,F);function bT(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function ET(e,t){for(;e.parent;){if(b(e.parent,t))return e.parent;e=e.parent}}var rs=Math.max,os=Math.min,xT=20;function Vm(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function wT(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+r,o.height=e.height-r):t.indexOf("s")!==-1&&(o.height=e.height+r),t.indexOf("e")!==-1?o.width=e.width+i:t.indexOf("w")!==-1&&(o.x=e.x+i,o.width=e.width-i),o}function ST(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function as(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return ee(r)&&(i=(/top|left/.test(e)?os:rs)(i,r)),ee(o)&&(i=(/top|left/.test(e)?rs:os)(i,o)),i}function CT(e,t){if(!t)return e;var n=Q(e);return ua({top:as("top",n,t),right:as("right",n,t),bottom:as("bottom",n,t),left:as("left",n,t)})}function RT(e,t,n,i){var r=Q(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?Q(i):o,s={top:os(o.top,a.top),left:os(o.left,a.left),bottom:rs(o.bottom,a.bottom),right:rs(o.right,a.right)};return ua(s)}function ao(e,t){return typeof e<"u"?e:xT}function TT(e,t){var n,i,r,o;return typeof t=="object"?(n=ao(t.left),i=ao(t.right),r=ao(t.top),o=ao(t.bottom)):n=i=r=o=ao(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}function PT(e){return!(e.waypoints||e.type==="label")}function zm(e,t){var n;if(e.length===void 0?n=ce(e.children,PT):n=e,n.length)return TT(Ye(n),t)}var Qn=Math.abs;function AT(e,t){return Vm(Q(t),Q(e))}var kT=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],zt=30;function ss(e,t){return t=t||[],e.children.filter(function(n){b(n,"bpmn:Lane")&&(ss(n,t),t.push(n))}),t}function ei(e){return e.children.filter(function(t){return b(t,"bpmn:Lane")})}function Wt(e){return lr(e,kT)||e}function DT(e,t){var n=Wt(e),i=b(n,"bpmn:Process")?[]:[n],r=ss(n,i),o=Q(e),a=Q(t),s=AT(e,t),c=[],l=Qe(e);return r.forEach(function(u){if(u!==e){var p=l?0:s.top,d=l?s.right:0,h=l?0:s.bottom,m=l?s.left:0,y=Q(u);s.top&&(Qn(y.bottom-o.top)<10&&(h=a.top-y.bottom),Qn(y.top-o.top)<5&&(p=a.top-y.top)),s.left&&(Qn(y.right-o.left)<10&&(d=a.left-y.right),Qn(y.left-o.left)<5&&(m=a.left-y.left)),s.bottom&&(Qn(y.top-o.bottom)<10&&(p=a.bottom-y.top),Qn(y.bottom-o.bottom)<5&&(h=a.bottom-y.bottom)),s.right&&(Qn(y.left-o.right)<10&&(m=a.right-y.left),Qn(y.right-o.right)<5&&(d=a.right-y.right)),(p||d||h||m)&&c.push({shape:u,newBounds:ST(u,{top:p,right:d,bottom:h,left:m})})}}),c}var MT=500;function Zl(e,t){F.call(this,e);function n(i,r){var o=Qe(i),a=ei(r),s=[],c=[],l=[],u=[];if(bi(a,function(g){return o?g.y>i.y?c.push(g):s.push(g):g.x>i.x?u.push(g):l.push(g),g.children}),!!a.length){var p;o?c.length&&s.length?p=i.height/2:p=i.height:u.length&&l.length?p=i.width/2:p=i.width;var d,h,m,y;s.length&&(d=t.calculateAdjustments(s,"y",p,i.y-10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),c.length&&(h=t.calculateAdjustments(c,"y",-p,i.y+i.height+10),t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:-p},"n")),l.length&&(m=t.calculateAdjustments(l,"x",p,i.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:p,y:0},"e")),u.length&&(y=t.calculateAdjustments(u,"x",-p,i.x+i.width+10),t.makeSpace(y.movingShapes,y.resizingShapes,{x:-p,y:0},"w"))}}this.postExecuted("shape.delete",MT,function(i){var r=i.context,o=r.hints,a=r.shape,s=r.oldParent;b(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}Zl.$inject=["eventBus","spaceTool"],Y(Zl,F);var Wm=500;function cs(e,t){t.invoke(F,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Wm,function(i){var r=i.elements;r.filter(function(o){var a=o.host;return Um(o,a)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",Wm,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c=a.host;Um(a,OT(r,c)?c:o)&&(r[s]=n._replaceShape(a))})},!0)}cs.$inject=["bpmnReplace","injector"],Y(cs,F),cs.prototype._replaceShape=function(e){var t=NT(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function NT(e){var t=V(e),n=t.eventDefinitions;return n&&n[0]}function Um(e,t){return!ge(e)&&b(e,"bpmn:BoundaryEvent")&&!t}function OT(e,t){return e.indexOf(t)!==-1}function Jl(e,t,n){F.call(this,e);function i(r,o,a){var s=o.waypoints,c,l,u,p,d,h,m,y=r.outgoing.slice(),g=r.incoming.slice(),w;ee(a.width)?w=te(a):w=a;var C=Pl(s,w);if(C){if(c=s.slice(0,C.index),l=s.slice(C.index+(C.bendpoint?1:0)),!c.length||!l.length)return;u=C.bendpoint?s[C.index]:w,(c.length===1||!Gm(r,c[c.length-1]))&&c.push(Km(u)),(l.length===1||!Gm(r,l[0]))&&l.unshift(Km(u))}p=o.source,d=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||w),h=o),t.canConnect(r,d,o)&&(h?m=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||w),m=o));var x=[].concat(h&&ce(g,function(E){return E.source===h.source})||[],m&&ce(y,function(E){return E.target===m.target})||[]);x.length&&n.removeElements(x)}this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(r.newParent=o=o.parent);var l=te(c),u={x:l.x+s.x,y:l.y+s.y},p=_e(o.children,function(d){var h=t.canInsert(a,d);return h&&Pl(d.waypoints,u)});p&&(r.targetFlow=p,r.position=u)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}Y(Jl,F),Jl.$inject=["eventBus","bpmnRules","modeling"];function Gm(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Km(e){return D({},e)}function Ql(e,t){F.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;if(!(s&&s.createElementsBehavior===!1)&&mr(r)){var c=[];b(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(l=>l!==r&&mr(l)):c=a.incoming.filter(l=>l!==r&&mr(l)&&b(l.source,"bpmn:EventBasedGateway")),c.forEach(function(l){t.removeConnection(l)})}}),this.preExecuted("shape.replace",function(n){var i=n.context,r=i.newShape;if(b(r,"bpmn:EventBasedGateway")){var o=r.outgoing.filter(mr).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(mr).forEach(function(s){const c=a.incoming.filter(mr).filter(function(l){return l.source===r});(s.source!==r||c.length>1)&&t.removeConnection(s)})})}})}Ql.$inject=["eventBus","modeling"],Y(Ql,F);function mr(e){return b(e,"bpmn:SequenceFlow")}var ls=1500,qm=2e3;function Ym(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],ls,function(i){var r=i.context,o=r.shape||i.shape,a=i.hover;b(a,"bpmn:Lane")&&!le(o,["bpmn:Lane","bpmn:Participant"])&&(i.hover=Wt(a),i.hoverGfx=e.getGraphics(i.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||le(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(i.hover=s,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],ls,function(i){var r=i.hover;b(r,"bpmn:Lane")&&(i.hover=Wt(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],ls,function(i){var r=i.context,o=i.hover,a=r.type;b(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=Wt(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],ls,function(i){var r=i.context,o=r.start;b(o,"bpmn:Lane")&&(r.start=Wt(o)||o)}),t.on("shape.move.start",qm,function(i){var r=i.shape;b(r,"bpmn:Lane")&&(i.shape=Wt(r)||r)}),t.on("spaceTool.move",qm,function(i){var r=i.hover;r&&b(r,"bpmn:Lane")&&(i.hover=Wt(r))})}Ym.$inject=["elementRegistry","eventBus","canvas"];function IT(e){return e.create("bpmn:Category")}function BT(e){return e.create("bpmn:CategoryValue")}function LT(e,t,n){return Xe(t.get("categoryValue"),e),e.$parent=t,Xe(n.get("rootElements"),t),t.$parent=n,e}function $T(e){var t=e.$parent;return t&&(je(t.get("categoryValue"),e),e.$parent=null),e}function jT(e){var t=e.$parent;return t&&(je(t.get("rootElements"),e),e.$parent=null),e}var Xm=770;function eu(e,t,n,i,r,o){r.invoke(F,this);function a(){return n.filter(function(m){return b(m,"bpmn:Group")})}function s(m,y){return m.some(function(g){var w=V(g),C=w.categoryValueRef&&w.categoryValueRef.$parent;return C===y})}function c(m,y){return m.some(function(g){var w=V(g);return w.categoryValueRef===y})}function l(m,y,g){var w=a().filter(function(C){return C.businessObject!==g});y&&!s(w,y)&&jT(y),m&&!c(w,m)&&$T(m)}function u(m,y){return LT(m,y,t.getDefinitions())}function p(m,y){var g=V(m),w=g.categoryValueRef;w||(w=g.categoryValueRef=y.categoryValue=y.categoryValue||BT(e));var C=w.$parent;C||(C=w.$parent=y.category=y.category||IT(e)),u(w,C,t.getDefinitions())}function d(m,y){var g=y.category,w=y.categoryValue,C=V(m);w?(C.categoryValueRef=null,l(w,g,C)):l(null,C.categoryValueRef.$parent,C)}this.execute("label.create",function(m){var y=m.context,g=y.labelTarget;b(g,"bpmn:Group")&&p(g,y)}),this.revert("label.create",function(m){var y=m.context,g=y.labelTarget;b(g,"bpmn:Group")&&d(g,y)}),this.execute("shape.delete",function(m){var y=m.context,g=y.shape,w=V(g);if(!(!b(g,"bpmn:Group")||g.labelTarget)){var C=y.categoryValue=w.categoryValueRef,x;C&&(x=y.category=C.$parent,l(C,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var y=m.context,g=y.shape;if(!(!b(g,"bpmn:Group")||g.labelTarget)){var w=y.category,C=y.categoryValue,x=V(g);C&&(x.categoryValueRef=C,u(C,w))}}),this.execute("shape.create",function(m){var y=m.context,g=y.shape;!b(g,"bpmn:Group")||g.labelTarget||V(g).categoryValueRef&&p(g,y)}),this.reverted("shape.create",function(m){var y=m.context,g=y.shape;!b(g,"bpmn:Group")||g.labelTarget||V(g).categoryValueRef&&d(g,y)});function h(m,y){var g=e.create(m.$type);return o.copyElement(m,g,null,y)}i.on("copyPaste.copyElement",Xm,function(m){var y=m.descriptor,g=m.element;if(!(!b(g,"bpmn:Group")||g.labelTarget)){var w=V(g);if(w.categoryValueRef){var C=w.categoryValueRef;y.categoryValue=h(C,!0),C.$parent&&(y.category=h(C.$parent,!0))}}}),i.on("copyPaste.pasteElement",Xm,function(m){var y=m.descriptor,g=y.businessObject,w=y.categoryValue,C=y.category;w&&(w=g.categoryValueRef=h(w)),C&&(w.$parent=h(C)),delete y.category,delete y.categoryValue})}eu.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],Y(eu,F);function tu(e,t,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y),r==0?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Zm(e){function t(i,r,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=tu(i,r,o,a),l=tu(i,r,o,s),u;c&&l?Jm(c,o)>Jm(l,o)?u=l:u=c:u=c||l,i.original=u}function n(i){var r=i.waypoints;t(r[0],r[1],te(i.source)),t(r[r.length-1],r[r.length-2],te(i.target))}e.on("bpmnElement.added",function(i){var r=i.element;r.waypoints&&n(r)})}Zm.$inject=["eventBus"];function Jm(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nu(e){F.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=V(i),o=ye(i);if(le(r,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}nu.$inject=["eventBus"],Y(nu,F);var Qm=Math.sqrt,eg=Math.min,FT=Math.max,tg=Math.abs;function ng(e){return Math.pow(e,2)}function so(e,t){return Qm(ng(e.x-t.x)+ng(e.y-t.y))}function HT(e,t){var n=0,i,r,o,a,s,c,l,u,p,d,h;for(n=0;n<t.length-1;n++){if(i=t[n],r=t[n+1],rg(i,r)?l=[i]:(o=so(e,i),a=so(e,r),c=eg(o,a),l=VT(i,r,e,c)),l.length<1)throw new Error("expected between [1, 2] circle -> line intersections");l.length===1&&(u={type:"bendpoint",position:l[0],segmentIndex:n,bendpointIndex:rg(i,l[0])?n:n+1}),l.length===2&&(s=WT(l[0],l[1]),u={type:"segment",position:s,segmentIndex:n,relativeLocation:so(i,s)/so(i,r)}),p=so(u.position,e),(!h||d>p)&&(h=u,d=p)}return h}function VT(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,l=r*a+o*s,u=a*a+s*s-i*i,p=l/c,d=u/c,h=p*p-d;if(h<0&&h>-1e-6&&(h=0),h<0)return[];var m=Qm(h),y=-p+m,g=-p-m,w={x:e.x-r*y,y:e.y-o*y};if(h===0)return[w];var C={x:e.x-r*g,y:e.y-o*g};return[w,C].filter(function(x){return zT(x,e,t)})}function zT(e,t,n){return ig(e.x,t.x,n.x)&&ig(e.y,t.y,n.y)}function ig(e,t,n){return e>=eg(t,n)-us&&e<=FT(t,n)+us}function WT(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var us=.1;function rg(e,t){return tg(e.x-t.x)<=us&&tg(e.y-t.y)<=us}function UT(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c=i.bendpointMove.insert,l=i.bendpointMove.bendpointIndex,u;if(o===0)return r;if(r>=l&&(u=c?r+1:r-1),r<l&&(u=r,c&&n.type!=="bendpoint"&&l-1===r)){var p=ag(t,l);p<n.relativeLocation&&u++}return u}return o===0?r:i.connectionStart&&r===0?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function og(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=HT(e,n),c=s.segmentIndex,l=UT(n,t,s,i);if(l<0||l>t.length-2||l===null)return a;var u=sg(n,c),p=sg(t,l),d=s.position,h=KT(u,d),m=GT(u,p);if(s.type==="bendpoint"){var y=t.length-n.length,g=s.bendpointIndex,w=n[g];if(t.indexOf(w)!==-1)return a;if(y===0){var C=t[g];return r=C.x-s.position.x,o=C.y-s.position.y,{delta:{x:r,y:o},point:{x:e.x+r,y:e.y+o}}}y<0&&g!==0&&g<n.length-1&&(h=ag(n,g))}var x={x:(p[1].x-p[0].x)*h+p[0].x,y:(p[1].y-p[0].y)*h+p[0].y},E=BR({x:e.x-d.x,y:e.y-d.y},m);return r=x.x+E.x-e.x,o=x.y+E.y-e.y,{point:xn(x),delta:xn({x:r,y:o})}}function ag(e,t){var n=Ya(e[t-1],e[t]),i=Ya(e[t],e[t+1]),r=n/(n+i);return r}function GT(e,t){var n=am(e),i=am(t);return i-n}function sg(e,t){return[e[t],e[t+1]]}function KT(e,t){var n=Ya(e[0],e[1]),i=Ya(e[0],t);return n===0?0:i/n}function qT(e,t,n,i){var r=te(e);return og(r,t,n,i).delta}function co(e,t,n){var i=Xr(t),r=Xr(n),o=nn(e,i),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return xn({x:r.x+a.x,y:r.y+a.y})}function cg(e,t,n){var i=Xr(e),r=Xr(t),o=Xr(n),a=nn(e,i),s=nn(i,r),c=YT(i,t,n);if(c)return c;var l={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},u={x:o.x+l.x,y:o.y+l.y};return xn({x:u.x+a.x-e.x,y:u.y+a.y-e.y})}function YT(e,t,n){var i=Q(t),r=Q(n);if(XT(i,r))return null;var o=pt(t,e),a,s,c;if(o==="top")a={x:0,y:r.bottom-i.bottom};else if(o==="bottom")a={x:0,y:r.top-i.top};else if(o==="right")a={x:r.left-i.left,y:0};else if(o==="left")a={x:r.right-i.right,y:0};else return null;return s={x:e.x+a.x,y:e.y+a.y},c=pt(n,s),c!==o?null:a}function XT(e,t){return ZT(e,t)||JT(e,t)}function ZT(e,t){return e.right!==t.right&&e.left!==t.left}function JT(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var lg="name",ug="text";function iu(e,t,n,i){F.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",a=>{V(a.context.element)===a.context.moddleElement&&r(a)});function r(a){var s=a.context,c=s.element,l=s.properties;if(lg in l&&t.updateLabel(c,l[lg]),ug in l&&b(c,"bpmn:TextAnnotation")){var u=i.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},l[ug]||"");t.updateLabel(c,l.text,u)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var l=s.shape||s.connection;ge(l)||!Ci(l)||en(l)&&t.updateLabel(l,en(l))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,l=s.hints||{};c&&l.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,l=c.label,u=D({},s.hints),p=s.newWaypoints||c.waypoints,d=s.oldWaypoints;return typeof u.startChanged>"u"&&(u.startChanged=!!u.connectionStart),typeof u.endChanged>"u"&&(u.endChanged=!!u.connectionEnd),qT(l,p,d,u)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var l=s.connection,u=l.label,p;!u||!u.parent||(p=o(a),t.moveShape(u,p))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,l=s.oldShape,u=V(c);u&&Ci(u)&&l.label&&c.label&&(c.label.x=l.label.x,c.label.y=l.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.newBounds,u=s.oldBounds;if(_a(c)){var p=c.label,d=te(p),h=tP(u),m=eP(d,h),y=QT(m,u,l);t.moveShape(p,y)}})}Y(iu,F),iu.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function QT(e,t,n){var i=co(e,t,n);return xn(nn(i,e))}function eP(e,t){if(t.length){var n=nP(e,t);return Al(e,n)}}function tP(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function nP(e,t){var n=t.map(function(r){return{line:r,distance:sm(e,r)}}),i=cn(n,"distance");return i[0].line}function iP(e,t,n,i){return og(e,t,n,i).point}function ru(e,t){F.call(this,e);function n(i,r){var o=i.context,a=o.connection,s=D({},o.hints),c=o.newWaypoints||a.waypoints,l=o.oldWaypoints;return typeof s.startChanged>"u"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged>"u"&&(s.endChanged=!!s.connectionEnd),iP(r,c,l,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var l=c.waypoints[c.waypoints.length-1],u=n(i,l),p=[].concat(c.waypoints.slice(0,-1),[u]);t.updateWaypoints(c,p)}),a.forEach(function(c){var l=c.waypoints[0],u=n(i,l),p=[].concat([u],c.waypoints.slice(1));t.updateWaypoints(c,p)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(l){var u=l.waypoints[l.waypoints.length-1],p={x:u.x+c.x,y:u.y+c.y},d=[].concat(l.waypoints.slice(0,-1),[p]);t.updateWaypoints(l,d)}),a.forEach(function(l){var u=l.waypoints[0],p={x:u.x+c.x,y:u.y+c.y},d=[].concat([p],l.waypoints.slice(1));t.updateWaypoints(l,d)})})}Y(ru,F),ru.$inject=["eventBus","modeling"];function ps(e,t,n){var i=ds(e),r=fg(i,t),o=i[0];return r.length?r[r.length-1]:co(o.original||o,n,t)}function fs(e,t,n){var i=ds(e),r=fg(i,t),o=i[i.length-1];return r.length?r[0]:co(o.original||o,n,t)}function ou(e,t,n){var i=ds(e),r=pg(t,n),o=i[0];return co(o.original||o,r,t)}function au(e,t,n){var i=ds(e),r=pg(t,n),o=i[i.length-1];return co(o.original||o,r,t)}function pg(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ds(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function fg(e,t){var n=ct(e,oP);return ce(n,function(i){return rP(i,t)})}function rP(e,t){return pt(t,e,1)==="intersect"}function oP(e){return e.original||e}function su(e,t){F.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(aP(i,r)){var o=sP(i);o.incoming.forEach(function(a){var s=fs(a,r,i);t.reconnectEnd(a,r,s)}),o.outgoing.forEach(function(a){var s=ps(a,r,i);t.reconnectStart(a,r,s)})}},!0)}su.$inject=["eventBus","modeling"],Y(su,F);function aP(e,t){return b(e,"bpmn:Participant")&&fe(e)&&b(t,"bpmn:Participant")&&!fe(t)}function sP(e){var t=Or([e],!1),n=[],i=[];return t.forEach(function(r){r!==e&&(r.incoming.forEach(function(o){b(o,"bpmn:MessageFlow")&&n.push(o)}),r.outgoing.forEach(function(o){b(o,"bpmn:MessageFlow")&&i.push(o)}))},[]),{incoming:n,outgoing:i}}const cP=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function dg(e){const t=V(e);if(!b(t,"bpmn:BoundaryEvent")&&!(b(t,"bpmn:StartEvent")&&ht(t.$parent)))return!1;const n=t.get("eventDefinitions");return!n||!n.length?!1:cP.some(i=>b(n[0],i))}function hg(e){return b(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function cu(e,t){e.invoke(F,this),this.postExecuted("shape.replace",function(n){const i=n.context.oldShape,r=n.context.newShape,o=n.context.hints;if(!dg(r))return;const a=hg(r);if(o.targetElement&&o.targetElement[a]!==void 0)return;const c=V(i).get(a),l=V(r).get(a);c!==l&&t.updateProperties(r,{[a]:c})})}cu.$inject=["injector","modeling"],Y(cu,F);function lu(e,t){F.call(this,e),this.preExecute("shape.resize",function(n){var i=n.shape,r=ye(i),o=r&&r.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(i,o,{bounds:void 0})},!0)}Y(lu,F),lu.$inject=["eventBus","modeling"];function uu(e,t,n){F.call(this,e),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(!(r.incoming.length!==1||r.outgoing.length!==1)){var o=r.incoming[0],a=r.outgoing[0];if(!(!b(o,"bpmn:SequenceFlow")||!b(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=lP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}Y(uu,F),uu.$inject=["eventBus","bpmnRules","modeling"];function gr(e){return e.original||e}function lP(e,t){var n=tu(gr(e[e.length-2]),gr(e[e.length-1]),gr(t[1]),gr(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[gr(e[0]),gr(t[t.length-1])]}function pu(e,t){F.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;b(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;if(i&&!i.businessObject.participants.length){var r=t.makeProcess(),o=i.children.slice();t.moveElements(o,{x:0,y:0},r)}},!0)}pu.$inject=["eventBus","modeling"],Y(pu,F);function fu(e,t,n,i){F.call(this,e);var r=i.get("dragging",!1);function o(c){var l=c.source,u=c.target,p=c.parent;if(p){var d,h;b(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(l,u)||(h=!0),n.canConnectMessageFlow(l,u)&&(d="bpmn:MessageFlow")),b(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(l,u)||(h=!0),n.canConnectSequenceFlow(l,u)&&(d="bpmn:SequenceFlow")),h&&t.removeConnection(c),d&&t.connect(l,u,{type:d,waypoints:c.waypoints.slice()})}}function a(c){var l=c.context,u=l.connection,p=l.newSource||u.source,d=l.newTarget||u.target,h,m;h=n.canConnect(p,d),!(!h||h.type===u.type)&&(m=t.connect(p,d,{type:h.type,associationDirection:h.associationDirection,waypoints:u.waypoints.slice()}),u.parent&&t.removeConnection(u),l.connection=m,r&&s(u,m))}function s(c,l){var u=r.context(),p=u&&u.payload.previousSelection,d;!p||!p.length||(d=p.indexOf(c),d!==-1&&p.splice(d,1,l))}this.postExecuted("elements.move",function(c){var l=c.closure,u=l.allConnections;A(u,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var l=c.context,u=l.properties,p=l.element,d=p.businessObject,h;u.default&&(h=_e(p.outgoing,Jt({id:p.businessObject.default.id})),h&&t.updateProperties(h,{conditionExpression:void 0})),u.conditionExpression&&d.sourceRef.default===d&&t.updateProperties(p.source,{default:void 0})})}Y(fu,F),fu.$inject=["eventBus","modeling","bpmnRules","injector"];function hs(e,t,n,i,r,o){i.invoke(F,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,l=s.elements,u=Tt(l,function(p,d){var h=t.canReplace([d],d.host||d.parent||c);return h?p.concat(h.replacements):p},[]);u.length&&this._replaceElements(l,u)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,l=s.newHost,u=[];A(s.closure.topLevel,function(d){ht(d)?u=u.concat(d.children):u=u.concat(d)}),u.length===1&&l&&(c=l);var p=t.canReplace(u,c);p&&this._replaceElements(u,p.replacements,l)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape,u=c.attachers,p;u&&u.length&&(p=t.canReplace(u,l),this._replaceElements(u,p.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(l,{id:c.id})})}Y(hs,F),hs.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;A(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=i.replaceElement(s,a,{select:!1})}),t&&r.select(e)},hs.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var uP=1500,pP={width:140,height:120},du={width:300,height:60},hu={width:60,height:300},ms={width:300,height:150},gs={width:150,height:300},mg={width:140,height:120},gg={width:50,height:30};function yg(e){e.on("resize.start",uP,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(b(i,"bpmn:Lane")||b(i,"bpmn:Participant"))&&(n.resizeConstraints=gP(i,r,o)),b(i,"bpmn:SubProcess")&&fe(i)&&(n.minDimensions=mg),b(i,"bpmn:TextAnnotation")&&(n.minDimensions=gg)})}yg.$inject=["eventBus"];var ti=Math.abs,fP=Math.min,dP=Math.max;function vg(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function yr(e,t,n){return vg(e,t,n,fP)}function vr(e,t,n){return vg(e,t,n,dP)}var hP={top:20,left:50,right:20,bottom:20},mP={top:50,left:20,right:20,bottom:20};function gP(e,t,n){var i=Wt(e),r=!0,o=!0,a=ss(i,[i]),s=Q(e),c={},l={},u=Qe(e),p=u?du:hu;/n/.test(t)?l.top=s.bottom-p.height:/e/.test(t)?l.right=s.left+p.width:/s/.test(t)?l.bottom=s.top+p.height:/w/.test(t)&&(l.left=s.right-p.width),a.forEach(function(m){var y=Q(m);u?(y.top<s.top-10&&(r=!1),y.bottom>s.bottom+10&&(o=!1)):(y.left<s.left-10&&(r=!1),y.right>s.right+10&&(o=!1)),/n/.test(t)&&(n&&ti(s.top-y.bottom)<10&&vr(c,"top",y.top+p.height),ti(s.top-y.top)<5&&yr(l,"top",y.bottom-p.height)),/e/.test(t)&&(n&&ti(s.right-y.left)<10&&yr(c,"right",y.right-p.width),ti(s.right-y.right)<5&&vr(l,"right",y.left+p.width)),/s/.test(t)&&(n&&ti(s.bottom-y.top)<10&&yr(c,"bottom",y.bottom-p.height),ti(s.bottom-y.bottom)<5&&vr(l,"bottom",y.top+p.height)),/w/.test(t)&&(n&&ti(s.left-y.right)<10&&vr(c,"left",y.left+p.width),ti(s.left-y.left)<5&&yr(l,"left",y.right-p.width))});var d=i.children.filter(function(m){return!m.hidden&&!m.waypoints&&(b(m,"bpmn:FlowElement")||b(m,"bpmn:Artifact"))}),h=u?hP:mP;return d.forEach(function(m){var y=Q(m);/n/.test(t)&&(!u||r)&&yr(l,"top",y.top-h.top),/e/.test(t)&&(u||o)&&vr(l,"right",y.right+h.right),/s/.test(t)&&(!u||o)&&vr(l,"bottom",y.bottom+h.bottom),/w/.test(t)&&(u||r)&&yr(l,"left",y.left-h.left)}),{min:l,max:c}}var _g=1001;function bg(e,t){e.on("resize.start",_g+500,function(n){var i=n.context,r=i.shape;(b(r,"bpmn:Lane")||b(r,"bpmn:Participant"))&&(i.balanced=!Yr(n))}),e.on("resize.end",_g,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(b(r,"bpmn:Lane")||b(r,"bpmn:Participant"))return o&&(a=jf(a),t.resizeLane(r,a,i.balanced)),!1})}bg.$inject=["eventBus","modeling"];var yP=500;function mu(e,t,n,i,r){n.invoke(F,this);function o(u){return le(u,["bpmn:ReceiveTask","bpmn:SendTask"])||vP(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){var p=e.getDefinitions(),d=p.get("rootElements");return!!_e(d,Jt({id:u.id}))}function s(u){if(b(u,"bpmn:ErrorEventDefinition"))return"errorRef";if(b(u,"bpmn:EscalationEventDefinition"))return"escalationRef";if(b(u,"bpmn:MessageEventDefinition"))return"messageRef";if(b(u,"bpmn:SignalEventDefinition"))return"signalRef"}function c(u){if(le(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions"),d=p[0];return d.get(s(d))}function l(u,p){if(le(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.set("messageRef",p);var d=u.get("eventDefinitions"),h=d[0];return h.set(s(h),p)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.shape||u.element;if(o(p)){var d=V(p),h=c(d),m;h&&!a(h)&&(m=e.getDefinitions().get("rootElements"),Xe(m,h),u.addedRootElement=h)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.addedRootElement;if(p){var d=e.getDefinitions().get("rootElements");je(d,p)}},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(!(d.labelTarget||!o(d))){var h=V(d),m=c(h);m&&(p.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",yP,function(u){var p=u.descriptor,d=p.businessObject,h=p.referencedRootElement;h&&(a(h)||(h=i.copyElement(h,r.create(h.$type))),l(d,h),delete p.referencedRootElement)})}mu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],Y(mu,F);function vP(e,t){return oe(t)||(t=[t]),jn(t,function(n){return Ji(e,n)})}var Eg=Math.max;function xg(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return A(n,function(a){var s=a.id;b(a,"bpmn:Participant")&&(o[s]=bP(a,i,r)),b(a,"bpmn:Lane")&&(o[s]=Qe(a)?du:hu),b(a,"bpmn:SubProcess")&&fe(a)&&(o[s]=mg),b(a,"bpmn:TextAnnotation")&&(o[s]=gg),b(a,"bpmn:Group")&&(o[s]=pP)}),o})}xg.$inject=["eventBus"];function _P(e){return e==="x"}function bP(e,t,n){var i=Qe(e);if(!wP(e))return i?ms:gs;var r=_P(t),o={};return r?i?o=ms:o={width:xP(e,n,r),height:gs.height}:i?o={width:ms.width,height:EP(e,n,r)}:o=gs,o}function EP(e,t,n){var i;return i=SP(e,t,n),Eg(ms.height,i)}function xP(e,t,n){var i;return i=CP(e,t,n),Eg(gs.width,i)}function wP(e){return!!ei(e).length}function SP(e,t,n){var i=ei(e),r;return r=gu(i,t,n),e.height-r.height+du.height}function CP(e,t,n){var i=ei(e),r;return r=gu(i,t,n),e.width-r.width+hu.width}function gu(e,t,n){var i,r,o;for(i=0;i<e.length;i++)if(r=e[i],!n&&t>=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return o=ei(r),o.length?gu(o,t,n):r}var wg=400,RP=600,Sg={x:180,y:160};function ni(e,t,n,i,r,o,a){F.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(p){return b(p,"bpmn:SubProcess")&&!fe(p)}function l(p){var d=p.shape,h=p.newRootElement,m=V(d);h=s._addDiagram(h||m),p.newRootElement=e.addRootElement(h)}function u(p){var d=p.shape,h=V(d);s._removeDiagram(h);var m=p.newRootElement=a.get(Tn(h));e.removeRootElement(m)}this.executed("shape.create",function(p){var d=p.shape;c(d)&&l(p)},!0),this.postExecuted("shape.create",function(p){var d=p.shape,h=p.newRootElement;!h||!d.children||(s._showRecursively(d.children),s._moveChildrenToShape(d,h))},!0),this.reverted("shape.create",function(p){var d=p.shape;c(d)&&u(p)},!0),this.preExecuted("shape.delete",function(p){var d=p.shape;if(c(d)){var h=a.get(Tn(d));h&&n.removeElements(h.children.slice())}},!0),this.executed("shape.delete",function(p){var d=p.shape;c(d)&&u(p)},!0),this.reverted("shape.delete",function(p){var d=p.shape;c(d)&&l(p)},!0),this.preExecuted("shape.replace",function(p){var d=p.oldShape,h=p.newShape;!c(d)||!c(h)||(p.oldRoot=e.removeRootElement(Tn(d)))},!0),this.postExecuted("shape.replace",function(p){var d=p.newShape,h=p.oldRoot,m=e.findRoot(Tn(d));if(!(!h||!m)){var y=h.children;n.moveElements(y,{x:0,y:0},m)}},!0),this.executed("element.updateProperties",function(p){var d=p.element;if(b(d,"bpmn:SubProcess")){var h=p.properties,m=p.oldProperties,y=m.id,g=h.id;if(y!==g){if(Ta(d)){a.updateId(d,Ti(g)),a.updateId(y,g);return}var w=a.get(Ti(y));w&&a.updateId(Ti(y),Ti(g))}}},!0),this.reverted("element.updateProperties",function(p){var d=p.element;if(b(d,"bpmn:SubProcess")){var h=p.properties,m=p.oldProperties,y=m.id,g=h.id;if(y!==g){if(Ta(d)){a.updateId(d,Ti(y)),a.updateId(g,y);return}var w=a.get(Ti(g));w&&a.updateId(w,Ti(y))}}},!0),t.on("element.changed",function(p){var d=p.element;if(Ta(d)){var h=d,m=a.get(Id(h));!m||m===h||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",wg,function(p){var d=p.shape;b(d,"bpmn:SubProcess")&&(fe(d)?u(p):(l(p),s._showRecursively(d.children)))},!0),this.reverted("shape.toggleCollapse",wg,function(p){var d=p.shape;b(d,"bpmn:SubProcess")&&(fe(d)?u(p):(l(p),s._showRecursively(d.children)))},!0),this.postExecuted("shape.toggleCollapse",RP,function(p){var d=p.shape;if(b(d,"bpmn:SubProcess")){var h=p.newRootElement;h&&(fe(d)?s._moveChildrenToShape(h,d):s._moveChildrenToShape(d,h))}},!0),t.on("copyPaste.createTree",function(p){var d=p.element,h=p.children;if(c(d)){var m=Tn(d),y=a.get(m);y&&h.push.apply(h,y.children)}}),t.on("copyPaste.copyElement",function(p){var d=p.descriptor,h=p.element,m=p.elements,y=h.parent,g=b(ye(y),"bpmndi:BPMNPlane");if(g){var w=Id(y),C=_e(m,function(x){return x.id===w});C&&(d.parent=C.id)}}),t.on("copyPaste.pasteElement",function(p){var d=p.descriptor;d.parent&&(c(d.parent)||d.parent.hidden)&&(d.hidden=!0)})}Y(ni,F),ni.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,i=e.children,r;if(i){i=i.concat(i.reduce(function(l,u){return u.label&&u.label.parent!==e?l.concat(u.label):l},[]));var o=i.filter(function(l){return!l.hidden});if(!o.length){n.moveElements(i,{x:0,y:0},t,{autoResize:!1});return}var a=Ye(o);if(!t.x)r={x:Sg.x-a.x,y:Sg.y-a.y};else{var s=te(t),c=te(a);r={x:s.x-c.x,y:s.y-c.y}}n.moveElements(i,r,t,{autoResize:!1})}},ni.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(r){r.hidden=!!t,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||t)))}),i},ni.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e},ni.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:Tn(e),type:e.$type,di:i,businessObject:e,collapsed:!0});return o},ni.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,i=_e(n,function(r){return r.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(i),1),i},ni.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function yu(e,t){e.invoke(F,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(!(!b(r,"bpmn:SubProcess")||b(r,"bpmn:AdHocSubProcess")||!(b(i,"bpmn:Task")||b(i,"bpmn:CallActivity"))||!fe(r))){var o=TP(r);t.createShape({type:"bpmn:StartEvent"},o,r)}})}yu.$inject=["injector","modeling"],Y(yu,F);function TP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function vu(e){F.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;b(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&b(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}Y(vu,F),vu.$inject=["eventBus"];function _u(e,t){F.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(fe(i))return;var r=Or(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();A(s,function(l){o(l,!0)}),A(c,function(l){o(l,!1)})});function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?t.reconnectEnd(a,i,te(i)):t.reconnectStart(a,i,te(i)))}},!0)}Y(_u,F),_u.$inject=["eventBus","modeling"];var bu=500;function Eu(e,t,n){F.call(this,e);function i(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function r(a,s){var c=a.children,l=s,u,p;return u=PP(c).concat([a]),p=zm(u),p?(l.width=Math.max(p.width,l.width),l.height=Math.max(p.height,l.height),l.x=p.x+(p.width-l.width)/2,l.y=p.y+(p.height-l.height)/2):(l.x=a.x+(a.width-l.width)/2,l.y=a.y+(a.height-l.height)/2),l}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;b(c,"bpmn:SubProcess")&&(c.collapsed?ye(c).isExpanded=!1:(i(c.children),ye(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;c.collapsed?ye(c).isExpanded=!1:ye(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],bu,function(a){var s=a.context.shape,c=t.getDefaultSize(s),l;s.collapsed?l=o(s,c):l=r(s,c),n.resizeShape(s,l,null,{autoResize:s.collapsed?!1:"nwse"})})}Y(Eu,F),Eu.$inject=["eventBus","elementFactory","modeling"];function PP(e){return e.filter(function(t){return!t.hidden})}function xu(e,t,n,i){t.invoke(F,this),this.preExecute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.businessObject;ge(a)||(b(a,"bpmn:Participant")&&fe(a)&&n.ids.unclaim(s.processRef.id),i.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(r){var o=r.context,a=o.connection,s=a.businessObject;i.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement(),o=r.businessObject;b(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}Y(xu,F),xu.$inject=["canvas","injector","moddle","modeling"];function wu(e,t){F.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context,r=i.connection,o=r.source;AP(r,o)&&t.updateProperties(o,{default:null})})}Y(wu,F),wu.$inject=["eventBus","modeling"];function AP(e,t){if(!b(e,"bpmn:SequenceFlow"))return!1;var n=V(t),i=V(e);return n.get("default")===i}var kP=500,DP=5e3;function Su(e,t){F.call(this,e);var n;function i(){return n=n||new MP,n.enter(),n}function r(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,DP,function(s){i()}),this.postExecuted(a,kP,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,l=c.shape,u=r();l.labelTarget||(b(l,"bpmn:Lane")&&u.addLane(l),b(l,"bpmn:FlowNode")&&u.addFlowNode(l))})}Su.$inject=["eventBus","modeling"],Y(Su,F);function MP(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Cu(e,t){F.call(this,e),this.postExecuted("elements.create",function(n){const i=n.context,r=i.elements;for(const o of r)NP(o)&&!IP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}Y(Cu,F),Cu.$inject=["eventBus","modeling"];function NP(e){const t=V(e);return t&&t.isForCompensation}function OP(e){return e&&b(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function IP(e){return e.incoming.filter(n=>OP(n.source)).length>0}const BP={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",jl],appendBehavior:["type",Fl],associationBehavior:["type",Hl],attachEventBehavior:["type",es],boundaryEventBehavior:["type",Vl],compensateBoundaryEventBehaviour:["type",zl],createBehavior:["type",Wl],createDataObjectBehavior:["type",Ul],createParticipantBehavior:["type",ql],dataInputAssociationBehavior:["type",Yl],dataStoreBehavior:["type",Xl],deleteLaneBehavior:["type",Zl],detachEventBehavior:["type",cs],dropOnFlowBehavior:["type",Jl],eventBasedGatewayBehavior:["type",Ql],fixHoverBehavior:["type",Ym],groupBehavior:["type",eu],importDockingFix:["type",Zm],isHorizontalFix:["type",nu],labelBehavior:["type",iu],layoutConnectionBehavior:["type",ru],messageFlowBehavior:["type",su],nonInterruptingBehavior:["type",cu],removeElementBehavior:["type",uu],removeEmbeddedLabelBoundsBehavior:["type",lu],removeParticipantBehavior:["type",pu],replaceConnectionBehavior:["type",fu],replaceElementBehaviour:["type",hs],resizeBehavior:["type",yg],resizeLaneBehavior:["type",bg],rootElementReferenceBehavior:["type",mu],spaceToolBehavior:["type",xg],subProcessPlaneBehavior:["type",ni],subProcessStartEventBehavior:["type",yu],textAnnotationBehavior:["type",vu],toggleCollapseConnectionBehaviour:["type",_u],toggleElementCollapseBehaviour:["type",Eu],unclaimIdBehavior:["type",xu],unsetDefaultFlowBehavior:["type",wu],updateFlowNodeRefsBehavior:["type",Su],setCompensationActivityAfterPasteBehavior:["type",Cu]};function Cg(e,t){var n=pt(e,t,-15);return n!=="intersect"?n:null}function st(e){Ht.call(this,e)}Y(st,Ht),st.$inject=["eventBus"],st.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return LP(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return vs(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,i=e.target;return vs(n,i,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return Bg(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return Ce(i)&&!_s(t,i)?!1:vi(t,function(r){return Ce(r)?vs(r.source,r.target,r):r.host?lo(r,r.host,null,n):ku(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return lo(n,t,null,i)||Og(n,t,i)||Ig(n,t)||_s(n,t)}),this.addRule("shape.create",function(e){return ku(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return lo(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return Hg(n,t)})},st.prototype.canConnectMessageFlow=jg,st.prototype.canConnectSequenceFlow=Fg,st.prototype.canConnectDataAssociation=Du,st.prototype.canConnectAssociation=Lg,st.prototype.canConnectCompensationAssociation=$g,st.prototype.canMove=Ig,st.prototype.canAttach=lo,st.prototype.canReplace=Og,st.prototype.canDrop=_r,st.prototype.canInsert=_s,st.prototype.canCreate=ku,st.prototype.canConnect=vs,st.prototype.canResize=Bg,st.prototype.canCopy=Hg;function LP(e){return Ru(e)?null:le(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function Ru(e){return!e||ge(e)}function $P(e,t){return e===t}function Rg(e){do{if(b(e,"bpmn:Process"))return V(e);if(b(e,"bpmn:Participant"))return V(e).processRef||V(e)}while(e=e.parent)}function Tu(e){return b(e,"bpmn:TextAnnotation")}function Pu(e){return b(e,"bpmn:Group")&&!e.labelTarget}function Tg(e){return b(e,"bpmn:BoundaryEvent")&&vn(e,"bpmn:CompensateEventDefinition")}function ys(e){return V(e).isForCompensation}function jP(e,t){var n=Rg(e),i=Rg(t);return n===i}function FP(e){return b(e,"bpmn:InteractionNode")&&!b(e,"bpmn:BoundaryEvent")&&(!b(e,"bpmn:Event")||b(e,"bpmn:ThrowEvent")&&kg(e,"bpmn:MessageEventDefinition"))}function HP(e){return b(e,"bpmn:InteractionNode")&&!ys(e)&&(!b(e,"bpmn:Event")||b(e,"bpmn:CatchEvent")&&kg(e,"bpmn:MessageEventDefinition"))&&!(b(e,"bpmn:BoundaryEvent")&&!vn(e,"bpmn:MessageEventDefinition"))}function Pg(e){for(var t=e;t=t.parent;){if(b(t,"bpmn:FlowElementsContainer"))return V(t);if(b(t,"bpmn:Participant"))return V(t).processRef}return null}function Ag(e,t){var n=Pg(e),i=Pg(t);return n===i}function vn(e,t){var n=V(e);return!!_e(n.eventDefinitions||[],function(i){return b(i,t)})}function kg(e,t){var n=V(e);return(n.eventDefinitions||[]).every(function(i){return b(i,t)})}function VP(e){return b(e,"bpmn:FlowNode")&&!b(e,"bpmn:EndEvent")&&!ht(e)&&!(b(e,"bpmn:IntermediateThrowEvent")&&vn(e,"bpmn:LinkEventDefinition"))&&!Tg(e)&&!ys(e)}function zP(e){return b(e,"bpmn:FlowNode")&&!b(e,"bpmn:StartEvent")&&!b(e,"bpmn:BoundaryEvent")&&!ht(e)&&!(b(e,"bpmn:IntermediateCatchEvent")&&vn(e,"bpmn:LinkEventDefinition"))&&!ys(e)}function WP(e){return b(e,"bpmn:ReceiveTask")||b(e,"bpmn:IntermediateCatchEvent")&&(vn(e,"bpmn:MessageEventDefinition")||vn(e,"bpmn:TimerEventDefinition")||vn(e,"bpmn:ConditionalEventDefinition")||vn(e,"bpmn:SignalEventDefinition"))}function UP(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Au(e,t){var n=UP(t);return n.indexOf(e)!==-1}function vs(e,t,n){if(Ru(e)||Ru(t))return null;if(!b(n,"bpmn:DataAssociation")){if(jg(e,t))return{type:"bpmn:MessageFlow"};if(Fg(e,t))return{type:"bpmn:SequenceFlow"}}var i=Du(e,t);return i||($g(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Lg(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function _r(e,t){return ge(e)||Pu(e)?!0:b(t,"bpmn:Participant")&&!fe(t)?!1:b(e,"bpmn:Participant")?b(t,"bpmn:Process")||b(t,"bpmn:Collaboration"):le(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:b(e,"bpmn:Lane")?b(t,"bpmn:Participant")||b(t,"bpmn:Lane"):b(e,"bpmn:BoundaryEvent")&&!GP(e)?!1:b(e,"bpmn:FlowElement")&&!b(e,"bpmn:DataStoreReference")?b(t,"bpmn:FlowElementsContainer")?fe(t):le(t,["bpmn:Participant","bpmn:Lane"]):b(e,"bpmn:DataStoreReference")&&b(t,"bpmn:Collaboration")?jn(V(t).get("participants"),function(n){return!!n.get("processRef")}):le(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?le(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):b(e,"bpmn:MessageFlow")?b(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function GP(e){return V(e).cancelActivity&&(Dg(e)||Mg(e))}function KP(e){return!ge(e)&&b(e,"bpmn:BoundaryEvent")}function qP(e){return b(e,"bpmn:Lane")}function YP(e){return KP(e)||b(e,"bpmn:IntermediateThrowEvent")&&Dg(e)?!0:b(e,"bpmn:IntermediateCatchEvent")&&Mg(e)}function Dg(e){var t=V(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Mg(e){return Ng(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Ng(e,t){return t.some(function(n){return vn(e,n)})}function XP(e){return b(e,"bpmn:ReceiveTask")&&_e(e.incoming,function(t){return b(t.source,"bpmn:EventBasedGateway")})}function lo(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return ge(r)||!YP(r)||ht(t)||!b(t,"bpmn:Activity")||ys(t)||i&&!Cg(i,t)||XP(t)?!1:"attach"}function Og(e,t,n){if(!t)return!1;var i={replacements:[]};return A(e,function(r){ht(t)||b(r,"bpmn:StartEvent")&&r.type!=="label"&&_r(r,t)&&(z1(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(W1(r)||U1(r)||G1(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),Ng(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&b(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),b(t,"bpmn:Transaction")||vn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(b(r,"bpmn:EndEvent")&&_r(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),b(r,"bpmn:BoundaryEvent")&&lo(r,t,null,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),i.replacements.length?i:!1}function Ig(e,t){return jn(e,qP)?!1:t?e.every(function(n){return _r(n,t)}):!0}function ku(e,t,n,i){return t?ge(e)||Pu(e)?!0:$P(n,t)||n&&Au(n,t)?!1:_r(e,t)||_s(e,t):!1}function Bg(e,t){return b(e,"bpmn:SubProcess")?fe(e)&&(!t||t.width>=100&&t.height>=80):!!(b(e,"bpmn:Lane")||b(e,"bpmn:Participant")||Tu(e)||Pu(e))}function ZP(e,t){var n=Tu(e),i=Tu(t);return(n||i)&&n!==i}function Lg(e,t){return Au(t,e)||Au(e,t)?!1:ZP(e,t)?!0:!!Du(e,t)}function $g(e,t){return Ag(e,t)&&Tg(e)&&b(t,"bpmn:Activity")&&!QP(t,e)&&!ht(t)}function jg(e,t){return Vg(e)&&!Vg(t)?!1:FP(e)&&HP(t)&&!jP(e,t)}function Fg(e,t){return VP(e)&&zP(t)&&Ag(e,t)&&!(b(e,"bpmn:EventBasedGateway")&&!WP(t))}function Du(e,t){return le(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&le(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:le(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&le(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function _s(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:le(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(t)&&b(e,"bpmn:FlowNode")&&!b(e,"bpmn:BoundaryEvent")&&_r(e,t.parent)}function JP(e,t){return e&&t&&e.indexOf(t)!==-1}function Hg(e,t){return ge(t)?!0:!(b(t,"bpmn:Lane")&&!JP(e,t.parent))}function Vg(e){return lr(e,"bpmn:Process")||lr(e,"bpmn:Collaboration")}function QP(e,t){return e.attachers.includes(t)}const eA={__depends__:[yn],__init__:["bpmnRules"],bpmnRules:["type",st]};var tA=2e3;function zg(e,t){e.on("saveXML.start",tA,n);function n(){var i=t.getRootElements();A(i,function(r){var o=ye(r),a,s;a=Or([r],!1),a=ce(a,function(c){return c!==r&&!c.labelTarget}),s=ct(a,ye),o.set("planeElement",s)})}}zg.$inject=["eventBus","canvas"];const nA={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",zg]};function bs(e){F.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}bs.prototype.getOrdering=function(e,t){return null},Y(bs,F);function Mu(e,t){bs.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function i(a){if(a.labelTarget)return{level:10};var s=_e(n,function(c){return le(a,[c.type])});return s&&s.order||{level:1}}function r(a){var s=a.order;if(s||(a.order=s=i(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var l=s;l&&!le(l,c);)l=l.parent;if(!l)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return l}this.getOrdering=function(a,s){if(a.labelTarget||b(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=r(a);c.containers&&(s=o(a,s,c.containers));var l=s.children.indexOf(a),u=tf(s.children,function(p){return!a.labelTarget&&p.labelTarget?!1:c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:s}}}Mu.$inject=["eventBus","canvas"],Y(Mu,bs);const iA={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Mu]};function uo(){}uo.prototype.get=function(){return this._data},uo.prototype.set=function(e){this._data=e},uo.prototype.clear=function(){var e=this._data;return delete this._data,e},uo.prototype.isEmpty=function(){return!this._data};const rA={clipboard:["type",uo]};var oA="drop-ok",Wg="drop-not-ok",Ug="attach-ok",Gg="new-parent",Kg="create",aA=2e3;function qg(e,t,n,i,r){function o(c,l,u,p,d){if(!l)return!1;c=ce(c,function(C){var x=C.labelTarget;return!C.parent&&!(ge(C)&&c.indexOf(x)!==-1)});var h=_e(c,function(C){return!Ce(C)}),m=!1,y=!1,g=!1;Xg(c)&&(m=r.allowed("shape.attach",{position:u,shape:h,target:l})),m||(Xg(c)?g=r.allowed("shape.create",{position:u,shape:h,source:p,target:l}):g=r.allowed("elements.create",{elements:c,position:u,target:l}));var w=d.connectionTarget;return g||m?(h&&p&&(y=r.allowed("connection.create",{source:w===p?h:p,target:w===p?p:h,hints:{targetParent:l,targetAttach:m}})),{attach:m,connect:y}):g===null||m===null?null:!1}function a(c,l){[Ug,oA,Wg,Gg].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,d=l.source,h=l.hints||{};if(!p){l.canExecute=!1,l.target=null;return}Yg(c);var m={x:c.x,y:c.y},y=l.canExecute=p&&o(u,p,m,d,h);p&&y!==null&&(l.target=p,y&&y.attach?a(p,Ug):a(p,y?Gg:Wg))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&a(l,null)}),n.on("create.end",function(c){var l=c.context,u=l.source,p=l.shape,d=l.elements,h=l.target,m=l.canExecute,y=m&&m.attach,g=m&&m.connect,w=l.hints||{};if(m===!1||!h)return!1;Yg(c);var C={x:c.x,y:c.y};g?p=i.appendShape(u,p,C,h,{attach:y,connection:g===!0?{}:g,connectionTarget:w.connectionTarget}):(d=i.createElements(d,C,h,D({},w,{attach:y})),p=_e(d,function(x){return!Ce(x)})),D(l,{elements:d,shape:p}),D(c,{elements:d,shape:p})});function s(){var c=t.context();c&&c.prefix===Kg&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],aA,function(){n.off("elements.changed",s)})}),this.start=function(c,l,u){oe(l)||(l=[l]);var p=_e(l,function(m){return!Ce(m)});if(p){u=D({elements:l,hints:{},shape:p},u||{}),A(l,function(m){ee(m.x)||(m.x=0),ee(m.y)||(m.y=0)});var d=ce(l,function(m){return!m.hidden}),h=Ye(d);A(l,function(m){Ce(m)&&(m.waypoints=ct(m.waypoints,function(y){return{x:y.x-h.x-h.width/2,y:y.y-h.y-h.height/2}})),D(m,{x:m.x-h.x-h.width/2,y:m.y-h.y-h.height/2})}),t.init(c,Kg,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}qg.$inject=["canvas","dragging","eventBus","modeling","rules"];function Yg(e){var t=e.context,n=t.createConstraints;n&&(n.left&&(e.x=Math.max(e.x,n.left)),n.right&&(e.x=Math.min(e.x,n.right)),n.top&&(e.y=Math.max(e.y,n.top)),n.bottom&&(e.y=Math.min(e.y,n.bottom)))}function Xg(e){return e&&e.length===1&&!Ce(e[0])}var sA=750;function Zg(e,t,n,i,r){function o(a){var s=X("g");q(s,r.cls("djs-drag-group",["no-events"]));var c=X("g");return a.forEach(function(l){var u;l.hidden||(l.waypoints?(u=n._createContainer("connection",c),n.drawConnection(Ei(u),l)):(u=n._createContainer("shape",c),n.drawShape(Ei(u),l),at(u,l.x,l.y)),i.addDragger(l,s,u))}),s}t.on("create.move",sA,function(a){var s=a.hover,c=a.context,l=c.elements,u=c.dragGroup;u||(u=c.dragGroup=o(l));var p;s?(u.parentNode||(p=e.getActiveLayer(),ie(p,u)),at(u,a.x,a.y)):qe(u)}),t.on("create.cleanup",function(a){var s=a.context,c=s.dragGroup;c&&qe(c)})}Zg.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Es={__depends__:[kn,dr,yn,tn],__init__:["create","createPreview"],create:["type",qg],createPreview:["type",Zg]};function Nu(e){var t=this;this._lastMoveEvent=null;function n(i){t._lastMoveEvent=i}e.on("canvas.init",function(i){var r=t._svg=i.svg;r.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Nu.$inject=["eventBus"],Nu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||cA(0,0)};function cA(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}const po={__init__:["mouse"],mouse:["type",Nu]};function rn(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(c){var l=c.descriptor,u=c.element,p=c.elements;l.priority=1,l.id=u.id;var d=_e(p,function(h){return h===u.parent});d&&(l.parent=u.parent.id),lA(u)&&(l.priority=2,l.host=u.host.id),Ce(u)&&(l.priority=3,l.source=u.source.id,l.target=u.target.id,l.waypoints=uA(u)),ge(u)&&(l.priority=4,l.labelTarget=u.labelTarget.id),A(["x","y","width","height"],function(h){ee(u[h])&&(l[h]=u[h])}),l.hidden=u.hidden,l.collapsed=u.collapsed}),r.on("copyPaste.pasteElements",function(c){var l=c.hints;D(l,{createElementsBehavior:!1})})}rn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],rn.prototype.copy=function(e){var t,n;return oe(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?n={}:n=this.createTree(oe(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},rn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},rn.prototype._paste=function(e,t,n,i){A(e,function(o){ee(o.x)||(o.x=0),ee(o.y)||(o.y=0)});var r=Ye(e);return A(e,function(o){Ce(o)&&(o.waypoints=ct(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),D(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,D({},i))},rn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return A(e,function(o,a){o=cn(o,"priority"),A(o,function(s){var c=D({},ln(s,["priority"]));i[s.parent]?c.parent=i[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:c});var l;if(Ce(c)){c.source=i[s.source],c.target=i[s.target],l=i[s.id]=t.createConnection(c),r.push(l);return}if(ge(c)){c.labelTarget=i[c.labelTarget],l=i[s.id]=t.createLabel(c),r.push(l);return}c.host&&(c.host=i[c.host]),l=i[s.id]=t.createShape(c),r.push(l)})}),r},rn.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(ln(e,["id"]));return t},rn.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(ln(e,["id"]));return t},rn.prototype.createShape=function(e){var t=this._elementFactory.createShape(ln(e,["id"]));return t},rn.prototype.hasRelations=function(e,t){var n,i,r;return!(Ce(e)&&(i=_e(t,Jt({id:e.source.id})),r=_e(t,Jt({id:e.target.id})),!i||!r)||ge(e)&&(n=_e(t,Jt({id:e.labelTarget.id})),!n))},rn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=oa(e);function a(l,u){return t.allowed("element.copy",{element:l,elements:u})}function s(l,u){var p=_e(r,function(d){return l===d.element});if(!p){r.push({element:l,depth:u});return}p.depth<u&&(r=c(p,r),r.push({element:p.element,depth:u}))}function c(l,u){var p=u.indexOf(l);return p!==-1&&u.splice(p,1),u}return bi(o,function(l,u,p){if(ge(l))return;A(l.labels,function(m){s(m,p)});function d(m){m&&m.length&&A(m,function(y){A(y.labels,function(g){s(g,p)}),s(y,p)})}A([l.attachers,l.incoming,l.outgoing],d),s(l,p);var h=[];return l.children&&(h=l.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:l,children:h}),h}),e=ct(r,function(l){return l.element}),r=ct(r,function(l){return l.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),r=cn(r,function(l){return l.descriptor.priority}),e=ct(r,function(l){return l.element}),A(r,function(l){var u=l.depth;if(!n.hasRelations(l.element,e)){Qg(l.element,e);return}if(!a(l.element,e)){Qg(l.element,e);return}i[u]||(i[u]=[]),i[u].push(l.descriptor)}),i};function lA(e){return!!e.host}function uA(e){return ct(e.waypoints,function(t){return t=Jg(t),t.original&&(t.original=Jg(t.original)),t})}function Jg(e){return D({},e)}function Qg(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}const pA={__depends__:[rA,Es,po,yn],__init__:["copyPaste"],copyPaste:["type",rn]};function Ou(e,t,n){oe(n)||(n=[n]),A(n,function(i){yi(e[i])||(t[i]=e[i])})}var Iu=750;function ey(e,t,n){function i(c,l){var u=e.create(c.$type);return n.copyElement(c,u,null,l)}t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element,p=V(u);if(ge(u))return l;var d=l.businessObject=i(p,!0),h=l.di=i(ye(u),!0);h.bpmnElement=d,Ou(d,l,"name"),Ou(h,l,"isExpanded"),p.default&&(l.default=p.default.id)});var r="-bpmn-js-refs";function o(c){return c[r]=c[r]||{}}function a(c,l){c[r]=l}function s(c,l,u){var p=V(c);return c.default&&(u[c.default]={element:p,property:"default"}),c.host&&(V(c).attachedToRef=V(l[c.host])),ln(u,Tt(u,function(d,h,m){var y=h.element,g=h.property;return m===c.id&&(y.set(g,p),d.push(c.id)),d},[]))}t.on("copyPaste.pasteElement",function(c){var l=c.cache,u=c.descriptor,p=u.businessObject,d=u.di;if(ge(u)){u.businessObject=V(l[u.labelTarget]),u.di=ye(l[u.labelTarget]);return}p=u.businessObject=i(p),d=u.di=i(d),d.bpmnElement=p,Ou(u,p,["isExpanded","name"]),u.type=p.$type}),t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element;if(b(u,"bpmn:Participant")){var p=V(u);p.processRef&&(l.processRef=i(p.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var l=c.descriptor,u=l.processRef;u&&(l.processRef=i(u))}),t.on("copyPaste.pasteElement",Iu,function(c){var l=c.cache,u=c.descriptor;a(l,s(u,l,o(l)))})}ey.$inject=["bpmnFactory","eventBus","moddleCopy"];var fA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function fo(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(!(!r||!r.length))return cn(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=nt(r)&&r.$descriptor,a=i.propertyName;if(a&&fA.indexOf(a)!==-1||a&&o&&!_e(o.properties,Jt({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r=i.property;if(dA(r,"bpmn:ExtensionElements")&&(!r.values||!r.values.length))return!1})}fo.$inject=["eventBus","bpmnFactory","moddle"],fo.prototype.copyElement=function(e,t,n,i=!1){var r=this;n&&!oe(n)&&(n=[n]),n=n||Bu(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return o===!1||(oe(o)&&(n=o),A(n,function(a){var s;Et(e,a)&&(s=e.get(a));var c=r.copyProperty(s,t,a,i);if(tt(c)){var l=r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:a});l!==!1&&t.set(a,c)}})),t},fo.prototype.copyProperty=function(e,t,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(o!==!1){if(o)return nt(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference)return a.isId?e&&this._copyId(e,t,i):oe(e)?Tt(e,function(s,c){return o=r.copyProperty(c,t,n,i),o?s.concat(o):s},[]):nt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(o=r._bpmnFactory.create(e.$type),o.$parent=t,o=r.copyElement(e,o,null,i),o):e}},fo.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function Bu(e,t){return Tt(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}function dA(e,t){return e&&Ge(e.$instanceOf)&&e.$instanceOf(t)}const ty={__depends__:[pA],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ey],moddleCopy:["type",fo]};var ny=Math.round;function Lu(e,t){this._modeling=e,this._eventBus=t}Lu.$inject=["modeling","eventBus"],Lu.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,l=ny(s+o/2),u=ny(c+a/2),p=i.replaceShape(e,D({},t,{x:l,y:u,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:p,hints:n}),p};function iy(e,t){t.on("replace.end",500,function(n){const{newElement:i,hints:r={}}=n;r.select!==!1&&e.select(i)})}iy.$inject=["selection","eventBus"];const hA={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",iy],replace:["type",Lu]};function mA(e,t,n){oe(n)||(n=[n]),A(n,function(i){yi(e[i])||(t[i]=e[i])})}var gA=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function yA(e,t){var n=e&&Et(e,"collapsed")?e.collapsed:!fe(e),i;return t&&(Et(t,"collapsed")||Et(t,"isExpanded"))?i=Et(t,"collapsed")?t.collapsed:!t.isExpanded:i=n,n!==i}function ry(e,t,n,i,r,o){function a(s,c,l){l=l||{};var u=c.type,p=s.businessObject;if(xs(p)&&(u==="bpmn:SubProcess"||u==="bpmn:AdHocSubProcess")&&yA(s,c))return i.toggleCollapse(s),s;var d=e.create(u),h={type:u,businessObject:d};h.di={},u==="bpmn:ExclusiveGateway"&&(h.di.isMarkerVisible=!0),mA(s.di,h.di,["fill","stroke","background-color","border-color","color"]);var m=Bu(p.$descriptor),y=Bu(d.$descriptor,!0),g=vA(m,y);D(d,Qt(c,gA));var w=ce(g,function(E){return E==="eventDefinitions"?oy(s,c.eventDefinitionType):E==="loopCharacteristics"?!ht(d):Et(d,E)||E==="processRef"&&c.isExpanded===!1||E==="triggeredByEvent"?!1:E==="isForCompensation"?!ht(d):!0});if(d=n.copyElement(p,d,w),c.eventDefinitionType&&(oy(d,c.eventDefinitionType)||(h.eventDefinitionType=c.eventDefinitionType,h.eventDefinitionAttrs=c.eventDefinitionAttrs)),b(p,"bpmn:Activity")){if(xs(p))h.isExpanded=fe(s);else if(c&&Et(c,"isExpanded")){h.isExpanded=c.isExpanded;var C=t.getDefaultSize(d,{isExpanded:h.isExpanded});h.width=C.width,h.height=C.height,h.x=s.x-(h.width-s.width)/2,h.y=s.y-(h.height-s.height)/2}fe(s)&&!b(p,"bpmn:Task")&&h.isExpanded&&(h.width=s.width,h.height=s.height)}if(xs(p)&&!xs(d)&&(l.moveChildren=!1),b(p,"bpmn:Participant")){c.isExpanded===!0?d.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var x=Qe(s);ye(s).isHorizontal||(ye(h).isHorizontal=x),h.width=x?s.width:t.getDefaultSize(h).width,h.height=x?t.getDefaultSize(h).height:s.height}return o.allowed("shape.resize",{shape:d})||(h.height=t.getDefaultSize(h).height,h.width=t.getDefaultSize(h).width),d.name=p.name,le(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&le(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(d.default=p.default),c.host&&!b(p,"bpmn:BoundaryEvent")&&b(d,"bpmn:BoundaryEvent")&&(h.host=c.host),(h.type==="bpmn:DataStoreReference"||h.type==="bpmn:DataObjectReference")&&(h.x=s.x+(s.width-h.width)/2),r.replaceElement(s,h,{...l,targetElement:c})}this.replaceElement=a}ry.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function xs(e){return b(e,"bpmn:SubProcess")}function oy(e,t){var n=V(e);return t&&n.get("eventDefinitions").some(function(i){return b(i,t)})}function vA(e,t){return e.filter(function(n){return t.includes(n)})}const ay={__depends__:[ty,hA,tn],bpmnReplace:["type",ry]};var _A=250;function Oi(e){this._eventBus=e,this._tools=[],this._active=null}Oi.$inject=["eventBus"],Oi.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},Oi.prototype.isActive=function(e){return e&&this._active===e},Oi.prototype.length=function(e){return this._tools.length},Oi.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Oi.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(r){var o=r.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),A(t,function(r){i.push(r+".ended"),i.push(r+".canceled")}),n.on(i,_A,function(r){this._active&&(bA(r)||this.setActive(null))},this)};function bA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Ui(t,'.group[data-group="tools"]')}const ws={__depends__:[kn],__init__:["toolManager"],toolManager:["type",Oi]};function EA(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function xA(e,t){var n=[];return A(e.concat(t),function(i){var r=i.incoming,o=i.outgoing;A(r.concat(o),function(a){var s=a.source,c=a.target;(ho(e,s)||ho(e,c)||ho(t,s)||ho(t,c))&&(ho(n,a)||n.push(a))})}),n}function ho(e,t){return e.indexOf(t)!==-1}function wA(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var $u=Math.abs,SA=Math.round,Mn={x:"width",y:"height"},sy="crosshair",ii={n:"top",w:"left",s:"bottom",e:"right"},CA=1500,Ss={n:"s",w:"e",s:"n",e:"w"},Cs=20;function Ut(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",CA,function(c){var l=c.context,u=l.initialized;u||(u=l.initialized=s.init(c,l)),u&&ly(c)}),n.on("spaceTool.end",function(c){var l=c.context,u=l.axis,p=l.direction,d=l.movingShapes,h=l.resizingShapes,m=l.start;if(l.initialized){ly(c);var y={x:0,y:0};y[u]=SA(c["d"+u]),s.makeSpace(d,h,y,p,m),n.once("spaceTool.ended",function(g){s.activateSelection(g.originalEvent,!0,!0)})}})}Ut.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Ut.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:sy,data:{context:{reactivate:n}},trapClick:!1})},Ut.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:sy,data:{context:{}}})},Ut.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Ut.prototype.init=function(e,t){var n=$u(e.dx)>$u(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if($u(i)<5)return!1;i<0&&(i*=-1),Yr(e)&&(i*=-1);var o=EA(n,i),a=this._canvas.getRootElement();!Aa(e)&&e.hover&&(a=e.hover);var s=[...Or(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),u=RA(c,n,o,r,l);return D(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:r}),Na("resize-"+(n==="x"?"ew":"ns")),!0},Ut.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function l(d){o.includes(d)||o.push(d);var h=d.label;h&&!o.includes(h)&&o.push(h)}function u(d){a.includes(d)||a.push(d)}A(e,function(d){if(!(!d.parent||ge(d))){if(Ce(d)){c.push(d);return}var h=d[t],m=h+d[Mn[t]];if(TA(d)&&(n>0&&te(d)[t]>i||n<0&&te(d)[t]<i)){s.push(d);return}if(n>0&&h>i||n<0&&m<i){l(d);return}if(h<i&&m>i&&r.allowed("shape.resize",{shape:d})){u(d);return}}}),A(o,function(d){var h=d.attachers;h&&A(h,function(m){l(m)})});var p=o.concat(a);return A(s,function(d){var h=d.host;Ii(p,h)&&l(d)}),p=o.concat(a),A(c,function(d){var h=d.source,m=d.target,y=d.label;Ii(p,h)&&Ii(p,m)&&y&&l(y)}),{movingShapes:o,resizingShapes:a}},Ut.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Ut.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function cy(e){return{top:e.top-Cs,right:e.right+Cs,bottom:e.bottom+Cs,left:e.left-Cs}}function ly(e){var t=e.context,n=t.spaceToolConstraints;if(n){var i,r;ee(n.left)&&(i=Math.max(e.x,n.left),e.dx=e.dx+i-e.x,e.x=i),ee(n.right)&&(i=Math.min(e.x,n.right),e.dx=e.dx+i-e.x,e.x=i),ee(n.top)&&(r=Math.max(e.y,n.top),e.dy=e.dy+r-e.y,e.y=r),ee(n.bottom)&&(r=Math.min(e.y,n.bottom),e.dy=e.dy+r-e.y,e.y=r)}}function RA(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,l;return A(a,function(u){var p=u.attachers,d=u.children,h=Q(u),m=ce(d,function(O){return!Ce(O)&&!ge(O)&&!Ii(o,O)&&!Ii(a,O)}),y=ce(d,function(O){return!Ce(O)&&!ge(O)&&Ii(o,O)}),g,w,C,x=[],E=[],S,R,M,P;m.length&&(w=cy(Q(Ye(m))),g=i-h[ii[n]]+w[ii[n]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),y.length&&(C=cy(Q(Ye(y))),g=i-C[ii[Ss[n]]]+h[ii[Ss[n]]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),p&&p.length&&(p.forEach(function(O){Ii(o,O)?x.push(O):E.push(O)}),x.length&&(S=Q(Ye(x.map(te))),R=h[ii[Ss[n]]]-(S[ii[Ss[n]]]-i)),E.length&&(M=Q(Ye(E.map(te))),P=M[ii[n]]-(h[ii[n]]-i)),n==="n"?(g=Math.min(R||1/0,P||1/0),s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=Math.min(R||1/0,P||1/0),s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=Math.max(R||-1/0,P||-1/0),s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=Math.max(R||-1/0,P||-1/0),s.left=c=ee(c)?Math.max(c,g):g));var I=r&&r[u.id];I&&(n==="n"?(g=i+u[Mn[t]]-I[Mn[t]],s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=i+u[Mn[t]]-I[Mn[t]],s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=i-u[Mn[t]]+I[Mn[t]],s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=i-u[Mn[t]]+I[Mn[t]],s.left=c=ee(c)?Math.max(c,g):g))}),s}}function Ii(e,t){return e.indexOf(t)!==-1}function TA(e){return!!e.host}var ju="djs-dragging",uy="djs-resizing",PA=250,Rs=Math.max;function py(e,t,n,i,r){function o(a,s){A(a,function(c){r.addDragger(c,s),n.addMarker(c,ju)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,l={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},u=X("g");q(u,i.cls("djs-crosshair-group",["no-events"])),ie(s,u);var p=X("path");q(p,"d",l.x),me(p).add("djs-crosshair"),ie(u,p);var d=X("path");q(d,"d",l.y),me(d).add("djs-crosshair"),ie(u,d),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;at(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&qe(c)}),e.on("spaceTool.move",PA,function(a){var s=a.context,c=s.line,l=s.axis,u=s.movingShapes,p=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var d=n.getLayer("space");c=X("path"),q(c,"d","M0,0 L0,0"),me(c).add("djs-crosshair"),ie(d,c),s.line=c;var h=X("g");q(h,i.cls("djs-drag-group",["no-events"])),ie(n.getActiveLayer(),h),o(u,h);var m=s.movingConnections=t.filter(function(E){var S=!1;A(u,function(I){A(I.outgoing,function(O){E===O&&(S=!0)})});var R=!1;A(u,function(I){A(I.incoming,function(O){E===O&&(R=!0)})});var M=!1;A(p,function(I){A(I.outgoing,function(O){E===O&&(M=!0)})});var P=!1;return A(p,function(I){A(I.incoming,function(O){E===O&&(P=!0)})}),Ce(E)&&(S||M)&&(R||P)});o(m,h),s.dragGroup=h}if(!s.frameGroup){var y=X("g");q(y,i.cls("djs-frame-group",["no-events"])),ie(n.getActiveLayer(),y);var g=[];A(p,function(E){var S=r.addFrame(E,y),R=S.getBBox();g.push({element:S,initialBounds:R}),n.addMarker(E,uy)}),s.frameGroup=y,s.frames=g}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};q(c,{d:w[l]});var C={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[C[s.axis]]=0,at(s.dragGroup,x.x,x.y),A(s.frames,function(E){var S=E.element,R=E.initialBounds,M,P;s.direction==="e"?q(S,{width:Rs(R.width+x.x,5)}):(M=Rs(R.width-x.x,5),q(S,{width:M,x:R.x+R.width-M})),s.direction==="s"?q(S,{height:Rs(R.height+x.y,5)}):(P=Rs(R.height-x.y,5),q(S,{height:P,y:R.y+R.height-P}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,l=s.movingConnections,u=s.resizingShapes,p=s.line,d=s.dragGroup,h=s.frameGroup;A(c,function(m){n.removeMarker(m,ju)}),A(l,function(m){n.removeMarker(m,ju)}),d&&(qe(p),qe(d)),A(u,function(m){n.removeMarker(m,uy)}),h&&qe(h)})}py.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const AA={__init__:["spaceToolPreview"],__depends__:[kn,yn,ws,dr,po],spaceTool:["type",Ut],spaceToolPreview:["type",py]};function Ts(e,t){e.invoke(Ut,this),this._canvas=t}Ts.$inject=["injector","canvas"],Y(Ts,Ut),Ts.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],a=[];o&&(a=Yo(wf(r.children.filter(l=>b(l,"bpmn:Artifact")),Ye(o))));const s=[...e,...a];var c=Ut.prototype.calculateAdjustments.call(this,s,t,n,i);return c.resizingShapes=c.resizingShapes.filter(function(l){return!(b(l,"bpmn:TextAnnotation")||kA(l)&&(t==="y"&&Qe(l)||t==="x"&&!Qe(l)))}),c};function kA(e){return b(e,"bpmn:Participant")&&!V(e).processRef}const fy={__depends__:[AA],spaceTool:["type",Ts]};function Ne(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ne.$inject=["eventBus","injector"],Ne.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Ne.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Ne.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Ne.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ne.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ne.prototype.register=function(e,t){this._setHandler(e,t)},Ne.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Ne.prototype.canUndo=function(){return!!this._getUndoAction()},Ne.prototype.canRedo=function(){return!!this._getRedoAction()},Ne.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ne.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ne.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},Ne.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Ne.prototype._createId=function(){return this._uid++},Ne.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ne.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Ne.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Ne.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:nf("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ne.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=oe(e)?e:[e],t.dirty=t.dirty.concat(e))},Ne.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ne.prototype._revertedAction=function(e){this._stackIdx--},Ne.prototype._getHandler=function(e){return this._handlerMap[e]},Ne.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const DA={commandStack:["type",Ne]};function ri(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var MA=250,dy=1400;function Fu(e,t,n){F.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",dy,function(r){var o=r.context,a=o.shapes,s=o.validatedShapes;o.shapes=hy(a),o.validatedShapes=hy(s)}),i&&t.on("shape.move.start",MA,function(r){var o=r.context,a=o.shapes,s=[];A(a,function(c){A(c.labels,function(l){!l.hidden&&o.shapes.indexOf(l)===-1&&s.push(l),c.labelTarget&&s.push(c)})}),A(s,function(c){i.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",dy,function(r){var o=r.context,a=o.closure,s=a.enclosedElements,c=[];A(s,function(l){A(l.labels,function(u){s[u.id]||c.push(u)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context,a=o.connection||o.shape;ri(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=Ic(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(Xe(s.labels,a,c),a.labelTarget=s)})}Y(Fu,F),Fu.$inject=["injector","eventBus","modeling"];function hy(e){return ce(e,function(t){return e.indexOf(t.labelTarget)===-1})}const NA={__init__:["labelSupport"],labelSupport:["type",Fu]};var OA=251,my=1401,gy="attach-ok";function Hu(e,t,n,i,r){F.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",my,function(a){var s=a.context,c=s.shapes,l=s.validatedShapes;s.shapes=IA(c),s.validatedShapes=BA(l)}),o&&t.on("shape.move.start",OA,function(a){var s=a.context,c=s.shapes,l=Vu(c);A(l,function(u){o.makeDraggable(s,u,!0),A(u.labels,function(p){o.makeDraggable(s,p,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var l=c[0],u=l.host;u&&(n.addMarker(u,gy),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(u,gy)}))}}),this.preExecuted("elements.move",my,function(a){var s=a.context,c=s.closure,l=s.shapes,u=Vu(l);A(u,function(p){c.add(p,c.topLevel[p.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,l=s.newHost,u;l&&c.length!==1||(l?u=c:u=ce(c,function(p){var d=p.host;return LA(p)&&!$A(c,d)}),A(u,function(p){r.updateAttachment(p,l)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;A(s,function(c){A(c.attachers,function(l){A(l.outgoing.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)}),A(l.incoming.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,l=s.host;l&&r.updateAttachment(c,l)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,l=s.newShape;ri(c.attachers,function(u){var p=i.allowed("elements.move",{target:l,shapes:[u]});p==="attach"?r.updateAttachment(u,l):r.removeShape(u)}),l.attachers.length&&A(l.attachers,function(u){var p=cg(u,c,l);r.moveShape(u,p,u.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.oldBounds,u=s.newBounds,p=c.attachers,d=s.hints||{};d.attachSupport!==!1&&A(p,function(h){var m=cg(h,l,u);r.moveShape(h,m,h.parent),A(h.labels,function(y){r.moveShape(y,m,y.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;ri(s.attachers,function(c){r.removeShape(c)}),s.host&&r.updateAttachment(s,null)})}Y(Hu,F),Hu.$inject=["injector","eventBus","canvas","rules","modeling"];function Vu(e){return xc(ct(e,function(t){return t.attachers||[]}))}function IA(e){var t=Vu(e);return P0("id",e,t)}function BA(e){var t=Wi(e,"id");return ce(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function LA(e){return!!e.host}function $A(e,t){return e.indexOf(t)!==-1}const jA={__depends__:[yn],__init__:["attachSupport"],attachSupport:["type",Hu]};function Gt(e){this._model=e}Gt.$inject=["moddle"],Gt.prototype._needsId=function(e){return le(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Gt.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;b(e,"bpmn:Activity")?t="Activity":b(e,"bpmn:Event")?t="Event":b(e,"bpmn:Gateway")?t="Gateway":le(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Gt.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Gt.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Gt.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",D({bpmnElement:e,bounds:this.createDiBounds()},t))},Gt.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Gt.prototype.createDiWaypoints=function(e){var t=this;return ct(e,function(n){return t.createDiWaypoint(n)})},Gt.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Qt(e,["x","y"]))},Gt.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",D({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Gt.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",D({bpmnElement:e},t))};function Dt(e,t,n){F.call(this,e),this._bpmnFactory=t;var i=this;function r(h){var m=h.context,y=m.hints||{},g;!m.cropped&&y.createElementsBehavior!==!1&&(g=m.connection,g.waypoints=n.getCroppedWaypoints(g),m.cropped=!0)}this.executed(["connection.layout","connection.create"],r),this.reverted(["connection.layout"],function(h){delete h.context.cropped});function o(h){var m=h.context;i.updateParent(m.shape||m.connection,m.oldParent)}function a(h){var m=h.context,y=m.shape||m.connection,g=m.parent||m.newParent;i.updateParent(y,g)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Mt(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Mt(a));function s(h){var m=h.context,y=m.oldRoot,g=y.children;A(g,function(w){b(w,"bpmn:BaseElement")&&i.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(h){var m=h.context.shape;b(m,"bpmn:BaseElement")&&i.updateBounds(m)}this.executed(["shape.move","shape.create","shape.resize"],Mt(function(h){h.context.shape.type!=="label"&&c(h)})),this.reverted(["shape.move","shape.create","shape.resize"],Mt(function(h){h.context.shape.type!=="label"&&c(h)})),e.on("shape.changed",function(h){h.element.type==="label"&&c({context:{shape:h.element}})});function l(h){i.updateConnection(h.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Mt(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Mt(l));function u(h){i.updateConnectionWaypoints(h.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Mt(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Mt(u)),this.executed("connection.reconnect",Mt(function(h){var m=h.context,y=m.connection,g=m.oldSource,w=m.newSource,C=V(y),x=V(g),E=V(w);C.conditionExpression&&!le(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=C.conditionExpression,delete C.conditionExpression),g!==w&&x.default===C&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",Mt(function(h){var m=h.context,y=m.connection,g=m.oldSource,w=m.newSource,C=V(y),x=V(g),E=V(w);m.oldConditionExpression&&(C.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete E.default)}));function p(h){i.updateAttachment(h.context)}this.executed(["element.updateAttachment"],Mt(p)),this.reverted(["element.updateAttachment"],Mt(p)),this.executed("element.updateLabel",Mt(d)),this.reverted("element.updateLabel",Mt(d));function d(h){const{element:m}=h.context,y=en(m),g=ye(m),w=g&&g.get("label");Ci(m)||Ta(m)||(y&&!w?g.set("label",t.create("bpmndi:BPMNLabel")):!y&&w&&g.set("label",void 0))}}Y(Dt,F),Dt.$inject=["eventBus","bpmnFactory","connectionDocking"],Dt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Dt.prototype.updateParent=function(e,t){if(!ge(e)&&!(b(e,"bpmn:DataStoreReference")&&e.parent&&b(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=ye(e),o=n&&n.businessObject,a=ye(n);b(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),b(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),b(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(i,o),b(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Dt.prototype.updateBounds=function(e){var t=ye(e),n=HA(e);if(n){var i=nn(n,t.get("bounds"));D(n,{x:e.x+i.x,y:e.y+i.y})}var r=ge(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),D(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Dt.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var i,r;b(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),je(i,e)),b(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),Xe(r,e))}},Dt.prototype.updateDiConnection=function(e,t,n){var i=ye(e),r=ye(t),o=ye(n);i.sourceElement&&i.sourceElement.bpmnElement!==V(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==V(n)&&(i.targetElement=n&&o)},Dt.prototype.updateDiParent=function(e,t){if(t&&!b(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(je(n,e),e.$parent=null)}};function FA(e){for(;e&&!b(e,"bpmn:Definitions");)e=e.$parent;return e}Dt.prototype.getLaneSet=function(e){var t,n;return b(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(b(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)},Dt.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&!((b(e,"bpmn:DataInput")||b(e,"bpmn:DataOutput"))&&(b(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(b(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(b(e,"bpmn:FlowElement")){if(t){if(b(t,"bpmn:Participant"))t=t.processRef;else if(b(t,"bpmn:Lane"))do t=t.$parent.$parent;while(b(t,"bpmn:Lane"))}i="flowElements"}else if(b(e,"bpmn:Artifact")){for(;t&&!b(t,"bpmn:Process")&&!b(t,"bpmn:SubProcess")&&!b(t,"bpmn:Collaboration");)if(b(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;i="artifacts"}else if(b(e,"bpmn:MessageFlow"))i="messageFlows";else if(b(e,"bpmn:Participant")){i="participants";var r=e.processRef,o;r&&(o=FA(e.$parent||t),e.$parent&&(je(o.get("rootElements"),r),r.$parent=null),t&&(Xe(o.get("rootElements"),r),r.$parent=o))}else b(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":b(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(i),je(a,e)),t?(a=t.get(i),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(i);je(a,e),t&&(s||(s=[],t.set(i,s)),s.push(e))}}},Dt.prototype.updateConnectionWaypoints=function(e){var t=ye(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Dt.prototype.updateConnection=function(e){var t=e.connection,n=V(t),i=t.source,r=V(i),o=t.target,a=V(t.target),s;if(b(n,"bpmn:DataAssociation"))b(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=r,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):b(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||r,this.updateSemanticParent(n,r,s),n.targetRef=a);else{var c=b(n,"bpmn:SequenceFlow");n.sourceRef!==r&&(c&&(je(n.sourceRef&&n.sourceRef.get("outgoing"),n),r&&r.get("outgoing")&&r.get("outgoing").push(n)),n.sourceRef=r),n.targetRef!==a&&(c&&(je(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,i,o)},Dt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function Mt(e){return function(t){var n=t.context,i=n.shape||n.connection||n.element;b(i,"bpmn:BaseElement")&&e(t)}}function HA(e){if(b(e,"bpmn:Activity")){var t=ye(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function oi(e,t){wn.call(this),this._bpmnFactory=e,this._moddle=t}Y(oi,wn),oi.$inject=["bpmnFactory","moddle"],oi.prototype._baseCreate=wn.prototype.create,oi.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,D({type:"label",di:n},Wr,t))}return this.createElement(e,t)},oi.prototype.createElement=function(e,t){t=D({},t||{});var n,i=t.businessObject,r=t.di;if(!i){if(!t.type)throw new Error("no shape type specified");i=this._bpmnFactory.create(t.type),_d(i)}if(!zA(r)){var o=D({},r||{},{id:i.id+"_di"});e==="root"?r=this._bpmnFactory.createDiPlane(i,o):e==="connection"?r=this._bpmnFactory.createDiEdge(i,o):r=this._bpmnFactory.createDiShape(i,o)}b(i,"bpmn:Group")&&(t=D({isFrame:!0},t)),t=VA(i,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=zu(r,t,"isExpanded")),le(i,["bpmn:Lane","bpmn:Participant"])&&(t=zu(r,t,"isHorizontal")),b(i,"bpmn:SubProcess")&&(t.collapsed=!fe(i,r)),b(i,"bpmn:ExclusiveGateway")&&(Et(r,"isMarkerVisible")?r.isMarkerVisible===void 0&&(r.isMarkerVisible=!1):r.isMarkerVisible=!0),tt(t.triggeredByEvent)&&(i.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),tt(t.cancelActivity)&&(i.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=i.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=i,i.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(i,r),t=D({id:i.id},n,t,{businessObject:i,di:r}),this._baseCreate(e,t)},oi.prototype.getDefaultSize=function(e,t){var n=V(e);if(t=t||ye(e),b(n,"bpmn:SubProcess"))return fe(n,t)?{width:350,height:200}:{width:100,height:80};if(b(n,"bpmn:Task"))return{width:100,height:80};if(b(n,"bpmn:Gateway"))return{width:50,height:50};if(b(n,"bpmn:Event"))return{width:36,height:36};if(b(n,"bpmn:Participant")){var i=t.isHorizontal===void 0||t.isHorizontal===!0;return fe(n,t)?i?{width:600,height:250}:{width:250,height:600}:i?{width:400,height:60}:{width:60,height:400}}return b(n,"bpmn:Lane")?{width:400,height:100}:b(n,"bpmn:DataObjectReference")?{width:36,height:50}:b(n,"bpmn:DataStoreReference")?{width:50,height:50}:b(n,"bpmn:TextAnnotation")?{width:100,height:30}:b(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},oi.prototype.createParticipantShape=function(e){return nt(e)||(e={isExpanded:e}),e=D({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function VA(e,t,n){return A(n,function(i){t=zu(e,t,i)}),t}function zu(e,t,n){return t[n]===void 0?t:(e[n]=t[n],ln(t,[n]))}function zA(e){return le(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Ps(e,t){this._modeling=e,this._canvas=t}Ps.$inject=["modeling","canvas"],Ps.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;A(n,function(r){var o={x:0,y:0};tt(i.left)?o.x=i.left-r.x:tt(i.right)?o.x=i.right-r.width-r.x:tt(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:tt(i.top)?o.y=i.top-r.y:tt(i.bottom)?o.y=i.bottom-r.height-r.y:tt(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},Ps.prototype.postExecute=function(e){};function As(e){this._modeling=e}As.$inject=["modeling"],As.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},As.prototype.postExecute=function(e){var t=e.hints||{};WA(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function WA(e,t){return jn(e.outgoing,function(n){return n.target===t})}function ks(e,t){this._canvas=e,this._layouter=t}ks.$inject=["canvas","layouter"],ks.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},ks.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Ds=Math.round;function Wu(e){this._modeling=e}Wu.$inject=["modeling"],Wu.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;A(t,function(p){ee(p.x)||(p.x=0),ee(p.y)||(p.y=0)});var s=ce(t,function(p){return!p.hidden}),c=Ye(s);A(t,function(p){Ce(p)&&(p.waypoints=ct(p.waypoints,function(d){return{x:Ds(d.x-c.x-c.width/2+r.x),y:Ds(d.y-c.y-c.height/2+r.y)}})),D(p,{x:Ds(p.x-c.x-c.width/2+r.x),y:Ds(p.y-c.y-c.height/2+r.y)})});var l=oa(t),u={};A(t,function(p){if(Ce(p)){u[p.id]=ee(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);return}var d=D({},o);l.indexOf(p)===-1&&(d.autoResize=!1),ge(p)&&(d=ln(d,["attach"])),u[p.id]=ee(i)?a.createShape(p,Qt(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Qt(p,["x","y","width","height"]),p.parent||n,d)}),e.elements=Yo(u)};var yy=Math.round;function ai(e){this._canvas=e}ai.$inject=["canvas"],ai.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?D(t,n):D(t,{x:n.x-yy(t.width/2),y:n.y-yy(t.height/2)}),this._canvas.addShape(t,i,r),t},ai.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function mo(e){ai.call(this,e)}Y(mo,ai),mo.$inject=["canvas"];var UA=ai.prototype.execute;mo.prototype.execute=function(e){var t=e.shape;return KA(t),t.labelTarget=e.labelTarget,UA.call(this,e)};var GA=ai.prototype.revert;mo.prototype.revert=function(e){return e.shape.labelTarget=null,GA.call(this,e)};function KA(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function go(e,t){this._canvas=e,this._modeling=t}go.$inject=["canvas","modeling"],go.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;ri(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ri(n.outgoing,function(i){t.removeConnection(i,{nested:!0})})},go.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ic(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},go.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Xe(n.children,t,i),this._canvas.addConnection(t,n),t};function Uu(e,t){this._modeling=e,this._elementRegistry=t}Uu.$inject=["modeling","elementRegistry"],Uu.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;A(i,function(r){n.get(r.id)&&(r.waypoints?t.removeConnection(r):t.removeShape(r))})};function yo(e,t){this._canvas=e,this._modeling=t}yo.$inject=["canvas","modeling"],yo.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;ri(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ri(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),ri(n.children,function(i){Ce(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},yo.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Ic(i.children,n),t.removeShape(n),n},yo.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return Xe(i.children,n,r),t.addShape(n,i),n};function Ms(e){this._modeling=e}Ms.$inject=["modeling"];var vy={x:"y",y:"x"};Ms.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,w){g.range.min=Math.min(w[i],g.range.min),g.range.max=Math.max(w[i]+w[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}function l(g,w){var C={y:0};C[i]=g-a(w),C[i]&&(C[vy[i]]=0,t.moveElements([w],C,w.parent))}var u=n[0],p=s(n),d=n[p],h,m,y=0;A(n,function(g,w){var C,x,E;if(g.elements.length<2){w&&w!==n.length-1&&(o(g,g.elements[0]),y+=c(g.range));return}C=cn(g.elements,i),x=C[0],w===p&&(x=C[s(C)]),E=a(x),g.range=null,A(C,function(S){if(l(E,S),g.range===null){g.range={min:S[i],max:S[i]+S[r]};return}o(g,S)}),w&&w!==n.length-1&&(y+=c(g.range))}),m=Math.abs(d.range.min-u.range.max),h=Math.round((m-y)/(n.length-1)),!(h<n.length-1)&&A(n,function(g,w){var C={},x;g===u||g===d||(x=n[w-1],g.range.max=0,A(g.elements,function(E,S){C[vy[i]]=0,C[i]=x.range.max-E[i]+h,g.range.min!==E[i]&&(C[i]+=E[i]-g.range.min),C[i]&&t.moveElements([E],C,E.parent),g.range.max=Math.max(E[i]+E[r],S?g.range.max:0)}))})},Ms.prototype.postExecute=function(e){};function Ns(e,t){this._layouter=e,this._canvas=t}Ns.$inject=["layouter","canvas"],Ns.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return D(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Ns.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Gu(){}Gu.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=je(o.children,t),Xe(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},Gu.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return je(n.children,t),Xe(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t};function Ku(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Ku.prototype.add=function(e,t){return this.addAll([e],t)},Ku.prototype.addAll=function(e,t){var n=vx(e,!!t,this);return D(this,n),this};function vo(e){this._modeling=e}vo.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},vo.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,l=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),A(a,function(p){o.moveShape(p,t,l[p.id]&&!u&&n,{recurse:!1,layout:!1})}),A(s,function(p){var d=!!a[p.source.id],h=!!a[p.target.id];c[p.id]&&d&&h?o.moveConnection(p,t,l[p.id]&&!u&&n):o.layoutConnection(p,{connectionStart:d&&ou(p,p.source,t),connectionEnd:h&&au(p,p.target,t)})})},vo.prototype.getClosure=function(e){return new Ku().addAll(e,!0)};function Os(e){this._helper=new vo(e)}Os.$inject=["modeling"],Os.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Os.prototype.postExecute=function(e){var t=e.hints,n;t&&t.primaryShape&&(n=t.primaryShape,t.oldParent=n.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,n)};function Bi(e){this._modeling=e,this._helper=new vo(e)}Bi.$inject=["modeling"],Bi.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=Qt(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=je(o.children,t),Xe(i.children,t,r),D(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Bi.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&(A(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:au(o,t,n)})}),A(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:ou(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},Bi.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return Xe(n.children,t,i),D(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Bi.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Bi.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function _o(e){this._modeling=e}_o.$inject=["modeling"],_o.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return oe(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},_o.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!i||o.docking==="source")&&(a.connectionStart=a.connectionStart||_y(oe(r)?r[0]:r)),i&&(!n||o.docking==="target")&&(a.connectionEnd=a.connectionEnd||_y(oe(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},_o.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r};function _y(e){return e.original||e}function Nn(e,t){this._modeling=e,this._rules=t}Nn.$inject=["modeling","rules"],Nn.prototype.preExecute=function(e){var t=this,n=this._modeling,i=this._rules,r=e.oldShape,o=e.newData,a=e.hints||{},s;function c(m,y,g){return i.allowed("connection.reconnect",{connection:g,source:m,target:y})}var l={x:o.x,y:o.y},u={x:r.x,y:r.y,width:r.width,height:r.height};s=e.newShape=e.newShape||t.createShape(o,l,r.parent,a),r.host&&n.updateAttachment(s,r.host);var p;a.moveChildren!==!1&&(p=r.children.slice(),n.moveElements(p,{x:0,y:0},s,a));var d=r.incoming.slice(),h=r.outgoing.slice();A(d,function(m){var y=m.source,g=c(y,s,m);g&&t.reconnectEnd(m,s,fs(m,s,u),a)}),A(h,function(m){var y=m.target,g=c(s,y,m);g&&t.reconnectStart(m,s,ps(m,s,u),a)})},Nn.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Nn.prototype.execute=function(e){},Nn.prototype.revert=function(e){},Nn.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Nn.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Nn.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)};function bo(e){this._modeling=e}bo.$inject=["modeling"],bo.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},bo.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds,r=e.hints||{};r.layout!==!1&&(A(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:fs(o,n,i)})}),A(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:ps(o,n,i)})}))},bo.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function si(e){this._modeling=e}si.$inject=["modeling"],si.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),A(r,function(s){a[s.id]=YA(s)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(xA(i,r),t,n,o,i,r,a)},si.prototype.execute=function(){},si.prototype.revert=function(){},si.prototype.moveShapes=function(e,t){var n=this;A(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},si.prototype.resizeShapes=function(e,t,n){var i=this;A(e,function(r){var o=wA(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},si.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);A(e,function(l){var u=l.source,p=l.target,d=qA(l),h=Ey(n),m={};ci(c,u)&&ci(c,p)?(d=ct(d,function(y){return xy(y,i,n)&&(y[h]=y[h]+t[h]),y.original&&xy(y.original,i,n)&&(y.original[h]=y.original[h]+t[h]),y}),s._modeling.updateWaypoints(l,d,{labelBehavior:!1})):(ci(c,u)||ci(c,p))&&(ci(r,u)?m.connectionStart=ou(l,u,t):ci(r,p)?m.connectionEnd=au(l,p,t):ci(o,u)?m.connectionStart=ps(l,u,a[u.id]):ci(o,p)&&(m.connectionEnd=fs(l,p,a[p.id])),s._modeling.layoutConnection(l,m))})};function by(e){return D({},e)}function qA(e){return ct(e.waypoints,function(t){return t=by(t),t.original&&(t.original=by(t.original)),t})}function Ey(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function xy(e,t,n){var i=Ey(n);if(/e|s/.test(n))return e[i]>t;if(/n|w/.test(n))return e[i]<t}function ci(e,t){return e.indexOf(t)!==-1}function YA(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function Is(e){this._modeling=e}Is.$inject=["modeling"],Is.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=wy(n),t.collapsed=!t.collapsed;var i=Sy(n,t.collapsed);return[t].concat(i)},Is.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=t.children,r=Cy(i,n);return t.collapsed=!t.collapsed,[t].concat(r)};function wy(e){var t={};return A(e,function(n){t[n.id]=n.hidden,n.children&&(t=D({},t,wy(n.children)))}),t}function Sy(e,t){var n=[];return A(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(Sy(i.children,i.collapsed||t)))}),n}function Cy(e,t){var n=[];return A(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(Cy(i.children,t)))}),n}function Bs(e){this._modeling=e}Bs.$inject=["modeling"],Bs.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Ry(i,t),Ty(n,t),t.host=n,t},Bs.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Ry(n,t),Ty(i,t,r),t};function Ry(e,t){return je(e&&e.attachers,t)}function Ty(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),Xe(i,t,n)}}function qu(){}qu.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},qu.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function Re(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}Re.$inject=["eventBus","elementFactory","commandStack"],Re.prototype.getHandlers=function(){return{"shape.append":As,"shape.create":ai,"shape.delete":yo,"shape.move":Bi,"shape.resize":bo,"shape.replace":Nn,"shape.toggleCollapse":Is,spaceTool:si,"label.create":mo,"connection.create":ks,"connection.delete":go,"connection.move":Gu,"connection.layout":Ns,"connection.updateWaypoints":qu,"connection.reconnect":_o,"elements.create":Wu,"elements.move":Os,"elements.delete":Uu,"elements.distribute":Ms,"elements.align":Ps,"element.updateAttachment":Bs}},Re.prototype.registerHandlers=function(e){A(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Re.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Re.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Re.prototype.moveElements=function(e,t,n,i){i=i||{};var r=i.attach,o=n,a;r===!0?(a=n,o=n.parent):r===!1&&(a=null);var s={shapes:e,delta:t,newParent:o,newHost:a,hints:i};this._commandStack.execute("elements.move",s)},Re.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Re.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Re.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0),i=this._create("connection",i);var a={source:e,target:t,parent:r,parentIndex:n,connection:i,hints:o};return this._commandStack.execute("connection.create",a),a.connection},Re.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(r=i,i=void 0),r=r||{};var o=r.attach,a,s;e=this._create("shape",e),o?(a=n.parent,s=n):a=n;var c={position:t,shape:e,parent:a,parentIndex:i,host:s,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Re.prototype.createElements=function(e,t,n,i,r){oe(e)||(e=[e]),typeof i!="number"&&(r=i,i=void 0),r=r||{};var o={position:t,elements:e,parent:n,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements},Re.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Re.prototype.appendShape=function(e,t,n,i,r){r=r||{},t=this._create("shape",t);var o={source:e,position:n,target:i,shape:t,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Re.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Re.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Re.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Re.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Re.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Re.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Re.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Re.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Re.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Re.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Re.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,D(i,{docking:"source"}))},Re.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,D(i,{docking:"target"}))},Re.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Re.prototype._create=function(e,t){return Zx(t)?t:this._elementFactory.create(e,t)},Re.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function Eo(e){this._elementRegistry=e}Eo.$inject=["elementRegistry"],Eo.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||XA(n,qo(i));return Py(n,i),e.oldProperties=o,e.changed=r,r},Eo.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Py(n,t),i},Eo.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return b(e,"bpmn:DataObject")?ZA(e,t):[]};function XA(e,t){return Tt(t,function(n,i){return n[i]=e.get(i),n},{})}function Py(e,t){A(t,function(n,i){e.set(i,n)})}function ZA(e,t){return t.filter(function(n){return b(n,"bpmn:DataObjectReference")&&V(n).dataObjectRef===e})}var xo="default",On="id",Ay="di",JA={width:0,height:0};function wo(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}wo.$inject=["elementRegistry","moddle","modeling","textRenderer"],wo.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var i=this._elementRegistry,r=this._moddle.ids,o=t.businessObject,a=ik(e.properties),s=e.oldProperties||QA(t,a);return ky(a,o)&&(r.unclaim(o[On]),i.updateId(t,a[On]),r.claim(a[On],o)),xo in a&&(a[xo]&&n.push(i.get(a[xo].id)),o[xo]&&n.push(i.get(o[xo].id))),Dy(t,a),e.oldProperties=s,e.changed=n,n},wo.prototype.postExecute=function(e){var t=e.element,n=t.label,i=n&&V(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,JA)}},wo.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Dy(t,i),ky(n,r)&&(a.unclaim(n[On]),o.updateId(t,i[On]),a.claim(i[On],r)),e.changed};function ky(e,t){return On in e&&e[On]!==t[On]}function QA(e,t){var n=qo(t),i=e.businessObject,r=ye(e);return Tt(n,function(o,a){return a!==Ay?o[a]=i.get(a):o[a]=ek(r,qo(t.di)),o},{})}function ek(e,t){return Tt(t,function(n,i){return n[i]=e&&e.get(i),n},{})}function Dy(e,t){var n=e.businessObject,i=ye(e);A(t,function(r,o){o!==Ay?n.set(o,r):i&&tk(i,r)})}function tk(e,t){A(t,function(n,i){e.set(i,n)})}var nk=["default"];function ik(e){var t=D({},e);return nk.forEach(function(n){n in e&&(t[n]=V(t[n]))}),t}function Ls(e,t){this._canvas=e,this._modeling=t}Ls.$inject=["canvas","modeling"],Ls.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=ye(r);return t.setRootElement(n),t.removeRootElement(r),Xe(a.rootElements,i),i.$parent=a,je(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Ls.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=ye(n);return t.setRootElement(r),t.removeRootElement(n),je(a.rootElements,i),i.$parent=null,Xe(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]};function Yu(e,t){this._modeling=e,this._spaceTool=t}Yu.$inject=["modeling","spaceTool"],Yu.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=Wt(i),a=o===i,s=a?i:i.parent,c=ei(s),l=Qe(i);if(l?r==="left"?r="top":r==="right"&&(r="bottom"):r==="top"?r="left":r==="bottom"&&(r="right"),!c.length){var u=l?{x:i.x+zt,y:i.y,width:i.width-zt,height:i.height}:{x:i.x,y:i.y+zt,width:i.width,height:i.height-zt};n.createShape({type:"bpmn:Lane",isHorizontal:l},u,s)}var p=[];bi(o,function(E){return p.push(E),E.label&&p.push(E.label),E===i?[]:ce(E.children,function(S){return S!==i})});var d,h,m,y,g;r==="top"?(d=-120,h=i.y,m=h+10,y="n",g="y"):r==="left"?(d=-120,h=i.x,m=h+10,y="w",g="x"):r==="bottom"?(d=120,h=i.y+i.height,m=h-10,y="s",g="y"):r==="right"&&(d=120,h=i.x+i.width,m=h-10,y="e",g="x");var w=t.calculateAdjustments(p,g,d,m),C=l?{x:0,y:d}:{x:d,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,C,y,m);var x=l?{x:i.x+(a?zt:0),y:h-(r==="top"?120:0),width:i.width-(a?zt:0),height:120}:{x:h-(r==="left"?120:0),y:i.y+(a?zt:0),width:120,height:i.height-(a?zt:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:l},x,s)};function Xu(e){this._modeling=e}Xu.$inject=["modeling"],Xu.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=ei(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var a=Qe(n),s=a?n.height:n.width,c=Math.round(s/i),l,u,p,d;for(d=0;d<i;d++)d===i-1?l=s-c*d:l=c,u=a?{x:n.x+zt,y:n.y+d*c,width:n.width-zt,height:l}:{x:n.x+d*c,y:n.y+zt,width:l,height:n.height-zt},d<o?t.resizeShape(r[d],u):(p={type:"bpmn:Lane",isHorizontal:a},t.createShape(p,u,n))};function So(e,t){this._modeling=e,this._spaceTool=t}So.$inject=["modeling","spaceTool"],So.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,i=e.balanced;i!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},So.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=DT(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},So.prototype.resizeSpace=function(e,t){var n=this._spaceTool,i=Q(e),r=Q(t),o=Vm(r,i),a=Wt(e),s=[],c=[];bi(a,function(m){return s.push(m),(b(m,"bpmn:Lane")||b(m,"bpmn:Participant"))&&c.push(m),m.children});var l,u,p,d,h;(o.bottom||o.top)&&(l=o.bottom||o.top,u=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),p=o.bottom?"s":"n",d=o.top>0||o.bottom<0?-l:l,h=n.calculateAdjustments(s,"y",d,u),n.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:l},p)),(o.left||o.right)&&(l=o.right||o.left,u=e.x+(o.right?e.width:0)+(o.right?-10:100),p=o.right?"e":"w",d=o.left>0||o.right<0?-l:l,h=n.calculateAdjustments(c,"x",d,u),n.makeSpace(h.movingShapes,h.resizingShapes,{x:l,y:0},p))};var Co="flowNodeRef",Zu="lanes";function Ro(e){this._elementRegistry=e}Ro.$inject=["elementRegistry"],Ro.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(u,p){var d=Q(p),h={x:u.x+u.width/2,y:u.y+u.height/2};return h.x>d.left&&h.x<d.right&&h.y>d.top&&h.y<d.bottom}function s(u){n.indexOf(u)===-1&&(o.push(u),n.push(u))}function c(u){var p=Wt(u);return r[p.id]||(r[p.id]=ss(p)),r[p.id]}function l(u){if(!u.parent)return[];var p=c(u);return p.filter(function(d){return a(u,d)}).map(function(d){return d.businessObject})}return t.forEach(function(u){var p=Wt(u);if(!(!p||n.indexOf(p)!==-1)){var d=p.children.filter(function(h){return b(h,"bpmn:FlowNode")});d.forEach(s),n.push(p)}}),e.forEach(s),o.forEach(function(u){var p=u.businessObject,d=p.get(Zu),h=d.slice(),m=l(u);i.push({flowNode:p,remove:h,add:m})}),t.forEach(function(u){var p=u.businessObject;u.parent||p.get(Co).forEach(function(d){i.push({flowNode:d,remove:[p],add:[]})})}),i},Ro.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.remove.forEach(function(o){je(r,o),je(o.get(Co),i)}),n.add.forEach(function(o){Xe(r,o),Xe(o.get(Co),i)})}),[]},Ro.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.add.forEach(function(o){je(r,o),je(o.get(Co),i)}),n.remove.forEach(function(o){Xe(r,o),Xe(o.get(Co),i)})}),[]};function $s(e){this._moddle=e}$s.$inject=["moddle"],$s.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.claim(n,i):t.unclaim(n),[]},$s.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.unclaim(n):t.claim(n,i),[]};var rk={fill:void 0,stroke:void 0};function Ju(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Rt(t)){var n=ok(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}Ju.$inject=["commandStack"],Ju.prototype.postExecute=function(e){var t=e.elements,n=e.colors||rk,i=this,r={};"fill"in n&&D(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&D(r,{"border-color":this._normalizeColor(n.stroke)}),A(t,function(o){var a=Ce(o)?Qt(r,["border-color"]):r,s=ye(o);if(ak(a),ge(o))i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:r["border-color"]}});else{if(!le(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};function ok(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}function ak(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var sk={width:0,height:0};function My(e,t,n){function i(c,l){var u=c.label||c,p=c.labelTarget||c;return Z1(u,l),[u,p]}function r(c){var l=c.element,u=l.businessObject,p=c.newLabel;if(!ge(l)&&Ci(l)&&!_a(l)&&!Ny(p)){var d=7,h=el(l);h={x:h.x,y:h.y+d},e.createLabel(l,h,{id:u.id+"_label",businessObject:u,di:l.di})}}function o(c){return c.oldLabel=en(c.element),i(c.element,c.newLabel)}function a(c){return i(c.element,c.oldLabel)}function s(c){var l=c.element,u=l.label||l,p=c.newLabel,d=c.newBounds,h=c.hints||{};if(!(!ge(u)&&!b(u,"bpmn:TextAnnotation"))){if(ge(u)&&Ny(p)){h.removeShape!==!1&&e.removeShape(u,{unsetLabel:!1});return}var m=en(l);typeof d>"u"&&(d=t.getExternalLabelBounds(u,m)),d&&e.resizeShape(u,d,sk)}}this.preExecute=r,this.execute=o,this.revert=a,this.postExecute=s}My.$inject=["modeling","textRenderer","bpmnFactory"];function Ny(e){return!e||!e.trim()}function mt(e,t,n,i){Re.call(this,e,t,n),this._bpmnRules=i}Y(mt,Re),mt.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],mt.prototype.getHandlers=function(){var e=Re.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Eo,e["element.updateProperties"]=wo,e["canvas.updateRoot"]=Ls,e["lane.add"]=Yu,e["lane.resize"]=So,e["lane.split"]=Xu,e["lane.updateRefs"]=Ro,e["id.updateClaim"]=$s,e["element.setColor"]=Ju,e["element.updateLabel"]=My,e},mt.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},mt.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,i)},mt.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},mt.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},mt.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},mt.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},mt.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},mt.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},mt.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},mt.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},mt.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},mt.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},mt.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Oy(){}Oy.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||te(t.source||e.source),t.connectionEnd||te(t.target||e.target)]};var js=20,ck=5,Fs=Math.round,Iy=20,lk={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function uk(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function pk(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function By(e,t,n){var i=pt(t,e,ck),r=n.split(":")[0],o=Fs((t.x-e.x)/2+e.x),a=Fs((t.y-e.y)/2+e.y),s,c,l=pk(r,i),u=/h|r|l/.test(r),p=!1,d=!1;return l?(s=u?{x:o,y:e.y}:{x:e.x,y:a},c=u?"h:h":"v:v"):(p=uk(i,r),c=u?"h:v":"v:h",p?u?(d=a===e.y,s={x:e.x+js*(/l/.test(r)?-1:1),y:d?a+js:a}):(d=o===e.x,s={x:d?o+js:o,y:e.y+js*(/t/.test(r)?-1:1)}):s={x:o,y:a}),{waypoints:Qu(e,s,c).concat(s),directions:c,turnNextDirections:d}}function fk(e,t,n){return By(e,t,n)}function dk(e,t,n){var i=By(t,e,Ly(n));return{waypoints:i.waypoints.slice().reverse(),directions:Ly(i.directions),turnNextDirections:i.turnNextDirections}}function hk(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var r=n+":"+i,o=Qu(e.waypoints[e.waypoints.length-1],t.waypoints[0],r);return{waypoints:o,directions:r}}function Ly(e){return e.split(":").reverse().join(":")}function mk(e,t,n){var i=Fs((t.x-e.x)/2+e.x),r=Fs((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(n==="v:v")return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Qu(e,t,n){if(n=n||"h:h",!Sk(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(jy(n)){var i=fk(e,t,n),r=dk(e,t,n),o=hk(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return mk(e,t,n)}function gk(e,t,n){var i=Qu(e,t,n);return i.unshift(e),i.push(t),Hy(i)}function yk(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=R0(o,"straight")[0]||"h:h",s=lk[a]||0,c=pt(e,t,s),l=wk(c,a);n=n||te(e),i=i||te(t);var u=l.split(":"),p=Fy(n,e,u[0],Ck(c)),d=Fy(i,t,u[1],c);return gk(p,d,l)}function vk(e,t,n,i,r,o){oe(n)&&(r=n,o=i,n=te(e),i=te(t)),o=D({preferredLayouts:[]},o),r=r||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&bk(e,t,n,i,o),c||(c=o.connectionEnd&&xk(t,e,i,r),c)||(c=o.connectionStart&&Ek(e,t,n,r),c)?c:!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:yk(e,t,n,i,o)}function _k(e,t,n){return e>=t&&e<=n}function $y(e,t,n){var i={x:"width",y:"height"};return _k(t[e],n[e],n[e]+n[i[e]])}function bk(e,t,n,i,r){var o={},a,s;return s=pt(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),r.preserveDocking==="target"?$y(a,i,e)?(o[a]=i[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:i.x,y:i.y}]):null:$y(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y,original:{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y}}]):null):null}function Ek(e,t,n,i){return ep(e,t,n,i)}function xk(e,t,n,i){var r=i.slice().reverse();return r=ep(e,t,n,r),r?r.reverse():null}function ep(e,t,n,i){function r(u){return u.length<3?!0:u.length>4?!1:!!_e(u,function(p,d){var h=u[d-1];return h&&Br(p,h)<3})}function o(u,p,d){var h=En(p,u);switch(h){case"v":return{x:d.x,y:u.y};case"h":return{x:u.x,y:d.y}}return{x:u.x,y:u.y}}function a(u,p,d){var h;for(h=u.length-2;h!==0;h--)if(Rf(u[h],p,Iy)||Rf(u[h],d,Iy))return u.slice(h);return u}if(r(i))return null;var s=i[0],c=i.slice(),l;return c[0]=n,c[1]=o(c[1],s,n),l=a(c,e,t),l!==c&&(c=ep(e,t,n,l)),c&&En(c)?null:c}function wk(e,t){if(jy(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function Sk(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function jy(e){return e&&/t|r|b|l/.test(e)}function Ck(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function Fy(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Hy(e){return e.reduce(function(t,n,i){var r=t[t.length-1],o=e[i+1];return Bc(r,o,n,0)||t.push(n),t},[])}var Rk=-10,Tk=40,Pk={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},Ak={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},tp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},To={top:"t",right:"r",bottom:"b",left:"l"};function Hs(e){this._elementRegistry=e}Y(Hs,Oy),Hs.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,i=t.target||e.target,r=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,l;if(o||(o=Vy(r&&r[0],n)),a||(a=Vy(r&&r[r.length-1],i)),(b(e,"bpmn:Association")||b(e,"bpmn:DataAssociation"))&&r&&!zy(n,i))return[].concat([o],r.slice(1,-1),[a]);var u=Xh(n,s)?Pk:Ak;return b(e,"bpmn:MessageFlow")?c=Dk(n,i,u):(b(e,"bpmn:SequenceFlow")||zy(n,i))&&(n===i?c={preferredLayouts:Lk(n,e,u)}:b(n,"bpmn:BoundaryEvent")?c={preferredLayouts:$k(n,i,a,u)}:Po(n)||Po(i)?c={preferredLayouts:u.subProcess,preserveDocking:Nk(n)}:b(n,"bpmn:Gateway")?c={preferredLayouts:u.fromGateway}:b(i,"bpmn:Gateway")?c={preferredLayouts:u.toGateway}:c={preferredLayouts:u.default}),c&&(c=D(c,t),l=Hy(vk(n,i,o,a,r,c))),l||[o,a]};function kk(e){var t=e.host;return pt(te(e),t,Rk)}function Dk(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:Mk(e,t)}}function Mk(e,t){return b(t,"bpmn:Participant")?"source":b(e,"bpmn:Participant")?"target":Po(t)?"source":Po(e)||b(t,"bpmn:Event")?"target":b(e,"bpmn:Event")?"source":null}function Nk(e){return Po(e)?"target":"source"}function Vy(e,t){return e?e.original||e:te(t)}function zy(e,t){return b(t,"bpmn:Activity")&&b(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Po(e){return b(e,"bpmn:SubProcess")&&fe(e)}function Li(e,t){return e===t}function Ok(e,t){return t.indexOf(e)!==-1}function br(e){var t=/right|left/.exec(e);return t&&t[0]}function Er(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Wy(e,t){return tp[e]===t}function Ik(e,t){var n=br(e),i=tp[n];return t.indexOf(i)!==-1}function Bk(e,t){var n=Er(e),i=tp[n];return t.indexOf(i)!==-1}function Uy(e){return e==="right"||e==="left"}function Lk(e,t,n){var i=t.waypoints,r=i&&i.length&&pt(i[0],e);return r==="top"?n.loop.fromTop:r==="right"?n.loop.fromRight:r==="left"?n.loop.fromLeft:n.loop.fromBottom}function $k(e,t,n,i){var r=te(e),o=te(t),a=kk(e),s,c,l=Li(e.host,t),u=Ok(a,["top","right","bottom","left"]),p=pt(o,r,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?jk(a,u,e,t,n,i):(s=Fk(a,p,u,i.isHorizontal),c=Hk(a,p,u,i.isHorizontal),[s+":"+c])}function jk(e,t,n,i,r,o){var a=t?e:o.isHorizontal?Er(e):br(e),s=To[a],c;return t?Uy(e)?c=Gy("y",n,i,r)?"h":o.boundaryLoop.alternateHorizontalSide:c=Gy("x",n,i,r)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function Gy(e,t,n,i){var r=Tk;return!(np(e,i,n,r)||np(e,i,{x:n.x+n.width,y:n.y+n.height},r)||np(e,i,te(t),r))}function np(e,t,n,i){return Math.abs(t[e]-n[e])<i}function Fk(e,t,n,i){if(n)return To[e];var r=Er(e),o=br(e),a=Er(t),s=br(t);if(i){if(Li(r,a)||Wy(o,s))return To[r]}else if(Li(o,s)||Wy(r,a))return To[o];return To[i?o:r]}function Hk(e,t,n,i){return n?Uy(e)?Ik(e,t)||Li(e,t)?"h":"v":Bk(e,t)||Li(e,t)?"v":"h":i?Li(Er(e),Er(t))?"h":"v":Li(br(e),br(t))?"v":"h"}Hs.$inject=["elementRegistry"];function Ky(e){return D({original:e.point.original||e.point},e.actual)}function li(e,t){this._elementRegistry=e,this._graphicsFactory=t}li.$inject=["elementRegistry","graphicsFactory"],li.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(Ky(i)),o.push(Ky(r)),o},li.prototype.getDockingPoint=function(e,t,n){var i=e.waypoints,r,o,a;return r=n?0:i.length-1,o=i[r],a=this._getIntersection(t,e,n),{point:o,actual:a||o,idx:r}},li.prototype._getIntersection=function(e,t,n){var i=this._getShapePath(e),r=this._getConnectionPath(t);return Fc(i,r,n)},li.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},li.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},li.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const qy={__init__:["modeling","bpmnUpdater"],__depends__:[BP,eA,nA,iA,ay,DA,NA,jA,tn,nl,fy],bpmnFactory:["type",Gt],bpmnUpdater:["type",Dt],elementFactory:["type",oi],modeling:["type",mt],layouter:["type",Hs],connectionDocking:["type",li]},Yy=Math.round;function Vs(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}Vs.prototype.create=function(e,t,n){const i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,l=o.createShape(D({type:t},n)),u=a.fire("autoPlace",{source:e,shape:l});if(!u)return;D(l,{x:u.x-Yy(l.width/2),y:u.y-Yy(l.height/2)});const p=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}});let d=null;p&&(d=o.createConnection(p),d.waypoints=s.layoutConnection(d,{source:e,target:l}),d.waypoints=r.getCroppedWaypoints(d,e,l)),i.create({created:[l,d].filter(h=>!Dr(h))})},Vs.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Vs.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const Vk={__depends__:[Rl,pT,qy],__init__:["appendPreview"],appendPreview:["type",Vs]};var Xy=Math.min,Zy=Math.max;function ip(e){e.preventDefault()}function Ao(e){e.stopPropagation()}function zk(e){return e.nodeType===Node.TEXT_NODE}function Wk(e){return[].slice.call(e)}function on(e){this.container=e.container,this.parent=Pe('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Se("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=xt(this.autoResize,this),this.handlePaste=xt(this.handlePaste,this)}on.prototype.create=function(e,t,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},t=this.style=t||{};var c=Qt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);D(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Qt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return D(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&D(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),a.innerText=n,ae.bind(a,"keydown",this.keyHandler),ae.bind(a,"mousedown",Ao),ae.bind(a,"paste",r.handlePaste),i.autoResize&&ae.bind(a,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},on.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var i;if(e.clipboardData?i=e.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),t.autoResize){var r=this.autoResize(n);r&&this.resizeHandler(r)}},on.prototype.insertText=function(e){e=Uk(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},on.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,i=t.endContainer,r=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=Wk(a.childNodes),c,l;if(zk(a)){var u=n.textContent;n.textContent=u.substring(0,r)+e+u.substring(o),c=n,l=r+e.length}else if(n===this.content&&i===this.content){var p=document.createTextNode(e);this.content.insertBefore(p,s[r]),c=p,l=p.textContent.length}else{var d=s.indexOf(n),h=s.indexOf(i);s.forEach(function(m,y){y===d?m.textContent=n.textContent.substring(0,r)+e+i.textContent.substring(o):y>d&&y<=h&&un(m)}),c=n,l=r+e.length}c&&l!==void 0&&setTimeout(function(){self.setSelection(c,l)})},on.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},on.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=Pe('<div class="djs-direct-editing-resize-handle"></div>');var s,c,l,u,p=function(m){ip(m),Ao(m),s=m.clientX,c=m.clientY;var y=t.getBoundingClientRect();l=y.width,u=y.height,ae.bind(document,"mousemove",d),ae.bind(document,"mouseup",h)},d=function(m){ip(m),Ao(m);var y=Xy(Zy(l+m.clientX-s,i),o),g=Xy(Zy(u+m.clientY-c,r),a);t.style.width=y+"px",t.style.height=g+"px",e.resizeHandler({width:l,height:u,dx:m.clientX-s,dy:m.clientY-c})},h=function(m){ip(m),Ao(m),ae.unbind(document,"mousemove",d,!1),ae.unbind(document,"mouseup",h,!1)};ae.bind(n,"mousedown",p)}D(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},on.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ae.unbind(t,"keydown",this.keyHandler),ae.unbind(t,"mousedown",Ao),ae.unbind(t,"input",this.autoResize),ae.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),un(n)),un(e)},on.prototype.getValue=function(){return this.content.innerText.trim()},on.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},on.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)};function Uk(e){return e.replace(/\r\n|\r|\n/g,`
213
+ `)}function Kt(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new on({container:t.getContainer(),keyHandler:xt(this._handleKey,this),resizeHandler:xt(this._handleResize,this)})}Kt.$inject=["eventBus","canvas"],Kt.prototype.registerProvider=function(e){this._providers.push(e)},Kt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},Kt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Kt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Kt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},Kt.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=e.context.text;(r!==o||i.height!==n.height||i.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Kt.prototype.getValue=function(){return this._textbox.getValue()},Kt.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()},Kt.prototype._handleResize=function(e){this._fire("resize",e)},Kt.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=_e(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const Jy={__depends__:[Da],__init__:["directEditing"],directEditing:["type",Kt]};function Gk(e){return function(t){var n=t.target,i=V(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===fe(e);return!o||!a||!s||!c}}var Kk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],qk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Yk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Xk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Zk=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Jk=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Qk=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],Qy=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],eD=Qy,ev=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],tD=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],nD=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],iD=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],rD=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],oD=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],aD=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],sD={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};const tv={"start-event-non-interrupting":`
214
214
  <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
215
215
  <g transform="translate(0 995.64)">
216
216
  <path d="m1899 28.357c21.545 567.43-598.38 1023.5-1133.6 835.92-548.09-147.21-801.57-873.95-463.59-1330 302.62-480.3 1071.7-507.54 1407.6-49.847 122.14 153.12 190.07 348.07 189.59 543.91z" fill="none" stroke="currentColor" stroke-dasharray="418.310422, 361.2328165" stroke-linecap="round" stroke-width="100"/>
@@ -221,7 +221,7 @@
221
221
  <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/>
222
222
  <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/>
223
223
  </g>
224
- </svg>`};function qt(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}qt.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],qt.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},qt.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,i=[],r,o=[];if(oe(e)||!n.allowed("shape.replace",{element:e}))return{};var a=Kk(e);return b(t,"bpmn:DataObjectReference")?this._createEntries(e,nD):b(t,"bpmn:DataStoreReference")&&!b(e.parent,"bpmn:Collaboration")?this._createEntries(e,iD):(b(t,"bpmn:Event")&&!b(t,"bpmn:BoundaryEvent")&&(r=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,i=cD[r]||[],!ht(t.$parent)&&b(t.$parent,"bpmn:SubProcess")&&(i=ce(i,function(c){return c.target.type!=="bpmn:StartEvent"}))),b(t,"bpmn:StartEvent")&&!b(t.$parent,"bpmn:SubProcess")?(o=ce(qk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:Participant")?(o=ce(sD,function(c){return fe(e)!==c.target.isExpanded}),this._createEntries(e,o)):b(t,"bpmn:StartEvent")&&ht(t.$parent)?(o=ce(oD.concat(i),function(c){var l=c.target,u=l.isInterrupting!==!1,p=t.isInterrupting===u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):b(t,"bpmn:StartEvent")&&!ht(t.$parent)&&b(t.$parent,"bpmn:SubProcess")?(o=ce(Yk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:EndEvent")?(o=ce(Zk.concat(i),function(c){var l=c.target;return l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!b(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):b(t,"bpmn:BoundaryEvent")?(o=ce(rD,function(c){var l=c.target;if(l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!b(t.attachedToRef,"bpmn:Transaction"))return!1;var u=l.cancelActivity!==!1,p=t.cancelActivity==u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):b(t,"bpmn:IntermediateCatchEvent")||b(t,"bpmn:IntermediateThrowEvent")?(o=ce(Xk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:Gateway")?(o=ce(Jk,a),this._createEntries(e,o)):b(t,"bpmn:Transaction")?(o=ce(Qv,a),this._createEntries(e,o)):ht(t)&&fe(e)?(o=ce(tD,a),this._createEntries(e,o)):b(t,"bpmn:AdHocSubProcess")&&fe(e)?(o=ce(eD,a),this._createEntries(e,o)):b(t,"bpmn:SubProcess")&&fe(e)?(o=ce(Qk,a),this._createEntries(e,o)):b(t,"bpmn:SubProcess")&&!fe(e)?(o=ce(ey,function(c){var l=c.target.type===e.type,u=c.target.isExpanded===!0;return l===u}),this._createEntries(e,o)):b(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,aD):b(t,"bpmn:FlowNode")?(o=ce(ey,a),this._createEntries(e,o)):{})},qt.prototype.getPopupMenuHeaderEntries=function(e){var t={};return b(e,"bpmn:Activity")&&!ht(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),b(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),b(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),dg(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},qt.prototype._createEntries=function(e,t){var n={},i=this;return A(t,function(r){n[r.actionName]=i._createEntry(r,e)}),n},qt.prototype._createSequenceFlowEntries=function(e,t){var n=H(e),i={},r=this._modeling,o=this._moddle,a=this;return A(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(b(n.sourceRef,"bpmn:ExclusiveGateway")||b(n.sourceRef,"bpmn:InclusiveGateway")||b(n.sourceRef,"bpmn:ComplexGateway")||b(n.sourceRef,"bpmn:Activity"))&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&b(n.sourceRef,"bpmn:Activity")&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:c})})});break;default:b(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(b(n.sourceRef,"bpmn:ExclusiveGateway")||b(n.sourceRef,"bpmn:InclusiveGateway")||b(n.sourceRef,"bpmn:ComplexGateway")||b(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},qt.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=function(){return r(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:i(a),className:e.className,action:n}},qt.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(l,u){if(u.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var p=e.businessObject.get("loopCharacteristics");p&&b(p,u.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,p,{isSequential:u.options.isSequential}):(p=t._moddle.create(u.options.loopCharacteristics,{isSequential:u.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:p}))}var r=H(e),o=r.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},qt.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};function r(a,s){t._modeling.updateModdleProperties(e,i,{isCollection:!s.active})}var o=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:r}}},qt.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate;function r(a,s){var c=s.active,l;c||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!o,action:r}}},qt.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=H(e),i=this,r=hg(e),o=b(e,"bpmn:BoundaryEvent")?ty["intermediate-event-non-interrupting"]:ty["start-event-non-interrupting"],a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const lD={__depends__:[xl,av,Rl],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",qt]};function ko(e,t,n,i,r,o,a,s,c,l,u,p,f){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=l,this._rules=u,this._translate=p,this._eventBus=n,this._appendPreview=f,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(d){var m=d.context,v=m.shape;if(!(!Yr(d)||!i.isOpen(v))){var g=i.getEntries(v);g.replace&&g.replace.action.click(d,v)}}),n.on("contextPad.close",function(){f.cleanUp()})}ko.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],ko.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&D(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(i,r){t.removeElements(r.slice())}}}}),n},ko.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return oe(t)?yi(e,n=>t.includes(n)):t},ko.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,l=this._appendPreview,u={};if(e.type==="label")return this._isDeleteAllowed([e])&&D(u,m()),u;var p=e.businessObject;function f(x,E){r.start(x,E)}function d(x,E){n.removeElements([E])}function m(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:d}}}}function v(x){var E=5,S=t.getPad(x).html,R=S.getBoundingClientRect(),N={x:R.left,y:R.bottom+E};return N}function g(x,E,S,R){function N(I,L){var B=i.createShape(D({type:x},R));o.start(I,B,{source:L})}var P=s?function(I,L){var B=i.createShape(D({type:x},R));s.append(L,B)}:N,O=s?function(I,L){return l.create(L,x,R),()=>{l.cleanUp()}}:null;return{group:"model",className:E,title:S,action:{dragstart:N,click:P,hover:O}}}function w(x){return function(E,S){n.splitLane(S,x),t.open(S,!0)}}if(le(p,["bpmn:Lane","bpmn:Participant"])&&fe(e)){var C=Qn(e);D(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(x,E){n.addLane(E,"top")}}}}),C.length<2&&((Ze(e)?e.height>=120:e.width>=120)&&D(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Ze(e)?e.height>=180:e.width>=180)&&D(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),D(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(x,E){n.addLane(E,"bottom")}}}})}return b(p,"bpmn:FlowNode")&&(b(p,"bpmn:EventBasedGateway")?D(u,{"append.receive-task":g("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):ny(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?D(u,{"append.compensation-activity":g("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!b(p,"bpmn:EndEvent")&&!p.isForCompensation&&!ny(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!ht(p)&&D(u,{"append.end-event":g("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":g("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":g("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":g("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||D(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(x,E){var S=D(v(E),{cursor:{x:x.x,y:x.y}});a.open(E,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),b(p,"bpmn:SequenceFlow")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),le(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:f,dragstart:f}}}),b(p,"bpmn:TextAnnotation")&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:f,dragstart:f}}}),le(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:f,dragstart:f}}}),b(p,"bpmn:Group")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&D(u,m()),u};function ny(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return A(o,function(a){a.$type===n&&(r=!0)}),i&&r}const uD={__depends__:[zk,Jv,uh,en,Ll,Es,lD],__init__:["contextPadProvider"],contextPadProvider:["type",ko]};var pD={horizontal:["x","width"],vertical:["y","height"]},iy=5;function In(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var i=t.allowed("elements.distribute",{elements:n});return oe(i)?i:i?n:[]})}In.$inject=["modeling","rules"],In.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},In.prototype.trigger=function(e,t){var n=this._modeling,i,r;if(!(e.length<3)&&(this._setOrientation(t),r=this._filterElements(e),i=this._createGroups(r),!(i.length<=2)))return n.distributeElements(i,this._axis,this._dimension),i},In.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(A(t,function(o){r=o(r,n,i)}),r):e},In.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=cn(e,i);return A(o,function(a,s){var c=n._findRange(a,i,r),l,u=t[t.length-1];u&&n._hasIntersection(u.range,c)?t[t.length-1].elements.push(a):(l={range:c,elements:[a]},t.push(l))}),t},In.prototype._setOrientation=function(e){var t=pD[e];this._axis=t[0],this._dimension=t[1]},In.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},In.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+iy,max:t+n-iy}};const fD={__init__:["distributeElements"],distributeElements:["type",In]};function zs(e){Ht.call(this,e)}zs.$inject=["eventBus"],Y(zs,Ht),zs.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=ce(t,function(n){var i=le(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}),t=oa(t),t.length<3?!1:t})};var ry={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
224
+ </svg>`};function qt(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}qt.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],qt.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},qt.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,i=[],r,o=[];if(oe(e)||!n.allowed("shape.replace",{element:e}))return{};var a=Gk(e);return b(t,"bpmn:DataObjectReference")?this._createEntries(e,tD):b(t,"bpmn:DataStoreReference")&&!b(e.parent,"bpmn:Collaboration")?this._createEntries(e,nD):(b(t,"bpmn:Event")&&!b(t,"bpmn:BoundaryEvent")&&(r=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,i=sD[r]||[],!ht(t.$parent)&&b(t.$parent,"bpmn:SubProcess")&&(i=ce(i,function(c){return c.target.type!=="bpmn:StartEvent"}))),b(t,"bpmn:StartEvent")&&!b(t.$parent,"bpmn:SubProcess")?(o=ce(Kk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:Participant")?(o=ce(aD,function(c){return fe(e)!==c.target.isExpanded}),this._createEntries(e,o)):b(t,"bpmn:StartEvent")&&ht(t.$parent)?(o=ce(rD.concat(i),function(c){var l=c.target,u=l.isInterrupting!==!1,p=t.isInterrupting===u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):b(t,"bpmn:StartEvent")&&!ht(t.$parent)&&b(t.$parent,"bpmn:SubProcess")?(o=ce(qk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:EndEvent")?(o=ce(Xk.concat(i),function(c){var l=c.target;return l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!b(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):b(t,"bpmn:BoundaryEvent")?(o=ce(iD,function(c){var l=c.target;if(l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!b(t.attachedToRef,"bpmn:Transaction"))return!1;var u=l.cancelActivity!==!1,p=t.cancelActivity==u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):b(t,"bpmn:IntermediateCatchEvent")||b(t,"bpmn:IntermediateThrowEvent")?(o=ce(Yk.concat(i),a),this._createEntries(e,o)):b(t,"bpmn:Gateway")?(o=ce(Zk,a),this._createEntries(e,o)):b(t,"bpmn:Transaction")?(o=ce(Qy,a),this._createEntries(e,o)):ht(t)&&fe(e)?(o=ce(eD,a),this._createEntries(e,o)):b(t,"bpmn:AdHocSubProcess")&&fe(e)?(o=ce(Qk,a),this._createEntries(e,o)):b(t,"bpmn:SubProcess")&&fe(e)?(o=ce(Jk,a),this._createEntries(e,o)):b(t,"bpmn:SubProcess")&&!fe(e)?(o=ce(ev,function(c){var l=c.target.type===e.type,u=c.target.isExpanded===!0;return l===u}),this._createEntries(e,o)):b(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,oD):b(t,"bpmn:FlowNode")?(o=ce(ev,a),this._createEntries(e,o)):{})},qt.prototype.getPopupMenuHeaderEntries=function(e){var t={};return b(e,"bpmn:Activity")&&!ht(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),b(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),b(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),dg(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},qt.prototype._createEntries=function(e,t){var n={},i=this;return A(t,function(r){n[r.actionName]=i._createEntry(r,e)}),n},qt.prototype._createSequenceFlowEntries=function(e,t){var n=V(e),i={},r=this._modeling,o=this._moddle,a=this;return A(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(b(n.sourceRef,"bpmn:ExclusiveGateway")||b(n.sourceRef,"bpmn:InclusiveGateway")||b(n.sourceRef,"bpmn:ComplexGateway")||b(n.sourceRef,"bpmn:Activity"))&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&b(n.sourceRef,"bpmn:Activity")&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:c})})});break;default:b(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(b(n.sourceRef,"bpmn:ExclusiveGateway")||b(n.sourceRef,"bpmn:InclusiveGateway")||b(n.sourceRef,"bpmn:ComplexGateway")||b(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},qt.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=function(){return r(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:i(a),className:e.className,action:n}},qt.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(l,u){if(u.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var p=e.businessObject.get("loopCharacteristics");p&&b(p,u.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,p,{isSequential:u.options.isSequential}):(p=t._moddle.create(u.options.loopCharacteristics,{isSequential:u.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:p}))}var r=V(e),o=r.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},qt.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};function r(a,s){t._modeling.updateModdleProperties(e,i,{isCollection:!s.active})}var o=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:r}}},qt.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate;function r(a,s){var c=s.active,l;c||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!o,action:r}}},qt.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=V(e),i=this,r=hg(e),o=b(e,"bpmn:BoundaryEvent")?tv["intermediate-event-non-interrupting"]:tv["start-event-non-interrupting"],a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const cD={__depends__:[xl,ay,Rl],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",qt]};function ko(e,t,n,i,r,o,a,s,c,l,u,p,d){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=l,this._rules=u,this._translate=p,this._eventBus=n,this._appendPreview=d,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(h){var m=h.context,y=m.shape;if(!(!Yr(h)||!i.isOpen(y))){var g=i.getEntries(y);g.replace&&g.replace.action.click(h,y)}}),n.on("contextPad.close",function(){d.cleanUp()})}ko.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],ko.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&D(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(i,r){t.removeElements(r.slice())}}}}),n},ko.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return oe(t)?vi(e,n=>t.includes(n)):t},ko.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,l=this._appendPreview,u={};if(e.type==="label")return this._isDeleteAllowed([e])&&D(u,m()),u;var p=e.businessObject;function d(x,E){r.start(x,E)}function h(x,E){n.removeElements([E])}function m(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:h}}}}function y(x){var E=5,S=t.getPad(x).html,R=S.getBoundingClientRect(),M={x:R.left,y:R.bottom+E};return M}function g(x,E,S,R){function M(O,B){var L=i.createShape(D({type:x},R));o.start(O,L,{source:B})}var P=s?function(O,B){var L=i.createShape(D({type:x},R));s.append(B,L)}:M,I=s?function(O,B){return l.create(B,x,R),()=>{l.cleanUp()}}:null;return{group:"model",className:E,title:S,action:{dragstart:M,click:P,hover:I}}}function w(x){return function(E,S){n.splitLane(S,x),t.open(S,!0)}}if(le(p,["bpmn:Lane","bpmn:Participant"])&&fe(e)){var C=ei(e);D(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(x,E){n.addLane(E,"top")}}}}),C.length<2&&((Qe(e)?e.height>=120:e.width>=120)&&D(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Qe(e)?e.height>=180:e.width>=180)&&D(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),D(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(x,E){n.addLane(E,"bottom")}}}})}return b(p,"bpmn:FlowNode")&&(b(p,"bpmn:EventBasedGateway")?D(u,{"append.receive-task":g("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):nv(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?D(u,{"append.compensation-activity":g("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!b(p,"bpmn:EndEvent")&&!p.isForCompensation&&!nv(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!ht(p)&&D(u,{"append.end-event":g("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":g("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":g("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":g("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||D(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(x,E){var S=D(y(E),{cursor:{x:x.x,y:x.y}});a.open(E,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),b(p,"bpmn:SequenceFlow")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),le(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:d,dragstart:d}}}),b(p,"bpmn:TextAnnotation")&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:d,dragstart:d}}}),le(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:d,dragstart:d}}}),b(p,"bpmn:Group")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&D(u,m()),u};function nv(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return A(o,function(a){a.$type===n&&(r=!0)}),i&&r}const lD={__depends__:[Vk,Jy,uh,tn,Ll,Es,cD],__init__:["contextPadProvider"],contextPadProvider:["type",ko]};var uD={horizontal:["x","width"],vertical:["y","height"]},iv=5;function In(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var i=t.allowed("elements.distribute",{elements:n});return oe(i)?i:i?n:[]})}In.$inject=["modeling","rules"],In.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},In.prototype.trigger=function(e,t){var n=this._modeling,i,r;if(!(e.length<3)&&(this._setOrientation(t),r=this._filterElements(e),i=this._createGroups(r),!(i.length<=2)))return n.distributeElements(i,this._axis,this._dimension),i},In.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(A(t,function(o){r=o(r,n,i)}),r):e},In.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=cn(e,i);return A(o,function(a,s){var c=n._findRange(a,i,r),l,u=t[t.length-1];u&&n._hasIntersection(u.range,c)?t[t.length-1].elements.push(a):(l={range:c,elements:[a]},t.push(l))}),t},In.prototype._setOrientation=function(e){var t=uD[e];this._axis=t[0],this._dimension=t[1]},In.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},In.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+iv,max:t+n-iv}};const pD={__init__:["distributeElements"],distributeElements:["type",In]};function zs(e){Ht.call(this,e)}zs.$inject=["eventBus"],Y(zs,Ht),zs.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=ce(t,function(n){var i=le(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}),t=oa(t),t.length<3?!1:t})};var rv={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
225
225
  <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
226
226
  <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
227
227
  <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
@@ -229,7 +229,7 @@
229
229
  <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
230
230
  <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
231
231
  <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
232
- </svg>`},dD=900;function Do(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",dD,this)}Do.$inject=["popupMenu","distributeElements","translate","rules"],Do.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},Do.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Do.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:ry.horizontal,action:function(o,a){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:ry.vertical,action:function(o,a){t.trigger(e,"vertical"),i.close()}}};return r};const hD={__depends__:[xl,fD],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",zs],distributeElementsMenuProvider:["type",Do]};var oy="is not a registered action",mD="is already registered";function Yt(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Yt.$inject=["eventBus","injector"],Yt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var u=i.get();if(u.length)return o.copy(u)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(u){r.stepZoom(u.value)}),a&&this.register("zoom",function(u){a.zoom(u.value)}),n&&i&&s&&this.register("removeSelection",function(){var u=i.get();if(u.length){var p=s.allowed("elements.delete",{elements:u}),f;p!==!1&&(oe(p)?f=p:f=u,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(u){c.moveCanvas(u)}),l&&this.register("moveSelection",function(u){l.moveSelection(u.direction,u.accelerated)})},Yt.prototype.trigger=function(e,t){if(!this._actions[e])throw rp(e,oy);return this._actions[e](t)},Yt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);A(e,function(i,r){n._registerAction(r,i)})},Yt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw rp(e,mD);this._actions[e]=t},Yt.prototype.unregister=function(e){if(!this.isRegistered(e))throw rp(e,oy);this._actions[e]=void 0},Yt.prototype.getActions=function(){return Object.keys(this._actions)},Yt.prototype.isRegistered=function(e){return!!this._actions[e]};function rp(e,t){return new Error(e+" "+t)}const gD={__init__:["editorActions"],editorActions:["type",Yt]};function Ws(e){e.invoke(Yt,this)}Y(Ws,Yt),Ws.$inject=["injector"],Ws.prototype._registerDefaultActions=function(e){Yt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),u=e.get("directEditing",!1),p=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var m=t.getRootElement(),v=n.filter(function(g){return g!==m});return i.select(v),v}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),i&&c&&this._registerAction("distributeElements",function(m){var v=i.get(),g=m.type;v.length&&c.trigger(v,g)}),i&&l&&this._registerAction("alignElements",function(m){var v=i.get(),g=[],w=m.type;v.length&&(g=ce(v,function(C){return!b(C,"bpmn:Lane")}),l.trigger(g,w))}),i&&f&&this._registerAction("setColor",function(m){var v=i.get();v.length&&f.setColor(v,m)}),i&&u&&this._registerAction("directEditing",function(){var m=i.get();m.length&&u.activate(m[0])}),p&&this._registerAction("find",function(){p.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),v,g;b(m,"bpmn:Collaboration")?g=n.filter(function(w){return b(w.parent,"bpmn:Collaboration")}):g=n.filter(function(w){return w!==m&&!b(w.parent,"bpmn:SubProcess")}),v=Ke(g),f.moveElements(g,{x:-v.x,y:-v.y},m)}),i&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};const vD={__depends__:[gD],editorActions:["type",Ws]};function ay(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,i=t.shape;le(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}ay.$inject=["eventBus"];var Us=10;function op(e,t,n){return n||(n="round"),Math[n](e/t)*t}var yD=1200,_D=800;function li(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",_D,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],yD,function(o){var a=o.originalEvent;if(!(!r.active||a&&Ft(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(l){var u={},p=ED(o,l,e);p&&(u.offset=p);var f=bD(o,l);f&&D(u,f),fr(o,l)||r.snapEvent(o,l,u)})}})}li.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);He(e,t,i)},li.prototype.getGridSpacing=function(){return Us},li.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=op(e,Us);var i,r;return t&&t.min&&(i=t.min,ee(i)&&(i=op(i+n,Us,"ceil"),e=Math.max(e,i))),t&&t.max&&(r=t.max,ee(r)&&(r=op(r+n,Us,"floor"),e=Math.min(e,r))),e-=n,e},li.prototype.isActive=function(){return this.active},li.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},li.prototype.toggleActive=function(){this.setActive(!this.active)},li.$inject=["elementRegistry","eventBus","config.gridSnapping"];function bD(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Gs(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,l=r.max;return c&&(Gs(t)?cy(s)?a.x.max=c.left:a.x.min=c.right:sy(s)?a.y.max=c.top:a.y.min=c.bottom),l&&(Gs(t)?cy(s)?a.x.min=l.left:a.x.max=l.right:sy(s)?a.y.min=l.top:a.y.max=l.bottom),a[t]}function ED(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ee(s[t])||(s||(s=o.snapOffset={}),ee(s[t])||(s[t]=0),!r)||(n.get(r.id)||(Gs(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2)),s[t]}function Gs(e){return e==="x"}function sy(e){return e.indexOf("n")!==-1}function cy(e){return e.indexOf("w")!==-1}function $i(e,t){F.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},a=o.autoResize;if(a){var s=r.shape,c=r.newBounds;Rt(a)?r.newBounds=n.snapComplex(c,a):r.newBounds=n.snapSimple(s,c)}})}$i.$inject=["eventBus","gridSnapping","modeling"],Y($i,F),$i.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},$i.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},$i.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),D(e,o),e},$i.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),D(e,o),e};var xD=2e3;function ly(e,t){e.on(["spaceTool.move","spaceTool.end"],xD,function(n){var i=n.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}ly.$inject=["eventBus","gridSnapping"];const wD={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",$i],gridSnappingSpaceToolBehavior:["type",ly]}],__init__:["gridSnapping"],gridSnapping:["type",li]};var SD=2e3;function uy(e,t,n){e.on("autoPlace",SD,function(i){var r=i.source,o=te(r),a=i.shape,s=Zh(r,a,n);return["x","y"].forEach(function(c){var l={};s[c]!==o[c]&&(s[c]>o[c]?l.min=s[c]:l.max=s[c],b(a,"bpmn:TextAnnotation")&&(CD(c)?l.offset=-a.width/2:l.offset=-a.height/2),s[c]=t.snapValue(s[c],l))}),s})}uy.$inject=["eventBus","gridSnapping","elementRegistry"];function CD(e){return e==="x"}var RD=1750;function py(e,t,n){t.on(["create.start","shape.move.start"],RD,function(i){var r=i.context,o=r.shape,a=e.getRootElement();if(!(!b(o,"bpmn:Participant")||!b(a,"bpmn:Process")||!a.children.length)){var s=r.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}py.$inject=["canvas","eventBus","gridSnapping"];var TD=3e3;function Ks(e,t,n){F.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],TD,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||PD(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}Ks.$inject=["eventBus","gridSnapping","modeling"],Y(Ks,F),Ks.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var i=1;i<e.length-2;i++)n=DD(t,e[i],e[i+1]),e[i]=n[0],e[i+1]=n[1];return e};function PD(e){return e.length>3}function AD(e){return e==="h"}function kD(e){return e==="v"}function DD(e,t,n){var i=En(t,n),r={};return AD(i)&&(r.y=e.snapValue(t.y)),kD(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=D({},t,r),n=D({},n,r)),[t,n]}const MD={__depends__:[wD,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",uy],gridSnappingParticipantBehavior:["type",py],gridSnappingLayoutConnectionBehavior:["type",Ks]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",ay]};var ND=30,fy=30;function Mo(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;if(b(r,"bpmn:Lane"))return n._createParticipantHit(r,o);if(b(r,"bpmn:Participant"))return fe(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o);if(b(r,"bpmn:SubProcess"))return fe(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o)})}Mo.$inject=["eventBus","interactionEvents"],Mo.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Mo.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Ze(e)?{width:ND,height:e.height}:{width:e.width,height:fy};return this._interactionEvents.createBoxHit(t,"all",n),!0},Mo.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:fy}),!0};const OD={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Mo]};function qs(e){e.invoke(nr,this)}Y(qs,nr),qs.$inject=["injector"],qs.prototype.registerBindings=function(e,t){nr.prototype.registerBindings.call(this,e,t);function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["s","S"],r))return t.trigger("spaceTool"),!0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["l","L"],r))return t.trigger("lassoTool"),!0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["h","H"],r))return t.trigger("handTool"),!0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["c","C"],r))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["e","E"],r))return t.trigger("directEditing"),!0}),n("replaceElement",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["r","R"],r))return t.trigger("replaceElement",r),!0})};const ID={__depends__:[al],__init__:["keyboardBindings"],keyboardBindings:["type",qs]};var BD={moveSpeed:1,moveSpeedAccelerated:10},LD=1500,dy="left",hy="up",my="right",gy="down",$D={ArrowLeft:dy,Left:dy,ArrowUp:hy,Up:hy,ArrowRight:my,Right:my,ArrowDown:gy,Down:gy},jD={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function vy(e,t,n,i,r){var o=this;this._config=D({},BD,e||{}),t.addListener(LD,function(a){var s=a.keyEvent,c=$D[s.key];if(c&&!t.isCmd(s)){var l=t.isShift(s);return o.moveSelection(c,l),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var l=this._config[s?"moveSpeedAccelerated":"moveSpeed"],u=jD[a](l),p=i.allowed("elements.move",{shapes:c});p&&n.moveElements(c,u)}}}vy.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const FD={__depends__:[al,en],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",vy]};var yy=10;function No(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(c,l){var u=c.shape,p=c.direction,f=c.resizeConstraints,d;c.delta=l,d=ST(u,p,l),c.newBounds=RT(d,f),c.canExecute=r.canResize(c)}function a(c){var l=c.resizeConstraints,u=c.minBounds;l===void 0&&(u===void 0&&(u=r.computeMinResizeBox(c)),c.resizeConstraints={min:Q(u)})}function s(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(p=jf(p),!HD(l,p))return;n.resizeShape(l,p)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var l={x:c.dx,y:c.dy};o(c.context,l)}),e.on("resize.end",function(c){s(c.context)})}No.prototype.canResize=function(e){var t=this._rules,n=Jt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},No.prototype.activate=function(e,t,n){var i=this._dragging,r,o;if(typeof n=="string"&&(n={direction:n}),r=D({shape:t},n),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(e,_y(t,o),"resize",{autoActivate:!0,cursor:VD(o),data:{shape:t,context:r}})},No.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,i,r;return i=e.minDimensions||{width:yy,height:yy},r=zm(t,e.childrenBoxPadding),TT(n,t,i,r)},No.$inject=["eventBus","rules","modeling","dragging"];function HD(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function _y(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function VD(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var by="djs-resizing",Ey="resize-not-ok",zD=500;function xy(e,t,n){function i(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,by)),s.width>5&&G(c,{x:s.x,width:s.width}),s.height>5&&G(c,{y:s.y,height:s.height}),o.canExecute?me(c).remove(Ey):me(c).add(Ey)}function r(o){var a=o.shape,s=o.frame;s&&Ge(o.frame),t.removeMarker(a,by)}e.on("resize.move",zD,function(o){i(o.context)}),e.on("resize.cleanup",function(o){r(o.context)})}xy.$inject=["eventBus","canvas","previewSupport"];var wy=-6,Sy=8,Cy=20,Oo="djs-resizer",WD=["n","w","s","e","nw","ne","se","sw"];function ui(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&A(a,Et(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}ui.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Yn(o)&&i.activate(o,e,n)}ae.bind(t,"mousedown",r),ae.bind(t,"touchstart",r)},ui.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=UD(i),a=X("g");me(a).add(Oo),me(a).add(Oo+"-"+e.id),me(a).add(Oo+"-"+i),ie(r,a);var s=X("rect");G(s,{x:-8/2+o.x,y:-8/2+o.y,width:Sy,height:Sy}),me(s).add(Oo+"-visual"),ie(a,s);var c=X("rect");return G(c,{x:-20/2+o.x,y:-20/2+o.y,width:Cy,height:Cy}),me(c).add(Oo+"-hit"),ie(a,c),da(a,t,n),a},ui.prototype.createResizer=function(e,t){var n=_y(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},ui.prototype.addResizer=function(e){var t=this;we(e)||!this._resize.canResize({shape:e})||A(WD,function(n){t.createResizer(e,n)})},ui.prototype.removeResizers=function(){var e=this._getResizersParent();ta(e)},ui.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},ui.$inject=["eventBus","canvas","selection","resize"];function UD(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=6:e.indexOf("w")!==-1&&(t.x=wy),e.indexOf("s")!==-1?t.y=6:e.indexOf("n")!==-1&&(t.y=wy),t}const Ry={__depends__:[vn,kn,dr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",No],resizePreview:["type",xy],resizeHandles:["type",ui]};var GD=2e3;function Io(e,t,n,i,r,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),e.on(["shape.remove","connection.remove"],GD,function(c){i.isActive(c.element)&&i.cancel()}),e.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var l=c.context,u=l.shape,p=c.context.canExecute,f=c.isTouch;f||p&&(l.hints&&l.hints.createElementsBehavior===!1||s(u))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,l){(l||le(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||ap(c))&&i.activate(c)}}Io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Io.prototype.activate=function(e){var t=Qt(e);if(t!==void 0){var n={text:t},i=this.getEditingBBox(e);D(n,i);var r={},o=n.style||{};return D(o,{backgroundColor:null,border:null}),(le(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ap(e))&&D(r,{centerVertically:!0}),Ci(e)&&(D(r,{autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),b(e,"bpmn:TextAnnotation")&&(D(r,{resizable:!0,autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),D(n,{options:r,style:o}),n}},Io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),l=c.fontSize*a,u=c.lineHeight,p=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(b(e,"bpmn:Lane")||YD(e)){var m=Ze(e),v=m?{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}:{width:i.width,height:30*a};D(o,v),D(d,{fontSize:p+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(qD(e)){var g=Ze(e),w=g?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r.x-i.height/2,y:r.y-i.width/2};D(o,w),D(d,{fontSize:p+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:g?null:"rotate(-90deg)"})}(le(e,["bpmn:Task","bpmn:CallActivity"])||ap(e))&&(D(o,{width:i.width,height:i.height}),D(d,{fontSize:p+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),KD(e)&&(D(o,{width:i.width,x:i.x}),D(d,{fontSize:p+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var C=90*a,x=7*a,E=4*a;if(n.labelTarget&&(D(o,{width:C,height:i.height+x+E,x:r.x-C/2,y:i.y-x}),D(d,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:E+"px"})),Ci(n)&&!_a(n)&&!ge(n)){var S=el(e),R=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),N=l+x+E;D(o,{width:C,height:N,x:R.x-C/2,y:R.y-N/2}),D(d,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:E+"px"})}return b(e,"bpmn:TextAnnotation")&&(D(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),D(d,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:p+"px",lineHeight:f})),{bounds:o,style:d}},Io.prototype.update=function(e,t,n,i){var r,o;b(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),XD(t)&&(t=null),this._modeling.updateLabel(e,t,r)};function ap(e){return b(e,"bpmn:SubProcess")&&!fe(e)}function KD(e){return b(e,"bpmn:SubProcess")&&fe(e)}function qD(e){return b(e,"bpmn:Participant")&&!fe(e)}function YD(e){return b(e,"bpmn:Participant")&&fe(e)}function XD(e){return!e||!e.trim()}var Ty="djs-element-hidden",Py="djs-label-hidden";function Ay(e,t,n){var i=this,r=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var l=c.active;if(o=l.element.label||l.element,b(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=X("g");var u=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),p=i.path=X("path");G(p,{d:u,strokeWidth:2,stroke:ZD(o)}),ie(s,p),ie(r,s),ot(s,o.x,o.y)}b(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Ty):(b(o,"bpmn:Task")||b(o,"bpmn:CallActivity")||b(o,"bpmn:SubProcess")||b(o,"bpmn:Participant")||b(o,"bpmn:Lane"))&&t.addMarker(o,Py)}),e.on("directEditing.resize",function(c){if(b(o,"bpmn:TextAnnotation")){var l=c.height,u=c.dy,p=Math.max(o.height/a.height*(l+u),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:p,position:{mx:0,my:0}});G(i.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var l=c.active;l&&(t.removeMarker(l.element.label||l.element,Ty),t.removeMarker(o,Py)),o=void 0,a=void 0,s&&(Ge(s),s=void 0)})}Ay.$inject=["eventBus","canvas","pathMap"];function ZD(e,t){var n=ve(e);return n.get("stroke")||t||"black"}const JD={__depends__:[nl,Ry,Jv],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Io],labelEditingPreview:["type",Ay]};var QD=new Kr("tt");function eM(e){var t=Te('<div class="djs-tooltip-container" />');return lt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function tM(e,t,n){lt(e,{left:t+"px",top:n+"px"})}function sp(e,t){e.style.display=t===!1?"none":""}var ky="djs-tooltip",cp="."+ky;function wt(e,t){this._eventBus=e,this._canvas=t,this._ids=QD,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=eM(t.getContainer());var n=this;Pt.bind(this._tooltipRoot,cp,"mousedown",function(i){i.stopPropagation()}),Pt.bind(this._tooltipRoot,cp,"mouseover",function(i){n.trigger("mouseover",i)}),Pt.bind(this._tooltipRoot,cp,"mouseout",function(i){n.trigger("mouseout",i)}),this._init()}wt.$inject=["eventBus","canvas"],wt.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=D({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},wt.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(ut(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},wt.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},wt.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},wt.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},wt.prototype.remove=function(e){var t=this.get(e);t&&(un(t.html),un(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},wt.prototype.show=function(){sp(this._tooltipRoot)},wt.prototype.hide=function(){sp(this._tooltipRoot,!1)},wt.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},wt.prototype._addTooltip=function(e){var t=e.id,n=e.html,i,r=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),Rt(n)&&(n=Te(n)),i=Te('<div data-tooltip-id="'+t+'" class="'+ky+'">'),lt(i,{position:"absolute"}),i.appendChild(n),e.type&&Ne(i).add("djs-tooltip-"+e.type),e.className&&Ne(i).add(e.className),e.htmlContainer=i,r.appendChild(i),this._tooltips[t]=e,this._updateTooltip(e)},wt.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;tM(n,t.x,t.y)},wt.prototype._updateTooltipVisibilty=function(e){A(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),sp(i,r))})},wt.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};const nM={__init__:["tooltips"],tooltips:["type",wt]};var iM="flow elements must be children of pools/participants",rM="Data object must be placed within a pool/participant.";function Dy(e,t,n){function i(r,o,a){t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(r){var o=r.context,a=o.shape,s=o.target;b(s,"bpmn:Collaboration")&&(b(a,"bpmn:FlowNode")?i(r,n(iM)):b(a,"bpmn:DataObjectReference")&&i(r,n(rM)))})}Dy.$inject=["eventBus","tooltips","translate"];const oM={__depends__:[nM],__init__:["modelingFeedback"],modelingFeedback:["type",Dy]};var aM=500,sM=1e3;function ji(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=X("rect");return G(a,D({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],aM,function(o){var a=o.element,s=o.gfx,c=xe(".djs-outline",s);c||(c=i.getOutline(a)||r(),ie(s,c)),i.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=xe(".djs-outline",s);c||(c=r(),ie(s,c)),i.updateConnectionOutline(c,a)})}ji.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&A(i,function(r){n=n||r.updateOutline(t,e)}),n||G(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},ji.prototype.updateConnectionOutline=function(e,t){var n=Ke(t);G(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},ji.prototype.registerProvider=function(e,t){t||(t=e,e=sM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},ji.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ji.prototype.getOutline=function(e){var t,n=this._getProviders();return A(n,function(i){We(i.getOutline)&&(t=t||i.getOutline(e))}),t},ji.$inject=["eventBus","styles","elementRegistry"];var Ys=6;function lp(e,t,n){this._canvas=t;var i=this;e.on("element.changed",function(r){n.isSelected(r.element)&&i._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(r){var o=r.newSelection;i._updateMultiSelectionOutline(o)})}lp.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");ta(t);var n=e.length>1,i=this._canvas.getContainer();if(me(i)[n?"add":"remove"]("djs-multi-select"),!!n){var r=cM(Ke(e)),o=X("rect");G(o,D({rx:3},r)),me(o).add("djs-selection-outline"),ie(t,o)}},lp.$inject=["eventBus","canvas","selection"];function cM(e){return{x:e.x-Ys,y:e.y-Ys,width:e.width+Ys*2,height:e.height+Ys*2}}const My={__depends__:[en],__init__:["outline","multiSelectionOutline"],outline:["type",ji],multiSelectionOutline:["type",lp]};var lM=500,uM=1250,pM=1500,Xs=Math.round;function fM(e){return{x:e.x+Xs(e.width/2),y:e.y+Xs(e.height/2)}}function Ny(e,t,n,i,r){function o(s,c,l,u){return r.allowed("elements.move",{shapes:s,delta:c,position:l,target:u})}e.on("shape.move.start",pM,function(s){var c=s.context,l=s.shape,u=i.get().slice();u.indexOf(l)===-1&&(u=[l]),u=dM(u),D(c,{shapes:u,validatedShapes:u,shape:l})}),e.on("shape.move.start",uM,function(s){var c=s.context,l=c.validatedShapes,u;if(u=c.canExecute=o(l),!u)return!1}),e.on("shape.move.move",lM,function(s){var c=s.context,l=c.validatedShapes,u=s.hover,p={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(l,p,f,u),c.delta=p,c.canExecute=d,d===null){c.target=null;return}c.target=u}),e.on("shape.move.end",function(s){var c=s.context,l=c.delta,u=c.canExecute,p=u==="attach",f=c.shapes;if(u===!1)return!1;l.x=Xs(l.x),l.y=Xs(l.y),!(l.x===0&&l.y===0)&&n.moveElements(f,l,c.target,{primaryShape:c.shape,attach:p})}),e.on("element.mousedown",function(s){if(Yn(s)){var c=er(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,l,u){if(tt(l)&&(u=l,l=!1),!(c.waypoints||!c.parent)&&!me(s.target).has("djs-hit-no-move")){var p=fM(c);return t.init(s,p,"shape.move",{cursor:"grabbing",autoActivate:l,data:{shape:c,context:u||{}}}),!0}}this.start=a}Ny.$inject=["eventBus","dragging","modeling","selection","rules"];function dM(e){var t=Wi(e,"id");return ce(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var Oy=499,up="djs-dragging",Iy="drop-ok",By="drop-not-ok",Ly="new-parent",$y="attach-ok";function jy(e,t,n,i){function r(c){var l=o(c),u=hM(l);return u}function o(c){var l=Or(c,!0),u=l.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),p=l.concat(u),f=[...new Set(p)];return f}function a(c,l){[$y,Iy,By,Ly].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}function s(c,l,u){i.addDragger(l,c.dragGroup),u&&t.addMarker(l,up),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}e.on("shape.move.start",Oy,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,f=r(u);if(!l.dragGroup){var d=X("g");G(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();ie(m,d),l.dragGroup=d}f.forEach(function(v){i.addDragger(v,l.dragGroup)}),p?p=xc([p,o(u)]):p=o(u),A(p,function(v){t.addMarker(v,up)}),l.allDraggedElements=p,l.differentParents=mM(u)}),e.on("shape.move.move",Oy,function(c){var l=c.context,u=l.dragGroup,p=l.target,f=l.shape.parent,d=l.canExecute;p&&(d==="attach"?a(p,$y):l.canExecute&&f&&p.id!==f.id?a(p,Ly):a(p,l.canExecute?Iy:By)),ot(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context,u=l.target;u&&a(u,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;A(u,function(f){t.removeMarker(f,up)}),p&&Ge(p)}),this.makeDraggable=s}jy.$inject=["eventBus","canvas","styles","previewSupport"];function hM(e){var t=ce(e,function(n){return we(n)?_e(e,Zt({id:n.source.id}))&&_e(e,Zt({id:n.target.id})):!0});return t}function mM(e){return P0(Wi(e,function(t){return t.parent&&t.parent.id}))!==1}const gM={__depends__:[Da,en,My,vn,kn,dr],__init__:["move","movePreview"],move:["type",Ny],movePreview:["type",jy]};var Fy=".djs-palette-toggle",Hy=".entry",vM=Fy+", "+Hy,pp="djs-palette-",yM="shown",fp="open",Vy="two-column",_M=1e3;function Ve(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}Ve.$inject=["eventBus","canvas"],Ve.prototype.registerProvider=function(e,t){t||(t=e,e=_M),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},Ve.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(EM,{})},Ve.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},Ve.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Te(Ve.HTML_MARKUP);n.appendChild(i),Ne(n).add(pp+yM),Pt.bind(i,vM,"click",function(r){var o=r.delegateTarget;if(lf(o,Fy))return e.toggle();e.trigger("click",r)}),ae.bind(i,"mousedown",function(r){r.stopPropagation()}),Pt.bind(i,Hy,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},Ve.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},Ve.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,i=this._eventBus,r,o=Ne(n),a=Ne(t);"twoColumn"in e?r=e.twoColumn:r=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(Vy,r),a.toggle(pp+Vy,r),"open"in e&&(o.toggle(fp,e.open),a.toggle(pp+fp,e.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})},Ve.prototype._update=function(){var e=xe(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Zo(e),A(t,function(n,i){var r=n.group||"default",o=xe("[data-group="+qr(r)+"]",e);o||(o=Te('<div class="group"></div>'),ut(o,"data-group",r),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=Te(a);if(o.appendChild(s),!n.separator&&(ut(s,"data-action",i),n.title&&ut(s,"title",n.title),n.className&&bM(s,n.className),n.imageUrl)){var c=Te("<img>");ut(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},Ve.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=ut(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},Ve.prototype.triggerEntry=function(e,t,n,i){var r=this._entries,o,a;if(o=r[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(We(a)){if(t==="click")return a(n,i)}else if(a[t])return a[t](n,i);n.preventDefault()}},Ve.prototype._layoutChanged=function(){this._toggleState({})},Ve.prototype._needsCollapse=function(e,t){var n=50,i=Object.keys(t).length*46;return e<i+n},Ve.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},Ve.prototype.open=function(){this._toggleState({open:!0})},Ve.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Ve.prototype.isActiveTool=function(e){return e&&this._activeTool===e},Ve.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=xe(".djs-palette-entries",this._container),this._toolsContainer=xe("[data-group=tools]",t)),n=this._toolsContainer,A(n.children,function(i){var r=i.getAttribute("data-action");if(r){var o=Ne(i);r=r.replace("-tool",""),o.contains("entry")&&r===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},Ve.prototype.isOpen=function(){return Ne(this._container).has(fp)},Ve.prototype._getParentContainer=function(){return this._canvas.getContainer()},Ve.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function bM(e,t){var n=Ne(e),i=oe(t)?t:t.split(/\s+/g);i.forEach(function(r){n.add(r)})}function EM(e,t){var n=t.getPaletteEntries();return We(n)?n(e):(A(n,function(i,r){e[r]=i}),e)}const xM={__init__:["palette"],palette:["type",Ve]};var zy="crosshair";function Fi(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var u=t.getActiveLayer(),p;p=l.frame=X("rect"),G(p,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ie(u,p)},update:function(l){var u=l.frame,p=l.bbox;G(u,{x:p.x,y:p.y,width:p.width,height:p.height})},remove:function(l){l.frame&&Ge(l.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var u=l.originalEvent.target;!l.hover&&!(u instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var u=l.context,p=dp(l),f=i.filter(function(m){return m}),d=Aa(l);s.select(f,p,d?u.selection:[])}),e.on("lasso.start",function(l){var u=l.context;u.bbox=dp(l),c.create(u),u.selection=r.get()}),e.on("lasso.move",function(l){var u=l.context;u.bbox=dp(l),c.update(u)}),e.on("lasso.cleanup",function(l){var u=l.context;c.remove(u)}),e.on("element.mousedown",1500,function(l){if(Aa(l))return s.activateLasso(l.originalEvent),!0})}Fi.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Fi.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:zy,data:{context:{}}})},Fi.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:zy,data:{context:{}},keepSelection:!0})},Fi.prototype.select=function(e,t,n=[]){var i=wf(e,t);this._selection.select([...n,...Yo(i)])},Fi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Fi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function dp(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},i;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?i={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?i={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?i={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?i={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:i={x:n.x,y:n.y,width:0,height:0},i}const wM={__depends__:[ws,po],__init__:["lassoTool"],lassoTool:["type",Fi]};var hp=1500,Wy="grab";function xr(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",hp,function(c){if(Yr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(hp,function(c){if(!(!Uy(c.keyEvent)||a.isActive())){var l=a._mouse.getLastMoveEvent();a.activateMove(l,!!l)}},"keyboard.keydown"),s&&s.addListener(hp,function(c){!Uy(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var l=c.originalEvent.target;if(!c.hover&&!(l instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var l=t.viewbox().scale;t.scroll({dx:c.dx*l,dy:c.dy*l})}),e.on("hand.move.end",function(c){var l=c.context,u=l.reactivate;return!Yr(c)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}xr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],xr.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Wy,data:{context:n||{}}})},xr.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Wy,data:{context:{reactivate:n}}})},xr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},xr.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function Uy(e){return it("Space",e)}const SM={__depends__:[ws,po],__init__:["handTool"],handTool:["type",xr]};var Gy="connect-ok",Ky="connect-not-ok";function wr(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var l=c.context,u=c.hover,p=l.canStartConnect=s.canStartConnect(u);p!==null&&(l.startTarget=u,i.addMarker(u,p?Gy:Ky))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var l=c.context.startTarget,u=c.context.canStartConnect;l&&i.removeMarker(l,u?Gy:Ky)}),e.on(["global-connect.ended"],function(c){var l=c.context,u=l.startTarget,p={x:c.x,y:c.y},f=s.canStartConnect(u);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}wr.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],wr.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},wr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},wr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},wr.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const CM={__depends__:[Ll,vn,kn,ws,po],globalConnect:["type",wr]};function mp(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}mp.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],mp.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(p,f,d,m,v){function g(w){var C=n.createShape(D({type:p},v));t.start(w,C)}return{group:f,className:d,title:m,action:{dragstart:g,click:g}}}function l(p){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(p,[f,d],{hints:{autoSelect:[f]}})}function u(p){t.start(p,n.createParticipantShape())}return D(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(p){o.activateHand(p)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(p){r.activateSelection(p)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(p){i.activateSelection(p)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(p){a.start(p)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};const RM={__depends__:[xM,Es,fv,wM,SM,CM,wa],__init__:["paletteProvider"],paletteProvider:["type",mp]};var TM=250;function gp(e,t,n,i,r){F.call(this,e);function o(s){var c=s.canExecute.replacements;A(c,function(l){var u=l.oldElementId,p={type:l.newElementType};if(!s.visualReplacements[u]){var f=t.get(u);D(p,{x:f.x,y:f.y});var d=n.createShape(p);i.addShape(d,f.parent);var m=xe('[data-element-id="'+qr(f.id)+'"]',s.dragGroup);m&&G(m,{display:"none"});var v=r.addDragger(d,s.dragGroup);s.visualReplacements[u]=v,i.removeShape(d)}})}function a(s){var c=s.visualReplacements;A(c,function(l,u){var p=xe('[data-element-id="'+qr(u)+'"]',s.dragGroup);p&&G(p,{display:"inline"}),l.remove(),c[u]&&delete c[u]})}e.on("shape.move.move",TM,function(s){var c=s.context,l=c.canExecute;c.visualReplacements||(c.visualReplacements={}),l&&l.replacements?o(c):a(c)})}gp.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],Y(gp,F);const PM={__depends__:[dr],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",gp]};var AM=1250,vp=40,kM=20,DM=10,qy=20,Yy=["x","y"],MM=Math.abs;function Xy(e){e.on(["connect.hover","connect.move","connect.end"],AM,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&Ft(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&NM(t,o,LM(o)),o&&BM(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Vt(r),le(o,["bpmn:Event","bpmn:Gateway"])&&Zy(t,Vt(o)),le(o,["bpmn:Task","bpmn:SubProcess"])&&OM(t,o),b(a,"bpmn:BoundaryEvent")&&s===a.host&&IM(t)):Jy(i,"bpmn:MessageFlow")?(b(r,"bpmn:Event")&&(n.connectionStart=Vt(r)),b(o,"bpmn:Event")&&Zy(t,Vt(o))):n.connectionStart=n.initialConnectionStart)})}Xy.$inject=["eventBus"];function NM(e,t,n){Yy.forEach(function(i){var r=Qy(i,t);e[i]<t[i]+n?He(e,i,t[i]+n):e[i]>t[i]+r-n&&He(e,i,t[i]+r-n)})}function OM(e,t){var n=Vt(t);Yy.forEach(function(i){$M(e,t,i)&&He(e,i,n[i])})}function IM(e){var t=e.context,n=t.source,i=t.target;if(!jM(t)){var r=Vt(n),o=pt(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],l;MM(c-r[s])<vp&&(c>r[s]?l=r[s]+vp:l=r[s]-vp,He(e,s,l))})}}function Zy(e,t){He(e,"x",t.x),He(e,"y",t.y)}function Jy(e,t){return e&&e.type===t}function BM(e,t){return $n(t,function(n){return Jy(e,n)})}function Qy(e,t){return e==="x"?t.width:t.height}function LM(e){return b(e,"bpmn:Task")?DM:kM}function $M(e,t,n){return e[n]>t[n]+qy&&e[n]<t[n]+Qy(n,t)-qy}function jM(e){var t=e.hover,n=e.source;return t&&n&&t===n}function pi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}pi.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},pi.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},pi.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},pi.prototype.getSnapLocations=function(){return this._snapLocations},pi.prototype.setSnapLocations=function(e){this._snapLocations=e},pi.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Zs,n.initDefaults(this._defaultSnaps)),n};function Zs(){this._snapValues={}}Zs.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Zs.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&YR(e[n],r[n],i)},Zs.prototype.initDefaults=function(e){var t=this;A(e||{},function(n,i){A(n,function(r){t.add(i,r)})})};var FM=1250;function _n(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],FM,function(r){var o=r.context,a=o.shape,s=o.snapContext,c=o.target;if(!(r.originalEvent&&Ft(r.originalEvent))&&!(fr(r)||!c)){var l=s.pointsForTarget(c);l.initialized||(l=i.addSnapTargetPoints(l,a,c),l.initialized=!0),n.snap(r,l)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}_n.$inject=["elementRegistry","eventBus","snapping"],_n.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,i=n.shape,r=n.snapContext;r||(r=n.snapContext=new pi);var o;t.get(i.id)?o=Vt(i,e):o={x:e.x+Vt(i).x,y:e.y+Vt(i).y};var a={x:o.x-i.width/2,y:o.y-i.height/2},s={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ge(i)||(r.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),r.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),r},_n.prototype.addSnapTargetPoints=function(e,t,n){var i=this.getSnapTargets(t,n);return A(i,function(r){if(ge(r)){ge(t)&&e.add("mid",Vt(r));return}if(we(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);A(o,function(a){e.add("mid",a)});return}e.add("mid",Vt(r))}),!ee(t.x)||!ee(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",Vt(t)),e},_n.prototype.getSnapTargets=function(e,t){return Pm(t).filter(function(n){return!HM(n)})};function HM(e){return!!e.hidden}var e_=1500;function Sr(e,t){t.invoke(_n,this),e.on(["create.move","create.end"],e_,UM),e.on(["create.move","create.end","shape.move.move","shape.move.end"],e_,function(n){var i=n.context,r=i.canExecute,o=i.target,a=r&&(r==="attach"||r.attach);a&&!fr(n)&&VM(n,o)})}Y(Sr,_n),Sr.$inject=["eventBus","injector"],Sr.prototype.initSnap=function(e){var t=_n.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return A(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",n_(o,i,e))}),A(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",n_(o,i,e))}),b(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Sr.prototype.addSnapTargetPoints=function(e,t,n){_n.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);A(i,function(o){(WM(o)||zM([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Rm(o)),e.add("bottom-right",Tm(o)))});var r=this._elementRegistry;return A(t.incoming,function(o){if(r.get(t.id)){t_(i,o.source)||e.add("mid",te(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),A(t.outgoing,function(o){if(r.get(t.id)){t_(i,o.target)||e.add("mid",te(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),b(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Sr.prototype.getSnapTargets=function(e,t){return _n.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!b(n,"bpmn:Lane")})};function VM(e,t){var n=Q(t),i=Cg(e,t),r=e.context,o=r.shape,a;o.parent?a={x:0,y:0}:a=te(o),/top/.test(i)?He(e,"y",n.top-a.y):/bottom/.test(i)&&He(e,"y",n.bottom-a.y),/left/.test(i)?He(e,"x",n.left-a.x):/right/.test(i)&&He(e,"x",n.right-a.x)}function zM(e,t){return e.every(function(n){return b(n,t)})}function WM(e){return b(e,"bpmn:SubProcess")&&fe(e)?!0:b(e,"bpmn:Participant")}function UM(e){var t=e.context,n=t.createConstraints;if(n){var i=n.top,r=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||r&&r<=e.x)&&He(e,"x",e.x),(i&&i>=e.y||o&&o<=e.y)&&He(e,"y",e.y)}}function t_(e,t){return e.indexOf(t)!==-1}function n_(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var GM=1250;function Bo(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],GM,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&Ft(i.originalEvent))&&!fr(i)){var l=c.pointsForTarget(a);l.initialized||(l=n.addSnapTargetPoints(l,o,a,s),l.initialized=!0),YM(s)&&He(i,"x",i.x),XM(s)&&He(i,"y",i.y),t.snap(i,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}Bo.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new pi);var o=i_(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Bo.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return A(r,function(o){e.add("corner",Tm(o)),e.add("corner",Rm(o))}),e.add("corner",i_(t,i)),e},Bo.$inject=["eventBus","snapping"],Bo.prototype.getSnapTargets=function(e,t){return Pm(t).filter(function(n){return!KM(n,e)&&!we(n)&&!qM(n)&&!ge(n)})};function i_(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function KM(e,t){return e.host===t}function qM(e){return!!e.hidden}function YM(e){return e==="n"||e==="s"}function XM(e){return e==="e"||e==="w"}var ZM=7,JM=1e3;function fi(e){this._canvas=e,this._asyncHide=rf(Et(this.hide,this),JM)}fi.$inject=["canvas"],fi.prototype.snap=function(e,t){var n=e.context,i=n.snapContext,r=i.getSnapLocations(),o={x:fr(e,"x"),y:fr(e,"y")};A(r,function(a){var s=i.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(A(["x","y"],function(l){var u;o[l]||(u=t.snap(c,a,l,ZM),u!==void 0&&(o[l]={value:u,originValue:u-s[l]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),A(["x","y"],function(a){var s=o[a];tt(s)&&He(e,a,s.originValue)})},fi.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=X("path");return G(n,{d:"M0,0 L0,0"}),me(n).add("djs-snap-line"),ie(t,n),{update:function(i){ee(i)?e==="horizontal"?G(n,{d:"M-100000,"+i+" L+100000,"+i,display:""}):G(n,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):G(n,{display:"none"})}}},fi.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},fi.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},fi.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},fi.prototype.hide=function(){A(this._snapLines,function(e){e.update()})};const QM={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",_n],resizeSnapping:["type",Bo],snapping:["type",fi]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Xy],createMoveSnapping:["type",Sr]};var r_=300;function re(e,t,n,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=xe(re.INPUT_SELECTOR,this._container),this._resultsContainer=xe(re.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}re.$inject=["canvas","eventBus","selection","translate"],re.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Pt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,re.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,re.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,re.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,re.INPUT_SELECTOR,"keydown",function(n){it("ArrowUp",n)&&n.preventDefault(),it("ArrowDown",n)&&n.preventDefault()}),t(this._container,re.INPUT_SELECTOR,"keyup",function(n){if(it("Escape",n))return e.close();if(it("Enter",n)){var i=e._getCurrentResult();return i?e._select(i):e.close(!1)}if(it("ArrowUp",n))return e._scrollToDirection(!0);if(it("ArrowDown",n))return e._scrollToDirection();it(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},re.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Pt.unbind(e.el,e.type,e.listener)})},re.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(r){return!t._canvas.getRootElements().includes(r.element)}),!n.length){this._selection.select(null);return}n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=xe(re.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}},re.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},re.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},re.prototype._clearResults=function(){Zo(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},re.prototype._getCurrentResult=function(){return xe(re.RESULT_SELECTED_SELECTOR,this._resultsContainer)},re.prototype._createResultNode=function(e,t){var n=Te(re.RESULT_HTML);return e.primaryTokens.length>0&&o_(n,e.primaryTokens,re.RESULT_PRIMARY_HTML),o_(n,e.secondaryTokens,re.RESULT_SECONDARY_HTML),ut(n,re.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},re.prototype.registerProvider=function(e){this._searchProvider=e},re.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ne(this._canvas.getContainer()).add("djs-search-open"),Ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},re.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ne(this._canvas.getContainer()).remove("djs-search-open"),Ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},re.prototype.toggle=function(){this.isOpen()?this.close():this.open()},re.prototype.isOpen=function(){return this._open},re.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ne(t).remove(re.RESULT_SELECTED_CLASS);var n=ut(e,re.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Ne(e).add(re.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:r_}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},re.prototype._select=function(e){var t=ut(e,re.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:r_}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},re.prototype._getBoxHtml=function(){const e=Te(re.BOX_HTML),t=xe(re.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function o_(e,t,n){var i=e2(t),r=Te(n);r.innerHTML=i,e.appendChild(r)}function e2(e){var t="";return e.forEach(function(n){var i=Nd(n.value||n.matched||n.normal),r=n.match||n.matched;r?t+='<b class="'+re.RESULT_HIGHLIGHT_CLASS+'">'+i+"</b>":t+=i}),t!==""?t:null}re.CONTAINER_SELECTOR=".djs-search-container",re.INPUT_SELECTOR=".djs-search-input input",re.RESULTS_CONTAINER_SELECTOR=".djs-search-results",re.RESULT_SELECTOR=".djs-search-result",re.RESULT_SELECTED_CLASS="djs-search-result-selected",re.RESULT_SELECTED_SELECTOR="."+re.RESULT_SELECTED_CLASS,re.RESULT_ID_ATTRIBUTE="data-result-id",re.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",re.BOX_HTML=`<div class="djs-search-container djs-scrollable">
232
+ </svg>`},fD=900;function Do(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",fD,this)}Do.$inject=["popupMenu","distributeElements","translate","rules"],Do.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},Do.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Do.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:rv.horizontal,action:function(o,a){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:rv.vertical,action:function(o,a){t.trigger(e,"vertical"),i.close()}}};return r};const dD={__depends__:[xl,pD],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",zs],distributeElementsMenuProvider:["type",Do]};var ov="is not a registered action",hD="is already registered";function Yt(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Yt.$inject=["eventBus","injector"],Yt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var u=i.get();if(u.length)return o.copy(u)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(u){r.stepZoom(u.value)}),a&&this.register("zoom",function(u){a.zoom(u.value)}),n&&i&&s&&this.register("removeSelection",function(){var u=i.get();if(u.length){var p=s.allowed("elements.delete",{elements:u}),d;p!==!1&&(oe(p)?d=p:d=u,d.length&&n.removeElements(d.slice()))}}),c&&this.register("moveCanvas",function(u){c.moveCanvas(u)}),l&&this.register("moveSelection",function(u){l.moveSelection(u.direction,u.accelerated)})},Yt.prototype.trigger=function(e,t){if(!this._actions[e])throw rp(e,ov);return this._actions[e](t)},Yt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);A(e,function(i,r){n._registerAction(r,i)})},Yt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw rp(e,hD);this._actions[e]=t},Yt.prototype.unregister=function(e){if(!this.isRegistered(e))throw rp(e,ov);this._actions[e]=void 0},Yt.prototype.getActions=function(){return Object.keys(this._actions)},Yt.prototype.isRegistered=function(e){return!!this._actions[e]};function rp(e,t){return new Error(e+" "+t)}const mD={__init__:["editorActions"],editorActions:["type",Yt]};function Ws(e){e.invoke(Yt,this)}Y(Ws,Yt),Ws.$inject=["injector"],Ws.prototype._registerDefaultActions=function(e){Yt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),u=e.get("directEditing",!1),p=e.get("searchPad",!1),d=e.get("modeling",!1),h=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var m=t.getRootElement(),y=n.filter(function(g){return g!==m});return i.select(y),y}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),i&&c&&this._registerAction("distributeElements",function(m){var y=i.get(),g=m.type;y.length&&c.trigger(y,g)}),i&&l&&this._registerAction("alignElements",function(m){var y=i.get(),g=[],w=m.type;y.length&&(g=ce(y,function(C){return!b(C,"bpmn:Lane")}),l.trigger(g,w))}),i&&d&&this._registerAction("setColor",function(m){var y=i.get();y.length&&d.setColor(y,m)}),i&&u&&this._registerAction("directEditing",function(){var m=i.get();m.length&&u.activate(m[0])}),p&&this._registerAction("find",function(){p.toggle()}),t&&d&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),y,g;b(m,"bpmn:Collaboration")?g=n.filter(function(w){return b(w.parent,"bpmn:Collaboration")}):g=n.filter(function(w){return w!==m&&!b(w.parent,"bpmn:SubProcess")}),y=Ye(g),d.moveElements(g,{x:-y.x,y:-y.y},m)}),i&&h&&this._registerAction("replaceElement",function(m){h.triggerEntry("replace","click",m)})};const gD={__depends__:[mD],editorActions:["type",Ws]};function av(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,i=t.shape;le(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}av.$inject=["eventBus"];var Us=10;function op(e,t,n){return n||(n="round"),Math[n](e/t)*t}var yD=1200,vD=800;function ui(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",vD,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],yD,function(o){var a=o.originalEvent;if(!(!r.active||a&&Ft(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(l){var u={},p=bD(o,l,e);p&&(u.offset=p);var d=_D(o,l);d&&D(u,d),fr(o,l)||r.snapEvent(o,l,u)})}})}ui.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);ze(e,t,i)},ui.prototype.getGridSpacing=function(){return Us},ui.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=op(e,Us);var i,r;return t&&t.min&&(i=t.min,ee(i)&&(i=op(i+n,Us,"ceil"),e=Math.max(e,i))),t&&t.max&&(r=t.max,ee(r)&&(r=op(r+n,Us,"floor"),e=Math.min(e,r))),e-=n,e},ui.prototype.isActive=function(){return this.active},ui.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},ui.prototype.toggleActive=function(){this.setActive(!this.active)},ui.$inject=["elementRegistry","eventBus","config.gridSnapping"];function _D(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Gs(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,l=r.max;return c&&(Gs(t)?cv(s)?a.x.max=c.left:a.x.min=c.right:sv(s)?a.y.max=c.top:a.y.min=c.bottom),l&&(Gs(t)?cv(s)?a.x.min=l.left:a.x.max=l.right:sv(s)?a.y.min=l.top:a.y.max=l.bottom),a[t]}function bD(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ee(s[t])||(s||(s=o.snapOffset={}),ee(s[t])||(s[t]=0),!r)||(n.get(r.id)||(Gs(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2)),s[t]}function Gs(e){return e==="x"}function sv(e){return e.indexOf("n")!==-1}function cv(e){return e.indexOf("w")!==-1}function $i(e,t){F.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},a=o.autoResize;if(a){var s=r.shape,c=r.newBounds;Rt(a)?r.newBounds=n.snapComplex(c,a):r.newBounds=n.snapSimple(s,c)}})}$i.$inject=["eventBus","gridSnapping","modeling"],Y($i,F),$i.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},$i.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},$i.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),D(e,o),e},$i.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),D(e,o),e};var ED=2e3;function lv(e,t){e.on(["spaceTool.move","spaceTool.end"],ED,function(n){var i=n.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}lv.$inject=["eventBus","gridSnapping"];const xD={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",$i],gridSnappingSpaceToolBehavior:["type",lv]}],__init__:["gridSnapping"],gridSnapping:["type",ui]};var wD=2e3;function uv(e,t,n){e.on("autoPlace",wD,function(i){var r=i.source,o=te(r),a=i.shape,s=Zh(r,a,n);return["x","y"].forEach(function(c){var l={};s[c]!==o[c]&&(s[c]>o[c]?l.min=s[c]:l.max=s[c],b(a,"bpmn:TextAnnotation")&&(SD(c)?l.offset=-a.width/2:l.offset=-a.height/2),s[c]=t.snapValue(s[c],l))}),s})}uv.$inject=["eventBus","gridSnapping","elementRegistry"];function SD(e){return e==="x"}var CD=1750;function pv(e,t,n){t.on(["create.start","shape.move.start"],CD,function(i){var r=i.context,o=r.shape,a=e.getRootElement();if(!(!b(o,"bpmn:Participant")||!b(a,"bpmn:Process")||!a.children.length)){var s=r.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}pv.$inject=["canvas","eventBus","gridSnapping"];var RD=3e3;function Ks(e,t,n){F.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],RD,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||TD(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}Ks.$inject=["eventBus","gridSnapping","modeling"],Y(Ks,F),Ks.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var i=1;i<e.length-2;i++)n=kD(t,e[i],e[i+1]),e[i]=n[0],e[i+1]=n[1];return e};function TD(e){return e.length>3}function PD(e){return e==="h"}function AD(e){return e==="v"}function kD(e,t,n){var i=En(t,n),r={};return PD(i)&&(r.y=e.snapValue(t.y)),AD(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=D({},t,r),n=D({},n,r)),[t,n]}const DD={__depends__:[xD,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",uv],gridSnappingParticipantBehavior:["type",pv],gridSnappingLayoutConnectionBehavior:["type",Ks]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",av]};var MD=30,fv=30;function Mo(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;if(b(r,"bpmn:Lane"))return n._createParticipantHit(r,o);if(b(r,"bpmn:Participant"))return fe(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o);if(b(r,"bpmn:SubProcess"))return fe(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o)})}Mo.$inject=["eventBus","interactionEvents"],Mo.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Mo.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Qe(e)?{width:MD,height:e.height}:{width:e.width,height:fv};return this._interactionEvents.createBoxHit(t,"all",n),!0},Mo.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:fv}),!0};const ND={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Mo]};function qs(e){e.invoke(nr,this)}Y(qs,nr),qs.$inject=["injector"],qs.prototype.registerBindings=function(e,t){nr.prototype.registerBindings.call(this,e,t);function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["s","S"],r))return t.trigger("spaceTool"),!0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["l","L"],r))return t.trigger("lassoTool"),!0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["h","H"],r))return t.trigger("handTool"),!0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["c","C"],r))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["e","E"],r))return t.trigger("directEditing"),!0}),n("replaceElement",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["r","R"],r))return t.trigger("replaceElement",r),!0})};const OD={__depends__:[al],__init__:["keyboardBindings"],keyboardBindings:["type",qs]};var ID={moveSpeed:1,moveSpeedAccelerated:10},BD=1500,dv="left",hv="up",mv="right",gv="down",LD={ArrowLeft:dv,Left:dv,ArrowUp:hv,Up:hv,ArrowRight:mv,Right:mv,ArrowDown:gv,Down:gv},$D={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function yv(e,t,n,i,r){var o=this;this._config=D({},ID,e||{}),t.addListener(BD,function(a){var s=a.keyEvent,c=LD[s.key];if(c&&!t.isCmd(s)){var l=t.isShift(s);return o.moveSelection(c,l),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var l=this._config[s?"moveSpeedAccelerated":"moveSpeed"],u=$D[a](l),p=i.allowed("elements.move",{shapes:c});p&&n.moveElements(c,u)}}}yv.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const jD={__depends__:[al,tn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",yv]};var vv=10;function No(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(c,l){var u=c.shape,p=c.direction,d=c.resizeConstraints,h;c.delta=l,h=wT(u,p,l),c.newBounds=CT(h,d),c.canExecute=r.canResize(c)}function a(c){var l=c.resizeConstraints,u=c.minBounds;l===void 0&&(u===void 0&&(u=r.computeMinResizeBox(c)),c.resizeConstraints={min:Q(u)})}function s(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(p=jf(p),!FD(l,p))return;n.resizeShape(l,p)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var l={x:c.dx,y:c.dy};o(c.context,l)}),e.on("resize.end",function(c){s(c.context)})}No.prototype.canResize=function(e){var t=this._rules,n=Qt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},No.prototype.activate=function(e,t,n){var i=this._dragging,r,o;if(typeof n=="string"&&(n={direction:n}),r=D({shape:t},n),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(e,_v(t,o),"resize",{autoActivate:!0,cursor:HD(o),data:{shape:t,context:r}})},No.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,i,r;return i=e.minDimensions||{width:vv,height:vv},r=zm(t,e.childrenBoxPadding),RT(n,t,i,r)},No.$inject=["eventBus","rules","modeling","dragging"];function FD(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function _v(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function HD(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var bv="djs-resizing",Ev="resize-not-ok",VD=500;function xv(e,t,n){function i(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,bv)),s.width>5&&q(c,{x:s.x,width:s.width}),s.height>5&&q(c,{y:s.y,height:s.height}),o.canExecute?me(c).remove(Ev):me(c).add(Ev)}function r(o){var a=o.shape,s=o.frame;s&&qe(o.frame),t.removeMarker(a,bv)}e.on("resize.move",VD,function(o){i(o.context)}),e.on("resize.cleanup",function(o){r(o.context)})}xv.$inject=["eventBus","canvas","previewSupport"];var wv=-6,Sv=8,Cv=20,Oo="djs-resizer",zD=["n","w","s","e","nw","ne","se","sw"];function pi(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&A(a,xt(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}pi.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Xn(o)&&i.activate(o,e,n)}ae.bind(t,"mousedown",r),ae.bind(t,"touchstart",r)},pi.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=WD(i),a=X("g");me(a).add(Oo),me(a).add(Oo+"-"+e.id),me(a).add(Oo+"-"+i),ie(r,a);var s=X("rect");q(s,{x:-8/2+o.x,y:-8/2+o.y,width:Sv,height:Sv}),me(s).add(Oo+"-visual"),ie(a,s);var c=X("rect");return q(c,{x:-20/2+o.x,y:-20/2+o.y,width:Cv,height:Cv}),me(c).add(Oo+"-hit"),ie(a,c),da(a,t,n),a},pi.prototype.createResizer=function(e,t){var n=_v(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},pi.prototype.addResizer=function(e){var t=this;Ce(e)||!this._resize.canResize({shape:e})||A(zD,function(n){t.createResizer(e,n)})},pi.prototype.removeResizers=function(){var e=this._getResizersParent();ta(e)},pi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},pi.$inject=["eventBus","canvas","selection","resize"];function WD(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=6:e.indexOf("w")!==-1&&(t.x=wv),e.indexOf("s")!==-1?t.y=6:e.indexOf("n")!==-1&&(t.y=wv),t}const Rv={__depends__:[yn,kn,dr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",No],resizePreview:["type",xv],resizeHandles:["type",pi]};var UD=2e3;function Io(e,t,n,i,r,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),e.on(["shape.remove","connection.remove"],UD,function(c){i.isActive(c.element)&&i.cancel()}),e.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var l=c.context,u=l.shape,p=c.context.canExecute,d=c.isTouch;d||p&&(l.hints&&l.hints.createElementsBehavior===!1||s(u))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,l){(l||le(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||ap(c))&&i.activate(c)}}Io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Io.prototype.activate=function(e){var t=en(e);if(t!==void 0){var n={text:t},i=this.getEditingBBox(e);D(n,i);var r={},o=n.style||{};return D(o,{backgroundColor:null,border:null}),(le(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ap(e))&&D(r,{centerVertically:!0}),Ci(e)&&(D(r,{autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),b(e,"bpmn:TextAnnotation")&&(D(r,{resizable:!0,autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),D(n,{options:r,style:o}),n}},Io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),l=c.fontSize*a,u=c.lineHeight,p=s.fontSize*a,d=s.lineHeight,h={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(b(e,"bpmn:Lane")||qD(e)){var m=Qe(e),y=m?{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}:{width:i.width,height:30*a};D(o,y),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(KD(e)){var g=Qe(e),w=g?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r.x-i.height/2,y:r.y-i.width/2};D(o,w),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:g?null:"rotate(-90deg)"})}(le(e,["bpmn:Task","bpmn:CallActivity"])||ap(e))&&(D(o,{width:i.width,height:i.height}),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),GD(e)&&(D(o,{width:i.width,x:i.x}),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var C=90*a,x=7*a,E=4*a;if(n.labelTarget&&(D(o,{width:C,height:i.height+x+E,x:r.x-C/2,y:i.y-x}),D(h,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:E+"px"})),Ci(n)&&!_a(n)&&!ge(n)){var S=el(e),R=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),M=l+x+E;D(o,{width:C,height:M,x:R.x-C/2,y:R.y-M/2}),D(h,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:E+"px"})}return b(e,"bpmn:TextAnnotation")&&(D(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),D(h,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:p+"px",lineHeight:d})),{bounds:o,style:h}},Io.prototype.update=function(e,t,n,i){var r,o;b(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),YD(t)&&(t=null),this._modeling.updateLabel(e,t,r)};function ap(e){return b(e,"bpmn:SubProcess")&&!fe(e)}function GD(e){return b(e,"bpmn:SubProcess")&&fe(e)}function KD(e){return b(e,"bpmn:Participant")&&!fe(e)}function qD(e){return b(e,"bpmn:Participant")&&fe(e)}function YD(e){return!e||!e.trim()}var Tv="djs-element-hidden",Pv="djs-label-hidden";function Av(e,t,n){var i=this,r=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var l=c.active;if(o=l.element.label||l.element,b(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=X("g");var u=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),p=i.path=X("path");q(p,{d:u,strokeWidth:2,stroke:XD(o)}),ie(s,p),ie(r,s),at(s,o.x,o.y)}b(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Tv):(b(o,"bpmn:Task")||b(o,"bpmn:CallActivity")||b(o,"bpmn:SubProcess")||b(o,"bpmn:Participant")||b(o,"bpmn:Lane"))&&t.addMarker(o,Pv)}),e.on("directEditing.resize",function(c){if(b(o,"bpmn:TextAnnotation")){var l=c.height,u=c.dy,p=Math.max(o.height/a.height*(l+u),0),d=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:p,position:{mx:0,my:0}});q(i.path,{d})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var l=c.active;l&&(t.removeMarker(l.element.label||l.element,Tv),t.removeMarker(o,Pv)),o=void 0,a=void 0,s&&(qe(s),s=void 0)})}Av.$inject=["eventBus","canvas","pathMap"];function XD(e,t){var n=ye(e);return n.get("stroke")||t||"black"}const ZD={__depends__:[nl,Rv,Jy],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Io],labelEditingPreview:["type",Av]};var JD=new Kr("tt");function QD(e){var t=Pe('<div class="djs-tooltip-container" />');return lt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function eM(e,t,n){lt(e,{left:t+"px",top:n+"px"})}function sp(e,t){e.style.display=t===!1?"none":""}var kv="djs-tooltip",cp="."+kv;function St(e,t){this._eventBus=e,this._canvas=t,this._ids=JD,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=QD(t.getContainer());var n=this;Pt.bind(this._tooltipRoot,cp,"mousedown",function(i){i.stopPropagation()}),Pt.bind(this._tooltipRoot,cp,"mouseover",function(i){n.trigger("mouseover",i)}),Pt.bind(this._tooltipRoot,cp,"mouseout",function(i){n.trigger("mouseout",i)}),this._init()}St.$inject=["eventBus","canvas"],St.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=D({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},St.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(ut(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},St.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},St.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},St.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},St.prototype.remove=function(e){var t=this.get(e);t&&(un(t.html),un(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},St.prototype.show=function(){sp(this._tooltipRoot)},St.prototype.hide=function(){sp(this._tooltipRoot,!1)},St.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},St.prototype._addTooltip=function(e){var t=e.id,n=e.html,i,r=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),Rt(n)&&(n=Pe(n)),i=Pe('<div data-tooltip-id="'+t+'" class="'+kv+'">'),lt(i,{position:"absolute"}),i.appendChild(n),e.type&&Oe(i).add("djs-tooltip-"+e.type),e.className&&Oe(i).add(e.className),e.htmlContainer=i,r.appendChild(i),this._tooltips[t]=e,this._updateTooltip(e)},St.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;eM(n,t.x,t.y)},St.prototype._updateTooltipVisibilty=function(e){A(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),sp(i,r))})},St.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};const tM={__init__:["tooltips"],tooltips:["type",St]};var nM="flow elements must be children of pools/participants",iM="Data object must be placed within a pool/participant.";function Dv(e,t,n){function i(r,o,a){t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(r){var o=r.context,a=o.shape,s=o.target;b(s,"bpmn:Collaboration")&&(b(a,"bpmn:FlowNode")?i(r,n(nM)):b(a,"bpmn:DataObjectReference")&&i(r,n(iM)))})}Dv.$inject=["eventBus","tooltips","translate"];const rM={__depends__:[tM],__init__:["modelingFeedback"],modelingFeedback:["type",Dv]};var oM=500,aM=1e3;function ji(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=X("rect");return q(a,D({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],oM,function(o){var a=o.element,s=o.gfx,c=Se(".djs-outline",s);c||(c=i.getOutline(a)||r(),ie(s,c)),i.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=Se(".djs-outline",s);c||(c=r(),ie(s,c)),i.updateConnectionOutline(c,a)})}ji.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&A(i,function(r){n=n||r.updateOutline(t,e)}),n||q(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},ji.prototype.updateConnectionOutline=function(e,t){var n=Ye(t);q(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},ji.prototype.registerProvider=function(e,t){t||(t=e,e=aM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},ji.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ji.prototype.getOutline=function(e){var t,n=this._getProviders();return A(n,function(i){Ge(i.getOutline)&&(t=t||i.getOutline(e))}),t},ji.$inject=["eventBus","styles","elementRegistry"];var Ys=6;function lp(e,t,n){this._canvas=t;var i=this;e.on("element.changed",function(r){n.isSelected(r.element)&&i._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(r){var o=r.newSelection;i._updateMultiSelectionOutline(o)})}lp.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");ta(t);var n=e.length>1,i=this._canvas.getContainer();if(me(i)[n?"add":"remove"]("djs-multi-select"),!!n){var r=sM(Ye(e)),o=X("rect");q(o,D({rx:3},r)),me(o).add("djs-selection-outline"),ie(t,o)}},lp.$inject=["eventBus","canvas","selection"];function sM(e){return{x:e.x-Ys,y:e.y-Ys,width:e.width+Ys*2,height:e.height+Ys*2}}const Mv={__depends__:[tn],__init__:["outline","multiSelectionOutline"],outline:["type",ji],multiSelectionOutline:["type",lp]};var cM=500,lM=1250,uM=1500,Xs=Math.round;function pM(e){return{x:e.x+Xs(e.width/2),y:e.y+Xs(e.height/2)}}function Nv(e,t,n,i,r){function o(s,c,l,u){return r.allowed("elements.move",{shapes:s,delta:c,position:l,target:u})}e.on("shape.move.start",uM,function(s){var c=s.context,l=s.shape,u=i.get().slice();u.indexOf(l)===-1&&(u=[l]),u=fM(u),D(c,{shapes:u,validatedShapes:u,shape:l})}),e.on("shape.move.start",lM,function(s){var c=s.context,l=c.validatedShapes,u;if(u=c.canExecute=o(l),!u)return!1}),e.on("shape.move.move",cM,function(s){var c=s.context,l=c.validatedShapes,u=s.hover,p={x:s.dx,y:s.dy},d={x:s.x,y:s.y},h;if(h=o(l,p,d,u),c.delta=p,c.canExecute=h,h===null){c.target=null;return}c.target=u}),e.on("shape.move.end",function(s){var c=s.context,l=c.delta,u=c.canExecute,p=u==="attach",d=c.shapes;if(u===!1)return!1;l.x=Xs(l.x),l.y=Xs(l.y),!(l.x===0&&l.y===0)&&n.moveElements(d,l,c.target,{primaryShape:c.shape,attach:p})}),e.on("element.mousedown",function(s){if(Xn(s)){var c=er(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,l,u){if(nt(l)&&(u=l,l=!1),!(c.waypoints||!c.parent)&&!me(s.target).has("djs-hit-no-move")){var p=pM(c);return t.init(s,p,"shape.move",{cursor:"grabbing",autoActivate:l,data:{shape:c,context:u||{}}}),!0}}this.start=a}Nv.$inject=["eventBus","dragging","modeling","selection","rules"];function fM(e){var t=Wi(e,"id");return ce(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var Ov=499,up="djs-dragging",Iv="drop-ok",Bv="drop-not-ok",Lv="new-parent",$v="attach-ok";function jv(e,t,n,i){function r(c){var l=o(c),u=dM(l);return u}function o(c){var l=Or(c,!0),u=l.flatMap(h=>(h.incoming||[]).concat(h.outgoing||[])),p=l.concat(u),d=[...new Set(p)];return d}function a(c,l){[$v,Iv,Bv,Lv].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}function s(c,l,u){i.addDragger(l,c.dragGroup),u&&t.addMarker(l,up),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}e.on("shape.move.start",Ov,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,d=r(u);if(!l.dragGroup){var h=X("g");q(h,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();ie(m,h),l.dragGroup=h}d.forEach(function(y){i.addDragger(y,l.dragGroup)}),p?p=xc([p,o(u)]):p=o(u),A(p,function(y){t.addMarker(y,up)}),l.allDraggedElements=p,l.differentParents=hM(u)}),e.on("shape.move.move",Ov,function(c){var l=c.context,u=l.dragGroup,p=l.target,d=l.shape.parent,h=l.canExecute;p&&(h==="attach"?a(p,$v):l.canExecute&&d&&p.id!==d.id?a(p,Lv):a(p,l.canExecute?Iv:Bv)),at(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context,u=l.target;u&&a(u,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;A(u,function(d){t.removeMarker(d,up)}),p&&qe(p)}),this.makeDraggable=s}jv.$inject=["eventBus","canvas","styles","previewSupport"];function dM(e){var t=ce(e,function(n){return Ce(n)?_e(e,Jt({id:n.source.id}))&&_e(e,Jt({id:n.target.id})):!0});return t}function hM(e){return T0(Wi(e,function(t){return t.parent&&t.parent.id}))!==1}const mM={__depends__:[Da,tn,Mv,yn,kn,dr],__init__:["move","movePreview"],move:["type",Nv],movePreview:["type",jv]};var Fv=".djs-palette-toggle",Hv=".entry",gM=Fv+", "+Hv,pp="djs-palette-",yM="shown",fp="open",Vv="two-column",vM=1e3;function We(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}We.$inject=["eventBus","canvas"],We.prototype.registerProvider=function(e,t){t||(t=e,e=vM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},We.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(bM,{})},We.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},We.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Pe(We.HTML_MARKUP);n.appendChild(i),Oe(n).add(pp+yM),Pt.bind(i,gM,"click",function(r){var o=r.delegateTarget;if(lf(o,Fv))return e.toggle();e.trigger("click",r)}),ae.bind(i,"mousedown",function(r){r.stopPropagation()}),Pt.bind(i,Hv,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},We.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},We.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,i=this._eventBus,r,o=Oe(n),a=Oe(t);"twoColumn"in e?r=e.twoColumn:r=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(Vv,r),a.toggle(pp+Vv,r),"open"in e&&(o.toggle(fp,e.open),a.toggle(pp+fp,e.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})},We.prototype._update=function(){var e=Se(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Zo(e),A(t,function(n,i){var r=n.group||"default",o=Se("[data-group="+qr(r)+"]",e);o||(o=Pe('<div class="group"></div>'),ut(o,"data-group",r),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=Pe(a);if(o.appendChild(s),!n.separator&&(ut(s,"data-action",i),n.title&&ut(s,"title",n.title),n.className&&_M(s,n.className),n.imageUrl)){var c=Pe("<img>");ut(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},We.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=ut(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},We.prototype.triggerEntry=function(e,t,n,i){var r=this._entries,o,a;if(o=r[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Ge(a)){if(t==="click")return a(n,i)}else if(a[t])return a[t](n,i);n.preventDefault()}},We.prototype._layoutChanged=function(){this._toggleState({})},We.prototype._needsCollapse=function(e,t){var n=50,i=Object.keys(t).length*46;return e<i+n},We.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},We.prototype.open=function(){this._toggleState({open:!0})},We.prototype.toggle=function(){this.isOpen()?this.close():this.open()},We.prototype.isActiveTool=function(e){return e&&this._activeTool===e},We.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=Se(".djs-palette-entries",this._container),this._toolsContainer=Se("[data-group=tools]",t)),n=this._toolsContainer,A(n.children,function(i){var r=i.getAttribute("data-action");if(r){var o=Oe(i);r=r.replace("-tool",""),o.contains("entry")&&r===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},We.prototype.isOpen=function(){return Oe(this._container).has(fp)},We.prototype._getParentContainer=function(){return this._canvas.getContainer()},We.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function _M(e,t){var n=Oe(e),i=oe(t)?t:t.split(/\s+/g);i.forEach(function(r){n.add(r)})}function bM(e,t){var n=t.getPaletteEntries();return Ge(n)?n(e):(A(n,function(i,r){e[r]=i}),e)}const EM={__init__:["palette"],palette:["type",We]};var zv="crosshair";function Fi(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var u=t.getActiveLayer(),p;p=l.frame=X("rect"),q(p,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ie(u,p)},update:function(l){var u=l.frame,p=l.bbox;q(u,{x:p.x,y:p.y,width:p.width,height:p.height})},remove:function(l){l.frame&&qe(l.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var u=l.originalEvent.target;!l.hover&&!(u instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var u=l.context,p=dp(l),d=i.filter(function(m){return m}),h=Aa(l);s.select(d,p,h?u.selection:[])}),e.on("lasso.start",function(l){var u=l.context;u.bbox=dp(l),c.create(u),u.selection=r.get()}),e.on("lasso.move",function(l){var u=l.context;u.bbox=dp(l),c.update(u)}),e.on("lasso.cleanup",function(l){var u=l.context;c.remove(u)}),e.on("element.mousedown",1500,function(l){if(Aa(l))return s.activateLasso(l.originalEvent),!0})}Fi.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Fi.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:zv,data:{context:{}}})},Fi.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:zv,data:{context:{}},keepSelection:!0})},Fi.prototype.select=function(e,t,n=[]){var i=wf(e,t);this._selection.select([...n,...Yo(i)])},Fi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Fi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function dp(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},i;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?i={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?i={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?i={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?i={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:i={x:n.x,y:n.y,width:0,height:0},i}const xM={__depends__:[ws,po],__init__:["lassoTool"],lassoTool:["type",Fi]};var hp=1500,Wv="grab";function xr(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",hp,function(c){if(Yr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(hp,function(c){if(!(!Uv(c.keyEvent)||a.isActive())){var l=a._mouse.getLastMoveEvent();a.activateMove(l,!!l)}},"keyboard.keydown"),s&&s.addListener(hp,function(c){!Uv(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var l=c.originalEvent.target;if(!c.hover&&!(l instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var l=t.viewbox().scale;t.scroll({dx:c.dx*l,dy:c.dy*l})}),e.on("hand.move.end",function(c){var l=c.context,u=l.reactivate;return!Yr(c)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}xr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],xr.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Wv,data:{context:n||{}}})},xr.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Wv,data:{context:{reactivate:n}}})},xr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},xr.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function Uv(e){return rt("Space",e)}const wM={__depends__:[ws,po],__init__:["handTool"],handTool:["type",xr]};var Gv="connect-ok",Kv="connect-not-ok";function wr(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var l=c.context,u=c.hover,p=l.canStartConnect=s.canStartConnect(u);p!==null&&(l.startTarget=u,i.addMarker(u,p?Gv:Kv))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var l=c.context.startTarget,u=c.context.canStartConnect;l&&i.removeMarker(l,u?Gv:Kv)}),e.on(["global-connect.ended"],function(c){var l=c.context,u=l.startTarget,p={x:c.x,y:c.y},d=s.canStartConnect(u);if(d)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}wr.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],wr.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},wr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},wr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},wr.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const SM={__depends__:[Ll,yn,kn,ws,po],globalConnect:["type",wr]};function mp(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}mp.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],mp.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(p,d,h,m,y){function g(w){var C=n.createShape(D({type:p},y));t.start(w,C)}return{group:d,className:h,title:m,action:{dragstart:g,click:g}}}function l(p){var d=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),h=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:d});t.start(p,[d,h],{hints:{autoSelect:[d]}})}function u(p){t.start(p,n.createParticipantShape())}return D(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(p){o.activateHand(p)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(p){r.activateSelection(p)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(p){i.activateSelection(p)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(p){a.start(p)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};const CM={__depends__:[EM,Es,fy,xM,wM,SM,wa],__init__:["paletteProvider"],paletteProvider:["type",mp]};var RM=250;function gp(e,t,n,i,r){F.call(this,e);function o(s){var c=s.canExecute.replacements;A(c,function(l){var u=l.oldElementId,p={type:l.newElementType};if(!s.visualReplacements[u]){var d=t.get(u);D(p,{x:d.x,y:d.y});var h=n.createShape(p);i.addShape(h,d.parent);var m=Se('[data-element-id="'+qr(d.id)+'"]',s.dragGroup);m&&q(m,{display:"none"});var y=r.addDragger(h,s.dragGroup);s.visualReplacements[u]=y,i.removeShape(h)}})}function a(s){var c=s.visualReplacements;A(c,function(l,u){var p=Se('[data-element-id="'+qr(u)+'"]',s.dragGroup);p&&q(p,{display:"inline"}),l.remove(),c[u]&&delete c[u]})}e.on("shape.move.move",RM,function(s){var c=s.context,l=c.canExecute;c.visualReplacements||(c.visualReplacements={}),l&&l.replacements?o(c):a(c)})}gp.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],Y(gp,F);const TM={__depends__:[dr],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",gp]};var PM=1250,yp=40,AM=20,kM=10,qv=20,Yv=["x","y"],DM=Math.abs;function Xv(e){e.on(["connect.hover","connect.move","connect.end"],PM,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&Ft(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&MM(t,o,BM(o)),o&&IM(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Vt(r),le(o,["bpmn:Event","bpmn:Gateway"])&&Zv(t,Vt(o)),le(o,["bpmn:Task","bpmn:SubProcess"])&&NM(t,o),b(a,"bpmn:BoundaryEvent")&&s===a.host&&OM(t)):Jv(i,"bpmn:MessageFlow")?(b(r,"bpmn:Event")&&(n.connectionStart=Vt(r)),b(o,"bpmn:Event")&&Zv(t,Vt(o))):n.connectionStart=n.initialConnectionStart)})}Xv.$inject=["eventBus"];function MM(e,t,n){Yv.forEach(function(i){var r=Qv(i,t);e[i]<t[i]+n?ze(e,i,t[i]+n):e[i]>t[i]+r-n&&ze(e,i,t[i]+r-n)})}function NM(e,t){var n=Vt(t);Yv.forEach(function(i){LM(e,t,i)&&ze(e,i,n[i])})}function OM(e){var t=e.context,n=t.source,i=t.target;if(!$M(t)){var r=Vt(n),o=pt(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],l;DM(c-r[s])<yp&&(c>r[s]?l=r[s]+yp:l=r[s]-yp,ze(e,s,l))})}}function Zv(e,t){ze(e,"x",t.x),ze(e,"y",t.y)}function Jv(e,t){return e&&e.type===t}function IM(e,t){return jn(t,function(n){return Jv(e,n)})}function Qv(e,t){return e==="x"?t.width:t.height}function BM(e){return b(e,"bpmn:Task")?kM:AM}function LM(e,t,n){return e[n]>t[n]+qv&&e[n]<t[n]+Qv(n,t)-qv}function $M(e){var t=e.hover,n=e.source;return t&&n&&t===n}function fi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}fi.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},fi.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},fi.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},fi.prototype.getSnapLocations=function(){return this._snapLocations},fi.prototype.setSnapLocations=function(e){this._snapLocations=e},fi.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Zs,n.initDefaults(this._defaultSnaps)),n};function Zs(){this._snapValues={}}Zs.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Zs.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&qR(e[n],r[n],i)},Zs.prototype.initDefaults=function(e){var t=this;A(e||{},function(n,i){A(n,function(r){t.add(i,r)})})};var jM=1250;function _n(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],jM,function(r){var o=r.context,a=o.shape,s=o.snapContext,c=o.target;if(!(r.originalEvent&&Ft(r.originalEvent))&&!(fr(r)||!c)){var l=s.pointsForTarget(c);l.initialized||(l=i.addSnapTargetPoints(l,a,c),l.initialized=!0),n.snap(r,l)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}_n.$inject=["elementRegistry","eventBus","snapping"],_n.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,i=n.shape,r=n.snapContext;r||(r=n.snapContext=new fi);var o;t.get(i.id)?o=Vt(i,e):o={x:e.x+Vt(i).x,y:e.y+Vt(i).y};var a={x:o.x-i.width/2,y:o.y-i.height/2},s={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ge(i)||(r.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),r.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),r},_n.prototype.addSnapTargetPoints=function(e,t,n){var i=this.getSnapTargets(t,n);return A(i,function(r){if(ge(r)){ge(t)&&e.add("mid",Vt(r));return}if(Ce(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);A(o,function(a){e.add("mid",a)});return}e.add("mid",Vt(r))}),!ee(t.x)||!ee(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",Vt(t)),e},_n.prototype.getSnapTargets=function(e,t){return Pm(t).filter(function(n){return!FM(n)})};function FM(e){return!!e.hidden}var e_=1500;function Sr(e,t){t.invoke(_n,this),e.on(["create.move","create.end"],e_,WM),e.on(["create.move","create.end","shape.move.move","shape.move.end"],e_,function(n){var i=n.context,r=i.canExecute,o=i.target,a=r&&(r==="attach"||r.attach);a&&!fr(n)&&HM(n,o)})}Y(Sr,_n),Sr.$inject=["eventBus","injector"],Sr.prototype.initSnap=function(e){var t=_n.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return A(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",n_(o,i,e))}),A(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",n_(o,i,e))}),b(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Sr.prototype.addSnapTargetPoints=function(e,t,n){_n.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);A(i,function(o){(zM(o)||VM([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Rm(o)),e.add("bottom-right",Tm(o)))});var r=this._elementRegistry;return A(t.incoming,function(o){if(r.get(t.id)){t_(i,o.source)||e.add("mid",te(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),A(t.outgoing,function(o){if(r.get(t.id)){t_(i,o.target)||e.add("mid",te(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),b(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Sr.prototype.getSnapTargets=function(e,t){return _n.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!b(n,"bpmn:Lane")})};function HM(e,t){var n=Q(t),i=Cg(e,t),r=e.context,o=r.shape,a;o.parent?a={x:0,y:0}:a=te(o),/top/.test(i)?ze(e,"y",n.top-a.y):/bottom/.test(i)&&ze(e,"y",n.bottom-a.y),/left/.test(i)?ze(e,"x",n.left-a.x):/right/.test(i)&&ze(e,"x",n.right-a.x)}function VM(e,t){return e.every(function(n){return b(n,t)})}function zM(e){return b(e,"bpmn:SubProcess")&&fe(e)?!0:b(e,"bpmn:Participant")}function WM(e){var t=e.context,n=t.createConstraints;if(n){var i=n.top,r=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||r&&r<=e.x)&&ze(e,"x",e.x),(i&&i>=e.y||o&&o<=e.y)&&ze(e,"y",e.y)}}function t_(e,t){return e.indexOf(t)!==-1}function n_(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var UM=1250;function Bo(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],UM,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&Ft(i.originalEvent))&&!fr(i)){var l=c.pointsForTarget(a);l.initialized||(l=n.addSnapTargetPoints(l,o,a,s),l.initialized=!0),qM(s)&&ze(i,"x",i.x),YM(s)&&ze(i,"y",i.y),t.snap(i,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}Bo.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new fi);var o=i_(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Bo.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return A(r,function(o){e.add("corner",Tm(o)),e.add("corner",Rm(o))}),e.add("corner",i_(t,i)),e},Bo.$inject=["eventBus","snapping"],Bo.prototype.getSnapTargets=function(e,t){return Pm(t).filter(function(n){return!GM(n,e)&&!Ce(n)&&!KM(n)&&!ge(n)})};function i_(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function GM(e,t){return e.host===t}function KM(e){return!!e.hidden}function qM(e){return e==="n"||e==="s"}function YM(e){return e==="e"||e==="w"}var XM=7,ZM=1e3;function di(e){this._canvas=e,this._asyncHide=rf(xt(this.hide,this),ZM)}di.$inject=["canvas"],di.prototype.snap=function(e,t){var n=e.context,i=n.snapContext,r=i.getSnapLocations(),o={x:fr(e,"x"),y:fr(e,"y")};A(r,function(a){var s=i.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(A(["x","y"],function(l){var u;o[l]||(u=t.snap(c,a,l,XM),u!==void 0&&(o[l]={value:u,originValue:u-s[l]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),A(["x","y"],function(a){var s=o[a];nt(s)&&ze(e,a,s.originValue)})},di.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=X("path");return q(n,{d:"M0,0 L0,0"}),me(n).add("djs-snap-line"),ie(t,n),{update:function(i){ee(i)?e==="horizontal"?q(n,{d:"M-100000,"+i+" L+100000,"+i,display:""}):q(n,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):q(n,{display:"none"})}}},di.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},di.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},di.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},di.prototype.hide=function(){A(this._snapLines,function(e){e.update()})};const JM={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",_n],resizeSnapping:["type",Bo],snapping:["type",di]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Xv],createMoveSnapping:["type",Sr]};var r_=300;function re(e,t,n,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=Se(re.INPUT_SELECTOR,this._container),this._resultsContainer=Se(re.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}re.$inject=["canvas","eventBus","selection","translate"],re.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Pt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,re.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,re.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,re.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,re.INPUT_SELECTOR,"keydown",function(n){rt("ArrowUp",n)&&n.preventDefault(),rt("ArrowDown",n)&&n.preventDefault()}),t(this._container,re.INPUT_SELECTOR,"keyup",function(n){if(rt("Escape",n))return e.close();if(rt("Enter",n)){var i=e._getCurrentResult();return i?e._select(i):e.close(!1)}if(rt("ArrowUp",n))return e._scrollToDirection(!0);if(rt("ArrowDown",n))return e._scrollToDirection();rt(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},re.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Pt.unbind(e.el,e.type,e.listener)})},re.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(r){return!t._canvas.getRootElements().includes(r.element)}),!n.length){this._selection.select(null);return}n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=Se(re.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}},re.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},re.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},re.prototype._clearResults=function(){Zo(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},re.prototype._getCurrentResult=function(){return Se(re.RESULT_SELECTED_SELECTOR,this._resultsContainer)},re.prototype._createResultNode=function(e,t){var n=Pe(re.RESULT_HTML);return e.primaryTokens.length>0&&o_(n,e.primaryTokens,re.RESULT_PRIMARY_HTML),o_(n,e.secondaryTokens,re.RESULT_SECONDARY_HTML),ut(n,re.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},re.prototype.registerProvider=function(e){this._searchProvider=e},re.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Oe(this._canvas.getContainer()).add("djs-search-open"),Oe(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},re.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Oe(this._canvas.getContainer()).remove("djs-search-open"),Oe(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},re.prototype.toggle=function(){this.isOpen()?this.close():this.open()},re.prototype.isOpen=function(){return this._open},re.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Oe(t).remove(re.RESULT_SELECTED_CLASS);var n=ut(e,re.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Oe(e).add(re.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:r_}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},re.prototype._select=function(e){var t=ut(e,re.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:r_}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},re.prototype._getBoxHtml=function(){const e=Pe(re.BOX_HTML),t=Se(re.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function o_(e,t,n){var i=QM(t),r=Pe(n);r.innerHTML=i,e.appendChild(r)}function QM(e){var t="";return e.forEach(function(n){var i=Nd(n.value||n.matched||n.normal),r=n.match||n.matched;r?t+='<b class="'+re.RESULT_HIGHLIGHT_CLASS+'">'+i+"</b>":t+=i}),t!==""?t:null}re.CONTAINER_SELECTOR=".djs-search-container",re.INPUT_SELECTOR=".djs-search-input input",re.RESULTS_CONTAINER_SELECTOR=".djs-search-results",re.RESULT_SELECTOR=".djs-search-result",re.RESULT_SELECTED_CLASS="djs-search-result-selected",re.RESULT_SELECTED_SELECTOR="."+re.RESULT_SELECTED_CLASS,re.RESULT_ID_ATTRIBUTE="data-result-id",re.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",re.BOX_HTML=`<div class="djs-search-container djs-scrollable">
233
233
  <div class="djs-search-input">
234
234
  <svg class="djs-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
235
235
  <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
@@ -237,4 +237,4 @@
237
237
  <input type="text" spellcheck="false" />
238
238
  </div>
239
239
  <div class="djs-search-results" />
240
- </div>`,re.RESULT_HTML='<div class="djs-search-result"></div>',re.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',re.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const t2={__depends__:[wa,Ra,en],searchPad:["type",re]};function yp(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._search=i,t.registerProvider(this)}yp.$inject=["elementRegistry","searchPad","canvas","search"],yp.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(i){return!ge(i)&&!t.includes(i)});return this._search(n.map(i=>({element:i,label:Qt(i),id:i.id})),e,{keys:["label","id"]}).map(n2)};function n2(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}const i2={__depends__:[t2,Uh],__init__:["bpmnSearch"],bpmnSearch:["type",yp]},r2="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",o2="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",a2={width:36,height:50},s2={width:50,height:50};function a_(e,t,n){return X("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}const Cr=5;function Js(e,t){this._styles=t,e.registerProvider(this)}Js.$inject=["outline","styles"],Js.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!ge(e))return b(e,"bpmn:Gateway")?(n=X("rect"),D(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),G(n,D({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):le(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=X("rect"),G(n,D({x:-5,y:-5,rx:14,width:e.width+Cr*2,height:e.height+Cr*2},t))):b(e,"bpmn:EndEvent")?(n=X("circle"),G(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr+1},t))):b(e,"bpmn:Event")?(n=X("circle"),G(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr},t))):b(e,"bpmn:DataObjectReference")&&s_(e,"bpmn:DataObjectReference")?n=a_(r2,{x:-6,y:-6},t):b(e,"bpmn:DataStoreReference")&&s_(e,"bpmn:DataStoreReference")&&(n=a_(o2,{x:-6,y:-6},t)),n},Js.prototype.updateOutline=function(e,t){if(!ge(e))return le(e,["bpmn:SubProcess","bpmn:Group"])?(G(t,{width:e.width+Cr*2,height:e.height+Cr*2}),!0):!!le(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function s_(e,t){var n;return t==="bpmn:DataObjectReference"?n=a2:t==="bpmn:DataStoreReference"&&(n=s2),e.width===n.width&&e.height===n.height}const c2={__depends__:[My],__init__:["outlineProvider"],outlineProvider:["type",Js]};var l2='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function on(e){zr.call(this,e)}Y(on,zr),on.Viewer=Xn,on.NavigatedViewer=Zr,on.prototype.createDiagram=function(){return this.importXML(l2)},on.prototype._interactionModules=[Qd,ih,ah],on.prototype._modelingModules=[cR,Rl,DR,CR,ZR,Ll,iT,uD,tv,Es,hD,vD,MD,OD,ID,FD,JD,qv,oM,gM,RM,PM,Ry,QM,i2,c2],on.prototype._modules=[].concat(Xn.prototype._modules,on.prototype._interactionModules,on.prototype._modelingModules);const u2={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:JSON.parse('[{"name":"Definitions","isAbstract":true,"extends":["bpmn:Definitions"],"properties":[{"name":"diagramRelationId","isAttr":true,"type":"String"}]},{"name":"InOutBinding","superClass":["Element"],"isAbstract":true,"properties":[{"name":"source","isAttr":true,"type":"String"},{"name":"sourceExpression","isAttr":true,"type":"String"},{"name":"target","isAttr":true,"type":"String"},{"name":"businessKey","isAttr":true,"type":"String"},{"name":"local","isAttr":true,"type":"Boolean","default":false},{"name":"variables","isAttr":true,"type":"String"}]},{"name":"In","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{"name":"Out","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity"]}},{"name":"AsyncCapable","isAbstract":true,"extends":["bpmn:Activity","bpmn:Gateway","bpmn:Event"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false},{"name":"asyncBefore","isAttr":true,"type":"Boolean","default":false},{"name":"asyncAfter","isAttr":true,"type":"Boolean","default":false},{"name":"exclusive","isAttr":true,"type":"Boolean","default":true}]},{"name":"JobPriorized","isAbstract":true,"extends":["bpmn:Process","camunda:AsyncCapable"],"properties":[{"name":"jobPriority","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false}]},{"name":"ErrorEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ErrorEventDefinition"],"properties":[{"name":"errorCodeVariable","isAttr":true,"type":"String"},{"name":"errorMessageVariable","isAttr":true,"type":"String"}]},{"name":"ErrorEventDefinition","superClass":["bpmn:ErrorEventDefinition","Element"],"properties":[{"name":"expression","isAttr":true,"type":"String"}],"meta":{"allowedIn":["bpmn:ServiceTask"]}},{"name":"Error","isAbstract":true,"extends":["bpmn:Error"],"properties":[{"name":"camunda:errorMessage","isAttr":true,"type":"String"}]},{"name":"PotentialStarter","superClass":["Element"],"properties":[{"name":"resourceAssignmentExpression","type":"bpmn:ResourceAssignmentExpression"}]},{"name":"FormSupported","isAbstract":true,"extends":["bpmn:StartEvent","bpmn:UserTask"],"properties":[{"name":"formHandlerClass","isAttr":true,"type":"String"},{"name":"formKey","isAttr":true,"type":"String"},{"name":"formRef","isAttr":true,"type":"String"},{"name":"formRefBinding","isAttr":true,"type":"String"},{"name":"formRefVersion","isAttr":true,"type":"String"}]},{"name":"TemplateSupported","isAbstract":true,"extends":["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],"properties":[{"name":"modelerTemplate","isAttr":true,"type":"String"},{"name":"modelerTemplateVersion","isAttr":true,"type":"Integer"}]},{"name":"Initiator","isAbstract":true,"extends":["bpmn:StartEvent"],"properties":[{"name":"initiator","isAttr":true,"type":"String"}]},{"name":"ScriptTask","isAbstract":true,"extends":["bpmn:ScriptTask"],"properties":[{"name":"resultVariable","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Process","isAbstract":true,"extends":["bpmn:Process"],"properties":[{"name":"candidateStarterGroups","isAttr":true,"type":"String"},{"name":"candidateStarterUsers","isAttr":true,"type":"String"},{"name":"versionTag","isAttr":true,"type":"String"},{"name":"historyTimeToLive","isAttr":true,"type":"String"},{"name":"isStartableInTasklist","isAttr":true,"type":"Boolean","default":true}]},{"name":"EscalationEventDefinitionExtension","isAbstract":true,"extends":["bpmn:EscalationEventDefinition"],"properties":[{"name":"escalationCodeVariable","isAttr":true,"type":"String"}]},{"name":"FormalExpression","isAbstract":true,"extends":["bpmn:FormalExpression"],"properties":[{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Assignable","extends":["bpmn:UserTask"],"properties":[{"name":"assignee","isAttr":true,"type":"String"},{"name":"candidateUsers","isAttr":true,"type":"String"},{"name":"candidateGroups","isAttr":true,"type":"String"},{"name":"dueDate","isAttr":true,"type":"String"},{"name":"followUpDate","isAttr":true,"type":"String"},{"name":"priority","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"calledElementBinding","isAttr":true,"type":"String","default":"latest"},{"name":"calledElementVersion","isAttr":true,"type":"String"},{"name":"calledElementVersionTag","isAttr":true,"type":"String"},{"name":"calledElementTenantId","isAttr":true,"type":"String"},{"name":"caseRef","isAttr":true,"type":"String"},{"name":"caseBinding","isAttr":true,"type":"String","default":"latest"},{"name":"caseVersion","isAttr":true,"type":"String"},{"name":"caseTenantId","isAttr":true,"type":"String"},{"name":"variableMappingClass","isAttr":true,"type":"String"},{"name":"variableMappingDelegateExpression","isAttr":true,"type":"String"}]},{"name":"ServiceTaskLike","extends":["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"resultVariable","isAttr":true,"type":"String"}]},{"name":"DmnCapable","extends":["bpmn:BusinessRuleTask"],"properties":[{"name":"decisionRef","isAttr":true,"type":"String"},{"name":"decisionRefBinding","isAttr":true,"type":"String","default":"latest"},{"name":"decisionRefVersion","isAttr":true,"type":"String"},{"name":"mapDecisionResult","isAttr":true,"type":"String","default":"resultList"},{"name":"decisionRefTenantId","isAttr":true,"type":"String"}]},{"name":"ExternalCapable","extends":["camunda:ServiceTaskLike"],"properties":[{"name":"type","isAttr":true,"type":"String"},{"name":"topic","isAttr":true,"type":"String"}]},{"name":"TaskPriorized","extends":["bpmn:Process","camunda:ExternalCapable"],"properties":[{"name":"taskPriority","isAttr":true,"type":"String"}]},{"name":"Properties","superClass":["Element"],"meta":{"allowedIn":["*"]},"properties":[{"name":"values","type":"Property","isMany":true}]},{"name":"Property","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"value","type":"String","isAttr":true}]},{"name":"Connector","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"}]},{"name":"InputOutput","superClass":["Element"],"meta":{"allowedIn":["bpmn:FlowNode","camunda:Connector"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"},{"name":"inputParameters","isMany":true,"type":"InputParameter"},{"name":"outputParameters","isMany":true,"type":"OutputParameter"}]},{"name":"InputOutputParameter","properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"InputOutputParameterDefinition","isAbstract":true},{"name":"List","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"items","isMany":true,"type":"InputOutputParameterDefinition"}]},{"name":"Map","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"entries","isMany":true,"type":"Entry"}]},{"name":"Entry","properties":[{"name":"key","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"Value","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"id","isAttr":true,"type":"String"},{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Script","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"scriptFormat","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Field","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},"properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"expression","type":"String"},{"name":"stringValue","isAttr":true,"type":"String"},{"name":"string","type":"String"}]},{"name":"InputParameter","superClass":["InputOutputParameter"]},{"name":"OutputParameter","superClass":["InputOutputParameter"]},{"name":"Collectable","isAbstract":true,"extends":["bpmn:MultiInstanceLoopCharacteristics"],"superClass":["camunda:AsyncCapable"],"properties":[{"name":"collection","isAttr":true,"type":"String"},{"name":"elementVariable","isAttr":true,"type":"String"}]},{"name":"FailedJobRetryTimeCycle","superClass":["Element"],"meta":{"allowedIn":["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"ExecutionListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true}]},{"name":"TaskListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:UserTask"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true},{"name":"id","type":"String","isAttr":true},{"name":"eventDefinitions","type":"bpmn:TimerEventDefinition","isMany":true}]},{"name":"FormProperty","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"required","type":"String","isAttr":true},{"name":"readable","type":"String","isAttr":true},{"name":"writable","type":"String","isAttr":true},{"name":"variable","type":"String","isAttr":true},{"name":"expression","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"default","type":"String","isAttr":true},{"name":"values","type":"Value","isMany":true}]},{"name":"FormData","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"fields","type":"FormField","isMany":true},{"name":"businessKey","type":"String","isAttr":true}]},{"name":"FormField","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"label","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"defaultValue","type":"String","isAttr":true},{"name":"properties","type":"Properties"},{"name":"validation","type":"Validation"},{"name":"values","type":"Value","isMany":true}]},{"name":"Validation","superClass":["Element"],"properties":[{"name":"constraints","type":"Constraint","isMany":true}]},{"name":"Constraint","superClass":["Element"],"properties":[{"name":"name","type":"String","isAttr":true},{"name":"config","type":"String","isAttr":true}]},{"name":"ConditionalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ConditionalEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"},{"name":"variableEvents","isAttr":true,"type":"String"}]}]'),emumerations:[]},p2={class:"wrapper"},f2={class:"mt-xs"},d2={class:"flex-sc"},h2={class:"mt-xs"},m2=gi(h.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(e,{emit:t}){const{t:n}=an.useI18n(),i=e,r=t,o=h.ref({});function a(p){const f=p.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${f}}`)}function s(p){if(typeof p=="string"&&(p.trim().startsWith("{")||p.trim().startsWith("[")))try{return JSON.parse(p),!0}catch{return!1}return!1}function c(){i.jsonStr?s(i.jsonStr)?o.value=JSON.parse(i.jsonStr):o.value=a(i.jsonStr):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1}}function l(){st.Modal.destroyAll()}function u(){const p=o.value;if(p.timeoutConfigSwitch&&!p.timeoutPeriod){st.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}r("submit",o.value),st.Modal.destroyAll()}return h.onMounted(()=>{c()}),(p,f)=>{const d=K.Checkbox,m=K.FormItem,v=K.Radio,g=K.RadioGroup,w=K.InputNumber,C=K.Form,x=K.Button,E=K.Space;return h.openBlock(),h.createElementBlock("div",p2,[h.createVNode(C,{class:"my-nm","label-col":{span:6},"wrapper-col":{span:18},colon:!1,model:h.unref(o)},{default:h.withCtx(()=>[h.createVNode(m,{label:p.$t("bpmn.revertRule")},{default:h.withCtx(()=>[h.createVNode(d,{checked:h.unref(o).revokeRule,"onUpdate:checked":f[0]||(f[0]=S=>h.unref(o).revokeRule=S)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),h.createVNode(m,{label:p.$t("bpmn.rollbackRule")},{default:h.withCtx(()=>[h.createVNode(d,{checked:h.unref(o).fallbackRule,"onUpdate:checked":f[1]||(f[1]=S=>h.unref(o).fallbackRule=S)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),h.createVNode(m,{label:p.$t("bpmn.deduplicationApprovers")},{default:h.withCtx(()=>[h.createElementVNode("div",f2,h.toDisplayString(p.$t("bpmn.deduplicationApproversTxt")),1),h.createVNode(g,{value:h.unref(o).approverRemoveDuplicates,"onUpdate:value":f[2]||(f[2]=S=>h.unref(o).approverRemoveDuplicates=S)},{default:h.withCtx(()=>[h.createVNode(v,{value:0},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.deduplicationRadio0")),1)]),_:1}),h.createVNode(v,{value:1},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.deduplicationRadio1")),1)]),_:1}),h.createVNode(v,{value:2},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),h.createVNode(m,{label:p.$t("bpmn.timeoutRule")},{default:h.withCtx(()=>[h.createVNode(d,{checked:h.unref(o).timeoutConfigSwitch,"onUpdate:checked":f[3]||(f[3]=S=>h.unref(o).timeoutConfigSwitch=S)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),h.unref(o).timeoutConfigSwitch?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createVNode(m,{label:p.$t("wo_my.timeout")},{default:h.withCtx(()=>[h.createElementVNode("div",d2,[h.createTextVNode(h.toDisplayString(p.$t("bpmn.linkTimeoutTxt1"))+" ",1),h.createVNode(w,{class:"mx-xs",value:h.unref(o).timeoutPeriod,"onUpdate:value":f[4]||(f[4]=S=>h.unref(o).timeoutPeriod=S),min:1,max:1e4,precision:0},null,8,["value"]),h.createTextVNode(" "+h.toDisplayString(p.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),h.createVNode(m,{label:p.$t("bpmn.timeoutHandle")},{default:h.withCtx(()=>[h.createElementVNode("div",h2,h.toDisplayString(p.$t("bpmn.timeoutHandleTxt")),1),h.createVNode(g,{value:h.unref(o).timeoutHandler,"onUpdate:value":f[5]||(f[5]=S=>h.unref(o).timeoutHandler=S)},{default:h.withCtx(()=>[h.createVNode(v,{value:0},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),h.createVNode(v,{value:1},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):h.createCommentVNode("",!0)]),_:1},8,["model"]),h.createVNode(E,{class:"modal-btns"},{default:h.withCtx(()=>[h.createVNode(x,{onClick:l},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("common.btn_cancel1")),1)]),_:1}),h.createVNode(x,{type:"primary",onClick:u},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-bc38a637"]]),g2=h.defineComponent({__name:"Process",props:h.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(e){const{modal:t}=st.App.useApp(),{t:n}=an.useI18n(),i=h.useModel(e,"formState"),r=h.ref(["1","2","3","4","5","6"]);function o(){t.info({title:n("ruleModel.title"),content:h.h(m2,{jsonStr:i.value.jobPriority,onSubmit:a=>{i.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const c=K.Input,l=K.FormItem,u=K.Form,p=K.CollapsePanel,f=K.Collapse;return h.openBlock(),h.createBlock(f,{activeKey:h.unref(r),"onUpdate:activeKey":s[4]||(s[4]=d=>h.isRef(r)?r.value=d:null)},{default:h.withCtx(()=>[h.createVNode(p,{key:"1",header:a.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(u,{layout:"vertical",model:i.value},{default:h.withCtx(()=>[h.createVNode(l,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:h.withCtx(()=>[h.createVNode(c,{value:i.value.id,"onUpdate:value":s[0]||(s[0]=d=>i.value.id=d),placeholder:a.$t("common.plsEnter"),readonly:e.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),h.createVNode(l,{label:a.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(c,{value:i.value.name,"onUpdate:value":s[1]||(s[1]=d=>i.value.name=d),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(l,{label:a.$t("FLOW_CHART.Version Tag")},{default:h.withCtx(()=>[h.createVNode(c,{value:i.value.versionTag,"onUpdate:value":s[2]||(s[2]=d=>i.value.versionTag=d),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),h.createVNode(p,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:h.withCtx(()=>[h.createVNode(u,{layout:"vertical",model:i.value},{default:h.withCtx(()=>[h.createVNode(l,{label:a.$t("FLOW_CHART.Job Priority")},{default:h.withCtx(()=>[h.createVNode(c,{value:i.value.jobPriority,"onUpdate:value":s[3]||(s[3]=d=>i.value.jobPriority=d),placeholder:a.$t("common.plsSelect"),readonly:"",onClick:o},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),v2={class:"modal-container"},c_=h.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(e,{emit:t}){const{t:n}=an.useI18n(),i=e,r=t,o=h.ref({}),a=h.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=h.ref([]),c=h.ref();function l(g,w){s.value=g,c.value=w}h.watchEffect(()=>{i.id&&(s.value=[i.id])});function u(g){c.value=null;const w={...o.value};return Object.assign(w,g),Ct.getLinkList(w)}const p=h.ref(),f=()=>{p.value.refresh()},d=()=>{o.value={},f()};h.onMounted(()=>{d()});function m(){st.Modal.destroyAll()}function v(){var g;(g=c.value)!=null&&g.length&&r("submit",c.value[0]),st.Modal.destroyAll()}return(g,w)=>{const C=K.Input,x=K.FormItem,E=K.Button,S=K.Space,R=K.Form,N=h.resolveComponent("a-table-ex");return h.openBlock(),h.createElementBlock("div",v2,[h.createVNode(R,{class:"form-query mx-nm mt-nm",layout:"vertical",model:h.unref(o)},{default:h.withCtx(()=>[h.createVNode(x,{label:g.$t("link.id")},{default:h.withCtx(()=>[h.createVNode(C,{value:h.unref(o).id,"onUpdate:value":w[0]||(w[0]=P=>h.unref(o).id=P),placeholder:g.$t("common.plsEnter"),onKeydown:h.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(x,{label:g.$t("link.description")},{default:h.withCtx(()=>[h.createVNode(C,{value:h.unref(o).description,"onUpdate:value":w[1]||(w[1]=P=>h.unref(o).description=P),placeholder:g.$t("common.plsEnter"),onKeydown:h.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(x,{class:"form-btns"},{default:h.withCtx(()=>[h.createVNode(S,null,{default:h.withCtx(()=>[h.createVNode(E,{type:"primary",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),h.createVNode(E,{onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),h.createVNode(N,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:h.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:h.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),h.createVNode(S,{class:"modal-btns"},{default:h.withCtx(()=>{var P;return[h.createVNode(E,{onClick:m},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),h.createVNode(E,{type:"primary",disabled:!((P=h.unref(s))!=null&&P.length),onClick:v},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),y2={class:"modal-container"},_2=h.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(e,{emit:t}){const{t:n}=an.useI18n(),i=e,r=t,o=h.ref({}),a=h.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=h.ref([]),c=h.ref();function l(g,w){s.value=g,c.value=w}h.watchEffect(()=>{i.userIds&&(s.value=Array.isArray(i.userIds)?i.userIds:[i.userIds])});function u(g){c.value=null;const w={...o.value,branchId:i.branchId};return Object.assign(w,g),Ct.getUserList(w)}const p=h.ref(),f=()=>{p.value.refresh()},d=()=>{o.value={},f()};h.onMounted(()=>{d()});function m(){st.Modal.destroyAll()}function v(){var g;if((g=c.value)!=null&&g.length){const w=c.value;r("submit",i.mode==="multiple"?w:w[0])}st.Modal.destroyAll()}return(g,w)=>{const C=K.Input,x=K.FormItem,E=K.Button,S=K.Space,R=K.Form,N=h.resolveComponent("a-table-ex");return h.openBlock(),h.createElementBlock("div",y2,[h.createVNode(R,{class:"form-query mx-nm mt-nm",layout:"vertical",model:h.unref(o)},{default:h.withCtx(()=>[h.createVNode(x,{label:g.$t("user.key")},{default:h.withCtx(()=>[h.createVNode(C,{value:h.unref(o).userName,"onUpdate:value":w[0]||(w[0]=P=>h.unref(o).userName=P),placeholder:g.$t("common.plsEnter"),onKeydown:h.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(x,{class:"form-btns"},{default:h.withCtx(()=>[h.createVNode(S,null,{default:h.withCtx(()=>[h.createVNode(E,{type:"primary",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),h.createVNode(E,{onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),h.createVNode(N,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:h.unref(a),rowKey:"userId","row-selection":{type:e.mode==="multiple"?"checkbox":"radio",selectedRowKeys:h.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),h.createVNode(S,{class:"modal-btns"},{default:h.withCtx(()=>{var P;return[h.createVNode(E,{onClick:m},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),h.createVNode(E,{type:"primary",disabled:!((P=h.unref(s))!=null&&P.length),onClick:v},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),b2=h.defineComponent({__name:"UserTask",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const{modal:t}=st.App.useApp(),{t:n}=an.useI18n(),i=h.useModel(e,"formState"),r=h.ref(["1","2","3","4","5","6"]),o=h.ref([]),a=h.ref([]),s=h.ref([]),c=h.computed(()=>{const w=i.value.assignee;return w==null?void 0:w.startsWith("${")});function l(){const w="abcdefghijklmnopqrstuvwxyz";let C="";for(let x=0;x<2;x++)C+=w.charAt(Math.floor(Math.random()*w.length));for(let x=0;x<2;x++)C+=Math.floor(Math.random()*10);return C}function u(){t.info({title:n("link.select_link"),content:h.h(c_,{id:i.value.id,onSubmit:w=>{let C=w.id;C.endsWith("*")&&(C=C.substring(0,C.length-1)+l()),Object.assign(i.value,{id:C,name:w.description,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:[],roleArr:[]}),w.variable&&(i.value.assignee=`\${${w.variable}}`)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function p(){t.info({title:n("user.select_user"),content:h.h(_2,{userIds:i.value.assignee,onSubmit:w=>{Object.assign(i.value,{assignee:w.userId,"camunda:assigneeName":w.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function f(){Ct.getBranchTree().then(w=>{w.code===0&&(o.value=w.result||[])})}function d(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};Ct.getUserList(w).then(C=>{var x,E;C.code===0&&(s.value=((E=(x=C.result)==null?void 0:x.data)==null?void 0:E.map(S=>({...S,label:S.userName,value:S.userId})))||[])})}function m(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};Ct.getRoleList(w).then(C=>{var x,E;C.code===0&&(a.value=((E=(x=C.result)==null?void 0:x.data)==null?void 0:E.map(S=>({...S,label:S.roleName,value:S.roleId})))||[])})}function v(){Object.assign(i.value,{userArr:[],roleArr:[]}),d(),m()}function g(w){if(w!=null&&w.length){const C=s.value.find(x=>x.userId===w[0]);i.value.priority!==C.branchId&&(Object.assign(i.value,{priority:C.branchId,roleArr:[]}),d(),m())}}return h.onMounted(()=>{f(),d(),m()}),(w,C)=>{const x=K.Input,E=K.FormItem,S=K.TreeSelect,R=K.Select,N=K.Form,P=K.CollapsePanel,O=K.Radio,I=K.RadioGroup,L=K.Checkbox,B=K.CheckboxGroup,z=K.Collapse;return h.openBlock(),h.createBlock(z,{activeKey:h.unref(r),"onUpdate:activeKey":C[10]||(C[10]=q=>h.isRef(r)?r.value=q:null)},{default:h.withCtx(()=>[h.createVNode(P,{key:"1",header:w.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(N,{layout:"vertical",model:i.value},{default:h.withCtx(()=>[h.createVNode(E,{label:w.$t("FLOW_CHART.Id")},{default:h.withCtx(()=>[h.createVNode(x,{value:i.value.id,"onUpdate:value":C[0]||(C[0]=q=>i.value.id=q),placeholder:w.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(E,{label:w.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(x,{value:i.value.name,"onUpdate:value":C[1]||(C[1]=q=>i.value.name=q),placeholder:w.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(E,{label:w.$t("FLOW_CHART.Assignee")},{default:h.withCtx(()=>[h.unref(c)?(h.openBlock(),h.createBlock(x,{key:0,value:i.value.assignee,"onUpdate:value":C[2]||(C[2]=q=>i.value.assignee=q),placeholder:w.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(h.openBlock(),h.createBlock(x,{key:1,value:i.value["camunda:assigneeName"],"onUpdate:value":C[3]||(C[3]=q=>i.value["camunda:assigneeName"]=q),placeholder:w.$t("common.plsSelect"),readonly:"",onClick:p},null,8,["value","placeholder"]))]),_:1},8,["label"]),h.createVNode(E,{label:w.$t("FLOW_CHART.Priority")},{default:h.withCtx(()=>[h.createVNode(S,{value:i.value.priority,"onUpdate:value":C[4]||(C[4]=q=>i.value.priority=q),placeholder:w.$t("common.plsSelect"),"tree-data":h.unref(o),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:v},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),h.createVNode(E,{label:w.$t("FLOW_CHART.Candidate Users")},{default:h.withCtx(()=>[h.createVNode(R,{value:i.value.userArr,"onUpdate:value":C[5]||(C[5]=q=>i.value.userArr=q),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:h.unref(s),optionFilterProp:"label",disabled:h.unref(c),onChange:g},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),h.createVNode(E,{label:w.$t("FLOW_CHART.Candidate Groups")},{default:h.withCtx(()=>[h.createVNode(R,{value:i.value.roleArr,"onUpdate:value":C[6]||(C[6]=q=>i.value.roleArr=q),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:h.unref(a),optionFilterProp:"label",disabled:h.unref(c)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),h.createVNode(P,{key:"2",header:w.$t("FLOW_CHART.isAllowRollback")},{default:h.withCtx(()=>[h.createVNode(I,{value:i.value.rollback,"onUpdate:value":C[7]||(C[7]=q=>i.value.rollback=q)},{default:h.withCtx(()=>[h.createVNode(O,{value:"1"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.yes")),1)]),_:1}),h.createVNode(O,{value:"0"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"]),h.createVNode(P,{key:"3",header:w.$t("FLOW_CHART.Approval Mode")},{default:h.withCtx(()=>[h.createVNode(I,{value:i.value.approvalSign,"onUpdate:value":C[8]||(C[8]=q=>i.value.approvalSign=q)},{default:h.withCtx(()=>[h.createVNode(O,{value:"orSign"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.Or Sign")),1)]),_:1}),h.createVNode(O,{value:"countersign"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"]),h.createVNode(P,{key:"4",header:w.$t("FLOW_CHART.Approval Required")},{default:h.withCtx(()=>[h.createVNode(B,{value:i.value.approvalCheckbox,"onUpdate:value":C[9]||(C[9]=q=>i.value.approvalCheckbox=q)},{default:h.withCtx(()=>[h.createVNode(L,{value:"advice"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.Comments Required")),1)]),_:1}),h.createVNode(L,{value:"attachment"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),E2=h.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=h.useModel(e,"formState"),n=h.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=K.Input,a=K.FormItem,s=K.Form,c=K.CollapsePanel,l=K.Collapse;return h.openBlock(),h.createBlock(l,{activeKey:h.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>h.isRef(n)?n.value=u:null)},{default:h.withCtx(()=>[h.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(s,{layout:"vertical",model:t.value},{default:h.withCtx(()=>[h.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),x2=h.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=h.useModel(e,"formState"),n=h.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=K.Input,a=K.FormItem,s=K.SelectOption,c=K.Select,l=K.Form,u=K.CollapsePanel,p=K.Collapse;return h.openBlock(),h.createBlock(p,{activeKey:h.unref(n),"onUpdate:activeKey":r[4]||(r[4]=f=>h.isRef(n)?n.value=f:null)},{default:h.withCtx(()=>[h.createVNode(u,{key:"1",header:i.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(l,{layout:"vertical",model:t.value},{default:h.withCtx(()=>[h.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=f=>t.value.id=f),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=f=>t.value.name=f),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(a,{label:i.$t("FLOW_CHART.Condition Type")},{default:h.withCtx(()=>[h.createVNode(c,{value:t.value.condType,"onUpdate:value":r[2]||(r[2]=f=>t.value.condType=f),placeholder:i.$t("common.plsSelect"),allowClear:""},{default:h.withCtx(()=>[h.createVNode(s,{value:"bpmn:FormalExpression"},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(i.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),t.value.condType==="bpmn:FormalExpression"?(h.openBlock(),h.createBlock(a,{key:0,label:i.$t("FLOW_CHART.Expression")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.condBody,"onUpdate:value":r[3]||(r[3]=f=>t.value.condBody=f),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):h.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),w2=h.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const{modal:t}=st.App.useApp(),{t:n}=an.useI18n(),i=h.useModel(e,"formState"),r=h.ref(["1","2","3","4","5","6"]);function o(){const s="abcdefghijklmnopqrstuvwxyz";let c="";for(let l=0;l<2;l++)c+=s.charAt(Math.floor(Math.random()*s.length));for(let l=0;l<2;l++)c+=Math.floor(Math.random()*10);return c}function a(){t.info({title:n("link.select_link"),content:h.h(c_,{id:i.value.id,onSubmit:s=>{let c=s.id;c.endsWith("*")&&(c=c.substring(0,c.length-1)+o()),Object.assign(i.value,{id:c,name:s.description})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(s,c)=>{const l=K.Input,u=K.FormItem,p=K.Form,f=K.CollapsePanel,d=K.Collapse;return h.openBlock(),h.createBlock(d,{activeKey:h.unref(r),"onUpdate:activeKey":c[2]||(c[2]=m=>h.isRef(r)?r.value=m:null)},{default:h.withCtx(()=>[h.createVNode(f,{key:"1",header:s.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(p,{layout:"vertical",model:i.value},{default:h.withCtx(()=>[h.createVNode(u,{label:s.$t("FLOW_CHART.Id")},{default:h.withCtx(()=>[h.createVNode(l,{value:i.value.id,"onUpdate:value":c[0]||(c[0]=m=>i.value.id=m),placeholder:s.$t("common.plsEnter"),readonly:"",onClick:a},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(u,{label:s.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(l,{value:i.value.name,"onUpdate:value":c[1]||(c[1]=m=>i.value.name=m),placeholder:s.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),S2=h.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=h.useModel(e,"formState"),n=h.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=K.Input,a=K.FormItem,s=K.Form,c=K.CollapsePanel,l=K.Collapse;return h.openBlock(),h.createBlock(l,{activeKey:h.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>h.isRef(n)?n.value=u:null)},{default:h.withCtx(()=>[h.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:h.withCtx(()=>[h.createVNode(s,{layout:"vertical",model:t.value},{default:h.withCtx(()=>[h.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),h.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:h.withCtx(()=>[h.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),C2={class:"properties-panel"},R2=gi(h.defineComponent({__name:"BpmnPropertiesPanel",props:{modeler:{type:on},isEdit:{type:Boolean}},setup(e){const t=e,n=h.ref(""),i=h.ref({});let r,o,a;h.watch(()=>t.modeler,()=>{t.modeler&&(r=t.modeler,s())}),h.watch(i,(u,p)=>{u===p&&l()},{deep:!0});function s(){o=r.get("modeling"),r.on("element.click",u=>{c(u.element)}),r.on("selection.changed",u=>{if(u.newSelection.length)c(u.newSelection[0]);else{const p=r.get("canvas").getRootElement();c(p)}})}function c(u){if(!(u!=null&&u.businessObject)||a===u)return;a=u;const p=u.businessObject,f=p.$type;n.value="",h.nextTick(()=>{n.value=f});const d={...p.$attrs};Object.keys(p).forEach(m=>{const v=p[m];typeof v=="string"&&(d[m]=v)}),f==="bpmn:UserTask"?(Object.assign(d,{rollback:d["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(d,{approvalSign:d["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),d["camunda:advice"]==="true"&&d.approvalCheckbox.push("advice"),d["camunda:attachment"]==="true"&&d.approvalCheckbox.push("attachment"),d.userArr=(d.candidateUsers||"").split(",").filter(m=>m),d.roleArr=(d.candidateGroups||"").split(",").filter(m=>m)):f==="bpmn:SequenceFlow"&&p.conditionExpression&&Object.assign(d,{condType:p.conditionExpression.$type,condBody:p.conditionExpression.body}),i.value=d}function l(){var m,v;const u=i.value;function p(g){return g?"true":"false"}const f={id:u.id,name:u.name},d=n.value;if(d==="bpmn:Process")u.jobPriority&&Object.assign(f,{"camunda:jobPriority":u.jobPriority});else if(d==="bpmn:UserTask")Object.assign(f,{"camunda:orSign":p(u.approvalSign==="orSign"),"camunda:rollback":u.rollback==="1"?"1":"0","camunda:countersign":p(u.approvalSign==="countersign"),"camunda:advice":p(u.approvalCheckbox.includes("advice")),"camunda:attachment":p(u.approvalCheckbox.includes("attachment")),"camunda:assignee":u.assignee||void 0,"camunda:assigneeName":u["camunda:assigneeName"]||void 0,"camunda:priority":u.priority||void 0,"camunda:candidateUsers":((m=u.userArr)==null?void 0:m.join())||void 0,"camunda:candidateGroups":((v=u.roleArr)==null?void 0:v.join())||void 0});else if(d==="bpmn:SequenceFlow")if(u.condType){const g=r.get("moddle").create("bpmn:FormalExpression",{body:u.condBody});f.conditionExpression=g}else f.conditionExpression=null;o.updateProperties(a,f)}return(u,p)=>{const f=ef;return h.openBlock(),h.createElementBlock("div",C2,[h.createVNode(f,null,{default:h.withCtx(()=>[h.unref(n)==="bpmn:Process"?(h.openBlock(),h.createBlock(g2,{key:0,formState:h.unref(i),"onUpdate:formState":p[0]||(p[0]=d=>h.isRef(i)?i.value=d:null),isEdit:e.isEdit},null,8,["formState","isEdit"])):h.unref(n)==="bpmn:UserTask"?(h.openBlock(),h.createBlock(b2,{key:1,formState:h.unref(i),"onUpdate:formState":p[1]||(p[1]=d=>h.isRef(i)?i.value=d:null)},null,8,["formState"])):h.unref(n)==="bpmn:ExclusiveGateway"?(h.openBlock(),h.createBlock(E2,{key:2,formState:h.unref(i),"onUpdate:formState":p[2]||(p[2]=d=>h.isRef(i)?i.value=d:null)},null,8,["formState"])):h.unref(n)==="bpmn:SequenceFlow"?(h.openBlock(),h.createBlock(x2,{key:3,formState:h.unref(i),"onUpdate:formState":p[3]||(p[3]=d=>h.isRef(i)?i.value=d:null)},null,8,["formState"])):h.unref(n)==="bpmn:EndEvent"?(h.openBlock(),h.createBlock(w2,{key:4,formState:h.unref(i),"onUpdate:formState":p[4]||(p[4]=d=>h.isRef(i)?i.value=d:null)},null,8,["formState"])):h.unref(n)?(h.openBlock(),h.createBlock(S2,{key:5,formState:h.unref(i),"onUpdate:formState":p[5]||(p[5]=d=>h.isRef(i)?i.value=d:null)},null,8,["formState"])):h.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-886844b5"]]),T2={class:"wrapper"},P2=gi(h.defineComponent({__name:"index",props:{data:{type:Object,required:!0}},setup(e,{expose:t}){const n=e,i=h.shallowRef();function r(){i.value=new on({container:"#canvas",moddleExtensions:{camunda:u2}})}function o(){Ct.getBpmnXml({code:n.data.code}).then(s=>{var c;if(s.code===0){const l=s.result.text;(c=i.value)==null||c.importXML(l)}})}h.onMounted(()=>{var s;r(),n.data.code?o():(s=i.value)==null||s.createDiagram()});function a(){var s;return(s=i.value)==null?void 0:s.saveXML({format:!0})}return t({saveXML:a}),(s,c)=>(h.openBlock(),h.createElementBlock("div",T2,[c[0]||(c[0]=h.createElementVNode("div",{id:"canvas"},null,-1)),h.createVNode(R2,{modeler:h.unref(i),isEdit:e.data.opType==="2"},null,8,["modeler","isEdit"])]))}}),[["__scopeId","data-v-d49b9b2a"]]),A2={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function k2(e,t){return h.openBlock(),h.createElementBlock("svg",A2,t[0]||(t[0]=[h.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const D2=h.markRaw({name:"ant-design-left",render:k2}),M2={class:"container"},N2={class:"viewer-container"},O2=gi(h.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(e){const{t}=an.useI18n(),n=e,i=h.computed(()=>{const c=n.data.opType||"1";if(c==="1")return t("bpmn.add_workflow");if(c==="2")return t("bpmn.edit_workflow");if(c==="3")return t("bpmn.clone_workflow")}),r=h.inject(Ko);function o(){r==null||r.emit("changeComp",{comp:"BusTypeList"})}const a=h.ref();function s(){var c;(c=a.value)==null||c.saveXML().then(({error:l,xml:u})=>{if(l){st.message.error(l);return}const p={type:n.data.type,text:u};((n.data.opType||"1")==="2"?Ct.bpmnUpdate(p):Ct.bpmnInsert(p)).then(m=>{m.code===0&&(r==null||r.emit("changeComp",{comp:"BusTypeList"}))})})}return(c,l)=>{const u=D2,p=K.Button,f=K.Space,d=K.PageHeader,m=P2;return h.openBlock(),h.createElementBlock("div",M2,[h.createVNode(d,{class:"page-header-sticky",title:h.unref(i),onBack:o},{backIcon:h.withCtx(()=>[h.createVNode(u)]),extra:h.withCtx(()=>[h.createVNode(f,null,{default:h.withCtx(()=>[h.createVNode(p,{type:"default",onClick:o},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.$t("common.btn_cancel")),1)]),_:1}),h.createVNode(p,{type:"primary",onClick:s},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),h.createElementVNode("div",N2,[h.createVNode(m,{ref_key:"bpmnViewer",ref:a,data:e.data},null,8,["data"])])])}}}),[["__scopeId","data-v-e763e4dc"]]),I2={class:"wrapper"},B2=gi(h.defineComponent({components:{BusTypeList:x0,BpmnEditPage:O2},__name:"index",setup(e){const t=h.ref("BusTypeList"),n=h.ref(),i=D_(Ko);return h.provide(Ko,i),i.on((r,o)=>{r==="changeComp"&&(t.value=o.comp,n.value=o)}),(r,o)=>{const a=I_;return h.openBlock(),h.createBlock(a,null,{default:h.withCtx(()=>[h.createElementVNode("div",I2,[(h.openBlock(),h.createBlock(h.KeepAlive,{include:"BusTypeList"},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(h.unref(t)),{data:h.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);_p.createPinia();function L2(e){ic().setLang(e)}function $2(e,t){const{i18n:n,pinia:i,theme:r}=t;u_(n);const o=ic();o.setTheme(r),o.setupLangWatcher()}const j2={install:$2};yt.WfManagePage=B2,yt.default=j2,yt.setWorkflowLang=L2,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
240
+ </div>`,re.RESULT_HTML='<div class="djs-search-result"></div>',re.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',re.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const eN={__depends__:[wa,Ra,tn],searchPad:["type",re]};function vp(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._search=i,t.registerProvider(this)}vp.$inject=["elementRegistry","searchPad","canvas","search"],vp.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(i){return!ge(i)&&!t.includes(i)});return this._search(n.map(i=>({element:i,label:en(i),id:i.id})),e,{keys:["label","id"]}).map(tN)};function tN(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}const nN={__depends__:[eN,Uh],__init__:["bpmnSearch"],bpmnSearch:["type",vp]},iN="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",rN="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",oN={width:36,height:50},aN={width:50,height:50};function a_(e,t,n){return X("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}const Cr=5;function Js(e,t){this._styles=t,e.registerProvider(this)}Js.$inject=["outline","styles"],Js.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!ge(e))return b(e,"bpmn:Gateway")?(n=X("rect"),D(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),q(n,D({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):le(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=X("rect"),q(n,D({x:-5,y:-5,rx:14,width:e.width+Cr*2,height:e.height+Cr*2},t))):b(e,"bpmn:EndEvent")?(n=X("circle"),q(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr+1},t))):b(e,"bpmn:Event")?(n=X("circle"),q(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr},t))):b(e,"bpmn:DataObjectReference")&&s_(e,"bpmn:DataObjectReference")?n=a_(iN,{x:-6,y:-6},t):b(e,"bpmn:DataStoreReference")&&s_(e,"bpmn:DataStoreReference")&&(n=a_(rN,{x:-6,y:-6},t)),n},Js.prototype.updateOutline=function(e,t){if(!ge(e))return le(e,["bpmn:SubProcess","bpmn:Group"])?(q(t,{width:e.width+Cr*2,height:e.height+Cr*2}),!0):!!le(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function s_(e,t){var n;return t==="bpmn:DataObjectReference"?n=oN:t==="bpmn:DataStoreReference"&&(n=aN),e.width===n.width&&e.height===n.height}const sN={__depends__:[Mv],__init__:["outlineProvider"],outlineProvider:["type",Js]};var cN='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function an(e){zr.call(this,e)}Y(an,zr),an.Viewer=Zn,an.NavigatedViewer=Zr,an.prototype.createDiagram=function(){return this.importXML(cN)},an.prototype._interactionModules=[Qd,ih,ah],an.prototype._modelingModules=[sR,Rl,kR,SR,XR,Ll,nT,lD,ty,Es,dD,gD,DD,ND,OD,jD,ZD,qy,rM,mM,CM,TM,Rv,JM,nN,sN],an.prototype._modules=[].concat(Zn.prototype._modules,an.prototype._interactionModules,an.prototype._modelingModules);const lN={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:JSON.parse('[{"name":"Definitions","isAbstract":true,"extends":["bpmn:Definitions"],"properties":[{"name":"diagramRelationId","isAttr":true,"type":"String"}]},{"name":"InOutBinding","superClass":["Element"],"isAbstract":true,"properties":[{"name":"source","isAttr":true,"type":"String"},{"name":"sourceExpression","isAttr":true,"type":"String"},{"name":"target","isAttr":true,"type":"String"},{"name":"businessKey","isAttr":true,"type":"String"},{"name":"local","isAttr":true,"type":"Boolean","default":false},{"name":"variables","isAttr":true,"type":"String"}]},{"name":"In","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{"name":"Out","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity"]}},{"name":"AsyncCapable","isAbstract":true,"extends":["bpmn:Activity","bpmn:Gateway","bpmn:Event"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false},{"name":"asyncBefore","isAttr":true,"type":"Boolean","default":false},{"name":"asyncAfter","isAttr":true,"type":"Boolean","default":false},{"name":"exclusive","isAttr":true,"type":"Boolean","default":true}]},{"name":"JobPriorized","isAbstract":true,"extends":["bpmn:Process","camunda:AsyncCapable"],"properties":[{"name":"jobPriority","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false}]},{"name":"ErrorEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ErrorEventDefinition"],"properties":[{"name":"errorCodeVariable","isAttr":true,"type":"String"},{"name":"errorMessageVariable","isAttr":true,"type":"String"}]},{"name":"ErrorEventDefinition","superClass":["bpmn:ErrorEventDefinition","Element"],"properties":[{"name":"expression","isAttr":true,"type":"String"}],"meta":{"allowedIn":["bpmn:ServiceTask"]}},{"name":"Error","isAbstract":true,"extends":["bpmn:Error"],"properties":[{"name":"camunda:errorMessage","isAttr":true,"type":"String"}]},{"name":"PotentialStarter","superClass":["Element"],"properties":[{"name":"resourceAssignmentExpression","type":"bpmn:ResourceAssignmentExpression"}]},{"name":"FormSupported","isAbstract":true,"extends":["bpmn:StartEvent","bpmn:UserTask"],"properties":[{"name":"formHandlerClass","isAttr":true,"type":"String"},{"name":"formKey","isAttr":true,"type":"String"},{"name":"formRef","isAttr":true,"type":"String"},{"name":"formRefBinding","isAttr":true,"type":"String"},{"name":"formRefVersion","isAttr":true,"type":"String"}]},{"name":"TemplateSupported","isAbstract":true,"extends":["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],"properties":[{"name":"modelerTemplate","isAttr":true,"type":"String"},{"name":"modelerTemplateVersion","isAttr":true,"type":"Integer"}]},{"name":"Initiator","isAbstract":true,"extends":["bpmn:StartEvent"],"properties":[{"name":"initiator","isAttr":true,"type":"String"}]},{"name":"ScriptTask","isAbstract":true,"extends":["bpmn:ScriptTask"],"properties":[{"name":"resultVariable","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Process","isAbstract":true,"extends":["bpmn:Process"],"properties":[{"name":"candidateStarterGroups","isAttr":true,"type":"String"},{"name":"candidateStarterUsers","isAttr":true,"type":"String"},{"name":"versionTag","isAttr":true,"type":"String"},{"name":"historyTimeToLive","isAttr":true,"type":"String"},{"name":"isStartableInTasklist","isAttr":true,"type":"Boolean","default":true}]},{"name":"EscalationEventDefinitionExtension","isAbstract":true,"extends":["bpmn:EscalationEventDefinition"],"properties":[{"name":"escalationCodeVariable","isAttr":true,"type":"String"}]},{"name":"FormalExpression","isAbstract":true,"extends":["bpmn:FormalExpression"],"properties":[{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Assignable","extends":["bpmn:UserTask"],"properties":[{"name":"assignee","isAttr":true,"type":"String"},{"name":"candidateUsers","isAttr":true,"type":"String"},{"name":"candidateGroups","isAttr":true,"type":"String"},{"name":"dueDate","isAttr":true,"type":"String"},{"name":"followUpDate","isAttr":true,"type":"String"},{"name":"priority","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"calledElementBinding","isAttr":true,"type":"String","default":"latest"},{"name":"calledElementVersion","isAttr":true,"type":"String"},{"name":"calledElementVersionTag","isAttr":true,"type":"String"},{"name":"calledElementTenantId","isAttr":true,"type":"String"},{"name":"caseRef","isAttr":true,"type":"String"},{"name":"caseBinding","isAttr":true,"type":"String","default":"latest"},{"name":"caseVersion","isAttr":true,"type":"String"},{"name":"caseTenantId","isAttr":true,"type":"String"},{"name":"variableMappingClass","isAttr":true,"type":"String"},{"name":"variableMappingDelegateExpression","isAttr":true,"type":"String"}]},{"name":"ServiceTaskLike","extends":["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"resultVariable","isAttr":true,"type":"String"}]},{"name":"DmnCapable","extends":["bpmn:BusinessRuleTask"],"properties":[{"name":"decisionRef","isAttr":true,"type":"String"},{"name":"decisionRefBinding","isAttr":true,"type":"String","default":"latest"},{"name":"decisionRefVersion","isAttr":true,"type":"String"},{"name":"mapDecisionResult","isAttr":true,"type":"String","default":"resultList"},{"name":"decisionRefTenantId","isAttr":true,"type":"String"}]},{"name":"ExternalCapable","extends":["camunda:ServiceTaskLike"],"properties":[{"name":"type","isAttr":true,"type":"String"},{"name":"topic","isAttr":true,"type":"String"}]},{"name":"TaskPriorized","extends":["bpmn:Process","camunda:ExternalCapable"],"properties":[{"name":"taskPriority","isAttr":true,"type":"String"}]},{"name":"Properties","superClass":["Element"],"meta":{"allowedIn":["*"]},"properties":[{"name":"values","type":"Property","isMany":true}]},{"name":"Property","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"value","type":"String","isAttr":true}]},{"name":"Connector","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"}]},{"name":"InputOutput","superClass":["Element"],"meta":{"allowedIn":["bpmn:FlowNode","camunda:Connector"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"},{"name":"inputParameters","isMany":true,"type":"InputParameter"},{"name":"outputParameters","isMany":true,"type":"OutputParameter"}]},{"name":"InputOutputParameter","properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"InputOutputParameterDefinition","isAbstract":true},{"name":"List","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"items","isMany":true,"type":"InputOutputParameterDefinition"}]},{"name":"Map","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"entries","isMany":true,"type":"Entry"}]},{"name":"Entry","properties":[{"name":"key","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"Value","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"id","isAttr":true,"type":"String"},{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Script","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"scriptFormat","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Field","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},"properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"expression","type":"String"},{"name":"stringValue","isAttr":true,"type":"String"},{"name":"string","type":"String"}]},{"name":"InputParameter","superClass":["InputOutputParameter"]},{"name":"OutputParameter","superClass":["InputOutputParameter"]},{"name":"Collectable","isAbstract":true,"extends":["bpmn:MultiInstanceLoopCharacteristics"],"superClass":["camunda:AsyncCapable"],"properties":[{"name":"collection","isAttr":true,"type":"String"},{"name":"elementVariable","isAttr":true,"type":"String"}]},{"name":"FailedJobRetryTimeCycle","superClass":["Element"],"meta":{"allowedIn":["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"ExecutionListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true}]},{"name":"TaskListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:UserTask"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true},{"name":"id","type":"String","isAttr":true},{"name":"eventDefinitions","type":"bpmn:TimerEventDefinition","isMany":true}]},{"name":"FormProperty","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"required","type":"String","isAttr":true},{"name":"readable","type":"String","isAttr":true},{"name":"writable","type":"String","isAttr":true},{"name":"variable","type":"String","isAttr":true},{"name":"expression","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"default","type":"String","isAttr":true},{"name":"values","type":"Value","isMany":true}]},{"name":"FormData","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"fields","type":"FormField","isMany":true},{"name":"businessKey","type":"String","isAttr":true}]},{"name":"FormField","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"label","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"defaultValue","type":"String","isAttr":true},{"name":"properties","type":"Properties"},{"name":"validation","type":"Validation"},{"name":"values","type":"Value","isMany":true}]},{"name":"Validation","superClass":["Element"],"properties":[{"name":"constraints","type":"Constraint","isMany":true}]},{"name":"Constraint","superClass":["Element"],"properties":[{"name":"name","type":"String","isAttr":true},{"name":"config","type":"String","isAttr":true}]},{"name":"ConditionalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ConditionalEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"},{"name":"variableEvents","isAttr":true,"type":"String"}]}]'),emumerations:[]},uN={class:"wrapper"},pN={class:"mt-xs"},fN={class:"flex-sc"},dN={class:"mt-xs"},hN=$n(f.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({});function a(p){const d=p.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${d}}`)}function s(p){if(typeof p=="string"&&(p.trim().startsWith("{")||p.trim().startsWith("[")))try{return JSON.parse(p),!0}catch{return!1}return!1}function c(){i.jsonStr?s(i.jsonStr)?o.value=JSON.parse(i.jsonStr):o.value=a(i.jsonStr):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1}}function l(){et.Modal.destroyAll()}function u(){const p=o.value;if(p.timeoutConfigSwitch&&!p.timeoutPeriod){et.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}r("submit",o.value),et.Modal.destroyAll()}return f.onMounted(()=>{c()}),(p,d)=>{const h=U.Checkbox,m=U.FormItem,y=U.Radio,g=U.RadioGroup,w=U.InputNumber,C=U.Form,x=U.Button,E=U.Space;return f.openBlock(),f.createElementBlock("div",uN,[f.createVNode(C,{class:"my-nm","label-col":{span:6},"wrapper-col":{span:18},colon:!1,model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(m,{label:p.$t("bpmn.revertRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).revokeRule,"onUpdate:checked":d[0]||(d[0]=S=>f.unref(o).revokeRule=S)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.rollbackRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).fallbackRule,"onUpdate:checked":d[1]||(d[1]=S=>f.unref(o).fallbackRule=S)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.deduplicationApprovers")},{default:f.withCtx(()=>[f.createElementVNode("div",pN,f.toDisplayString(p.$t("bpmn.deduplicationApproversTxt")),1),f.createVNode(g,{value:f.unref(o).approverRemoveDuplicates,"onUpdate:value":d[2]||(d[2]=S=>f.unref(o).approverRemoveDuplicates=S)},{default:f.withCtx(()=>[f.createVNode(y,{value:0},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio0")),1)]),_:1}),f.createVNode(y,{value:1},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio1")),1)]),_:1}),f.createVNode(y,{value:2},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.timeoutRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).timeoutConfigSwitch,"onUpdate:checked":d[3]||(d[3]=S=>f.unref(o).timeoutConfigSwitch=S)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.unref(o).timeoutConfigSwitch?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(m,{label:p.$t("wo_my.timeout")},{default:f.withCtx(()=>[f.createElementVNode("div",fN,[f.createTextVNode(f.toDisplayString(p.$t("bpmn.linkTimeoutTxt1"))+" ",1),f.createVNode(w,{class:"mx-xs",value:f.unref(o).timeoutPeriod,"onUpdate:value":d[4]||(d[4]=S=>f.unref(o).timeoutPeriod=S),min:1,max:1e4,precision:0},null,8,["value"]),f.createTextVNode(" "+f.toDisplayString(p.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.timeoutHandle")},{default:f.withCtx(()=>[f.createElementVNode("div",dN,f.toDisplayString(p.$t("bpmn.timeoutHandleTxt")),1),f.createVNode(g,{value:f.unref(o).timeoutHandler,"onUpdate:value":d[5]||(d[5]=S=>f.unref(o).timeoutHandler=S)},{default:f.withCtx(()=>[f.createVNode(y,{value:0},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),f.createVNode(y,{value:1},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):f.createCommentVNode("",!0)]),_:1},8,["model"]),f.createVNode(E,{class:"modal-btns"},{default:f.withCtx(()=>[f.createVNode(x,{onClick:l},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(x,{type:"primary",onClick:u},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-bc38a637"]]),mN=f.defineComponent({__name:"Process",props:f.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(e){const{modal:t}=et.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]);function o(){t.info({title:n("ruleModel.title"),content:f.h(hN,{jsonStr:i.value.jobPriority,onSubmit:a=>{i.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const c=U.Input,l=U.FormItem,u=U.Form,p=U.CollapsePanel,d=U.Collapse;return f.openBlock(),f.createBlock(d,{activeKey:f.unref(r),"onUpdate:activeKey":s[4]||(s[4]=h=>f.isRef(r)?r.value=h:null)},{default:f.withCtx(()=>[f.createVNode(p,{key:"1",header:a.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(u,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(l,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.id,"onUpdate:value":s[0]||(s[0]=h=>i.value.id=h),placeholder:a.$t("common.plsEnter"),readonly:e.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),f.createVNode(l,{label:a.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.name,"onUpdate:value":s[1]||(s[1]=h=>i.value.name=h),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(l,{label:a.$t("FLOW_CHART.Version Tag")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.versionTag,"onUpdate:value":s[2]||(s[2]=h=>i.value.versionTag=h),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),f.createVNode(p,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:f.withCtx(()=>[f.createVNode(u,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(l,{label:a.$t("FLOW_CHART.Job Priority")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.jobPriority,"onUpdate:value":s[3]||(s[3]=h=>i.value.jobPriority=h),placeholder:a.$t("common.plsSelect"),readonly:"",onClick:o},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),gN=$n(f.defineComponent({__name:"TemplateConfig",props:{data:{type:Object,default:()=>{}},templateList:{type:Array,default:()=>[]}},emits:["update:data"],setup(e,{emit:t}){const n=t,i=e,r=f.computed({get:()=>i.data,set:l=>{n("update:data",l)}}),o=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("1")}).map(l=>({label:l.name,value:l.id}))),a=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("2")}).map(l=>({label:l.name,value:l.id}))),s=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("3")}).map(l=>({label:l.name,value:l.id}))),c=(l,u)=>u.label.toLowerCase().indexOf(l.toLowerCase())>=0;return(l,u)=>{const p=U.Select,d=U.FormItem,h=U.Form;return f.openBlock(),f.createElementBlock("div",null,[f.createVNode(h,{class:"form-query-select mx-nm mt-nm",layout:"vertical",model:r.value},{default:f.withCtx(()=>[f.createVNode(d,{label:l.$t("待办工单处理")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[1],"onUpdate:value":u[0]||(u[0]=m=>r.value[1]=m),options:o.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"]),f.createVNode(d,{label:l.$t("待办工单详情")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[2],"onUpdate:value":u[1]||(u[1]=m=>r.value[2]=m),options:a.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"]),f.createVNode(d,{label:l.$t("全部工单详情")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[3],"onUpdate:value":u[2]||(u[2]=m=>r.value[3]=m),options:s.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-5c46da3d"]]),yN={class:"modal-container"},vN=f.defineComponent({__name:"SelectLinkTask",props:{id:{type:String},componentInfo:{type:String,default:""},variable:{type:String,default:""},description:{type:String,default:""}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"},{title:n("bpmn.action"),dataIndex:"action"}]),s=f.ref([]),c=f.ref();function l(O,B){s.value=O,c.value=B}const u=f.ref({1:void 0,2:void 0,3:void 0}),p=f.ref({}),d=f.ref(!1),h=f.ref(""),m=f.ref("");function y(){d.value=!1,h.value=JSON.stringify(u.value)}function g(){d.value=!1}function w(O){p.value=O,d.value=!0}const C=f.ref([]);async function x(){const{result:O}=await yt.getTemplateList({pageNum:1,pageSize:1e3});C.value=(O==null?void 0:O.data)||[]}f.watchEffect(()=>{i.id&&(i.id.startsWith("common-approve-")||i.id.startsWith("common-handle-")?(m.value=i.id.slice(-4),s.value=[i.id.slice(0,-4)+"*"]):s.value=[i.id]),i.componentInfo&&(u.value=JSON.parse(i.componentInfo)||{})});function E(O){c.value=null;const B={...o.value};return Object.assign(B,O),yt.getLinkList(B)}const S=f.ref(),R=()=>{S.value.refresh()},M=()=>{o.value={},R()};f.onMounted(()=>{M(),x()});function P(){et.Modal.destroyAll()}function I(){var O,B;(O=c.value)!=null&&O.length?r("submit",{...c.value[0],bindComponent:h.value,hasSuffix:""}):(B=s.value)!=null&&B.length&&r("submit",{id:i.id,hasSuffix:m.value,variable:i.variable,description:i.description,bindComponent:h.value}),et.Modal.destroyAll()}return(O,B)=>{const L=U.Input,H=U.FormItem,G=U.Button,Be=U.Space,xe=U.Form,pe=f.resolveComponent("a-table-ex"),Ue=U.Modal;return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",yN,[f.createVNode(xe,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(H,{label:O.$t("link.id")},{default:f.withCtx(()=>[f.createVNode(L,{value:f.unref(o).id,"onUpdate:value":B[0]||(B[0]=be=>f.unref(o).id=be),placeholder:O.$t("common.plsEnter"),onKeydown:f.withKeys(R,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(H,{label:O.$t("link.description")},{default:f.withCtx(()=>[f.createVNode(L,{value:f.unref(o).description,"onUpdate:value":B[1]||(B[1]=be=>f.unref(o).description=be),placeholder:O.$t("common.plsEnter"),onKeydown:f.withKeys(R,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(H,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(Be,null,{default:f.withCtx(()=>[f.createVNode(G,{type:"primary",onClick:R},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_search")),1)]),_:1}),f.createVNode(G,{onClick:M},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(pe,{ref_key:"tableEx",ref:S,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:E},{bodyCell:f.withCtx(({record:be,column:Ee})=>[Ee.dataIndex==="action"?(f.openBlock(),f.createBlock(G,{key:0,type:"link",onClick:Le=>w(be),disabled:!f.unref(s).includes(be.id)},{default:f.withCtx(()=>B[4]||(B[4]=[f.createTextVNode(f.toDisplayString("配置渲染组件"))])),_:2},1032,["onClick","disabled"])):f.createCommentVNode("",!0)]),_:1},8,["columns","row-selection"]),f.createVNode(Be,{class:"modal-btns"},{default:f.withCtx(()=>{var be;return[f.createVNode(G,{onClick:P},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(G,{type:"primary",disabled:!((be=f.unref(s))!=null&&be.length),onClick:I},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})]),f.createVNode(Ue,{open:f.unref(d),"onUpdate:open":B[3]||(B[3]=be=>f.isRef(d)?d.value=be:null),title:"配置渲染组件",onOk:y,onCancel:g},{default:f.withCtx(()=>[f.createVNode(gN,{data:f.unref(u),"onUpdate:data":B[2]||(B[2]=be=>f.isRef(u)?u.value=be:null),"template-list":f.unref(C)},null,8,["data","template-list"])]),_:1},8,["open"])],64)}}}),_N={class:"modal-container"},bN=f.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=f.ref([]),c=f.ref();function l(g,w){s.value=g,c.value=w}f.watchEffect(()=>{i.userIds&&(s.value=Array.isArray(i.userIds)?i.userIds:[i.userIds])});function u(g){c.value=null;const w={...o.value,branchId:i.branchId};return Object.assign(w,g),yt.getUserList(w)}const p=f.ref(),d=()=>{p.value.refresh()},h=()=>{o.value={},d()};f.onMounted(()=>{h()});function m(){et.Modal.destroyAll()}function y(){var g;if((g=c.value)!=null&&g.length){const w=c.value;r("submit",i.mode==="multiple"?w:w[0])}et.Modal.destroyAll()}return(g,w)=>{const C=U.Input,x=U.FormItem,E=U.Button,S=U.Space,R=U.Form,M=f.resolveComponent("a-table-ex");return f.openBlock(),f.createElementBlock("div",_N,[f.createVNode(R,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(x,{label:g.$t("user.key")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).userName,"onUpdate:value":w[0]||(w[0]=P=>f.unref(o).userName=P),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(S,null,{default:f.withCtx(()=>[f.createVNode(E,{type:"primary",onClick:d},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),f.createVNode(E,{onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(M,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"userId","row-selection":{type:e.mode==="multiple"?"checkbox":"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),f.createVNode(S,{class:"modal-btns"},{default:f.withCtx(()=>{var P;return[f.createVNode(E,{onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(E,{type:"primary",disabled:!((P=f.unref(s))!=null&&P.length),onClick:y},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),EN=f.defineComponent({__name:"UserTask",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const{modal:t}=et.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]),o=f.ref([]),a=f.ref([]),s=f.ref([]),c=f.computed(()=>{const w=i.value.assignee;return w==null?void 0:w.startsWith("${")});function l(){const w="abcdefghijklmnopqrstuvwxyz";let C="";for(let x=0;x<2;x++)C+=w.charAt(Math.floor(Math.random()*w.length));for(let x=0;x<2;x++)C+=Math.floor(Math.random()*10);return C}function u(){t.info({title:n("link.select_link"),content:f.h(vN,{id:i.value.id,variable:i.value.assignee,description:i.value.name,componentInfo:i.value.bindComponent,onSubmit:w=>{let C=w.id;C.endsWith("*")&&(w.hasSuffix?C=C.substring(0,C.length-1)+w.hasSuffix:C=C.substring(0,C.length-1)+l()),Object.assign(i.value,{id:C,name:w.description,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:[],roleArr:[]}),w.variable&&(i.value.assignee=`\${${w.variable}}`),w.bindComponent&&(i.value.bindComponent=w.bindComponent)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,zIndex:100,class:"modal-comp"})}function p(){t.info({title:n("user.select_user"),content:f.h(bN,{userIds:i.value.assignee,onSubmit:w=>{Object.assign(i.value,{assignee:w.userId,"camunda:assigneeName":w.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function d(){yt.getBranchTree().then(w=>{w.code===0&&(o.value=w.result||[])})}function h(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};yt.getUserList(w).then(C=>{var x,E;C.code===0&&(s.value=((E=(x=C.result)==null?void 0:x.data)==null?void 0:E.map(S=>({...S,label:S.userName,value:S.userId})))||[])})}function m(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};yt.getRoleList(w).then(C=>{var x,E;C.code===0&&(a.value=((E=(x=C.result)==null?void 0:x.data)==null?void 0:E.map(S=>({...S,label:S.roleName,value:S.roleId})))||[])})}function y(){Object.assign(i.value,{userArr:[],roleArr:[]}),h(),m()}function g(w){if(w!=null&&w.length){const C=s.value.find(x=>x.userId===w[0]);i.value.priority!==C.branchId&&(Object.assign(i.value,{priority:C.branchId,roleArr:[]}),h(),m())}}return f.onMounted(()=>{d(),h(),m()}),(w,C)=>{const x=U.Input,E=U.FormItem,S=U.TreeSelect,R=U.Select,M=U.Form,P=U.CollapsePanel,I=U.Radio,O=U.RadioGroup,B=U.Checkbox,L=U.CheckboxGroup,H=U.Collapse;return f.openBlock(),f.createBlock(H,{activeKey:f.unref(r),"onUpdate:activeKey":C[10]||(C[10]=G=>f.isRef(r)?r.value=G:null)},{default:f.withCtx(()=>[f.createVNode(P,{key:"1",header:w.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(M,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(E,{label:w.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(x,{value:i.value.id,"onUpdate:value":C[0]||(C[0]=G=>i.value.id=G),placeholder:w.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(E,{label:w.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(x,{value:i.value.name,"onUpdate:value":C[1]||(C[1]=G=>i.value.name=G),placeholder:w.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(E,{label:w.$t("FLOW_CHART.Assignee")},{default:f.withCtx(()=>[f.unref(c)?(f.openBlock(),f.createBlock(x,{key:0,value:i.value.assignee,"onUpdate:value":C[2]||(C[2]=G=>i.value.assignee=G),placeholder:w.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(f.openBlock(),f.createBlock(x,{key:1,value:i.value["camunda:assigneeName"],"onUpdate:value":C[3]||(C[3]=G=>i.value["camunda:assigneeName"]=G),placeholder:w.$t("common.plsSelect"),readonly:"",onClick:p},null,8,["value","placeholder"]))]),_:1},8,["label"]),f.createVNode(E,{label:w.$t("FLOW_CHART.Priority")},{default:f.withCtx(()=>[f.createVNode(S,{value:i.value.priority,"onUpdate:value":C[4]||(C[4]=G=>i.value.priority=G),placeholder:w.$t("common.plsSelect"),"tree-data":f.unref(o),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:y},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),f.createVNode(E,{label:w.$t("FLOW_CHART.Candidate Users")},{default:f.withCtx(()=>[f.createVNode(R,{value:i.value.userArr,"onUpdate:value":C[5]||(C[5]=G=>i.value.userArr=G),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:f.unref(s),optionFilterProp:"label",disabled:f.unref(c),onChange:g},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),f.createVNode(E,{label:w.$t("FLOW_CHART.Candidate Groups")},{default:f.withCtx(()=>[f.createVNode(R,{value:i.value.roleArr,"onUpdate:value":C[6]||(C[6]=G=>i.value.roleArr=G),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:f.unref(a),optionFilterProp:"label",disabled:f.unref(c)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),f.createVNode(P,{key:"2",header:w.$t("FLOW_CHART.isAllowRollback")},{default:f.withCtx(()=>[f.createVNode(O,{value:i.value.rollback,"onUpdate:value":C[7]||(C[7]=G=>i.value.rollback=G)},{default:f.withCtx(()=>[f.createVNode(I,{value:"1"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.yes")),1)]),_:1}),f.createVNode(I,{value:"0"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"]),f.createVNode(P,{key:"3",header:w.$t("FLOW_CHART.Approval Mode")},{default:f.withCtx(()=>[f.createVNode(O,{value:i.value.approvalSign,"onUpdate:value":C[8]||(C[8]=G=>i.value.approvalSign=G)},{default:f.withCtx(()=>[f.createVNode(I,{value:"orSign"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Or Sign")),1)]),_:1}),f.createVNode(I,{value:"countersign"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"]),f.createVNode(P,{key:"4",header:w.$t("FLOW_CHART.Approval Required")},{default:f.withCtx(()=>[f.createVNode(L,{value:i.value.approvalCheckbox,"onUpdate:value":C[9]||(C[9]=G=>i.value.approvalCheckbox=G)},{default:f.withCtx(()=>[f.createVNode(B,{value:"advice"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Comments Required")),1)]),_:1}),f.createVNode(B,{value:"attachment"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),xN=f.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.Form,c=U.CollapsePanel,l=U.Collapse;return f.openBlock(),f.createBlock(l,{activeKey:f.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>f.isRef(n)?n.value=u:null)},{default:f.withCtx(()=>[f.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(s,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),wN=f.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.SelectOption,c=U.Select,l=U.Form,u=U.CollapsePanel,p=U.Collapse;return f.openBlock(),f.createBlock(p,{activeKey:f.unref(n),"onUpdate:activeKey":r[4]||(r[4]=d=>f.isRef(n)?n.value=d:null)},{default:f.withCtx(()=>[f.createVNode(u,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(l,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=d=>t.value.id=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=d=>t.value.name=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Condition Type")},{default:f.withCtx(()=>[f.createVNode(c,{value:t.value.condType,"onUpdate:value":r[2]||(r[2]=d=>t.value.condType=d),placeholder:i.$t("common.plsSelect"),allowClear:""},{default:f.withCtx(()=>[f.createVNode(s,{value:"bpmn:FormalExpression"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(i.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),t.value.condType==="bpmn:FormalExpression"?(f.openBlock(),f.createBlock(a,{key:0,label:i.$t("FLOW_CHART.Expression")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.condBody,"onUpdate:value":r[3]||(r[3]=d=>t.value.condBody=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):f.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),SN={class:"modal-container"},CN=f.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=f.ref([]),c=f.ref();function l(g,w){s.value=g,c.value=w}f.watchEffect(()=>{i.id&&(s.value=[i.id])});function u(g){c.value=null;const w={...o.value};return Object.assign(w,g),yt.getLinkList(w)}const p=f.ref(),d=()=>{p.value.refresh()},h=()=>{o.value={},d()};f.onMounted(()=>{h()});function m(){et.Modal.destroyAll()}function y(){var g;(g=c.value)!=null&&g.length&&r("submit",c.value[0]),et.Modal.destroyAll()}return(g,w)=>{const C=U.Input,x=U.FormItem,E=U.Button,S=U.Space,R=U.Form,M=f.resolveComponent("a-table-ex");return f.openBlock(),f.createElementBlock("div",SN,[f.createVNode(R,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(x,{label:g.$t("link.id")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).id,"onUpdate:value":w[0]||(w[0]=P=>f.unref(o).id=P),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{label:g.$t("link.description")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).description,"onUpdate:value":w[1]||(w[1]=P=>f.unref(o).description=P),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(S,null,{default:f.withCtx(()=>[f.createVNode(E,{type:"primary",onClick:d},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),f.createVNode(E,{onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(M,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),f.createVNode(S,{class:"modal-btns"},{default:f.withCtx(()=>{var P;return[f.createVNode(E,{onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(E,{type:"primary",disabled:!((P=f.unref(s))!=null&&P.length),onClick:y},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),RN=f.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const{modal:t}=et.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]);function o(){const s="abcdefghijklmnopqrstuvwxyz";let c="";for(let l=0;l<2;l++)c+=s.charAt(Math.floor(Math.random()*s.length));for(let l=0;l<2;l++)c+=Math.floor(Math.random()*10);return c}function a(){t.info({title:n("link.select_link"),content:f.h(CN,{id:i.value.id,onSubmit:s=>{let c=s.id;c.endsWith("*")&&(c=c.substring(0,c.length-1)+o()),Object.assign(i.value,{id:c,name:s.description})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(s,c)=>{const l=U.Input,u=U.FormItem,p=U.Form,d=U.CollapsePanel,h=U.Collapse;return f.openBlock(),f.createBlock(h,{activeKey:f.unref(r),"onUpdate:activeKey":c[2]||(c[2]=m=>f.isRef(r)?r.value=m:null)},{default:f.withCtx(()=>[f.createVNode(d,{key:"1",header:s.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(p,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(u,{label:s.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(l,{value:i.value.id,"onUpdate:value":c[0]||(c[0]=m=>i.value.id=m),placeholder:s.$t("common.plsEnter"),readonly:"",onClick:a},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(u,{label:s.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(l,{value:i.value.name,"onUpdate:value":c[1]||(c[1]=m=>i.value.name=m),placeholder:s.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),TN=f.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.Form,c=U.CollapsePanel,l=U.Collapse;return f.openBlock(),f.createBlock(l,{activeKey:f.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>f.isRef(n)?n.value=u:null)},{default:f.withCtx(()=>[f.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(s,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),PN={class:"properties-panel"},AN=$n(f.defineComponent({__name:"BpmnPropertiesPanel",props:{modeler:{type:an},isEdit:{type:Boolean}},setup(e){const t=e,n=f.ref(""),i=f.ref({});let r,o,a;f.watch(()=>t.modeler,()=>{t.modeler&&(r=t.modeler,s())}),f.watch(i,(u,p)=>{u===p&&l()},{deep:!0});function s(){o=r.get("modeling"),r.on("element.click",u=>{c(u.element)}),r.on("selection.changed",u=>{if(u.newSelection.length)c(u.newSelection[0]);else{const p=r.get("canvas").getRootElement();c(p)}})}function c(u){if(!(u!=null&&u.businessObject)||a===u)return;a=u;const p=u.businessObject,d=p.$type;n.value="",f.nextTick(()=>{n.value=d});const h={...p.$attrs};Object.keys(p).forEach(m=>{const y=p[m];typeof y=="string"&&(h[m]=y)}),d==="bpmn:UserTask"?(Object.assign(h,{rollback:h["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(h,{approvalSign:h["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),h["camunda:advice"]==="true"&&h.approvalCheckbox.push("advice"),h["camunda:attachment"]==="true"&&h.approvalCheckbox.push("attachment"),h["camunda:bindComponent"]&&(h.bindComponent=h["camunda:bindComponent"]),h.userArr=(h.candidateUsers||"").split(",").filter(m=>m),h.roleArr=(h.candidateGroups||"").split(",").filter(m=>m)):d==="bpmn:SequenceFlow"&&p.conditionExpression&&Object.assign(h,{condType:p.conditionExpression.$type,condBody:p.conditionExpression.body}),i.value=h}function l(){var m,y;const u=i.value;function p(g){return g?"true":"false"}const d={id:u.id,name:u.name},h=n.value;if(h==="bpmn:Process")u.jobPriority&&Object.assign(d,{"camunda:jobPriority":u.jobPriority});else if(h==="bpmn:UserTask")Object.assign(d,{"camunda:orSign":p(u.approvalSign==="orSign"),"camunda:rollback":u.rollback==="1"?"1":"0","camunda:countersign":p(u.approvalSign==="countersign"),"camunda:advice":p(u.approvalCheckbox.includes("advice")),"camunda:attachment":p(u.approvalCheckbox.includes("attachment")),"camunda:assignee":u.assignee||void 0,"camunda:assigneeName":u["camunda:assigneeName"]||void 0,"camunda:priority":u.priority||void 0,"camunda:candidateUsers":((m=u.userArr)==null?void 0:m.join())||void 0,"camunda:candidateGroups":((y=u.roleArr)==null?void 0:y.join())||void 0,"camunda:bindComponent":u.bindComponent});else if(h==="bpmn:SequenceFlow")if(u.condType){const g=r.get("moddle").create("bpmn:FormalExpression",{body:u.condBody});d.conditionExpression=g}else d.conditionExpression=null;o.updateProperties(a,d)}return(u,p)=>{const d=ef;return f.openBlock(),f.createElementBlock("div",PN,[f.createVNode(d,null,{default:f.withCtx(()=>[f.unref(n)==="bpmn:Process"?(f.openBlock(),f.createBlock(mN,{key:0,formState:f.unref(i),"onUpdate:formState":p[0]||(p[0]=h=>f.isRef(i)?i.value=h:null),isEdit:e.isEdit},null,8,["formState","isEdit"])):f.unref(n)==="bpmn:UserTask"?(f.openBlock(),f.createBlock(EN,{key:1,formState:f.unref(i),"onUpdate:formState":p[1]||(p[1]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)==="bpmn:ExclusiveGateway"?(f.openBlock(),f.createBlock(xN,{key:2,formState:f.unref(i),"onUpdate:formState":p[2]||(p[2]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)==="bpmn:SequenceFlow"?(f.openBlock(),f.createBlock(wN,{key:3,formState:f.unref(i),"onUpdate:formState":p[3]||(p[3]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)==="bpmn:EndEvent"?(f.openBlock(),f.createBlock(RN,{key:4,formState:f.unref(i),"onUpdate:formState":p[4]||(p[4]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)?(f.openBlock(),f.createBlock(TN,{key:5,formState:f.unref(i),"onUpdate:formState":p[5]||(p[5]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-e901c5bf"]]),kN={class:"wrapper"},DN=$n(f.defineComponent({__name:"index",props:{data:{type:Object,required:!0}},setup(e,{expose:t}){const n=e,i=f.shallowRef();function r(){i.value=new an({container:"#canvas",moddleExtensions:{camunda:lN}})}function o(){yt.getBpmnXml({code:n.data.code}).then(s=>{var c;if(s.code===0){const l=s.result.text;(c=i.value)==null||c.importXML(l)}})}f.onMounted(()=>{var s;r(),n.data.code?o():(s=i.value)==null||s.createDiagram()});function a(){var s;return(s=i.value)==null?void 0:s.saveXML({format:!0})}return t({saveXML:a}),(s,c)=>(f.openBlock(),f.createElementBlock("div",kN,[c[0]||(c[0]=f.createElementVNode("div",{id:"canvas"},null,-1)),f.createVNode(AN,{modeler:f.unref(i),isEdit:e.data.opType==="2"},null,8,["modeler","isEdit"])]))}}),[["__scopeId","data-v-d49b9b2a"]]),MN={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function NN(e,t){return f.openBlock(),f.createElementBlock("svg",MN,t[0]||(t[0]=[f.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const ON=f.markRaw({name:"ant-design-left",render:NN}),IN={class:"container"},BN={class:"viewer-container"},LN=$n(f.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(e){const{t}=Zt.useI18n(),n=e,i=f.computed(()=>{const c=n.data.opType||"1";if(c==="1")return t("bpmn.add_workflow");if(c==="2")return t("bpmn.edit_workflow");if(c==="3")return t("bpmn.clone_workflow")}),r=f.inject(Ko);function o(){r==null||r.emit("changeComp",{comp:"BusTypeList"})}const a=f.ref();function s(){var c;(c=a.value)==null||c.saveXML().then(({error:l,xml:u})=>{if(l){et.message.error(l);return}const p={type:n.data.type,text:u};((n.data.opType||"1")==="2"?yt.bpmnUpdate(p):yt.bpmnInsert(p)).then(m=>{m.code===0&&(r==null||r.emit("changeComp",{comp:"BusTypeList"}))})})}return(c,l)=>{const u=ON,p=U.Button,d=U.Space,h=U.PageHeader,m=DN;return f.openBlock(),f.createElementBlock("div",IN,[f.createVNode(h,{class:"page-header-sticky",title:f.unref(i),onBack:o},{backIcon:f.withCtx(()=>[f.createVNode(u)]),extra:f.withCtx(()=>[f.createVNode(d,null,{default:f.withCtx(()=>[f.createVNode(p,{type:"default",onClick:o},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.$t("common.btn_cancel")),1)]),_:1}),f.createVNode(p,{type:"primary",onClick:s},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),f.createElementVNode("div",BN,[f.createVNode(m,{ref_key:"bpmnViewer",ref:a,data:e.data},null,8,["data"])])])}}}),[["__scopeId","data-v-e763e4dc"]]),$N={class:"wrapper"},jN=$n(f.defineComponent({components:{BusTypeList:E0,BpmnEditPage:LN},__name:"index",setup(e){const t=f.ref("BusTypeList"),n=f.ref(),i=k_(Ko);return f.provide(Ko,i),i.on((r,o)=>{r==="changeComp"&&(t.value=o.comp,n.value=o)}),(r,o)=>{const a=O_;return f.openBlock(),f.createBlock(a,null,{default:f.withCtx(()=>[f.createElementVNode("div",$N,[(f.openBlock(),f.createBlock(f.KeepAlive,{include:"BusTypeList"},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(f.unref(t)),{data:f.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);_p.createPinia();function FN(e){ic().setLang(e)}function HN(e,t){const{i18n:n,pinia:i,theme:r}=t;l_(n);const o=ic();o.setTheme(r),o.setupLangWatcher()}const VN={install:HN};bt.WfManagePage=jN,bt.default=VN,bt.setWorkflowLang=FN,Object.defineProperties(bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});