@processmaker/modeler 1.39.32 → 1.40.0

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.
@@ -31,5 +31,5 @@ a=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.d
31
31
  * (c) 2021 Evan You
32
32
  * @license MIT
33
33
  */
34
- function Ut(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}var qt="undefined"!==typeof window?window:"undefined"!==typeof f.g?f.g:{},Vt=qt.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Ht(e){Vt&&(e._devtoolHook=Vt,Vt.emit("vuex:init",e),Vt.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){Vt.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){Vt.emit("vuex:action",e,t)}),{prepend:!0}))}function Wt(e,t){return e.filter(t)[0]}function Gt(e,t){if(void 0===t&&(t=[]),null===e||"object"!==typeof e)return e;var n=Wt(t,(function(t){return t.original===e}));if(n)return n.copy;var r=Array.isArray(e)?[]:{};return t.push({original:e,copy:r}),Object.keys(e).forEach((function(n){r[n]=Gt(e[n],t)})),r}function $t(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function Xt(e){return null!==e&&"object"===typeof e}function Yt(e){return e&&"function"===typeof e.then}function Jt(e,t){return function(){return e(t)}}var Zt=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"===typeof n?n():n)||{}},Kt={namespaced:{configurable:!0}};Kt.namespaced.get=function(){return!!this._rawModule.namespaced},Zt.prototype.addChild=function(e,t){this._children[e]=t},Zt.prototype.removeChild=function(e){delete this._children[e]},Zt.prototype.getChild=function(e){return this._children[e]},Zt.prototype.hasChild=function(e){return e in this._children},Zt.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},Zt.prototype.forEachChild=function(e){$t(this._children,e)},Zt.prototype.forEachGetter=function(e){this._rawModule.getters&&$t(this._rawModule.getters,e)},Zt.prototype.forEachAction=function(e){this._rawModule.actions&&$t(this._rawModule.actions,e)},Zt.prototype.forEachMutation=function(e){this._rawModule.mutations&&$t(this._rawModule.mutations,e)},Object.defineProperties(Zt.prototype,Kt);var Qt=function(e){this.register([],e,!1)};function en(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return void 0;en(e.concat(r),t.getChild(r),n.modules[r])}}Qt.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Qt.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")}),"")},Qt.prototype.update=function(e){en([],this.root,e)},Qt.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var o=new Zt(t,n);if(0===e.length)this.root=o;else{var i=this.get(e.slice(0,-1));i.addChild(e[e.length-1],o)}t.modules&&$t(t.modules,(function(t,o){r.register(e.concat(o),t,n)}))},Qt.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],r=t.getChild(n);r&&r.runtime&&t.removeChild(n)},Qt.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var tn;var nn=function(e){var t=this;void 0===e&&(e={}),!tn&&"undefined"!==typeof window&&window.Vue&&vn(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Qt(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new tn,this._makeLocalGettersCache=Object.create(null);var o=this,i=this,s=i.dispatch,a=i.commit;this.dispatch=function(e,t){return s.call(o,e,t)},this.commit=function(e,t,n){return a.call(o,e,t,n)},this.strict=r;var c=this._modules.root.state;cn(this,c,[],this._modules.root),an(this,c),n.forEach((function(e){return e(t)}));var l=void 0!==e.devtools?e.devtools:tn.config.devtools;l&&Ht(this)},rn={state:{configurable:!0}};function on(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function sn(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;cn(e,n,[],e._modules.root,!0),an(e,n,t)}function an(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};$t(o,(function(t,n){i[n]=Jt(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=tn.config.silent;tn.config.silent=!0,e._vm=new tn({data:{$$state:t},computed:i}),tn.config.silent=s,e.strict&&fn(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),tn.nextTick((function(){return r.$destroy()})))}function cn(e,t,n,r,o){var i=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!i&&!o){var a=mn(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){tn.set(a,c,r.state)}))}var l=r.context=ln(e,s,n);r.forEachMutation((function(t,n){var r=s+n;un(e,r,t,l)})),r.forEachAction((function(t,n){var r=t.root?n:s+n,o=t.handler||t;hn(e,r,o,l)})),r.forEachGetter((function(t,n){var r=s+n;pn(e,r,t,l)})),r.forEachChild((function(r,i){cn(e,t,n.concat(i),r,o)}))}function ln(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=gn(n,r,o),s=i.payload,a=i.options,c=i.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:r?e.commit:function(n,r,o){var i=gn(n,r,o),s=i.payload,a=i.options,c=i.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return dn(e,t)}},state:{get:function(){return mn(e.state,n)}}}),o}function dn(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function un(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push((function(t){n.call(e,r.state,t)}))}function hn(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push((function(t){var o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return Yt(o)||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}function pn(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)})}function fn(e){e._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function mn(e,t){return t.reduce((function(e,t){return e[t]}),e)}function gn(e,t,n){return Xt(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function vn(e){tn&&e===tn||(tn=e,Ut(tn))}rn.state.get=function(){return this._vm._data.$$state},rn.state.set=function(e){0},nn.prototype.commit=function(e,t,n){var r=this,o=gn(e,t,n),i=o.type,s=o.payload,a=(o.options,{type:i,payload:s}),c=this._mutations[i];c&&(this._withCommit((function(){c.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,r.state)})))},nn.prototype.dispatch=function(e,t){var n=this,r=gn(e,t),o=r.type,i=r.payload,s={type:o,payload:i},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(l){0}var c=a.length>1?Promise.all(a.map((function(e){return e(i)}))):a[0](i);return new Promise((function(e,t){c.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(l){0}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(l){0}t(e)}))}))}},nn.prototype.subscribe=function(e,t){return on(e,this._subscribers,t)},nn.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return on(n,this._actionSubscribers,t)},nn.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},nn.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},nn.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"===typeof e&&(e=[e]),this._modules.register(e,t),cn(this,this.state,e,this._modules.get(e),n.preserveState),an(this,this.state)},nn.prototype.unregisterModule=function(e){var t=this;"string"===typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=mn(t.state,e.slice(0,-1));tn.delete(n,e[e.length-1])})),sn(this)},nn.prototype.hasModule=function(e){return"string"===typeof e&&(e=[e]),this._modules.isRegistered(e)},nn.prototype.hotUpdate=function(e){this._modules.update(e),sn(this,!0)},nn.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(nn.prototype,rn);var bn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=An(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"===typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),yn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=An(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),wn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||An(this.$store,"mapGetters",e))return this.$store.getters[o]},n[r].vuex=!0})),n})),xn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=An(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),kn=function(e){return{mapState:bn.bind(null,e),mapGetters:wn.bind(null,e),mapMutations:yn.bind(null,e),mapActions:xn.bind(null,e)}};function Cn(e){return Sn(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function Sn(e){return Array.isArray(e)||Xt(e)}function En(e){return function(t,n){return"string"!==typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function An(e,t,n){var r=e._modulesNamespaceMap[n];return r}function _n(e){void 0===e&&(e={});var t=e.collapsed;void 0===t&&(t=!0);var n=e.filter;void 0===n&&(n=function(e,t,n){return!0});var r=e.transformer;void 0===r&&(r=function(e){return e});var o=e.mutationTransformer;void 0===o&&(o=function(e){return e});var i=e.actionFilter;void 0===i&&(i=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var a=e.logMutations;void 0===a&&(a=!0);var c=e.logActions;void 0===c&&(c=!0);var l=e.logger;return void 0===l&&(l=console),function(e){var d=Gt(e.state);"undefined"!==typeof l&&(a&&e.subscribe((function(e,i){var s=Gt(i);if(n(e,d,s)){var a=Pn(),c=o(e),u="mutation "+e.type+a;Tn(l,u,t),l.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),l.log("%c mutation","color: #03A9F4; font-weight: bold",c),l.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),Mn(l)}d=s})),c&&e.subscribeAction((function(e,n){if(i(e,n)){var r=Pn(),o=s(e),a="action "+e.type+r;Tn(l,a,t),l.log("%c action","color: #03A9F4; font-weight: bold",o),Mn(l)}})))}}function Tn(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(o){e.log(t)}}function Mn(e){try{e.groupEnd()}catch(t){e.log("—— log end ——")}}function Pn(){var e=new Date;return" @ "+On(e.getHours(),2)+":"+On(e.getMinutes(),2)+":"+On(e.getSeconds(),2)+"."+On(e.getMilliseconds(),3)}function In(e,t){return new Array(t+1).join(e)}function On(e,t){return In("0",t-e.toString().length)+e}var Dn={Store:nn,install:vn,version:"3.6.2",mapState:bn,mapMutations:yn,mapGetters:wn,mapActions:xn,createNamespacedHelpers:kn,createLogger:_n},Nn=Dn,Rn=f(85564),Bn=f.n(Rn),Ln=f(44908),jn=f.n(Ln);function Fn(e,t,n){Object.hasOwn(e,t)?e.set(t,n):(delete Object.getPrototypeOf(e)[t],zt().set(e,t,n))}function zn(e,t,n){e.nodes.filter((function(e){var t=e.definition;return("bpmn:IntermediateCatchEvent"===t.$type||"bpmn:StartEvent"===t.$type)&&t.eventDefinitions&&t.eventDefinitions.some(n)})).forEach((function(e){var n=e.definition;n.eventDefinitions[0][t]=null}))}zt().use(Nn);var Un=new Nn.Store({state:{graph:null,paper:null,highlightedNodes:[],nodes:[],rootElements:[],autoValidate:!1,globalProcesses:[],allowSavingElementPosition:!0,copiedElements:[],clientLeftPaper:!1,readOnly:!1,isMultiplayer:!1},getters:{nodes:function(e){return e.nodes},paper:function(e){return e.paper},highlightedNodes:function(e){return e.highlightedNodes},nodeShape:function(e){return function(t){return e.graph.getCells().find((function(e){return e.component&&e.component.node===t}))}},highlightedShapes:function(e,t){return t.highlightedNodes.filter((function(e){return"processmaker-modeler-process"!==e.type})).map(t.nodeShape)},rootElements:function(e){return e.rootElements},autoValidate:function(e){return e.autoValidate},globalProcesses:function(e){return e.globalProcesses},globalProcessEvents:function(e,t){return Bn()(t.globalProcesses.map((function(e){return e.events})))},allowSavingElementPosition:function(e){return e.allowSavingElementPosition},copiedElements:function(e){return e.copiedElements},clientLeftPaper:function(e){return e.clientLeftPaper},isReadOnly:function(e){return e.readOnly},showComponent:function(e){return!e.readOnly},isMultiplayer:function(e){return e.isMultiplayer}},mutations:{setReadOnly:function(e,t){e.readOnly=t},preventSavingElementPosition:function(e){e.allowSavingElementPosition=!1},allowSavingElementPosition:function(e){e.allowSavingElementPosition=!0},setAutoValidate:function(e,t){e.autoValidate=t},setRootElements:function(e,t){e.rootElements=t},updateNodeBounds:function(e,t){var n=t.node,r=t.bounds;r&&Object.entries(r).forEach((function(e){var t=jt(e,2),r=t[0],o=t[1];"$type"!==r&&n.diagram.bounds.set(r,o)}))},updateNodeProp:function(e,t){var n=t.node,r=t.key,o=t.value;"id"==r&&n.definition.id!==o&&e.nodes.some((function(e){return e.definition.id===o}))||(Fn(n.definition,r,o),null==o&&zt()["delete"](n.definition,r))},clearNodes:function(e){e.nodes=[]},highlightNode:function(e,t){e.highlightedNodes=t?[t]:[]},addToHighlightedNodes:function(e,t){var n=jn()([].concat(W(e.highlightedNodes),W(t))),r=n.filter((function(e){return"processmaker-modeler-pool"===e.type})).map((function(e){return e.id}));e.highlightedNodes=n.filter((function(e){return!e.pool||!e.pool.component.node.id||!r.includes(e.pool.component.node.id)}))},addNode:function(e,t){t._modelerId="_modelerId_"+t.definition.get("id"),e.nodes.push(t)},removeNode:function(e,t){var n=e.nodes.indexOf(t);-1!==n&&e.nodes.splice(n,1)},removeMessageRef:function(e,t){zn(e,"messageRef",(function(e){var n=e.messageRef;return n===t}))},removeSignalRef:function(e,t){zn(e,"signalRef",(function(e){var n=e.signalRef;return n===t}))},setGraph:function(e,t){e.graph=t},setPaper:function(e,t){e.paper=t},setGlobalProcesses:function(e,t){e.globalProcesses=t},setCopiedElements:function(e,t){e.copiedElements=t},setClientLeftPaper:function(e,t){e.clientLeftPaper=t},enableMultiplayer:function(e,t){e.isMultiplayer=t}},actions:{fetchGlobalProcesses:function(e){return l(a().mark((function t(){var n,r,o;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.commit,t.prev=1,t.next=4,window.ProcessMaker.apiClient.get("processes",{params:{order_direction:"asc",per_page:1e3,status:"all",include:"events,category"}});case 4:r=t.sent,o=r.data,n("setGlobalProcesses",o.data),window.ProcessMaker.globalProcesses=o.data,t.next=12;break;case 10:t.prev=10,t.t0=t["catch"](1);case 12:case"end":return t.stop()}}),t,null,[[1,10]])})))()}}}),qn="#5096db",Vn="#FF0000",Hn="#3FA6FF",Wn="#DCF2FF",Gn="#CCCCCC",$n="#F5F5F5",Xn="#00BA7C",Yn="#D6FFE6",Jn={source:"source",target:"target"};function Zn(e){return e.x&&e.y}var Kn={props:["highlighted","paper","paperManager","isCompleted","isIdle"],data:function(){return{linkView:null,sourceShape:null,target:null,listeningToMouseup:!1,listeningToMouseleave:!1,vertices:null,anchorPointFunction:Mt}},watch:{target:function(e,t){t&&t!==e&&Nt(t)},isValidConnection:function(e){e?this.shape.stopListening(this.paper,"blank:pointerdown link:pointerdown element:pointerdown",this.removeLink):this.shape.listenToOnce(this.paper,"blank:pointerdown link:pointerdown element:pointerdown",this.removeLink)},highlighted:function(e){Un.getters.isReadOnly||(e?(this.shape.attr({line:{stroke:"#5096db"},".joint-highlight-stroke":{display:"none"}}),this.shapeView.showTools()):(Nt(this.shape),this.shapeView.hideTools()))}},computed:{shapeView:function(){return this.shape.findView(this.paper)},sourceNode:function(){return $()(this.sourceShape,"component.node")},targetNode:function(){return $()(this.target,"component.node")},sourceConfig:function(){return this.sourceNode&&this.nodeRegistry[this.sourceNode.type]},targetConfig:function(){return this.targetNode&&this.nodeRegistry[this.targetNode.type]},elementPadding:function(){return this.shape&&this.shape.source().id===this.shape.target().id?20:1}},methods:{setShapeHighlight:function(){this.isCompleted?this.shape.attr({line:{stroke:Xn}}):this.isIdle&&this.shape.attr({line:{stroke:Gn}})},findSourceShape:function(){var e=this;return this.graph.getElements().find((function(t){return t.component&&t.component.node.definition===e.node.definition.get("sourceRef")}))},setEndpoint:function(e,t,n){var r=this;if(e&&Zn(e))return this.shape[t](e,{anchor:{name:"modelCenter",args:{padding:25}},connectionPoint:{name:"boundary"}});var o=function(){var t=e.position(),r=t.x,o=t.y,i=e.size(),s=i.width,a=i.height;return n?{x:r+n.x,y:o+n.y}:{x:r+s/2,y:o+a/2}};this.shape[t](e,{anchor:function(){return r.getAnchorPointFunction(t)(o(),e.findView(r.paper))},connectionPoint:{name:"boundary"}})},setSource:function(e,t){this.setEndpoint(e,Jn.source,t)},setTarget:function(e,t){this.setEndpoint(e,Jn.target,t)},completeLink:function(){this.shape.stopListening(this.paper,"cell:mouseleave"),this.$emit("set-cursor",null),this.resetPaper();var e=this.shape.getTargetElement();Nt(e),this.shape.on("change:vertices",this.onChangeVertices),this.shape.on("change:source",this.onChangeTargets),this.shape.on("change:target",this.onChangeTargets),this.shape.listenTo(this.sourceShape,"change:position",this.updateWaypoints),this.shape.listenTo(e,"change:position",this.updateWaypoints),this.shape.listenTo(this.paper,"link:mouseleave",this.storeWaypoints);var t=this.shape.getSourceElement();t.embed(this.shape),this.$emit("set-shape-stacking",t)},waitForUpdateWaypoints:function(){var e=this;return new Promise((function(t){e.updateWaypoints(),e.updateWaypoints.flush(),t()}))},storeWaypoints:function(){var e=this;return l(a().mark((function t(){var n,r,o,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.highlighted||e.listeningToMouseleave){t.next=7;break}return e.updateWaypoints(),t.next=4,e.$nextTick();case 4:e.$parent.isMultiplayer&&e.linkView&&(n=e.linkView.model.component.node.type,r=e.linkView.sourceView.model.component.node.definition.id,o=e.linkView.targetView.model.component.node.definition.id,i=[{id:e.linkView.model.component.node.definition.id,properties:{type:n,waypoint:[e.linkView.sourceAnchor.toJSON()].concat(W(e.shape.vertices()),[e.linkView.targetAnchor.toJSON()]),sourceRefId:r,targetRefId:o}}],window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",i)),e.listeningToMouseleave=!0,e.$emit("save-state");case 7:case"end":return t.stop()}}),t)})))()},onChangeTargets:function(e,t,n){var r=this;return l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===n||void 0===n||!n.ui){e.next=8;break}return e.next=3,r.$nextTick();case 3:return e.next=5,r.waitForUpdateWaypoints();case 5:return r.listeningToMouseleave=!1,e.next=8,r.storeWaypoints();case 8:case"end":return e.stop()}}),e)})))()},onChangeVertices:function(e,t,n){var r=this;return l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===n||void 0===n||!n.ui){e.next=6;break}return r.updateWaypoints(),e.next=4,r.$nextTick();case 4:r.listeningToMouseleave=!1,r.$emit("save-state");case 6:case"end":return e.stop()}}),e)})))()},updateWaypoints:function(){var e=this;this.linkView=this.shape.findView(this.paper);var t=this.linkView.sourceAnchor,n=this.linkView.targetAnchor;this.node.diagram.waypoint=[t].concat(W(this.shape.vertices()),[n]).map((function(t){return e.moddle.create("dc:Point",t)})),this.listeningToMouseup||(this.listeningToMouseup=!0,document.addEventListener("mouseup",this.emitSave))},updateLinkTarget:function(e){var t=this,n=e.clientX,r=e.clientY,o=this.paper.clientToLocalPoint({x:n,y:r});if(this.target=this.graph.findModelsFromPoint(o).sort((function(e,t){return t.get("z")-e.get("z")}))[0],!this.isValidConnection)return this.$emit("set-cursor","not-allowed"),this.shape.target({x:o.x,y:o.y}),void(this.target&&Ze(this.target,ze));this.setTarget(this.target),this.updateRouter(),this.$emit("set-cursor","default"),Ze(this.target,Fe),this.paper.el.removeEventListener("mousemove",this.updateLinkTarget),this.shape.listenToOnce(this.paper,"cell:pointerclick",(function(){t.completeLink(),t.updateWaypoints(),t.updateWaypoints.flush(),t.updateDefinitionLinks&&t.updateDefinitionLinks(),t.linkView&&["processmaker-modeler-association","processmaker-modeler-data-input-association"].includes(t.shape.component.node.type)&&t.$parent.multiplayerHook(t.shape.component.node,!1),t.$emit("save-state")})),this.shape.listenToOnce(this.paper,"cell:mouseleave",(function(){t.paper.el.addEventListener("mousemove",t.updateLinkTarget),t.shape.stopListening(t.paper,"cell:pointerclick"),Nt(t.target),t.$emit("set-cursor","not-allowed")}))},removeLink:function(){this.$emit("remove-node",this.node),this.resetPaper()},resetPaper:function(){this.$emit("set-cursor",null),this.paper.el.removeEventListener("mousemove",this.updateLinkTarget),this.paper.setInteractivity(this.graph.get("interactiveFunc")),this.target&&Nt(this.target)},getAnchorPointFunction:function(e){return"source"===e?this.sourceShape.component.anchorPointFunction||this.anchorPointFunction:"target"===e?this.target.component.anchorPointFunction||this.anchorPointFunction:void 0},setupLinkTools:function(){var e=new F.linkTools.Vertices,t=new F.linkTools.SourceAnchor({snap:this.getAnchorPointFunction("source")}),n=new F.linkTools.TargetAnchor({snap:this.getAnchorPointFunction("target")}),r=new F.dia.ToolsView({tools:[e,t,n]});this.shapeView.addTools(r),this.shapeView.hideTools()},emitSave:function(){this.highlighted&&(this.updateWaypoints.flush(),document.removeEventListener("mouseup",this.emitSave),this.listeningToMouseup=!1)}},created:function(){this.updateWaypoints=Y()(this.updateWaypoints,100),this.emitSave.bind(this)},mounted:function(){var e=this;return l(a().mark((function t(){var n,r,o,i,s,c,l,d,u,h,p,f,m,g;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:if(e.sourceShape=e.findSourceShape(),e.setSource(e.sourceShape),e.$once("click",(function(){e.$nextTick((function(){Un.getters.isReadOnly||e.setupLinkTools()}))})),n=e.getTargetRef?e.getTargetRef():e.node.definition.get("targetRef"),n){t.next=8;break}return t.abrupt("return");case 8:n.id?(r=e.graph.getElements().find((function(e){return e.component&&e.component.node.definition===n})),e.target=r,o=e.node.diagram.waypoint,i=e.node.diagram.waypoint[0],s=o[o.length-1],c=r.position(),l=c.x,d=c.y,u={x:s.x-l,y:s.y-d},h=e.sourceShape.position(),p=h.x,f=h.y,m={x:i.x-p,y:i.y-f},o&&(g=o.slice(1,o.length-1).map((function(e){var t=e.x,n=e.y;return{x:t,y:n}})),e.shape.vertices(g)),e.setSource(e.sourceShape,m),e.setTarget(r,u),e.completeLink()):(e.setTarget(n),e.paper.setInteractivity(!1),e.paper.el.addEventListener("mousemove",e.updateLinkTarget),e.$emit("set-cursor","not-allowed"),e.isValidConnection?e.shape.stopListening(e.paper,"blank:pointerdown link:pointerdown element:pointerdown",e.removeLink):e.shape.listenToOnce(e.paper,"blank:pointerdown link:pointerdown element:pointerdown",e.removeLink)),e.updateRouter(),e.shape.on("change:vertices",(function(){this.component.$emit("shape-resize")})),Un.getters.isReadOnly&&e.$nextTick((function(){e.paperManager.awaitScheduledUpdates().then((function(){e.setShapeHighlight()}))}));case 12:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){document.removeEventListener("mouseup",this.emitSave)},destroyed:function(){this.updateWaypoints.cancel()}},Qn=f.p+"img/association-head.0b14da7b.svg",er="processmaker-modeler-association",tr="bpmn:Association",nr={none:"None",one:"One",both:"Both"};function rr(e){return e.create(tr,{associationDirection:nr.none,targetRef:{x:void 0,y:void 0}})}function or(e){return e.create("bpmndi:BPMNEdge")}var ir=function(){var e=this,t=e._self._c;return e.showCrownConfig?t("div",{staticClass:"crown-config",style:e.style,attrs:{role:"menu"}},[e._t("default"),t("association-flow-button",e._g({attrs:{node:e.node,moddle:e.moddle,shape:e.shape},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("generic-flow-button",e._g({attrs:{node:e.node,"node-registry":e.nodeRegistry,moddle:e.moddle},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("data-association-flow-button",e._g({attrs:{node:e.node,moddle:e.moddle,shape:e.shape},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("default-flow",e._g({attrs:{node:e.node}},e.$listeners)),t("crown-dropdowns",e._g({attrs:{"dropdown-data":e.dropdownData,"hide-color-dropdown":e.hideColorDropdown,"boundary-event-dropdown-data":e.boundaryEventDropdownData,node:e.node,"node-registry":e.nodeRegistry,moddle:e.moddle,shape:e.shape,"task-dropdown-initially-open":e.taskDropdownInitiallyOpen,showCustomIconPicker:e.showCustomIconPicker,iconName:e.iconName},on:{"replace-node-type":e.replaceNodeTypePrompt}},e.$listeners)),t("copy-button",e._g({attrs:{node:e.node}},e.$listeners)),t("clone-button",e._g({attrs:{node:e.node}},e.$listeners)),t("delete-button",e._g({attrs:{graph:e.graph,shape:e.shape,node:e.node}},e.$listeners)),t("preview-button",e._g({attrs:{graph:e.graph,shape:e.shape,node:e.node}},e.$listeners)),t("b-modal",{ref:"modal",attrs:{"no-fade":e.runningInCypressTest,id:"modal-prevent-closing",title:e.$t("Change Type"),"ok-title":e.$t("Confirm"),"cancel-title":e.$t("Cancel")},on:{hidden:function(t){e.showReplaceModal=!1},ok:e.confirmedReplaceNodeType},model:{value:e.showReplaceModal,callback:function(t){e.showReplaceModal=t},expression:"showReplaceModal"}},[t("p",[e._v(e._s(e.$t("Changing this type will replace your current configuration")))])])],2):e._e()},sr=[],ar=(f(47941),function(){var e=this,t=e._self._c;return e.displayIcon?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Preview"),role:"menuitem",id:"preview-button","aria-label":"Preview","data-test":"preview-button"},on:{click:function(t){return e.preview()}}},[t("i",{staticClass:"fas fa-eye cog-container--button"})]):e._e()}),cr=[],lr=(f(85827),f.p+"img/trash-alt-solid.9d41abd9.svg"),dr=function(){var e=this,t=e._self._c;return t("button",e._g({staticClass:"crown-button",attrs:{id:e.id,"aria-label":e.ariaLabel}},e.$listeners),[e._t("default",(function(){return[t("img",{staticClass:"crown-icon",attrs:{src:e.src,width:"width",height:"height"}})]}))],2)},ur=[],hr={props:{id:String,ariaLabel:String,src:String,width:{type:Number,default:19},height:{type:Number,default:20}}},pr=hr;f(21353);function fr(e,t,n,r,o,i,s,a){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=a?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var d=l.render;l.render=function(e,t){return c.call(t),d(e,t)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:e,options:l}}var mr=fr(pr,dr,ur,!1,null,"09d8a8ac",null),gr=mr.exports,vr=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],br=vr,yr={components:{CrownButton:gr},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lr,validPreviewElements:br,displayIcon:!1}},mounted:function(){var e=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})},t=e(this.node),n=window.ProcessMaker.$modeler.previewConfigs.find((function(e){return e.matcher(t)}));this.displayIcon=!!n},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{preview:function(){window.ProcessMaker.$modeler.isOpenPreview?window.ProcessMaker.$modeler.isOpenPreview=!1:this.$emit("previewNode",this.node)}}},wr=yr,xr=fr(wr,ar,cr,!1,null,null,null),kr=xr.exports,Cr=function(){var e=this,t=e._self._c;return t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Delete"),role:"menuitem",id:"delete-button","aria-label":"Delete this node"},on:{click:function(t){e.isPoolLane?e.removePoolLaneShape():e.removeShape()}}},[t("i",{staticClass:"fas fa-trash-alt cog-container--button"})])},Sr=[],Er=f(50467),Ar=f.n(Er),_r="processmaker-modeler-data-output-association",Tr="bpmn:DataOutputAssociation";function Mr(e){return e.create("bpmn:DataOutputAssociation",{targetRef:{x:void 0,y:void 0}})}function Pr(e){return e.create("bpmndi:BPMNEdge")}var Ir="processmaker-modeler-data-input-association",Or="bpmn:DataInputAssociation";function Dr(e){return e.create("bpmn:DataInputAssociation",{targetRef:{x:void 0,y:void 0}})}function Nr(e){return e.create("bpmndi:BPMNEdge")}function Rr(e,t){var n=this,r=e.getConnectedLinks(t);r.forEach((function(e){return n.$emit("remove-node",e.component.node)}))}function Br(e,t){e.definition.incoming&&e.definition.incoming.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));t.removeNode(n)})),e.definition.outgoing&&e.definition.outgoing.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));t.removeNode(n)}))}function Lr(e,t){var n=t.nodes.filter((function(t){return!(!t.definition.sourceRef||t.definition.sourceRef!==e.definition)||(!(!t.definition.targetRef||t.definition.targetRef!==e.definition)||void 0)}));n.forEach((function(e){t.removeNode(e)}))}function jr(e,t){var n=t.nodes.filter((function(t){return!(!t.definition.sourceRef||t.definition.sourceRef!==e.definition)||(!(!t.definition.targetRef||t.definition.targetRef!==e.definition)||void 0)}));n.forEach((function(e){t.removeNode(e)}))}function Fr(e,t,n){var r=e.getCells().find((function(e){return e.component&&e.component.node===t}));r&&r.getEmbeddedCells({deep:!0}).filter((function(e){return e.component&&e.component.node.isBpmnType("bpmn:BoundaryEvent")})).forEach((function(t){e.getConnectedLinks(t).forEach((function(e){return n(e.component.node)})),n(t.component.node)}))}function zr(e){if(!e.isBpmnType(Tr,Or)){var t=e.definition,n=t.sourceRef,r=t.targetRef;n&&(0,Er.pull)(n.get("outgoing"),e.definition),r&&r.id&&(0,Er.pull)(r.get("incoming"),e.definition)}}function Ur(e){var t=(0,Er.get)(e,"definition.sourceRef.default.id",null);t&&t===e.id&&e.definition.sourceRef.set("default",null)}function qr(e,t,n){if("bpmn:DataObjectReference"!==n.$type&&"bpmn:DataStoreReference"!==n.$type)throw"Source node must be a DataObjectReference or bpmn:DataStoreReference, got "+n.$type;var r=n.id,o="data_input_".concat(r);t.definition.ioSpecification||(t.definition.ioSpecification=e.create("bpmn:InputOutputSpecification",{dataInputs:[],dataOutputs:[],inputSets:[],outputSets:[]}),t.definition.ioSpecification.$parent=t.definition),t.definition.ioSpecification.dataInputs||t.definition.ioSpecification.set("dataInputs",[]);var i=t.definition.ioSpecification.dataInputs.find((function(e){return e.id===o}));i||(t.definition.ioSpecification.dataInputs.push(e.create("bpmn:DataInput",{id:o,isCollection:"false",name:n.name})),t.definition.ioSpecification.dataInputs[t.definition.ioSpecification.dataInputs.length-1].$parent=t.definition.ioSpecification,t.definition.ioSpecification.set("dataInputs",t.definition.ioSpecification.dataInputs)),i=t.definition.ioSpecification.dataInputs.find((function(e){return e.id===o})),t.definition.ioSpecification.outputSets||t.definition.ioSpecification.set("outputSets",[e.create("bpmn:OutputSet",{dataOutputRefs:[]})]);var s=t.definition.ioSpecification.outputSets[0];s||t.definition.ioSpecification.set("outputSets",[e.create("bpmn:OutputSet",{dataOutputRefs:[]})]),s=t.definition.ioSpecification.outputSets[0],t.definition.ioSpecification.inputSets||t.definition.ioSpecification.set("inputSets",[e.create("bpmn:InputSet",{dataInputRefs:[]})]);var a=t.definition.ioSpecification.inputSets[0];a||t.definition.ioSpecification.set("inputSets",[e.create("bpmn:InputSet",{dataInputRefs:[]})]),a=t.definition.ioSpecification.inputSets[0];var c=a.get("dataInputRefs").find((function(e){return e.id===o}));return c||a.dataInputRefs.push(i),i}function Vr(e,t){var n,r=e.$parent;return r||(null===(n=t.nodes.find((function(t){var n;return t.definition.ioSpecification===e||(null===(n=t.definition.ioSpecification)||void 0===n?void 0:n.id)===e.id})))||void 0===n?void 0:n.definition)}function Hr(e,t){if("bpmn:DataObjectReference"!==t.$type&&"bpmn:DataStoreReference"!==t.$type)throw"Source node must be a DataObjectReference or bpmn:DataStoreReference, got "+t.$type;var n=t.id,r="data_input_".concat(n);if(e.definition.ioSpecification&&e.definition.ioSpecification.dataInputs){var o=e.definition.ioSpecification.dataInputs.find((function(e){return e.id===r}));if(o&&((0,Er.pull)(e.definition.ioSpecification.dataInputs,o),e.definition.ioSpecification.inputSets)){var i=e.definition.ioSpecification.inputSets[0];if(i){var s=i.dataInputRefs.find((function(e){return e.id===r}));if(s&&(0,Er.pull)(i.dataInputRefs,s),0===i.dataInputRefs.length&&delete e.definition.ioSpecification.inputSets,e.definition.ioSpecification.outputSets){var a=e.definition.ioSpecification.outputSets[0];!a||a.dataOutputRefs&&0!==a.dataOutputRefs.length||delete e.definition.ioSpecification.outputSets}e.definition.ioSpecification.inputSets||e.definition.ioSpecification.outputSets||delete e.definition.ioSpecification}}}}var Wr={components:{CrownButton:gr},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lr}},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{removeFlows:Rr,removeShape:function(){this.removeFlows(this.graph,this.shape),this.$emit("remove-node",this.node)},removePoolLaneShape:function(){var e=this;this.$emit("remove-node",this.node);var t=this.node.pool.component,n=t.sortedLanes();2!==n.length?this.shape!==n[n.length-1]?t.fillLanes(this.shape,"bottom-right",!0):t.fillLanes(this.shape,"top-right",!0):this.$emit("remove-node",n.filter((function(t){return t!==e.shape}))[0].component.node)}}},Gr=Wr,$r=fr(Gr,Cr,Sr,!1,null,null,null),Xr=$r.exports,Yr=function(){var e=this,t=e._self._c;return e.allowOutgoingSequenceFlow?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Flow"),id:"generic-flow-button","aria-label":"Create a flow",role:"menuitem"},on:{click:e.addSequence}},[t("font-awesome-icon",{attrs:{icon:["fpm","fa-connect-elements"]}})],1):e._e()},Jr=[],Zr=f.p+"img/connect-elements.ab6af00f.svg";f(38880),f(49337);function Kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kr(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}f(15306);var eo={"processmaker-modeler-start-event":"Start Event","processmaker-modeler-start-timer-event":"Start Timer Event","processmaker-modeler-signal-start-event":"Signal Start Event","processmaker-modeler-message-start-event":"Message Start Event","processmaker-modeler-conditional-start-event":"Conditional Start Event"},to=eo,no={"processmaker-modeler-end-event":"End Event","processmaker-modeler-error-end-event":"Error End Event","processmaker-modeler-message-end-event":"Message End Event","processmaker-modeler-signal-end-event":"Signal End Event","processmaker-modeler-terminate-end-event":"Terminate End Event"},ro=no,oo={"processmaker-modeler-task":"Form Task","processmaker-modeler-manual-task":"Manual Task","processmaker-modeler-script-task":"Script Task","processmaker-modeler-call-activity":"Sub Process","processmaker-modeler-data-object":"Data Object","processmaker-modeler-data-store":"Data Store"},io=oo,so={"processmaker-modeler-exclusive-gateway":"Exclusive Gateway","processmaker-modeler-inclusive-gateway":"Inclusive Gateway","processmaker-modeler-parallel-gateway":"Parallel Gateway","processmaker-modeler-event-based-gateway":"Event Based Gateway"},ao=so,co={"processmaker-modeler-intermediate-catch-timer-event":"Intermediate Timer Event","processmaker-modeler-intermediate-signal-catch-event":"Intermediate Signal Catch Event","processmaker-modeler-intermediate-signal-throw-event":"Intermediate Signal Throw Event","processmaker-modeler-intermediate-message-catch-event":"Intermediate Message Catch Event","processmaker-modeler-intermediate-message-throw-event":"Intermediate Message Throw Event","processmaker-modeler-intermediate-conditional-catch-event":"Intermediate Conditional Catch Event"},lo=co,uo=f(50361),ho=f.n(uo),po=function(){function e(t,n,r){d(this,e),y(this,"type",void 0),y(this,"definition",void 0),y(this,"diagram",void 0),y(this,"pool",void 0),this.type=t,this.definition=n,this.diagram=r}return g(e,[{key:"isBpmnType",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.includes(this.definition.$type)}},{key:"canBeDefaultFlow",value:function(){var e=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"];return"bpmn:SequenceFlow"===this.definition.$type&&e.includes(this.definition.sourceRef.$type)}},{key:"isType",value:function(e){return this.type===e}},{key:"isStartEvent",value:function(){return Object.keys(to).includes(this.type)}},{key:"isEndEvent",value:function(){return Object.keys(ro).includes(this.type)}},{key:"isTask",value:function(){return Object.keys(io).includes(this.type)}},{key:"isGateway",value:function(){return Object.keys(ao).includes(this.type)}},{key:"isIntermediateEvent",value:function(){return Object.keys(lo).includes(this.type)}},{key:"id",get:function(){return this.definition.id},set:function(e){this.definition.id=e}},{key:"setIds",value:function(e,t){var n,r,o=this,i=t?[t,t+"_di"]:e.generate(),s=jt(i,2),a=s[0],c=s[1];if(this.id||(this.id=a),this.diagram&&(this.diagram.id=c,this.diagram.bpmnElement=this.definition),this.definition.loopCharacteristics&&"bpmn:StandardLoopCharacteristics"===this.definition.loopCharacteristics.$type&&(this.definition.loopCharacteristics.set("id",e.generate()[0]),this.definition.loopCharacteristics.loopCondition&&this.definition.loopCharacteristics.get("loopCondition").set("id",e.generate()[0])),this.definition.ioSpecification){this.definition.ioSpecification.set("id",e.generate()[0]);var l=this.definition.id;this.definition.ioSpecification.get("dataInputs")&&this.definition.ioSpecification.get("dataInputs").forEach((function(t){var r=t.get("id");r.substring(0,o.cloneOf.length)===o.cloneOf?(t.set("id",r.replace(o.cloneOf+"_",l+"_")),n=t):t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("dataOutputs")&&this.definition.ioSpecification.get("dataOutputs").forEach((function(t){var n=t.get("id");n.substring(0,o.cloneOf.length)===o.cloneOf?(t.set("id",n.replace(o.cloneOf+"_",l+"_")),r=t):t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("inputSets")&&this.definition.ioSpecification.get("inputSets").forEach((function(t){t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("outputSets")&&this.definition.ioSpecification.get("outputSets").forEach((function(t){t.set("id",e.generate()[0])}))}this.definition.loopCharacteristics&&"bpmn:MultiInstanceLoopCharacteristics"===this.definition.loopCharacteristics.$type&&(this.definition.loopCharacteristics.set("id",e.generate()[0]),this.definition.loopCharacteristics.loopCardinality&&this.definition.loopCharacteristics.get("loopCardinality").set("id",e.generate()[0]),this.definition.loopCharacteristics.loopDataInputRef&&n&&this.definition.loopCharacteristics.set("loopDataInputRef",n),this.definition.loopCharacteristics.loopDataOutputRef&&r&&this.definition.loopCharacteristics.set("loopDataOutputRef",r),this.definition.loopCharacteristics.inputDataItem&&this.definition.loopCharacteristics.get("inputDataItem").set("id",e.generate()[0]),this.definition.loopCharacteristics.outputDataItem&&this.definition.loopCharacteristics.get("outputDataItem").set("id",e.generate()[0]),this.definition.loopCharacteristics.completionCondition&&this.definition.loopCharacteristics.get("completionCondition").set("id",e.generate()[0]))}},{key:"clone",value:function(t,n,r){var o=this,i=t[this.type].definition(n,r),a=t[this.type].diagram(n),c=new this.constructor(this.type,i,a);return c.id=null,c.pool=this.pool,c.cloneOf=this.id,e.diagramPropertiesToCopy.forEach((function(e){return c.diagram.bounds[e]=o.diagram.bounds[e]})),Object.keys(this.definition).filter((function(t){return!e.definitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=o.definition.get(e),n="object"===s(t)?ho()(t):t;if("eventDefinitions"===e)for(var r in n)t[r].signalRef&&!n[r].signalRef&&n[r].set("signalRef",Qr({},t[r].signalRef));c.definition.set(e,n)})),e.eventDefinitionPropertiesToNotCopy.forEach((function(e){return c.definition.eventDefinitions&&c.definition.eventDefinitions[0]&&Object.hasOwn(c.definition.eventDefinitions[0],e)&&c.definition.eventDefinitions[0].set(e,null)})),c}},{key:"cloneFlow",value:function(t,n,r){var o=this,i=t[this.type].definition(n,r),a=t[this.type].diagram(n),c=new this.constructor(this.type,i,a);return c.id=null,c.pool=this.pool,c.cloneOf=this.id,c.diagram=n.create("bpmndi:BPMNEdge",{waypoint:[]}),this.diagram.waypoint.forEach((function(e){var t=n.create("dc:Point",{x:e.x,y:e.y});c.diagram.waypoint.push(t)})),Object.keys(this.definition).filter((function(t){return!e.flowDefinitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=o.definition.get(e),n="object"===s(t)?ho()(t):t;if("eventDefinitions"===e)for(var r in n)t[r].signalRef&&!n[r].signalRef&&n[r].set("signalRef",Qr({},t[r].signalRef));c.definition.set(e,n),c.definition.set("sourceRef",null),c.definition.set("targetRef",null)})),e.eventDefinitionPropertiesToNotCopy.forEach((function(e){return c.definition.eventDefinitions&&c.definition.eventDefinitions[0]&&Object.hasOwn(c.definition.eventDefinitions[0],e)&&c.definition.eventDefinitions[0].set(e,null)})),c}},{key:"getTargetProcess",value:function(e,t){var n=this;return this.pool?e.find((function(e){var t=e.id;return t===n.pool.component.node.definition.get("processRef").id})):t.definition}}],[{key:"isTimerType",value:function(e){return["processmaker-modeler-start-timer-event","processmaker-modeler-intermediate-catch-timer-event"].includes(e)}}]),e}();y(po,"diagramPropertiesToCopy",["x","y","width","height"]),y(po,"definitionPropertiesToNotCopy",["$type","id","dataOutputAssociations"]),y(po,"flowDefinitionPropertiesToNotCopy",["$type","id","sourceRef","targetRef"]),y(po,"eventDefinitionPropertiesToNotCopy",["errorRef","messageRef"]);var fo="processmaker-modeler-generic-flow",mo=f(65554),go={prefix:"fpm",iconName:"fa-boundary-event",icon:[112,112,[],"e001","M51.739 2.056c-13.026.848-25.131 6.341-34.43 15.625C10.84 24.139 6.603 30.987 3.72 39.642.81 48.38.051 56.948 1.392 65.92c.932 6.232 3.501 13.807 6.441 18.991 8.903 15.7 23.772 25.701 41.487 27.903 2.517.312 9.393.312 11.911 0 17.703-2.201 32.617-12.231 41.488-27.903 2.943-5.2 5.508-12.763 6.439-18.991 1.698-11.359-.064-22.783-5.13-33.257-4.913-10.156-13.314-18.932-23.21-24.247-7.159-3.845-14.191-5.854-22.286-6.365-3.224-.204-3.584-.204-6.793.005m8.216 4.091c8.319.827 15.946 3.548 22.891 8.165 3.153 2.096 5.414 3.998 8.35 7.021 7.582 7.807 12.34 17.536 14.049 28.731.423 2.764.572 9.015.29 12.1-.962 10.515-4.848 20.143-11.415 28.286-1.857 2.303-5.901 6.293-8.136 8.029a50.9 50.9 0 0 1-23.544 10.144c-3.182.489-11.148.489-14.33 0-5.812-.893-11.669-2.875-16.75-5.668-11.303-6.213-20.134-17.022-24.092-29.49-3.259-10.266-3.259-21.647 0-31.913a51.37 51.37 0 0 1 11.995-20.128c2.834-2.93 5.301-5.008 8.426-7.097a49.964 49.964 0 0 1 22.654-8.169c2.192-.225 7.401-.231 9.612-.011m-9.053 12.099c-20.419 2.322-35.641 19.091-35.641 39.263 0 14.657 8.112 27.984 21.217 34.859 14.221 7.46 31.65 5.768 44.132-4.283 14.219-11.449 18.699-30.977 10.879-47.42-5.522-11.611-16.451-19.808-29.421-22.068-2.55-.444-8.659-.636-11.166-.351m6.979 3.906c1.382.105 3.214.321 4.071.481 12.854 2.394 23.482 11.579 27.55 23.808 4.141 12.449 1.019 26.046-8.153 35.508-5.615 5.792-12.307 9.26-20.584 10.667-2.565.436-8.414.436-10.98 0-11.016-1.872-19.998-7.889-25.586-17.14-5.178-8.573-6.354-19.406-3.15-29.035 4.492-13.506 16.952-23.186 31.248-24.278 2.856-.218 2.85-.218 5.584-.011"]},vo={prefix:"fpm",iconName:"fa-connect-elements",icon:[20,20,[],"e002","M0 2.502v2.501h5.003V3.008h5.004v15.01h5.478V19c0 .54.011.981.024.981.053-.001 2.989-2.477 2.964-2.499a203.517 203.517 0 0 0-2.942-2.429c-.04-.016-.046.116-.046.967v.985h-4.497V1.995H5.003V0H0v2.502m3.99.016v1.504H1.013V1.013H3.99v1.505"]},bo={prefix:"fpm",iconName:"fa-lane-above",icon:[26,18,[],"e003","M0 .997v.996h.997V.997h1.04V0H0v.997M2.99.498v.499h2.037V0H2.99v.498m2.99 0v.499h2.037V0H5.98v.498m3.033 0v.499h1.994V0H9.013v.498m2.99 0v.499h1.994V0h-1.994v.498m2.99 0v.499h1.994V0h-1.994v.498m2.99 0v.499h2.037V0h-2.037v.498m2.99 0v.499h2.037V0h-2.037v.498m2.99 0v.499h1.04v.996H26V0h-2.037v.498M0 3.987v.996h.997V2.99H0v.997m25.003 0v.996H26V2.99h-.997v.997M0 11.982v6.001h26V5.98H0v6.002"]},yo={prefix:"fpm",iconName:"fa-lane-below",icon:[26,18,[],"e004","M0 6.002v6.001h26V0H0v6.002m0 7.995v.996h.997V13H0v.997m25.003 0v.996H26V13h-.997v.997M0 16.987v.996h2.037v-.996H.997v-.997H0v.997m25.003-.499v.499h-1.04v.996H26V15.99h-.997v.498m-22.013.997v.498h2.037v-.996H2.99v.498m2.99 0v.498h2.037v-.996H5.98v.498m3.033 0v.498h1.994v-.996H9.013v.498m2.99 0v.498h1.994v-.996h-1.994v.498m2.99 0v.498h1.994v-.996h-1.994v.498m2.99 0v.498h2.037v-.996h-2.037v.498m2.99 0v.498h2.037v-.996h-2.037v.498"]},wo={prefix:"fpm",iconName:"fa-center-horizontally",icon:[24,24,[],"e001","M11.04 4.88v1.88H7.28v3.92h3.76v3.28H5v3.92h6.04v3.76h1v-3.76h6.04v-3.92h-6.04v-3.28h3.76V6.76h-3.76V3h-1v1.88"]},xo={prefix:"fpm",iconName:"fa-center-vertically",icon:[24,24,[],"e001","M6.76 8.04v3.04H3v.96h3.76v6.04h3.92v-6.04h3.28v3.76h3.92v-3.76h3.76v-.959l-1.87-.011-1.87-.01-.01-1.89-.011-1.89H13.96v3.801l-1.63-.011-1.63-.01-.01-3.03L10.679 5H6.76v3.04"]},ko={prefix:"fpm",iconName:"fa-align-left",icon:[24,24,[],"e001","M4 12.32v9.32h1V3H4v9.32m2.28-3.6v1.96h8.52V6.76H6.28v1.96m0 7.2v1.96h13.08v-3.92H6.28v1.96"]},Co={prefix:"fpm",iconName:"fa-align-right",icon:[24,24,[],"e001","M18.4 12.32v9.32h1V3h-1v9.32m-9.8-3.6v1.96h8.48V6.76H8.6v1.96M4 15.92v1.96h13.08v-3.92H4v1.96"]},So={prefix:"fpm",iconName:"fa-align-bottom",icon:[24,24,[],"e001","M6.76 10.54v6.54h3.92V4H6.76v6.54m7.2 2.3v4.24h3.92V8.6h-3.92v4.24M3 18.9v.5h18.64v-1H3v.5"]},Eo={prefix:"fpm",iconName:"fa-align-top",icon:[24,24,[],"e001","M3 4.5V5h18.64V4H3v.5m3.76 8.32v6.54h3.92V6.28H6.76v6.54m7.2-2.28v4.26h3.92V6.28h-3.92v4.26"]},Ao={prefix:"fpm",iconName:"fa-distribute-horizontally",icon:[24,24,[],"e001","M3 12.32v9.32h.96V3H3v9.32m17 0v9.32h1V3h-1v9.32m-10.44.02v6.54h4.88V5.8H9.56v6.54"]},_o={prefix:"fpm",iconName:"fa-distribute-vertically",icon:[24,24,[],"e001","M3 3.5V4h18.64V3H3v.5M5.8 12v2.44h13.08V9.56H5.8V12M3 20.52V21h18.64v-.96H3v.48"]},To=f(39865),Mo=["processmaker-modeler-data-object","processmaker-modeler-data-store","processmaker-modeler-lane","processmaker-modeler-end-event","processmaker-modeler-error-end-event","processmaker-modeler-signal-end-event","processmaker-modeler-terminate-end-event","processmaker-modeler-text-annotation","processmaker-modeler-sequence-flow","processmaker-modeler-message-flow"],Po={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},props:["node","moddle","nodeRegistry"],data:function(){return{sequenceFlow:Zr}},computed:{paper:function(){return Un.getters.paper},sequenceFlowConfig:function(){return this.nodeRegistry[fo]},nodeConfig:function(){return this.nodeRegistry[this.node.type]},allowOutgoingSequenceFlow:function(){var e=this;return!Mo.some((function(t){return e.node.isType(t)}))}},methods:{addSequence:function(e,t,n,r){this.$emit("toggle-crown-state",!1);var o=e.clientX,i=e.clientY,s=null;e&&(s=(0,F.V)(this.paper.viewport).toLocalPoint(o,i));var a=this.moddle.create("bpmn:SequenceFlow",{name:"",sourceRef:this.node.definition,targetRef:{x:n||s.x,y:r||s.y}});this.$emit("add-node",new po(fo,a,this.moddle.create("bpmndi:BPMNEdge")))}},created:function(){this.$t=this.$t.bind(this),mo.library.add(vo)}},Io=Po,Oo=fr(Io,Yr,Jr,!1,null,null,null),Do=Oo.exports,No=function(){var e=this,t=e._self._c;return e.node.isType("processmaker-modeler-text-annotation")?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Association Flow"),id:"association-flow-button","aria-label":"Add association flow",role:"menuitem"},on:{click:e.addAssociation}},[t("img",{attrs:{src:e.connectIcon,"aria-hidden":"true"}})]):e._e()},Ro=[],Bo=f.p+"img/connect-artifacts.e3e5e73f.svg",Lo={components:{CrownButton:gr},props:["node","moddle","shape"],data:function(){return{connectIcon:Bo}},methods:{addAssociation:function(e,t,n,r){this.$emit("toggle-crown-state",!1);var o=this.moddle.create("bpmn:Association",{sourceRef:this.shape.component.node.definition,targetRef:{x:n,y:r},associationDirection:nr.none});this.$emit("add-node",new po("processmaker-modeler-association",o,this.moddle.create("bpmndi:BPMNEdge")))}}},jo=Lo,Fo=fr(jo,No,Ro,!1,null,null,null),zo=Fo.exports,Uo=function(){var e=this,t=e._self._c;return e.allowOutgoingDataAssociationFlow?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Data Association Flow"),id:"association-flow-button","aria-label":"Add association flow",role:"menuitem"},on:{click:e.addDataAssociation}},[t("img",{attrs:{src:e.connectIcon,"aria-hidden":"true"}})]):e._e()},qo=[];function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}function Ho(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vo(e,t)}f(12419),f(81299);function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Go(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function $o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xo(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $o(e)}function Yo(e){var t=Go();return function(){var n,r=Wo(e);if(t){var o=Wo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xo(this,n)}}var Jo="processmaker-modeler-pool",Zo=function(){function e(t,n,r){d(this,e),y(this,"nodeRegistry",void 0),y(this,"moddle",void 0),y(this,"paper",void 0),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){throw new Error("Best practice is to implement 'makeFlowDefinition' in each class")}}],[{key:"isValid",value:function(e,t,n){throw new Error("Best practice is to implement 'isValid' in each class")}},{key:"hasTargetType",value:function(e){return null!=$()(e,"component.node.type")}},{key:"targetIsValidStartEventType",value:function(e){return!e.isBpmnType("bpmn:StartEvent")||e.isType("processmaker-modeler-message-start-event")}},{key:"targetIsValidIntermediateEventType",value:function(e){return!e.isBpmnType("bpmn:IntermediateCatchEvent")||e.isType("processmaker-modeler-intermediate-message-catch-event")}},{key:"targetIsValidBoundaryEventType",value:function(e){return!e.isBpmnType("bpmn:BoundaryEvent")||e.isType("processmaker-modeler-boundary-message-event")}},{key:"targetIsNotContainingPool",value:function(e,t){return e!==t.pool}},{key:"targetIsInDifferentPool",value:function(t,n){var r=e.shapeIsPool(t)?t:t.component.node.pool,o=e.shapeIsPool(n)?n:n.component.node.pool;return null!=o&&o!==r}},{key:"targetIsNotSource",value:function(e,t){return e.id!==t.id}},{key:"allowOutgoingFlow",value:function(e,t){return!("allowOutgoingFlow"in e)||e.allowOutgoingFlow(t)}},{key:"shapeIsPool",value:function(e){var t=$()(e,"component.node.type");return t===Jo}}]),e}(),Ko=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,null,[{key:"isADataNode",value:function(e){return e.isBpmnType.apply(e,W(n.dataNodeTypes))}},{key:"isNodeDisallowedFromDataAssociation",value:function(e){return e.isBpmnType.apply(e,W(n.disallowedNodes))}}]),n}(Zo);y(Ko,"dataNodeTypes",["bpmn:DataStoreReference","bpmn:DataObjectReference"]),y(Ko,"disallowedNodes",["bpmn:EndEvent","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation","bpmn:Association"]);var Qo={components:{CrownButton:gr},props:["node","moddle","shape"],data:function(){return{connectIcon:Bo}},computed:{paper:function(){return Un.getters.paper},allowOutgoingDataAssociationFlow:function(){return Ko.isADataNode(this.node)}},methods:{addDataAssociation:function(n,r,o){this.$emit("toggle-crown-state",!1);var i=n.clientX,s=n.clientY,a=null;n&&(a=(0,F.V)(this.paper.viewport).toLocalPoint(i,s));var c=this.node.isBpmnType("bpmn:DataStoreReference","bpmn:DataObjectReference"),l=c?t:e,d=l.definition(this.moddle),u=new po(l.id,d,l.diagram(this.moddle));u.dataAssociationProps={sourceShape:this.shape,targetCoords:{x:r||a.x,y:o||a.y}},this.$emit("add-node",u)}}},ei=Qo,ti=fr(ei,Uo,qo,!1,null,null,null),ni=ti.exports,ri=function(){var e,t=this,n=t._self._c;return(e=t.node).isBpmnType.apply(e,W(t.validCopyElements))?n("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:t.$t("Copy Element"),"aria-label":"Copy Element","data-test":"copy-button",role:"menuitem"},on:{click:t.copyElement}},[n("i",{staticClass:"fas fa-clipboard"})]):t._e()},oi=[],ii=f.p+"img/clipboard.06edfa02.svg",si=["bpmn:StartEvent","bpmn:IntermediateEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:ExclusiveGateway","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:Gateway","bpmn:EventBasedGateway","bpmn:TextAnnotation"],ai=si,ci={components:{CrownButton:gr},props:["node"],data:function(){return{copyCount:0,copyIcon:ii,validCopyElements:ai}},methods:{copyElement:function(){this.$emit("copy-element")}}},li=ci,di=fr(li,ri,oi,!1,null,null,null),ui=di.exports,hi=function(){var e,t=this,n=t._self._c;return(e=t.node).isBpmnType.apply(e,W(t.validCopyElements))?n("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:t.$t("Clone Element"),"aria-label":"Clone Element","data-test":"clone-button"},on:{click:t.cloneElement}},[n("i",{staticClass:"fas fa-paste"})]):t._e()},pi=[],fi=f.p+"img/copy-regular.67a8edbd.svg",mi={components:{CrownButton:gr},props:["node"],data:function(){return{copyCount:0,cloneIcon:fi,validCopyElements:ai}},methods:{cloneElement:function(){this.$emit("clone-element",this.node,++this.copyCount)}}},gi=mi,vi=fr(gi,hi,pi,!1,null,null,null),bi=vi.exports,yi=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"dropdown"}},[t("crown-task-dropdown",e._g({attrs:{"dropdown-data":e.dropdownData,"dropdown-open":e.taskDropdownOpen,node:e.node},on:{"toggle-dropdown-state":e.taskDropdownToggle}},e.$listeners)),t("crown-boundary-event-dropdown",e._g({attrs:{"dropdown-data":e.boundaryEventDropdownData,"dropdown-open":e.boundaryEventDropdownOpen,nodeRegistry:e.nodeRegistry,moddle:e.moddle,node:e.node,shape:e.shape},on:{"toggle-dropdown-state":e.boundaryEventDropdownToggle}},e.$listeners)),t("crown-color-dropdown",e._g({attrs:{hide:e.hideColorDropdown,"dropdown-open":e.colorDropdownOpen,node:e.node,showCustomIconPicker:e.showCustomIconPicker,iconName:e.iconName},on:{"toggle-dropdown-state":e.colorDropdownToggle}},e.$listeners))],1)},wi=[],xi=function(){var e=this,t=e._self._c;return e.dropdownData.length>0?t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",e._g({attrs:{"data-test":"select-type-dropdown",id:"dropdown-button","aria-label":"Select a type"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},e.$listeners),[t("i",{staticClass:"fas fa-cog"})]),e.dropdownOpen?t("ul",{staticClass:"element-list",attrs:{role:"list"}},e._l(e.dropdownData,(function(n){var r=n.label,o=n.nodeType,i=n.dataTest,s=n.disabled;return t("li",{key:o,staticClass:"element-list--item",attrs:{role:"listitem",id:o}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:e.isDisabled(s,e.node,o)},on:{click:function(t){return e.replaceNode({node:e.node,typeToReplaceWith:o})}}},[e._v(e._s(e.$t(r))+" ")]),e.isDisabled(s,e.node,o)?t("b-tooltip",{attrs:{target:o,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.$t(e.tooltip(s,e.node,o)))+" ")]):e._e()],1)})),0):e._e()],1):e._e()},ki=[],Ci={name:"CrownTaskDropdown",components:{CrownButton:gr},props:{dropdownData:Array,node:Object,dropdownOpen:{type:Boolean,required:!0}},methods:{isDisabled:function(e,t,n){return e&&(e instanceof Function?e.apply(this,[t,n]):e)},tooltip:function(e,t,n){return this.isDisabled(e,t,n)||""},replaceNode:function(e){e.node.type!==e.typeToReplaceWith?this.$emit("replace-node-type",e):this.$emit("toggle-dropdown-state",!1)}}},Si=Ci,Ei=(f(5648),fr(Si,xi,ki,!1,null,"31668547",null)),Ai=Ei.exports,_i=function(){var e=this,t=e._self._c;return e.dropdownData.length>0?t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",e._g({directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{id:"dropdown-button","aria-label":"Select a boundary event","data-test":"boundary-event-dropdown",title:e.$t("Boundary Events"),role:"menuitem"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-boundary-event"]}})],1),e.dropdownOpen?t("ul",{staticClass:"element-list",attrs:{role:"list"}},e._l(e.dropdownData,(function(n){var r=n.label,o=n.nodeType,i=n.dataTest,s=n.disabledLabel;return t("li",{key:o,staticClass:"element-list--item",attrs:{role:"listitem",id:o}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:!e.canAddBoundaryEventToTarget(o,e.shape)},on:{click:function(t){return e.addBoundaryEvent(o)}}},[e._v(e._s(e.$t(r))+" ")]),e.canAddBoundaryEventToTarget(o,e.shape)?e._e():t("b-tooltip",{attrs:{target:o,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.getErrorTooltipText(s))+" ")])],1)})),0):e._e()],1):e._e()},Ti=[],Mi=f.p+"img/boundary-event.40a868e9.svg",Pi=["bpmn:Task","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:SendTask","bpmn:ReceiveTask","bpmn:UserTask","bpmn:GlobalTask","bpmn:ManualTask","bpmn:CallActivity"];function Ii(e){return e&&Pi.some((function(t){return e.node.isBpmnType(t)}))}function Oi(e,t){return!(!t||!Ii(t.component))&&Ni(t)}function Di(e){return e&&e.node.isBpmnType("bpmn:CallActivity")}function Ni(e){return 0!==Dt(e).length}var Ri={name:"CrownBoundaryEventDropdown",components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},props:{dropdownOpen:{type:Boolean,required:!0},dropdownData:Array,nodeRegistry:Object,moddle:Object,node:Object,shape:Object},data:function(){return{boundaryEventIcon:Mi}},methods:{getErrorTooltipText:function(e){return 0===this.getEmptyBoundaryEventPositionsForShape(this.shape).length?"No available space":e},canAddBoundaryEventToTarget:Oi,getEmptyBoundaryEventPositionsForShape:Dt,addBoundaryEvent:function(e){if(this.$emit("toggle-dropdown-state",!1),this.canAddBoundaryEventToTarget(e,this.shape)){var t=this.nodeRegistry[e].definition(this.moddle,this.$t),n=this.nodeRegistry[e].diagram(this.moddle),r=Dt(this.shape)[0];n.bounds.x=r.x-n.bounds.width/2,n.bounds.y=r.y-n.bounds.height/2;var o=new po(e,t,n);o.pool=this.node.pool,o.fromCrown=!0,Un.commit("highlightNode",o),this.$emit("add-node",o)}}},created:function(){this.$t=this.$t.bind(this),mo.library.add(go)}},Bi=Ri,Li=(f(56073),fr(Bi,_i,Ti,!1,null,null,null)),ji=Li.exports,Fi=function(){var e=this,t=e._self._c;return e.hide?e._e():t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Open Color Palette"),"aria-label":e.$t("Open Color Palette"),role:"menuitem","data-test":"picker-dropdown-button"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},[t("i",{staticClass:"fas fa-palette"})]),e.dropdownOpen?t("div",{staticClass:"element-list color-list"},[e._l(e.colors.slice(0,4),(function(n){return t("button",{key:n,staticClass:"color-button",style:{backgroundColor:n},attrs:{type:"button","data-test":n},on:{click:function(t){e.selectedColor=n}}})})),e.showCustomIconPicker?t("button",{staticClass:"color-button p-0 fa fa-drafting-compass",attrs:{type:"button","data-test":"set-custom-icon"},on:{click:e.openIconSelector}}):t("div"),e._l(e.colors.slice(4,8),(function(n){return t("button",{key:n,staticClass:"color-button",style:{backgroundColor:n},attrs:{type:"button","data-test":n},on:{click:function(t){e.selectedColor=n}}})})),t("button",{staticClass:"color-button toggle-picker",attrs:{type:"button"},on:{click:function(t){e.colorPickerOpen=!e.colorPickerOpen}}}),t("button",{staticClass:"color-button p-0 fa fa-undo-alt",attrs:{type:"button","data-test":"clear-color"},on:{click:e.resetNodeStyling}}),e.colorPickerOpen?t("sketch-picker",{staticClass:"color-picker",attrs:{value:e.selectedColor||"#fff",presetColors:null},on:{input:e.setColorFromPicker}}):e._e()],2):e._e(),t("b-modal",{ref:"icon-selector-modal",attrs:{title:"Select a custom icon","cancel-title":"Reset to Default"},on:{cancel:e.resetCustomIcon}},[t("div",[t("icon-selector",{attrs:{value:e.iconName,"allow-custom":!1},on:{input:e.setCustomIcon}})],1)])],1)},zi=[],Ui=(f(27479),f(87714),f(82801),f(1174),f(94023)),qi=function(){var e=this,t=e._self._c;return t("div",{staticClass:"multiselect-icons"},[t("b-input-group",[t("multiselect",{ref:"multiselect",attrs:{"track-by":"value",label:"label","show-labels":!1,placeholder:e.placeholder,options:e.list,multiple:!1,searchable:!0,"internal-search":!1,"allow-empty":!1},on:{"search-change":e.onSearch,open:e.onOpen,close:e.onClose},scopedSlots:e._u([{key:"singleLabel",fn:function(n){return[n.option?t("span",[t("i",{staticClass:"fas fa-fw",class:"fa-"+n.option.value}),e._v(" "+e._s(n.option.label)+" ")]):e._e()]}},{key:"option",fn:function(n){return[t("div",{staticClass:"icon-square",on:{mouseover:function(t){return e.onHover(n.option)}}},[t("i",{staticClass:"fas fa-fw",class:"fa-"+n.option.value})])]}}]),model:{value:e.icon,callback:function(t){e.icon=t},expression:"icon"}},[t("template",{slot:"noResult"},[e.allowCustom?t("div",{staticClass:"multiselect-no-result text-muted my-2 text-center w-100"},[t("strong",[e._v(e._s(e.$t("No icons found.")))]),t("br"),e._v(" "+e._s(e.$t("Try a different search or"))+" "),t("br"),t("a",{staticClass:"text-primary link-upload",on:{click:e.triggerUpload}},[e._v(e._s(e.$t("upload a custom icon")))]),e._v(". ")]):t("div",{staticClass:"multiselect-no-result text-muted my-2 text-center w-100"},[t("strong",[e._v(e._s(e.$t("No icons found.")))]),t("br"),e._v(" "+e._s(e.$t("Try a different search."))+" ")])]),t("template",{slot:"placeholder"},[this.file?t("span",[e._v(" "+e._s(e.$t("Custom Icon File"))+" "),this.fileName?t("span",{staticClass:"text-muted"},[e._v("("+e._s(this.fileName)+")")]):e._e()]):e._e()])],2),e.allowCustom?t("b-input-group-append",{staticClass:"multiselect-icons-upload"},[t("file-upload-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:{title:e.$t("Upload Custom Icon")},expression:"{ title: $t('Upload Custom Icon') }"}],ref:"fileUploadButton",attrs:{accept:"image/png, image/svg+xml, image/gif",variant:"secondary"},model:{value:e.uploadedFile,callback:function(t){e.uploadedFile=t},expression:"uploadedFile"}},[t("i",{staticClass:"fas fa-fw fa-upload"})])],1):e._e()],1)],1)},Vi=[],Hi=(f(64765),f(69600),f(42238)),Wi=f.n(Hi),Gi=["search","search-plus","search-dollar","check-square","list","id-badge","clipboard-list","clipboard-check","clipboard","fire","fire-alt","star","dollar-sign","users","user-circle","trophy"],$i=["align-center","align-justify","align-left","align-right","arrows-alt","arrows-alt-h","arrows-alt-v","bars","beer","bong","border-all","border-none","border-style","cannabis","circle-notch","cog","cogs","compress","compress-alt","compress-arrows-alt","custom","democrat","disease","download","ellipsis-h","ellipsis-v","expand","expand-alt","expand-arrows-alt","faucet","file-download","file-export","file-import","file-upload","flag-usa","font-awesome-logo-full","grip-horizontal","grip-lines","grip-lines-vertical","grip-vertical","hand-holding-water","hand-middle-finger","hospital-user","joint","lungs","republican","upload"],Xi=function(){function e(){d(this,e)}return g(e,null,[{key:"list",value:function(){var e=this,t=[];Gi.forEach((function(n){Wi()[n]&&t.push(e.parseIcon(n,Wi()[n]))}));for(var n=0,r=Object.entries(Wi());n<r.length;n++){var o=jt(r[n],2),i=o[0],s=o[1];this.shouldIncludeIcon(i,s)&&t.push(this.parseIcon(i,s))}return t}},{key:"grouped",value:function(){for(var e=[{group:"Common",icons:[]},{group:"All Icons",icons:[]}],t=0,n=Object.entries(Wi());t<n.length;t++){var r=jt(n[t],2),o=r[0],i=r[1];$i.includes(o)||(Gi.includes(o)&&e[0].icons.push(this.parseIcon(o,i)),this.shouldIncludeIcon(o,i)&&e[1].icons.push(this.parseIcon(o,i)))}return e}},{key:"shouldIncludeIcon",value:function(e,t){var n=!1,r=["-left","-right","-up","-down"];return $i.includes(e)||Gi.includes(e)||t.styles.includes("solid")&&!t.changes.includes("5.13.0")&&(n=!0),r.forEach((function(t){e.includes(t)&&(n=!1)})),n}},{key:"parseIcon",value:function(e,t){var n={value:e,label:t.label,search:t.search.terms.join()+","+e+","+t.label.toLowerCase()};return n.label.startsLowerCase()&&(n.label=n.label.unSlug().titleCase()),n}}]),e}();String.prototype.startsLowerCase=function(){var e=this.substring(0,1);return e==e.toLowerCase()},String.prototype.unSlug=function(){return this.split("-").join(" ")},String.prototype.titleCase=function(){var e=this.split(" ");return e=e.map((function(e){return e.substring(0,1).toUpperCase()+e.substring(1)})),e.join(" ")};var Yi=function(){var e=this,t=e._self._c;return t("b-button",{staticClass:"file-upload-button",attrs:{block:e.block,disabled:e.disabled,size:e.size,variant:e.variant,type:e.type,tag:e.tag,pill:e.pill,squared:e.squared,pressed:e.pressed},on:{click:e.onClick}},[t("b-form-file",e._b({ref:"fileUpload",staticClass:"file-upload-control",attrs:{plain:"",accept:e.accept,capture:e.capture,multiple:e.multiple,directory:e.directory,"no-traverse":e.noTraverse,"no-drop":e.noDrop,"file-name-formatter":e.fileNameFormatter},on:{change:e.onChange,input:e.onInput},model:{value:e.file,callback:function(t){e.file=t},expression:"file"}},"b-form-file",e.$attrs,!1)),e._t("default")],2)},Ji=[],Zi={inheritAttrs:!1,props:{value:{default:null},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},variant:{type:String,default:"secondary"},type:{type:String,default:"button"},tag:{type:String,default:"button"},pill:{type:Boolean,default:!1},squared:{type:Boolean,default:!1},pressed:{type:Boolean,default:null},accept:{type:String,default:""},capture:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},noTraverse:{type:Boolean,default:!1},noDrop:{type:Boolean,default:!1},fileNameFormatter:{type:Function,default:null}},data:function(){return{file:null}},watch:{file:{handler:function(e){this.$emit("input",e)}},value:{handler:function(e){this.file=e},deep:!0}},methods:{onClick:function(){this.$refs.fileUpload.$el.click()},onChange:function(e){this.$emit("change",e)},onInput:function(e){this.$emit("input",e)},reset:function(){this.$refs.fileUpload.reset()},trigger:function(){this.$refs.fileUpload.$el.click()}}},Ki=Zi,Qi=(f(94960),fr(Ki,Yi,Ji,!1,null,null,null)),es=Qi.exports,ts={components:{FileUploadButton:es},props:{value:{required:!1},allowCustom:{type:Boolean,default:!0},default:{type:String,default:"search"}},data:function(){return{all:Xi.list(),file:null,fileName:null,icon:null,list:{},loading:!0,placeholder:this.$t("Icon"),query:"",uploadedFile:null}},computed:{isOpen:function(){return this.$refs.multiselect.isOpen},iconAndFile:function(){return this.allowCustom?{icon:this.icon?this.icon.value:null,file:this.file}:this.icon?this.icon.value:null}},watch:{value:function(){this.allowCustom?(this.icon=this.find(this.value.icon),this.file=this.value.file):this.icon=this.find(this.value)},icon:function(e){e&&(this.file=null,this.fileName=null,this.allowCustom&&this.$refs.fileUploadButton.reset(),this.$emit("input",this.iconAndFile))},file:function(e){e&&(this.icon=null,this.$refs.multiselect.deactivate(),this.$emit("input",this.iconAndFile))},uploadedFile:function(e){var t=this;if(e)if(e.size>2e3)this.$emit("error",this.$t("The custom icon file is too large. File size must be less than 2KB."));else{this.file=e,this.fileName=e.name,this.uploadedFile=null;var n=new FileReader;n.readAsDataURL(this.file),n.onload=function(){t.file=n.result}}}},beforeMount:function(){this.list=this.all},mounted:function(){this.allowCustom?(this.icon=this.find(this.value.icon),this.file=this.value.file):this.value?this.icon=this.find(this.value):this.icon=this.find(this.default)},methods:{onSearch:function(e){var t=this;e.length?this.query=e.toLowerCase():this.isOpen&&(this.query=""),this.query.length?this.list=this.all.filter((function(e){return e.search.includes(t.query)})):this.list=this.all},onOpen:function(){this.$refs.multiselect.search=this.query},onClose:function(){this.placeholder=this.$t("Icon")},find:function(e){return this.all.find((function(t){return t.value==e}))},onHover:function(e){this.placeholder=e.label},triggerUpload:function(){this.$refs.fileUploadButton.trigger()}}},ns=ts,rs=(f(18785),fr(ns,qi,Vi,!1,null,null,null)),os=rs.exports,is=f(9943),ss={props:{dropdownOpen:{type:Boolean,required:!0},node:Object,showCustomIconPicker:{type:Boolean,default:!1},iconName:{type:String,default:""},hide:{type:Boolean,default:!1}},components:{CrownButton:gr,"sketch-picker":Ui.Sketch,IconSelector:os},data:function(){return{colors:je,selectedColor:this.node.definition.get("color"),colorPickerOpen:!1}},watch:{selectedColor:function(e){e?this.setNodeColor(e):this.resetNodeColor()}},methods:{setColorFromPicker:function(e){var t=e.hex8;this.selectedColor=t},resetNodeStyling:function(){this.resetNodeColor(),this.resetCustomIcon()},setNodeColor:function(e){var t;Un.commit("updateNodeProp",{node:this.node,key:"color",value:e}),zt().set(this.node.definition,"color",e),this.$emit("save-state");var n={id:this.node.definition.id,properties:{color:this.node.definition.color,x:this.node.diagram.bounds.x,y:this.node.diagram.bounds.y,height:this.node.diagram.bounds.height,width:this.node.diagram.bounds.width,type:this.node.type,id:this.node.definition.id,attachedToRefId:null===(t=this.node.definition.get("attachedToRef"))||void 0===t?void 0:t.id}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[n])},resetNodeColor:function(){Un.commit("updateNodeProp",{node:this.node,key:"color",value:void 0}),zt().set(this.node.definition,"color",void 0),this.$emit("save-state")},setCustomIcon:function(e){if(e){var t=(0,mo.icon)({prefix:"fas",iconName:e}),n=t.html,r=btoa(n);Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:r}),zt().set(this.node.definition,"customIcon",r),this.$emit("set-custom-icon-name",e),this.$emit("save-state")}},resetCustomIcon:function(){Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:void 0}),zt().set(this.node.definition,"customIcon",void 0),this.$emit("reset-custom-icon-name"),this.$emit("save-state")},openIconSelector:function(){this.$refs["icon-selector-modal"].show()}},created:function(){this.$t=this.$t.bind(this),mo.library.add(is.fas)}},as=ss,cs=(f(39302),fr(as,Fi,zi,!1,null,"76b859ea",null)),ls=cs.exports,ds={name:"CrownDropdowns",components:{CrownTaskDropdown:Ai,CrownBoundaryEventDropdown:ji,CrownColorDropdown:ls},props:{dropdownData:Array,boundaryEventDropdownData:Array,node:Object,nodeRegistry:Object,moddle:Object,shape:Object,taskDropdownInitiallyOpen:{type:Boolean,required:!0},hideColorDropdown:{type:Boolean,default:!1},showCustomIconPicker:Boolean,iconName:{type:String,default:""}},data:function(){return{taskDropdownOpen:this.taskDropdownInitiallyOpen,boundaryEventDropdownOpen:!1,colorDropdownOpen:!1}},methods:{taskDropdownToggle:function(e){this.taskDropdownOpen=e,this.boundaryEventDropdownOpen=!1,this.colorDropdownOpen=!1},boundaryEventDropdownToggle:function(e){this.taskDropdownOpen=!1,this.boundaryEventDropdownOpen=e,this.colorDropdownOpen=!1},colorDropdownToggle:function(e){this.taskDropdownOpen=!1,this.boundaryEventDropdownOpen=!1,this.colorDropdownOpen=e}}},us=ds,hs=(f(79803),fr(us,yi,wi,!1,null,"3b3ce003",null)),ps=hs.exports,fs=function(){var e=this,t=e._self._c;return e.node.canBeDefaultFlow()?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Set as Default Flow"),"aria-label":"Default Flow","data-test":"default-flow",role:"menuitem"},on:{click:e.click}},[t("img",{attrs:{src:e.icon,"aria-hidden":"true"}})]):e._e()},ms=[],gs=f.p+"img/default-flow.3f3d5309.svg",vs={components:{CrownButton:gr},props:["node"],data:function(){return{icon:gs}},methods:{click:function(){this.$emit("default-flow",this.node)}}},bs=vs,ys=fr(bs,fs,ms,!1,null,null,null),ws=ys.exports,xs={computed:{isLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{configurePoolLane:function(){var e=this;if(!["processmaker-modeler-pool","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-message-flow"].includes(this.node.type)){if(this.node.pool)return this.graph.getCell(this.node.pool)||(this.node.pool=this.graph.getElements().find((function(t){return t.component&&t.component.node===e.node.pool.component.node}))),this.node.pool.component.addToPool(this.shape),void(this.isLane&&this.configureLaneInParentPool());var t=this.graph.findModelsInArea(this.shape.getBBox()).filter((function(e){return e.component&&"processmaker-modeler-pool"===e.component.node.type}))[0];t&&(this.node.pool=t,this.node.pool.component.addToPool(this.shape),this.isLane&&this.configureLaneInParentPool())}},configureLaneInParentPool:function(){var e=this.node.pool.component;e.laneSet||e.createLaneSet();var t=e.laneSet.get("lanes");t.includes(this.node.definition)||t.push(this.node.definition)}},mounted:function(){var e=this;this.$nextTick((function(){e.configurePoolLane()}))}},ks=f(97019),Cs=f.n(ks);function Ss(){return!!window.Cypress}var Es={components:{CrownDropdowns:ps,PreviewButton:kr,DeleteButton:Xr,GenericFlowButton:Do,AssociationFlowButton:zo,CopyButton:ui,CloneButton:bi,DefaultFlow:ws,DataAssociationFlowButton:ni},props:{highlighted:Boolean,paper:Object,graph:Object,shape:Object,node:Object,nodeRegistry:Object,moddle:Object,planeElements:Array,processNode:Object,collaboration:Object,isRendering:Boolean,dropdownData:{type:Array,default:function(){return[]}},boundaryEventDropdownData:{type:Array,default:function(){return[]}},showCustomIconPicker:{type:Boolean,default:!1},hideColorDropdown:{type:Boolean,default:!1},iconName:{type:String,default:""}},mixins:[xs],watch:{"node.definition.color":{handler:function(){this.setNodeColor()}},highlightedShapes:function(e,t){Et()(e,t)||(this.showCrown=this.highlightedShapes[0]===this.shape)},highlighted:function(e){e||(this.taskDropdownInitiallyOpen=!1)},shape:function(){this.highlighted&&(this.showCrown=!0)}},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null}},created:function(){this.$t=this.$t.bind(this)},computed:{showCrownConfig:function(){return this.showCrown&&!this.isMultiselect&&!1===Un.getters.isReadOnly},isMultiselect:function(){var e=Un.getters.highlightedShapes.length;return e>1},isFlow:function(){return["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow"].includes(this.node.type)},isTextAnnotation:function(){return"processmaker-modeler-text-annotation"===this.node.type},process:function(){return this.node.pool?this.node.pool.component.containingProcess:this.processNode.definition},highlightedShapes:function(){return Un.getters.highlightedShapes}},methods:{setNodeColor:function(){var e=this.node.definition.get("color"),t=Je(this.node,e),n=t.fill,r=t.stroke;Ze(this.shape,n,r)},paperNotRendered:function(){return!this.isRendering},replaceNodeTypePrompt:function(e){this.taskDropdownInitiallyOpen?this.$emit("replace-node",e):(this.showReplaceModal=!0,this.nodeToReplace=e)},confirmedReplaceNodeType:function(){this.$emit("replace-node",this.nodeToReplace)},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition},repositionCrown:function(){var e=this.shape.findView(this.paper);if(e){var t=e.getBBox({useModelGeometry:!this.isTextAnnotation&&!this.isFlow}),n=t.x,r=t.y,o=t.width;this.style={top:"".concat(r-52,"px"),left:"".concat(n+o-20,"px"),cursor:"pointer"}}},paperDoneRendering:function(){var e=this;this.isRendering&&new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown),this.shape.on("change:position change:size change:attrs",this.repositionCrown),this.planeElements.includes(this.node.diagram)||this.planeElements.push(this.node.diagram);var e=Object.keys(this.node.definition.$descriptor.allTypesByName);e.includes("bpmn:FlowElement")&&!this.process.get("flowElements").includes(this.node.definition)&&this.process.get("flowElements").push(this.node.definition),e.includes("bpmn:Artifact")&&!this.process.get("artifacts").includes(this.node.definition)&&this.process.get("artifacts").push(this.node.definition),this.collaboration&&e.includes("bpmn:MessageFlow")&&!this.collaboration.get("messageFlows").includes(this.node.definition)&&this.collaboration.get("messageFlows").push(this.node.definition)},setUpPositionHandling:function(){var e=this;this.shape.on("change:position",(function(t,n){e.node.diagram.bounds.x=n.x,e.node.diagram.bounds.y=n.y,e.savePositionOnPointerupEventSet||(e.shape.listenToOnce(e.paper,"element:pointerup",e.setNodePosition),e.savePositionOnPointerupEventSet=!0)}))}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig(),e.setUpPositionHandling(),e.setNodeColor();case 7:case"end":return t.stop()}}),t)})))()},destroyed:function(){this.shape.stopListening(),this.shape.remove(),Cs()(this.process.get("flowElements"),this.node.definition),Cs()(this.planeElements,this.node.diagram),Cs()(this.process.get("artifacts"),this.node.definition),this.collaboration&&Cs()(this.collaboration.get("messageFlows"),this.node.definition)}},As=Es,_s=(f(78135),fr(As,ir,sr,!1,null,null,null)),Ts=_s.exports,Ms={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialAssociationDirection:this.node.definition.associationDirection,associationDirection:nr}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.type");if(!e)return!1;var t=this.target.component.node.pool,n=this.sourceShape.component.node.pool;if(n&&n!==t)return!1;var r=this.targetConfig.validateAssociationIncoming&&!this.targetConfig.validateAssociationIncoming(this.sourceNode),o=this.sourceConfig.validateAssociationOutgoing&&!this.sourceConfig.validateAssociationOutgoing(this.targetNode);return!r&&!o}},watch:{"node.definition.associationDirection":function(e){this.updateAssociationMarker(e)}},methods:{updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition},updateAssociationMarker:function(e){e===this.associationDirection.none&&(this.shape.attr("line/targetMarker/display","none"),this.shape.attr("line/sourceMarker/display","none")),e===this.associationDirection.one&&(this.shape.attr("line/targetMarker/display","block"),this.shape.attr("line/sourceMarker/display","none")),e===this.associationDirection.both&&(this.shape.attr("line/targetMarker/display","block"),this.shape.attr("line/sourceMarker/display","block"))}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10},sourceMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this,this.updateAssociationMarker(this.initialAssociationDirection)}},Ps=Ms,Is=fr(Ps,L,j,!1,null,null,null),Os=Is.exports,Ds={label:"Node Identifier",helper:"Enter the id that is unique from all other elements in the diagram",name:"id",validation:"required|regex:/^[_A-Za-z][-._A-Za-z0-9]*$/"},Ns=Ds,Rs=function(){function e(t,n,r){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=or(this.moddle),i=rr(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var s=new po(er,i,o);return s}}]),e}(),Bs={id:er,component:Os,bpmnType:tr,control:!1,definition:rr,diagram:or,inspectorConfig:[{name:"Data Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-association"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select Direction",name:"associationDirection",options:[{value:"".concat(nr.none),content:"None"},{value:"".concat(nr.one),content:"One"},{value:"".concat(nr.both),content:"Both"}]}}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new Rs(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},Ls=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},js=[],Fs={props:{isActive:Boolean},methods:{hideLabel:function(e,t,n){this.isActive&&!n.movedWithArrowKeys&&(this.shape.attr("label/display","none"),this.shape.getEmbeddedCells().filter((function(e){return e.attr("label/text")})).forEach((function(e){e.attr("label/display","none")})))},showLabel:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.shape.attr("label/display","initial"),t.next=3,e.$nextTick();case 3:e.shape.once("change:position",e.hideLabel);case 4:case"end":return t.stop()}}),t)})))()}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:e.$once("click",(function(){e.shape.once("change:position",e.hideLabel)})),e.shape.listenTo(e.paper,"cell:pointerup blank:pointerup",e.showLabel),e.shape.once("change:parent",e.showLabel);case 5:case"end":return t.stop()}}),t)})))()}},zs=3,Us=16,qs=4;function Vs(e,t){var n=t.size(),r=n.width,o=n.height;for(var i in e)Ws(t,i,r),Gs(t,i,o),$s(t,i,e,r)}function Hs(e,t){var n=e.attr(t);return void 0===n?qs:n}function Ws(e,t,n){var r=Hs(e,t+"/ref-padding-x");-1!==t.indexOf("Right")?e.attr(t+"/ref-x",n-Us-r):-1!==t.indexOf("Left")&&e.attr(t+"/ref-x",r+(Ys(e)?16:0))}function Gs(e,t,n){var r=Hs(e,t+"/ref-padding-y");-1!==t.indexOf("bottom")&&e.attr(t+"/ref-y",n-Us-r)}function $s(e,t,n,r){for(var o=0,i=0;i<zs;i++)e.attr(t+"."+i+"/xlink:href",null);var s=Xs(n,t);for(var a in s)if(e.attr(t+"."+o+"/xlink:href",n[t][a]),o++,o>=zs)break;e.attr(t+"/ref-width",Us*o),-1!==t.indexOf("Center")&&e.attr(t+"/ref-x",(r-o*Us)/2)}function Xs(e,t){if("bottomCenter"===t){var n={};return Object.keys(e[t]).sort().forEach((function(r){n[r]=e[t][r]})),n}return e[t]}function Ys(e){return!!e.attr("image/xlink:href")}var Js=3,Zs=16;function Ks(e){for(var t=[],n=0;n<Js;n++)t.push({tagName:"image",selector:e+"."+n});return{tagName:"g",selector:e,children:t}}function Qs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r={};r[e]=t;for(var o=0;o<Js;o++)r[e+"."+o]={"ref-x":o*Zs*n,"ref-y":0,width:Zs,height:Zs};return r}var ea,ta,na,ra,oa,ia,sa,aa,ca,la,da,ua,ha,pa,fa={data:function(){return{markers:{topLeft:{},topCenter:{},topRight:{},bottomLeft:{},bottomCenter:{},bottomRight:{}}}},watch:{markers:{deep:!0,handler:function(){this.recalcMarkersAlignment()}}},methods:{recalcMarkersAlignment:function(){Vs(this.markers,this.shape)}}},ma=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({size:{width:36,height:36},attrs:Qr(Qr(Qr(Qr(Qr(Qr({image:{"ref-x":5,"ref-y":5,ref:"circle",width:26,height:26}},Qs("topLeft",{ref:"circle","ref-y":-20,"ref-padding-x":0})),Qs("topCenter",{ref:"circle","ref-y":-20})),Qs("topRight",{ref:"circle","ref-x":26,"ref-y":-20,"ref-padding-x":0},-1)),Qs("bottomLeft",{ref:"circle","ref-padding-x":0,"ref-padding-y":-40})),Qs("bottomCenter",{ref:"circle","ref-padding-y":-40})),Qs("bottomRight",{ref:"circle","ref-x":26,"ref-padding-x":0,"ref-padding-y":-40},-1))},F.shapes.standard.Circle.prototype.defaults)}),ga={highlighter:{name:"stroke",options:{padding:10,attrs:{stroke:Vn,"stroke-width":10,opacity:.3}}}},va={highlighter:{name:"stroke",options:{attrs:{stroke:qn,"stroke-width":3,"data-cy":"selected"}}}},ba={highlighter:{name:"stroke",options:{attrs:{stroke:Xn,"stroke-width":5}}}},ya={highlighter:{name:"stroke",options:{attrs:{stroke:Hn,"stroke-width":5}}}},wa={highlighter:{name:"stroke",options:{attrs:{stroke:Gn,"stroke-width":5}}}},xa={props:["highlighted","paperManager","hasError","autoValidate","borderOutline","isCompleted","isInProgress","isIdle"],data:function(){return{shape:null,currentBorderOutline:null}},watch:{highlighted:function(){this.setShapeHighlight()},hasError:function(){this.paperManager.awaitScheduledUpdates().then(this.setShapeHighlight)},autoValidate:function(){this.setShapeHighlight()},borderOutline:{deep:!0,handler:function(e){this.setBorderOutline(e)}}},computed:{shapeView:function(){return this.shape.findView(this.paperManager.paper)},shapeBody:function(){return this.shapeView.$el.find("[joint-selector=body]")||this.shapeView.$el}},methods:{setShapeHighlight:function(){if(Un.getters.isReadOnly)return this.shapeView.unhighlight(this.shapeBody,ba),this.isCompleted&&(this.shape.attr("body/fill",Yn),this.shapeView.highlight(this.shapeBody,ba)),this.shapeView.unhighlight(this.shapeBody,ya),this.isInProgress&&(this.shape.attr("body/fill",Wn),this.shapeView.highlight(this.shapeBody,ya)),void(this.isIdle&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa)));this.shapeView&&(this.shapeView.unhighlight(this.shapeBody,ga),this.hasError&&this.autoValidate&&this.shapeView.highlight(this.shapeBody,ga),this.shapeView.unhighlight(this.shapeBody,va),this.highlighted&&this.shapeView.highlight(this.shapeBody,va))},setBorderOutline:function(e){this.currentBorderOutline&&this.shapeView.unhighlight(this.shapeBody,this.currentBorderOutline),this.currentBorderOutline=e?ho()(e):null,this.currentBorderOutline&&this.shapeView.highlight(this.shapeBody,this.currentBorderOutline)}},mounted:function(){var e=this;this.$nextTick((function(){e.paperManager.awaitScheduledUpdates().then((function(){e.setShapeHighlight(),e.shape.on("change:size",(function(){e.paperManager.awaitScheduledUpdates().then(e.setShapeHighlight),e.$emit("shape-resize",e.shape)}))}))}))}},ka={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,Fs],data:function(){return{shape:null,definition:null,dropdownData:[{label:ro["processmaker-modeler-end-event"],nodeType:"processmaker-modeler-end-event"},{label:ro["processmaker-modeler-message-end-event"],nodeType:"processmaker-modeler-message-end-event",dataTest:"switch-to-message-end-event"},{label:ro["processmaker-modeler-error-end-event"],nodeType:"processmaker-modeler-error-end-event",dataTest:"switch-to-error-end-event"},{label:ro["processmaker-modeler-signal-end-event"],nodeType:"processmaker-modeler-signal-end-event",dataTest:"switch-to-signal-end-event"},{label:ro["processmaker-modeler-terminate-end-event"],nodeType:"processmaker-modeler-terminate-end-event",dataTest:"switch-to-terminate-end-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new ma,this.shape.set("type","processmaker.components.nodes.endEvent.Shape");var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({body:{fill:$e,stroke:Xe},label:{text:this.node.definition.get("name"),refY:"130%"}}),this.shape.addTo(this.graph),this.shape.component=this}},Ca=ka,Sa=fr(Ca,Ls,js,!1,null,null,null),Ea=Sa.exports,Aa={label:"Name",name:"name",helper:"Enter the name of this element",validation:"required"},_a=Aa,Ta=function(){var e=this,t=e._self._c;return t("div",[t("FormInput",{attrs:{name:"id",label:e.label,helper:e.helper,error:e.error,validation:e.validation},on:{input:e.onInput},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)},Ma=[],Pa={props:{label:{type:String},helper:{type:String},value:{default:null},validation:{type:String}},data:function(){return{localValue:this.value,error:""}},methods:{onInput:function(e){this.value!==e&&(this.isUnique(e)?(this.error="",this.$emit("input",e)):this.error=this.$t("Must be unique"))},isUnique:function(e){return!!Un.state.nodes.every((function(t){return t.definition.id!==e}))}}},Ia=Pa,Oa=fr(Ia,Ta,Ma,!1,null,null,null),Da=Oa.exports,Na={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Da,config:Ns}]},Ra=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"d-flex justify-content-between align-items-end mb-2"},[t("label",{staticClass:"m-0"},[e._v(e._s(e.$t(e.label)))]),t("button",{directives:[{name:"b-modal",rawName:"v-b-modal.documentation-modal",modifiers:{"documentation-modal":!0}}],staticClass:"btn-sm float-right",attrs:{type:"button","aria-label":e.$t("Expand"),"data-test":"documentation-modal-button"}},[t("i",{staticClass:"fas fa-expand"})])]),t("form-text-area",{staticClass:"documentation-input d-flex",attrs:{value:e.textValue,richtext:!0,"data-test":"documentation-text-area",id:"documentation-editor"},on:{input:function(t){return e.$emit("input",t)},blur:e.onBlur}}),t("b-modal",{attrs:{id:"documentation-modal",size:"lg",centered:"",title:e.$t("Description"),"header-close-content":"&times;","ok-only":"","ok-variant":"secondary","ok-title":"Close","no-enforce-focus":""}},[t("form-text-area",{staticClass:"documentation-input",attrs:{rows:"5",value:e.textValue,richtext:!0,"data-test":"documentation-modal-text-area",id:"documentation-editor-modal"},on:{input:function(t){return e.$emit("input",t)},blur:e.onBlur}})],1)],1)},Ba=[],La=f(47037),ja=f.n(La),Fa={props:{value:{type:[String,Array],default:""},label:{type:String,default:"Description"}},inheritAttrs:!1,computed:{textValue:function(){return ja()(this.value)?this.value:$()(this.value[0],"text","")}},methods:{onBlur:function(){var e=this.$root.$children.find((function(e){return e.$refs.modeler}));e.$refs.modeler.pushToUndoStack()}}},za=Fa,Ua=(f(14855),fr(za,Ra,Ba,!1,null,null,null)),qa=Ua.exports,Va={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Documentation",icon:"book",name:"documentation-accordion"},items:[{component:qa,config:{label:"Description",name:"documentation",helper:""}}]},Ha="processmaker-modeler-end-event",Wa={id:Ha,component:Ea,bpmnType:"bpmn:EndEvent",control:!0,category:"BPMN",icon:f(48807),label:ro[Ha],rank:30,items:[{icon:f(48807),label:ro[Ha],control:!0,rank:31,id:"processmaker-modeler-end-event"},{icon:f(52080),label:ro["processmaker-modeler-message-end-event"],control:!0,rank:32,id:"processmaker-modeler-message-end-event"},{icon:f(95093),label:ro["processmaker-modeler-error-end-event"],control:!0,rank:33,id:"processmaker-modeler-error-end-event"},{icon:f(96425),label:ro["processmaker-modeler-signal-end-event"],control:!0,rank:34,id:"processmaker-modeler-signal-end-event"},{icon:f(47616),label:ro["processmaker-modeler-terminate-end-event"],control:!0,rank:35,id:"processmaker-modeler-terminate-end-event"}],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[Ha])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:ro[Ha],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-end-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Ga=f(84384),$a=f.n(Ga),Xa=(f(75505),f(23157),f(91910)),Ya=function(e){var t=btoa(e);return"data:image/svg+xml;base64,".concat(t)},Ja=function(e){return e.definition.get("color")||Ke(e)},Za=function(e,t){var n=(new DOMParser).parseFromString(e,"text/xml"),r=n.querySelectorAll('*[fill]:not([fill="none"])'),o=n.querySelectorAll('*[stroke]:not([stroke="none"])');return r.forEach((function(e){e.setAttribute("fill",t)})),o.forEach((function(e){e.setAttribute("stroke",t)})),n.documentElement.outerHTML},Ka=function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/,r=/<svg[^>]*>/,o=e.startsWith("<xml")&&/<svg[^>]*>/.test(e);return"string"===typeof e&&(t.test(e)||n.test(e)||r.test(e)||o)},Qa=function(e,t){if(!Ka(e)){mo.library.add(is.fas,Xa.fab);var n=e.split(" "),r=jt(n,1),o=r[0],i=e.split("-"),s=jt(i,2),a=s[1],c=(0,mo.findIconDefinition)({prefix:o,iconName:a}),l=(0,mo.icon)(c).html;e=l[0]}var d=Ja(t),u=Za(e,d);return Ya(u)},ec=Qa,tc={data:function(){return{nodeIcon:null}},computed:{icon:function(){return this.node.definition.customIcon?atob(this.node.definition.customIcon):this.nodeIcon}},watch:{"node.definition.color":{handler:function(){this.updateIconColor()}},"node.definition.customIcon":{handler:function(){this.updateIconColor()}}},methods:{updateIconColor:function(){this.nodeIcon&&!this.node.isBpmnType("bpmn:ServiceTask")&&this.shape&&this.shape.attr("image/xlink:href",ec(this.icon,this.node))}},mounted:function(){this.updateIconColor()}},nc={extends:Ea,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{error:this.moddle.create("bpmn:Error",{id:"".concat(this.id,"_error"),name:"".concat(this.id,"_error")}),nodeIcon:$a()}},methods:{addErrorRef:function(){this.node.definition.get("eventDefinitions")[0].errorRef?this.error=this.node.definition.get("eventDefinitions")[0].errorRef:(this.error=this.moddle.create("bpmn:Error",{id:"".concat(this.id,"_error"),name:"".concat(this.id,"_error")}),this.rootElements.push(this.error),this.node.definition.get("eventDefinitions")[0].errorRef=this.error)}},mounted:function(){this.addErrorRef()},destroyed:function(){Cs()(this.rootElements,this.error)}},rc=nc,oc=fr(rc,ea,ta,!1,null,null,null),ic=oc.exports,sc=f(82492),ac=f.n(sc),cc=f(57557),lc=f.n(cc),dc="processmaker-modeler-error-end-event",uc=ac()(ho()(Wa),{id:dc,component:ic,control:!1,label:ro[dc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[dc]),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return"eventDefinitions"===r?e.errorName=o[0].get("errorRef").name:e[r]=o,e}),{})},inspectorHandler:function(e,t,n){for(var r in lc()(e,["$type","eventDefinitions","errorName"]))t.definition[r]!==e[r]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]}),n(t,r,e[r]));var o=t.definition.get("eventDefinitions")[0].errorRef;o.name!==e.errorName&&(o.name=e.errorName,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:t.definition.get("eventDefinitions")}))},multiplayerInspectorHandler:function(e,t,n){var r=Object.keys(t).filter((function(e){return"id"!==e}));if("eventDefinitions"!==r[0])n(e,r[0],t[r[0]]);else{var o=t[r[0]][0].errorRef,i=e.definition.get("eventDefinitions")[0].errorRef;o&&i&&o.name!==i.name&&(i.name=o.name)}},inspectorConfig:[{items:[{items:[{},{component:"FormInput",config:{label:"Error Name",name:"errorName",helper:"Enter the error name that is unique from all other elements in the diagram"}}]}]}]}),hc=f(43258),pc=f.n(hc),fc={extends:Ea,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{nodeIcon:pc()}}},mc=fc,gc=fr(mc,na,ra,!1,null,null,null),vc=gc.exports,bc="processmaker-modeler-terminate-end-event",yc=ac()(ho()(Wa),{id:bc,component:vc,control:!1,label:ro[bc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[bc]),eventDefinitions:[e.create("bpmn:TerminateEventDefinition")]})}}),wc=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},xc=[],kc=18,Cc=F.dia.Element.define("processmaker.components.nodes.gateway.Shape",{markup:[].concat(W(F.shapes.standard.Polygon.prototype.markup),[{tagName:"image",selector:"image"}]),attrs:{body:{strokeWidth:2,stroke:"#000000",refPointsKeepOffset:"40,0, 80,40, 40,80, 0,40",fill:"#FFFFFF"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"50",fontSize:14,fill:"#333333"},image:{width:kc,height:kc,fill:"transparent",xlinkHref:"",refX:"50%",refX2:-kc/2,refY:"50%",refY2:-kc/2}}}),Sc=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"],Ec={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,Fs],created:function(){var e=this.node.definition.default||null;delete this.node.definition.default,Sc.indexOf(this.node.definition.$type)>-1&&this.$set(this.node.definition,"default",e)},data:function(){return{shape:null,definition:null,labelWidth:175,dropdownData:[{label:ao["processmaker-modeler-exclusive-gateway"],nodeType:"processmaker-modeler-exclusive-gateway"},{label:ao["processmaker-modeler-inclusive-gateway"],nodeType:"processmaker-modeler-inclusive-gateway",dataTest:"switch-to-inclusive-gateway"},{label:ao["processmaker-modeler-parallel-gateway"],nodeType:"processmaker-modeler-parallel-gateway",dataTest:"switch-to-parallel-gateway"},{label:ao["processmaker-modeler-event-based-gateway"],nodeType:"processmaker-modeler-event-based-gateway",dataTest:"switch-to-event-based-gateway",disabled:function(e){if(e&&e.definition&&e.definition.outgoing){var t=["bpmn:IntermediateCatchEvent"],n=e.definition.outgoing.find((function(e){return!t.includes(e.targetRef.$type)}));return!!n&&"It must be connected only to catch events"}return!1}}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Cc;var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.attr({label:{text:this.node.definition.get("name"),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this}},Ac=Ec,_c=fr(Ac,wc,xc,!1,null,null,null),Tc=_c.exports,Mc=f(4074),Pc=f.n(Mc),Ic={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:Pc()}}},Oc=Ic,Dc=fr(Oc,oa,ia,!1,null,null,null),Nc=Dc.exports,Rc="processmaker-modeler-exclusive-gateway",Bc={id:Rc,component:Nc,bpmnType:"bpmn:ExclusiveGateway",control:!0,category:"BPMN",icon:f(21678),label:"Gateway",rank:50,items:[{icon:f(52794),label:"Exclusive Gateway",control:!0,rank:51,id:"processmaker-modeler-exclusive-gateway"},{icon:f(59749),label:"Inclusive Gateway",control:!0,rank:52,id:"processmaker-modeler-inclusive-gateway"},{icon:f(23726),label:"Parallel Gateway",control:!0,rank:53,id:"processmaker-modeler-parallel-gateway"},{icon:f(93763),label:"Event Based Gateway",control:!0,rank:54,id:"processmaker-modeler-event-based-gateway"}],definition:function(e,t){return e.create("bpmn:ExclusiveGateway",{name:t(ao[Rc])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[Rc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-exlcusive-gateway"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Lc=f(62635),jc=f.n(Lc),Fc={diverging:"Diverging",converging:"Converging"},zc={extends:Tc,mixins:[tc],data:function(){return{incoming:this.node.definition.get("incoming"),nodeIcon:jc()}},watch:{incoming:function(e){var t=e.length<=1?Fc.diverging:Fc.converging;this.node.definition.set("gatewayDirection",t)}}},Uc=zc,qc=fr(Uc,sa,aa,!1,null,null,null),Vc=qc.exports,Hc="processmaker-modeler-inclusive-gateway",Wc={id:Hc,component:Vc,bpmnType:"bpmn:InclusiveGateway",control:!1,category:"BPMN",label:ao[Hc],definition:function(e,t){return e.create("bpmn:InclusiveGateway",{name:t(ao[Hc]),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[Hc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-inclusive-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-inclusive-gateway-advanced"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select the direction of workflow for this element",name:"gatewayDirection",options:[{value:Fc.diverging,content:"Diverging"},{value:Fc.converging,content:"Converging"}]}}]}]}]},Gc=f(70718),$c=f.n(Gc),Xc={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:$c()}},watch:{"node.definition":{deep:!0,immediate:!0,handler:function(){delete this.node.definition.default}}}},Yc=Xc,Jc=fr(Yc,ca,la,!1,null,null,null),Zc=Jc.exports,Kc={id:"processmaker-modeler-parallel-gateway",component:Zc,bpmnType:"bpmn:ParallelGateway",control:!1,category:"BPMN",label:"Parallel Gateway",definition:function(e,t){return e.create("bpmn:ParallelGateway",{name:t("Parallel Gateway"),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:"Parallel Gateway",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-parallel-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-parallel-gateway-direction"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select the direction of workflow for this element",name:"gatewayDirection",options:[{value:Fc.diverging,content:"Diverging"},{value:Fc.converging,content:"Converging"}]}}]}]}]},Qc=f(30666),el=f.n(Qc),tl={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:el()}}},nl=tl,rl=fr(nl,da,ua,!1,null,null,null),ol=rl.exports,il="processmaker-modeler-event-based-gateway",sl={id:il,component:ol,bpmnType:"bpmn:EventBasedGateway",control:!1,category:"BPMN",label:ao[il],definition:function(e,t){return e.create("bpmn:EventBasedGateway",{name:t(ao[il])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[il],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-event-based-gateway"},items:[{component:"FormInput",config:{label:"Name",helper:"The Name of the Gateway",name:"name"}}]},Va,Na]}]},al=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},cl=[],ll={offset:{y:-20}},dl="processmaker-modeler-lane",ul=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=this.nodeRegistry["processmaker-modeler-sequence-flow"].diagram(this.moddle),i=this.nodeRegistry["processmaker-modeler-sequence-flow"].definition(this.moddle,this.$t);return i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)})),"bpmn:ExclusiveGateway"!==i.sourceRef.$type&&"bpmn:InclusiveGateway"!==i.sourceRef.$type||(i.conditionExpression=this.moddle.create("bpmn:FormalExpression",{body:""})),e.component.node.definition.get("outgoing").push(i),t.component.node.definition.get("incoming").push(i),new po("processmaker-modeler-sequence-flow",i,o)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,r=e.targetShape,o=e.targetConfig,i=$()(r,"component.node"),s=$()(t,"component.node");return Zo.hasTargetType(r)&&Zo.targetIsNotSource(s,i)&&n.targetIsNotALane(i)&&n.targetIsInSamePool(t,r)&&n.eventBasedGatewayTarget(s,i)&&n.isValidSource(t,o)&&n.sourceIsNotPool(s)&&!Ko.isADataNode(s)&&!Ko.isADataNode(i)}},{key:"isValidSource",value:function(e,t){return null==t.validateIncoming||t.validateIncoming(e.node)}},{key:"targetIsNotALane",value:function(e){return!e.isType(dl)}},{key:"targetIsInSamePool",value:function(e,t){var n=t.component.node.pool,r=e.component.node.pool;return!r||r===n}},{key:"targetIsNotSource",value:function(e,t){return t.id!==e.id}},{key:"eventBasedGatewayTarget",value:function(e,t){var n=e.isBpmnType("bpmn:EventBasedGateway"),r=t.isBpmnType("bpmn:IntermediateCatchEvent");return!n||r}},{key:"sourceIsNotPool",value:function(e){return!e.isType("processmaker-modeler-pool")}}]),n}(Zo),hl={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){return ul.isValid({sourceShape:this.sourceShape,targetShape:this.target,targetConfig:this.targetConfig})},targetType:function(){return $()(this.target,"component.node.type")},shapeName:function(){return this.node.definition.get("name")},nameLabel:{get:function(){return this.shape.label(0).attrs.text.text},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.shape.label(0,{attrs:{text:{text:e}}})}}},watch:{"node.definition":{handler:function(){var e=this.shapeName;e!==this.nameLabel&&(this.nameLabel=e),this.setDefaultMarker(this.isDefaultFlow())},deep:!0},"node.definition.sourceRef":{handler:function(){this.setDefaultMarker(this.isDefaultFlow())},deep:!0}},methods:{setDefaultMarker:function(e){this.shape.attr("line",{sourceMarker:{"stroke-width":e?2:0}})},isDefaultFlow:function(){return this.node.definition.sourceRef&&this.node.definition.sourceRef.default&&this.node.definition.sourceRef.default.id===this.node.definition.id},updateRouter:function(){this.shape.router("orthogonal",{padding:1})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition,this.sourceShape.component.node.definition.get("outgoing").push(this.node.definition),e.component.node.definition.get("incoming").push(this.node.definition)},createLabel:function(){this.shape.labels([{attrs:{text:{text:this.shapeName}},position:ll}])},createDefaultFlowMarker:function(){this.shape.attr("line",{sourceMarker:{type:"polyline","stroke-width":this.isDefaultFlow()?2:0,points:"2,6 6,-6"}})}},mounted:function(){this.shape=new F.shapes.standard.Link,this.shape.connector("rounded",{radius:5}),this.createLabel(),this.createDefaultFlowMarker(),this.shape.addTo(this.graph),this.shape.component=this}},pl=hl,fl=fr(pl,al,cl,!1,null,null,null),ml=fl.exports,gl="processmaker-modeler-sequence-flow",vl={id:gl,component:ml,bpmnType:"bpmn:SequenceFlow",control:!1,definition:function(e){return e.create("bpmn:SequenceFlow",{name:null})},diagram:function(e){return e.create("bpmndi:BPMNEdge")},inspectorData:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.definition.sourceRef.$type);return t||delete e.definition.conditionExpression,Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]="conditionExpression"===r?o.body:o,e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition,i=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(o.sourceRef.$type);for(var s in e)if(o[s]!==e[s])if("conditionExpression"===s&&i){if(o[s].body!==e[s]){var a=r.create("bpmn:FormalExpression",{body:e[s]});window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:[a]}),n(t,s,a)}}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:e[s]}),n(t,s,e[s])},multiplayerInspectorHandler:function(e,t,n,r){var o=Object.keys(t).filter((function(e){return"id"!==e}));if(0!==o.length)if("conditionExpression"!==o[0])n(e,o[0],t[o[0]]);else{var i=r.create("bpmn:FormalExpression",{body:t[o[0]][0].body});n(e,o[0],i)}},inspectorConfig:[{name:"Sequence Flow",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-sequence-flow"},items:[{component:"FormInput",config:Qr(Qr({},_a),{},{validation:null})}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new ul(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},bl=function(){var e=this,t=e._self._c;return t("crown-config",{attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering},on:{"remove-node":function(t){return e.$emit("remove-node",t)},"add-node":function(t){return e.$emit("add-node",t)},"save-state":function(t){return e.$emit("save-state",t)}}})},yl=[],wl=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=this.nodeRegistry["processmaker-modeler-message-flow"].diagram(this.moddle),i=this.nodeRegistry["processmaker-modeler-message-flow"].definition(this.moddle);return i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)})),new po("processmaker-modeler-message-flow",i,o)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,r=e.targetShape,o=e.sourceConfig,i=$()(r,"component.node"),s=$()(t,"component.node");return Zo.hasTargetType(r)&&n.isValidTargetType(i)&&Zo.targetIsValidStartEventType(i)&&Zo.targetIsValidIntermediateEventType(i)&&Zo.targetIsValidBoundaryEventType(i)&&Zo.targetIsNotContainingPool(r,s)&&Zo.targetIsInDifferentPool(r,t)&&Zo.targetIsNotSource(i,s)&&Zo.allowOutgoingFlow(o,s)}},{key:"isValidTargetType",value:function(e){return["bpmn:Task","bpmn:ScriptTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ServiceTask","bpmn:IntermediateCatchEvent","bpmn:Participant","bpmn:StartEvent","bpmn:BoundaryEvent"].some((function(t){return e.isBpmnType(t)}))}}]),n}(Zo),xl={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){return wl.isValid({sourceShape:this.sourceShape,targetShape:this.target,sourceConfig:this.sourceConfig})},targetType:function(){return $()(this.target,"component.node.type")},sourceType:function(){return $()(this.sourceNode,"type")}},methods:{updateRouter:function(){this.shape.router("orthogonal",{padding:1})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"orthogonal"}}),this.shape.attr("line",{strokeDasharray:"10 10",sourceMarker:{type:"circle",r:5,"stroke-width":2,fill:"#fff"},targetMarker:{type:"path",fill:"#fff","stroke-width":2,d:"M 10 -5 0 0 10 5 Z"}}),this.shape.addTo(this.graph),this.shape.component=this}},kl=xl,Cl=fr(kl,bl,yl,!1,null,null,null),Sl=Cl.exports,El="processmaker-modeler-message-flow",Al={id:El,component:Sl,bpmnType:"bpmn:MessageFlow",control:!1,definition:function(e){return e.create("bpmn:MessageFlow",{name:""})},diagram:function(e){return e.create("bpmndi:BPMNEdge")},inspectorConfig:[{name:"Message Flow",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-message-flow"},items:[{component:"FormInput",config:_a}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new wl(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},_l=f(18256),Tl=f.n(_l),Ml={extends:Ea,mixins:[tc],props:["node","rootElements","id"],data:function(){return{message:this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),nodeIcon:Tl()}},methods:{addMessageRef:function(){this.node.definition.get("eventDefinitions")[0].messageRef?this.message=this.node.definition.get("eventDefinitions")[0].messageRef:(this.message=this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),this.rootElements.push(this.message),this.node.definition.get("eventDefinitions")[0].messageRef=this.message)}},mounted:function(){this.addMessageRef()},destroyed:function(){Cs()(this.rootElements,this.message),Un.commit("removeMessageRef",this.message)}},Pl=Ml,Il=fr(Pl,ha,pa,!1,null,null,null),Ol=Il.exports,Dl=function(){var e=this,t=e._self._c;return t("div",[t("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),t("div",{staticClass:"d-flex",class:{invalid:e.invalid}},[t("multiselect",{attrs:{value:e.selectedOption,placeholder:e.$t(e.placeholder),options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"name","data-test":"".concat(e.name,":select")},on:{input:e.change,"search-change":e.loadOptionsDebounced,open:e.loadOptions}},[t("template",{slot:"noResult"},[e._t("noResult",(function(){return[e._v(e._s(e.$t("Not found")))]}))],2),t("template",{slot:"noOptions"},[e._t("noOptions",(function(){return[e._v(e._s(e.$t("No Data Available")))]}))],2)],2),t("div",{staticClass:"btn-group ml-1",attrs:{role:"group"}},[t("button",{staticClass:"btn btn-secondary btn-sm",attrs:{type:"button","data-cy":"events-list",title:e.$t("Configure")},on:{click:e.toggleConfigMessage}},[t("i",{staticClass:"fa fa-ellipsis-h"})])])],1),e.invalid?t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("Message reference is required"))+" ")])]):e._e(),e.helper?t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),e.showNewMessage?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("ID"),error:e.getValidationErrorForNewId(e.messageId),"data-cy":"events-add-id"},model:{value:e.messageId,callback:function(t){e.messageId=t},expression:"messageId"}}),t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNewName(e.messageName),"data-cy":"events-add-name"},model:{value:e.messageName,callback:function(t){e.messageName=t},expression:"messageName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddMessage}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validNew,type:"button","data-cy":"events-save"},on:{click:e.addMessage}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),e.showEditMessage?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNameUpdate(e.messageName),"data-cy":"events-edit-name"},model:{value:e.messageName,callback:function(t){e.messageName=t},expression:"messageName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddMessage}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validUpdate,type:"button","data-cy":"events-save"},on:{click:e.updateMessage}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e.showConfirmDelete?t("div",{staticClass:"card mb-3 bg-danger text-white"},[e.deleteMessageUsage(e.deleteMessage.id)?t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.deleteMessageUsage(e.deleteMessage.id))+" ")]):t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.$t("Are you sure you want to delete this item?"))+" ("+e._s(e.deleteMessage.id)+") "+e._s(e.deleteMessage.name)+" ")]),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn btn-sm btn-light mr-2 p-1 font-xs",attrs:{type:"button","data-cy":"events-cancel"},on:{click:function(t){e.showConfirmDelete=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),e.deleteMessageUsage(e.deleteMessage.id)?e._e():t("button",{staticClass:"btn btn-sm btn-danger p-1 font-xs",attrs:{type:"button","data-cy":"events-delete"},on:{click:e.confirmDeleteMessage}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])]):!e.showListMessages||e.showNewMessage||e.showEditMessage?e._e():[t("table",{staticClass:"table table-sm table-striped",attrs:{width:"100%"}},[t("thead",[t("tr",[t("td",{attrs:{colspan:"2",align:"right"}},[t("button",{staticClass:"btn btn-secondary btn-sm p-1 font-xs",attrs:{type:"button","data-cy":"events-add"},on:{click:e.showAddMessage}},[t("i",{staticClass:"fa fa-plus"}),e._v(" "+e._s(e.$t("Message"))+" ")])])])]),t("tbody",e._l(e.localMessages,(function(n){return t("tr",{key:"message-".concat(n.id)},[t("td",[t("b-badge",{attrs:{variant:"secondary"}},[e._v(e._s(n.id))]),e._v(" "+e._s(n.name)+" ")],1),t("td",{attrs:{align:"right"}},[t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Edit")},on:{click:function(t){return e.editMessage(n)}}},[t("i",{staticClass:"fa fa-pen",attrs:{"data-cy":"events-edit"}})]),t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Remove")},on:{click:function(t){return e.removeMessage(n)}}},[t("i",{staticClass:"fa fa-trash",attrs:{"data-cy":"events-remove"}})])])])})),0)])]],2)},Nl=[],Rl=(f(34553),{props:{value:null,name:String,placeholder:{type:String,default:"Select option"},helper:String,trackBy:{type:String,default:"id"},label:{type:String,default:"name"},api:{type:String,default:"messages"},multiple:{type:Boolean,default:!1}},computed:{invalid:function(){return!this.value},localMessages:function(){return Un.getters.rootElements.filter((function(e){return"bpmn:Message"===e.$type}))},validNew:function(){return""===this.getValidationErrorForNewId(this.messageId)&&""===this.getValidationErrorForNewName(this.messageName)},validUpdate:function(){return""===this.getValidationErrorForNameUpdate(this.messageName)}},data:function(){return{options:[],selectedOption:null,pmql:"id!="+window.ProcessMaker.modeler.process.id,showListMessages:!1,showNewMessage:!1,showEditMessage:!1,showConfirmDelete:!1,deleteMessage:null,messageId:"",messageName:""}},methods:{deleteMessageUsage:function(e){var t=this.messageUsage(e),n=[];return t.forEach((function(e){return n.push(e.name||e.id)})),n.length?this.$t("This message cannot be removed, it is used by")+": "+n.join(", "):""},messageUsage:function(e){var t=[];return Un.getters.rootElements.forEach((function(n){"bpmn:Process"===n.$type&&n.flowElements.forEach((function(n){n.eventDefinitions&&n.eventDefinitions.forEach((function(r){"bpmn:MessageEventDefinition"===r.$type&&r.messageRef&&r.messageRef.id===e&&t.push(n)}))}))})),t},getValidationErrorForNewId:function(e){if(!e)return this.$t("Message ID is required");var t=Un.getters.rootElements.find((function(t){return t.id===e}));if(t)return this.$t("Message ID is duplicated");var n=e.match(/^[_A-Za-z][-._A-Za-z0-9]*$/);return n?"":this.$t("Message ID is not a valid xsd:ID")},getValidationErrorForNewName:function(e){if(!e)return this.$t("Message Name is required");var t=Un.getters.rootElements.find((function(t){return"bpmn:Message"===t.$type&&t.name===e}));return t?this.$t("Message Name is duplicated"):""},getValidationErrorForNameUpdate:function(e){var t=this;if(!e)return this.$t("Message Name is required");var n=Un.getters.rootElements.find((function(n){return"bpmn:Message"===n.$type&&n.name===e&&n.id!==t.messageId}));return n?this.$t("Message Name is duplicated"):""},confirmDeleteMessage:function(){var e=this;this.showConfirmDelete=!1;var t=Un.getters.rootElements.findIndex((function(t){return t.id===e.deleteMessage.id}));t>-1&&Un.getters.rootElements.splice(t,1)},removeMessage:function(e){this.showConfirmDelete=!0,this.deleteMessage=e},toggleConfigMessage:function(){this.showListMessages=!this.showListMessages},editMessage:function(e){this.messageId=e.id,this.messageName=e.name,this.showEditMessage=!0},getMessageById:function(e){return Un.getters.rootElements.find((function(t){return t.id===e}))},change:function(e){if(!e)return this.$emit("input",""),void this.refreshVueMultiselectValue();var t=this.getMessageById(e.id);t||(t=window.ProcessMaker.$modeler.moddle.create("bpmn:Message",{id:e.id,name:e.name}),Un.getters.rootElements.push(t)),this.$emit("input",(0,Er.get)(e,this.trackBy)),this.refreshVueMultiselectValue()},refreshVueMultiselectValue:function(){var e=this;this.$nextTick((function(){var t=e;while(t&&"vue-form-renderer"!==t.$options._componentTag)t=t.$parent;t&&t.$emit("update",t.transientData)}))},showAddMessage:function(){this.showNewMessage=!0,this.messageId="",this.messageName=""},cancelAddMessage:function(){this.showNewMessage=!1,this.showEditMessage=!1},updateMessage:function(){this.getMessageById(this.messageId).name=this.messageName,this.showEditMessage=!1},addMessage:function(){var e=window.ProcessMaker.$modeler.moddle.create("bpmn:Message",{id:this.messageId,name:this.messageName});Un.getters.rootElements.push(e),this.showNewMessage=!1},updateOptions:function(e){this.options=(0,Er.uniqBy)([].concat(W(this.localMessages),W(e)),"id")},loadOptions:function(){this.updateOptions([])},loadSelected:function(e){var t=Un.getters.rootElements.find((function(t){return t.id===e}));t?this.selectedOption={id:t.id,name:t.name}:(this.$emit("input",""),this.refreshVueMultiselectValue())},loadOptionsDebounced:function(){}},watch:{value:{immediate:!0,handler:function(e){var t=this;this.selectedOption=this.options.find((function(n){return(0,Er.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}}),Bl=Rl,Ll=(f(53030),f(54061),fr(Bl,Dl,Nl,!1,null,"5e4e6e5a",null)),jl=Ll.exports;function Fl(e){return{component:jl,config:{label:"Message",name:"messageRef",helper:e}}}var zl,Ul,ql={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=o[0].get("messageRef");e.messageRef=i?i.id:""}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r,o){var i;for(var s in lc()(e,["$type","eventDefinitions","messageRef"]))t.definition[s]!==e[s]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:e[s]}),n(t,s,e[s]));var a=o.rootElements.find((function(t){return t.id===e.messageRef}));!a&&e.messageRef&&(a=r.create("bpmn:Message",{id:e.messageRef,name:e.messageRef}),o.rootElements.push(a)),t.definition.get("eventDefinitions")[0].messageRef=a,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"messageRef",value:e.messageRef,extras:{messageName:null===(i=a)||void 0===i?void 0:i.name,allowedUsers:t.definition.get("allowedUsers"),allowedGroups:t.definition.get("allowedGroups")}})}},Vl="processmaker-modeler-message-end-event",Hl=ac()(ho()(Wa),Qr(Qr({},ql),{},{id:Vl,component:Ol,control:!1,label:ro[Vl],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[Vl]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Select the message reference that this element throws")]}]}]})),Wl=f(77389),Gl=f.n(Wl),$l={extends:Ea,mixins:[tc],data:function(){return{nodeIcon:Gl()}},mounted:function(){this.shape.attr({image:{"ref-y":3}})}},Xl=$l,Yl=fr(Xl,zl,Ul,!1,null,null,null),Jl=Yl.exports,Zl=function(){var e=this,t=e._self._c;return t("div",[t("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),t("div",{staticClass:"d-flex",class:{invalid:e.invalid}},[t("multiselect",{attrs:{value:e.selectedOption,placeholder:e.$t(e.placeholder),options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"name","data-test":"".concat(e.name,":select"),disabled:!e.can("view-signals")},on:{input:e.change,"search-change":e.loadOptions,open:function(t){return e.loadOptions()}}},[t("template",{slot:"noResult"},[e._t("noResult",(function(){return[e._v(e._s(e.$t("Not found")))]}))],2),t("template",{slot:"noOptions"},[e._t("noOptions",(function(){return[e._v(e._s(e.$t("No Data Available")))]}))],2)],2),e.canEdit?t("div",{staticClass:"btn-group ml-1",attrs:{role:"group"}},[t("button",{staticClass:"btn btn-secondary btn-sm",attrs:{type:"button","data-cy":"events-list",title:e.$t("Configure")},on:{click:e.toggleConfigSignal}},[t("i",{staticClass:"fa fa-ellipsis-h"})])]):e._e()],1),e.can("view-signals")?e._e():t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("You do not have permission to view signals"))+" ")])]),e.invalid?t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("Signal reference is required"))+" ")])]):e._e(),e.helper?t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),e.showNewSignal?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("ID"),error:e.getValidationErrorForNewId(e.signalId),"data-cy":"events-add-id"},model:{value:e.signalId,callback:function(t){e.signalId=t},expression:"signalId"}}),t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNewName(e.signalName),"data-cy":"events-add-name"},model:{value:e.signalName,callback:function(t){e.signalName=t},expression:"signalName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddSignal}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validNew,type:"button","data-cy":"events-save"},on:{click:e.addSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),e.showEditSignal?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNameUpdate(e.signalName),"data-cy":"events-edit-name"},model:{value:e.signalName,callback:function(t){e.signalName=t},expression:"signalName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddSignal}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validUpdate,type:"button","data-cy":"events-save"},on:{click:e.updateSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e.showConfirmDelete?t("div",{staticClass:"card mb-3 bg-danger text-white"},[e.deleteSignalUsage(e.deleteSignal.id)?t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.deleteSignalUsage(e.deleteSignal.id))+" ")]):t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.$t("Are you sure you want to delete this item?"))+" ("+e._s(e.deleteSignal.id)+") "+e._s(e.deleteSignal.name)+" ")]),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn btn-sm btn-light mr-2 p-1 font-xs",attrs:{type:"button","data-cy":"events-cancel"},on:{click:function(t){e.showConfirmDelete=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),e.deleteSignalUsage(e.deleteSignal.id)?e._e():t("button",{staticClass:"btn btn-sm btn-danger p-1 font-xs",attrs:{type:"button","data-cy":"events-delete"},on:{click:e.confirmDeleteSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):!e.showListSignals||e.showNewSignal||e.showEditSignal?e._e():[t("table",{staticClass:"table table-sm table-striped",attrs:{width:"100%"}},[t("thead",[t("tr",[t("td",{attrs:{colspan:"2",align:"right"}},[t("button",{staticClass:"btn btn-secondary btn-sm p-1 font-xs",attrs:{type:"button","data-cy":"events-add"},on:{click:e.showAddSignal}},[t("i",{staticClass:"fa fa-plus"}),e._v(" "+e._s(e.$t("Signal"))+" ")])])])]),t("tbody",e._l(e.localSignals,(function(n){return t("tr",{key:"signal-".concat(n.id)},[t("td",[t("b-badge",{attrs:{variant:"secondary"}},[e._v(e._s(n.id))]),e._v(" "+e._s(n.name)+" ")],1),t("td",{attrs:{align:"right"}},[e.can("edit-signals")?t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Edit")},on:{click:function(t){return e.editSignal(n)}}},[t("i",{staticClass:"fa fa-pen",attrs:{"data-cy":"events-edit"}})]):e._e(),e.can("delete-signals")?t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Remove")},on:{click:function(t){return e.removeSignal(n)}}},[t("i",{staticClass:"fa fa-trash",attrs:{"data-cy":"events-remove"}})]):e._e()])])})),0)])]],2)},Kl=[],Ql={props:{value:null,name:String,placeholder:{type:String,default:"Select option"},helper:String,canEdit:{type:Boolean,default:!0},trackBy:{type:String,default:"id"},label:{type:String,default:"name"},api:{type:String,default:"signals"},multiple:{type:Boolean,default:!1}},computed:{invalid:function(){return!this.value},localSignals:function(){return Un.getters.rootElements.filter((function(e){return"bpmn:Signal"===e.$type}))},validNew:function(){return""===this.getValidationErrorForNewId(this.signalId)&&""===this.getValidationErrorForNewName(this.signalName)},validUpdate:function(){return""===this.getValidationErrorForNameUpdate(this.signalName)}},data:function(){return{options:[],selectedOption:null,pmql:"id!="+window.ProcessMaker.modeler.process.id,showListSignals:!1,showNewSignal:!1,showEditSignal:!1,showConfirmDelete:!1,deleteSignal:null,signalId:"",signalName:""}},methods:{deleteSignalUsage:function(e){var t=this.signalUsage(e),n=[];return t.forEach((function(e){return n.push(e.name||e.id)})),n.length?this.$t("This signal cannot be removed, it is used by")+": "+n.join(", "):""},signalUsage:function(e){var t=[];return Un.getters.rootElements.forEach((function(n){"bpmn:Process"===n.$type&&n.flowElements.forEach((function(n){n.eventDefinitions&&n.eventDefinitions.forEach((function(r){"bpmn:SignalEventDefinition"===r.$type&&r.signalRef&&r.signalRef.id===e&&t.push(n)}))}))})),t},getValidationErrorForNewId:function(e){if(!e)return this.$t("Signal ID is required");var t=Un.getters.rootElements.find((function(t){return t.id===e}));if(t)return this.$t("Signal ID is duplicated");var n=e.match(/^[_A-Za-z][-._A-Za-z0-9]*$/);return n?"":this.$t("Signal ID is not a valid xsd:ID")},getValidationErrorForNewName:function(e){if(!e)return this.$t("Signal Name is required");var t=Un.getters.rootElements.find((function(t){return"bpmn:Signal"===t.$type&&t.name===e}));return t?this.$t("Signal Name is duplicated"):""},getValidationErrorForNameUpdate:function(e){var t=this;if(!e)return this.$t("Signal Name is required");var n=Un.getters.rootElements.find((function(n){return"bpmn:Signal"===n.$type&&n.name===e&&n.id!==t.signalId}));return n?this.$t("Signal Name is duplicated"):""},confirmDeleteSignal:function(){var e=this;this.showConfirmDelete=!1;var t=Un.getters.rootElements.findIndex((function(t){return t.id===e.deleteSignal.id}));t>-1&&Un.getters.rootElements.splice(t,1)},removeSignal:function(e){this.showConfirmDelete=!0,this.deleteSignal=e},toggleConfigSignal:function(){this.can("view-signals")?this.showListSignals=!this.showListSignals:window.ProcessMaker.alert(this.$t("You do not have permission to view signals"),"danger")},editSignal:function(e){this.signalId=e.id,this.signalName=e.name,this.showEditSignal=!0},getSignalById:function(e){return Un.getters.rootElements.find((function(t){return t.id===e}))},change:function(e){if(!e)return this.$emit("input",""),void this.refreshVueMultiselectValue();var t=this.getSignalById(e.id);t||(t=window.ProcessMaker.$modeler.moddle.create("bpmn:Signal",{id:e.id,name:e.name}),Un.getters.rootElements.push(t)),this.$emit("input",(0,Er.get)(e,this.trackBy)),this.refreshVueMultiselectValue()},refreshVueMultiselectValue:function(){var e=this;this.$nextTick((function(){var t=e;while(t&&"vue-form-renderer"!==t.$options._componentTag)t=t.$parent;t&&t.$emit("update",t.transientData)}))},showAddSignal:function(){this.can("create-signals")?(this.showNewSignal=!0,this.signalId="",this.signalName=""):window.ProcessMaker.alert(this.$t("You do not have permission to add new signals"),"danger")},cancelAddSignal:function(){this.showNewSignal=!1,this.showEditSignal=!1},updateSignal:function(){this.getSignalById(this.signalId).name=this.signalName,this.showEditSignal=!1},addSignal:function(){var e=window.ProcessMaker.$modeler.moddle.create("bpmn:Signal",{id:this.signalId,name:this.signalName});Un.getters.rootElements.push(e),this.showNewSignal=!1},updateOptions:function(e){this.options=(0,Er.uniqBy)([].concat(W(e),W(this.localSignals)),"id")},loadOptions:function(e){var t=this;if(this.can("view-signals")){var n=this.pmql;window.window.ProcessMaker.apiClient.get(this.api,{params:{filter:e,pmql:n}}).then((function(e){t.updateOptions(e.data.data||[])}))}},loadSelected:function(e){var t=Un.getters.rootElements.find((function(t){return t.id===e}));t?this.selectedOption={id:t.id,name:t.name}:(this.$emit("input",""),this.refreshVueMultiselectValue())},loadOptionsDebounced:function(){},can:function(e){return(0,Er.get)(window,"ProcessMaker.modeler.signalPermissions.".concat(e),!1)}},watch:{value:{immediate:!0,handler:function(e){var t=this;this.selectedOption=this.options.find((function(n){return(0,Er.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}},ed=Ql,td=(f(59244),f(34924),fr(ed,Zl,Kl,!1,null,"607e6d70",null)),nd=td.exports;function rd(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{component:nd,config:{label:"Signal",name:"signalRef",helper:e,canEdit:t}}}var od={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=o[0].get("signalRef");e.signalRef=i?i.id:""}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r,o){for(var i in lc()(e,["$type","eventDefinitions","signalRef"]))t.definition[i]!==e[i]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i]));var s=o.rootElements.find((function(t){return t.id===e.signalRef}));!s&&e.signalRef&&(s=r.create("bpmn:Signal",{id:e.signalRef,name:e.signalRef}),o.rootElements.push(s)),t.definition.get("eventDefinitions")[0].signalRef=s}},id="processmaker-modeler-signal-end-event",sd=ac()(ho()(Wa),Qr(Qr({},od),{},{id:id,component:Jl,control:!1,label:ro[id],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[id]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Select the signal reference that this element throws")]}]}]})),ad=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},cd=[],ld={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs,tc],data:function(){return{shape:new ma,definition:null,dropdownData:[{label:to["processmaker-modeler-start-event"],nodeType:"processmaker-modeler-start-event",dataTest:"switch-to-start-event"},{label:to["processmaker-modeler-start-timer-event"],nodeType:"processmaker-modeler-start-timer-event",dataTest:"switch-to-start-timer-event"},{label:to["processmaker-modeler-signal-start-event"],nodeType:"processmaker-modeler-signal-start-event",dataTest:"switch-to-signal-start-event"},{label:to["processmaker-modeler-message-start-event"],nodeType:"processmaker-modeler-message-start-event",dataTest:"switch-to-message-start-event"},{label:to["processmaker-modeler-conditional-start-event"],nodeType:"processmaker-modeler-conditional-start-event",dataTest:"switch-to-conditional-start-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape.set("type","processmaker.components.nodes.startEvent.Shape");var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({body:{stroke:He,fill:Ve},label:{text:this.node.definition.get("name"),refY:"130%"},image:{"ref-x":5,"ref-y":5,width:e.get("width")-10,height:e.get("height")-10}}),this.shape.addTo(this.graph),this.shape.component=this}},dd=ld,ud=fr(dd,ad,cd,!1,null,null,null),hd=ud.exports,pd=f(27879),fd=f.n(pd);function md(e){if(!e)return!1;var t=JSON.parse(e);return t&&t.web_entry&&"DISABLED"!==t.web_entry.mode}var gd,vd,bd,yd,wd,xd,kd,Cd,Sd={extends:hd,watch:{"node.definition.config":{immediate:!0,handler:function(e){if(md(e))return this.nodeIcon=fd(),void this.shape.attr("image/xlink:href",ec(fd(),this.node));this.nodeIcon=null,this.shape.attr("image/xlink:href",null)}}}},Ed=Sd,Ad=fr(Ed,gd,vd,!1,null,null,null),_d=Ad.exports,Td=36,Md={bpmnType:"bpmn:StartEvent",control:!1,category:"BPMN",diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:Td,width:Td,x:null,y:null})})},validateIncoming:function(){return!1},inspectorConfig:[{items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-start-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Pd="processmaker-modeler-start-event",Id=ac()(ho()(Md),{id:Pd,component:_d,control:!0,icon:f(34954),label:to[Pd],rank:10,items:[{icon:f(34954),label:to[Pd],control:!0,bpmnType:"bpmn:StartEvent",rank:10,id:"processmaker-modeler-start-event"},{icon:f(42123),label:to["processmaker-modeler-message-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:11,id:"processmaker-modeler-message-start-event"},{icon:f(47658),label:to["processmaker-modeler-conditional-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:12,id:"processmaker-modeler-conditional-start-event"},{icon:f(43762),label:to["processmaker-modeler-signal-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:13,id:"processmaker-modeler-signal-start-event"},{icon:f(8519),label:to["processmaker-modeler-start-timer-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:14,id:"processmaker-modeler-start-timer-event"}],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[Pd])})}}),Od=f(69766),Dd=f.n(Od),Nd={extends:hd,data:function(){return{nodeIcon:Dd()}},mounted:function(){this.shape.attr({image:{"ref-x":5,"ref-y":3}})}},Rd=Nd,Bd=fr(Rd,bd,yd,!1,null,null,null),Ld=Bd.exports,jd={label:"Request Variable",name:"config",helper:"Enter the request variable that will store the signal payload","data-cy":"signal-request-variable"},Fd=jd,zd="processmaker-modeler-signal-start-event",Ud=ac()(ho()(Md),Qr(Qr({},od),{},{id:zd,component:Ld,label:to[zd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[zd]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Signal that will trigger this start event",!1),{component:"FormInput",config:Fd}]}]}]})),qd=f(47179),Vd=f.n(qd),Hd={extends:hd,data:function(){return{nodeIcon:Vd()}}},Wd=Hd,Gd=fr(Wd,wd,xd,!1,null,null,null),$d=Gd.exports,Xd="processmaker-modeler-message-start-event",Yd=ac()(ho()(Md),Qr(Qr({},ql),{},{id:Xd,component:$d,label:to[Xd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[Xd]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Message that will trigger this start event")]}]}]})),Jd=f(93698),Zd=f.n(Jd),Kd={extends:hd,data:function(){return{nodeIcon:Zd()}}},Qd=Kd,eu=fr(Qd,kd,Cd,!1,null,null,null),tu=eu.exports,nu=(f(82481),function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-group"},[t("form-date-picker",{staticClass:"p-0",attrs:{"emit-iso":!0,"data-test":"start-date-picker","data-format":"datetime",label:e.$t("Start date"),placeholder:e.$t("Start date"),"control-class":"form-control",value:e.startDate,helper:e.$t(e.startDateHelper)},on:{input:e.setStartDate}}),e.hasRepeat?[t("label",{},[e._v(e._s(e.$t(e.repeatLabel)))]),t("b-form-group",{staticClass:"m-0 mb-3 p-0"},[t("b-form-input",{staticClass:"d-inline-block w-50",attrs:{type:"number",min:"1",max:"99","data-test":"repeat-input"},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-form-select",{staticClass:"d-inline-block w-50 periodicity",attrs:{"data-test":"repeat-on-select"},model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},[t("option",{attrs:{value:"day"}},[e._v(e._s(e.$t("day")))]),t("option",{attrs:{value:"week"}},[e._v(e._s(e.$t("week")))]),t("option",{attrs:{value:"month"}},[e._v(e._s(e.$t("month")))]),t("option",{attrs:{value:"year"}},[e._v(e._s(e.$t("year")))])]),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.repeatHelper)))])],1)]:e._e(),e.isWeeklyPeriodSelected?t("weekday-select",{attrs:{selectWeekdays:e.selectedWeekdays,periodicityValue:e.periodicityValue,repeat:e.repeat,"start-date":e.startDate,"end-date":e.endDate,ends:e.ends,times:e.times},model:{value:e.expression,callback:function(t){e.expression=t},expression:"expression"}}):e._e(),e.hasEnds?[t("label",{staticClass:"mt-1"},[e._v(e._s(e.$t("Ends")))]),t("div",[t("b-form-group",{staticClass:"m-0 mb-2"},[t("b-form-radio",{attrs:{"data-test":"ends-never",name:"optradio",value:"never"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("Never")))])],1),t("b-form-group",{staticClass:"p-0 mb-1",attrs:{description:"".concat(e.$t("Click On to select a date"),".")}},[t("b-form-radio",{staticClass:"pl-3 ml-2 mb-1",attrs:{name:"optradio",value:"ondate","data-test":"ends-on"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("On")))]),t("form-date-picker",{staticClass:"form-date-picker p-0 m-0",class:{"date-disabled":"ondate"!==e.ends},attrs:{"emit-iso":!0,"data-test":"end-date-picker",disabled:"ondate"!==e.ends,placeholder:e.$t("End date"),"data-format":"datetime","control-class":"form-control",value:e.endDate,name:"end date"},on:{input:e.setEndDate}})],1),t("b-form-group",{staticClass:"mt-0 p-0",attrs:{description:"".concat(e.$t("Click After to enter how many occurrences to end the timer control"),".")}},[t("b-form-radio",{staticClass:"pl-3 ml-2 mb-1",attrs:{"data-test":"ends-after",name:"optradio",value:"after"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("After")))]),t("b-form-input",{staticClass:"w-25 pl-2 pr-1 d-inline-block",attrs:{"data-test":"ends-after-input",type:"number",min:"0",max:"99",disabled:"after"!==e.ends},model:{value:e.times,callback:function(t){e.times=t},expression:"times"}}),t("b-form-input",{staticClass:"w-75 d-inline-block occurrences-text",attrs:{readonly:"after"!==e.ends,value:e.$t("occurrences")}})],1)],1)]:e._e()],2)}),ru=[],ou=f(26985),iu=function(){var e=this,t=e._self._c;return e.cycleManager.isWeeklyPeriodSelected()?t("div",{staticClass:"mb-2"},[t("label",{},[e._v(e._s(e.$t(e.weekLabel)))]),t("div",e._l(e.weekdays,(function(n){return t("span",{key:n.day,staticClass:"badge badge-pill weekday mb-1",class:e.cycleManager.weekdayStyle(n),attrs:{"data-test":"day-".concat(n.day)},on:{click:function(t){return e.clickWeekDay(n)}}},[e._v(" "+e._s(e.$t(n.initial))+" ")])})),0),e.repeatOnValidationError?t("small",{staticClass:"text-danger"},[e._v(e._s(e.repeatOnValidationError))]):e._e(),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.periodicityHelper)))])]):e._e()},su=[];function au(e){return null===e?"":"string"===typeof e?e:e.isLuxonDateTime?e.toISO():e.toISOString()}function cu(e,t,n,r,o){var i=au(e),s=au(t),a="after"===r?o:"",c="ondate"===r?s:"";return"R".concat(a,"/").concat(i,"/").concat(n)+(c?"/"+c:"")}function lu(e,t){return"P".concat(e).concat(t)}var du,uu,hu=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"never",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"1";d(this,e),y(this,"_startDate",void 0),y(this,"_repeat",void 0),y(this,"_periodicityValue",void 0),y(this,"_selectedWeekdays",void 0),y(this,"_endDate",void 0),y(this,"_ends",void 0),y(this,"_times",void 0),this._startDate=this.sanitizeDate(t),this._repeat=n,this._periodicityValue=r,this._selectedWeekdays=o,this._endDate=this.sanitizeDate(i),this._ends=s,this._times=a}return g(e,[{key:"startDate",set:function(e){this._startDate=this.sanitizeDate(e)}},{key:"endDate",set:function(e){this._endDate=this.sanitizeDate(e)}},{key:"ends",set:function(e){this._ends=e}},{key:"times",set:function(e){this._times=e}},{key:"repeat",set:function(e){this._repeat=e}},{key:"periodicityValue",set:function(e){this._periodicityValue=e}},{key:"selectedWeekdays",set:function(e){this._selectedWeekdays=e}},{key:"sanitizeDate",value:function(e){return null===e?e:"string"===typeof e?ou.DateTime.fromISO(e).toUTC():e.isLuxonDateTime?e.toUTC():ou.DateTime.fromJSDate(e).toUTC()}},{key:"getFormattedDateWithWeekdayIntervals",value:function(){var e=this,t=lu(this._repeat,this._periodicityValue),n=[this._startDate.toISO()];return this._selectedWeekdays.forEach((function(r){var o=e.getWeekDayDate(r),i=cu(o,e._endDate,t,e._ends,e._times);n.push(i)})),n.join("|")}},{key:"getWeekDayDate",value:function(e){var t=ou.DateTime.fromISO(this._startDate,{zone:"utc"}),n=t.set({weekday:e});return n.toMillis()<t.toMillis()&&(n=n.plus({days:7})),n.toUTC()}},{key:"dateIntervalString",value:function(){if(this.isWeeklyPeriodSelected()&&this.hasSelectedWeekdays())return this.getFormattedDateWithWeekdayIntervals();var e=lu(this._repeat,this._periodicityValue);return cu(this._startDate,this._endDate,e,this._ends,this._times)}},{key:"isWeeklyPeriodSelected",value:function(){return"W"===this._periodicityValue}},{key:"hasSelectedWeekdays",value:function(){return this._selectedWeekdays.length>0}},{key:"weekdayStyle",value:function(e){var t=this._startDate.toLocal().weekday;return[e.selected?"badge-primary":"badge-light",{"border border-primary":t===e.day}]}}]),e}(),pu={props:{selectWeekdays:{type:Array,default:function(){return[]}},startDate:{type:String,default:ou.DateTime.local().toUTC().toISO()},endDate:{type:String,default:null},ends:{type:String,default:"never"},times:{type:[Number,String],default:1},periodicityValue:{type:String,required:!0},repeat:{type:[String,Number],default:1},hasEnds:{type:Boolean,default:!0},weekLabel:{type:String,default:"Repeat on"},periodicityHelper:{type:String,default:"Select the day(s) of the week in which to trigger this element"}},data:function(){return{DateTime:ou.DateTime,weekdays:[{day:7,initial:"S",selected:!1},{day:1,initial:"M",selected:!1},{day:2,initial:"T",selected:!1},{day:3,initial:"W",selected:!1},{day:4,initial:"T",selected:!1},{day:5,initial:"F",selected:!1},{day:6,initial:"S",selected:!1}],cycleManager:new hu(this.startDate,this.repeat,this.periodicityValue,this.selectedWeekdays,this.endDate,this.ends,this.times)}},watch:{startDate:function(e){this.cycleManager.startDate=e},endDate:function(e){this.cycleManager.endDate=e},ends:function(e){this.cycleManager.ends=e},times:function(e){this.cycleManager.times=e},repeat:function(e){this.cycleManager.repeat=e},periodicityValue:function(e){this.cycleManager.periodicityValue=e},selectedWeekdays:function(e){this.cycleManager.selectedWeekdays=e},dateIntervalString:function(){this.update()}},mounted:function(){var e=this;this.selectWeekdays.forEach((function(t){var n=e.weekdays.find((function(e){return e.day===t}));n&&(n.selected=!0)}))},computed:{repeatOnValidationError:function(){var e=this.weekdays.filter((function(e){var t=e.selected;return t})).length;return!this.cycleManager.isWeeklyPeriodSelected()||e>0?null:"You must select at least one day."},dateIntervalString:function(){return this.cycleManager.dateIntervalString()},selectedWeekdays:function(){return this.weekdays.filter((function(e){var t=e.selected;return t})).map((function(e){var t=e.day;return t}))}},methods:{clickWeekDay:function(e){e.selected=!e.selected},update:function(){this.$emit("input",this.dateIntervalString)}},destroyed:function(){this.$emit("input",null)}},fu=pu,mu=(f(41168),fr(fu,iu,su,!1,null,"4ae18478",null)),gu=mu.exports,vu={day:"D",week:"W",month:"M",year:"Y"},bu={components:{WeekdaySelect:gu},props:{value:[Array,String],hasEnds:{type:Boolean,default:!0},hasRepeat:{type:Boolean,default:!0},repeatLabel:{type:String,default:"Repeat every"},weekLabel:{type:String,default:"Repeat on"},startDateHelper:{type:String,default:"Select the date to initially trigger this element"},repeatHelper:{type:String,default:"Set the periodic interval to trigger this element again"},periodicityHelper:{type:String,default:"Select the day(s) of the week in which to trigger this element"}},data:function(){return{DateTime:ou.DateTime,expression:null,startDate:ou.DateTime.local().toUTC().toISO(),repeat:"1",periodicity:"week",ends:"never",endDate:ou.DateTime.local().toUTC().toISO(),times:"1",selectedWeekdays:[]}},created:function(){this.parseTimerConfig(this.value)},watch:{timerExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{periodicityValue:function(){return vu[this.periodicity]},timerExpression:function(){if(this.isWeeklyPeriodSelected()&&this.expression)return this.expression;var e=lu(this.repeat,this.periodicityValue);return cu(this.startDate,this.endDate,e,this.ends,this.times)}},methods:{isWeeklyPeriodSelected:function(){return"week"===this.periodicity},setStartDate:function(e){this.startDate=ou.DateTime.fromISO(e,{zone:"utc"}).set({seconds:0,milliseconds:0}).toUTC().toISO()},setEndDate:function(e){var t=ou.DateTime.fromISO(this.startDate,{zone:"utc"});this.endDate=ou.DateTime.fromISO(e,{zone:"utc"}).set({hours:t.hour,minutes:t.minute,seconds:0,milliseconds:0}).toUTC().toISO()},parseTimerConfig:function(e){var t,n,r=this;if(null!==(t=e[0])&&void 0!==t&&null!==(n=t.timeCycle)&&void 0!==n&&n.body)try{var o=!1,i=e[0].timeCycle.body.split("|");i.forEach((function(e){if("R"!==e.substr(0,1))r.startDate=e,o=!0;else{var t=e.match(/R(\d*)\/([^/]+)\/P(\d+)(\w)(?:\/([^/]+))?/);if(t){if(r.times=t[1]||"1",r.repeat=t[3],r.periodicity=Object.keys(vu).find((function(e){return vu[e]===t[4]})),o||(r.startDate=t[2],o=!0),r.isWeeklyPeriodSelected()){var n=ou.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;r.selectedWeekdays.push(n)}r.endDate=t[5]||ou.DateTime.local().toUTC().toISO(),r.ends=t[5]?"ondate":t[1]?"after":"never"}}o=!0}))}catch(s){this.resetTimerExpression()}},resetTimerExpression:function(){this.startDate=ou.DateTime.local().toUTC().toISO(),this.times="1",this.repeat="1",this.periodicity="week",this.endDate=ou.DateTime.local().toUTC().toISO(),this.ends="never",this.expression=null,this.selectedWeekdays=[]}}},yu=bu,wu=(f(33383),f(66667),fr(yu,nu,ru,!1,null,"72709fd0",null)),xu=wu.exports,ku="processmaker-modeler-start-timer-event",Cu=ac()(ho()(Md),{id:ku,component:tu,label:to[ku],definition:function(e,t){var n=e.create("bpmn:StartEvent",{name:t(to[ku])});return n.eventDefinitions=[e.create("bpmn:TimerEventDefinition",{timeCycle:e.create("bpmn:Expression",{body:""})})],n},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var a=e[i];if("object"===s(a))continue;var c=o.get(i)[0].timeCycle;if(c&&c.body===a)continue;var l={timeCycle:r.create("bpmn:Expression",{body:a})},d=[r.create("bpmn:TimerEventDefinition",l)];n(t,"eventDefinitions",d),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:d})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-start-timer-timing-control"},items:[{component:xu,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Va,Na]}]}),Su=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,dropdownData:e.dropdownData}},e.$listeners))},Eu=[],Au=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"circle",selector:"body2"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.intermediateEvent.Shape",size:{width:36,height:36},attrs:Qr(Qr(Qr(Qr(Qr(Qr({body:{fill:We,stroke:Ge},body2:{cx:18,cy:18,r:15,"stroke-width":2,fill:We,stroke:Ge},image:{"ref-x":5,"ref-y":5,ref:"circle",width:26,height:26}},Qs("topLeft",{ref:"circle","ref-y":-20,"ref-padding-x":0})),Qs("topCenter",{ref:"circle","ref-y":-20})),Qs("topRight",{ref:"circle","ref-x":26,"ref-y":-20,"ref-padding-x":0},-1)),Qs("bottomLeft",{ref:"circle","ref-padding-x":0,"ref-padding-y":-40})),Qs("bottomCenter",{ref:"circle","ref-padding-y":-40})),Qs("bottomRight",{ref:"circle","ref-x":26,"ref-padding-x":0,"ref-padding-y":-40},-1))},F.shapes.standard.Circle.prototype.defaults)}),_u={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs],data:function(){return{shape:null,definition:null,dropdownData:[{label:lo["processmaker-modeler-intermediate-catch-timer-event"],nodeType:"processmaker-modeler-intermediate-catch-timer-event",dataTest:"switch-to-intermediate-timer-catch-event"},{label:lo["processmaker-modeler-intermediate-signal-catch-event"],nodeType:"processmaker-modeler-intermediate-signal-catch-event",dataTest:"switch-to-intermediate-signal-catch-event"},{label:lo["processmaker-modeler-intermediate-signal-throw-event"],nodeType:"processmaker-modeler-intermediate-signal-throw-event",dataTest:"switch-to-intermediate-signal-throw-event"},{label:lo["processmaker-modeler-intermediate-message-catch-event"],nodeType:"processmaker-modeler-intermediate-message-catch-event",dataTest:"switch-to-intermediate-message-catch-event"},{label:lo["processmaker-modeler-intermediate-message-throw-event"],nodeType:"processmaker-modeler-intermediate-message-throw-event",dataTest:"switch-to-intermediate-message-throw-event"},{label:lo["processmaker-modeler-intermediate-conditional-catch-event"],nodeType:"processmaker-modeler-intermediate-conditional-catch-event",dataTest:"switch-to-intermediate-conditional-catch-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Au;var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({label:{text:this.node.definition.get("name"),refY:"130%"}}),this.shape.addTo(this.graph),this.shape.component=this}},Tu=_u,Mu=fr(Tu,Su,Eu,!1,null,null,null),Pu=Mu.exports,Iu=f(39653),Ou=f.n(Iu),Du={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Ou()}}},Nu=Du,Ru=fr(Nu,du,uu,!1,null,null,null),Bu=Ru.exports,Lu=function(){var e=this,t=e._self._c;return t("div",[t("label",[e._v(e._s(e.$t("Type")))]),t("b-input-group",[t("b-form-select",{attrs:{value:e.timerPropertyName,"data-test":"intermediateTypeSelect"},on:{change:e.changeType}},[t("option",{attrs:{value:"timeDuration"}},[e._v(e._s(e.$t("Duration")))]),t("option",{attrs:{value:"timeDate"}},[e._v(e._s(e.$t("Date/Time")))]),t("option",{attrs:{value:"timeCycle"}},[e._v(e._s(e.$t("Cycle")))])])],1),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.typeHelper)))]),t(e.component,{tag:"component",attrs:{"has-ends":!1,"repeat-label":"Wait for","week-label":"Every"},model:{value:e.timerProperty,callback:function(t){e.timerProperty=t},expression:"timerProperty"}})],1)},ju=[],Fu=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("label",[e._v(e._s(e.$t("Duration")))]),t("b-input-group",[t("b-form-input",{staticClass:"form-control control repeat",attrs:{type:"number",min:"1","data-test":e.repeatInput},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-input-group-append",[t("b-form-select",{model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},e._l(e.periods,(function(n){return t("option",{key:n.name,domProps:{value:n}},[e._v(e._s(e.$t(n.name)))])})),0)],1),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Select the duration of the timer")))])],1)],1)},zu=[],Uu=f(10928),qu=f.n(Uu),Vu={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},Hu={props:["value","repeatInput"],data:function(){var e=[{name:Vu.minute,value:"M",isTime:!0},{name:Vu.hour,value:"H",isTime:!0},{name:Vu.day,value:"D"},{name:Vu.week,value:"W"},{name:Vu.month,value:"M"}];return{repeat:null,periodicity:null,periods:e}},watch:{value:{handler:function(e){this.periodicity=this.getPeriodFromDelayString(e),this.repeat=this.getRepeatNumberFromDelayString(e)},immediate:!0},durationExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{durationExpression:function(){return this.periodicity.isTime?"PT".concat(this.repeat).concat(this.periodicity.value):"P".concat(this.repeat).concat(this.periodicity.value)}},methods:{getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var r=t?Vu.minute:Vu.month;return this.periods.find((function(e){var t=e.name;return t===r}))}return this.periods.find((function(e){var t=e.value;return t===n}))},isTimePeriod:function(e){return"T"===e[1]},getRepeatNumberFromDelayString:function(e){var t=e.match(/\d+/);return t&&t[0]}}},Wu=Hu,Gu=fr(Wu,Fu,zu,!1,null,null,null),$u=Gu.exports,Xu=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("form-date-picker",{staticClass:"p-0",attrs:{"emit-iso":!0,"data-format":"datetime",label:e.$t("Wait until specific date/time"),"control-class":"form-control",value:e.convertFromUTC(e.value),"data-test":"date-picker",helper:"Select the date to trigger this element"},on:{input:e.emitValue}})],1)},Yu=[],Ju={data:function(){return{DateTime:ou.DateTime}},props:{value:String},methods:{getTimezone:function(){return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.timezone||"local"},convertFromUTC:function(e){return ou.DateTime.fromISO(e,{zone:"utc"}).setZone(this.getTimezone()).toISO()},emitValue:function(e){var t=ou.DateTime.fromISO(e).toUTC().toISO();this.$emit("input",t)}}},Zu=Ju,Ku=fr(Zu,Xu,Yu,!1,null,null,null),Qu=Ku.exports,eh=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("label",[e._v(e._s(e.$t("Recurring loop repeats at time interval set below")))]),t("b-input-group",[t("b-form-input",{staticClass:"form-control control repeat",attrs:{type:"number",min:"1","data-test":e.repeatInput},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-input-group-append",[t("b-form-select",{attrs:{"data-test":"periods"},model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},e._l(e.periods,(function(n){return t("option",{key:n.name,domProps:{value:n}},[e._v(e._s(e.$t(n.name)))])})),0)],1)],1),e.periodicity&&e.periodicity.isWeek?t("weekday-select",{staticClass:"pt-3",attrs:{selectWeekdays:e.selectedWeekdays,periodicityValue:e.periodicity.value,repeat:e.repeat},model:{value:e.expression,callback:function(t){e.expression=t},expression:"expression"}}):e._e()],1)},th=[],nh={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},rh={components:{WeekdaySelect:gu},props:["value","repeatInput"],data:function(){var e=[{name:nh.minute,value:"M",isTime:!0},{name:nh.hour,value:"H",isTime:!0},{name:nh.day,value:"D"},{name:nh.week,value:"W",isWeek:!0},{name:nh.month,value:"M"}];return{DateTime:ou.DateTime,repeat:null,periodicity:null,expression:null,periods:e,selectedWeekdays:null}},watch:{value:{handler:function(e){this.periodicity=this.getPeriodFromDelayString(e),this.repeat=this.getRepeatNumberFromDelayString(e),this.selectedWeekdays=this.getSelectedWeekdaysFromDelayString(e)},immediate:!0},cycleExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{cycleExpression:function(){return this.periodicity.isTime?"R/PT".concat(this.repeat).concat(this.periodicity.value):this.periodicity.isWeek&&this.expression?this.expression:"R/P".concat(this.repeat).concat(this.periodicity.value)}},methods:{getSelectedWeekdaysFromDelayString:function(e){var t=e.split("|"),n=[];return t.forEach((function(e){var t=e.match(/R(\d*)\/([^/]+)\/PT?(\d+)(\w)(?:\/([^/]+))?/);if(t){var r=ou.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.push(r)}})),n},getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var r=t?nh.minute:nh.month;return this.periods.find((function(e){var t=e.name;return t===r}))}return this.periods.find((function(e){var t=e.value;return t===n}))},isTimePeriod:function(e){return"T"===e[3]},getRepeatNumberFromDelayString:function(e){var t=e.match(/PT?(\d+)/);return t?t[1]:1}}},oh=rh,ih=fr(oh,eh,th,!1,null,null,null),sh=ih.exports,ah="PT1H",ch={timeDuration:"DurationExpression",timeDate:"DateTimeExpression",timeCycle:"CycleExpression"},lh={props:{value:{type:Object},typeHelper:{type:String,default:"Select the type of delay"}},components:{DurationExpression:$u,DateTimeExpression:Qu,CycleExpression:sh},computed:{component:function(){return ch[this.timerPropertyName]},timerProperty:{get:function(){return this.value.body},set:function(e){this.emitChange(this.value.type,e)}},timerPropertyName:function(){return this.value.type}},methods:{changeType:function(e){var t=this.isDelayType(e)||this.isCycleType(e)?ah:ou.DateTime.local().toUTC().toISO();this.emitChange(e,t)},isDelayType:function(e){return ch[e]===ch.timeDuration},isCycleType:function(e){return ch[e]===ch.timeCycle},emitChange:function(e,t){this.$emit("input",{type:e,body:t})}}},dh=lh,uh=fr(dh,Lu,ju,!1,null,null,null),hh=uh.exports,ph="processmaker-modeler-intermediate-catch-timer-event",fh={id:ph,component:Bu,bpmnType:"bpmn:IntermediateCatchEvent",control:!0,category:"BPMN",icon:f(58455),label:"Intermediate Event",rank:20,items:[{icon:f(24462),label:"Intermediate Timer Event",control:!0,rank:21,id:"processmaker-modeler-intermediate-catch-timer-event"},{icon:f(48351),label:"Intermediate Signal Catch Event",control:!0,rank:22,id:"processmaker-modeler-intermediate-signal-catch-event"},{icon:f(20894),label:"Intermediate Signal Throw Event",control:!0,rank:23,id:"processmaker-modeler-intermediate-signal-throw-event"},{icon:f(5294),label:"Intermediate Message Catch Event",control:!0,rank:24,id:"processmaker-modeler-intermediate-message-catch-event"},{icon:f(16383),label:"Intermediate Message Throw Event",control:!0,rank:25,id:"processmaker-modeler-intermediate-message-throw-event"},{icon:f(74726),label:"Intermediate Conditional Catch Event",control:!0,rank:26,id:"processmaker-modeler-intermediate-conditional-catch-event"}],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[ph]),eventDefinitions:[e.create("bpmn:TimerEventDefinition",{timeDuration:e.create("bpmn:Expression",{body:ah})})]})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=Object.keys(o[0])[1],s=o[0][i].body;e[r]={type:i,body:s}}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=o.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,r.create("bpmn:Expression",{body:c})),u=[r.create("bpmn:TimerEventDefinition",d)];n(t,"eventDefinitions",u),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:u})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{name:lo[ph],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-timer-config"},items:[{component:"FormInput",config:_a}]},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-intermediate-timer-event-timing-control"},items:[{component:hh,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Va,Na]}]};function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#000",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#fff";return{image:{width:20,height:20,y:3,x:3},body:{stroke:e,strokeWidth:t,fill:n},body2:{stroke:e,strokeWidth:t,fill:n}}}var gh,vh,bh,yh,wh,xh,kh,Ch,Sh,Eh,Ah=f(89454),_h=f.n(Ah),Th={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:_h()}},mounted:function(){var e=mh(Ge,2,We);this.shape.attr(e)}},Mh=Th,Ph=fr(Mh,gh,vh,!1,null,null,null),Ih=Ph.exports,Oh={id:"processmaker-modeler-intermediate-message",component:Pu,bpmnType:"bpmn:IntermediateEvent",control:!0,category:"BPMN",label:"Intermediate Message Event",definition:function(e,t){return e.create("bpmn:IntermediateEvent",{name:t("Intermediate Message Event"),eventDefinitions:[e.create("bpmn:MessageEventDefinition",{})]})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:"Intermediate Message Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-message-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Dh="processmaker-modeler-intermediate-message-catch-event",Nh=ac()(ho()(Oh),Qr(Qr({},ql),{},{id:Dh,component:Ih,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[Dh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[Dh]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Message that will catch this intermediate event")]}]}]})),Rh=f(74225),Bh=f.n(Rh),Lh={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Bh()}},mounted:function(){this.shape.attr({image:{"ref-x":7,"ref-y":5,width:22,height:22}})}},jh=Lh,Fh=fr(jh,bh,yh,!1,null,null,null),zh=Fh.exports,Uh={id:"processmaker-modeler-intermediate-event",component:Pu,bpmnType:"bpmn:IntermediateEvent",control:!0,category:"BPMN",label:"Intermediate Event",definition:function(e,t){return e.create("bpmn:IntermediateEvent",{name:t("Intermediate Event")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:"Intermediate Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},qh="processmaker-modeler-intermediate-signal-catch-event",Vh=ac()(ho()(Uh),Qr(Qr({},od),{},{id:qh,component:zh,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[qh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[qh]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Signal that will catch this intermediate event",!1),{component:"FormInput",config:Fd}]}]}]})),Hh=f(98358),Wh=f.n(Hh),Gh={extends:Pu,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{message:this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),nodeIcon:Wh()}},methods:{addMessageRef:function(){this.node.definition.get("eventDefinitions")[0].messageRef?this.message=this.node.definition.get("eventDefinitions")[0].messageRef:(this.message=this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),this.rootElements.push(this.message),this.node.definition.get("eventDefinitions")[0].messageRef=this.message)}},mounted:function(){this.shape.attr({image:{width:22,height:20,y:3,x:2}}),this.addMessageRef()},destroyed:function(){Cs()(this.rootElements,this.message),Un.commit("removeMessageRef",this.message)}},$h=Gh,Xh=fr($h,wh,xh,!1,null,null,null),Yh=Xh.exports,Jh="processmaker-modeler-intermediate-message-throw-event",Zh=ac()(ho()(Oh),Qr(Qr({},ql),{},{id:Jh,component:Yh,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:lo[Jh],icon:f(16383),definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(lo[Jh]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Select the message reference that this element throws")]}]}]})),Kh=f(67471),Qh=f.n(Kh),ep={extends:Pu,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{nodeIcon:Qh()}},mounted:function(){this.shape.attr({image:{"ref-x":7,"ref-y":5,width:22,height:22}})}},tp=ep,np=fr(tp,kh,Ch,!1,null,null,null),rp=np.exports,op="processmaker-modeler-intermediate-signal-throw-event",ip=ac()(ho()(Uh),Qr(Qr({},od),{},{id:op,component:rp,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:lo[op],definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(lo[op]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Select the signal reference that this element throws")]}]}]})),sp=f(94081),ap=f.n(sp),cp={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.attr({image:{"ref-x":9,"ref-y":9,width:e.get("width")-18,height:e.get("height")-18}})}},lp=cp,dp=fr(lp,Sh,Eh,!1,null,null,null),up=dp.exports;function hp(){return[{component:"FormInput",config:{label:"Condition",name:"condition",helper:"Expression to evaluate condition"}}]}var pp={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return"eventDefinitions"===r?e.condition=o[0].get("condition").body:e[r]=o,e}),{})},inspectorHandler:function(e,t,n){for(var r in lc()(e,["$type","eventDefinitions"]))t.definition[r]!==e[r]&&("condition"===r?(t.definition.get("eventDefinitions")[0].get("condition").body=e[r],window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]})):(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]}),n(t,r,e[r])))}},fp="processmaker-modeler-intermediate-conditional-catch-event",mp=ac()(ho()(Uh),Qr(Qr({},pp),{},{id:fp,component:up,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[fp],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[fp]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),gp=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"boundary-event-dropdown-data":e.boundaryEventDropdownData,"dropdown-data":e.dropdownData,"hide-color-dropdown":e.hideColorDropdown,showCustomIconPicker:!0,iconName:this.iconName},on:{"set-custom-icon-name":e.setCustomIconName,"reset-custom-icon-name":e.resetCustomIconName}},e.$listeners))},vp=[],bp=F.shapes.standard.Rectangle.extend({markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.task.Shape",size:{width:100,height:60},attrs:Qr(Qr(Qr(Qr(Qr(Qr({image:{"ref-x":4,"ref-y":4,ref:"rect",width:16,height:16,"data-test":"nodeIcon"}},Qs("topLeft",{"ref-y":4,ref:"rect"})),Qs("topCenter",{"ref-y":4,ref:"rect"})),Qs("topRight",{"ref-y":4,"ref-x":96,ref:"rect"},-1)),Qs("bottomLeft",{ref:"rect"})),Qs("bottomCenter",{ref:"rect"})),Qs("bottomRight",{"ref-x":96,ref:"rect"},-1))},F.shapes.standard.Rectangle.prototype.defaults)}),yp=76,wp=116,xp={data:function(){return{iconName:""}},watch:{shape:function(){this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},methods:{setCustomIconName:function(e){this.iconName=e},resetCustomIconName:function(){this.setCustomIconName("")},setCustomIcon:function(e){if(this.shape)try{var t=atob(e);this.updateIcon(t)}catch(n){this.updateIcon(e)}},updateIcon:function(e){var t=this.getIconURL(e);this.shape.attr("image/xlink:href",t)},getIconURL:function(e){return ec(e,this.node)}},mounted:function(){this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},kp=10,Cp=[{label:"Boundary Timer Event",nodeType:"processmaker-modeler-boundary-timer-event",dataTest:"add-boundary-timer-event"},{label:"Boundary Error Event",nodeType:"processmaker-modeler-boundary-error-event",dataTest:"add-boundary-error-event"},{label:"Boundary Signal Event",nodeType:"processmaker-modeler-boundary-signal-event",dataTest:"add-boundary-signal-event"},{label:"Boundary Conditional Event",nodeType:"processmaker-modeler-boundary-conditional-event",dataTest:"add-boundary-conditional-event"},{label:"Boundary Message Event",nodeType:"processmaker-modeler-boundary-message-event",dataTest:"add-boundary-message-event"}],Sp=Cp,Ep=f.p+"img/sequential.f86ad08b.svg",Ap=f.p+"img/parallel.cf1d1995.svg",_p=f.p+"img/loop.00441d9f.svg",Tp="bpmn:StandardLoopCharacteristics",Mp="bpmn:MultiInstanceLoopCharacteristics";function Pp(e,t,n,r){var o=e.get("loopCharacteristics"),i=[Tp,Mp];if(o&&i.includes(o.$type))if(o.$type!==Tp){var s=o.isSequential?Ep:Ap;n(t.bottomCenter,"loopCharacteristics",s)}else n(t.bottomCenter,"loopCharacteristics",_p);else r(t.bottomCenter,"loopCharacteristics")}var Ip=f.p+"img/compensation.495ae0a2.svg";function Op(e,t,n,r){e.isForCompensation?n(t.bottomCenter,"compensation",Ip):r(t.bottomCenter,"compensation")}var Dp,Np,Rp=15,Bp=2*Zs,Lp={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs,xp],data:function(){return{shape:null,definition:null,dropdownData:[{label:io["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:io["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:io["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:io["processmaker-modeler-call-activity"],nodeType:"processmaker-modeler-call-activity",dataTest:"switch-to-sub-process"}],boundaryEventDropdownData:Sp,anchorPointFunction:Pt,hideColorDropdown:!1}},computed:{hasTaskMarker:function(){return!!this.shape.attr("image/xlink:href")}},watch:{"node.definition.name":function(e){var t=this.node.diagram.bounds.width;this.shape.attr("label/text",F.util.breakText(e,{width:t}));var n=this.shape.size(),r=n.height,o=this.calculateSizeOnGrid(),i=this.useTaskHeight(o)?yp:o;r!==i&&(this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment())},"node.definition.isForCompensation":function(){Op(this.node.definition,this.markers,this.$set,this.$delete)},"node.definition":{deep:!0,handler:function(){Pp(this.node.definition,this.markers,this.$set,this.$delete)}}},methods:{getElementsUnderArea:function(e){var t=e.getBBox(),n=t.x,r=t.y,o=t.width,i=t.height,s={x:n,y:r,width:o,height:i};return this.graph.findModelsInArea(s)},calculateSizeOnGrid:function(){var e=kp-yp%kp,t=Math.floor(this.shapeView.selectors.label.getBBox().height),n=t+Rp+Bp,r=this.paperManager.ceilToNearestGridMultiple(n)-e;return this.middleIsOddNumber(r)&&(r+=kp),r},useTaskHeight:function(e){return e<yp||!this.node.definition.name},middleIsOddNumber:function(e){return 1===Math.abs(e/2%2)}},mounted:function(){this.shape=new bp;var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),Op(this.node.definition,this.markers,this.$set,this.$delete),Pp(this.node.definition,this.markers,this.$set,this.$delete),this.shape.attr({body:{rx:8,ry:8},label:{text:F.util.breakText(this.node.definition.get("name"),{width:e.width}),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this}},jp=Lp,Fp=fr(jp,gp,vp,!1,null,null,null),zp=Fp.exports,Up=f(95514),qp=f.n(Up),Vp={extends:zp,mixins:[tc],data:function(){return{nodeIcon:qp()}}},Hp=Vp,Wp=fr(Hp,Dp,Np,!1,null,null,null),Gp=Wp.exports,$p=function(){var e=this,t=e._self._c;return t("div",[t("b-form-group",[t("b-form-checkbox",{attrs:{"data-test":"for-compensation",name:"for-compensation"},model:{value:e.isForCompensation,callback:function(t){e.isForCompensation=t},expression:"isForCompensation"}},[e._v(e._s(e.$t("For Compensation")))])],1)],1)},Xp=[],Yp={props:{value:{type:Object,default:function(){return{isForCompensation:!1}}}},name:"MarkerFlags",data:function(){return{isForCompensation:this.value.isForCompensation}},watch:{isForCompensation:function(e){this.$emit("input",{isForCompensation:e})}}},Jp=Yp,Zp=fr(Jp,$p,Xp,!1,null,"66aabb37",null),Kp=Zp.exports,Qp={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Da,config:Ns},{component:Kp,name:"taskMarkers",config:{label:"Marker Flags",name:"markerFlags",style:"display:none"}}]},ef=function(){var e=this,t=e._self._c;return t("div",[t("b-form-group",{attrs:{label:e.$t("Loop Mode")}},[t("b-form-select",{attrs:{id:""},on:{change:e.changeLoopType},model:{value:e.loopType,callback:function(t){e.loopType=t},expression:"loopType"}},e._l(e.loopOptions,(function(n){return t("option",{key:n.text,domProps:{value:n.value}},[e._v(e._s(e.$t(n.text)))])})),0)],1),"loop"===e.loopType?[t("b-form-group",{attrs:{label:e.$t("Maximum Iterations")}},[t("b-form-input",{attrs:{type:"number",min:"0",step:"1","data-cy":"loopMaximum"},on:{input:e.changeLoopMaximum},model:{value:e.loopMaximum,callback:function(t){e.loopMaximum=t},expression:"loopMaximum"}}),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Leave empty to continue until exit condition is satisfied")))])],1),t("b-form-group",{attrs:{label:e.$t("Exit Condition")}},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.loopCondition,expression:"loopCondition"}],ref:"specialAssignmentsInput",staticClass:"form-control special-assignment-input",attrs:{"aria-label":e.$t("FEEL Syntax"),placeholder:"FEEL Syntax","data-cy":"loopCondition"},domProps:{value:e.loopCondition},on:{input:[function(t){t.target.composing||(e.loopCondition=t.target.value)},e.changeLoopCondition]}}),e._v(" "),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("When FEEL expression evaluates to true then exit loop")))])])]:e._e(),"parallel_mi"===e.loopType||"sequential_mi"===e.loopType?["inputData"===e.multiType?t("b-form-group",{attrs:{id:"group-inputData",label:e.$t("Request Variable Array"),"label-for":"inputData",description:e.$t("Non-array data will result in an error.")}},[t("b-form-input",{attrs:{id:"inputData",type:"text",placeholder:e.$t("Request Variable Name")},on:{input:e.changeInputData},model:{value:e.inputData,callback:function(t){e.inputData=t},expression:"inputData"}})],1):e._e(),"sequential_mi"===e.loopType?t("b-form-group",{attrs:{id:"group-exit-condition",label:e.$t("Exit Condition"),"label-for":"exit-condition",description:e.$t("When the FEEL Expression evaluates to true then exit the loop")}},[t("b-form-textarea",{attrs:{id:"exit-condition",placeholder:e.$t("FEEL Syntax")},on:{input:e.changeCompletionCondition},model:{value:e.completionCondition,callback:function(t){e.completionCondition=t},expression:"completionCondition"}})],1):e._e(),t("b-form-group",{attrs:{id:"group-outputData",label:e.$t("Output Data Variable"),"label-for":"outputData",description:e.$t("Specifies the output request data variable array, which will be produced as a result of the multi-instance.")}},[t("b-form-input",{attrs:{id:"outputData",type:"text",placeholder:e.$t("Request Variable Name")},on:{input:e.changeOutputData},model:{value:e.outputData,callback:function(t){e.outputData=t},expression:"outputData"}})],1)]:e._e()],2)},tf=[],nf={props:{value:{type:Object,default:function(){return{loopCharacteristics:null,ioSpecification:null}}}},name:"LoopCharacteristics",data:function(){return{loopOptions:[{text:this.$t("No Loop Mode"),value:"no_loop"},{text:this.$t("Loop"),value:"loop"},{text:this.$t("Multi-Instance (Parallel)"),value:"parallel_mi"},{text:this.$t("Multi-Instance (Sequential)"),value:"sequential_mi"}],showAdvanced:!1,previous:{loopCardinality:"3",completionCondition:null,inputData:null,outputData:null,inputDataItem:null},local:{loopCharacteristics:{$type:null,isSequential:!1},loopMaximum:0,loopCondition:null,ioSpecification:{dataInputs:[]}},loopType:null,multiType:null,loopCardinality:null,completionCondition:null,inputData:null,inputDataItem:null,outputData:null,outputDataItem:null,loopMaximum:0,loopCondition:null}},mounted:function(){this.loadData()},watch:{value:{deep:!0,handler:function(e){(0,Er.isEqual)(this.local,e)||this.loadData()}}},methods:{changeLoopMaximum:function(e){this.setLoopMaximum(e),this.saveData()},changeLoopCondition:function(){this.setLoopCondition(this.loopCondition),this.saveData()},changeLoopType:function(e){this.setLoopCharacteristics(e),this.saveData()},changeMultiType:function(e){this.setMultiType(e),this.saveData()},changeLoopCardinality:function(e){this.setLoopCardinality(e),this.saveData()},changeCompletionCondition:function(e){this.setCompletionCondition(e),this.saveData()},changeInputData:function(e){this.setLoopDataInputRef(e),this.saveData()},changeInputDataItem:function(e){this.setInputDataItem(e),this.saveData()},changeOutputData:function(e){this.setLoopDataOutputRef(e),this.saveData()},changeOutputDataItem:function(e){this.setOutputDataItem(e),this.saveData()},loadData:function(){this.$set(this,"local",(0,Er.cloneDeep)(this.value)),this.loopType=this.getLoopCharacteristics(),this.multiType=this.getMultiType(),this.loopCardinality=this.getLoopCardinality(),this.completionCondition=this.getCompletionCondition(),this.inputData=this.getLoopDataInputRef(),this.inputDataItem=this.getInputDataItem(),this.outputData=this.getLoopDataOutputRef(),this.outputDataItem=this.getOutputDataItem(),this.previous.inputData=this.inputData,this.previous.outputData=this.outputData,this.previous.loopCardinality=this.loopCardinality,this.loopMaximum=this.getLoopMaximum(),this.loopCondition=this.getLoopCondition()},saveData:function(){(0,Er.isEqual)(this.local,this.value)||this.$emit("input",(0,Er.cloneDeep)(this.local))},getOutputDataItem:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.outputDataItem?this.local.loopCharacteristics.outputDataItem.name:null},setOutputDataItem:function(e){this.local.loopCharacteristics.outputDataItem={$type:"bpmn:DataInput",isCollection:!0,name:e}},getLoopDataOutputRef:function(){var e;return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopDataOutputRef?null===(e=this.local.ioSpecification)||void 0===e?void 0:e.dataOutputs[0].name:null},setLoopDataOutputRef:function(e){this.local.ioSpecification||this.initIoSpecification();var t=this.local.ioSpecification.dataOutputs[0]||{$type:"bpmn:DataOutput",id:"".concat(this.local.id,"_output_1"),isCollection:!0,name:e};t.name=e,this.local.ioSpecification.dataOutputs=[t],this.local.ioSpecification.outputSets[0].dataOutputRefs=[t.id],this.local.loopCharacteristics.loopDataOutputRef=t.id},getInputDataItem:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.inputDataItem?this.local.loopCharacteristics.inputDataItem.name:null},setInputDataItem:function(e){this.local.loopCharacteristics.inputDataItem={$type:"bpmn:DataInput",isCollection:!0,name:e}},getLoopDataInputRef:function(){var e;return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopDataInputRef?null===(e=this.local.ioSpecification)||void 0===e?void 0:e.dataInputs[0].name:null},setLoopDataInputRef:function(e){var t={$type:"bpmn:DataInput",id:"".concat(this.local.id,"_input_1"),isCollection:!0,name:e};this.local.ioSpecification||this.initIoSpecification(),this.local.ioSpecification.dataInputs=[t],this.local.ioSpecification.inputSets[0].dataInputRefs=[t.id],this.local.loopCharacteristics.loopDataInputRef=t.id},initIoSpecification:function(){this.local.ioSpecification={$type:"bpmn:InputOutputSpecification",dataInputs:[],dataOutputs:[],inputSets:[{$type:"bpmn:InputSet",dataInputRefs:[]}],outputSets:[{$type:"bpmn:OutputSet",dataOutputRefs:[]}]}},getLoopCardinality:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopCardinality?this.local.loopCharacteristics.loopCardinality.body:null},getCompletionCondition:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.completionCondition?this.local.loopCharacteristics.completionCondition.body:null},setLoopCardinality:function(e){this.local.loopCharacteristics.loopCardinality={$type:"bpmn:Expression",body:e}},setCompletionCondition:function(e){this.local.loopCharacteristics.completionCondition={$type:"bpmn:Expression",body:e}},getMultiType:function(){return this.local.loopCharacteristics?void 0!==this.local.loopCharacteristics.loopCardinality?"loopCardinality":"inputData":null},setMultiType:function(e){"loopCardinality"===e?(this.local.loopCharacteristics.loopCardinality={$type:"bpmn:Expression",body:this.previous.loopCardinality||"3"},this.local.loopCharacteristics.completionCondition={$type:"bpmn:Expression",body:this.previous.completionCondition||""},this.previous.inputData=this.inputData,this.previous.outputData=this.outputData,this.previous.inputDataItem=this.inputDataItem,delete this.local.loopCharacteristics.loopDataInputRef,delete this.local.loopCharacteristics.inputDataItem,this.setLoopDataOutputRef(this.previous.outputData||"output_array_".concat(this.local.id))):(this.previous.loopCardinality=this.loopCardinality,this.previous.completionCondition=this.completionCondition,this.previous.outputData=this.outputData,delete this.local.loopCharacteristics.loopCardinality,delete this.local.loopCharacteristics.completionCondition,this.local.loopCharacteristics.loopDataInputRef="",this.setLoopDataInputRef(this.previous.inputData||"source_array"),this.setLoopDataOutputRef(this.previous.outputData||"output_array_".concat(this.local.id)),this.setInputDataItem(this.previous.inputDataItem||"")),this.loopCardinality=this.getLoopCardinality(),this.completionCondition=this.getCompletionCondition(),this.inputData=this.getLoopDataInputRef(),this.outputData=this.getLoopDataOutputRef()},getLoopCharacteristics:function(){return this.local.loopCharacteristics?"bpmn:StandardLoopCharacteristics"===this.local.loopCharacteristics.$type?"loop":"bpmn:MultiInstanceLoopCharacteristics"===this.local.loopCharacteristics.$type?this.local.loopCharacteristics.isSequential?"sequential_mi":"parallel_mi":"no_loop":"no_loop"},setLoopCharacteristics:function(e){switch(this.local.loopCharacteristics||(this.local.loopCharacteristics={}),e){case"no_loop":this.local.loopCharacteristics=void 0;break;case"loop":this.local.loopCharacteristics.$type="bpmn:StandardLoopCharacteristics";break;case"parallel_mi":this.local.loopCharacteristics.$type="bpmn:MultiInstanceLoopCharacteristics",this.local.loopCharacteristics.isSequential=!1,this.multiType||(this.multiType="inputData");break;case"sequential_mi":this.local.loopCharacteristics.$type="bpmn:MultiInstanceLoopCharacteristics",this.local.loopCharacteristics.isSequential=!0,this.multiType||(this.multiType="inputData");break}},setLoopMaximum:function(e){e||(e=null),this.local.loopCharacteristics.loopMaximum=e},getLoopMaximum:function(){return this.local.loopCharacteristics?this.local.loopCharacteristics.loopMaximum:null},setLoopCondition:function(e){this.local.loopCharacteristics.loopCondition={$type:"bpmn:Expression",body:e}},getLoopCondition:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopCondition?this.local.loopCharacteristics.loopCondition.body:null}}},rf=nf,of=fr(rf,ef,tf,!1,null,null,null),sf=of.exports,af=(f(19601),function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d(this,e),this.index=window.NODE_INSPECTOR_FIRST_INDEX||(new Date).getTime(),this.definitions=t,this.nodeIdGenerator=B(this.definitions),this.options=Object.assign({prefix:this.nodeIdGenerator.generate()[0]},n),this.createdModdleNodes={}}return g(e,[{key:"getDefinitionProps",value:function(e){var t=this;return e instanceof Array?e.map((function(e){return t.getDefinitionProps(e)})):e instanceof Object?Object.getOwnPropertyNames(e).reduce((function(n,r){if(e[r]instanceof Function)return n;var o="Ref"===r.substr(r.length-3)||"Refs"===r.substr(r.length-4);return e[r]instanceof Object&&e[r].id&&o?n[r]=Object&&e[r].id:e[r]instanceof Array&&o?n[r]=e[r].filter((function(e){return e})).map((function(e){return e.id})):("$type"===r||"$"!==r.substr(0,1)&&"__"!==r.substr(0,2))&&(n[r]=t.getDefinitionProps(e[r])),n}),{}):e}},{key:"setDefinitionProps",value:function(e,t,n,r,o){var i=this;if(void 0!==e){if(e instanceof Array)e=e.map((function(e){return i.setDefinitionProps(e,t,n)}));else if(e instanceof Object)try{e=Object.keys(lc()(e,"$type","$config","markerFlags")).reduce((function(r,o){var s=i.setDefinitionProps(e[o],t,n,void 0,o);return null!==s&&void 0!==s?r[o]=s:void 0===s&&delete r[o],r}),r||this.createModdleNode(n,e))}catch(s){throw'Unable to create moddle node of type "'.concat(e.$type,'" \n ').concat(s)}return r&&void 0!==o&&void 0!==e&&null!==e&&(r[o]=e),e}}},{key:"createModdleNode",value:function(e,t){var n=e.create(t.$type,{id:this.generateId()});return t.id&&(this.createdModdleNodes[t.id]=n),n}},{key:"setReferences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(void 0!==e)return this.isReference(n)?e=e instanceof Array?e.map((function(e){return t.findReference(e)})):this.findReference(e):e instanceof Array?e=e.map((function(e){return t.setReferences(e,null)})):e instanceof Object&&Object.keys(lc()(e,"$type","$config","markerFlags")).forEach((function(n){e[n]=t.setReferences(e[n],n)})),e}},{key:"isReference",value:function(e){return!!e&&("Ref"===e.substr(e.length-3)||"Refs"===e.substr(e.length-4))}},{key:"findReference",value:function(e){return this.createdModdleNodes[e]||this.findById(e)}},{key:"generateId",value:function(){return this.index++,"".concat(this.options.prefix,"_").concat(this.index)}},{key:"findById",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.definitions.rootElements,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!(r.indexOf(n)>-1)){var o;if(n instanceof Array)r.push(n),n.find((function(n){return o=t.findById(e,n,r)}));else if(n instanceof Object&&n.$type){if(r.push(n),n.id===e)return n;Object.getOwnPropertyNames(n).find((function(i){return o=!(n[i]instanceof Function)&&t.findById(e,n[i],r)}))}return o}}}]),e}()),cf=function(e,t,n,r,o,i){var s=new af(o,{prefix:"".concat(t.definition.id,"_inner")}),a=s.setDefinitionProps(e.$loopCharactetistics,n,r,{});return a=s.setReferences(a),a.loopCharacteristics?(delete t.definition.loopCharacteristics,i&&window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"loopCharacteristics",value:a.loopCharacteristics}),n(t,"loopCharacteristics",a.loopCharacteristics)):(t.definition.loopCharacteristics=null,delete t.definition.loopCharacteristics),a.ioSpecification?(delete t.definition.ioSpecification,n(t,"ioSpecification",a.ioSpecification)):delete t.definition.ioSpecification,lc()(e,["$loopCharactetistics"])},lf=function(e,t,n,r){var o=r.definitions,i=new af(o);e.$loopCharactetistics=i.getDefinitionProps({id:t.definition.id,loopCharacteristics:t.definition.loopCharacteristics,ioSpecification:t.definition.ioSpecification}),delete e.loopCharacteristics,delete e.ioSpecification},df={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Loop Activity",icon:"redo",name:"loop-characteristics-accordion"},items:[{component:sf,name:"LoopCharactetistics",config:{name:"$loopCharactetistics"}}]},uf="processmaker-modeler-task",hf={id:"processmaker-modeler-task",component:zp,bpmnType:["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:SubProcess"],control:!0,category:"BPMN",rank:40,icon:f(45849),label:"Task",items:[{icon:f(45849),label:"Form Task",control:!0,rank:41,id:"processmaker-modeler-task"},{icon:f(24678),label:"Manual Task",control:!0,rank:42,id:"processmaker-modeler-manual-task"},{icon:f(37901),label:"Script Task",control:!0,rank:43,id:"processmaker-modeler-script-task"},{icon:f(47356),label:"Sub Process",control:!0,rank:44,id:"processmaker-modeler-call-activity"}],definition:function(e,t){return e.create("bpmn:Task",{name:t(io[uf]),assignment:"requester"})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorHandler:function(e,t,n,r,o,i,s){pf(e.markerFlags,t,n),cf(e,t,n,r,o,s),i(lc()(e,"markerFlags","$loopCharactetistics"),s)},inspectorData:function(e,t,n){var r=t(e);return lf(r,e,t,n),r.markerFlags={isForCompensation:r.isForCompensation},delete r.isForCompensation,r},inspectorConfig:[{name:io[uf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-task"},items:[{component:"FormInput",config:_a}]},df,Va,Qp]}],loopCharacteristicsHandler:cf,loopCharacteristicsData:lf};function pf(e,t,n){if(e){var r=t.definition.get("isForCompensation"),o=e.isForCompensation;null!=o&&o!==r&&n(t,"isForCompensation",o)}}var ff,mf,gf=Qr(Qr({},hf),{},{component:Gp}),vf=(f(38862),function(){var e=this,t=e._self._c;return t("div",[t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"boundary-event-dropdown-data":e.boundaryEventDropdownData,"dropdown-data":e.dropdownData,showCustomIconPicker:!0,iconName:this.iconName},on:{"set-custom-icon-name":e.setCustomIconName,"reset-custom-icon-name":e.resetCustomIconName}},e.$listeners)),t("b-modal",{ref:"subprocess-modal",attrs:{title:"Previewing '".concat(e.subprocessName,"'")},scopedSlots:e._u([{key:"modal-footer",fn:function(){return[t("a",{attrs:{href:e.subprocessLink,target:"_blank","data-test":"modal-process-link"}},[e._v(" Open subprocess in new window "),t("i",{staticClass:"ml-1 fas fa-external-link-alt"})])]},proxy:!0}])},[e.subProcessSvg?t("div",{staticClass:"text-center",domProps:{innerHTML:e._s(e.subProcessSvg)}}):e.failedToLoadPreview?t("div",[e._v("Could not load preview")]):t("div",[t("i",{staticClass:"fas fa-spinner fa-spin"}),e._v(" Loading process preview...")])]),t("b-modal",{ref:"no-subprocess-modal",attrs:{title:"No subprocess selected","hide-footer":!0}},[e._v(" Please select a subprocess to view it. ")])],1)}),bf=[],yf=f.p+"img/subprocess.19c191a3.svg",wf=15,xf=2*Zs,kf='<svg version="1.1"\n baseProfile="full"\n width="16" height="16"\n xmlns="http://www.w3.org/2000/svg"></svg>',Cf={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering","paperManager"],mixins:[xa,xt,fa,Fs,tc,xp],data:function(){return{subProcessSvg:null,failedToLoadPreview:!1,boundaryEventDropdownData:Sp,dropdownData:[{label:io["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:io["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:io["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:io["processmaker-modeler-call-activity"],nodeType:"processmaker-modeler-call-activity",dataTest:"switch-to-sub-process"}],nodeIcon:kf,iconName:"",anchorPointFunction:Pt}},computed:{subprocessId:function(){return JSON.parse(this.node.definition.get("config")).processId},subprocessLink:function(){return"/modeler/".concat(this.subprocessId)},subprocessName:function(){return this.node.definition.get("name")}},watch:{"node.definition.name":function(e){var t=this.node.diagram.bounds.width;this.shape.attr("label/text",F.util.breakText(e,{width:t}));var n=this.shapeView.selectors.label.getBBox().height,r=this.shape.size(),o=r.height;if(n+wf+xf!==o){var i=Math.max(n+wf+xf,yp);this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment()}},"node.definition.config":function(e){Un.commit("updateNodeProp",{node:this.node,key:"config",value:e}),this.$emit("save-state")},"node.definition.callActivityType":function(e){this.shape.attr("image/display","globalTask"===e?"none":"initial")},"node.definition.loopCharacteristics":function(){Pp(this.node.definition,this.markers,this.$set,this.$delete)}},methods:{clickSubprocess:function(e,t){var n=this,r="bottomCenter.0"===t.target.getAttribute("joint-selector"),o=e.model===this.shape;r&&o&&(this.subprocessId?(this.$refs["subprocess-modal"].show(),this.subProcessSvg=null,this.failedToLoadPreview=!1,window.ProcessMaker.apiClient.get("/processes/".concat(this.subprocessId),{params:{include:"svg"}}).then((function(e){var t=e.data;if(t.svg){var r=function(e){return e.replace('<svg width="100%"',"<svg ")},o=function(e){return e.replace("<svg ",'<svg class="border border-dark"')};n.subProcessSvg=o(r(t.svg))}else n.failedToLoadPreview=!0})).catch((function(){n.failedToLoadPreview=!0}))):this.$refs["no-subprocess-modal"].show())}},mounted:function(){this.shape=new bp,this.$set(this.markers.bottomCenter,"subprocess",yf);var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),Pp(this.node.definition,this.markers,this.$set,this.$delete),this.shape.attr({body:{rx:8,ry:8,strokeWidth:4},label:{text:F.util.breakText(this.node.definition.get("name"),{width:e.width}),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this,this.paperManager.addEventHandler("element:pointerclick",this.clickSubprocess),this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},Sf=Cf,Ef=fr(Sf,vf,bf,!1,null,null,null),Af=Ef.exports,_f=function(){var e=this,t=e._self._c;return t("div",[t("form-multi-select",{staticClass:"p-0 mb-2",attrs:{label:e.$t("Process"),name:"Process",helper:e.$t("Select which Process this element calls"),showLabels:!1,"allow-empty":!1,options:e.processList,loading:e.loading,optionContent:"name",validation:e.validation,searchable:!0,"internal-search":!1,"preserve-search":!1,"clear-on-select":!1},on:{"search-change":e.searchChange},model:{value:e.selectedProcess,callback:function(t){e.selectedProcess=t},expression:"selectedProcess"}}),e.selectedProcess?t("form-multi-select",{staticClass:"p-0 mb-2",attrs:{label:e.$t("Start Event"),name:"StartEvent",disabled:0===e.startEventList.length,"allow-empty":!1,showLabels:!1,options:e.startEventList,optionContent:"name",validation:"required"},model:{value:e.selectedStartEvent,callback:function(t){e.selectedStartEvent=t},expression:"selectedStartEvent"}}):e._e(),e.selectedProcess?t("a",{attrs:{href:"/modeler/".concat(e.selectedProcess.id),target:"_blank"}},[e._v(" "+e._s(e.$t("Open Process"))+" "),t("i",{staticClass:"ml-1 fas fa-external-link-alt"})]):e._e()],1)},Tf=[],Mf=f(45578),Pf=f.n(Mf),If={data:function(){return{selectedProcess:null,selectedStartEvent:null,config:{},name:"",loading:!1,processes:[],selectedProcessInfo:null,validation:""}},inheritAttrs:!1,props:["value"],computed:{processList:function(){var e=this,t=this.filterValidProcesses(this.processes)||[];return this.selectedProcessInfo&&!t.find((function(t){return t.id===e.selectedProcessInfo.id}))&&t.push(this.selectedProcessInfo),t},startEventList:function(){return this.selectedProcess?this.filterValidStartEvents(this.selectedProcess.events):[]},currentProcessId:function(){var e=window.location.href.match(/modeler\/(\d+)/);return e&&e[1]?parseInt(e[1]):null}},watch:{selectedProcess:function(){this.loading||(this.startEventList.length>0?this.selectedStartEvent=this.startEventList[0]:this.selectedStartEvent=null)},selectedStartEvent:function(){this.loading||this.setBpmnValues()},processList:function(){this.loadBpmnValues()},value:{handler:function(){this.config=JSON.parse(this.value),this.loadSelectedProcessInfo()},immediate:!0}},methods:{searchChange:function(e){this.loadProcessesDebounced(e)},filterValidProcesses:function(e){var t=this;return e.filter((function(e){return t.filterValidStartEvents(e.events).length>0})).filter((function(e){return e.id!==t.currentProcessId}))},filterValidStartEvents:function(e){return e.filter((function(e){if(e.eventDefinitions&&e.eventDefinitions.length>0)return!1;if(e.config)try{var t=JSON.parse(e.config);if(t.web_entry)return!1}catch(n){return!1}return!0}))},loadBpmnValues:function(){var e=this;this.config.processId&&this.config.startEvent&&(this.loading=!0,this.name=this.config.name,this.selectedProcess=this.processList.find((function(t){return t.id===e.config.processId})),this.selectedStartEvent=this.startEventList.find((function(t){return t.id===e.config.startEvent})),this.$nextTick((function(){e.selectedProcess||(e.validation="required"),e.loading=!1})))},setBpmnValues:function(){if(this.selectedProcess&&this.selectedStartEvent){var e=this.selectedProcess.name;this.startEventList.length>1&&(e+=" (".concat(this.selectedStartEvent.name,")"));var t={calledElement:"".concat(this.selectedStartEvent.ownerProcessId,"-").concat(this.selectedProcess.id),processId:this.selectedProcess.id,startEvent:this.selectedStartEvent.id,name:e},n=JSON.stringify(t);this.$emit("input",n)}},containsMultipleProcesses:function(e){return Pf()(e.events,"ownerProcessId").length>1},loadProcesses:function(e){var t=this;this.loading=!0;var n={order_direction:"asc",per_page:20,include:"events,category",filter_without_assignments:!0};e&&(n.filter=e),window.ProcessMaker.apiClient.get("processes",{params:n}).then((function(e){t.loading=!1,t.processes=e.data.data})).catch((function(){t.loading=!1}))},loadSelectedProcessInfo:function(){var e=this;this.config.processId&&window.ProcessMaker.apiClient.get("processes/"+this.config.processId,{params:{include:"events,category",filter_without_assignments:!0}}).then((function(t){e.selectedProcessInfo=t.data}))}},created:function(){var e=this;this.validation=this.config.processId?"":"required",this.loadProcessesDebounced=Y()((function(t){e.loadProcesses(t)}),500),0===this.processList.length?this.loadProcesses():this.loadBpmnValues()}},Of=If,Df=fr(Of,_f,Tf,!1,null,null,null),Nf=Df.exports,Rf="processmaker-modeler-call-activity",Bf={id:Rf,component:Af,bpmnType:"bpmn:CallActivity",control:!1,category:"BPMN",icon:f(12893),label:io[Rf],definition:function(e,t){return e.create("bpmn:CallActivity",{name:t(io[Rf]),calledElement:"",config:"{}",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorHandler:function(e,t,n){n(t,"id",e.id),n(t,"name",e.name);var r=JSON.parse(e.config);e["calledElement"]=r.calledElement,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"calledElement",value:r.calledElement}),n(t,"calledElement",r.calledElement),r.name!==e.name&&(r.name=e.name),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"config",value:JSON.stringify(r)}),n(t,"config",JSON.stringify(r))},inspectorConfig:[{name:io[Rf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-subprocess"},items:[{component:"FormInput",config:_a},{component:Nf,config:{name:"config"}}]},Va,Na]}]},Lf=f(87465),jf=f.n(Lf),Ff={extends:zp,mixins:[tc],data:function(){return{nodeIcon:jf(),iconName:""}}},zf=Ff,Uf=fr(zf,ff,mf,!1,null,null,null),qf=Uf.exports,Vf="processmaker-modeler-script-task",Hf={id:Vf,component:qf,bpmnType:"bpmn:ScriptTask",control:!1,category:"BPMN",icon:f(75763),label:io[Vf],definition:function(e,t){return e.create("bpmn:ScriptTask",{name:t(io[Vf]),scriptRef:null,loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorConfig:[{name:io[Vf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-script-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Wf=Qr(Qr({},hf),{},{id:"processmaker-modeler-service-task",bpmnType:["bpmn:ServiceTask","bpmn:SendTask","bpmn:ReceiveTask"],control:!1,label:"Service Task",definition:function(e,t){return e.create("bpmn:ServiceTask",{name:t("Service Task")})},inspectorConfig:[{name:"Service Task",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-service-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]}),Gf=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},$f=[],Xf=160,Yf={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","paperManager","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt],data:function(){return{shape:null,definition:null,nodeWidth:10}},watch:{"node.definition.text":function(e){this.updateNodeText(e)}},methods:{getLabelHeight:function(e){return this.shape.findView(this.paperManager.paper).selectors.label.getBBox().height+e},calculateNewHeight:function(e,t,n){var r=3,o=15,i=this.getLabelHeight(o);return i!==e?i-r:0===t.length?n-r:e-r},updateNodeText:function(e){var t=this,n=this.shape.findView(this.paperManager.paper).getBBox(),r=n.height,o="25 ".concat(r," 3 ").concat(r," 3 3 25 3"),i=this.node.diagram.bounds;this.shape.position(i.x,i.y),this.shape.attr({body:{refPoints:o},label:{text:F.util.breakText(e,{width:Xf}),textAnchor:"left"}}),this.paperManager.awaitScheduledUpdates().then((function(){t.shape.resize(t.nodeWidth,t.calculateNewHeight(r,e,i.height)),t.setShapeHighlight()}))}},mounted:function(){var e=this.node.diagram.bounds;this.shape=new F.shapes.standard.Polyline,this.shape.set("type","textAnnotation"),this.shape.position(e.x,e.y),this.shape.resize(this.nodeWidth,e.height),this.shape.attr({body:{refPoints:"25 10 3 10 3 3 25 3",fill:"none"},label:{fill:"black",yAlignment:"left",xAlignment:"left",refX:"5",refY:"5"}}),this.shape.addTo(this.graph),this.shape.component=this,this.updateNodeText(this.node.definition.get("text"))}},Jf=Yf,Zf=fr(Jf,Gf,$f,!1,null,null,null),Kf=Zf.exports,Qf="processmaker-modeler-text-annotation",em={id:Qf,component:Kf,bpmnType:"bpmn:TextAnnotation",control:!0,category:"BPMN",icon:f(15153),label:"Text Annotation",rank:70,definition:function(e,t){return e.create("bpmn:TextAnnotation",{text:t("Text Annotation")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:30,width:150})})},validateIncoming:function(){return!1},validateAssociationIncoming:function(){return!1},inspectorConfig:[{name:"Text Annotation",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-text-annotation"},items:[{component:"FormInput",config:{label:"Text to Show",helper:"Body of the text annotation",name:"text",placeholder:"Text Annotation"}}]},Va,Na]}]},tm=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners),[t("add-lane-above-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"crown-config__icon",attrs:{title:e.$t("Lane Above")},on:{click:e.addLaneAbove}}),t("add-lane-below-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"crown-config__icon",attrs:{title:e.$t("Lane Below")},on:{click:e.addLaneBelow}})],1)},nm=[],rm=f.p+"img/highlight-shape.5f7b1ba9.svg",om=30,im=200,sm=300,am=20,cm=300,lm=100,dm={props:["highlighted","paper","processNode","planeElements","moddle"],data:function(){return{anchorPoints:[],isResizing:!0,pointWidth:15,pointHeight:15,elementBounds:[],elementTopY:null,elementRightX:null,elementBottomY:null,elementLeftX:null}},watch:{highlighted:function(e){0!==this.anchorPoints.length&&(e?(!1===Un.getters.isReadOnly&&this.addResizeAnchors(),this.calculateElementLimits(),this.updateAnchorPointPosition()):this.removeResizeAnchors())}},computed:{poolComponent:function(){return $()(this,"node.pool.component",this)},isLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{calculateElementLimits:function(){this.elementBounds=this.poolComponent.shape.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl&&"processmaker-modeler-message-flow"!==e.component.node.type})).map((function(e){return e.getBBox()})),this.elementTopY=Math.min.apply(Math,W(this.elementBounds.map((function(e){var t=e.y;return t-am})))),this.elementBottomY=Math.max.apply(Math,W(this.elementBounds.map((function(e){var t=e.y,n=e.height;return t+n+am})))),this.elementRightX=Math.max.apply(Math,W(this.elementBounds.map((function(e){var t=e.x,n=e.width;return t+n+am})))),this.elementLeftX=Math.min.apply(Math,W(this.elementBounds.map((function(e){var t=e.x;return t-am}))))},configureResize:function(){var e=this;this.shape.listenTo(this.paper,"element:pointerup",(function(t){t.model.component&&t.model.component===e&&e.calculateElementLimits()}));var t=new F.shapes.standard.EmbeddedImage,n=new F.shapes.standard.EmbeddedImage,r=new F.shapes.standard.EmbeddedImage,o=new F.shapes.standard.EmbeddedImage;this.anchorPoints=[t,n,r,o];var i=this.shape.getBBox(),s=i.x,a=i.y,c=i.width,l=i.height;this.anchorPoints.forEach((function(e){e.set("isDrag",!0),e.set("previousPosition",e.position())})),this.highlighted&&this.addResizeAnchors(),this.setPointAttributes(t,"nwse-resize","bottom-right-resize-button"),this.setPointAttributes(n,"nesw-resize","bottom-left-resize-button"),this.setPointAttributes(r,"nesw-resize","top-right-resize-button"),this.setPointAttributes(o,"nwse-resize","top-left-resize-button"),t.position(s+c,a+l),n.position(s-this.pointWidth,a+l),r.position(s+c,a-this.pointHeight),o.position(s-this.pointWidth,a-this.pointHeight),t.listenTo(this.paper,"element:pointerdown",(function(n){n.model===t&&(t.on("change:position",e.resizeBottomRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){t.off("change:position",e.resizeBottomRight),e.resizeUpdate()})))})),n.listenTo(this.paper,"element:pointerdown",(function(t){t.model===n&&(n.on("change:position",e.resizeBottomLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){n.off("change:position",e.resizeBottomLeft),e.resizeUpdate()})))})),r.listenTo(this.paper,"element:pointerdown",(function(t){t.model===r&&(r.on("change:position",e.resizeTopRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){r.off("change:position",e.resizeTopRight),e.resizeUpdate()})))})),o.listenTo(this.paper,"element:pointerdown",(function(t){t.model===o&&(o.on("change:position",e.resizeTopLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){o.off("change:position",e.resizeTopLeft),e.resizeUpdate()})))}))},fixResizeRounding:function(){var e=this.poolComponent.shape.getBBox(),t=e.x,n=e.y,r=e.width,o=e.height;this.poolComponent.shape.resize(Math.round(r),Math.round(o)),this.poolComponent.shape.position(Math.round(t),Math.round(n))},resizeUpdate:function(){this.fixResizeRounding();var e=this.shape.getBBox(),t=e.width,n=e.height,r=this.node.diagram.bounds;t===r.width&&n===r.height||(this.poolComponent.laneSet&&(this.poolComponent.updateLaneChildren(),this.poolComponent.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),Un.commit("updateNodeBounds",{node:this.poolComponent.node,bounds:this.poolComponent.shape.getBBox()}),this.$emit("save-state"))},resizeTopLeft:function(e,t,n){if(n.ui){var r="top-left",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.width,d=s.height,u=this.shape.getBBox(),h=u.x,p=u.y,f=u.width,m=u.height,g=this.poolComponent.sortedLanes(),v=g.slice(1).reduce((function(e,t){return e+t.getBBox().height}),lm),b=Math.max(a+l-(o+this.pointWidth),a+l-this.elementLeftX+om,sm),y=Math.max(c+d-(i+this.pointWidth),c+d-this.elementTopY,this.poolComponent.laneSet?v:im),w=Math.max(h+f-(o+this.pointWidth),h+f-this.elementLeftX+am+om,cm),x=Math.max(p+m-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===g[0]){var k=Math.max(a+l-(o+this.pointWidth)+om,a+l-this.elementLeftX+om,sm);this.poolComponent.shape.resize(k,y,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes()}else{var C=g[g.indexOf(this.shape)-1];this.shape.resize(w,Math.min(p+m-(C.getBBox().y+lm),x),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else e.set("previousPosition",{x:o,y:i}),this.shape.resize(b,y,{direction:r}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeTopRight:function(e,t,n){if(n.ui){var r="top-right",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.height,d=this.shape.getBBox(),u=d.x,h=d.y,p=d.height,f=this.poolComponent.sortedLanes(),m=f.slice(1).reduce((function(e,t){return e+t.getBBox().height}),lm),g=Math.max(o-a,this.elementRightX-a,sm),v=Math.max(c+l-(i+this.pointWidth),c+l-this.elementTopY,this.poolComponent.laneSet?m:im),b=Math.max(o-u,this.elementRightX-u,cm),y=Math.max(h+p-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===f[0])this.poolComponent.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes();else{var w=f[f.indexOf(this.shape)-1];this.shape.resize(b,Math.min(h+p-(w.getBBox().y+lm),y),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomLeft:function(e,t,n){if(n.ui){var r="bottom-left",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.width,d=this.shape.getBBox(),u=d.x,h=d.y,p=d.width,f=this.poolComponent.sortedLanes(),m=f.slice(0,f.length-1).reduce((function(e,t){return e+t.getBBox().height}),lm),g=Math.max(a+l-(o+this.pointWidth),a+l-this.elementLeftX+om,sm),v=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?m:im),b=Math.max(u+p-(o+this.pointWidth),u+p-this.elementLeftX+am+om,cm),y=Math.max(i-h,lm);if(this.isLane)if(this.shape===f[f.length-1]){var w=Math.max(a+l-(o+this.pointWidth)+om,a+l-this.elementLeftX+om,sm);this.poolComponent.shape.resize(w,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes()}else{var x=f[f.indexOf(this.shape)+1];this.shape.resize(b,Math.min(x.getBBox().y+x.getBBox().height-lm-h,y),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomRight:function(e,t,n){if(n.ui){var r="bottom-right",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=this.shape.getBBox(),d=l.x,u=l.y,h=this.poolComponent.sortedLanes(),p=h.slice(0,h.length-1).reduce((function(e,t){return e+t.getBBox().height}),lm),f=Math.max(o-a,this.elementRightX-a,sm),m=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?p:im),g=Math.max(o-d,this.elementRightX-d,cm),v=Math.max(i-u,lm);if(this.isLane)if(this.shape===h[h.length-1])this.poolComponent.shape.resize(f,m,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes();else{var b=h[h.indexOf(this.shape)+1];this.shape.resize(g,Math.min(b.getBBox().y+b.getBBox().height-lm-u,v),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(f,m,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},addResizeAnchors:function(){var e=this;this.anchorPoints.forEach((function(t){try{e.shape.embed(t)}catch(n){}t.addTo(e.graph),t.toFront()}))},removeResizeAnchors:function(){this.anchorPoints.forEach((function(e){e.remove()}))},updateAnchorPointPosition:function(e){if(0!==this.anchorPoints.length){var t=this.shape.getBBox(),n=t.x,r=t.y,o=t.width,i=t.height;0!==e&&this.anchorPoints[0].position(n+o,r+i),1!==e&&this.anchorPoints[1].position(n-this.pointWidth,r+i),2!==e&&this.anchorPoints[2].position(n+o,r-this.pointHeight),3!==e&&this.anchorPoints[3].position(n-this.pointWidth,r-this.pointWidth)}},setPointAttributes:function(e,t,n){e.attr({body:{fill:"#fff",stroke:" #fff",opacity:.8},image:{xlinkHref:rm,cursor:t,buttonId:n,refWidth:20,refHeight:20,resetOffset:!0}})}},mounted:function(){var e=this;this.$nextTick((function(){e.configureResize()}))}},um=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},hm=[],pm={components:{CrownConfig:Ts},props:["graph","node","nodes","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,dm],data:function(){return{shape:null,definition:null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new F.shapes.standard.Rectangle,this.shape.set("type","PoolLane");var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.set("elementMove",!1),this.shape.attr("body/cursor","default"),this.shape.attr("body",{fill:Ye}),this.shape.attr("label",{text:F.util.breakText(this.node.definition.get("name"),{width:e.height}),fill:"black",transform:"rotate(-90)",refX:om/2}),this.shape.component=this,this.shape.addTo(this.graph),this.planeElements.includes(this.node.diagram)||this.planeElements.push(this.node.diagram)},beforeDestroy:function(){var e=this.node.pool.component,t=e.laneSet.get("lanes");if(Cs()(t,this.node.definition),0===t.length)return e.containingProcess.set("laneSets",[]),void(e.laneSet=null)}},fm=pm,mm=fr(fm,um,hm,!1,null,null,null),gm=mm.exports,vm=F.shapes.standard.Rectangle.define("processmaker.modeler.bpmn.pool",{markup:[].concat(W(F.shapes.standard.Rectangle.prototype.markup),[{tagName:"polyline",selector:"polyline"}]),attrs:{label:{fill:"black",transform:"rotate(-90)",refX:om/2},polyline:{refPointsKeepOffset:"".concat(om,",0 ").concat(om,",200"),stroke:"#000",fill:"#fff",strokeWidth:2}}}),bm=vm,ym=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},wm=[],xm={inheritAttrs:!1,components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Fs,xt],data:function(){return{shape:null,definition:null,dropdownData:[]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new F.shapes.standard.Path,this.shape.attr("root/title","joint.shapes.standard.Path"),this.shape.attr("label",{refY:65,text:this.node.definition.get("name"),fill:"black"}),this.shape.attr("body",{refD:"M1,1 L25,1 L35,10 L35,49 L1,49 L1,1 M24,1 L24,10 L35,10"});var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.addTo(this.graph),this.shape.component=this}},km=xm,Cm=fr(km,ym,wm,!1,null,null,null),Sm=Cm.exports,Em="processmaker-modeler-data-object",Am={id:Em,component:Sm,bpmnType:"bpmn:DataObjectReference",control:!0,category:"BPMN",icon:f(91012),label:io[Em],rank:80,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataObjectReference",{name:t(io[Em])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:36})})},inspectorConfig:[{name:io[Em],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-object"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},_m=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},Tm=[],Mm=F.shapes.standard.Cylinder.extend({markup:[].concat(W(F.shapes.standard.Cylinder.prototype.markup),[{tagName:"ellipse",selector:"thirdLine"},{tagName:"ellipse",selector:"secondLine"},{tagName:"ellipse",selector:"firstLine"}]),defaults:F.util.deepSupplement({attrs:{thirdLine:{refCx:"50%",refRx:"50%",cy:20,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},secondLine:{refCx:"50%",refRx:"50%",cy:15,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},firstLine:{refCx:"50%",refRx:"50%",cy:10,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},label:{refY:50,fill:"#000"}}},F.shapes.standard.Cylinder.prototype.defaults)}),Pm={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Fs,xt],data:function(){return{shape:null,definition:null,dropdownData:[]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Mm,this.shape.attr("label/text",this.node.definition.get("name"));var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.addTo(this.graph),this.shape.component=this}},Im=Pm,Om=fr(Im,_m,Tm,!1,null,null,null),Dm=Om.exports,Nm="processmaker-modeler-data-store",Rm={id:Nm,component:Dm,bpmnType:"bpmn:DataStoreReference",control:!0,category:"BPMN",icon:f(63427),label:io[Nm],rank:90,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataStoreReference",{name:t(io[Nm])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:50})})},inspectorConfig:[{name:io[Nm],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-store"},items:[{component:"FormInput",config:_a}]},Va,Na]}]};function Bm(e,t){var n=new bm,r=e.diagram.bounds;return n.position(r.x,r.y),n.resize(r.width,r.height),n.attr("label/text",F.util.breakText(e.definition.get("name"),{width:r.width})),n.attr("body",{fill:Ye}),n.addTo(t),n}function Lm(e,t){e.getElements().filter((function(e){return e!==t})).filter((function(e){var t=e.component;return!t.node.isBpmnType("bpmn:BoundaryEvent")})).forEach((function(e){var n=e.component;t.embed(n.shape),n.node.pool=t}))}function jm(e,t){e.fitEmbeds({padding:am+om}),e.resize(e.getBBox().width-om,e.getBBox().height-om),e.resize(e.getBBox().width,e.getBBox().height-om,{direction:"top"});var n=e.get("size"),r=n.width,o=n.height,i=t.diagram.bounds;e.resize(Math.max(r,i.width),Math.max(o,i.height))}function Fm(e,t,n){var r=Bm(t,n);return e||(Lm(n,r),jm(r,t)),r}function zm(e){return e.component&&e.component.node.type!==dl&&e.component.node.type!==Qf&&e.component.node.type!==Em&&e.component.node.type!==Nm}var Um={id:dl,component:gm,bpmnType:"bpmn:Lane",control:!1,category:"BPMN",label:"Lane",definition:function(e){return e.create("bpmn:Lane",{name:""})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:150,width:600,x:null,y:null})})},inspectorConfig:[{name:"Lane",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-pool-lane"},items:[{component:"FormInput",config:_a}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.getElementByNodeId(t.poolId),o=e.moddle.create("bpmn:Lane",{name:t.name}),!r.component.laneSet&&r.component.createLaneSet&&(r.component.createLaneSet([t.laneSetId]),r.component.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){o.get("flowNodeRef").push(e.component.node.definition)})),i=B(e.definitions),i.updateCounters()),s=e.moddle.create("bpmndi:BPMNShape",{bounds:e.moddle.create("dc:Bounds",{height:t.height,width:t.width,x:t.x,y:t.y})}),c=new po(t.type,o,s),n.next=7,e.addNode(c,t.id,!0);case 7:e.setShapeStacking(r.component.shape);case 8:case"end":return n.stop()}}),n)})))()}},qm=function(){var e=this,t=e._self._c;return t("crown-button",e._g({attrs:{id:"lane-above-button","aria-label":"Add lane above icon",width:25}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-lane-above"]}})],1)},Vm=[],Hm=f.p+"img/lane-above.37ee2b80.svg",Wm={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{laneAboveIcon:Hm}},created:function(){mo.library.add(bo)}},Gm=Wm,$m=fr(Gm,qm,Vm,!1,null,null,null),Xm=$m.exports,Ym=function(){var e=this,t=e._self._c;return t("crown-button",e._g({attrs:{id:"lane-below-button","aria-label":"Add lane below icon",width:25}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-lane-below"]}})],1)},Jm=[],Zm=f.p+"img/lane-below.22169670.svg",Km={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{laneBelowIcon:Zm}},created:function(){mo.library.add(yo)}},Qm=Km,eg=fr(Qm,Ym,Jm,!1,null,null,null),tg=eg.exports,ng={components:{CrownConfig:Ts,AddLaneAboveButton:Xm,AddLaneBelowButton:tg},props:["graph","node","nodes","id","collaboration","processes","moddle","processNode","rootElements","highlighted","nodeRegistry","paper","planeElements","isRendering","paperManager","nodeIdGenerator"],mixins:[xa,dm,xt],data:function(){return{shape:null,definition:null,laneSet:null,isAddingLaneAbove:!1,anchorPointFunction:It(20)}},computed:{containingProcess:function(){var e=this;return this.node.definition.get("processRef")?this.processes.find((function(t){return t.id===e.node.definition.get("processRef").id})):null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},methods:{addLaneAbove:function(){this.isAddingLaneAbove=!0,this.addLane()},addLaneBelow:function(){this.isAddingLaneAbove=!1,this.addLane()},sortedLanes:function(){return this.shape.getEmbeddedCells().filter((function(e){var t=e.component;return t&&t.node.type===dl})).sort((function(e,t){return e.position().y-t.position().y}))},getElementsUnderArea:function(e,t){var n=e.getBBox(),r=n.x,o=n.y,i=n.width,s=n.height,a={x:r,y:o,width:i,height:s};return t.findModelsInArea(a)},moveEmbeddedElements:function(e,t){var n=this;this.getElementsUnderArea(e,this.graph).filter((function(t){return t.isEmbeddedIn(e)})).forEach((function(e){e.component.node.pool=t,Cs()(n.containingProcess.get("flowElements"),e.component.node.definition),t.component.containingProcess.get("flowElements").push(e.component.node.definition)}))},moveFlow:function(e,t){var n=e.component.node.definition;Cs()(this.containingProcess.get("flowElements"),n),t.component.containingProcess.get("flowElements").push(n)},moveElementRemote:function(e,t){var n=e.component.node.definition;if(this.laneSet){var r=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(r.get("flowNodeRef"),n)}Cs()(this.containingProcess.get("flowElements"),n),e.component.node.pool=t,this.shape.unembed(e),t.component.shape.embed(e),e.component.node.type!==dl&&t.component.laneSet&&t.component.updateLaneChildren(),this.$emit("set-shape-stacking",e.component.shape)},moveElement:function(e,t){var n=e.component.node.definition;if(this.laneSet){var r=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(r.get("flowNodeRef"),n)}Cs()(this.containingProcess.get("flowElements"),n),t.component.containingProcess.get("flowElements").push(n),this.moveEmbeddedElements(e,t),e.component.node.pool=t,this.shape.unembed(e),t.component.addToPool(e)},addLane:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=!(e.length>0&&void 0!==e[0])||e[0],o=[],t.laneSet||(t.createLaneSet(),i=Um.definition(t.moddle,t.$t),t.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){i.get("flowNodeRef").push(e.component.node.definition)})),o.push(t.pushNewLane(i))),o.push(t.pushNewLane()),n.next=6,Promise.all(o).then((function(e){r&&t.$parent.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-addLanes",e)}));case 6:t.$emit("set-shape-stacking",t.shape),t.graph.getLinks().forEach((function(e){t.$emit("set-shape-stacking",e)})),t.$emit("save-state");case 9:case"end":return n.stop()}}),n)})))()},createLaneSet:function(e){var t=this.moddle.create("bpmn:LaneSet");this.laneSet=t;var n=this.nodeIdGenerator,r=null!==e&&void 0!==e?e:n.generate(),o=jt(r,1),i=o[0];this.laneSet.set("id",i),this.containingProcess.get("laneSets").push(t)},pushNewLane:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:Um.definition(t.moddle,t.$t),r.set("color",t.node.definition.get("color")),t.$emit("set-pool-target",t.shape),o=Um.diagram(t.moddle),o.bounds.width=t.shape.getBBox().width,i=new po(Um.id,r,o),t.$emit("add-node",i),n.next=9,t.$nextTick();case 9:return n.abrupt("return",i);case 10:case"end":return n.stop()}}),n)})))()},addToPool:function(e){e.component.node.isBpmnType("bpmn:BoundaryEvent")||(this.shape.unembed(e),this.shape.embed(e),this.expandToFitElement(e,this.shape),e.component.node.type!==dl&&this.laneSet&&this.updateLaneChildren())},positionAndSizeLane:function(e,t){var n=t.getBBox(),r=n.width,o=n.height,i=e.component.node.diagram.bounds;if(!i.x||!i.y){var s=1===t.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type===dl})).length,a=s?o:i.height;e.resize(r-om,a),e.position(om,s?0:this.isAddingLaneAbove?-a:o,{parentRelative:!0}),t.resize(r,s?o:o+a,{direction:this.isAddingLaneAbove?"top-right":"bottom-right"}),this.fixResizeRounding(),this.updateAnchorPointPosition();var c=e.position(),l=c.x,d=c.y;i.set("x",l),i.set("y",d),i.set("width",e.get("size").width),i.set("height",e.get("size").height),Un.commit("updateNodeBounds",{node:this.node,bounds:t.getBBox()})}},expandToFitElement:function(e,t){if(e.component.node.type!==El){var n=t.getBBox(),r=n.x,o=n.y,i=n.width,s=n.height;if(e.component.node.type!==dl){var a=e.get("size"),c=a.width,l=a.height,d=e.position(),u=d.x,h=d.y,p=u-r,f=h-o,m=p+c,g=p,v=f,b=f+l,y=0,w=0,x="bottom",k="right";m>i-am&&(y=m+am),g<om+am&&(y=i+(om+am-g),k="left"),v<am&&(w=am-v+s,x="top"),b>s-am&&(w=b+am),(y||w)&&(t.resize(Math.max(y,i),Math.max(w,s),{direction:"".concat(x,"-").concat(k)}),this.fixResizeRounding(),this.updateAnchorPointPosition(),this.laneSet&&(this.resizeLanes(),this.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),Un.commit("updateNodeBounds",{node:this.node,bounds:t.getBBox()}),this.$emit("save-state"))}else this.positionAndSizeLane(e,t)}},fillLanes:function(e,t,n){var r,o=this.shape.get("size").height,i=this.sortedLanes().reduce((function(e,t){return e+t.getBBox().height}),0),s=n?e.get("size").height:o-i;switch(t){case"top-right":r="bottom-right";break;case"top-left":r="bottom-left";break;case"bottom-right":r="top-right";break;case"bottom-left":r="top-left";break}var a=this.sortedLanes().indexOf(e),c=e.getBBox(),l=c.width,d=this.sortedLanes()[a+(t.includes("top")?-1:1)];d.resize(l,d.getBBox().height+s,{direction:r}),this.shape.resize(l+om,o,{direction:r}),this.sortedLanes().forEach((function(e){return e.resize(l,e.getBBox().height,{direction:r})}))},resizeLanes:function(){var e=this;this.sortedLanes().forEach((function(t,n,r){var o=e.shape.get("size"),i=o.width,s=o.height,a=t.get("size"),c=a.height,l=t.position({parentRelative:!0}),d=l.y,u=c,h=d;if(0===n&&(u=c+t.position({parentRelative:!0}).y,h=0),n===r.length-1){var p=s-(t.position({parentRelative:!0}).y+c);u=c+p}t.resize(i-om,u),t.position(om,h,{parentRelative:!0})}))},captureChildren:function(){var e=this;this.graph.getElements().filter((function(t){var n=t.component;return n&&n!==e})).forEach((function(t){var n=t.component;n.node.isBpmnType("bpmn:BoundaryEvent")||(e.shape.embed(n.shape),n.node.pool=e.shape)})),this.$emit("set-shape-stacking",this.shape),this.resizePool(this.shape)},fitEmbeds:function(){this.shape.fitEmbeds({padding:am+om}),this.shape.resize(this.shape.getBBox().width-om,this.shape.getBBox().height-om),this.shape.resize(this.shape.getBBox().width,this.shape.getBBox().height-om,{direction:"top"})},resizePool:function(e){var t=this;this.fitEmbeds();var n=this.shape.get("size"),r=n.width,o=n.height,i=this.node.diagram.bounds;this.shape.resize(Math.max(r,i.width),Math.max(o,i.height)),this.shape.getEmbeddedCells().forEach((function(n){t.expandToFitElement(n,e)}));var s=this.shape.position(),a=s.x,c=s.y,l=this.shape.get("size"),d=l.width,u=l.height;this.node.diagram.bounds.x=a,this.node.diagram.bounds.y=c,this.node.diagram.bounds.width=d,this.node.diagram.bounds.height=u},updateLaneChildren:function(){var e=this,t={};this.shape.getEmbeddedCells().filter((function(t){return zm(t)&&t.component.node.pool===e.shape})).forEach((function(n){var r=e.graph.findModelsUnderElement(n,{searchBy:"center"}).find((function(e){return e.component&&e.component.node.type===dl}));t[r.id]?t[r.id].push(n.component.node.definition):t[r.id]=[n.component.node.definition]})),this.sortedLanes().forEach((function(e){var n=t[e.id],r=e.component.node.definition.get("flowNodeRef"),o=n?n.length!==r.length:r.length>0;o&&Un.commit("updateNodeProp",{node:e.component.node,key:"flowNodeRef",value:n||[]})}))},hasPools:function(){return this.collaboration.get("participants").length>0},setPoolSize:function(e){var t=this;e.getEmbeddedCells().forEach((function(n){t.expandToFitElement(n,e)}));var n=e.position(),r=n.x,o=n.y,i=e.get("size"),s=i.width,a=i.height;this.node.diagram.bounds.x=r,this.node.diagram.bounds.y=o,this.node.diagram.bounds.width=s,this.node.diagram.bounds.height=a}},mounted:function(){this.$emit("set-pools",this.node.definition),this.laneSet=this.containingProcess.get("laneSets")[0],this.shape=Fm(this.collaboration,this.node,this.graph),this.shape.component=this,this.collaboration||this.captureChildren(),this.setPoolSize(this.shape),this.$emit("set-shape-stacking",this.shape)},beforeDestroy:function(){var e=this.collaboration.get("participants");Cs()(e,this.node.definition),this.hasPools()?Cs()(this.rootElements,this.containingProcess):this.$emit("unset-pools")},created:function(){this.$t=this.$t.bind(this)}},rg=ng,og=fr(rg,tm,nm,!1,null,null,null),ig=og.exports,sg={id:Jo,component:ig,bpmnType:"bpmn:Participant",control:!0,category:"BPMN",icon:f(77217),label:"Pool",rank:60,definition:function(e,t){return e.create("bpmn:Participant",{name:t("Pool")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:300,width:600})})},inspectorConfig:[{name:"Pool",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-pool"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},ag=function(){var e=this,t=e._self._c;return t("b-card-footer",{staticClass:"p-0 border-0 statusbar d-flex align-items-center justify-content-end pr-3 pl-3 border-top"},[e._t("default"),t("b-btn",{staticClass:"mr-auto",attrs:{disabled:!e.xmlManager,variant:"secondary",size:"sm","data-test":"downloadXMLBtn"},on:{click:function(t){e.xmlManager&&e.xmlManager.download()}}},[t("i",{staticClass:"fas fa-download mr-1"}),e._v(" "+e._s(e.$t("Download BPMN"))+" ")]),t("div",{staticClass:"status-bar-container d-flex align-items-center justify-content-end"},[e.autoValidate?[0===e.numberOfProblemsToDisplay?t("button",{staticClass:"btn btn-light",attrs:{type:"button","data-test":"validation-list-valid",disabled:!0}},[e._v(" "+e._s(e.$t("BPMN Valid"))+" "),t("span",{staticClass:"badge badge-success badge-pill"},[t("font-awesome-icon",{attrs:{icon:e.faCheck}})],1)]):t("button",{staticClass:"btn btn-light",attrs:{type:"button","data-test":"validation-list-toggle"},on:{click:function(t){e.shouldDisplayProblemsPanel=!e.shouldDisplayProblemsPanel}}},[e._v(" "+e._s(e.$t("BPMN Issues"))+" "),t("span",{staticClass:"badge badge-primary badge-pill"},[e._v(" "+e._s(e.numberOfProblemsToDisplay)+" ")]),t("font-awesome-icon",{staticClass:"ml-3",attrs:{icon:e.chevronIcon}})],1)]:e._e(),t("span",{staticClass:"divider"}),t("b-form-checkbox",{staticClass:"h-100 d-flex align-items-center",attrs:{"data-test":"validation-toggle",switch:""},model:{value:e.autoValidate,callback:function(t){e.autoValidate=t},expression:"autoValidate"}},[e._v(" "+e._s(e.$t("Auto validate"))+" ")]),t("transition",{attrs:{name:"slide"}},[e.isProblemsPanelDisplayed?t("div",{staticClass:"validation-container position-absolute text-left"},[t("dl",{staticClass:"validation-container__list align-items-baseline",attrs:{"data-test":"validation-list"}},[e._l(e.errorList,(function(n,r){return[t("dt",{key:"".concat(n.errorId,"_").concat(r),staticClass:"text-capitalize"},[t("font-awesome-icon",{staticClass:"status-bar-container__status-icon ml-1 mr-1 mt-1",style:{color:e.isErrorCategory(n)?e.errorColor:e.warningColor},attrs:{icon:e.isErrorCategory(n)?e.faTimesCircle:e.faExclamationTriangle}}),e._v(" "+e._s(n.errorKey)+" ")],1),t("dd",{key:"".concat(n.errorId,"_").concat(r,"_dd")},[t("p",{staticClass:"pl-4 mb-0 font-italic"},[e._v(e._s(n.message)+".")]),n.id?t("p",{staticClass:"pl-4 mb-0"},[t("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.$t("Node ID"))+":")]),e._v(" "+e._s(n.id))]):e._e()])]})),e._l(e.warnings,(function(n,r){return[t("dt",{key:n.title+r,staticClass:"text-capitalize"},[t("font-awesome-icon",{staticClass:"status-bar-container__status-icon ml-1 mr-1 mt-1",style:{color:e.warningColor},attrs:{icon:e.faExclamationTriangle}}),e._v(" "+e._s(n.title)+" ")],1),t("dd",{key:n.title+r+"__dd",staticClass:"font-italic pl-4"},[e._v(e._s(n.text))])]}))],2)]):e._e()])],2)],2)},cg=[];f(86535),f(99244);function lg(e){return Object.entries(e).flatMap((function(e){var t=jt(e,2),n=t[0],r=t[1];return r.flatMap((function(e){return Qr(Qr({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))}var dg={components:{FontAwesomeIcon:To.FontAwesomeIcon},props:["validationErrors","warnings","xmlManager"],data:function(){return{shouldDisplayProblemsPanel:!1,errorColor:"#D9534F",warningColor:"#F0AD4E",faExclamationTriangle:is.faExclamationTriangle,faTimesCircle:is.faTimesCircle,faChevronUp:is.faChevronUp,faChevronDown:is.faChevronDown,faCheck:is.faCheck}},computed:{autoValidate:{get:function(){return Un.getters.autoValidate},set:function(e){Un.commit("setAutoValidate",e)}},errorList:function(){return lg(this.validationErrors)},numberOfProblemsToDisplay:function(){return this.errorList.length+this.warnings.length},isProblemsPanelDisplayed:function(){return this.shouldDisplayProblemsPanel&&this.numberOfProblemsToDisplay>0&&this.autoValidate},chevronIcon:function(){return this.shouldDisplayProblemsPanel?is.faChevronUp:is.faChevronDown}},methods:{isErrorCategory:function(e){return"error"===e.category}}},ug=dg,hg=(f(99088),fr(ug,ag,cg,!1,null,"1ad192c7",null)),pg=hg.exports,fg=function(){var e=this,t=e._self._c;return t("span",{attrs:{"data-test":"body-container"}},[e.showComponent?t("tool-bar",{ref:"tool-bar",attrs:{"canvas-drag-position":e.canvasDragPosition,cursor:e.cursor,"is-rendering":e.isRendering,"paper-manager":e.paperManager,"breadcrumb-data":e.breadcrumbData,panelsCompressed:e.panelsCompressed,"validation-errors":e.validationErrors,warnings:e.allWarnings,"xml-manager":e.xmlManager,validationBar:e.validationBar,"extra-actions":e.extraActions,players:e.players},on:{"load-xml":e.loadXML,"toggle-panels-compressed":function(t){e.panelsCompressed=!e.panelsCompressed},"toggle-mini-map-open":function(t){e.miniMapOpen=t},saveBpmn:e.saveBpmn,publishTemplate:e.publishTemplate,publishPmBlock:e.publishPmBlock,close:e.close,"save-state":e.pushToUndoStack,clearSelection:e.clearSelection,action:e.handleToolbarAction}}):e._e(),t("b-row",{staticClass:"modeler h-100"},[e.tooltipTarget?t("b-tooltip",{key:e.tooltipTarget.id,attrs:{target:e.getTooltipTarget,title:e.tooltipTitle}}):e._e(),e.showComponent?t("explorer-rail",{attrs:{"node-types":e.nodeTypes,"pm-block-nodes":e.pmBlockNodes},on:{"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler}}):e._e(),t("b-col",{ref:"paper-container",staticClass:"paper-container h-100 pr-4",class:[e.cursor,{"grabbing-cursor":e.isGrabbing}],style:{width:e.parentWidth,height:e.parentHeight},on:{mouseup:e.onMouseUp,mousemove:function(t){e.onMouseMove(t),e.setInspectorButtonPosition(t)}}},[t("div",{ref:"paper",staticClass:"main-paper",attrs:{"data-test":"paper"}})]),e.showWelcomeMessage?t("WelcomeMessage"):e._e(),t("InspectorButton",{directives:[{name:"show",rawName:"v-show",value:e.showComponent&&e.showInspectorButton,expression:"showComponent && showInspectorButton"}],ref:"inspector-button",style:{right:e.inspectorButtonRight+"px"},attrs:{showInspector:e.isOpenInspector},on:{toggleInspector:function(t){e.handleToggleInspector(t),e.setInspectorButtonPosition(t)}}}),t("PreviewPanel",{ref:"preview-panel",attrs:{visible:e.isOpenPreview,nodeRegistry:e.nodeRegistry,previewConfigs:e.previewConfigs,panelWidth:e.previewPanelWidth},on:{togglePreview:function(t){e.handleTogglePreview(t),e.setInspectorButtonPosition(t)},previewResize:function(t){e.onMouseMove(t),e.setInspectorButtonPosition(t)},startResize:e.onStartPreviewResize,stopResize:e.onMouseUp}}),e.showComponent?t("InspectorPanel",{directives:[{name:"show",rawName:"v-show",value:e.isOpenInspector&&!(e.highlightedNodes.length>1),expression:"isOpenInspector && !(highlightedNodes.length > 1)"}],ref:"inspector-panel",staticClass:"inspector h-100",style:{height:e.parentHeight},attrs:{nodeRegistry:e.nodeRegistry,moddle:e.moddle,definitions:e.definitions,processNode:e.processNode,"parent-height":e.parentHeight,"canvas-drag-position":e.canvasDragPosition},on:{"save-state":e.pushToUndoStack,"shape-resize":function(t){return e.shapeResize(!1)},toggleInspector:function(t){e.handleToggleInspector(t),e.setInspectorButtonPosition(t)}}}):e._e(),e._l(e.nodes,(function(n){return t(n.type,{key:n._modelerId,ref:"nodeComponent",refInFor:!0,tag:"component",attrs:{graph:e.graph,paper:e.paper,node:n,id:n.id,highlighted:e.highlightedNodes.includes(n),"has-error":e.invalidNodes.includes(n),"border-outline":e.borderOutline(n.id),collaboration:e.collaboration,"process-node":e.processNode,processes:e.processes,"plane-elements":e.planeElements,moddle:e.moddle,nodeRegistry:e.nodeRegistry,"root-elements":e.definitions.get("rootElements"),isRendering:e.isRendering,paperManager:e.paperManager,"auto-validate":e.autoValidate,"node-id-generator":e.nodeIdGenerator,"is-active":n===e.activeNode,"is-completed":e.requestCompletedNodes.includes(n.definition.id),"is-in-progress":e.requestInProgressNodes.includes(n.definition.id),"is-idle":e.requestIdleNodes.includes(n.definition.id)},on:{"add-node":e.addNode,"remove-node":e.removeNode,previewNode:function(t){e.handlePreview(t),e.setInspectorButtonPosition(t)},"set-cursor":function(t){e.cursor=t},"set-pool-target":function(t){e.poolTarget=t},"unset-pools":e.unsetPools,clearSelection:e.clearSelection,"set-pools":e.setPools,"save-state":e.pushToUndoStack,"set-shape-stacking":e.setShapeStacking,setTooltip:function(t){e.tooltipTarget=t},"replace-node":e.replaceNode,"replace-generic-flow":e.replaceGenericFlow,"copy-element":e.copyElement,"copy-selection":e.copyElement,"paste-element":e.pasteElements,"clone-element":e.cloneElement,"clone-selection":e.cloneSelection,"default-flow":e.toggleDefaultFlow,"shape-resize":e.shapeResize}})})),t("RailBottom",{attrs:{nodeTypes:e.nodeTypes,"paper-manager":e.paperManager,graph:e.graph,"is-rendering":e.isRendering},on:{"load-xml":e.loadXML,clearSelection:e.clearSelection,"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler}}),e.paper?t("selection",{ref:"selector",attrs:{graph:e.graph,paperManager:e.paperManager,useModelGeometry:!1,processNode:e.processNode,isMultiplayer:e.isMultiplayer},on:{"clone-selection":e.cloneSelection,"remove-nodes":e.removeNodes,"save-state":e.pushToUndoStack}}):e._e()],2)],1)},mg=[],gg=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},vg=[],bg=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"circle",selector:"body2"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"}],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.boundaryEvent.Shape",size:{width:36,height:36},attrs:{label:{refY:"130%"},body:{stroke:"#212529",strokeWidth:.85,fill:"#FFF"},body2:{cx:18,cy:18,r:15,strokeWidth:.85,stroke:"#212529",fill:"#FFF"},image:{refX:5,refY:5,ref:"circle",width:26,height:26}}},F.shapes.standard.Circle.prototype.defaults)}),yg={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering","isActive"],mixins:[xa,xt,Fs],data:function(){return{shape:null,previousPosition:null,validPosition:null,invalidTargetElement:null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)},"node.definition.cancelActivity":function(e){this.toggleInterruptingStyle(e)}},methods:{getTaskUnderShape:function(){return this.graph.findModelsUnderElement(this.shape).find((function(e){return Ii(e.component)}))},setShapeBorderDashSpacing:function(e){this.shape.attr({body:{strokeDasharray:e},body2:{strokeDasharray:e}})},setSolidShapeBorder:function(){var e=0;this.setShapeBorderDashSpacing(e)},setDashedShapeBorder:function(){var e=5;this.setShapeBorderDashSpacing(e)},toggleInterruptingStyle:function(){this.node.definition.cancelActivity?this.setSolidShapeBorder():this.setDashedShapeBorder()},setShapeProperties:function(){var e=this.node.diagram.bounds,t=e.x,n=e.y,r=e.width,o=e.height;this.shape.position(t,n),this.shape.resize(r,o),this.shape.attr("label/text",this.node.definition.get("name")),this.shape.component=this},hasPositionChanged:function(){if(!this.previousPosition)return!0;var e=this.shape.position(),t=e.x,n=e.y,r=this.previousPosition,o=r.x,i=r.y;return t!==o||n!==i},getCenterPosition:function(){var e=this.shape.position(),t=e.x,n=e.y,r=this.shape.size(),o=r.width,i=r.height;return{x:t+o/2,y:n+i/2}},updateShapePosition:function(e){if(this.hasPositionChanged()){var t=Tt(this.getCenterPosition(),e),n=t.x,r=t.y,o=this.shape.size(),i=o.width,s=o.height;this.shape.position(n-i/2,r-s/2),this.previousPosition=this.shape.position()}},attachBoundaryEventToTask:function(e){if(e){var t=this.shape.getParentCell();t&&t.unembed(this.shape),e.embed(this.shape),this.node.definition.set("attachedToRef",e.component.node.definition)}},resetToInitialPosition:function(){this.shape.position(this.validPosition.x,this.validPosition.y),Un.commit("allowSavingElementPosition"),this.$emit("shape-resize")},moveBoundaryEventIfOverTask:function(){var e=this.getTaskUnderShape();Oi(this.node.type,e)?(this.attachBoundaryEventToTask(e),this.updateShapePosition(e),this.$emit("shape-resize")):this.resetToInitialPosition()},resetInvalidTarget:function(){this.invalidTargetElement&&(Nt(this.invalidTargetElement),this.invalidTargetElement=null,this.$emit("shape-resize"))},attachToValidTarget:function(e){var t=this;e.model===this.shape&&(Un.commit("preventSavingElementPosition"),this.validPosition=this.shape.position(),this.shape.listenToOnce(this.paper,"cell:pointerup blank:pointerup",(function(){t.moveBoundaryEventIfOverTask(),t.resetInvalidTarget(),Un.commit("allowSavingElementPosition")})))},turnInvalidTargetRed:function(){if(this.isActive){var e=this.graph.findModelsUnderElement(this.shape).filter((function(e){return e.component}))[0],t=this.invalidTargetElement===e;if(!t){var n=this.shape.getParentCell();e&&e!==n&&!Oi(this.node.type,e)&&e.attr("body/fill",ze),this.invalidTargetElement&&Nt(this.invalidTargetElement),this.invalidTargetElement=e}}},addMultiplayerBoundaryEvent:function(){var e,t={bpmnType:this.node.diagram.$type,id:this.node.diagram.id,type:this.node.type,attachedToRef:this.node.definition.get("attachedToRef")};window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",{x:this.node.diagram.bounds.x,y:this.node.diagram.bounds.y,height:this.node.diagram.bounds.height,width:this.node.diagram.bounds.width,attachedToRefId:null===(e=this.node.definition.get("attachedToRef"))||void 0===e?void 0:e.id,control:t,type:this.node.type,id:this.node.definition.id,color:this.node.definition.get("color")})}},mounted:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.shape=new bg,e.setShapeProperties(),e.shape.addTo(e.graph),t.next=5,e.$nextTick();case 5:e.toggleInterruptingStyle(),n=e.getTaskUnderShape(),e.attachBoundaryEventToTask(n),e.updateShapePosition(n),e.node.fromCrown&&e.addMultiplayerBoundaryEvent();case 10:case"end":return t.stop()}}),t)})))()}},wg=yg,xg=fr(wg,gg,vg,!1,null,null,null),kg=xg.exports,Cg={id:"processmaker-modeler-boundary-event",component:kg,bpmnType:"bpmn:BoundaryEvent",control:!0,category:"BPMN",label:"Boundary Event",definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Event"),cancelActivity:!0})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},validateIncoming:function(){return!1},inspectorConfig:[{name:"Boundary Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-boundary-event"},items:[{component:"FormInput",config:_a}]}]}]},Sg=f(67629),Eg=f.n(Sg),Ag=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.explorerOpen,expression:"explorerOpen"}],attrs:{id:"explorer-rail","data-test":"explorer-rail"}},[t("div",{staticClass:"rail-menu"},[t("b-tabs",{staticClass:"tabs--container",attrs:{"no-nav-style":!0}},[e._l(e.tabs,(function(n){return[t("b-tab",{key:n.idx,attrs:{title:e.$t(n.label),active:n.idx===e.tabIndex},on:{click:function(t){return e.setTabIndex(n.idx)}}})]}))],2),t("div",{staticClass:"close--container",on:{click:function(t){return e.closeRail()}}},[t("font-awesome-icon",{attrs:{icon:e.faTimes()}})],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:0===e.tabIndex,expression:"tabIndex === 0"}],staticClass:"node-types__container"},[t("filter-node-types",{attrs:{type:"object"}}),t("node-types-loop",e._g({},e.$listeners))],1),t("div",{directives:[{name:"show",rawName:"v-show",value:1===e.tabIndex,expression:"tabIndex === 1"}],staticClass:"pm-blocks__container"},[t("filter-node-types",{attrs:{type:"pmBlock"}}),t("pm-blocks-loop",e._g({},e.$listeners))],1)])},_g=[],Tg=5e3;zt().use(Nn);var Mg=new Nn.Store({state:{nodeTypes:[],pinnedNodeTypes:[],filteredNodeTypes:[],pmBlockNodeTypes:[],filteredPmBlockNodeTypes:[],explorerOpen:!1,searchTerm:"",selectedNode:null,ghostNode:null},getters:{getNodeTypes:function(e){return e.nodeTypes},getPinnedNodeTypes:function(e){return e.pinnedNodeTypes},getFilteredNodeTypes:function(e){return e.filteredNodeTypes},getExplorerOpen:function(e){return e.explorerOpen},getSearchTerm:function(e){return e.searchTerm},getPmBlockNodeTypes:function(e){return e.pmBlockNodeTypes},getFilteredPmBlockNodeTypes:function(e){return e.filteredPmBlockNodeTypes},getSelectedNode:function(e){return e.selectedNode},getGhostNode:function(e){return e.ghostNode}},mutations:{setNodeTypes:function(e,t){e.nodeTypes=t.filter((function(e){return e.control})).map((function(e){var t;return{id:(0,Er.uniqueId)("nodeType_"),type:e.id,icon:e.icon,label:e.label,bpmnType:e.bpmnType,rank:e.rank||Tg,items:null===(t=e.items)||void 0===t?void 0:t.map((function(e){return Qr(Qr({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setPinnedNodes:function(e,t){e.pinnedNodeTypes.push(t),e.pinnedNodeTypes=(0,Er.uniqBy)(e.pinnedNodeTypes,"type"),e.pinnedNodeTypes.sort((function(e,t){return e.rank-t.rank}))},setUnpinNode:function(e,t){e.pinnedNodeTypes=e.pinnedNodeTypes.filter((function(e){return e!==t}))},setFilteredNodeTypes:function(e,t){var n=e.pinnedNodeTypes,r=e.nodeTypes;e.searchTerm=t;var o=(0,Er.uniqBy)([].concat(W(n),W(r)),"id");e.filteredNodeTypes=o.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))},setPmBlockNodeTypes:function(e,t){e.pmBlockNodeTypes=t.filter((function(e){return e.control})).map((function(e){var t;return{id:(0,Er.uniqueId)("pmBlockNode_"),type:e.id,icon:e.icon,customIcon:e.customIcon,svgIcon:e.svgIcon,label:e.label,description:e.description,bpmnType:e.bpmnType,rank:e.rank||Tg,items:null===(t=e.items)||void 0===t?void 0:t.map((function(e){return Qr(Qr({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setFilteredPmBlockNodeTypes:function(e,t){var n=e.pmBlockNodeTypes;e.searchTerm=t;var r=(0,Er.uniqBy)(W(n),"id");e.filteredPmBlockNodeTypes=r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))},clearFilteredNodes:function(e){e.filteredNodeTypes=[],e.searchTerm=""},clearFilteredPmBlockNodes:function(e){e.filteredNodeTypes=[],e.filteredPmBlockNodeTypes=[],e.searchTerm=""},closeExplorer:function(e){e.explorerOpen=!1},toggleExplorer:function(e){e.explorerOpen=!e.explorerOpen},setSelectedNode:function(e,t){e.selectedNode=t},clearSelectedNode:function(e){e.selectedNode=null},setGhostNode:function(e,t){e.ghostNode=t}},actions:{getUserPinnedObjects:function(e){var t,n,r=e.commit;if("standalone"!==(null===(t=window.ProcessMaker)||void 0===t||null===(n=t.user)||void 0===n?void 0:n.id)){var o=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.get("/users/".concat(o,"/get_pinnned_controls")).then((function(e){var t=e.data;t.forEach((function(e){r("setPinnedNodes",e)}))})).catch((function(e){console.error(e)}))}else{var i=localStorage.pinnedNodes?JSON.parse(localStorage.pinnedNodes):[];i.forEach((function(e){r("setPinnedNodes",e)}))}},addUserPinnedObject:function(e,t){var n,r,o=e.commit,i=e.state;o("setPinnedNodes",t);var s=i.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(r=n.user)||void 0===r?void 0:r.id)){var a=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(a,"/update_pinned_controls"),{pinnedNodes:s}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(s)},removeUserPinnedObject:function(e,t){var n,r,o=e.commit,i=e.state;o("setUnpinNode",t);var s=i.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(r=n.user)||void 0===r?void 0:r.id)){var a=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(a,"/update_pinned_controls"),{pinnedNodes:s}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(s)}}}),Pg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"searchNodeTypes"}},[t("label",{staticClass:"position-relative d-block"},[t("i",{staticClass:"fas fa-search position-absolute h-100 text-muted ml-2"}),t("b-input",{attrs:{placeholder:e.placeholder},model:{value:e.searchTerm,callback:function(t){e.searchTerm=t},expression:"searchTerm"}})],1)])},Ig=[],Og={name:"FilterNodeTypes",props:["type"],data:function(){return{searchTerm:""}},watch:{searchTerm:function(e){"pmBlock"===this.type?(0===e.length&&Mg.commit("clearFilteredPmBlockNodes"),e.length>0&&Mg.commit("setFilteredPmBlockNodeTypes",e)):(0===e.length&&Mg.commit("clearFilteredNodes"),e.length>0&&Mg.commit("setFilteredNodeTypes",e))},type:function(e,t){this.searchTerm=t===e?this.searchTerm:""}},computed:{nodeTypes:function(){var e=Mg.getters.getPinnedNodeTypes,t=Mg.getters.getNodeTypes;return[].concat(W(e),W(t))},pmBlockNodes:function(){var e=Mg.getters.getPmBlockNodeTypes;return W(e)},placeholder:function(){return"pmBlock"===this.type?this.$t("Search PM Blocks"):this.$t("Search Objects")}}},Dg=Og,Ng=(f(29062),fr(Dg,Pg,Ig,!1,null,"c468f432",null)),Rg=Ng.exports,Bg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"nodeTypesList"}},[e.filteredNodes.length>0?t("div",{attrs:{id:"filteredNodes-container"}},[e._l(e.filteredNodes,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.target!==t.currentTarget?null:e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),e.nodeTypeAlreadyPinned(n,n.type)?t("img",{staticClass:"pinIcon",attrs:{src:e.pinFillIcon,alt:"Unpin Element"},on:{click:function(t){return e.unPin(n)}}}):t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin Element"},on:{click:function(t){return e.addPin(n)}}})])]}))],2):e._e(),0!==e.filteredNodes.length||e.searchTerm?e._e():[e.pinnedObjects.length>0?t("div",{staticClass:"pinnedObjects"},[t("p",[e._v(e._s(e.$t("Pinned Objects")))]),e._l(e.pinnedObjects,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),t("img",{staticClass:"pinIcon",attrs:{src:e.pinFillIcon,alt:"Pin/Unpin Element"},on:{click:function(t){return e.unPin(n)}}})])]}))],2):e._e(),t("div",{staticClass:"objectCategory"},[t("p",[e._v(e._s(e.$t("Object Category")))]),e._l(e.unpinnedObjects,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin/Unpin Element"},on:{click:function(t){return e.addPin(n)}}})])]}))],2)]],2)},Lg=[],jg=f.p+"img/pin-angle.95ef112b.svg",Fg=f.p+"img/pin-angle-fill.45c5a07f.svg",zg={methods:{containsSvg:function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/;return"string"===typeof e&&(t.test(e)||n.test(e))}}},Ug={mixins:[zg],data:function(){return{wasClicked:!1,selectedSubmenuItem:null,xOffset:0,yOffset:0,helperStyles:{backgroundColor:"#ffffff",position:"absolute",height:"40px",width:"40px",zIndex:"10",opacity:"0.5",pointerEvents:"none"},popperType:null}},methods:{onClickHandler:function(e,t){var n=this;this.createDraggingHelper(e,t),document.addEventListener("mousemove",this.setDraggingPosition),this.setDraggingPosition(e),this.selectedItem&&this.selectedItem.type===t.type?this.deselect():(this.wasClicked=!0,Mg.commit("setSelectedNode",t),this.$emit("onSetCursor","crosshair"),this.parent||(this.popperType=t.type),window.ProcessMaker.EventBus.$on("custom-pointerclick",(function(e){window.ProcessMaker.EventBus.$off("custom-pointerclick"),document.removeEventListener("mousemove",n.setDraggingPosition),n.movedElement&&document.body.removeChild(n.movedElement),n.popperType=null,n.selectedSubmenuItem=null,n.onCreateElement(e),Mg.commit("clearSelectedNode"),Mg.commit("setGhostNode",null),n.$emit("onSetCursor","none")})))},onCreateElement:function(e){this.wasClicked&&this.selectedItem&&(this.parent&&(this.parent=null),this.$emit("onCreateElement",{event:e,control:this.selectedItem}),this.wasClicked=!1,e.preventDefault())},setDraggingPosition:function(e){var t=e.pageX,n=e.pageY,r=this.movedElement;r&&(r.style.left="".concat(t,"px"),r.style.top="".concat(n,"px")),Mg.commit("setGhostNode",r)},createDraggingHelper:function(e,t){this.movedElement&&(document.removeEventListener("mousemove",this.setDraggingPosition),document.body.removeChild(this.movedElement));var n=this.containsSvg(t.icon),r=n?document.createElement("img"):document.createElement("i");Object.assign(r.style,this.helperStyles),n?r.src=t.icon:r.setAttribute("class",t.icon),document.body.appendChild(r),Mg.commit("setGhostNode",r);var o=e.target;this.xOffset=e.clientX-o.getBoundingClientRect().left,this.yOffset=e.clientY-o.getBoundingClientRect().top},deselect:function(){window.ProcessMaker.EventBus.$off("custom-pointerclick"),document.removeEventListener("mousemove",this.setDraggingPosition),this.movedElement&&document.body.removeChild(this.movedElement),this.$emit("onSetCursor","none"),this.wasClicked=!1,Mg.commit("clearSelectedNode"),Mg.commit("setGhostNode",null)}},computed:{selectedItem:function(){return Mg.getters.getSelectedNode},movedElement:function(){return Mg.getters.getGhostNode}}},qg={name:"NodeTypesLoop",mixins:[Ug,zg],data:function(){return{pinIcon:jg,pinFillIcon:Fg,showPin:!1}},created:function(){Mg.dispatch("getUserPinnedObjects")},methods:{nodeTypeAlreadyPinned:function(e,t){return!!this.pinnedObjects.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Mg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Mg.dispatch("addUserPinnedObject",e)}},computed:{pinnedObjects:function(){return Mg.getters.getPinnedNodeTypes},objects:function(){return Mg.getters.getNodeTypes},unpinnedObjects:function(){var e=this,t=this.objects;return t.filter((function(t){return!e.pinnedObjects.some((function(e){return e.type===t.type}))}))},filteredNodes:function(){return Mg.getters.getFilteredNodeTypes},searchTerm:function(){return Mg.getters.getSearchTerm}}},Vg=qg,Hg=(f(66456),fr(Vg,Bg,Lg,!1,null,null,null)),Wg=Hg.exports,Gg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"pmBlockNodeTypesList"}},[e.filteredPmBlockNodes.length>0?t("div",{attrs:{id:"filteredPmBlockNodes-container"}},[e._l(e.filteredPmBlockNodes,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",on:{click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[t("div",{staticClass:"d-flex"},[n.svgIcon?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"node-types__item__icon",class:n.customIcon}),t("label",[e._v(e._s(e.$t(n.label)))])])])]}))],2):e._e(),0!==e.filteredPmBlockNodes.length||e.searchTerm?e._e():[t("div",{staticClass:"pmBlocksContainer p-2"},[e._l(e.pmBlockNodeTypes,(function(n){return[t("div",{key:n.id,staticClass:"pm-block-node-types__item p-2 d-block",on:{click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[t("div",{staticClass:"d-flex"},[n.svgIcon?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"node-types__item__icon",class:n.customIcon}),t("label",[e._v(e._s(e.$t(n.label)))])])])]}))],2)]],2)},$g=[],Xg={name:"PmBlocksLoop",mixins:[Ug],computed:{pmBlockNodeTypes:function(){return Mg.getters.getPmBlockNodeTypes},filteredPmBlockNodes:function(){return Mg.getters.getFilteredPmBlockNodeTypes},searchTerm:function(){return Mg.getters.getSearchTerm}}},Yg=Xg,Jg=(f(48649),fr(Yg,Gg,$g,!1,null,null,null)),Zg=Jg.exports,Kg={name:"ExplorerRail",props:{explorerExpanded:{type:Boolean},nodeTypes:{type:Array},pmBlockNodes:{type:Array}},components:{FontAwesomeIcon:To.FontAwesomeIcon,FilterNodeTypes:Rg,NodeTypesLoop:Wg,PmBlocksLoop:Zg},data:function(){return{tabs:[{idx:0,label:"Add Object"},{idx:1,label:"PM Blocks"}],tabIndex:0}},computed:{explorerOpen:function(){return Mg.getters.getExplorerOpen}},created:function(){Mg.commit("setNodeTypes",this.nodeTypes)},methods:{faTimes:function(){return is.faTimes},setTabIndex:function(e){this.tabIndex!==e&&(this.tabIndex=e,this.clearFilteredObjects())},closeRail:function(){Mg.commit("closeExplorer"),this.clearFilteredObjects()},clearFilteredObjects:function(){Mg.commit("clearFilteredNodes"),Mg.commit("clearFilteredPmBlockNodes")}}},Qg=Kg,ev=(f(14906),fr(Qg,Ag,_g,!1,null,null,null)),tv=ev.exports,nv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message d-flex flex-column w-100 align-items-center"},[t("b-button",{staticClass:"new-process-btn d-flex flex-row px-2 py-4 align-items-center",on:{click:function(t){return e.redirectToAiProcess()}}},[t("div",{staticClass:"d-flex justify-content-between"},[t("inline-svg",{staticClass:"mx-3 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("div",{staticClass:"mr-2 text-left"},[t("div",{staticClass:"h5 m-0"},[e._v(e._s(e.aiProcessButtonTitle))]),t("div",{staticClass:"text-secondary font-weight-light small"},[this.promptSessionId&&""!==this.promptSessionId?t("div",{staticClass:"d-flex align-items-center"},[e._v(" "+e._s(e.$t("Last session by:"))+" "),t("avatar-image",{staticClass:"ml-2 mr-1 d-flex align-items-center",attrs:{size:"18","input-data":e.lastSession,"hide-name":"true"}}),e._v(" "+e._s(e.aiProcessButtonSubtitle)+" ")],1):t("div",[e.showSessionLoader?t("span",[t("i",{staticClass:"fa fa-spinner fa-spin"})]):e._e(),t("span",[e._v(e._s(e.aiProcessButtonSubtitle))])])])])],1),t("span",{staticClass:"fa fa-chevron-right mx-3"})]),t("div",{staticClass:"d-flex justify-content-center align-items-center flex-column justify-content-center"},[t("div",{staticClass:"justify-content-center align-items-center w-100 text-center my-4"},[t("div",{staticClass:"text-align-center d-flex text-center justify-content-center align-items-center"},[t("div",{staticClass:"hyphen"}),e._v(" "+e._s(e.$t("or"))+" "),t("div",{staticClass:"hyphen"})])]),t("div",{staticClass:"w-100"},[e._v(" "+e._s(e.$t("Click and drop objects to build the process you like."))+" ")])])],1)},rv=[];const ov={};function iv(e){return Object.keys(e).reduce(((t,n)=>(!1!==e[n]&&null!==e[n]&&void 0!==e[n]&&(t[n]=e[n]),t)),{})}const sv={name:"InlineSvg",inheritAttrs:!1,render(e){return this.svgElSource?e("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),iv(this.$attrs)),domProps:{innerHTML:this.getSvgContent(this.svgElSource)}}):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0}},data(){return{svgElSource:null}},watch:{src(e){this.getSource(e)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t},getSvgContent(e){return e=e.cloneNode(!0),e=this.transformSource(e),this.title&&av(e,this.title),e.innerHTML},getSource(e){ov[e]||(ov[e]=this.download(e)),this.svgElSource&&ov[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),ov[e].then((e=>{this.svgElSource=e,this.$nextTick((()=>{this.$emit("loaded",this.$el)}))})).catch((t=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete ov[e],this.$emit("error",t)}))},download(e){return cv(new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.onload=()=>{if(r.status>=200&&r.status<400)try{const e=new DOMParser,o=e.parseFromString(r.responseText,"text/xml");let i=o.getElementsByTagName("svg")[0];i?t(i):n(new Error('Loaded file is not valid SVG"'))}catch(e){n(e)}else n(new Error("Error loading SVG"))},r.onerror=n,r.send()})))}}};function av(e,t){const n=e.getElementsByTagName("title");if(n.length)n[0].textContent=t;else{const n=document.createElementNS("http://www.w3.org/2000/svg","title");n.textContent=t,e.insertBefore(n,e.firstChild)}}function cv(e){if(e.getIsPending)return e;let t=!0,n=e.then((e=>(t=!1,e)),(e=>{throw t=!1,e}));return n.getIsPending=function(){return t},n}var lv={name:"WelcomeMessage",components:{InlineSvg:sv},data:function(){var e,t,n;return{proceC2Icon:f(7225),lastSession:{},history:[],processId:null===(e=window.ProcessMaker)||void 0===e||null===(t=e.modeler)||void 0===t||null===(n=t.process)||void 0===n?void 0:n.id}},computed:{promptSessionId:function(){var e=this,t=localStorage.getItem("promptSessions");t=t?JSON.parse(t):[];var n=t.find((function(t){return t.processId===e.processId&&t.server===window.location.host}));return n?n.promptSessionId:""},showSessionLoader:function(){return!(!this.promptSessionId||""===this.promptSessionId||void 0!==this.lastSession.firstname)},aiProcessButtonTitle:function(){return this.promptSessionId&&""!==this.promptSessionId?this.$t("Continue AI session"):this.$t("Create a process with AI")},aiProcessButtonSubtitle:function(){return this.promptSessionId&&""!==this.promptSessionId?"".concat(this.lastSession.firstname," ").concat(this.lastSession.lastnameInitials,". | ").concat(this.formatDateTime(this.lastSession.requestDate)):this.$t("Kick-start an AI generated process")}},mounted:function(){localStorage.getItem("promptSessions")&&"null"!==localStorage.getItem("promptSessions")||localStorage.setItem("promptSessions",JSON.stringify([])),this.promptSessionId&&""!==this.promptSessionId&&this.getLastSharedHistory()},methods:{redirectToAiProcess:function(){var e,t=null!==(e=window.ProcessMaker.modeler.process.id)&&void 0!==e?e:null;if(t){var n="/package-ai/processes/create/".concat(t,"/").concat(t);window.location=n}},getLastSharedHistory:function(){var e=this,t="/package-ai/getLastSharedSessionHistory",n={sharedSessionId:this.promptSessionId};window.ProcessMaker.apiClient.post(t,n).then((function(t){e.$set(e.lastSession,"requestDate",t.data.requestDate),e.$set(e.lastSession,"firstname",t.data.firstname),e.$set(e.lastSession,"lastname",t.data.lastname),e.$set(e.lastSession,"lastnameInitials",t.data.lastnameInitials),e.$set(e.lastSession,"avatar",t.data.avatar)})).catch((function(t){var n,r,o=(null===(n=t.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)||t.message;e.loading=!1,window.ProcessMaker.alert(o,"danger")}))},formatDateTime:function(e){var t="";return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.datetime_format&&(t=window.ProcessMaker.user.datetime_format),e?window.moment(e).isValid()?window.moment(e).format(t):e:"n/a"}}},dv=lv,uv=(f(43207),fr(dv,nv,rv,!1,null,null,null)),hv=uv.exports,pv=f(33293),fv=f(82729),mv=f.n(fv),gv=function(){var e=this,t=e._self._c;return t("button",{staticClass:"inspector-button",attrs:{type:"button","data-cy":"inspector-button"},on:{click:e.toggleInspector}},[t("inline-svg",{attrs:{src:e.inspectorIcon}})],1)},vv=[],bv={components:{InlineSvg:sv},props:{showInspector:{type:Boolean,default:!0}},data:function(){return{inspectorIcon:f(28400)}},methods:{toggleInspector:function(){this.$emit("toggleInspector",!this.showInspector)}}},yv=bv,wv=(f(5728),fr(yv,gv,vv,!1,null,"cebfb20a",null)),xv=wv.exports,kv=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"inspector"}},[t("b-col",{staticClass:"pl-0 h-100 overflow-hidden inspector-column",class:[{"ignore-pointer":e.canvasDragPosition,"ai-inspector":e.isAiInspector}],attrs:{id:"inspector","data-test":"inspector-column"}},[t("b-card",{staticClass:"inspector-container border-top-0 border-bottom-0 border-right-0 rounded-0",style:{height:e.parentHeight},attrs:{"no-body":"","data-test":"inspector-container","data-cy":"inspector-panel"},scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"inspector-header"},[t("div",{staticClass:"inspector-header-title"},[e._v(" "+e._s(e.inspectorHeaderTitle)+" ")]),t("button",{staticClass:"close",attrs:{type:"button","aria-label":"Close","data-cy":"inspector-close-button"},on:{click:e.onClose}},[e._v(" × ")])])]},proxy:!0}])},[e.highlightedNode?t("vue-form-renderer",{key:e.highlightedNode._modelerId,ref:"formRenderer",staticClass:"overflow-auto h-100 inspector-font-size",attrs:{data:e.data,config:e.config},on:{update:e.updateDefinition},nativeOn:{focusout:function(t){return e.updateState.apply(null,arguments)}}}):e._e()],1)],1)],1)},Cv=[],Sv=f(43637),Ev=f(21223),Av=(f(85780),f(50308)),_v=f.n(Av),Tv={id:"processmaker-modeler-process",bpmnType:"bpmn:Process",control:!1,label:"Process",inspectorConfig:[{name:"Process Information",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-process"},items:[{component:"FormInput",config:Ns},{component:"FormInput",config:{label:"Name",helper:"The Name of the Process",name:"name",placeholder:""}}]}]}]},Mv=Tv.id,Pv=Tv;zt().component("FormText",Sv.renderer.FormText),zt().component("FormInput",Ev.FormInput),zt().component("FormSelect",Ev.FormSelect),zt().component("FormTextArea",Ev.FormTextArea),zt().component("FormCheckbox",Ev.FormCheckbox),zt().component("FormRadioButtonGroup",Ev.FormRadioButtonGroup),zt().component("FormAccordion",Ev.FormAccordion),zt().component("FormDatePicker",Ev.FormDatePicker),zt().component("FormMultiSelect",Ev.FormMultiSelect);var Iv={components:{},props:["nodeRegistry","moddle","processNode","parentHeight","canvasDragPosition","definitions"],data:function(){return{data:{},config:[],inspectorHandler:null,translated:[],isVisible:!0}},watch:{highlightedNode:function(){document.activeElement.blur(),this.prepareData(),this.prepareConfig()},"highlightedNode.definition.assignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentLock":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.allowReassignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedUsers":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedGroups":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentRules":function(e,t){this.handleAssignmentChanges(e,t)}},computed:{inspectorHeaderTitle:function(){return"package-ai/processmaker-ai-assistant"===this.data.implementation?this.$t("AI Assistant"):this.$t("Configuration")},isAiInspector:function(){return"package-ai/processmaker-ai-assistant"===this.data.implementation},highlightedNode:function(){return Un.getters.highlightedNodes[0]},isAnyNodeActive:function(){return this.highlightedNode},updateDefinition:function(){var e=this;if(!this.isAnyNodeActive)return _v();var t=this.defaultInspectorHandler;return this.isProcessNodeActive&&(t=this.processNodeInspectorHandler),this.hasCustomInspectorHandler&&(t=this.customInspectorHandler),function(n){if(n){if(ja()(n.documentation)&&$()(e.highlightedNode.definition.get("documentation")[0],"text")!==n.documentation){var r=n.documentation?[e.moddle.create("bpmn:Documentation",{text:n.documentation})]:void 0;e.setNodeProp(e.highlightedNode,"documentation",r),e.multiplayerHook("documentation",r,Un.state.isMultiplayer)}t(lc()(n,["documentation"]),Un.state.isMultiplayer)}}},hasCustomInspectorHandler:function(){return this.nodeRegistry[this.highlightedNode.type].inspectorHandler},isProcessNodeActive:function(){return this.highlightedNode===this.processNode}},methods:{onClose:function(){this.$emit("toggleInspector",!1)},handleAssignmentChanges:function(e,t){e!==t&&this.prepareData()},prepareConfig:function(){if(!this.highlightedNode)return this.config={name:"Empty",items:[]};var e=this.highlightedNode,t=e.type,n=e.definition;if(this.highlightedNode===this.processNode)return this.config=Pv.inspectorConfig;var r=ho()(this.nodeRegistry[t].inspectorConfig),o=$()(r,"[0].items[0].items");if(this.isSequenceFlow(t)&&this.isConnectedToGateway(n)){var i=this.$t("Enter the expression that describes the workflow condition");i+=' <a href="https://docs.processmaker.com/designing-processes/expression-syntax-components" target="_blank"><i class="far fa-question-circle mr-1"></a>';var s={component:"FormInput",config:{label:this.$t("Expression"),helper:i,name:"conditionExpression"}},a=o.find((function(e){return e.config&&"Name"===e.config.label})),c=o.indexOf(a);a&&c>=0?o.splice(c+1,0,s):o.push(s)}return this.config=r},prepareData:function(){if(!this.highlightedNode)return{};var e=this.highlightedNode&&this.highlightedNode.type,t=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})};this.data=e&&this.nodeRegistry[e].inspectorData?this.nodeRegistry[e].inspectorData(this.highlightedNode,t,this):t(this.highlightedNode)},isSequenceFlow:function(e){return e===gl},isConnectedToGateway:function(e){return["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type)},isConnectedToSubProcess:function(e){return"bpmn:CallActivity"===e.targetRef.$type},customInspectorHandler:function(e,t){return this.nodeRegistry[this.highlightedNode.type].inspectorHandler(e,this.highlightedNode,this.setNodeProp,this.moddle,this.definitions,this.defaultInspectorHandler,t)},processNodeInspectorHandler:function(e,t){return this.defaultInspectorHandler(lc()(e,["artifacts","flowElements","laneSets"]),t)},setNodeProp:function(e,t,n){this.$emit("shape-resize"),Un.commit("updateNodeProp",{node:e,key:t,value:n})},defaultInspectorHandler:function(e,t){for(var n in lc()(e,["$type","eventDefinitions"]))this.highlightedNode.definition.get(n)!==e[n]&&(this.multiplayerHook(n,e[n],t),this.setNodeProp(this.highlightedNode,n,e[n]))},updateState:function(){this.$emit("save-state")},multiplayerHook:function(e,t,n){n&&window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:this.highlightedNode.definition.id,key:e,value:t})}}},Ov=Iv,Dv=(f(86020),fr(Ov,kv,Cv,!1,null,"40e10039",null)),Nv=Dv.exports,Rv=function(){var e=this,t=e._self._c;return t("b-row",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"resizableDiv",on:{mouseup:e.onMouseUp,mousemove:e.onMouseMove}},[t("b-col",{staticClass:"col-auto p-0 resizer-column",on:{mousedown:e.onMouseDown}}),t("b-col",{staticClass:"pl-0 h-100 overflow-hidden preview-column",style:{width:e.panelWidth+"px"},attrs:{"data-test":"preview-panel"}},[t("b-row",{staticClass:"control-bar"},[t("b-col",{attrs:{cols:"9"}},[t("div",[t("i",{directives:[{name:"show",rawName:"v-show",value:1===e.selectedPreview,expression:"selectedPreview === 1"}],staticClass:"fas fa-file-alt"}),t("b",{directives:[{name:"show",rawName:"v-show",value:2===e.selectedPreview,expression:"selectedPreview === 2"}]},[e._v(" {} ")]),t("b-dropdown",{staticClass:"preview-type-dropdown",attrs:{variant:"ellipsis","no-caret":"","no-flip":"",lazy:""},scopedSlots:e._u([{key:"button-content",fn:function(){return[t("i",{staticClass:"fas fa-sort-down"})]},proxy:!0}]),model:{value:e.selectedPreview,callback:function(t){e.selectedPreview=t},expression:"selectedPreview"}},[t("b-dropdown-item",{key:"1",staticClass:"ellipsis-dropdown-item mx-auto",on:{click:function(t){return e.onSelectedPreview(1)}}},[t("div",{staticClass:"ellipsis-dropdown-content"},[t("b",{staticClass:"pr-1 fa-fw fas fa-file-alt"}),t("span",[e._v(e._s(e.$t("Document")))])])])],1),t("span",[e._v(e._s(e.$t("Preview"))+" - "+e._s(e.taskTitle))])],1)]),t("b-col",{staticClass:"actions"},[t("i",{directives:[{name:"show",rawName:"v-show",value:e.previewUrl,expression:"previewUrl"}],staticClass:"fas fa-external-link-alt",on:{click:function(t){return e.openAsset()}}}),t("i",{staticClass:"fas fa-times",on:{click:function(t){return e.onClose()}}})])],1),t("b-row",{staticClass:"divider"}),t("b-row",[t("div",{staticClass:"task-title"},[e._v(" "+e._s(e.taskTitle)+" ")])]),t("loading-preview",{directives:[{name:"show",rawName:"v-show",value:e.showSpinner,expression:"showSpinner"}]}),t("no-preview-available",{directives:[{name:"show",rawName:"v-show",value:!e.previewUrl,expression:"!previewUrl"}]}),t("iframe",{directives:[{name:"show",rawName:"v-show",value:!!e.previewUrl&&!e.showSpinner,expression:"!!previewUrl && !showSpinner"}],staticClass:"preview-iframe",attrs:{title:"Preview",src:e.previewUrl},on:{load:e.loading,mousemove:e.onMouseMove,mouseup:e.onMouseUp}})],1)],1)},Bv=[],Lv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"preview-placeholder"},[t("img",{attrs:{id:"preview-image",src:e.noPreviewImg,alt:"no preview"}}),t("h1",[e._v("No Resource Assigned")]),t("h2",[e._v("This is a placeholder screen. Please, assign a resource to this task.")])])},jv=[],Fv={data:function(){return{noPreviewImg:f(2431)}}},zv=Fv,Uv=(f(79763),f(17378),fr(zv,Lv,jv,!1,null,"cdc64a14",null)),qv=Uv.exports,Vv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"preview-placeholder"},[t("img",{attrs:{id:"preview-image",src:e.previewAsset,alt:"Preview Asset"}}),t("h1",[e._v("The preview is loading")]),t("h2",[e._v("Some assets can take some time to load")]),t("img",{attrs:{alt:"spinner",src:e.spinnerImg}})])},Hv=[],Wv={data:function(){return{previewAsset:f(74818),spinnerImg:f(95522)}}},Gv=Wv,$v=(f(24289),f(64346),fr(Gv,Vv,Hv,!1,null,"0cafde2c",null)),Xv=$v.exports,Yv={props:["nodeRegistry","visible","previewConfigs","panelWidth"],components:{NoPreviewAvailable:qv,LoadingPreview:Xv},data:function(){return{data:{},previewUrl:null,showSpinner:!1,selectedPreview:"1",taskTitle:"",itemTitle:"",width:600,currentPos:600}},watch:{previewUrl:function(e,t){e!==t&&(this.showSpinner=!0)},highlightedNode:function(){document.activeElement.blur(),this.prepareData()},"highlightedNode.definition":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentLock":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.allowReassignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedUsers":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedGroups":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentRules":function(e,t){this.handleAssignmentChanges(e,t)}},computed:{highlightedNode:function(){return Un.getters.highlightedNodes[0]}},methods:{loading:function(){this.showSpinner=!1},getConfig:function(e){return this.previewConfigs.find((function(t){return t.matcher(e)}))},openAsset:function(){var e=this.getConfig(this.data);window.open(e.assetUrl(this.data),"_blank")},prepareData:function(){var e,t,n;if(!this.highlightedNode)return{};var r=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})};this.data=r(this.highlightedNode),this.taskTitle=null===(e=this.data)||void 0===e?void 0:e.name,this.taskTitle=null===this||void 0===this||null===(t=this.highlightedNode)||void 0===t||null===(n=t.definition)||void 0===n?void 0:n.name,this.previewNode()},handleAssignmentChanges:function(e,t){if(e!==t){var n=this.getConfig(this.data);n?this.prepareData():this.$emit("togglePreview",!1)}},onSelectedPreview:function(e){this.selectedPreview=e},previewNode:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.highlightedNode&&(this.visible||r)){var o=this.previewConfigs.find((function(e){return e.matcher(n.data)})),i={};for(var s in this.data){var a;(null!==(a=null===o||void 0===o?void 0:o.receivingParams)&&void 0!==a?a:[]).includes(s)&&(i[s]=this.data[s])}var c=encodeURI(JSON.stringify(i)),l=Object.keys(i).length>0;this.previewUrl=o&&l?"".concat(o.url,"?node=").concat(c):null,this.taskTitle=null===(e=this.highlightedNode)||void 0===e||null===(t=e.definition)||void 0===t?void 0:t.name}},onClose:function(){this.$emit("togglePreview",!1)},onMouseDown:function(e){this.$emit("startResize",e)},onMouseUp:function(){this.$emit("stopResize")},onMouseMove:function(e){window.ProcessMaker.$modeler.isResizingPreview&&this.$emit("previewResize",e)},setWidth:function(e){var t=this.currentPos-e;this.currentPos=e,this.width=parseInt(this.width)+t}}},Jv=Yv,Zv=(f(70134),fr(Jv,Rv,Bv,!1,null,"65cadc71",null)),Kv=Zv.exports;zt().use(Nn);var Qv=new Nn.Store({state:{stack:[],position:null,disabled:!1,isVersionsInstalled:!1,isDraft:!1,isLoading:!1},getters:{canUndo:function(e){return e.position>0},canRedo:function(e){return e.position<e.stack.length-1},currentState:function(e){return e.stack[e.position]},isVersionsInstalled:function(e){return e.isVersionsInstalled},isDraft:function(e){return e.isDraft},isLoading:function(e){return e.isLoading}},mutations:{setPosition:function(e,t){e.position=t},setState:function(e,t){e.stack=e.stack.slice(0,e.position+1),e.stack.push(t)},clearStack:function(e){e.stack=[e.stack[e.stack.length-1]]},disableSavingState:function(e){e.disabled=!0},enableSavingState:function(e){e.disabled=!1},isVersionsInstalled:function(e,t){e.isVersionsInstalled=t},isDraft:function(e,t){e.isDraft=t},isLoading:function(e,t){e.isLoading=t}},actions:{pushState:function(e,t){var n=e.state,r=e.getters,o=e.commit;t===r.currentState||n.disabled||(o("setState",t),o("setPosition",n.stack.length-1))},undo:function(e){var t=e.state,n=e.getters,r=e.commit;n.canUndo&&r("setPosition",t.position-1)},redo:function(e){var t=e.state,n=e.getters,r=e.commit;n.canRedo&&r("setPosition",t.position+1)},enableVersions:function(e){var t=e.commit;t("isVersionsInstalled",!0)},setVersionIndicator:function(e,t){var n=e.commit;n("isDraft",t)},setLoadingState:function(e,t){var n=e.commit;n("isLoading",t)}}}),eb=f(51540),tb=f(51248),nb=f.n(tb),rb=f(48909),ob=f.n(rb),ib=f(82317),sb=f.n(ib),ab=f(83184),cb=f.n(ab),lb=f(36111),db=f.n(lb),ub=f(25795),hb=f.n(ub),pb=f(37554),fb=f.n(pb),mb=f(19869),gb=f.n(mb),vb=f(88687),bb=f.n(vb),yb=f(37028),wb=f.n(yb),xb=f(89185),kb=f.n(xb),Cb=f(34652),Sb=f.n(Cb),Eb=f(49252),Ab=f.n(Eb),_b=f(93414),Tb=f.n(_b),Mb=f(68522),Pb=f.n(Mb),Ib=f(7174),Ob=f.n(Ib),Db=f(74815),Nb=f.n(Db),Rb=f(24874),Bb=f.n(Rb),Lb={};function jb(){}jb.prototype.resolveRule=function(e,t){const n=Lb[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">");return n},jb.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">")};var Fb=new jb,zb={"conditional-flows":"error","end-event-required":"error","event-sub-process-typed-start-event":"error","label-required":"error","no-complex-gateway":"error","no-disconnected":"error","no-gateway-join-fork":"error","no-implicit-split":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"warning","processmaker/custom-validation":"error","processmaker/gateway-direction":"error","processmaker/event-based-gateway":"error","processmaker/call-activity-child-process":"error","processmaker/id-required":"error","processmaker/signal-ref-required":"error"},Ub={rules:zb},qb={resolver:Fb,config:Ub},Vb=qb;function Hb(e,t,n,r,o,i,s){var a={allowDrop:!1,poolTarget:null};if(!Yb(e,t,s))return a.allowDrop=!1,a;if($b(n.type))return a.allowDrop=!0,a;if(Jb(n.bpmnType)){var c=o.findModelsFromPoint(Zb(e,t,r)).sort((function(e,t){return t.get("z")-e.get("z")}))[0];return a.allowDrop=Oi(n.type,c),a}if(Xb(i))return a.allowDrop=!0,a;if(Wb(n.bpmnType))return a.allowDrop=!0,a;var l=Gb(e,t,r,o);return l&&(a.allowDrop=!0,a.poolTarget=l),a}function Wb(e){return"bpmn:TextAnnotation"===e}function Gb(e,t,n,r){return r.findModelsFromPoint(Zb(e,t,n)).find((function(e){var t=e.component;return t&&t.node.type===Jo}))}function $b(e){return e===Jo}function Xb(e){return!e||0===e.get("participants").length}function Yb(e,t,n){var r=n.getBoundingClientRect(),o=r.left,i=r.top,s=r.width,a=r.height,c=new F.g.rect(o,i,s,a),l=new F.g.Point(e,t);return c.containsPoint(l)}function Jb(e){return"bpmn:BoundaryEvent"===e}function Zb(e,t,n){return n.clientToLocalPoint({x:e,y:t})}Lb["bpmnlint/conditional-flows"]=nb(),Lb["bpmnlint/end-event-required"]=ob(),Lb["bpmnlint/event-sub-process-typed-start-event"]=sb(),Lb["bpmnlint/label-required"]=cb(),Lb["bpmnlint/no-complex-gateway"]=db(),Lb["bpmnlint/no-disconnected"]=hb(),Lb["bpmnlint/no-gateway-join-fork"]=fb(),Lb["bpmnlint/no-implicit-split"]=gb(),Lb["bpmnlint/single-event-definition"]=bb(),Lb["bpmnlint/start-event-required"]=wb(),Lb["bpmnlint/sub-process-blank-start-event"]=kb(),Lb["bpmnlint/superfluous-gateway"]=Sb(),Lb["bpmnlint-plugin-processmaker/custom-validation"]=Ab(),Lb["bpmnlint-plugin-processmaker/gateway-direction"]=Tb(),Lb["bpmnlint-plugin-processmaker/event-based-gateway"]=Pb(),Lb["bpmnlint-plugin-processmaker/call-activity-child-process"]=Ob(),Lb["bpmnlint-plugin-processmaker/id-required"]=Nb(),Lb["bpmnlint-plugin-processmaker/signal-ref-required"]=Bb();var Kb,Qb,ey,ty,ny,ry,oy,iy,sy,ay,cy,ly,dy=f(7407),uy=f.n(dy),hy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:uy()}}},py=hy,fy=fr(py,Kb,Qb,!1,null,null,null),my=fy.exports,gy="processmaker-modeler-boundary-error-event",vy=ac()(ho()(Cg),{id:gy,component:my,control:!1,label:"Boundary Error Event",icon:f(43634),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Error Event"),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorConfig:[{items:[{items:[{}]},Va,Na]}]}),by={extends:kg,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){this.shape.attr({image:{"ref-x":4,"ref-y":4,width:18,height:18}})}},yy=by,wy=fr(yy,ey,ty,!1,null,null,null),xy=wy.exports,ky={component:"FormCheckbox",config:{label:"Interrupting",name:"cancelActivity",helper:"Select to interrupt the current Request workflow and route to the alternate workflow, thereby preventing parallel workflow"}},Cy=ky,Sy="processmaker-modeler-boundary-conditional-event",Ey=ac()(ho()(Cg),Qr(Qr({},pp),{},{id:Sy,component:xy,control:!1,label:"Boundary Conditional Event",definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Conditional Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()),[Cy])},Na,Va]}]})),Ay=f.p+"img/boundary-escalation-icon.c999a95e.svg",_y={extends:kg,mounted:function(){this.shape.attr("image/xlink:href",Ay)},methods:{isValidBoundaryEventTarget:function(e){return Di(e.component)}}},Ty=_y,My=fr(Ty,ny,ry,!1,null,null,null),Py=My.exports,Iy="processmaker-modeler-boundary-escalation-event",Oy=ac()(ho()(Cg),{id:Iy,component:Py,control:!1,label:"Boundary Escalation Event",icon:f(62442),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Escalation Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:EscalationEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy]},Va,Na]}]}),Dy=f(81146),Ny=f.n(Dy),Ry={extends:kg,mixins:[tc],data:function(){return{nodeIcon:Ny()}},methods:{isValidBoundaryEventTarget:function(e){var t=e.component;return t&&t.node.isBpmnType("bpmn:CallActivity")}},mounted:function(){var e=mh();this.shape.attr(e)}},By=Ry,Ly=fr(By,oy,iy,!1,null,null,null),jy=Ly.exports,Fy="processmaker-modeler-boundary-message-event",zy=ac()(ho()(Cg),Qr(Qr({},ql),{},{id:Fy,component:jy,control:!1,label:"Boundary Message Event",icon:f(52018),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Message Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy,Fl("Message that will trigger this boundary event")]},Va,Na]}]})),Uy=f(16221),qy=f.n(Uy),Vy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:qy()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({image:{"ref-x":3,"ref-y":1,width:e.get("width")-15,height:e.get("height")-15}})}},Hy=Vy,Wy=fr(Hy,sy,ay,!1,null,null,null),Gy=Wy.exports,$y="processmaker-modeler-boundary-signal-event",Xy=ac()(ho()(Cg),Qr(Qr({},od),{},{id:$y,component:Gy,control:!1,label:"Boundary Signal Event",icon:f(34070),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Signal Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy,rd("Signal that will trigger this boundary event")]},Va,Na]}]})),Yy=f(50889),Jy=f.n(Yy),Zy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:Jy()}},methods:{addTimerEventDefinitionId:function(){var e="".concat(this.id,"_timer_event_definition");this.node.definition.get("eventDefinitions")[0].id=e}},mounted:function(){this.addTimerEventDefinitionId()}},Ky=Zy,Qy=fr(Ky,cy,ly,!1,null,null,null),ew=Qy.exports,tw="processmaker-modeler-boundary-timer-event",nw=ac()(ho()(Cg),{id:tw,component:ew,control:!1,label:"Boundary Timer Event",icon:f(99400),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Timer Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:TimerEventDefinition",{timeDuration:e.create("bpmn:Expression",{body:ah})})]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=Object.keys(o[0])[1],s=o[0][i].body;e[r]={type:i,body:s}}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=o.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,r.create("bpmn:Expression",{body:c})),u=[r.create("bpmn:TimerEventDefinition",d)];u[0].id=t.definition.get("eventDefinitions")[0].id,n(t,"eventDefinitions",u)}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{items:[{},Cy]},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-boundary-timer-event"},items:[{component:hh,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Na,Va]}]});function rw(e,t,n){var r=x(e,t,"set");return A(e,r,n),n}var ow=new WeakMap,iw=function(){function e(t){d(this,e),b(this,ow,{writable:!0,value:void 0}),y(this,"preventTranslate",!1),rw(this,ow,t)}return g(e,[{key:"paper",get:function(){return k(this,ow)}},{key:"scale",get:function(){return k(this,ow).scale()},set:function(e){k(this,ow).scale(e),k(this,ow).trigger("scale:changed")}},{key:"roundToNearestGridMultiple",value:function(t){return Math.round(t/e.gridSize)*e.gridSize}},{key:"ceilToNearestGridMultiple",value:function(t){return Math.ceil(t/e.gridSize)*e.gridSize}},{key:"translate",value:function(e,t){this.preventTranslate||(k(this,ow).translate(e,t),k(this,ow).trigger("translate:changed"))}},{key:"addEventHandler",value:function(e,t,n){k(this,ow).on(e,t,n)}},{key:"addOnceHandler",value:function(e,t){k(this,ow).once(e,t)}},{key:"removeEventHandler",value:function(e,t,n){k(this,ow).off(e,t,n)}},{key:"setPaperDimensions",value:function(e,t){k(this,ow).setDimensions(e,t)}},{key:"performAtomicAction",value:function(){var e=l(a().mark((function e(t){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return k(this,ow).freeze(),e.next=3,t(k(this,ow));case 3:k(this,ow).unfreeze();case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"clientToGridPoint",value:function(e,t){var n=k(this,ow).localToPagePoint(0,0),r=this.scale;return{x:this.roundToNearestGridMultiple((e-n.x)/r.sx),y:this.roundToNearestGridMultiple((t-n.y)/r.sy)}}},{key:"setStateInvalid",value:function(){this.paper.drawBackground({color:ze})}},{key:"setStateValid",value:function(){this.paper.drawBackground({color:Ue})}},{key:"awaitScheduledUpdates",value:function(){var e=this;return k(this,ow)._updates.priorities.some((function(e){return!F.util.isEmpty(e)}))?new Promise((function(t){e.addOnceHandler("render:done",t)})):Promise.resolve()}}],[{key:"factory",value:function(t,n,r){var o=3,i=new F.dia.Paper({async:!0,el:t,model:r,sorting:"sorting-approximate",gridSize:e.gridSize,drawGrid:!0,snapLinks:!1,snapElements:!1,clickThreshold:10,perpendicularLinks:!0,interactive:n,highlighting:{default:{options:{padding:o}}}});return i.translate(168,20),new this(i)}}]),e}();function sw(e,t,n){var r=lw(e,t,n);cw(r,t),e.inspectorConfig[0].items.sort(aw)}function aw(e,t){return dw(e)?1:dw(t)?-1:0}function cw(e,t){var n=e.findIndex((function(e){var n=!t.container&&t.config&&e.config&&t.config.name&&t.config.name===e.config.name;return t.id&&t.id===e.id||n}));-1!==n?e[n]=t:e.push(t)}function lw(e,t,n){return"undefined"!==typeof t.container?e.inspectorConfig[0].items:n?(e=e.inspectorConfig[0],n.split(".").forEach((function(t){e=e&&e.items.find((function(e){return e.config&&e.config.name===t}))})),e?e.items:null):e.inspectorConfig[0].items[0].items}function dw(e){return e.config&&"Advanced"===e.config.label}function uw(e,t){vw(e)&&pw(e);var n=gw(e);n&&pw(n),hw(e)&&!vw(e)&&fw(e),mw(t)}function hw(e){return e.component.node.type!==dl}function pw(e){fw(e);var t=e.component.node.definition.processRef&&e.component.node.definition.processRef.laneSets[0];if(t){var n=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type===dl})),r=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl}));n.forEach(fw),r.forEach(fw)}}function fw(e){e.toFront({deep:!0})}function mw(e){e.getLinks().forEach(fw)}function gw(e){return e.component.node.pool}function vw(e){return e.component.node.type===Jo}y(iw,"gridSize",kp);var bw=function(){var e=this,t=e._self._c;return t("b-row",{staticClass:"w-100 m-0"},[t("div",{staticClass:"toolbar d-flex justify-content-between align-items-center border-top border-bottom",class:{"ignore-pointer":e.canvasDragPosition},attrs:{role:"toolbar","aria-label":"Toolbar"}},[t("breadcrumb",{attrs:{"breadcrumb-data":e.breadcrumbData}}),t("div",{staticClass:"d-flex mr-3"},[t("TopRail",{attrs:{"validation-errors":e.validationErrors,warnings:e.warnings,players:e.players}},e._l(e.validationBar,(function(e,n){return t(e.button,{key:"validation-status-".concat(n),tag:"component"})})),1),t("div",{staticClass:"d-flex align-items-center btn-group btn-group-sm",attrs:{role:"group","aria-label":"Publish controls","data-cy":"publish-control"}},[t("div",{staticClass:"divider"}),e.isVersionsInstalled?[t("div",{staticClass:"toolbar-item toolbar-version-status",attrs:{"data-cy":"publish-version-status"}},[e._v(" "+e._s(e.versionStatus)+" ")]),t("div",{staticClass:"toolbar-item toolbar-loading-status",attrs:{"data-cy":"publish-loading-status"}},[t("span",[e._v(" "+e._s(e.loadingStatus)+" ")]),t("font-awesome-icon",{staticClass:"text-success",attrs:{icon:e.loadingIcon,spin:e.isLoading}})],1),t("a",{staticClass:"toolbar-item toolbar-publish",attrs:{title:e.$t("Publish"),"data-cy":"publish-btn"},on:{click:function(t){return e.$emit("saveBpmn")}}},[e._v(" "+e._s(e.$t("Publish"))+" ")]),t("a",{staticClass:"toolbar-item toolbar-close",attrs:{title:e.$t("Close"),"data-cy":"close-btn"},on:{click:function(t){return e.$emit("close")}}},[e._v(" "+e._s(e.$t("Close"))+" ")]),t("EllipsisMenu",{attrs:{actions:e.combinedMenuActions,divider:!1,"data-cy":"ellipsis-menu"},on:{navigate:e.onNavigate,show:e.onShow,hide:e.onHide}})]:[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"save-button",attrs:{"data-test":"mini-map-btn",title:e.$t("Save")},on:{click:function(t){return e.$emit("saveBpmn")}}},[t("font-awesome-icon",{attrs:{icon:e.saveIcon}}),t("span",{staticClass:"save-button-label"},[e._v(e._s(e.$t("Save")))])],1),t("b-btn",{staticClass:"ml-1 rounded",attrs:{disabled:!e.xmlManager,variant:"secondary",size:"sm","data-test":"downloadXMLBtn"},on:{click:function(t){e.xmlManager&&e.xmlManager.download()}}},[t("i",{staticClass:"fas fa-download mr-1"}),e._v(" "+e._s(e.$t("Download BPMN"))+" ")]),t("b-btn",{directives:[{name:"b-modal",rawName:"v-b-modal",value:"uploadmodal",expression:"'uploadmodal'"}],staticClass:"ml-1 rounded",attrs:{variant:"secondary",size:"sm"}},[t("i",{staticClass:"fas fa-upload mr-1"}),e._v(" "+e._s(e.$t("Upload XML"))+" ")])]],2)],1)],1)])},yw=[],ww=function(){var e=this,t=e._self._c;return t("nav",{attrs:{id:"breadcrumbs"}},[e.breadcrumbData.length>0?t("ol",{staticClass:"breadcrumb"},[e._m(0),e._l(e.breadcrumbData[0],(function(n,r){return t("li",{key:r,staticClass:"breadcrumb-item"},[n.url?t("a",{attrs:{href:n.url}},[e._v(e._s(n.text))]):e._e(),n.url?e._e():t("span",[e._v(e._s(n.text))])])}))],2):e._e()])},xw=[function(){var e=this,t=e._self._c;return t("li",{staticClass:"breadcrumb-item"},[t("a",{attrs:{href:"/"}},[t("i",{staticClass:"fas fa-home"})])])}],kw={name:"breadcrumb",props:{breadcrumbData:{type:Array,default:function(){return[]}}}},Cw=kw,Sw=(f(61573),fr(Cw,ww,xw,!1,null,"d1e148b4",null)),Ew=Sw.exports,Aw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"top-rail-container"},[t("MultiplayerViewUsers",{attrs:{players:e.players}}),t("ValidateIssue",{directives:[{name:"show",rawName:"v-show",value:e.isOpenIssue,expression:"isOpenIssue"}],attrs:{"number-of-errors":e.numberOfErrors},on:{openPanel:e.handleOpenPanel}}),t("ValidateButton",{on:{openIssue:e.handleOpenIssue}}),t("ValidatePanel",{directives:[{name:"show",rawName:"v-show",value:e.isOpenIssue&&e.isOpenPanel,expression:"isOpenIssue && isOpenPanel"}],attrs:{"error-list":e.errorList,warnings:e.warnings}}),e._t("default")],2)},_w=[],Tw=function(){var e=this,t=e._self._c;return t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],class:["validate-button",{"validate-button-active":e.isOpen}],attrs:{type:"button",title:e.$t("Auto validate"),"data-cy":"validate-button"},on:{click:function(t){return t.preventDefault(),e.handleOpen.apply(null,arguments)}}},[t("inline-svg",{attrs:{src:e.isOpen?e.validateOpenIcon:e.validateCloseIcon}})],1)},Mw=[],Pw={components:{InlineSvg:sv},data:function(){return{isOpen:!1,validateCloseIcon:f(13828),validateOpenIcon:f(78540)}},methods:{handleOpen:function(){this.isOpen=!this.isOpen,this.$emit("openIssue",this.isOpen)}},mounted:function(){var e=this;window.ProcessMaker.EventBus.$on("save-changes-activate-autovalidate",(function(){e.handleOpen()}))}},Iw=Pw,Ow=(f(70947),fr(Iw,Tw,Mw,!1,null,"5880bbc6",null)),Dw=Ow.exports,Nw=function(){var e=this,t=e._self._c;return t("button",{staticClass:"issue-box",attrs:{type:"button",disabled:0===e.numberOfErrors,"data-cy":"validate-issue-button"},on:{click:function(t){return t.preventDefault(),e.handleOpen.apply(null,arguments)}}},[t("span",{staticClass:"issue-title"},[e._v("Issues")]),t("span",{staticClass:"issue-badge"},[e._v(e._s(e.numberOfErrors))]),t("span",{staticClass:"issue-icon"},[t("inline-svg",{attrs:{src:e.isOpen?e.issueOpenIcon:e.issueCloseIcon}})],1)])},Rw=[],Bw={components:{InlineSvg:sv},props:{numberOfErrors:{type:Number,required:!0}},data:function(){return{isOpen:!1,issueCloseIcon:f(61339),issueOpenIcon:f(68058)}},watch:{numberOfErrors:function(e){0===e&&(this.isOpen=!1)}},methods:{handleOpen:function(){this.isOpen=!this.isOpen,this.$emit("openPanel",this.isOpen)}}},Lw=Bw,jw=(f(59724),fr(Lw,Nw,Rw,!1,null,"337583fe",null)),Fw=jw.exports,zw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"validate-container",attrs:{"data-cy":"validate-panel"}},[e._l(e.errorList,(function(n,r){return t("div",{key:"".concat(n.errorId,"_").concat(r),staticClass:"validate-item-box"},[t("vue-inline-svg",{attrs:{src:e.issueIcon}}),t("div",{staticClass:"validate-item-info"},[t("div",{staticClass:"validate-item-title"},[e._v(e._s(n.errorKey))]),t("div",{staticClass:"validate-item-description"},[e._v(e._s(n.message)+".")]),n.id?t("div",{staticClass:"validate-item-node"},[t("span",{staticClass:"validate-item-node-title"},[e._v(e._s(e.$t("Node ID"))+":")]),e._v(" "+e._s(n.id)+" ")]):e._e()])],1)})),e._l(e.warnings,(function(n,r){return t("div",{key:n.title+r,staticClass:"validate-item-box"},[t("vue-inline-svg",{attrs:{src:e.issueIcon}}),t("div",{staticClass:"validate-item-info"},[t("div",{staticClass:"validate-item-title"},[e._v(e._s(n.title))]),t("div",{staticClass:"validate-item-description"},[e._v(e._s(n.text)+".")])])],1)}))],2)},Uw=[],qw={components:{VueInlineSvg:sv},props:{errorList:{type:Array,required:!0},warnings:{type:Array,required:!0}},data:function(){return{issueIcon:f(4298)}}},Vw=qw,Hw=(f(95254),fr(Vw,zw,Uw,!1,null,"0722e36d",null)),Ww=Hw.exports,Gw=function(){var e=this,t=e._self._c;return e.isMultiplayer?e._e():t("b-avatar-group",{staticClass:"container"},[e._l(e.filteredPlayers,(function(e){return[t("Avatar",{key:e.key,attrs:{badgeBackgroundColor:e.color,imgSrc:e.avatar,userName:e.name}})]}))],2)},$w=[],Xw=function(){var e=this,t=e._self._c;return t("span",{staticClass:"b-avatar rounded-circle",style:{backgroundColor:e.generateColorHsl(e.userName,e.saturationRange,e.lightnessRange)}},[e.imgSrc?t("span",{staticClass:"b-avatar-img"},[t("img",{attrs:{src:e.imgSrc,alt:e.userName}})]):t("span",{staticClass:"b-avatar-text avatar-initials"},[t("span",[e._v(" "+e._s(this.getInitials(e.userName))+" ")])]),t("span",{staticClass:"b-avatar-badge badge-danger",style:{bottom:"0px",right:"0px",backgroundColor:e.badgeBackgroundColor}})])},Yw=[],Jw={props:{badgeBackgroundColor:{type:String,required:!1},imgSrc:{type:String,required:!1},userName:{type:String,required:!1}},data:function(){return{saturation:50,lightness:50,range:10}},computed:{saturationRange:function(){return this.getRange(this.saturation,this.range)},lightnessRange:function(){return this.getRange(this.lightness,this.range)}},methods:{getInitials:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(" "),n=t[0].charAt(0).toUpperCase(),r=t[t.length-1].charAt(0).toUpperCase();return"".concat(n).concat(r)},getHashOfString:function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return t=Math.abs(t),t},getRange:function(e,t){return[Math.max(0,e-t),Math.min(e+t,100)]},normalizeHash:function(e,t,n){return Math.floor(e%(n-t)+t)},generateHSL:function(e,t,n){var r=this.getHashOfString(e),o=this.normalizeHash(r,0,360),i=this.normalizeHash(r,t[0],t[1]),s=this.normalizeHash(r,n[0],n[1]);return[o,i,s]},HSLtoString:function(e){return"hsl(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%)")},generateColorHsl:function(e,t,n){return this.HSLtoString(this.generateHSL(e,t,n))}}},Zw=Jw,Kw=(f(4913),fr(Zw,Xw,Yw,!1,null,"1c50a604",null)),Qw=Kw.exports,ex={components:{Avatar:Qw},props:{players:{type:Array,required:!0}},computed:{filteredPlayers:function(){var e=(0,Er.uniqBy)(this.players,"name");return e.filter((function(e){var t;return e.name.toLowerCase()!==(null===(t=window.ProcessMaker.user)||void 0===t?void 0:t.fullName.toLowerCase())}))},isMultiplayer:function(){return Un.getters.isMultiplayer}}},tx=ex,nx=fr(tx,Gw,$w,!1,null,null,null),rx=nx.exports,ox={components:{ValidateButton:Dw,ValidateIssue:Fw,ValidatePanel:Ww,MultiplayerViewUsers:rx},props:{validationErrors:{type:Object,required:!0},warnings:{type:Array,required:!0},players:{type:Array,required:!1}},data:function(){return{isOpenIssue:!1,isOpenPanel:!1}},computed:{errorList:function(){return Object.entries(this.validationErrors).flatMap((function(e){var t=jt(e,2),n=t[0],r=t[1];return r.flatMap((function(e){return Qr(Qr({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))},numberOfErrors:function(){return this.errorList.length+this.warnings.length}},watch:{numberOfErrors:function(e){0===e&&(this.isOpenPanel=!1)}},methods:{handleOpenIssue:function(e){this.isOpenIssue=e,Un.commit("setAutoValidate",this.isOpenIssue)},handleOpenPanel:function(e){this.isOpenPanel=e}}},ix=ox,sx=(f(53713),fr(ix,Aw,_w,!1,null,"f6aad76c",null)),ax=sx.exports,cx={name:"tool-bar",components:{Breadcrumb:Ew,TopRail:ax,FontAwesomeIcon:To.FontAwesomeIcon},props:["canvasDragPosition","cursor","paperManager","isRendering","breadcrumbData","panelsCompressed","validationErrors","warnings","xmlManager","validationBar","players","extraActions"],watch:{miniMapOpen:function(e){this.$emit("toggle-mini-map-open",e)},canUndo:function(e){e||this.$root.$emit("bv::hide::tooltip")},canRedo:function(e){e||this.$root.$emit("bv::hide::tooltip")}},computed:{combinedMenuActions:function(){return this.extraActions?this.ellipsisMenuActions.concat(this.extraActions):this.ellipsisMenuActions},canUndo:function(){return Qv.getters.canUndo},canRedo:function(){return Qv.getters.canRedo},versionStatus:function(){var e=Qv.getters.isDraft?"Draft":"Published";return this.$t(e)},isVersionsInstalled:function(){return Qv.getters.isVersionsInstalled},isLoading:function(){return Qv.getters.isLoading},loadingStatus:function(){var e=this.isLoading?"Saving":"Saved";return this.$t(e)},loadingIcon:function(){return this.isLoading?this.spinner:this.savedIcon}},data:function(){return{plusIcon:is.faPlus,minusIcon:is.faMinus,scale:1,initialScale:1,minimumScale:.2,scaleStep:.1,mapIcon:is.faMapMarked,miniMapOpen:!1,compressIcon:is.faCompress,expandIcon:is.faExpand,undoIcon:is.faUndo,redoIcon:is.faRedo,saveIcon:is.faSave,savedIcon:is.faCheckCircle,spinner:is.faSpinner,ellipsisMenuActions:[{value:"save-template",content:this.$t("Save as Template"),icon:""},{value:"save-pm-block",content:this.$t("Save as PM Block"),icon:""},{value:"discard-draft",content:this.$t("Discard Draft"),icon:""}]}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("redo").then((function(){return e.$emit("load-xml")}))},onNavigate:function(e){switch(e.value){case"discard-draft":window.ProcessMaker.EventBus.$emit("open-versions-discard-modal");break;case"save-template":this.$emit("publishTemplate");break;case"save-pm-block":this.$emit("publishPmBlock");break;default:this.$emit("action",e)}},onShow:function(){var e=document.getElementById("inspector");e&&(e.style.zIndex="1")},onHide:function(){var e=document.getElementById("inspector");e&&(e.style.zIndex="2")}},mounted:function(){var e,t=null===(e=this.$root.$children[0])||void 0===e?void 0:e.process,n=this.ellipsisMenuActions.findIndex((function(e){return"save-template"===e.value}));null!==t&&void 0!==t&&t.is_template&&this.ellipsisMenuActions.splice(n,1),"PM_BLOCK"===(null===t||void 0===t?void 0:t.asset_type)&&this.ellipsisMenuActions.splice(n,2)}},lx=cx,dx=(f(91503),fr(lx,bw,yw,!1,null,null,null)),ux=dx.exports;function hx(e,t){var n=function(e){return e.isBpmnType("bpmn:MessageFlow",Tr,Or)||e.isType("processmaker-modeler-pool")};if(!n(e))if(e.isType("processmaker-modeler-lane"))t.get("laneSets")[0].get("lanes").push(e.definition);else{var r="flowElements";(e.isBpmnType("bpmn:TextAnnotation")||e.isBpmnType("bpmn:Association"))&&(r="artifacts"),t.get(r).push(e.definition)}}var px={methods:{zoomInOutHandler:function(e,t){var n="+"===e.key||"NumpadAdd"===e.key||107===e.keyCode||187===e.keyCode,r="-"===e.key||"NumpadSubtract"===e.key||109===e.keyCode||189===e.keyCode;n&&t.mod&&this.zoomIn(e),r&&t.mod&&this.zoomOut(e)},zoomIn:function(e){e.preventDefault(),this.canvasScale=this.paperManager.scale.sx+this.scaleStep},zoomOut:function(e){e.preventDefault(),this.canvasScale=Math.max(this.minimumScale,this.paperManager.scale.sx-=this.scaleStep)}}},fx={methods:{copyPasteHandler:function(e,t){var n=e.target.nodeName.toLowerCase(),r="body"===n,o=e.key.toLowerCase(),i="c"===o,s="v"===o;r&&i&&t.mod&&this.copy(e),r&&s&&t.mod&&this.paste(e)},copy:function(e){e.preventDefault(),window.ProcessMaker.$modeler.copyElement()},paste:function(e){e.preventDefault(),window.ProcessMaker.$modeler.pasteElements()}}},mx=(f(51532),iw.gridSize/2),gx=new Map;gx.set("Up",[0,-mx]),gx.set("Down",[0,mx]),gx.set("Left",[-mx,0]),gx.set("Right",[mx,0]);var vx=["PoolLane","processmaker.components.nodes.boundaryEvent.Shape"];function bx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(yx(e)){var r=t.filter(wx);if(0!==r.length){var o=xx(e),i=jt(o,2),s=i[0],a=i[1];r.forEach((function(e){e.translate(s,a,{movedWithArrowKeys:!0}),Cx(e)})),n()}}}function yx(e){var t=["up","down","left","right"];return t.some((function(t){return e.toLowerCase().includes(t)}))}function wx(e){return e&&!vx.includes(e.get("type"))}function xx(e){var t=e.match(/^(?:Arrow)?(Up|Down|Left|Right)$/);return null!==t?gx.get(t[1]):[0,0]}function kx(e){return!e||"processmaker.modeler.bpmn.pool"!==e.get("type")}function Cx(e){var t=e.getParentCell();kx(t)||(t.component.expandToFitElement(e,t),t.component.laneSet&&t.component.updateLaneChildren())}var Sx={methods:{escapeKeyHandler:function(e){this.selectedNode&&(e.preventDefault(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e))}},computed:{selectedNode:function(){return Mg.getters.getSelectedNode},movedElement:function(){return Mg.getters.getGhostNode}}},Ex={mixins:[px,fx,Sx],computed:{clientLeftPaper:function(){return Un.getters.clientLeftPaper}},mounted:function(){document.addEventListener("keydown",this.keydownListener),document.addEventListener("keyup",this.keyupListener)},methods:{handleHotkeys:function(e,t){this.zoomInOutHandler(e,t),this.copyPasteHandler(e,t),this.escapeKeyHandler(e)},keyupListener:function(e){"Space"===e.code&&(this.isGrabbing=!1,this.paperManager.removeEventHandler("blank:pointermove"))},keydownListener:function(e){var t=this,n=this.isAppleOS(),r=n?e.metaKey:e.ctrlKey,o={mod:r,isAppleOS:n,modeler:this};try{this.handleHotkeys(e,o)}catch(s){console.error(s)}var i=!e.target.toString().toLowerCase().includes("body");i||("Space"===e.code&&(this.isGrabbing=!0,this.paperManager.addEventHandler("blank:pointermove",(function(e,n,r){if(!t.canvasDragPosition){var o=t.paperManager.scale;t.canvasDragPosition={x:n*o.sx,y:r*o.sy}}t.canvasDragPosition&&!t.clientLeftPaper&&t.paperManager.translate(e.offsetX-t.canvasDragPosition.x,e.offsetY-t.canvasDragPosition.y)}))),bx(e.key,Un.getters.highlightedShapes,this.pushToUndoStack))}}};f(74819);function Ax(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Wo(e),null===e)break;return e}function _x(){return _x="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Ax(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},_x.apply(this,arguments)}var Tx,Mx=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"clone",value:function(e,t,r){return this.withTimerKeys(_x(Wo(n.prototype),"clone",this).call(this,e,t,r))}},{key:"withTimerKeys",value:function(e){var t=this,r=n.timerPropertyKeys.find((function(e){return t.definition.eventDefinitions[0][e]}));return e.definition.eventDefinitions[0][r]||(e.definition.eventDefinitions[0][r]={}),e.definition.eventDefinitions[0][r].body=this.definition.eventDefinitions[0][r].body,e}}]),n}(po);function Px(e){return Ix.apply(this,arguments)}function Ix(){return Ix=l(a().mark((function e(t){var n,r,o;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=Ox(t),r=document.querySelector('[name="name"]')||document.querySelector('[name="text"]'),n&&r&&document.activeElement!==r){e.next=4;break}return e.abrupt("return");case 4:if(o=document.getElementById("accordion-button-Configuration"),!o||"false"!==o.getAttribute("aria-expanded")){e.next=10;break}return clearTimeout(Tx),o.click(),e.next=10,Dx();case 10:n.style.outline="1px dashed blue",r.addEventListener("blur",(function(){n.style.outline=""})),r.focus(),r.select();case 14:case"end":return e.stop()}}),e)}))),Ix.apply(this,arguments)}function Ox(e){if(e.selectors)return e.selectors.label||Array.from(e.selectors.root.children).find((function(e){return e.classList.contains("labels")}))}function Dx(){return new Promise((function(e){Tx=setTimeout(e)}))}y(Mx,"timerPropertyKeys",["timeDuration","timeDate","timeCycle"]);var Nx=f(93162),Rx=f.n(Nx),Bx=new WeakMap,Lx=new WeakMap,jx=function(){function e(t){d(this,e),b(this,Bx,{writable:!0,value:void 0}),b(this,Lx,{writable:!0,value:void 0}),rw(this,Bx,t)}return g(e,[{key:"definitions",set:function(e){rw(this,Lx,e)}},{key:"getDefinitionsFromXml",value:function(e){var t=this;return new Promise((function(n,r){k(t,Bx).fromXML(e,(function(e,o){e&&r(e),o.exporter="ProcessMaker Modeler",o.exporterVersion="1.0",t.cleanBrokenReferences(o),n(o)}))}))}},{key:"cleanBrokenReferences",value:function(e){var t=e.rootElements,n=e.diagrams,r=[];t.forEach((function(t){"bpmn:Process"===t.$type&&t.flowElements&&(t.flowElements=t.flowElements.filter((function(e){return"bpmn:SequenceFlow"!==e.$type||(e.sourceRef&&e.targetRef||r.push(e),e.sourceRef&&e.targetRef)}))),"bpmn:Process"===t.$type&&t.laneSets&&t.laneSets.forEach((function(t){t.lanes=t.lanes.filter((function(t){if(!e.diagrams)return!1;var n=e.diagrams.find((function(e){return e.plane.planeElement.find((function(e){return e&&e.bpmnElement.id===t.id}))}));return n}))}))})),n.forEach((function(e){"bpmndi:BPMNDiagram"===e.$type&&e.plane&&e.plane.planeElement&&(e.plane.planeElement=e.plane.planeElement.filter((function(e){return"bpmndi:BPMNEdge"!==e.$type||e.bpmnElement&&!r.includes(e.bpmnElement)})))}))}},{key:"download",value:function(){k(this,Lx)&&k(this,Bx).toXML(k(this,Lx),{format:!0},(function(e,t){if(e)alert(e);else{if(Ss())return void(window.xml=t);var n=new File([t],"bpmnProcess.xml",{type:"text/xml"});Rx().saveAs(n)}}))}}]),e}();function Fx(e){return e.isStartEvent()?to:e.isTask()?io:e.isGateway()?ao:e.isIntermediateEvent()?lo:e.isEndEvent()?ro:null}function zx(e){if(!e)return!1;var t=Fx(e);return!t||!Object.values(t).includes(e.definition.name)}function Ux(e,t){return t.reduce((function(e,t){return e.concat(t.get("artifacts"))}),[]).filter((function(e){return"bpmn:Association"===e.$type})).filter((function(t){return t.targetRef===e.definition}))}function qx(e,t){var n=Object.values(e).flatMap((function(e){return e.map((function(e){return t.find((function(t){return t.id===e.id}))}))})),r=t.filter((function(e){return!e.id}));return[].concat(W(n),W(r))}var Vx=function(){function e(t,n,r,o,i,s){d(this,e),this._nodeThatWillBeReplaced=t,this._definition=n,this._graph=r,this._newNode=o,this._processes=i,this._collaboration=s}return g(e,[{key:"migrate",value:function(){var e,t,n=this;zx(this._nodeThatWillBeReplaced)&&(this._definition.name=this._nodeThatWillBeReplaced.definition.name);var r=[],o=function(e){var t=n._graph.getLinks().find((function(t){return t.component&&t.component.node.definition===e}));t.component.node._modelerId+="_replaced",r.push({id:t.component.node.definition.id,type:t.component.node.type,name:t.component.node.definition.name,sourceRefId:t.component.node.definition.sourceRef.id,targetRefId:t.component.node.definition.targetRef.id})},i=this._nodeThatWillBeReplaced.definition.get("incoming"),s=this._nodeThatWillBeReplaced.definition.get("outgoing");(e=this._definition.get("incoming")).push.apply(e,W(i)),(t=this._definition.get("outgoing")).push.apply(t,W(s)),s.forEach((function(e){e.set("sourceRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),o(e)})),i.forEach((function(e){e.set("targetRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),o(e)}));var a=Ux(this._nodeThatWillBeReplaced,this._processes);if(a.forEach((function(e){e.set("targetRef",n._newNode.definition),o(e)})),this._collaboration){var c=this._collaboration.get("messageFlows");c.filter((function(e){return e.sourceRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("sourceRef",n._newNode.definition),o(e)})),c.filter((function(e){return e.targetRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("targetRef",n._newNode.definition),o(e)}))}window.ProcessMaker.EventBus.$emit("multiplayer-updateFlows",r)}},{key:"_handleSequenceFlowForGateway",value:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type);t||delete e.conditionExpression}}]),e}(),Hx=["bpmn:ServiceTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ScriptTask"],Wx=function(e){if(-1!==Hx.indexOf(e.bpmnType)&&"package-ai/processmaker-ai-assistant"!==e.implementation){e.inspectorConfig[0].items.splice(e.loopInspectorIndex||1,0,df);var t=e.inspectorHandler||function(){},n=e.inspectorData||null;e.inspectorHandler=function(e,n,r,o,i,s){t(e,n,r,o,i,s),e=cf(e,n,r,o,i),s(e)},e.inspectorData=function(e,t,r){var o=n?n(e,t,r):t(e);return lf(o,e,t,r),o}}},Gx={methods:{cloneNodesSelection:function(){var e=this,t=[],n=[],r=[],o=[],i=[],s=this.highlightedNodes,a=this.$refs.selector.$el,c=[gl,dl,er,El,fo],l=[Ir],d=[_r];return"function"===typeof a.getBoundingClientRect&&s.forEach((function(s){if(c.includes(s.type)){var a=e.cloneFlowAndSetNewId(s);n.push(a),t.push(a)}else if(l.includes(s.type)){var u=e.cloneFlowAndSetNewId(s);o.push(u),t.push(u)}else if(d.includes(s.type)){var h=e.cloneFlowAndSetNewId(s);i.push(h),t.push(h)}else{var p=e.cloneElementAndCalculateOffset(s);s.definition&&"bpmn:BoundaryEvent"!==s.definition.$type?t.push(p):r.push(p)}})),t=[].concat(W(t),r),this.connectClonedFlows(n,t),this.connectClonedDataInputAssociations(o,t),this.connectClonedDataOutputAssociations(i,t),t},getDataInputOutputAssociationTargetRef:function(e){if("bpmn:DataInput"===e.targetRef.$type){var t=e.targetRef.$parent;return Vr(t,this)}if("bpmn:DataInputAssociation"===e.targetRef.$type){var n=e.targetRef.$parent;return Vr(n,this)}return e.targetRef},cloneFlowAndSetNewId:function(e){var t=e.cloneFlow(this.nodeRegistry,this.moddle,this.$t);return t.setIds(this.nodeIdGenerator),t},cloneElementAndCalculateOffset:function(e){var t=e.clone(this.nodeRegistry,this.moddle,this.$t),n=this.$refs.selector.$el.getBoundingClientRect(),r=n.height,o=this.paper.scale(),i=o.sy,s=r/i;return t.diagram.bounds.y+=s,t.setIds(this.nodeIdGenerator),t},connectClonedFlows:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef,i=r.definition.targetRef,s=t.find((function(e){return e.cloneOf===o.id})),a=t.find((function(e){return e.cloneOf===i.id}));if(s&&a){e.definition.set("sourceRef",s.definition),e.definition.set("targetRef",a.definition),s.definition.outgoing?s.definition.outgoing.push(e.definition):s.definition.set("outgoing",[e.definition]),a.definition.incoming?a.definition.incoming.push(e.definition):a.definition.set("incoming",[e.definition]);var c=n.$refs.selector.$el.getBoundingClientRect(),l=c.height,d=n.paper.scale(),u=d.sy,h=l/u;e.diagram.waypoint.forEach((function(e){e.y+=h}))}else t.splice(t.indexOf(e),1)}))},connectClonedDataInputAssociations:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef[0],i=t.find((function(e){return e.cloneOf===o.id})),s=n.getDataInputOutputAssociationTargetRef(r.definition),a=t.find((function(e){return e.cloneOf===s.id})),c=qr(n.moddle,a,i.definition);e.definition.set("sourceRef",[i.definition]),e.definition.set("targetRef",c),a.definition.set("dataInputAssociations",[e.definition])}))},connectClonedDataOutputAssociations:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef||r.definition.$parent,i=r.definition.targetRef,s=t.find((function(e){return e.cloneOf===o.id})),a=t.find((function(e){return e.cloneOf===i.id}));e.definition.set("targetRef",a.definition),e.definition.set("sourceRef",s.definition);var c=s.definition.get("dataOutputAssociations")||[];s.definition.set("dataOutputAssociations",[].concat(W(c),[e.definition]))}))}}},$x=function(){var e=this,t=e._self._c;return t("div",{staticClass:"rail-container",attrs:{"data-cy":"rail-bottom"}},[t("div",{ref:"railLeftBox",staticClass:"rail-left",style:[e.overlap?{position:"relative"}:{position:"absolute"}]},[t("MiniPaperControl",{class:{"hidden-opacity":!1===e.showComponent},attrs:{"paper-manager":e.paperManager,graph:e.graph}}),t("ZoomControl",{ref:"zoomBox",attrs:{"paper-manager":e.paperManager}})],1),t("div",{staticClass:"rail-center",style:[e.overlap?{width:"auto"}:{width:"100%"}]},[e.isMultiplayer?e._e():t("UndoRedoControl",{directives:[{name:"show",rawName:"v-show",value:e.showComponent,expression:"showComponent"}],ref:"undoRedoBox",attrs:{"is-rendering":e.isRendering},on:{"load-xml":function(t){return e.$emit("load-xml")},clearSelection:function(t){return e.$emit("clearSelection")}}}),t("Controls",{directives:[{name:"show",rawName:"v-show",value:e.showComponent,expression:"showComponent"}],ref:"controlBox",attrs:{nodeTypes:e.nodeTypes},on:{onCreateElement:e.onCreateElementHandler,onSetCursor:e.onSetCursorHandler}})],1)])},Xx=[],Yx=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mini-paper-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mini-paper-button",class:e.miniMapOpen?"mini-paper-button-active":"",attrs:{type:"button","data-cy":"mini-paper-button",title:e.miniMapOpen?e.$t("Hide Mini-Map"):e.$t("Show Mini-Map")},on:{click:function(t){e.miniMapOpen=!e.miniMapOpen}}},[t("inline-svg",{attrs:{src:e.miniMapIcon}})],1),t("mini-paper",{attrs:{isOpen:e.miniMapOpen,paperManager:e.paperManager,graph:e.graph}})],1)},Jx=[],Zx=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mini-paper-container",class:e.isOpen?"opened":"closed",attrs:{"data-cy":"mini-map-box"},on:{click:e.movePaper}},[t("div",{ref:"miniPaper",staticClass:"mini-paper"})])},Kx=[],Qx=new WeakMap,ek=function(){function e(t){d(this,e),b(this,Qx,{writable:!0,value:void 0}),rw(this,Qx,t)}return g(e,[{key:"miniMap",get:function(){return k(this,Qx)}},{key:"scaleMiniMap",value:function(){this.miniMap.scaleContentToFit({padding:10,maxScaleX:.5,maxScaleY:.5})}},{key:"calculateNewPaperPosition",value:function(e,t,n,r,o,i){var s=this.miniMap.paperToLocalPoint(e,t),a=s.x,c=s.y;return{newX:o/2-a*n,newY:i/2-c*r}}}],[{key:"factory",value:function(e,t){var n=new F.dia.Paper({el:t,model:e,width:230,height:200,interactive:!1});return new this(n)}}]),e}(),tk={data:function(){return{miniMapManager:null,newX:0,newY:0}},props:{isOpen:{type:Boolean},paperManager:{type:Object},graph:{type:Object}},watch:{isOpen:function(e){e&&this.miniMapManager.scaleMiniMap()}},computed:{miniMap:function(){return this.miniMapManager.miniMap}},methods:{movePaper:function(e){var t=e.offsetX,n=e.offsetY,r=this.paperManager.scale,o=r.sx,i=r.sy,s=this.paperManager.paper.el,a=s.clientWidth,c=s.clientHeight,l=this.miniMapManager.calculateNewPaperPosition(t,n,o,i,a,c),d=l.newX,u=l.newY;this.newX=d,this.newY=u,this.paperManager.translate(this.newX,this.newY)}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return window.Cypress&&(window.MiniPaper=e),t.next=3,e.$nextTick();case 3:e.miniMapManager=ek.factory(e.graph,e.$refs.miniPaper),e.paperManager.addEventHandler("render:done",e.miniMapManager.scaleMiniMap,e),window.ProcessMaker.EventBus.$on("modeler-change",(function(){return e.miniMapManager.scaleMiniMap()}));case 6:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){this.paperManager.removeEventHandler("render:done",this.miniMapManager.scaleMiniMap,this)}},nk=tk,rk=(f(63564),fr(nk,Zx,Kx,!1,null,"76e95759",null)),ok=rk.exports,ik={components:{InlineSvg:sv,MiniPaper:ok},props:{paperManager:Object,graph:Object},data:function(){return{miniMapOpen:!1,miniMapIcon:f(65759)}}},sk=ik,ak=(f(71776),fr(sk,Yx,Jx,!1,null,"7f06057f",null)),ck=ak.exports,lk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"zoom-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button",attrs:{type:"button","data-cy":"zoom-out-control",title:e.$t("Zoom Out")},on:{click:e.onClickZoomOut}},[t("inline-svg",{attrs:{src:e.minusIcon}})],1),e.paperManager?t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button zoom-reset",attrs:{"data-cy":"zoom-reset-control",title:e.$t("Reset to initial scale")},on:{click:e.onClickReset}},[e._v(e._s(e.percentageText))]):e._e(),t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button",attrs:{type:"button","data-cy":"zoom-in-control",title:e.$t("Zoom In")},on:{click:e.onClickZoomIn}},[t("inline-svg",{attrs:{src:e.plusIcon}})],1)])},dk=[],uk={components:{InlineSvg:sv},props:{paperManager:Object},data:function(){return{initialScale:1,minimumScale:.2,scaleStep:.1,minusIcon:f(22044),plusIcon:f(29943)}},computed:{percentageText:function(){return"".concat(Math.round(100*this.$props.paperManager.scale.sx),"%")}},methods:{onClickZoomOut:function(){this.paperManager.scale=Math.max(this.minimumScale,this.paperManager.scale.sx-=this.scaleStep)},onClickZoomIn:function(){this.paperManager.scale=this.paperManager.scale.sx+this.scaleStep},onClickReset:function(){this.paperManager.scale=this.initialScale}}},hk=uk,pk=(f(5365),fr(hk,lk,dk,!1,null,"576edbd4",null)),fk=pk.exports,mk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ur-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"ur-button",attrs:{type:"button","data-cy":"undo-control",disabled:!e.canUndo,title:e.$t("Undo")},on:{click:e.undo}},[t("inline-svg",{attrs:{src:e.undoIcon}})],1),t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"ur-button",attrs:{type:"button","data-cy":"redo-control",disabled:!e.canRedo,title:e.$t("Redo")},on:{click:e.redo}},[t("inline-svg",{attrs:{src:e.redoIcon}})],1)])},gk=[],vk={components:{InlineSvg:sv},props:{isRendering:{type:Boolean}},data:function(){return{undoIcon:f(28994),redoIcon:f(45617)}},watch:{canUndo:function(e){e||this.$root.$emit("bv::hide::tooltip")},canRedo:function(e){e||this.$root.$emit("bv::hide::tooltip")}},computed:{canUndo:function(){return Qv.getters.canUndo},canRedo:function(){return Qv.getters.canRedo}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("redo").then((function(){return e.$emit("load-xml")}))}}},bk=vk,yk=(f(81935),fr(bk,mk,gk,!1,null,"379ae012",null)),wk=yk.exports,xk=function(){var e=this,t=e._self._c;return e.controls?t("ul",{staticClass:"control-list"},[e._l(e.controls,(function(n){return t("li",{key:n.id,class:["control-item",{active:e.selectedItem&&e.selectedItem.type===n.type}],attrs:{id:n.id,"data-test":"".concat(n.type,"-main")},on:{click:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n)}}},[t("SubmenuPopper",{attrs:{data:n,selectedItem:e.selectedSubmenuItem,popperType:e.popperType},on:{clickToSubmenu:e.clickToSubmenuHandler}})],1)})),t("li",{staticClass:"control-item"},[t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],class:{"control-add":!0,"control-active":e.explorerOpen},attrs:{title:e.$t("Add")},on:{click:e.toggleExplorer}},[t("inline-svg",{attrs:{src:e.plusIcon}})],1)])],2):e._e()},kk=[],Ck=function(){var e=this,t=e._self._c;return e.data.items?t("popper",{attrs:{trigger:"clickToOpen",options:{placement:"top",modifiers:{offset:{offset:"0,5px"},preventOverflow:{escapeWithReference:!0}}},"append-to-body":!0,"visible-arrow":!1,"force-show":e.popperType===e.data.type}},[t("div",[t("ul",{staticClass:"control-submenu"},e._l(e.data.items,(function(n,r){return t("li",{key:r,class:["control-submenu-list",{active:e.selectedItem===n.type}],attrs:{"data-test":n.type},on:{click:function(t){return e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("inline-svg",{attrs:{src:n.icon,alt:n.label}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("div",{staticClass:"control-submenu-list-label"},[e._v(" "+e._s(n.label)+" ")])],1)})),0)]),t("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"control-submenu-item",attrs:{slot:"reference",alt:e.data.label,title:e.$t(e.data.label)},slot:"reference"},[t("div",{staticClass:"control-submenu-options"},[t("span")]),e.containsSvg(e.data.icon)?e._e():t("i",{staticClass:"fa-lg",class:e.data.icon}),t("inline-svg",{attrs:{src:e.data.icon}})],1)]):t("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"control-submenu-item",attrs:{alt:e.data.label,title:e.$t(e.data.label)}},[e.containsSvg(e.data.icon)?e._e():t("i",{staticClass:"fa-lg",class:e.data.icon}),t("inline-svg",{attrs:{src:e.data.icon}})],1)},Sk=[],Ek=f(95951),Ak=f.n(Ek),_k=(f(44301),{mixins:[zg],props:{data:{type:Object},selectedItem:{type:String},popperType:{type:String}},components:{Popper:Ak(),InlineSvg:sv},data:function(){return{wasClickedSubmenu:!1,element:null,wasClicked:!1}},methods:{onClickHandler:function(e,t){e.stopPropagation(),this.$emit("clickToSubmenu",{event:e,control:t})}}}),Tk=_k,Mk=(f(56668),fr(Tk,Ck,Sk,!1,null,"36ac61a1",null)),Pk=Mk.exports,Ik={components:{SubmenuPopper:Pk,InlineSvg:sv},props:{nodeTypes:Array},mixins:[Ug],data:function(){return{plusIcon:f(29943),currentType:null}},created:function(){Mg.dispatch("getUserPinnedObjects")},computed:{controls:function(){return Mg.getters.getPinnedNodeTypes},explorerOpen:function(){return Mg.getters.getExplorerOpen}},methods:{clickToSubmenuHandler:function(e){window.ProcessMaker.EventBus.$off("custom-pointerclick"),this.wasClicked=!1,this.parent=this.selectedItem,this.selectedSubmenuItem=e.control.type,this.onClickHandler(e.event,e.control)},onClickControlHandler:function(e,t){this.selectedSubmenuItem=null,this.popperType=this.currentType===t.type?null:t.type,this.onClickHandler(e,t),this.currentType=this.popperType},toggleExplorer:function(){this.deselect(),this.popperType=null,this.selectedSubmenuItem=null,Mg.commit("toggleExplorer"),Mg.commit("clearFilteredNodes"),Mg.commit("clearFilteredPmBlockNodes")}}},Ok=Ik,Dk=(f(33422),fr(Ok,xk,kk,!1,null,"0e6b16b8",null)),Nk=Dk.exports,Rk={components:{MiniPaperControl:ck,ZoomControl:fk,UndoRedoControl:wk,Controls:Nk},props:{paperManager:Object,graph:Object,isRendering:Boolean,nodeTypes:Array},data:function(){return{overlap:!1,widthOverlapControl:0,leftOverlapUndoRedo:0,controlObserver:null}},created:function(){this.controlObserver=new ResizeObserver(this.onControlObserver)},methods:{onCreateElementHandler:function(e){this.$emit("onCreateElement",e)},onSetCursorHandler:function(e){this.$emit("set-cursor",e)},onControlObserver:function(e){var t=e[0].target.getBoundingClientRect(),n=this.$refs.zoomBox.$el.getBoundingClientRect(),r=this.$refs.undoRedoBox.$el.getBoundingClientRect();if(this.overlap){if(t.width<this.widthOverlapControl){var o=window.getComputedStyle(this.$refs.zoomBox.$el),i=parseInt(o.paddingLeft,10)+parseInt(o.paddingRight,10),s=window.getComputedStyle(this.$refs.railLeftBox),a=parseInt(s.paddingLeft,10)+parseInt(s.paddingRight,10),c=this.leftOverlapUndoRedo+(this.widthOverlapControl-t.width)-i-a;c>n.right&&(this.overlap=!1)}}else r.left<n.right&&(this.overlap=!0,this.widthOverlapControl=t.width,this.leftOverlapUndoRedo=r.left)}},computed:{showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,Ft.nextTick)();case 2:e.controlObserver.observe(e.$refs.controlBox.$el);case 3:case"end":return t.stop()}}),t)})))()}},Bk=Rk,Lk=(f(99155),fr(Bk,$x,Xx,!1,null,"30b2f3e9",null)),jk=Lk.exports,Fk=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},zk=[],Uk=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=Pr(this.moddle),i=Mr(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var s=new po(_r,i,o);s.dataAssociationProps={sourceShape:e,targetCoords:{x:void 0,y:void 0}};var a=$()(e,"component.node"),c=a.definition.get("dataOutputAssociations")||[];return a.definition.set("dataOutputAssociations",[].concat(W(c),[s.definition])),s}}],[{key:"isValid",value:function(e){var t=e.sourceShape,n=e.targetShape,r=$()(t,"component.node"),o=$()(n,"component.node");if(!o)return!1;var i=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],s=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],a=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateCatchEvent","bpmn:StartEvent"],c=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],l=r.definition.$type,d=o.definition.$type,u="bpmn:DataStoreReference"===r.definition.$type,h="bpmn:DataObjectReference"===r.definition.$type,p="bpmn:DataStoreReference"===o.definition.$type,f="bpmn:DataObjectReference"===o.definition.$type;return!(!u||!s.includes(d))||(!(!h||!c.includes(d))||(!(!p||!i.includes(l))||f&&a.includes(l)))}},{key:"isValidSourceNode",value:function(e){return!Ko.isNodeDisallowedFromDataAssociation(e)}}]),n}(Ko),qk=[{type:"processmaker-modeler-text-annotation",factory:Uk},{type:"processmaker-modeler-sequence-flow",factory:ul},{type:"processmaker-modeler-message-flow",factory:wl}],Vk={name:fo,components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){var e=this;return qk.some((function(t){return t.factory.isValid({sourceShape:e.sourceShape,targetShape:e.target,sourceConfig:e.sourceConfig,targetConfig:e.targetConfig})}))},targetType:function(){return $()(this.target,"component.node.type")},shapeName:function(){return this.node.definition.get("name")},nameLabel:{get:function(){return this.shape.label(0).attrs.text.text},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.shape.label(0,{attrs:{text:{text:e}}})}}},watch:{},methods:{completeLink:function(){var e=this,t=qk.find((function(t){return t.factory.isValid({sourceShape:e.sourceShape,targetShape:e.target,sourceConfig:e.sourceConfig,targetConfig:e.targetConfig})})),n=new t.factory(this.nodeRegistry,this.moddle,this.paper),r=this.shape.findView(this.paper),o=[r.sourceAnchor.toJSON(),r.targetAnchor.toJSON()];this.$emit("replace-generic-flow",{actualFlow:n.makeFlowNode(this.sourceShape,this.target,o),genericFlow:this.node,targetNode:$()(this.target,"component.node")})},updateRouter:function(){this.shape.router("normal")},createDefaultFlowMarker:function(){this.shape.attr("line",{strokeWidth:1,strokeDasharray:"2 2"})}},mounted:function(){this.shape=new F.shapes.standard.Link,this.shape.connector("rounded",{radius:5}),this.createDefaultFlowMarker(),this.shape.addTo(this.graph),this.shape.component=this}},Hk=Vk,Wk=fr(Hk,Fk,zk,!1,null,null,null),Gk=Wk.exports,$k=function(){var e=this,t=e._self._c;return e.showLasso&&e.style?t("div",{ref:"drag",staticClass:"box",style:e.style,attrs:{"data-cy":"selection-box","data-length":e.selected.length}},[t("crown-multiselect",e._g({attrs:{paper:e.paperManager.paper,graph:e.$parent.graph,moddle:e.$parent.moddle,collaboration:e.$parent.collaboration,"process-node":e.$parent.processNode,"plane-elements":e.$parent.planeElements,"is-rendering":e.$parent.isRendering,"dropdown-data":[],"has-pools":e.hasPoolsOrLanesSelected},on:{"save-state":function(t){return e.$emit("save-state")}}},e.$listeners))],1):e._e()},Xk=[],Yk=function(){var e=this,t=e._self._c;return e.isMultiSelect?t("div",{staticClass:"crown-config crown-multiselect",style:e.style,attrs:{role:"menu"}},[e._t("default"),e._l(e.availableButtons,(function(e){return t("button",{key:e.label,staticClass:"crown-button",attrs:{"aria-label":e.label,title:e.label,"data-test":e.testId,role:e.role},on:{click:e.action}},["fpm"===e.iconPrefix?t("font-awesome-icon",{attrs:{icon:[e.iconPrefix,"fa-".concat(e.icon)]}}):t("i",{class:"".concat(e.iconPrefix," fa-").concat(e.icon," text-dark")})],1)})),t("crown-align",{directives:[{name:"show",rawName:"v-show",value:e.showAlignmentButtons,expression:"showAlignmentButtons"}],attrs:{paper:e.paper},on:{"save-state":function(t){return e.$emit("save-state")}}})],2):e._e()},Jk=[],Zk=function(){var e=this,t=e._self._c;return e.isMultiSelect?t("div",{staticClass:"crown-config crown-align",style:e.style,attrs:{role:"menu"}},[e._t("default"),e._l(e.availableButtons,(function(e){return t("button",{key:e.label,staticClass:"crown-button",attrs:{"aria-label":e.label,title:e.label,"data-test":e.testId,role:e.role,disabled:e.disabled},on:{mousedown:function(e){e.stopPropagation(),e.preventDefault()},click:function(t){return t.stopPropagation(),t.preventDefault(),e.action.apply(null,arguments)}}},[t("font-awesome-icon",{attrs:{icon:["fpm","fa-".concat(e.icon)]}})],1)}))],2):e._e()},Kk=[],Qk=function(e){return e.position().y+e.size().height},eC=function(e){return e.position().x},tC=function(e){return e.position().x+e.size().width/2},nC=function(e){return e.position().y+e.size().height/2},rC=function(e){return e.position().x+e.size().width},oC=function(e){return e.position().y},iC=function(e){return Boolean(e&&e.position&&e.size)},sC={poolLane:"PoolLane",boundaryEvent:"processmaker.components.nodes.boundaryEvent.Shape"},aC=[sC.boundaryEvent,sC.poolLane],cC=function(e){return!aC.includes(e.get("type"))};function lC(e){return iC(e)&&cC(e)}function dC(e,t){var n=t-Qk(e);e.translate(0,n)}function uC(e,t){var n=t-eC(e);e.translate(n,0)}function hC(e,t){var n=t-rC(e);e.translate(n,0)}function pC(e,t){var n=t-tC(e);e.translate(n,0)}function fC(e,t){var n=t-nC(e);e.translate(0,n)}function mC(e,t){var n=t-oC(e);e.translate(0,n)}function gC(e){var t=SC(e);e.forEach((function(e){uC(e,t.left)}))}function vC(e){var t=SC(e);e.forEach((function(e){hC(e,t.right)}))}function bC(e){var t=SC(e);e.forEach((function(e){mC(e,t.top)}))}function yC(e){var t=SC(e);e.forEach((function(e){dC(e,t.bottom)}))}function wC(e){var t=SC(e);e.forEach((function(e){pC(e,t.hMiddle)}))}function xC(e){var t=SC(e);e.forEach((function(e){fC(e,t.vMiddle)}))}function kC(e){var t=SC(e),n=e.length,r=3;if(!(n<r)){var o=e.reduce((function(e,t){return t.size().height+e}),0),i=e.sort((function(e,t){return nC(e)-nC(t)})),s=t.top+e[0].size().height,a=(t.height-o)/(i.length-1);i.forEach((function(e,t){0!==t&&(mC(e,s+a),s+=a+e.size().height)}))}}function CC(e){var t=SC(e),n=e.length,r=3;if(!(n<r)){var o=e.reduce((function(e,t){return t.size().width+e}),0),i=e.sort((function(e,t){return tC(e)-tC(t)})),s=t.left+e[0].size().width,a=(t.width-o)/(i.length-1);i.forEach((function(e,t){0!==t&&(uC(e,s+a),s+=a+e.size().width)}))}}function SC(e){if(!e||!e.length||0===e.length)return{left:0,right:0,top:0,bottom:0,width:0,height:0,vMiddle:0,hMiddle:0};var t=function(e){return iC(e)?e.position().x:0},n=function(e){return iC(e)?e.position().x+e.size().width:0},r=function(e){return iC(e)?e.position().y:0},o=function(e){return iC(e)?e.position().y+e.size().height:0},i=Math.min.apply(Math,W(e.map(t))),s=Math.max.apply(Math,W(e.map(n))),a=Math.min.apply(Math,W(e.map(r))),c=Math.max.apply(Math,W(e.map(o))),l=s-i,d=c-a;return{left:i,right:s,top:a,bottom:c,width:l,height:d,vMiddle:a+d/2,hMiddle:i+l/2}}function EC(e){var t=e.filter((function(e){return lC(e)})),n=SC(e),r=t.length>1;return{can:{align:{left:r&&t.some((function(e){return eC(e)!==n.left})),horizontalCenter:r&&t.some((function(e){return tC(e)!==n.hMiddle})),right:r&&t.some((function(e){return rC(e)!==n.right})),bottom:r&&t.some((function(e){return Qk(e)!==n.bottom})),verticalCenter:r&&t.some((function(e){return nC(e)!==n.vMiddle})),top:r&&t.some((function(e){return oC(e)!==n.top}))},distribute:{horizontally:r&&t.length>2,vertically:r&&t.length>2}},align:{left:function(){return gC(t)},horizontalCenter:function(){return wC(t)},right:function(){return vC(t)},bottom:function(){return yC(t)},verticalCenter:function(){return xC(t)},top:function(){return bC(t)}},distribute:{horizontally:function(){return CC(t)},vertically:function(){return kC(t)}}}}var AC={components:{FontAwesomeIcon:To.FontAwesomeIcon},props:{paper:Object,hasPools:Boolean},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null,buttons:[{label:this.$t("Align Left"),icon:"align-left",testId:"align-left",role:"menuitem",action:this.alignLeft,condition:"align.left",disabled:!1},{label:this.$t("Center Horizontally"),icon:"center-horizontally",testId:"align-horizontally",role:"menuitem",action:this.centerHorizontally,condition:"align.horizontalCenter",disabled:!1},{label:this.$t("Align Right"),icon:"align-right",testId:"align-right",role:"menuitem",action:this.alignRight,condition:"align.right",disabled:!1},{label:this.$t("Align Bottom"),icon:"align-bottom",testId:"align-bottom",role:"menuitem",action:this.alignBottom,condition:"align.bottom",disabled:!1},{label:this.$t("Center Vertically"),icon:"center-vertically",testId:"center-vertically",role:"menuitem",action:this.centerVertically,condition:"align.verticalCenter",disabled:!1},{label:this.$t("Align Top"),icon:"align-top",testId:"align-top",role:"menuitem",action:this.alignTop,condition:"align.top",disabled:!1},{label:this.$t("Distribute Horizontally"),icon:"distribute-horizontally",testId:"distribute-horizontally",role:"menuitem",action:this.distributeHorizontally,condition:"distribute.horizontally",disabled:!1},{label:this.$t("Distribute Vertically"),icon:"distribute-vertically",testId:"distribute-vertically",role:"menuitem",action:this.distributeVertically,condition:"distribute.vertically",disabled:!1}]}},created:function(){this.$t=this.$t.bind(this),mo.library.add(Co),mo.library.add(ko),mo.library.add(So),mo.library.add(Eo),mo.library.add(xo),mo.library.add(wo),mo.library.add(_o),mo.library.add(Ao)},watch:{selectedShapes:function(){this.$root.$emit("bv::hide::tooltip")}},computed:{selectedShapes:function(){return this.disableButtons(),EC(Un.getters.highlightedShapes)},isMultiSelect:function(){var e=Un.getters.highlightedShapes.length;return e>1},highlightedShapes:function(){return Un.getters.highlightedShapes},availableButtons:function(){var e=this.hasPools;return this.buttons.filter((function(t){return"copy-button"===t.testId?!e:"clone-button"!==t.testId||!e}))}},methods:{disableButtons:function(){var e=EC(Un.getters.highlightedShapes);this.buttons.forEach((function(t){t.disabled=!(0,Er.get)(e.can,t.condition,!0)}))},alignLeft:function(){this.undoableAction(this.selectedShapes.align.left)},centerHorizontally:function(){this.undoableAction(this.selectedShapes.align.horizontalCenter)},alignRight:function(){this.undoableAction(this.selectedShapes.align.right)},alignBottom:function(){this.undoableAction(this.selectedShapes.align.bottom)},centerVertically:function(){this.undoableAction(this.selectedShapes.align.verticalCenter)},alignTop:function(){this.undoableAction(this.selectedShapes.align.top)},distributeHorizontally:function(){this.undoableAction(this.selectedShapes.distribute.horizontally)},distributeVertically:function(){this.undoableAction(this.selectedShapes.distribute.vertically)},undoableAction:function(e){e(),this.$emit("save-state"),this.disableButtons()},paperNotRendered:function(){return!this.isRendering},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition&&this.$emit("save-state")},paperDoneRendering:function(){var e=this;if(this.isRendering)return new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown)},setUpPositionHandling:function(){}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig();case 5:case"end":return t.stop()}}),t)})))()}},_C=AC,TC=(f(81856),f(69100),fr(_C,Zk,Kk,!1,null,"46e3ac40",null)),MC=TC.exports,PC={props:{paper:Object,hasPools:Boolean},components:{crownAlign:MC,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{showAlignmentButtons:!1,runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null,buttons:[{label:"Copy Selection",iconPrefix:"fa",icon:"clipboard",testId:"copy-button",role:"menuitem",action:this.copySelection},{label:"Clone Selection",iconPrefix:"fa",icon:"copy",testId:"clone-button",role:"menuitem",action:this.cloneSelection},{label:"Align",iconPrefix:"fpm",icon:"align-left",testId:"align",role:"menuitem",action:this.showAlign},{label:"Delete Element",iconPrefix:"fa",icon:"trash-alt",testId:"delete-button",role:"menuitem",action:this.deleteElement}]}},created:function(){this.$t=this.$t.bind(this),mo.library.add(ko)},computed:{isMultiSelect:function(){var e=Un.getters.highlightedShapes.length;return e>1},highlightedShapes:function(){return Un.getters.highlightedShapes},availableButtons:function(){var e=this.hasPools;return this.buttons.filter((function(t){return"copy-button"===t.testId?!e:"clone-button"!==t.testId||!e}))}},methods:{showAlign:function(){this.showAlignmentButtons=!this.showAlignmentButtons},copySelection:function(){this.$emit("copy-selection")},cloneSelection:function(){this.$emit("clone-selection")},deleteElement:function(){this.$emit("remove-nodes")},paperNotRendered:function(){return!this.isRendering},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition&&this.$emit("save-state")},paperDoneRendering:function(){var e=this;if(this.isRendering)return new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown)},setUpPositionHandling:function(){}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig();case 5:case"end":return t.stop()}}),t)})))()}},IC=PC,OC=(f(6718),fr(IC,Yk,Jk,!1,null,"bcd827ec",null)),DC=OC.exports,NC={name:"Selection",components:{CrownMultiselect:DC},props:{graph:Object,paperManager:Object,useModelGeometry:Boolean,processNode:Object,isMultiplayer:Boolean},data:function(){return{start:null,isSelecting:!1,isSelected:!1,selected:[],conectedLinks:[],dragging:!1,style:{left:"0px",top:"0px",width:"0px",height:"0px"},mouseX:0,mouseY:0,top:0,left:0,initialPosition:null,hasMouseDown:!1,hasMouseMoved:!1,showLasso:!1,isOutOfThePool:!1,stopForceMove:!1,draggableBlackList:[dl],selectionBlackList:[fo],selectableBlackList:[fo],newPool:null,oldPool:null,isValidSelectionLinks:!0,invalidPool:null}},mounted:function(){this.paperManager.paper.on("scale:changed ",this.updateSelectionBox),this.paperManager.paper.on("translate:changed ",this.translateChanged)},computed:{hasPoolsOrLanesSelected:function(){return this.selected.some((function(e){return e.model.component.node.type===Jo||e.model.component.node.type===dl}))}},watch:{selected:function(e){this.prepareConectedLinks(e),this.addToHighlightedNodes(e)}},methods:{selectElements:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$nextTick();case 2:return t.clearSelection(),t.selected=e,t.showLasso=!0,t.isSelected=!0,t.isSelecting=!0,t.start=null,n.next=10,t.$nextTick();case 10:t.updateSelectionBox();case 11:case"end":return n.stop()}}),n)})))()},selectElement:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]&&t[1],!e.model.component||!n.selectableBlackList.includes(e.model.component.node.type)){r.next=3;break}return r.abrupt("return");case 3:return n.showLasso=!0,n.isSelected=!0,n.isSelecting=!0,n.start=null,o?n.shiftKeySelectionHandler(e):n.selected=[e],n.filterSelected(),r.next=11,n.$nextTick();case 11:!1===Un.getters.isReadOnly&&n.updateSelectionBox();case 12:case"end":return r.stop()}}),r)})))()},shiftKeySelectionHandler:function(e){var t=this;if(!(e&&e.model&&e.model.component&&this.draggableBlackList.includes(e.model.component.node.type))){var n=this.selected.find((function(e){return t.draggableBlackList.includes(e.model.component.node.type)}));if(n)this.selected=[e];else{var r=this.selected.find((function(e){return e.model.component.node.type===Jo}));r&&e.model.component.node.type!==Jo?this.selected=[e]:e.model.component&&e.model.component.node.type===Jo?this.hasOnlyPools(this.selected)?this.selectOrUnselectShape(e):this.selected=[e]:e.model.component&&e.model.component.node.pool&&(r=this.getPool(this.selected),r&&e.model.component.node.pool.id!==r.model.get("id"))?this.selected=[e]:this.selectOrUnselectShape(e)}}},selectOrUnselectShape:function(e){var t=this.selected.find((function(t){return t.id===e.id}));t?this.selected=this.selected.filter((function(t){return t.id!==e.id})):this.selected.push(e)},clearSelection:function(){this.initSelection()},initSelection:function(){this.isSelecting=!1,this.start=null,this.selected=[],this.showLasso=!1,this.isSelected=!1,this.style={left:"0px",top:"0px",width:"0px",height:"0px"}},startSelection:function(e){var t=this.paperManager.paper,n=F.util.normalizeEvent(e),r=n.clientX,o=n.clientY,i=n.offsetX,s=n.offsetY,a=t.$el.offset();this.clearSelection(),this.isSelecting=!0,this.showLasso=!0,this.start={x:r-a.left+window.pageXOffset+t.$el.scrollLeft(),y:o-a.top+window.pageYOffset+t.$el.scrollTop()},this._offset={x:i,y:s}},updateSelection:function(e){var t=this.paperManager.paper;if(this.isSelecting&&!this.isSelected&&this.start){var n=F.util.normalizeEvent(e),r=t.$el.offset(),o={x:n.clientX-r.left+window.pageXOffset+t.$el.scrollLeft(),y:n.clientY-r.top+window.pageYOffset+t.$el.scrollTop()},i={height:o.y-this.start.y,width:o.x-this.start.x};this.style.left="".concat(i.width<0?this._offset.x+i.width:this.start.x,"px"),this.style.top="".concat(i.height<0?this._offset.y+i.height:this.start.y,"px"),this.style.width="".concat(Math.abs(i.width),"px"),this.style.height="".concat(Math.abs(i.height),"px")}},endSelection:function(){var e=this.paperManager.paper;if(this.isSelecting&&!this.isSelected){var t=e.$el.offset(),n={left:this.$el.offsetLeft+t.left,top:this.$el.offsetTop+t.top},r=this.$el.clientWidth,o=this.$el.clientHeight,i=(0,F.V)(e.viewport).toLocalPoint(n.left,n.top);i.x-=window.pageXOffset,i.y-=window.pageYOffset;var s=e.scale();r/=s.sx,o/=s.sy;var a=F.g.rect(i.x,i.y,r,o);this.selected=this.getElementsInSelectedArea(a,{strict:!1}),this.filterSelected(),this.selected&&this.selected.length>0?(this.updateSelectionBox(),this.isSelected=!0):(this.clearSelection(),this.isSelected=!1,this.start=null),this.start=null}},getElementsInSelectedArea:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.paperManager.paper,o=r.findViewsInArea(e,t);return n?(this.graph.getLinks().forEach((function(t){e.intersect(t.getBBox())&&o.push(r.findViewByModel(t))})),o):o},isPositionWithinArea:function(e,t){var n=t.x,r=t.y,o=t.width,i=t.height;return e.x>=n&&e.x<=n+o&&e.y>=r&&e.y<=r+i},prepareConectedLinks:function(e){var t=this,n=this.paperManager.paper;this.conectedLinks=[],this.isValidSelectionLinks=!0,e.forEach((function(e){var r=t.graph.getConnectedLinks(e.model);if(e.model.component&&e.model.component.node.type===Jo){var o=e.model.getBBox(),i=n.model.getLinks().filter((function(e){var n=e.getSourcePoint(),r=e.getTargetPoint();return t.isPositionWithinArea(n,o)||t.isPositionWithinArea(r,o)}));i&&(r=[].concat(W(r),W(i)))}r.forEach((function(e){var r=n.findViewByModel(e);t.conectedLinks.some((function(e){return e.id===r.id}))||(t.conectedLinks.push(r),t.validateSelectionLinks(r))}))}))},validateSelectionLinks:function(e){if(this.isValidSelectionLinks){var t=this.selected.find((function(t){return t.model.get("id")===e.model.getSourceElement().get("id")})),n=this.selected.find((function(t){return t.model.get("id")===e.model.getTargetElement().get("id")}));this.isValidSelectionLinks=!(!t||!n)}},getSelectionVertex:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r={x:1/0,y:1/0},o={width:0,height:0},i=this.useModelGeometry,s=["PoolLane","standard.Link"];return e.filter((function(e){return n||!s.includes(e.model.get("type"))})).map((function(e){var n=t?e.model.getBBox({useModelGeometry:i}):e.getBBox({useModelGeometry:i}).inflate(7);r.x=Math.min(r.x,n.x),r.y=Math.min(r.y,n.y),o.width=Math.max(o.width,n.x+n.width),o.height=Math.max(o.height,n.y+n.height)})),{minX:r.x,minY:r.y,maxX:o.width,maxY:o.height}},updateSelectionBox:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e||this.isSelecting&&this.style)if(this.selected.length>0){var n=this.getSelectionVertex(this.selected,!1,!0);this.style.left="".concat(n.minX,"px"),this.style.top="".concat(n.minY,"px"),this.left=parseInt(this.style.left),this.top=parseInt(this.style.top),this.style.width="".concat(n.maxX-n.minX,"px"),this.style.height="".concat(n.maxY-n.minY,"px")}else t&&this.clearSelection()},filterSelected:function(){var e=[gl,_r,Ir,er,El],t=this.selected.filter((function(e){return e.model.component})).filter((function(e){return"processmaker-modeler-pool"===e.model.component.node.type})).map((function(e){return e.model.component.node.id}));this.selected=this.selected.filter((function(n){if(n.model.component&&n.model.component.node.pool)return n.model.component.node.pool&&!t.includes(n.model.component.node.pool.component.node.id);if(n.model.component&&e.includes(n.model.component.node.type)){var r=n.model.getParentCell();if(r.component&&r.component.node.pool)return!t.includes(r.component.node.pool.component.node.id)}return!0}))},translateChanged:function(){this.isSelecting&&this.updateSelectionBox()},hasLanes:function(e){var t=["processmaker-modeler-lane"],n=e.find((function(e){return t.includes(e.model.component.node.type)}));return!!n},hasOnlyLinks:function(e){var t=this.selected.filter((function(e){return"standard.Link"===e.model.get("type")}));return t&&e.length===t.length},hasOnlyPools:function(e){var t=this.selected.filter((function(e){return e.model.component&&e.model.component.node.type===Jo}));return t&&e.length===t.length},startDrag:function(e){if(this.$refs.drag){this.stopForceMove=!1,this.dragging=!0,this.hasMouseMoved=!1;var t=F.util.normalizeEvent(e);this.mouseX=t.clientX,this.mouseY=t.clientY,this.top=this.$refs.drag.offsetTop,this.left=this.$refs.drag.offsetLeft,this.initialPosition={top:this.top,left:this.left},this.hasLanes(this.selected)||this.hasOnlyLinks(this.selected)?this.stopForceMove=!0:this.selected&&1===this.selected.length&&"processmaker.components.nodes.boundaryEvent.Shape"===this.selected[0].model.get("type")&&this.selected[0].model.component.attachToValidTarget(this.selected[0])}},drag:function(e){if(!this.stopForceMove&&this.dragging){this.hasMouseMoved=!0;var t=F.util.normalizeEvent(e),n=t.clientX-this.mouseX,r=t.clientY-this.mouseY;this.top+=r,this.left+=n,this.mouseX=t.clientX,this.mouseY=t.clientY;var o=this.paperManager.paper.scale();this.style.left="".concat(this.left,"px"),this.style.top="".concat(this.top,"px"),this.translateSelectedShapes(n/o.sx,r/o.sy),this.overPoolDrag(e)}},stopDrag:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.dragging=!1,e.stopForceMove=!1,t.next=4,e.$nextTick();case 4:return t.next=6,e.paperManager.awaitScheduledUpdates();case 6:e.overPoolStopDrag(),e.updateSelectionBox(),e.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",e.getProperties(e.selected));case 9:case"end":return t.stop()}}),t)})))()},getProperties:function(e){var t=this,n=[],r=["PoolLane","standard.Link"];return e.filter((function(e){return!r.includes(e.model.get("type"))})).forEach((function(e){if("processmaker.modeler.bpmn.pool"===e.model.get("type")){var r=e.model.component.getElementsUnderArea(e.model,t.graph);n=[].concat(W(n),W(t.getContainerProperties(r,n)))}else{var o,i,s,a=e.model.component.node,c={id:a.definition.id,properties:{x:e.model.get("position").x,y:e.model.get("position").y,height:e.model.get("size").height,width:e.model.get("size").width,attachedToRefId:null!==(o=null===(i=e.model.component.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id)&&void 0!==o?o:null,color:e.model.get("color")}};null!==a&&void 0!==a&&null!==(s=a.pool)&&void 0!==s&&s.component&&(c["poolId"]=a.pool.component.id),n.push(c)}var l=t.getBoundariesChangesForShape(e);n=n.concat(l)})),n},getBoundariesChangesForShape:function(e){var t=[],n=[gy,Sy,Iy,Fy,$y,tw],r=Un.getters.nodes.filter((function(e){return n.includes(e.type)}));return r.forEach((function(n){var r,o,i;n.definition.attachedToRef.id===e.model.component.node.definition.id&&t.push({id:n.definition.id,properties:{x:n.diagram.bounds.x,y:n.diagram.bounds.y,height:n.diagram.bounds.height,width:n.diagram.bounds.width,attachedToRefId:null!==(r=null===(o=n.definition.get("attachedToRef"))||void 0===o?void 0:o.id)&&void 0!==r?r:null,color:null!==(i=n.definition.get("color"))&&void 0!==i?i:null}})})),t},getContainerProperties:function(e){var t=[];return e.forEach((function(e){t.push({id:e.component.node.definition.id,properties:{x:e.get("position").x,y:e.get("position").y,height:e.get("size").height,width:e.get("size").width,color:e.get("color")}})})),t},updateFlowsWaypoint:function(){this.conectedLinks.forEach((function(e){if(e.model.component&&"standard.Link"===e.model.get("type")){var t=e.sourceAnchor,n=e.targetAnchor;e.model.component.node.diagram.waypoint=[t].concat(W(e.model.component.shape.vertices()),[n]).map((function(t){return e.model.component.moddle.create("dc:Point",t)}))}}))},translateSelectedShapes:function(e,t,n){var r=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],o=this.selected.filter((function(e){return!r.includes(e.model.get("type"))}));if(n&&o.filter((function(e){return n.model.get("id")!==e.model.get("id")})),this.selected&&1===this.selected.length&&"processmaker.components.nodes.boundaryEvent.Shape"===this.selected[0].model.get("type"))return this.selected[0].model.translate(e,t),void this.selected[0].model.component.turnInvalidTargetRed();o.forEach((function(n){return n.model.translate(e,t)}))},getShapesFromPoint:function(e){var t=F.util.normalizeEvent(e),n=t.clientX,r=t.clientY,o=(0,F.V)(this.paperManager.paper.viewport).toLocalPoint(n,r);return this.paperManager.paper.findViewsFromPoint(o)},addToHighlightedNodes:function(e){if(Un.commit("highlightNode"),e.length>0){var t=e.filter((function(e){return e.model.component})).map((function(e){return e.model.component.node}));Un.commit("addToHighlightedNodes",t)}else Un.commit("highlightNode",this.processNode)},getChildShape:function(e){var t=null,n=this.getShapesFromPoint(e);return 1===n.length?n[0]:(n.forEach((function(e){e.model.get("parent")&&e.model.component.node.type!==dl&&(t=e)})),t)},markSelectedByPoint:function(e){var t=this.getChildShape(e);t&&(this.selected=[t]),this.selected.length>0&&(this.isSelected=!0,this.isSelecting=!0,this.showLasso=!0,this.updateSelectionBox())},getElementsInsideSelector:function(){var e=this.paperManager.paper,t=e.$el.offset(),n={left:this.$el.offsetLeft+t.left,top:this.$el.offsetTop+t.top},r=this.$el.clientWidth,o=this.$el.clientHeight,i=(0,F.V)(e.viewport).toLocalPoint(n.left,n.top);i.x-=window.pageXOffset,i.y-=window.pageYOffset;var s=e.scale();r/=s.sx,o/=s.sy;var a=F.g.rect(i.x,i.y,r,o);return this.getElementsInSelectedArea(a,{strict:!1})},getPool:function(e){var t=this.paperManager.paper,n=null;return e&&e.length>0&&e.forEach((function(e){var t=e.model;n||t.getParentCell()&&t.getParentCell().component.node.type===Jo&&(n=t.getParentCell())})),t.findViewByModel(n)},isNotPoolChilds:function(e){if(e.length>0){var t=e.find((function(e){var t=e.model;return t.component&&t.component.node.type===Jo})),n=e.find((function(e){var t=e.model;return t.getParentCell()&&t.getParentCell().component.node.type===Jo}));return!!t||!n}return!1},overPoolDrag:function(e){if(!this.isNotPoolChilds(this.selected)){var t=this.getPool(this.selected),n=this.getShapesFromPoint(e),r=n.find((function(e){return e.model.component&&e.model.component.node.type===Jo}));this.newPool=null,this.oldPool=null,r?(this.paperManager.setStateValid(),this.invalidPool&&(this.invalidPool.model.component.shape.attr("body/fill",Ye),this.invalidPool=null),t&&t.model.get("id")!==r.model.get("id")&&(this.newPool=r,this.oldPool=t,this.isOutOfThePool=!1,this.isValidSelectionLinks||(this.isOutOfThePool=!0,this.invalidPool=r,r.model.component.shape.attr("body/fill",ze),Un.commit("preventSavingElementPosition")))):(this.isOutOfThePool=!0,Un.commit("preventSavingElementPosition"),this.paperManager.setStateInvalid())}},overPoolStopDrag:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.isNotPoolChilds(e.selected)){t.next=4;break}return e.updateFlowsWaypoint(),e.$emit("save-state"),t.abrupt("return");case 4:e.isOutOfThePool?(e.rollbackSelection(),e.invalidPool&&(e.invalidPool.model.component.shape.attr("body/fill",Ye),e.invalidPool=null)):(e.updateFlowsWaypoint(),e.newPool?(e.moveElements(e.selected,e.oldPool,e.newPool),e.moveConectedLinks(e.conectedLinks,e.oldPool,e.newPool),e.newPool=null,e.oldPool=null,e.updateLaneChildren(e.selected),e.$emit("save-state")):(e.expandToFitElement(e.selected),e.updateLaneChildren(e.selected),e.$emit("save-state")));case 5:case"end":return t.stop()}}),t)})))()},rollbackSelection:function(){var e=this;return l(a().mark((function t(){var n,r,o,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.initialPosition.left-e.left,r=e.initialPosition.top-e.top,e.style.left="".concat(e.initialPosition.left,"px"),e.style.top="".concat(e.initialPosition.top,"px"),o=e.paperManager.paper.scale(),i=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],e.selected.filter((function(e){return!i.includes(e.model.get("type"))})).forEach((function(e){e.model.translate(n/o.sx,r/o.sy)})),e.isOutOfThePool=!1,t.next=10,Un.commit("allowSavingElementPosition");case 10:return e.paperManager.setStateValid(),t.next=13,e.$nextTick();case 13:return t.next=15,e.paperManager.awaitScheduledUpdates();case 15:e.updateSelectionBox(!0);case 16:case"end":return t.stop()}}),t)})))()},expandToFitElement:function(e){if(e.length>0){var t=e.find((function(e){var t=e.model;return!!t.getParentCell()&&t.getParentCell().component.node.type===Jo})).model.getParentCell(),n=this.getSelectionVertex(this.selected,!0),r=t.getBBox(),o=r.x,i=r.y,s=r.width,a=r.height,c=n.maxX-n.minX,l=n.maxY-n.minY,d=n.minX-o,u=n.minY-i,h=d+c,p=d,f=u,m=u+l,g=0,v=0,b="bottom",y="right";h>s-am&&(g=h+am),p<om+am&&(g=s+(om+am-p),y="left"),f<am&&(v=am-f+a,b="top"),m>a&&(v=m+am),(g||v)&&(t.resize(Math.max(g,s),Math.max(v,a),{direction:"".concat(b,"-").concat(y)}),t.component.fixResizeRounding(),t.component.laneSet&&(t.component.resizeLanes(),t.component.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),t.component.updateAnchorPointPosition(),Un.commit("updateNodeBounds",{node:t.component.node,bounds:t.getBBox()}))}},updateLaneChildren:function(e){if(e){var t=e.find((function(e){var t=e.model;return!!t.getParentCell()&&t.getParentCell().component.node.type===Jo}));t&&(t.model.getParentCell(),t.model.component.laneSet&&t.component.updateLaneChildren())}},moveElements:function(e,t,n){var r=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"];e.filter((function(e){return!r.includes(e.model.get("type"))})).forEach((function(e){t.model.component.moveElement(e.model,n.model)}))},moveConectedLinks:function(e,t,n){e.forEach((function(e){t.model.component.moveFlow(e.model,n.model)}))}}},RC=NC,BC=(f(81289),fr(RC,$k,Xk,!1,null,"7c27567b",null)),LC=BC.exports,jC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"remote-cursor",style:{left:e.left+"px",top:e.top+"px"}},[t("inline-svg",{attrs:{src:e.cursorIcon,fill:e.cursorColor}}),t("div",{staticClass:"remote-username"},[e._v(" "+e._s(e.username)+" ")])],1)},FC=[],zC={components:{InlineSvg:sv},props:{cursorColor:{type:String,default:"#000000"},username:{type:String},top:{type:Number},left:{type:Number}},data:function(){return{cursorIcon:f(61264)}}},UC=zC,qC=(f(89655),fr(UC,jC,FC,!1,null,"70c20f1a",null)),VC=qC.exports;function HC(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=V(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(a)throw i}}}}f(39575),f(82472),f(48675),f(92990),f(18927),f(33105),f(35035),f(74345),f(89080),f(63408),f(14590),f(32846),f(44731),f(77209),f(96319),f(58867),f(37789),f(33739),f(29368),f(14483),f(12056),f(3462),f(30678),f(27462),f(33824),f(55021),f(12974),f(15016),f(23767),f(8585),f(68696);const WC=Object.create(null);WC["open"]="0",WC["close"]="1",WC["ping"]="2",WC["pong"]="3",WC["message"]="4",WC["upgrade"]="5",WC["noop"]="6";const GC=Object.create(null);Object.keys(WC).forEach((e=>{GC[WC[e]]=e}));const $C={type:"error",data:"parser error"},XC="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YC="function"===typeof ArrayBuffer,JC=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ZC=({type:e,data:t},n,r)=>XC&&t instanceof Blob?n?r(t):KC(t,r):YC&&(t instanceof ArrayBuffer||JC(t))?n?r(t):KC(new Blob([t]),r):r(WC[e]+(t||"")),KC=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function QC(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let eS;function tS(e,t){return XC&&e.data instanceof Blob?e.data.arrayBuffer().then(QC).then(t):YC&&(e.data instanceof ArrayBuffer||JC(e.data))?t(QC(e.data)):void ZC(e,!1,(e=>{eS||(eS=new TextEncoder),t(eS.encode(e))}))}const nS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rS="undefined"===typeof Uint8Array?[]:new Uint8Array(256);for(let f=0;f<nS.length;f++)rS[nS.charCodeAt(f)]=f;const oS=e=>{let t,n,r,o,i,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);const l=new ArrayBuffer(s),d=new Uint8Array(l);for(t=0;t<a;t+=4)n=rS[e.charCodeAt(t)],r=rS[e.charCodeAt(t+1)],o=rS[e.charCodeAt(t+2)],i=rS[e.charCodeAt(t+3)],d[c++]=n<<2|r>>4,d[c++]=(15&r)<<4|o>>2,d[c++]=(3&o)<<6|63&i;return l},iS="function"===typeof ArrayBuffer,sS=(e,t)=>{if("string"!==typeof e)return{type:"message",data:cS(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:aS(e.substring(1),t)};const r=GC[n];return r?e.length>1?{type:GC[n],data:e.substring(1)}:{type:GC[n]}:$C},aS=(e,t)=>{if(iS){const n=oS(e);return cS(n,t)}return{base64:!0,data:e}},cS=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},lS=String.fromCharCode(30),dS=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZC(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(lS))}))}))},uS=(e,t)=>{const n=e.split(lS),r=[];for(let o=0;o<n.length;o++){const e=sS(n[o],t);if(r.push(e),"error"===e.type)break}return r};function hS(){return new TransformStream({transform(e,t){tS(e,(n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!==typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)}))}})}let pS;function fS(e){return e.reduce(((e,t)=>e+t.length),0)}function mS(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function gS(e,t){pS||(pS=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){n.push(s);while(1){if(0===r){if(fS(n)<1)break;const e=mS(n,1);i=128===(128&e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(fS(n)<2)break;const e=mS(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(fS(n)<8)break;const e=mS(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue($C);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(fS(n)<o)break;const e=mS(n,o);a.enqueue(sS(i?e:pS.decode(e),t)),r=0}if(0===o||o>e){a.enqueue($C);break}}}})}const vS=4;function bS(e){if(e)return yS(e)}function yS(e){for(var t in bS.prototype)e[t]=bS.prototype[t];return e}bS.prototype.on=bS.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},bS.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},bS.prototype.off=bS.prototype.removeListener=bS.prototype.removeAllListeners=bS.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if(n=r[o],n===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},bS.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);r=0;for(var o=n.length;r<o;++r)n[r].apply(this,t)}return this},bS.prototype.emitReserved=bS.prototype.emit,bS.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},bS.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wS=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())();function xS(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const kS=wS.setTimeout,CS=wS.clearTimeout;function SS(e,t){t.useNativeTimers?(e.setTimeoutFn=kS.bind(wS),e.clearTimeoutFn=CS.bind(wS)):(e.setTimeoutFn=wS.setTimeout.bind(wS),e.clearTimeoutFn=wS.clearTimeout.bind(wS))}const ES=1.33;function AS(e){return"string"===typeof e?_S(e):Math.ceil((e.byteLength||e.size)*ES)}function _S(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function TS(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function MS(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}class PS extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class IS extends bS{constructor(e){super(),this.writable=!1,SS(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new PS(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=sS(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=TS(e);return t.length?"?"+t:""}}const OS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),DS=64,NS={};let RS,BS=0,LS=0;function jS(e){let t="";do{t=OS[e%DS]+t,e=Math.floor(e/DS)}while(e>0);return t}function FS(){const e=jS(+new Date);return e!==RS?(BS=0,RS=e):e+"."+jS(BS++)}for(;LS<DS;LS++)NS[OS[LS]]=LS;let zS=!1;try{zS="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(FO){}const US=zS;function qS(e){const t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||US))return new XMLHttpRequest}catch(n){}if(!t)try{return new(wS[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}function VS(){}function HS(){}const WS=function(){const e=new qS({xdomain:!1});return null!=e.responseType}();class GS extends IS{constructor(e){if(super(e),this.polling=!1,"undefined"!==typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!==typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=WS&&!t,this.opts.withCredentials&&(this.cookieJar=VS())}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};uS(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,dS(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=FS()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new $S(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}class $S extends bS{constructor(e,t){super(),SS(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=xS(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new qS(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(r){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"===typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(r){return void this.setTimeoutFn((()=>{this.onError(r)}),0)}"undefined"!==typeof document&&(this.index=$S.requestsCount++,$S.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=HS,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete $S.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if($S.requestsCount=0,$S.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",XS);else if("function"===typeof addEventListener){const e="onpagehide"in wS?"pagehide":"unload";addEventListener(e,XS,!1)}function XS(){for(let e in $S.requests)$S.requests.hasOwnProperty(e)&&$S.requests[e].abort()}const YS=(()=>{const e="function"===typeof Promise&&"function"===typeof Promise.resolve;return e?e=>Promise.resolve().then(e):(e,t)=>t(e,0)})(),JS=wS.WebSocket||wS.MozWebSocket,ZS=!0,KS="arraybuffer",QS="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class eE extends IS{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=QS?{}:xS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=ZS&&!QS?t?new JS(e,t):new JS(e):new JS(e,t,n)}catch(FO){return this.emitReserved("error",FO)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;ZC(n,this.supportsBinary,(e=>{const t={};if(!ZS&&(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate)){const n="string"===typeof e?Buffer.byteLength(e):e.length;n<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{ZS?this.ws.send(e):this.ws.send(e,t)}catch(o){}r&&YS((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=FS()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!JS}}class tE extends IS{get name(){return"webtransport"}doOpen(){"function"===typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=gS(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=hS();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const o=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),o())})).catch((e=>{}))};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this.writer.write(i).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&YS((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}const nE={websocket:eE,webtransport:tE,polling:GS},rE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,oE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function iE(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=rE.exec(e||""),i={},s=14;while(s--)i[oE[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=sE(i,i["path"]),i.queryKey=aE(i,i["query"]),i}function sE(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),r}function aE(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}class cE extends bS{constructor(e,t={}){super(),this.binaryType=KS,this.writeBuffer=[],e&&"object"===typeof e&&(t=e,e=null),e?(e=iE(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=iE(t.host).host),SS(this,t),this.secure=null!=t.secure?t.secure:"undefined"!==typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!==typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"===typeof this.opts.query&&(this.opts.query=MS(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"===typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=vS,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new nE[e](n)}open(){let e;if(this.opts.rememberUpgrade&&cE.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(t){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;cE.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;cE.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,l(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function c(e){t&&e.name!==t.name&&o()}const l=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",i),t.once("close",s),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{n||t.open()}),200):t.open()}onOpen(){if(this.readyState="open",cE.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){const e=this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1;if(!e)return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const e=this.writeBuffer[n].data;if(e&&(t+=AS(e)),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"===typeof t&&(r=t,t=void 0),"function"===typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){cE.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}cE.protocol=vS;cE.protocol;function lE(e,t="",n){let r=e;n=n||"undefined"!==typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e="undefined"!==typeof n?n.protocol+"//"+e:"https://"+e),r=iE(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":"),i=o?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const dE="function"===typeof ArrayBuffer,uE=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,hE=Object.prototype.toString,pE="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===hE.call(Blob),fE="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===hE.call(File);function mE(e){return dE&&(e instanceof ArrayBuffer||uE(e))||pE&&e instanceof Blob||fE&&e instanceof File}function gE(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(gE(e[t]))return!0;return!1}if(mE(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return gE(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&gE(e[n]))return!0;return!1}function vE(e){const t=[],n=e.data,r=e;return r.data=bE(n,t),r.attachments=t.length,{packet:r,buffers:t}}function bE(e,t){if(!e)return e;if(mE(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=bE(e[r],t);return n}if("object"===typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=bE(e[r],t));return n}return e}function yE(e,t){return e.data=wE(e.data,t),delete e.attachments,e}function wE(e,t){if(!e)return e;if(e&&!0===e._placeholder){const n="number"===typeof e.num&&e.num>=0&&e.num<t.length;if(n)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=wE(e[n],t);else if("object"===typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=wE(e[n],t));return e}const xE=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],kE=5;var CE;(function(e){e[e["CONNECT"]=0]="CONNECT",e[e["DISCONNECT"]=1]="DISCONNECT",e[e["EVENT"]=2]="EVENT",e[e["ACK"]=3]="ACK",e[e["CONNECT_ERROR"]=4]="CONNECT_ERROR",e[e["BINARY_EVENT"]=5]="BINARY_EVENT",e[e["BINARY_ACK"]=6]="BINARY_ACK"})(CE||(CE={}));class SE{constructor(e){this.replacer=e}encode(e){return e.type!==CE.EVENT&&e.type!==CE.ACK||!gE(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===CE.EVENT?CE.BINARY_EVENT:CE.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==CE.BINARY_EVENT&&e.type!==CE.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=vE(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function EE(e){return"[object Object]"===Object.prototype.toString.call(e)}class AE extends bS{constructor(e){super(),this.reviver=e}add(e){let t;if("string"===typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===CE.BINARY_EVENT;n||t.type===CE.BINARY_ACK?(t.type=n?CE.EVENT:CE.ACK,this.reconstructor=new _E(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!mE(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===CE[n.type])throw new Error("unknown packet type "+n.type);if(n.type===CE.BINARY_EVENT||n.type===CE.BINARY_ACK){const r=t+1;while("-"!==e.charAt(++t)&&t!=e.length);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;while(++t){const n=e.charAt(t);if(","===n)break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;while(++t){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!AE.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case CE.CONNECT:return EE(t);case CE.DISCONNECT:return void 0===t;case CE.CONNECT_ERROR:return"string"===typeof t||EE(t);case CE.EVENT:case CE.BINARY_EVENT:return Array.isArray(t)&&("number"===typeof t[0]||"string"===typeof t[0]&&-1===xE.indexOf(t[0]));case CE.ACK:case CE.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class _E{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=yE(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function TE(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ME=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class PE extends bS{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[TE(e,"open",this.onopen.bind(this)),TE(e,"packet",this.onpacket.bind(this)),TE(e,"error",this.onerror.bind(this)),TE(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io["_reconnecting"]||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ME.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:CE.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,o=this.flags.volatile&&(!r||!this.connected);return o||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"===typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;const o=null!==e;return o?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:CE.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){const t=e.nsp===this.nsp;if(t)switch(e.type){case CE.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case CE.EVENT:case CE.BINARY_EVENT:this.onevent(e);break;case CE.ACK:case CE.BINARY_ACK:this.onack(e);break;case CE.DISCONNECT:this.ondisconnect();break;case CE.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t);break}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"===typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:CE.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"===typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io["_destroy"](this)}disconnect(){return this.connected&&this.packet({type:CE.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function IE(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}IE.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},IE.prototype.reset=function(){this.attempts=0},IE.prototype.setMin=function(e){this.ms=e},IE.prototype.setMax=function(e){this.max=e},IE.prototype.setJitter=function(e){this.jitter=e};class OE extends bS{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"===typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,SS(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new IE({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const o=t.parser||n;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new cE(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=TE(t,"open",(function(){n.onopen(),e&&e()})),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=TE(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),o(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(TE(e,"ping",this.onping.bind(this)),TE(e,"data",this.ondata.bind(this)),TE(e,"error",this.onerror.bind(this)),TE(e,"close",this.onclose.bind(this)),TE(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){YS((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new PE(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){const e=this.nsps[n];if(e.active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const DE={};function NE(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};const n=lE(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=DE[o]&&i in DE[o]["nsps"],a=t.forceNew||t["force new connection"]||!1===t.multiplex||s;let c;return a?c=new OE(r,t):(DE[o]||(DE[o]=new OE(r,t)),c=DE[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(NE,{Manager:OE,Socket:PE,io:NE,connect:NE});const RE=()=>new Map,BE=e=>{const t=RE();return e.forEach(((e,n)=>{t.set(n,e)})),t},LE=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},jE=(e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n},FE=(e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1},zE=()=>new Set,UE=e=>e[e.length-1],qE=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},VE=Array.from,HE=Array.isArray;class WE{constructor(){this._observers=RE()}on(e,t){LE(this._observers,e,zE).add(t)}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return VE((this._observers.get(e)||RE()).values()).forEach((e=>e(...t)))}destroy(){this._observers=RE()}}const GE=Math.floor,$E=(Math.ceil,Math.abs),XE=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),YE=(e,t)=>e>t?e:t,JE=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),ZE=String.fromCharCode,KE=(String.fromCodePoint,ZE(65535),e=>e.toLowerCase()),QE=/^\s*/g,eA=e=>e.replace(QE,""),tA=/([A-Z])/g,nA=(e,t)=>eA(e.replace(tA,(e=>`${t}${KE(e)}`))),rA=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.codePointAt(o);return r},oA="undefined"!==typeof TextEncoder?new TextEncoder:null,iA=e=>oA.encode(e),sA=oA?iA:rA;let aA="undefined"===typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});aA&&1===aA.decode(new Uint8Array).length&&(aA=null);const cA=e=>void 0===e?null:e;class lA{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let dA=new lA,uA=!0;try{"undefined"!==typeof localStorage&&(dA=localStorage,uA=!1)}catch(zO){}const hA=dA,pA=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&pA(e,t,n+1)}},fA=e=>e,mA=(e,t)=>t.includes(e),gA="undefined"!==typeof process&&process.release&&/node|io\.js/.test(process.release.name);"undefined"!==typeof navigator&&/Mac/.test(navigator.platform);let vA;const bA=[],yA=()=>{if(void 0===vA)if(gA){vA=RE();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];"-"===r[0]?(null!==t&&vA.set(t,""),t=r):null!==t?(vA.set(t,r),t=null):bA.push(r)}null!==t&&vA.set(t,"")}else"object"===typeof location?(vA=RE(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");vA.set(`--${nA(t,"-")}`,n),vA.set(`-${nA(t,"-")}`,n)}}))):vA=RE();return vA},wA=e=>yA().has(e),xA=e=>cA(gA?{VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}[e.toUpperCase()]:hA.getItem(e)),kA=e=>wA("--"+e)||null!==xA(e),CA=(kA("production"),gA&&mA({VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}.FORCE_COLOR,["true","1","2"])),SA=!wA("no-colors")&&(!gA||process.stdout.isTTY||CA)&&(!gA||wA("color")||CA||null!==xA("COLORTERM")||(xA("TERM")||"").includes("color")),EA=e=>new Uint8Array(e),AA=(e,t,n)=>new Uint8Array(e,t,n),_A=e=>{const t=EA(e.byteLength);return t.set(e),t},TA=1,MA=2,PA=4,IA=8,OA=32,DA=64,NA=128,RA=31,BA=63,LA=127,jA=2147483647,FA=Number.MAX_SAFE_INTEGER,zA=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"===typeof e&&isFinite(e)&&GE(e)===e));Number.isNaN,Number.parseInt;class UA{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const qA=()=>new UA,VA=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},HA=e=>{const t=new Uint8Array(VA(e));let n=0;for(let r=0;r<e.bufs.length;r++){const o=e.bufs[r];t.set(o,n),n+=o.length}return t.set(AA(e.cbuf.buffer,0,e.cpos),n),t},WA=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(AA(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*YE(n,t)),e.cpos=0)},GA=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},$A=GA,XA=(e,t)=>{while(t>LA)GA(e,NA|LA&t),t=GE(t/128);GA(e,LA&t)},YA=(e,t)=>{const n=JE(t);n&&(t=-t),GA(e,(t>BA?NA:0)|(n?DA:0)|BA&t),t=GE(t/64);while(t>0)GA(e,(t>LA?NA:0)|LA&t),t=GE(t/128)},JA=new Uint8Array(3e4),ZA=JA.length/3,KA=(e,t)=>{if(t.length<ZA){const n=oA.encodeInto(t,JA).written||0;XA(e,n);for(let t=0;t<n;t++)GA(e,JA[t])}else n_(e,sA(t))},QA=(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;XA(e,r);for(let o=0;o<r;o++)GA(e,n.codePointAt(o))},e_=oA&&oA.encodeInto?KA:QA,t_=(e,t)=>{const n=e.cbuf.length,r=e.cpos,o=XE(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(YE(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},n_=(e,t)=>{XA(e,t.byteLength),t_(e,t)},r_=(e,t)=>{WA(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},o_=(e,t)=>r_(e,4).setFloat32(0,t,!1),i_=(e,t)=>r_(e,8).setFloat64(0,t,!1),s_=(e,t)=>r_(e,8).setBigInt64(0,t,!1),a_=new DataView(new ArrayBuffer(4)),c_=e=>(a_.setFloat32(0,e),a_.getFloat32(0)===e),l_=(e,t)=>{switch(typeof t){case"string":GA(e,119),e_(e,t);break;case"number":zA(t)&&$E(t)<=jA?(GA(e,125),YA(e,t)):c_(t)?(GA(e,124),o_(e,t)):(GA(e,123),i_(e,t));break;case"bigint":GA(e,122),s_(e,t);break;case"object":if(null===t)GA(e,126);else if(HE(t)){GA(e,117),XA(e,t.length);for(let n=0;n<t.length;n++)l_(e,t[n])}else if(t instanceof Uint8Array)GA(e,116),n_(e,t);else{GA(e,118);const n=Object.keys(t);XA(e,n.length);for(let r=0;r<n.length;r++){const o=n[r];e_(e,o),l_(e,t[o])}}break;case"boolean":GA(e,t?120:121);break;default:GA(e,127)}};class d_ extends UA{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&XA(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const u_=e=>{e.count>0&&(YA(e.encoder,1===e.count?e.s:-e.s),e.count>1&&XA(e.encoder,e.count-2))};class h_{constructor(){this.encoder=new UA,this.s=0,this.count=0}write(e){this.s===e?this.count++:(u_(this),this.count=1,this.s=e)}toUint8Array(){return u_(this),HA(this.encoder)}}const p_=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);YA(e.encoder,t),e.count>1&&XA(e.encoder,e.count-2)}};class f_{constructor(){this.encoder=new UA,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(p_(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return p_(this),HA(this.encoder)}}class m_{constructor(){this.sarr=[],this.s="",this.lensE=new h_}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new UA;return this.sarr.push(this.s),this.s="",e_(e,this.sarr.join("")),t_(e,this.lensE.toUint8Array()),HA(e)}}const g_=e=>new Error(e),v_=()=>{throw g_("Method unimplemented")},b_=()=>{throw g_("Unexpected case")},y_=g_("Unexpected end of array"),w_=g_("Integer out of Range");class x_{constructor(e){this.arr=e,this.pos=0}}const k_=e=>new x_(e),C_=e=>e.pos!==e.arr.length,S_=(e,t)=>{const n=AA(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},E_=e=>S_(e,__(e)),A_=e=>e.arr[e.pos++],__=e=>{let t=0,n=1;const r=e.arr.length;while(e.pos<r){const r=e.arr[e.pos++];if(t+=(r&LA)*n,n*=128,r<NA)return t;if(t>FA)throw w_}throw y_},T_=e=>{let t=e.arr[e.pos++],n=t&BA,r=64;const o=(t&DA)>0?-1:1;if(0===(t&NA))return o*n;const i=e.arr.length;while(e.pos<i){if(t=e.arr[e.pos++],n+=(t&LA)*r,r*=128,t<NA)return o*n;if(n>FA)throw w_}throw y_},M_=e=>{let t=__(e);if(0===t)return"";{let n=String.fromCodePoint(A_(e));if(--t<100)while(t--)n+=String.fromCodePoint(A_(e));else while(t>0){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},P_=e=>aA.decode(E_(e)),I_=aA?P_:M_,O_=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},D_=e=>O_(e,4).getFloat32(0,!1),N_=e=>O_(e,8).getFloat64(0,!1),R_=e=>O_(e,8).getBigInt64(0,!1),B_=[e=>{},e=>null,T_,D_,N_,R_,e=>!1,e=>!0,I_,e=>{const t=__(e),n={};for(let r=0;r<t;r++){const t=I_(e);n[t]=L_(e)}return n},e=>{const t=__(e),n=[];for(let r=0;r<t;r++)n.push(L_(e));return n},E_],L_=e=>B_[127-A_(e)](e);class j_ extends x_{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),C_(this)?this.count=__(this)+1:this.count=-1),this.count--,this.s}}class F_ extends x_{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=T_(this);const e=JE(this.s);this.count=1,e&&(this.s=-this.s,this.count=__(this)+2)}return this.count--,this.s}}class z_ extends x_{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=T_(this),t=1&e;this.diff=GE(e/2),this.count=1,t&&(this.count=__(this)+2)}return this.s+=this.diff,this.count--,this.s}}class U_{constructor(e){this.decoder=new F_(e),this.str=I_(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const q_=crypto.getRandomValues.bind(crypto),V_=(Math.random,()=>q_(new Uint32Array(1))[0]),H_=[1e7]+-1e3+-4e3+-8e3+-1e11,W_=()=>H_.replace(/[018]/g,(e=>(e^V_()&15>>e/4).toString(16))),G_=e=>new Promise(e);Promise.all.bind(Promise);class $_{constructor(e,t){this.left=e,this.right=t}}const X_=(e,t)=>new $_(e,t),Y_="undefined"!==typeof document?document:{},J_=("undefined"!==typeof DOMParser&&new DOMParser,e=>jE(e,((e,t)=>`${t}:${e};`)).join("")),Z_=(Y_.ELEMENT_NODE,Y_.TEXT_NODE,Y_.CDATA_SECTION_NODE,Y_.COMMENT_NODE,Y_.DOCUMENT_NODE,Y_.DOCUMENT_TYPE_NODE,Y_.DOCUMENT_FRAGMENT_NODE,Symbol),K_=Date.now,Q_=Z_(),eT=Z_(),tT=Z_(),nT=Z_(),rT=Z_(),oT=Z_(),iT=Z_(),sT=Z_(),aT=Z_(),cT=e=>{const t=[],n=[];let r=0;for(;r<e.length;r++){const o=e[r];o.constructor===String||o.constructor===Number?t.push(o):o.constructor===Object&&n.push(JSON.stringify(o))}return n};K_();const lT={[Q_]:X_("font-weight","bold"),[eT]:X_("font-weight","normal"),[tT]:X_("color","blue"),[rT]:X_("color","green"),[nT]:X_("color","grey"),[oT]:X_("color","red"),[iT]:X_("color","purple"),[sT]:X_("color","orange"),[aT]:X_("color","black")},dT=e=>{const t=[],n=[],r=RE();let o=[],i=0;for(;i<e.length;i++){const o=e[i],s=lT[o];if(void 0!==s)r.set(s.left,s.right);else{if(o.constructor!==String&&o.constructor!==Number)break;{const e=J_(r);i>0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||o.push(t)}return o},uT=SA?dT:cT,hT=(...e)=>{console.log(...uT(e)),pT.forEach((t=>t.print(e)))},pT=zE();const fT=e=>({[Symbol.iterator](){return this},next:e}),mT=(e,t)=>fT((()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n})),gT=(e,t)=>fT((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})),vT=Object.assign,bT=Object.keys,yT=(e,t)=>{for(const n in e)t(e[n],n)},wT=e=>bT(e).length,xT=e=>{for(const t in e)return!1;return!0},kT=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},CT=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ST=(e,t)=>e===t||wT(e)===wT(t)&&kT(e,((e,n)=>(void 0!==e||CT(t,n))&&t[n]===e));class ET{constructor(e,t){this.clock=e,this.len=t}}class AT{constructor(){this.clients=new Map}}const _T=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let i=0;i<t.length;i++){const r=t[i];IM(e,o,r.clock,r.len,n)}})),TT=(e,t)=>{let n=0,r=e.length-1;while(n<=r){const o=GE((n+r)/2),i=e[o],s=i.clock;if(s<=t){if(t<s+i.len)return o;n=o+1}else r=o-1}return null},MT=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==TT(n,t.clock)},PT=e=>{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t<e.length;t++){const r=e[n-1],o=e[t];r.clock+r.len>=o.clock?r.len=YE(r.len,o.clock+o.len-r.clock):(n<t&&(e[n]=o),n++)}e.length=n}))},IT=e=>{const t=new AT;for(let n=0;n<e.length;n++)e[n].clients.forEach(((r,o)=>{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;t<e.length;t++)qE(i,e[t].clients.get(o)||[]);t.clients.set(o,i)}}));return PT(t),t},OT=(e,t,n,r)=>{LE(e.clients,t,(()=>[])).push(new ET(n,r))},DT=()=>new AT,NT=e=>{const t=DT();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const o=n.id.clock;let i=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])i+=n.length;r.push(new ET(o,i))}}r.length>0&&t.clients.set(n,r)})),t},RT=(e,t)=>{XA(e.restEncoder,t.clients.size),VE(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),XA(e.restEncoder,t);const r=n.length;XA(e.restEncoder,r);for(let o=0;o<r;o++){const t=n[o];e.writeDsClock(t.clock),e.writeDsLen(t.len)}}))},BT=e=>{const t=new AT,n=__(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();const n=__(e.restDecoder),r=__(e.restDecoder);if(r>0){const o=LE(t.clients,n,(()=>[]));for(let t=0;t<r;t++)o.push(new ET(e.readDsClock(),e.readDsLen()))}}return t},LT=(e,t,n)=>{const r=new AT,o=__(e.restDecoder);for(let i=0;i<o;i++){e.resetDsCurVal();const o=__(e.restDecoder),i=__(e.restDecoder),s=n.clients.get(o)||[],a=kM(n,o);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<a){a<i&&OT(r,o,a,i-a);let e=SM(s,n),c=s[e];!c.deleted&&c.id.clock<n&&(s.splice(e+1,0,jI(t,c,n-c.id.clock)),e++);while(e<s.length){if(c=s[e++],!(c.id.clock<i))break;c.deleted||(i<c.id.clock+c.length&&s.splice(e,0,jI(t,c,i-c.id.clock)),c.delete(t))}}else OT(r,o,n,i-n)}}if(r.clients.size>0){const e=new $T;return XA(e.restEncoder,0),RT(e,r),e.toUint8Array()}return null},jT=V_;class FT extends WE{constructor({guid:e=W_(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=jT(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new wM,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=G_((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>G_((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isLoaded||this.emit("load",[])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||FM(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(VE(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return FM(this,e,t)}get(e,t=dP){const n=LE(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==dP&&r!==t){if(r===dP){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,MP)}getText(e=""){return this.get(e,JP)}getMap(e=""){return this.get(e,OP)}getXmlFragment(e=""){return this.get(e,QP)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){VE(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new FT({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,FM(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class zT{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return __(this.restDecoder)}readDsLen(){return __(this.restDecoder)}}class UT extends zT{readLeftID(){return fM(__(this.restDecoder),__(this.restDecoder))}readRightID(){return fM(__(this.restDecoder),__(this.restDecoder))}readClient(){return __(this.restDecoder)}readInfo(){return A_(this.restDecoder)}readString(){return I_(this.restDecoder)}readParentInfo(){return 1===__(this.restDecoder)}readTypeRef(){return __(this.restDecoder)}readLen(){return __(this.restDecoder)}readAny(){return L_(this.restDecoder)}readBuf(){return _A(E_(this.restDecoder))}readJSON(){return JSON.parse(I_(this.restDecoder))}readKey(){return I_(this.restDecoder)}}class qT{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=__(this.restDecoder),this.dsCurrVal}readDsLen(){const e=__(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class VT extends qT{constructor(e){super(e),this.keys=[],__(e),this.keyClockDecoder=new z_(E_(e)),this.clientDecoder=new F_(E_(e)),this.leftClockDecoder=new z_(E_(e)),this.rightClockDecoder=new z_(E_(e)),this.infoDecoder=new j_(E_(e),A_),this.stringDecoder=new U_(E_(e)),this.parentInfoDecoder=new j_(E_(e),A_),this.typeRefDecoder=new F_(E_(e)),this.lenDecoder=new F_(E_(e))}readLeftID(){return new hM(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new hM(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return L_(this.restDecoder)}readBuf(){return E_(this.restDecoder)}readJSON(){return L_(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class HT{constructor(){this.restEncoder=qA()}toUint8Array(){return HA(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){XA(this.restEncoder,e)}writeDsLen(e){XA(this.restEncoder,e)}}class WT extends HT{writeLeftID(e){XA(this.restEncoder,e.client),XA(this.restEncoder,e.clock)}writeRightID(e){XA(this.restEncoder,e.client),XA(this.restEncoder,e.clock)}writeClient(e){XA(this.restEncoder,e)}writeInfo(e){$A(this.restEncoder,e)}writeString(e){e_(this.restEncoder,e)}writeParentInfo(e){XA(this.restEncoder,e?1:0)}writeTypeRef(e){XA(this.restEncoder,e)}writeLen(e){XA(this.restEncoder,e)}writeAny(e){l_(this.restEncoder,e)}writeBuf(e){n_(this.restEncoder,e)}writeJSON(e){e_(this.restEncoder,JSON.stringify(e))}writeKey(e){e_(this.restEncoder,e)}}class GT{constructor(){this.restEncoder=qA(),this.dsCurrVal=0}toUint8Array(){return HA(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,XA(this.restEncoder,t)}writeDsLen(e){0===e&&b_(),XA(this.restEncoder,e-1),this.dsCurrVal+=e}}class $T extends GT{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new f_,this.clientEncoder=new h_,this.leftClockEncoder=new f_,this.rightClockEncoder=new f_,this.infoEncoder=new d_($A),this.stringEncoder=new m_,this.parentInfoEncoder=new d_($A),this.typeRefEncoder=new h_,this.lenEncoder=new h_}toUint8Array(){const e=qA();return XA(e,0),n_(e,this.keyClockEncoder.toUint8Array()),n_(e,this.clientEncoder.toUint8Array()),n_(e,this.leftClockEncoder.toUint8Array()),n_(e,this.rightClockEncoder.toUint8Array()),n_(e,HA(this.infoEncoder)),n_(e,this.stringEncoder.toUint8Array()),n_(e,HA(this.parentInfoEncoder)),n_(e,this.typeRefEncoder.toUint8Array()),n_(e,this.lenEncoder.toUint8Array()),t_(e,HA(this.restEncoder)),HA(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){l_(this.restEncoder,e)}writeBuf(e){n_(this.restEncoder,e)}writeJSON(e){l_(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const XT=(e,t,n,r)=>{r=YE(r,t[0].id.clock);const o=SM(t,r);XA(e.restEncoder,t.length-o),e.writeClient(n),XA(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let s=o+1;s<t.length;s++)t[s].write(e,0)},YT=(e,t,n)=>{const r=new Map;n.forEach(((e,n)=>{kM(t,n)>e&&r.set(n,e)})),xM(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),XA(e.restEncoder,r.size),VE(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{XT(e,t.clients.get(n),n,r)}))},JT=(e,t)=>{const n=RE(),r=__(e.restDecoder);for(let o=0;o<r;o++){const r=__(e.restDecoder),o=new Array(r),i=e.readClient();let s=__(e.restDecoder);n.set(i,{i:0,refs:o});for(let n=0;n<r;n++){const r=e.readInfo();switch(RA&r){case 0:{const t=e.readLen();o[n]=new dI(fM(i,s),t),s+=t;break}case 10:{const t=__(e.restDecoder);o[n]=new VI(fM(i,s),t),s+=t;break}default:{const a=0===(r&(DA|NA)),c=new FI(fM(i,s),null,(r&NA)===NA?e.readLeftID():null,null,(r&DA)===DA?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,a&&(r&OA)===OA?e.readString():null,zI(e,r));o[n]=c,s+=c.length}}}}return n},ZT=(e,t,n)=>{const r=[];let o=VE(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);while(e.refs.length===e.i){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let s=i();if(null===s&&0===r.length)return null;const a=new wM,c=new Map,l=(e,t)=>{const n=c.get(e);(null==n||n>t)&&c.set(e,t)};let d=s.refs[s.i++];const u=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};while(1){if(d.constructor!==VI){const o=LE(u,d.id.client,(()=>kM(t,d.id.client))),i=o-d.id.clock;if(i<0)r.push(d),l(d.id.client,d.id.clock-1),h();else{const o=d.getMissing(e,t);if(null!==o){r.push(d);const e=n.get(o)||{refs:[],i:0};if(e.refs.length!==e.i){d=e.refs[e.i++];continue}l(o,kM(t,o)),h()}else(0===i||i<d.length)&&(d.integrate(e,i),u.set(d.id.client,d.id.clock+d.length))}}if(r.length>0)d=r.pop();else if(null!==s&&s.i<s.refs.length)d=s.refs[s.i++];else{if(s=i(),null===s)break;d=s.refs[s.i++]}}if(a.clients.size>0){const e=new $T;return YT(e,a,new Map),XA(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},KT=(e,t)=>YT(e,t.doc.store,t.beforeState),QT=(e,t,n,r=new VT(e))=>FM(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=JT(r,n),s=ZT(e,o,i),a=o.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<kM(o,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const n=a.missing.get(e);(null==n||n>t)&&a.missing.set(e,t)}a.update=WM([a.update,s.update])}}else o.pendingStructs=s;const c=LT(r,e,o);if(o.pendingDs){const t=new VT(k_(o.pendingDs));__(t.restDecoder);const n=LT(t,e,o);o.pendingDs=c&&n?WM([c,n]):c||n}else o.pendingDs=c;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,eM(e.doc,t)}}),n,!1),eM=(e,t,n,r=VT)=>{const o=k_(t);QT(o,e,n,new r(o))},tM=(e,t,n)=>eM(e,t,n,UT),nM=(e,t,n=new Map)=>{YT(e,t.store,n),RT(e,NT(t.store))},rM=(e,t=new Uint8Array([0]),n=new $T)=>{const r=sM(t);nM(n,e,r);const o=[n.toUint8Array()];if(e.store.pendingDs&&o.push(e.store.pendingDs),e.store.pendingStructs&&o.push(GM(e.store.pendingStructs.update,t)),o.length>1){if(n.constructor===WT)return VM(o.map(((e,t)=>0===t?e:ZM(e))));if(n.constructor===$T)return WM(o)}return o[0]},oM=(e,t)=>rM(e,t,new WT),iM=e=>{const t=new Map,n=__(e.restDecoder);for(let r=0;r<n;r++){const n=__(e.restDecoder),r=__(e.restDecoder);t.set(n,r)}return t},sM=e=>iM(new zT(k_(e)));class aM{constructor(){this.l=[]}}const cM=()=>new aM,lM=(e,t)=>e.l.push(t),dM=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},uM=(e,t,n)=>pA(e.l,[t,n]);class hM{constructor(e,t){this.client=e,this.clock=t}}const pM=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,fM=(e,t)=>new hM(e,t),mM=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw b_()};class gM{constructor(e,t){this.ds=e,this.sv=t}}const vM=(e,t)=>new gM(e,t),bM=(vM(DT(),new Map),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!MT(t.ds,e.id)),yM=(e,t)=>{const n=LE(e.meta,yM,zE),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<kM(r,n)&&TM(e,fM(n,t))})),_T(e,t.ds,(e=>{})),n.add(t))};class wM{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const xM=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},kM=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},CM=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw b_()}n.push(t)},SM=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let s=GE(t/(i+o.length-1)*r);while(n<=r){if(o=e[s],i=o.id.clock,i<=t){if(t<i+o.length)return s;n=s+1}else r=s-1;s=GE((n+r)/2)}throw b_()},EM=(e,t)=>{const n=e.clients.get(t.client);return n[SM(n,t.clock)]},AM=EM,_M=(e,t,n)=>{const r=SM(t,n),o=t[r];return o.id.clock<n&&o instanceof FI?(t.splice(r+1,0,jI(e,o,n-o.id.clock)),r+1):r},TM=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[_M(e,n,t.clock)]},MM=(e,t,n)=>{const r=t.clients.get(n.client),o=SM(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==dI&&r.splice(o+1,0,jI(e,i,n.clock-i.id.clock+1)),i},PM=(e,t,n)=>{const r=e.clients.get(t.id.client);r[SM(r,t.id.clock)]=n},IM=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=_M(e,t,n);do{s=t[a++],i<s.id.clock+s.length&&_M(e,t,i),o(s)}while(a<t.length&&t[a].id.clock<i)};class OM{constructor(e,t,n){this.doc=e,this.deleteSet=new AT,this.beforeState=xM(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const DM=(e,t)=>!(0===t.deleteSet.clients.size&&!FE(t.afterState,((e,n)=>t.beforeState.get(n)!==e)))&&(PT(t.deleteSet),KT(e,t),RT(e,t.deleteSet),!0),NM=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&LE(e.changed,t,zE).add(n)},RM=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0;n=r,r=e[--o-1]){if(r.deleted!==n.deleted||r.constructor!==n.constructor||!r.mergeWith(n))break;n instanceof FI&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r)}const i=t-o;return i&&e.splice(t+1-i,i),i},BM=(e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=SM(e,i.clock),o=e[r];r<e.length&&o.id.clock<s;o=e[++r]){const o=e[r];if(i.clock+i.len<=o.id.clock)break;o instanceof FI&&o.deleted&&!o.keep&&n(o)&&o.gc(t,!1)}}}},LM=(e,t)=>{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t],o=XE(r.length-1,1+SM(r,n.clock+n.len-1));for(let e=o,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+RM(r,e)}}))},jM=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{PT(i),n.afterState=xM(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const e=[];n.changed.forEach(((t,r)=>e.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&(e=e.filter((e=>null===e.target._item||!e.target._item.deleted)),e.forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),uM(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),pA(e,[]),n._needFormattingCleanup&&$P(n)}finally{r.gc&&BM(i,o,r.gcFilter),LM(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=YE(SM(e,r),1);for(let t=e.length-1;t>=n;)t-=1+RM(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=o.clients.get(t),i=SM(r,n);i+1<r.length&&RM(r,i+1)>1||i>0&&RM(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(hT(sT,Q_,"[yjs] ",eT,oT,"Changed the client-id because another client seems to be using it."),r.clientID=jT()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new WT,t=DM(e,n);t&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new $T,t=DM(e,n);t&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:c,subdocsRemoved:l}=n;(a.size>0||l.size>0||c.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),l.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:c,added:a,removed:l},r,n]),l.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):jM(e,t+1)}}},FM=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new OM(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&jM(o,0)}}return s};function*zM(e){const t=__(e.restDecoder);for(let n=0;n<t;n++){const t=__(e.restDecoder),n=e.readClient();let r=__(e.restDecoder);for(let o=0;o<t;o++){const t=e.readInfo();if(10===t){const t=__(e.restDecoder);yield new VI(fM(n,r),t),r+=t}else if(0!==(RA&t)){const o=0===(t&(DA|NA)),i=new FI(fM(n,r),null,(t&NA)===NA?e.readLeftID():null,null,(t&DA)===DA?e.readRightID():null,o?e.readParentInfo()?e.readString():e.readLeftID():null,o&&(t&OA)===OA?e.readString():null,zI(e,t));yield i,r+=i.length}else{const t=e.readLen();yield new dI(fM(n,r),t),r+=t}}}}class UM{constructor(e,t){this.gen=zM(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===VI);return this.curr}}class qM{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const VM=e=>WM(e,UT,WT),HM=(e,t)=>{if(e.constructor===dI){const{client:n,clock:r}=e.id;return new dI(fM(n,r+t),e.length-t)}if(e.constructor===VI){const{client:n,clock:r}=e.id;return new VI(fM(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new FI(fM(r,o+t),null,fM(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},WM=(e,t=VT,n=$T)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(k_(e))));let o=r.map((e=>new UM(e,!0))),i=null;const s=new n,a=new qM(s);while(1){if(o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===VI?1:-1:n}return t.curr.id.client-e.curr.id.client})),0===o.length)break;const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;while(null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)XM(a,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length<n.id.clock)if(i.struct.constructor===VI)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{XM(a,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length,r=new VI(fM(t,i.struct.id.clock+i.struct.length),e);i={struct:r,offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===VI?i.struct.length-=t:n=HM(n,t)),i.struct.mergeWith(n)||(XM(a,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==VI;n=e.next())XM(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(XM(a,i.struct,i.offset),i=null),YM(a);const c=r.map((e=>BT(e))),l=IT(c);return RT(s,l),s.toUint8Array()},GM=(e,t,n=VT,r=$T)=>{const o=sM(t),i=new r,s=new qM(i),a=new n(k_(e)),c=new UM(a,!1);while(c.curr){const e=c.curr,t=e.id.client,n=o.get(t)||0;if(c.curr.constructor!==VI)if(e.id.clock+e.length>n){XM(s,e,YE(n-e.id.clock,0)),c.next();while(c.curr&&c.curr.id.client===t)XM(s,c.curr,0),c.next()}else while(c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n)c.next();else c.next()}YM(s);const l=BT(a);return RT(i,l),i.toUint8Array()},$M=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:HA(e.encoder.restEncoder)}),e.encoder.restEncoder=qA(),e.written=0)},XM=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&$M(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),XA(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},YM=e=>{$M(e);const t=e.encoder.restEncoder;XA(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const r=e.clientStructs[n];XA(t,r.written),t_(t,r.restEncoder)}},JM=(e,t,n,r)=>{const o=new n(k_(e)),i=new UM(o,!1),s=new r,a=new qM(s);for(let l=i.curr;null!==l;l=i.next())XM(a,t(l),0);YM(a);const c=BT(o);return RT(s,c),s.toUint8Array()},ZM=e=>JM(e,fA,VT,WT),KM="You must not compute changes after the event-handler fired.";class QM{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=eP(this.currentTarget,this.target))}deletes(e){return MT(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw g_(KM);const e=new Map,t=this.target,n=this.transaction.changed.get(t);n.forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;while(null!==e&&this.adds(e))e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=UE(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=UE(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=UE(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw g_(KM);const t=this.target,n=zE(),r=zE(),o=[];e={added:n,deleted:r,delta:o,keys:this.keys};const i=this.transaction.changed.get(t);if(i.has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const eP=(e,t)=>{const n=[];while(null!==t._item&&t!==e){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;while(r!==t._item&&null!==r)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n},tP=80;let nP=0;class rP{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=nP++}}const oP=e=>{e.timestamp=nP++},iP=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=nP++},sP=(e,t,n)=>{if(e.length>=tP){const r=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return iP(r,t,n),r}{const r=new rP(t,n);return e.push(r),r}},aP=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>$E(t-e.index)<$E(t-n.index)?e:n));let r=e._start,o=0;null!==n&&(r=n.p,o=n.index,oP(n));while(null!==r.right&&o<t){if(!r.deleted&&r.countable){if(t<o+r.length)break;o+=r.length}r=r.right}while(null!==r.left&&o>t)r=r.left,!r.deleted&&r.countable&&(o-=r.length);while(null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&$E(n.index-o)<r.parent.length/tP?(iP(n,r,o),n):sP(e._searchMarker,r,o)},cP=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;t.marker=!1;while(t&&(t.deleted||!t.countable))t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t<o.index||n>0&&t===o.index)&&(o.index=YE(t,o.index+n))}},lP=(e,t,n)=>{const r=e,o=t.changedParentTypes;while(1){if(LE(o,e,(()=>[])).push(n),null===e._item)break;e=e._item.parent}uM(r._eH,n,t)};class dP{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=cM(),this._dEH=cM(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw v_()}clone(){throw v_()}_write(e){}get _first(){let e=this._start;while(null!==e&&e.deleted)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){lM(this._eH,e)}observeDeep(e){lM(this._dEH,e)}unobserve(e){dM(this._eH,e)}unobserveDeep(e){dM(this._dEH,e)}toJSON(){}}const uP=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;while(null!==i&&r>0){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},hP=e=>{const t=[];let n=e._start;while(null!==n){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},pP=(e,t)=>{let n=0,r=e._start;while(null!==r){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r<o.length;r++)t(o[r],n++,e)}r=r.right}},fP=(e,t)=>{const n=[];return pP(e,((r,o)=>{n.push(t(r,o,e))})),n},mP=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){while(null!==t&&t.deleted)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},gP=(e,t)=>{const n=aP(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},vP=(e,t,n,r)=>{let o=n;const i=e.doc,s=i.clientID,a=i.store,c=null===n?t._start:n.right;let l=[];const d=()=>{l.length>0&&(o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new SI(l)),o.integrate(e,0),l=[])};r.forEach((n=>{if(null===n)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(d(),n.constructor){case Uint8Array:case ArrayBuffer:o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new uI(new Uint8Array(n))),o.integrate(e,0);break;case FT:o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new gI(n)),o.integrate(e,0);break;default:if(!(n instanceof dP))throw new Error("Unexpected content type in insert operation");o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new BI(n)),o.integrate(e,0)}}})),d()},bP=g_("Length exceeded!"),yP=(e,t,n,r)=>{if(n>t._length)throw bP;if(0===n)return t._searchMarker&&cP(t._searchMarker,n,r.length),vP(e,t,null,r);const o=n,i=aP(t,n);let s=t._start;for(null!==i&&(s=i.p,n-=i.index,0===n&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&TM(e,fM(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&cP(t._searchMarker,o,r.length),vP(e,t,s,r)},wP=(e,t,n)=>{const r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start});let o=r.p;if(o)while(o.right)o=o.right;return vP(e,t,o,n)},xP=(e,t,n,r)=>{if(0===r)return;const o=n,i=r,s=aP(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&TM(e,fM(a.id.client,a.id.clock+n)),n-=a.length);while(r>0&&null!==a)a.deleted||(r<a.length&&TM(e,fM(a.id.client,a.id.clock+r)),a.delete(e),r-=a.length),a=a.right;if(r>0)throw bP;t._searchMarker&&cP(t._searchMarker,o,-i+r)},kP=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},CP=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==r)a=new SI([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new SI([r]);break;case Uint8Array:a=new uI(r);break;case FT:a=new gI(r);break;default:if(!(r instanceof dP))throw new Error("Unexpected content type");a=new BI(r)}new FI(fM(s,kM(i.store,s)),o,o&&o.lastId,null,null,t,n,a).integrate(e,0)},SP=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},EP=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},AP=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},_P=e=>mT(e.entries(),(e=>!e[1].deleted));class TP extends QM{constructor(e,t){super(e,t),this._transaction=t}}class MP extends dP{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new MP;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new MP}clone(){const e=new MP;return e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),lP(this,e,new TP(this,e))}insert(e,t){null!==this.doc?FM(this.doc,(n=>{yP(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?FM(this.doc,(t=>{wP(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?FM(this.doc,(n=>{xP(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return gP(this,e)}toArray(){return hP(this)}slice(e=0,t=this.length){return uP(this,e,t)}toJSON(){return this.map((e=>e instanceof dP?e.toJSON():e))}map(e){return fP(this,e)}forEach(e){pP(this,e)}[Symbol.iterator](){return mP(this)}_write(e){e.writeTypeRef(MI)}}const PP=e=>new MP;class IP extends QM{constructor(e,t,n){super(e,t),this.keysChanged=n}}class OP extends dP{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new OP}clone(){const e=new OP;return this.forEach(((t,n)=>{e.set(n,t instanceof dP?t.clone():t)})),e}_callObserver(e,t){lP(this,e,new IP(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof dP?r.toJSON():r}})),e}get size(){return[..._P(this._map)].length}keys(){return gT(_P(this._map),(e=>e[0]))}values(){return gT(_P(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return gT(_P(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return SP(this,e)}has(e){return AP(this,e)}clear(){null!==this.doc?FM(this.doc,(e=>{this.forEach((function(t,n,r){kP(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(PI)}}const DP=e=>new OP,NP=(e,t)=>e===t||"object"===typeof e&&"object"===typeof t&&e&&t&&ST(e,t);class RP{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(null===this.right&&b_(),this.right.content.constructor){case wI:this.right.deleted||FP(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const BP=(e,t,n)=>{while(null!==t.right&&n>0){switch(t.right.content.constructor){case wI:t.right.deleted||FP(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&TM(e,fM(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},LP=(e,t,n)=>{const r=new Map,o=aP(t,n);if(o){const t=new RP(o.p.left,o.p,o.index,r);return BP(e,t,n-o.index)}{const o=new RP(null,t._start,0,r);return BP(e,o,n)}},jP=(e,t,n,r)=>{while(null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===wI&&NP(r.get(n.right.content.key),n.right.content.value)))n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,s)=>{const a=n.left,c=n.right,l=new FI(fM(i,kM(o.store,i)),a,a&&a.lastId,c,c&&c.id,t,null,new wI(s,r));l.integrate(e,0),n.right=l,n.forward()}))},FP=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},zP=(e,t)=>{while(1){if(null===e.right)break;if(!(e.right.deleted||e.right.content.constructor===wI&&NP(t[e.right.content.key]||null,e.right.content.value)))break;e.forward()}},UP=(e,t,n,r)=>{const o=e.doc,i=o.clientID,s=new Map;for(const a in r){const c=r[a],l=n.currentAttributes.get(a)||null;if(!NP(l,c)){s.set(a,l);const{left:r,right:d}=n;n.right=new FI(fM(i,kM(o.store,i)),r,r&&r.lastId,d,d&&d.id,t,null,new wI(a,c)),n.right.integrate(e,0),n.forward()}}return s},qP=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,s=i.clientID;zP(n,o);const a=UP(e,t,n,o),c=r.constructor===String?new AI(r):r instanceof dP?new BI(r):new bI(r);let{left:l,right:d,index:u}=n;t._searchMarker&&cP(t._searchMarker,n.index,c.getLength()),d=new FI(fM(s,kM(i.store,s)),l,l&&l.lastId,d,d&&d.id,t,null,c),d.integrate(e,0),n.right=d,n.index=u,n.forward(),jP(e,t,n,a)},VP=(e,t,n,r,o)=>{const i=e.doc,s=i.clientID;zP(n,o);const a=UP(e,t,n,o);e:while(null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===wI))){if(!n.right.deleted)switch(n.right.content.constructor){case wI:{const{key:t,value:i}=n.right.content,s=o[t];if(void 0!==s){if(NP(s,i))a.delete(t);else{if(0===r)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r<n.right.length&&TM(e,fM(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let o="";for(;r>0;r--)o+="\n";n.right=new FI(fM(s,kM(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new AI(o)),n.right.integrate(e,0),n.forward()}jP(e,t,n,a)},HP=(e,t,n,r,o)=>{let i=t;const s=RE();while(i&&(!i.countable||i.deleted)){if(!i.deleted&&i.content.constructor===wI){const e=i.content;s.set(e.key,e)}i=i.right}let a=0,c=!1;while(t!==i){if(n===t&&(c=!0),!t.deleted){const n=t.content;switch(n.constructor){case wI:{const{key:i,value:l}=n,d=r.get(i)||null;s.get(i)===n&&d!==l||(t.delete(e),a++,c||(o.get(i)||null)!==l||d===l||(null===d?o.delete(i):o.set(i,d))),c||t.deleted||FP(o,n);break}}}t=t.right}return a},WP=(e,t)=>{while(t&&t.right&&(t.right.deleted||!t.right.countable))t=t.right;const n=new Set;while(t&&(t.deleted||!t.countable)){if(!t.deleted&&t.content.constructor===wI){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},GP=e=>{let t=0;return FM(e.doc,(n=>{let r=e._start,o=e._start,i=RE();const s=BE(i);while(o){if(!1===o.deleted)switch(o.content.constructor){case wI:FP(s,o.content);break;default:t+=HP(n,r,o,i,s),i=BE(s),r=o;break}o=o.right}})),t},$P=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&IM(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==wI||e.constructor===dI||t.add(e.parent)}))}FM(n,(n=>{_T(e,e.deleteSet,(e=>{if(e instanceof dI||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===wI?t.add(r):WP(n,e)}));for(const e of t)GP(e)}))},XP=(e,t,n)=>{const r=n,o=BE(t.currentAttributes),i=t.right;while(n>0&&null!==t.right){if(!1===t.right.deleted)switch(t.right.content.constructor){case BI:case bI:case AI:n<t.right.length&&TM(e,fM(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&HP(e,i,t.right,o,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&cP(s._searchMarker,t.index,-r+n),t};class YP extends QM{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];FM(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",c=0,l=0;const d=()=>{if(null!==i){let e=null;switch(i){case"delete":l>0&&(e={delete:l}),l=0;break;case"insert":("object"===typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":c>0&&(e={retain:c},xT(s)||(e.attributes=vT({},s))),c=0;break}e&&t.push(e),i=null}};while(null!==o){switch(o.content.constructor){case BI:case bI:this.adds(o)?this.deletes(o)||(d(),i="insert",a=o.content.getContent()[0],d()):this.deletes(o)?("delete"!==i&&(d(),i="delete"),l+=1):o.deleted||("retain"!==i&&(d(),i="retain"),c+=1);break;case AI:this.adds(o)?this.deletes(o)||("insert"!==i&&(d(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(d(),i="delete"),l+=o.length):o.deleted||("retain"!==i&&(d(),i="retain"),c+=o.length);break;case wI:{const{key:t,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const c=n.get(t)||null;NP(c,a)?null!==a&&o.delete(e):("retain"===i&&d(),NP(a,r.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(o)){r.set(t,a);const e=n.get(t)||null;NP(e,a)||("retain"===i&&d(),s[t]=e)}else if(!o.deleted){r.set(t,a);const n=s[t];void 0!==n&&(NP(n,a)?null!==n&&o.delete(e):("retain"===i&&d(),null===a?delete s[t]:s[t]=a))}o.deleted||("insert"===i&&d(),FP(n,o.content));break}}o=o.right}d();while(t.length>0){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class JP extends dP{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(zO){console.error(zO)}this._pending=null}_copy(){return new JP}clone(){const e=new JP;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new YP(this,e,t);lP(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;while(null!==t)!t.deleted&&t.countable&&t.content.constructor===AI&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?FM(this.doc,(n=>{const r=new RP(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const i=e[o];if(void 0!==i.insert){const s=t||"string"!==typeof i.insert||o!==e.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!==typeof s||s.length>0)&&qP(n,this,r,s,i.attributes||{})}else void 0!==i.retain?VP(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&XP(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let s="",a=this._start;function c(){if(s.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const l=()=>{while(null!==a){if(bM(a,e)||void 0!==t&&bM(a,t))switch(a.content.constructor){case AI:{const r=o.get("ychange");void 0===e||bM(a,e)?void 0===t||bM(a,t)?void 0!==r&&(c(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(c(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(c(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case BI:case bI:{c();const e={insert:a.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case wI:bM(a,e)&&(c(),FP(o,a.content));break}a=a.right}c()};return e||t?FM(i,(n=>{e&&yM(n,e),t&&yM(n,t),l()}),"cleanup"):l(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),qP(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n={}){const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);qP(r,this,o,t,n)})):this._pending.push((()=>this.insertEmbed(e,t,n)))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?FM(n,(n=>{XP(n,LP(n,this,e),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);null!==o.right&&VP(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return SP(this,e)}getAttributes(){return EP(this)}_write(e){e.writeTypeRef(II)}}const ZP=e=>new JP;class KP{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==tI&&t.constructor!==QP||null===t._start)while(null!==e){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class QP extends dP{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new QP}clone(){const e=new QP;return e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new KP(this,e)}querySelector(e){e=e.toUpperCase();const t=new KP(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)),n=t.next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),VE(new KP(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){lP(this,e,new rI(this,t,e))}toString(){return fP(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),pP(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?FM(this.doc,(n=>{yP(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)FM(this.doc,(n=>{const r=e&&e instanceof dP?e._item:e;vP(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw g_("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?FM(this.doc,(n=>{xP(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return hP(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return gP(this,e)}slice(e=0,t=this.length){return uP(this,e,t)}forEach(e){pP(this,e)}_write(e){e.writeTypeRef(DI)}}const eI=e=>new QP;class tI extends QP{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new tI(this.nodeName)}clone(){const e=new tI(this.nodeName),t=this.getAttributes();return yT(t,((t,n)=>{"string"===typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const s in e)n.push(s);n.sort();const r=n.length;for(let s=0;s<r;s++){const r=n[s];t.push(r+'="'+e[r]+'"')}const o=this.nodeName.toLocaleLowerCase(),i=t.length>0?" "+t.join(" "):"";return`<${o}${i}>${super.toString()}</${o}>`}removeAttribute(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return SP(this,e)}hasAttribute(e){return AP(this,e)}getAttributes(){return EP(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const i in o){const e=o[i];"string"===typeof e&&r.setAttribute(i,e)}return pP(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(OI),e.writeKey(this.nodeName)}}const nI=e=>new tI(e.readKey());class rI extends QM{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class oI extends OP{constructor(e){super(),this.hookName=e}_copy(){return new oI(this.hookName)}clone(){const e=new oI(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(NI),e.writeKey(this.hookName)}}const iI=e=>new oI(e.readKey());class sI extends JP{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new sI}clone(){const e=new sI;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const r in e.attributes){const n=[];for(const t in e.attributes[r])n.push({key:t,value:e.attributes[r][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:r,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let r=0;r<t.length;r++){const e=t[r];n+=`<${e.nodeName}`;for(let t=0;t<e.attrs.length;t++){const r=e.attrs[t];n+=` ${r.key}="${r.value}"`}n+=">"}n+=e.insert;for(let r=t.length-1;r>=0;r--)n+=`</${t[r].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(RI)}}const aI=e=>new sI;class cI{constructor(e,t){this.id=e,this.length=t}get deleted(){throw v_()}mergeWith(e){return!1}write(e,t,n){throw v_()}integrate(e,t){throw v_()}}const lI=0;class dI extends cI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),CM(e.doc.store,this)}write(e,t){e.writeInfo(lI),e.writeLen(this.length-t)}getMissing(e,t){return null}}class uI{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new uI(this.content)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const hI=e=>new uI(e.readBuf());class pI{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new pI(this.len)}splice(e){const t=new pI(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){OT(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const fI=e=>new pI(e.readLen()),mI=(e,t)=>new FT({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class gI{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new gI(mI(this.doc.guid,this.opts))}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const vI=e=>new gI(mI(e.readString(),e.readAny()));class bI{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new bI(this.embed)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const yI=e=>new bI(e.readJSON());class wI{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new wI(this.key,this.value)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){const n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const xI=e=>new wI(e.readKey(),e.readJSON());class kI{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new kI(this.arr)}splice(e){const t=new kI(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const CI=e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new kI(n)};class SI{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new SI(this.arr)}splice(e){const t=new SI(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeAny(t)}}getRef(){return 8}}const EI=e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new SI(n)};class AI{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new AI(this.str)}splice(e){const t=new AI(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const _I=e=>new AI(e.readString()),TI=[PP,DP,ZP,nI,eI,iI,aI],MI=0,PI=1,II=2,OI=3,DI=4,NI=5,RI=6;class BI{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new BI(this.type._copy())}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;while(null!==t)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;while(null!==t)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{while(null!==t)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const LI=e=>new BI(TI[e.readTypeRef()](e)),jI=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new FI(fM(r,o+n),t,fM(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=fM(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class FI extends cI{constructor(e,t,n,r,o,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?MA:0}set marker(e){(this.info&IA)>0!==e&&(this.info^=IA)}get marker(){return(this.info&IA)>0}get keep(){return(this.info&TA)>0}set keep(e){this.keep!==e&&(this.info^=TA)}get countable(){return(this.info&MA)>0}get deleted(){return(this.info&PA)>0}set deleted(e){this.deleted!==e&&(this.info^=PA)}markDeleted(){this.info|=PA}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=kM(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=kM(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===hM&&this.id.client!==this.parent.client&&this.parent.clock>=kM(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=MM(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=TM(e,this.rightOrigin),this.rightOrigin=this.right.id),(this.left&&this.left.constructor===dI||this.right&&this.right.constructor===dI)&&(this.parent=null),this.parent){if(this.parent.constructor===hM){const e=AM(t,this.parent);e.constructor===dI?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===FI&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===FI&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=MM(e,e.doc.store,fM(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub){t=this.parent._map.get(this.parentSub)||null;while(null!==t&&null!==t.left)t=t.left}else t=this.parent._start;const r=new Set,o=new Set;while(null!==t&&t!==this.right){if(o.add(t),r.add(t),pM(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,r.clear();else if(pM(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!o.has(AM(e.doc.store,t.origin)))break;r.has(AM(e.doc.store,t.origin))||(n=t,r.clear())}t=t.right}this.left=n}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub){e=this.parent._map.get(this.parentSub)||null;while(null!==e&&null!==e.left)e=e.left}else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),CM(e.doc.store,this),this.content.integrate(e,this),NM(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new dI(this.id,this.length).integrate(e,0)}get next(){let e=this.right;while(null!==e&&e.deleted)e=e.right;return e}get prev(){let e=this.left;while(null!==e&&e.deleted)e=e.left;return e}get lastId(){return 1===this.length?this.id:fM(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&pM(e.origin,this.lastId)&&this.right===e&&pM(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach((t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),OT(e.deleteSet,this.id.client,this.id.clock,this.length),NM(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw b_();this.content.gc(e),t?PM(e,this,new dI(this.id,this.length)):this.content=new pI(this.length)}write(e,t){const n=t>0?fM(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=this.content.getRef()&RA|(null===n?0:NA)|(null===r?0:DA)|(null===o?0:OA);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=mM(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===hM?(e.writeParentInfo(!1),e.writeLeftID(t)):b_();null!==o&&e.writeString(o)}this.content.write(e,t)}}const zI=(e,t)=>UI[t&RA](e),UI=[()=>{b_()},fI,CI,hI,_I,yI,xI,LI,EI,vI,()=>{b_()}],qI=10;class VI extends cI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){b_()}write(e,t){e.writeInfo(qI),XA(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const HI="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:{},WI="__ $YJS$ __";!0===HI[WI]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),HI[WI]=!0;var GI,$I,XI,YI,JI=new WeakMap,ZI=function(){function e(t){d(this,e),b(this,JI,{writable:!0,value:""}),rw(this,JI,t)}return g(e,[{key:"getRoom",value:function(){return k(this,JI)}}]),e}(),KI=new WeakMap,QI=function(){function e(t){d(this,e),y(this,"clientIO",null),y(this,"yDoc",null),y(this,"yArray",null),y(this,"modeler",null),b(this,KI,{writable:!0,value:null}),y(this,"room",null),y(this,"deletedItem",null),this.yDoc=new FT,this.yArray=this.yDoc.getArray("elements"),this.modeler=t}return g(e,[{key:"init",value:function(){var e,t=this;rw(this,KI,B(this.modeler.definitions));var n=null!==(e=window.ProcessMaker.modeler.process.uuid)&&void 0!==e?e:window.ProcessMaker.modeler.process.id;this.room=new ZI("room-".concat(n)),this.clientIO=NE(window.ProcessMaker.multiplayer.host,{transports:["websocket","polling"]}),this.clientIO.on("connect",(function(){var e,n;t.clientIO.emit("joinRoom",{roomName:t.room.getRoom(),clientName:null===(e=window.ProcessMaker.user)||void 0===e?void 0:e.fullName,clientAvatar:null===(n=window.ProcessMaker.user)||void 0===n?void 0:n.avatar})})),this.clientIO.on("clientJoined",(function(e){t.modeler.enableMultiplayer(e.isMultiplayer),e.isMultiplayer&&e.clients.map((function(e){var n={id:e.id,name:e.name,color:"#FF6F61",avatar:e.avatar,top:90,left:80};t.modeler.addPlayer(n)}))})),this.clientIO.on("clientLeft",(function(e){t.modeler.removePlayer(e.clientId),t.modeler.enableMultiplayer(e.isMultiplayer)})),this.clientIO.on("requestProcess",(function(e){var n=e.clientId;n&&t.syncLocalNodes(n)})),this.clientIO.on("createElement",function(){var e=l(a().mark((function e(n){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.createRemoteShape(n.changes);case 2:tM(t.yDoc,new Uint8Array(n.updateDoc));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.clientIO.on("createRequestedElement",function(){var e=l(a().mark((function e(n){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n.clientId!==t.clientIO.id){e.next=4;break}return e.next=3,t.createRemoteShape(n.changes);case 3:tM(t.yDoc,new Uint8Array(n.updateDoc));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.clientIO.on("removeElement",(function(e){e.deletedNodes.forEach((function(e){var n=t.getNodeById(e);t.removeShape(n)})),tM(t.yDoc,new Uint8Array(e.updateDoc))})),this.clientIO.on("updateElement",(function(e){var n=e.updateDoc,r=e.updatedNodes,o=e.isReplaced;o?t.replaceShape(r[0]):r.forEach((function(e){t.updateShapes(e)})),tM(t.yDoc,new Uint8Array(n))})),this.clientIO.on("updateInspector",(function(e){var n=e.updateDoc,r=e.updatedNodes;r.forEach((function(e){t.updateShapeFromInspector(e)})),tM(t.yDoc,new Uint8Array(n))})),this.clientIO.on("updateFlows",(function(e){var n=e.updateDoc,r=e.updatedNodes;r.forEach((function(e){t.updateFlowClient(e)})),tM(t.yDoc,new Uint8Array(n))})),window.ProcessMaker.EventBus.$on("multiplayer-addNode",(function(e){t.addNode(e)})),window.ProcessMaker.EventBus.$on("multiplayer-removeNode",(function(e){t.removeNode(e)})),window.ProcessMaker.EventBus.$on("multiplayer-updateNodes",(function(e){t.updateNodes(e)})),window.ProcessMaker.EventBus.$on("multiplayer-replaceNode",(function(e){var n=e.nodeData,r=e.newControl;t.replaceNode(n,r)})),window.ProcessMaker.EventBus.$on("multiplayer-addFlow",(function(e){t.addCommonElement(e)})),window.ProcessMaker.EventBus.$on("multiplayer-addBoundaryEvent",(function(e){t.addCommonElement(e)})),window.ProcessMaker.EventBus.$on("multiplayer-addLanes",(function(e){t.addLaneNodes(e)})),window.ProcessMaker.EventBus.$on("multiplayer-updateInspectorProperty",(function(e){t.modeler.isMultiplayer&&t.updateInspectorProperty(e)})),window.ProcessMaker.EventBus.$on("multiplayer-updateFlows",(function(e){t.modeler.isMultiplayer&&t.updateFlows(e)}))}},{key:"syncLocalNodes",value:function(e){var t=this,n=this.modeler.nodes.map((function(e){return t.modeler.multiplayerHook(e,!1,!0)}));n.forEach((function(n){var r=new OP;t.doTransact(r,n),t.yArray.push([r]);var o=oM(t.yDoc);t.clientIO.emit("createElement",{updateDoc:o,clientId:e})}))}},{key:"addNode",value:function(e){var t=new OP;this.doTransact(t,e),this.yArray.push([t]);var n=oM(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n})}},{key:"createShape",value:function(e){var t=this.getNodeById(e.id);t||(this.modeler.nodeRegistry[e.type]&&this.modeler.nodeRegistry[e.type].multiplayerClient?this.modeler.nodeRegistry[e.type].multiplayerClient(this.modeler,e):this.modeler.addRemoteNode(e),k(this,KI).updateCounters())}},{key:"createRemoteShape",value:function(e){var t=this;return new Promise((function(n){e.map((function(e){t.createShape(e)})),n()}))}},{key:"removeNode",value:function(e){var t=this.getIndex(e.definition.id);if(t>=0){this.removeShape(e),this.yArray.delete(t,1);var n=oM(this.yDoc);this.clientIO.emit("removeElement",n)}}},{key:"getIndex",value:function(e){var t,n=-1,r=!1,o=HC(this.yArray);try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n++,i.get("id")===e){r=!0;break}}}catch(FO){o.e(FO)}finally{o.f()}return r?n:-1}},{key:"getNodeById",value:function(e){var t=this.modeler.nodes.find((function(t){return t.definition&&t.definition.id===e}));return t}},{key:"removeShape",value:function(e){this.modeler.removeNodeProcedure(e,{removeRelationships:!1})}},{key:"getRemovedNodes",value:function(e,t){return e.filter((function(e){return!t.some((function(t){return e.definition.id===t.get("id")}))}))}},{key:"updateNodes",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),r=t.yArray.get(n),o=e.poolId?Qr(Qr({},e.properties),{poolId:e.poolId}):e.properties;t.doTransact(r,o)}))}},{key:"replaceNode",value:function(e,t){var n=this.getIndex(e.nodeThatWillBeReplaced.definition.id),r=this.yArray.get(n);e.id="node_".concat(k(this,KI).getDefinitionNumber()),k(this,KI).updateCounters(),this.replaceShape({oldNodeId:e.nodeThatWillBeReplaced.definition.id,id:e.id,type:t,x:e.x,y:e.y}),this.yDoc.transact((function(){r.set("type",t),r.set("id",e.id)}));var o=oM(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:o,isReplaced:!0})}},{key:"replaceShape",value:function(e){var t=this.modeler.paper.localToClientPoint(e),n=t.x,r=t.y,o=this.getNodeById(e.oldNodeId),i={clientX:n,clientY:r,control:{type:e.type},nodeThatWillBeReplaced:o,color:o.color,id:e.id};this.modeler.replaceNodeProcedure(i,!0),k(this,KI).updateCounters()}},{key:"doTransact",value:function(e,t){this.yDoc.transact((function(){for(var n in t)Object.hasOwn(t,n)&&e.set(n,t[n])}));var n=oM(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:n,isReplaced:!1})}},{key:"updateShapes",value:function(){var e=l(a().mark((function e(t){var n,r,o,i,s,c,l,d,u,h,p=this;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.modeler.paper,r=this.modeler.getElementByNodeId(t.id),o=this.modeler.getElementByNodeId(t.poolId),!this.modeler.flowTypes.includes(t.type)){e.next=15;break}i=this.modeler.getElementByNodeId(t.sourceRefId),s=this.modeler.getElementByNodeId(t.targetRefId),c=t.waypoint,l=c.shift(),d=c.pop(),u=c.map((function(e){return p.modeler.moddle.create("dc:Point",e)})),r.set("vertices",u),r.source(i,{anchor:function(){return Mt(p.getConnectionPoint(i,l),i.findView(n))},connectionPoint:{name:"boundary"}}),r.target(s,{anchor:function(){return Mt(p.getConnectionPoint(s,d),s.findView(n))},connectionPoint:{name:"boundary"}}),e.next=27;break;case 15:return r.resize(t.width,t.height),r.set("position",{x:t.x,y:t.y}),h=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:h,key:"color",value:t.color}),"bpmn:BoundaryEvent"===r.component.node.definition.$type&&this.attachBoundaryEventToNode(r,t),e.next=22,n.findViewByModel(r).update();case 22:return e.next=24,r.component.$nextTick();case 24:return e.next=26,this.modeler.paperManager.awaitScheduledUpdates();case 26:o&&r.component.node.pool&&r.component.node.pool.component.id!==t.poolId&&r.component.node.pool.component.moveElementRemote(r,o);case 27:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"attachBoundaryEventToNode",value:function(e,t){var n=this.getNodeById(t.attachedToRefId),r=e.getParentCell(),o=this.modeler.getElementByNodeId(t.attachedToRefId);r&&r.unembed(e),o&&o.embed(e),e.component.node.definition.set("attachedToRef",n.definition)}},{key:"addCommonElement",value:function(e){var t=new OP;this.doTransact(t,e),this.yArray.push([t]);var n=oM(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n}),k(this,KI).updateCounters()}},{key:"addLaneNodes",value:function(e){var t=this,n=this.getPool(e);window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[{id:n.component.node.definition.id,properties:{x:n.component.node.diagram.bounds.x,y:n.component.node.diagram.bounds.y,height:n.component.node.diagram.bounds.height,width:n.component.node.diagram.bounds.width,isAddingLaneAbove:n.isAddingLaneAbove}}]),this.yDoc.transact((function(){e.forEach((function(e){var n=new OP,r=t.prepareLaneData(e);t.doTransact(n,r),t.yArray.push([n]);var o=oM(t.yDoc);t.clientIO.emit("createElement",{updateDoc:o})}))}))}},{key:"prepareLaneData",value:function(e){var t={type:e.type,id:e.definition.id,name:e.definition.name,x:e.diagram.bounds.x,y:e.diagram.bounds.y,width:e.diagram.bounds.width,height:e.diagram.bounds.height,poolId:e.pool.component.node.definition.id,laneSetId:e.pool.component.laneSet.id};return t}},{key:"getPool",value:function(e){return!!(e&&e.length>0)&&e[0].pool}},{key:"getConnectionPoint",value:function(e,t){var n=e.position(),r=n.x,o=n.y,i={x:t.x-r,y:t.y-o},s=e.position(),a=s.x,c=s.y,l=e.size(),d=l.width,u=l.height;return i?{x:a+i.x,y:c+i.y}:{x:a+d/2,y:c+u/2}}},{key:"updateInspectorProperty",value:function(e){var t=this.getIndex(e.id),n=this.yArray.get(t);if(n){var r=e.value;"loopCharacteristics"===e.key&&(r=JSON.stringify(e.value)),n.set(e.key,r),e.extras&&Object.keys(e.extras).length>0&&n.set("extras",e.extras);var o=oM(this.yDoc);this.clientIO.emit("updateFromInspector",{updateDoc:o,isReplaced:!1})}}},{key:"setNodeProp",value:function(e,t,n){Un.commit("updateNodeProp",{node:e,key:t,value:n})}},{key:"updateShapeFromInspector",value:function(e){var t=null;if(e.oldNodeId&&e.oldNodeId!==e.id){var n=this.getIndex(e.oldNodeId),r=this.yArray.get(n);return r.set("id",e.id),t=this.getNodeById(e.oldNodeId),void Un.commit("updateNodeProp",{node:t,key:"id",value:e.id})}if(t=this.getNodeById(e.id),t){var o,i={};if(e.extras&&Object.keys(e.extras).length>0&&(i=e.extras),e.loopCharacteristics){var s=JSON.parse(e.loopCharacteristics);return void this.modeler.nodeRegistry[t.type].loopCharacteristicsHandler({type:t.definition.type,$loopCharactetistics:{id:e.id,loopCharacteristics:s}},t,this.setNodeProp,this.modeler.moddle,this.modeler.definitions,!1)}if(null!==(o=this.modeler.nodeRegistry[t.type])&&void 0!==o&&o.multiplayerInspectorHandler)return void this.modeler.nodeRegistry[t.type].multiplayerInspectorHandler(t,e,this.setNodeProp,this.modeler.moddle);var a=Object.keys(e).filter((function(e){return"id"!==e})),c=a[0],l=e[c];if("condition"===c&&(t.definition.get("eventDefinitions")[0].get("condition").body=l),"gatewayDirection"===c&&t.definition.set("gatewayDirection",l),"messageRef"===c){var d,u,h,p=this.modeler.definitions.rootElements.find((function(e){return e.id===l}));if(!p)p=this.modeler.moddle.create("bpmn:Message",{id:l,name:(null===(h=i)||void 0===h?void 0:h.messageName)||l}),this.modeler.definitions.rootElements.push(p);t.definition.get("eventDefinitions")[0].messageRef=p,null!==(d=i)&&void 0!==d&&d.allowedUsers&&t.definition.set("allowedUsers",i.allowedUsers),null!==(u=i)&&void 0!==u&&u.allowedGroups&&t.definition.set("allowedGroups",i.allowedGroups)}["messageRef","gatewayDirection","condition","allowedUsers","allowedGroups"].includes(c)||Un.commit("updateNodeProp",{node:t,key:c,value:l})}}},{key:"updateFlows",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),r=t.yArray.get(n);t.yDoc.transact((function(){for(var t in e)Object.hasOwn(e,t)&&r.set(t,e[t])}))}));var n=oM(this.yDoc);this.clientIO.emit("updateFlows",{updateDoc:n,isReplaced:!1})}},{key:"updateFlowClient",value:function(e){var t=!1,n=this.getNodeById(e.id);if(n&&e.sourceRefId){var r=this.getNodeById(e.sourceRefId);n.definition.set("sourceRef",r.definition);var o,i=r.definition.get("outgoing").find((function(e){return e.id===n.definition.id}));if(!i)(o=r.definition.get("outgoing")).push.apply(o,[n.definition]);t=!0}if(n&&e.targetRefId){var s=this.getNodeById(e.targetRefId);n.definition.set("targetRef",s.definition);var a,c=s.definition.get("incoming").find((function(e){return e.id===n.definition.id}));if(!c)(a=s.definition.get("incoming")).push.apply(a,[n.definition]);t=!0}t&&(n._modelerId+="_replaced")}}]),e}(),eO={components:{PreviewPanel:Kv,ToolBar:ux,ExplorerRail:tv,InspectorButton:xv,InspectorPanel:Nv,ProcessmakerModelerGenericFlow:Gk,Selection:LC,RailBottom:jk,WelcomeMessage:hv,RemoteCursor:VC},props:{owner:Object,decorations:{type:Object,default:function(){return{}}},readOnly:{type:Boolean,default:function(){return!1}},validationBar:Array,requestIdleNodes:{type:Array,default:function(){return[]}},requestCompletedNodes:{type:Array,default:function(){return[]}},requestInProgressNodes:{type:Array,default:function(){return[]}}},mixins:[Ex,Gx],data:function(){return{extraActions:[],pasteInProgress:!1,cloneInProgress:!1,internalClipboard:[],tooltipTarget:null,parsers:{},extensions:[],nodeRegistry:{},graph:null,paper:null,paperManager:null,definitions:null,nodeIdGenerator:null,planeElements:null,canvasDragPosition:null,processNode:null,collaboration:null,moddle:null,allowDrop:!0,poolTarget:null,processes:[],cursor:null,parentHeight:null,parentWidth:null,linter:null,validationErrors:{},miniMapOpen:!1,panelsCompressed:!1,isOpenInspector:!1,isOpenPreview:!1,isGrabbing:!1,isRendering:!1,isLoaded:!1,allWarnings:[],nodeTypes:[],pmBlockNodes:[],breadcrumbData:[],activeNode:null,xmlManager:null,previouslyStackedShape:null,keyMod:this.isAppleOS()?"Command":"Control",canvasScale:1,initialScale:1,minimumScale:.2,scaleStep:.1,isDragging:!1,isSelecting:!1,isIntoTheSelection:!1,dragStart:null,players:[],showInspectorButton:!0,inspectorButtonRight:65,previewConfigs:[],isResizingPreview:!1,currentCursorPosition:0,previewPanelWidth:600,flowTypes:["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow","processmaker-modeler-data-input-association","processmaker-modeler-data-output-association","processmaker-modeler-association"]}},watch:{isRendering:function(){var e="Loading process, please be patient.";if(this.isRendering)return window.ProcessMaker.alert(e,"warning"),document.body.style.cursor="wait !important",void(this.cursor="wait");window.ProcessMaker.navbar.alerts=window.ProcessMaker.navbar.alerts.filter((function(t){return t.alertText!==e})),document.body.style.cursor="auto",this.cursor=null,this.isLoaded=!0},currentXML:function(){this.validateIfAutoValidateIsOn()},definitions:function(){this.validateIfAutoValidateIsOn()},autoValidate:function(){this.validateIfAutoValidateIsOn()},canvasScale:function(e){this.paperManager.scale=e},highlightedNodes:function(){var e;null!==(e=window.ProcessMaker)&&void 0!==e&&e.EventBus&&window.ProcessMaker.EventBus.$emit("modeler:highlightedNodes",this.highlightedNodes)}},computed:{showWelcomeMessage:function(){return!this.selectedNode&&!this.nodes.length&&!Un.getters.isReadOnly&&this.isLoaded},noElementsSelected:function(){return 0===this.highlightedNodes.filter((function(e){return!e.isType("processmaker-modeler-process")})).length},tooltipTitle:function(){if(this.tooltipTarget)return this.tooltipTarget.$el.data("title")},autoValidate:function(){return Un.getters.autoValidate},nodes:function(){return Un.getters.nodes},currentXML:function(){return Qv.getters.currentState},copiedElements:function(){return Un.getters.copiedElements},highlightedNode:function(){return Un.getters.highlightedNodes[0]},highlightedNodes:function(){return Un.getters.highlightedNodes},invalidNodes:function(){return qx(this.validationErrors,this.nodes)},showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer}},methods:{onStartPreviewResize:function(e){this.isResizingPreview=!0,this.currentCursorPosition=e.x},onMouseUp:function(){this.isResizingPreview=!1},onMouseMove:function(e){if(this.isResizingPreview){var t=this.currentCursorPosition-e.x;this.previewPanelWidth=parseInt(this.previewPanelWidth)+t,this.currentCursorPosition=e.x}},registerPreview:function(e){this.previewConfigs.push(e)},handleToolbarAction:function(e){e.handler instanceof Function&&e.handler(this)},handleToggleInspector:function(e){this.showInspectorButton=!(null===e||void 0===e||e),this.isOpenInspector=e},handlePreview:function(){1!=this.highlightedNodes.length&&(this.isOpenPreview=!1),this.$refs["preview-panel"].previewNode(!0),this.handleTogglePreview(!0)},handleTogglePreview:function(e){this.isOpenPreview=e},setInspectorButtonPosition:function(){this.isOpenInspector||(this.isOpenPreview&&!this.isOpenInspector&&(this.inspectorButtonRight=65+this.previewPanelWidth),this.isOpenPreview||this.isOpenInspector||(this.inspectorButtonRight=65))},isAppleOS:function(){return"undefined"!==typeof navigator&&/Mac|iPad|iPhone/.test(navigator.platform)},shapeResize:function(){var e=arguments,t=this;return l(a().mark((function n(){var r;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=!(e.length>0&&void 0!==e[0])||e[0],n.next=3,t.$nextTick();case 3:return n.next=5,t.paperManager.awaitScheduledUpdates();case 5:t.$refs.selector.updateSelectionBox(!0,r);case 6:case"end":return n.stop()}}),n)})))()},toggleDefaultFlow:function(e){var t=e.definition.sourceRef;t.default&&t.default.id===e.id&&(e=null),t.set("default",e)},cloneElement:function(e,t){var n=e.clone(this.nodeRegistry,this.moddle,this.$t),r=(e.diagram.bounds.height+30)*t;n.diagram.bounds.y+=r,this.addNode(n)},copyElement:function(){var e=[gl,_r,Ir,fo,Mv],t=[gy,Sy,Iy,Fy,$y,tw];1===this.highlightedNodes.length&&(e.includes(this.highlightedNodes[0].type)||t.includes(this.highlightedNodes[0].type))||(Un.commit("setCopiedElements",this.cloneNodesSelection()),this.$bvToast.toast(this.$t("Object(s) have been copied"),{noCloseButton:!0,variant:"success",solid:!0,toaster:"b-toaster-top-center"}))},publishTemplate:function(){this.$emit("publishTemplate")},publishPmBlock:function(){this.$emit("publishPmBlock")},pasteElements:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.copiedElements.length>0)||e.pasteInProgress){t.next=21;break}return e.pasteInProgress=!0,t.prev=2,t.next=5,e.addClonedNodes(e.copiedElements);case 5:return t.next=7,e.$nextTick();case 7:return t.next=9,e.paperManager.awaitScheduledUpdates();case 9:return t.next=11,e.$refs.selector.selectElements(e.findViewElementsFromNodes(e.copiedElements),!0);case 11:return t.next=13,e.$nextTick();case 13:return t.next=15,Un.commit("setCopiedElements",e.cloneNodesSelection());case 15:e.scrollToSelection();case 16:return t.prev=16,e.pasteInProgress=!1,t.next=20,e.pushToUndoStack();case 20:return t.finish(16);case 21:case"end":return t.stop()}}),t,null,[[2,,16,21]])})))()},cloneSelection:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.cloneNodesSelection(),!n||0!==n.length){t.next=3;break}return t.abrupt("return");case 3:return t.prev=3,e.cloneInProgress=!0,e.$refs.selector.clearSelection(),t.next=8,e.addClonedNodes(n);case 8:return t.next=10,e.$nextTick();case 10:return t.next=12,e.paperManager.awaitScheduledUpdates();case 12:return t.next=14,e.$refs.selector.selectElements(e.findViewElementsFromNodes(n));case 14:e.scrollToSelection();case 15:return t.prev=15,e.cloneInProgress=!1,t.next=19,e.pushToUndoStack();case 19:return t.finish(15);case 20:case"end":return t.stop()}}),t,null,[[3,,15,20]])})))()},scrollToSelection:function(){var e=this.$refs["paper-container"].getBoundingClientRect(),t=this.$refs.selector,n=t.$el.getBoundingClientRect();if(n.right>e.right||n.bottom>e.bottom||n.left<e.left||n.top<e.top){var r=this.paper.translate(),o=r.ty-(n.top-e.top-n.height);this.paper.translate(r.tx,o),t.updateSelectionBox(!0)}},findViewElementsFromNodes:function(e){var t=this;return e.map((function(e){var n=t.$refs.nodeComponent.find((function(t){return t.node===e})),r=n.shape;return t.paper.findViewByModel(r)}))},getElementByNodeId:function(e){var t=this.paper.model.getCells();return t.find((function(t){return t.component&&t.component.id===e}))},close:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$emit("close");case 1:case"end":return t.stop()}}),t)})))()},saveBpmn:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i,s,c,l,d;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:null,o=e.length>1&&void 0!==e[1]?e[1]:null,i=document.querySelector(".mini-paper svg"),s="text { font-family: sans-serif; }",c=document.createElement("style"),c.appendChild(document.createTextNode(s)),i.appendChild(c),n.next=9,t.getXmlFromDiagram();case 9:l=n.sent,d=(new XMLSerializer).serializeToString(i),t.$emit("saveBpmn",{xml:l,svg:d,redirectUrl:r,nodeId:o});case 12:case"end":return n.stop()}}),n)})))()},borderOutline:function(e){return this.decorations.borderOutline&&this.decorations.borderOutline[e]},addWarning:function(e){this.allWarnings.push(e),this.$emit("warnings",this.allWarnings)},validatePlaneElements:function(){var e=this;this.planeElements.filter((function(e){return!e.bpmnElement})).map((function(t){return{title:e.$t("Non-existent Element"),text:e.$t("bpmdi:BPMNShape ")+t.id+e.$t(" references a non-existent element and was not parsed")}})).forEach((function(t){return e.addWarning(t)}))},cleanPlaneElements:function(){mv()(this.planeElements,(function(e){return!e.bpmnElement}))},getTooltipTarget:function(){return this.tooltipTarget.$el[0]},validateIfAutoValidateIsOn:function(){this.autoValidate&&this.validateBpmnDiagram()},translateConfig:function(e){if(e.config){var t=e.config;t.label=this.$t(t.label),t.helper=this.$t(t.helper)}e.items&&e.items.forEach(this.translateConfig)},pushToUndoStack:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.pasteInProgress&&!e.cloneInProgress){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,e.getXmlFromDiagram();case 5:return n=t.sent,t.next=8,Qv.dispatch("pushState",n);case 8:window.ProcessMaker.EventBus.$emit("modeler-change"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),console.warn(t.t0.message);case 14:case"end":return t.stop()}}),t,null,[[2,11]])})))()},getXmlFromDiagram:function(){var e=this;return new Promise((function(t,n){e.toXML((function(e,r){e?n(e):t(r)}))}))},validateBpmnDiagram:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(Un.getters.globalProcesses&&0!==Un.getters.globalProcesses.length){t.next=3;break}return t.next=3,Un.dispatch("fetchGlobalProcesses");case 3:return t.next=5,e.linter.lint(e.definitions);case 5:e.validationErrors=t.sent,e.$emit("validate",e.validationErrors);case 7:case"end":return t.stop()}}),t)})))()},setPools:function(e){var t;(this.collaboration||(this.collaboration=this.moddle.create("bpmn:Collaboration"),this.definitions.get("rootElements").push(this.collaboration),this.collaboration.set("id","collaboration_0"),this.plane.set("bpmnElement",this.collaboration)),e.get("processRef"))?this.collaboration.get("participants").includes(e)||this.collaboration.get("participants").push(e):(0===this.collaboration.get("participants").length?t=this.processNode.definition:(t=this.moddle.create("bpmn:Process"),this.processes.push(t),t.set("id",this.nodeIdGenerator.generateProcessId()),this.definitions.get("rootElements").push(t)),e.set("processRef",t),this.collaboration.get("participants").push(e))},unsetPools:function(){Cs()(this.definitions.get("rootElements"),this.collaboration),this.plane.set("bpmnElement",this.processNode.definition),this.collaboration=null},highlightNode:function(e,t){if(e&&this.highlightedNode)if(t&&t.shiftKey)Un.commit("addToHighlightedNodes",[e]);else{var n=Ar().isEqual(e.id,this.highlightedNode.id);n||Un.commit("highlightNode",e)}},blurFocusedScreenBuilderElement:function(){var e=["INPUT","SELECT"];e.includes(document.activeElement&&document.activeElement.tagName)&&document.activeElement.blur()},registerStatusBar:function(e){this.owner.validationBar.push(e)},registerComponentMixin:function(e,t){e.mixins||(e.mixins=[]),e.mixins.push(t)},registerBpmnExtension:function(e,t){this.extensions[e]=t},registerNode:function(e,t){var n=this,r=function(){return e.id},o=function(t){if(t.get("implementation")===e.implementation)return e.id};this.translateConfig(e.inspectorConfig[0]),Wx(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.nodeTypes.push(e);var i=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];i.forEach((function(i){n.parsers[i]||(n.parsers[i]={custom:[],implementation:[],default:[]}),t?n.parsers[i].custom.push(t):e.implementation?n.parsers[i].implementation.push(o):n.parsers[i].default.push(r)})),Mg.commit("setNodeTypes",this.nodeTypes)},registerPmBlock:function(e,t){var n=this,r=function(){return e.id};this.translateConfig(e.inspectorConfig[0]),Wx(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.pmBlockNodes.push(e);var o=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];o.forEach((function(e){n.parsers[e]||(n.parsers[e]={custom:[],implementation:[],default:[]}),t?n.parsers[e].custom.push(t):n.parsers[e].default.push(r)})),Mg.commit("setPmBlockNodeTypes",this.pmBlockNodes)},registerMenuAction:function(e){if(!e.value||"string"!==typeof e.value)throw new Error("Menu action must have a action.value");if(!e.content||"string"!==typeof e.content)throw new Error("Menu action must have a action.content");this.extraActions.push(e)},addMessageFlows:function(){this.collaboration&&this.collaboration.get("messageFlows").filter(this.hasSourceAndTarget).forEach(this.setNode)},loadAssociations:function(e,t){var n=this;t.filter((function(e){return"bpmn:Association"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(r){return n.setNode(r,e,t)}))},loadDataAssociations:function(e){var t=this,n=e.filter((function(e){return e.get("dataOutputAssociations")&&e.get("dataOutputAssociations").length>0}));n.forEach((function(n){n.get("dataOutputAssociations").forEach((function(n){t.setNode(n,e)}))}));var r=e.filter((function(e){return e.get("dataInputAssociations")&&e.get("dataInputAssociations").length>0}));r.forEach((function(n){n.get("dataInputAssociations").forEach((function(n){t.setNode(n,e)}))}))},loadArtifacts:function(e,t){var n=this;t.filter((function(e){return"bpmn:Association"!==e.$type})).forEach((function(r){return n.setNode(r,e,t)}))},loadSequenceFlows:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(r){return n.setNode(r,e,t)}))},loadFlowElements:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"!==e.$type})).forEach((function(r){return n.setNode(r,e,t)}))},addLanes:function(e){e.get("laneSets")[0]&&e.laneSets[0].lanes.forEach(this.setNode)},addPools:function(){this.collaboration&&this.collaboration.get("participants").forEach(this.setNode)},setUpDiagram:function(){var e=this;this.processes.forEach((function(t){e.ensureCancelActivityIsAddedToBoundaryEvents(t),e.addLanes(t);var n=t.get("flowElements"),r=t.get("artifacts");e.loadFlowElements(n,r),e.loadSequenceFlows(n,r),e.loadArtifacts(n,r),e.loadAssociations(n,r),e.loadDataAssociations(n)})),Un.commit("setRootElements",this.definitions.rootElements),this.addMessageFlows(),Un.commit("highlightNode",this.processNode)},getCollaboration:function(){return this.definitions.rootElements.find((function(e){var t=e.$type;return"bpmn:Collaboration"===t}))},getProcesses:function(){return this.definitions.rootElements.filter((function(e){var t=e.$type;return"bpmn:Process"===t}))},getPlane:function(){return this.definitions.diagrams[0].plane},getPlaneElements:function(){return this.plane.get("planeElement")},parse:function(){var e=this;this.collaboration=this.getCollaboration(),this.processes=this.getProcesses(),this.plane=this.getPlane(),this.planeElements=this.getPlaneElements(),this.validatePlaneElements(),this.cleanPlaneElements(),this.processNode=new po("processmaker-modeler-process",this.processes[0],this.planeElements.find((function(t){return t.bpmnElement.id===e.processes[0].id})))},removeUnsupportedElementAttributes:function(e){var t=["extensionElements"];t.filter((function(t){return e.get(t)})).forEach((function(t){return e.set(t,void 0)}))},getCustomParser:function(e){var t=this,n=this.parsers[e.$type];if(n){var r=n.custom.find((function(n){return n(e,t.moddle)})),o=n.implementation.find((function(n){return n(e,t.moddle)})),i=n.default.find((function(n){return n(e,t.moddle)}));return r||o||i}},handleUnsupportedElement:function(e,t,n,r,o){this.addWarning({title:this.$t("Unsupported Element"),text:e+this.$t(" is an unsupported element type in parse")}),Cs()(t,n),Cs()(r,n),Cs()(this.planeElements,o),this.collaboration&&Cs()(this.collaboration.get("messageFlows"),n);var i=n.get("incoming");i&&Cs()(t,i);var s=n.get("outgoing");s&&Cs()(t,s)},setNode:function(e,t,n){var r=this.planeElements.find((function(t){return t.bpmnElement.id===e.id})),o=e.$type,i=this.getCustomParser(e);if(i){this.removeUnsupportedElementAttributes(e);var s=e.config&&(0,pv.isJSON)(e.config)?JSON.parse(e.config):{},a=(null===s||void 0===s?void 0:s.processKey)||i(e,this.moddle),c=["bpmn:TextAnnotation","bpmn:Association","bpmn:DataOutputAssociation","bpmn:DataInputAssociation"],l=-1===c.indexOf(o);l&&!e.get("name")&&e.set("name",""),this.createNodeAsync(a,e,r)}else this.handleUnsupportedElement(o,t,e,n,r)},createNodeAsync:function(e,t,n){var r=this;return l(a().mark((function o(){var i;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:i=r.createNode(e,t,n),r.isMultiplayer?r.loadNodeForMultiplayer(i):Un.commit("addNode",i);case 2:case"end":return o.stop()}}),o)})))()},loadNodeForMultiplayer:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if("processmaker-modeler-lane"!==e.type){n.next=10;break}return n.next=3,t.addNode(e,e.definition.id,!0);case 3:return t.nodeIdGenerator.updateCounters(),n.next=6,t.$nextTick();case 6:return n.next=8,t.paperManager.awaitScheduledUpdates();case 8:return window.ProcessMaker.EventBus.$emit("multiplayer-addLanes",[e]),n.abrupt("return");case 10:t.multiplayerHook(e,!1),Un.commit("addNode",e),t.poolTarget=null;case 13:case"end":return n.stop()}}),n)})))()},createNode:function(e,t,n){return po.isTimerType(e)?new Mx(e,t,n):(Object.keys(t).forEach((function(e){void 0!==t[e]&&null!==t[e]||delete t[e]})),new po(e,t,n))},hasSourceAndTarget:function(e){var t=e.sourceRef&&this.parsers[e.sourceRef.$type],n=e.targetRef&&this.parsers[e.targetRef.$type];return t&&n},waitForCursorToChange:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=300,t.next=3,e.$nextTick();case 3:return t.abrupt("return",new Promise((function(e){return setTimeout(e,n)})));case 4:case"end":return t.stop()}}),t)})))()},renderPaper:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isRendering=!0,t.next=3,e.paperManager.performAtomicAction(l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.waitForCursorToChange();case 2:e.parse(),e.addPools(),e.setUpDiagram();case 5:case"end":return t.stop()}}),t)}))));case 3:return t.next=5,e.paperManager.awaitScheduledUpdates();case 5:e.isRendering=!1,e.$emit("parsed");case 7:case"end":return t.stop()}}),t)})))()},loadXML:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:null,o=!1,null===r&&(r=t.currentXML,o=!0),n.next=5,t.xmlManager.getDefinitionsFromXml(r);case 5:return t.definitions=n.sent,t.xmlManager.definitions=t.definitions,t.nodeIdGenerator=B(t.definitions),Un.commit("clearNodes"),n.next=11,t.renderPaper();case 11:o&&window.ProcessMaker.EventBus.$emit("modeler-change");case 12:case"end":return n.stop()}}),n)})))()},getBoundaryEvents:function(e){return e.get("flowElements").filter((function(e){var t=e.$type;return"bpmn:BoundaryEvent"===t}))},createBoundaryEvent:function(e){var t=Cg.definition(this.moddle,this.$t);return t.set("id",e.get("id")),t.set("name",e.get("name")),t.set("eventDefinitions",e.get("eventDefinitions")),t.set("cancelActivity",e.get("cancelActivity")),t.set("attachedToRef",e.get("attachedToRef")),t.set("color",e.get("color")),t.$parent=e.$parent,e.get("outgoing").length>0&&t.set("outgoing",e.get("outgoing")),t},ensureCancelActivityIsAddedToBoundaryEvents:function(e){var t=this;this.getBoundaryEvents(e).forEach((function(n){var r=t.createBoundaryEvent(n);n.get("outgoing").forEach((function(e){return e.set("sourceRef",r)})),t.replaceDefinition(n,r,e)}))},replaceDefinition:function(e,t,n){var r=n.get("flowElements").indexOf(e);n.flowElements[r]=t;var o=this.planeElements.find((function(t){return t.bpmnElement===e}));o.bpmnElement=t},toXML:function(e){this.moddle.toXML(this.definitions,{format:!0},e)},onCreateElementHandler:function(e){var t=e.event,n=e.control;this.handleDrop({clientX:t.clientX,clientY:t.clientY,control:n})},addRemoteNode:function(e){var t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.nodeRegistry[e.type].definition(t.moddle,t.$t),o=t.nodeRegistry[e.type].diagram(t.moddle),o.bounds.x=e.x,o.bounds.y=e.y,i=t.createNode(e.type,r,o),n.next=7,t.addNode(i,e.id,!0);case 7:return n.next=9,t.$nextTick();case 9:return n.next=11,t.paperManager.awaitScheduledUpdates();case 11:t.autoValidate&&t.validateBpmnDiagram();case 12:case"end":return n.stop()}}),n)})))()},handleDrop:function(e){var t=this;return l(a().mark((function n(){var r,o,i,s,c,l,d,u,h,p,f;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.clientX,o=e.clientY,i=e.control,s=e.nodeThatWillBeReplaced,t.validateDropTarget({clientX:r,clientY:o,control:i}),t.allowDrop){n.next=4;break}return n.abrupt("return");case 4:return c=t.nodeRegistry[i.type].definition(t.moddle,t.$t),l=t.nodeRegistry[i.type].diagram(t.moddle),d=t.paperManager.clientToGridPoint(r,o),u=d.x,h=d.y,l.bounds.x=u,l.bounds.y=h,p=t.createNode(i.type,c,l),p.isBpmnType("bpmn:BoundaryEvent")&&t.setShapeCenterUnderCursor(l),t.highlightNode(p),n.next=14,t.addNode(p);case 14:if(s){n.next=16;break}return n.abrupt("return");case 16:return f=new Vx(s,c,t.graph,p,t.processes,t.collaboration),f.migrate(),n.abrupt("return",p);case 19:case"end":return n.stop()}}),n)})))()},setShapeCenterUnderCursor:function(e){e.bounds.x-=e.bounds.width/2,e.bounds.y-=e.bounds.height/2},selectNewNode:function(e){var t=this;return l(a().mark((function n(){var r,o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$nextTick();case 2:return n.next=4,t.paperManager.awaitScheduledUpdates();case 4:return r=t.$refs.nodeComponent.find((function(t){return t.node===e})),o=r.shapeView,n.next=8,t.$refs.selector.selectElement(o);case 8:case"end":return n.stop()}}),n)})))()},multiplayerHook:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=["processmaker-modeler-lane","processmaker-modeler-generic-flow","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-data-input-association","processmaker-modeler-data-input-association","processmaker-modeler-boundary-timer-event","processmaker-modeler-boundary-error-event","processmaker-modeler-boundary-signal-event","processmaker-modeler-boundary-conditional-even","processmaker-modeler-boundary-message-event"];if(this.isMultiplayer&&!t){if(!r.includes(e.type)&&!this.flowTypes.includes(e.type)){var o,i={x:e.diagram.bounds.x,y:e.diagram.bounds.y,height:e.diagram.bounds.height,width:e.diagram.bounds.width,type:e.type,id:e.definition.id,oldNodeId:null,isAddingLaneAbove:!0,color:e.definition.color,dueIn:e.definition.dueIn,name:e.definition.name,assignedUsers:e.definition.assignedUsers,config:e.definition.config,loopCharacteristics:null,gatewayDirection:null,messageRef:null,extras:{}};if(null!==e&&void 0!==e&&null!==(o=e.pool)&&void 0!==o&&o.component&&(i["poolId"]=e.pool.component.id),n)return i;window.ProcessMaker.EventBus.$emit("multiplayer-addNode",i)}if(this.flowTypes.includes(e.type)){var s,a,c,l,d,u,h=null===(s=e.definition.sourceRef)||void 0===s?void 0:s.id,p=null===(a=e.definition.targetRef)||void 0===a?void 0:a.id;if("processmaker-modeler-data-input-association"===e.type)h=Array.isArray(e.definition.sourceRef)&&(null===(c=e.definition.sourceRef[0])||void 0===c?void 0:c.id),p=null===(l=e.definition.targetRef)||void 0===l||null===(d=l.$parent)||void 0===d||null===(u=d.$parent)||void 0===u?void 0:u.get("id");var f=[];if(e.diagram.waypoint.forEach((function(e){f.push({x:e.x,y:e.y})})),h&&p){var m={id:e.definition.id,type:e.type,sourceRefId:h,targetRefId:p,waypoint:f,name:e.definition.name,conditionExpression:null};if(n)return m;window.ProcessMaker.EventBus.$emit("multiplayer-addFlow",m)}}}},addNode:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]?t[1]:null,i=t.length>2&&void 0!==t[2]&&t[2],e.pool||(e.pool=n.poolTarget),s=e.getTargetProcess(n.processes,n.processNode),hx(e,s),e.setIds(n.nodeIdGenerator,o),n.planeElements.push(e.diagram),n.multiplayerHook(e,i),Un.commit("addNode",e),n.poolTarget=null,![gl,dl,er,El,_r,Ir,fo].includes(e.type)){r.next=12;break}return r.abrupt("return");case 12:return i||n.selectNewNode(e),r.abrupt("return",new Promise((function(e){setTimeout((function(){n.pushToUndoStack(),e()}))})));case 14:case"end":return r.stop()}}),r)})))()},addClonedNodes:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.forEach((function(e){e.pool||(e.pool=t.poolTarget);var n=e.getTargetProcess(t.processes,t.processNode);hx(e,n),t.planeElements.push(e.diagram),t.multiplayerHook(e,!1),Un.commit("addNode",e),t.poolTarget=null}));case 1:case"end":return n.stop()}}),n)})))()},removeNode:function(e,t){var n=this;return l(a().mark((function r(){return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:n.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-removeNode",e),n.removeNodeProcedure(e,t);case 2:case"end":return r.stop()}}),r)})))()},removeNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]?t[1]:{},i=o.removeRelationships,s=void 0===i||i,e){r.next=3;break}return r.abrupt("return");case 3:return s&&(Br(e,n),Lr(e,n),jr(e,n)),zr(e),Fr(n.graph,e,n.removeNode),Ur(e),n.removeNodesFromLane(e),n.removeNodesFromPool(e),Un.commit("removeNode",e),Un.commit("highlightNode",n.processNode),n.$refs.selector.clearSelection(),r.next=14,n.$nextTick();case 14:return r.next=16,n.pushToUndoStack();case 16:n.processes=n.getProcesses(),n.processes&&n.processes.length>0&&(n.processNode=new po("processmaker-modeler-process",n.processes[0],n.planeElements.find((function(e){return e.bpmnElement.id===n.processes[0].id}))));case 18:case"end":return r.stop()}}),r)})))()},removeNodes:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.performSingleUndoRedoTransaction(l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.paperManager.performAtomicAction(l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=[],e.highlightedNodes.forEach((function(t){return n.push(e.removeNode(t,{removeRelationships:!0}))})),t.next=4,Promise.all(n);case 4:Un.commit("highlightNode");case 5:case"end":return t.stop()}}),t)}))));case 2:case"end":return t.stop()}}),t)}))));case 2:case"end":return t.stop()}}),t)})))()},replaceNode:function(e){var t=this,n=e.node,r=e.typeToReplaceWith;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){var o,i,s,c;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o=n.diagram.bounds,i=o.x,s=o.y,c={x:i,y:s,control:{type:r},nodeThatWillBeReplaced:n},e.next=4,t.replaceNodeProcedure(c,!0);case 4:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},replaceNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s,c;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return o=t.length>1&&void 0!==t[1]&&t[1],o&&(i=n.paper.localToClientPoint(e.nodeThatWillBeReplaced.diagram.bounds),s=i.x,c=i.y,e.clientX=s,e.clientY=c),r.next=4,n.handleDrop(e);case 4:return r.next=6,n.removeNode(e.nodeThatWillBeReplaced,{removeRelationships:!1,isReplaced:o});case 6:case"end":return r.stop()}}),r)})))()},replaceAiNode:function(e){var t=this,n=e.node,r=e.typeToReplaceWith,o=e.assetId,i=e.assetName,s=e.redirectTo;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){var c,l,d,u;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return c=t.paper.localToClientPoint(n.diagram.bounds),l=c.x,d=c.y,e.next=3,t.handleDrop({clientX:l,clientY:d,control:{type:r},nodeThatWillBeReplaced:n});case 3:return u=e.sent,"processmaker-modeler-task"===r&&(u.definition.screenRef=o,u.definition.name=i),"processmaker-modeler-script-task"===r&&(u.definition.scriptRef=o,u.definition.name=i),"processmaker-modeler-call-activity"===r&&(u.definition.name=i,u.definition.calledElement="ProcessId-".concat(o),u.definition.config='{"calledElement":"ProcessId-'.concat(o,'","processId":').concat(o,',"startEvent":"node_1","name":"').concat(i,'"}'),s="".concat(s,"/").concat(u.id)),e.next=9,t.removeNode(n,{removeRelationships:!1});case 9:return t.highlightNode(u),t.selectNewNode(u),e.next=13,t.pushToUndoStack();case 13:return e.next=15,t.$nextTick();case 15:t.saveBpmn(s,u.id);case 16:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},replaceGenericFlow:function(e){var t=this,n=e.actualFlow,r=e.genericFlow,o=e.targetNode;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.highlightNode(null);case 2:return e.next=4,t.$nextTick();case 4:return e.next=6,Un.commit("removeNode",r);case 6:return e.next=8,t.$nextTick();case 8:return e.next=10,t.addNode(n,r.definition.id);case 10:return e.next=12,t.$nextTick();case 12:return e.next=14,t.highlightNode(o);case 14:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},performSingleUndoRedoTransaction:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return Qv.commit("disableSavingState"),n.next=3,e();case 3:return Qv.commit("enableSavingState"),n.next=6,t.pushToUndoStack();case 6:case"end":return n.stop()}}),n)})))()},removeNodesFromLane:function(e){var t=e.pool&&e.pool.component.laneSet&&e.pool.component.laneSet.get("lanes").find((function(t){return t.get("flowNodeRef").includes(e.definition)}));t&&Cs()(t.get("flowNodeRef"),e.definition)},removeNodesFromPool:function(e){var t=this;if("processmaker-modeler-pool"===e.type&&e.definition.processRef){e.definition.processRef.artifacts&&e.definition.processRef.artifacts.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)})),e.definition.processRef.flowElements&&e.definition.processRef.flowElements.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)}));var n=e.definition.processRef.laneSets;n&&n.length>0&&n[0].lanes.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)}))}},handleResize:function(){var e=this.$el.parentElement,t=e.clientWidth,n=e.clientHeight;this.parentWidth=t+"px",this.parentHeight=n+"px",this.paperManager.setPaperDimensions(t,n)},validateDropTarget:function(e){var t=e.clientX,n=e.clientY,r=e.control,o=Hb(t,n,r,this.paperManager.paper,this.graph,this.collaboration,this.$refs["paper-container"]),i=o.allowDrop,s=o.poolTarget;this.allowDrop=i,this.poolTarget=s},isBpmnNode:function(e){return null!=e.component},setShapeStacking:function(e){var t=this;this.isRendering||!e.component.node.isType("processmaker-modeler-pool")&&e===this.previouslyStackedShape||(this.previouslyStackedShape=e,this.paperManager.performAtomicAction((function(){return uw(e,t.graph)})))},showSavedNotification:function(){Qv.dispatch("saved")},enableVersions:function(){Qv.dispatch("enableVersions")},setVersionIndicator:function(e){Qv.dispatch("setVersionIndicator",e)},setLoadingState:function(e){Qv.dispatch("setLoadingState",e)},clearSelection:function(){this.$refs.selector.clearSelection()},isPointInSelection:function(e){var t=this.$refs.selector.$el;if("function"===typeof t.getBoundingClientRect){var n=t.getBoundingClientRect(),r=n.x,o=n.y,i=n.width,s=n.height;if(e.clientX>=r&&e.clientX<=r+i&&e.clientY>=o&&e.clientY<=o+s)return!0}return!1},pointerDowInShape:function(e,t){var n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=e.clientX,i=e.clientY,s=n.paper.findViewByModel(t),n.isDragging=!1,n.isSelecting=!1,n.isIntoTheSelection=!1,n.dragStart={x:o,y:i},!n.isPointInSelection(e)){r.next=10;break}n.isIntoTheSelection=!0,r.next=15;break;case 10:if(e.shiftKey){r.next=15;break}return r.next=13,n.$refs.selector.selectElement(s);case 13:return r.next=15,n.$nextTick();case 15:n.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY});case 16:case"end":return r.stop()}}),r)})))()},pointerDownHandler:function(e){var t=e.clientX,n=e.clientY;this.isDragging=!1,this.isSelecting=!1,this.isIntoTheSelection=!1,this.dragStart={x:t,y:n},this.isPointInSelection(e)?(this.isIntoTheSelection=!0,this.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY})):(this.isSelecting=!0,this.$refs.selector.startSelection(e))},pointerMoveHandler:function(e){var t=e.clientX,n=e.clientY;Un.getters.isReadOnly?this.canvasDragPosition&&!this.clientLeftPaper&&this.paperManager.translate(e.offsetX-this.canvasDragPosition.x,e.offsetY-this.canvasDragPosition.y):this.isGrabbing||(this.dragStart&&(Math.abs(t-this.dragStart.x)>5||Math.abs(n-this.dragStart.y)>5)?(this.isDragging=!0,this.dragStart=null):this.isSelecting?this.$refs.selector.updateSelection(e):this.isDragging&&this.$refs.selector.drag(e))},pointerUpHandler:function(e,t){!this.isDragging&&this.dragStart?t?this.$refs.selector.selectElement(t,e.shiftKey):this.clearSelection():this.isSelecting?this.$refs.selector.endSelection(this.paperManager.paper):this.$refs.selector.stopDrag(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e),this.isDragging=!1,this.dragStart=null,this.isSelecting=!1},redirect:function(e){window.location=e},enableMultiplayer:function(e){Un.commit("enableMultiplayer",e)},addPlayer:function(e){this.players.push(e)},removePlayer:function(e){var t=this.players.findIndex((function(t){return t.id===e}));-1!==t&&this.players.splice(t,1)}},created:function(){Ss()&&(window.store=Un,window.undoRedoStore=Qv),this.$t=this.$t.bind(this),window.ProcessMaker.EventBus.$emit("modeler-before-init",{registerComponentMixin:this.registerComponentMixin}),this.registerNode(Pv),window.ProcessMaker.EventBus.$emit("modeler-init",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,registerInspectorExtension:sw,registerBpmnExtension:this.registerBpmnExtension,registerNode:this.registerNode,registerStatusBar:this.registerStatusBar,registerPmBlock:this.registerPmBlock,registerPreview:this.registerPreview}),this.moddle=new(Eg())(this.extensions),this.linter=new eb.Linter(Vb),this.xmlManager=new jx(this.moddle),this.$emit("set-xml-manager",this.xmlManager)},mounted:function(){var e=this;Un.commit("setReadOnly",this.readOnly),this.graph=new F.dia.Graph,Un.commit("setGraph",this.graph),this.graph.set("interactiveFunc",(function(e){var t="standard.EmbeddedImage"===e.model.get("type");return{elementMove:t,labelMove:!1}})),this.paperManager=iw.factory(this.$refs.paper,this.graph.get("interactiveFunc"),this.graph),this.paper=this.paperManager.paper,this.paperManager.addEventHandler("cell:pointerdblclick",Px),this.handleResize(),window.addEventListener("resize",this.handleResize),Un.commit("setPaper",this.paperManager.paper),this.paperManager.addEventHandler("element:pointerclick",this.blurFocusedScreenBuilderElement,this),this.paperManager.addEventHandler("blank:pointerdown",(function(t,n,r){if(!e.isGrabbing){Un.getters.isReadOnly&&(e.isGrabbing=!0);var o=e.paperManager.scale;e.canvasDragPosition={x:n*o.sx,y:r*o.sy},e.isOverShape=!1,e.pointerDownHandler(t)}}),this),this.paperManager.addEventHandler("cell:mouseover element:mouseover",(function(t){var n=t.model;e.isBpmnNode(n)&&"default"!==n.attr("body/cursor")&&!e.isGrabbing&&n.attr("body/cursor","move"),e.isGrabbing&&e.isBpmnNode(n)&&n.attr("body/cursor","grabbing")})),this.paperManager.addEventHandler("blank:pointerup",(function(t){e.isGrabbing=!1,e.canvasDragPosition=null,e.activeNode=null,e.pointerUpHandler(t)}),this),this.paperManager.addEventHandler("cell:pointerup",(function(t,n){e.canvasDragPosition=null,e.activeNode=null,e.pointerUpHandler(n,t)}),this),this.$refs["paper-container"].addEventListener("mouseenter",(function(){Un.commit("setClientLeftPaper",!1)})),this.$el.addEventListener("mousemove",(function(t){e.pointerMoveHandler(t)})),this.$refs["paper-container"].addEventListener("mouseleave",(function(){e.paperManager.removeEventHandler("blank:pointermove"),Un.commit("setClientLeftPaper",!0)})),this.paperManager.addEventHandler("cell:pointerclick",(function(e,t,n,r){var o=e.model.get("onClick");o&&o(e,t,n,r)})),this.paperManager.addEventHandler("cell:pointerclick",(function(t,n){var r=t.model;e.isBpmnNode(r)&&(e.isGrabbing||(r.component.$emit("click",n),e.$emit("click",{event:n,node:e.highlightedNode.definition})))})),this.paperManager.addEventHandler("cell:pointerdown",(function(t,n){var r=t.model;e.isBpmnNode(r)&&(e.isGrabbing||(e.setShapeStacking(r),e.activeNode=r.component.node,e.isOverShape=!0,e.pointerDowInShape(n,r)))})),this.paperManager.addEventHandler("cell:pointermove",(function(t,n,r,o){if(e.isGrabbing){if(!e.canvasDragPosition){var i=e.paperManager.scale;e.canvasDragPosition={x:r*i.sx,y:o*i.sy}}e.canvasDragPosition&&!e.clientLeftPaper&&e.paperManager.translate(n.offsetX-e.canvasDragPosition.x,n.offsetY-e.canvasDragPosition.y)}})),window.ProcessMaker.EventBus.$emit("modeler-start",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,loadXML:function(){var t=l(a().mark((function t(n){var r;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.loadXML(n);case 2:return t.next=4,Qv.dispatch("pushState",n);case 4:try{r=new QI(e),r.init(),e.multiplayer=r}catch(o){console.warn("Could not initialize multiplayer",o)}case 5:case"end":return t.stop()}}),t)})));function n(e){return t.apply(this,arguments)}return n}(),addWarnings:function(t){return e.$emit("warnings",t)},addBreadcrumbs:function(t){return e.breadcrumbData.push(t)}}),this.$root.$on("replace-ai-node",(function(t){e.replaceAiNode(t)})),window.ProcessMaker.EventBus.$on("save-changes",(function(t){t&&e.redirect(t)}))}},tO=eO,nO=(f(75317),fr(tO,fg,mg,!1,null,null,null)),rO=nO.exports,oO=f(87299),iO=f.n(oO),sO={extends:zp,mixins:[tc],data:function(){return{nodeIcon:iO(),iconName:""}}},aO=sO,cO=fr(aO,GI,$I,!1,null,null,null),lO=cO.exports,dO=76,uO="processmaker-modeler-manual-task",hO={id:uO,component:lO,bpmnType:"bpmn:ManualTask",control:!1,category:"BPMN",icon:f(8565),label:io[uO],loopInspectorIndex:1,definition:function(e,t){return e.create("bpmn:ManualTask",{name:t(io[uO]),assignment:"requester",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:dO,width:116})})},inspectorConfig:[{name:io[uO],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-manual-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},pO={extends:hd,data:function(){return{nodeIcon:ap()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.attr({image:{"ref-x":7,"ref-y":7,width:e.get("width")-14,height:e.get("height")-14}})}},fO=pO,mO=fr(fO,XI,YI,!1,null,null,null),gO=mO.exports,vO="processmaker-modeler-conditional-start-event",bO=ac()(ho()(Md),Qr(Qr({},pp),{},{id:vO,component:gO,label:to[vO],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[vO]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),yO=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},wO=[],xO={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialDataAssociationDirection:this.node.definition.dataAssociationDirection}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.definition.$type");if(!e)return!1;var t=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],n=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],r="bpmn:DataStoreReference"===this.sourceNode.definition.$type,o="bpmn:DataObjectReference"===this.sourceNode.definition.$type;return!(!r||!t.includes(e))||o&&n.includes(e)}},methods:{findSourceShape:function(){if(this.node.dataAssociationProps)return this.node.dataAssociationProps.sourceShape;var e=this.node.definition.sourceRef[0],t=this.graph.getElements().find((function(t){return t.component.node.definition===e}));return t},getTargetRef:function(){return this.node.dataAssociationProps?this.node.dataAssociationProps.targetCoords:Vr(this.node.definition.targetRef.$parent,this.$parent)},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement(),t=qr(this.moddle,e.component.node,this.sourceNode.definition);this.node.definition.set("targetRef",t),this.node.definition.set("sourceRef",[this.sourceNode.definition]),e.component.node.definition.set("dataInputAssociations",[this.node.definition])}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this},destroyed:function(){this.targetNode&&(Hr(this.targetNode,this.sourceNode.definition),(0,Er.pull)(this.targetNode.definition.get("dataInputAssociations"),this.node.definition))}},kO=xO,CO=fr(kO,yO,wO,!1,null,null,null),SO=CO.exports,EO=function(){function e(t,n,r){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=Nr(this.moddle),i=Dr(this.moddle),s=qr(this.moddle,t.component.node,e.component.node.definition);i.set("targetRef",s),i.set("sourceRef",[e.component.node.definition]),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var a=new po(Ir,i,o);return a}}]),e}(),AO=Qr(Qr({},t),{},{component:SO,control:!1,inspectorConfig:[{name:"Data Input Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-input-association"},items:[{component:"FormInput",config:Ns}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new EO(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),i.component.node.definition.set("dataInputAssociations",[c.definition]),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),_O=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},TO=[],MO={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialDataAssociationDirection:this.node.definition.dataAssociationDirection}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.type");if(!e)return!1;var t="bpmn:DataObjectReference"!==this.targetConfig.bpmnType&&"bpmn:DataStoreReference"!==this.targetConfig.bpmnType;return!t}},methods:{findSourceShape:function(){var e=this;return this.node.dataAssociationProps?this.node.dataAssociationProps.sourceShape:this.graph.getElements().find((function(t){return t.component&&t.component.node.definition.get("dataOutputAssociations")&&t.component.node.definition.get("dataOutputAssociations").includes(e.node.definition)}))},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){this.node.definition.set("targetRef",this.targetNode.definition);var e=this.sourceNode.definition.get("dataOutputAssociations")||[];this.sourceNode.definition.set("dataOutputAssociations",[].concat(W(e),[this.node.definition]))}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this},destroyed:function(){(0,Er.pull)(this.sourceNode.definition.get("dataOutputAssociations"),this.node.definition)}},PO=MO,IO=fr(PO,_O,TO,!1,null,null,null),OO=IO.exports,DO=Qr(Qr({},e),{},{component:OO,control:!1,inspectorConfig:[{name:"Data Output Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-output-association"},items:[{component:"FormInput",config:Ns}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new Uk(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),NO=JSON.parse('{"name":"ProcessMaker","uri":"http://processmaker.com/BPMN/2.0/Schema.xsd","prefix":"pm","xml":{"tagAlias":"lowerCase"},"associations":[],"types":[{"name":"BaseElement","extends":["bpmn:BaseElement"],"isAbstract":true,"properties":[{"name":"color","isAttr":true,"type":"String"}]},{"name":"Task","extends":["bpmn:Task"],"properties":[{"name":"screenRef","isAttr":true,"type":"String"},{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"screenVersion","isAttr":true,"type":"String"},{"name":"dueIn","isAttr":true,"type":"Integer"},{"name":"notifyAfterRouting","isAttr":true,"type":"Boolean"},{"name":"notifyRequestCreator","isAttr":true,"type":"Boolean"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"assignmentLock","isAttr":true,"type":"Boolean"},{"name":"allowReassignment","isAttr":true,"type":"Boolean"},{"name":"assignmentRules","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"customIcon","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"ScriptTask","extends":["bpmn:ScriptTask"],"properties":[{"name":"scriptRef","isAttr":true,"type":"String"},{"name":"scriptVersion","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"ServiceTask","extends":["bpmn:ServiceTask"],"properties":[{"name":"implementationVersion","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"Message","extends":["bpmn:Message"],"properties":[{"name":"payload","isAttr":true,"type":"String"}]},{"name":"EndEvent","extends":["bpmn:EndEvent"],"properties":[{"name":"screenRef","isAttr":true,"type":"String"},{"name":"screenVersion","isAttr":true,"type":"String"}]},{"name":"StartEvent","extends":["bpmn:StartEvent"],"properties":[{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"IntermediateCatchEvent","extends":["bpmn:IntermediateCatchEvent"],"properties":[{"name":"allowedUsers","isAttr":true,"type":"String"},{"name":"allowedGroups","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"whitelist","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"MessageEventDefinition","extends":["bpmn:MessageEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"}]},{"name":"MessageEventDefinition","extends":["bpmn:MessageEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinition","extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"config","isAttr":true,"type":"String"}]},{"name":"SequenceFlow","extends":["bpmn:SequenceFlow"],"properties":[{"name":"config","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"customIcon","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"Signal","extends":["bpmn:Signal"],"properties":[{"name":"config","isAttr":true,"type":"String"},{"name":"detail","isAttr":true,"type":"String"}]}],"emumerations":[]}'),RO=[Id,Am,Rm,Wa,gf,Hf,hO,Bf,Wf,Bc,Wc,sl,Kc,vl,Al,Bs,AO,DO,sg,Um,em],BO=[[Ud,"bpmn:StartEvent","bpmn:SignalEventDefinition"],[Cu,"bpmn:StartEvent","bpmn:TimerEventDefinition"],[Yd,"bpmn:StartEvent","bpmn:MessageEventDefinition"],[bO,"bpmn:StartEvent","bpmn:ConditionalEventDefinition"],[fh,"bpmn:IntermediateCatchEvent","bpmn:TimerEventDefinition"],[Nh,"bpmn:IntermediateCatchEvent","bpmn:MessageEventDefinition"],[Vh,"bpmn:IntermediateCatchEvent","bpmn:SignalEventDefinition"],[Zh,"bpmn:IntermediateThrowEvent","bpmn:MessageEventDefinition"],[ip,"bpmn:IntermediateThrowEvent","bpmn:SignalEventDefinition"],[mp,"bpmn:IntermediateCatchEvent","bpmn:ConditionalEventDefinition"],[nw,"bpmn:BoundaryEvent","bpmn:TimerEventDefinition"],[vy,"bpmn:BoundaryEvent","bpmn:ErrorEventDefinition"],[Oy,"bpmn:BoundaryEvent","bpmn:EscalationEventDefinition"],[zy,"bpmn:BoundaryEvent","bpmn:MessageEventDefinition"],[Xy,"bpmn:BoundaryEvent","bpmn:SignalEventDefinition"],[Ey,"bpmn:BoundaryEvent","bpmn:ConditionalEventDefinition"],[Hl,"bpmn:EndEvent","bpmn:MessageEventDefinition"],[uc,"bpmn:EndEvent","bpmn:ErrorEventDefinition"],[sd,"bpmn:EndEvent","bpmn:SignalEventDefinition"],[yc,"bpmn:EndEvent","bpmn:TerminateEventDefinition"]],LO=function(e,t,n){return function(r){var o=r.get("eventDefinitions"),i=r.$type===t&&o&&o.length&&o[0].$type===n;if(i)return e.id}};function jO(e){var t=e.registerNode,n=e.registerBpmnExtension;BO.forEach((function(e){var n=jt(e,3),r=n[0],o=n[1],i=n[2];t(r,LO(r,o,i))})),RO.forEach((function(e){return t(e)})),n("pm",NO)}}(),m}()}));
34
+ function Ut(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}var qt="undefined"!==typeof window?window:"undefined"!==typeof f.g?f.g:{},Vt=qt.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Ht(e){Vt&&(e._devtoolHook=Vt,Vt.emit("vuex:init",e),Vt.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){Vt.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){Vt.emit("vuex:action",e,t)}),{prepend:!0}))}function Wt(e,t){return e.filter(t)[0]}function Gt(e,t){if(void 0===t&&(t=[]),null===e||"object"!==typeof e)return e;var n=Wt(t,(function(t){return t.original===e}));if(n)return n.copy;var r=Array.isArray(e)?[]:{};return t.push({original:e,copy:r}),Object.keys(e).forEach((function(n){r[n]=Gt(e[n],t)})),r}function $t(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function Xt(e){return null!==e&&"object"===typeof e}function Yt(e){return e&&"function"===typeof e.then}function Jt(e,t){return function(){return e(t)}}var Zt=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"===typeof n?n():n)||{}},Kt={namespaced:{configurable:!0}};Kt.namespaced.get=function(){return!!this._rawModule.namespaced},Zt.prototype.addChild=function(e,t){this._children[e]=t},Zt.prototype.removeChild=function(e){delete this._children[e]},Zt.prototype.getChild=function(e){return this._children[e]},Zt.prototype.hasChild=function(e){return e in this._children},Zt.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},Zt.prototype.forEachChild=function(e){$t(this._children,e)},Zt.prototype.forEachGetter=function(e){this._rawModule.getters&&$t(this._rawModule.getters,e)},Zt.prototype.forEachAction=function(e){this._rawModule.actions&&$t(this._rawModule.actions,e)},Zt.prototype.forEachMutation=function(e){this._rawModule.mutations&&$t(this._rawModule.mutations,e)},Object.defineProperties(Zt.prototype,Kt);var Qt=function(e){this.register([],e,!1)};function en(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return void 0;en(e.concat(r),t.getChild(r),n.modules[r])}}Qt.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Qt.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")}),"")},Qt.prototype.update=function(e){en([],this.root,e)},Qt.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var o=new Zt(t,n);if(0===e.length)this.root=o;else{var i=this.get(e.slice(0,-1));i.addChild(e[e.length-1],o)}t.modules&&$t(t.modules,(function(t,o){r.register(e.concat(o),t,n)}))},Qt.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],r=t.getChild(n);r&&r.runtime&&t.removeChild(n)},Qt.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var tn;var nn=function(e){var t=this;void 0===e&&(e={}),!tn&&"undefined"!==typeof window&&window.Vue&&vn(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Qt(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new tn,this._makeLocalGettersCache=Object.create(null);var o=this,i=this,s=i.dispatch,a=i.commit;this.dispatch=function(e,t){return s.call(o,e,t)},this.commit=function(e,t,n){return a.call(o,e,t,n)},this.strict=r;var c=this._modules.root.state;cn(this,c,[],this._modules.root),an(this,c),n.forEach((function(e){return e(t)}));var l=void 0!==e.devtools?e.devtools:tn.config.devtools;l&&Ht(this)},rn={state:{configurable:!0}};function on(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function sn(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;cn(e,n,[],e._modules.root,!0),an(e,n,t)}function an(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};$t(o,(function(t,n){i[n]=Jt(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=tn.config.silent;tn.config.silent=!0,e._vm=new tn({data:{$$state:t},computed:i}),tn.config.silent=s,e.strict&&fn(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),tn.nextTick((function(){return r.$destroy()})))}function cn(e,t,n,r,o){var i=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!i&&!o){var a=mn(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){tn.set(a,c,r.state)}))}var l=r.context=ln(e,s,n);r.forEachMutation((function(t,n){var r=s+n;un(e,r,t,l)})),r.forEachAction((function(t,n){var r=t.root?n:s+n,o=t.handler||t;hn(e,r,o,l)})),r.forEachGetter((function(t,n){var r=s+n;pn(e,r,t,l)})),r.forEachChild((function(r,i){cn(e,t,n.concat(i),r,o)}))}function ln(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=gn(n,r,o),s=i.payload,a=i.options,c=i.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:r?e.commit:function(n,r,o){var i=gn(n,r,o),s=i.payload,a=i.options,c=i.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return dn(e,t)}},state:{get:function(){return mn(e.state,n)}}}),o}function dn(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function un(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push((function(t){n.call(e,r.state,t)}))}function hn(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push((function(t){var o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return Yt(o)||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}function pn(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)})}function fn(e){e._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function mn(e,t){return t.reduce((function(e,t){return e[t]}),e)}function gn(e,t,n){return Xt(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function vn(e){tn&&e===tn||(tn=e,Ut(tn))}rn.state.get=function(){return this._vm._data.$$state},rn.state.set=function(e){0},nn.prototype.commit=function(e,t,n){var r=this,o=gn(e,t,n),i=o.type,s=o.payload,a=(o.options,{type:i,payload:s}),c=this._mutations[i];c&&(this._withCommit((function(){c.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,r.state)})))},nn.prototype.dispatch=function(e,t){var n=this,r=gn(e,t),o=r.type,i=r.payload,s={type:o,payload:i},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(l){0}var c=a.length>1?Promise.all(a.map((function(e){return e(i)}))):a[0](i);return new Promise((function(e,t){c.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(l){0}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(l){0}t(e)}))}))}},nn.prototype.subscribe=function(e,t){return on(e,this._subscribers,t)},nn.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return on(n,this._actionSubscribers,t)},nn.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},nn.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},nn.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"===typeof e&&(e=[e]),this._modules.register(e,t),cn(this,this.state,e,this._modules.get(e),n.preserveState),an(this,this.state)},nn.prototype.unregisterModule=function(e){var t=this;"string"===typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=mn(t.state,e.slice(0,-1));tn.delete(n,e[e.length-1])})),sn(this)},nn.prototype.hasModule=function(e){return"string"===typeof e&&(e=[e]),this._modules.isRegistered(e)},nn.prototype.hotUpdate=function(e){this._modules.update(e),sn(this,!0)},nn.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(nn.prototype,rn);var bn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=An(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"===typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),yn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=An(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),wn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||An(this.$store,"mapGetters",e))return this.$store.getters[o]},n[r].vuex=!0})),n})),xn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=An(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),kn=function(e){return{mapState:bn.bind(null,e),mapGetters:wn.bind(null,e),mapMutations:yn.bind(null,e),mapActions:xn.bind(null,e)}};function Cn(e){return Sn(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function Sn(e){return Array.isArray(e)||Xt(e)}function En(e){return function(t,n){return"string"!==typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function An(e,t,n){var r=e._modulesNamespaceMap[n];return r}function _n(e){void 0===e&&(e={});var t=e.collapsed;void 0===t&&(t=!0);var n=e.filter;void 0===n&&(n=function(e,t,n){return!0});var r=e.transformer;void 0===r&&(r=function(e){return e});var o=e.mutationTransformer;void 0===o&&(o=function(e){return e});var i=e.actionFilter;void 0===i&&(i=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var a=e.logMutations;void 0===a&&(a=!0);var c=e.logActions;void 0===c&&(c=!0);var l=e.logger;return void 0===l&&(l=console),function(e){var d=Gt(e.state);"undefined"!==typeof l&&(a&&e.subscribe((function(e,i){var s=Gt(i);if(n(e,d,s)){var a=Pn(),c=o(e),u="mutation "+e.type+a;Tn(l,u,t),l.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),l.log("%c mutation","color: #03A9F4; font-weight: bold",c),l.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),Mn(l)}d=s})),c&&e.subscribeAction((function(e,n){if(i(e,n)){var r=Pn(),o=s(e),a="action "+e.type+r;Tn(l,a,t),l.log("%c action","color: #03A9F4; font-weight: bold",o),Mn(l)}})))}}function Tn(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(o){e.log(t)}}function Mn(e){try{e.groupEnd()}catch(t){e.log("—— log end ——")}}function Pn(){var e=new Date;return" @ "+On(e.getHours(),2)+":"+On(e.getMinutes(),2)+":"+On(e.getSeconds(),2)+"."+On(e.getMilliseconds(),3)}function In(e,t){return new Array(t+1).join(e)}function On(e,t){return In("0",t-e.toString().length)+e}var Dn={Store:nn,install:vn,version:"3.6.2",mapState:bn,mapMutations:yn,mapGetters:wn,mapActions:xn,createNamespacedHelpers:kn,createLogger:_n},Nn=Dn,Rn=f(85564),Bn=f.n(Rn),Ln=f(44908),jn=f.n(Ln);function Fn(e,t,n){Object.hasOwn(e,t)?e.set(t,n):(delete Object.getPrototypeOf(e)[t],zt().set(e,t,n))}function zn(e,t,n){e.nodes.filter((function(e){var t=e.definition;return("bpmn:IntermediateCatchEvent"===t.$type||"bpmn:StartEvent"===t.$type)&&t.eventDefinitions&&t.eventDefinitions.some(n)})).forEach((function(e){var n=e.definition;n.eventDefinitions[0][t]=null}))}zt().use(Nn);var Un=new Nn.Store({state:{graph:null,paper:null,highlightedNodes:[],nodes:[],rootElements:[],autoValidate:!1,globalProcesses:[],allowSavingElementPosition:!0,copiedElements:[],clientLeftPaper:!1,readOnly:!1,isMultiplayer:!1},getters:{nodes:function(e){return e.nodes},paper:function(e){return e.paper},highlightedNodes:function(e){return e.highlightedNodes},nodeShape:function(e){return function(t){return e.graph.getCells().find((function(e){return e.component&&e.component.node===t}))}},highlightedShapes:function(e,t){return t.highlightedNodes.filter((function(e){return"processmaker-modeler-process"!==e.type})).map(t.nodeShape)},rootElements:function(e){return e.rootElements},autoValidate:function(e){return e.autoValidate},globalProcesses:function(e){return e.globalProcesses},globalProcessEvents:function(e,t){return Bn()(t.globalProcesses.map((function(e){return e.events})))},allowSavingElementPosition:function(e){return e.allowSavingElementPosition},copiedElements:function(e){return e.copiedElements},clientLeftPaper:function(e){return e.clientLeftPaper},isReadOnly:function(e){return e.readOnly},showComponent:function(e){return!e.readOnly},isMultiplayer:function(e){return e.isMultiplayer}},mutations:{setReadOnly:function(e,t){e.readOnly=t},preventSavingElementPosition:function(e){e.allowSavingElementPosition=!1},allowSavingElementPosition:function(e){e.allowSavingElementPosition=!0},setAutoValidate:function(e,t){e.autoValidate=t},setRootElements:function(e,t){e.rootElements=t},updateNodeBounds:function(e,t){var n=t.node,r=t.bounds;r&&Object.entries(r).forEach((function(e){var t=jt(e,2),r=t[0],o=t[1];"$type"!==r&&n.diagram.bounds.set(r,o)}))},updateNodeProp:function(e,t){var n=t.node,r=t.key,o=t.value;"id"==r&&n.definition.id!==o&&e.nodes.some((function(e){return e.definition.id===o}))||(Fn(n.definition,r,o),null==o&&zt()["delete"](n.definition,r))},clearNodes:function(e){e.nodes=[]},highlightNode:function(e,t){e.highlightedNodes=t?[t]:[]},addToHighlightedNodes:function(e,t){var n=jn()([].concat(W(e.highlightedNodes),W(t))),r=n.filter((function(e){return"processmaker-modeler-pool"===e.type})).map((function(e){return e.id}));e.highlightedNodes=n.filter((function(e){return!e.pool||!e.pool.component.node.id||!r.includes(e.pool.component.node.id)}))},addNode:function(e,t){t._modelerId="_modelerId_"+t.definition.get("id"),e.nodes.push(t)},removeNode:function(e,t){var n=e.nodes.indexOf(t);-1!==n&&e.nodes.splice(n,1)},removeMessageRef:function(e,t){zn(e,"messageRef",(function(e){var n=e.messageRef;return n===t}))},removeSignalRef:function(e,t){zn(e,"signalRef",(function(e){var n=e.signalRef;return n===t}))},setGraph:function(e,t){e.graph=t},setPaper:function(e,t){e.paper=t},setGlobalProcesses:function(e,t){e.globalProcesses=t},setCopiedElements:function(e,t){e.copiedElements=t},setClientLeftPaper:function(e,t){e.clientLeftPaper=t},enableMultiplayer:function(e,t){e.isMultiplayer=t}},actions:{fetchGlobalProcesses:function(e){return l(a().mark((function t(){var n,r,o;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.commit,t.prev=1,t.next=4,window.ProcessMaker.apiClient.get("processes",{params:{order_direction:"asc",per_page:1e3,status:"all",include:"events,category"}});case 4:r=t.sent,o=r.data,n("setGlobalProcesses",o.data),window.ProcessMaker.globalProcesses=o.data,t.next=12;break;case 10:t.prev=10,t.t0=t["catch"](1);case 12:case"end":return t.stop()}}),t,null,[[1,10]])})))()}}}),qn="#5096db",Vn="#FF0000",Hn="#3FA6FF",Wn="#DCF2FF",Gn="#CCCCCC",$n="#F5F5F5",Xn="#00BA7C",Yn="#D6FFE6",Jn={source:"source",target:"target"};function Zn(e){return e.x&&e.y}var Kn={props:["highlighted","paper","paperManager","isCompleted","isIdle"],data:function(){return{linkView:null,sourceShape:null,target:null,listeningToMouseup:!1,listeningToMouseleave:!1,vertices:null,anchorPointFunction:Mt}},watch:{target:function(e,t){t&&t!==e&&Nt(t)},isValidConnection:function(e){e?this.shape.stopListening(this.paper,"blank:pointerdown link:pointerdown element:pointerdown",this.removeLink):this.shape.listenToOnce(this.paper,"blank:pointerdown link:pointerdown element:pointerdown",this.removeLink)},highlighted:function(e){Un.getters.isReadOnly||(e?(this.shape.attr({line:{stroke:"#5096db"},".joint-highlight-stroke":{display:"none"}}),this.shapeView.showTools()):(Nt(this.shape),this.shapeView.hideTools()))}},computed:{shapeView:function(){return this.shape.findView(this.paper)},sourceNode:function(){return $()(this.sourceShape,"component.node")},targetNode:function(){return $()(this.target,"component.node")},sourceConfig:function(){return this.sourceNode&&this.nodeRegistry[this.sourceNode.type]},targetConfig:function(){return this.targetNode&&this.nodeRegistry[this.targetNode.type]},elementPadding:function(){return this.shape&&this.shape.source().id===this.shape.target().id?20:1}},methods:{setShapeHighlight:function(){this.isCompleted?this.shape.attr({line:{stroke:Xn}}):this.isIdle&&this.shape.attr({line:{stroke:Gn}})},findSourceShape:function(){var e=this;return this.graph.getElements().find((function(t){return t.component&&t.component.node.definition===e.node.definition.get("sourceRef")}))},setEndpoint:function(e,t,n){var r=this;if(e&&Zn(e))return this.shape[t](e,{anchor:{name:"modelCenter",args:{padding:25}},connectionPoint:{name:"boundary"}});var o=function(){var t=e.position(),r=t.x,o=t.y,i=e.size(),s=i.width,a=i.height;return n?{x:r+n.x,y:o+n.y}:{x:r+s/2,y:o+a/2}};this.shape[t](e,{anchor:function(){return r.getAnchorPointFunction(t)(o(),e.findView(r.paper))},connectionPoint:{name:"boundary"}})},setSource:function(e,t){this.setEndpoint(e,Jn.source,t)},setTarget:function(e,t){this.setEndpoint(e,Jn.target,t)},completeLink:function(){this.shape.stopListening(this.paper,"cell:mouseleave"),this.$emit("set-cursor",null),this.resetPaper();var e=this.shape.getTargetElement();Nt(e),this.shape.on("change:vertices",this.onChangeVertices),this.shape.on("change:source",this.onChangeTargets),this.shape.on("change:target",this.onChangeTargets),this.shape.listenTo(this.sourceShape,"change:position",this.updateWaypoints),this.shape.listenTo(e,"change:position",this.updateWaypoints),this.shape.listenTo(this.paper,"link:mouseleave",this.storeWaypoints);var t=this.shape.getSourceElement();t.embed(this.shape),this.$emit("set-shape-stacking",t)},waitForUpdateWaypoints:function(){var e=this;return new Promise((function(t){e.updateWaypoints(),e.updateWaypoints.flush(),t()}))},storeWaypoints:function(){var e=this;return l(a().mark((function t(){var n,r,o,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.highlighted||e.listeningToMouseleave){t.next=7;break}return e.updateWaypoints(),t.next=4,e.$nextTick();case 4:e.$parent.isMultiplayer&&e.linkView&&(n=e.linkView.model.component.node.type,r=e.linkView.sourceView.model.component.node.definition.id,o=e.linkView.targetView.model.component.node.definition.id,i=[{id:e.linkView.model.component.node.definition.id,properties:{type:n,waypoint:[e.linkView.sourceAnchor.toJSON()].concat(W(e.shape.vertices()),[e.linkView.targetAnchor.toJSON()]),sourceRefId:r,targetRefId:o}}],window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",i)),e.listeningToMouseleave=!0,e.$emit("save-state");case 7:case"end":return t.stop()}}),t)})))()},onChangeTargets:function(e,t,n){var r=this;return l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===n||void 0===n||!n.ui){e.next=8;break}return e.next=3,r.$nextTick();case 3:return e.next=5,r.waitForUpdateWaypoints();case 5:return r.listeningToMouseleave=!1,e.next=8,r.storeWaypoints();case 8:case"end":return e.stop()}}),e)})))()},onChangeVertices:function(e,t,n){var r=this;return l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===n||void 0===n||!n.ui){e.next=6;break}return r.updateWaypoints(),e.next=4,r.$nextTick();case 4:r.listeningToMouseleave=!1,r.$emit("save-state");case 6:case"end":return e.stop()}}),e)})))()},updateWaypoints:function(){var e=this;this.linkView=this.shape.findView(this.paper);var t=this.linkView.sourceAnchor,n=this.linkView.targetAnchor;this.node.diagram.waypoint=[t].concat(W(this.shape.vertices()),[n]).map((function(t){return e.moddle.create("dc:Point",t)})),this.listeningToMouseup||(this.listeningToMouseup=!0,document.addEventListener("mouseup",this.emitSave))},updateLinkTarget:function(e){var t=this,n=e.clientX,r=e.clientY,o=this.paper.clientToLocalPoint({x:n,y:r});if(this.target=this.graph.findModelsFromPoint(o).sort((function(e,t){return t.get("z")-e.get("z")}))[0],!this.isValidConnection)return this.$emit("set-cursor","not-allowed"),this.shape.target({x:o.x,y:o.y}),void(this.target&&Ze(this.target,ze));this.setTarget(this.target),this.updateRouter(),this.$emit("set-cursor","default"),Ze(this.target,Fe),this.paper.el.removeEventListener("mousemove",this.updateLinkTarget),this.shape.listenToOnce(this.paper,"cell:pointerclick",(function(){t.completeLink(),t.updateWaypoints(),t.updateWaypoints.flush(),t.updateDefinitionLinks&&t.updateDefinitionLinks(),t.linkView&&["processmaker-modeler-association","processmaker-modeler-data-input-association"].includes(t.shape.component.node.type)&&t.$parent.multiplayerHook(t.shape.component.node,!1),t.$emit("save-state")})),this.shape.listenToOnce(this.paper,"cell:mouseleave",(function(){t.paper.el.addEventListener("mousemove",t.updateLinkTarget),t.shape.stopListening(t.paper,"cell:pointerclick"),Nt(t.target),t.$emit("set-cursor","not-allowed")}))},removeLink:function(){this.$emit("remove-node",this.node),this.resetPaper()},resetPaper:function(){this.$emit("set-cursor",null),this.paper.el.removeEventListener("mousemove",this.updateLinkTarget),this.paper.setInteractivity(this.graph.get("interactiveFunc")),this.target&&Nt(this.target)},getAnchorPointFunction:function(e){return"source"===e?this.sourceShape.component.anchorPointFunction||this.anchorPointFunction:"target"===e?this.target.component.anchorPointFunction||this.anchorPointFunction:void 0},setupLinkTools:function(){var e=new F.linkTools.Vertices,t=new F.linkTools.SourceAnchor({snap:this.getAnchorPointFunction("source")}),n=new F.linkTools.TargetAnchor({snap:this.getAnchorPointFunction("target")}),r=new F.dia.ToolsView({tools:[e,t,n]});this.shapeView.addTools(r),this.shapeView.hideTools()},emitSave:function(){this.highlighted&&(this.updateWaypoints.flush(),document.removeEventListener("mouseup",this.emitSave),this.listeningToMouseup=!1)}},created:function(){this.updateWaypoints=Y()(this.updateWaypoints,100),this.emitSave.bind(this)},mounted:function(){var e=this;return l(a().mark((function t(){var n,r,o,i,s,c,l,d,u,h,p,f,m,g;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:if(e.sourceShape=e.findSourceShape(),e.setSource(e.sourceShape),e.$once("click",(function(){e.$nextTick((function(){Un.getters.isReadOnly||e.setupLinkTools()}))})),n=e.getTargetRef?e.getTargetRef():e.node.definition.get("targetRef"),n){t.next=8;break}return t.abrupt("return");case 8:n.id?(r=e.graph.getElements().find((function(e){return e.component&&e.component.node.definition===n})),e.target=r,o=e.node.diagram.waypoint,i=e.node.diagram.waypoint[0],s=o[o.length-1],c=r.position(),l=c.x,d=c.y,u={x:s.x-l,y:s.y-d},h=e.sourceShape.position(),p=h.x,f=h.y,m={x:i.x-p,y:i.y-f},o&&(g=o.slice(1,o.length-1).map((function(e){var t=e.x,n=e.y;return{x:t,y:n}})),e.shape.vertices(g)),e.setSource(e.sourceShape,m),e.setTarget(r,u),e.completeLink()):(e.setTarget(n),e.paper.setInteractivity(!1),e.paper.el.addEventListener("mousemove",e.updateLinkTarget),e.$emit("set-cursor","not-allowed"),e.isValidConnection?e.shape.stopListening(e.paper,"blank:pointerdown link:pointerdown element:pointerdown",e.removeLink):e.shape.listenToOnce(e.paper,"blank:pointerdown link:pointerdown element:pointerdown",e.removeLink)),e.updateRouter(),e.shape.on("change:vertices",(function(){this.component.$emit("shape-resize")})),Un.getters.isReadOnly&&e.$nextTick((function(){e.paperManager.awaitScheduledUpdates().then((function(){e.setShapeHighlight()}))}));case 12:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){document.removeEventListener("mouseup",this.emitSave)},destroyed:function(){this.updateWaypoints.cancel()}},Qn=f.p+"img/association-head.0b14da7b.svg",er="processmaker-modeler-association",tr="bpmn:Association",nr={none:"None",one:"One",both:"Both"};function rr(e){return e.create(tr,{associationDirection:nr.none,targetRef:{x:void 0,y:void 0}})}function or(e){return e.create("bpmndi:BPMNEdge")}var ir=function(){var e=this,t=e._self._c;return e.showCrownConfig?t("div",{staticClass:"crown-config",style:e.style,attrs:{role:"menu"}},[e._t("default"),t("association-flow-button",e._g({attrs:{node:e.node,moddle:e.moddle,shape:e.shape},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("generic-flow-button",e._g({attrs:{node:e.node,"node-registry":e.nodeRegistry,moddle:e.moddle},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("data-association-flow-button",e._g({attrs:{node:e.node,moddle:e.moddle,shape:e.shape},on:{"toggle-crown-state":function(t){e.showCrown=t}}},e.$listeners)),t("default-flow",e._g({attrs:{node:e.node}},e.$listeners)),t("crown-dropdowns",e._g({attrs:{"dropdown-data":e.dropdownData,"hide-color-dropdown":e.hideColorDropdown,"boundary-event-dropdown-data":e.boundaryEventDropdownData,node:e.node,"node-registry":e.nodeRegistry,moddle:e.moddle,shape:e.shape,"task-dropdown-initially-open":e.taskDropdownInitiallyOpen,showCustomIconPicker:e.showCustomIconPicker,iconName:e.iconName},on:{"replace-node-type":e.replaceNodeTypePrompt}},e.$listeners)),t("copy-button",e._g({attrs:{node:e.node}},e.$listeners)),t("clone-button",e._g({attrs:{node:e.node}},e.$listeners)),t("delete-button",e._g({attrs:{graph:e.graph,shape:e.shape,node:e.node}},e.$listeners)),t("preview-button",e._g({attrs:{graph:e.graph,shape:e.shape,node:e.node}},e.$listeners)),t("b-modal",{ref:"modal",attrs:{"no-fade":e.runningInCypressTest,id:"modal-prevent-closing",title:e.$t("Change Type"),"ok-title":e.$t("Confirm"),"cancel-title":e.$t("Cancel")},on:{hidden:function(t){e.showReplaceModal=!1},ok:e.confirmedReplaceNodeType},model:{value:e.showReplaceModal,callback:function(t){e.showReplaceModal=t},expression:"showReplaceModal"}},[t("p",[e._v(e._s(e.$t("Changing this type will replace your current configuration")))])])],2):e._e()},sr=[],ar=(f(47941),function(){var e=this,t=e._self._c;return e.displayIcon?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Preview"),role:"menuitem",id:"preview-button","aria-label":"Preview","data-test":"preview-button"},on:{click:function(t){return e.preview()}}},[t("i",{staticClass:"fas fa-eye cog-container--button"})]):e._e()}),cr=[],lr=(f(85827),f.p+"img/trash-alt-solid.9d41abd9.svg"),dr=function(){var e=this,t=e._self._c;return t("button",e._g({staticClass:"crown-button",attrs:{id:e.id,"aria-label":e.ariaLabel}},e.$listeners),[e._t("default",(function(){return[t("img",{staticClass:"crown-icon",attrs:{src:e.src,width:"width",height:"height"}})]}))],2)},ur=[],hr={props:{id:String,ariaLabel:String,src:String,width:{type:Number,default:19},height:{type:Number,default:20}}},pr=hr;f(21353);function fr(e,t,n,r,o,i,s,a){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=a?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var d=l.render;l.render=function(e,t){return c.call(t),d(e,t)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:e,options:l}}var mr=fr(pr,dr,ur,!1,null,"09d8a8ac",null),gr=mr.exports,vr=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],br=vr,yr={components:{CrownButton:gr},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lr,validPreviewElements:br,displayIcon:!1}},mounted:function(){var e=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})},t=e(this.node),n=window.ProcessMaker.$modeler.previewConfigs.find((function(e){return e.matcher(t)}));this.displayIcon=!!n},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{preview:function(){window.ProcessMaker.$modeler.isOpenPreview?window.ProcessMaker.$modeler.isOpenPreview=!1:this.$emit("previewNode",this.node)}}},wr=yr,xr=fr(wr,ar,cr,!1,null,null,null),kr=xr.exports,Cr=function(){var e=this,t=e._self._c;return t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Delete"),role:"menuitem",id:"delete-button","aria-label":"Delete this node"},on:{click:function(t){e.isPoolLane?e.removePoolLaneShape():e.removeShape()}}},[t("i",{staticClass:"fas fa-trash-alt cog-container--button"})])},Sr=[],Er=f(50467),Ar=f.n(Er),_r="processmaker-modeler-data-output-association",Tr="bpmn:DataOutputAssociation";function Mr(e){return e.create("bpmn:DataOutputAssociation",{targetRef:{x:void 0,y:void 0}})}function Pr(e){return e.create("bpmndi:BPMNEdge")}var Ir="processmaker-modeler-data-input-association",Or="bpmn:DataInputAssociation";function Dr(e){return e.create("bpmn:DataInputAssociation",{targetRef:{x:void 0,y:void 0}})}function Nr(e){return e.create("bpmndi:BPMNEdge")}function Rr(e,t){var n=this,r=e.getConnectedLinks(t);r.forEach((function(e){return n.$emit("remove-node",e.component.node)}))}function Br(e,t){e.definition.incoming&&e.definition.incoming.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));t.removeNode(n)})),e.definition.outgoing&&e.definition.outgoing.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));t.removeNode(n)}))}function Lr(e,t){var n=t.nodes.filter((function(t){return!(!t.definition.sourceRef||t.definition.sourceRef!==e.definition)||(!(!t.definition.targetRef||t.definition.targetRef!==e.definition)||void 0)}));n.forEach((function(e){t.removeNode(e)}))}function jr(e,t){var n=t.nodes.filter((function(t){return!(!t.definition.sourceRef||t.definition.sourceRef!==e.definition)||(!(!t.definition.targetRef||t.definition.targetRef!==e.definition)||void 0)}));n.forEach((function(e){t.removeNode(e)}))}function Fr(e,t,n){var r=e.getCells().find((function(e){return e.component&&e.component.node===t}));r&&r.getEmbeddedCells({deep:!0}).filter((function(e){return e.component&&e.component.node.isBpmnType("bpmn:BoundaryEvent")})).forEach((function(t){e.getConnectedLinks(t).forEach((function(e){return n(e.component.node)})),n(t.component.node)}))}function zr(e){if(!e.isBpmnType(Tr,Or)){var t=e.definition,n=t.sourceRef,r=t.targetRef;n&&(0,Er.pull)(n.get("outgoing"),e.definition),r&&r.id&&(0,Er.pull)(r.get("incoming"),e.definition)}}function Ur(e){var t=(0,Er.get)(e,"definition.sourceRef.default.id",null);t&&t===e.id&&e.definition.sourceRef.set("default",null)}function qr(e,t,n){if("bpmn:DataObjectReference"!==n.$type&&"bpmn:DataStoreReference"!==n.$type)throw"Source node must be a DataObjectReference or bpmn:DataStoreReference, got "+n.$type;var r=n.id,o="data_input_".concat(r);t.definition.ioSpecification||(t.definition.ioSpecification=e.create("bpmn:InputOutputSpecification",{dataInputs:[],dataOutputs:[],inputSets:[],outputSets:[]}),t.definition.ioSpecification.$parent=t.definition),t.definition.ioSpecification.dataInputs||t.definition.ioSpecification.set("dataInputs",[]);var i=t.definition.ioSpecification.dataInputs.find((function(e){return e.id===o}));i||(t.definition.ioSpecification.dataInputs.push(e.create("bpmn:DataInput",{id:o,isCollection:"false",name:n.name})),t.definition.ioSpecification.dataInputs[t.definition.ioSpecification.dataInputs.length-1].$parent=t.definition.ioSpecification,t.definition.ioSpecification.set("dataInputs",t.definition.ioSpecification.dataInputs)),i=t.definition.ioSpecification.dataInputs.find((function(e){return e.id===o})),t.definition.ioSpecification.outputSets||t.definition.ioSpecification.set("outputSets",[e.create("bpmn:OutputSet",{dataOutputRefs:[]})]);var s=t.definition.ioSpecification.outputSets[0];s||t.definition.ioSpecification.set("outputSets",[e.create("bpmn:OutputSet",{dataOutputRefs:[]})]),s=t.definition.ioSpecification.outputSets[0],t.definition.ioSpecification.inputSets||t.definition.ioSpecification.set("inputSets",[e.create("bpmn:InputSet",{dataInputRefs:[]})]);var a=t.definition.ioSpecification.inputSets[0];a||t.definition.ioSpecification.set("inputSets",[e.create("bpmn:InputSet",{dataInputRefs:[]})]),a=t.definition.ioSpecification.inputSets[0];var c=a.get("dataInputRefs").find((function(e){return e.id===o}));return c||a.dataInputRefs.push(i),i}function Vr(e,t){var n,r=e.$parent;return r||(null===(n=t.nodes.find((function(t){var n;return t.definition.ioSpecification===e||(null===(n=t.definition.ioSpecification)||void 0===n?void 0:n.id)===e.id})))||void 0===n?void 0:n.definition)}function Hr(e,t){if("bpmn:DataObjectReference"!==t.$type&&"bpmn:DataStoreReference"!==t.$type)throw"Source node must be a DataObjectReference or bpmn:DataStoreReference, got "+t.$type;var n=t.id,r="data_input_".concat(n);if(e.definition.ioSpecification&&e.definition.ioSpecification.dataInputs){var o=e.definition.ioSpecification.dataInputs.find((function(e){return e.id===r}));if(o&&((0,Er.pull)(e.definition.ioSpecification.dataInputs,o),e.definition.ioSpecification.inputSets)){var i=e.definition.ioSpecification.inputSets[0];if(i){var s=i.dataInputRefs.find((function(e){return e.id===r}));if(s&&(0,Er.pull)(i.dataInputRefs,s),0===i.dataInputRefs.length&&delete e.definition.ioSpecification.inputSets,e.definition.ioSpecification.outputSets){var a=e.definition.ioSpecification.outputSets[0];!a||a.dataOutputRefs&&0!==a.dataOutputRefs.length||delete e.definition.ioSpecification.outputSets}e.definition.ioSpecification.inputSets||e.definition.ioSpecification.outputSets||delete e.definition.ioSpecification}}}}var Wr={components:{CrownButton:gr},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lr}},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{removeFlows:Rr,removeShape:function(){this.removeFlows(this.graph,this.shape),this.$emit("remove-node",this.node)},removePoolLaneShape:function(){var e=this;this.$emit("remove-node",this.node);var t=this.node.pool.component,n=t.sortedLanes();2!==n.length?this.shape!==n[n.length-1]?t.fillLanes(this.shape,"bottom-right",!0):t.fillLanes(this.shape,"top-right",!0):this.$emit("remove-node",n.filter((function(t){return t!==e.shape}))[0].component.node)}}},Gr=Wr,$r=fr(Gr,Cr,Sr,!1,null,null,null),Xr=$r.exports,Yr=function(){var e=this,t=e._self._c;return e.allowOutgoingSequenceFlow?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Flow"),id:"generic-flow-button","aria-label":"Create a flow",role:"menuitem"},on:{click:e.addSequence}},[t("font-awesome-icon",{attrs:{icon:["fpm","fa-connect-elements"]}})],1):e._e()},Jr=[],Zr=f.p+"img/connect-elements.ab6af00f.svg";f(38880),f(49337);function Kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kr(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}f(15306);var eo={"processmaker-modeler-start-event":"Start Event","processmaker-modeler-start-timer-event":"Start Timer Event","processmaker-modeler-signal-start-event":"Signal Start Event","processmaker-modeler-message-start-event":"Message Start Event","processmaker-modeler-conditional-start-event":"Conditional Start Event"},to=eo,no={"processmaker-modeler-end-event":"End Event","processmaker-modeler-error-end-event":"Error End Event","processmaker-modeler-message-end-event":"Message End Event","processmaker-modeler-signal-end-event":"Signal End Event","processmaker-modeler-terminate-end-event":"Terminate End Event"},ro=no,oo={"processmaker-modeler-task":"Form Task","processmaker-modeler-manual-task":"Manual Task","processmaker-modeler-script-task":"Script Task","processmaker-modeler-call-activity":"Sub Process","processmaker-modeler-data-object":"Data Object","processmaker-modeler-data-store":"Data Store"},io=oo,so={"processmaker-modeler-exclusive-gateway":"Exclusive Gateway","processmaker-modeler-inclusive-gateway":"Inclusive Gateway","processmaker-modeler-parallel-gateway":"Parallel Gateway","processmaker-modeler-event-based-gateway":"Event Based Gateway"},ao=so,co={"processmaker-modeler-intermediate-catch-timer-event":"Intermediate Timer Event","processmaker-modeler-intermediate-signal-catch-event":"Intermediate Signal Catch Event","processmaker-modeler-intermediate-signal-throw-event":"Intermediate Signal Throw Event","processmaker-modeler-intermediate-message-catch-event":"Intermediate Message Catch Event","processmaker-modeler-intermediate-message-throw-event":"Intermediate Message Throw Event","processmaker-modeler-intermediate-conditional-catch-event":"Intermediate Conditional Catch Event"},lo=co,uo=f(50361),ho=f.n(uo),po=function(){function e(t,n,r){d(this,e),y(this,"type",void 0),y(this,"definition",void 0),y(this,"diagram",void 0),y(this,"pool",void 0),this.type=t,this.definition=n,this.diagram=r}return g(e,[{key:"isBpmnType",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.includes(this.definition.$type)}},{key:"canBeDefaultFlow",value:function(){var e=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"];return"bpmn:SequenceFlow"===this.definition.$type&&e.includes(this.definition.sourceRef.$type)}},{key:"isType",value:function(e){return this.type===e}},{key:"isStartEvent",value:function(){return Object.keys(to).includes(this.type)}},{key:"isEndEvent",value:function(){return Object.keys(ro).includes(this.type)}},{key:"isTask",value:function(){return Object.keys(io).includes(this.type)}},{key:"isGateway",value:function(){return Object.keys(ao).includes(this.type)}},{key:"isIntermediateEvent",value:function(){return Object.keys(lo).includes(this.type)}},{key:"id",get:function(){return this.definition.id},set:function(e){this.definition.id=e}},{key:"setIds",value:function(e,t){var n,r,o=this,i=t?[t,t+"_di"]:e.generate(),s=jt(i,2),a=s[0],c=s[1];if(this.id||(this.id=a),this.diagram&&(this.diagram.id=c,this.diagram.bpmnElement=this.definition),this.definition.loopCharacteristics&&"bpmn:StandardLoopCharacteristics"===this.definition.loopCharacteristics.$type&&(this.definition.loopCharacteristics.set("id",e.generate()[0]),this.definition.loopCharacteristics.loopCondition&&this.definition.loopCharacteristics.get("loopCondition").set("id",e.generate()[0])),this.definition.ioSpecification){this.definition.ioSpecification.set("id",e.generate()[0]);var l=this.definition.id;this.definition.ioSpecification.get("dataInputs")&&this.definition.ioSpecification.get("dataInputs").forEach((function(t){var r=t.get("id");r.substring(0,o.cloneOf.length)===o.cloneOf?(t.set("id",r.replace(o.cloneOf+"_",l+"_")),n=t):t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("dataOutputs")&&this.definition.ioSpecification.get("dataOutputs").forEach((function(t){var n=t.get("id");n.substring(0,o.cloneOf.length)===o.cloneOf?(t.set("id",n.replace(o.cloneOf+"_",l+"_")),r=t):t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("inputSets")&&this.definition.ioSpecification.get("inputSets").forEach((function(t){t.set("id",e.generate()[0])})),this.definition.ioSpecification.get("outputSets")&&this.definition.ioSpecification.get("outputSets").forEach((function(t){t.set("id",e.generate()[0])}))}this.definition.loopCharacteristics&&"bpmn:MultiInstanceLoopCharacteristics"===this.definition.loopCharacteristics.$type&&(this.definition.loopCharacteristics.set("id",e.generate()[0]),this.definition.loopCharacteristics.loopCardinality&&this.definition.loopCharacteristics.get("loopCardinality").set("id",e.generate()[0]),this.definition.loopCharacteristics.loopDataInputRef&&n&&this.definition.loopCharacteristics.set("loopDataInputRef",n),this.definition.loopCharacteristics.loopDataOutputRef&&r&&this.definition.loopCharacteristics.set("loopDataOutputRef",r),this.definition.loopCharacteristics.inputDataItem&&this.definition.loopCharacteristics.get("inputDataItem").set("id",e.generate()[0]),this.definition.loopCharacteristics.outputDataItem&&this.definition.loopCharacteristics.get("outputDataItem").set("id",e.generate()[0]),this.definition.loopCharacteristics.completionCondition&&this.definition.loopCharacteristics.get("completionCondition").set("id",e.generate()[0]))}},{key:"clone",value:function(t,n,r){var o=this,i=t[this.type].definition(n,r),a=t[this.type].diagram(n),c=new this.constructor(this.type,i,a);return c.id=null,c.pool=this.pool,c.cloneOf=this.id,e.diagramPropertiesToCopy.forEach((function(e){return c.diagram.bounds[e]=o.diagram.bounds[e]})),Object.keys(this.definition).filter((function(t){return!e.definitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=o.definition.get(e),n="object"===s(t)?ho()(t):t;if("eventDefinitions"===e)for(var r in n)t[r].signalRef&&!n[r].signalRef&&n[r].set("signalRef",Qr({},t[r].signalRef));c.definition.set(e,n)})),e.eventDefinitionPropertiesToNotCopy.forEach((function(e){return c.definition.eventDefinitions&&c.definition.eventDefinitions[0]&&Object.hasOwn(c.definition.eventDefinitions[0],e)&&c.definition.eventDefinitions[0].set(e,null)})),c}},{key:"cloneFlow",value:function(t,n,r){var o=this,i=t[this.type].definition(n,r),a=t[this.type].diagram(n),c=new this.constructor(this.type,i,a);return c.id=null,c.pool=this.pool,c.cloneOf=this.id,c.diagram=n.create("bpmndi:BPMNEdge",{waypoint:[]}),this.diagram.waypoint.forEach((function(e){var t=n.create("dc:Point",{x:e.x,y:e.y});c.diagram.waypoint.push(t)})),Object.keys(this.definition).filter((function(t){return!e.flowDefinitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=o.definition.get(e),n="object"===s(t)?ho()(t):t;if("eventDefinitions"===e)for(var r in n)t[r].signalRef&&!n[r].signalRef&&n[r].set("signalRef",Qr({},t[r].signalRef));c.definition.set(e,n),c.definition.set("sourceRef",null),c.definition.set("targetRef",null)})),e.eventDefinitionPropertiesToNotCopy.forEach((function(e){return c.definition.eventDefinitions&&c.definition.eventDefinitions[0]&&Object.hasOwn(c.definition.eventDefinitions[0],e)&&c.definition.eventDefinitions[0].set(e,null)})),c}},{key:"getTargetProcess",value:function(e,t){var n=this;return this.pool?e.find((function(e){var t=e.id;return t===n.pool.component.node.definition.get("processRef").id})):t.definition}}],[{key:"isTimerType",value:function(e){return["processmaker-modeler-start-timer-event","processmaker-modeler-intermediate-catch-timer-event"].includes(e)}}]),e}();y(po,"diagramPropertiesToCopy",["x","y","width","height"]),y(po,"definitionPropertiesToNotCopy",["$type","id","dataOutputAssociations"]),y(po,"flowDefinitionPropertiesToNotCopy",["$type","id","sourceRef","targetRef"]),y(po,"eventDefinitionPropertiesToNotCopy",["errorRef","messageRef"]);var fo="processmaker-modeler-generic-flow",mo=f(65554),go={prefix:"fpm",iconName:"fa-boundary-event",icon:[112,112,[],"e001","M51.739 2.056c-13.026.848-25.131 6.341-34.43 15.625C10.84 24.139 6.603 30.987 3.72 39.642.81 48.38.051 56.948 1.392 65.92c.932 6.232 3.501 13.807 6.441 18.991 8.903 15.7 23.772 25.701 41.487 27.903 2.517.312 9.393.312 11.911 0 17.703-2.201 32.617-12.231 41.488-27.903 2.943-5.2 5.508-12.763 6.439-18.991 1.698-11.359-.064-22.783-5.13-33.257-4.913-10.156-13.314-18.932-23.21-24.247-7.159-3.845-14.191-5.854-22.286-6.365-3.224-.204-3.584-.204-6.793.005m8.216 4.091c8.319.827 15.946 3.548 22.891 8.165 3.153 2.096 5.414 3.998 8.35 7.021 7.582 7.807 12.34 17.536 14.049 28.731.423 2.764.572 9.015.29 12.1-.962 10.515-4.848 20.143-11.415 28.286-1.857 2.303-5.901 6.293-8.136 8.029a50.9 50.9 0 0 1-23.544 10.144c-3.182.489-11.148.489-14.33 0-5.812-.893-11.669-2.875-16.75-5.668-11.303-6.213-20.134-17.022-24.092-29.49-3.259-10.266-3.259-21.647 0-31.913a51.37 51.37 0 0 1 11.995-20.128c2.834-2.93 5.301-5.008 8.426-7.097a49.964 49.964 0 0 1 22.654-8.169c2.192-.225 7.401-.231 9.612-.011m-9.053 12.099c-20.419 2.322-35.641 19.091-35.641 39.263 0 14.657 8.112 27.984 21.217 34.859 14.221 7.46 31.65 5.768 44.132-4.283 14.219-11.449 18.699-30.977 10.879-47.42-5.522-11.611-16.451-19.808-29.421-22.068-2.55-.444-8.659-.636-11.166-.351m6.979 3.906c1.382.105 3.214.321 4.071.481 12.854 2.394 23.482 11.579 27.55 23.808 4.141 12.449 1.019 26.046-8.153 35.508-5.615 5.792-12.307 9.26-20.584 10.667-2.565.436-8.414.436-10.98 0-11.016-1.872-19.998-7.889-25.586-17.14-5.178-8.573-6.354-19.406-3.15-29.035 4.492-13.506 16.952-23.186 31.248-24.278 2.856-.218 2.85-.218 5.584-.011"]},vo={prefix:"fpm",iconName:"fa-connect-elements",icon:[20,20,[],"e002","M0 2.502v2.501h5.003V3.008h5.004v15.01h5.478V19c0 .54.011.981.024.981.053-.001 2.989-2.477 2.964-2.499a203.517 203.517 0 0 0-2.942-2.429c-.04-.016-.046.116-.046.967v.985h-4.497V1.995H5.003V0H0v2.502m3.99.016v1.504H1.013V1.013H3.99v1.505"]},bo={prefix:"fpm",iconName:"fa-lane-above",icon:[26,18,[],"e003","M0 .997v.996h.997V.997h1.04V0H0v.997M2.99.498v.499h2.037V0H2.99v.498m2.99 0v.499h2.037V0H5.98v.498m3.033 0v.499h1.994V0H9.013v.498m2.99 0v.499h1.994V0h-1.994v.498m2.99 0v.499h1.994V0h-1.994v.498m2.99 0v.499h2.037V0h-2.037v.498m2.99 0v.499h2.037V0h-2.037v.498m2.99 0v.499h1.04v.996H26V0h-2.037v.498M0 3.987v.996h.997V2.99H0v.997m25.003 0v.996H26V2.99h-.997v.997M0 11.982v6.001h26V5.98H0v6.002"]},yo={prefix:"fpm",iconName:"fa-lane-below",icon:[26,18,[],"e004","M0 6.002v6.001h26V0H0v6.002m0 7.995v.996h.997V13H0v.997m25.003 0v.996H26V13h-.997v.997M0 16.987v.996h2.037v-.996H.997v-.997H0v.997m25.003-.499v.499h-1.04v.996H26V15.99h-.997v.498m-22.013.997v.498h2.037v-.996H2.99v.498m2.99 0v.498h2.037v-.996H5.98v.498m3.033 0v.498h1.994v-.996H9.013v.498m2.99 0v.498h1.994v-.996h-1.994v.498m2.99 0v.498h1.994v-.996h-1.994v.498m2.99 0v.498h2.037v-.996h-2.037v.498m2.99 0v.498h2.037v-.996h-2.037v.498"]},wo={prefix:"fpm",iconName:"fa-center-horizontally",icon:[24,24,[],"e001","M11.04 4.88v1.88H7.28v3.92h3.76v3.28H5v3.92h6.04v3.76h1v-3.76h6.04v-3.92h-6.04v-3.28h3.76V6.76h-3.76V3h-1v1.88"]},xo={prefix:"fpm",iconName:"fa-center-vertically",icon:[24,24,[],"e001","M6.76 8.04v3.04H3v.96h3.76v6.04h3.92v-6.04h3.28v3.76h3.92v-3.76h3.76v-.959l-1.87-.011-1.87-.01-.01-1.89-.011-1.89H13.96v3.801l-1.63-.011-1.63-.01-.01-3.03L10.679 5H6.76v3.04"]},ko={prefix:"fpm",iconName:"fa-align-left",icon:[24,24,[],"e001","M4 12.32v9.32h1V3H4v9.32m2.28-3.6v1.96h8.52V6.76H6.28v1.96m0 7.2v1.96h13.08v-3.92H6.28v1.96"]},Co={prefix:"fpm",iconName:"fa-align-right",icon:[24,24,[],"e001","M18.4 12.32v9.32h1V3h-1v9.32m-9.8-3.6v1.96h8.48V6.76H8.6v1.96M4 15.92v1.96h13.08v-3.92H4v1.96"]},So={prefix:"fpm",iconName:"fa-align-bottom",icon:[24,24,[],"e001","M6.76 10.54v6.54h3.92V4H6.76v6.54m7.2 2.3v4.24h3.92V8.6h-3.92v4.24M3 18.9v.5h18.64v-1H3v.5"]},Eo={prefix:"fpm",iconName:"fa-align-top",icon:[24,24,[],"e001","M3 4.5V5h18.64V4H3v.5m3.76 8.32v6.54h3.92V6.28H6.76v6.54m7.2-2.28v4.26h3.92V6.28h-3.92v4.26"]},Ao={prefix:"fpm",iconName:"fa-distribute-horizontally",icon:[24,24,[],"e001","M3 12.32v9.32h.96V3H3v9.32m17 0v9.32h1V3h-1v9.32m-10.44.02v6.54h4.88V5.8H9.56v6.54"]},_o={prefix:"fpm",iconName:"fa-distribute-vertically",icon:[24,24,[],"e001","M3 3.5V4h18.64V3H3v.5M5.8 12v2.44h13.08V9.56H5.8V12M3 20.52V21h18.64v-.96H3v.48"]},To=f(39865),Mo=["processmaker-modeler-data-object","processmaker-modeler-data-store","processmaker-modeler-lane","processmaker-modeler-end-event","processmaker-modeler-error-end-event","processmaker-modeler-signal-end-event","processmaker-modeler-terminate-end-event","processmaker-modeler-text-annotation","processmaker-modeler-sequence-flow","processmaker-modeler-message-flow"],Po={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},props:["node","moddle","nodeRegistry"],data:function(){return{sequenceFlow:Zr}},computed:{paper:function(){return Un.getters.paper},sequenceFlowConfig:function(){return this.nodeRegistry[fo]},nodeConfig:function(){return this.nodeRegistry[this.node.type]},allowOutgoingSequenceFlow:function(){var e=this;return!Mo.some((function(t){return e.node.isType(t)}))}},methods:{addSequence:function(e,t,n,r){this.$emit("toggle-crown-state",!1);var o=e.clientX,i=e.clientY,s=null;e&&(s=(0,F.V)(this.paper.viewport).toLocalPoint(o,i));var a=this.moddle.create("bpmn:SequenceFlow",{name:"",sourceRef:this.node.definition,targetRef:{x:n||s.x,y:r||s.y}});this.$emit("add-node",new po(fo,a,this.moddle.create("bpmndi:BPMNEdge")))}},created:function(){this.$t=this.$t.bind(this),mo.library.add(vo)}},Io=Po,Oo=fr(Io,Yr,Jr,!1,null,null,null),Do=Oo.exports,No=function(){var e=this,t=e._self._c;return e.node.isType("processmaker-modeler-text-annotation")?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Association Flow"),id:"association-flow-button","aria-label":"Add association flow",role:"menuitem"},on:{click:e.addAssociation}},[t("img",{attrs:{src:e.connectIcon,"aria-hidden":"true"}})]):e._e()},Ro=[],Bo=f.p+"img/connect-artifacts.e3e5e73f.svg",Lo={components:{CrownButton:gr},props:["node","moddle","shape"],data:function(){return{connectIcon:Bo}},methods:{addAssociation:function(e,t,n,r){this.$emit("toggle-crown-state",!1);var o=this.moddle.create("bpmn:Association",{sourceRef:this.shape.component.node.definition,targetRef:{x:n,y:r},associationDirection:nr.none});this.$emit("add-node",new po("processmaker-modeler-association",o,this.moddle.create("bpmndi:BPMNEdge")))}}},jo=Lo,Fo=fr(jo,No,Ro,!1,null,null,null),zo=Fo.exports,Uo=function(){var e=this,t=e._self._c;return e.allowOutgoingDataAssociationFlow?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Data Association Flow"),id:"association-flow-button","aria-label":"Add association flow",role:"menuitem"},on:{click:e.addDataAssociation}},[t("img",{attrs:{src:e.connectIcon,"aria-hidden":"true"}})]):e._e()},qo=[];function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}function Ho(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vo(e,t)}f(12419),f(81299);function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Go(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function $o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xo(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $o(e)}function Yo(e){var t=Go();return function(){var n,r=Wo(e);if(t){var o=Wo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xo(this,n)}}var Jo="processmaker-modeler-pool",Zo=function(){function e(t,n,r){d(this,e),y(this,"nodeRegistry",void 0),y(this,"moddle",void 0),y(this,"paper",void 0),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){throw new Error("Best practice is to implement 'makeFlowDefinition' in each class")}}],[{key:"isValid",value:function(e,t,n){throw new Error("Best practice is to implement 'isValid' in each class")}},{key:"hasTargetType",value:function(e){return null!=$()(e,"component.node.type")}},{key:"targetIsValidStartEventType",value:function(e){return!e.isBpmnType("bpmn:StartEvent")||e.isType("processmaker-modeler-message-start-event")}},{key:"targetIsValidIntermediateEventType",value:function(e){return!e.isBpmnType("bpmn:IntermediateCatchEvent")||e.isType("processmaker-modeler-intermediate-message-catch-event")}},{key:"targetIsValidBoundaryEventType",value:function(e){return!e.isBpmnType("bpmn:BoundaryEvent")||e.isType("processmaker-modeler-boundary-message-event")}},{key:"targetIsNotContainingPool",value:function(e,t){return e!==t.pool}},{key:"targetIsInDifferentPool",value:function(t,n){var r=e.shapeIsPool(t)?t:t.component.node.pool,o=e.shapeIsPool(n)?n:n.component.node.pool;return null!=o&&o!==r}},{key:"targetIsNotSource",value:function(e,t){return e.id!==t.id}},{key:"allowOutgoingFlow",value:function(e,t){return!("allowOutgoingFlow"in e)||e.allowOutgoingFlow(t)}},{key:"shapeIsPool",value:function(e){var t=$()(e,"component.node.type");return t===Jo}}]),e}(),Ko=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,null,[{key:"isADataNode",value:function(e){return e.isBpmnType.apply(e,W(n.dataNodeTypes))}},{key:"isNodeDisallowedFromDataAssociation",value:function(e){return e.isBpmnType.apply(e,W(n.disallowedNodes))}}]),n}(Zo);y(Ko,"dataNodeTypes",["bpmn:DataStoreReference","bpmn:DataObjectReference"]),y(Ko,"disallowedNodes",["bpmn:EndEvent","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation","bpmn:Association"]);var Qo={components:{CrownButton:gr},props:["node","moddle","shape"],data:function(){return{connectIcon:Bo}},computed:{paper:function(){return Un.getters.paper},allowOutgoingDataAssociationFlow:function(){return Ko.isADataNode(this.node)}},methods:{addDataAssociation:function(n,r,o){this.$emit("toggle-crown-state",!1);var i=n.clientX,s=n.clientY,a=null;n&&(a=(0,F.V)(this.paper.viewport).toLocalPoint(i,s));var c=this.node.isBpmnType("bpmn:DataStoreReference","bpmn:DataObjectReference"),l=c?t:e,d=l.definition(this.moddle),u=new po(l.id,d,l.diagram(this.moddle));u.dataAssociationProps={sourceShape:this.shape,targetCoords:{x:r||a.x,y:o||a.y}},this.$emit("add-node",u)}}},ei=Qo,ti=fr(ei,Uo,qo,!1,null,null,null),ni=ti.exports,ri=function(){var e,t=this,n=t._self._c;return(e=t.node).isBpmnType.apply(e,W(t.validCopyElements))?n("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:t.$t("Copy Element"),"aria-label":"Copy Element","data-test":"copy-button",role:"menuitem"},on:{click:t.copyElement}},[n("i",{staticClass:"fas fa-clipboard"})]):t._e()},oi=[],ii=f.p+"img/clipboard.06edfa02.svg",si=["bpmn:StartEvent","bpmn:IntermediateEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:ExclusiveGateway","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:Gateway","bpmn:EventBasedGateway","bpmn:TextAnnotation"],ai=si,ci={components:{CrownButton:gr},props:["node"],data:function(){return{copyCount:0,copyIcon:ii,validCopyElements:ai}},methods:{copyElement:function(){this.$emit("copy-element")}}},li=ci,di=fr(li,ri,oi,!1,null,null,null),ui=di.exports,hi=function(){var e,t=this,n=t._self._c;return(e=t.node).isBpmnType.apply(e,W(t.validCopyElements))?n("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:t.$t("Clone Element"),"aria-label":"Clone Element","data-test":"clone-button"},on:{click:t.cloneElement}},[n("i",{staticClass:"fas fa-paste"})]):t._e()},pi=[],fi=f.p+"img/copy-regular.67a8edbd.svg",mi={components:{CrownButton:gr},props:["node"],data:function(){return{copyCount:0,cloneIcon:fi,validCopyElements:ai}},methods:{cloneElement:function(){this.$emit("clone-element",this.node,++this.copyCount)}}},gi=mi,vi=fr(gi,hi,pi,!1,null,null,null),bi=vi.exports,yi=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"dropdown"}},[t("crown-task-dropdown",e._g({attrs:{"dropdown-data":e.dropdownData,"dropdown-open":e.taskDropdownOpen,node:e.node},on:{"toggle-dropdown-state":e.taskDropdownToggle}},e.$listeners)),t("crown-boundary-event-dropdown",e._g({attrs:{"dropdown-data":e.boundaryEventDropdownData,"dropdown-open":e.boundaryEventDropdownOpen,nodeRegistry:e.nodeRegistry,moddle:e.moddle,node:e.node,shape:e.shape},on:{"toggle-dropdown-state":e.boundaryEventDropdownToggle}},e.$listeners)),t("crown-color-dropdown",e._g({attrs:{hide:e.hideColorDropdown,"dropdown-open":e.colorDropdownOpen,node:e.node,showCustomIconPicker:e.showCustomIconPicker,iconName:e.iconName},on:{"toggle-dropdown-state":e.colorDropdownToggle}},e.$listeners))],1)},wi=[],xi=function(){var e=this,t=e._self._c;return e.dropdownData.length>0?t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",e._g({attrs:{"data-test":"select-type-dropdown",id:"dropdown-button","aria-label":"Select a type"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},e.$listeners),[t("i",{staticClass:"fas fa-cog"})]),e.dropdownOpen?t("ul",{staticClass:"element-list",attrs:{role:"list"}},e._l(e.dropdownData,(function(n){var r=n.label,o=n.nodeType,i=n.dataTest,s=n.disabled;return t("li",{key:o,staticClass:"element-list--item",attrs:{role:"listitem",id:o}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:e.isDisabled(s,e.node,o)},on:{click:function(t){return e.replaceNode({node:e.node,typeToReplaceWith:o})}}},[e._v(e._s(e.$t(r))+" ")]),e.isDisabled(s,e.node,o)?t("b-tooltip",{attrs:{target:o,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.$t(e.tooltip(s,e.node,o)))+" ")]):e._e()],1)})),0):e._e()],1):e._e()},ki=[],Ci={name:"CrownTaskDropdown",components:{CrownButton:gr},props:{dropdownData:Array,node:Object,dropdownOpen:{type:Boolean,required:!0}},methods:{isDisabled:function(e,t,n){return e&&(e instanceof Function?e.apply(this,[t,n]):e)},tooltip:function(e,t,n){return this.isDisabled(e,t,n)||""},replaceNode:function(e){e.node.type!==e.typeToReplaceWith?this.$emit("replace-node-type",e):this.$emit("toggle-dropdown-state",!1)}}},Si=Ci,Ei=(f(5648),fr(Si,xi,ki,!1,null,"31668547",null)),Ai=Ei.exports,_i=function(){var e=this,t=e._self._c;return e.dropdownData.length>0?t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",e._g({directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{id:"dropdown-button","aria-label":"Select a boundary event","data-test":"boundary-event-dropdown",title:e.$t("Boundary Events"),role:"menuitem"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-boundary-event"]}})],1),e.dropdownOpen?t("ul",{staticClass:"element-list",attrs:{role:"list"}},e._l(e.dropdownData,(function(n){var r=n.label,o=n.nodeType,i=n.dataTest,s=n.disabledLabel;return t("li",{key:o,staticClass:"element-list--item",attrs:{role:"listitem",id:o}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:!e.canAddBoundaryEventToTarget(o,e.shape)},on:{click:function(t){return e.addBoundaryEvent(o)}}},[e._v(e._s(e.$t(r))+" ")]),e.canAddBoundaryEventToTarget(o,e.shape)?e._e():t("b-tooltip",{attrs:{target:o,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.getErrorTooltipText(s))+" ")])],1)})),0):e._e()],1):e._e()},Ti=[],Mi=f.p+"img/boundary-event.40a868e9.svg",Pi=["bpmn:Task","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:SendTask","bpmn:ReceiveTask","bpmn:UserTask","bpmn:GlobalTask","bpmn:ManualTask","bpmn:CallActivity"];function Ii(e){return e&&Pi.some((function(t){return e.node.isBpmnType(t)}))}function Oi(e,t){return!(!t||!Ii(t.component))&&Ni(t)}function Di(e){return e&&e.node.isBpmnType("bpmn:CallActivity")}function Ni(e){return 0!==Dt(e).length}var Ri={name:"CrownBoundaryEventDropdown",components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},props:{dropdownOpen:{type:Boolean,required:!0},dropdownData:Array,nodeRegistry:Object,moddle:Object,node:Object,shape:Object},data:function(){return{boundaryEventIcon:Mi}},methods:{getErrorTooltipText:function(e){return 0===this.getEmptyBoundaryEventPositionsForShape(this.shape).length?"No available space":e},canAddBoundaryEventToTarget:Oi,getEmptyBoundaryEventPositionsForShape:Dt,addBoundaryEvent:function(e){if(this.$emit("toggle-dropdown-state",!1),this.canAddBoundaryEventToTarget(e,this.shape)){var t=this.nodeRegistry[e].definition(this.moddle,this.$t),n=this.nodeRegistry[e].diagram(this.moddle),r=Dt(this.shape)[0];n.bounds.x=r.x-n.bounds.width/2,n.bounds.y=r.y-n.bounds.height/2;var o=new po(e,t,n);o.pool=this.node.pool,o.fromCrown=!0,Un.commit("highlightNode",o),this.$emit("add-node",o)}}},created:function(){this.$t=this.$t.bind(this),mo.library.add(go)}},Bi=Ri,Li=(f(56073),fr(Bi,_i,Ti,!1,null,null,null)),ji=Li.exports,Fi=function(){var e=this,t=e._self._c;return e.hide?e._e():t("div",{staticClass:"cog-container",attrs:{role:"menuitem"}},[t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Open Color Palette"),"aria-label":e.$t("Open Color Palette"),role:"menuitem","data-test":"picker-dropdown-button"},on:{click:function(t){return e.$emit("toggle-dropdown-state",!e.dropdownOpen)}}},[t("i",{staticClass:"fas fa-palette"})]),e.dropdownOpen?t("div",{staticClass:"element-list color-list"},[e._l(e.colors.slice(0,4),(function(n){return t("button",{key:n,staticClass:"color-button",style:{backgroundColor:n},attrs:{type:"button","data-test":n},on:{click:function(t){e.selectedColor=n}}})})),e.showCustomIconPicker?t("button",{staticClass:"color-button p-0 fa fa-drafting-compass",attrs:{type:"button","data-test":"set-custom-icon"},on:{click:e.openIconSelector}}):t("div"),e._l(e.colors.slice(4,8),(function(n){return t("button",{key:n,staticClass:"color-button",style:{backgroundColor:n},attrs:{type:"button","data-test":n},on:{click:function(t){e.selectedColor=n}}})})),t("button",{staticClass:"color-button toggle-picker",attrs:{type:"button"},on:{click:function(t){e.colorPickerOpen=!e.colorPickerOpen}}}),t("button",{staticClass:"color-button p-0 fa fa-undo-alt",attrs:{type:"button","data-test":"clear-color"},on:{click:e.resetNodeStyling}}),e.colorPickerOpen?t("sketch-picker",{staticClass:"color-picker",attrs:{value:e.selectedColor||"#fff",presetColors:null},on:{input:e.setColorFromPicker}}):e._e()],2):e._e(),t("b-modal",{ref:"icon-selector-modal",attrs:{title:"Select a custom icon","cancel-title":"Reset to Default"},on:{cancel:e.resetCustomIcon}},[t("div",[t("icon-selector",{attrs:{value:e.iconName,"allow-custom":!1},on:{input:e.setCustomIcon}})],1)])],1)},zi=[],Ui=(f(27479),f(87714),f(82801),f(1174),f(94023)),qi=function(){var e=this,t=e._self._c;return t("div",{staticClass:"multiselect-icons"},[t("b-input-group",[t("multiselect",{ref:"multiselect",attrs:{"track-by":"value",label:"label","show-labels":!1,placeholder:e.placeholder,options:e.list,multiple:!1,searchable:!0,"internal-search":!1,"allow-empty":!1},on:{"search-change":e.onSearch,open:e.onOpen,close:e.onClose},scopedSlots:e._u([{key:"singleLabel",fn:function(n){return[n.option?t("span",[t("i",{staticClass:"fas fa-fw",class:"fa-"+n.option.value}),e._v(" "+e._s(n.option.label)+" ")]):e._e()]}},{key:"option",fn:function(n){return[t("div",{staticClass:"icon-square",on:{mouseover:function(t){return e.onHover(n.option)}}},[t("i",{staticClass:"fas fa-fw",class:"fa-"+n.option.value})])]}}]),model:{value:e.icon,callback:function(t){e.icon=t},expression:"icon"}},[t("template",{slot:"noResult"},[e.allowCustom?t("div",{staticClass:"multiselect-no-result text-muted my-2 text-center w-100"},[t("strong",[e._v(e._s(e.$t("No icons found.")))]),t("br"),e._v(" "+e._s(e.$t("Try a different search or"))+" "),t("br"),t("a",{staticClass:"text-primary link-upload",on:{click:e.triggerUpload}},[e._v(e._s(e.$t("upload a custom icon")))]),e._v(". ")]):t("div",{staticClass:"multiselect-no-result text-muted my-2 text-center w-100"},[t("strong",[e._v(e._s(e.$t("No icons found.")))]),t("br"),e._v(" "+e._s(e.$t("Try a different search."))+" ")])]),t("template",{slot:"placeholder"},[this.file?t("span",[e._v(" "+e._s(e.$t("Custom Icon File"))+" "),this.fileName?t("span",{staticClass:"text-muted"},[e._v("("+e._s(this.fileName)+")")]):e._e()]):e._e()])],2),e.allowCustom?t("b-input-group-append",{staticClass:"multiselect-icons-upload"},[t("file-upload-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:{title:e.$t("Upload Custom Icon")},expression:"{ title: $t('Upload Custom Icon') }"}],ref:"fileUploadButton",attrs:{accept:"image/png, image/svg+xml, image/gif",variant:"secondary"},model:{value:e.uploadedFile,callback:function(t){e.uploadedFile=t},expression:"uploadedFile"}},[t("i",{staticClass:"fas fa-fw fa-upload"})])],1):e._e()],1)],1)},Vi=[],Hi=(f(64765),f(69600),f(42238)),Wi=f.n(Hi),Gi=["search","search-plus","search-dollar","check-square","list","id-badge","clipboard-list","clipboard-check","clipboard","fire","fire-alt","star","dollar-sign","users","user-circle","trophy"],$i=["align-center","align-justify","align-left","align-right","arrows-alt","arrows-alt-h","arrows-alt-v","bars","beer","bong","border-all","border-none","border-style","cannabis","circle-notch","cog","cogs","compress","compress-alt","compress-arrows-alt","custom","democrat","disease","download","ellipsis-h","ellipsis-v","expand","expand-alt","expand-arrows-alt","faucet","file-download","file-export","file-import","file-upload","flag-usa","font-awesome-logo-full","grip-horizontal","grip-lines","grip-lines-vertical","grip-vertical","hand-holding-water","hand-middle-finger","hospital-user","joint","lungs","republican","upload"],Xi=function(){function e(){d(this,e)}return g(e,null,[{key:"list",value:function(){var e=this,t=[];Gi.forEach((function(n){Wi()[n]&&t.push(e.parseIcon(n,Wi()[n]))}));for(var n=0,r=Object.entries(Wi());n<r.length;n++){var o=jt(r[n],2),i=o[0],s=o[1];this.shouldIncludeIcon(i,s)&&t.push(this.parseIcon(i,s))}return t}},{key:"grouped",value:function(){for(var e=[{group:"Common",icons:[]},{group:"All Icons",icons:[]}],t=0,n=Object.entries(Wi());t<n.length;t++){var r=jt(n[t],2),o=r[0],i=r[1];$i.includes(o)||(Gi.includes(o)&&e[0].icons.push(this.parseIcon(o,i)),this.shouldIncludeIcon(o,i)&&e[1].icons.push(this.parseIcon(o,i)))}return e}},{key:"shouldIncludeIcon",value:function(e,t){var n=!1,r=["-left","-right","-up","-down"];return $i.includes(e)||Gi.includes(e)||t.styles.includes("solid")&&!t.changes.includes("5.13.0")&&(n=!0),r.forEach((function(t){e.includes(t)&&(n=!1)})),n}},{key:"parseIcon",value:function(e,t){var n={value:e,label:t.label,search:t.search.terms.join()+","+e+","+t.label.toLowerCase()};return n.label.startsLowerCase()&&(n.label=n.label.unSlug().titleCase()),n}}]),e}();String.prototype.startsLowerCase=function(){var e=this.substring(0,1);return e==e.toLowerCase()},String.prototype.unSlug=function(){return this.split("-").join(" ")},String.prototype.titleCase=function(){var e=this.split(" ");return e=e.map((function(e){return e.substring(0,1).toUpperCase()+e.substring(1)})),e.join(" ")};var Yi=function(){var e=this,t=e._self._c;return t("b-button",{staticClass:"file-upload-button",attrs:{block:e.block,disabled:e.disabled,size:e.size,variant:e.variant,type:e.type,tag:e.tag,pill:e.pill,squared:e.squared,pressed:e.pressed},on:{click:e.onClick}},[t("b-form-file",e._b({ref:"fileUpload",staticClass:"file-upload-control",attrs:{plain:"",accept:e.accept,capture:e.capture,multiple:e.multiple,directory:e.directory,"no-traverse":e.noTraverse,"no-drop":e.noDrop,"file-name-formatter":e.fileNameFormatter},on:{change:e.onChange,input:e.onInput},model:{value:e.file,callback:function(t){e.file=t},expression:"file"}},"b-form-file",e.$attrs,!1)),e._t("default")],2)},Ji=[],Zi={inheritAttrs:!1,props:{value:{default:null},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},variant:{type:String,default:"secondary"},type:{type:String,default:"button"},tag:{type:String,default:"button"},pill:{type:Boolean,default:!1},squared:{type:Boolean,default:!1},pressed:{type:Boolean,default:null},accept:{type:String,default:""},capture:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},noTraverse:{type:Boolean,default:!1},noDrop:{type:Boolean,default:!1},fileNameFormatter:{type:Function,default:null}},data:function(){return{file:null}},watch:{file:{handler:function(e){this.$emit("input",e)}},value:{handler:function(e){this.file=e},deep:!0}},methods:{onClick:function(){this.$refs.fileUpload.$el.click()},onChange:function(e){this.$emit("change",e)},onInput:function(e){this.$emit("input",e)},reset:function(){this.$refs.fileUpload.reset()},trigger:function(){this.$refs.fileUpload.$el.click()}}},Ki=Zi,Qi=(f(94960),fr(Ki,Yi,Ji,!1,null,null,null)),es=Qi.exports,ts={components:{FileUploadButton:es},props:{value:{required:!1},allowCustom:{type:Boolean,default:!0},default:{type:String,default:"search"}},data:function(){return{all:Xi.list(),file:null,fileName:null,icon:null,list:{},loading:!0,placeholder:this.$t("Icon"),query:"",uploadedFile:null}},computed:{isOpen:function(){return this.$refs.multiselect.isOpen},iconAndFile:function(){return this.allowCustom?{icon:this.icon?this.icon.value:null,file:this.file}:this.icon?this.icon.value:null}},watch:{value:function(){this.allowCustom?(this.icon=this.find(this.value.icon),this.file=this.value.file):this.icon=this.find(this.value)},icon:function(e){e&&(this.file=null,this.fileName=null,this.allowCustom&&this.$refs.fileUploadButton.reset(),this.$emit("input",this.iconAndFile))},file:function(e){e&&(this.icon=null,this.$refs.multiselect.deactivate(),this.$emit("input",this.iconAndFile))},uploadedFile:function(e){var t=this;if(e)if(e.size>2e3)this.$emit("error",this.$t("The custom icon file is too large. File size must be less than 2KB."));else{this.file=e,this.fileName=e.name,this.uploadedFile=null;var n=new FileReader;n.readAsDataURL(this.file),n.onload=function(){t.file=n.result}}}},beforeMount:function(){this.list=this.all},mounted:function(){this.allowCustom?(this.icon=this.find(this.value.icon),this.file=this.value.file):this.value?this.icon=this.find(this.value):this.icon=this.find(this.default)},methods:{onSearch:function(e){var t=this;e.length?this.query=e.toLowerCase():this.isOpen&&(this.query=""),this.query.length?this.list=this.all.filter((function(e){return e.search.includes(t.query)})):this.list=this.all},onOpen:function(){this.$refs.multiselect.search=this.query},onClose:function(){this.placeholder=this.$t("Icon")},find:function(e){return this.all.find((function(t){return t.value==e}))},onHover:function(e){this.placeholder=e.label},triggerUpload:function(){this.$refs.fileUploadButton.trigger()}}},ns=ts,rs=(f(18785),fr(ns,qi,Vi,!1,null,null,null)),os=rs.exports,is=f(9943),ss={props:{dropdownOpen:{type:Boolean,required:!0},node:Object,showCustomIconPicker:{type:Boolean,default:!1},iconName:{type:String,default:""},hide:{type:Boolean,default:!1}},components:{CrownButton:gr,"sketch-picker":Ui.Sketch,IconSelector:os},data:function(){return{colors:je,selectedColor:this.node.definition.get("color"),colorPickerOpen:!1}},watch:{selectedColor:function(e){e?this.setNodeColor(e):this.resetNodeColor()}},methods:{setColorFromPicker:function(e){var t=e.hex8;this.selectedColor=t},resetNodeStyling:function(){this.resetNodeColor(),this.resetCustomIcon()},setNodeColor:function(e){var t;Un.commit("updateNodeProp",{node:this.node,key:"color",value:e}),zt().set(this.node.definition,"color",e),this.$emit("save-state");var n={id:this.node.definition.id,properties:{color:this.node.definition.color,x:this.node.diagram.bounds.x,y:this.node.diagram.bounds.y,height:this.node.diagram.bounds.height,width:this.node.diagram.bounds.width,type:this.node.type,id:this.node.definition.id,attachedToRefId:null===(t=this.node.definition.get("attachedToRef"))||void 0===t?void 0:t.id}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[n])},resetNodeColor:function(){Un.commit("updateNodeProp",{node:this.node,key:"color",value:void 0}),zt().set(this.node.definition,"color",void 0),this.$emit("save-state")},setCustomIcon:function(e){if(e){var t=(0,mo.icon)({prefix:"fas",iconName:e}),n=t.html,r=btoa(n);Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:r}),zt().set(this.node.definition,"customIcon",r),this.$emit("set-custom-icon-name",e),this.$emit("save-state")}},resetCustomIcon:function(){Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:void 0}),zt().set(this.node.definition,"customIcon",void 0),this.$emit("reset-custom-icon-name"),this.$emit("save-state")},openIconSelector:function(){this.$refs["icon-selector-modal"].show()}},created:function(){this.$t=this.$t.bind(this),mo.library.add(is.fas)}},as=ss,cs=(f(39302),fr(as,Fi,zi,!1,null,"76b859ea",null)),ls=cs.exports,ds={name:"CrownDropdowns",components:{CrownTaskDropdown:Ai,CrownBoundaryEventDropdown:ji,CrownColorDropdown:ls},props:{dropdownData:Array,boundaryEventDropdownData:Array,node:Object,nodeRegistry:Object,moddle:Object,shape:Object,taskDropdownInitiallyOpen:{type:Boolean,required:!0},hideColorDropdown:{type:Boolean,default:!1},showCustomIconPicker:Boolean,iconName:{type:String,default:""}},data:function(){return{taskDropdownOpen:this.taskDropdownInitiallyOpen,boundaryEventDropdownOpen:!1,colorDropdownOpen:!1}},methods:{taskDropdownToggle:function(e){this.taskDropdownOpen=e,this.boundaryEventDropdownOpen=!1,this.colorDropdownOpen=!1},boundaryEventDropdownToggle:function(e){this.taskDropdownOpen=!1,this.boundaryEventDropdownOpen=e,this.colorDropdownOpen=!1},colorDropdownToggle:function(e){this.taskDropdownOpen=!1,this.boundaryEventDropdownOpen=!1,this.colorDropdownOpen=e}}},us=ds,hs=(f(79803),fr(us,yi,wi,!1,null,"3b3ce003",null)),ps=hs.exports,fs=function(){var e=this,t=e._self._c;return e.node.canBeDefaultFlow()?t("crown-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],attrs:{title:e.$t("Set as Default Flow"),"aria-label":"Default Flow","data-test":"default-flow",role:"menuitem"},on:{click:e.click}},[t("img",{attrs:{src:e.icon,"aria-hidden":"true"}})]):e._e()},ms=[],gs=f.p+"img/default-flow.3f3d5309.svg",vs={components:{CrownButton:gr},props:["node"],data:function(){return{icon:gs}},methods:{click:function(){this.$emit("default-flow",this.node)}}},bs=vs,ys=fr(bs,fs,ms,!1,null,null,null),ws=ys.exports,xs={computed:{isLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{configurePoolLane:function(){var e=this;if(!["processmaker-modeler-pool","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-message-flow"].includes(this.node.type)){if(this.node.pool)return this.graph.getCell(this.node.pool)||(this.node.pool=this.graph.getElements().find((function(t){return t.component&&t.component.node===e.node.pool.component.node}))),this.node.pool.component.addToPool(this.shape),void(this.isLane&&this.configureLaneInParentPool());var t=this.graph.findModelsInArea(this.shape.getBBox()).filter((function(e){return e.component&&"processmaker-modeler-pool"===e.component.node.type}))[0];t&&(this.node.pool=t,this.node.pool.component.addToPool(this.shape),this.isLane&&this.configureLaneInParentPool())}},configureLaneInParentPool:function(){var e=this.node.pool.component;e.laneSet||e.createLaneSet();var t=e.laneSet.get("lanes");t.includes(this.node.definition)||t.push(this.node.definition)}},mounted:function(){var e=this;this.$nextTick((function(){e.configurePoolLane()}))}},ks=f(97019),Cs=f.n(ks);function Ss(){return!!window.Cypress}var Es={components:{CrownDropdowns:ps,PreviewButton:kr,DeleteButton:Xr,GenericFlowButton:Do,AssociationFlowButton:zo,CopyButton:ui,CloneButton:bi,DefaultFlow:ws,DataAssociationFlowButton:ni},props:{highlighted:Boolean,paper:Object,graph:Object,shape:Object,node:Object,nodeRegistry:Object,moddle:Object,planeElements:Array,processNode:Object,collaboration:Object,isRendering:Boolean,dropdownData:{type:Array,default:function(){return[]}},boundaryEventDropdownData:{type:Array,default:function(){return[]}},showCustomIconPicker:{type:Boolean,default:!1},hideColorDropdown:{type:Boolean,default:!1},iconName:{type:String,default:""}},mixins:[xs],watch:{"node.definition.color":{handler:function(){this.setNodeColor()}},highlightedShapes:function(e,t){Et()(e,t)||(this.showCrown=this.highlightedShapes[0]===this.shape)},highlighted:function(e){e||(this.taskDropdownInitiallyOpen=!1)},shape:function(){this.highlighted&&(this.showCrown=!0)}},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null}},created:function(){this.$t=this.$t.bind(this)},computed:{showCrownConfig:function(){return this.showCrown&&!this.isMultiselect&&!1===Un.getters.isReadOnly},isMultiselect:function(){var e=Un.getters.highlightedShapes.length;return e>1},isFlow:function(){return["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow"].includes(this.node.type)},isTextAnnotation:function(){return"processmaker-modeler-text-annotation"===this.node.type},process:function(){return this.node.pool?this.node.pool.component.containingProcess:this.processNode.definition},highlightedShapes:function(){return Un.getters.highlightedShapes}},methods:{setNodeColor:function(){var e=this.node.definition.get("color"),t=Je(this.node,e),n=t.fill,r=t.stroke;Ze(this.shape,n,r)},paperNotRendered:function(){return!this.isRendering},replaceNodeTypePrompt:function(e){this.taskDropdownInitiallyOpen?this.$emit("replace-node",e):(this.showReplaceModal=!0,this.nodeToReplace=e)},confirmedReplaceNodeType:function(){this.$emit("replace-node",this.nodeToReplace)},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition},repositionCrown:function(){var e=this.shape.findView(this.paper);if(e){var t=e.getBBox({useModelGeometry:!this.isTextAnnotation&&!this.isFlow}),n=t.x,r=t.y,o=t.width;this.style={top:"".concat(r-52,"px"),left:"".concat(n+o-20,"px"),cursor:"pointer"}}},paperDoneRendering:function(){var e=this;this.isRendering&&new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown),this.shape.on("change:position change:size change:attrs",this.repositionCrown),this.planeElements.includes(this.node.diagram)||this.planeElements.push(this.node.diagram);var e=Object.keys(this.node.definition.$descriptor.allTypesByName);e.includes("bpmn:FlowElement")&&!this.process.get("flowElements").includes(this.node.definition)&&this.process.get("flowElements").push(this.node.definition),e.includes("bpmn:Artifact")&&!this.process.get("artifacts").includes(this.node.definition)&&this.process.get("artifacts").push(this.node.definition),this.collaboration&&e.includes("bpmn:MessageFlow")&&!this.collaboration.get("messageFlows").includes(this.node.definition)&&this.collaboration.get("messageFlows").push(this.node.definition)},setUpPositionHandling:function(){var e=this;this.shape.on("change:position",(function(t,n){e.node.diagram.bounds.x=n.x,e.node.diagram.bounds.y=n.y,e.savePositionOnPointerupEventSet||(e.shape.listenToOnce(e.paper,"element:pointerup",e.setNodePosition),e.savePositionOnPointerupEventSet=!0)}))}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig(),e.setUpPositionHandling(),e.setNodeColor();case 7:case"end":return t.stop()}}),t)})))()},destroyed:function(){this.shape.stopListening(),this.shape.remove(),Cs()(this.process.get("flowElements"),this.node.definition),Cs()(this.planeElements,this.node.diagram),Cs()(this.process.get("artifacts"),this.node.definition),this.collaboration&&Cs()(this.collaboration.get("messageFlows"),this.node.definition)}},As=Es,_s=(f(78135),fr(As,ir,sr,!1,null,null,null)),Ts=_s.exports,Ms={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialAssociationDirection:this.node.definition.associationDirection,associationDirection:nr}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.type");if(!e)return!1;var t=this.target.component.node.pool,n=this.sourceShape.component.node.pool;if(n&&n!==t)return!1;var r=this.targetConfig.validateAssociationIncoming&&!this.targetConfig.validateAssociationIncoming(this.sourceNode),o=this.sourceConfig.validateAssociationOutgoing&&!this.sourceConfig.validateAssociationOutgoing(this.targetNode);return!r&&!o}},watch:{"node.definition.associationDirection":function(e){this.updateAssociationMarker(e)}},methods:{updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition},updateAssociationMarker:function(e){e===this.associationDirection.none&&(this.shape.attr("line/targetMarker/display","none"),this.shape.attr("line/sourceMarker/display","none")),e===this.associationDirection.one&&(this.shape.attr("line/targetMarker/display","block"),this.shape.attr("line/sourceMarker/display","none")),e===this.associationDirection.both&&(this.shape.attr("line/targetMarker/display","block"),this.shape.attr("line/sourceMarker/display","block"))}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10},sourceMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this,this.updateAssociationMarker(this.initialAssociationDirection)}},Ps=Ms,Is=fr(Ps,L,j,!1,null,null,null),Os=Is.exports,Ds={label:"Node Identifier",helper:"Enter the id that is unique from all other elements in the diagram",name:"id",validation:"required|regex:/^[_A-Za-z][-._A-Za-z0-9]*$/"},Ns=Ds,Rs=function(){function e(t,n,r){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=or(this.moddle),i=rr(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var s=new po(er,i,o);return s}}]),e}(),Bs={id:er,component:Os,bpmnType:tr,control:!1,definition:rr,diagram:or,inspectorConfig:[{name:"Data Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-association"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select Direction",name:"associationDirection",options:[{value:"".concat(nr.none),content:"None"},{value:"".concat(nr.one),content:"One"},{value:"".concat(nr.both),content:"Both"}]}}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new Rs(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},Ls=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},js=[],Fs={props:{isActive:Boolean},methods:{hideLabel:function(e,t,n){this.isActive&&!n.movedWithArrowKeys&&(this.shape.attr("label/display","none"),this.shape.getEmbeddedCells().filter((function(e){return e.attr("label/text")})).forEach((function(e){e.attr("label/display","none")})))},showLabel:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.shape.attr("label/display","initial"),t.next=3,e.$nextTick();case 3:e.shape.once("change:position",e.hideLabel);case 4:case"end":return t.stop()}}),t)})))()}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:e.$once("click",(function(){e.shape.once("change:position",e.hideLabel)})),e.shape.listenTo(e.paper,"cell:pointerup blank:pointerup",e.showLabel),e.shape.once("change:parent",e.showLabel);case 5:case"end":return t.stop()}}),t)})))()}},zs=3,Us=16,qs=4;function Vs(e,t){var n=t.size(),r=n.width,o=n.height;for(var i in e)Ws(t,i,r),Gs(t,i,o),$s(t,i,e,r)}function Hs(e,t){var n=e.attr(t);return void 0===n?qs:n}function Ws(e,t,n){var r=Hs(e,t+"/ref-padding-x");-1!==t.indexOf("Right")?e.attr(t+"/ref-x",n-Us-r):-1!==t.indexOf("Left")&&e.attr(t+"/ref-x",r+(Ys(e)?16:0))}function Gs(e,t,n){var r=Hs(e,t+"/ref-padding-y");-1!==t.indexOf("bottom")&&e.attr(t+"/ref-y",n-Us-r)}function $s(e,t,n,r){for(var o=0,i=0;i<zs;i++)e.attr(t+"."+i+"/xlink:href",null);var s=Xs(n,t);for(var a in s)if(e.attr(t+"."+o+"/xlink:href",n[t][a]),o++,o>=zs)break;e.attr(t+"/ref-width",Us*o),-1!==t.indexOf("Center")&&e.attr(t+"/ref-x",(r-o*Us)/2)}function Xs(e,t){if("bottomCenter"===t){var n={};return Object.keys(e[t]).sort().forEach((function(r){n[r]=e[t][r]})),n}return e[t]}function Ys(e){return!!e.attr("image/xlink:href")}var Js=3,Zs=16;function Ks(e){for(var t=[],n=0;n<Js;n++)t.push({tagName:"image",selector:e+"."+n});return{tagName:"g",selector:e,children:t}}function Qs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r={};r[e]=t;for(var o=0;o<Js;o++)r[e+"."+o]={"ref-x":o*Zs*n,"ref-y":0,width:Zs,height:Zs};return r}var ea,ta,na,ra,oa,ia,sa,aa,ca,la,da,ua,ha,pa,fa={data:function(){return{markers:{topLeft:{},topCenter:{},topRight:{},bottomLeft:{},bottomCenter:{},bottomRight:{}}}},watch:{markers:{deep:!0,handler:function(){this.recalcMarkersAlignment()}}},methods:{recalcMarkersAlignment:function(){Vs(this.markers,this.shape)}}},ma=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({size:{width:36,height:36},attrs:Qr(Qr(Qr(Qr(Qr(Qr({image:{"ref-x":5,"ref-y":5,ref:"circle",width:26,height:26}},Qs("topLeft",{ref:"circle","ref-y":-20,"ref-padding-x":0})),Qs("topCenter",{ref:"circle","ref-y":-20})),Qs("topRight",{ref:"circle","ref-x":26,"ref-y":-20,"ref-padding-x":0},-1)),Qs("bottomLeft",{ref:"circle","ref-padding-x":0,"ref-padding-y":-40})),Qs("bottomCenter",{ref:"circle","ref-padding-y":-40})),Qs("bottomRight",{ref:"circle","ref-x":26,"ref-padding-x":0,"ref-padding-y":-40},-1))},F.shapes.standard.Circle.prototype.defaults)}),ga={highlighter:{name:"stroke",options:{padding:10,attrs:{stroke:Vn,"stroke-width":10,opacity:.3}}}},va={highlighter:{name:"stroke",options:{attrs:{stroke:qn,"stroke-width":3,"data-cy":"selected"}}}},ba={highlighter:{name:"stroke",options:{attrs:{stroke:Xn,"stroke-width":5}}}},ya={highlighter:{name:"stroke",options:{attrs:{stroke:Hn,"stroke-width":5}}}},wa={highlighter:{name:"stroke",options:{attrs:{stroke:Gn,"stroke-width":5}}}},xa={props:["highlighted","paperManager","hasError","autoValidate","borderOutline","isCompleted","isInProgress","isIdle"],data:function(){return{shape:null,currentBorderOutline:null}},watch:{highlighted:function(){this.setShapeHighlight()},hasError:function(){this.paperManager.awaitScheduledUpdates().then(this.setShapeHighlight)},autoValidate:function(){this.setShapeHighlight()},borderOutline:{deep:!0,handler:function(e){this.setBorderOutline(e)}}},computed:{shapeView:function(){return this.shape.findView(this.paperManager.paper)},shapeBody:function(){return this.shapeView.$el.find("[joint-selector=body]")||this.shapeView.$el}},methods:{setShapeHighlight:function(){if(Un.getters.isReadOnly)return this.shapeView.unhighlight(this.shapeBody,ba),this.isCompleted&&(this.shape.attr("body/fill",Yn),this.shapeView.highlight(this.shapeBody,ba)),this.shapeView.unhighlight(this.shapeBody,ya),this.isInProgress&&(this.shape.attr("body/fill",Wn),this.shapeView.highlight(this.shapeBody,ya)),void(this.isIdle&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa)));this.shapeView&&(this.shapeView.unhighlight(this.shapeBody,ga),this.hasError&&this.autoValidate&&this.shapeView.highlight(this.shapeBody,ga),this.shapeView.unhighlight(this.shapeBody,va),this.highlighted&&this.shapeView.highlight(this.shapeBody,va))},setBorderOutline:function(e){this.currentBorderOutline&&this.shapeView.unhighlight(this.shapeBody,this.currentBorderOutline),this.currentBorderOutline=e?ho()(e):null,this.currentBorderOutline&&this.shapeView.highlight(this.shapeBody,this.currentBorderOutline)}},mounted:function(){var e=this;this.$nextTick((function(){e.paperManager.awaitScheduledUpdates().then((function(){e.setShapeHighlight(),e.shape.on("change:size",(function(){e.paperManager.awaitScheduledUpdates().then(e.setShapeHighlight),e.$emit("shape-resize",e.shape)}))}))}))}},ka={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,Fs],data:function(){return{shape:null,definition:null,dropdownData:[{label:ro["processmaker-modeler-end-event"],nodeType:"processmaker-modeler-end-event"},{label:ro["processmaker-modeler-message-end-event"],nodeType:"processmaker-modeler-message-end-event",dataTest:"switch-to-message-end-event"},{label:ro["processmaker-modeler-error-end-event"],nodeType:"processmaker-modeler-error-end-event",dataTest:"switch-to-error-end-event"},{label:ro["processmaker-modeler-signal-end-event"],nodeType:"processmaker-modeler-signal-end-event",dataTest:"switch-to-signal-end-event"},{label:ro["processmaker-modeler-terminate-end-event"],nodeType:"processmaker-modeler-terminate-end-event",dataTest:"switch-to-terminate-end-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new ma,this.shape.set("type","processmaker.components.nodes.endEvent.Shape");var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({body:{fill:$e,stroke:Xe},label:{text:this.node.definition.get("name"),refY:"130%"}}),this.shape.addTo(this.graph),this.shape.component=this}},Ca=ka,Sa=fr(Ca,Ls,js,!1,null,null,null),Ea=Sa.exports,Aa={label:"Name",name:"name",helper:"Enter the name of this element",validation:"required"},_a=Aa,Ta=function(){var e=this,t=e._self._c;return t("div",[t("FormInput",{attrs:{name:"id",label:e.label,helper:e.helper,error:e.error,validation:e.validation},on:{input:e.onInput},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)},Ma=[],Pa={props:{label:{type:String},helper:{type:String},value:{default:null},validation:{type:String}},data:function(){return{localValue:this.value,error:""}},methods:{onInput:function(e){this.value!==e&&(this.isUnique(e)?(this.error="",this.$emit("input",e)):this.error=this.$t("Must be unique"))},isUnique:function(e){return!!Un.state.nodes.every((function(t){return t.definition.id!==e}))}}},Ia=Pa,Oa=fr(Ia,Ta,Ma,!1,null,null,null),Da=Oa.exports,Na={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Da,config:Ns}]},Ra=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"d-flex justify-content-between align-items-end mb-2"},[t("label",{staticClass:"m-0"},[e._v(e._s(e.$t(e.label)))]),t("button",{directives:[{name:"b-modal",rawName:"v-b-modal.documentation-modal",modifiers:{"documentation-modal":!0}}],staticClass:"btn-sm float-right",attrs:{type:"button","aria-label":e.$t("Expand"),"data-test":"documentation-modal-button"}},[t("i",{staticClass:"fas fa-expand"})])]),t("form-text-area",{staticClass:"documentation-input d-flex",attrs:{value:e.textValue,richtext:!0,"data-test":"documentation-text-area",id:"documentation-editor"},on:{input:function(t){return e.$emit("input",t)},blur:e.onBlur}}),t("b-modal",{attrs:{id:"documentation-modal",size:"lg",centered:"",title:e.$t("Description"),"header-close-content":"&times;","ok-only":"","ok-variant":"secondary","ok-title":"Close","no-enforce-focus":""}},[t("form-text-area",{staticClass:"documentation-input",attrs:{rows:"5",value:e.textValue,richtext:!0,"data-test":"documentation-modal-text-area",id:"documentation-editor-modal"},on:{input:function(t){return e.$emit("input",t)},blur:e.onBlur}})],1)],1)},Ba=[],La=f(47037),ja=f.n(La),Fa={props:{value:{type:[String,Array],default:""},label:{type:String,default:"Description"}},inheritAttrs:!1,computed:{textValue:function(){return ja()(this.value)?this.value:$()(this.value[0],"text","")}},methods:{onBlur:function(){var e=this.$root.$children.find((function(e){return e.$refs.modeler}));e.$refs.modeler.pushToUndoStack()}}},za=Fa,Ua=(f(14855),fr(za,Ra,Ba,!1,null,null,null)),qa=Ua.exports,Va={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Documentation",icon:"book",name:"documentation-accordion"},items:[{component:qa,config:{label:"Description",name:"documentation",helper:""}}]},Ha="processmaker-modeler-end-event",Wa={id:Ha,component:Ea,bpmnType:"bpmn:EndEvent",control:!0,category:"BPMN",icon:f(48807),label:ro[Ha],rank:30,items:[{icon:f(48807),label:ro[Ha],control:!0,rank:31,id:"processmaker-modeler-end-event"},{icon:f(52080),label:ro["processmaker-modeler-message-end-event"],control:!0,rank:32,id:"processmaker-modeler-message-end-event"},{icon:f(95093),label:ro["processmaker-modeler-error-end-event"],control:!0,rank:33,id:"processmaker-modeler-error-end-event"},{icon:f(96425),label:ro["processmaker-modeler-signal-end-event"],control:!0,rank:34,id:"processmaker-modeler-signal-end-event"},{icon:f(47616),label:ro["processmaker-modeler-terminate-end-event"],control:!0,rank:35,id:"processmaker-modeler-terminate-end-event"}],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[Ha])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:ro[Ha],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-end-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Ga=f(84384),$a=f.n(Ga),Xa=(f(75505),f(23157),f(91910)),Ya=function(e){var t=btoa(e);return"data:image/svg+xml;base64,".concat(t)},Ja=function(e){return e.definition.get("color")||Ke(e)},Za=function(e,t){var n=(new DOMParser).parseFromString(e,"text/xml"),r=n.querySelectorAll('*[fill]:not([fill="none"])'),o=n.querySelectorAll('*[stroke]:not([stroke="none"])');return r.forEach((function(e){e.setAttribute("fill",t)})),o.forEach((function(e){e.setAttribute("stroke",t)})),n.documentElement.outerHTML},Ka=function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/,r=/<svg[^>]*>/,o=e.startsWith("<xml")&&/<svg[^>]*>/.test(e);return"string"===typeof e&&(t.test(e)||n.test(e)||r.test(e)||o)},Qa=function(e,t){if(!Ka(e)){mo.library.add(is.fas,Xa.fab);var n=e.split(" "),r=jt(n,1),o=r[0],i=e.split("-"),s=jt(i,2),a=s[1],c=(0,mo.findIconDefinition)({prefix:o,iconName:a}),l=(0,mo.icon)(c).html;e=l[0]}var d=Ja(t),u=Za(e,d);return Ya(u)},ec=Qa,tc={data:function(){return{nodeIcon:null}},computed:{icon:function(){return this.node.definition.customIcon?atob(this.node.definition.customIcon):this.nodeIcon}},watch:{"node.definition.color":{handler:function(){this.updateIconColor()}},"node.definition.customIcon":{handler:function(){this.updateIconColor()}}},methods:{updateIconColor:function(){this.nodeIcon&&!this.node.isBpmnType("bpmn:ServiceTask")&&this.shape&&this.shape.attr("image/xlink:href",ec(this.icon,this.node))}},mounted:function(){this.updateIconColor()}},nc={extends:Ea,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{error:this.moddle.create("bpmn:Error",{id:"".concat(this.id,"_error"),name:"".concat(this.id,"_error")}),nodeIcon:$a()}},methods:{addErrorRef:function(){this.node.definition.get("eventDefinitions")[0].errorRef?this.error=this.node.definition.get("eventDefinitions")[0].errorRef:(this.error=this.moddle.create("bpmn:Error",{id:"".concat(this.id,"_error"),name:"".concat(this.id,"_error")}),this.rootElements.push(this.error),this.node.definition.get("eventDefinitions")[0].errorRef=this.error)}},mounted:function(){this.addErrorRef()},destroyed:function(){Cs()(this.rootElements,this.error)}},rc=nc,oc=fr(rc,ea,ta,!1,null,null,null),ic=oc.exports,sc=f(82492),ac=f.n(sc),cc=f(57557),lc=f.n(cc),dc="processmaker-modeler-error-end-event",uc=ac()(ho()(Wa),{id:dc,component:ic,control:!1,label:ro[dc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[dc]),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return"eventDefinitions"===r?e.errorName=o[0].get("errorRef").name:e[r]=o,e}),{})},inspectorHandler:function(e,t,n){for(var r in lc()(e,["$type","eventDefinitions","errorName"]))t.definition[r]!==e[r]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]}),n(t,r,e[r]));var o=t.definition.get("eventDefinitions")[0].errorRef;o.name!==e.errorName&&(o.name=e.errorName,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:t.definition.get("eventDefinitions")}))},multiplayerInspectorHandler:function(e,t,n){var r=Object.keys(t).filter((function(e){return"id"!==e}));if("eventDefinitions"!==r[0])n(e,r[0],t[r[0]]);else{var o=t[r[0]][0].errorRef,i=e.definition.get("eventDefinitions")[0].errorRef;o&&i&&o.name!==i.name&&(i.name=o.name)}},inspectorConfig:[{items:[{items:[{},{component:"FormInput",config:{label:"Error Name",name:"errorName",helper:"Enter the error name that is unique from all other elements in the diagram"}}]}]}]}),hc=f(43258),pc=f.n(hc),fc={extends:Ea,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{nodeIcon:pc()}}},mc=fc,gc=fr(mc,na,ra,!1,null,null,null),vc=gc.exports,bc="processmaker-modeler-terminate-end-event",yc=ac()(ho()(Wa),{id:bc,component:vc,control:!1,label:ro[bc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[bc]),eventDefinitions:[e.create("bpmn:TerminateEventDefinition")]})}}),wc=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},xc=[],kc=18,Cc=F.dia.Element.define("processmaker.components.nodes.gateway.Shape",{markup:[].concat(W(F.shapes.standard.Polygon.prototype.markup),[{tagName:"image",selector:"image"}]),attrs:{body:{strokeWidth:2,stroke:"#000000",refPointsKeepOffset:"40,0, 80,40, 40,80, 0,40",fill:"#FFFFFF"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"50",fontSize:14,fill:"#333333"},image:{width:kc,height:kc,fill:"transparent",xlinkHref:"",refX:"50%",refX2:-kc/2,refY:"50%",refY2:-kc/2}}}),Sc=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"],Ec={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,Fs],created:function(){var e=this.node.definition.default||null;delete this.node.definition.default,Sc.indexOf(this.node.definition.$type)>-1&&this.$set(this.node.definition,"default",e)},data:function(){return{shape:null,definition:null,labelWidth:175,dropdownData:[{label:ao["processmaker-modeler-exclusive-gateway"],nodeType:"processmaker-modeler-exclusive-gateway"},{label:ao["processmaker-modeler-inclusive-gateway"],nodeType:"processmaker-modeler-inclusive-gateway",dataTest:"switch-to-inclusive-gateway"},{label:ao["processmaker-modeler-parallel-gateway"],nodeType:"processmaker-modeler-parallel-gateway",dataTest:"switch-to-parallel-gateway"},{label:ao["processmaker-modeler-event-based-gateway"],nodeType:"processmaker-modeler-event-based-gateway",dataTest:"switch-to-event-based-gateway",disabled:function(e){if(e&&e.definition&&e.definition.outgoing){var t=["bpmn:IntermediateCatchEvent"],n=e.definition.outgoing.find((function(e){return!t.includes(e.targetRef.$type)}));return!!n&&"It must be connected only to catch events"}return!1}}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Cc;var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.attr({label:{text:this.node.definition.get("name"),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this}},Ac=Ec,_c=fr(Ac,wc,xc,!1,null,null,null),Tc=_c.exports,Mc=f(4074),Pc=f.n(Mc),Ic={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:Pc()}}},Oc=Ic,Dc=fr(Oc,oa,ia,!1,null,null,null),Nc=Dc.exports,Rc="processmaker-modeler-exclusive-gateway",Bc={id:Rc,component:Nc,bpmnType:"bpmn:ExclusiveGateway",control:!0,category:"BPMN",icon:f(21678),label:"Gateway",rank:50,items:[{icon:f(52794),label:"Exclusive Gateway",control:!0,rank:51,id:"processmaker-modeler-exclusive-gateway"},{icon:f(59749),label:"Inclusive Gateway",control:!0,rank:52,id:"processmaker-modeler-inclusive-gateway"},{icon:f(23726),label:"Parallel Gateway",control:!0,rank:53,id:"processmaker-modeler-parallel-gateway"},{icon:f(93763),label:"Event Based Gateway",control:!0,rank:54,id:"processmaker-modeler-event-based-gateway"}],definition:function(e,t){return e.create("bpmn:ExclusiveGateway",{name:t(ao[Rc])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[Rc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-exlcusive-gateway"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Lc=f(62635),jc=f.n(Lc),Fc={diverging:"Diverging",converging:"Converging"},zc={extends:Tc,mixins:[tc],data:function(){return{incoming:this.node.definition.get("incoming"),nodeIcon:jc()}},watch:{incoming:function(e){var t=e.length<=1?Fc.diverging:Fc.converging;this.node.definition.set("gatewayDirection",t)}}},Uc=zc,qc=fr(Uc,sa,aa,!1,null,null,null),Vc=qc.exports,Hc="processmaker-modeler-inclusive-gateway",Wc={id:Hc,component:Vc,bpmnType:"bpmn:InclusiveGateway",control:!1,category:"BPMN",label:ao[Hc],definition:function(e,t){return e.create("bpmn:InclusiveGateway",{name:t(ao[Hc]),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[Hc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-inclusive-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-inclusive-gateway-advanced"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select the direction of workflow for this element",name:"gatewayDirection",options:[{value:Fc.diverging,content:"Diverging"},{value:Fc.converging,content:"Converging"}]}}]}]}]},Gc=f(70718),$c=f.n(Gc),Xc={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:$c()}},watch:{"node.definition":{deep:!0,immediate:!0,handler:function(){delete this.node.definition.default}}}},Yc=Xc,Jc=fr(Yc,ca,la,!1,null,null,null),Zc=Jc.exports,Kc={id:"processmaker-modeler-parallel-gateway",component:Zc,bpmnType:"bpmn:ParallelGateway",control:!1,category:"BPMN",label:"Parallel Gateway",definition:function(e,t){return e.create("bpmn:ParallelGateway",{name:t("Parallel Gateway"),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:"Parallel Gateway",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-parallel-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-parallel-gateway-direction"},items:[{component:"FormInput",config:Ns},{component:"FormSelect",config:{label:"Direction",helper:"Select the direction of workflow for this element",name:"gatewayDirection",options:[{value:Fc.diverging,content:"Diverging"},{value:Fc.converging,content:"Converging"}]}}]}]}]},Qc=f(30666),el=f.n(Qc),tl={extends:Tc,mixins:[tc],data:function(){return{nodeIcon:el()}}},nl=tl,rl=fr(nl,da,ua,!1,null,null,null),ol=rl.exports,il="processmaker-modeler-event-based-gateway",sl={id:il,component:ol,bpmnType:"bpmn:EventBasedGateway",control:!1,category:"BPMN",label:ao[il],definition:function(e,t){return e.create("bpmn:EventBasedGateway",{name:t(ao[il])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:ao[il],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-event-based-gateway"},items:[{component:"FormInput",config:{label:"Name",helper:"The Name of the Gateway",name:"name"}}]},Va,Na]}]},al=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},cl=[],ll={offset:{y:-20}},dl="processmaker-modeler-lane",ul=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=this.nodeRegistry["processmaker-modeler-sequence-flow"].diagram(this.moddle),i=this.nodeRegistry["processmaker-modeler-sequence-flow"].definition(this.moddle,this.$t);return i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)})),"bpmn:ExclusiveGateway"!==i.sourceRef.$type&&"bpmn:InclusiveGateway"!==i.sourceRef.$type||(i.conditionExpression=this.moddle.create("bpmn:FormalExpression",{body:""})),e.component.node.definition.get("outgoing").push(i),t.component.node.definition.get("incoming").push(i),new po("processmaker-modeler-sequence-flow",i,o)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,r=e.targetShape,o=e.targetConfig,i=$()(r,"component.node"),s=$()(t,"component.node");return Zo.hasTargetType(r)&&Zo.targetIsNotSource(s,i)&&n.targetIsNotALane(i)&&n.targetIsInSamePool(t,r)&&n.eventBasedGatewayTarget(s,i)&&n.isValidSource(t,o)&&n.sourceIsNotPool(s)&&!Ko.isADataNode(s)&&!Ko.isADataNode(i)}},{key:"isValidSource",value:function(e,t){return null==t.validateIncoming||t.validateIncoming(e.node)}},{key:"targetIsNotALane",value:function(e){return!e.isType(dl)}},{key:"targetIsInSamePool",value:function(e,t){var n=t.component.node.pool,r=e.component.node.pool;return!r||r===n}},{key:"targetIsNotSource",value:function(e,t){return t.id!==e.id}},{key:"eventBasedGatewayTarget",value:function(e,t){var n=e.isBpmnType("bpmn:EventBasedGateway"),r=t.isBpmnType("bpmn:IntermediateCatchEvent");return!n||r}},{key:"sourceIsNotPool",value:function(e){return!e.isType("processmaker-modeler-pool")}}]),n}(Zo),hl={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){return ul.isValid({sourceShape:this.sourceShape,targetShape:this.target,targetConfig:this.targetConfig})},targetType:function(){return $()(this.target,"component.node.type")},shapeName:function(){return this.node.definition.get("name")},nameLabel:{get:function(){return this.shape.label(0).attrs.text.text},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.shape.label(0,{attrs:{text:{text:e}}})}}},watch:{"node.definition":{handler:function(){var e=this.shapeName;e!==this.nameLabel&&(this.nameLabel=e),this.setDefaultMarker(this.isDefaultFlow())},deep:!0},"node.definition.sourceRef":{handler:function(){this.setDefaultMarker(this.isDefaultFlow())},deep:!0}},methods:{setDefaultMarker:function(e){this.shape.attr("line",{sourceMarker:{"stroke-width":e?2:0}})},isDefaultFlow:function(){return this.node.definition.sourceRef&&this.node.definition.sourceRef.default&&this.node.definition.sourceRef.default.id===this.node.definition.id},updateRouter:function(){this.shape.router("orthogonal",{padding:1})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition,this.sourceShape.component.node.definition.get("outgoing").push(this.node.definition),e.component.node.definition.get("incoming").push(this.node.definition)},createLabel:function(){this.shape.labels([{attrs:{text:{text:this.shapeName}},position:ll}])},createDefaultFlowMarker:function(){this.shape.attr("line",{sourceMarker:{type:"polyline","stroke-width":this.isDefaultFlow()?2:0,points:"2,6 6,-6"}})}},mounted:function(){this.shape=new F.shapes.standard.Link,this.shape.connector("rounded",{radius:5}),this.createLabel(),this.createDefaultFlowMarker(),this.shape.addTo(this.graph),this.shape.component=this}},pl=hl,fl=fr(pl,al,cl,!1,null,null,null),ml=fl.exports,gl="processmaker-modeler-sequence-flow",vl={id:gl,component:ml,bpmnType:"bpmn:SequenceFlow",control:!1,definition:function(e){return e.create("bpmn:SequenceFlow",{name:null})},diagram:function(e){return e.create("bpmndi:BPMNEdge")},inspectorData:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.definition.sourceRef.$type);return t||delete e.definition.conditionExpression,Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]="conditionExpression"===r?o.body:o,e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition,i=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(o.sourceRef.$type);for(var s in e)if(o[s]!==e[s])if("conditionExpression"===s&&i){if(o[s].body!==e[s]){var a=r.create("bpmn:FormalExpression",{body:e[s]});window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:[a]}),n(t,s,a)}}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:e[s]}),n(t,s,e[s])},multiplayerInspectorHandler:function(e,t,n,r){var o=Object.keys(t).filter((function(e){return"id"!==e}));if(0!==o.length)if("conditionExpression"!==o[0])n(e,o[0],t[o[0]]);else{var i=r.create("bpmn:FormalExpression",{body:t[o[0]][0].body});n(e,o[0],i)}},inspectorConfig:[{name:"Sequence Flow",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-sequence-flow"},items:[{component:"FormInput",config:Qr(Qr({},_a),{},{validation:null})}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new ul(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},bl=function(){var e=this,t=e._self._c;return t("crown-config",{attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering},on:{"remove-node":function(t){return e.$emit("remove-node",t)},"add-node":function(t){return e.$emit("add-node",t)},"save-state":function(t){return e.$emit("save-state",t)}}})},yl=[],wl=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=this.nodeRegistry["processmaker-modeler-message-flow"].diagram(this.moddle),i=this.nodeRegistry["processmaker-modeler-message-flow"].definition(this.moddle);return i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)})),new po("processmaker-modeler-message-flow",i,o)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,r=e.targetShape,o=e.sourceConfig,i=$()(r,"component.node"),s=$()(t,"component.node");return Zo.hasTargetType(r)&&n.isValidTargetType(i)&&Zo.targetIsValidStartEventType(i)&&Zo.targetIsValidIntermediateEventType(i)&&Zo.targetIsValidBoundaryEventType(i)&&Zo.targetIsNotContainingPool(r,s)&&Zo.targetIsInDifferentPool(r,t)&&Zo.targetIsNotSource(i,s)&&Zo.allowOutgoingFlow(o,s)}},{key:"isValidTargetType",value:function(e){return["bpmn:Task","bpmn:ScriptTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ServiceTask","bpmn:IntermediateCatchEvent","bpmn:Participant","bpmn:StartEvent","bpmn:BoundaryEvent"].some((function(t){return e.isBpmnType(t)}))}}]),n}(Zo),xl={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){return wl.isValid({sourceShape:this.sourceShape,targetShape:this.target,sourceConfig:this.sourceConfig})},targetType:function(){return $()(this.target,"component.node.type")},sourceType:function(){return $()(this.sourceNode,"type")}},methods:{updateRouter:function(){this.shape.router("orthogonal",{padding:1})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement();this.node.definition.targetRef=e.component.node.definition}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"orthogonal"}}),this.shape.attr("line",{strokeDasharray:"10 10",sourceMarker:{type:"circle",r:5,"stroke-width":2,fill:"#fff"},targetMarker:{type:"path",fill:"#fff","stroke-width":2,d:"M 10 -5 0 0 10 5 Z"}}),this.shape.addTo(this.graph),this.shape.component=this}},kl=xl,Cl=fr(kl,bl,yl,!1,null,null,null),Sl=Cl.exports,El="processmaker-modeler-message-flow",Al={id:El,component:Sl,bpmnType:"bpmn:MessageFlow",control:!1,definition:function(e){return e.create("bpmn:MessageFlow",{name:""})},diagram:function(e){return e.create("bpmndi:BPMNEdge")},inspectorConfig:[{name:"Message Flow",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-message-flow"},items:[{component:"FormInput",config:_a}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new wl(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}},_l=f(18256),Tl=f.n(_l),Ml={extends:Ea,mixins:[tc],props:["node","rootElements","id"],data:function(){return{message:this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),nodeIcon:Tl()}},methods:{addMessageRef:function(){this.node.definition.get("eventDefinitions")[0].messageRef?this.message=this.node.definition.get("eventDefinitions")[0].messageRef:(this.message=this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),this.rootElements.push(this.message),this.node.definition.get("eventDefinitions")[0].messageRef=this.message)}},mounted:function(){this.addMessageRef()},destroyed:function(){Cs()(this.rootElements,this.message),Un.commit("removeMessageRef",this.message)}},Pl=Ml,Il=fr(Pl,ha,pa,!1,null,null,null),Ol=Il.exports,Dl=function(){var e=this,t=e._self._c;return t("div",[t("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),t("div",{staticClass:"d-flex",class:{invalid:e.invalid}},[t("multiselect",{attrs:{value:e.selectedOption,placeholder:e.$t(e.placeholder),options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"name","data-test":"".concat(e.name,":select")},on:{input:e.change,"search-change":e.loadOptionsDebounced,open:e.loadOptions}},[t("template",{slot:"noResult"},[e._t("noResult",(function(){return[e._v(e._s(e.$t("Not found")))]}))],2),t("template",{slot:"noOptions"},[e._t("noOptions",(function(){return[e._v(e._s(e.$t("No Data Available")))]}))],2)],2),t("div",{staticClass:"btn-group ml-1",attrs:{role:"group"}},[t("button",{staticClass:"btn btn-secondary btn-sm",attrs:{type:"button","data-cy":"events-list",title:e.$t("Configure")},on:{click:e.toggleConfigMessage}},[t("i",{staticClass:"fa fa-ellipsis-h"})])])],1),e.invalid?t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("Message reference is required"))+" ")])]):e._e(),e.helper?t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),e.showNewMessage?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("ID"),error:e.getValidationErrorForNewId(e.messageId),"data-cy":"events-add-id"},model:{value:e.messageId,callback:function(t){e.messageId=t},expression:"messageId"}}),t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNewName(e.messageName),"data-cy":"events-add-name"},model:{value:e.messageName,callback:function(t){e.messageName=t},expression:"messageName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddMessage}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validNew,type:"button","data-cy":"events-save"},on:{click:e.addMessage}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),e.showEditMessage?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNameUpdate(e.messageName),"data-cy":"events-edit-name"},model:{value:e.messageName,callback:function(t){e.messageName=t},expression:"messageName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddMessage}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validUpdate,type:"button","data-cy":"events-save"},on:{click:e.updateMessage}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e.showConfirmDelete?t("div",{staticClass:"card mb-3 bg-danger text-white"},[e.deleteMessageUsage(e.deleteMessage.id)?t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.deleteMessageUsage(e.deleteMessage.id))+" ")]):t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.$t("Are you sure you want to delete this item?"))+" ("+e._s(e.deleteMessage.id)+") "+e._s(e.deleteMessage.name)+" ")]),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn btn-sm btn-light mr-2 p-1 font-xs",attrs:{type:"button","data-cy":"events-cancel"},on:{click:function(t){e.showConfirmDelete=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),e.deleteMessageUsage(e.deleteMessage.id)?e._e():t("button",{staticClass:"btn btn-sm btn-danger p-1 font-xs",attrs:{type:"button","data-cy":"events-delete"},on:{click:e.confirmDeleteMessage}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])]):!e.showListMessages||e.showNewMessage||e.showEditMessage?e._e():[t("table",{staticClass:"table table-sm table-striped",attrs:{width:"100%"}},[t("thead",[t("tr",[t("td",{attrs:{colspan:"2",align:"right"}},[t("button",{staticClass:"btn btn-secondary btn-sm p-1 font-xs",attrs:{type:"button","data-cy":"events-add"},on:{click:e.showAddMessage}},[t("i",{staticClass:"fa fa-plus"}),e._v(" "+e._s(e.$t("Message"))+" ")])])])]),t("tbody",e._l(e.localMessages,(function(n){return t("tr",{key:"message-".concat(n.id)},[t("td",[t("b-badge",{attrs:{variant:"secondary"}},[e._v(e._s(n.id))]),e._v(" "+e._s(n.name)+" ")],1),t("td",{attrs:{align:"right"}},[t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Edit")},on:{click:function(t){return e.editMessage(n)}}},[t("i",{staticClass:"fa fa-pen",attrs:{"data-cy":"events-edit"}})]),t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Remove")},on:{click:function(t){return e.removeMessage(n)}}},[t("i",{staticClass:"fa fa-trash",attrs:{"data-cy":"events-remove"}})])])])})),0)])]],2)},Nl=[],Rl=(f(34553),{props:{value:null,name:String,placeholder:{type:String,default:"Select option"},helper:String,trackBy:{type:String,default:"id"},label:{type:String,default:"name"},api:{type:String,default:"messages"},multiple:{type:Boolean,default:!1}},computed:{invalid:function(){return!this.value},localMessages:function(){return Un.getters.rootElements.filter((function(e){return"bpmn:Message"===e.$type}))},validNew:function(){return""===this.getValidationErrorForNewId(this.messageId)&&""===this.getValidationErrorForNewName(this.messageName)},validUpdate:function(){return""===this.getValidationErrorForNameUpdate(this.messageName)}},data:function(){return{options:[],selectedOption:null,pmql:"id!="+window.ProcessMaker.modeler.process.id,showListMessages:!1,showNewMessage:!1,showEditMessage:!1,showConfirmDelete:!1,deleteMessage:null,messageId:"",messageName:""}},methods:{deleteMessageUsage:function(e){var t=this.messageUsage(e),n=[];return t.forEach((function(e){return n.push(e.name||e.id)})),n.length?this.$t("This message cannot be removed, it is used by")+": "+n.join(", "):""},messageUsage:function(e){var t=[];return Un.getters.rootElements.forEach((function(n){"bpmn:Process"===n.$type&&n.flowElements.forEach((function(n){n.eventDefinitions&&n.eventDefinitions.forEach((function(r){"bpmn:MessageEventDefinition"===r.$type&&r.messageRef&&r.messageRef.id===e&&t.push(n)}))}))})),t},getValidationErrorForNewId:function(e){if(!e)return this.$t("Message ID is required");var t=Un.getters.rootElements.find((function(t){return t.id===e}));if(t)return this.$t("Message ID is duplicated");var n=e.match(/^[_A-Za-z][-._A-Za-z0-9]*$/);return n?"":this.$t("Message ID is not a valid xsd:ID")},getValidationErrorForNewName:function(e){if(!e)return this.$t("Message Name is required");var t=Un.getters.rootElements.find((function(t){return"bpmn:Message"===t.$type&&t.name===e}));return t?this.$t("Message Name is duplicated"):""},getValidationErrorForNameUpdate:function(e){var t=this;if(!e)return this.$t("Message Name is required");var n=Un.getters.rootElements.find((function(n){return"bpmn:Message"===n.$type&&n.name===e&&n.id!==t.messageId}));return n?this.$t("Message Name is duplicated"):""},confirmDeleteMessage:function(){var e=this;this.showConfirmDelete=!1;var t=Un.getters.rootElements.findIndex((function(t){return t.id===e.deleteMessage.id}));t>-1&&Un.getters.rootElements.splice(t,1)},removeMessage:function(e){this.showConfirmDelete=!0,this.deleteMessage=e},toggleConfigMessage:function(){this.showListMessages=!this.showListMessages},editMessage:function(e){this.messageId=e.id,this.messageName=e.name,this.showEditMessage=!0},getMessageById:function(e){return Un.getters.rootElements.find((function(t){return t.id===e}))},change:function(e){if(!e)return this.$emit("input",""),void this.refreshVueMultiselectValue();var t=this.getMessageById(e.id);t||(t=window.ProcessMaker.$modeler.moddle.create("bpmn:Message",{id:e.id,name:e.name}),Un.getters.rootElements.push(t)),this.$emit("input",(0,Er.get)(e,this.trackBy)),this.refreshVueMultiselectValue()},refreshVueMultiselectValue:function(){var e=this;this.$nextTick((function(){var t=e;while(t&&"vue-form-renderer"!==t.$options._componentTag)t=t.$parent;t&&t.$emit("update",t.transientData)}))},showAddMessage:function(){this.showNewMessage=!0,this.messageId="",this.messageName=""},cancelAddMessage:function(){this.showNewMessage=!1,this.showEditMessage=!1},updateMessage:function(){this.getMessageById(this.messageId).name=this.messageName,this.showEditMessage=!1},addMessage:function(){var e=window.ProcessMaker.$modeler.moddle.create("bpmn:Message",{id:this.messageId,name:this.messageName});Un.getters.rootElements.push(e),this.showNewMessage=!1},updateOptions:function(e){this.options=(0,Er.uniqBy)([].concat(W(this.localMessages),W(e)),"id")},loadOptions:function(){this.updateOptions([])},loadSelected:function(e){var t=Un.getters.rootElements.find((function(t){return t.id===e}));t?this.selectedOption={id:t.id,name:t.name}:(this.$emit("input",""),this.refreshVueMultiselectValue())},loadOptionsDebounced:function(){}},watch:{value:{immediate:!0,handler:function(e){var t=this;this.selectedOption=this.options.find((function(n){return(0,Er.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}}),Bl=Rl,Ll=(f(53030),f(54061),fr(Bl,Dl,Nl,!1,null,"5e4e6e5a",null)),jl=Ll.exports;function Fl(e){return{component:jl,config:{label:"Message",name:"messageRef",helper:e}}}var zl,Ul,ql={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=o[0].get("messageRef");e.messageRef=i?i.id:""}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r,o){var i;for(var s in lc()(e,["$type","eventDefinitions","messageRef"]))t.definition[s]!==e[s]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:s,value:e[s]}),n(t,s,e[s]));var a=o.rootElements.find((function(t){return t.id===e.messageRef}));!a&&e.messageRef&&(a=r.create("bpmn:Message",{id:e.messageRef,name:e.messageRef}),o.rootElements.push(a)),t.definition.get("eventDefinitions")[0].messageRef=a,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"messageRef",value:e.messageRef,extras:{messageName:null===(i=a)||void 0===i?void 0:i.name,allowedUsers:t.definition.get("allowedUsers"),allowedGroups:t.definition.get("allowedGroups")}})}},Vl="processmaker-modeler-message-end-event",Hl=ac()(ho()(Wa),Qr(Qr({},ql),{},{id:Vl,component:Ol,control:!1,label:ro[Vl],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[Vl]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Select the message reference that this element throws")]}]}]})),Wl=f(77389),Gl=f.n(Wl),$l={extends:Ea,mixins:[tc],data:function(){return{nodeIcon:Gl()}},mounted:function(){this.shape.attr({image:{"ref-y":3}})}},Xl=$l,Yl=fr(Xl,zl,Ul,!1,null,null,null),Jl=Yl.exports,Zl=function(){var e=this,t=e._self._c;return t("div",[t("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),t("div",{staticClass:"d-flex",class:{invalid:e.invalid}},[t("multiselect",{attrs:{value:e.selectedOption,placeholder:e.$t(e.placeholder),options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"name","data-test":"".concat(e.name,":select"),disabled:!e.can("view-signals")},on:{input:e.change,"search-change":e.loadOptions,open:function(t){return e.loadOptions()}}},[t("template",{slot:"noResult"},[e._t("noResult",(function(){return[e._v(e._s(e.$t("Not found")))]}))],2),t("template",{slot:"noOptions"},[e._t("noOptions",(function(){return[e._v(e._s(e.$t("No Data Available")))]}))],2)],2),e.canEdit?t("div",{staticClass:"btn-group ml-1",attrs:{role:"group"}},[t("button",{staticClass:"btn btn-secondary btn-sm",attrs:{type:"button","data-cy":"events-list",title:e.$t("Configure")},on:{click:e.toggleConfigSignal}},[t("i",{staticClass:"fa fa-ellipsis-h"})])]):e._e()],1),e.can("view-signals")?e._e():t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("You do not have permission to view signals"))+" ")])]),e.invalid?t("div",{staticClass:"invalid-feedback d-block"},[t("div",[e._v(" "+e._s(e.$t("Signal reference is required"))+" ")])]):e._e(),e.helper?t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),e.showNewSignal?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("ID"),error:e.getValidationErrorForNewId(e.signalId),"data-cy":"events-add-id"},model:{value:e.signalId,callback:function(t){e.signalId=t},expression:"signalId"}}),t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNewName(e.signalName),"data-cy":"events-add-name"},model:{value:e.signalName,callback:function(t){e.signalName=t},expression:"signalName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddSignal}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validNew,type:"button","data-cy":"events-save"},on:{click:e.addSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),e.showEditSignal?t("div",{staticClass:"card"},[t("div",{staticClass:"card-body p-2"},[t("form-input",{attrs:{label:e.$t("Name"),error:e.getValidationErrorForNameUpdate(e.signalName),"data-cy":"events-edit-name"},model:{value:e.signalName,callback:function(t){e.signalName=t},expression:"signalName"}})],1),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn-special-assignment-action btn-special-assignment-close btn btn-outline-secondary btn-sm",attrs:{type:"button","data-cy":"events-cancel"},on:{click:e.cancelAddSignal}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),t("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm",attrs:{disabled:!e.validUpdate,type:"button","data-cy":"events-save"},on:{click:e.updateSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e.showConfirmDelete?t("div",{staticClass:"card mb-3 bg-danger text-white"},[e.deleteSignalUsage(e.deleteSignal.id)?t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.deleteSignalUsage(e.deleteSignal.id))+" ")]):t("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.$t("Are you sure you want to delete this item?"))+" ("+e._s(e.deleteSignal.id)+") "+e._s(e.deleteSignal.name)+" ")]),t("div",{staticClass:"card-footer text-right p-2"},[t("button",{staticClass:"btn btn-sm btn-light mr-2 p-1 font-xs",attrs:{type:"button","data-cy":"events-cancel"},on:{click:function(t){e.showConfirmDelete=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),e.deleteSignalUsage(e.deleteSignal.id)?e._e():t("button",{staticClass:"btn btn-sm btn-danger p-1 font-xs",attrs:{type:"button","data-cy":"events-delete"},on:{click:e.confirmDeleteSignal}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):!e.showListSignals||e.showNewSignal||e.showEditSignal?e._e():[t("table",{staticClass:"table table-sm table-striped",attrs:{width:"100%"}},[t("thead",[t("tr",[t("td",{attrs:{colspan:"2",align:"right"}},[t("button",{staticClass:"btn btn-secondary btn-sm p-1 font-xs",attrs:{type:"button","data-cy":"events-add"},on:{click:e.showAddSignal}},[t("i",{staticClass:"fa fa-plus"}),e._v(" "+e._s(e.$t("Signal"))+" ")])])])]),t("tbody",e._l(e.localSignals,(function(n){return t("tr",{key:"signal-".concat(n.id)},[t("td",[t("b-badge",{attrs:{variant:"secondary"}},[e._v(e._s(n.id))]),e._v(" "+e._s(n.name)+" ")],1),t("td",{attrs:{align:"right"}},[e.can("edit-signals")?t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Edit")},on:{click:function(t){return e.editSignal(n)}}},[t("i",{staticClass:"fa fa-pen",attrs:{"data-cy":"events-edit"}})]):e._e(),e.can("delete-signals")?t("button",{staticClass:"btn-link ml-2",attrs:{"aria-label":e.$t("Remove")},on:{click:function(t){return e.removeSignal(n)}}},[t("i",{staticClass:"fa fa-trash",attrs:{"data-cy":"events-remove"}})]):e._e()])])})),0)])]],2)},Kl=[],Ql={props:{value:null,name:String,placeholder:{type:String,default:"Select option"},helper:String,canEdit:{type:Boolean,default:!0},trackBy:{type:String,default:"id"},label:{type:String,default:"name"},api:{type:String,default:"signals"},multiple:{type:Boolean,default:!1}},computed:{invalid:function(){return!this.value},localSignals:function(){return Un.getters.rootElements.filter((function(e){return"bpmn:Signal"===e.$type}))},validNew:function(){return""===this.getValidationErrorForNewId(this.signalId)&&""===this.getValidationErrorForNewName(this.signalName)},validUpdate:function(){return""===this.getValidationErrorForNameUpdate(this.signalName)}},data:function(){return{options:[],selectedOption:null,pmql:"id!="+window.ProcessMaker.modeler.process.id,showListSignals:!1,showNewSignal:!1,showEditSignal:!1,showConfirmDelete:!1,deleteSignal:null,signalId:"",signalName:""}},methods:{deleteSignalUsage:function(e){var t=this.signalUsage(e),n=[];return t.forEach((function(e){return n.push(e.name||e.id)})),n.length?this.$t("This signal cannot be removed, it is used by")+": "+n.join(", "):""},signalUsage:function(e){var t=[];return Un.getters.rootElements.forEach((function(n){"bpmn:Process"===n.$type&&n.flowElements.forEach((function(n){n.eventDefinitions&&n.eventDefinitions.forEach((function(r){"bpmn:SignalEventDefinition"===r.$type&&r.signalRef&&r.signalRef.id===e&&t.push(n)}))}))})),t},getValidationErrorForNewId:function(e){if(!e)return this.$t("Signal ID is required");var t=Un.getters.rootElements.find((function(t){return t.id===e}));if(t)return this.$t("Signal ID is duplicated");var n=e.match(/^[_A-Za-z][-._A-Za-z0-9]*$/);return n?"":this.$t("Signal ID is not a valid xsd:ID")},getValidationErrorForNewName:function(e){if(!e)return this.$t("Signal Name is required");var t=Un.getters.rootElements.find((function(t){return"bpmn:Signal"===t.$type&&t.name===e}));return t?this.$t("Signal Name is duplicated"):""},getValidationErrorForNameUpdate:function(e){var t=this;if(!e)return this.$t("Signal Name is required");var n=Un.getters.rootElements.find((function(n){return"bpmn:Signal"===n.$type&&n.name===e&&n.id!==t.signalId}));return n?this.$t("Signal Name is duplicated"):""},confirmDeleteSignal:function(){var e=this;this.showConfirmDelete=!1;var t=Un.getters.rootElements.findIndex((function(t){return t.id===e.deleteSignal.id}));t>-1&&Un.getters.rootElements.splice(t,1)},removeSignal:function(e){this.showConfirmDelete=!0,this.deleteSignal=e},toggleConfigSignal:function(){this.can("view-signals")?this.showListSignals=!this.showListSignals:window.ProcessMaker.alert(this.$t("You do not have permission to view signals"),"danger")},editSignal:function(e){this.signalId=e.id,this.signalName=e.name,this.showEditSignal=!0},getSignalById:function(e){return Un.getters.rootElements.find((function(t){return t.id===e}))},change:function(e){if(!e)return this.$emit("input",""),void this.refreshVueMultiselectValue();var t=this.getSignalById(e.id);t||(t=window.ProcessMaker.$modeler.moddle.create("bpmn:Signal",{id:e.id,name:e.name}),Un.getters.rootElements.push(t)),this.$emit("input",(0,Er.get)(e,this.trackBy)),this.refreshVueMultiselectValue()},refreshVueMultiselectValue:function(){var e=this;this.$nextTick((function(){var t=e;while(t&&"vue-form-renderer"!==t.$options._componentTag)t=t.$parent;t&&t.$emit("update",t.transientData)}))},showAddSignal:function(){this.can("create-signals")?(this.showNewSignal=!0,this.signalId="",this.signalName=""):window.ProcessMaker.alert(this.$t("You do not have permission to add new signals"),"danger")},cancelAddSignal:function(){this.showNewSignal=!1,this.showEditSignal=!1},updateSignal:function(){this.getSignalById(this.signalId).name=this.signalName,this.showEditSignal=!1},addSignal:function(){var e=window.ProcessMaker.$modeler.moddle.create("bpmn:Signal",{id:this.signalId,name:this.signalName});Un.getters.rootElements.push(e),this.showNewSignal=!1},updateOptions:function(e){this.options=(0,Er.uniqBy)([].concat(W(e),W(this.localSignals)),"id")},loadOptions:function(e){var t=this;if(this.can("view-signals")){var n=this.pmql;window.window.ProcessMaker.apiClient.get(this.api,{params:{filter:e,pmql:n}}).then((function(e){t.updateOptions(e.data.data||[])}))}},loadSelected:function(e){var t=Un.getters.rootElements.find((function(t){return t.id===e}));t?this.selectedOption={id:t.id,name:t.name}:(this.$emit("input",""),this.refreshVueMultiselectValue())},loadOptionsDebounced:function(){},can:function(e){return(0,Er.get)(window,"ProcessMaker.modeler.signalPermissions.".concat(e),!1)}},watch:{value:{immediate:!0,handler:function(e){var t=this;this.selectedOption=this.options.find((function(n){return(0,Er.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}},ed=Ql,td=(f(59244),f(34924),fr(ed,Zl,Kl,!1,null,"607e6d70",null)),nd=td.exports;function rd(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{component:nd,config:{label:"Signal",name:"signalRef",helper:e,canEdit:t}}}var od={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=o[0].get("signalRef");e.signalRef=i?i.id:""}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r,o){for(var i in lc()(e,["$type","eventDefinitions","signalRef"]))t.definition[i]!==e[i]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i]));var s=o.rootElements.find((function(t){return t.id===e.signalRef}));!s&&e.signalRef&&(s=r.create("bpmn:Signal",{id:e.signalRef,name:e.signalRef}),o.rootElements.push(s)),t.definition.get("eventDefinitions")[0].signalRef=s}},id="processmaker-modeler-signal-end-event",sd=ac()(ho()(Wa),Qr(Qr({},od),{},{id:id,component:Jl,control:!1,label:ro[id],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(ro[id]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Select the signal reference that this element throws")]}]}]})),ad=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},cd=[],ld={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs,tc],data:function(){return{shape:new ma,definition:null,dropdownData:[{label:to["processmaker-modeler-start-event"],nodeType:"processmaker-modeler-start-event",dataTest:"switch-to-start-event"},{label:to["processmaker-modeler-start-timer-event"],nodeType:"processmaker-modeler-start-timer-event",dataTest:"switch-to-start-timer-event"},{label:to["processmaker-modeler-signal-start-event"],nodeType:"processmaker-modeler-signal-start-event",dataTest:"switch-to-signal-start-event"},{label:to["processmaker-modeler-message-start-event"],nodeType:"processmaker-modeler-message-start-event",dataTest:"switch-to-message-start-event"},{label:to["processmaker-modeler-conditional-start-event"],nodeType:"processmaker-modeler-conditional-start-event",dataTest:"switch-to-conditional-start-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape.set("type","processmaker.components.nodes.startEvent.Shape");var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({body:{stroke:He,fill:Ve},label:{text:this.node.definition.get("name"),refY:"130%"},image:{"ref-x":5,"ref-y":5,width:e.get("width")-10,height:e.get("height")-10}}),this.shape.addTo(this.graph),this.shape.component=this}},dd=ld,ud=fr(dd,ad,cd,!1,null,null,null),hd=ud.exports,pd=f(27879),fd=f.n(pd);function md(e){if(!e)return!1;var t=JSON.parse(e);return t&&t.web_entry&&"DISABLED"!==t.web_entry.mode}var gd,vd,bd,yd,wd,xd,kd,Cd,Sd={extends:hd,watch:{"node.definition.config":{immediate:!0,handler:function(e){if(md(e))return this.nodeIcon=fd(),void this.shape.attr("image/xlink:href",ec(fd(),this.node));this.nodeIcon=null,this.shape.attr("image/xlink:href",null)}}}},Ed=Sd,Ad=fr(Ed,gd,vd,!1,null,null,null),_d=Ad.exports,Td=36,Md={bpmnType:"bpmn:StartEvent",control:!1,category:"BPMN",diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:Td,width:Td,x:null,y:null})})},validateIncoming:function(){return!1},inspectorConfig:[{items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-start-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Pd="processmaker-modeler-start-event",Id=ac()(ho()(Md),{id:Pd,component:_d,control:!0,icon:f(34954),label:to[Pd],rank:10,items:[{icon:f(34954),label:to[Pd],control:!0,bpmnType:"bpmn:StartEvent",rank:10,id:"processmaker-modeler-start-event"},{icon:f(42123),label:to["processmaker-modeler-message-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:11,id:"processmaker-modeler-message-start-event"},{icon:f(47658),label:to["processmaker-modeler-conditional-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:12,id:"processmaker-modeler-conditional-start-event"},{icon:f(43762),label:to["processmaker-modeler-signal-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:13,id:"processmaker-modeler-signal-start-event"},{icon:f(8519),label:to["processmaker-modeler-start-timer-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:14,id:"processmaker-modeler-start-timer-event"}],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[Pd])})}}),Od=f(69766),Dd=f.n(Od),Nd={extends:hd,data:function(){return{nodeIcon:Dd()}},mounted:function(){this.shape.attr({image:{"ref-x":5,"ref-y":3}})}},Rd=Nd,Bd=fr(Rd,bd,yd,!1,null,null,null),Ld=Bd.exports,jd={label:"Request Variable",name:"config",helper:"Enter the request variable that will store the signal payload","data-cy":"signal-request-variable"},Fd=jd,zd="processmaker-modeler-signal-start-event",Ud=ac()(ho()(Md),Qr(Qr({},od),{},{id:zd,component:Ld,label:to[zd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[zd]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Signal that will trigger this start event",!1),{component:"FormInput",config:Fd}]}]}]})),qd=f(47179),Vd=f.n(qd),Hd={extends:hd,data:function(){return{nodeIcon:Vd()}}},Wd=Hd,Gd=fr(Wd,wd,xd,!1,null,null,null),$d=Gd.exports,Xd="processmaker-modeler-message-start-event",Yd=ac()(ho()(Md),Qr(Qr({},ql),{},{id:Xd,component:$d,label:to[Xd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[Xd]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Message that will trigger this start event")]}]}]})),Jd=f(93698),Zd=f.n(Jd),Kd={extends:hd,data:function(){return{nodeIcon:Zd()}}},Qd=Kd,eu=fr(Qd,kd,Cd,!1,null,null,null),tu=eu.exports,nu=(f(82481),function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-group"},[t("form-date-picker",{staticClass:"p-0",attrs:{"emit-iso":!0,"data-test":"start-date-picker","data-format":"datetime",label:e.$t("Start date"),placeholder:e.$t("Start date"),"control-class":"form-control",value:e.startDate,helper:e.$t(e.startDateHelper)},on:{input:e.setStartDate}}),e.hasRepeat?[t("label",{},[e._v(e._s(e.$t(e.repeatLabel)))]),t("b-form-group",{staticClass:"m-0 mb-3 p-0"},[t("b-form-input",{staticClass:"d-inline-block w-50",attrs:{type:"number",min:"1",max:"99","data-test":"repeat-input"},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-form-select",{staticClass:"d-inline-block w-50 periodicity",attrs:{"data-test":"repeat-on-select"},model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},[t("option",{attrs:{value:"day"}},[e._v(e._s(e.$t("day")))]),t("option",{attrs:{value:"week"}},[e._v(e._s(e.$t("week")))]),t("option",{attrs:{value:"month"}},[e._v(e._s(e.$t("month")))]),t("option",{attrs:{value:"year"}},[e._v(e._s(e.$t("year")))])]),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.repeatHelper)))])],1)]:e._e(),e.isWeeklyPeriodSelected?t("weekday-select",{attrs:{selectWeekdays:e.selectedWeekdays,periodicityValue:e.periodicityValue,repeat:e.repeat,"start-date":e.startDate,"end-date":e.endDate,ends:e.ends,times:e.times},model:{value:e.expression,callback:function(t){e.expression=t},expression:"expression"}}):e._e(),e.hasEnds?[t("label",{staticClass:"mt-1"},[e._v(e._s(e.$t("Ends")))]),t("div",[t("b-form-group",{staticClass:"m-0 mb-2"},[t("b-form-radio",{attrs:{"data-test":"ends-never",name:"optradio",value:"never"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("Never")))])],1),t("b-form-group",{staticClass:"p-0 mb-1",attrs:{description:"".concat(e.$t("Click On to select a date"),".")}},[t("b-form-radio",{staticClass:"pl-3 ml-2 mb-1",attrs:{name:"optradio",value:"ondate","data-test":"ends-on"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("On")))]),t("form-date-picker",{staticClass:"form-date-picker p-0 m-0",class:{"date-disabled":"ondate"!==e.ends},attrs:{"emit-iso":!0,"data-test":"end-date-picker",disabled:"ondate"!==e.ends,placeholder:e.$t("End date"),"data-format":"datetime","control-class":"form-control",value:e.endDate,name:"end date"},on:{input:e.setEndDate}})],1),t("b-form-group",{staticClass:"mt-0 p-0",attrs:{description:"".concat(e.$t("Click After to enter how many occurrences to end the timer control"),".")}},[t("b-form-radio",{staticClass:"pl-3 ml-2 mb-1",attrs:{"data-test":"ends-after",name:"optradio",value:"after"},model:{value:e.ends,callback:function(t){e.ends=t},expression:"ends"}},[e._v(e._s(e.$t("After")))]),t("b-form-input",{staticClass:"w-25 pl-2 pr-1 d-inline-block",attrs:{"data-test":"ends-after-input",type:"number",min:"0",max:"99",disabled:"after"!==e.ends},model:{value:e.times,callback:function(t){e.times=t},expression:"times"}}),t("b-form-input",{staticClass:"w-75 d-inline-block occurrences-text",attrs:{readonly:"after"!==e.ends,value:e.$t("occurrences")}})],1)],1)]:e._e()],2)}),ru=[],ou=f(26985),iu=function(){var e=this,t=e._self._c;return e.cycleManager.isWeeklyPeriodSelected()?t("div",{staticClass:"mb-2"},[t("label",{},[e._v(e._s(e.$t(e.weekLabel)))]),t("div",e._l(e.weekdays,(function(n){return t("span",{key:n.day,staticClass:"badge badge-pill weekday mb-1",class:e.cycleManager.weekdayStyle(n),attrs:{"data-test":"day-".concat(n.day)},on:{click:function(t){return e.clickWeekDay(n)}}},[e._v(" "+e._s(e.$t(n.initial))+" ")])})),0),e.repeatOnValidationError?t("small",{staticClass:"text-danger"},[e._v(e._s(e.repeatOnValidationError))]):e._e(),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.periodicityHelper)))])]):e._e()},su=[];function au(e){return null===e?"":"string"===typeof e?e:e.isLuxonDateTime?e.toISO():e.toISOString()}function cu(e,t,n,r,o){var i=au(e),s=au(t),a="after"===r?o:"",c="ondate"===r?s:"";return"R".concat(a,"/").concat(i,"/").concat(n)+(c?"/"+c:"")}function lu(e,t){return"P".concat(e).concat(t)}var du,uu,hu=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"never",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"1";d(this,e),y(this,"_startDate",void 0),y(this,"_repeat",void 0),y(this,"_periodicityValue",void 0),y(this,"_selectedWeekdays",void 0),y(this,"_endDate",void 0),y(this,"_ends",void 0),y(this,"_times",void 0),this._startDate=this.sanitizeDate(t),this._repeat=n,this._periodicityValue=r,this._selectedWeekdays=o,this._endDate=this.sanitizeDate(i),this._ends=s,this._times=a}return g(e,[{key:"startDate",set:function(e){this._startDate=this.sanitizeDate(e)}},{key:"endDate",set:function(e){this._endDate=this.sanitizeDate(e)}},{key:"ends",set:function(e){this._ends=e}},{key:"times",set:function(e){this._times=e}},{key:"repeat",set:function(e){this._repeat=e}},{key:"periodicityValue",set:function(e){this._periodicityValue=e}},{key:"selectedWeekdays",set:function(e){this._selectedWeekdays=e}},{key:"sanitizeDate",value:function(e){return null===e?e:"string"===typeof e?ou.DateTime.fromISO(e).toUTC():e.isLuxonDateTime?e.toUTC():ou.DateTime.fromJSDate(e).toUTC()}},{key:"getFormattedDateWithWeekdayIntervals",value:function(){var e=this,t=lu(this._repeat,this._periodicityValue),n=[this._startDate.toISO()];return this._selectedWeekdays.forEach((function(r){var o=e.getWeekDayDate(r),i=cu(o,e._endDate,t,e._ends,e._times);n.push(i)})),n.join("|")}},{key:"getWeekDayDate",value:function(e){var t=ou.DateTime.fromISO(this._startDate,{zone:"utc"}),n=t.set({weekday:e});return n.toMillis()<t.toMillis()&&(n=n.plus({days:7})),n.toUTC()}},{key:"dateIntervalString",value:function(){if(this.isWeeklyPeriodSelected()&&this.hasSelectedWeekdays())return this.getFormattedDateWithWeekdayIntervals();var e=lu(this._repeat,this._periodicityValue);return cu(this._startDate,this._endDate,e,this._ends,this._times)}},{key:"isWeeklyPeriodSelected",value:function(){return"W"===this._periodicityValue}},{key:"hasSelectedWeekdays",value:function(){return this._selectedWeekdays.length>0}},{key:"weekdayStyle",value:function(e){var t=this._startDate.toLocal().weekday;return[e.selected?"badge-primary":"badge-light",{"border border-primary":t===e.day}]}}]),e}(),pu={props:{selectWeekdays:{type:Array,default:function(){return[]}},startDate:{type:String,default:ou.DateTime.local().toUTC().toISO()},endDate:{type:String,default:null},ends:{type:String,default:"never"},times:{type:[Number,String],default:1},periodicityValue:{type:String,required:!0},repeat:{type:[String,Number],default:1},hasEnds:{type:Boolean,default:!0},weekLabel:{type:String,default:"Repeat on"},periodicityHelper:{type:String,default:"Select the day(s) of the week in which to trigger this element"}},data:function(){return{DateTime:ou.DateTime,weekdays:[{day:7,initial:"S",selected:!1},{day:1,initial:"M",selected:!1},{day:2,initial:"T",selected:!1},{day:3,initial:"W",selected:!1},{day:4,initial:"T",selected:!1},{day:5,initial:"F",selected:!1},{day:6,initial:"S",selected:!1}],cycleManager:new hu(this.startDate,this.repeat,this.periodicityValue,this.selectedWeekdays,this.endDate,this.ends,this.times)}},watch:{startDate:function(e){this.cycleManager.startDate=e},endDate:function(e){this.cycleManager.endDate=e},ends:function(e){this.cycleManager.ends=e},times:function(e){this.cycleManager.times=e},repeat:function(e){this.cycleManager.repeat=e},periodicityValue:function(e){this.cycleManager.periodicityValue=e},selectedWeekdays:function(e){this.cycleManager.selectedWeekdays=e},dateIntervalString:function(){this.update()}},mounted:function(){var e=this;this.selectWeekdays.forEach((function(t){var n=e.weekdays.find((function(e){return e.day===t}));n&&(n.selected=!0)}))},computed:{repeatOnValidationError:function(){var e=this.weekdays.filter((function(e){var t=e.selected;return t})).length;return!this.cycleManager.isWeeklyPeriodSelected()||e>0?null:"You must select at least one day."},dateIntervalString:function(){return this.cycleManager.dateIntervalString()},selectedWeekdays:function(){return this.weekdays.filter((function(e){var t=e.selected;return t})).map((function(e){var t=e.day;return t}))}},methods:{clickWeekDay:function(e){e.selected=!e.selected},update:function(){this.$emit("input",this.dateIntervalString)}},destroyed:function(){this.$emit("input",null)}},fu=pu,mu=(f(41168),fr(fu,iu,su,!1,null,"4ae18478",null)),gu=mu.exports,vu={day:"D",week:"W",month:"M",year:"Y"},bu={components:{WeekdaySelect:gu},props:{value:[Array,String],hasEnds:{type:Boolean,default:!0},hasRepeat:{type:Boolean,default:!0},repeatLabel:{type:String,default:"Repeat every"},weekLabel:{type:String,default:"Repeat on"},startDateHelper:{type:String,default:"Select the date to initially trigger this element"},repeatHelper:{type:String,default:"Set the periodic interval to trigger this element again"},periodicityHelper:{type:String,default:"Select the day(s) of the week in which to trigger this element"}},data:function(){return{DateTime:ou.DateTime,expression:null,startDate:ou.DateTime.local().toUTC().toISO(),repeat:"1",periodicity:"week",ends:"never",endDate:ou.DateTime.local().toUTC().toISO(),times:"1",selectedWeekdays:[]}},created:function(){this.parseTimerConfig(this.value)},watch:{timerExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{periodicityValue:function(){return vu[this.periodicity]},timerExpression:function(){if(this.isWeeklyPeriodSelected()&&this.expression)return this.expression;var e=lu(this.repeat,this.periodicityValue);return cu(this.startDate,this.endDate,e,this.ends,this.times)}},methods:{isWeeklyPeriodSelected:function(){return"week"===this.periodicity},setStartDate:function(e){this.startDate=ou.DateTime.fromISO(e,{zone:"utc"}).set({seconds:0,milliseconds:0}).toUTC().toISO()},setEndDate:function(e){var t=ou.DateTime.fromISO(this.startDate,{zone:"utc"});this.endDate=ou.DateTime.fromISO(e,{zone:"utc"}).set({hours:t.hour,minutes:t.minute,seconds:0,milliseconds:0}).toUTC().toISO()},parseTimerConfig:function(e){var t,n,r=this;if(null!==(t=e[0])&&void 0!==t&&null!==(n=t.timeCycle)&&void 0!==n&&n.body)try{var o=!1,i=e[0].timeCycle.body.split("|");i.forEach((function(e){if("R"!==e.substr(0,1))r.startDate=e,o=!0;else{var t=e.match(/R(\d*)\/([^/]+)\/P(\d+)(\w)(?:\/([^/]+))?/);if(t){if(r.times=t[1]||"1",r.repeat=t[3],r.periodicity=Object.keys(vu).find((function(e){return vu[e]===t[4]})),o||(r.startDate=t[2],o=!0),r.isWeeklyPeriodSelected()){var n=ou.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;r.selectedWeekdays.push(n)}r.endDate=t[5]||ou.DateTime.local().toUTC().toISO(),r.ends=t[5]?"ondate":t[1]?"after":"never"}}o=!0}))}catch(s){this.resetTimerExpression()}},resetTimerExpression:function(){this.startDate=ou.DateTime.local().toUTC().toISO(),this.times="1",this.repeat="1",this.periodicity="week",this.endDate=ou.DateTime.local().toUTC().toISO(),this.ends="never",this.expression=null,this.selectedWeekdays=[]}}},yu=bu,wu=(f(33383),f(66667),fr(yu,nu,ru,!1,null,"72709fd0",null)),xu=wu.exports,ku="processmaker-modeler-start-timer-event",Cu=ac()(ho()(Md),{id:ku,component:tu,label:to[ku],definition:function(e,t){var n=e.create("bpmn:StartEvent",{name:t(to[ku])});return n.eventDefinitions=[e.create("bpmn:TimerEventDefinition",{timeCycle:e.create("bpmn:Expression",{body:""})})],n},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var a=e[i];if("object"===s(a))continue;var c=o.get(i)[0].timeCycle;if(c&&c.body===a)continue;var l={timeCycle:r.create("bpmn:Expression",{body:a})},d=[r.create("bpmn:TimerEventDefinition",l)];n(t,"eventDefinitions",d),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:d})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-start-timer-timing-control"},items:[{component:xu,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Va,Na]}]}),Su=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,dropdownData:e.dropdownData}},e.$listeners))},Eu=[],Au=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"circle",selector:"body2"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.intermediateEvent.Shape",size:{width:36,height:36},attrs:Qr(Qr(Qr(Qr(Qr(Qr({body:{fill:We,stroke:Ge},body2:{cx:18,cy:18,r:15,"stroke-width":2,fill:We,stroke:Ge},image:{"ref-x":5,"ref-y":5,ref:"circle",width:26,height:26}},Qs("topLeft",{ref:"circle","ref-y":-20,"ref-padding-x":0})),Qs("topCenter",{ref:"circle","ref-y":-20})),Qs("topRight",{ref:"circle","ref-x":26,"ref-y":-20,"ref-padding-x":0},-1)),Qs("bottomLeft",{ref:"circle","ref-padding-x":0,"ref-padding-y":-40})),Qs("bottomCenter",{ref:"circle","ref-padding-y":-40})),Qs("bottomRight",{ref:"circle","ref-x":26,"ref-padding-x":0,"ref-padding-y":-40},-1))},F.shapes.standard.Circle.prototype.defaults)}),_u={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs],data:function(){return{shape:null,definition:null,dropdownData:[{label:lo["processmaker-modeler-intermediate-catch-timer-event"],nodeType:"processmaker-modeler-intermediate-catch-timer-event",dataTest:"switch-to-intermediate-timer-catch-event"},{label:lo["processmaker-modeler-intermediate-signal-catch-event"],nodeType:"processmaker-modeler-intermediate-signal-catch-event",dataTest:"switch-to-intermediate-signal-catch-event"},{label:lo["processmaker-modeler-intermediate-signal-throw-event"],nodeType:"processmaker-modeler-intermediate-signal-throw-event",dataTest:"switch-to-intermediate-signal-throw-event"},{label:lo["processmaker-modeler-intermediate-message-catch-event"],nodeType:"processmaker-modeler-intermediate-message-catch-event",dataTest:"switch-to-intermediate-message-catch-event"},{label:lo["processmaker-modeler-intermediate-message-throw-event"],nodeType:"processmaker-modeler-intermediate-message-throw-event",dataTest:"switch-to-intermediate-message-throw-event"},{label:lo["processmaker-modeler-intermediate-conditional-catch-event"],nodeType:"processmaker-modeler-intermediate-conditional-catch-event",dataTest:"switch-to-intermediate-conditional-catch-event"}]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Au;var e=this.node.diagram.bounds;this.shape.position(e.get("x"),e.get("y")),this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({label:{text:this.node.definition.get("name"),refY:"130%"}}),this.shape.addTo(this.graph),this.shape.component=this}},Tu=_u,Mu=fr(Tu,Su,Eu,!1,null,null,null),Pu=Mu.exports,Iu=f(39653),Ou=f.n(Iu),Du={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Ou()}}},Nu=Du,Ru=fr(Nu,du,uu,!1,null,null,null),Bu=Ru.exports,Lu=function(){var e=this,t=e._self._c;return t("div",[t("label",[e._v(e._s(e.$t("Type")))]),t("b-input-group",[t("b-form-select",{attrs:{value:e.timerPropertyName,"data-test":"intermediateTypeSelect"},on:{change:e.changeType}},[t("option",{attrs:{value:"timeDuration"}},[e._v(e._s(e.$t("Duration")))]),t("option",{attrs:{value:"timeDate"}},[e._v(e._s(e.$t("Date/Time")))]),t("option",{attrs:{value:"timeCycle"}},[e._v(e._s(e.$t("Cycle")))])])],1),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.typeHelper)))]),t(e.component,{tag:"component",attrs:{"has-ends":!1,"repeat-label":"Wait for","week-label":"Every"},model:{value:e.timerProperty,callback:function(t){e.timerProperty=t},expression:"timerProperty"}})],1)},ju=[],Fu=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("label",[e._v(e._s(e.$t("Duration")))]),t("b-input-group",[t("b-form-input",{staticClass:"form-control control repeat",attrs:{type:"number",min:"1","data-test":e.repeatInput},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-input-group-append",[t("b-form-select",{model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},e._l(e.periods,(function(n){return t("option",{key:n.name,domProps:{value:n}},[e._v(e._s(e.$t(n.name)))])})),0)],1),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Select the duration of the timer")))])],1)],1)},zu=[],Uu=f(10928),qu=f.n(Uu),Vu={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},Hu={props:["value","repeatInput"],data:function(){var e=[{name:Vu.minute,value:"M",isTime:!0},{name:Vu.hour,value:"H",isTime:!0},{name:Vu.day,value:"D"},{name:Vu.week,value:"W"},{name:Vu.month,value:"M"}];return{repeat:null,periodicity:null,periods:e}},watch:{value:{handler:function(e){this.periodicity=this.getPeriodFromDelayString(e),this.repeat=this.getRepeatNumberFromDelayString(e)},immediate:!0},durationExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{durationExpression:function(){return this.periodicity.isTime?"PT".concat(this.repeat).concat(this.periodicity.value):"P".concat(this.repeat).concat(this.periodicity.value)}},methods:{getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var r=t?Vu.minute:Vu.month;return this.periods.find((function(e){var t=e.name;return t===r}))}return this.periods.find((function(e){var t=e.value;return t===n}))},isTimePeriod:function(e){return"T"===e[1]},getRepeatNumberFromDelayString:function(e){var t=e.match(/\d+/);return t&&t[0]}}},Wu=Hu,Gu=fr(Wu,Fu,zu,!1,null,null,null),$u=Gu.exports,Xu=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("form-date-picker",{staticClass:"p-0",attrs:{"emit-iso":!0,"data-format":"datetime",label:e.$t("Wait until specific date/time"),"control-class":"form-control",value:e.convertFromUTC(e.value),"data-test":"date-picker",helper:"Select the date to trigger this element"},on:{input:e.emitValue}})],1)},Yu=[],Ju={data:function(){return{DateTime:ou.DateTime}},props:{value:String},methods:{getTimezone:function(){return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.timezone||"local"},convertFromUTC:function(e){return ou.DateTime.fromISO(e,{zone:"utc"}).setZone(this.getTimezone()).toISO()},emitValue:function(e){var t=ou.DateTime.fromISO(e).toUTC().toISO();this.$emit("input",t)}}},Zu=Ju,Ku=fr(Zu,Xu,Yu,!1,null,null,null),Qu=Ku.exports,eh=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-3"},[t("label",[e._v(e._s(e.$t("Recurring loop repeats at time interval set below")))]),t("b-input-group",[t("b-form-input",{staticClass:"form-control control repeat",attrs:{type:"number",min:"1","data-test":e.repeatInput},model:{value:e.repeat,callback:function(t){e.repeat=t},expression:"repeat"}}),t("b-input-group-append",[t("b-form-select",{attrs:{"data-test":"periods"},model:{value:e.periodicity,callback:function(t){e.periodicity=t},expression:"periodicity"}},e._l(e.periods,(function(n){return t("option",{key:n.name,domProps:{value:n}},[e._v(e._s(e.$t(n.name)))])})),0)],1)],1),e.periodicity&&e.periodicity.isWeek?t("weekday-select",{staticClass:"pt-3",attrs:{selectWeekdays:e.selectedWeekdays,periodicityValue:e.periodicity.value,repeat:e.repeat},model:{value:e.expression,callback:function(t){e.expression=t},expression:"expression"}}):e._e()],1)},th=[],nh={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},rh={components:{WeekdaySelect:gu},props:["value","repeatInput"],data:function(){var e=[{name:nh.minute,value:"M",isTime:!0},{name:nh.hour,value:"H",isTime:!0},{name:nh.day,value:"D"},{name:nh.week,value:"W",isWeek:!0},{name:nh.month,value:"M"}];return{DateTime:ou.DateTime,repeat:null,periodicity:null,expression:null,periods:e,selectedWeekdays:null}},watch:{value:{handler:function(e){this.periodicity=this.getPeriodFromDelayString(e),this.repeat=this.getRepeatNumberFromDelayString(e),this.selectedWeekdays=this.getSelectedWeekdaysFromDelayString(e)},immediate:!0},cycleExpression:{handler:function(e){this.$emit("input",e)},immediate:!0}},computed:{cycleExpression:function(){return this.periodicity.isTime?"R/PT".concat(this.repeat).concat(this.periodicity.value):this.periodicity.isWeek&&this.expression?this.expression:"R/P".concat(this.repeat).concat(this.periodicity.value)}},methods:{getSelectedWeekdaysFromDelayString:function(e){var t=e.split("|"),n=[];return t.forEach((function(e){var t=e.match(/R(\d*)\/([^/]+)\/PT?(\d+)(\w)(?:\/([^/]+))?/);if(t){var r=ou.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.push(r)}})),n},getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var r=t?nh.minute:nh.month;return this.periods.find((function(e){var t=e.name;return t===r}))}return this.periods.find((function(e){var t=e.value;return t===n}))},isTimePeriod:function(e){return"T"===e[3]},getRepeatNumberFromDelayString:function(e){var t=e.match(/PT?(\d+)/);return t?t[1]:1}}},oh=rh,ih=fr(oh,eh,th,!1,null,null,null),sh=ih.exports,ah="PT1H",ch={timeDuration:"DurationExpression",timeDate:"DateTimeExpression",timeCycle:"CycleExpression"},lh={props:{value:{type:Object},typeHelper:{type:String,default:"Select the type of delay"}},components:{DurationExpression:$u,DateTimeExpression:Qu,CycleExpression:sh},computed:{component:function(){return ch[this.timerPropertyName]},timerProperty:{get:function(){return this.value.body},set:function(e){this.emitChange(this.value.type,e)}},timerPropertyName:function(){return this.value.type}},methods:{changeType:function(e){var t=this.isDelayType(e)||this.isCycleType(e)?ah:ou.DateTime.local().toUTC().toISO();this.emitChange(e,t)},isDelayType:function(e){return ch[e]===ch.timeDuration},isCycleType:function(e){return ch[e]===ch.timeCycle},emitChange:function(e,t){this.$emit("input",{type:e,body:t})}}},dh=lh,uh=fr(dh,Lu,ju,!1,null,null,null),hh=uh.exports,ph="processmaker-modeler-intermediate-catch-timer-event",fh={id:ph,component:Bu,bpmnType:"bpmn:IntermediateCatchEvent",control:!0,category:"BPMN",icon:f(58455),label:"Intermediate Event",rank:20,items:[{icon:f(24462),label:"Intermediate Timer Event",control:!0,rank:21,id:"processmaker-modeler-intermediate-catch-timer-event"},{icon:f(48351),label:"Intermediate Signal Catch Event",control:!0,rank:22,id:"processmaker-modeler-intermediate-signal-catch-event"},{icon:f(20894),label:"Intermediate Signal Throw Event",control:!0,rank:23,id:"processmaker-modeler-intermediate-signal-throw-event"},{icon:f(5294),label:"Intermediate Message Catch Event",control:!0,rank:24,id:"processmaker-modeler-intermediate-message-catch-event"},{icon:f(16383),label:"Intermediate Message Throw Event",control:!0,rank:25,id:"processmaker-modeler-intermediate-message-throw-event"},{icon:f(74726),label:"Intermediate Conditional Catch Event",control:!0,rank:26,id:"processmaker-modeler-intermediate-conditional-catch-event"}],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[ph]),eventDefinitions:[e.create("bpmn:TimerEventDefinition",{timeDuration:e.create("bpmn:Expression",{body:ah})})]})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=Object.keys(o[0])[1],s=o[0][i].body;e[r]={type:i,body:s}}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=o.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,r.create("bpmn:Expression",{body:c})),u=[r.create("bpmn:TimerEventDefinition",d)];n(t,"eventDefinitions",u),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventDefinitions",value:u})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{name:lo[ph],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-timer-config"},items:[{component:"FormInput",config:_a}]},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-intermediate-timer-event-timing-control"},items:[{component:hh,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Va,Na]}]};function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#000",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#fff";return{image:{width:20,height:20,y:3,x:3},body:{stroke:e,strokeWidth:t,fill:n},body2:{stroke:e,strokeWidth:t,fill:n}}}var gh,vh,bh,yh,wh,xh,kh,Ch,Sh,Eh,Ah=f(89454),_h=f.n(Ah),Th={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:_h()}},mounted:function(){var e=mh(Ge,2,We);this.shape.attr(e)}},Mh=Th,Ph=fr(Mh,gh,vh,!1,null,null,null),Ih=Ph.exports,Oh={id:"processmaker-modeler-intermediate-message",component:Pu,bpmnType:"bpmn:IntermediateEvent",control:!0,category:"BPMN",label:"Intermediate Message Event",definition:function(e,t){return e.create("bpmn:IntermediateEvent",{name:t("Intermediate Message Event"),eventDefinitions:[e.create("bpmn:MessageEventDefinition",{})]})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:"Intermediate Message Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-message-event"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Dh="processmaker-modeler-intermediate-message-catch-event",Nh=ac()(ho()(Oh),Qr(Qr({},ql),{},{id:Dh,component:Ih,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[Dh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[Dh]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Message that will catch this intermediate event")]}]}]})),Rh=f(74225),Bh=f.n(Rh),Lh={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Bh()}},mounted:function(){this.shape.attr({image:{"ref-x":7,"ref-y":5,width:22,height:22}})}},jh=Lh,Fh=fr(jh,bh,yh,!1,null,null,null),zh=Fh.exports,Uh={id:"processmaker-modeler-intermediate-event",component:Pu,bpmnType:"bpmn:IntermediateEvent",control:!0,category:"BPMN",label:"Intermediate Event",definition:function(e,t){return e.create("bpmn:IntermediateEvent",{name:t("Intermediate Event")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:"Intermediate Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-intermediate-gateway-config"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},qh="processmaker-modeler-intermediate-signal-catch-event",Vh=ac()(ho()(Uh),Qr(Qr({},od),{},{id:qh,component:zh,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[qh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[qh]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Signal that will catch this intermediate event",!1),{component:"FormInput",config:Fd}]}]}]})),Hh=f(98358),Wh=f.n(Hh),Gh={extends:Pu,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{message:this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),nodeIcon:Wh()}},methods:{addMessageRef:function(){this.node.definition.get("eventDefinitions")[0].messageRef?this.message=this.node.definition.get("eventDefinitions")[0].messageRef:(this.message=this.moddle.create("bpmn:Message",{id:"".concat(this.id,"_message"),name:"".concat(this.id,"_message")}),this.rootElements.push(this.message),this.node.definition.get("eventDefinitions")[0].messageRef=this.message)}},mounted:function(){this.shape.attr({image:{width:22,height:20,y:3,x:2}}),this.addMessageRef()},destroyed:function(){Cs()(this.rootElements,this.message),Un.commit("removeMessageRef",this.message)}},$h=Gh,Xh=fr($h,wh,xh,!1,null,null,null),Yh=Xh.exports,Jh="processmaker-modeler-intermediate-message-throw-event",Zh=ac()(ho()(Oh),Qr(Qr({},ql),{},{id:Jh,component:Yh,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:lo[Jh],icon:f(16383),definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(lo[Jh]),eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Fl("Select the message reference that this element throws")]}]}]})),Kh=f(67471),Qh=f.n(Kh),ep={extends:Pu,mixins:[tc],props:["moddle","rootElements","id"],data:function(){return{nodeIcon:Qh()}},mounted:function(){this.shape.attr({image:{"ref-x":7,"ref-y":5,width:22,height:22}})}},tp=ep,np=fr(tp,kh,Ch,!1,null,null,null),rp=np.exports,op="processmaker-modeler-intermediate-signal-throw-event",ip=ac()(ho()(Uh),Qr(Qr({},od),{},{id:op,component:rp,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:lo[op],definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(lo[op]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},rd("Select the signal reference that this element throws")]}]}]})),sp=f(94081),ap=f.n(sp),cp={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.attr({image:{"ref-x":9,"ref-y":9,width:e.get("width")-18,height:e.get("height")-18}})}},lp=cp,dp=fr(lp,Sh,Eh,!1,null,null,null),up=dp.exports;function hp(){return[{component:"FormInput",config:{label:"Condition",name:"condition",helper:"Expression to evaluate condition"}}]}var pp={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return"eventDefinitions"===r?e.condition=o[0].get("condition").body:e[r]=o,e}),{})},inspectorHandler:function(e,t,n){for(var r in lc()(e,["$type","eventDefinitions"]))t.definition[r]!==e[r]&&("condition"===r?(t.definition.get("eventDefinitions")[0].get("condition").body=e[r],window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]})):(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:r,value:e[r]}),n(t,r,e[r])))}},fp="processmaker-modeler-intermediate-conditional-catch-event",mp=ac()(ho()(Uh),Qr(Qr({},pp),{},{id:fp,component:up,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:lo[fp],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(lo[fp]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),gp=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"boundary-event-dropdown-data":e.boundaryEventDropdownData,"dropdown-data":e.dropdownData,"hide-color-dropdown":e.hideColorDropdown,showCustomIconPicker:!0,iconName:this.iconName},on:{"set-custom-icon-name":e.setCustomIconName,"reset-custom-icon-name":e.resetCustomIconName}},e.$listeners))},vp=[],bp=F.shapes.standard.Rectangle.extend({markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"},Ks("topLeft"),Ks("topCenter"),Ks("topRight"),Ks("bottomLeft"),Ks("bottomCenter"),Ks("bottomRight")],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.task.Shape",size:{width:100,height:60},attrs:Qr(Qr(Qr(Qr(Qr(Qr({image:{"ref-x":4,"ref-y":4,ref:"rect",width:16,height:16,"data-test":"nodeIcon"}},Qs("topLeft",{"ref-y":4,ref:"rect"})),Qs("topCenter",{"ref-y":4,ref:"rect"})),Qs("topRight",{"ref-y":4,"ref-x":96,ref:"rect"},-1)),Qs("bottomLeft",{ref:"rect"})),Qs("bottomCenter",{ref:"rect"})),Qs("bottomRight",{"ref-x":96,ref:"rect"},-1))},F.shapes.standard.Rectangle.prototype.defaults)}),yp=76,wp=116,xp={data:function(){return{iconName:""}},watch:{shape:function(){this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},methods:{setCustomIconName:function(e){this.iconName=e},resetCustomIconName:function(){this.setCustomIconName("")},setCustomIcon:function(e){if(this.shape)try{var t=atob(e);this.updateIcon(t)}catch(n){this.updateIcon(e)}},updateIcon:function(e){var t=this.getIconURL(e);this.shape.attr("image/xlink:href",t)},getIconURL:function(e){return ec(e,this.node)}},mounted:function(){this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},kp=10,Cp=[{label:"Boundary Timer Event",nodeType:"processmaker-modeler-boundary-timer-event",dataTest:"add-boundary-timer-event"},{label:"Boundary Error Event",nodeType:"processmaker-modeler-boundary-error-event",dataTest:"add-boundary-error-event"},{label:"Boundary Signal Event",nodeType:"processmaker-modeler-boundary-signal-event",dataTest:"add-boundary-signal-event"},{label:"Boundary Conditional Event",nodeType:"processmaker-modeler-boundary-conditional-event",dataTest:"add-boundary-conditional-event"},{label:"Boundary Message Event",nodeType:"processmaker-modeler-boundary-message-event",dataTest:"add-boundary-message-event"}],Sp=Cp,Ep=f.p+"img/sequential.f86ad08b.svg",Ap=f.p+"img/parallel.cf1d1995.svg",_p=f.p+"img/loop.00441d9f.svg",Tp="bpmn:StandardLoopCharacteristics",Mp="bpmn:MultiInstanceLoopCharacteristics";function Pp(e,t,n,r){var o=e.get("loopCharacteristics"),i=[Tp,Mp];if(o&&i.includes(o.$type))if(o.$type!==Tp){var s=o.isSequential?Ep:Ap;n(t.bottomCenter,"loopCharacteristics",s)}else n(t.bottomCenter,"loopCharacteristics",_p);else r(t.bottomCenter,"loopCharacteristics")}var Ip=f.p+"img/compensation.495ae0a2.svg";function Op(e,t,n,r){e.isForCompensation?n(t.bottomCenter,"compensation",Ip):r(t.bottomCenter,"compensation")}var Dp,Np,Rp=15,Bp=2*Zs,Lp={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt,fa,Fs,xp],data:function(){return{shape:null,definition:null,dropdownData:[{label:io["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:io["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:io["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:io["processmaker-modeler-call-activity"],nodeType:"processmaker-modeler-call-activity",dataTest:"switch-to-sub-process"}],boundaryEventDropdownData:Sp,anchorPointFunction:Pt,hideColorDropdown:!1}},computed:{hasTaskMarker:function(){return!!this.shape.attr("image/xlink:href")}},watch:{"node.definition.name":function(e){var t=this.node.diagram.bounds.width;this.shape.attr("label/text",F.util.breakText(e,{width:t}));var n=this.shape.size(),r=n.height,o=this.calculateSizeOnGrid(),i=this.useTaskHeight(o)?yp:o;r!==i&&(this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment())},"node.definition.isForCompensation":function(){Op(this.node.definition,this.markers,this.$set,this.$delete)},"node.definition":{deep:!0,handler:function(){Pp(this.node.definition,this.markers,this.$set,this.$delete)}}},methods:{getElementsUnderArea:function(e){var t=e.getBBox(),n=t.x,r=t.y,o=t.width,i=t.height,s={x:n,y:r,width:o,height:i};return this.graph.findModelsInArea(s)},calculateSizeOnGrid:function(){var e=kp-yp%kp,t=Math.floor(this.shapeView.selectors.label.getBBox().height),n=t+Rp+Bp,r=this.paperManager.ceilToNearestGridMultiple(n)-e;return this.middleIsOddNumber(r)&&(r+=kp),r},useTaskHeight:function(e){return e<yp||!this.node.definition.name},middleIsOddNumber:function(e){return 1===Math.abs(e/2%2)}},mounted:function(){this.shape=new bp;var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),Op(this.node.definition,this.markers,this.$set,this.$delete),Pp(this.node.definition,this.markers,this.$set,this.$delete),this.shape.attr({body:{rx:8,ry:8},label:{text:F.util.breakText(this.node.definition.get("name"),{width:e.width}),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this}},jp=Lp,Fp=fr(jp,gp,vp,!1,null,null,null),zp=Fp.exports,Up=f(95514),qp=f.n(Up),Vp={extends:zp,mixins:[tc],data:function(){return{nodeIcon:qp()}}},Hp=Vp,Wp=fr(Hp,Dp,Np,!1,null,null,null),Gp=Wp.exports,$p=function(){var e=this,t=e._self._c;return t("div",[t("b-form-group",[t("b-form-checkbox",{attrs:{"data-test":"for-compensation",name:"for-compensation"},model:{value:e.isForCompensation,callback:function(t){e.isForCompensation=t},expression:"isForCompensation"}},[e._v(e._s(e.$t("For Compensation")))])],1)],1)},Xp=[],Yp={props:{value:{type:Object,default:function(){return{isForCompensation:!1}}}},name:"MarkerFlags",data:function(){return{isForCompensation:this.value.isForCompensation}},watch:{isForCompensation:function(e){this.$emit("input",{isForCompensation:e})}}},Jp=Yp,Zp=fr(Jp,$p,Xp,!1,null,"66aabb37",null),Kp=Zp.exports,Qp={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Da,config:Ns},{component:Kp,name:"taskMarkers",config:{label:"Marker Flags",name:"markerFlags",style:"display:none"}}]},ef=function(){var e=this,t=e._self._c;return t("div",[t("b-form-group",{attrs:{label:e.$t("Loop Mode")}},[t("b-form-select",{attrs:{id:""},on:{change:e.changeLoopType},model:{value:e.loopType,callback:function(t){e.loopType=t},expression:"loopType"}},e._l(e.loopOptions,(function(n){return t("option",{key:n.text,domProps:{value:n.value}},[e._v(e._s(e.$t(n.text)))])})),0)],1),"loop"===e.loopType?[t("b-form-group",{attrs:{label:e.$t("Maximum Iterations")}},[t("b-form-input",{attrs:{type:"number",min:"0",step:"1","data-cy":"loopMaximum"},on:{input:e.changeLoopMaximum},model:{value:e.loopMaximum,callback:function(t){e.loopMaximum=t},expression:"loopMaximum"}}),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Leave empty to continue until exit condition is satisfied")))])],1),t("b-form-group",{attrs:{label:e.$t("Exit Condition")}},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.loopCondition,expression:"loopCondition"}],ref:"specialAssignmentsInput",staticClass:"form-control special-assignment-input",attrs:{"aria-label":e.$t("FEEL Syntax"),placeholder:"FEEL Syntax","data-cy":"loopCondition"},domProps:{value:e.loopCondition},on:{input:[function(t){t.target.composing||(e.loopCondition=t.target.value)},e.changeLoopCondition]}}),e._v(" "),t("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("When FEEL expression evaluates to true then exit loop")))])])]:e._e(),"parallel_mi"===e.loopType||"sequential_mi"===e.loopType?["inputData"===e.multiType?t("b-form-group",{attrs:{id:"group-inputData",label:e.$t("Request Variable Array"),"label-for":"inputData",description:e.$t("Non-array data will result in an error.")}},[t("b-form-input",{attrs:{id:"inputData",type:"text",placeholder:e.$t("Request Variable Name")},on:{input:e.changeInputData},model:{value:e.inputData,callback:function(t){e.inputData=t},expression:"inputData"}})],1):e._e(),"sequential_mi"===e.loopType?t("b-form-group",{attrs:{id:"group-exit-condition",label:e.$t("Exit Condition"),"label-for":"exit-condition",description:e.$t("When the FEEL Expression evaluates to true then exit the loop")}},[t("b-form-textarea",{attrs:{id:"exit-condition",placeholder:e.$t("FEEL Syntax")},on:{input:e.changeCompletionCondition},model:{value:e.completionCondition,callback:function(t){e.completionCondition=t},expression:"completionCondition"}})],1):e._e(),t("b-form-group",{attrs:{id:"group-outputData",label:e.$t("Output Data Variable"),"label-for":"outputData",description:e.$t("Specifies the output request data variable array, which will be produced as a result of the multi-instance.")}},[t("b-form-input",{attrs:{id:"outputData",type:"text",placeholder:e.$t("Request Variable Name")},on:{input:e.changeOutputData},model:{value:e.outputData,callback:function(t){e.outputData=t},expression:"outputData"}})],1)]:e._e()],2)},tf=[],nf={props:{value:{type:Object,default:function(){return{loopCharacteristics:null,ioSpecification:null}}}},name:"LoopCharacteristics",data:function(){return{loopOptions:[{text:this.$t("No Loop Mode"),value:"no_loop"},{text:this.$t("Loop"),value:"loop"},{text:this.$t("Multi-Instance (Parallel)"),value:"parallel_mi"},{text:this.$t("Multi-Instance (Sequential)"),value:"sequential_mi"}],showAdvanced:!1,previous:{loopCardinality:"3",completionCondition:null,inputData:null,outputData:null,inputDataItem:null},local:{loopCharacteristics:{$type:null,isSequential:!1},loopMaximum:0,loopCondition:null,ioSpecification:{dataInputs:[]}},loopType:null,multiType:null,loopCardinality:null,completionCondition:null,inputData:null,inputDataItem:null,outputData:null,outputDataItem:null,loopMaximum:0,loopCondition:null}},mounted:function(){this.loadData()},watch:{value:{deep:!0,handler:function(e){(0,Er.isEqual)(this.local,e)||this.loadData()}}},methods:{changeLoopMaximum:function(e){this.setLoopMaximum(e),this.saveData()},changeLoopCondition:function(){this.setLoopCondition(this.loopCondition),this.saveData()},changeLoopType:function(e){this.setLoopCharacteristics(e),this.saveData()},changeMultiType:function(e){this.setMultiType(e),this.saveData()},changeLoopCardinality:function(e){this.setLoopCardinality(e),this.saveData()},changeCompletionCondition:function(e){this.setCompletionCondition(e),this.saveData()},changeInputData:function(e){this.setLoopDataInputRef(e),this.saveData()},changeInputDataItem:function(e){this.setInputDataItem(e),this.saveData()},changeOutputData:function(e){this.setLoopDataOutputRef(e),this.saveData()},changeOutputDataItem:function(e){this.setOutputDataItem(e),this.saveData()},loadData:function(){this.$set(this,"local",(0,Er.cloneDeep)(this.value)),this.loopType=this.getLoopCharacteristics(),this.multiType=this.getMultiType(),this.loopCardinality=this.getLoopCardinality(),this.completionCondition=this.getCompletionCondition(),this.inputData=this.getLoopDataInputRef(),this.inputDataItem=this.getInputDataItem(),this.outputData=this.getLoopDataOutputRef(),this.outputDataItem=this.getOutputDataItem(),this.previous.inputData=this.inputData,this.previous.outputData=this.outputData,this.previous.loopCardinality=this.loopCardinality,this.loopMaximum=this.getLoopMaximum(),this.loopCondition=this.getLoopCondition()},saveData:function(){(0,Er.isEqual)(this.local,this.value)||this.$emit("input",(0,Er.cloneDeep)(this.local))},getOutputDataItem:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.outputDataItem?this.local.loopCharacteristics.outputDataItem.name:null},setOutputDataItem:function(e){this.local.loopCharacteristics.outputDataItem={$type:"bpmn:DataInput",isCollection:!0,name:e}},getLoopDataOutputRef:function(){var e;return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopDataOutputRef?null===(e=this.local.ioSpecification)||void 0===e?void 0:e.dataOutputs[0].name:null},setLoopDataOutputRef:function(e){this.local.ioSpecification||this.initIoSpecification();var t=this.local.ioSpecification.dataOutputs[0]||{$type:"bpmn:DataOutput",id:"".concat(this.local.id,"_output_1"),isCollection:!0,name:e};t.name=e,this.local.ioSpecification.dataOutputs=[t],this.local.ioSpecification.outputSets[0].dataOutputRefs=[t.id],this.local.loopCharacteristics.loopDataOutputRef=t.id},getInputDataItem:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.inputDataItem?this.local.loopCharacteristics.inputDataItem.name:null},setInputDataItem:function(e){this.local.loopCharacteristics.inputDataItem={$type:"bpmn:DataInput",isCollection:!0,name:e}},getLoopDataInputRef:function(){var e;return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopDataInputRef?null===(e=this.local.ioSpecification)||void 0===e?void 0:e.dataInputs[0].name:null},setLoopDataInputRef:function(e){var t={$type:"bpmn:DataInput",id:"".concat(this.local.id,"_input_1"),isCollection:!0,name:e};this.local.ioSpecification||this.initIoSpecification(),this.local.ioSpecification.dataInputs=[t],this.local.ioSpecification.inputSets[0].dataInputRefs=[t.id],this.local.loopCharacteristics.loopDataInputRef=t.id},initIoSpecification:function(){this.local.ioSpecification={$type:"bpmn:InputOutputSpecification",dataInputs:[],dataOutputs:[],inputSets:[{$type:"bpmn:InputSet",dataInputRefs:[]}],outputSets:[{$type:"bpmn:OutputSet",dataOutputRefs:[]}]}},getLoopCardinality:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopCardinality?this.local.loopCharacteristics.loopCardinality.body:null},getCompletionCondition:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.completionCondition?this.local.loopCharacteristics.completionCondition.body:null},setLoopCardinality:function(e){this.local.loopCharacteristics.loopCardinality={$type:"bpmn:Expression",body:e}},setCompletionCondition:function(e){this.local.loopCharacteristics.completionCondition={$type:"bpmn:Expression",body:e}},getMultiType:function(){return this.local.loopCharacteristics?void 0!==this.local.loopCharacteristics.loopCardinality?"loopCardinality":"inputData":null},setMultiType:function(e){"loopCardinality"===e?(this.local.loopCharacteristics.loopCardinality={$type:"bpmn:Expression",body:this.previous.loopCardinality||"3"},this.local.loopCharacteristics.completionCondition={$type:"bpmn:Expression",body:this.previous.completionCondition||""},this.previous.inputData=this.inputData,this.previous.outputData=this.outputData,this.previous.inputDataItem=this.inputDataItem,delete this.local.loopCharacteristics.loopDataInputRef,delete this.local.loopCharacteristics.inputDataItem,this.setLoopDataOutputRef(this.previous.outputData||"output_array_".concat(this.local.id))):(this.previous.loopCardinality=this.loopCardinality,this.previous.completionCondition=this.completionCondition,this.previous.outputData=this.outputData,delete this.local.loopCharacteristics.loopCardinality,delete this.local.loopCharacteristics.completionCondition,this.local.loopCharacteristics.loopDataInputRef="",this.setLoopDataInputRef(this.previous.inputData||"source_array"),this.setLoopDataOutputRef(this.previous.outputData||"output_array_".concat(this.local.id)),this.setInputDataItem(this.previous.inputDataItem||"")),this.loopCardinality=this.getLoopCardinality(),this.completionCondition=this.getCompletionCondition(),this.inputData=this.getLoopDataInputRef(),this.outputData=this.getLoopDataOutputRef()},getLoopCharacteristics:function(){return this.local.loopCharacteristics?"bpmn:StandardLoopCharacteristics"===this.local.loopCharacteristics.$type?"loop":"bpmn:MultiInstanceLoopCharacteristics"===this.local.loopCharacteristics.$type?this.local.loopCharacteristics.isSequential?"sequential_mi":"parallel_mi":"no_loop":"no_loop"},setLoopCharacteristics:function(e){switch(this.local.loopCharacteristics||(this.local.loopCharacteristics={}),e){case"no_loop":this.local.loopCharacteristics=void 0;break;case"loop":this.local.loopCharacteristics.$type="bpmn:StandardLoopCharacteristics";break;case"parallel_mi":this.local.loopCharacteristics.$type="bpmn:MultiInstanceLoopCharacteristics",this.local.loopCharacteristics.isSequential=!1,this.multiType||(this.multiType="inputData");break;case"sequential_mi":this.local.loopCharacteristics.$type="bpmn:MultiInstanceLoopCharacteristics",this.local.loopCharacteristics.isSequential=!0,this.multiType||(this.multiType="inputData");break}},setLoopMaximum:function(e){e||(e=null),this.local.loopCharacteristics.loopMaximum=e},getLoopMaximum:function(){return this.local.loopCharacteristics?this.local.loopCharacteristics.loopMaximum:null},setLoopCondition:function(e){this.local.loopCharacteristics.loopCondition={$type:"bpmn:Expression",body:e}},getLoopCondition:function(){return this.local.loopCharacteristics&&this.local.loopCharacteristics.loopCondition?this.local.loopCharacteristics.loopCondition.body:null}}},rf=nf,of=fr(rf,ef,tf,!1,null,null,null),sf=of.exports,af=(f(19601),function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d(this,e),this.index=window.NODE_INSPECTOR_FIRST_INDEX||(new Date).getTime(),this.definitions=t,this.nodeIdGenerator=B(this.definitions),this.options=Object.assign({prefix:this.nodeIdGenerator.generate()[0]},n),this.createdModdleNodes={}}return g(e,[{key:"getDefinitionProps",value:function(e){var t=this;return e instanceof Array?e.map((function(e){return t.getDefinitionProps(e)})):e instanceof Object?Object.getOwnPropertyNames(e).reduce((function(n,r){if(e[r]instanceof Function)return n;var o="Ref"===r.substr(r.length-3)||"Refs"===r.substr(r.length-4);return e[r]instanceof Object&&e[r].id&&o?n[r]=Object&&e[r].id:e[r]instanceof Array&&o?n[r]=e[r].filter((function(e){return e})).map((function(e){return e.id})):("$type"===r||"$"!==r.substr(0,1)&&"__"!==r.substr(0,2))&&(n[r]=t.getDefinitionProps(e[r])),n}),{}):e}},{key:"setDefinitionProps",value:function(e,t,n,r,o){var i=this;if(void 0!==e){if(e instanceof Array)e=e.map((function(e){return i.setDefinitionProps(e,t,n)}));else if(e instanceof Object)try{e=Object.keys(lc()(e,"$type","$config","markerFlags")).reduce((function(r,o){var s=i.setDefinitionProps(e[o],t,n,void 0,o);return null!==s&&void 0!==s?r[o]=s:void 0===s&&delete r[o],r}),r||this.createModdleNode(n,e))}catch(s){throw'Unable to create moddle node of type "'.concat(e.$type,'" \n ').concat(s)}return r&&void 0!==o&&void 0!==e&&null!==e&&(r[o]=e),e}}},{key:"createModdleNode",value:function(e,t){var n=e.create(t.$type,{id:this.generateId()});return t.id&&(this.createdModdleNodes[t.id]=n),n}},{key:"setReferences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(void 0!==e)return this.isReference(n)?e=e instanceof Array?e.map((function(e){return t.findReference(e)})):this.findReference(e):e instanceof Array?e=e.map((function(e){return t.setReferences(e,null)})):e instanceof Object&&Object.keys(lc()(e,"$type","$config","markerFlags")).forEach((function(n){e[n]=t.setReferences(e[n],n)})),e}},{key:"isReference",value:function(e){return!!e&&("Ref"===e.substr(e.length-3)||"Refs"===e.substr(e.length-4))}},{key:"findReference",value:function(e){return this.createdModdleNodes[e]||this.findById(e)}},{key:"generateId",value:function(){return this.index++,"".concat(this.options.prefix,"_").concat(this.index)}},{key:"findById",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.definitions.rootElements,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!(r.indexOf(n)>-1)){var o;if(n instanceof Array)r.push(n),n.find((function(n){return o=t.findById(e,n,r)}));else if(n instanceof Object&&n.$type){if(r.push(n),n.id===e)return n;Object.getOwnPropertyNames(n).find((function(i){return o=!(n[i]instanceof Function)&&t.findById(e,n[i],r)}))}return o}}}]),e}()),cf=function(e,t,n,r,o,i){var s=new af(o,{prefix:"".concat(t.definition.id,"_inner")}),a=s.setDefinitionProps(e.$loopCharactetistics,n,r,{});return a=s.setReferences(a),a.loopCharacteristics?(delete t.definition.loopCharacteristics,i&&window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"loopCharacteristics",value:a.loopCharacteristics}),n(t,"loopCharacteristics",a.loopCharacteristics)):(t.definition.loopCharacteristics=null,delete t.definition.loopCharacteristics),a.ioSpecification?(delete t.definition.ioSpecification,n(t,"ioSpecification",a.ioSpecification)):delete t.definition.ioSpecification,lc()(e,["$loopCharactetistics"])},lf=function(e,t,n,r){var o=r.definitions,i=new af(o);e.$loopCharactetistics=i.getDefinitionProps({id:t.definition.id,loopCharacteristics:t.definition.loopCharacteristics,ioSpecification:t.definition.ioSpecification}),delete e.loopCharacteristics,delete e.ioSpecification},df={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Loop Activity",icon:"redo",name:"loop-characteristics-accordion"},items:[{component:sf,name:"LoopCharactetistics",config:{name:"$loopCharactetistics"}}]},uf="processmaker-modeler-task",hf={id:"processmaker-modeler-task",component:zp,bpmnType:["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:SubProcess"],control:!0,category:"BPMN",rank:40,icon:f(45849),label:"Task",items:[{icon:f(45849),label:"Form Task",control:!0,rank:41,id:"processmaker-modeler-task"},{icon:f(24678),label:"Manual Task",control:!0,rank:42,id:"processmaker-modeler-manual-task"},{icon:f(37901),label:"Script Task",control:!0,rank:43,id:"processmaker-modeler-script-task"},{icon:f(47356),label:"Sub Process",control:!0,rank:44,id:"processmaker-modeler-call-activity"}],definition:function(e,t){return e.create("bpmn:Task",{name:t(io[uf]),assignment:"requester"})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorHandler:function(e,t,n,r,o,i,s){pf(e.markerFlags,t,n),cf(e,t,n,r,o,s),i(lc()(e,"markerFlags","$loopCharactetistics"),s)},inspectorData:function(e,t,n){var r=t(e);return lf(r,e,t,n),r.markerFlags={isForCompensation:r.isForCompensation},delete r.isForCompensation,r},inspectorConfig:[{name:io[uf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-task"},items:[{component:"FormInput",config:_a}]},df,Va,Qp]}],loopCharacteristicsHandler:cf,loopCharacteristicsData:lf};function pf(e,t,n){if(e){var r=t.definition.get("isForCompensation"),o=e.isForCompensation;null!=o&&o!==r&&n(t,"isForCompensation",o)}}var ff,mf,gf=Qr(Qr({},hf),{},{component:Gp}),vf=(f(38862),function(){var e=this,t=e._self._c;return t("div",[t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"boundary-event-dropdown-data":e.boundaryEventDropdownData,"dropdown-data":e.dropdownData,showCustomIconPicker:!0,iconName:this.iconName},on:{"set-custom-icon-name":e.setCustomIconName,"reset-custom-icon-name":e.resetCustomIconName}},e.$listeners)),t("b-modal",{ref:"subprocess-modal",attrs:{title:"Previewing '".concat(e.subprocessName,"'")},scopedSlots:e._u([{key:"modal-footer",fn:function(){return[t("a",{attrs:{href:e.subprocessLink,target:"_blank","data-test":"modal-process-link"}},[e._v(" Open subprocess in new window "),t("i",{staticClass:"ml-1 fas fa-external-link-alt"})])]},proxy:!0}])},[e.subProcessSvg?t("div",{staticClass:"text-center",domProps:{innerHTML:e._s(e.subProcessSvg)}}):e.failedToLoadPreview?t("div",[e._v("Could not load preview")]):t("div",[t("i",{staticClass:"fas fa-spinner fa-spin"}),e._v(" Loading process preview...")])]),t("b-modal",{ref:"no-subprocess-modal",attrs:{title:"No subprocess selected","hide-footer":!0}},[e._v(" Please select a subprocess to view it. ")])],1)}),bf=[],yf=f.p+"img/subprocess.19c191a3.svg",wf=15,xf=2*Zs,kf='<svg version="1.1"\n baseProfile="full"\n width="16" height="16"\n xmlns="http://www.w3.org/2000/svg"></svg>',Cf={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering","paperManager"],mixins:[xa,xt,fa,Fs,tc,xp],data:function(){return{subProcessSvg:null,failedToLoadPreview:!1,boundaryEventDropdownData:Sp,dropdownData:[{label:io["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:io["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:io["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:io["processmaker-modeler-call-activity"],nodeType:"processmaker-modeler-call-activity",dataTest:"switch-to-sub-process"}],nodeIcon:kf,iconName:"",anchorPointFunction:Pt}},computed:{subprocessId:function(){return JSON.parse(this.node.definition.get("config")).processId},subprocessLink:function(){return"/modeler/".concat(this.subprocessId)},subprocessName:function(){return this.node.definition.get("name")}},watch:{"node.definition.name":function(e){var t=this.node.diagram.bounds.width;this.shape.attr("label/text",F.util.breakText(e,{width:t}));var n=this.shapeView.selectors.label.getBBox().height,r=this.shape.size(),o=r.height;if(n+wf+xf!==o){var i=Math.max(n+wf+xf,yp);this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment()}},"node.definition.config":function(e){Un.commit("updateNodeProp",{node:this.node,key:"config",value:e}),this.$emit("save-state")},"node.definition.callActivityType":function(e){this.shape.attr("image/display","globalTask"===e?"none":"initial")},"node.definition.loopCharacteristics":function(){Pp(this.node.definition,this.markers,this.$set,this.$delete)}},methods:{clickSubprocess:function(e,t){var n=this,r="bottomCenter.0"===t.target.getAttribute("joint-selector"),o=e.model===this.shape;r&&o&&(this.subprocessId?(this.$refs["subprocess-modal"].show(),this.subProcessSvg=null,this.failedToLoadPreview=!1,window.ProcessMaker.apiClient.get("/processes/".concat(this.subprocessId),{params:{include:"svg"}}).then((function(e){var t=e.data;if(t.svg){var r=function(e){return e.replace('<svg width="100%"',"<svg ")},o=function(e){return e.replace("<svg ",'<svg class="border border-dark"')};n.subProcessSvg=o(r(t.svg))}else n.failedToLoadPreview=!0})).catch((function(){n.failedToLoadPreview=!0}))):this.$refs["no-subprocess-modal"].show())}},mounted:function(){this.shape=new bp,this.$set(this.markers.bottomCenter,"subprocess",yf);var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),Pp(this.node.definition,this.markers,this.$set,this.$delete),this.shape.attr({body:{rx:8,ry:8,strokeWidth:4},label:{text:F.util.breakText(this.node.definition.get("name"),{width:e.width}),fill:"black"}}),this.shape.addTo(this.graph),this.shape.component=this,this.paperManager.addEventHandler("element:pointerclick",this.clickSubprocess),this.node.definition.get("customIcon")&&this.setCustomIcon(this.node.definition.get("customIcon"))}},Sf=Cf,Ef=fr(Sf,vf,bf,!1,null,null,null),Af=Ef.exports,_f=function(){var e=this,t=e._self._c;return t("div",[t("form-multi-select",{staticClass:"p-0 mb-2",attrs:{label:e.$t("Process"),name:"Process",helper:e.$t("Select which Process this element calls"),showLabels:!1,"allow-empty":!1,options:e.processList,loading:e.loading,optionContent:"name",validation:e.validation,searchable:!0,"internal-search":!1,"preserve-search":!1,"clear-on-select":!1},on:{"search-change":e.searchChange},model:{value:e.selectedProcess,callback:function(t){e.selectedProcess=t},expression:"selectedProcess"}}),e.selectedProcess?t("form-multi-select",{staticClass:"p-0 mb-2",attrs:{label:e.$t("Start Event"),name:"StartEvent",disabled:0===e.startEventList.length,"allow-empty":!1,showLabels:!1,options:e.startEventList,optionContent:"name",validation:"required"},model:{value:e.selectedStartEvent,callback:function(t){e.selectedStartEvent=t},expression:"selectedStartEvent"}}):e._e(),e.selectedProcess?t("a",{attrs:{href:"/modeler/".concat(e.selectedProcess.id),target:"_blank"}},[e._v(" "+e._s(e.$t("Open Process"))+" "),t("i",{staticClass:"ml-1 fas fa-external-link-alt"})]):e._e()],1)},Tf=[],Mf=f(45578),Pf=f.n(Mf),If={data:function(){return{selectedProcess:null,selectedStartEvent:null,config:{},name:"",loading:!1,processes:[],selectedProcessInfo:null,validation:""}},inheritAttrs:!1,props:["value"],computed:{processList:function(){var e=this,t=this.filterValidProcesses(this.processes)||[];return this.selectedProcessInfo&&!t.find((function(t){return t.id===e.selectedProcessInfo.id}))&&t.push(this.selectedProcessInfo),t},startEventList:function(){return this.selectedProcess?this.filterValidStartEvents(this.selectedProcess.events):[]},currentProcessId:function(){var e=window.location.href.match(/modeler\/(\d+)/);return e&&e[1]?parseInt(e[1]):null}},watch:{selectedProcess:function(){this.loading||(this.startEventList.length>0?this.selectedStartEvent=this.startEventList[0]:this.selectedStartEvent=null)},selectedStartEvent:function(){this.loading||this.setBpmnValues()},processList:function(){this.loadBpmnValues()},value:{handler:function(){this.config=JSON.parse(this.value),this.loadSelectedProcessInfo()},immediate:!0}},methods:{searchChange:function(e){this.loadProcessesDebounced(e)},filterValidProcesses:function(e){var t=this;return e.filter((function(e){return t.filterValidStartEvents(e.events).length>0})).filter((function(e){return e.id!==t.currentProcessId}))},filterValidStartEvents:function(e){return e.filter((function(e){if(e.eventDefinitions&&e.eventDefinitions.length>0)return!1;if(e.config)try{var t=JSON.parse(e.config);if(t.web_entry)return!1}catch(n){return!1}return!0}))},loadBpmnValues:function(){var e=this;this.config.processId&&this.config.startEvent&&(this.loading=!0,this.name=this.config.name,this.selectedProcess=this.processList.find((function(t){return t.id===e.config.processId})),this.selectedStartEvent=this.startEventList.find((function(t){return t.id===e.config.startEvent})),this.$nextTick((function(){e.selectedProcess||(e.validation="required"),e.loading=!1})))},setBpmnValues:function(){if(this.selectedProcess&&this.selectedStartEvent){var e=this.selectedProcess.name;this.startEventList.length>1&&(e+=" (".concat(this.selectedStartEvent.name,")"));var t={calledElement:"".concat(this.selectedStartEvent.ownerProcessId,"-").concat(this.selectedProcess.id),processId:this.selectedProcess.id,startEvent:this.selectedStartEvent.id,name:e},n=JSON.stringify(t);this.$emit("input",n)}},containsMultipleProcesses:function(e){return Pf()(e.events,"ownerProcessId").length>1},loadProcesses:function(e){var t=this;this.loading=!0;var n={order_direction:"asc",per_page:20,include:"events,category",filter_without_assignments:!0};e&&(n.filter=e),window.ProcessMaker.apiClient.get("processes",{params:n}).then((function(e){t.loading=!1,t.processes=e.data.data})).catch((function(){t.loading=!1}))},loadSelectedProcessInfo:function(){var e=this;this.config.processId&&window.ProcessMaker.apiClient.get("processes/"+this.config.processId,{params:{include:"events,category",filter_without_assignments:!0}}).then((function(t){e.selectedProcessInfo=t.data}))}},created:function(){var e=this;this.validation=this.config.processId?"":"required",this.loadProcessesDebounced=Y()((function(t){e.loadProcesses(t)}),500),0===this.processList.length?this.loadProcesses():this.loadBpmnValues()}},Of=If,Df=fr(Of,_f,Tf,!1,null,null,null),Nf=Df.exports,Rf="processmaker-modeler-call-activity",Bf={id:Rf,component:Af,bpmnType:"bpmn:CallActivity",control:!1,category:"BPMN",icon:f(12893),label:io[Rf],definition:function(e,t){return e.create("bpmn:CallActivity",{name:t(io[Rf]),calledElement:"",config:"{}",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorHandler:function(e,t,n){n(t,"id",e.id),n(t,"name",e.name);var r=JSON.parse(e.config);e["calledElement"]=r.calledElement,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"calledElement",value:r.calledElement}),n(t,"calledElement",r.calledElement),r.name!==e.name&&(r.name=e.name),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"config",value:JSON.stringify(r)}),n(t,"config",JSON.stringify(r))},inspectorConfig:[{name:io[Rf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-subprocess"},items:[{component:"FormInput",config:_a},{component:Nf,config:{name:"config"}}]},Va,Na]}]},Lf=f(87465),jf=f.n(Lf),Ff={extends:zp,mixins:[tc],data:function(){return{nodeIcon:jf(),iconName:""}}},zf=Ff,Uf=fr(zf,ff,mf,!1,null,null,null),qf=Uf.exports,Vf="processmaker-modeler-script-task",Hf={id:Vf,component:qf,bpmnType:"bpmn:ScriptTask",control:!1,category:"BPMN",icon:f(75763),label:io[Vf],definition:function(e,t){return e.create("bpmn:ScriptTask",{name:t(io[Vf]),scriptRef:null,loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:yp,width:wp})})},inspectorConfig:[{name:io[Vf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-script-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},Wf=Qr(Qr({},hf),{},{id:"processmaker-modeler-service-task",bpmnType:["bpmn:ServiceTask","bpmn:SendTask","bpmn:ReceiveTask"],control:!1,label:"Service Task",definition:function(e,t){return e.create("bpmn:ServiceTask",{name:t("Service Task")})},inspectorConfig:[{name:"Service Task",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-service-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]}),Gf=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},$f=[],Xf=160,Yf={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","paperManager","collaboration","processNode","planeElements","isRendering"],mixins:[xa,xt],data:function(){return{shape:null,definition:null,nodeWidth:10}},watch:{"node.definition.text":function(e){this.updateNodeText(e)}},methods:{getLabelHeight:function(e){return this.shape.findView(this.paperManager.paper).selectors.label.getBBox().height+e},calculateNewHeight:function(e,t,n){var r=3,o=15,i=this.getLabelHeight(o);return i!==e?i-r:0===t.length?n-r:e-r},updateNodeText:function(e){var t=this,n=this.shape.findView(this.paperManager.paper).getBBox(),r=n.height,o="25 ".concat(r," 3 ").concat(r," 3 3 25 3"),i=this.node.diagram.bounds;this.shape.position(i.x,i.y),this.shape.attr({body:{refPoints:o},label:{text:F.util.breakText(e,{width:Xf}),textAnchor:"left"}}),this.paperManager.awaitScheduledUpdates().then((function(){t.shape.resize(t.nodeWidth,t.calculateNewHeight(r,e,i.height)),t.setShapeHighlight()}))}},mounted:function(){var e=this.node.diagram.bounds;this.shape=new F.shapes.standard.Polyline,this.shape.set("type","textAnnotation"),this.shape.position(e.x,e.y),this.shape.resize(this.nodeWidth,e.height),this.shape.attr({body:{refPoints:"25 10 3 10 3 3 25 3",fill:"none"},label:{fill:"black",yAlignment:"left",xAlignment:"left",refX:"5",refY:"5"}}),this.shape.addTo(this.graph),this.shape.component=this,this.updateNodeText(this.node.definition.get("text"))}},Jf=Yf,Zf=fr(Jf,Gf,$f,!1,null,null,null),Kf=Zf.exports,Qf="processmaker-modeler-text-annotation",em={id:Qf,component:Kf,bpmnType:"bpmn:TextAnnotation",control:!0,category:"BPMN",icon:f(15153),label:"Text Annotation",rank:70,definition:function(e,t){return e.create("bpmn:TextAnnotation",{text:t("Text Annotation")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:30,width:150})})},validateIncoming:function(){return!1},validateAssociationIncoming:function(){return!1},inspectorConfig:[{name:"Text Annotation",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-text-annotation"},items:[{component:"FormInput",config:{label:"Text to Show",helper:"Body of the text annotation",name:"text",placeholder:"Text Annotation"}}]},Va,Na]}]},tm=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners),[t("add-lane-above-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"crown-config__icon",attrs:{title:e.$t("Lane Above")},on:{click:e.addLaneAbove}}),t("add-lane-below-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"crown-config__icon",attrs:{title:e.$t("Lane Below")},on:{click:e.addLaneBelow}})],1)},nm=[],rm=f.p+"img/highlight-shape.5f7b1ba9.svg",om=30,im=200,sm=300,am=20,cm=300,lm=100,dm={props:["highlighted","paper","processNode","planeElements","moddle"],data:function(){return{anchorPoints:[],isResizing:!0,pointWidth:15,pointHeight:15,elementBounds:[],elementTopY:null,elementRightX:null,elementBottomY:null,elementLeftX:null}},watch:{highlighted:function(e){0!==this.anchorPoints.length&&(e?(!1===Un.getters.isReadOnly&&this.addResizeAnchors(),this.calculateElementLimits(),this.updateAnchorPointPosition()):this.removeResizeAnchors())}},computed:{poolComponent:function(){return $()(this,"node.pool.component",this)},isLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{calculateElementLimits:function(){this.elementBounds=this.poolComponent.shape.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl&&"processmaker-modeler-message-flow"!==e.component.node.type})).map((function(e){return e.getBBox()})),this.elementTopY=Math.min.apply(Math,W(this.elementBounds.map((function(e){var t=e.y;return t-am})))),this.elementBottomY=Math.max.apply(Math,W(this.elementBounds.map((function(e){var t=e.y,n=e.height;return t+n+am})))),this.elementRightX=Math.max.apply(Math,W(this.elementBounds.map((function(e){var t=e.x,n=e.width;return t+n+am})))),this.elementLeftX=Math.min.apply(Math,W(this.elementBounds.map((function(e){var t=e.x;return t-am}))))},configureResize:function(){var e=this;this.shape.listenTo(this.paper,"element:pointerup",(function(t){t.model.component&&t.model.component===e&&e.calculateElementLimits()}));var t=new F.shapes.standard.EmbeddedImage,n=new F.shapes.standard.EmbeddedImage,r=new F.shapes.standard.EmbeddedImage,o=new F.shapes.standard.EmbeddedImage;this.anchorPoints=[t,n,r,o];var i=this.shape.getBBox(),s=i.x,a=i.y,c=i.width,l=i.height;this.anchorPoints.forEach((function(e){e.set("isDrag",!0),e.set("previousPosition",e.position())})),this.highlighted&&this.addResizeAnchors(),this.setPointAttributes(t,"nwse-resize","bottom-right-resize-button"),this.setPointAttributes(n,"nesw-resize","bottom-left-resize-button"),this.setPointAttributes(r,"nesw-resize","top-right-resize-button"),this.setPointAttributes(o,"nwse-resize","top-left-resize-button"),t.position(s+c,a+l),n.position(s-this.pointWidth,a+l),r.position(s+c,a-this.pointHeight),o.position(s-this.pointWidth,a-this.pointHeight),t.listenTo(this.paper,"element:pointerdown",(function(n){n.model===t&&(t.on("change:position",e.resizeBottomRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){t.off("change:position",e.resizeBottomRight),e.resizeUpdate()})))})),n.listenTo(this.paper,"element:pointerdown",(function(t){t.model===n&&(n.on("change:position",e.resizeBottomLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){n.off("change:position",e.resizeBottomLeft),e.resizeUpdate()})))})),r.listenTo(this.paper,"element:pointerdown",(function(t){t.model===r&&(r.on("change:position",e.resizeTopRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){r.off("change:position",e.resizeTopRight),e.resizeUpdate()})))})),o.listenTo(this.paper,"element:pointerdown",(function(t){t.model===o&&(o.on("change:position",e.resizeTopLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){o.off("change:position",e.resizeTopLeft),e.resizeUpdate()})))}))},fixResizeRounding:function(){var e=this.poolComponent.shape.getBBox(),t=e.x,n=e.y,r=e.width,o=e.height;this.poolComponent.shape.resize(Math.round(r),Math.round(o)),this.poolComponent.shape.position(Math.round(t),Math.round(n))},resizeUpdate:function(){this.fixResizeRounding();var e=this.shape.getBBox(),t=e.width,n=e.height,r=this.node.diagram.bounds;t===r.width&&n===r.height||(this.poolComponent.laneSet&&(this.poolComponent.updateLaneChildren(),this.poolComponent.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),Un.commit("updateNodeBounds",{node:this.poolComponent.node,bounds:this.poolComponent.shape.getBBox()}),this.$emit("save-state"))},resizeTopLeft:function(e,t,n){if(n.ui){var r="top-left",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.width,d=s.height,u=this.shape.getBBox(),h=u.x,p=u.y,f=u.width,m=u.height,g=this.poolComponent.sortedLanes(),v=g.slice(1).reduce((function(e,t){return e+t.getBBox().height}),lm),b=Math.max(a+l-(o+this.pointWidth),a+l-this.elementLeftX+om,sm),y=Math.max(c+d-(i+this.pointWidth),c+d-this.elementTopY,this.poolComponent.laneSet?v:im),w=Math.max(h+f-(o+this.pointWidth),h+f-this.elementLeftX+am+om,cm),x=Math.max(p+m-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===g[0]){var k=Math.max(a+l-(o+this.pointWidth)+om,a+l-this.elementLeftX+om,sm);this.poolComponent.shape.resize(k,y,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes()}else{var C=g[g.indexOf(this.shape)-1];this.shape.resize(w,Math.min(p+m-(C.getBBox().y+lm),x),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else e.set("previousPosition",{x:o,y:i}),this.shape.resize(b,y,{direction:r}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeTopRight:function(e,t,n){if(n.ui){var r="top-right",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.height,d=this.shape.getBBox(),u=d.x,h=d.y,p=d.height,f=this.poolComponent.sortedLanes(),m=f.slice(1).reduce((function(e,t){return e+t.getBBox().height}),lm),g=Math.max(o-a,this.elementRightX-a,sm),v=Math.max(c+l-(i+this.pointWidth),c+l-this.elementTopY,this.poolComponent.laneSet?m:im),b=Math.max(o-u,this.elementRightX-u,cm),y=Math.max(h+p-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===f[0])this.poolComponent.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes();else{var w=f[f.indexOf(this.shape)-1];this.shape.resize(b,Math.min(h+p-(w.getBBox().y+lm),y),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomLeft:function(e,t,n){if(n.ui){var r="bottom-left",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=s.width,d=this.shape.getBBox(),u=d.x,h=d.y,p=d.width,f=this.poolComponent.sortedLanes(),m=f.slice(0,f.length-1).reduce((function(e,t){return e+t.getBBox().height}),lm),g=Math.max(a+l-(o+this.pointWidth),a+l-this.elementLeftX+om,sm),v=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?m:im),b=Math.max(u+p-(o+this.pointWidth),u+p-this.elementLeftX+am+om,cm),y=Math.max(i-h,lm);if(this.isLane)if(this.shape===f[f.length-1]){var w=Math.max(a+l-(o+this.pointWidth)+om,a+l-this.elementLeftX+om,sm);this.poolComponent.shape.resize(w,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes()}else{var x=f[f.indexOf(this.shape)+1];this.shape.resize(b,Math.min(x.getBBox().y+x.getBBox().height-lm-h,y),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(g,v,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomRight:function(e,t,n){if(n.ui){var r="bottom-right",o=t.x,i=t.y;if(e.get("previousPosition").x!==o||e.get("previousPosition").y!==i){var s=this.poolComponent.shape.getBBox(),a=s.x,c=s.y,l=this.shape.getBBox(),d=l.x,u=l.y,h=this.poolComponent.sortedLanes(),p=h.slice(0,h.length-1).reduce((function(e,t){return e+t.getBBox().height}),lm),f=Math.max(o-a,this.elementRightX-a,sm),m=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?p:im),g=Math.max(o-d,this.elementRightX-d,cm),v=Math.max(i-u,lm);if(this.isLane)if(this.shape===h[h.length-1])this.poolComponent.shape.resize(f,m,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.resizeLanes();else{var b=h[h.indexOf(this.shape)+1];this.shape.resize(g,Math.min(b.getBBox().y+b.getBBox().height-lm-u,v),{direction:r}),e.set("previousPosition",{x:o,y:i}),this.poolComponent.fillLanes(this.shape,r)}else this.shape.resize(f,m,{direction:r}),e.set("previousPosition",{x:o,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},addResizeAnchors:function(){var e=this;this.anchorPoints.forEach((function(t){try{e.shape.embed(t)}catch(n){}t.addTo(e.graph),t.toFront()}))},removeResizeAnchors:function(){this.anchorPoints.forEach((function(e){e.remove()}))},updateAnchorPointPosition:function(e){if(0!==this.anchorPoints.length){var t=this.shape.getBBox(),n=t.x,r=t.y,o=t.width,i=t.height;0!==e&&this.anchorPoints[0].position(n+o,r+i),1!==e&&this.anchorPoints[1].position(n-this.pointWidth,r+i),2!==e&&this.anchorPoints[2].position(n+o,r-this.pointHeight),3!==e&&this.anchorPoints[3].position(n-this.pointWidth,r-this.pointWidth)}},setPointAttributes:function(e,t,n){e.attr({body:{fill:"#fff",stroke:" #fff",opacity:.8},image:{xlinkHref:rm,cursor:t,buttonId:n,refWidth:20,refHeight:20,resetOffset:!0}})}},mounted:function(){var e=this;this.$nextTick((function(){e.configureResize()}))}},um=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},hm=[],pm={components:{CrownConfig:Ts},props:["graph","node","nodes","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,dm],data:function(){return{shape:null,definition:null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new F.shapes.standard.Rectangle,this.shape.set("type","PoolLane");var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.set("elementMove",!1),this.shape.attr("body/cursor","default"),this.shape.attr("body",{fill:Ye}),this.shape.attr("label",{text:F.util.breakText(this.node.definition.get("name"),{width:e.height}),fill:"black",transform:"rotate(-90)",refX:om/2}),this.shape.component=this,this.shape.addTo(this.graph),this.planeElements.includes(this.node.diagram)||this.planeElements.push(this.node.diagram)},beforeDestroy:function(){var e=this.node.pool.component,t=e.laneSet.get("lanes");if(Cs()(t,this.node.definition),0===t.length)return e.containingProcess.set("laneSets",[]),void(e.laneSet=null)}},fm=pm,mm=fr(fm,um,hm,!1,null,null,null),gm=mm.exports,vm=F.shapes.standard.Rectangle.define("processmaker.modeler.bpmn.pool",{markup:[].concat(W(F.shapes.standard.Rectangle.prototype.markup),[{tagName:"polyline",selector:"polyline"}]),attrs:{label:{fill:"black",transform:"rotate(-90)",refX:om/2},polyline:{refPointsKeepOffset:"".concat(om,",0 ").concat(om,",200"),stroke:"#000",fill:"#fff",strokeWidth:2}}}),bm=vm,ym=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},wm=[],xm={inheritAttrs:!1,components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Fs,xt],data:function(){return{shape:null,definition:null,dropdownData:[]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new F.shapes.standard.Path,this.shape.attr("root/title","joint.shapes.standard.Path"),this.shape.attr("label",{refY:65,text:this.node.definition.get("name"),fill:"black"}),this.shape.attr("body",{refD:"M1,1 L25,1 L35,10 L35,49 L1,49 L1,1 M24,1 L24,10 L35,10"});var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.addTo(this.graph),this.shape.component=this}},km=xm,Cm=fr(km,ym,wm,!1,null,null,null),Sm=Cm.exports,Em="processmaker-modeler-data-object",Am={id:Em,component:Sm,bpmnType:"bpmn:DataObjectReference",control:!0,category:"BPMN",icon:f(91012),label:io[Em],rank:80,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataObjectReference",{name:t(io[Em])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:36})})},inspectorConfig:[{name:io[Em],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-object"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},_m=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering,"dropdown-data":e.dropdownData}},e.$listeners))},Tm=[],Mm=F.shapes.standard.Cylinder.extend({markup:[].concat(W(F.shapes.standard.Cylinder.prototype.markup),[{tagName:"ellipse",selector:"thirdLine"},{tagName:"ellipse",selector:"secondLine"},{tagName:"ellipse",selector:"firstLine"}]),defaults:F.util.deepSupplement({attrs:{thirdLine:{refCx:"50%",refRx:"50%",cy:20,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},secondLine:{refCx:"50%",refRx:"50%",cy:15,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},firstLine:{refCx:"50%",refRx:"50%",cy:10,refRy:"20%","stroke-width":2,fill:"#fff",stroke:"#000"},label:{refY:50,fill:"#000"}}},F.shapes.standard.Cylinder.prototype.defaults)}),Pm={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Fs,xt],data:function(){return{shape:null,definition:null,dropdownData:[]}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},mounted:function(){this.shape=new Mm,this.shape.attr("label/text",this.node.definition.get("name"));var e=this.node.diagram.bounds;this.shape.position(e.x,e.y),this.shape.resize(e.width,e.height),this.shape.addTo(this.graph),this.shape.component=this}},Im=Pm,Om=fr(Im,_m,Tm,!1,null,null,null),Dm=Om.exports,Nm="processmaker-modeler-data-store",Rm={id:Nm,component:Dm,bpmnType:"bpmn:DataStoreReference",control:!0,category:"BPMN",icon:f(63427),label:io[Nm],rank:90,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataStoreReference",{name:t(io[Nm])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:50})})},inspectorConfig:[{name:io[Nm],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-store"},items:[{component:"FormInput",config:_a}]},Va,Na]}]};function Bm(e,t){var n=new bm,r=e.diagram.bounds;return n.position(r.x,r.y),n.resize(r.width,r.height),n.attr("label/text",F.util.breakText(e.definition.get("name"),{width:r.width})),n.attr("body",{fill:Ye}),n.addTo(t),n}function Lm(e,t){e.getElements().filter((function(e){return e!==t})).filter((function(e){var t=e.component;return!t.node.isBpmnType("bpmn:BoundaryEvent")})).forEach((function(e){var n=e.component;t.embed(n.shape),n.node.pool=t}))}function jm(e,t){e.fitEmbeds({padding:am+om}),e.resize(e.getBBox().width-om,e.getBBox().height-om),e.resize(e.getBBox().width,e.getBBox().height-om,{direction:"top"});var n=e.get("size"),r=n.width,o=n.height,i=t.diagram.bounds;e.resize(Math.max(r,i.width),Math.max(o,i.height))}function Fm(e,t,n){var r=Bm(t,n);return e||(Lm(n,r),jm(r,t)),r}function zm(e){return e.component&&e.component.node.type!==dl&&e.component.node.type!==Qf&&e.component.node.type!==Em&&e.component.node.type!==Nm}var Um={id:dl,component:gm,bpmnType:"bpmn:Lane",control:!1,category:"BPMN",label:"Lane",definition:function(e){return e.create("bpmn:Lane",{name:""})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:150,width:600,x:null,y:null})})},inspectorConfig:[{name:"Lane",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-pool-lane"},items:[{component:"FormInput",config:_a}]},Va,Na]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.getElementByNodeId(t.poolId),o=e.moddle.create("bpmn:Lane",{name:t.name}),!r.component.laneSet&&r.component.createLaneSet&&(r.component.createLaneSet([t.laneSetId]),r.component.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){o.get("flowNodeRef").push(e.component.node.definition)})),i=B(e.definitions),i.updateCounters()),s=e.moddle.create("bpmndi:BPMNShape",{bounds:e.moddle.create("dc:Bounds",{height:t.height,width:t.width,x:t.x,y:t.y})}),c=new po(t.type,o,s),n.next=7,e.addNode(c,t.id,!0);case 7:e.setShapeStacking(r.component.shape);case 8:case"end":return n.stop()}}),n)})))()}},qm=function(){var e=this,t=e._self._c;return t("crown-button",e._g({attrs:{id:"lane-above-button","aria-label":"Add lane above icon",width:25}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-lane-above"]}})],1)},Vm=[],Hm=f.p+"img/lane-above.37ee2b80.svg",Wm={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{laneAboveIcon:Hm}},created:function(){mo.library.add(bo)}},Gm=Wm,$m=fr(Gm,qm,Vm,!1,null,null,null),Xm=$m.exports,Ym=function(){var e=this,t=e._self._c;return t("crown-button",e._g({attrs:{id:"lane-below-button","aria-label":"Add lane below icon",width:25}},e.$listeners),[t("font-awesome-icon",{attrs:{icon:["fpm","fa-lane-below"]}})],1)},Jm=[],Zm=f.p+"img/lane-below.22169670.svg",Km={components:{CrownButton:gr,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{laneBelowIcon:Zm}},created:function(){mo.library.add(yo)}},Qm=Km,eg=fr(Qm,Ym,Jm,!1,null,null,null),tg=eg.exports,ng={components:{CrownConfig:Ts,AddLaneAboveButton:Xm,AddLaneBelowButton:tg},props:["graph","node","nodes","id","collaboration","processes","moddle","processNode","rootElements","highlighted","nodeRegistry","paper","planeElements","isRendering","paperManager","nodeIdGenerator"],mixins:[xa,dm,xt],data:function(){return{shape:null,definition:null,laneSet:null,isAddingLaneAbove:!1,anchorPointFunction:It(20)}},computed:{containingProcess:function(){var e=this;return this.node.definition.get("processRef")?this.processes.find((function(t){return t.id===e.node.definition.get("processRef").id})):null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)}},methods:{addLaneAbove:function(){this.isAddingLaneAbove=!0,this.addLane()},addLaneBelow:function(){this.isAddingLaneAbove=!1,this.addLane()},sortedLanes:function(){return this.shape.getEmbeddedCells().filter((function(e){var t=e.component;return t&&t.node.type===dl})).sort((function(e,t){return e.position().y-t.position().y}))},getElementsUnderArea:function(e,t){var n=e.getBBox(),r=n.x,o=n.y,i=n.width,s=n.height,a={x:r,y:o,width:i,height:s};return t.findModelsInArea(a)},moveEmbeddedElements:function(e,t){var n=this;this.getElementsUnderArea(e,this.graph).filter((function(t){return t.isEmbeddedIn(e)})).forEach((function(e){e.component.node.pool=t,Cs()(n.containingProcess.get("flowElements"),e.component.node.definition),t.component.containingProcess.get("flowElements").push(e.component.node.definition)}))},moveFlow:function(e,t){var n=e.component.node.definition;Cs()(this.containingProcess.get("flowElements"),n),t.component.containingProcess.get("flowElements").push(n)},moveElementRemote:function(e,t){var n=e.component.node.definition;if(this.laneSet){var r=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(r.get("flowNodeRef"),n)}Cs()(this.containingProcess.get("flowElements"),n),e.component.node.pool=t,this.shape.unembed(e),t.component.shape.embed(e),e.component.node.type!==dl&&t.component.laneSet&&t.component.updateLaneChildren(),this.$emit("set-shape-stacking",e.component.shape)},moveElement:function(e,t){var n=e.component.node.definition;if(this.laneSet){var r=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(r.get("flowNodeRef"),n)}Cs()(this.containingProcess.get("flowElements"),n),t.component.containingProcess.get("flowElements").push(n),this.moveEmbeddedElements(e,t),e.component.node.pool=t,this.shape.unembed(e),t.component.addToPool(e)},addLane:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=!(e.length>0&&void 0!==e[0])||e[0],o=[],t.laneSet||(t.createLaneSet(),i=Um.definition(t.moddle,t.$t),t.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){i.get("flowNodeRef").push(e.component.node.definition)})),o.push(t.pushNewLane(i))),o.push(t.pushNewLane()),n.next=6,Promise.all(o).then((function(e){r&&t.$parent.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-addLanes",e)}));case 6:t.$emit("set-shape-stacking",t.shape),t.graph.getLinks().forEach((function(e){t.$emit("set-shape-stacking",e)})),t.$emit("save-state");case 9:case"end":return n.stop()}}),n)})))()},createLaneSet:function(e){var t=this.moddle.create("bpmn:LaneSet");this.laneSet=t;var n=this.nodeIdGenerator,r=null!==e&&void 0!==e?e:n.generate(),o=jt(r,1),i=o[0];this.laneSet.set("id",i),this.containingProcess.get("laneSets").push(t)},pushNewLane:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:Um.definition(t.moddle,t.$t),r.set("color",t.node.definition.get("color")),t.$emit("set-pool-target",t.shape),o=Um.diagram(t.moddle),o.bounds.width=t.shape.getBBox().width,i=new po(Um.id,r,o),t.$emit("add-node",i),n.next=9,t.$nextTick();case 9:return n.abrupt("return",i);case 10:case"end":return n.stop()}}),n)})))()},addToPool:function(e){e.component.node.isBpmnType("bpmn:BoundaryEvent")||(this.shape.unembed(e),this.shape.embed(e),this.expandToFitElement(e,this.shape),e.component.node.type!==dl&&this.laneSet&&this.updateLaneChildren())},positionAndSizeLane:function(e,t){var n=t.getBBox(),r=n.width,o=n.height,i=e.component.node.diagram.bounds;if(!i.x||!i.y){var s=1===t.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type===dl})).length,a=s?o:i.height;e.resize(r-om,a),e.position(om,s?0:this.isAddingLaneAbove?-a:o,{parentRelative:!0}),t.resize(r,s?o:o+a,{direction:this.isAddingLaneAbove?"top-right":"bottom-right"}),this.fixResizeRounding(),this.updateAnchorPointPosition();var c=e.position(),l=c.x,d=c.y;i.set("x",l),i.set("y",d),i.set("width",e.get("size").width),i.set("height",e.get("size").height),Un.commit("updateNodeBounds",{node:this.node,bounds:t.getBBox()})}},expandToFitElement:function(e,t){if(e.component.node.type!==El){var n=t.getBBox(),r=n.x,o=n.y,i=n.width,s=n.height;if(e.component.node.type!==dl){var a=e.get("size"),c=a.width,l=a.height,d=e.position(),u=d.x,h=d.y,p=u-r,f=h-o,m=p+c,g=p,v=f,b=f+l,y=0,w=0,x="bottom",k="right";m>i-am&&(y=m+am),g<om+am&&(y=i+(om+am-g),k="left"),v<am&&(w=am-v+s,x="top"),b>s-am&&(w=b+am),(y||w)&&(t.resize(Math.max(y,i),Math.max(w,s),{direction:"".concat(x,"-").concat(k)}),this.fixResizeRounding(),this.updateAnchorPointPosition(),this.laneSet&&(this.resizeLanes(),this.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),Un.commit("updateNodeBounds",{node:this.node,bounds:t.getBBox()}),this.$emit("save-state"))}else this.positionAndSizeLane(e,t)}},fillLanes:function(e,t,n){var r,o=this.shape.get("size").height,i=this.sortedLanes().reduce((function(e,t){return e+t.getBBox().height}),0),s=n?e.get("size").height:o-i;switch(t){case"top-right":r="bottom-right";break;case"top-left":r="bottom-left";break;case"bottom-right":r="top-right";break;case"bottom-left":r="top-left";break}var a=this.sortedLanes().indexOf(e),c=e.getBBox(),l=c.width,d=this.sortedLanes()[a+(t.includes("top")?-1:1)];d.resize(l,d.getBBox().height+s,{direction:r}),this.shape.resize(l+om,o,{direction:r}),this.sortedLanes().forEach((function(e){return e.resize(l,e.getBBox().height,{direction:r})}))},resizeLanes:function(){var e=this;this.sortedLanes().forEach((function(t,n,r){var o=e.shape.get("size"),i=o.width,s=o.height,a=t.get("size"),c=a.height,l=t.position({parentRelative:!0}),d=l.y,u=c,h=d;if(0===n&&(u=c+t.position({parentRelative:!0}).y,h=0),n===r.length-1){var p=s-(t.position({parentRelative:!0}).y+c);u=c+p}t.resize(i-om,u),t.position(om,h,{parentRelative:!0})}))},captureChildren:function(){var e=this;this.graph.getElements().filter((function(t){var n=t.component;return n&&n!==e})).forEach((function(t){var n=t.component;n.node.isBpmnType("bpmn:BoundaryEvent")||(e.shape.embed(n.shape),n.node.pool=e.shape)})),this.$emit("set-shape-stacking",this.shape),this.resizePool(this.shape)},fitEmbeds:function(){this.shape.fitEmbeds({padding:am+om}),this.shape.resize(this.shape.getBBox().width-om,this.shape.getBBox().height-om),this.shape.resize(this.shape.getBBox().width,this.shape.getBBox().height-om,{direction:"top"})},resizePool:function(e){var t=this;this.fitEmbeds();var n=this.shape.get("size"),r=n.width,o=n.height,i=this.node.diagram.bounds;this.shape.resize(Math.max(r,i.width),Math.max(o,i.height)),this.shape.getEmbeddedCells().forEach((function(n){t.expandToFitElement(n,e)}));var s=this.shape.position(),a=s.x,c=s.y,l=this.shape.get("size"),d=l.width,u=l.height;this.node.diagram.bounds.x=a,this.node.diagram.bounds.y=c,this.node.diagram.bounds.width=d,this.node.diagram.bounds.height=u},updateLaneChildren:function(){var e=this,t={};this.shape.getEmbeddedCells().filter((function(t){return zm(t)&&t.component.node.pool===e.shape})).forEach((function(n){var r=e.graph.findModelsUnderElement(n,{searchBy:"center"}).find((function(e){return e.component&&e.component.node.type===dl}));t[r.id]?t[r.id].push(n.component.node.definition):t[r.id]=[n.component.node.definition]})),this.sortedLanes().forEach((function(e){var n=t[e.id],r=e.component.node.definition.get("flowNodeRef"),o=n?n.length!==r.length:r.length>0;o&&Un.commit("updateNodeProp",{node:e.component.node,key:"flowNodeRef",value:n||[]})}))},hasPools:function(){return this.collaboration.get("participants").length>0},setPoolSize:function(e){var t=this;e.getEmbeddedCells().forEach((function(n){t.expandToFitElement(n,e)}));var n=e.position(),r=n.x,o=n.y,i=e.get("size"),s=i.width,a=i.height;this.node.diagram.bounds.x=r,this.node.diagram.bounds.y=o,this.node.diagram.bounds.width=s,this.node.diagram.bounds.height=a}},mounted:function(){this.$emit("set-pools",this.node.definition),this.laneSet=this.containingProcess.get("laneSets")[0],this.shape=Fm(this.collaboration,this.node,this.graph),this.shape.component=this,this.collaboration||this.captureChildren(),this.setPoolSize(this.shape),this.$emit("set-shape-stacking",this.shape)},beforeDestroy:function(){var e=this.collaboration.get("participants");Cs()(e,this.node.definition),this.hasPools()?Cs()(this.rootElements,this.containingProcess):this.$emit("unset-pools")},created:function(){this.$t=this.$t.bind(this)}},rg=ng,og=fr(rg,tm,nm,!1,null,null,null),ig=og.exports,sg={id:Jo,component:ig,bpmnType:"bpmn:Participant",control:!0,category:"BPMN",icon:f(77217),label:"Pool",rank:60,definition:function(e,t){return e.create("bpmn:Participant",{name:t("Pool")})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:300,width:600})})},inspectorConfig:[{name:"Pool",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-pool"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},ag=function(){var e=this,t=e._self._c;return t("b-card-footer",{staticClass:"p-0 border-0 statusbar d-flex align-items-center justify-content-end pr-3 pl-3 border-top"},[e._t("default"),t("b-btn",{staticClass:"mr-auto",attrs:{disabled:!e.xmlManager,variant:"secondary",size:"sm","data-test":"downloadXMLBtn"},on:{click:function(t){e.xmlManager&&e.xmlManager.download()}}},[t("i",{staticClass:"fas fa-download mr-1"}),e._v(" "+e._s(e.$t("Download BPMN"))+" ")]),t("div",{staticClass:"status-bar-container d-flex align-items-center justify-content-end"},[e.autoValidate?[0===e.numberOfProblemsToDisplay?t("button",{staticClass:"btn btn-light",attrs:{type:"button","data-test":"validation-list-valid",disabled:!0}},[e._v(" "+e._s(e.$t("BPMN Valid"))+" "),t("span",{staticClass:"badge badge-success badge-pill"},[t("font-awesome-icon",{attrs:{icon:e.faCheck}})],1)]):t("button",{staticClass:"btn btn-light",attrs:{type:"button","data-test":"validation-list-toggle"},on:{click:function(t){e.shouldDisplayProblemsPanel=!e.shouldDisplayProblemsPanel}}},[e._v(" "+e._s(e.$t("BPMN Issues"))+" "),t("span",{staticClass:"badge badge-primary badge-pill"},[e._v(" "+e._s(e.numberOfProblemsToDisplay)+" ")]),t("font-awesome-icon",{staticClass:"ml-3",attrs:{icon:e.chevronIcon}})],1)]:e._e(),t("span",{staticClass:"divider"}),t("b-form-checkbox",{staticClass:"h-100 d-flex align-items-center",attrs:{"data-test":"validation-toggle",switch:""},model:{value:e.autoValidate,callback:function(t){e.autoValidate=t},expression:"autoValidate"}},[e._v(" "+e._s(e.$t("Auto validate"))+" ")]),t("transition",{attrs:{name:"slide"}},[e.isProblemsPanelDisplayed?t("div",{staticClass:"validation-container position-absolute text-left"},[t("dl",{staticClass:"validation-container__list align-items-baseline",attrs:{"data-test":"validation-list"}},[e._l(e.errorList,(function(n,r){return[t("dt",{key:"".concat(n.errorId,"_").concat(r),staticClass:"text-capitalize"},[t("font-awesome-icon",{staticClass:"status-bar-container__status-icon ml-1 mr-1 mt-1",style:{color:e.isErrorCategory(n)?e.errorColor:e.warningColor},attrs:{icon:e.isErrorCategory(n)?e.faTimesCircle:e.faExclamationTriangle}}),e._v(" "+e._s(n.errorKey)+" ")],1),t("dd",{key:"".concat(n.errorId,"_").concat(r,"_dd")},[t("p",{staticClass:"pl-4 mb-0 font-italic"},[e._v(e._s(n.message)+".")]),n.id?t("p",{staticClass:"pl-4 mb-0"},[t("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.$t("Node ID"))+":")]),e._v(" "+e._s(n.id))]):e._e()])]})),e._l(e.warnings,(function(n,r){return[t("dt",{key:n.title+r,staticClass:"text-capitalize"},[t("font-awesome-icon",{staticClass:"status-bar-container__status-icon ml-1 mr-1 mt-1",style:{color:e.warningColor},attrs:{icon:e.faExclamationTriangle}}),e._v(" "+e._s(n.title)+" ")],1),t("dd",{key:n.title+r+"__dd",staticClass:"font-italic pl-4"},[e._v(e._s(n.text))])]}))],2)]):e._e()])],2)],2)},cg=[];f(86535),f(99244);function lg(e){return Object.entries(e).flatMap((function(e){var t=jt(e,2),n=t[0],r=t[1];return r.flatMap((function(e){return Qr(Qr({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))}var dg={components:{FontAwesomeIcon:To.FontAwesomeIcon},props:["validationErrors","warnings","xmlManager"],data:function(){return{shouldDisplayProblemsPanel:!1,errorColor:"#D9534F",warningColor:"#F0AD4E",faExclamationTriangle:is.faExclamationTriangle,faTimesCircle:is.faTimesCircle,faChevronUp:is.faChevronUp,faChevronDown:is.faChevronDown,faCheck:is.faCheck}},computed:{autoValidate:{get:function(){return Un.getters.autoValidate},set:function(e){Un.commit("setAutoValidate",e)}},errorList:function(){return lg(this.validationErrors)},numberOfProblemsToDisplay:function(){return this.errorList.length+this.warnings.length},isProblemsPanelDisplayed:function(){return this.shouldDisplayProblemsPanel&&this.numberOfProblemsToDisplay>0&&this.autoValidate},chevronIcon:function(){return this.shouldDisplayProblemsPanel?is.faChevronUp:is.faChevronDown}},methods:{isErrorCategory:function(e){return"error"===e.category}}},ug=dg,hg=(f(99088),fr(ug,ag,cg,!1,null,"1ad192c7",null)),pg=hg.exports,fg=function(){var e=this,t=e._self._c;return t("span",{attrs:{"data-test":"body-container"}},[e.showComponent?t("tool-bar",{ref:"tool-bar",attrs:{"canvas-drag-position":e.canvasDragPosition,cursor:e.cursor,"is-rendering":e.isRendering,"paper-manager":e.paperManager,"breadcrumb-data":e.breadcrumbData,panelsCompressed:e.panelsCompressed,"validation-errors":e.validationErrors,warnings:e.allWarnings,"xml-manager":e.xmlManager,validationBar:e.validationBar,"extra-actions":e.extraActions,players:e.players},on:{"load-xml":e.loadXML,"toggle-panels-compressed":function(t){e.panelsCompressed=!e.panelsCompressed},"toggle-mini-map-open":function(t){e.miniMapOpen=t},saveBpmn:e.saveBpmn,publishTemplate:e.publishTemplate,publishPmBlock:e.publishPmBlock,close:e.close,"save-state":e.pushToUndoStack,clearSelection:e.clearSelection,action:e.handleToolbarAction}}):e._e(),t("b-row",{staticClass:"modeler h-100"},[e.tooltipTarget?t("b-tooltip",{key:e.tooltipTarget.id,attrs:{target:e.getTooltipTarget,title:e.tooltipTitle}}):e._e(),e.showComponent?t("explorer-rail",{attrs:{"node-types":e.nodeTypes,"pm-block-nodes":e.pmBlockNodes},on:{"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler}}):e._e(),t("b-col",{ref:"paper-container",staticClass:"paper-container h-100 pr-4",class:[e.cursor,{"grabbing-cursor":e.isGrabbing}],style:{width:e.parentWidth,height:e.parentHeight},on:{mouseup:e.onMouseUp,mousemove:function(t){e.onMouseMove(t),e.setInspectorButtonPosition(t)}}},[t("div",{ref:"paper",staticClass:"main-paper",attrs:{"data-test":"paper"}})]),e.showWelcomeMessage?t("WelcomeMessage"):e._e(),t("InspectorButton",{directives:[{name:"show",rawName:"v-show",value:e.showComponent&&e.showInspectorButton,expression:"showComponent && showInspectorButton"}],ref:"inspector-button",style:{right:e.inspectorButtonRight+"px"},attrs:{showInspector:e.isOpenInspector},on:{toggleInspector:function(t){e.handleToggleInspector(t),e.setInspectorButtonPosition(t)}}}),t("PreviewPanel",{ref:"preview-panel",attrs:{visible:e.isOpenPreview,nodeRegistry:e.nodeRegistry,previewConfigs:e.previewConfigs,panelWidth:e.previewPanelWidth},on:{togglePreview:function(t){e.handleTogglePreview(t),e.setInspectorButtonPosition(t)},previewResize:function(t){e.onMouseMove(t),e.setInspectorButtonPosition(t)},startResize:e.onStartPreviewResize,stopResize:e.onMouseUp}}),e.showComponent?t("InspectorPanel",{directives:[{name:"show",rawName:"v-show",value:e.isOpenInspector&&!(e.highlightedNodes.length>1),expression:"isOpenInspector && !(highlightedNodes.length > 1)"}],ref:"inspector-panel",staticClass:"inspector h-100",style:{height:e.parentHeight},attrs:{nodeRegistry:e.nodeRegistry,moddle:e.moddle,definitions:e.definitions,processNode:e.processNode,"parent-height":e.parentHeight,"canvas-drag-position":e.canvasDragPosition},on:{"save-state":e.pushToUndoStack,"shape-resize":function(t){return e.shapeResize(!1)},toggleInspector:function(t){e.handleToggleInspector(t),e.setInspectorButtonPosition(t)}}}):e._e(),e._l(e.nodes,(function(n){return t(n.type,{key:n._modelerId,ref:"nodeComponent",refInFor:!0,tag:"component",attrs:{graph:e.graph,paper:e.paper,node:n,id:n.id,highlighted:e.highlightedNodes.includes(n),"has-error":e.invalidNodes.includes(n),"border-outline":e.borderOutline(n.id),collaboration:e.collaboration,"process-node":e.processNode,processes:e.processes,"plane-elements":e.planeElements,moddle:e.moddle,nodeRegistry:e.nodeRegistry,"root-elements":e.definitions.get("rootElements"),isRendering:e.isRendering,paperManager:e.paperManager,"auto-validate":e.autoValidate,"node-id-generator":e.nodeIdGenerator,"is-active":n===e.activeNode,"is-completed":e.requestCompletedNodes.includes(n.definition.id),"is-in-progress":e.requestInProgressNodes.includes(n.definition.id),"is-idle":e.requestIdleNodes.includes(n.definition.id)},on:{"add-node":e.addNode,"remove-node":e.removeNode,previewNode:function(t){e.handlePreview(t),e.setInspectorButtonPosition(t)},"set-cursor":function(t){e.cursor=t},"set-pool-target":function(t){e.poolTarget=t},"unset-pools":e.unsetPools,clearSelection:e.clearSelection,"set-pools":e.setPools,"save-state":e.pushToUndoStack,"set-shape-stacking":e.setShapeStacking,setTooltip:function(t){e.tooltipTarget=t},"replace-node":e.replaceNode,"replace-generic-flow":e.replaceGenericFlow,"copy-element":e.copyElement,"copy-selection":e.copyElement,"paste-element":e.pasteElements,"clone-element":e.cloneElement,"clone-selection":e.cloneSelection,"default-flow":e.toggleDefaultFlow,"shape-resize":e.shapeResize}})})),t("RailBottom",{attrs:{nodeTypes:e.nodeTypes,"paper-manager":e.paperManager,graph:e.graph,"is-rendering":e.isRendering},on:{"load-xml":e.loadXML,clearSelection:e.clearSelection,"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler}}),e.paper?t("selection",{ref:"selector",attrs:{graph:e.graph,paperManager:e.paperManager,useModelGeometry:!1,processNode:e.processNode,isMultiplayer:e.isMultiplayer},on:{"clone-selection":e.cloneSelection,"remove-nodes":e.removeNodes,"save-state":e.pushToUndoStack}}):e._e()],2)],1)},mg=[],gg=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},vg=[],bg=F.shapes.standard.Circle.extend({markup:[{tagName:"circle",selector:"body"},{tagName:"circle",selector:"body2"},{tagName:"text",selector:"label"},{tagName:"image",selector:"image"}],defaults:F.util.deepSupplement({type:"processmaker.components.nodes.boundaryEvent.Shape",size:{width:36,height:36},attrs:{label:{refY:"130%"},body:{stroke:"#212529",strokeWidth:.85,fill:"#FFF"},body2:{cx:18,cy:18,r:15,strokeWidth:.85,stroke:"#212529",fill:"#FFF"},image:{refX:5,refY:5,ref:"circle",width:26,height:26}}},F.shapes.standard.Circle.prototype.defaults)}),yg={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering","isActive"],mixins:[xa,xt,Fs],data:function(){return{shape:null,previousPosition:null,validPosition:null,invalidTargetElement:null}},watch:{"node.definition.name":function(e){this.shape.attr("label/text",e)},"node.definition.cancelActivity":function(e){this.toggleInterruptingStyle(e)}},methods:{getTaskUnderShape:function(){return this.graph.findModelsUnderElement(this.shape).find((function(e){return Ii(e.component)}))},setShapeBorderDashSpacing:function(e){this.shape.attr({body:{strokeDasharray:e},body2:{strokeDasharray:e}})},setSolidShapeBorder:function(){var e=0;this.setShapeBorderDashSpacing(e)},setDashedShapeBorder:function(){var e=5;this.setShapeBorderDashSpacing(e)},toggleInterruptingStyle:function(){this.node.definition.cancelActivity?this.setSolidShapeBorder():this.setDashedShapeBorder()},setShapeProperties:function(){var e=this.node.diagram.bounds,t=e.x,n=e.y,r=e.width,o=e.height;this.shape.position(t,n),this.shape.resize(r,o),this.shape.attr("label/text",this.node.definition.get("name")),this.shape.component=this},hasPositionChanged:function(){if(!this.previousPosition)return!0;var e=this.shape.position(),t=e.x,n=e.y,r=this.previousPosition,o=r.x,i=r.y;return t!==o||n!==i},getCenterPosition:function(){var e=this.shape.position(),t=e.x,n=e.y,r=this.shape.size(),o=r.width,i=r.height;return{x:t+o/2,y:n+i/2}},updateShapePosition:function(e){if(this.hasPositionChanged()){var t=Tt(this.getCenterPosition(),e),n=t.x,r=t.y,o=this.shape.size(),i=o.width,s=o.height;this.shape.position(n-i/2,r-s/2),this.previousPosition=this.shape.position()}},attachBoundaryEventToTask:function(e){if(e){var t=this.shape.getParentCell();t&&t.unembed(this.shape),e.embed(this.shape),this.node.definition.set("attachedToRef",e.component.node.definition)}},resetToInitialPosition:function(){this.shape.position(this.validPosition.x,this.validPosition.y),Un.commit("allowSavingElementPosition"),this.$emit("shape-resize")},moveBoundaryEventIfOverTask:function(){var e=this.getTaskUnderShape();Oi(this.node.type,e)?(this.attachBoundaryEventToTask(e),this.updateShapePosition(e),this.$emit("shape-resize")):this.resetToInitialPosition()},resetInvalidTarget:function(){this.invalidTargetElement&&(Nt(this.invalidTargetElement),this.invalidTargetElement=null,this.$emit("shape-resize"))},attachToValidTarget:function(e){var t=this;e.model===this.shape&&(Un.commit("preventSavingElementPosition"),this.validPosition=this.shape.position(),this.shape.listenToOnce(this.paper,"cell:pointerup blank:pointerup",(function(){t.moveBoundaryEventIfOverTask(),t.resetInvalidTarget(),Un.commit("allowSavingElementPosition")})))},turnInvalidTargetRed:function(){if(this.isActive){var e=this.graph.findModelsUnderElement(this.shape).filter((function(e){return e.component}))[0],t=this.invalidTargetElement===e;if(!t){var n=this.shape.getParentCell();e&&e!==n&&!Oi(this.node.type,e)&&e.attr("body/fill",ze),this.invalidTargetElement&&Nt(this.invalidTargetElement),this.invalidTargetElement=e}}},addMultiplayerBoundaryEvent:function(){var e,t={bpmnType:this.node.diagram.$type,id:this.node.diagram.id,type:this.node.type,attachedToRef:this.node.definition.get("attachedToRef")};window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",{x:this.node.diagram.bounds.x,y:this.node.diagram.bounds.y,height:this.node.diagram.bounds.height,width:this.node.diagram.bounds.width,attachedToRefId:null===(e=this.node.definition.get("attachedToRef"))||void 0===e?void 0:e.id,control:t,type:this.node.type,id:this.node.definition.id,color:this.node.definition.get("color")})}},mounted:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.shape=new bg,e.setShapeProperties(),e.shape.addTo(e.graph),t.next=5,e.$nextTick();case 5:e.toggleInterruptingStyle(),n=e.getTaskUnderShape(),e.attachBoundaryEventToTask(n),e.updateShapePosition(n),e.node.fromCrown&&e.addMultiplayerBoundaryEvent();case 10:case"end":return t.stop()}}),t)})))()}},wg=yg,xg=fr(wg,gg,vg,!1,null,null,null),kg=xg.exports,Cg={id:"processmaker-modeler-boundary-event",component:kg,bpmnType:"bpmn:BoundaryEvent",control:!0,category:"BPMN",label:"Boundary Event",definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Event"),cancelActivity:!0})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},validateIncoming:function(){return!1},inspectorConfig:[{name:"Boundary Event",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-boundary-event"},items:[{component:"FormInput",config:_a}]}]}]},Sg=f(67629),Eg=f.n(Sg),Ag=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.explorerOpen,expression:"explorerOpen"}],attrs:{id:"explorer-rail","data-test":"explorer-rail"}},[t("div",{staticClass:"rail-menu"},[t("b-tabs",{staticClass:"tabs--container",attrs:{"no-nav-style":!0}},[e._l(e.tabs,(function(n){return[t("b-tab",{key:n.idx,attrs:{title:e.$t(n.label),active:n.idx===e.tabIndex},on:{click:function(t){return e.setTabIndex(n.idx)}}})]}))],2),t("div",{staticClass:"close--container",on:{click:function(t){return e.closeRail()}}},[t("font-awesome-icon",{attrs:{icon:e.faTimes()}})],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:0===e.tabIndex,expression:"tabIndex === 0"}],staticClass:"node-types__container"},[t("filter-node-types",{attrs:{type:"object"}}),t("node-types-loop",e._g({},e.$listeners))],1),t("div",{directives:[{name:"show",rawName:"v-show",value:1===e.tabIndex,expression:"tabIndex === 1"}],staticClass:"pm-blocks__container"},[t("filter-node-types",{attrs:{type:"pmBlock"}}),t("pm-blocks-loop",e._g({},e.$listeners))],1)])},_g=[],Tg=5e3;zt().use(Nn);var Mg=new Nn.Store({state:{nodeTypes:[],pinnedNodeTypes:[],filteredNodeTypes:[],pmBlockNodeTypes:[],filteredPmBlockNodeTypes:[],explorerOpen:!1,searchTerm:"",selectedNode:null,ghostNode:null},getters:{getNodeTypes:function(e){return e.nodeTypes},getPinnedNodeTypes:function(e){return e.pinnedNodeTypes},getFilteredNodeTypes:function(e){return e.filteredNodeTypes},getExplorerOpen:function(e){return e.explorerOpen},getSearchTerm:function(e){return e.searchTerm},getPmBlockNodeTypes:function(e){return e.pmBlockNodeTypes},getFilteredPmBlockNodeTypes:function(e){return e.filteredPmBlockNodeTypes},getSelectedNode:function(e){return e.selectedNode},getGhostNode:function(e){return e.ghostNode}},mutations:{setNodeTypes:function(e,t){e.nodeTypes=t.filter((function(e){return e.control})).map((function(e){var t;return{id:(0,Er.uniqueId)("nodeType_"),type:e.id,icon:e.icon,label:e.label,bpmnType:e.bpmnType,rank:e.rank||Tg,items:null===(t=e.items)||void 0===t?void 0:t.map((function(e){return Qr(Qr({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setPinnedNodes:function(e,t){e.pinnedNodeTypes.push(t),e.pinnedNodeTypes=(0,Er.uniqBy)(e.pinnedNodeTypes,"type"),e.pinnedNodeTypes.sort((function(e,t){return e.rank-t.rank}))},setUnpinNode:function(e,t){e.pinnedNodeTypes=e.pinnedNodeTypes.filter((function(e){return e!==t}))},setFilteredNodeTypes:function(e,t){var n=e.pinnedNodeTypes,r=e.nodeTypes;e.searchTerm=t;var o=(0,Er.uniqBy)([].concat(W(n),W(r)),"id");e.filteredNodeTypes=o.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))},setPmBlockNodeTypes:function(e,t){e.pmBlockNodeTypes=t.filter((function(e){return e.control})).map((function(e){var t;return{id:(0,Er.uniqueId)("pmBlockNode_"),type:e.id,icon:e.icon,customIcon:e.customIcon,svgIcon:e.svgIcon,label:e.label,description:e.description,bpmnType:e.bpmnType,rank:e.rank||Tg,items:null===(t=e.items)||void 0===t?void 0:t.map((function(e){return Qr(Qr({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setFilteredPmBlockNodeTypes:function(e,t){var n=e.pmBlockNodeTypes;e.searchTerm=t;var r=(0,Er.uniqBy)(W(n),"id");e.filteredPmBlockNodeTypes=r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))},clearFilteredNodes:function(e){e.filteredNodeTypes=[],e.searchTerm=""},clearFilteredPmBlockNodes:function(e){e.filteredNodeTypes=[],e.filteredPmBlockNodeTypes=[],e.searchTerm=""},closeExplorer:function(e){e.explorerOpen=!1},toggleExplorer:function(e){e.explorerOpen=!e.explorerOpen},setSelectedNode:function(e,t){e.selectedNode=t},clearSelectedNode:function(e){e.selectedNode=null},setGhostNode:function(e,t){e.ghostNode=t}},actions:{getUserPinnedObjects:function(e){var t,n,r=e.commit;if("standalone"!==(null===(t=window.ProcessMaker)||void 0===t||null===(n=t.user)||void 0===n?void 0:n.id)){var o=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.get("/users/".concat(o,"/get_pinnned_controls")).then((function(e){var t=e.data;t.forEach((function(e){r("setPinnedNodes",e)}))})).catch((function(e){console.error(e)}))}else{var i=localStorage.pinnedNodes?JSON.parse(localStorage.pinnedNodes):[];i.forEach((function(e){r("setPinnedNodes",e)}))}},addUserPinnedObject:function(e,t){var n,r,o=e.commit,i=e.state;o("setPinnedNodes",t);var s=i.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(r=n.user)||void 0===r?void 0:r.id)){var a=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(a,"/update_pinned_controls"),{pinnedNodes:s}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(s)},removeUserPinnedObject:function(e,t){var n,r,o=e.commit,i=e.state;o("setUnpinNode",t);var s=i.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(r=n.user)||void 0===r?void 0:r.id)){var a=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(a,"/update_pinned_controls"),{pinnedNodes:s}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(s)}}}),Pg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"searchNodeTypes"}},[t("label",{staticClass:"position-relative d-block"},[t("i",{staticClass:"fas fa-search position-absolute h-100 text-muted ml-2"}),t("b-input",{attrs:{placeholder:e.placeholder},model:{value:e.searchTerm,callback:function(t){e.searchTerm=t},expression:"searchTerm"}})],1)])},Ig=[],Og={name:"FilterNodeTypes",props:["type"],data:function(){return{searchTerm:""}},watch:{searchTerm:function(e){"pmBlock"===this.type?(0===e.length&&Mg.commit("clearFilteredPmBlockNodes"),e.length>0&&Mg.commit("setFilteredPmBlockNodeTypes",e)):(0===e.length&&Mg.commit("clearFilteredNodes"),e.length>0&&Mg.commit("setFilteredNodeTypes",e))},type:function(e,t){this.searchTerm=t===e?this.searchTerm:""}},computed:{nodeTypes:function(){var e=Mg.getters.getPinnedNodeTypes,t=Mg.getters.getNodeTypes;return[].concat(W(e),W(t))},pmBlockNodes:function(){var e=Mg.getters.getPmBlockNodeTypes;return W(e)},placeholder:function(){return"pmBlock"===this.type?this.$t("Search PM Blocks"):this.$t("Search Objects")}}},Dg=Og,Ng=(f(29062),fr(Dg,Pg,Ig,!1,null,"c468f432",null)),Rg=Ng.exports,Bg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"nodeTypesList"}},[e.filteredNodes.length>0?t("div",{attrs:{id:"filteredNodes-container"}},[e._l(e.filteredNodes,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.target!==t.currentTarget?null:e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),e.nodeTypeAlreadyPinned(n,n.type)?t("img",{staticClass:"pinIcon",attrs:{src:e.pinFillIcon,alt:"Unpin Element"},on:{click:function(t){return e.unPin(n)}}}):t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin Element"},on:{click:function(t){return e.addPin(n)}}})])]}))],2):e._e(),0!==e.filteredNodes.length||e.searchTerm?e._e():[e.pinnedObjects.length>0?t("div",{staticClass:"pinnedObjects"},[t("p",[e._v(e._s(e.$t("Pinned Objects")))]),e._l(e.pinnedObjects,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),t("img",{staticClass:"pinIcon",attrs:{src:e.pinFillIcon,alt:"Pin/Unpin Element"},on:{click:function(t){return e.unPin(n)}}})])]}))],2):e._e(),t("div",{staticClass:"objectCategory"},[t("p",[e._v(e._s(e.$t("Object Category")))]),e._l(e.unpinnedObjects,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",class:{"node-types__item__highlight":"processmaker-ai-assistant"===n.type},attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.icon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("span",[e._v(e._s(e.$t(n.label)))]),t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin/Unpin Element"},on:{click:function(t){return e.addPin(n)}}})])]}))],2)]],2)},Lg=[],jg=f.p+"img/pin-angle.95ef112b.svg",Fg=f.p+"img/pin-angle-fill.45c5a07f.svg",zg={methods:{containsSvg:function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/;return"string"===typeof e&&(t.test(e)||n.test(e))}}},Ug={mixins:[zg],data:function(){return{wasClicked:!1,selectedSubmenuItem:null,xOffset:0,yOffset:0,helperStyles:{backgroundColor:"#ffffff",position:"absolute",height:"40px",width:"40px",zIndex:"10",opacity:"0.5",pointerEvents:"none"},popperType:null}},methods:{onClickHandler:function(e,t){var n=this;this.createDraggingHelper(e,t),document.addEventListener("mousemove",this.setDraggingPosition),this.setDraggingPosition(e),this.selectedItem&&this.selectedItem.type===t.type?this.deselect():(this.wasClicked=!0,Mg.commit("setSelectedNode",t),this.$emit("onSetCursor","crosshair"),this.parent||(this.popperType=t.type),window.ProcessMaker.EventBus.$on("custom-pointerclick",(function(e){window.ProcessMaker.EventBus.$off("custom-pointerclick"),document.removeEventListener("mousemove",n.setDraggingPosition),n.movedElement&&document.body.removeChild(n.movedElement),n.popperType=null,n.selectedSubmenuItem=null,n.onCreateElement(e),Mg.commit("clearSelectedNode"),Mg.commit("setGhostNode",null),n.$emit("onSetCursor","none")})))},onCreateElement:function(e){this.wasClicked&&this.selectedItem&&(this.parent&&(this.parent=null),this.$emit("onCreateElement",{event:e,control:this.selectedItem}),this.wasClicked=!1,e.preventDefault())},setDraggingPosition:function(e){var t=e.pageX,n=e.pageY,r=this.movedElement;r&&(r.style.left="".concat(t,"px"),r.style.top="".concat(n,"px")),Mg.commit("setGhostNode",r)},createDraggingHelper:function(e,t){this.movedElement&&(document.removeEventListener("mousemove",this.setDraggingPosition),document.body.removeChild(this.movedElement));var n=this.containsSvg(t.icon),r=n?document.createElement("img"):document.createElement("i");Object.assign(r.style,this.helperStyles),n?r.src=t.icon:r.setAttribute("class",t.icon),document.body.appendChild(r),Mg.commit("setGhostNode",r);var o=e.target;this.xOffset=e.clientX-o.getBoundingClientRect().left,this.yOffset=e.clientY-o.getBoundingClientRect().top},deselect:function(){window.ProcessMaker.EventBus.$off("custom-pointerclick"),document.removeEventListener("mousemove",this.setDraggingPosition),this.movedElement&&document.body.removeChild(this.movedElement),this.$emit("onSetCursor","none"),this.wasClicked=!1,Mg.commit("clearSelectedNode"),Mg.commit("setGhostNode",null)}},computed:{selectedItem:function(){return Mg.getters.getSelectedNode},movedElement:function(){return Mg.getters.getGhostNode}}},qg={name:"NodeTypesLoop",mixins:[Ug,zg],data:function(){return{pinIcon:jg,pinFillIcon:Fg,showPin:!1}},created:function(){Mg.dispatch("getUserPinnedObjects")},methods:{nodeTypeAlreadyPinned:function(e,t){return!!this.pinnedObjects.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Mg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Mg.dispatch("addUserPinnedObject",e)}},computed:{pinnedObjects:function(){return Mg.getters.getPinnedNodeTypes},objects:function(){return Mg.getters.getNodeTypes},unpinnedObjects:function(){var e=this,t=this.objects;return t.filter((function(t){return!e.pinnedObjects.some((function(e){return e.type===t.type}))}))},filteredNodes:function(){return Mg.getters.getFilteredNodeTypes},searchTerm:function(){return Mg.getters.getSearchTerm}}},Vg=qg,Hg=(f(66456),fr(Vg,Bg,Lg,!1,null,null,null)),Wg=Hg.exports,Gg=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"pmBlockNodeTypesList"}},[e.filteredPmBlockNodes.length>0?t("div",{attrs:{id:"filteredPmBlockNodes-container"}},[e._l(e.filteredPmBlockNodes,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",on:{click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[t("div",{staticClass:"d-flex"},[n.svgIcon?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"node-types__item__icon",class:n.customIcon}),t("label",[e._v(e._s(e.$t(n.label)))])])])]}))],2):e._e(),0!==e.filteredPmBlockNodes.length||e.searchTerm?e._e():[t("div",{staticClass:"pmBlocksContainer p-2"},[e._l(e.pmBlockNodeTypes,(function(n){return[t("div",{key:n.id,staticClass:"pm-block-node-types__item p-2 d-block",on:{click:function(t){return t.stopPropagation(),e.onClickHandler(t,n)}}},[t("div",{staticClass:"d-flex"},[n.svgIcon?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"node-types__item__icon",class:n.customIcon}),t("label",[e._v(e._s(e.$t(n.label)))])])])]}))],2)]],2)},$g=[],Xg={name:"PmBlocksLoop",mixins:[Ug],computed:{pmBlockNodeTypes:function(){return Mg.getters.getPmBlockNodeTypes},filteredPmBlockNodes:function(){return Mg.getters.getFilteredPmBlockNodeTypes},searchTerm:function(){return Mg.getters.getSearchTerm}}},Yg=Xg,Jg=(f(48649),fr(Yg,Gg,$g,!1,null,null,null)),Zg=Jg.exports,Kg={name:"ExplorerRail",props:{explorerExpanded:{type:Boolean},nodeTypes:{type:Array},pmBlockNodes:{type:Array}},components:{FontAwesomeIcon:To.FontAwesomeIcon,FilterNodeTypes:Rg,NodeTypesLoop:Wg,PmBlocksLoop:Zg},data:function(){return{tabs:[{idx:0,label:"Add Object"},{idx:1,label:"PM Blocks"}],tabIndex:0}},computed:{explorerOpen:function(){return Mg.getters.getExplorerOpen}},created:function(){Mg.commit("setNodeTypes",this.nodeTypes)},methods:{faTimes:function(){return is.faTimes},setTabIndex:function(e){this.tabIndex!==e&&(this.tabIndex=e,this.clearFilteredObjects())},closeRail:function(){Mg.commit("closeExplorer"),this.clearFilteredObjects()},clearFilteredObjects:function(){Mg.commit("clearFilteredNodes"),Mg.commit("clearFilteredPmBlockNodes")}}},Qg=Kg,ev=(f(14906),fr(Qg,Ag,_g,!1,null,null,null)),tv=ev.exports,nv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message d-flex flex-column w-100 align-items-center"},[t("b-button",{staticClass:"new-process-btn d-flex flex-row px-2 py-4 align-items-center",on:{click:function(t){return e.redirectToAiProcess()}}},[t("div",{staticClass:"d-flex justify-content-between"},[t("inline-svg",{staticClass:"mx-3 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("div",{staticClass:"mr-2 text-left"},[t("div",{staticClass:"h5 m-0"},[e._v(e._s(e.aiProcessButtonTitle))]),t("div",{staticClass:"text-secondary font-weight-light small"},[this.promptSessionId&&""!==this.promptSessionId?t("div",{staticClass:"d-flex align-items-center"},[e._v(" "+e._s(e.$t("Last session by:"))+" "),t("avatar-image",{staticClass:"ml-2 mr-1 d-flex align-items-center",attrs:{size:"18","input-data":e.lastSession,"hide-name":"true"}}),e._v(" "+e._s(e.aiProcessButtonSubtitle)+" ")],1):t("div",[e.showSessionLoader?t("span",[t("i",{staticClass:"fa fa-spinner fa-spin"})]):e._e(),t("span",[e._v(e._s(e.aiProcessButtonSubtitle))])])])])],1),t("span",{staticClass:"fa fa-chevron-right mx-3"})]),t("div",{staticClass:"d-flex justify-content-center align-items-center flex-column justify-content-center"},[t("div",{staticClass:"justify-content-center align-items-center w-100 text-center my-4"},[t("div",{staticClass:"text-align-center d-flex text-center justify-content-center align-items-center"},[t("div",{staticClass:"hyphen"}),e._v(" "+e._s(e.$t("or"))+" "),t("div",{staticClass:"hyphen"})])]),t("div",{staticClass:"w-100"},[e._v(" "+e._s(e.$t("Click and drop objects to build the process you like."))+" ")])])],1)},rv=[];const ov={};function iv(e){return Object.keys(e).reduce(((t,n)=>(!1!==e[n]&&null!==e[n]&&void 0!==e[n]&&(t[n]=e[n]),t)),{})}const sv={name:"InlineSvg",inheritAttrs:!1,render(e){return this.svgElSource?e("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),iv(this.$attrs)),domProps:{innerHTML:this.getSvgContent(this.svgElSource)}}):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0}},data(){return{svgElSource:null}},watch:{src(e){this.getSource(e)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t},getSvgContent(e){return e=e.cloneNode(!0),e=this.transformSource(e),this.title&&av(e,this.title),e.innerHTML},getSource(e){ov[e]||(ov[e]=this.download(e)),this.svgElSource&&ov[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),ov[e].then((e=>{this.svgElSource=e,this.$nextTick((()=>{this.$emit("loaded",this.$el)}))})).catch((t=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete ov[e],this.$emit("error",t)}))},download(e){return cv(new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.onload=()=>{if(r.status>=200&&r.status<400)try{const e=new DOMParser,o=e.parseFromString(r.responseText,"text/xml");let i=o.getElementsByTagName("svg")[0];i?t(i):n(new Error('Loaded file is not valid SVG"'))}catch(e){n(e)}else n(new Error("Error loading SVG"))},r.onerror=n,r.send()})))}}};function av(e,t){const n=e.getElementsByTagName("title");if(n.length)n[0].textContent=t;else{const n=document.createElementNS("http://www.w3.org/2000/svg","title");n.textContent=t,e.insertBefore(n,e.firstChild)}}function cv(e){if(e.getIsPending)return e;let t=!0,n=e.then((e=>(t=!1,e)),(e=>{throw t=!1,e}));return n.getIsPending=function(){return t},n}var lv={name:"WelcomeMessage",components:{InlineSvg:sv},data:function(){var e,t,n;return{proceC2Icon:f(7225),lastSession:{},history:[],processId:null===(e=window.ProcessMaker)||void 0===e||null===(t=e.modeler)||void 0===t||null===(n=t.process)||void 0===n?void 0:n.id}},computed:{promptSessionId:function(){var e=this,t=localStorage.getItem("promptSessions");t=t?JSON.parse(t):[];var n=t.find((function(t){return t.processId===e.processId&&t.server===window.location.host}));return n?n.promptSessionId:""},showSessionLoader:function(){return!(!this.promptSessionId||""===this.promptSessionId||void 0!==this.lastSession.firstname)},aiProcessButtonTitle:function(){return this.promptSessionId&&""!==this.promptSessionId?this.$t("Continue AI session"):this.$t("Create a process with AI")},aiProcessButtonSubtitle:function(){return this.promptSessionId&&""!==this.promptSessionId?"".concat(this.lastSession.firstname," ").concat(this.lastSession.lastnameInitials,". | ").concat(this.formatDateTime(this.lastSession.requestDate)):this.$t("Kick-start an AI generated process")}},mounted:function(){localStorage.getItem("promptSessions")&&"null"!==localStorage.getItem("promptSessions")||localStorage.setItem("promptSessions",JSON.stringify([])),this.promptSessionId&&""!==this.promptSessionId&&this.getLastSharedHistory()},methods:{redirectToAiProcess:function(){var e,t=null!==(e=window.ProcessMaker.modeler.process.id)&&void 0!==e?e:null;if(t){var n="/package-ai/processes/create/".concat(t,"/").concat(t);window.location=n}},getLastSharedHistory:function(){var e=this,t="/package-ai/getLastSharedSessionHistory",n={sharedSessionId:this.promptSessionId};window.ProcessMaker.apiClient.post(t,n).then((function(t){e.$set(e.lastSession,"requestDate",t.data.requestDate),e.$set(e.lastSession,"firstname",t.data.firstname),e.$set(e.lastSession,"lastname",t.data.lastname),e.$set(e.lastSession,"lastnameInitials",t.data.lastnameInitials),e.$set(e.lastSession,"avatar",t.data.avatar)})).catch((function(t){var n,r,o=(null===(n=t.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)||t.message;e.loading=!1,window.ProcessMaker.alert(o,"danger")}))},formatDateTime:function(e){var t="";return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.datetime_format&&(t=window.ProcessMaker.user.datetime_format),e?window.moment(e).isValid()?window.moment(e).format(t):e:"n/a"}}},dv=lv,uv=(f(43207),fr(dv,nv,rv,!1,null,null,null)),hv=uv.exports,pv=f(33293),fv=f(82729),mv=f.n(fv),gv=function(){var e=this,t=e._self._c;return t("button",{staticClass:"inspector-button",attrs:{type:"button","data-cy":"inspector-button"},on:{click:e.toggleInspector}},[t("inline-svg",{attrs:{src:e.inspectorIcon}})],1)},vv=[],bv={components:{InlineSvg:sv},props:{showInspector:{type:Boolean,default:!0}},data:function(){return{inspectorIcon:f(28400)}},methods:{toggleInspector:function(){this.$emit("toggleInspector",!this.showInspector)}}},yv=bv,wv=(f(5728),fr(yv,gv,vv,!1,null,"cebfb20a",null)),xv=wv.exports,kv=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"inspector"}},[t("b-col",{staticClass:"pl-0 h-100 overflow-hidden inspector-column",class:[{"ignore-pointer":e.canvasDragPosition,"ai-inspector":e.isAiInspector}],attrs:{id:"inspector","data-test":"inspector-column"}},[t("b-card",{staticClass:"inspector-container border-top-0 border-bottom-0 border-right-0 rounded-0",style:{height:e.parentHeight},attrs:{"no-body":"","data-test":"inspector-container","data-cy":"inspector-panel"},scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"inspector-header"},[t("div",{staticClass:"inspector-header-title"},[e._v(" "+e._s(e.inspectorHeaderTitle)+" ")]),t("button",{staticClass:"close",attrs:{type:"button","aria-label":"Close","data-cy":"inspector-close-button"},on:{click:e.onClose}},[e._v(" × ")])])]},proxy:!0}])},[e.highlightedNode?t("vue-form-renderer",{key:e.highlightedNode._modelerId,ref:"formRenderer",staticClass:"overflow-auto h-100 inspector-font-size",attrs:{data:e.data,config:e.config},on:{update:e.updateDefinition},nativeOn:{focusout:function(t){return e.updateState.apply(null,arguments)}}}):e._e()],1)],1)],1)},Cv=[],Sv=f(43637),Ev=f(21223),Av=(f(85780),f(50308)),_v=f.n(Av),Tv={id:"processmaker-modeler-process",bpmnType:"bpmn:Process",control:!1,label:"Process",inspectorConfig:[{name:"Process Information",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-process"},items:[{component:"FormInput",config:Ns},{component:"FormInput",config:{label:"Name",helper:"The Name of the Process",name:"name",placeholder:""}}]}]}]},Mv=Tv.id,Pv=Tv;zt().component("FormText",Sv.renderer.FormText),zt().component("FormInput",Ev.FormInput),zt().component("FormSelect",Ev.FormSelect),zt().component("FormTextArea",Ev.FormTextArea),zt().component("FormCheckbox",Ev.FormCheckbox),zt().component("FormRadioButtonGroup",Ev.FormRadioButtonGroup),zt().component("FormAccordion",Ev.FormAccordion),zt().component("FormDatePicker",Ev.FormDatePicker),zt().component("FormMultiSelect",Ev.FormMultiSelect);var Iv={components:{},props:["nodeRegistry","moddle","processNode","parentHeight","canvasDragPosition","definitions"],data:function(){return{data:{},config:[],inspectorHandler:null,translated:[],isVisible:!0}},watch:{highlightedNode:function(){document.activeElement.blur(),this.prepareData(),this.prepareConfig()},"highlightedNode.definition.assignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentLock":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.allowReassignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedUsers":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedGroups":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentRules":function(e,t){this.handleAssignmentChanges(e,t)}},computed:{inspectorHeaderTitle:function(){return"package-ai/processmaker-ai-assistant"===this.data.implementation?this.$t("AI Assistant"):this.$t("Configuration")},isAiInspector:function(){return"package-ai/processmaker-ai-assistant"===this.data.implementation},highlightedNode:function(){return Un.getters.highlightedNodes[0]},isAnyNodeActive:function(){return this.highlightedNode},updateDefinition:function(){var e=this;if(!this.isAnyNodeActive)return _v();var t=this.defaultInspectorHandler;return this.isProcessNodeActive&&(t=this.processNodeInspectorHandler),this.hasCustomInspectorHandler&&(t=this.customInspectorHandler),function(n){if(n){if(ja()(n.documentation)&&$()(e.highlightedNode.definition.get("documentation")[0],"text")!==n.documentation){var r=n.documentation?[e.moddle.create("bpmn:Documentation",{text:n.documentation})]:void 0;e.setNodeProp(e.highlightedNode,"documentation",r),e.multiplayerHook("documentation",r,Un.state.isMultiplayer)}t(lc()(n,["documentation"]),Un.state.isMultiplayer)}}},hasCustomInspectorHandler:function(){return this.nodeRegistry[this.highlightedNode.type].inspectorHandler},isProcessNodeActive:function(){return this.highlightedNode===this.processNode}},methods:{onClose:function(){this.$emit("toggleInspector",!1)},handleAssignmentChanges:function(e,t){e!==t&&this.prepareData()},prepareConfig:function(){if(!this.highlightedNode)return this.config={name:"Empty",items:[]};var e=this.highlightedNode,t=e.type,n=e.definition;if(this.highlightedNode===this.processNode)return this.config=Pv.inspectorConfig;var r=ho()(this.nodeRegistry[t].inspectorConfig),o=$()(r,"[0].items[0].items");if(this.isSequenceFlow(t)&&this.isConnectedToGateway(n)){var i=this.$t("Enter the expression that describes the workflow condition");i+=' <a href="https://docs.processmaker.com/designing-processes/expression-syntax-components" target="_blank"><i class="far fa-question-circle mr-1"></a>';var s={component:"FormInput",config:{label:this.$t("Expression"),helper:i,name:"conditionExpression"}},a=o.find((function(e){return e.config&&"Name"===e.config.label})),c=o.indexOf(a);a&&c>=0?o.splice(c+1,0,s):o.push(s)}return this.config=r},prepareData:function(){if(!this.highlightedNode)return{};var e=this.highlightedNode&&this.highlightedNode.type,t=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})};this.data=e&&this.nodeRegistry[e].inspectorData?this.nodeRegistry[e].inspectorData(this.highlightedNode,t,this):t(this.highlightedNode)},isSequenceFlow:function(e){return e===gl},isConnectedToGateway:function(e){return["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type)},isConnectedToSubProcess:function(e){return"bpmn:CallActivity"===e.targetRef.$type},customInspectorHandler:function(e,t){return this.nodeRegistry[this.highlightedNode.type].inspectorHandler(e,this.highlightedNode,this.setNodeProp,this.moddle,this.definitions,this.defaultInspectorHandler,t)},processNodeInspectorHandler:function(e,t){return this.defaultInspectorHandler(lc()(e,["artifacts","flowElements","laneSets"]),t)},setNodeProp:function(e,t,n){this.$emit("shape-resize"),Un.commit("updateNodeProp",{node:e,key:t,value:n})},defaultInspectorHandler:function(e,t){for(var n in lc()(e,["$type","eventDefinitions"]))this.highlightedNode.definition.get(n)!==e[n]&&(this.multiplayerHook(n,e[n],t),this.setNodeProp(this.highlightedNode,n,e[n]))},updateState:function(){this.$emit("save-state")},multiplayerHook:function(e,t,n){n&&window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:this.highlightedNode.definition.id,key:e,value:t})}}},Ov=Iv,Dv=(f(86020),fr(Ov,kv,Cv,!1,null,"40e10039",null)),Nv=Dv.exports,Rv=function(){var e=this,t=e._self._c;return t("b-row",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"resizableDiv",on:{mouseup:e.onMouseUp,mousemove:e.onMouseMove}},[t("b-col",{staticClass:"col-auto p-0 resizer-column",on:{mousedown:e.onMouseDown}}),t("b-col",{staticClass:"pl-0 h-100 overflow-hidden preview-column",style:{width:e.panelWidth+"px"},attrs:{"data-test":"preview-panel"}},[t("b-row",{staticClass:"control-bar"},[t("b-col",{attrs:{cols:"9"}},[t("div",[t("i",{directives:[{name:"show",rawName:"v-show",value:1===e.selectedPreview,expression:"selectedPreview === 1"}],staticClass:"fas fa-file-alt"}),t("b",{directives:[{name:"show",rawName:"v-show",value:2===e.selectedPreview,expression:"selectedPreview === 2"}]},[e._v(" {} ")]),t("b-dropdown",{staticClass:"preview-type-dropdown",attrs:{variant:"ellipsis","no-caret":"","no-flip":"",lazy:""},scopedSlots:e._u([{key:"button-content",fn:function(){return[t("i",{staticClass:"fas fa-sort-down"})]},proxy:!0}]),model:{value:e.selectedPreview,callback:function(t){e.selectedPreview=t},expression:"selectedPreview"}},[t("b-dropdown-item",{key:"1",staticClass:"ellipsis-dropdown-item mx-auto",on:{click:function(t){return e.onSelectedPreview(1)}}},[t("div",{staticClass:"ellipsis-dropdown-content"},[t("b",{staticClass:"pr-1 fa-fw fas fa-file-alt"}),t("span",[e._v(e._s(e.$t("Document")))])])])],1),t("span",[e._v(e._s(e.$t("Preview"))+" - "+e._s(e.taskTitle))])],1)]),t("b-col",{staticClass:"actions"},[t("i",{directives:[{name:"show",rawName:"v-show",value:e.previewUrl,expression:"previewUrl"}],staticClass:"fas fa-external-link-alt",on:{click:function(t){return e.openAsset()}}}),t("i",{staticClass:"fas fa-times",on:{click:function(t){return e.onClose()}}})])],1),t("b-row",{staticClass:"divider"}),t("b-row",[t("div",{staticClass:"task-title"},[e._v(" "+e._s(e.taskTitle)+" ")])]),t("loading-preview",{directives:[{name:"show",rawName:"v-show",value:e.showSpinner,expression:"showSpinner"}]}),t("no-preview-available",{directives:[{name:"show",rawName:"v-show",value:!e.previewUrl,expression:"!previewUrl"}]}),t("iframe",{directives:[{name:"show",rawName:"v-show",value:!!e.previewUrl&&!e.showSpinner,expression:"!!previewUrl && !showSpinner"}],staticClass:"preview-iframe",attrs:{title:"Preview",src:e.previewUrl},on:{load:e.loading,mousemove:e.onMouseMove,mouseup:e.onMouseUp}})],1)],1)},Bv=[],Lv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"preview-placeholder"},[t("img",{attrs:{id:"preview-image",src:e.noPreviewImg,alt:"no preview"}}),t("h1",[e._v("No Resource Assigned")]),t("h2",[e._v("This is a placeholder screen. Please, assign a resource to this task.")])])},jv=[],Fv={data:function(){return{noPreviewImg:f(2431)}}},zv=Fv,Uv=(f(79763),f(17378),fr(zv,Lv,jv,!1,null,"cdc64a14",null)),qv=Uv.exports,Vv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"preview-placeholder"},[t("img",{attrs:{id:"preview-image",src:e.previewAsset,alt:"Preview Asset"}}),t("h1",[e._v("The preview is loading")]),t("h2",[e._v("Some assets can take some time to load")]),t("img",{attrs:{alt:"spinner",src:e.spinnerImg}})])},Hv=[],Wv={data:function(){return{previewAsset:f(74818),spinnerImg:f(95522)}}},Gv=Wv,$v=(f(24289),f(64346),fr(Gv,Vv,Hv,!1,null,"0cafde2c",null)),Xv=$v.exports,Yv={props:["nodeRegistry","visible","previewConfigs","panelWidth"],components:{NoPreviewAvailable:qv,LoadingPreview:Xv},data:function(){return{data:{},previewUrl:null,showSpinner:!1,selectedPreview:"1",taskTitle:"",itemTitle:"",width:600,currentPos:600}},watch:{previewUrl:function(e,t){e!==t&&(this.showSpinner=!0)},highlightedNode:function(){document.activeElement.blur(),this.prepareData()},"highlightedNode.definition":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentLock":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.allowReassignment":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedUsers":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignedGroups":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.assignmentRules":function(e,t){this.handleAssignmentChanges(e,t)}},computed:{highlightedNode:function(){return Un.getters.highlightedNodes[0]}},methods:{loading:function(){this.showSpinner=!1},getConfig:function(e){return this.previewConfigs.find((function(t){return t.matcher(e)}))},openAsset:function(){var e=this.getConfig(this.data);window.open(e.assetUrl(this.data),"_blank")},prepareData:function(){var e,t,n;if(!this.highlightedNode)return{};var r=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})};this.data=r(this.highlightedNode),this.taskTitle=null===(e=this.data)||void 0===e?void 0:e.name,this.taskTitle=null===this||void 0===this||null===(t=this.highlightedNode)||void 0===t||null===(n=t.definition)||void 0===n?void 0:n.name,this.previewNode()},handleAssignmentChanges:function(e,t){if(e!==t){var n=this.getConfig(this.data);n?this.prepareData():this.$emit("togglePreview",!1)}},onSelectedPreview:function(e){this.selectedPreview=e},previewNode:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.highlightedNode&&(this.visible||r)){var o=this.previewConfigs.find((function(e){return e.matcher(n.data)})),i={};for(var s in this.data){var a;(null!==(a=null===o||void 0===o?void 0:o.receivingParams)&&void 0!==a?a:[]).includes(s)&&(i[s]=this.data[s])}var c=encodeURI(JSON.stringify(i)),l=Object.keys(i).length>0;this.previewUrl=o&&l?"".concat(o.url,"?node=").concat(c):null,this.taskTitle=null===(e=this.highlightedNode)||void 0===e||null===(t=e.definition)||void 0===t?void 0:t.name}},onClose:function(){this.$emit("togglePreview",!1)},onMouseDown:function(e){this.$emit("startResize",e)},onMouseUp:function(){this.$emit("stopResize")},onMouseMove:function(e){window.ProcessMaker.$modeler.isResizingPreview&&this.$emit("previewResize",e)},setWidth:function(e){var t=this.currentPos-e;this.currentPos=e,this.width=parseInt(this.width)+t}}},Jv=Yv,Zv=(f(70134),fr(Jv,Rv,Bv,!1,null,"65cadc71",null)),Kv=Zv.exports;zt().use(Nn);var Qv=new Nn.Store({state:{stack:[],position:null,disabled:!1,isVersionsInstalled:!1,isDraft:!1,isLoading:!1},getters:{canUndo:function(e){return e.position>0},canRedo:function(e){return e.position<e.stack.length-1},currentState:function(e){return e.stack[e.position]},isVersionsInstalled:function(e){return e.isVersionsInstalled},isDraft:function(e){return e.isDraft},isLoading:function(e){return e.isLoading}},mutations:{setPosition:function(e,t){e.position=t},setState:function(e,t){e.stack=e.stack.slice(0,e.position+1),e.stack.push(t)},clearStack:function(e){e.stack=[e.stack[e.stack.length-1]]},disableSavingState:function(e){e.disabled=!0},enableSavingState:function(e){e.disabled=!1},isVersionsInstalled:function(e,t){e.isVersionsInstalled=t},isDraft:function(e,t){e.isDraft=t},isLoading:function(e,t){e.isLoading=t}},actions:{pushState:function(e,t){var n=e.state,r=e.getters,o=e.commit;t===r.currentState||n.disabled||(o("setState",t),o("setPosition",n.stack.length-1))},undo:function(e){var t=e.state,n=e.getters,r=e.commit;n.canUndo&&r("setPosition",t.position-1)},redo:function(e){var t=e.state,n=e.getters,r=e.commit;n.canRedo&&r("setPosition",t.position+1)},enableVersions:function(e){var t=e.commit;t("isVersionsInstalled",!0)},setVersionIndicator:function(e,t){var n=e.commit;n("isDraft",t)},setLoadingState:function(e,t){var n=e.commit;n("isLoading",t)}}}),eb=f(51540),tb=f(51248),nb=f.n(tb),rb=f(48909),ob=f.n(rb),ib=f(82317),sb=f.n(ib),ab=f(83184),cb=f.n(ab),lb=f(36111),db=f.n(lb),ub=f(25795),hb=f.n(ub),pb=f(37554),fb=f.n(pb),mb=f(19869),gb=f.n(mb),vb=f(88687),bb=f.n(vb),yb=f(37028),wb=f.n(yb),xb=f(89185),kb=f.n(xb),Cb=f(34652),Sb=f.n(Cb),Eb=f(49252),Ab=f.n(Eb),_b=f(93414),Tb=f.n(_b),Mb=f(68522),Pb=f.n(Mb),Ib=f(7174),Ob=f.n(Ib),Db=f(74815),Nb=f.n(Db),Rb=f(24874),Bb=f.n(Rb),Lb={};function jb(){}jb.prototype.resolveRule=function(e,t){const n=Lb[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">");return n},jb.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">")};var Fb=new jb,zb={"conditional-flows":"error","end-event-required":"error","event-sub-process-typed-start-event":"error","label-required":"error","no-complex-gateway":"error","no-disconnected":"error","no-gateway-join-fork":"error","no-implicit-split":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"warning","processmaker/custom-validation":"error","processmaker/gateway-direction":"error","processmaker/event-based-gateway":"error","processmaker/call-activity-child-process":"error","processmaker/id-required":"error","processmaker/signal-ref-required":"error"},Ub={rules:zb},qb={resolver:Fb,config:Ub},Vb=qb;function Hb(e,t,n,r,o,i,s){var a={allowDrop:!1,poolTarget:null};if(!Yb(e,t,s))return a.allowDrop=!1,a;if($b(n.type))return a.allowDrop=!0,a;if(Jb(n.bpmnType)){var c=o.findModelsFromPoint(Zb(e,t,r)).sort((function(e,t){return t.get("z")-e.get("z")}))[0];return a.allowDrop=Oi(n.type,c),a}if(Xb(i))return a.allowDrop=!0,a;if(Wb(n.bpmnType))return a.allowDrop=!0,a;var l=Gb(e,t,r,o);return l&&(a.allowDrop=!0,a.poolTarget=l),a}function Wb(e){return"bpmn:TextAnnotation"===e}function Gb(e,t,n,r){return r.findModelsFromPoint(Zb(e,t,n)).find((function(e){var t=e.component;return t&&t.node.type===Jo}))}function $b(e){return e===Jo}function Xb(e){return!e||0===e.get("participants").length}function Yb(e,t,n){var r=n.getBoundingClientRect(),o=r.left,i=r.top,s=r.width,a=r.height,c=new F.g.rect(o,i,s,a),l=new F.g.Point(e,t);return c.containsPoint(l)}function Jb(e){return"bpmn:BoundaryEvent"===e}function Zb(e,t,n){return n.clientToLocalPoint({x:e,y:t})}Lb["bpmnlint/conditional-flows"]=nb(),Lb["bpmnlint/end-event-required"]=ob(),Lb["bpmnlint/event-sub-process-typed-start-event"]=sb(),Lb["bpmnlint/label-required"]=cb(),Lb["bpmnlint/no-complex-gateway"]=db(),Lb["bpmnlint/no-disconnected"]=hb(),Lb["bpmnlint/no-gateway-join-fork"]=fb(),Lb["bpmnlint/no-implicit-split"]=gb(),Lb["bpmnlint/single-event-definition"]=bb(),Lb["bpmnlint/start-event-required"]=wb(),Lb["bpmnlint/sub-process-blank-start-event"]=kb(),Lb["bpmnlint/superfluous-gateway"]=Sb(),Lb["bpmnlint-plugin-processmaker/custom-validation"]=Ab(),Lb["bpmnlint-plugin-processmaker/gateway-direction"]=Tb(),Lb["bpmnlint-plugin-processmaker/event-based-gateway"]=Pb(),Lb["bpmnlint-plugin-processmaker/call-activity-child-process"]=Ob(),Lb["bpmnlint-plugin-processmaker/id-required"]=Nb(),Lb["bpmnlint-plugin-processmaker/signal-ref-required"]=Bb();var Kb,Qb,ey,ty,ny,ry,oy,iy,sy,ay,cy,ly,dy=f(7407),uy=f.n(dy),hy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:uy()}}},py=hy,fy=fr(py,Kb,Qb,!1,null,null,null),my=fy.exports,gy="processmaker-modeler-boundary-error-event",vy=ac()(ho()(Cg),{id:gy,component:my,control:!1,label:"Boundary Error Event",icon:f(43634),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Error Event"),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorConfig:[{items:[{items:[{}]},Va,Na]}]}),by={extends:kg,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){this.shape.attr({image:{"ref-x":4,"ref-y":4,width:18,height:18}})}},yy=by,wy=fr(yy,ey,ty,!1,null,null,null),xy=wy.exports,ky={component:"FormCheckbox",config:{label:"Interrupting",name:"cancelActivity",helper:"Select to interrupt the current Request workflow and route to the alternate workflow, thereby preventing parallel workflow"}},Cy=ky,Sy="processmaker-modeler-boundary-conditional-event",Ey=ac()(ho()(Cg),Qr(Qr({},pp),{},{id:Sy,component:xy,control:!1,label:"Boundary Conditional Event",definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Conditional Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()),[Cy])},Na,Va]}]})),Ay=f.p+"img/boundary-escalation-icon.c999a95e.svg",_y={extends:kg,mounted:function(){this.shape.attr("image/xlink:href",Ay)},methods:{isValidBoundaryEventTarget:function(e){return Di(e.component)}}},Ty=_y,My=fr(Ty,ny,ry,!1,null,null,null),Py=My.exports,Iy="processmaker-modeler-boundary-escalation-event",Oy=ac()(ho()(Cg),{id:Iy,component:Py,control:!1,label:"Boundary Escalation Event",icon:f(62442),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Escalation Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:EscalationEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy]},Va,Na]}]}),Dy=f(81146),Ny=f.n(Dy),Ry={extends:kg,mixins:[tc],data:function(){return{nodeIcon:Ny()}},methods:{isValidBoundaryEventTarget:function(e){var t=e.component;return t&&t.node.isBpmnType("bpmn:CallActivity")}},mounted:function(){var e=mh();this.shape.attr(e)}},By=Ry,Ly=fr(By,oy,iy,!1,null,null,null),jy=Ly.exports,Fy="processmaker-modeler-boundary-message-event",zy=ac()(ho()(Cg),Qr(Qr({},ql),{},{id:Fy,component:jy,control:!1,label:"Boundary Message Event",icon:f(52018),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Message Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:MessageEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy,Fl("Message that will trigger this boundary event")]},Va,Na]}]})),Uy=f(16221),qy=f.n(Uy),Vy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:qy()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.resize(e.get("width"),e.get("height")),this.shape.attr({image:{"ref-x":3,"ref-y":1,width:e.get("width")-15,height:e.get("height")-15}})}},Hy=Vy,Wy=fr(Hy,sy,ay,!1,null,null,null),Gy=Wy.exports,$y="processmaker-modeler-boundary-signal-event",Xy=ac()(ho()(Cg),Qr(Qr({},od),{},{id:$y,component:Gy,control:!1,label:"Boundary Signal Event",icon:f(34070),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Signal Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},Cy,rd("Signal that will trigger this boundary event")]},Va,Na]}]})),Yy=f(50889),Jy=f.n(Yy),Zy={extends:kg,mixins:[tc],data:function(){return{nodeIcon:Jy()}},methods:{addTimerEventDefinitionId:function(){var e="".concat(this.id,"_timer_event_definition");this.node.definition.get("eventDefinitions")[0].id=e}},mounted:function(){this.addTimerEventDefinitionId()}},Ky=Zy,Qy=fr(Ky,cy,ly,!1,null,null,null),ew=Qy.exports,tw="processmaker-modeler-boundary-timer-event",nw=ac()(ho()(Cg),{id:tw,component:ew,control:!1,label:"Boundary Timer Event",icon:f(99400),definition:function(e,t){return e.create("bpmn:BoundaryEvent",{name:t("Boundary Timer Event"),cancelActivity:!0,eventDefinitions:[e.create("bpmn:TimerEventDefinition",{timeDuration:e.create("bpmn:Expression",{body:ah})})]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),r=n[0],o=n[1];if("eventDefinitions"===r){var i=Object.keys(o[0])[1],s=o[0][i].body;e[r]={type:i,body:s}}else e[r]=o;return e}),{})},inspectorHandler:function(e,t,n,r){var o=t.definition;for(var i in e)if(o[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=o.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,r.create("bpmn:Expression",{body:c})),u=[r.create("bpmn:TimerEventDefinition",d)];u[0].id=t.definition.get("eventDefinitions")[0].id,n(t,"eventDefinitions",u)}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{items:[{},Cy]},{component:"FormAccordion",container:!0,config:{label:"Timing Control",icon:"clock",name:"inspector-accordion-boundary-timer-event"},items:[{component:hh,config:{label:"Name",helper:"Time expression",name:"eventDefinitions"}}]},Na,Va]}]});function rw(e,t,n){var r=x(e,t,"set");return A(e,r,n),n}var ow=new WeakMap,iw=function(){function e(t){d(this,e),b(this,ow,{writable:!0,value:void 0}),y(this,"preventTranslate",!1),rw(this,ow,t)}return g(e,[{key:"paper",get:function(){return k(this,ow)}},{key:"scale",get:function(){return k(this,ow).scale()},set:function(e){k(this,ow).scale(e),k(this,ow).trigger("scale:changed")}},{key:"roundToNearestGridMultiple",value:function(t){return Math.round(t/e.gridSize)*e.gridSize}},{key:"ceilToNearestGridMultiple",value:function(t){return Math.ceil(t/e.gridSize)*e.gridSize}},{key:"translate",value:function(e,t){this.preventTranslate||(k(this,ow).translate(e,t),k(this,ow).trigger("translate:changed"))}},{key:"addEventHandler",value:function(e,t,n){k(this,ow).on(e,t,n)}},{key:"addOnceHandler",value:function(e,t){k(this,ow).once(e,t)}},{key:"removeEventHandler",value:function(e,t,n){k(this,ow).off(e,t,n)}},{key:"setPaperDimensions",value:function(e,t){k(this,ow).setDimensions(e,t)}},{key:"performAtomicAction",value:function(){var e=l(a().mark((function e(t){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return k(this,ow).freeze(),e.next=3,t(k(this,ow));case 3:k(this,ow).unfreeze();case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"clientToGridPoint",value:function(e,t){var n=k(this,ow).localToPagePoint(0,0),r=this.scale;return{x:this.roundToNearestGridMultiple((e-n.x)/r.sx),y:this.roundToNearestGridMultiple((t-n.y)/r.sy)}}},{key:"setStateInvalid",value:function(){this.paper.drawBackground({color:ze})}},{key:"setStateValid",value:function(){this.paper.drawBackground({color:Ue})}},{key:"awaitScheduledUpdates",value:function(){var e=this;return k(this,ow)._updates.priorities.some((function(e){return!F.util.isEmpty(e)}))?new Promise((function(t){e.addOnceHandler("render:done",t)})):Promise.resolve()}}],[{key:"factory",value:function(t,n,r){var o=3,i=new F.dia.Paper({async:!0,el:t,model:r,sorting:"sorting-approximate",gridSize:e.gridSize,drawGrid:!0,snapLinks:!1,snapElements:!1,clickThreshold:10,perpendicularLinks:!0,interactive:n,highlighting:{default:{options:{padding:o}}}});return i.translate(168,20),new this(i)}}]),e}();function sw(e,t,n){var r=lw(e,t,n);cw(r,t),e.inspectorConfig[0].items.sort(aw)}function aw(e,t){return dw(e)?1:dw(t)?-1:0}function cw(e,t){var n=e.findIndex((function(e){var n=!t.container&&t.config&&e.config&&t.config.name&&t.config.name===e.config.name;return t.id&&t.id===e.id||n}));-1!==n?e[n]=t:e.push(t)}function lw(e,t,n){return"undefined"!==typeof t.container?e.inspectorConfig[0].items:n?(e=e.inspectorConfig[0],n.split(".").forEach((function(t){e=e&&e.items.find((function(e){return e.config&&e.config.name===t}))})),e?e.items:null):e.inspectorConfig[0].items[0].items}function dw(e){return e.config&&"Advanced"===e.config.label}function uw(e,t){vw(e)&&pw(e);var n=gw(e);n&&pw(n),hw(e)&&!vw(e)&&fw(e),mw(t)}function hw(e){return e.component.node.type!==dl}function pw(e){fw(e);var t=e.component.node.definition.processRef&&e.component.node.definition.processRef.laneSets[0];if(t){var n=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type===dl})),r=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl}));n.forEach(fw),r.forEach(fw)}}function fw(e){e.toFront({deep:!0})}function mw(e){e.getLinks().forEach(fw)}function gw(e){return e.component.node.pool}function vw(e){return e.component.node.type===Jo}y(iw,"gridSize",kp);var bw=function(){var e=this,t=e._self._c;return t("b-row",{staticClass:"w-100 m-0"},[t("div",{staticClass:"toolbar d-flex justify-content-between align-items-center border-top border-bottom",class:{"ignore-pointer":e.canvasDragPosition},attrs:{role:"toolbar","aria-label":"Toolbar"}},[t("breadcrumb",{attrs:{"breadcrumb-data":e.breadcrumbData}}),t("div",{staticClass:"d-flex mr-3"},[t("TopRail",{attrs:{"validation-errors":e.validationErrors,warnings:e.warnings,players:e.players}},e._l(e.validationBar,(function(e,n){return t(e.button,{key:"validation-status-".concat(n),tag:"component"})})),1),t("div",{staticClass:"d-flex align-items-center btn-group btn-group-sm",attrs:{role:"group","aria-label":"Publish controls","data-cy":"publish-control"}},[t("div",{staticClass:"divider"}),e.isVersionsInstalled?[t("div",{staticClass:"toolbar-item toolbar-version-status",attrs:{"data-cy":"publish-version-status"}},[e._v(" "+e._s(e.versionStatus)+" ")]),t("div",{staticClass:"toolbar-item toolbar-loading-status",attrs:{"data-cy":"publish-loading-status"}},[t("span",[e._v(" "+e._s(e.loadingStatus)+" ")]),t("font-awesome-icon",{staticClass:"text-success",attrs:{icon:e.loadingIcon,spin:e.isLoading}})],1),t("a",{staticClass:"toolbar-item toolbar-publish",attrs:{title:e.$t("Publish"),"data-cy":"publish-btn"},on:{click:function(t){return e.$emit("saveBpmn")}}},[e._v(" "+e._s(e.$t("Publish"))+" ")]),t("a",{staticClass:"toolbar-item toolbar-close",attrs:{title:e.$t("Close"),"data-cy":"close-btn"},on:{click:function(t){return e.$emit("close")}}},[e._v(" "+e._s(e.$t("Close"))+" ")]),t("EllipsisMenu",{attrs:{actions:e.combinedMenuActions,divider:!1,"data-cy":"ellipsis-menu"},on:{navigate:e.onNavigate,show:e.onShow,hide:e.onHide}})]:[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"save-button",attrs:{"data-test":"mini-map-btn",title:e.$t("Save")},on:{click:function(t){return e.$emit("saveBpmn")}}},[t("font-awesome-icon",{attrs:{icon:e.saveIcon}}),t("span",{staticClass:"save-button-label"},[e._v(e._s(e.$t("Save")))])],1),t("b-btn",{staticClass:"ml-1 rounded",attrs:{disabled:!e.xmlManager,variant:"secondary",size:"sm","data-test":"downloadXMLBtn"},on:{click:function(t){e.xmlManager&&e.xmlManager.download()}}},[t("i",{staticClass:"fas fa-download mr-1"}),e._v(" "+e._s(e.$t("Download BPMN"))+" ")]),t("b-btn",{directives:[{name:"b-modal",rawName:"v-b-modal",value:"uploadmodal",expression:"'uploadmodal'"}],staticClass:"ml-1 rounded",attrs:{variant:"secondary",size:"sm"}},[t("i",{staticClass:"fas fa-upload mr-1"}),e._v(" "+e._s(e.$t("Upload XML"))+" ")])]],2)],1)],1)])},yw=[],ww=function(){var e=this,t=e._self._c;return t("nav",{attrs:{id:"breadcrumbs"}},[e.breadcrumbData.length>0?t("ol",{staticClass:"breadcrumb"},[e._m(0),e._l(e.breadcrumbData[0],(function(n,r){return t("li",{key:r,staticClass:"breadcrumb-item"},[n.url?t("a",{attrs:{href:n.url}},[e._v(e._s(n.text))]):e._e(),n.url?e._e():t("span",[e._v(e._s(n.text))])])}))],2):e._e()])},xw=[function(){var e=this,t=e._self._c;return t("li",{staticClass:"breadcrumb-item"},[t("a",{attrs:{href:"/"}},[t("i",{staticClass:"fas fa-home"})])])}],kw={name:"breadcrumb",props:{breadcrumbData:{type:Array,default:function(){return[]}}}},Cw=kw,Sw=(f(61573),fr(Cw,ww,xw,!1,null,"d1e148b4",null)),Ew=Sw.exports,Aw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"top-rail-container"},[t("MultiplayerViewUsers",{attrs:{players:e.players}}),t("ValidateIssue",{directives:[{name:"show",rawName:"v-show",value:e.isOpenIssue,expression:"isOpenIssue"}],attrs:{"number-of-errors":e.numberOfErrors},on:{openPanel:e.handleOpenPanel}}),t("ValidateButton",{on:{openIssue:e.handleOpenIssue}}),t("ValidatePanel",{directives:[{name:"show",rawName:"v-show",value:e.isOpenIssue&&e.isOpenPanel,expression:"isOpenIssue && isOpenPanel"}],attrs:{"error-list":e.errorList,warnings:e.warnings}}),e._t("default")],2)},_w=[],Tw=function(){var e=this,t=e._self._c;return t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],class:["validate-button",{"validate-button-active":e.isOpen}],attrs:{type:"button",title:e.$t("Auto validate"),"data-cy":"validate-button"},on:{click:function(t){return t.preventDefault(),e.handleOpen.apply(null,arguments)}}},[t("inline-svg",{attrs:{src:e.isOpen?e.validateOpenIcon:e.validateCloseIcon}})],1)},Mw=[],Pw={components:{InlineSvg:sv},data:function(){return{isOpen:!1,validateCloseIcon:f(13828),validateOpenIcon:f(78540)}},methods:{handleOpen:function(){this.isOpen=!this.isOpen,this.$emit("openIssue",this.isOpen)}},mounted:function(){var e=this;window.ProcessMaker.EventBus.$on("save-changes-activate-autovalidate",(function(){e.handleOpen()}))}},Iw=Pw,Ow=(f(70947),fr(Iw,Tw,Mw,!1,null,"5880bbc6",null)),Dw=Ow.exports,Nw=function(){var e=this,t=e._self._c;return t("button",{staticClass:"issue-box",attrs:{type:"button",disabled:0===e.numberOfErrors,"data-cy":"validate-issue-button"},on:{click:function(t){return t.preventDefault(),e.handleOpen.apply(null,arguments)}}},[t("span",{staticClass:"issue-title"},[e._v("Issues")]),t("span",{staticClass:"issue-badge"},[e._v(e._s(e.numberOfErrors))]),t("span",{staticClass:"issue-icon"},[t("inline-svg",{attrs:{src:e.isOpen?e.issueOpenIcon:e.issueCloseIcon}})],1)])},Rw=[],Bw={components:{InlineSvg:sv},props:{numberOfErrors:{type:Number,required:!0}},data:function(){return{isOpen:!1,issueCloseIcon:f(61339),issueOpenIcon:f(68058)}},watch:{numberOfErrors:function(e){0===e&&(this.isOpen=!1)}},methods:{handleOpen:function(){this.isOpen=!this.isOpen,this.$emit("openPanel",this.isOpen)}}},Lw=Bw,jw=(f(59724),fr(Lw,Nw,Rw,!1,null,"337583fe",null)),Fw=jw.exports,zw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"validate-container",attrs:{"data-cy":"validate-panel"}},[e._l(e.errorList,(function(n,r){return t("div",{key:"".concat(n.errorId,"_").concat(r),staticClass:"validate-item-box"},[t("vue-inline-svg",{attrs:{src:e.issueIcon}}),t("div",{staticClass:"validate-item-info"},[t("div",{staticClass:"validate-item-title"},[e._v(e._s(n.errorKey))]),t("div",{staticClass:"validate-item-description"},[e._v(e._s(n.message)+".")]),n.id?t("div",{staticClass:"validate-item-node"},[t("span",{staticClass:"validate-item-node-title"},[e._v(e._s(e.$t("Node ID"))+":")]),e._v(" "+e._s(n.id)+" ")]):e._e()])],1)})),e._l(e.warnings,(function(n,r){return t("div",{key:n.title+r,staticClass:"validate-item-box"},[t("vue-inline-svg",{attrs:{src:e.issueIcon}}),t("div",{staticClass:"validate-item-info"},[t("div",{staticClass:"validate-item-title"},[e._v(e._s(n.title))]),t("div",{staticClass:"validate-item-description"},[e._v(e._s(n.text)+".")])])],1)}))],2)},Uw=[],qw={components:{VueInlineSvg:sv},props:{errorList:{type:Array,required:!0},warnings:{type:Array,required:!0}},data:function(){return{issueIcon:f(4298)}}},Vw=qw,Hw=(f(95254),fr(Vw,zw,Uw,!1,null,"0722e36d",null)),Ww=Hw.exports,Gw=function(){var e=this,t=e._self._c;return e.isMultiplayer?e._e():t("b-avatar-group",{staticClass:"container"},[e._l(e.filteredPlayers,(function(e){return[t("Avatar",{key:e.key,attrs:{badgeBackgroundColor:e.color,imgSrc:e.avatar,userName:e.name}})]}))],2)},$w=[],Xw=function(){var e=this,t=e._self._c;return t("span",{staticClass:"b-avatar rounded-circle",style:{backgroundColor:e.generateColorHsl(e.userName,e.saturationRange,e.lightnessRange)}},[e.imgSrc?t("span",{staticClass:"b-avatar-img"},[t("img",{attrs:{src:e.imgSrc,alt:e.userName}})]):t("span",{staticClass:"b-avatar-text avatar-initials"},[t("span",[e._v(" "+e._s(this.getInitials(e.userName))+" ")])]),t("span",{staticClass:"b-avatar-badge badge-danger",style:{bottom:"0px",right:"0px",backgroundColor:e.badgeBackgroundColor}})])},Yw=[],Jw={props:{badgeBackgroundColor:{type:String,required:!1},imgSrc:{type:String,required:!1},userName:{type:String,required:!1}},data:function(){return{saturation:50,lightness:50,range:10}},computed:{saturationRange:function(){return this.getRange(this.saturation,this.range)},lightnessRange:function(){return this.getRange(this.lightness,this.range)}},methods:{getInitials:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(" "),n=t[0].charAt(0).toUpperCase(),r=t[t.length-1].charAt(0).toUpperCase();return"".concat(n).concat(r)},getHashOfString:function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return t=Math.abs(t),t},getRange:function(e,t){return[Math.max(0,e-t),Math.min(e+t,100)]},normalizeHash:function(e,t,n){return Math.floor(e%(n-t)+t)},generateHSL:function(e,t,n){var r=this.getHashOfString(e),o=this.normalizeHash(r,0,360),i=this.normalizeHash(r,t[0],t[1]),s=this.normalizeHash(r,n[0],n[1]);return[o,i,s]},HSLtoString:function(e){return"hsl(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%)")},generateColorHsl:function(e,t,n){return this.HSLtoString(this.generateHSL(e,t,n))}}},Zw=Jw,Kw=(f(4913),fr(Zw,Xw,Yw,!1,null,"1c50a604",null)),Qw=Kw.exports,ex={components:{Avatar:Qw},props:{players:{type:Array,required:!0}},computed:{filteredPlayers:function(){var e=(0,Er.uniqBy)(this.players,"name");return e.filter((function(e){var t;return e.name.toLowerCase()!==(null===(t=window.ProcessMaker.user)||void 0===t?void 0:t.fullName.toLowerCase())}))},isMultiplayer:function(){return Un.getters.isMultiplayer}}},tx=ex,nx=fr(tx,Gw,$w,!1,null,null,null),rx=nx.exports,ox={components:{ValidateButton:Dw,ValidateIssue:Fw,ValidatePanel:Ww,MultiplayerViewUsers:rx},props:{validationErrors:{type:Object,required:!0},warnings:{type:Array,required:!0},players:{type:Array,required:!1}},data:function(){return{isOpenIssue:!1,isOpenPanel:!1}},computed:{errorList:function(){return Object.entries(this.validationErrors).flatMap((function(e){var t=jt(e,2),n=t[0],r=t[1];return r.flatMap((function(e){return Qr(Qr({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))},numberOfErrors:function(){return this.errorList.length+this.warnings.length}},watch:{numberOfErrors:function(e){0===e&&(this.isOpenPanel=!1)}},methods:{handleOpenIssue:function(e){this.isOpenIssue=e,Un.commit("setAutoValidate",this.isOpenIssue)},handleOpenPanel:function(e){this.isOpenPanel=e}}},ix=ox,sx=(f(53713),fr(ix,Aw,_w,!1,null,"f6aad76c",null)),ax=sx.exports,cx={name:"tool-bar",components:{Breadcrumb:Ew,TopRail:ax,FontAwesomeIcon:To.FontAwesomeIcon},props:["canvasDragPosition","cursor","paperManager","isRendering","breadcrumbData","panelsCompressed","validationErrors","warnings","xmlManager","validationBar","players","extraActions"],watch:{miniMapOpen:function(e){this.$emit("toggle-mini-map-open",e)},canUndo:function(e){e||this.$root.$emit("bv::hide::tooltip")},canRedo:function(e){e||this.$root.$emit("bv::hide::tooltip")}},computed:{combinedMenuActions:function(){return this.extraActions?this.ellipsisMenuActions.concat(this.extraActions):this.ellipsisMenuActions},canUndo:function(){return Qv.getters.canUndo},canRedo:function(){return Qv.getters.canRedo},versionStatus:function(){var e=Qv.getters.isDraft?"Draft":"Published";return this.$t(e)},isVersionsInstalled:function(){return Qv.getters.isVersionsInstalled},isLoading:function(){return Qv.getters.isLoading},loadingStatus:function(){var e=this.isLoading?"Saving":"Saved";return this.$t(e)},loadingIcon:function(){return this.isLoading?this.spinner:this.savedIcon}},data:function(){return{plusIcon:is.faPlus,minusIcon:is.faMinus,scale:1,initialScale:1,minimumScale:.2,scaleStep:.1,mapIcon:is.faMapMarked,miniMapOpen:!1,compressIcon:is.faCompress,expandIcon:is.faExpand,undoIcon:is.faUndo,redoIcon:is.faRedo,saveIcon:is.faSave,savedIcon:is.faCheckCircle,spinner:is.faSpinner,ellipsisMenuActions:[{value:"save-template",content:this.$t("Save as Template"),icon:""},{value:"save-pm-block",content:this.$t("Save as PM Block"),icon:""},{value:"discard-draft",content:this.$t("Discard Draft"),icon:""}]}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("redo").then((function(){return e.$emit("load-xml")}))},onNavigate:function(e){switch(e.value){case"discard-draft":window.ProcessMaker.EventBus.$emit("open-versions-discard-modal");break;case"save-template":this.$emit("publishTemplate");break;case"save-pm-block":this.$emit("publishPmBlock");break;default:this.$emit("action",e)}},onShow:function(){var e=document.getElementById("inspector");e&&(e.style.zIndex="1")},onHide:function(){var e=document.getElementById("inspector");e&&(e.style.zIndex="2")}},mounted:function(){var e,t=null===(e=this.$root.$children[0])||void 0===e?void 0:e.process,n=this.ellipsisMenuActions.findIndex((function(e){return"save-template"===e.value}));null!==t&&void 0!==t&&t.is_template&&this.ellipsisMenuActions.splice(n,1),"PM_BLOCK"===(null===t||void 0===t?void 0:t.asset_type)&&this.ellipsisMenuActions.splice(n,2)}},lx=cx,dx=(f(91503),fr(lx,bw,yw,!1,null,null,null)),ux=dx.exports;function hx(e,t){var n=function(e){return e.isBpmnType("bpmn:MessageFlow",Tr,Or)||e.isType("processmaker-modeler-pool")};if(!n(e))if(e.isType("processmaker-modeler-lane"))t.get("laneSets")[0].get("lanes").push(e.definition);else{var r="flowElements";(e.isBpmnType("bpmn:TextAnnotation")||e.isBpmnType("bpmn:Association"))&&(r="artifacts"),t.get(r).push(e.definition)}}var px={methods:{zoomInOutHandler:function(e,t){var n="+"===e.key||"NumpadAdd"===e.key||107===e.keyCode||187===e.keyCode,r="-"===e.key||"NumpadSubtract"===e.key||109===e.keyCode||189===e.keyCode;n&&t.mod&&this.zoomIn(e),r&&t.mod&&this.zoomOut(e)},zoomIn:function(e){e.preventDefault(),this.canvasScale=this.paperManager.scale.sx+this.scaleStep},zoomOut:function(e){e.preventDefault(),this.canvasScale=Math.max(this.minimumScale,this.paperManager.scale.sx-=this.scaleStep)}}},fx={methods:{copyPasteHandler:function(e,t){var n=e.target.nodeName.toLowerCase(),r="body"===n,o=e.key.toLowerCase(),i="c"===o,s="v"===o;r&&i&&t.mod&&this.copy(e),r&&s&&t.mod&&this.paste(e)},copy:function(e){e.preventDefault(),window.ProcessMaker.$modeler.copyElement()},paste:function(e){e.preventDefault(),window.ProcessMaker.$modeler.pasteElements()}}},mx=(f(51532),iw.gridSize/2),gx=new Map;gx.set("Up",[0,-mx]),gx.set("Down",[0,mx]),gx.set("Left",[-mx,0]),gx.set("Right",[mx,0]);var vx=["PoolLane","processmaker.components.nodes.boundaryEvent.Shape"];function bx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(yx(e)){var r=t.filter(wx);if(0!==r.length){var o=xx(e),i=jt(o,2),s=i[0],a=i[1];r.forEach((function(e){e.translate(s,a,{movedWithArrowKeys:!0}),Cx(e)})),n()}}}function yx(e){var t=["up","down","left","right"];return t.some((function(t){return e.toLowerCase().includes(t)}))}function wx(e){return e&&!vx.includes(e.get("type"))}function xx(e){var t=e.match(/^(?:Arrow)?(Up|Down|Left|Right)$/);return null!==t?gx.get(t[1]):[0,0]}function kx(e){return!e||"processmaker.modeler.bpmn.pool"!==e.get("type")}function Cx(e){var t=e.getParentCell();kx(t)||(t.component.expandToFitElement(e,t),t.component.laneSet&&t.component.updateLaneChildren())}var Sx={methods:{escapeKeyHandler:function(e){this.selectedNode&&(e.preventDefault(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e))}},computed:{selectedNode:function(){return Mg.getters.getSelectedNode},movedElement:function(){return Mg.getters.getGhostNode}}},Ex={mixins:[px,fx,Sx],computed:{clientLeftPaper:function(){return Un.getters.clientLeftPaper}},mounted:function(){document.addEventListener("keydown",this.keydownListener),document.addEventListener("keyup",this.keyupListener)},methods:{handleHotkeys:function(e,t){this.zoomInOutHandler(e,t),this.copyPasteHandler(e,t),this.escapeKeyHandler(e)},keyupListener:function(e){"Space"===e.code&&(this.isGrabbing=!1,this.paperManager.removeEventHandler("blank:pointermove"))},keydownListener:function(e){var t=this,n=this.isAppleOS(),r=n?e.metaKey:e.ctrlKey,o={mod:r,isAppleOS:n,modeler:this};try{this.handleHotkeys(e,o)}catch(s){console.error(s)}var i=!e.target.toString().toLowerCase().includes("body");i||("Space"===e.code&&(this.isGrabbing=!0,this.paperManager.addEventHandler("blank:pointermove",(function(e,n,r){if(!t.canvasDragPosition){var o=t.paperManager.scale;t.canvasDragPosition={x:n*o.sx,y:r*o.sy}}t.canvasDragPosition&&!t.clientLeftPaper&&t.paperManager.translate(e.offsetX-t.canvasDragPosition.x,e.offsetY-t.canvasDragPosition.y)}))),bx(e.key,Un.getters.highlightedShapes,this.pushToUndoStack))}}};f(74819);function Ax(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Wo(e),null===e)break;return e}function _x(){return _x="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Ax(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},_x.apply(this,arguments)}var Tx,Mx=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"clone",value:function(e,t,r){return this.withTimerKeys(_x(Wo(n.prototype),"clone",this).call(this,e,t,r))}},{key:"withTimerKeys",value:function(e){var t=this,r=n.timerPropertyKeys.find((function(e){return t.definition.eventDefinitions[0][e]}));return e.definition.eventDefinitions[0][r]||(e.definition.eventDefinitions[0][r]={}),e.definition.eventDefinitions[0][r].body=this.definition.eventDefinitions[0][r].body,e}}]),n}(po);function Px(e){return Ix.apply(this,arguments)}function Ix(){return Ix=l(a().mark((function e(t){var n,r,o;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=Ox(t),r=document.querySelector('[name="name"]')||document.querySelector('[name="text"]'),n&&r&&document.activeElement!==r){e.next=4;break}return e.abrupt("return");case 4:if(o=document.getElementById("accordion-button-Configuration"),!o||"false"!==o.getAttribute("aria-expanded")){e.next=10;break}return clearTimeout(Tx),o.click(),e.next=10,Dx();case 10:n.style.outline="1px dashed blue",r.addEventListener("blur",(function(){n.style.outline=""})),r.focus(),r.select();case 14:case"end":return e.stop()}}),e)}))),Ix.apply(this,arguments)}function Ox(e){if(e.selectors)return e.selectors.label||Array.from(e.selectors.root.children).find((function(e){return e.classList.contains("labels")}))}function Dx(){return new Promise((function(e){Tx=setTimeout(e)}))}y(Mx,"timerPropertyKeys",["timeDuration","timeDate","timeCycle"]);var Nx=f(93162),Rx=f.n(Nx),Bx=new WeakMap,Lx=new WeakMap,jx=function(){function e(t){d(this,e),b(this,Bx,{writable:!0,value:void 0}),b(this,Lx,{writable:!0,value:void 0}),rw(this,Bx,t)}return g(e,[{key:"definitions",set:function(e){rw(this,Lx,e)}},{key:"getDefinitionsFromXml",value:function(e){var t=this;return new Promise((function(n,r){k(t,Bx).fromXML(e,(function(e,o){e&&r(e),o.exporter="ProcessMaker Modeler",o.exporterVersion="1.0",t.cleanBrokenReferences(o),n(o)}))}))}},{key:"cleanBrokenReferences",value:function(e){var t=e.rootElements,n=e.diagrams,r=[];t.forEach((function(t){"bpmn:Process"===t.$type&&t.flowElements&&(t.flowElements=t.flowElements.filter((function(e){return"bpmn:SequenceFlow"!==e.$type||(e.sourceRef&&e.targetRef||r.push(e),e.sourceRef&&e.targetRef)}))),"bpmn:Process"===t.$type&&t.laneSets&&t.laneSets.forEach((function(t){t.lanes=t.lanes.filter((function(t){if(!e.diagrams)return!1;var n=e.diagrams.find((function(e){return e.plane.planeElement.find((function(e){return e&&e.bpmnElement.id===t.id}))}));return n}))}))})),n.forEach((function(e){"bpmndi:BPMNDiagram"===e.$type&&e.plane&&e.plane.planeElement&&(e.plane.planeElement=e.plane.planeElement.filter((function(e){return"bpmndi:BPMNEdge"!==e.$type||e.bpmnElement&&!r.includes(e.bpmnElement)})))}))}},{key:"download",value:function(){k(this,Lx)&&k(this,Bx).toXML(k(this,Lx),{format:!0},(function(e,t){if(e)alert(e);else{if(Ss())return void(window.xml=t);var n=new File([t],"bpmnProcess.xml",{type:"text/xml"});Rx().saveAs(n)}}))}}]),e}();function Fx(e){return e.isStartEvent()?to:e.isTask()?io:e.isGateway()?ao:e.isIntermediateEvent()?lo:e.isEndEvent()?ro:null}function zx(e){if(!e)return!1;var t=Fx(e);return!t||!Object.values(t).includes(e.definition.name)}function Ux(e,t){return t.reduce((function(e,t){return e.concat(t.get("artifacts"))}),[]).filter((function(e){return"bpmn:Association"===e.$type})).filter((function(t){return t.targetRef===e.definition}))}function qx(e,t){var n=Object.values(e).flatMap((function(e){return e.map((function(e){return t.find((function(t){return t.id===e.id}))}))})),r=t.filter((function(e){return!e.id}));return[].concat(W(n),W(r))}var Vx=function(){function e(t,n,r,o,i,s){d(this,e),this._nodeThatWillBeReplaced=t,this._definition=n,this._graph=r,this._newNode=o,this._processes=i,this._collaboration=s}return g(e,[{key:"migrate",value:function(){var e,t,n=this;zx(this._nodeThatWillBeReplaced)&&(this._definition.name=this._nodeThatWillBeReplaced.definition.name);var r=[],o=function(e){var t=n._graph.getLinks().find((function(t){return t.component&&t.component.node.definition===e}));t.component.node._modelerId+="_replaced",r.push({id:t.component.node.definition.id,type:t.component.node.type,name:t.component.node.definition.name,sourceRefId:t.component.node.definition.sourceRef.id,targetRefId:t.component.node.definition.targetRef.id})},i=this._nodeThatWillBeReplaced.definition.get("incoming"),s=this._nodeThatWillBeReplaced.definition.get("outgoing");(e=this._definition.get("incoming")).push.apply(e,W(i)),(t=this._definition.get("outgoing")).push.apply(t,W(s)),s.forEach((function(e){e.set("sourceRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),o(e)})),i.forEach((function(e){e.set("targetRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),o(e)}));var a=Ux(this._nodeThatWillBeReplaced,this._processes);if(a.forEach((function(e){e.set("targetRef",n._newNode.definition),o(e)})),this._collaboration){var c=this._collaboration.get("messageFlows");c.filter((function(e){return e.sourceRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("sourceRef",n._newNode.definition),o(e)})),c.filter((function(e){return e.targetRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("targetRef",n._newNode.definition),o(e)}))}window.ProcessMaker.EventBus.$emit("multiplayer-updateFlows",r)}},{key:"_handleSequenceFlowForGateway",value:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type);t||delete e.conditionExpression}}]),e}(),Hx=["bpmn:ServiceTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ScriptTask"],Wx=function(e){if(-1!==Hx.indexOf(e.bpmnType)&&"package-ai/processmaker-ai-assistant"!==e.implementation){e.inspectorConfig[0].items.splice(e.loopInspectorIndex||1,0,df);var t=e.inspectorHandler||function(){},n=e.inspectorData||null;e.inspectorHandler=function(e,n,r,o,i,s){t(e,n,r,o,i,s),e=cf(e,n,r,o,i),s(e)},e.inspectorData=function(e,t,r){var o=n?n(e,t,r):t(e);return lf(o,e,t,r),o}}},Gx={methods:{cloneNodesSelection:function(){var e=this,t=[],n=[],r=[],o=[],i=[],s=this.highlightedNodes,a=this.$refs.selector.$el,c=[gl,dl,er,El,fo],l=[Ir],d=[_r];return"function"===typeof a.getBoundingClientRect&&s.forEach((function(s){if(c.includes(s.type)){var a=e.cloneFlowAndSetNewId(s);n.push(a),t.push(a)}else if(l.includes(s.type)){var u=e.cloneFlowAndSetNewId(s);o.push(u),t.push(u)}else if(d.includes(s.type)){var h=e.cloneFlowAndSetNewId(s);i.push(h),t.push(h)}else{var p=e.cloneElementAndCalculateOffset(s);s.definition&&"bpmn:BoundaryEvent"!==s.definition.$type?t.push(p):r.push(p)}})),t=[].concat(W(t),r),this.connectClonedFlows(n,t),this.connectClonedDataInputAssociations(o,t),this.connectClonedDataOutputAssociations(i,t),t},getDataInputOutputAssociationTargetRef:function(e){if("bpmn:DataInput"===e.targetRef.$type){var t=e.targetRef.$parent;return Vr(t,this)}if("bpmn:DataInputAssociation"===e.targetRef.$type){var n=e.targetRef.$parent;return Vr(n,this)}return e.targetRef},cloneFlowAndSetNewId:function(e){var t=e.cloneFlow(this.nodeRegistry,this.moddle,this.$t);return t.setIds(this.nodeIdGenerator),t},cloneElementAndCalculateOffset:function(e){var t=e.clone(this.nodeRegistry,this.moddle,this.$t),n=this.$refs.selector.$el.getBoundingClientRect(),r=n.height,o=this.paper.scale(),i=o.sy,s=r/i;return t.diagram.bounds.y+=s,t.setIds(this.nodeIdGenerator),t},connectClonedFlows:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef,i=r.definition.targetRef,s=t.find((function(e){return e.cloneOf===o.id})),a=t.find((function(e){return e.cloneOf===i.id}));if(s&&a){e.definition.set("sourceRef",s.definition),e.definition.set("targetRef",a.definition),s.definition.outgoing?s.definition.outgoing.push(e.definition):s.definition.set("outgoing",[e.definition]),a.definition.incoming?a.definition.incoming.push(e.definition):a.definition.set("incoming",[e.definition]);var c=n.$refs.selector.$el.getBoundingClientRect(),l=c.height,d=n.paper.scale(),u=d.sy,h=l/u;e.diagram.waypoint.forEach((function(e){e.y+=h}))}else t.splice(t.indexOf(e),1)}))},connectClonedDataInputAssociations:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef[0],i=t.find((function(e){return e.cloneOf===o.id})),s=n.getDataInputOutputAssociationTargetRef(r.definition),a=t.find((function(e){return e.cloneOf===s.id})),c=qr(n.moddle,a,i.definition);e.definition.set("sourceRef",[i.definition]),e.definition.set("targetRef",c),a.definition.set("dataInputAssociations",[e.definition])}))},connectClonedDataOutputAssociations:function(e,t){var n=this;e.forEach((function(e){var r=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),o=r.definition.sourceRef||r.definition.$parent,i=r.definition.targetRef,s=t.find((function(e){return e.cloneOf===o.id})),a=t.find((function(e){return e.cloneOf===i.id}));e.definition.set("targetRef",a.definition),e.definition.set("sourceRef",s.definition);var c=s.definition.get("dataOutputAssociations")||[];s.definition.set("dataOutputAssociations",[].concat(W(c),[e.definition]))}))}}},$x=function(){var e=this,t=e._self._c;return t("div",{staticClass:"rail-container",attrs:{"data-cy":"rail-bottom"}},[t("div",{ref:"railLeftBox",staticClass:"rail-left",style:[e.overlap?{position:"relative"}:{position:"absolute"}]},[t("MiniPaperControl",{class:{"hidden-opacity":!1===e.showComponent},attrs:{"paper-manager":e.paperManager,graph:e.graph}}),t("ZoomControl",{ref:"zoomBox",attrs:{"paper-manager":e.paperManager}})],1),t("div",{staticClass:"rail-center",style:[e.overlap?{width:"auto"}:{width:"100%"}]},[e.isMultiplayer?e._e():t("UndoRedoControl",{directives:[{name:"show",rawName:"v-show",value:e.showComponent,expression:"showComponent"}],ref:"undoRedoBox",attrs:{"is-rendering":e.isRendering},on:{"load-xml":function(t){return e.$emit("load-xml")},clearSelection:function(t){return e.$emit("clearSelection")}}}),t("Controls",{directives:[{name:"show",rawName:"v-show",value:e.showComponent,expression:"showComponent"}],ref:"controlBox",attrs:{nodeTypes:e.nodeTypes},on:{onCreateElement:e.onCreateElementHandler,onSetCursor:e.onSetCursorHandler}})],1)])},Xx=[],Yx=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mini-paper-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mini-paper-button",class:e.miniMapOpen?"mini-paper-button-active":"",attrs:{type:"button","data-cy":"mini-paper-button",title:e.miniMapOpen?e.$t("Hide Mini-Map"):e.$t("Show Mini-Map")},on:{click:function(t){e.miniMapOpen=!e.miniMapOpen}}},[t("inline-svg",{attrs:{src:e.miniMapIcon}})],1),t("mini-paper",{attrs:{isOpen:e.miniMapOpen,paperManager:e.paperManager,graph:e.graph}})],1)},Jx=[],Zx=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mini-paper-container",class:e.isOpen?"opened":"closed",attrs:{"data-cy":"mini-map-box"},on:{click:e.movePaper}},[t("div",{ref:"miniPaper",staticClass:"mini-paper"})])},Kx=[],Qx=new WeakMap,ek=function(){function e(t){d(this,e),b(this,Qx,{writable:!0,value:void 0}),rw(this,Qx,t)}return g(e,[{key:"miniMap",get:function(){return k(this,Qx)}},{key:"scaleMiniMap",value:function(){this.miniMap.scaleContentToFit({padding:10,maxScaleX:.5,maxScaleY:.5})}},{key:"calculateNewPaperPosition",value:function(e,t,n,r,o,i){var s=this.miniMap.paperToLocalPoint(e,t),a=s.x,c=s.y;return{newX:o/2-a*n,newY:i/2-c*r}}}],[{key:"factory",value:function(e,t){var n=new F.dia.Paper({el:t,model:e,width:230,height:200,interactive:!1});return new this(n)}}]),e}(),tk={data:function(){return{miniMapManager:null,newX:0,newY:0}},props:{isOpen:{type:Boolean},paperManager:{type:Object},graph:{type:Object}},watch:{isOpen:function(e){e&&this.miniMapManager.scaleMiniMap()}},computed:{miniMap:function(){return this.miniMapManager.miniMap}},methods:{movePaper:function(e){var t=e.offsetX,n=e.offsetY,r=this.paperManager.scale,o=r.sx,i=r.sy,s=this.paperManager.paper.el,a=s.clientWidth,c=s.clientHeight,l=this.miniMapManager.calculateNewPaperPosition(t,n,o,i,a,c),d=l.newX,u=l.newY;this.newX=d,this.newY=u,this.paperManager.translate(this.newX,this.newY)}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return window.Cypress&&(window.MiniPaper=e),t.next=3,e.$nextTick();case 3:e.miniMapManager=ek.factory(e.graph,e.$refs.miniPaper),e.paperManager.addEventHandler("render:done",e.miniMapManager.scaleMiniMap,e),window.ProcessMaker.EventBus.$on("modeler-change",(function(){return e.miniMapManager.scaleMiniMap()}));case 6:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){this.paperManager.removeEventHandler("render:done",this.miniMapManager.scaleMiniMap,this)}},nk=tk,rk=(f(63564),fr(nk,Zx,Kx,!1,null,"76e95759",null)),ok=rk.exports,ik={components:{InlineSvg:sv,MiniPaper:ok},props:{paperManager:Object,graph:Object},data:function(){return{miniMapOpen:!1,miniMapIcon:f(65759)}}},sk=ik,ak=(f(71776),fr(sk,Yx,Jx,!1,null,"7f06057f",null)),ck=ak.exports,lk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"zoom-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button",attrs:{type:"button","data-cy":"zoom-out-control",title:e.$t("Zoom Out")},on:{click:e.onClickZoomOut}},[t("inline-svg",{attrs:{src:e.minusIcon}})],1),e.paperManager?t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button zoom-reset",attrs:{"data-cy":"zoom-reset-control",title:e.$t("Reset to initial scale")},on:{click:e.onClickReset}},[e._v(e._s(e.percentageText))]):e._e(),t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"zoom-button",attrs:{type:"button","data-cy":"zoom-in-control",title:e.$t("Zoom In")},on:{click:e.onClickZoomIn}},[t("inline-svg",{attrs:{src:e.plusIcon}})],1)])},dk=[],uk={components:{InlineSvg:sv},props:{paperManager:Object},data:function(){return{initialScale:1,minimumScale:.2,scaleStep:.1,minusIcon:f(22044),plusIcon:f(29943)}},computed:{percentageText:function(){return"".concat(Math.round(100*this.$props.paperManager.scale.sx),"%")}},methods:{onClickZoomOut:function(){this.paperManager.scale=Math.max(this.minimumScale,this.paperManager.scale.sx-=this.scaleStep)},onClickZoomIn:function(){this.paperManager.scale=this.paperManager.scale.sx+this.scaleStep},onClickReset:function(){this.paperManager.scale=this.initialScale}}},hk=uk,pk=(f(5365),fr(hk,lk,dk,!1,null,"576edbd4",null)),fk=pk.exports,mk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ur-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"ur-button",attrs:{type:"button","data-cy":"undo-control",disabled:!e.canUndo,title:e.$t("Undo")},on:{click:e.undo}},[t("inline-svg",{attrs:{src:e.undoIcon}})],1),t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"ur-button",attrs:{type:"button","data-cy":"redo-control",disabled:!e.canRedo,title:e.$t("Redo")},on:{click:e.redo}},[t("inline-svg",{attrs:{src:e.redoIcon}})],1)])},gk=[],vk={components:{InlineSvg:sv},props:{isRendering:{type:Boolean}},data:function(){return{undoIcon:f(28994),redoIcon:f(45617)}},watch:{canUndo:function(e){e||this.$root.$emit("bv::hide::tooltip")},canRedo:function(e){e||this.$root.$emit("bv::hide::tooltip")}},computed:{canUndo:function(){return Qv.getters.canUndo},canRedo:function(){return Qv.getters.canRedo}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Qv.dispatch("redo").then((function(){return e.$emit("load-xml")}))}}},bk=vk,yk=(f(81935),fr(bk,mk,gk,!1,null,"379ae012",null)),wk=yk.exports,xk=function(){var e=this,t=e._self._c;return e.controls?t("ul",{staticClass:"control-list"},[e._l(e.controls,(function(n){return t("li",{key:n.id,class:["control-item",{active:e.selectedItem&&e.selectedItem.type===n.type}],attrs:{id:n.id,"data-test":"".concat(n.type,"-main")},on:{click:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n)}}},[t("SubmenuPopper",{attrs:{data:n,selectedItem:e.selectedSubmenuItem,popperType:e.popperType},on:{clickToSubmenu:e.clickToSubmenuHandler}})],1)})),t("li",{staticClass:"control-item"},[t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],class:{"control-add":!0,"control-active":e.explorerOpen},attrs:{title:e.$t("Add")},on:{click:e.toggleExplorer}},[t("inline-svg",{attrs:{src:e.plusIcon}})],1)])],2):e._e()},kk=[],Ck=function(){var e=this,t=e._self._c;return e.data.items?t("popper",{attrs:{trigger:"clickToOpen",options:{placement:"top",modifiers:{offset:{offset:"0,5px"},preventOverflow:{escapeWithReference:!0}}},"append-to-body":!0,"visible-arrow":!1,"force-show":e.popperType===e.data.type}},[t("div",[t("ul",{staticClass:"control-submenu"},e._l(e.data.items,(function(n,r){return t("li",{key:r,class:["control-submenu-list",{active:e.selectedItem===n.type}],attrs:{"data-test":n.type},on:{click:function(t){return e.onClickHandler(t,n)}}},[e.containsSvg(n.icon)?t("inline-svg",{attrs:{src:n.icon,alt:n.label}}):t("i",{staticClass:"fa-lg",class:n.icon}),t("div",{staticClass:"control-submenu-list-label"},[e._v(" "+e._s(n.label)+" ")])],1)})),0)]),t("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"control-submenu-item",attrs:{slot:"reference",alt:e.data.label,title:e.$t(e.data.label)},slot:"reference"},[t("div",{staticClass:"control-submenu-options"},[t("span")]),e.containsSvg(e.data.icon)?e._e():t("i",{staticClass:"fa-lg",class:e.data.icon}),t("inline-svg",{attrs:{src:e.data.icon}})],1)]):t("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport.d50",value:{customClass:"no-pointer-events"},expression:"{ customClass: 'no-pointer-events' }",modifiers:{hover:!0,viewport:!0,d50:!0}}],staticClass:"control-submenu-item",attrs:{alt:e.data.label,title:e.$t(e.data.label)}},[e.containsSvg(e.data.icon)?e._e():t("i",{staticClass:"fa-lg",class:e.data.icon}),t("inline-svg",{attrs:{src:e.data.icon}})],1)},Sk=[],Ek=f(95951),Ak=f.n(Ek),_k=(f(44301),{mixins:[zg],props:{data:{type:Object},selectedItem:{type:String},popperType:{type:String}},components:{Popper:Ak(),InlineSvg:sv},data:function(){return{wasClickedSubmenu:!1,element:null,wasClicked:!1}},methods:{onClickHandler:function(e,t){e.stopPropagation(),this.$emit("clickToSubmenu",{event:e,control:t})}}}),Tk=_k,Mk=(f(56668),fr(Tk,Ck,Sk,!1,null,"36ac61a1",null)),Pk=Mk.exports,Ik={components:{SubmenuPopper:Pk,InlineSvg:sv},props:{nodeTypes:Array},mixins:[Ug],data:function(){return{plusIcon:f(29943),currentType:null}},created:function(){Mg.dispatch("getUserPinnedObjects")},computed:{controls:function(){return Mg.getters.getPinnedNodeTypes},explorerOpen:function(){return Mg.getters.getExplorerOpen}},methods:{clickToSubmenuHandler:function(e){window.ProcessMaker.EventBus.$off("custom-pointerclick"),this.wasClicked=!1,this.parent=this.selectedItem,this.selectedSubmenuItem=e.control.type,this.onClickHandler(e.event,e.control)},onClickControlHandler:function(e,t){this.selectedSubmenuItem=null,this.popperType=this.currentType===t.type?null:t.type,this.onClickHandler(e,t),this.currentType=this.popperType},toggleExplorer:function(){this.deselect(),this.popperType=null,this.selectedSubmenuItem=null,Mg.commit("toggleExplorer"),Mg.commit("clearFilteredNodes"),Mg.commit("clearFilteredPmBlockNodes")}}},Ok=Ik,Dk=(f(33422),fr(Ok,xk,kk,!1,null,"0e6b16b8",null)),Nk=Dk.exports,Rk={components:{MiniPaperControl:ck,ZoomControl:fk,UndoRedoControl:wk,Controls:Nk},props:{paperManager:Object,graph:Object,isRendering:Boolean,nodeTypes:Array},data:function(){return{overlap:!1,widthOverlapControl:0,leftOverlapUndoRedo:0,controlObserver:null}},created:function(){this.controlObserver=new ResizeObserver(this.onControlObserver)},methods:{onCreateElementHandler:function(e){this.$emit("onCreateElement",e)},onSetCursorHandler:function(e){this.$emit("set-cursor",e)},onControlObserver:function(e){var t=e[0].target.getBoundingClientRect(),n=this.$refs.zoomBox.$el.getBoundingClientRect(),r=this.$refs.undoRedoBox.$el.getBoundingClientRect();if(this.overlap){if(t.width<this.widthOverlapControl){var o=window.getComputedStyle(this.$refs.zoomBox.$el),i=parseInt(o.paddingLeft,10)+parseInt(o.paddingRight,10),s=window.getComputedStyle(this.$refs.railLeftBox),a=parseInt(s.paddingLeft,10)+parseInt(s.paddingRight,10),c=this.leftOverlapUndoRedo+(this.widthOverlapControl-t.width)-i-a;c>n.right&&(this.overlap=!1)}}else r.left<n.right&&(this.overlap=!0,this.widthOverlapControl=t.width,this.leftOverlapUndoRedo=r.left)}},computed:{showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,Ft.nextTick)();case 2:e.controlObserver.observe(e.$refs.controlBox.$el);case 3:case"end":return t.stop()}}),t)})))()}},Bk=Rk,Lk=(f(99155),fr(Bk,$x,Xx,!1,null,"30b2f3e9",null)),jk=Lk.exports,Fk=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},zk=[],Uk=function(e){Ho(n,e);var t=Yo(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=Pr(this.moddle),i=Mr(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var s=new po(_r,i,o);s.dataAssociationProps={sourceShape:e,targetCoords:{x:void 0,y:void 0}};var a=$()(e,"component.node"),c=a.definition.get("dataOutputAssociations")||[];return a.definition.set("dataOutputAssociations",[].concat(W(c),[s.definition])),s}}],[{key:"isValid",value:function(e){var t=e.sourceShape,n=e.targetShape,r=$()(t,"component.node"),o=$()(n,"component.node");if(!o)return!1;var i=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],s=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],a=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateCatchEvent","bpmn:StartEvent"],c=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],l=r.definition.$type,d=o.definition.$type,u="bpmn:DataStoreReference"===r.definition.$type,h="bpmn:DataObjectReference"===r.definition.$type,p="bpmn:DataStoreReference"===o.definition.$type,f="bpmn:DataObjectReference"===o.definition.$type;return!(!u||!s.includes(d))||(!(!h||!c.includes(d))||(!(!p||!i.includes(l))||f&&a.includes(l)))}},{key:"isValidSourceNode",value:function(e){return!Ko.isNodeDisallowedFromDataAssociation(e)}}]),n}(Ko),qk=[{type:"processmaker-modeler-text-annotation",factory:Uk},{type:"processmaker-modeler-sequence-flow",factory:ul},{type:"processmaker-modeler-message-flow",factory:wl}],Vk={name:fo,components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){var e=this;return qk.some((function(t){return t.factory.isValid({sourceShape:e.sourceShape,targetShape:e.target,sourceConfig:e.sourceConfig,targetConfig:e.targetConfig})}))},targetType:function(){return $()(this.target,"component.node.type")},shapeName:function(){return this.node.definition.get("name")},nameLabel:{get:function(){return this.shape.label(0).attrs.text.text},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.shape.label(0,{attrs:{text:{text:e}}})}}},watch:{},methods:{completeLink:function(){var e=this,t=qk.find((function(t){return t.factory.isValid({sourceShape:e.sourceShape,targetShape:e.target,sourceConfig:e.sourceConfig,targetConfig:e.targetConfig})})),n=new t.factory(this.nodeRegistry,this.moddle,this.paper),r=this.shape.findView(this.paper),o=[r.sourceAnchor.toJSON(),r.targetAnchor.toJSON()];this.$emit("replace-generic-flow",{actualFlow:n.makeFlowNode(this.sourceShape,this.target,o),genericFlow:this.node,targetNode:$()(this.target,"component.node")})},updateRouter:function(){this.shape.router("normal")},createDefaultFlowMarker:function(){this.shape.attr("line",{strokeWidth:1,strokeDasharray:"2 2"})}},mounted:function(){this.shape=new F.shapes.standard.Link,this.shape.connector("rounded",{radius:5}),this.createDefaultFlowMarker(),this.shape.addTo(this.graph),this.shape.component=this}},Hk=Vk,Wk=fr(Hk,Fk,zk,!1,null,null,null),Gk=Wk.exports,$k=function(){var e=this,t=e._self._c;return e.showLasso&&e.style?t("div",{ref:"drag",staticClass:"box",style:e.style,attrs:{"data-cy":"selection-box","data-length":e.selected.length}},[t("crown-multiselect",e._g({attrs:{paper:e.paperManager.paper,graph:e.$parent.graph,moddle:e.$parent.moddle,collaboration:e.$parent.collaboration,"process-node":e.$parent.processNode,"plane-elements":e.$parent.planeElements,"is-rendering":e.$parent.isRendering,"dropdown-data":[],"has-pools":e.hasPoolsOrLanesSelected},on:{"save-state":function(t){return e.$emit("save-state")}}},e.$listeners))],1):e._e()},Xk=[],Yk=function(){var e=this,t=e._self._c;return e.isMultiSelect?t("div",{staticClass:"crown-config crown-multiselect",style:e.style,attrs:{role:"menu"}},[e._t("default"),e._l(e.availableButtons,(function(e){return t("button",{key:e.label,staticClass:"crown-button",attrs:{"aria-label":e.label,title:e.label,"data-test":e.testId,role:e.role},on:{click:e.action}},["fpm"===e.iconPrefix?t("font-awesome-icon",{attrs:{icon:[e.iconPrefix,"fa-".concat(e.icon)]}}):t("i",{class:"".concat(e.iconPrefix," fa-").concat(e.icon," text-dark")})],1)})),t("crown-align",{directives:[{name:"show",rawName:"v-show",value:e.showAlignmentButtons,expression:"showAlignmentButtons"}],attrs:{paper:e.paper},on:{"save-state":function(t){return e.$emit("save-state")}}})],2):e._e()},Jk=[],Zk=function(){var e=this,t=e._self._c;return e.isMultiSelect?t("div",{staticClass:"crown-config crown-align",style:e.style,attrs:{role:"menu"}},[e._t("default"),e._l(e.availableButtons,(function(e){return t("button",{key:e.label,staticClass:"crown-button",attrs:{"aria-label":e.label,title:e.label,"data-test":e.testId,role:e.role,disabled:e.disabled},on:{mousedown:function(e){e.stopPropagation(),e.preventDefault()},click:function(t){return t.stopPropagation(),t.preventDefault(),e.action.apply(null,arguments)}}},[t("font-awesome-icon",{attrs:{icon:["fpm","fa-".concat(e.icon)]}})],1)}))],2):e._e()},Kk=[],Qk=function(e){return e.position().y+e.size().height},eC=function(e){return e.position().x},tC=function(e){return e.position().x+e.size().width/2},nC=function(e){return e.position().y+e.size().height/2},rC=function(e){return e.position().x+e.size().width},oC=function(e){return e.position().y},iC=function(e){return Boolean(e&&e.position&&e.size)},sC={poolLane:"PoolLane",boundaryEvent:"processmaker.components.nodes.boundaryEvent.Shape"},aC=[sC.boundaryEvent,sC.poolLane],cC=function(e){return!aC.includes(e.get("type"))};function lC(e){return iC(e)&&cC(e)}function dC(e,t){var n=t-Qk(e);e.translate(0,n)}function uC(e,t){var n=t-eC(e);e.translate(n,0)}function hC(e,t){var n=t-rC(e);e.translate(n,0)}function pC(e,t){var n=t-tC(e);e.translate(n,0)}function fC(e,t){var n=t-nC(e);e.translate(0,n)}function mC(e,t){var n=t-oC(e);e.translate(0,n)}function gC(e){var t=SC(e);e.forEach((function(e){uC(e,t.left)}))}function vC(e){var t=SC(e);e.forEach((function(e){hC(e,t.right)}))}function bC(e){var t=SC(e);e.forEach((function(e){mC(e,t.top)}))}function yC(e){var t=SC(e);e.forEach((function(e){dC(e,t.bottom)}))}function wC(e){var t=SC(e);e.forEach((function(e){pC(e,t.hMiddle)}))}function xC(e){var t=SC(e);e.forEach((function(e){fC(e,t.vMiddle)}))}function kC(e){var t=SC(e),n=e.length,r=3;if(!(n<r)){var o=e.reduce((function(e,t){return t.size().height+e}),0),i=e.sort((function(e,t){return nC(e)-nC(t)})),s=t.top+e[0].size().height,a=(t.height-o)/(i.length-1);i.forEach((function(e,t){0!==t&&(mC(e,s+a),s+=a+e.size().height)}))}}function CC(e){var t=SC(e),n=e.length,r=3;if(!(n<r)){var o=e.reduce((function(e,t){return t.size().width+e}),0),i=e.sort((function(e,t){return tC(e)-tC(t)})),s=t.left+e[0].size().width,a=(t.width-o)/(i.length-1);i.forEach((function(e,t){0!==t&&(uC(e,s+a),s+=a+e.size().width)}))}}function SC(e){if(!e||!e.length||0===e.length)return{left:0,right:0,top:0,bottom:0,width:0,height:0,vMiddle:0,hMiddle:0};var t=function(e){return iC(e)?e.position().x:0},n=function(e){return iC(e)?e.position().x+e.size().width:0},r=function(e){return iC(e)?e.position().y:0},o=function(e){return iC(e)?e.position().y+e.size().height:0},i=Math.min.apply(Math,W(e.map(t))),s=Math.max.apply(Math,W(e.map(n))),a=Math.min.apply(Math,W(e.map(r))),c=Math.max.apply(Math,W(e.map(o))),l=s-i,d=c-a;return{left:i,right:s,top:a,bottom:c,width:l,height:d,vMiddle:a+d/2,hMiddle:i+l/2}}function EC(e){var t=e.filter((function(e){return lC(e)})),n=SC(e),r=t.length>1;return{can:{align:{left:r&&t.some((function(e){return eC(e)!==n.left})),horizontalCenter:r&&t.some((function(e){return tC(e)!==n.hMiddle})),right:r&&t.some((function(e){return rC(e)!==n.right})),bottom:r&&t.some((function(e){return Qk(e)!==n.bottom})),verticalCenter:r&&t.some((function(e){return nC(e)!==n.vMiddle})),top:r&&t.some((function(e){return oC(e)!==n.top}))},distribute:{horizontally:r&&t.length>2,vertically:r&&t.length>2}},align:{left:function(){return gC(t)},horizontalCenter:function(){return wC(t)},right:function(){return vC(t)},bottom:function(){return yC(t)},verticalCenter:function(){return xC(t)},top:function(){return bC(t)}},distribute:{horizontally:function(){return CC(t)},vertically:function(){return kC(t)}}}}var AC={components:{FontAwesomeIcon:To.FontAwesomeIcon},props:{paper:Object,hasPools:Boolean},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null,buttons:[{label:this.$t("Align Left"),icon:"align-left",testId:"align-left",role:"menuitem",action:this.alignLeft,condition:"align.left",disabled:!1},{label:this.$t("Center Horizontally"),icon:"center-horizontally",testId:"align-horizontally",role:"menuitem",action:this.centerHorizontally,condition:"align.horizontalCenter",disabled:!1},{label:this.$t("Align Right"),icon:"align-right",testId:"align-right",role:"menuitem",action:this.alignRight,condition:"align.right",disabled:!1},{label:this.$t("Align Bottom"),icon:"align-bottom",testId:"align-bottom",role:"menuitem",action:this.alignBottom,condition:"align.bottom",disabled:!1},{label:this.$t("Center Vertically"),icon:"center-vertically",testId:"center-vertically",role:"menuitem",action:this.centerVertically,condition:"align.verticalCenter",disabled:!1},{label:this.$t("Align Top"),icon:"align-top",testId:"align-top",role:"menuitem",action:this.alignTop,condition:"align.top",disabled:!1},{label:this.$t("Distribute Horizontally"),icon:"distribute-horizontally",testId:"distribute-horizontally",role:"menuitem",action:this.distributeHorizontally,condition:"distribute.horizontally",disabled:!1},{label:this.$t("Distribute Vertically"),icon:"distribute-vertically",testId:"distribute-vertically",role:"menuitem",action:this.distributeVertically,condition:"distribute.vertically",disabled:!1}]}},created:function(){this.$t=this.$t.bind(this),mo.library.add(Co),mo.library.add(ko),mo.library.add(So),mo.library.add(Eo),mo.library.add(xo),mo.library.add(wo),mo.library.add(_o),mo.library.add(Ao)},watch:{selectedShapes:function(){this.$root.$emit("bv::hide::tooltip")}},computed:{selectedShapes:function(){return this.disableButtons(),EC(Un.getters.highlightedShapes)},isMultiSelect:function(){var e=Un.getters.highlightedShapes.length;return e>1},highlightedShapes:function(){return Un.getters.highlightedShapes},availableButtons:function(){var e=this.hasPools;return this.buttons.filter((function(t){return"copy-button"===t.testId?!e:"clone-button"!==t.testId||!e}))}},methods:{disableButtons:function(){var e=EC(Un.getters.highlightedShapes);this.buttons.forEach((function(t){t.disabled=!(0,Er.get)(e.can,t.condition,!0)}))},alignLeft:function(){this.undoableAction(this.selectedShapes.align.left)},centerHorizontally:function(){this.undoableAction(this.selectedShapes.align.horizontalCenter)},alignRight:function(){this.undoableAction(this.selectedShapes.align.right)},alignBottom:function(){this.undoableAction(this.selectedShapes.align.bottom)},centerVertically:function(){this.undoableAction(this.selectedShapes.align.verticalCenter)},alignTop:function(){this.undoableAction(this.selectedShapes.align.top)},distributeHorizontally:function(){this.undoableAction(this.selectedShapes.distribute.horizontally)},distributeVertically:function(){this.undoableAction(this.selectedShapes.distribute.vertically)},undoableAction:function(e){e(),this.$emit("save-state"),this.disableButtons()},paperNotRendered:function(){return!this.isRendering},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition&&this.$emit("save-state")},paperDoneRendering:function(){var e=this;if(this.isRendering)return new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown)},setUpPositionHandling:function(){}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig();case 5:case"end":return t.stop()}}),t)})))()}},_C=AC,TC=(f(81856),f(69100),fr(_C,Zk,Kk,!1,null,"46e3ac40",null)),MC=TC.exports,PC={props:{paper:Object,hasPools:Boolean},components:{crownAlign:MC,FontAwesomeIcon:To.FontAwesomeIcon},data:function(){return{showAlignmentButtons:!1,runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:this.paperNotRendered(),showReplaceModal:!1,nodeToReplace:null,buttons:[{label:"Copy Selection",iconPrefix:"fa",icon:"clipboard",testId:"copy-button",role:"menuitem",action:this.copySelection},{label:"Clone Selection",iconPrefix:"fa",icon:"copy",testId:"clone-button",role:"menuitem",action:this.cloneSelection},{label:"Align",iconPrefix:"fpm",icon:"align-left",testId:"align",role:"menuitem",action:this.showAlign},{label:"Delete Element",iconPrefix:"fa",icon:"trash-alt",testId:"delete-button",role:"menuitem",action:this.deleteElement}]}},created:function(){this.$t=this.$t.bind(this),mo.library.add(ko)},computed:{isMultiSelect:function(){var e=Un.getters.highlightedShapes.length;return e>1},highlightedShapes:function(){return Un.getters.highlightedShapes},availableButtons:function(){var e=this.hasPools;return this.buttons.filter((function(t){return"copy-button"===t.testId?!e:"clone-button"!==t.testId||!e}))}},methods:{showAlign:function(){this.showAlignmentButtons=!this.showAlignmentButtons},copySelection:function(){this.$emit("copy-selection")},cloneSelection:function(){this.$emit("clone-selection")},deleteElement:function(){this.$emit("remove-nodes")},paperNotRendered:function(){return!this.isRendering},setNodePosition:function(){this.shape.stopListening(this.paper,"element:pointerup",this.setNodePosition),this.savePositionOnPointerupEventSet=!1,Un.getters.allowSavingElementPosition&&this.$emit("save-state")},paperDoneRendering:function(){var e=this;if(this.isRendering)return new Promise((function(t){return e.paper.once("render:done",t)}))},setUpCrownConfig:function(){this.paper.on("render:done scale:changed translate:changed",this.repositionCrown)},setUpPositionHandling:function(){}},mounted:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:return t.next=4,e.paperDoneRendering();case 4:e.setUpCrownConfig();case 5:case"end":return t.stop()}}),t)})))()}},IC=PC,OC=(f(6718),fr(IC,Yk,Jk,!1,null,"bcd827ec",null)),DC=OC.exports,NC={name:"Selection",components:{CrownMultiselect:DC},props:{graph:Object,paperManager:Object,useModelGeometry:Boolean,processNode:Object,isMultiplayer:Boolean},data:function(){return{start:null,isSelecting:!1,isSelected:!1,selected:[],conectedLinks:[],dragging:!1,style:{left:"0px",top:"0px",width:"0px",height:"0px"},mouseX:0,mouseY:0,top:0,left:0,initialPosition:null,hasMouseDown:!1,hasMouseMoved:!1,showLasso:!1,isOutOfThePool:!1,stopForceMove:!1,draggableBlackList:[dl],selectionBlackList:[fo],selectableBlackList:[fo],newPool:null,oldPool:null,isValidSelectionLinks:!0,invalidPool:null}},mounted:function(){this.paperManager.paper.on("scale:changed ",this.updateSelectionBox),this.paperManager.paper.on("translate:changed ",this.translateChanged)},computed:{hasPoolsOrLanesSelected:function(){return this.selected.some((function(e){return e.model.component.node.type===Jo||e.model.component.node.type===dl}))}},watch:{selected:function(e){this.prepareConectedLinks(e),this.addToHighlightedNodes(e)}},methods:{selectElements:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$nextTick();case 2:return t.clearSelection(),t.selected=e,t.showLasso=!0,t.isSelected=!0,t.isSelecting=!0,t.start=null,n.next=10,t.$nextTick();case 10:t.updateSelectionBox();case 11:case"end":return n.stop()}}),n)})))()},selectElement:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]&&t[1],!e.model.component||!n.selectableBlackList.includes(e.model.component.node.type)){r.next=3;break}return r.abrupt("return");case 3:return n.showLasso=!0,n.isSelected=!0,n.isSelecting=!0,n.start=null,o?n.shiftKeySelectionHandler(e):n.selected=[e],n.filterSelected(),r.next=11,n.$nextTick();case 11:!1===Un.getters.isReadOnly&&n.updateSelectionBox();case 12:case"end":return r.stop()}}),r)})))()},shiftKeySelectionHandler:function(e){var t=this;if(!(e&&e.model&&e.model.component&&this.draggableBlackList.includes(e.model.component.node.type))){var n=this.selected.find((function(e){return t.draggableBlackList.includes(e.model.component.node.type)}));if(n)this.selected=[e];else{var r=this.selected.find((function(e){return e.model.component.node.type===Jo}));r&&e.model.component.node.type!==Jo?this.selected=[e]:e.model.component&&e.model.component.node.type===Jo?this.hasOnlyPools(this.selected)?this.selectOrUnselectShape(e):this.selected=[e]:e.model.component&&e.model.component.node.pool&&(r=this.getPool(this.selected),r&&e.model.component.node.pool.id!==r.model.get("id"))?this.selected=[e]:this.selectOrUnselectShape(e)}}},selectOrUnselectShape:function(e){var t=this.selected.find((function(t){return t.id===e.id}));t?this.selected=this.selected.filter((function(t){return t.id!==e.id})):this.selected.push(e)},clearSelection:function(){this.initSelection()},initSelection:function(){this.isSelecting=!1,this.start=null,this.selected=[],this.showLasso=!1,this.isSelected=!1,this.style={left:"0px",top:"0px",width:"0px",height:"0px"}},startSelection:function(e){var t=this.paperManager.paper,n=F.util.normalizeEvent(e),r=n.clientX,o=n.clientY,i=n.offsetX,s=n.offsetY,a=t.$el.offset();this.clearSelection(),this.isSelecting=!0,this.showLasso=!0,this.start={x:r-a.left+window.pageXOffset+t.$el.scrollLeft(),y:o-a.top+window.pageYOffset+t.$el.scrollTop()},this._offset={x:i,y:s}},updateSelection:function(e){var t=this.paperManager.paper;if(this.isSelecting&&!this.isSelected&&this.start){var n=F.util.normalizeEvent(e),r=t.$el.offset(),o={x:n.clientX-r.left+window.pageXOffset+t.$el.scrollLeft(),y:n.clientY-r.top+window.pageYOffset+t.$el.scrollTop()},i={height:o.y-this.start.y,width:o.x-this.start.x};this.style.left="".concat(i.width<0?this._offset.x+i.width:this.start.x,"px"),this.style.top="".concat(i.height<0?this._offset.y+i.height:this.start.y,"px"),this.style.width="".concat(Math.abs(i.width),"px"),this.style.height="".concat(Math.abs(i.height),"px")}},endSelection:function(){var e=this.paperManager.paper;if(this.isSelecting&&!this.isSelected){var t=e.$el.offset(),n={left:this.$el.offsetLeft+t.left,top:this.$el.offsetTop+t.top},r=this.$el.clientWidth,o=this.$el.clientHeight,i=(0,F.V)(e.viewport).toLocalPoint(n.left,n.top);i.x-=window.pageXOffset,i.y-=window.pageYOffset;var s=e.scale();r/=s.sx,o/=s.sy;var a=F.g.rect(i.x,i.y,r,o);this.selected=this.getElementsInSelectedArea(a,{strict:!1}),this.filterSelected(),this.selected&&this.selected.length>0?(this.updateSelectionBox(),this.isSelected=!0):(this.clearSelection(),this.isSelected=!1,this.start=null),this.start=null}},getElementsInSelectedArea:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.paperManager.paper,o=r.findViewsInArea(e,t);return n?(this.graph.getLinks().forEach((function(t){e.intersect(t.getBBox())&&o.push(r.findViewByModel(t))})),o):o},isPositionWithinArea:function(e,t){var n=t.x,r=t.y,o=t.width,i=t.height;return e.x>=n&&e.x<=n+o&&e.y>=r&&e.y<=r+i},prepareConectedLinks:function(e){var t=this,n=this.paperManager.paper;this.conectedLinks=[],this.isValidSelectionLinks=!0,e.forEach((function(e){var r=t.graph.getConnectedLinks(e.model);if(e.model.component&&e.model.component.node.type===Jo){var o=e.model.getBBox(),i=n.model.getLinks().filter((function(e){var n=e.getSourcePoint(),r=e.getTargetPoint();return t.isPositionWithinArea(n,o)||t.isPositionWithinArea(r,o)}));i&&(r=[].concat(W(r),W(i)))}r.forEach((function(e){var r=n.findViewByModel(e);t.conectedLinks.some((function(e){return e.id===r.id}))||(t.conectedLinks.push(r),t.validateSelectionLinks(r))}))}))},validateSelectionLinks:function(e){if(this.isValidSelectionLinks){var t=this.selected.find((function(t){return t.model.get("id")===e.model.getSourceElement().get("id")})),n=this.selected.find((function(t){return t.model.get("id")===e.model.getTargetElement().get("id")}));this.isValidSelectionLinks=!(!t||!n)}},getSelectionVertex:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r={x:1/0,y:1/0},o={width:0,height:0},i=this.useModelGeometry,s=["PoolLane","standard.Link"];return e.filter((function(e){return n||!s.includes(e.model.get("type"))})).map((function(e){var n=t?e.model.getBBox({useModelGeometry:i}):e.getBBox({useModelGeometry:i}).inflate(7);r.x=Math.min(r.x,n.x),r.y=Math.min(r.y,n.y),o.width=Math.max(o.width,n.x+n.width),o.height=Math.max(o.height,n.y+n.height)})),{minX:r.x,minY:r.y,maxX:o.width,maxY:o.height}},updateSelectionBox:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e||this.isSelecting&&this.style)if(this.selected.length>0){var n=this.getSelectionVertex(this.selected,!1,!0);this.style.left="".concat(n.minX,"px"),this.style.top="".concat(n.minY,"px"),this.left=parseInt(this.style.left),this.top=parseInt(this.style.top),this.style.width="".concat(n.maxX-n.minX,"px"),this.style.height="".concat(n.maxY-n.minY,"px")}else t&&this.clearSelection()},filterSelected:function(){var e=[gl,_r,Ir,er,El],t=this.selected.filter((function(e){return e.model.component})).filter((function(e){return"processmaker-modeler-pool"===e.model.component.node.type})).map((function(e){return e.model.component.node.id}));this.selected=this.selected.filter((function(n){if(n.model.component&&n.model.component.node.pool)return n.model.component.node.pool&&!t.includes(n.model.component.node.pool.component.node.id);if(n.model.component&&e.includes(n.model.component.node.type)){var r=n.model.getParentCell();if(r.component&&r.component.node.pool)return!t.includes(r.component.node.pool.component.node.id)}return!0}))},translateChanged:function(){this.isSelecting&&this.updateSelectionBox()},hasLanes:function(e){var t=["processmaker-modeler-lane"],n=e.find((function(e){return t.includes(e.model.component.node.type)}));return!!n},hasOnlyLinks:function(e){var t=this.selected.filter((function(e){return"standard.Link"===e.model.get("type")}));return t&&e.length===t.length},hasOnlyPools:function(e){var t=this.selected.filter((function(e){return e.model.component&&e.model.component.node.type===Jo}));return t&&e.length===t.length},startDrag:function(e){if(this.$refs.drag){this.stopForceMove=!1,this.dragging=!0,this.hasMouseMoved=!1;var t=F.util.normalizeEvent(e);this.mouseX=t.clientX,this.mouseY=t.clientY,this.top=this.$refs.drag.offsetTop,this.left=this.$refs.drag.offsetLeft,this.initialPosition={top:this.top,left:this.left},this.hasLanes(this.selected)||this.hasOnlyLinks(this.selected)?this.stopForceMove=!0:this.selected&&1===this.selected.length&&"processmaker.components.nodes.boundaryEvent.Shape"===this.selected[0].model.get("type")&&this.selected[0].model.component.attachToValidTarget(this.selected[0])}},drag:function(e){if(!this.stopForceMove&&this.dragging){this.hasMouseMoved=!0;var t=F.util.normalizeEvent(e),n=t.clientX-this.mouseX,r=t.clientY-this.mouseY;this.top+=r,this.left+=n,this.mouseX=t.clientX,this.mouseY=t.clientY;var o=this.paperManager.paper.scale();this.style.left="".concat(this.left,"px"),this.style.top="".concat(this.top,"px"),this.translateSelectedShapes(n/o.sx,r/o.sy),this.overPoolDrag(e)}},stopDrag:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.dragging=!1,e.stopForceMove=!1,t.next=4,e.$nextTick();case 4:return t.next=6,e.paperManager.awaitScheduledUpdates();case 6:e.overPoolStopDrag(),e.updateSelectionBox(),e.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",e.getProperties(e.selected));case 9:case"end":return t.stop()}}),t)})))()},getProperties:function(e){var t=this,n=[],r=["PoolLane","standard.Link"];return e.filter((function(e){return!r.includes(e.model.get("type"))})).forEach((function(e){if("processmaker.modeler.bpmn.pool"===e.model.get("type")){var r=e.model.component.getElementsUnderArea(e.model,t.graph);n=[].concat(W(n),W(t.getContainerProperties(r,n)))}else{var o,i,s,a=e.model.component.node,c={id:a.definition.id,properties:{x:e.model.get("position").x,y:e.model.get("position").y,height:e.model.get("size").height,width:e.model.get("size").width,attachedToRefId:null!==(o=null===(i=e.model.component.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id)&&void 0!==o?o:null,color:e.model.get("color")}};null!==a&&void 0!==a&&null!==(s=a.pool)&&void 0!==s&&s.component&&(c["poolId"]=a.pool.component.id),n.push(c)}var l=t.getBoundariesChangesForShape(e);n=n.concat(l)})),n},getBoundariesChangesForShape:function(e){var t=[],n=[gy,Sy,Iy,Fy,$y,tw],r=Un.getters.nodes.filter((function(e){return n.includes(e.type)}));return r.forEach((function(n){var r,o,i;n.definition.attachedToRef.id===e.model.component.node.definition.id&&t.push({id:n.definition.id,properties:{x:n.diagram.bounds.x,y:n.diagram.bounds.y,height:n.diagram.bounds.height,width:n.diagram.bounds.width,attachedToRefId:null!==(r=null===(o=n.definition.get("attachedToRef"))||void 0===o?void 0:o.id)&&void 0!==r?r:null,color:null!==(i=n.definition.get("color"))&&void 0!==i?i:null}})})),t},getContainerProperties:function(e){var t=[];return e.forEach((function(e){t.push({id:e.component.node.definition.id,properties:{x:e.get("position").x,y:e.get("position").y,height:e.get("size").height,width:e.get("size").width,color:e.get("color")}})})),t},updateFlowsWaypoint:function(){this.conectedLinks.forEach((function(e){if(e.model.component&&"standard.Link"===e.model.get("type")){var t=e.sourceAnchor,n=e.targetAnchor;e.model.component.node.diagram.waypoint=[t].concat(W(e.model.component.shape.vertices()),[n]).map((function(t){return e.model.component.moddle.create("dc:Point",t)}))}}))},translateSelectedShapes:function(e,t,n){var r=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],o=this.selected.filter((function(e){return!r.includes(e.model.get("type"))}));if(n&&o.filter((function(e){return n.model.get("id")!==e.model.get("id")})),this.selected&&1===this.selected.length&&"processmaker.components.nodes.boundaryEvent.Shape"===this.selected[0].model.get("type"))return this.selected[0].model.translate(e,t),void this.selected[0].model.component.turnInvalidTargetRed();o.forEach((function(n){return n.model.translate(e,t)}))},getShapesFromPoint:function(e){var t=F.util.normalizeEvent(e),n=t.clientX,r=t.clientY,o=(0,F.V)(this.paperManager.paper.viewport).toLocalPoint(n,r);return this.paperManager.paper.findViewsFromPoint(o)},addToHighlightedNodes:function(e){if(Un.commit("highlightNode"),e.length>0){var t=e.filter((function(e){return e.model.component})).map((function(e){return e.model.component.node}));Un.commit("addToHighlightedNodes",t)}else Un.commit("highlightNode",this.processNode)},getChildShape:function(e){var t=null,n=this.getShapesFromPoint(e);return 1===n.length?n[0]:(n.forEach((function(e){e.model.get("parent")&&e.model.component.node.type!==dl&&(t=e)})),t)},markSelectedByPoint:function(e){var t=this.getChildShape(e);t&&(this.selected=[t]),this.selected.length>0&&(this.isSelected=!0,this.isSelecting=!0,this.showLasso=!0,this.updateSelectionBox())},getElementsInsideSelector:function(){var e=this.paperManager.paper,t=e.$el.offset(),n={left:this.$el.offsetLeft+t.left,top:this.$el.offsetTop+t.top},r=this.$el.clientWidth,o=this.$el.clientHeight,i=(0,F.V)(e.viewport).toLocalPoint(n.left,n.top);i.x-=window.pageXOffset,i.y-=window.pageYOffset;var s=e.scale();r/=s.sx,o/=s.sy;var a=F.g.rect(i.x,i.y,r,o);return this.getElementsInSelectedArea(a,{strict:!1})},getPool:function(e){var t=this.paperManager.paper,n=null;return e&&e.length>0&&e.forEach((function(e){var t=e.model;n||t.getParentCell()&&t.getParentCell().component.node.type===Jo&&(n=t.getParentCell())})),t.findViewByModel(n)},isNotPoolChilds:function(e){if(e.length>0){var t=e.find((function(e){var t=e.model;return t.component&&t.component.node.type===Jo})),n=e.find((function(e){var t=e.model;return t.getParentCell()&&t.getParentCell().component.node.type===Jo}));return!!t||!n}return!1},overPoolDrag:function(e){if(!this.isNotPoolChilds(this.selected)){var t=this.getPool(this.selected),n=this.getShapesFromPoint(e),r=n.find((function(e){return e.model.component&&e.model.component.node.type===Jo}));this.newPool=null,this.oldPool=null,r?(this.paperManager.setStateValid(),this.invalidPool&&(this.invalidPool.model.component.shape.attr("body/fill",Ye),this.invalidPool=null),t&&t.model.get("id")!==r.model.get("id")&&(this.newPool=r,this.oldPool=t,this.isOutOfThePool=!1,this.isValidSelectionLinks||(this.isOutOfThePool=!0,this.invalidPool=r,r.model.component.shape.attr("body/fill",ze),Un.commit("preventSavingElementPosition")))):(this.isOutOfThePool=!0,Un.commit("preventSavingElementPosition"),this.paperManager.setStateInvalid())}},overPoolStopDrag:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.isNotPoolChilds(e.selected)){t.next=4;break}return e.updateFlowsWaypoint(),e.$emit("save-state"),t.abrupt("return");case 4:e.isOutOfThePool?(e.rollbackSelection(),e.invalidPool&&(e.invalidPool.model.component.shape.attr("body/fill",Ye),e.invalidPool=null)):(e.updateFlowsWaypoint(),e.newPool?(e.moveElements(e.selected,e.oldPool,e.newPool),e.moveConectedLinks(e.conectedLinks,e.oldPool,e.newPool),e.newPool=null,e.oldPool=null,e.updateLaneChildren(e.selected),e.$emit("save-state")):(e.expandToFitElement(e.selected),e.updateLaneChildren(e.selected),e.$emit("save-state")));case 5:case"end":return t.stop()}}),t)})))()},rollbackSelection:function(){var e=this;return l(a().mark((function t(){var n,r,o,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.initialPosition.left-e.left,r=e.initialPosition.top-e.top,e.style.left="".concat(e.initialPosition.left,"px"),e.style.top="".concat(e.initialPosition.top,"px"),o=e.paperManager.paper.scale(),i=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],e.selected.filter((function(e){return!i.includes(e.model.get("type"))})).forEach((function(e){e.model.translate(n/o.sx,r/o.sy)})),e.isOutOfThePool=!1,t.next=10,Un.commit("allowSavingElementPosition");case 10:return e.paperManager.setStateValid(),t.next=13,e.$nextTick();case 13:return t.next=15,e.paperManager.awaitScheduledUpdates();case 15:e.updateSelectionBox(!0);case 16:case"end":return t.stop()}}),t)})))()},expandToFitElement:function(e){if(e.length>0){var t=e.find((function(e){var t=e.model;return!!t.getParentCell()&&t.getParentCell().component.node.type===Jo})).model.getParentCell(),n=this.getSelectionVertex(this.selected,!0),r=t.getBBox(),o=r.x,i=r.y,s=r.width,a=r.height,c=n.maxX-n.minX,l=n.maxY-n.minY,d=n.minX-o,u=n.minY-i,h=d+c,p=d,f=u,m=u+l,g=0,v=0,b="bottom",y="right";h>s-am&&(g=h+am),p<om+am&&(g=s+(om+am-p),y="left"),f<am&&(v=am-f+a,b="top"),m>a&&(v=m+am),(g||v)&&(t.resize(Math.max(g,s),Math.max(v,a),{direction:"".concat(b,"-").concat(y)}),t.component.fixResizeRounding(),t.component.laneSet&&(t.component.resizeLanes(),t.component.sortedLanes().forEach((function(e){Un.commit("updateNodeBounds",{node:e.component.node,bounds:e.getBBox()})}))),t.component.updateAnchorPointPosition(),Un.commit("updateNodeBounds",{node:t.component.node,bounds:t.getBBox()}))}},updateLaneChildren:function(e){if(e){var t=e.find((function(e){var t=e.model;return!!t.getParentCell()&&t.getParentCell().component.node.type===Jo}));t&&(t.model.getParentCell(),t.model.component.laneSet&&t.component.updateLaneChildren())}},moveElements:function(e,t,n){var r=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"];e.filter((function(e){return!r.includes(e.model.get("type"))})).forEach((function(e){t.model.component.moveElement(e.model,n.model)}))},moveConectedLinks:function(e,t,n){e.forEach((function(e){t.model.component.moveFlow(e.model,n.model)}))}}},RC=NC,BC=(f(81289),fr(RC,$k,Xk,!1,null,"7c27567b",null)),LC=BC.exports,jC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"remote-cursor",style:{left:e.left+"px",top:e.top+"px"}},[t("inline-svg",{attrs:{src:e.cursorIcon,fill:e.cursorColor}}),t("div",{staticClass:"remote-username"},[e._v(" "+e._s(e.username)+" ")])],1)},FC=[],zC={components:{InlineSvg:sv},props:{cursorColor:{type:String,default:"#000000"},username:{type:String},top:{type:Number},left:{type:Number}},data:function(){return{cursorIcon:f(61264)}}},UC=zC,qC=(f(89655),fr(UC,jC,FC,!1,null,"70c20f1a",null)),VC=qC.exports;function HC(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=V(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(a)throw i}}}}f(39575),f(82472),f(48675),f(92990),f(18927),f(33105),f(35035),f(74345),f(89080),f(63408),f(14590),f(32846),f(44731),f(77209),f(96319),f(58867),f(37789),f(33739),f(29368),f(14483),f(12056),f(3462),f(30678),f(27462),f(33824),f(55021),f(12974),f(15016),f(23767),f(8585),f(68696);const WC=Object.create(null);WC["open"]="0",WC["close"]="1",WC["ping"]="2",WC["pong"]="3",WC["message"]="4",WC["upgrade"]="5",WC["noop"]="6";const GC=Object.create(null);Object.keys(WC).forEach((e=>{GC[WC[e]]=e}));const $C={type:"error",data:"parser error"},XC="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YC="function"===typeof ArrayBuffer,JC=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ZC=({type:e,data:t},n,r)=>XC&&t instanceof Blob?n?r(t):KC(t,r):YC&&(t instanceof ArrayBuffer||JC(t))?n?r(t):KC(new Blob([t]),r):r(WC[e]+(t||"")),KC=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function QC(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let eS;function tS(e,t){return XC&&e.data instanceof Blob?e.data.arrayBuffer().then(QC).then(t):YC&&(e.data instanceof ArrayBuffer||JC(e.data))?t(QC(e.data)):void ZC(e,!1,(e=>{eS||(eS=new TextEncoder),t(eS.encode(e))}))}const nS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rS="undefined"===typeof Uint8Array?[]:new Uint8Array(256);for(let f=0;f<nS.length;f++)rS[nS.charCodeAt(f)]=f;const oS=e=>{let t,n,r,o,i,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);const l=new ArrayBuffer(s),d=new Uint8Array(l);for(t=0;t<a;t+=4)n=rS[e.charCodeAt(t)],r=rS[e.charCodeAt(t+1)],o=rS[e.charCodeAt(t+2)],i=rS[e.charCodeAt(t+3)],d[c++]=n<<2|r>>4,d[c++]=(15&r)<<4|o>>2,d[c++]=(3&o)<<6|63&i;return l},iS="function"===typeof ArrayBuffer,sS=(e,t)=>{if("string"!==typeof e)return{type:"message",data:cS(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:aS(e.substring(1),t)};const r=GC[n];return r?e.length>1?{type:GC[n],data:e.substring(1)}:{type:GC[n]}:$C},aS=(e,t)=>{if(iS){const n=oS(e);return cS(n,t)}return{base64:!0,data:e}},cS=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},lS=String.fromCharCode(30),dS=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZC(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(lS))}))}))},uS=(e,t)=>{const n=e.split(lS),r=[];for(let o=0;o<n.length;o++){const e=sS(n[o],t);if(r.push(e),"error"===e.type)break}return r};function hS(){return new TransformStream({transform(e,t){tS(e,(n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!==typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)}))}})}let pS;function fS(e){return e.reduce(((e,t)=>e+t.length),0)}function mS(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function gS(e,t){pS||(pS=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){n.push(s);while(1){if(0===r){if(fS(n)<1)break;const e=mS(n,1);i=128===(128&e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(fS(n)<2)break;const e=mS(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(fS(n)<8)break;const e=mS(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue($C);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(fS(n)<o)break;const e=mS(n,o);a.enqueue(sS(i?e:pS.decode(e),t)),r=0}if(0===o||o>e){a.enqueue($C);break}}}})}const vS=4;function bS(e){if(e)return yS(e)}function yS(e){for(var t in bS.prototype)e[t]=bS.prototype[t];return e}bS.prototype.on=bS.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},bS.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},bS.prototype.off=bS.prototype.removeListener=bS.prototype.removeAllListeners=bS.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if(n=r[o],n===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},bS.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);r=0;for(var o=n.length;r<o;++r)n[r].apply(this,t)}return this},bS.prototype.emitReserved=bS.prototype.emit,bS.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},bS.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wS=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())();function xS(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const kS=wS.setTimeout,CS=wS.clearTimeout;function SS(e,t){t.useNativeTimers?(e.setTimeoutFn=kS.bind(wS),e.clearTimeoutFn=CS.bind(wS)):(e.setTimeoutFn=wS.setTimeout.bind(wS),e.clearTimeoutFn=wS.clearTimeout.bind(wS))}const ES=1.33;function AS(e){return"string"===typeof e?_S(e):Math.ceil((e.byteLength||e.size)*ES)}function _S(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function TS(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function MS(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}class PS extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class IS extends bS{constructor(e){super(),this.writable=!1,SS(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new PS(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=sS(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=TS(e);return t.length?"?"+t:""}}const OS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),DS=64,NS={};let RS,BS=0,LS=0;function jS(e){let t="";do{t=OS[e%DS]+t,e=Math.floor(e/DS)}while(e>0);return t}function FS(){const e=jS(+new Date);return e!==RS?(BS=0,RS=e):e+"."+jS(BS++)}for(;LS<DS;LS++)NS[OS[LS]]=LS;let zS=!1;try{zS="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(FO){}const US=zS;function qS(e){const t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||US))return new XMLHttpRequest}catch(n){}if(!t)try{return new(wS[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}function VS(){}function HS(){}const WS=function(){const e=new qS({xdomain:!1});return null!=e.responseType}();class GS extends IS{constructor(e){if(super(e),this.polling=!1,"undefined"!==typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!==typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=WS&&!t,this.opts.withCredentials&&(this.cookieJar=VS())}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};uS(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,dS(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=FS()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new $S(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}class $S extends bS{constructor(e,t){super(),SS(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=xS(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new qS(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(r){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"===typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(r){return void this.setTimeoutFn((()=>{this.onError(r)}),0)}"undefined"!==typeof document&&(this.index=$S.requestsCount++,$S.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=HS,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete $S.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if($S.requestsCount=0,$S.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",XS);else if("function"===typeof addEventListener){const e="onpagehide"in wS?"pagehide":"unload";addEventListener(e,XS,!1)}function XS(){for(let e in $S.requests)$S.requests.hasOwnProperty(e)&&$S.requests[e].abort()}const YS=(()=>{const e="function"===typeof Promise&&"function"===typeof Promise.resolve;return e?e=>Promise.resolve().then(e):(e,t)=>t(e,0)})(),JS=wS.WebSocket||wS.MozWebSocket,ZS=!0,KS="arraybuffer",QS="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class eE extends IS{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=QS?{}:xS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=ZS&&!QS?t?new JS(e,t):new JS(e):new JS(e,t,n)}catch(FO){return this.emitReserved("error",FO)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;ZC(n,this.supportsBinary,(e=>{const t={};if(!ZS&&(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate)){const n="string"===typeof e?Buffer.byteLength(e):e.length;n<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{ZS?this.ws.send(e):this.ws.send(e,t)}catch(o){}r&&YS((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=FS()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!JS}}class tE extends IS{get name(){return"webtransport"}doOpen(){"function"===typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=gS(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=hS();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const o=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),o())})).catch((e=>{}))};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this.writer.write(i).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&YS((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}const nE={websocket:eE,webtransport:tE,polling:GS},rE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,oE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function iE(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=rE.exec(e||""),i={},s=14;while(s--)i[oE[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=sE(i,i["path"]),i.queryKey=aE(i,i["query"]),i}function sE(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),r}function aE(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}class cE extends bS{constructor(e,t={}){super(),this.binaryType=KS,this.writeBuffer=[],e&&"object"===typeof e&&(t=e,e=null),e?(e=iE(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=iE(t.host).host),SS(this,t),this.secure=null!=t.secure?t.secure:"undefined"!==typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!==typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"===typeof this.opts.query&&(this.opts.query=MS(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"===typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=vS,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new nE[e](n)}open(){let e;if(this.opts.rememberUpgrade&&cE.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(t){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;cE.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;cE.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,l(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function c(e){t&&e.name!==t.name&&o()}const l=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",i),t.once("close",s),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{n||t.open()}),200):t.open()}onOpen(){if(this.readyState="open",cE.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){const e=this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1;if(!e)return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const e=this.writeBuffer[n].data;if(e&&(t+=AS(e)),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"===typeof t&&(r=t,t=void 0),"function"===typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){cE.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}cE.protocol=vS;cE.protocol;function lE(e,t="",n){let r=e;n=n||"undefined"!==typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e="undefined"!==typeof n?n.protocol+"//"+e:"https://"+e),r=iE(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":"),i=o?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const dE="function"===typeof ArrayBuffer,uE=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,hE=Object.prototype.toString,pE="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===hE.call(Blob),fE="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===hE.call(File);function mE(e){return dE&&(e instanceof ArrayBuffer||uE(e))||pE&&e instanceof Blob||fE&&e instanceof File}function gE(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(gE(e[t]))return!0;return!1}if(mE(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return gE(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&gE(e[n]))return!0;return!1}function vE(e){const t=[],n=e.data,r=e;return r.data=bE(n,t),r.attachments=t.length,{packet:r,buffers:t}}function bE(e,t){if(!e)return e;if(mE(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=bE(e[r],t);return n}if("object"===typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=bE(e[r],t));return n}return e}function yE(e,t){return e.data=wE(e.data,t),delete e.attachments,e}function wE(e,t){if(!e)return e;if(e&&!0===e._placeholder){const n="number"===typeof e.num&&e.num>=0&&e.num<t.length;if(n)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=wE(e[n],t);else if("object"===typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=wE(e[n],t));return e}const xE=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],kE=5;var CE;(function(e){e[e["CONNECT"]=0]="CONNECT",e[e["DISCONNECT"]=1]="DISCONNECT",e[e["EVENT"]=2]="EVENT",e[e["ACK"]=3]="ACK",e[e["CONNECT_ERROR"]=4]="CONNECT_ERROR",e[e["BINARY_EVENT"]=5]="BINARY_EVENT",e[e["BINARY_ACK"]=6]="BINARY_ACK"})(CE||(CE={}));class SE{constructor(e){this.replacer=e}encode(e){return e.type!==CE.EVENT&&e.type!==CE.ACK||!gE(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===CE.EVENT?CE.BINARY_EVENT:CE.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==CE.BINARY_EVENT&&e.type!==CE.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=vE(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function EE(e){return"[object Object]"===Object.prototype.toString.call(e)}class AE extends bS{constructor(e){super(),this.reviver=e}add(e){let t;if("string"===typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===CE.BINARY_EVENT;n||t.type===CE.BINARY_ACK?(t.type=n?CE.EVENT:CE.ACK,this.reconstructor=new _E(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!mE(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===CE[n.type])throw new Error("unknown packet type "+n.type);if(n.type===CE.BINARY_EVENT||n.type===CE.BINARY_ACK){const r=t+1;while("-"!==e.charAt(++t)&&t!=e.length);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;while(++t){const n=e.charAt(t);if(","===n)break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;while(++t){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!AE.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case CE.CONNECT:return EE(t);case CE.DISCONNECT:return void 0===t;case CE.CONNECT_ERROR:return"string"===typeof t||EE(t);case CE.EVENT:case CE.BINARY_EVENT:return Array.isArray(t)&&("number"===typeof t[0]||"string"===typeof t[0]&&-1===xE.indexOf(t[0]));case CE.ACK:case CE.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class _E{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=yE(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function TE(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ME=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class PE extends bS{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[TE(e,"open",this.onopen.bind(this)),TE(e,"packet",this.onpacket.bind(this)),TE(e,"error",this.onerror.bind(this)),TE(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io["_reconnecting"]||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ME.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:CE.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,o=this.flags.volatile&&(!r||!this.connected);return o||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"===typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;const o=null!==e;return o?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:CE.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){const t=e.nsp===this.nsp;if(t)switch(e.type){case CE.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case CE.EVENT:case CE.BINARY_EVENT:this.onevent(e);break;case CE.ACK:case CE.BINARY_ACK:this.onack(e);break;case CE.DISCONNECT:this.ondisconnect();break;case CE.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t);break}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"===typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:CE.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"===typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io["_destroy"](this)}disconnect(){return this.connected&&this.packet({type:CE.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function IE(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}IE.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},IE.prototype.reset=function(){this.attempts=0},IE.prototype.setMin=function(e){this.ms=e},IE.prototype.setMax=function(e){this.max=e},IE.prototype.setJitter=function(e){this.jitter=e};class OE extends bS{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"===typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,SS(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new IE({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const o=t.parser||n;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new cE(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=TE(t,"open",(function(){n.onopen(),e&&e()})),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=TE(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),o(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(TE(e,"ping",this.onping.bind(this)),TE(e,"data",this.ondata.bind(this)),TE(e,"error",this.onerror.bind(this)),TE(e,"close",this.onclose.bind(this)),TE(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){YS((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new PE(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){const e=this.nsps[n];if(e.active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const DE={};function NE(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};const n=lE(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=DE[o]&&i in DE[o]["nsps"],a=t.forceNew||t["force new connection"]||!1===t.multiplex||s;let c;return a?c=new OE(r,t):(DE[o]||(DE[o]=new OE(r,t)),c=DE[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(NE,{Manager:OE,Socket:PE,io:NE,connect:NE});const RE=()=>new Map,BE=e=>{const t=RE();return e.forEach(((e,n)=>{t.set(n,e)})),t},LE=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},jE=(e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n},FE=(e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1},zE=()=>new Set,UE=e=>e[e.length-1],qE=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},VE=Array.from,HE=Array.isArray;class WE{constructor(){this._observers=RE()}on(e,t){LE(this._observers,e,zE).add(t)}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return VE((this._observers.get(e)||RE()).values()).forEach((e=>e(...t)))}destroy(){this._observers=RE()}}const GE=Math.floor,$E=(Math.ceil,Math.abs),XE=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),YE=(e,t)=>e>t?e:t,JE=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),ZE=String.fromCharCode,KE=(String.fromCodePoint,ZE(65535),e=>e.toLowerCase()),QE=/^\s*/g,eA=e=>e.replace(QE,""),tA=/([A-Z])/g,nA=(e,t)=>eA(e.replace(tA,(e=>`${t}${KE(e)}`))),rA=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.codePointAt(o);return r},oA="undefined"!==typeof TextEncoder?new TextEncoder:null,iA=e=>oA.encode(e),sA=oA?iA:rA;let aA="undefined"===typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});aA&&1===aA.decode(new Uint8Array).length&&(aA=null);const cA=e=>void 0===e?null:e;class lA{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let dA=new lA,uA=!0;try{"undefined"!==typeof localStorage&&(dA=localStorage,uA=!1)}catch(zO){}const hA=dA,pA=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&pA(e,t,n+1)}},fA=e=>e,mA=(e,t)=>t.includes(e),gA="undefined"!==typeof process&&process.release&&/node|io\.js/.test(process.release.name);"undefined"!==typeof navigator&&/Mac/.test(navigator.platform);let vA;const bA=[],yA=()=>{if(void 0===vA)if(gA){vA=RE();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];"-"===r[0]?(null!==t&&vA.set(t,""),t=r):null!==t?(vA.set(t,r),t=null):bA.push(r)}null!==t&&vA.set(t,"")}else"object"===typeof location?(vA=RE(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");vA.set(`--${nA(t,"-")}`,n),vA.set(`-${nA(t,"-")}`,n)}}))):vA=RE();return vA},wA=e=>yA().has(e),xA=e=>cA(gA?{VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}[e.toUpperCase()]:hA.getItem(e)),kA=e=>wA("--"+e)||null!==xA(e),CA=(kA("production"),gA&&mA({VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}.FORCE_COLOR,["true","1","2"])),SA=!wA("no-colors")&&(!gA||process.stdout.isTTY||CA)&&(!gA||wA("color")||CA||null!==xA("COLORTERM")||(xA("TERM")||"").includes("color")),EA=e=>new Uint8Array(e),AA=(e,t,n)=>new Uint8Array(e,t,n),_A=e=>{const t=EA(e.byteLength);return t.set(e),t},TA=1,MA=2,PA=4,IA=8,OA=32,DA=64,NA=128,RA=31,BA=63,LA=127,jA=2147483647,FA=Number.MAX_SAFE_INTEGER,zA=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"===typeof e&&isFinite(e)&&GE(e)===e));Number.isNaN,Number.parseInt;class UA{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const qA=()=>new UA,VA=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},HA=e=>{const t=new Uint8Array(VA(e));let n=0;for(let r=0;r<e.bufs.length;r++){const o=e.bufs[r];t.set(o,n),n+=o.length}return t.set(AA(e.cbuf.buffer,0,e.cpos),n),t},WA=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(AA(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*YE(n,t)),e.cpos=0)},GA=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},$A=GA,XA=(e,t)=>{while(t>LA)GA(e,NA|LA&t),t=GE(t/128);GA(e,LA&t)},YA=(e,t)=>{const n=JE(t);n&&(t=-t),GA(e,(t>BA?NA:0)|(n?DA:0)|BA&t),t=GE(t/64);while(t>0)GA(e,(t>LA?NA:0)|LA&t),t=GE(t/128)},JA=new Uint8Array(3e4),ZA=JA.length/3,KA=(e,t)=>{if(t.length<ZA){const n=oA.encodeInto(t,JA).written||0;XA(e,n);for(let t=0;t<n;t++)GA(e,JA[t])}else n_(e,sA(t))},QA=(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;XA(e,r);for(let o=0;o<r;o++)GA(e,n.codePointAt(o))},e_=oA&&oA.encodeInto?KA:QA,t_=(e,t)=>{const n=e.cbuf.length,r=e.cpos,o=XE(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(YE(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},n_=(e,t)=>{XA(e,t.byteLength),t_(e,t)},r_=(e,t)=>{WA(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},o_=(e,t)=>r_(e,4).setFloat32(0,t,!1),i_=(e,t)=>r_(e,8).setFloat64(0,t,!1),s_=(e,t)=>r_(e,8).setBigInt64(0,t,!1),a_=new DataView(new ArrayBuffer(4)),c_=e=>(a_.setFloat32(0,e),a_.getFloat32(0)===e),l_=(e,t)=>{switch(typeof t){case"string":GA(e,119),e_(e,t);break;case"number":zA(t)&&$E(t)<=jA?(GA(e,125),YA(e,t)):c_(t)?(GA(e,124),o_(e,t)):(GA(e,123),i_(e,t));break;case"bigint":GA(e,122),s_(e,t);break;case"object":if(null===t)GA(e,126);else if(HE(t)){GA(e,117),XA(e,t.length);for(let n=0;n<t.length;n++)l_(e,t[n])}else if(t instanceof Uint8Array)GA(e,116),n_(e,t);else{GA(e,118);const n=Object.keys(t);XA(e,n.length);for(let r=0;r<n.length;r++){const o=n[r];e_(e,o),l_(e,t[o])}}break;case"boolean":GA(e,t?120:121);break;default:GA(e,127)}};class d_ extends UA{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&XA(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const u_=e=>{e.count>0&&(YA(e.encoder,1===e.count?e.s:-e.s),e.count>1&&XA(e.encoder,e.count-2))};class h_{constructor(){this.encoder=new UA,this.s=0,this.count=0}write(e){this.s===e?this.count++:(u_(this),this.count=1,this.s=e)}toUint8Array(){return u_(this),HA(this.encoder)}}const p_=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);YA(e.encoder,t),e.count>1&&XA(e.encoder,e.count-2)}};class f_{constructor(){this.encoder=new UA,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(p_(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return p_(this),HA(this.encoder)}}class m_{constructor(){this.sarr=[],this.s="",this.lensE=new h_}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new UA;return this.sarr.push(this.s),this.s="",e_(e,this.sarr.join("")),t_(e,this.lensE.toUint8Array()),HA(e)}}const g_=e=>new Error(e),v_=()=>{throw g_("Method unimplemented")},b_=()=>{throw g_("Unexpected case")},y_=g_("Unexpected end of array"),w_=g_("Integer out of Range");class x_{constructor(e){this.arr=e,this.pos=0}}const k_=e=>new x_(e),C_=e=>e.pos!==e.arr.length,S_=(e,t)=>{const n=AA(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},E_=e=>S_(e,__(e)),A_=e=>e.arr[e.pos++],__=e=>{let t=0,n=1;const r=e.arr.length;while(e.pos<r){const r=e.arr[e.pos++];if(t+=(r&LA)*n,n*=128,r<NA)return t;if(t>FA)throw w_}throw y_},T_=e=>{let t=e.arr[e.pos++],n=t&BA,r=64;const o=(t&DA)>0?-1:1;if(0===(t&NA))return o*n;const i=e.arr.length;while(e.pos<i){if(t=e.arr[e.pos++],n+=(t&LA)*r,r*=128,t<NA)return o*n;if(n>FA)throw w_}throw y_},M_=e=>{let t=__(e);if(0===t)return"";{let n=String.fromCodePoint(A_(e));if(--t<100)while(t--)n+=String.fromCodePoint(A_(e));else while(t>0){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},P_=e=>aA.decode(E_(e)),I_=aA?P_:M_,O_=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},D_=e=>O_(e,4).getFloat32(0,!1),N_=e=>O_(e,8).getFloat64(0,!1),R_=e=>O_(e,8).getBigInt64(0,!1),B_=[e=>{},e=>null,T_,D_,N_,R_,e=>!1,e=>!0,I_,e=>{const t=__(e),n={};for(let r=0;r<t;r++){const t=I_(e);n[t]=L_(e)}return n},e=>{const t=__(e),n=[];for(let r=0;r<t;r++)n.push(L_(e));return n},E_],L_=e=>B_[127-A_(e)](e);class j_ extends x_{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),C_(this)?this.count=__(this)+1:this.count=-1),this.count--,this.s}}class F_ extends x_{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=T_(this);const e=JE(this.s);this.count=1,e&&(this.s=-this.s,this.count=__(this)+2)}return this.count--,this.s}}class z_ extends x_{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=T_(this),t=1&e;this.diff=GE(e/2),this.count=1,t&&(this.count=__(this)+2)}return this.s+=this.diff,this.count--,this.s}}class U_{constructor(e){this.decoder=new F_(e),this.str=I_(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const q_=crypto.getRandomValues.bind(crypto),V_=(Math.random,()=>q_(new Uint32Array(1))[0]),H_=[1e7]+-1e3+-4e3+-8e3+-1e11,W_=()=>H_.replace(/[018]/g,(e=>(e^V_()&15>>e/4).toString(16))),G_=e=>new Promise(e);Promise.all.bind(Promise);class $_{constructor(e,t){this.left=e,this.right=t}}const X_=(e,t)=>new $_(e,t),Y_="undefined"!==typeof document?document:{},J_=("undefined"!==typeof DOMParser&&new DOMParser,e=>jE(e,((e,t)=>`${t}:${e};`)).join("")),Z_=(Y_.ELEMENT_NODE,Y_.TEXT_NODE,Y_.CDATA_SECTION_NODE,Y_.COMMENT_NODE,Y_.DOCUMENT_NODE,Y_.DOCUMENT_TYPE_NODE,Y_.DOCUMENT_FRAGMENT_NODE,Symbol),K_=Date.now,Q_=Z_(),eT=Z_(),tT=Z_(),nT=Z_(),rT=Z_(),oT=Z_(),iT=Z_(),sT=Z_(),aT=Z_(),cT=e=>{const t=[],n=[];let r=0;for(;r<e.length;r++){const o=e[r];o.constructor===String||o.constructor===Number?t.push(o):o.constructor===Object&&n.push(JSON.stringify(o))}return n};K_();const lT={[Q_]:X_("font-weight","bold"),[eT]:X_("font-weight","normal"),[tT]:X_("color","blue"),[rT]:X_("color","green"),[nT]:X_("color","grey"),[oT]:X_("color","red"),[iT]:X_("color","purple"),[sT]:X_("color","orange"),[aT]:X_("color","black")},dT=e=>{const t=[],n=[],r=RE();let o=[],i=0;for(;i<e.length;i++){const o=e[i],s=lT[o];if(void 0!==s)r.set(s.left,s.right);else{if(o.constructor!==String&&o.constructor!==Number)break;{const e=J_(r);i>0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||o.push(t)}return o},uT=SA?dT:cT,hT=(...e)=>{console.log(...uT(e)),pT.forEach((t=>t.print(e)))},pT=zE();const fT=e=>({[Symbol.iterator](){return this},next:e}),mT=(e,t)=>fT((()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n})),gT=(e,t)=>fT((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})),vT=Object.assign,bT=Object.keys,yT=(e,t)=>{for(const n in e)t(e[n],n)},wT=e=>bT(e).length,xT=e=>{for(const t in e)return!1;return!0},kT=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},CT=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ST=(e,t)=>e===t||wT(e)===wT(t)&&kT(e,((e,n)=>(void 0!==e||CT(t,n))&&t[n]===e));class ET{constructor(e,t){this.clock=e,this.len=t}}class AT{constructor(){this.clients=new Map}}const _T=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let i=0;i<t.length;i++){const r=t[i];IM(e,o,r.clock,r.len,n)}})),TT=(e,t)=>{let n=0,r=e.length-1;while(n<=r){const o=GE((n+r)/2),i=e[o],s=i.clock;if(s<=t){if(t<s+i.len)return o;n=o+1}else r=o-1}return null},MT=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==TT(n,t.clock)},PT=e=>{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t<e.length;t++){const r=e[n-1],o=e[t];r.clock+r.len>=o.clock?r.len=YE(r.len,o.clock+o.len-r.clock):(n<t&&(e[n]=o),n++)}e.length=n}))},IT=e=>{const t=new AT;for(let n=0;n<e.length;n++)e[n].clients.forEach(((r,o)=>{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;t<e.length;t++)qE(i,e[t].clients.get(o)||[]);t.clients.set(o,i)}}));return PT(t),t},OT=(e,t,n,r)=>{LE(e.clients,t,(()=>[])).push(new ET(n,r))},DT=()=>new AT,NT=e=>{const t=DT();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const o=n.id.clock;let i=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])i+=n.length;r.push(new ET(o,i))}}r.length>0&&t.clients.set(n,r)})),t},RT=(e,t)=>{XA(e.restEncoder,t.clients.size),VE(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),XA(e.restEncoder,t);const r=n.length;XA(e.restEncoder,r);for(let o=0;o<r;o++){const t=n[o];e.writeDsClock(t.clock),e.writeDsLen(t.len)}}))},BT=e=>{const t=new AT,n=__(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();const n=__(e.restDecoder),r=__(e.restDecoder);if(r>0){const o=LE(t.clients,n,(()=>[]));for(let t=0;t<r;t++)o.push(new ET(e.readDsClock(),e.readDsLen()))}}return t},LT=(e,t,n)=>{const r=new AT,o=__(e.restDecoder);for(let i=0;i<o;i++){e.resetDsCurVal();const o=__(e.restDecoder),i=__(e.restDecoder),s=n.clients.get(o)||[],a=kM(n,o);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<a){a<i&&OT(r,o,a,i-a);let e=SM(s,n),c=s[e];!c.deleted&&c.id.clock<n&&(s.splice(e+1,0,jI(t,c,n-c.id.clock)),e++);while(e<s.length){if(c=s[e++],!(c.id.clock<i))break;c.deleted||(i<c.id.clock+c.length&&s.splice(e,0,jI(t,c,i-c.id.clock)),c.delete(t))}}else OT(r,o,n,i-n)}}if(r.clients.size>0){const e=new $T;return XA(e.restEncoder,0),RT(e,r),e.toUint8Array()}return null},jT=V_;class FT extends WE{constructor({guid:e=W_(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=jT(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new wM,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=G_((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>G_((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isLoaded||this.emit("load",[])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||FM(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(VE(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return FM(this,e,t)}get(e,t=dP){const n=LE(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==dP&&r!==t){if(r===dP){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,MP)}getText(e=""){return this.get(e,JP)}getMap(e=""){return this.get(e,OP)}getXmlFragment(e=""){return this.get(e,QP)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){VE(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new FT({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,FM(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class zT{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return __(this.restDecoder)}readDsLen(){return __(this.restDecoder)}}class UT extends zT{readLeftID(){return fM(__(this.restDecoder),__(this.restDecoder))}readRightID(){return fM(__(this.restDecoder),__(this.restDecoder))}readClient(){return __(this.restDecoder)}readInfo(){return A_(this.restDecoder)}readString(){return I_(this.restDecoder)}readParentInfo(){return 1===__(this.restDecoder)}readTypeRef(){return __(this.restDecoder)}readLen(){return __(this.restDecoder)}readAny(){return L_(this.restDecoder)}readBuf(){return _A(E_(this.restDecoder))}readJSON(){return JSON.parse(I_(this.restDecoder))}readKey(){return I_(this.restDecoder)}}class qT{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=__(this.restDecoder),this.dsCurrVal}readDsLen(){const e=__(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class VT extends qT{constructor(e){super(e),this.keys=[],__(e),this.keyClockDecoder=new z_(E_(e)),this.clientDecoder=new F_(E_(e)),this.leftClockDecoder=new z_(E_(e)),this.rightClockDecoder=new z_(E_(e)),this.infoDecoder=new j_(E_(e),A_),this.stringDecoder=new U_(E_(e)),this.parentInfoDecoder=new j_(E_(e),A_),this.typeRefDecoder=new F_(E_(e)),this.lenDecoder=new F_(E_(e))}readLeftID(){return new hM(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new hM(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return L_(this.restDecoder)}readBuf(){return E_(this.restDecoder)}readJSON(){return L_(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class HT{constructor(){this.restEncoder=qA()}toUint8Array(){return HA(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){XA(this.restEncoder,e)}writeDsLen(e){XA(this.restEncoder,e)}}class WT extends HT{writeLeftID(e){XA(this.restEncoder,e.client),XA(this.restEncoder,e.clock)}writeRightID(e){XA(this.restEncoder,e.client),XA(this.restEncoder,e.clock)}writeClient(e){XA(this.restEncoder,e)}writeInfo(e){$A(this.restEncoder,e)}writeString(e){e_(this.restEncoder,e)}writeParentInfo(e){XA(this.restEncoder,e?1:0)}writeTypeRef(e){XA(this.restEncoder,e)}writeLen(e){XA(this.restEncoder,e)}writeAny(e){l_(this.restEncoder,e)}writeBuf(e){n_(this.restEncoder,e)}writeJSON(e){e_(this.restEncoder,JSON.stringify(e))}writeKey(e){e_(this.restEncoder,e)}}class GT{constructor(){this.restEncoder=qA(),this.dsCurrVal=0}toUint8Array(){return HA(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,XA(this.restEncoder,t)}writeDsLen(e){0===e&&b_(),XA(this.restEncoder,e-1),this.dsCurrVal+=e}}class $T extends GT{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new f_,this.clientEncoder=new h_,this.leftClockEncoder=new f_,this.rightClockEncoder=new f_,this.infoEncoder=new d_($A),this.stringEncoder=new m_,this.parentInfoEncoder=new d_($A),this.typeRefEncoder=new h_,this.lenEncoder=new h_}toUint8Array(){const e=qA();return XA(e,0),n_(e,this.keyClockEncoder.toUint8Array()),n_(e,this.clientEncoder.toUint8Array()),n_(e,this.leftClockEncoder.toUint8Array()),n_(e,this.rightClockEncoder.toUint8Array()),n_(e,HA(this.infoEncoder)),n_(e,this.stringEncoder.toUint8Array()),n_(e,HA(this.parentInfoEncoder)),n_(e,this.typeRefEncoder.toUint8Array()),n_(e,this.lenEncoder.toUint8Array()),t_(e,HA(this.restEncoder)),HA(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){l_(this.restEncoder,e)}writeBuf(e){n_(this.restEncoder,e)}writeJSON(e){l_(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const XT=(e,t,n,r)=>{r=YE(r,t[0].id.clock);const o=SM(t,r);XA(e.restEncoder,t.length-o),e.writeClient(n),XA(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let s=o+1;s<t.length;s++)t[s].write(e,0)},YT=(e,t,n)=>{const r=new Map;n.forEach(((e,n)=>{kM(t,n)>e&&r.set(n,e)})),xM(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),XA(e.restEncoder,r.size),VE(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{XT(e,t.clients.get(n),n,r)}))},JT=(e,t)=>{const n=RE(),r=__(e.restDecoder);for(let o=0;o<r;o++){const r=__(e.restDecoder),o=new Array(r),i=e.readClient();let s=__(e.restDecoder);n.set(i,{i:0,refs:o});for(let n=0;n<r;n++){const r=e.readInfo();switch(RA&r){case 0:{const t=e.readLen();o[n]=new dI(fM(i,s),t),s+=t;break}case 10:{const t=__(e.restDecoder);o[n]=new VI(fM(i,s),t),s+=t;break}default:{const a=0===(r&(DA|NA)),c=new FI(fM(i,s),null,(r&NA)===NA?e.readLeftID():null,null,(r&DA)===DA?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,a&&(r&OA)===OA?e.readString():null,zI(e,r));o[n]=c,s+=c.length}}}}return n},ZT=(e,t,n)=>{const r=[];let o=VE(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);while(e.refs.length===e.i){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let s=i();if(null===s&&0===r.length)return null;const a=new wM,c=new Map,l=(e,t)=>{const n=c.get(e);(null==n||n>t)&&c.set(e,t)};let d=s.refs[s.i++];const u=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};while(1){if(d.constructor!==VI){const o=LE(u,d.id.client,(()=>kM(t,d.id.client))),i=o-d.id.clock;if(i<0)r.push(d),l(d.id.client,d.id.clock-1),h();else{const o=d.getMissing(e,t);if(null!==o){r.push(d);const e=n.get(o)||{refs:[],i:0};if(e.refs.length!==e.i){d=e.refs[e.i++];continue}l(o,kM(t,o)),h()}else(0===i||i<d.length)&&(d.integrate(e,i),u.set(d.id.client,d.id.clock+d.length))}}if(r.length>0)d=r.pop();else if(null!==s&&s.i<s.refs.length)d=s.refs[s.i++];else{if(s=i(),null===s)break;d=s.refs[s.i++]}}if(a.clients.size>0){const e=new $T;return YT(e,a,new Map),XA(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},KT=(e,t)=>YT(e,t.doc.store,t.beforeState),QT=(e,t,n,r=new VT(e))=>FM(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=JT(r,n),s=ZT(e,o,i),a=o.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<kM(o,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const n=a.missing.get(e);(null==n||n>t)&&a.missing.set(e,t)}a.update=WM([a.update,s.update])}}else o.pendingStructs=s;const c=LT(r,e,o);if(o.pendingDs){const t=new VT(k_(o.pendingDs));__(t.restDecoder);const n=LT(t,e,o);o.pendingDs=c&&n?WM([c,n]):c||n}else o.pendingDs=c;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,eM(e.doc,t)}}),n,!1),eM=(e,t,n,r=VT)=>{const o=k_(t);QT(o,e,n,new r(o))},tM=(e,t,n)=>eM(e,t,n,UT),nM=(e,t,n=new Map)=>{YT(e,t.store,n),RT(e,NT(t.store))},rM=(e,t=new Uint8Array([0]),n=new $T)=>{const r=sM(t);nM(n,e,r);const o=[n.toUint8Array()];if(e.store.pendingDs&&o.push(e.store.pendingDs),e.store.pendingStructs&&o.push(GM(e.store.pendingStructs.update,t)),o.length>1){if(n.constructor===WT)return VM(o.map(((e,t)=>0===t?e:ZM(e))));if(n.constructor===$T)return WM(o)}return o[0]},oM=(e,t)=>rM(e,t,new WT),iM=e=>{const t=new Map,n=__(e.restDecoder);for(let r=0;r<n;r++){const n=__(e.restDecoder),r=__(e.restDecoder);t.set(n,r)}return t},sM=e=>iM(new zT(k_(e)));class aM{constructor(){this.l=[]}}const cM=()=>new aM,lM=(e,t)=>e.l.push(t),dM=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},uM=(e,t,n)=>pA(e.l,[t,n]);class hM{constructor(e,t){this.client=e,this.clock=t}}const pM=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,fM=(e,t)=>new hM(e,t),mM=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw b_()};class gM{constructor(e,t){this.ds=e,this.sv=t}}const vM=(e,t)=>new gM(e,t),bM=(vM(DT(),new Map),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!MT(t.ds,e.id)),yM=(e,t)=>{const n=LE(e.meta,yM,zE),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<kM(r,n)&&TM(e,fM(n,t))})),_T(e,t.ds,(e=>{})),n.add(t))};class wM{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const xM=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},kM=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},CM=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw b_()}n.push(t)},SM=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let s=GE(t/(i+o.length-1)*r);while(n<=r){if(o=e[s],i=o.id.clock,i<=t){if(t<i+o.length)return s;n=s+1}else r=s-1;s=GE((n+r)/2)}throw b_()},EM=(e,t)=>{const n=e.clients.get(t.client);return n[SM(n,t.clock)]},AM=EM,_M=(e,t,n)=>{const r=SM(t,n),o=t[r];return o.id.clock<n&&o instanceof FI?(t.splice(r+1,0,jI(e,o,n-o.id.clock)),r+1):r},TM=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[_M(e,n,t.clock)]},MM=(e,t,n)=>{const r=t.clients.get(n.client),o=SM(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==dI&&r.splice(o+1,0,jI(e,i,n.clock-i.id.clock+1)),i},PM=(e,t,n)=>{const r=e.clients.get(t.id.client);r[SM(r,t.id.clock)]=n},IM=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=_M(e,t,n);do{s=t[a++],i<s.id.clock+s.length&&_M(e,t,i),o(s)}while(a<t.length&&t[a].id.clock<i)};class OM{constructor(e,t,n){this.doc=e,this.deleteSet=new AT,this.beforeState=xM(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const DM=(e,t)=>!(0===t.deleteSet.clients.size&&!FE(t.afterState,((e,n)=>t.beforeState.get(n)!==e)))&&(PT(t.deleteSet),KT(e,t),RT(e,t.deleteSet),!0),NM=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&LE(e.changed,t,zE).add(n)},RM=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0;n=r,r=e[--o-1]){if(r.deleted!==n.deleted||r.constructor!==n.constructor||!r.mergeWith(n))break;n instanceof FI&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r)}const i=t-o;return i&&e.splice(t+1-i,i),i},BM=(e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=SM(e,i.clock),o=e[r];r<e.length&&o.id.clock<s;o=e[++r]){const o=e[r];if(i.clock+i.len<=o.id.clock)break;o instanceof FI&&o.deleted&&!o.keep&&n(o)&&o.gc(t,!1)}}}},LM=(e,t)=>{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t],o=XE(r.length-1,1+SM(r,n.clock+n.len-1));for(let e=o,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+RM(r,e)}}))},jM=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{PT(i),n.afterState=xM(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const e=[];n.changed.forEach(((t,r)=>e.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&(e=e.filter((e=>null===e.target._item||!e.target._item.deleted)),e.forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),uM(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),pA(e,[]),n._needFormattingCleanup&&$P(n)}finally{r.gc&&BM(i,o,r.gcFilter),LM(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=YE(SM(e,r),1);for(let t=e.length-1;t>=n;)t-=1+RM(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=o.clients.get(t),i=SM(r,n);i+1<r.length&&RM(r,i+1)>1||i>0&&RM(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(hT(sT,Q_,"[yjs] ",eT,oT,"Changed the client-id because another client seems to be using it."),r.clientID=jT()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new WT,t=DM(e,n);t&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new $T,t=DM(e,n);t&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:c,subdocsRemoved:l}=n;(a.size>0||l.size>0||c.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),l.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:c,added:a,removed:l},r,n]),l.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):jM(e,t+1)}}},FM=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new OM(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&jM(o,0)}}return s};function*zM(e){const t=__(e.restDecoder);for(let n=0;n<t;n++){const t=__(e.restDecoder),n=e.readClient();let r=__(e.restDecoder);for(let o=0;o<t;o++){const t=e.readInfo();if(10===t){const t=__(e.restDecoder);yield new VI(fM(n,r),t),r+=t}else if(0!==(RA&t)){const o=0===(t&(DA|NA)),i=new FI(fM(n,r),null,(t&NA)===NA?e.readLeftID():null,null,(t&DA)===DA?e.readRightID():null,o?e.readParentInfo()?e.readString():e.readLeftID():null,o&&(t&OA)===OA?e.readString():null,zI(e,t));yield i,r+=i.length}else{const t=e.readLen();yield new dI(fM(n,r),t),r+=t}}}}class UM{constructor(e,t){this.gen=zM(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===VI);return this.curr}}class qM{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const VM=e=>WM(e,UT,WT),HM=(e,t)=>{if(e.constructor===dI){const{client:n,clock:r}=e.id;return new dI(fM(n,r+t),e.length-t)}if(e.constructor===VI){const{client:n,clock:r}=e.id;return new VI(fM(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new FI(fM(r,o+t),null,fM(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},WM=(e,t=VT,n=$T)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(k_(e))));let o=r.map((e=>new UM(e,!0))),i=null;const s=new n,a=new qM(s);while(1){if(o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===VI?1:-1:n}return t.curr.id.client-e.curr.id.client})),0===o.length)break;const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;while(null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)XM(a,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length<n.id.clock)if(i.struct.constructor===VI)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{XM(a,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length,r=new VI(fM(t,i.struct.id.clock+i.struct.length),e);i={struct:r,offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===VI?i.struct.length-=t:n=HM(n,t)),i.struct.mergeWith(n)||(XM(a,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==VI;n=e.next())XM(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(XM(a,i.struct,i.offset),i=null),YM(a);const c=r.map((e=>BT(e))),l=IT(c);return RT(s,l),s.toUint8Array()},GM=(e,t,n=VT,r=$T)=>{const o=sM(t),i=new r,s=new qM(i),a=new n(k_(e)),c=new UM(a,!1);while(c.curr){const e=c.curr,t=e.id.client,n=o.get(t)||0;if(c.curr.constructor!==VI)if(e.id.clock+e.length>n){XM(s,e,YE(n-e.id.clock,0)),c.next();while(c.curr&&c.curr.id.client===t)XM(s,c.curr,0),c.next()}else while(c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n)c.next();else c.next()}YM(s);const l=BT(a);return RT(i,l),i.toUint8Array()},$M=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:HA(e.encoder.restEncoder)}),e.encoder.restEncoder=qA(),e.written=0)},XM=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&$M(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),XA(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},YM=e=>{$M(e);const t=e.encoder.restEncoder;XA(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const r=e.clientStructs[n];XA(t,r.written),t_(t,r.restEncoder)}},JM=(e,t,n,r)=>{const o=new n(k_(e)),i=new UM(o,!1),s=new r,a=new qM(s);for(let l=i.curr;null!==l;l=i.next())XM(a,t(l),0);YM(a);const c=BT(o);return RT(s,c),s.toUint8Array()},ZM=e=>JM(e,fA,VT,WT),KM="You must not compute changes after the event-handler fired.";class QM{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=eP(this.currentTarget,this.target))}deletes(e){return MT(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw g_(KM);const e=new Map,t=this.target,n=this.transaction.changed.get(t);n.forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;while(null!==e&&this.adds(e))e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=UE(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=UE(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=UE(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw g_(KM);const t=this.target,n=zE(),r=zE(),o=[];e={added:n,deleted:r,delta:o,keys:this.keys};const i=this.transaction.changed.get(t);if(i.has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const eP=(e,t)=>{const n=[];while(null!==t._item&&t!==e){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;while(r!==t._item&&null!==r)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n},tP=80;let nP=0;class rP{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=nP++}}const oP=e=>{e.timestamp=nP++},iP=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=nP++},sP=(e,t,n)=>{if(e.length>=tP){const r=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return iP(r,t,n),r}{const r=new rP(t,n);return e.push(r),r}},aP=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>$E(t-e.index)<$E(t-n.index)?e:n));let r=e._start,o=0;null!==n&&(r=n.p,o=n.index,oP(n));while(null!==r.right&&o<t){if(!r.deleted&&r.countable){if(t<o+r.length)break;o+=r.length}r=r.right}while(null!==r.left&&o>t)r=r.left,!r.deleted&&r.countable&&(o-=r.length);while(null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&$E(n.index-o)<r.parent.length/tP?(iP(n,r,o),n):sP(e._searchMarker,r,o)},cP=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;t.marker=!1;while(t&&(t.deleted||!t.countable))t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t<o.index||n>0&&t===o.index)&&(o.index=YE(t,o.index+n))}},lP=(e,t,n)=>{const r=e,o=t.changedParentTypes;while(1){if(LE(o,e,(()=>[])).push(n),null===e._item)break;e=e._item.parent}uM(r._eH,n,t)};class dP{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=cM(),this._dEH=cM(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw v_()}clone(){throw v_()}_write(e){}get _first(){let e=this._start;while(null!==e&&e.deleted)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){lM(this._eH,e)}observeDeep(e){lM(this._dEH,e)}unobserve(e){dM(this._eH,e)}unobserveDeep(e){dM(this._dEH,e)}toJSON(){}}const uP=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;while(null!==i&&r>0){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},hP=e=>{const t=[];let n=e._start;while(null!==n){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},pP=(e,t)=>{let n=0,r=e._start;while(null!==r){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r<o.length;r++)t(o[r],n++,e)}r=r.right}},fP=(e,t)=>{const n=[];return pP(e,((r,o)=>{n.push(t(r,o,e))})),n},mP=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){while(null!==t&&t.deleted)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},gP=(e,t)=>{const n=aP(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},vP=(e,t,n,r)=>{let o=n;const i=e.doc,s=i.clientID,a=i.store,c=null===n?t._start:n.right;let l=[];const d=()=>{l.length>0&&(o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new SI(l)),o.integrate(e,0),l=[])};r.forEach((n=>{if(null===n)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(d(),n.constructor){case Uint8Array:case ArrayBuffer:o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new uI(new Uint8Array(n))),o.integrate(e,0);break;case FT:o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new gI(n)),o.integrate(e,0);break;default:if(!(n instanceof dP))throw new Error("Unexpected content type in insert operation");o=new FI(fM(s,kM(a,s)),o,o&&o.lastId,c,c&&c.id,t,null,new BI(n)),o.integrate(e,0)}}})),d()},bP=g_("Length exceeded!"),yP=(e,t,n,r)=>{if(n>t._length)throw bP;if(0===n)return t._searchMarker&&cP(t._searchMarker,n,r.length),vP(e,t,null,r);const o=n,i=aP(t,n);let s=t._start;for(null!==i&&(s=i.p,n-=i.index,0===n&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&TM(e,fM(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&cP(t._searchMarker,o,r.length),vP(e,t,s,r)},wP=(e,t,n)=>{const r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start});let o=r.p;if(o)while(o.right)o=o.right;return vP(e,t,o,n)},xP=(e,t,n,r)=>{if(0===r)return;const o=n,i=r,s=aP(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&TM(e,fM(a.id.client,a.id.clock+n)),n-=a.length);while(r>0&&null!==a)a.deleted||(r<a.length&&TM(e,fM(a.id.client,a.id.clock+r)),a.delete(e),r-=a.length),a=a.right;if(r>0)throw bP;t._searchMarker&&cP(t._searchMarker,o,-i+r)},kP=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},CP=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==r)a=new SI([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new SI([r]);break;case Uint8Array:a=new uI(r);break;case FT:a=new gI(r);break;default:if(!(r instanceof dP))throw new Error("Unexpected content type");a=new BI(r)}new FI(fM(s,kM(i.store,s)),o,o&&o.lastId,null,null,t,n,a).integrate(e,0)},SP=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},EP=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},AP=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},_P=e=>mT(e.entries(),(e=>!e[1].deleted));class TP extends QM{constructor(e,t){super(e,t),this._transaction=t}}class MP extends dP{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new MP;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new MP}clone(){const e=new MP;return e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),lP(this,e,new TP(this,e))}insert(e,t){null!==this.doc?FM(this.doc,(n=>{yP(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?FM(this.doc,(t=>{wP(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?FM(this.doc,(n=>{xP(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return gP(this,e)}toArray(){return hP(this)}slice(e=0,t=this.length){return uP(this,e,t)}toJSON(){return this.map((e=>e instanceof dP?e.toJSON():e))}map(e){return fP(this,e)}forEach(e){pP(this,e)}[Symbol.iterator](){return mP(this)}_write(e){e.writeTypeRef(MI)}}const PP=e=>new MP;class IP extends QM{constructor(e,t,n){super(e,t),this.keysChanged=n}}class OP extends dP{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new OP}clone(){const e=new OP;return this.forEach(((t,n)=>{e.set(n,t instanceof dP?t.clone():t)})),e}_callObserver(e,t){lP(this,e,new IP(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof dP?r.toJSON():r}})),e}get size(){return[..._P(this._map)].length}keys(){return gT(_P(this._map),(e=>e[0]))}values(){return gT(_P(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return gT(_P(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return SP(this,e)}has(e){return AP(this,e)}clear(){null!==this.doc?FM(this.doc,(e=>{this.forEach((function(t,n,r){kP(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(PI)}}const DP=e=>new OP,NP=(e,t)=>e===t||"object"===typeof e&&"object"===typeof t&&e&&t&&ST(e,t);class RP{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(null===this.right&&b_(),this.right.content.constructor){case wI:this.right.deleted||FP(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const BP=(e,t,n)=>{while(null!==t.right&&n>0){switch(t.right.content.constructor){case wI:t.right.deleted||FP(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&TM(e,fM(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},LP=(e,t,n)=>{const r=new Map,o=aP(t,n);if(o){const t=new RP(o.p.left,o.p,o.index,r);return BP(e,t,n-o.index)}{const o=new RP(null,t._start,0,r);return BP(e,o,n)}},jP=(e,t,n,r)=>{while(null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===wI&&NP(r.get(n.right.content.key),n.right.content.value)))n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,s)=>{const a=n.left,c=n.right,l=new FI(fM(i,kM(o.store,i)),a,a&&a.lastId,c,c&&c.id,t,null,new wI(s,r));l.integrate(e,0),n.right=l,n.forward()}))},FP=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},zP=(e,t)=>{while(1){if(null===e.right)break;if(!(e.right.deleted||e.right.content.constructor===wI&&NP(t[e.right.content.key]||null,e.right.content.value)))break;e.forward()}},UP=(e,t,n,r)=>{const o=e.doc,i=o.clientID,s=new Map;for(const a in r){const c=r[a],l=n.currentAttributes.get(a)||null;if(!NP(l,c)){s.set(a,l);const{left:r,right:d}=n;n.right=new FI(fM(i,kM(o.store,i)),r,r&&r.lastId,d,d&&d.id,t,null,new wI(a,c)),n.right.integrate(e,0),n.forward()}}return s},qP=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,s=i.clientID;zP(n,o);const a=UP(e,t,n,o),c=r.constructor===String?new AI(r):r instanceof dP?new BI(r):new bI(r);let{left:l,right:d,index:u}=n;t._searchMarker&&cP(t._searchMarker,n.index,c.getLength()),d=new FI(fM(s,kM(i.store,s)),l,l&&l.lastId,d,d&&d.id,t,null,c),d.integrate(e,0),n.right=d,n.index=u,n.forward(),jP(e,t,n,a)},VP=(e,t,n,r,o)=>{const i=e.doc,s=i.clientID;zP(n,o);const a=UP(e,t,n,o);e:while(null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===wI))){if(!n.right.deleted)switch(n.right.content.constructor){case wI:{const{key:t,value:i}=n.right.content,s=o[t];if(void 0!==s){if(NP(s,i))a.delete(t);else{if(0===r)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r<n.right.length&&TM(e,fM(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let o="";for(;r>0;r--)o+="\n";n.right=new FI(fM(s,kM(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new AI(o)),n.right.integrate(e,0),n.forward()}jP(e,t,n,a)},HP=(e,t,n,r,o)=>{let i=t;const s=RE();while(i&&(!i.countable||i.deleted)){if(!i.deleted&&i.content.constructor===wI){const e=i.content;s.set(e.key,e)}i=i.right}let a=0,c=!1;while(t!==i){if(n===t&&(c=!0),!t.deleted){const n=t.content;switch(n.constructor){case wI:{const{key:i,value:l}=n,d=r.get(i)||null;s.get(i)===n&&d!==l||(t.delete(e),a++,c||(o.get(i)||null)!==l||d===l||(null===d?o.delete(i):o.set(i,d))),c||t.deleted||FP(o,n);break}}}t=t.right}return a},WP=(e,t)=>{while(t&&t.right&&(t.right.deleted||!t.right.countable))t=t.right;const n=new Set;while(t&&(t.deleted||!t.countable)){if(!t.deleted&&t.content.constructor===wI){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},GP=e=>{let t=0;return FM(e.doc,(n=>{let r=e._start,o=e._start,i=RE();const s=BE(i);while(o){if(!1===o.deleted)switch(o.content.constructor){case wI:FP(s,o.content);break;default:t+=HP(n,r,o,i,s),i=BE(s),r=o;break}o=o.right}})),t},$P=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&IM(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==wI||e.constructor===dI||t.add(e.parent)}))}FM(n,(n=>{_T(e,e.deleteSet,(e=>{if(e instanceof dI||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===wI?t.add(r):WP(n,e)}));for(const e of t)GP(e)}))},XP=(e,t,n)=>{const r=n,o=BE(t.currentAttributes),i=t.right;while(n>0&&null!==t.right){if(!1===t.right.deleted)switch(t.right.content.constructor){case BI:case bI:case AI:n<t.right.length&&TM(e,fM(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&HP(e,i,t.right,o,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&cP(s._searchMarker,t.index,-r+n),t};class YP extends QM{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];FM(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",c=0,l=0;const d=()=>{if(null!==i){let e=null;switch(i){case"delete":l>0&&(e={delete:l}),l=0;break;case"insert":("object"===typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":c>0&&(e={retain:c},xT(s)||(e.attributes=vT({},s))),c=0;break}e&&t.push(e),i=null}};while(null!==o){switch(o.content.constructor){case BI:case bI:this.adds(o)?this.deletes(o)||(d(),i="insert",a=o.content.getContent()[0],d()):this.deletes(o)?("delete"!==i&&(d(),i="delete"),l+=1):o.deleted||("retain"!==i&&(d(),i="retain"),c+=1);break;case AI:this.adds(o)?this.deletes(o)||("insert"!==i&&(d(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(d(),i="delete"),l+=o.length):o.deleted||("retain"!==i&&(d(),i="retain"),c+=o.length);break;case wI:{const{key:t,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const c=n.get(t)||null;NP(c,a)?null!==a&&o.delete(e):("retain"===i&&d(),NP(a,r.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(o)){r.set(t,a);const e=n.get(t)||null;NP(e,a)||("retain"===i&&d(),s[t]=e)}else if(!o.deleted){r.set(t,a);const n=s[t];void 0!==n&&(NP(n,a)?null!==n&&o.delete(e):("retain"===i&&d(),null===a?delete s[t]:s[t]=a))}o.deleted||("insert"===i&&d(),FP(n,o.content));break}}o=o.right}d();while(t.length>0){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class JP extends dP{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(zO){console.error(zO)}this._pending=null}_copy(){return new JP}clone(){const e=new JP;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new YP(this,e,t);lP(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;while(null!==t)!t.deleted&&t.countable&&t.content.constructor===AI&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?FM(this.doc,(n=>{const r=new RP(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const i=e[o];if(void 0!==i.insert){const s=t||"string"!==typeof i.insert||o!==e.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!==typeof s||s.length>0)&&qP(n,this,r,s,i.attributes||{})}else void 0!==i.retain?VP(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&XP(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let s="",a=this._start;function c(){if(s.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const l=()=>{while(null!==a){if(bM(a,e)||void 0!==t&&bM(a,t))switch(a.content.constructor){case AI:{const r=o.get("ychange");void 0===e||bM(a,e)?void 0===t||bM(a,t)?void 0!==r&&(c(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(c(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(c(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case BI:case bI:{c();const e={insert:a.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case wI:bM(a,e)&&(c(),FP(o,a.content));break}a=a.right}c()};return e||t?FM(i,(n=>{e&&yM(n,e),t&&yM(n,t),l()}),"cleanup"):l(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),qP(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n={}){const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);qP(r,this,o,t,n)})):this._pending.push((()=>this.insertEmbed(e,t,n)))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?FM(n,(n=>{XP(n,LP(n,this,e),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?FM(r,(r=>{const o=LP(r,this,e);null!==o.right&&VP(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return SP(this,e)}getAttributes(){return EP(this)}_write(e){e.writeTypeRef(II)}}const ZP=e=>new JP;class KP{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==tI&&t.constructor!==QP||null===t._start)while(null!==e){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class QP extends dP{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new QP}clone(){const e=new QP;return e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new KP(this,e)}querySelector(e){e=e.toUpperCase();const t=new KP(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)),n=t.next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),VE(new KP(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){lP(this,e,new rI(this,t,e))}toString(){return fP(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),pP(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?FM(this.doc,(n=>{yP(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)FM(this.doc,(n=>{const r=e&&e instanceof dP?e._item:e;vP(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw g_("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?FM(this.doc,(n=>{xP(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return hP(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return gP(this,e)}slice(e=0,t=this.length){return uP(this,e,t)}forEach(e){pP(this,e)}_write(e){e.writeTypeRef(DI)}}const eI=e=>new QP;class tI extends QP{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new tI(this.nodeName)}clone(){const e=new tI(this.nodeName),t=this.getAttributes();return yT(t,((t,n)=>{"string"===typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof dP?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const s in e)n.push(s);n.sort();const r=n.length;for(let s=0;s<r;s++){const r=n[s];t.push(r+'="'+e[r]+'"')}const o=this.nodeName.toLocaleLowerCase(),i=t.length>0?" "+t.join(" "):"";return`<${o}${i}>${super.toString()}</${o}>`}removeAttribute(e){null!==this.doc?FM(this.doc,(t=>{kP(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?FM(this.doc,(n=>{CP(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return SP(this,e)}hasAttribute(e){return AP(this,e)}getAttributes(){return EP(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const i in o){const e=o[i];"string"===typeof e&&r.setAttribute(i,e)}return pP(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(OI),e.writeKey(this.nodeName)}}const nI=e=>new tI(e.readKey());class rI extends QM{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class oI extends OP{constructor(e){super(),this.hookName=e}_copy(){return new oI(this.hookName)}clone(){const e=new oI(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(NI),e.writeKey(this.hookName)}}const iI=e=>new oI(e.readKey());class sI extends JP{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new sI}clone(){const e=new sI;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const r in e.attributes){const n=[];for(const t in e.attributes[r])n.push({key:t,value:e.attributes[r][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:r,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let r=0;r<t.length;r++){const e=t[r];n+=`<${e.nodeName}`;for(let t=0;t<e.attrs.length;t++){const r=e.attrs[t];n+=` ${r.key}="${r.value}"`}n+=">"}n+=e.insert;for(let r=t.length-1;r>=0;r--)n+=`</${t[r].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(RI)}}const aI=e=>new sI;class cI{constructor(e,t){this.id=e,this.length=t}get deleted(){throw v_()}mergeWith(e){return!1}write(e,t,n){throw v_()}integrate(e,t){throw v_()}}const lI=0;class dI extends cI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),CM(e.doc.store,this)}write(e,t){e.writeInfo(lI),e.writeLen(this.length-t)}getMissing(e,t){return null}}class uI{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new uI(this.content)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const hI=e=>new uI(e.readBuf());class pI{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new pI(this.len)}splice(e){const t=new pI(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){OT(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const fI=e=>new pI(e.readLen()),mI=(e,t)=>new FT({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class gI{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new gI(mI(this.doc.guid,this.opts))}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const vI=e=>new gI(mI(e.readString(),e.readAny()));class bI{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new bI(this.embed)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const yI=e=>new bI(e.readJSON());class wI{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new wI(this.key,this.value)}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){const n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const xI=e=>new wI(e.readKey(),e.readJSON());class kI{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new kI(this.arr)}splice(e){const t=new kI(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const CI=e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new kI(n)};class SI{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new SI(this.arr)}splice(e){const t=new SI(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeAny(t)}}getRef(){return 8}}const EI=e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new SI(n)};class AI{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new AI(this.str)}splice(e){const t=new AI(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const _I=e=>new AI(e.readString()),TI=[PP,DP,ZP,nI,eI,iI,aI],MI=0,PI=1,II=2,OI=3,DI=4,NI=5,RI=6;class BI{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new BI(this.type._copy())}splice(e){throw v_()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;while(null!==t)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;while(null!==t)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{while(null!==t)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const LI=e=>new BI(TI[e.readTypeRef()](e)),jI=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new FI(fM(r,o+n),t,fM(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=fM(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class FI extends cI{constructor(e,t,n,r,o,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?MA:0}set marker(e){(this.info&IA)>0!==e&&(this.info^=IA)}get marker(){return(this.info&IA)>0}get keep(){return(this.info&TA)>0}set keep(e){this.keep!==e&&(this.info^=TA)}get countable(){return(this.info&MA)>0}get deleted(){return(this.info&PA)>0}set deleted(e){this.deleted!==e&&(this.info^=PA)}markDeleted(){this.info|=PA}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=kM(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=kM(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===hM&&this.id.client!==this.parent.client&&this.parent.clock>=kM(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=MM(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=TM(e,this.rightOrigin),this.rightOrigin=this.right.id),(this.left&&this.left.constructor===dI||this.right&&this.right.constructor===dI)&&(this.parent=null),this.parent){if(this.parent.constructor===hM){const e=AM(t,this.parent);e.constructor===dI?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===FI&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===FI&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=MM(e,e.doc.store,fM(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub){t=this.parent._map.get(this.parentSub)||null;while(null!==t&&null!==t.left)t=t.left}else t=this.parent._start;const r=new Set,o=new Set;while(null!==t&&t!==this.right){if(o.add(t),r.add(t),pM(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,r.clear();else if(pM(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!o.has(AM(e.doc.store,t.origin)))break;r.has(AM(e.doc.store,t.origin))||(n=t,r.clear())}t=t.right}this.left=n}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub){e=this.parent._map.get(this.parentSub)||null;while(null!==e&&null!==e.left)e=e.left}else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),CM(e.doc.store,this),this.content.integrate(e,this),NM(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new dI(this.id,this.length).integrate(e,0)}get next(){let e=this.right;while(null!==e&&e.deleted)e=e.right;return e}get prev(){let e=this.left;while(null!==e&&e.deleted)e=e.left;return e}get lastId(){return 1===this.length?this.id:fM(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&pM(e.origin,this.lastId)&&this.right===e&&pM(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach((t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),OT(e.deleteSet,this.id.client,this.id.clock,this.length),NM(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw b_();this.content.gc(e),t?PM(e,this,new dI(this.id,this.length)):this.content=new pI(this.length)}write(e,t){const n=t>0?fM(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=this.content.getRef()&RA|(null===n?0:NA)|(null===r?0:DA)|(null===o?0:OA);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=mM(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===hM?(e.writeParentInfo(!1),e.writeLeftID(t)):b_();null!==o&&e.writeString(o)}this.content.write(e,t)}}const zI=(e,t)=>UI[t&RA](e),UI=[()=>{b_()},fI,CI,hI,_I,yI,xI,LI,EI,vI,()=>{b_()}],qI=10;class VI extends cI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){b_()}write(e,t){e.writeInfo(qI),XA(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const HI="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:{},WI="__ $YJS$ __";!0===HI[WI]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),HI[WI]=!0;var GI,$I,XI,YI,JI=new WeakMap,ZI=function(){function e(t){d(this,e),b(this,JI,{writable:!0,value:""}),rw(this,JI,t)}return g(e,[{key:"getRoom",value:function(){return k(this,JI)}}]),e}(),KI=new WeakMap,QI=function(){function e(t){d(this,e),y(this,"clientIO",null),y(this,"yDoc",null),y(this,"yArray",null),y(this,"modeler",null),b(this,KI,{writable:!0,value:null}),y(this,"room",null),y(this,"deletedItem",null),this.yDoc=new FT,this.yArray=this.yDoc.getArray("elements"),this.modeler=t}return g(e,[{key:"init",value:function(){var e;rw(this,KI,B(this.modeler.definitions));var t=null!==(e=window.ProcessMaker.modeler.process.uuid)&&void 0!==e?e:window.ProcessMaker.modeler.process.id;this.room=new ZI("room-".concat(t)),this.clientIO=NE(window.ProcessMaker.multiplayer.host,{transports:["websocket","polling"]}),window.ProcessMaker.multiplayer.enabled?(this.webSocketEvents(),this.multiplayerEvents()):this.clientIO.disconnect()}},{key:"webSocketEvents",value:function(){var e=this;this.clientIO.on("connect",(function(){var t,n;e.clientIO.emit("joinRoom",{roomName:e.room.getRoom(),clientName:null===(t=window.ProcessMaker.user)||void 0===t?void 0:t.fullName,clientAvatar:null===(n=window.ProcessMaker.user)||void 0===n?void 0:n.avatar})})),this.clientIO.on("clientJoined",(function(t){e.modeler.enableMultiplayer(t.isMultiplayer),t.isMultiplayer&&t.clients.map((function(t){var n={id:t.id,name:t.name,color:"#FF6F61",avatar:t.avatar,top:90,left:80};e.modeler.addPlayer(n)}))})),this.clientIO.on("clientLeft",(function(t){e.modeler.removePlayer(t.clientId),e.modeler.enableMultiplayer(t.isMultiplayer)})),this.clientIO.on("requestProcess",(function(t){var n=t.clientId;n&&e.syncLocalNodes(n)})),this.clientIO.on("createElement",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.createRemoteShape(n.changes);case 2:tM(e.yDoc,new Uint8Array(n.updateDoc));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.clientIO.on("createRequestedElement",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n.clientId!==e.clientIO.id){t.next=4;break}return t.next=3,e.createRemoteShape(n.changes);case 3:tM(e.yDoc,new Uint8Array(n.updateDoc));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.clientIO.on("removeElement",(function(t){t.deletedNodes.forEach((function(t){var n=e.getNodeById(t);e.removeShape(n)})),tM(e.yDoc,new Uint8Array(t.updateDoc))})),this.clientIO.on("updateElement",(function(t){var n=t.updateDoc,r=t.updatedNodes,o=t.isReplaced;o?e.replaceShape(r[0]):r.forEach((function(t){e.updateShapes(t)})),tM(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateInspector",(function(t){var n=t.updateDoc,r=t.updatedNodes;r.forEach((function(t){e.updateShapeFromInspector(t)})),tM(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateFlows",(function(t){var n=t.updateDoc,r=t.updatedNodes;r.forEach((function(t){e.updateFlowClient(t)})),tM(e.yDoc,new Uint8Array(n))}))}},{key:"multiplayerEvents",value:function(){var e=this;window.ProcessMaker.EventBus.$on("multiplayer-addNode",(function(t){e.addNode(t)})),window.ProcessMaker.EventBus.$on("multiplayer-removeNode",(function(t){e.removeNode(t)})),window.ProcessMaker.EventBus.$on("multiplayer-updateNodes",(function(t){e.updateNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-replaceNode",(function(t){var n=t.nodeData,r=t.newControl;e.replaceNode(n,r)})),window.ProcessMaker.EventBus.$on("multiplayer-addFlow",(function(t){e.addCommonElement(t)})),window.ProcessMaker.EventBus.$on("multiplayer-addBoundaryEvent",(function(t){e.addCommonElement(t)})),window.ProcessMaker.EventBus.$on("multiplayer-addLanes",(function(t){e.addLaneNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-updateInspectorProperty",(function(t){e.modeler.isMultiplayer&&e.updateInspectorProperty(t)})),window.ProcessMaker.EventBus.$on("multiplayer-updateFlows",(function(t){e.modeler.isMultiplayer&&e.updateFlows(t)}))}},{key:"syncLocalNodes",value:function(e){var t=this,n=this.modeler.nodes.map((function(e){return t.modeler.multiplayerHook(e,!1,!0)}));n.forEach((function(n){var r=new OP;t.doTransact(r,n),t.yArray.push([r]);var o=oM(t.yDoc);t.clientIO.emit("createElement",{updateDoc:o,clientId:e})}))}},{key:"addNode",value:function(e){var t=new OP;this.doTransact(t,e),this.yArray.push([t]);var n=oM(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n})}},{key:"createShape",value:function(e){var t=this.getNodeById(e.id);t||(this.modeler.nodeRegistry[e.type]&&this.modeler.nodeRegistry[e.type].multiplayerClient?this.modeler.nodeRegistry[e.type].multiplayerClient(this.modeler,e):this.modeler.addRemoteNode(e),k(this,KI).updateCounters())}},{key:"createRemoteShape",value:function(e){var t=this;return new Promise((function(n){e.map((function(e){t.createShape(e)})),n()}))}},{key:"removeNode",value:function(e){var t=this.getIndex(e.definition.id);if(t>=0){this.removeShape(e),this.yArray.delete(t,1);var n=oM(this.yDoc);this.clientIO.emit("removeElement",n)}}},{key:"getIndex",value:function(e){var t,n=-1,r=!1,o=HC(this.yArray);try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n++,i.get("id")===e){r=!0;break}}}catch(FO){o.e(FO)}finally{o.f()}return r?n:-1}},{key:"getNodeById",value:function(e){var t=this.modeler.nodes.find((function(t){return t.definition&&t.definition.id===e}));return t}},{key:"removeShape",value:function(e){this.modeler.removeNodeProcedure(e,{removeRelationships:!1})}},{key:"getRemovedNodes",value:function(e,t){return e.filter((function(e){return!t.some((function(t){return e.definition.id===t.get("id")}))}))}},{key:"updateNodes",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),r=t.yArray.get(n),o=e.poolId?Qr(Qr({},e.properties),{poolId:e.poolId}):e.properties;t.doTransact(r,o)}))}},{key:"replaceNode",value:function(e,t){var n=this.getIndex(e.nodeThatWillBeReplaced.definition.id),r=this.yArray.get(n);e.id="node_".concat(k(this,KI).getDefinitionNumber()),k(this,KI).updateCounters(),this.replaceShape({oldNodeId:e.nodeThatWillBeReplaced.definition.id,id:e.id,type:t,x:e.x,y:e.y}),this.yDoc.transact((function(){r.set("type",t),r.set("id",e.id)}));var o=oM(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:o,isReplaced:!0})}},{key:"replaceShape",value:function(e){var t=this.modeler.paper.localToClientPoint(e),n=t.x,r=t.y,o=this.getNodeById(e.oldNodeId),i={clientX:n,clientY:r,control:{type:e.type},nodeThatWillBeReplaced:o,color:o.color,id:e.id};this.modeler.replaceNodeProcedure(i,!0),k(this,KI).updateCounters()}},{key:"doTransact",value:function(e,t){this.yDoc.transact((function(){for(var n in t)Object.hasOwn(t,n)&&e.set(n,t[n])}));var n=oM(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:n,isReplaced:!1})}},{key:"updateShapes",value:function(){var e=l(a().mark((function e(t){var n,r,o,i,s,c,l,d,u,h,p=this;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.modeler.paper,r=this.modeler.getElementByNodeId(t.id),o=this.modeler.getElementByNodeId(t.poolId),!this.modeler.flowTypes.includes(t.type)){e.next=15;break}i=this.modeler.getElementByNodeId(t.sourceRefId),s=this.modeler.getElementByNodeId(t.targetRefId),c=t.waypoint,l=c.shift(),d=c.pop(),u=c.map((function(e){return p.modeler.moddle.create("dc:Point",e)})),r.set("vertices",u),r.source(i,{anchor:function(){return Mt(p.getConnectionPoint(i,l),i.findView(n))},connectionPoint:{name:"boundary"}}),r.target(s,{anchor:function(){return Mt(p.getConnectionPoint(s,d),s.findView(n))},connectionPoint:{name:"boundary"}}),e.next=27;break;case 15:return r.resize(t.width,t.height),r.set("position",{x:t.x,y:t.y}),h=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:h,key:"color",value:t.color}),"bpmn:BoundaryEvent"===r.component.node.definition.$type&&this.attachBoundaryEventToNode(r,t),e.next=22,n.findViewByModel(r).update();case 22:return e.next=24,r.component.$nextTick();case 24:return e.next=26,this.modeler.paperManager.awaitScheduledUpdates();case 26:o&&r.component.node.pool&&r.component.node.pool.component.id!==t.poolId&&r.component.node.pool.component.moveElementRemote(r,o);case 27:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"attachBoundaryEventToNode",value:function(e,t){var n=this.getNodeById(t.attachedToRefId),r=e.getParentCell(),o=this.modeler.getElementByNodeId(t.attachedToRefId);r&&r.unembed(e),o&&o.embed(e),e.component.node.definition.set("attachedToRef",n.definition)}},{key:"addCommonElement",value:function(e){var t=new OP;this.doTransact(t,e),this.yArray.push([t]);var n=oM(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n}),k(this,KI).updateCounters()}},{key:"addLaneNodes",value:function(e){var t=this,n=this.getPool(e);window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[{id:n.component.node.definition.id,properties:{x:n.component.node.diagram.bounds.x,y:n.component.node.diagram.bounds.y,height:n.component.node.diagram.bounds.height,width:n.component.node.diagram.bounds.width,isAddingLaneAbove:n.isAddingLaneAbove}}]),this.yDoc.transact((function(){e.forEach((function(e){var n=new OP,r=t.prepareLaneData(e);t.doTransact(n,r),t.yArray.push([n]);var o=oM(t.yDoc);t.clientIO.emit("createElement",{updateDoc:o})}))}))}},{key:"prepareLaneData",value:function(e){var t={type:e.type,id:e.definition.id,name:e.definition.name,x:e.diagram.bounds.x,y:e.diagram.bounds.y,width:e.diagram.bounds.width,height:e.diagram.bounds.height,poolId:e.pool.component.node.definition.id,laneSetId:e.pool.component.laneSet.id};return t}},{key:"getPool",value:function(e){return!!(e&&e.length>0)&&e[0].pool}},{key:"getConnectionPoint",value:function(e,t){var n=e.position(),r=n.x,o=n.y,i={x:t.x-r,y:t.y-o},s=e.position(),a=s.x,c=s.y,l=e.size(),d=l.width,u=l.height;return i?{x:a+i.x,y:c+i.y}:{x:a+d/2,y:c+u/2}}},{key:"updateInspectorProperty",value:function(e){var t=this.getIndex(e.id),n=this.yArray.get(t);if(n){var r=e.value;"loopCharacteristics"===e.key&&(r=JSON.stringify(e.value)),n.set(e.key,r),e.extras&&Object.keys(e.extras).length>0&&n.set("extras",e.extras);var o=oM(this.yDoc);this.clientIO.emit("updateFromInspector",{updateDoc:o,isReplaced:!1})}}},{key:"setNodeProp",value:function(e,t,n){Un.commit("updateNodeProp",{node:e,key:t,value:n})}},{key:"updateShapeFromInspector",value:function(e){var t=null;if(e.oldNodeId&&e.oldNodeId!==e.id){var n=this.getIndex(e.oldNodeId),r=this.yArray.get(n);return r.set("id",e.id),t=this.getNodeById(e.oldNodeId),void Un.commit("updateNodeProp",{node:t,key:"id",value:e.id})}if(t=this.getNodeById(e.id),t){var o,i={};if(e.extras&&Object.keys(e.extras).length>0&&(i=e.extras),e.loopCharacteristics){var s=JSON.parse(e.loopCharacteristics);return void this.modeler.nodeRegistry[t.type].loopCharacteristicsHandler({type:t.definition.type,$loopCharactetistics:{id:e.id,loopCharacteristics:s}},t,this.setNodeProp,this.modeler.moddle,this.modeler.definitions,!1)}if(null!==(o=this.modeler.nodeRegistry[t.type])&&void 0!==o&&o.multiplayerInspectorHandler)return void this.modeler.nodeRegistry[t.type].multiplayerInspectorHandler(t,e,this.setNodeProp,this.modeler.moddle);var a=Object.keys(e).filter((function(e){return"id"!==e})),c=a[0],l=e[c];if("condition"===c&&(t.definition.get("eventDefinitions")[0].get("condition").body=l),"gatewayDirection"===c&&t.definition.set("gatewayDirection",l),"messageRef"===c){var d,u,h,p=this.modeler.definitions.rootElements.find((function(e){return e.id===l}));if(!p)p=this.modeler.moddle.create("bpmn:Message",{id:l,name:(null===(h=i)||void 0===h?void 0:h.messageName)||l}),this.modeler.definitions.rootElements.push(p);t.definition.get("eventDefinitions")[0].messageRef=p,null!==(d=i)&&void 0!==d&&d.allowedUsers&&t.definition.set("allowedUsers",i.allowedUsers),null!==(u=i)&&void 0!==u&&u.allowedGroups&&t.definition.set("allowedGroups",i.allowedGroups)}["messageRef","gatewayDirection","condition","allowedUsers","allowedGroups"].includes(c)||Un.commit("updateNodeProp",{node:t,key:c,value:l})}}},{key:"updateFlows",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),r=t.yArray.get(n);t.yDoc.transact((function(){for(var t in e)Object.hasOwn(e,t)&&r.set(t,e[t])}))}));var n=oM(this.yDoc);this.clientIO.emit("updateFlows",{updateDoc:n,isReplaced:!1})}},{key:"updateFlowClient",value:function(e){var t=!1,n=this.getNodeById(e.id);if(n&&e.sourceRefId){var r=this.getNodeById(e.sourceRefId);n.definition.set("sourceRef",r.definition);var o,i=r.definition.get("outgoing").find((function(e){return e.id===n.definition.id}));if(!i)(o=r.definition.get("outgoing")).push.apply(o,[n.definition]);t=!0}if(n&&e.targetRefId){var s=this.getNodeById(e.targetRefId);n.definition.set("targetRef",s.definition);var a,c=s.definition.get("incoming").find((function(e){return e.id===n.definition.id}));if(!c)(a=s.definition.get("incoming")).push.apply(a,[n.definition]);t=!0}t&&(n._modelerId+="_replaced")}}]),e}(),eO={components:{PreviewPanel:Kv,ToolBar:ux,ExplorerRail:tv,InspectorButton:xv,InspectorPanel:Nv,ProcessmakerModelerGenericFlow:Gk,Selection:LC,RailBottom:jk,WelcomeMessage:hv,RemoteCursor:VC},props:{owner:Object,decorations:{type:Object,default:function(){return{}}},readOnly:{type:Boolean,default:function(){return!1}},validationBar:Array,requestIdleNodes:{type:Array,default:function(){return[]}},requestCompletedNodes:{type:Array,default:function(){return[]}},requestInProgressNodes:{type:Array,default:function(){return[]}}},mixins:[Ex,Gx],data:function(){return{extraActions:[],pasteInProgress:!1,cloneInProgress:!1,internalClipboard:[],tooltipTarget:null,parsers:{},extensions:[],nodeRegistry:{},graph:null,paper:null,paperManager:null,definitions:null,nodeIdGenerator:null,planeElements:null,canvasDragPosition:null,processNode:null,collaboration:null,moddle:null,allowDrop:!0,poolTarget:null,processes:[],cursor:null,parentHeight:null,parentWidth:null,linter:null,validationErrors:{},miniMapOpen:!1,panelsCompressed:!1,isOpenInspector:!1,isOpenPreview:!1,isGrabbing:!1,isRendering:!1,isLoaded:!1,allWarnings:[],nodeTypes:[],pmBlockNodes:[],breadcrumbData:[],activeNode:null,xmlManager:null,previouslyStackedShape:null,keyMod:this.isAppleOS()?"Command":"Control",canvasScale:1,initialScale:1,minimumScale:.2,scaleStep:.1,isDragging:!1,isSelecting:!1,isIntoTheSelection:!1,dragStart:null,players:[],showInspectorButton:!0,inspectorButtonRight:65,previewConfigs:[],isResizingPreview:!1,currentCursorPosition:0,previewPanelWidth:600,flowTypes:["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow","processmaker-modeler-data-input-association","processmaker-modeler-data-output-association","processmaker-modeler-association"]}},watch:{isRendering:function(){var e="Loading process, please be patient.";if(this.isRendering)return window.ProcessMaker.alert(e,"warning"),document.body.style.cursor="wait !important",void(this.cursor="wait");window.ProcessMaker.navbar.alerts=window.ProcessMaker.navbar.alerts.filter((function(t){return t.alertText!==e})),document.body.style.cursor="auto",this.cursor=null,this.isLoaded=!0},currentXML:function(){this.validateIfAutoValidateIsOn()},definitions:function(){this.validateIfAutoValidateIsOn()},autoValidate:function(){this.validateIfAutoValidateIsOn()},canvasScale:function(e){this.paperManager.scale=e},highlightedNodes:function(){var e;null!==(e=window.ProcessMaker)&&void 0!==e&&e.EventBus&&window.ProcessMaker.EventBus.$emit("modeler:highlightedNodes",this.highlightedNodes)}},computed:{showWelcomeMessage:function(){return!this.selectedNode&&!this.nodes.length&&!Un.getters.isReadOnly&&this.isLoaded},noElementsSelected:function(){return 0===this.highlightedNodes.filter((function(e){return!e.isType("processmaker-modeler-process")})).length},tooltipTitle:function(){if(this.tooltipTarget)return this.tooltipTarget.$el.data("title")},autoValidate:function(){return Un.getters.autoValidate},nodes:function(){return Un.getters.nodes},currentXML:function(){return Qv.getters.currentState},copiedElements:function(){return Un.getters.copiedElements},highlightedNode:function(){return Un.getters.highlightedNodes[0]},highlightedNodes:function(){return Un.getters.highlightedNodes},invalidNodes:function(){return qx(this.validationErrors,this.nodes)},showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer}},methods:{onStartPreviewResize:function(e){this.isResizingPreview=!0,this.currentCursorPosition=e.x},onMouseUp:function(){this.isResizingPreview=!1},onMouseMove:function(e){if(this.isResizingPreview){var t=this.currentCursorPosition-e.x;this.previewPanelWidth=parseInt(this.previewPanelWidth)+t,this.currentCursorPosition=e.x}},registerPreview:function(e){this.previewConfigs.push(e)},handleToolbarAction:function(e){e.handler instanceof Function&&e.handler(this)},handleToggleInspector:function(e){this.showInspectorButton=!(null===e||void 0===e||e),this.isOpenInspector=e},handlePreview:function(){1!=this.highlightedNodes.length&&(this.isOpenPreview=!1),this.$refs["preview-panel"].previewNode(!0),this.handleTogglePreview(!0)},handleTogglePreview:function(e){this.isOpenPreview=e},setInspectorButtonPosition:function(){this.isOpenInspector||(this.isOpenPreview&&!this.isOpenInspector&&(this.inspectorButtonRight=65+this.previewPanelWidth),this.isOpenPreview||this.isOpenInspector||(this.inspectorButtonRight=65))},isAppleOS:function(){return"undefined"!==typeof navigator&&/Mac|iPad|iPhone/.test(navigator.platform)},shapeResize:function(){var e=arguments,t=this;return l(a().mark((function n(){var r;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=!(e.length>0&&void 0!==e[0])||e[0],n.next=3,t.$nextTick();case 3:return n.next=5,t.paperManager.awaitScheduledUpdates();case 5:t.$refs.selector.updateSelectionBox(!0,r);case 6:case"end":return n.stop()}}),n)})))()},toggleDefaultFlow:function(e){var t=e.definition.sourceRef;t.default&&t.default.id===e.id&&(e=null),t.set("default",e)},cloneElement:function(e,t){var n=e.clone(this.nodeRegistry,this.moddle,this.$t),r=(e.diagram.bounds.height+30)*t;n.diagram.bounds.y+=r,this.addNode(n)},copyElement:function(){var e=[gl,_r,Ir,fo,Mv],t=[gy,Sy,Iy,Fy,$y,tw];1===this.highlightedNodes.length&&(e.includes(this.highlightedNodes[0].type)||t.includes(this.highlightedNodes[0].type))||(Un.commit("setCopiedElements",this.cloneNodesSelection()),this.$bvToast.toast(this.$t("Object(s) have been copied"),{noCloseButton:!0,variant:"success",solid:!0,toaster:"b-toaster-top-center"}))},publishTemplate:function(){this.$emit("publishTemplate")},publishPmBlock:function(){this.$emit("publishPmBlock")},pasteElements:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.copiedElements.length>0)||e.pasteInProgress){t.next=21;break}return e.pasteInProgress=!0,t.prev=2,t.next=5,e.addClonedNodes(e.copiedElements);case 5:return t.next=7,e.$nextTick();case 7:return t.next=9,e.paperManager.awaitScheduledUpdates();case 9:return t.next=11,e.$refs.selector.selectElements(e.findViewElementsFromNodes(e.copiedElements),!0);case 11:return t.next=13,e.$nextTick();case 13:return t.next=15,Un.commit("setCopiedElements",e.cloneNodesSelection());case 15:e.scrollToSelection();case 16:return t.prev=16,e.pasteInProgress=!1,t.next=20,e.pushToUndoStack();case 20:return t.finish(16);case 21:case"end":return t.stop()}}),t,null,[[2,,16,21]])})))()},cloneSelection:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.cloneNodesSelection(),!n||0!==n.length){t.next=3;break}return t.abrupt("return");case 3:return t.prev=3,e.cloneInProgress=!0,e.$refs.selector.clearSelection(),t.next=8,e.addClonedNodes(n);case 8:return t.next=10,e.$nextTick();case 10:return t.next=12,e.paperManager.awaitScheduledUpdates();case 12:return t.next=14,e.$refs.selector.selectElements(e.findViewElementsFromNodes(n));case 14:e.scrollToSelection();case 15:return t.prev=15,e.cloneInProgress=!1,t.next=19,e.pushToUndoStack();case 19:return t.finish(15);case 20:case"end":return t.stop()}}),t,null,[[3,,15,20]])})))()},scrollToSelection:function(){var e=this.$refs["paper-container"].getBoundingClientRect(),t=this.$refs.selector,n=t.$el.getBoundingClientRect();if(n.right>e.right||n.bottom>e.bottom||n.left<e.left||n.top<e.top){var r=this.paper.translate(),o=r.ty-(n.top-e.top-n.height);this.paper.translate(r.tx,o),t.updateSelectionBox(!0)}},findViewElementsFromNodes:function(e){var t=this;return e.map((function(e){var n=t.$refs.nodeComponent.find((function(t){return t.node===e})),r=n.shape;return t.paper.findViewByModel(r)}))},getElementByNodeId:function(e){var t=this.paper.model.getCells();return t.find((function(t){return t.component&&t.component.id===e}))},close:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$emit("close");case 1:case"end":return t.stop()}}),t)})))()},saveBpmn:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o,i,s,c,l,d;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:null,o=e.length>1&&void 0!==e[1]?e[1]:null,i=document.querySelector(".mini-paper svg"),s="text { font-family: sans-serif; }",c=document.createElement("style"),c.appendChild(document.createTextNode(s)),i.appendChild(c),n.next=9,t.getXmlFromDiagram();case 9:l=n.sent,d=(new XMLSerializer).serializeToString(i),t.$emit("saveBpmn",{xml:l,svg:d,redirectUrl:r,nodeId:o});case 12:case"end":return n.stop()}}),n)})))()},borderOutline:function(e){return this.decorations.borderOutline&&this.decorations.borderOutline[e]},addWarning:function(e){this.allWarnings.push(e),this.$emit("warnings",this.allWarnings)},validatePlaneElements:function(){var e=this;this.planeElements.filter((function(e){return!e.bpmnElement})).map((function(t){return{title:e.$t("Non-existent Element"),text:e.$t("bpmdi:BPMNShape ")+t.id+e.$t(" references a non-existent element and was not parsed")}})).forEach((function(t){return e.addWarning(t)}))},cleanPlaneElements:function(){mv()(this.planeElements,(function(e){return!e.bpmnElement}))},getTooltipTarget:function(){return this.tooltipTarget.$el[0]},validateIfAutoValidateIsOn:function(){this.autoValidate&&this.validateBpmnDiagram()},translateConfig:function(e){if(e.config){var t=e.config;t.label=this.$t(t.label),t.helper=this.$t(t.helper)}e.items&&e.items.forEach(this.translateConfig)},pushToUndoStack:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.pasteInProgress&&!e.cloneInProgress){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,e.getXmlFromDiagram();case 5:return n=t.sent,t.next=8,Qv.dispatch("pushState",n);case 8:window.ProcessMaker.EventBus.$emit("modeler-change"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),console.warn(t.t0.message);case 14:case"end":return t.stop()}}),t,null,[[2,11]])})))()},getXmlFromDiagram:function(){var e=this;return new Promise((function(t,n){e.toXML((function(e,r){e?n(e):t(r)}))}))},validateBpmnDiagram:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(Un.getters.globalProcesses&&0!==Un.getters.globalProcesses.length){t.next=3;break}return t.next=3,Un.dispatch("fetchGlobalProcesses");case 3:return t.next=5,e.linter.lint(e.definitions);case 5:e.validationErrors=t.sent,e.$emit("validate",e.validationErrors);case 7:case"end":return t.stop()}}),t)})))()},setPools:function(e){var t;(this.collaboration||(this.collaboration=this.moddle.create("bpmn:Collaboration"),this.definitions.get("rootElements").push(this.collaboration),this.collaboration.set("id","collaboration_0"),this.plane.set("bpmnElement",this.collaboration)),e.get("processRef"))?this.collaboration.get("participants").includes(e)||this.collaboration.get("participants").push(e):(0===this.collaboration.get("participants").length?t=this.processNode.definition:(t=this.moddle.create("bpmn:Process"),this.processes.push(t),t.set("id",this.nodeIdGenerator.generateProcessId()),this.definitions.get("rootElements").push(t)),e.set("processRef",t),this.collaboration.get("participants").push(e))},unsetPools:function(){Cs()(this.definitions.get("rootElements"),this.collaboration),this.plane.set("bpmnElement",this.processNode.definition),this.collaboration=null},highlightNode:function(e,t){if(e&&this.highlightedNode)if(t&&t.shiftKey)Un.commit("addToHighlightedNodes",[e]);else{var n=Ar().isEqual(e.id,this.highlightedNode.id);n||Un.commit("highlightNode",e)}},blurFocusedScreenBuilderElement:function(){var e=["INPUT","SELECT"];e.includes(document.activeElement&&document.activeElement.tagName)&&document.activeElement.blur()},registerStatusBar:function(e){this.owner.validationBar.push(e)},registerComponentMixin:function(e,t){e.mixins||(e.mixins=[]),e.mixins.push(t)},registerBpmnExtension:function(e,t){this.extensions[e]=t},registerNode:function(e,t){var n=this,r=function(){return e.id},o=function(t){if(t.get("implementation")===e.implementation)return e.id};this.translateConfig(e.inspectorConfig[0]),Wx(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.nodeTypes.push(e);var i=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];i.forEach((function(i){n.parsers[i]||(n.parsers[i]={custom:[],implementation:[],default:[]}),t?n.parsers[i].custom.push(t):e.implementation?n.parsers[i].implementation.push(o):n.parsers[i].default.push(r)})),Mg.commit("setNodeTypes",this.nodeTypes)},registerPmBlock:function(e,t){var n=this,r=function(){return e.id};this.translateConfig(e.inspectorConfig[0]),Wx(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.pmBlockNodes.push(e);var o=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];o.forEach((function(e){n.parsers[e]||(n.parsers[e]={custom:[],implementation:[],default:[]}),t?n.parsers[e].custom.push(t):n.parsers[e].default.push(r)})),Mg.commit("setPmBlockNodeTypes",this.pmBlockNodes)},registerMenuAction:function(e){if(!e.value||"string"!==typeof e.value)throw new Error("Menu action must have a action.value");if(!e.content||"string"!==typeof e.content)throw new Error("Menu action must have a action.content");this.extraActions.push(e)},addMessageFlows:function(){this.collaboration&&this.collaboration.get("messageFlows").filter(this.hasSourceAndTarget).forEach(this.setNode)},loadAssociations:function(e,t){var n=this;t.filter((function(e){return"bpmn:Association"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(r){return n.setNode(r,e,t)}))},loadDataAssociations:function(e){var t=this,n=e.filter((function(e){return e.get("dataOutputAssociations")&&e.get("dataOutputAssociations").length>0}));n.forEach((function(n){n.get("dataOutputAssociations").forEach((function(n){t.setNode(n,e)}))}));var r=e.filter((function(e){return e.get("dataInputAssociations")&&e.get("dataInputAssociations").length>0}));r.forEach((function(n){n.get("dataInputAssociations").forEach((function(n){t.setNode(n,e)}))}))},loadArtifacts:function(e,t){var n=this;t.filter((function(e){return"bpmn:Association"!==e.$type})).forEach((function(r){return n.setNode(r,e,t)}))},loadSequenceFlows:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(r){return n.setNode(r,e,t)}))},loadFlowElements:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"!==e.$type})).forEach((function(r){return n.setNode(r,e,t)}))},addLanes:function(e){e.get("laneSets")[0]&&e.laneSets[0].lanes.forEach(this.setNode)},addPools:function(){this.collaboration&&this.collaboration.get("participants").forEach(this.setNode)},setUpDiagram:function(){var e=this;this.processes.forEach((function(t){e.ensureCancelActivityIsAddedToBoundaryEvents(t),e.addLanes(t);var n=t.get("flowElements"),r=t.get("artifacts");e.loadFlowElements(n,r),e.loadSequenceFlows(n,r),e.loadArtifacts(n,r),e.loadAssociations(n,r),e.loadDataAssociations(n)})),Un.commit("setRootElements",this.definitions.rootElements),this.addMessageFlows(),Un.commit("highlightNode",this.processNode)},getCollaboration:function(){return this.definitions.rootElements.find((function(e){var t=e.$type;return"bpmn:Collaboration"===t}))},getProcesses:function(){return this.definitions.rootElements.filter((function(e){var t=e.$type;return"bpmn:Process"===t}))},getPlane:function(){return this.definitions.diagrams[0].plane},getPlaneElements:function(){return this.plane.get("planeElement")},parse:function(){var e=this;this.collaboration=this.getCollaboration(),this.processes=this.getProcesses(),this.plane=this.getPlane(),this.planeElements=this.getPlaneElements(),this.validatePlaneElements(),this.cleanPlaneElements(),this.processNode=new po("processmaker-modeler-process",this.processes[0],this.planeElements.find((function(t){return t.bpmnElement.id===e.processes[0].id})))},removeUnsupportedElementAttributes:function(e){var t=["extensionElements"];t.filter((function(t){return e.get(t)})).forEach((function(t){return e.set(t,void 0)}))},getCustomParser:function(e){var t=this,n=this.parsers[e.$type];if(n){var r=n.custom.find((function(n){return n(e,t.moddle)})),o=n.implementation.find((function(n){return n(e,t.moddle)})),i=n.default.find((function(n){return n(e,t.moddle)}));return r||o||i}},handleUnsupportedElement:function(e,t,n,r,o){this.addWarning({title:this.$t("Unsupported Element"),text:e+this.$t(" is an unsupported element type in parse")}),Cs()(t,n),Cs()(r,n),Cs()(this.planeElements,o),this.collaboration&&Cs()(this.collaboration.get("messageFlows"),n);var i=n.get("incoming");i&&Cs()(t,i);var s=n.get("outgoing");s&&Cs()(t,s)},setNode:function(e,t,n){var r=this.planeElements.find((function(t){return t.bpmnElement.id===e.id})),o=e.$type,i=this.getCustomParser(e);if(i){this.removeUnsupportedElementAttributes(e);var s=e.config&&(0,pv.isJSON)(e.config)?JSON.parse(e.config):{},a=(null===s||void 0===s?void 0:s.processKey)||i(e,this.moddle),c=["bpmn:TextAnnotation","bpmn:Association","bpmn:DataOutputAssociation","bpmn:DataInputAssociation"],l=-1===c.indexOf(o);l&&!e.get("name")&&e.set("name",""),this.createNodeAsync(a,e,r)}else this.handleUnsupportedElement(o,t,e,n,r)},createNodeAsync:function(e,t,n){var r=this;return l(a().mark((function o(){var i;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:i=r.createNode(e,t,n),r.isMultiplayer?r.loadNodeForMultiplayer(i):Un.commit("addNode",i);case 2:case"end":return o.stop()}}),o)})))()},loadNodeForMultiplayer:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if("processmaker-modeler-lane"!==e.type){n.next=10;break}return n.next=3,t.addNode(e,e.definition.id,!0);case 3:return t.nodeIdGenerator.updateCounters(),n.next=6,t.$nextTick();case 6:return n.next=8,t.paperManager.awaitScheduledUpdates();case 8:return window.ProcessMaker.EventBus.$emit("multiplayer-addLanes",[e]),n.abrupt("return");case 10:t.multiplayerHook(e,!1),Un.commit("addNode",e),t.poolTarget=null;case 13:case"end":return n.stop()}}),n)})))()},createNode:function(e,t,n){return po.isTimerType(e)?new Mx(e,t,n):(Object.keys(t).forEach((function(e){void 0!==t[e]&&null!==t[e]||delete t[e]})),new po(e,t,n))},hasSourceAndTarget:function(e){var t=e.sourceRef&&this.parsers[e.sourceRef.$type],n=e.targetRef&&this.parsers[e.targetRef.$type];return t&&n},waitForCursorToChange:function(){var e=this;return l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=300,t.next=3,e.$nextTick();case 3:return t.abrupt("return",new Promise((function(e){return setTimeout(e,n)})));case 4:case"end":return t.stop()}}),t)})))()},renderPaper:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isRendering=!0,t.next=3,e.paperManager.performAtomicAction(l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.waitForCursorToChange();case 2:e.parse(),e.addPools(),e.setUpDiagram();case 5:case"end":return t.stop()}}),t)}))));case 3:return t.next=5,e.paperManager.awaitScheduledUpdates();case 5:e.isRendering=!1,e.$emit("parsed");case 7:case"end":return t.stop()}}),t)})))()},loadXML:function(){var e=arguments,t=this;return l(a().mark((function n(){var r,o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:null,o=!1,null===r&&(r=t.currentXML,o=!0),n.next=5,t.xmlManager.getDefinitionsFromXml(r);case 5:return t.definitions=n.sent,t.xmlManager.definitions=t.definitions,t.nodeIdGenerator=B(t.definitions),Un.commit("clearNodes"),n.next=11,t.renderPaper();case 11:o&&window.ProcessMaker.EventBus.$emit("modeler-change");case 12:case"end":return n.stop()}}),n)})))()},getBoundaryEvents:function(e){return e.get("flowElements").filter((function(e){var t=e.$type;return"bpmn:BoundaryEvent"===t}))},createBoundaryEvent:function(e){var t=Cg.definition(this.moddle,this.$t);return t.set("id",e.get("id")),t.set("name",e.get("name")),t.set("eventDefinitions",e.get("eventDefinitions")),t.set("cancelActivity",e.get("cancelActivity")),t.set("attachedToRef",e.get("attachedToRef")),t.set("color",e.get("color")),t.$parent=e.$parent,e.get("outgoing").length>0&&t.set("outgoing",e.get("outgoing")),t},ensureCancelActivityIsAddedToBoundaryEvents:function(e){var t=this;this.getBoundaryEvents(e).forEach((function(n){var r=t.createBoundaryEvent(n);n.get("outgoing").forEach((function(e){return e.set("sourceRef",r)})),t.replaceDefinition(n,r,e)}))},replaceDefinition:function(e,t,n){var r=n.get("flowElements").indexOf(e);n.flowElements[r]=t;var o=this.planeElements.find((function(t){return t.bpmnElement===e}));o.bpmnElement=t},toXML:function(e){this.moddle.toXML(this.definitions,{format:!0},e)},onCreateElementHandler:function(e){var t=e.event,n=e.control;this.handleDrop({clientX:t.clientX,clientY:t.clientY,control:n})},addRemoteNode:function(e){var t=this;return l(a().mark((function n(){var r,o,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.nodeRegistry[e.type].definition(t.moddle,t.$t),o=t.nodeRegistry[e.type].diagram(t.moddle),o.bounds.x=e.x,o.bounds.y=e.y,i=t.createNode(e.type,r,o),n.next=7,t.addNode(i,e.id,!0);case 7:return n.next=9,t.$nextTick();case 9:return n.next=11,t.paperManager.awaitScheduledUpdates();case 11:t.autoValidate&&t.validateBpmnDiagram();case 12:case"end":return n.stop()}}),n)})))()},handleDrop:function(e){var t=this;return l(a().mark((function n(){var r,o,i,s,c,l,d,u,h,p,f;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.clientX,o=e.clientY,i=e.control,s=e.nodeThatWillBeReplaced,t.validateDropTarget({clientX:r,clientY:o,control:i}),t.allowDrop){n.next=4;break}return n.abrupt("return");case 4:return c=t.nodeRegistry[i.type].definition(t.moddle,t.$t),l=t.nodeRegistry[i.type].diagram(t.moddle),d=t.paperManager.clientToGridPoint(r,o),u=d.x,h=d.y,l.bounds.x=u,l.bounds.y=h,p=t.createNode(i.type,c,l),p.isBpmnType("bpmn:BoundaryEvent")&&t.setShapeCenterUnderCursor(l),t.highlightNode(p),n.next=14,t.addNode(p);case 14:if(s){n.next=16;break}return n.abrupt("return");case 16:return f=new Vx(s,c,t.graph,p,t.processes,t.collaboration),f.migrate(),n.abrupt("return",p);case 19:case"end":return n.stop()}}),n)})))()},setShapeCenterUnderCursor:function(e){e.bounds.x-=e.bounds.width/2,e.bounds.y-=e.bounds.height/2},selectNewNode:function(e){var t=this;return l(a().mark((function n(){var r,o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$nextTick();case 2:return n.next=4,t.paperManager.awaitScheduledUpdates();case 4:return r=t.$refs.nodeComponent.find((function(t){return t.node===e})),o=r.shapeView,n.next=8,t.$refs.selector.selectElement(o);case 8:case"end":return n.stop()}}),n)})))()},multiplayerHook:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=["processmaker-modeler-lane","processmaker-modeler-generic-flow","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-data-input-association","processmaker-modeler-data-input-association","processmaker-modeler-boundary-timer-event","processmaker-modeler-boundary-error-event","processmaker-modeler-boundary-signal-event","processmaker-modeler-boundary-conditional-even","processmaker-modeler-boundary-message-event"];if(this.isMultiplayer&&!t){if(!r.includes(e.type)&&!this.flowTypes.includes(e.type)){var o,i={x:e.diagram.bounds.x,y:e.diagram.bounds.y,height:e.diagram.bounds.height,width:e.diagram.bounds.width,type:e.type,id:e.definition.id,oldNodeId:null,isAddingLaneAbove:!0,color:e.definition.color,dueIn:e.definition.dueIn,name:e.definition.name,assignedUsers:e.definition.assignedUsers,config:e.definition.config,loopCharacteristics:null,gatewayDirection:null,messageRef:null,extras:{}};if(null!==e&&void 0!==e&&null!==(o=e.pool)&&void 0!==o&&o.component&&(i["poolId"]=e.pool.component.id),n)return i;window.ProcessMaker.EventBus.$emit("multiplayer-addNode",i)}if(this.flowTypes.includes(e.type)){var s,a,c,l,d,u,h=null===(s=e.definition.sourceRef)||void 0===s?void 0:s.id,p=null===(a=e.definition.targetRef)||void 0===a?void 0:a.id;if("processmaker-modeler-data-input-association"===e.type)h=Array.isArray(e.definition.sourceRef)&&(null===(c=e.definition.sourceRef[0])||void 0===c?void 0:c.id),p=null===(l=e.definition.targetRef)||void 0===l||null===(d=l.$parent)||void 0===d||null===(u=d.$parent)||void 0===u?void 0:u.get("id");var f=[];if(e.diagram.waypoint.forEach((function(e){f.push({x:e.x,y:e.y})})),h&&p){var m={id:e.definition.id,type:e.type,sourceRefId:h,targetRefId:p,waypoint:f,name:e.definition.name,conditionExpression:null};if(n)return m;window.ProcessMaker.EventBus.$emit("multiplayer-addFlow",m)}}}},addNode:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]?t[1]:null,i=t.length>2&&void 0!==t[2]&&t[2],e.pool||(e.pool=n.poolTarget),s=e.getTargetProcess(n.processes,n.processNode),hx(e,s),e.setIds(n.nodeIdGenerator,o),n.planeElements.push(e.diagram),n.multiplayerHook(e,i),Un.commit("addNode",e),n.poolTarget=null,![gl,dl,er,El,_r,Ir,fo].includes(e.type)){r.next=12;break}return r.abrupt("return");case 12:return i||n.selectNewNode(e),r.abrupt("return",new Promise((function(e){setTimeout((function(){n.pushToUndoStack(),e()}))})));case 14:case"end":return r.stop()}}),r)})))()},addClonedNodes:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.forEach((function(e){e.pool||(e.pool=t.poolTarget);var n=e.getTargetProcess(t.processes,t.processNode);hx(e,n),t.planeElements.push(e.diagram),t.multiplayerHook(e,!1),Un.commit("addNode",e),t.poolTarget=null}));case 1:case"end":return n.stop()}}),n)})))()},removeNode:function(e,t){var n=this;return l(a().mark((function r(){return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:n.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-removeNode",e),n.removeNodeProcedure(e,t);case 2:case"end":return r.stop()}}),r)})))()},removeNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=t.length>1&&void 0!==t[1]?t[1]:{},i=o.removeRelationships,s=void 0===i||i,e){r.next=3;break}return r.abrupt("return");case 3:return s&&(Br(e,n),Lr(e,n),jr(e,n)),zr(e),Fr(n.graph,e,n.removeNode),Ur(e),n.removeNodesFromLane(e),n.removeNodesFromPool(e),Un.commit("removeNode",e),Un.commit("highlightNode",n.processNode),n.$refs.selector.clearSelection(),r.next=14,n.$nextTick();case 14:return r.next=16,n.pushToUndoStack();case 16:n.processes=n.getProcesses(),n.processes&&n.processes.length>0&&(n.processNode=new po("processmaker-modeler-process",n.processes[0],n.planeElements.find((function(e){return e.bpmnElement.id===n.processes[0].id}))));case 18:case"end":return r.stop()}}),r)})))()},removeNodes:function(){var e=this;return l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.performSingleUndoRedoTransaction(l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.paperManager.performAtomicAction(l(a().mark((function t(){var n;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=[],e.highlightedNodes.forEach((function(t){return n.push(e.removeNode(t,{removeRelationships:!0}))})),t.next=4,Promise.all(n);case 4:Un.commit("highlightNode");case 5:case"end":return t.stop()}}),t)}))));case 2:case"end":return t.stop()}}),t)}))));case 2:case"end":return t.stop()}}),t)})))()},replaceNode:function(e){var t=this,n=e.node,r=e.typeToReplaceWith;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){var o,i,s,c;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o=n.diagram.bounds,i=o.x,s=o.y,c={x:i,y:s,control:{type:r},nodeThatWillBeReplaced:n},e.next=4,t.replaceNodeProcedure(c,!0);case 4:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},replaceNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function r(){var o,i,s,c;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return o=t.length>1&&void 0!==t[1]&&t[1],o&&(i=n.paper.localToClientPoint(e.nodeThatWillBeReplaced.diagram.bounds),s=i.x,c=i.y,e.clientX=s,e.clientY=c),r.next=4,n.handleDrop(e);case 4:return r.next=6,n.removeNode(e.nodeThatWillBeReplaced,{removeRelationships:!1,isReplaced:o});case 6:case"end":return r.stop()}}),r)})))()},replaceAiNode:function(e){var t=this,n=e.node,r=e.typeToReplaceWith,o=e.assetId,i=e.assetName,s=e.redirectTo;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){var c,l,d,u;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return c=t.paper.localToClientPoint(n.diagram.bounds),l=c.x,d=c.y,e.next=3,t.handleDrop({clientX:l,clientY:d,control:{type:r},nodeThatWillBeReplaced:n});case 3:return u=e.sent,"processmaker-modeler-task"===r&&(u.definition.screenRef=o,u.definition.name=i),"processmaker-modeler-script-task"===r&&(u.definition.scriptRef=o,u.definition.name=i),"processmaker-modeler-call-activity"===r&&(u.definition.name=i,u.definition.calledElement="ProcessId-".concat(o),u.definition.config='{"calledElement":"ProcessId-'.concat(o,'","processId":').concat(o,',"startEvent":"node_1","name":"').concat(i,'"}'),s="".concat(s,"/").concat(u.id)),e.next=9,t.removeNode(n,{removeRelationships:!1});case 9:return t.highlightNode(u),t.selectNewNode(u),e.next=13,t.pushToUndoStack();case 13:return e.next=15,t.$nextTick();case 15:t.saveBpmn(s,u.id);case 16:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},replaceGenericFlow:function(e){var t=this,n=e.actualFlow,r=e.genericFlow,o=e.targetNode;this.performSingleUndoRedoTransaction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.paperManager.performAtomicAction(l(a().mark((function e(){return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.highlightNode(null);case 2:return e.next=4,t.$nextTick();case 4:return e.next=6,Un.commit("removeNode",r);case 6:return e.next=8,t.$nextTick();case 8:return e.next=10,t.addNode(n,r.definition.id);case 10:return e.next=12,t.$nextTick();case 12:return e.next=14,t.highlightNode(o);case 14:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)}))))},performSingleUndoRedoTransaction:function(e){var t=this;return l(a().mark((function n(){return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return Qv.commit("disableSavingState"),n.next=3,e();case 3:return Qv.commit("enableSavingState"),n.next=6,t.pushToUndoStack();case 6:case"end":return n.stop()}}),n)})))()},removeNodesFromLane:function(e){var t=e.pool&&e.pool.component.laneSet&&e.pool.component.laneSet.get("lanes").find((function(t){return t.get("flowNodeRef").includes(e.definition)}));t&&Cs()(t.get("flowNodeRef"),e.definition)},removeNodesFromPool:function(e){var t=this;if("processmaker-modeler-pool"===e.type&&e.definition.processRef){e.definition.processRef.artifacts&&e.definition.processRef.artifacts.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)})),e.definition.processRef.flowElements&&e.definition.processRef.flowElements.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)}));var n=e.definition.processRef.laneSets;n&&n.length>0&&n[0].lanes.forEach((function(e){var n=t.nodes.find((function(t){return t.definition===e}));n&&t.removeNode(n)}))}},handleResize:function(){var e=this.$el.parentElement,t=e.clientWidth,n=e.clientHeight;this.parentWidth=t+"px",this.parentHeight=n+"px",this.paperManager.setPaperDimensions(t,n)},validateDropTarget:function(e){var t=e.clientX,n=e.clientY,r=e.control,o=Hb(t,n,r,this.paperManager.paper,this.graph,this.collaboration,this.$refs["paper-container"]),i=o.allowDrop,s=o.poolTarget;this.allowDrop=i,this.poolTarget=s},isBpmnNode:function(e){return null!=e.component},setShapeStacking:function(e){var t=this;this.isRendering||!e.component.node.isType("processmaker-modeler-pool")&&e===this.previouslyStackedShape||(this.previouslyStackedShape=e,this.paperManager.performAtomicAction((function(){return uw(e,t.graph)})))},showSavedNotification:function(){Qv.dispatch("saved")},enableVersions:function(){Qv.dispatch("enableVersions")},setVersionIndicator:function(e){Qv.dispatch("setVersionIndicator",e)},setLoadingState:function(e){Qv.dispatch("setLoadingState",e)},clearSelection:function(){this.$refs.selector.clearSelection()},isPointInSelection:function(e){var t=this.$refs.selector.$el;if("function"===typeof t.getBoundingClientRect){var n=t.getBoundingClientRect(),r=n.x,o=n.y,i=n.width,s=n.height;if(e.clientX>=r&&e.clientX<=r+i&&e.clientY>=o&&e.clientY<=o+s)return!0}return!1},pointerDowInShape:function(e,t){var n=this;return l(a().mark((function r(){var o,i,s;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=e.clientX,i=e.clientY,s=n.paper.findViewByModel(t),n.isDragging=!1,n.isSelecting=!1,n.isIntoTheSelection=!1,n.dragStart={x:o,y:i},!n.isPointInSelection(e)){r.next=10;break}n.isIntoTheSelection=!0,r.next=15;break;case 10:if(e.shiftKey){r.next=15;break}return r.next=13,n.$refs.selector.selectElement(s);case 13:return r.next=15,n.$nextTick();case 15:n.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY});case 16:case"end":return r.stop()}}),r)})))()},pointerDownHandler:function(e){var t=e.clientX,n=e.clientY;this.isDragging=!1,this.isSelecting=!1,this.isIntoTheSelection=!1,this.dragStart={x:t,y:n},this.isPointInSelection(e)?(this.isIntoTheSelection=!0,this.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY})):(this.isSelecting=!0,this.$refs.selector.startSelection(e))},pointerMoveHandler:function(e){var t=e.clientX,n=e.clientY;Un.getters.isReadOnly?this.canvasDragPosition&&!this.clientLeftPaper&&this.paperManager.translate(e.offsetX-this.canvasDragPosition.x,e.offsetY-this.canvasDragPosition.y):this.isGrabbing||(this.dragStart&&(Math.abs(t-this.dragStart.x)>5||Math.abs(n-this.dragStart.y)>5)?(this.isDragging=!0,this.dragStart=null):this.isSelecting?this.$refs.selector.updateSelection(e):this.isDragging&&this.$refs.selector.drag(e))},pointerUpHandler:function(e,t){!this.isDragging&&this.dragStart?t?this.$refs.selector.selectElement(t,e.shiftKey):this.clearSelection():this.isSelecting?this.$refs.selector.endSelection(this.paperManager.paper):this.$refs.selector.stopDrag(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e),this.isDragging=!1,this.dragStart=null,this.isSelecting=!1},redirect:function(e){window.location=e},enableMultiplayer:function(e){Un.commit("enableMultiplayer",e)},addPlayer:function(e){this.players.push(e)},removePlayer:function(e){var t=this.players.findIndex((function(t){return t.id===e}));-1!==t&&this.players.splice(t,1)}},created:function(){Ss()&&(window.store=Un,window.undoRedoStore=Qv),this.$t=this.$t.bind(this),window.ProcessMaker.EventBus.$emit("modeler-before-init",{registerComponentMixin:this.registerComponentMixin}),this.registerNode(Pv),window.ProcessMaker.EventBus.$emit("modeler-init",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,registerInspectorExtension:sw,registerBpmnExtension:this.registerBpmnExtension,registerNode:this.registerNode,registerStatusBar:this.registerStatusBar,registerPmBlock:this.registerPmBlock,registerPreview:this.registerPreview}),this.moddle=new(Eg())(this.extensions),this.linter=new eb.Linter(Vb),this.xmlManager=new jx(this.moddle),this.$emit("set-xml-manager",this.xmlManager)},mounted:function(){var e=this;Un.commit("setReadOnly",this.readOnly),this.graph=new F.dia.Graph,Un.commit("setGraph",this.graph),this.graph.set("interactiveFunc",(function(e){var t="standard.EmbeddedImage"===e.model.get("type");return{elementMove:t,labelMove:!1}})),this.paperManager=iw.factory(this.$refs.paper,this.graph.get("interactiveFunc"),this.graph),this.paper=this.paperManager.paper,this.paperManager.addEventHandler("cell:pointerdblclick",Px),this.handleResize(),window.addEventListener("resize",this.handleResize),Un.commit("setPaper",this.paperManager.paper),this.paperManager.addEventHandler("element:pointerclick",this.blurFocusedScreenBuilderElement,this),this.paperManager.addEventHandler("blank:pointerdown",(function(t,n,r){if(!e.isGrabbing){Un.getters.isReadOnly&&(e.isGrabbing=!0);var o=e.paperManager.scale;e.canvasDragPosition={x:n*o.sx,y:r*o.sy},e.isOverShape=!1,e.pointerDownHandler(t)}}),this),this.paperManager.addEventHandler("cell:mouseover element:mouseover",(function(t){var n=t.model;e.isBpmnNode(n)&&"default"!==n.attr("body/cursor")&&!e.isGrabbing&&n.attr("body/cursor","move"),e.isGrabbing&&e.isBpmnNode(n)&&n.attr("body/cursor","grabbing")})),this.paperManager.addEventHandler("blank:pointerup",(function(t){e.isGrabbing=!1,e.canvasDragPosition=null,e.activeNode=null,e.pointerUpHandler(t)}),this),this.paperManager.addEventHandler("cell:pointerup",(function(t,n){e.canvasDragPosition=null,e.activeNode=null,e.pointerUpHandler(n,t)}),this),this.$refs["paper-container"].addEventListener("mouseenter",(function(){Un.commit("setClientLeftPaper",!1)})),this.$el.addEventListener("mousemove",(function(t){e.pointerMoveHandler(t)})),this.$refs["paper-container"].addEventListener("mouseleave",(function(){e.paperManager.removeEventHandler("blank:pointermove"),Un.commit("setClientLeftPaper",!0)})),this.paperManager.addEventHandler("cell:pointerclick",(function(e,t,n,r){var o=e.model.get("onClick");o&&o(e,t,n,r)})),this.paperManager.addEventHandler("cell:pointerclick",(function(t,n){var r=t.model;e.isBpmnNode(r)&&(e.isGrabbing||(r.component.$emit("click",n),e.$emit("click",{event:n,node:e.highlightedNode.definition})))})),this.paperManager.addEventHandler("cell:pointerdown",(function(t,n){var r=t.model;e.isBpmnNode(r)&&(e.isGrabbing||(e.setShapeStacking(r),e.activeNode=r.component.node,e.isOverShape=!0,e.pointerDowInShape(n,r)))})),this.paperManager.addEventHandler("cell:pointermove",(function(t,n,r,o){if(e.isGrabbing){if(!e.canvasDragPosition){var i=e.paperManager.scale;e.canvasDragPosition={x:r*i.sx,y:o*i.sy}}e.canvasDragPosition&&!e.clientLeftPaper&&e.paperManager.translate(n.offsetX-e.canvasDragPosition.x,n.offsetY-e.canvasDragPosition.y)}})),window.ProcessMaker.EventBus.$emit("modeler-start",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,loadXML:function(){var t=l(a().mark((function t(n){var r;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.loadXML(n);case 2:return t.next=4,Qv.dispatch("pushState",n);case 4:try{r=new QI(e),r.init(),e.multiplayer=r}catch(o){console.warn("Could not initialize multiplayer",o)}case 5:case"end":return t.stop()}}),t)})));function n(e){return t.apply(this,arguments)}return n}(),addWarnings:function(t){return e.$emit("warnings",t)},addBreadcrumbs:function(t){return e.breadcrumbData.push(t)}}),this.$root.$on("replace-ai-node",(function(t){e.replaceAiNode(t)})),window.ProcessMaker.EventBus.$on("save-changes",(function(t){t&&e.redirect(t)}))}},tO=eO,nO=(f(75317),fr(tO,fg,mg,!1,null,null,null)),rO=nO.exports,oO=f(87299),iO=f.n(oO),sO={extends:zp,mixins:[tc],data:function(){return{nodeIcon:iO(),iconName:""}}},aO=sO,cO=fr(aO,GI,$I,!1,null,null,null),lO=cO.exports,dO=76,uO="processmaker-modeler-manual-task",hO={id:uO,component:lO,bpmnType:"bpmn:ManualTask",control:!1,category:"BPMN",icon:f(8565),label:io[uO],loopInspectorIndex:1,definition:function(e,t){return e.create("bpmn:ManualTask",{name:t(io[uO]),assignment:"requester",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:dO,width:116})})},inspectorConfig:[{name:io[uO],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-manual-task"},items:[{component:"FormInput",config:_a}]},Va,Na]}]},pO={extends:hd,data:function(){return{nodeIcon:ap()}},mounted:function(){var e=this.node.diagram.bounds;this.shape.attr({image:{"ref-x":7,"ref-y":7,width:e.get("width")-14,height:e.get("height")-14}})}},fO=pO,mO=fr(fO,XI,YI,!1,null,null,null),gO=mO.exports,vO="processmaker-modeler-conditional-start-event",bO=ac()(ho()(Md),Qr(Qr({},pp),{},{id:vO,component:gO,label:to[vO],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(to[vO]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),yO=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},wO=[],xO={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialDataAssociationDirection:this.node.definition.dataAssociationDirection}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.definition.$type");if(!e)return!1;var t=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],n=["bpmn:Task","bpmn:SubProcess","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],r="bpmn:DataStoreReference"===this.sourceNode.definition.$type,o="bpmn:DataObjectReference"===this.sourceNode.definition.$type;return!(!r||!t.includes(e))||o&&n.includes(e)}},methods:{findSourceShape:function(){if(this.node.dataAssociationProps)return this.node.dataAssociationProps.sourceShape;var e=this.node.definition.sourceRef[0],t=this.graph.getElements().find((function(t){return t.component.node.definition===e}));return t},getTargetRef:function(){return this.node.dataAssociationProps?this.node.dataAssociationProps.targetCoords:Vr(this.node.definition.targetRef.$parent,this.$parent)},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement(),t=qr(this.moddle,e.component.node,this.sourceNode.definition);this.node.definition.set("targetRef",t),this.node.definition.set("sourceRef",[this.sourceNode.definition]),e.component.node.definition.set("dataInputAssociations",[this.node.definition])}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this},destroyed:function(){this.targetNode&&(Hr(this.targetNode,this.sourceNode.definition),(0,Er.pull)(this.targetNode.definition.get("dataInputAssociations"),this.node.definition))}},kO=xO,CO=fr(kO,yO,wO,!1,null,null,null),SO=CO.exports,EO=function(){function e(t,n,r){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=r}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var r=this,o=Nr(this.moddle),i=Dr(this.moddle),s=qr(this.moddle,t.component.node,e.component.node.definition);i.set("targetRef",s),i.set("sourceRef",[e.component.node.definition]),o.waypoint=n.map((function(e){return r.moddle.create("dc:Point",e)}));var a=new po(Ir,i,o);return a}}]),e}(),AO=Qr(Qr({},t),{},{component:SO,control:!1,inspectorConfig:[{name:"Data Input Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-input-association"},items:[{component:"FormInput",config:Ns}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new EO(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),i.component.node.definition.set("dataInputAssociations",[c.definition]),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),_O=function(){var e=this,t=e._self._c;return t("crown-config",e._g({attrs:{highlighted:e.highlighted,paper:e.paper,graph:e.graph,shape:e.shape,node:e.node,nodeRegistry:e.nodeRegistry,moddle:e.moddle,collaboration:e.collaboration,"process-node":e.processNode,"plane-elements":e.planeElements,"is-rendering":e.isRendering}},e.$listeners))},TO=[],MO={components:{CrownConfig:Ts},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[Kn],data:function(){return{shape:null,initialDataAssociationDirection:this.node.definition.dataAssociationDirection}},computed:{isValidConnection:function(){var e=$()(this.target,"component.node.type");if(!e)return!1;var t="bpmn:DataObjectReference"!==this.targetConfig.bpmnType&&"bpmn:DataStoreReference"!==this.targetConfig.bpmnType;return!t}},methods:{findSourceShape:function(){var e=this;return this.node.dataAssociationProps?this.node.dataAssociationProps.sourceShape:this.graph.getElements().find((function(t){return t.component&&t.component.node.definition.get("dataOutputAssociations")&&t.component.node.definition.get("dataOutputAssociations").includes(e.node.definition)}))},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){this.node.definition.set("targetRef",this.targetNode.definition);var e=this.sourceNode.definition.get("dataOutputAssociations")||[];this.sourceNode.definition.set("dataOutputAssociations",[].concat(W(e),[this.node.definition]))}},mounted:function(){this.shape=new F.shapes.standard.Link({router:{name:"normal"}}),this.shape.attr({line:{stroke:"black",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"1, 8",strokeDashoffset:"5",targetMarker:{type:"image","xlink:href":Qn,width:20,height:20,y:-10}}}),this.shape.addTo(this.graph),this.shape.component=this},destroyed:function(){(0,Er.pull)(this.sourceNode.definition.get("dataOutputAssociations"),this.node.definition)}},PO=MO,IO=fr(PO,_O,TO,!1,null,null,null),OO=IO.exports,DO=Qr(Qr({},e),{},{component:OO,control:!1,inspectorConfig:[{name:"Data Output Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-output-association"},items:[{component:"FormInput",config:Ns}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var r,o,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=e.paper,o=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),o&&i&&(s=new Uk(e.nodeRegistry,e.moddle,r),c=s.makeFlowNode(o,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),NO=JSON.parse('{"name":"ProcessMaker","uri":"http://processmaker.com/BPMN/2.0/Schema.xsd","prefix":"pm","xml":{"tagAlias":"lowerCase"},"associations":[],"types":[{"name":"BaseElement","extends":["bpmn:BaseElement"],"isAbstract":true,"properties":[{"name":"color","isAttr":true,"type":"String"}]},{"name":"Task","extends":["bpmn:Task"],"properties":[{"name":"screenRef","isAttr":true,"type":"String"},{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"screenVersion","isAttr":true,"type":"String"},{"name":"dueIn","isAttr":true,"type":"Integer"},{"name":"notifyAfterRouting","isAttr":true,"type":"Boolean"},{"name":"notifyRequestCreator","isAttr":true,"type":"Boolean"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"assignmentLock","isAttr":true,"type":"Boolean"},{"name":"allowReassignment","isAttr":true,"type":"Boolean"},{"name":"assignmentRules","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"customIcon","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"ScriptTask","extends":["bpmn:ScriptTask"],"properties":[{"name":"scriptRef","isAttr":true,"type":"String"},{"name":"scriptVersion","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"ServiceTask","extends":["bpmn:ServiceTask"],"properties":[{"name":"implementationVersion","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"Message","extends":["bpmn:Message"],"properties":[{"name":"payload","isAttr":true,"type":"String"}]},{"name":"EndEvent","extends":["bpmn:EndEvent"],"properties":[{"name":"screenRef","isAttr":true,"type":"String"},{"name":"screenVersion","isAttr":true,"type":"String"}]},{"name":"StartEvent","extends":["bpmn:StartEvent"],"properties":[{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"IntermediateCatchEvent","extends":["bpmn:IntermediateCatchEvent"],"properties":[{"name":"allowedUsers","isAttr":true,"type":"String"},{"name":"allowedGroups","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"whitelist","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"}]},{"name":"MessageEventDefinition","extends":["bpmn:MessageEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"}]},{"name":"MessageEventDefinition","extends":["bpmn:MessageEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinition","extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"config","isAttr":true,"type":"String"}]},{"name":"SequenceFlow","extends":["bpmn:SequenceFlow"],"properties":[{"name":"config","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"allowInterstitial","isAttr":true,"type":"Boolean"},{"name":"interstitialScreenRef","isAttr":true,"type":"String"},{"name":"config","isAttr":true,"type":"String"},{"name":"validations","isAttr":true,"type":"String"},{"name":"assignment","isAttr":true,"type":"String"},{"name":"assignedUsers","isAttr":true,"type":"String"},{"name":"assignedGroups","isAttr":true,"type":"String"},{"name":"customIcon","isAttr":true,"type":"String"},{"name":"errorHandling","isAttr":true,"type":"String"}]},{"name":"Signal","extends":["bpmn:Signal"],"properties":[{"name":"config","isAttr":true,"type":"String"},{"name":"detail","isAttr":true,"type":"String"}]}],"emumerations":[]}'),RO=[Id,Am,Rm,Wa,gf,Hf,hO,Bf,Wf,Bc,Wc,sl,Kc,vl,Al,Bs,AO,DO,sg,Um,em],BO=[[Ud,"bpmn:StartEvent","bpmn:SignalEventDefinition"],[Cu,"bpmn:StartEvent","bpmn:TimerEventDefinition"],[Yd,"bpmn:StartEvent","bpmn:MessageEventDefinition"],[bO,"bpmn:StartEvent","bpmn:ConditionalEventDefinition"],[fh,"bpmn:IntermediateCatchEvent","bpmn:TimerEventDefinition"],[Nh,"bpmn:IntermediateCatchEvent","bpmn:MessageEventDefinition"],[Vh,"bpmn:IntermediateCatchEvent","bpmn:SignalEventDefinition"],[Zh,"bpmn:IntermediateThrowEvent","bpmn:MessageEventDefinition"],[ip,"bpmn:IntermediateThrowEvent","bpmn:SignalEventDefinition"],[mp,"bpmn:IntermediateCatchEvent","bpmn:ConditionalEventDefinition"],[nw,"bpmn:BoundaryEvent","bpmn:TimerEventDefinition"],[vy,"bpmn:BoundaryEvent","bpmn:ErrorEventDefinition"],[Oy,"bpmn:BoundaryEvent","bpmn:EscalationEventDefinition"],[zy,"bpmn:BoundaryEvent","bpmn:MessageEventDefinition"],[Xy,"bpmn:BoundaryEvent","bpmn:SignalEventDefinition"],[Ey,"bpmn:BoundaryEvent","bpmn:ConditionalEventDefinition"],[Hl,"bpmn:EndEvent","bpmn:MessageEventDefinition"],[uc,"bpmn:EndEvent","bpmn:ErrorEventDefinition"],[sd,"bpmn:EndEvent","bpmn:SignalEventDefinition"],[yc,"bpmn:EndEvent","bpmn:TerminateEventDefinition"]],LO=function(e,t,n){return function(r){var o=r.get("eventDefinitions"),i=r.$type===t&&o&&o.length&&o[0].$type===n;if(i)return e.id}};function jO(e){var t=e.registerNode,n=e.registerBpmnExtension;BO.forEach((function(e){var n=jt(e,3),r=n[0],o=n[1],i=n[2];t(r,LO(r,o,i))})),RO.forEach((function(e){return t(e)})),n("pm",NO)}}(),m}()}));
35
35
  //# sourceMappingURL=modeler.umd.min.js.map