@processmaker/modeler 1.46.1 → 1.46.3

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 t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object
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:o});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[o].concat(e.init):o,n.call(this,e)}}function o(){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:{},Ht=qt.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Vt(e){Ht&&(e._devtoolHook=Ht,Ht.emit("vuex:init",e),Ht.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){Ht.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){Ht.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 o=Array.isArray(e)?[]:{};return t.push({original:e,copy:o}),Object.keys(e).forEach((function(n){o[n]=Gt(e[n],t)})),o}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 o in n.modules){if(!t.getChild(o))return void 0;en(e.concat(o),t.getChild(o),n.modules[o])}}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 o=this;void 0===n&&(n=!0);var r=new Zt(t,n);if(0===e.length)this.root=r;else{var i=this.get(e.slice(0,-1));i.addChild(e[e.length-1],r)}t.modules&&$t(t.modules,(function(t,r){o.register(e.concat(r),t,n)}))},Qt.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],o=t.getChild(n);o&&o.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 o=e.strict;void 0===o&&(o=!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 r=this,i=this,s=i.dispatch,a=i.commit;this.dispatch=function(e,t){return s.call(r,e,t)},this.commit=function(e,t,n){return a.call(r,e,t,n)},this.strict=o;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&&Vt(this)},on={state:{configurable:!0}};function rn(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 o=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var r=e._wrappedGetters,i={};$t(r,(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),o&&(n&&e._withCommit((function(){o._data.$$state=null})),tn.nextTick((function(){return o.$destroy()})))}function cn(e,t,n,o,r){var i=!n.length,s=e._modules.getNamespace(n);if(o.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=o),!i&&!r){var a=mn(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){tn.set(a,c,o.state)}))}var l=o.context=ln(e,s,n);o.forEachMutation((function(t,n){var o=s+n;un(e,o,t,l)})),o.forEachAction((function(t,n){var o=t.root?n:s+n,r=t.handler||t;hn(e,o,r,l)})),o.forEachGetter((function(t,n){var o=s+n;pn(e,o,t,l)})),o.forEachChild((function(o,i){cn(e,t,n.concat(i),o,r)}))}function ln(e,t,n){var o=""===t,r={dispatch:o?e.dispatch:function(n,o,r){var i=gn(n,o,r),s=i.payload,a=i.options,c=i.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:o?e.commit:function(n,o,r){var i=gn(n,o,r),s=i.payload,a=i.options,c=i.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(r,{getters:{get:o?function(){return e.getters}:function(){return dn(e,t)}},state:{get:function(){return mn(e.state,n)}}}),r}function dn(e,t){if(!e._makeLocalGettersCache[t]){var n={},o=t.length;Object.keys(e.getters).forEach((function(r){if(r.slice(0,o)===t){var i=r.slice(o);Object.defineProperty(n,i,{get:function(){return e.getters[r]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function un(e,t,n,o){var r=e._mutations[t]||(e._mutations[t]=[]);r.push((function(t){n.call(e,o.state,t)}))}function hn(e,t,n,o){var r=e._actions[t]||(e._actions[t]=[]);r.push((function(t){var r=n.call(e,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:e.getters,rootState:e.state},t);return Yt(r)||(r=Promise.resolve(r)),e._devtoolHook?r.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):r}))}function pn(e,t,n,o){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(o.state,o.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))}on.state.get=function(){return this._vm._data.$$state},on.state.set=function(e){0},nn.prototype.commit=function(e,t,n){var o=this,r=gn(e,t,n),i=r.type,s=r.payload,a=(r.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,o.state)})))},nn.prototype.dispatch=function(e,t){var n=this,o=gn(e,t),r=o.type,i=o.payload,s={type:r,payload:i},a=this._actions[r];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 rn(e,this._subscribers,t)},nn.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return rn(n,this._actionSubscribers,t)},nn.prototype.watch=function(e,t,n){var o=this;return this._watcherVM.$watch((function(){return e(o.state,o.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,on);var bn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var o=An(this.$store,"mapState",e);if(!o)return;t=o.context.state,n=o.context.getters}return"function"===typeof r?r.call(this,t,n):t[r]},n[o].vuex=!0})),n})),yn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.commit;if(e){var i=An(this.$store,"mapMutations",e);if(!i)return;o=i.context.commit}return"function"===typeof r?r.apply(this,[o].concat(t)):o.apply(this.$store,[r].concat(t))}})),n})),wn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;r=e+r,n[o]=function(){if(!e||An(this.$store,"mapGetters",e))return this.$store.getters[r]},n[o].vuex=!0})),n})),xn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.dispatch;if(e){var i=An(this.$store,"mapActions",e);if(!i)return;o=i.context.dispatch}return"function"===typeof r?r.apply(this,[o].concat(t)):o.apply(this.$store,[r].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 o=e._modulesNamespaceMap[n];return o}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 o=e.transformer;void 0===o&&(o=function(e){return e});var r=e.mutationTransformer;void 0===r&&(r=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=r(e),u="mutation "+e.type+a;Mn(l,u,t),l.log("%c prev state","color: #9E9E9E; font-weight: bold",o(d)),l.log("%c mutation","color: #03A9F4; font-weight: bold",c),l.log("%c next state","color: #4CAF50; font-weight: bold",o(s)),Tn(l)}d=s})),c&&e.subscribeAction((function(e,n){if(i(e,n)){var o=Pn(),r=s(e),a="action "+e.type+o;Mn(l,a,t),l.log("%c action","color: #03A9F4; font-weight: bold",r),Tn(l)}})))}}function Mn(e,t,n){var o=n?e.groupCollapsed:e.group;try{o.call(e,t)}catch(r){e.log(t)}}function Tn(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 Nn={Store:nn,install:vn,version:"3.6.2",mapState:bn,mapMutations:yn,mapGetters:wn,mapActions:xn,createNamespacedHelpers:kn,createLogger:_n},Dn=Nn,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(Dn);var Un=new Dn.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,o=t.bounds;o&&Object.entries(o).forEach((function(e){var t=jt(e,2),o=t[0],r=t[1];"$type"!==o&&n.diagram.bounds.set(o,r)}))},updateNodeProp:function(e,t){var n=t.node,o=t.key,r=t.value;"id"==o&&n.definition.id!==r&&e.nodes.some((function(e){return e.definition.id===r}))||(Fn(n.definition,o,r),null==r&&zt()["delete"](n.definition,o))},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))),o=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||!o.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,o,r;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:o=t.sent,r=o.data,n("setGlobalProcesses",r.data),window.ProcessMaker.globalProcesses=r.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",Hn="#FF0000",Vn="#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:Tt}},watch:{target:function(e,t){t&&t!==e&&Dt(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()):(Dt(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:{setHighlightColor:function(e,t){e?(this.shape.attr({line:{stroke:t},".joint-highlight-stroke":{display:"none"}}),this.shapeView.showTools()):(Dt(this.shape),this.shapeView.hideTools())},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 o=this;if(e&&Zn(e))return this.shape[t](e,{anchor:{name:"modelCenter",args:{padding:25}},connectionPoint:{name:"boundary"}});var r=function(){var t=e.position(),o=t.x,r=t.y,i=e.size(),s=i.width,a=i.height;return n?{x:o+n.x,y:r+n.y}:{x:o+s/2,y:r+a/2}};this.shape[t](e,{anchor:function(){return o.getAnchorPointFunction(t)(r(),e.findView(o.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();Dt(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,o,r,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,o=e.linkView.sourceView.model.component.node.definition.id,r=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:o,targetRefId:r}}],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 o=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,o.$nextTick();case 3:return e.next=5,o.waitForUpdateWaypoints();case 5:return o.listeningToMouseleave=!1,e.next=8,o.storeWaypoints();case 8:case"end":return e.stop()}}),e)})))()},onChangeVertices:function(e,t,n){var o=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 o.updateWaypoints(),e.next=4,o.$nextTick();case 4:o.listeningToMouseleave=!1,o.$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,o=e.clientY,r=this.paper.clientToLocalPoint({x:n,y:o});if(this.target=this.graph.findModelsFromPoint(r).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:r.x,y:r.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"),Dt(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&&Dt(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")}),o=new F.dia.ToolsView({tools:[e,t,n]});this.shapeView.addTools(o),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,o,r,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?(o=e.graph.getElements().find((function(e){return e.component&&e.component.node.definition===n})),e.target=o,r=e.node.diagram.waypoint,i=e.node.diagram.waypoint[0],s=r[r.length-1],c=o.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},r&&(g=r.slice(1,r.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(o,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",eo="processmaker-modeler-association",to="bpmn:Association",no={none:"None",one:"One",both:"Both"};function oo(e){return e.create(to,{associationDirection:no.none,targetRef:{x:void 0,y:void 0}})}function ro(e){return e.create("bpmndi:BPMNEdge")}var io=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()},so=[],ao=(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()}),co=[],lo=(f(85827),f.p+"img/trash-alt-solid.9d41abd9.svg"),uo=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)},ho=[],po={props:{id:String,ariaLabel:String,src:String,width:{type:Number,default:19},height:{type:Number,default:20}}},fo=po;f(21353);function mo(e,t,n,o,r,i,s,a){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),o&&(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__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):r&&(c=a?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),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 go=mo(fo,uo,ho,!1,null,"09d8a8ac",null),vo=go.exports,bo=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],yo=bo,wo={components:{CrownButton:vo},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lo,validPreviewElements:yo,displayIcon:!1}},mounted:function(){var e=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return e[o]=r,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)}}},xo=wo,ko=mo(xo,ao,co,!1,null,null,null),Co=ko.exports,So=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"})])},Eo=[],Ao=f(50467),_o=f.n(Ao),Mo="processmaker-modeler-data-output-association",To="bpmn:DataOutputAssociation";function Po(e){return e.create("bpmn:DataOutputAssociation",{targetRef:{x:void 0,y:void 0}})}function Io(e){return e.create("bpmndi:BPMNEdge")}var Oo="processmaker-modeler-data-input-association",No="bpmn:DataInputAssociation";function Do(e){return e.create("bpmn:DataInputAssociation",{targetRef:{x:void 0,y:void 0}})}function Ro(e){return e.create("bpmndi:BPMNEdge")}function Bo(e,t){var n=this,o=e.getConnectedLinks(t);o.forEach((function(e){return n.$emit("remove-node",e.component.node)}))}function Lo(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 jo(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 Fo(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 zo(e,t,n){var o=e.getCells().find((function(e){return e.component&&e.component.node===t}));o&&o.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 Uo(e){if(!e.isBpmnType(To,No)){var t=e.definition,n=t.sourceRef,o=t.targetRef;n&&(0,Ao.pull)(n.get("outgoing"),e.definition),o&&o.id&&(0,Ao.pull)(o.get("incoming"),e.definition)}}function qo(e){var t=(0,Ao.get)(e,"definition.sourceRef.default.id",null);t&&t===e.id&&e.definition.sourceRef.set("default",null)}function Ho(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 o=n.id,r="data_input_".concat(o);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===r}));i||(t.definition.ioSpecification.dataInputs.push(e.create("bpmn:DataInput",{id:r,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===r})),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===r}));return c||a.dataInputRefs.push(i),i}function Vo(e,t){var n,o=e.$parent;return o||(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 Wo(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,o="data_input_".concat(n);if(e.definition.ioSpecification&&e.definition.ioSpecification.dataInputs){var r=e.definition.ioSpecification.dataInputs.find((function(e){return e.id===o}));if(r&&((0,Ao.pull)(e.definition.ioSpecification.dataInputs,r),e.definition.ioSpecification.inputSets)){var i=e.definition.ioSpecification.inputSets[0];if(i){var s=i.dataInputRefs.find((function(e){return e.id===o}));if(s&&(0,Ao.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 Go={components:{CrownButton:vo},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lo}},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{removeFlows:Bo,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)}}},$o=Go,Xo=mo($o,So,Eo,!1,null,null,null),Yo=Xo.exports,Jo=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()},Zo=[],Ko=f.p+"img/connect-elements.ab6af00f.svg";f(38880),f(49337);function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function er(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qo(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}f(15306);var tr={"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"},nr=tr,or={"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"},rr=or,ir={"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"},sr=ir,ar={"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"},cr=ar,lr={"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"},dr=lr,ur=f(50361),hr=f.n(ur),pr=function(){function e(t,n,o){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=o}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(nr).includes(this.type)}},{key:"isEndEvent",value:function(){return Object.keys(rr).includes(this.type)}},{key:"isTask",value:function(){return Object.keys(sr).includes(this.type)}},{key:"isGateway",value:function(){return Object.keys(cr).includes(this.type)}},{key:"isIntermediateEvent",value:function(){return Object.keys(dr).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,o,r=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 o=t.get("id");o.substring(0,r.cloneOf.length)===r.cloneOf?(t.set("id",o.replace(r.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,r.cloneOf.length)===r.cloneOf?(t.set("id",n.replace(r.cloneOf+"_",l+"_")),o=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&&o&&this.definition.loopCharacteristics.set("loopDataOutputRef",o),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,o){var r=this,i=t[this.type].definition(n,o),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]=r.diagram.bounds[e]})),Object.keys(this.definition).filter((function(t){return!e.definitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=r.definition.get(e),n="object"===s(t)?hr()(t):t;if("eventDefinitions"===e)for(var o in n)t[o].signalRef&&!n[o].signalRef&&n[o].set("signalRef",er({},t[o].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,o){var r=this,i=t[this.type].definition(n,o),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=r.definition.get(e),n="object"===s(t)?hr()(t):t;if("eventDefinitions"===e)for(var o in n)t[o].signalRef&&!n[o].signalRef&&n[o].set("signalRef",er({},t[o].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(pr,"diagramPropertiesToCopy",["x","y","width","height"]),y(pr,"definitionPropertiesToNotCopy",["$type","id","dataOutputAssociations"]),y(pr,"flowDefinitionPropertiesToNotCopy",["$type","id","sourceRef","targetRef"]),y(pr,"eventDefinitionPropertiesToNotCopy",["errorRef","messageRef"]);var fr="processmaker-modeler-generic-flow",mr=f(65554),gr={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"]},vr={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"]},br={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"]},yr={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"]},wr={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"]},xr={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"]},kr={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"]},Cr={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"]},Sr={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"]},Er={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"]},Ar={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"]},_r={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"]},Mr=f(39865),Tr=["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"],Pr={components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},props:["node","moddle","nodeRegistry"],data:function(){return{sequenceFlow:Ko}},computed:{paper:function(){return Un.getters.paper},sequenceFlowConfig:function(){return this.nodeRegistry[fr]},nodeConfig:function(){return this.nodeRegistry[this.node.type]},allowOutgoingSequenceFlow:function(){var e=this;return!Tr.some((function(t){return e.node.isType(t)}))}},methods:{addSequence:function(e,t,n,o){this.$emit("toggle-crown-state",!1);var r=e.clientX,i=e.clientY,s=null;e&&(s=(0,F.V)(this.paper.viewport).toLocalPoint(r,i));var a=this.moddle.create("bpmn:SequenceFlow",{name:"",sourceRef:this.node.definition,targetRef:{x:n||s.x,y:o||s.y}});this.$emit("add-node",new pr(fr,a,this.moddle.create("bpmndi:BPMNEdge")))}},created:function(){this.$t=this.$t.bind(this),mr.library.add(vr)}},Ir=Pr,Or=mo(Ir,Jo,Zo,!1,null,null,null),Nr=Or.exports,Dr=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()},Rr=[],Br=f.p+"img/connect-artifacts.e3e5e73f.svg",Lr={components:{CrownButton:vo},props:["node","moddle","shape"],data:function(){return{connectIcon:Br}},methods:{addAssociation:function(e,t,n,o){this.$emit("toggle-crown-state",!1);var r=this.moddle.create("bpmn:Association",{sourceRef:this.shape.component.node.definition,targetRef:{x:n,y:o},associationDirection:no.none});this.$emit("add-node",new pr("processmaker-modeler-association",r,this.moddle.create("bpmndi:BPMNEdge")))}}},jr=Lr,Fr=mo(jr,Dr,Rr,!1,null,null,null),zr=Fr.exports,Ur=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()},qr=[];function Hr(e,t){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hr(e,t)}function Vr(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&&Hr(e,t)}f(12419),f(81299);function Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wr(e)}function Gr(){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 $r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xr(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 $r(e)}function Yr(e){var t=Gr();return function(){var n,o=Wr(e);if(t){var r=Wr(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Xr(this,n)}}var Jr="processmaker-modeler-pool",Zr=function(){function e(t,n,o){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=o}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 o=e.shapeIsPool(t)?t:t.component.node.pool,r=e.shapeIsPool(n)?n:n.component.node.pool;return null!=r&&r!==o}},{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===Jr}}]),e}(),Kr=function(e){Vr(n,e);var t=Yr(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}(Zr);y(Kr,"dataNodeTypes",["bpmn:DataStoreReference","bpmn:DataObjectReference"]),y(Kr,"disallowedNodes",["bpmn:EndEvent","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation","bpmn:Association"]);var Qr={components:{CrownButton:vo},props:["node","moddle","shape"],data:function(){return{connectIcon:Br}},computed:{paper:function(){return Un.getters.paper},allowOutgoingDataAssociationFlow:function(){return Kr.isADataNode(this.node)}},methods:{addDataAssociation:function(n,o,r){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 pr(l.id,d,l.diagram(this.moddle));u.dataAssociationProps={sourceShape:this.shape,targetCoords:{x:o||a.x,y:r||a.y}},this.$emit("add-node",u)}}},ei=Qr,ti=mo(ei,Ur,qr,!1,null,null,null),ni=ti.exports,oi=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()},ri=[],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:vo},props:["node"],data:function(){return{copyCount:0,copyIcon:ii,validCopyElements:ai}},methods:{copyElement:function(){this.$emit("copy-element")}}},li=ci,di=mo(li,oi,ri,!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:vo},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=mo(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 o=n.label,r=n.nodeType,i=n.dataTest,s=n.disabled;return t("li",{key:r,staticClass:"element-list--item",attrs:{role:"listitem",id:r}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:e.isDisabled(s,e.node,r)},on:{click:function(t){return e.replaceNode({node:e.node,typeToReplaceWith:r})}}},[e._v(e._s(e.$t(o))+" ")]),e.isDisabled(s,e.node,r)?t("b-tooltip",{attrs:{target:r,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.$t(e.tooltip(s,e.node,r)))+" ")]):e._e()],1)})),0):e._e()],1):e._e()},ki=[],Ci={name:"CrownTaskDropdown",components:{CrownButton:vo},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),mo(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 o=n.label,r=n.nodeType,i=n.dataTest,s=n.disabledLabel;return t("li",{key:r,staticClass:"element-list--item",attrs:{role:"listitem",id:r}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:!e.canAddBoundaryEventToTarget(r,e.shape)},on:{click:function(t){return e.addBoundaryEvent(r)}}},[e._v(e._s(e.$t(o))+" ")]),e.canAddBoundaryEventToTarget(r,e.shape)?e._e():t("b-tooltip",{attrs:{target:r,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.getErrorTooltipText(s))+" ")])],1)})),0):e._e()],1):e._e()},Mi=[],Ti=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))&&Di(t)}function Ni(e){return e&&e.node.isBpmnType("bpmn:CallActivity")}function Di(e){return 0!==Nt(e).length}var Ri={name:"CrownBoundaryEventDropdown",components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},props:{dropdownOpen:{type:Boolean,required:!0},dropdownData:Array,nodeRegistry:Object,moddle:Object,node:Object,shape:Object},data:function(){return{boundaryEventIcon:Ti}},methods:{getErrorTooltipText:function(e){return 0===this.getEmptyBoundaryEventPositionsForShape(this.shape).length?"No available space":e},canAddBoundaryEventToTarget:Oi,getEmptyBoundaryEventPositionsForShape:Nt,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),o=Nt(this.shape)[0];n.bounds.x=o.x-n.bounds.width/2,n.bounds.y=o.y-n.bounds.height/2;var r=new pr(e,t,n);r.pool=this.node.pool,r.fromCrown=!0,Un.commit("highlightNode",r),this.$emit("add-node",r)}}},created:function(){this.$t=this.$t.bind(this),mr.library.add(gr)}},Bi=Ri,Li=(f(56073),mo(Bi,_i,Mi,!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)},Hi=[],Vi=(f(64765),f(69600),f(42238)),Wi=f.n(Vi),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,o=Object.entries(Wi());n<o.length;n++){var r=jt(o[n],2),i=r[0],s=r[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 o=jt(n[t],2),r=o[0],i=o[1];$i.includes(r)||(Gi.includes(r)&&e[0].icons.push(this.parseIcon(r,i)),this.shouldIncludeIcon(r,i)&&e[1].icons.push(this.parseIcon(r,i)))}return e}},{key:"shouldIncludeIcon",value:function(e,t){var n=!1,o=["-left","-right","-up","-down"];return $i.includes(e)||Gi.includes(e)||t.styles.includes("solid")&&!t.changes.includes("5.13.0")&&(n=!0),o.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),mo(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,os=(f(18785),mo(ns,qi,Hi,!1,null,null,null)),rs=os.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:vo,"sketch-picker":Ui.Sketch,IconSelector:rs},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,n,o,r,i;Un.commit("updateNodeProp",{node:this.node,key:"color",value:e}),zt().set(this.node.definition,"color",e),this.$emit("save-state");var s={id:this.node.definition.id,properties:{color:this.node.definition.color,x:null===(t=this.node.diagram.bounds)||void 0===t?void 0:t.x,y:null===(n=this.node.diagram.bounds)||void 0===n?void 0:n.y,height:null===(o=this.node.diagram.bounds)||void 0===o?void 0:o.height,width:null===(r=this.node.diagram.bounds)||void 0===r?void 0:r.width,type:this.node.type,id:this.node.definition.id,attachedToRefId:null===(i=this.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[s])},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,mr.icon)({prefix:"fas",iconName:e}),n=t.html,o=btoa(n);Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:o}),zt().set(this.node.definition,"customIcon",o),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),mr.library.add(is.fas)}},as=ss,cs=(f(69309),mo(as,Fi,zi,!1,null,"16c02990",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),mo(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:vo},props:["node"],data:function(){return{icon:gs}},methods:{click:function(){this.$emit("default-flow",this.node)}}},bs=vs,ys=mo(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:Co,DeleteButton:Yo,GenericFlowButton:Nr,AssociationFlowButton:zr,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)},shape:function(){this.highlighted&&(this.showCrown=!0)}},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:!1,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,o=t.stroke;Ze(this.shape,n,o)},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,o=t.y,r=t.width;this.style={top:"".concat(o-52,"px"),left:"".concat(n+r-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),mo(As,io,so,!1,null,null,null)),Ms=_s.exports,Ts={components:{CrownConfig:Ms},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:no}},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 o=this.targetConfig.validateAssociationIncoming&&!this.targetConfig.validateAssociationIncoming(this.sourceNode),r=this.sourceConfig.validateAssociationOutgoing&&!this.sourceConfig.validateAssociationOutgoing(this.targetNode);return!o&&!r}},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=Ts,Is=mo(Ps,L,j,!1,null,null,null),Os=Is.exports,Ns={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]*$/"},Ds=Ns,Rs=function(){function e(t,n,o){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=o}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=ro(this.moddle),i=oo(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var s=new pr(eo,i,r);return s}}]),e}(),Bs={id:eo,component:Os,bpmnType:to,control:!1,definition:oo,diagram:ro,inspectorConfig:[{name:"Data Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-association"},items:[{component:"FormInput",config:Ds},{component:"FormSelect",config:{label:"Direction",helper:"Select Direction",name:"associationDirection",options:[{value:"".concat(no.none),content:"None"},{value:"".concat(no.one),content:"One"},{value:"".concat(no.both),content:"Both"}]}}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new Rs(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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 Hs(e,t){var n=t.size(),o=n.width,r=n.height;for(var i in e)Ws(t,i,o),Gs(t,i,r),$s(t,i,e,o)}function Vs(e,t){var n=e.attr(t);return void 0===n?qs:n}function Ws(e,t,n){var o=Vs(e,t+"/ref-padding-x");-1!==t.indexOf("Right")?e.attr(t+"/ref-x",n-Us-o):-1!==t.indexOf("Left")&&e.attr(t+"/ref-x",o+(Ys(e)?16:0))}function Gs(e,t,n){var o=Vs(e,t+"/ref-padding-y");-1!==t.indexOf("bottom")&&e.attr(t+"/ref-y",n-Us-o)}function $s(e,t,n,o){for(var r=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+"."+r+"/xlink:href",n[t][a]),r++,r>=zs)break;e.attr(t+"/ref-width",Us*r),-1!==t.indexOf("Center")&&e.attr(t+"/ref-x",(o-r*Us)/2)}function Xs(e,t){if("bottomCenter"===t){var n={};return Object.keys(e[t]).sort().forEach((function(o){n[o]=e[t][o]})),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,o={};o[e]=t;for(var r=0;r<Js;r++)o[e+"."+r]={"ref-x":r*Zs*n,"ref-y":0,width:Zs,height:Zs};return o}var ea,ta,na,oa,ra,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(){Hs(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:er(er(er(er(er(er({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:Hn,"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:Vn,"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:{prepareCustomColorHighlighter:function(e){return{highlighter:{name:"stroke",options:{attrs:{stroke:e,"stroke-width":3,"data-cy":"selected"}},partial:!1,type:"default"}}},setHighlightColor:function(e,t){this.shapeView&&(e?(this.shapeView.unhighlight(this.shapeBody,ga),this.shapeView.highlight(this.shapeBody,this.prepareCustomColorHighlighter(t))):this.shapeView.unhighlight(this.shapeBody,this.prepareCustomColorHighlighter(t)))},setAiStatusHighlight:function(e){this.shapeView.unhighlight(this.shapeBody,ba),"generated"===e&&(this.shape.attr("body/fill",Yn),this.shapeView.highlight(this.shapeBody,ba)),this.shapeView.unhighlight(this.shapeBody,ya),"generating"===e&&(this.shape.attr("body/fill",Wn),this.shapeView.highlight(this.shapeBody,ya)),this.shapeView.unhighlight(this.shapeBody,wa),"previously generated"===e&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa))},unsetHighlights:function(){this.shape.attr("body/fill","#FFFFFF"),this.shapeView.unhighlight(this.shapeBody,ya),this.shapeView.unhighlight(this.shapeBody,ba),this.shapeView.unhighlight(this.shapeBody,wa)},setShapeHighlightForReadOnly:function(){this.shapeView&&(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)),this.isIdle&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa)))},setShapeHighlightForDefault:function(){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))},setShapeHighlight:function(){this.shapeView&&(this.shapeView.unhighlight(this.shapeBody,ga),Un.getters.isReadOnly?this.setShapeHighlightForReadOnly():this.setShapeHighlightForDefault())},setBorderOutline:function(e){this.currentBorderOutline&&this.shapeView.unhighlight(this.shapeBody,this.currentBorderOutline),this.currentBorderOutline=e?hr()(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:Ms},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:rr["processmaker-modeler-end-event"],nodeType:"processmaker-modeler-end-event"},{label:rr["processmaker-modeler-message-end-event"],nodeType:"processmaker-modeler-message-end-event",dataTest:"switch-to-message-end-event"},{label:rr["processmaker-modeler-error-end-event"],nodeType:"processmaker-modeler-error-end-event",dataTest:"switch-to-error-end-event"},{label:rr["processmaker-modeler-signal-end-event"],nodeType:"processmaker-modeler-signal-end-event",dataTest:"switch-to-signal-end-event"},{label:rr["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=mo(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,Ma=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)},Ta=[],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=mo(Ia,Ma,Ta,!1,null,null,null),Na=Oa.exports,Da={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Na,config:Ds}]},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),mo(za,Ra,Ba,!1,null,null,null)),qa=Ua.exports,Ha={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Documentation",icon:"book",name:"documentation-accordion"},items:[{component:qa,config:{label:"Description",name:"documentation",helper:""}}]},Va="processmaker-modeler-end-event",Wa={id:Va,component:Ea,bpmnType:"bpmn:EndEvent",control:!0,category:"BPMN",icon:f(48807),label:rr[Va],rank:30,items:[{icon:f(48807),label:rr[Va],control:!0,rank:31,id:"processmaker-modeler-end-event"},{icon:f(52080),label:rr["processmaker-modeler-message-end-event"],control:!0,rank:32,id:"processmaker-modeler-message-end-event"},{icon:f(95093),label:rr["processmaker-modeler-error-end-event"],control:!0,rank:33,id:"processmaker-modeler-error-end-event"},{icon:f(96425),label:rr["processmaker-modeler-signal-end-event"],control:!0,rank:34,id:"processmaker-modeler-signal-end-event"},{icon:f(47616),label:rr["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(rr[Va])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:rr[Va],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-end-event"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},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"),o=n.querySelectorAll('*[fill]:not([fill="none"])'),r=n.querySelectorAll('*[stroke]:not([stroke="none"])');return o.forEach((function(e){e.setAttribute("fill",t)})),r.forEach((function(e){e.setAttribute("stroke",t)})),n.documentElement.outerHTML},Ka=function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/,o=/<svg[^>]*>/,r=e.startsWith("<xml")&&/<svg[^>]*>/.test(e);return"string"===typeof e&&(t.test(e)||n.test(e)||o.test(e)||r)},Qa=function(e,t){if(!Ka(e)){mr.library.add(is.fas,Xa.fab);var n=e.split(" "),o=jt(n,1),r=o[0],i=e.split("-"),s=jt(i,2),a=s[1],c=(0,mr.findIconDefinition)({prefix:r,iconName:a}),l=(0,mr.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)}},oc=nc,rc=mo(oc,ea,ta,!1,null,null,null),ic=rc.exports,sc=f(82492),ac=f.n(sc),cc=f(57557),lc=f.n(cc),dc="processmaker-modeler-error-end-event",uc=ac()(hr()(Wa),{id:dc,component:ic,control:!1,label:rr[dc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[dc]),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return"eventDefinitions"===o?e.errorName=r[0].get("errorRef").name:e[o]=r,e}),{})},inspectorHandler:function(e,t,n){for(var o in lc()(e,["$type","eventDefinitions","errorName"]))t.definition[o]!==e[o]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]}),n(t,o,e[o]));var r=t.definition.get("eventDefinitions")[0].errorRef;r.name!==e.errorName&&(r.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 o=Object.keys(t).filter((function(e){return"id"!==e}));if("eventDefinitions"!==o[0])n(e,o[0],t[o[0]]);else{var r=t[o[0]][0].errorRef,i=e.definition.get("eventDefinitions")[0].errorRef;r&&i&&r.name!==i.name&&(i.name=r.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=mo(mc,na,oa,!1,null,null,null),vc=gc.exports,bc="processmaker-modeler-terminate-end-event",yc=ac()(hr()(Wa),{id:bc,component:vc,control:!1,label:rr[bc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[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:Ms},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:cr["processmaker-modeler-exclusive-gateway"],nodeType:"processmaker-modeler-exclusive-gateway"},{label:cr["processmaker-modeler-inclusive-gateway"],nodeType:"processmaker-modeler-inclusive-gateway",dataTest:"switch-to-inclusive-gateway"},{label:cr["processmaker-modeler-parallel-gateway"],nodeType:"processmaker-modeler-parallel-gateway",dataTest:"switch-to-parallel-gateway"},{label:cr["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=mo(Ac,wc,xc,!1,null,null,null),Mc=_c.exports,Tc=f(4074),Pc=f.n(Tc),Ic={extends:Mc,mixins:[tc],data:function(){return{nodeIcon:Pc()}}},Oc=Ic,Nc=mo(Oc,ra,ia,!1,null,null,null),Dc=Nc.exports,Rc="processmaker-modeler-exclusive-gateway",Bc={id:Rc,component:Dc,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(cr[Rc])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[Rc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-exlcusive-gateway"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},Lc=f(62635),jc=f.n(Lc),Fc={diverging:"Diverging",converging:"Converging"},zc={extends:Mc,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=mo(Uc,sa,aa,!1,null,null,null),Hc=qc.exports,Vc="processmaker-modeler-inclusive-gateway",Wc={id:Vc,component:Hc,bpmnType:"bpmn:InclusiveGateway",control:!1,category:"BPMN",label:cr[Vc],definition:function(e,t){return e.create("bpmn:InclusiveGateway",{name:t(cr[Vc]),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[Vc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-inclusive-gateway-config"},items:[{component:"FormInput",config:_a}]},Ha,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-inclusive-gateway-advanced"},items:[{component:"FormInput",config:Ds},{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:Mc,mixins:[tc],data:function(){return{nodeIcon:$c()}},watch:{"node.definition":{deep:!0,immediate:!0,handler:function(){delete this.node.definition.default}}}},Yc=Xc,Jc=mo(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}]},Ha,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-parallel-gateway-direction"},items:[{component:"FormInput",config:Ds},{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:Mc,mixins:[tc],data:function(){return{nodeIcon:el()}}},nl=tl,ol=mo(nl,da,ua,!1,null,null,null),rl=ol.exports,il="processmaker-modeler-event-based-gateway",sl={id:il,component:rl,bpmnType:"bpmn:EventBasedGateway",control:!1,category:"BPMN",label:cr[il],definition:function(e,t){return e.create("bpmn:EventBasedGateway",{name:t(cr[il])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[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"}}]},Ha,Da]}]},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){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=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),r.waypoint=n.map((function(e){return o.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 pr("processmaker-modeler-sequence-flow",i,r)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,o=e.targetShape,r=e.targetConfig,i=$()(o,"component.node"),s=$()(t,"component.node");return Zr.hasTargetType(o)&&Zr.targetIsNotSource(s,i)&&n.targetIsNotALane(i)&&n.targetIsInSamePool(t,o)&&n.eventBasedGatewayTarget(s,i)&&n.isValidSource(t,r)&&n.sourceIsNotPool(s)&&!Kr.isADataNode(s)&&!Kr.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,o=e.component.node.pool;return!o||o===n}},{key:"targetIsNotSource",value:function(e,t){return t.id!==e.id}},{key:"eventBasedGatewayTarget",value:function(e,t){var n=e.isBpmnType("bpmn:EventBasedGateway"),o=t.isBpmnType("bpmn:IntermediateCatchEvent");return!n||o}},{key:"sourceIsNotPool",value:function(e){return!e.isType("processmaker-modeler-pool")}}]),n}(Zr),hl={components:{CrownConfig:Ms},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=mo(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),o=n[0],r=n[1];return e[o]="conditionExpression"===o?r.body:r,e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition,i=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(r.sourceRef.$type);for(var s in e)if(r[s]!==e[s])if("conditionExpression"===s&&i){if(r[s].body!==e[s]){var a=o.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,o){var r=Object.keys(t).filter((function(e){return"id"!==e}));if(0!==r.length)if("conditionExpression"!==r[0])n(e,r[0],t[r[0]]);else{var i=o.create("bpmn:FormalExpression",{body:t[r[0]][0].body});n(e,r[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:er(er({},_a),{},{validation:null})}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new ul(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=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),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)})),new pr("processmaker-modeler-message-flow",i,r)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,o=e.targetShape,r=e.sourceConfig,i=$()(o,"component.node"),s=$()(t,"component.node");return Zr.hasTargetType(o)&&n.isValidTargetType(i)&&Zr.targetIsValidStartEventType(i)&&Zr.targetIsValidIntermediateEventType(i)&&Zr.targetIsValidBoundaryEventType(i)&&Zr.targetIsNotContainingPool(o,s)&&Zr.targetIsInDifferentPool(o,t)&&Zr.targetIsNotSource(i,s)&&Zr.allowOutgoingFlow(r,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}(Zr),xl={components:{CrownConfig:Ms},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=mo(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}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new wl(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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),Ml=f.n(_l),Tl={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:Ml()}},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=Tl,Il=mo(Pl,ha,pa,!1,null,null,null),Ol=Il.exports,Nl=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)},Dl=[],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(o){"bpmn:MessageEventDefinition"===o.$type&&o.messageRef&&o.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,Ao.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,Ao.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,Ao.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}}),Bl=Rl,Ll=(f(53030),f(54061),mo(Bl,Nl,Dl,!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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=r[0].get("messageRef");e.messageRef=i?i.id:""}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o,r){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=r.rootElements.find((function(t){return t.id===e.messageRef}));!a&&e.messageRef&&(a=o.create("bpmn:Message",{id:e.messageRef,name:e.messageRef}),r.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")}})}},Hl="processmaker-modeler-message-end-event",Vl=ac()(hr()(Wa),er(er({},ql),{},{id:Hl,component:Ol,control:!1,label:rr[Hl],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[Hl]),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=mo(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(o){"bpmn:SignalEventDefinition"===o.$type&&o.signalRef&&o.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,Ao.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,Ao.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,Ao.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,Ao.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}},ed=Ql,td=(f(59244),f(34924),mo(ed,Zl,Kl,!1,null,"607e6d70",null)),nd=td.exports;function od(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 rd={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];if("eventDefinitions"===o){var i=r[0].get("signalRef");e.signalRef=i?i.id:""}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o,r){var i;for(var s in lc()(e,["$type","eventDefinitions","signalRef"]))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=r.rootElements.find((function(t){return t.id===e.signalRef}));!a&&e.signalRef&&(a=o.create("bpmn:Signal",{id:e.signalRef,name:e.signalRef}),r.rootElements.push(a)),t.definition.get("eventDefinitions")[0].signalRef=a,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"signalRef",value:e.signalRef,extras:{signalName:null===(i=a)||void 0===i?void 0:i.name}})}},id="processmaker-modeler-signal-end-event",sd=ac()(hr()(Wa),er(er({},rd),{},{id:id,component:Jl,control:!1,label:rr[id],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[id]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("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:Ms},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:nr["processmaker-modeler-start-event"],nodeType:"processmaker-modeler-start-event",dataTest:"switch-to-start-event"},{label:nr["processmaker-modeler-start-timer-event"],nodeType:"processmaker-modeler-start-timer-event",dataTest:"switch-to-start-timer-event"},{label:nr["processmaker-modeler-signal-start-event"],nodeType:"processmaker-modeler-signal-start-event",dataTest:"switch-to-signal-start-event"},{label:nr["processmaker-modeler-message-start-event"],nodeType:"processmaker-modeler-message-start-event",dataTest:"switch-to-message-start-event"},{label:nr["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:Ve,fill:He},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=mo(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=mo(Ed,gd,vd,!1,null,null,null),_d=Ad.exports,Md=36,Td={bpmnType:"bpmn:StartEvent",control:!1,category:"BPMN",diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:Md,width:Md,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}]},Ha,Da]}]},Pd="processmaker-modeler-start-event",Id=ac()(hr()(Td),{id:Pd,component:_d,control:!0,icon:f(34954),label:nr[Pd],rank:10,items:[{icon:f(34954),label:nr[Pd],control:!0,bpmnType:"bpmn:StartEvent",rank:10,id:"processmaker-modeler-start-event"},{icon:f(42123),label:nr["processmaker-modeler-message-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:11,id:"processmaker-modeler-message-start-event"},{icon:f(47658),label:nr["processmaker-modeler-conditional-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:12,id:"processmaker-modeler-conditional-start-event"},{icon:f(43762),label:nr["processmaker-modeler-signal-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:13,id:"processmaker-modeler-signal-start-event"},{icon:f(8519),label:nr["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(nr[Pd])})}}),Od=f(69766),Nd=f.n(Od),Dd={extends:hd,data:function(){return{nodeIcon:Nd()}},mounted:function(){this.shape.attr({image:{"ref-x":5,"ref-y":3}})}},Rd=Dd,Bd=mo(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()(hr()(Td),er(er({},rd),{},{id:zd,component:Ld,label:nr[zd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[zd]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("Signal that will trigger this start event",!1),{component:"FormInput",config:Fd}]}]}]})),qd=f(47179),Hd=f.n(qd),Vd={extends:hd,data:function(){return{nodeIcon:Hd()}}},Wd=Vd,Gd=mo(Wd,wd,xd,!1,null,null,null),$d=Gd.exports,Xd="processmaker-modeler-message-start-event",Yd=ac()(hr()(Td),er(er({},ql),{},{id:Xd,component:$d,label:nr[Xd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[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=mo(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)}),ou=[],ru=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,o,r){var i=au(e),s=au(t),a="after"===o?r:"",c="ondate"===o?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,o){var r=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=o,this._selectedWeekdays=r,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?ru.DateTime.fromISO(e).toUTC():e.isLuxonDateTime?e.toUTC():ru.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(o){var r=e.getWeekDayDate(o),i=cu(r,e._endDate,t,e._ends,e._times);n.push(i)})),n.join("|")}},{key:"getWeekDayDate",value:function(e){var t=ru.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:ru.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:ru.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),mo(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:ru.DateTime,expression:null,startDate:ru.DateTime.local().toUTC().toISO(),repeat:"1",periodicity:"week",ends:"never",endDate:ru.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=ru.DateTime.fromISO(e,{zone:"utc"}).set({seconds:0,milliseconds:0}).toUTC().toISO()},setEndDate:function(e){var t=ru.DateTime.fromISO(this.startDate,{zone:"utc"});this.endDate=ru.DateTime.fromISO(e,{zone:"utc"}).set({hours:t.hour,minutes:t.minute,seconds:0,milliseconds:0}).toUTC().toISO()},parseTimerConfig:function(e){var t,n=this;if(null!==(t=e[0])&&void 0!==t&&null!==(t=t.timeCycle)&&void 0!==t&&t.body)try{var o=!1,r=e[0].timeCycle.body.split("|");r.forEach((function(e){if("R"!==e.substr(0,1))n.startDate=e,o=!0;else{var t=e.match(/R(\d*)\/([^/]+)\/P(\d+)(\w)(?:\/([^/]+))?/);if(t){if(n.times=t[1]||"1",n.repeat=t[3],n.periodicity=Object.keys(vu).find((function(e){return vu[e]===t[4]})),o||(n.startDate=t[2],o=!0),n.isWeeklyPeriodSelected()){var r=ru.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.selectedWeekdays.push(r)}n.endDate=t[5]||ru.DateTime.local().toUTC().toISO(),n.ends=t[5]?"ondate":t[1]?"after":"never"}}o=!0}))}catch(i){this.resetTimerExpression()}},resetTimerExpression:function(){this.startDate=ru.DateTime.local().toUTC().toISO(),this.times="1",this.repeat="1",this.periodicity="week",this.endDate=ru.DateTime.local().toUTC().toISO(),this.ends="never",this.expression=null,this.selectedWeekdays=[]}}},yu=bu,wu=(f(33383),f(66667),mo(yu,nu,ou,!1,null,"72709fd0",null)),xu=wu.exports,ku="processmaker-modeler-start-timer-event",Cu=ac()(hr()(Td),{id:ku,component:tu,label:nr[ku],definition:function(e,t){var n=e.create("bpmn:StartEvent",{name:t(nr[ku])});return n.eventDefinitions=[e.create("bpmn:TimerEventDefinition",{timeCycle:e.create("bpmn:Expression",{body:""})})],n},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var a=e[i];if("object"===s(a))continue;var c=r.get(i)[0].timeCycle;if(c&&c.body===a)continue;var l={timeCycle:o.create("bpmn:Expression",{body:a})},d=[o.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"}}]},Ha,Da]}]}),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:er(er(er(er(er(er({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:Ms},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:dr["processmaker-modeler-intermediate-catch-timer-event"],nodeType:"processmaker-modeler-intermediate-catch-timer-event",dataTest:"switch-to-intermediate-timer-catch-event"},{label:dr["processmaker-modeler-intermediate-signal-catch-event"],nodeType:"processmaker-modeler-intermediate-signal-catch-event",dataTest:"switch-to-intermediate-signal-catch-event"},{label:dr["processmaker-modeler-intermediate-signal-throw-event"],nodeType:"processmaker-modeler-intermediate-signal-throw-event",dataTest:"switch-to-intermediate-signal-throw-event"},{label:dr["processmaker-modeler-intermediate-message-catch-event"],nodeType:"processmaker-modeler-intermediate-message-catch-event",dataTest:"switch-to-intermediate-message-catch-event"},{label:dr["processmaker-modeler-intermediate-message-throw-event"],nodeType:"processmaker-modeler-intermediate-message-throw-event",dataTest:"switch-to-intermediate-message-throw-event"},{label:dr["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}},Mu=_u,Tu=mo(Mu,Su,Eu,!1,null,null,null),Pu=Tu.exports,Iu=f(39653),Ou=f.n(Iu),Nu={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Ou()}}},Du=Nu,Ru=mo(Du,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),Hu={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},Vu={props:["value","repeatInput"],data:function(){var e=[{name:Hu.minute,value:"M",isTime:!0},{name:Hu.hour,value:"H",isTime:!0},{name:Hu.day,value:"D"},{name:Hu.week,value:"W"},{name:Hu.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 o=t?Hu.minute:Hu.month;return this.periods.find((function(e){var t=e.name;return t===o}))}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=Vu,Gu=mo(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:ru.DateTime}},props:{value:String},methods:{getTimezone:function(){return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.timezone||"local"},convertFromUTC:function(e){return ru.DateTime.fromISO(e,{zone:"utc"}).setZone(this.getTimezone()).toISO()},emitValue:function(e){var t=ru.DateTime.fromISO(e).toUTC().toISO();this.$emit("input",t)}}},Zu=Ju,Ku=mo(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"},oh={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:ru.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 o=ru.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.push(o)}})),n},getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var o=t?nh.minute:nh.month;return this.periods.find((function(e){var t=e.name;return t===o}))}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}}},rh=oh,ih=mo(rh,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:ru.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=mo(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(dr[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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=Object.keys(r[0])[1],s=r[0][i].body;e[o]={type:i,body:s}}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=r.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,o.create("bpmn:Expression",{body:c})),u=[o.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:dr[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"}}]},Ha,Da]}]};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),Mh={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:_h()}},mounted:function(){var e=mh(Ge,2,We);this.shape.attr(e)}},Th=Mh,Ph=mo(Th,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}]},Ha,Da]}]},Nh="processmaker-modeler-intermediate-message-catch-event",Dh=ac()(hr()(Oh),er(er({},ql),{},{id:Nh,component:Ih,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[Nh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[Nh]),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=mo(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}]},Ha,Da]}]},qh="processmaker-modeler-intermediate-signal-catch-event",Hh=ac()(hr()(Uh),er(er({},rd),{},{id:qh,component:zh,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[qh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[qh]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("Signal that will catch this intermediate event",!1),{component:"FormInput",config:Fd}]}]}]})),Vh=f(98358),Wh=f.n(Vh),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=mo($h,wh,xh,!1,null,null,null),Yh=Xh.exports,Jh="processmaker-modeler-intermediate-message-throw-event",Zh=ac()(hr()(Oh),er(er({},ql),{},{id:Jh,component:Yh,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:dr[Jh],icon:f(16383),definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(dr[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=mo(tp,kh,Ch,!1,null,null,null),op=np.exports,rp="processmaker-modeler-intermediate-signal-throw-event",ip=ac()(hr()(Uh),er(er({},rd),{},{id:rp,component:op,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:dr[rp],definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(dr[rp]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("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=mo(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),o=n[0],r=n[1];return"eventDefinitions"===o?e.condition=r[0].get("condition").body:e[o]=r,e}),{})},inspectorHandler:function(e,t,n){for(var o in lc()(e,["$type","eventDefinitions"]))t.definition[o]!==e[o]&&("condition"===o?(t.definition.get("eventDefinitions")[0].get("condition").body=e[o],window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]})):(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]}),n(t,o,e[o])))}},fp="processmaker-modeler-intermediate-conditional-catch-event",mp=ac()(hr()(Uh),er(er({},pp),{},{id:fp,component:up,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[fp],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[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:er(er(er(er(er(er({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",Mp="bpmn:StandardLoopCharacteristics",Tp="bpmn:MultiInstanceLoopCharacteristics";function Pp(e,t,n,o){var r=e.get("loopCharacteristics"),i=[Mp,Tp];if(r&&i.includes(r.$type))if(r.$type!==Mp){var s=r.isSequential?Ep:Ap;n(t.bottomCenter,"loopCharacteristics",s)}else n(t.bottomCenter,"loopCharacteristics",_p);else o(t.bottomCenter,"loopCharacteristics")}var Ip=f.p+"img/compensation.495ae0a2.svg";function Op(e,t,n,o){e.isForCompensation?n(t.bottomCenter,"compensation",Ip):o(t.bottomCenter,"compensation")}var Np,Dp,Rp=15,Bp=2*Zs,Lp={components:{CrownConfig:Ms},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:sr["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:sr["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:sr["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:sr["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":Y()((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(),o=n.height,r=this.calculateSizeOnGrid(),i=this.useTaskHeight(r)?yp:r;o!==i&&(this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment())}),300),"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),this.$emit("definition-changed",this.node.definition)}}},methods:{getElementsUnderArea:function(e){var t=e.getBBox(),n=t.x,o=t.y,r=t.width,i=t.height,s={x:n,y:o,width:r,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,o=this.paperManager.ceilToNearestGridMultiple(n)-e;return this.middleIsOddNumber(o)&&(o+=kp),o},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=mo(jp,gp,vp,!1,null,null,null),zp=Fp.exports,Up=f(95514),qp=f.n(Up),Hp={extends:zp,mixins:[tc],data:function(){return{nodeIcon:qp()}}},Vp=Hp,Wp=mo(Vp,Np,Dp,!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=mo(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:Na,config:Ds},{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,Ao.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,Ao.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,Ao.isEqual)(this.local,this.value)||this.$emit("input",(0,Ao.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}}},of=nf,rf=mo(of,ef,tf,!1,null,null,null),sf=rf.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,o){if(e[o]instanceof Function)return n;var r="Ref"===o.substr(o.length-3)||"Refs"===o.substr(o.length-4);return e[o]instanceof Object&&e[o].id&&r?n[o]=Object&&e[o].id:e[o]instanceof Array&&r?n[o]=e[o].filter((function(e){return e})).map((function(e){return e.id})):("$type"===o||"$"!==o.substr(0,1)&&"__"!==o.substr(0,2))&&(n[o]=t.getDefinitionProps(e[o])),n}),{}):e}},{key:"setDefinitionProps",value:function(e,t,n,o,r){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(o,r){var s=i.setDefinitionProps(e[r],t,n,void 0,r);return null!==s&&void 0!==s?o[r]=s:void 0===s&&delete o[r],o}),o||this.createModdleNode(n,e))}catch(s){throw'Unable to create moddle node of type "'.concat(e.$type,'" \n ').concat(s)}return o&&void 0!==r&&void 0!==e&&null!==e&&(o[r]=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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!(o.indexOf(n)>-1)){var r;if(n instanceof Array)o.push(n),n.find((function(n){return r=t.findById(e,n,o)}));else if(n instanceof Object&&n.$type){if(o.push(n),n.id===e)return n;Object.getOwnPropertyNames(n).find((function(i){return r=!(n[i]instanceof Function)&&t.findById(e,n[i],o)}))}return r}}}]),e}()),cf=function(e,t,n,o,r,i){var s=new af(r,{prefix:"".concat(t.definition.id,"_inner")}),a=s.setDefinitionProps(e.$loopCharactetistics,n,o,{});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,o){var r=o.definitions,i=new af(r);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(sr[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,o,r,i,s){pf(e.markerFlags,t,n),cf(e,t,n,o,r,s),i(lc()(e,"markerFlags","$loopCharactetistics"),s)},inspectorData:function(e,t,n){var o=t(e);return lf(o,e,t,n),o.markerFlags={isForCompensation:o.isForCompensation},delete o.isForCompensation,o},inspectorConfig:[{name:sr[uf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-task"},items:[{component:"FormInput",config:_a}]},df,Ha,Qp]}],loopCharacteristicsHandler:cf,loopCharacteristicsData:lf};function pf(e,t,n){if(e){var o=t.definition.get("isForCompensation"),r=e.isForCompensation;null!=r&&r!==o&&n(t,"isForCompensation",r)}}var ff,mf,gf=er(er({},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:Ms},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:sr["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:sr["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:sr["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:sr["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":Y()((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,o=this.shape.size(),r=o.height;if(n+wf+xf!==r){var i=Math.max(n+wf+xf,yp);this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment()}}),300),"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,o="bottomCenter.0"===t.target.getAttribute("joint-selector"),r=e.model===this.shape;o&&r&&(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 o=function(e){return e.replace('<svg width="100%"',"<svg ")},r=function(e){return e.replace("<svg ",'<svg class="border border-dark"')};n.subProcessSvg=r(o(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=mo(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)},Mf=[],Tf=f(45578),Pf=f.n(Tf),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,Nf=mo(Of,_f,Mf,!1,null,null,null),Df=Nf.exports,Rf="processmaker-modeler-call-activity",Bf={id:Rf,component:Af,bpmnType:"bpmn:CallActivity",control:!1,category:"BPMN",icon:f(12893),label:sr[Rf],definition:function(e,t){return e.create("bpmn:CallActivity",{name:t(sr[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){t.definition.get("id")!==e["id"]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"id",value:e.id}),n(t,"id",e.id)),t.definition.get("name")!==e["name"]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"name",value:e.name}),n(t,"name",e.name));var o=JSON.parse(e.config);e["calledElement"]=o.calledElement,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"calledElement",value:o.calledElement}),n(t,"calledElement",o.calledElement),o.name!==e.name&&(o.name=e.name),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"config",value:JSON.stringify(o)}),n(t,"config",JSON.stringify(o))},inspectorConfig:[{name:sr[Rf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-subprocess"},items:[{component:"FormInput",config:_a},{component:Df,config:{name:"config"}}]},Ha,Da]}],loopCharacteristicsHandler:cf},Lf=f(87465),jf=f.n(Lf),Ff={extends:zp,mixins:[tc],data:function(){return{nodeIcon:jf(),iconName:""}}},zf=Ff,Uf=mo(zf,ff,mf,!1,null,null,null),qf=Uf.exports,Hf="processmaker-modeler-script-task",Vf={id:Hf,component:qf,bpmnType:"bpmn:ScriptTask",control:!1,category:"BPMN",icon:f(75763),label:sr[Hf],definition:function(e,t){return e.create("bpmn:ScriptTask",{name:t(sr[Hf]),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:sr[Hf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-script-task"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},Wf=er(er({},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}]},Ha,Da]}]}),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:Ms},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 o=3,r=15,i=this.getLabelHeight(r);return i!==e?i-o:0===t.length?n-o:e-o},updateNodeText:function(e){var t=this,n=this.shape.findView(this.paperManager.paper).getBBox(),o=n.height,r="25 ".concat(o," 3 ").concat(o," 3 3 25 3"),i=this.node.diagram.bounds;this.shape.position(i.x,i.y),this.shape.attr({body:{refPoints:r},label:{text:F.util.breakText(e,{width:Xf}),textAnchor:"left"}}),this.paperManager.awaitScheduledUpdates().then((function(){t.shape.resize(t.nodeWidth,t.calculateNewHeight(o,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=mo(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"}}]},Ha,Da]}]},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=[],om=f.p+"img/highlight-shape.5f7b1ba9.svg",rm=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,o=new F.shapes.standard.EmbeddedImage,r=new F.shapes.standard.EmbeddedImage;this.anchorPoints=[t,n,o,r];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(o,"nesw-resize","top-right-resize-button"),this.setPointAttributes(r,"nwse-resize","top-left-resize-button"),t.position(s+c,a+l),n.position(s-this.pointWidth,a+l),o.position(s+c,a-this.pointHeight),r.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()})))})),o.listenTo(this.paper,"element:pointerdown",(function(t){t.model===o&&(o.on("change:position",e.resizeTopRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){o.off("change:position",e.resizeTopRight),e.resizeUpdate()})))})),r.listenTo(this.paper,"element:pointerdown",(function(t){t.model===r&&(r.on("change:position",e.resizeTopLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){r.off("change:position",e.resizeTopLeft),e.resizeUpdate()})))}))},fixResizeRounding:function(){var e=this.poolComponent.shape.getBBox(),t=e.x,n=e.y,o=e.width,r=e.height;this.poolComponent.shape.resize(Math.round(o),Math.round(r)),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,o=this.node.diagram.bounds;t===o.width&&n===o.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 o="top-left",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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-(r+this.pointWidth),a+l-this.elementLeftX+rm,sm),y=Math.max(c+d-(i+this.pointWidth),c+d-this.elementTopY,this.poolComponent.laneSet?v:im),w=Math.max(h+f-(r+this.pointWidth),h+f-this.elementLeftX+am+rm,cm),x=Math.max(p+m-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===g[0]){var k=Math.max(a+l-(r+this.pointWidth)+rm,a+l-this.elementLeftX+rm,sm);this.poolComponent.shape.resize(k,y,{direction:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else e.set("previousPosition",{x:r,y:i}),this.shape.resize(b,y,{direction:o}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeTopRight:function(e,t,n){if(n.ui){var o="top-right",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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(r-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(r-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:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(g,v,{direction:o}),e.set("previousPosition",{x:r,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomLeft:function(e,t,n){if(n.ui){var o="bottom-left",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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-(r+this.pointWidth),a+l-this.elementLeftX+rm,sm),v=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?m:im),b=Math.max(u+p-(r+this.pointWidth),u+p-this.elementLeftX+am+rm,cm),y=Math.max(i-h,lm);if(this.isLane)if(this.shape===f[f.length-1]){var w=Math.max(a+l-(r+this.pointWidth)+rm,a+l-this.elementLeftX+rm,sm);this.poolComponent.shape.resize(w,v,{direction:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(g,v,{direction:o}),e.set("previousPosition",{x:r,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomRight:function(e,t,n){if(n.ui){var o="bottom-right",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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(r-a,this.elementRightX-a,sm),m=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?p:im),g=Math.max(r-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:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(f,m,{direction:o}),e.set("previousPosition",{x:r,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,o=t.y,r=t.width,i=t.height;0!==e&&this.anchorPoints[0].position(n+r,o+i),1!==e&&this.anchorPoints[1].position(n-this.pointWidth,o+i),2!==e&&this.anchorPoints[2].position(n+r,o-this.pointHeight),3!==e&&this.anchorPoints[3].position(n-this.pointWidth,o-this.pointWidth)}},setPointAttributes:function(e,t,n){e.attr({body:{fill:"#fff",stroke:" #fff",opacity:.8},image:{xlinkHref:om,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:Ms},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:rm/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=mo(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:rm/2},polyline:{refPointsKeepOffset:"".concat(rm,",0 ").concat(rm,",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:Ms},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=mo(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:sr[Em],rank:80,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataObjectReference",{name:t(sr[Em])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:36})})},inspectorConfig:[{name:sr[Em],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-object"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},_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))},Mm=[],Tm=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:Ms},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 Tm,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=mo(Im,_m,Mm,!1,null,null,null),Nm=Om.exports,Dm="processmaker-modeler-data-store",Rm={id:Dm,component:Nm,bpmnType:"bpmn:DataStoreReference",control:!0,category:"BPMN",icon:f(63427),label:sr[Dm],rank:90,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataStoreReference",{name:t(sr[Dm])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:50})})},inspectorConfig:[{name:sr[Dm],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-store"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]};function Bm(e,t){var n=new bm,o=e.diagram.bounds;return n.position(o.x,o.y),n.resize(o.width,o.height),n.attr("label/text",F.util.breakText(e.definition.get("name"),{width:o.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+rm}),e.resize(e.getBBox().width-rm,e.getBBox().height-rm),e.resize(e.getBBox().width,e.getBBox().height-rm,{direction:"top"});var n=e.get("size"),o=n.width,r=n.height,i=t.diagram.bounds;e.resize(Math.max(o,i.width),Math.max(r,i.height))}function Fm(e,t,n){var o=Bm(t,n);return e||(Lm(n,o),jm(o,t)),o}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!==Dm}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}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.getElementByNodeId(t.poolId),r=e.moddle.create("bpmn:Lane",{name:t.name}),t.poolX&&t.poolY&&o.set("position",{x:t.poolX,y:t.poolY}),!o.component.laneSet&&o.component.createLaneSet&&(o.component.createLaneSet([t.laneSetId]),o.component.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){r.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 pr(t.type,r,s),c.pool=o,n.next=9,e.addNode(c,t.id,!0);case 9:e.setShapeStacking(o.component.shape);case 10: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)},Hm=[],Vm=f.p+"img/lane-above.37ee2b80.svg",Wm={components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},data:function(){return{laneAboveIcon:Vm}},created:function(){mr.library.add(br)}},Gm=Wm,$m=mo(Gm,qm,Hm,!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:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},data:function(){return{laneBelowIcon:Zm}},created:function(){mr.library.add(yr)}},Qm=Km,eg=mo(Qm,Ym,Jm,!1,null,null,null),tg=eg.exports,ng={components:{CrownConfig:Ms,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(),o=n.x,r=n.y,i=n.width,s=n.height,a={x:o,y:r,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 o=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(o.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 o=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(o.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 o,r,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=!(e.length>0&&void 0!==e[0])||e[0],r=[],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)})),r.push(t.pushNewLane(i))),r.push(t.pushNewLane()),n.next=6,Promise.all(r).then((function(e){o&&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,o=null!==e&&void 0!==e?e:n.generate(),r=jt(o,1),i=r[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 o,r,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:Um.definition(t.moddle,t.$t),o.set("color",t.node.definition.get("color")),t.$emit("set-pool-target",t.shape),r=Um.diagram(t.moddle),r.bounds.width=t.shape.getBBox().width,i=new pr(Um.id,o,r),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(),o=n.width,r=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?r:i.height;e.resize(o-rm,a),e.position(rm,s?0:this.isAddingLaneAbove?-a:r,{parentRelative:!0}),t.resize(o,s?r:r+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(),o=n.x,r=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-o,f=h-r,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<rm+am&&(y=i+(rm+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 o,r=this.shape.get("size").height,i=this.sortedLanes().reduce((function(e,t){return e+t.getBBox().height}),0),s=n?e.get("size").height:r-i;switch(t){case"top-right":o="bottom-right";break;case"top-left":o="bottom-left";break;case"bottom-right":o="top-right";break;case"bottom-left":o="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:o}),this.shape.resize(l+rm,r,{direction:o}),this.sortedLanes().forEach((function(e){return e.resize(l,e.getBBox().height,{direction:o})}))},resizeLanes:function(){var e=this;this.sortedLanes().forEach((function(t,n,o){var r=e.shape.get("size"),i=r.width,s=r.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===o.length-1){var p=s-(t.position({parentRelative:!0}).y+c);u=c+p}t.resize(i-rm,u),t.position(rm,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+rm}),this.shape.resize(this.shape.getBBox().width-rm,this.shape.getBBox().height-rm),this.shape.resize(this.shape.getBBox().width,this.shape.getBBox().height-rm,{direction:"top"})},resizePool:function(e){var t=this;this.fitEmbeds();var n=this.shape.get("size"),o=n.width,r=n.height,i=this.node.diagram.bounds;this.shape.resize(Math.max(o,i.width),Math.max(r,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 o=e.graph.findModelsUnderElement(n,{searchBy:"center"}).find((function(e){return e.component&&e.component.node.type===dl}));t[o.id]?t[o.id].push(n.component.node.definition):t[o.id]=[n.component.node.definition]})),this.sortedLanes().forEach((function(e){var n=t[e.id],o=e.component.node.definition.get("flowNodeRef"),r=n?n.length!==o.length:o.length>0;r&&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(),o=n.x,r=n.y,i=e.get("size"),s=i.width,a=i.height;this.node.diagram.bounds.x=o,this.node.diagram.bounds.y=r,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)}},og=ng,rg=mo(og,tm,nm,!1,null,null,null),ig=rg.exports,sg={id:Jr,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}]},Ha,Da]}]},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,o){return[t("dt",{key:"".concat(n.errorId,"_").concat(o),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(o,"_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,o){return[t("dt",{key:n.title+o,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+o+"__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],o=t[1];return o.flatMap((function(e){return er(er({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))}var dg={components:{FontAwesomeIcon:Mr.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),mo(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.filteredPlayers},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,onGenerateAssets:function(t){return e.onGenerateAssets()}}}):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.panMode&&e.panning,"grab-cursor":e.panMode&&!e.panning}],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(),e.isAiGenerated?t("CreateAssetsCard",{ref:"createAssetsCard",on:{onGenerateAssets:function(t){return e.onGenerateAssets()},closeCreateAssets:function(t){e.isAiGenerated=!1}}}):e._e(),e.loadingAI?t("GeneratingAssetsCard",{ref:"generatingAssetsCard",on:{stopAssetGeneration:function(t){return e.onStopAssetGeneration()}}}):e._e(),e.assetsCreated?t("AssetsCreatedCard",{ref:"assetsCreatedCard",on:{closeAssetsCreated:function(t){e.assetsCreated=!1}}}):e._e(),e.assetFail?t("CreateAssetsFailCard",{ref:"createAssetsFailCard",on:{onDismiss:function(t){e.assetFail=!1}}}):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&&!(e.highlightedNodes.length>1),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){var o;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":null===(o=e.definitions)||void 0===o?void 0:o.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,"definition-changed":e.onNodeDefinitionChanged}})})),t("RailBottom",{directives:[{name:"show",rawName:"v-show",value:!e.loadingAI,expression:"!loadingAI"}],attrs:{nodeTypes:e.nodeTypes,"paper-manager":e.paperManager,graph:e.graph,"is-rendering":e.isRendering,"pan-mode":e.panMode},on:{"load-xml":e.loadXML,clearSelection:e.clearSelection,"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler,"set-pan-mode":function(t){e.panMode=t}}}),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(),e._l(e.filteredPlayers,(function(n){return t("RemoteCursor",{key:n.id,attrs:{data:e.prepareCursorData(n)}})}))],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=function(e){var t,n,o={bpmnType:e.diagram.$type,id:e.diagram.id,type:e.type,attachedToRef:e.definition.get("attachedToRef")},r=e.definition.get("eventDefinitions")[0],i=Object.keys(r).reduce((function(e,t){return t.startsWith("time")&&(e[t]=r[t]),e}),{}),s=Object.keys(i)[0];return{x:e.diagram.bounds.x,y:e.diagram.bounds.y,height:e.diagram.bounds.height,width:e.diagram.bounds.width,attachedToRefId:null===(t=e.definition.get("attachedToRef"))||void 0===t?void 0:t.id,control:o,type:e.type,id:e.definition.id,color:e.definition.get("color"),cancelActivity:e.definition.get("cancelActivity"),eventTimerDefinition:{type:s,body:null===(n=i[s])||void 0===n?void 0:n.body}}},wg={components:{CrownConfig:Ms},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,o=e.width,r=e.height;this.shape.position(t,n),this.shape.resize(o,r),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,o=this.previousPosition,r=o.x,i=o.y;return t!==r||n!==i},getCenterPosition:function(){var e=this.shape.position(),t=e.x,n=e.y,o=this.shape.size(),r=o.width,i=o.height;return{x:t+r/2,y:n+i/2}},updateShapePosition:function(e){if(this.hasPositionChanged()){var t=Mt(this.getCenterPosition(),e),n=t.x,o=t.y,r=this.shape.size(),i=r.width,s=r.height;this.shape.position(n-i/2,o-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&&(Dt(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&&Dt(this.invalidTargetElement),this.invalidTargetElement=e}}},addMultiplayerBoundaryEvent:function(){var e=yg(this.node);window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",e)}},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)})))()}},xg=wg,kg=mo(xg,gg,vg,!1,null,null,null),Cg=kg.exports,Sg={id:"processmaker-modeler-boundary-event",component:Cg,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}]}]}]},Eg=f(67629),Ag=f.n(Eg),_g=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)])},Mg=[],Tg=5e3;zt().use(Dn);var Pg=new Dn.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,Ao.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 er(er({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setPinnedNodes:function(e,t){e.pinnedNodeTypes.push(t),e.pinnedNodeTypes=(0,Ao.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,o=e.nodeTypes;e.searchTerm=t;var r=(0,Ao.uniqBy)([].concat(W(n),W(o)),"id");e.filteredNodeTypes=r.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,Ao.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 er(er({},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 o=(0,Ao.uniqBy)(W(n),"id");e.filteredPmBlockNodeTypes=o.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=e.commit;if("standalone"!==(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.user)||void 0===t?void 0:t.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){n("setPinnedNodes",e)}))})).catch((function(e){console.error(e)}))}else{var r=localStorage.pinnedNodes?JSON.parse(localStorage.pinnedNodes):[];r.forEach((function(e){n("setPinnedNodes",e)}))}},addUserPinnedObject:function(e,t){var n,o=e.commit,r=e.state;o("setPinnedNodes",t);var i=r.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(n=n.user)||void 0===n?void 0:n.id)){var s=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(s,"/update_pinned_controls"),{pinnedNodes:i}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(i)},removeUserPinnedObject:function(e,t){var n,o=e.commit,r=e.state;o("setUnpinNode",t);var i=r.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(n=n.user)||void 0===n?void 0:n.id)){var s=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(s,"/update_pinned_controls"),{pinnedNodes:i}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(i)}}}),Ig=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)])},Og=[],Ng={name:"FilterNodeTypes",props:["type"],data:function(){return{searchTerm:""}},watch:{searchTerm:function(e){"pmBlock"===this.type?(0===e.length&&Pg.commit("clearFilteredPmBlockNodes"),e.length>0&&Pg.commit("setFilteredPmBlockNodeTypes",e)):(0===e.length&&Pg.commit("clearFilteredNodes"),e.length>0&&Pg.commit("setFilteredNodeTypes",e))},type:function(e,t){this.searchTerm=t===e?this.searchTerm:""}},computed:{nodeTypes:function(){var e=Pg.getters.getPinnedNodeTypes,t=Pg.getters.getNodeTypes;return[].concat(W(e),W(t))},pmBlockNodes:function(){var e=Pg.getters.getPmBlockNodeTypes;return W(e)},placeholder:function(){return"pmBlock"===this.type?this.$t("Search PM Blocks"):this.$t("Search Objects")}}},Dg=Ng,Rg=(f(29062),mo(Dg,Ig,Og,!1,null,"c468f432",null)),Bg=Rg.exports,Lg=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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}}):t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin Element"},on:{click:function(t){return e.addPin(n)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],2)]],2)},jg=[],Fg=f.p+"img/pin-angle.95ef112b.svg",zg=f.p+"img/pin-angle-fill.45c5a07f.svg",Ug={methods:{containsSvg:function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/;return"string"===typeof e&&(t.test(e)||n.test(e))}}},qg={mixins:[Ug],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,Pg.commit("setSelectedNode",t),this.$emit("onSetCursor","crosshair"),this.parent||(this.popperType=t.type),window.ProcessMaker.EventBus.$on("custom-pointerclick",(function(e){window.ProcessMaker.EventBus.$emit("capture-hovered-link",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),Pg.commit("clearSelectedNode"),Pg.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,o=this.movedElement;o&&(o.style.left="".concat(t,"px"),o.style.top="".concat(n,"px")),Pg.commit("setGhostNode",o)},createDraggingHelper:function(e,t){this.movedElement&&(document.removeEventListener("mousemove",this.setDraggingPosition),document.body.removeChild(this.movedElement));var n=this.containsSvg(t.icon),o=n?document.createElement("img"):document.createElement("i");Object.assign(o.style,this.helperStyles),n?o.src=t.icon:(o.setAttribute("class",t.icon),o.style.fontSize="42px",o.style.width="42px",o.style.height="42px"),document.body.appendChild(o),Pg.commit("setGhostNode",o);var r=e.target;this.xOffset=e.clientX-r.getBoundingClientRect().left,this.yOffset=e.clientY-r.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,Pg.commit("clearSelectedNode"),Pg.commit("setGhostNode",null)},startDragNewObject:function(e,t){window.ProcessMaker.mouseDownDrag=!0,this.onClickHandler(e,t)},cancelDragNewObject:function(){window.ProcessMaker.mouseDownDrag=!1}},computed:{selectedItem:function(){return Pg.getters.getSelectedNode},movedElement:function(){return Pg.getters.getGhostNode}}},Hg={name:"NodeTypesLoop",mixins:[qg,Ug],data:function(){return{pinIcon:Fg,pinFillIcon:zg,showPin:!1}},created:function(){Pg.dispatch("getUserPinnedObjects")},methods:{nodeTypeAlreadyPinned:function(e,t){return!!this.pinnedObjects.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Pg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Pg.dispatch("addUserPinnedObject",e)}},computed:{pinnedObjects:function(){var e=Pg.getters.getPinnedNodeTypes,t=e.filter((function(e){var t;return!(null!==(t=e.type)&&void 0!==t&&t.includes("processmaker-pm-block"))}));return t},objects:function(){return Pg.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 Pg.getters.getFilteredNodeTypes},searchTerm:function(){return Pg.getters.getSearchTerm}}},Vg=Hg,Wg=(f(96494),mo(Vg,Lg,jg,!1,null,null,null)),Gg=Wg.exports,$g=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",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)))]),e.blockAlreadyPinned(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.filteredPmBlockNodes.length||e.searchTerm?e._e():[e.pinnedBlocks.length>0?t("div",{staticClass:"pinnedBlocks"},[t("p",[e._v(e._s(e.$t("Pinned PM Blocks")))]),e._l(e.pinnedBlocks,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.customIcon}),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("PM Block Category")))]),e._l(e.unpinnedBlocks,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.customIcon}),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)},Xg=[],Yg={name:"PmBlocksLoop",mixins:[qg,Ug],data:function(){return{pinIcon:Fg,pinFillIcon:zg,showPin:!1}},created:function(){Pg.dispatch("getUserPinnedObjects")},methods:{blockAlreadyPinned:function(e,t){return!!this.pinnedBlocks.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Pg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Pg.dispatch("addUserPinnedObject",e)}},computed:{pinnedBlocks:function(){var e=Pg.getters.getPinnedNodeTypes,t=e.filter((function(e){var t;return null===(t=e.type)||void 0===t?void 0:t.includes("processmaker-pm-block")}));return t},unpinnedBlocks:function(){var e=this,t=this.pmBlockNodeTypes;return t.filter((function(t){return!e.pinnedBlocks.some((function(e){return e.type===t.type}))}))},pmBlockNodeTypes:function(){return Pg.getters.getPmBlockNodeTypes},filteredPmBlockNodes:function(){return Pg.getters.getFilteredPmBlockNodeTypes},searchTerm:function(){return Pg.getters.getSearchTerm}}},Jg=Yg,Zg=(f(92041),mo(Jg,$g,Xg,!1,null,null,null)),Kg=Zg.exports,Qg={name:"ExplorerRail",props:{explorerExpanded:{type:Boolean},nodeTypes:{type:Array},pmBlockNodes:{type:Array}},components:{FontAwesomeIcon:Mr.FontAwesomeIcon,FilterNodeTypes:Bg,NodeTypesLoop:Gg,PmBlocksLoop:Kg},data:function(){return{tabs:[{idx:0,label:"Add Object"},{idx:1,label:"PM Blocks"}],tabIndex:0}},computed:{explorerOpen:function(){return Pg.getters.getExplorerOpen}},created:function(){Pg.commit("setNodeTypes",this.nodeTypes)},methods:{faTimes:function(){return is.faTimes},setTabIndex:function(e){this.tabIndex!==e&&(this.tabIndex=e,this.clearFilteredObjects())},closeRail:function(){Pg.commit("closeExplorer"),this.clearFilteredObjects()},clearFilteredObjects:function(){Pg.commit("clearFilteredNodes"),Pg.commit("clearFilteredPmBlockNodes")}}},ev=Qg,tv=(f(14906),mo(ev,_g,Mg,!1,null,null,null)),nv=tv.exports,ov=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 iv={};function sv(e){return Object.keys(e).reduce(((t,n)=>(!1!==e[n]&&null!==e[n]&&void 0!==e[n]&&(t[n]=e[n]),t)),{})}const av={name:"InlineSvg",inheritAttrs:!1,render(e){return this.svgElSource?e("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),sv(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 o=n.length-1;o>=0;o--)t[n[o].name]=n[o].value;return t},getSvgContent(e){return e=e.cloneNode(!0),e=this.transformSource(e),this.title&&cv(e,this.title),e.innerHTML},getSource(e){iv[e]||(iv[e]=this.download(e)),this.svgElSource&&iv[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),iv[e].then((e=>{this.svgElSource=e,this.$nextTick((()=>{this.$emit("loaded",this.$el)}))})).catch((t=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete iv[e],this.$emit("error",t)}))},download(e){return lv(new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=()=>{if(o.status>=200&&o.status<400)try{const e=new DOMParser,r=e.parseFromString(o.responseText,"text/xml");let i=r.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"))},o.onerror=n,o.send()})))}}};function cv(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 lv(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 dv={name:"WelcomeMessage",components:{InlineSvg:av},data:function(){var e;return{proceC2Icon:f(7225),lastSession:{},history:[],processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.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,o=(null===(n=t.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.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"}}},uv=dv,hv=(f(83665),mo(uv,ov,rv,!1,null,"a8e6c808",null)),pv=hv.exports,fv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex pl-2 justify-content-between align-items-center"},[t("div",{staticClass:"col-9"},[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticStyle:{color:"#556271","font-weight":"600"}},[e._v(e._s(e.$t("Create your missing assets with AI")))])],1),t("div",{staticStyle:{color:"#556271","font-weight":"400"}},[e._v(" "+e._s(e.$t("Use AI to easily produce the necessary screens and scripts to complete the process."))+" ")])]),t("div",{staticClass:"col-3 h-100 p-0 d-flex flex-column justify-content-center"},[t("button",{staticClass:"h-100 createBtn btn btn-primary btn-block",on:{click:function(t){return e.onCreateAssets()}}},[e._v(" "+e._s(e.$t("Create now"))+" ")]),t("button",{staticClass:"h-100 m-0 cancelBtn btn btn-light btn-block",on:{click:function(t){return e.onCancel()}}},[e._v(" "+e._s(e.$t("Close"))+" ")])])])])],1)},mv=[],gv={name:"CreateAssetsCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onCreateAssets:function(){this.$emit("onGenerateAssets")},onCancel:function(){this.$emit("closeCreateAssets")}}},vv=gv,bv=(f(89841),mo(vv,fv,mv,!1,null,"46a7ce7f",null)),yv=bv.exports,wv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100 w-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex p-3 justify-content-between align-items-center"},[t("div",[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticClass:"card-text"},[e._v(e._s(e.$t("Generating...")))])],1)]),t("div",{staticClass:"p-0"},[t("button",{staticClass:"h-100 px-3 cancel-btn btn btn-secondary",on:{click:function(t){return e.onStop()}}},[e._v(" "+e._s(e.$t("STOP"))+" ")])])])])],1)},xv=[],kv={name:"GeneratingAssetsCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onStop:function(){this.$emit("stopAssetGeneration")}}},Cv=kv,Sv=(f(24798),mo(Cv,wv,xv,!1,null,"dfb6ccb8",null)),Ev=Sv.exports,Av=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100 w-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex pl-2 justify-content-between align-items-center"},[t("div",{staticClass:"col-9"},[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticStyle:{color:"#556271","font-weight":"600"}},[e._v(e._s(e.$t("Assets Generated Successfully")))])],1),t("div",{staticStyle:{color:"#556271","font-weight":"400"}},[e._v(" "+e._s(e.$t("Check them on their corresponding tasks"))+" ")])]),t("div",{staticClass:"col-3 h-100 p-0 d-flex flex-column justify-content-center"},[t("button",{staticClass:"h-100 m-0 cancelBtn btn btn-light btn-block",on:{click:function(t){return e.onClose()}}},[e._v(" "+e._s(e.$t("Close"))+" ")])])])])],1)},_v=[],Mv={name:"AssetsCreatedCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onClose:function(){this.$emit("closeAssetsCreated")}}},Tv=Mv,Pv=(f(72858),mo(Tv,Av,_v,!1,null,"2a8117cc",null)),Iv=Pv.exports,Ov=function(){var e=this,t=e._self._c;return t("div",{staticClass:"customAlert mx-auto mt-2"},[t("b-alert",{attrs:{show:"",dismissible:"",variant:"warning"},on:{dismissed:function(t){return e.onDismiss()}}},[e._v(" "+e._s(e.$t("Generation of assets was not able to complete. Try again"))+" ")])],1)},Nv=[],Dv={name:"CreateAssetsFailCard",data:function(){return{}},methods:{onDismiss:function(){this.$emit("onDismiss")}}},Rv=Dv,Bv=(f(24700),mo(Rv,Ov,Nv,!1,null,"0b1e2c98",null)),Lv=Bv.exports,jv=f(33293),Fv=f(82729),zv=f.n(Fv),Uv=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)},qv=[],Hv={components:{InlineSvg:av},props:{showInspector:{type:Boolean,default:!0}},data:function(){return{inspectorIcon:f(28400)}},methods:{toggleInspector:function(){this.$emit("toggleInspector",!this.showInspector)}}},Vv=Hv,Wv=(f(5728),mo(Vv,Uv,qv,!1,null,"cebfb20a",null)),Gv=Wv.exports,$v=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)},Xv=[],Yv=f(43637),Jv=f(21223),Zv=(f(85780),f(50308)),Kv=f.n(Zv),Qv={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:Ds},{component:"FormInput",config:{label:"Name",helper:"The Name of the Process",name:"name",placeholder:""}}]}]}]},eb=Qv.id,tb=Qv;zt().component("FormText",Yv.renderer.FormText),zt().component("FormInput",Jv.FormInput),zt().component("FormSelect",Jv.FormSelect),zt().component("FormTextArea",Jv.FormTextArea),zt().component("FormCheckbox",Jv.FormCheckbox),zt().component("FormRadioButtonGroup",Jv.FormRadioButtonGroup),zt().component("FormAccordion",Jv.FormAccordion),zt().component("FormDatePicker",Jv.FormDatePicker),zt().component("FormMultiSelect",Jv.FormMultiSelect);var nb={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)},"highlightedNode.definition.allowInterstitial":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.interstitialScreenRef":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.screenRef":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.scriptRef":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 Kv();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 o=n.documentation?[e.moddle.create("bpmn:Documentation",{text:n.documentation})]:void 0;e.setNodeProp(e.highlightedNode,"documentation",o),e.multiplayerHook("documentation",o,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=tb.inspectorConfig;var o=hr()(this.nodeRegistry[t].inspectorConfig),r=$()(o,"[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=r.find((function(e){return e.config&&"Name"===e.config.label})),c=r.indexOf(a);a&&c>=0?r.splice(c+1,0,s):r.push(s)}return this.config=o},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),o=n[0],r=n[1];return e[o]=r,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})}}},ob=nb,rb=(f(75766),mo(ob,$v,Xv,!1,null,"618b3b58",null)),ib=rb.exports,sb=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",{staticClass:"preview-iframe",style:{visibility:e.displayPreviewIframe},attrs:{title:"Preview",src:e.previewUrl},on:{load:e.loading,mousemove:e.onMouseMove,mouseup:e.onMouseUp}})],1)],1)},ab=[],cb=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.")])])},lb=[],db={data:function(){return{noPreviewImg:f(2431)}}},ub=db,hb=(f(79763),f(17378),mo(ub,cb,lb,!1,null,"cdc64a14",null)),pb=hb.exports,fb=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}})])},mb=[],gb={data:function(){return{previewAsset:f(74818),spinnerImg:f(95522)}}},vb=gb,bb=(f(24289),f(64346),mo(vb,fb,mb,!1,null,"0cafde2c",null)),yb=bb.exports,wb={props:["nodeRegistry","visible","previewConfigs","panelWidth"],components:{NoPreviewAvailable:pb,LoadingPreview:yb},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(){var e=this.getConfig(this.data);e?(document.activeElement.blur(),this.previewNode()):this.$emit("togglePreview",!1)}},computed:{highlightedNode:function(){return Un.getters.highlightedNodes[0]},displayPreviewIframe:function(){var e=!!this.previewUrl&&!this.showSpinner;return e?"visible":"hidden"}},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;if(!this.highlightedNode)return{};var n=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return e[o]=r,e}),{})};this.data=n(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===(t=t.definition)||void 0===t?void 0:t.name},onSelectedPreview:function(e){this.selectedPreview=e},previewNode:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.highlightedNode&&(this.visible||t)){this.prepareData();var n=this.getConfig(this.data),o={};for(var r in this.data){var i;(null!==(i=null===n||void 0===n?void 0:n.receivingParams)&&void 0!==i?i:[]).includes(r)&&(o[r]=this.data[r])}var s=encodeURI(JSON.stringify(o)),a=Object.keys(o).length>0,c=!(null===n||void 0===n||!n.assetUrl(this.data));this.previewUrl=c&&n&&a?"".concat(n.url,"?node=").concat(s):null,this.taskTitle=null===(e=this.highlightedNode)||void 0===e||null===(e=e.definition)||void 0===e?void 0:e.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}}},xb=wb,kb=(f(37700),mo(xb,sb,ab,!1,null,"0475b5a0",null)),Cb=kb.exports;zt().use(Dn);var Sb=new Dn.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},isRunning:function(e){return e.isRunning}},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},isRunning:function(e,t){e.isRunning=t}},actions:{pushState:function(e,t){var n=e.state,o=e.getters,r=e.commit;t===o.currentState||n.disabled||(r("setState",t),r("setPosition",n.stack.length-1))},undo:function(e){var t=e.state,n=e.getters,o=e.commit;n.canUndo&&(o("isRunning",!0),o("setPosition",t.position-1))},redo:function(e){var t=e.state,n=e.getters,o=e.commit;n.canRedo&&(o("isRunning",!0),o("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)},done:function(e){var t=e.commit;t("isRunning",!1)}}}),Eb=f(51540),Ab=f(51248),_b=f.n(Ab),Mb=f(48909),Tb=f.n(Mb),Pb=f(82317),Ib=f.n(Pb),Ob=f(83184),Nb=f.n(Ob),Db=f(36111),Rb=f.n(Db),Bb=f(25795),Lb=f.n(Bb),jb=f(37554),Fb=f.n(jb),zb=f(19869),Ub=f.n(zb),qb=f(88687),Hb=f.n(qb),Vb=f(37028),Wb=f.n(Vb),Gb=f(89185),$b=f.n(Gb),Xb=f(34652),Yb=f.n(Xb),Jb=f(49252),Zb=f.n(Jb),Kb=f(93414),Qb=f.n(Kb),ey=f(68522),ty=f.n(ey),ny=f(7174),oy=f.n(ny),ry=f(74815),iy=f.n(ry),sy=f(24874),ay=f.n(sy),cy={};function ly(){}ly.prototype.resolveRule=function(e,t){const n=cy[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">");return n},ly.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">")};var dy=new ly,uy={"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"},hy={rules:uy},py={resolver:dy,config:hy},fy=py;function my(e,t,n,o,r,i,s){var a={allowDrop:!1,poolTarget:null};if(!wy(e,t,s))return a.allowDrop=!1,a;if(by(n.type))return a.allowDrop=!0,a;if(xy(n.bpmnType)){var c=r.findModelsFromPoint(ky(e,t,o)).sort((function(e,t){return t.get("z")-e.get("z")}))[0];return a.allowDrop=Oi(n.type,c),a}if(yy(i))return a.allowDrop=!0,a;if(gy(n.bpmnType))return a.allowDrop=!0,a;var l=vy(e,t,o,r);return l&&(a.allowDrop=!0,a.poolTarget=l),a}function gy(e){return"bpmn:TextAnnotation"===e}function vy(e,t,n,o){return o.findModelsFromPoint(ky(e,t,n)).find((function(e){var t=e.component;return t&&t.node.type===Jr}))}function by(e){return e===Jr}function yy(e){return!e||0===e.get("participants").length}function wy(e,t,n){var o=n.getBoundingClientRect(),r=o.left,i=o.top,s=o.width,a=o.height,c=new F.g.rect(r,i,s,a),l=new F.g.Point(e,t);return c.containsPoint(l)}function xy(e){return"bpmn:BoundaryEvent"===e}function ky(e,t,n){return n.clientToLocalPoint({x:e,y:t})}cy["bpmnlint/conditional-flows"]=_b(),cy["bpmnlint/end-event-required"]=Tb(),cy["bpmnlint/event-sub-process-typed-start-event"]=Ib(),cy["bpmnlint/label-required"]=Nb(),cy["bpmnlint/no-complex-gateway"]=Rb(),cy["bpmnlint/no-disconnected"]=Lb(),cy["bpmnlint/no-gateway-join-fork"]=Fb(),cy["bpmnlint/no-implicit-split"]=Ub(),cy["bpmnlint/single-event-definition"]=Hb(),cy["bpmnlint/start-event-required"]=Wb(),cy["bpmnlint/sub-process-blank-start-event"]=$b(),cy["bpmnlint/superfluous-gateway"]=Yb(),cy["bpmnlint-plugin-processmaker/custom-validation"]=Zb(),cy["bpmnlint-plugin-processmaker/gateway-direction"]=Qb(),cy["bpmnlint-plugin-processmaker/event-based-gateway"]=ty(),cy["bpmnlint-plugin-processmaker/call-activity-child-process"]=oy(),cy["bpmnlint-plugin-processmaker/id-required"]=iy(),cy["bpmnlint-plugin-processmaker/signal-ref-required"]=ay();var Cy,Sy,Ey,Ay,_y,My,Ty,Py,Iy,Oy,Ny,Dy,Ry=f(7407),By=f.n(Ry),Ly={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:By()}}},jy=Ly,Fy=mo(jy,Cy,Sy,!1,null,null,null),zy=Fy.exports,Uy="processmaker-modeler-boundary-error-event",qy=ac()(hr()(Sg),{id:Uy,component:zy,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:[{}]},Ha,Da]}]}),Hy={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){this.shape.attr({image:{"ref-x":4,"ref-y":4,width:18,height:18}})}},Vy=Hy,Wy=mo(Vy,Ey,Ay,!1,null,null,null),Gy=Wy.exports,$y={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"}},Xy=$y,Yy="processmaker-modeler-boundary-conditional-event",Jy=ac()(hr()(Sg),er(er({},pp),{},{id:Yy,component:Gy,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()),[Xy])},Da,Ha]}]})),Zy=f.p+"img/boundary-escalation-icon.c999a95e.svg",Ky={extends:Cg,mounted:function(){this.shape.attr("image/xlink:href",Zy)},methods:{isValidBoundaryEventTarget:function(e){return Ni(e.component)}}},Qy=Ky,ew=mo(Qy,_y,My,!1,null,null,null),tw=ew.exports,nw="processmaker-modeler-boundary-escalation-event",ow=ac()(hr()(Sg),{id:nw,component:tw,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:[{},Xy]},Ha,Da]}]}),rw=f(81146),iw=f.n(rw),sw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:iw()}},methods:{isValidBoundaryEventTarget:function(e){var t=e.component;return t&&t.node.isBpmnType("bpmn:CallActivity")}},mounted:function(){var e=mh();this.shape.attr(e)}},aw=sw,cw=mo(aw,Ty,Py,!1,null,null,null),lw=cw.exports,dw="processmaker-modeler-boundary-message-event",uw=ac()(hr()(Sg),er(er({},ql),{},{id:dw,component:lw,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:[{},Xy,Fl("Message that will trigger this boundary event")]},Ha,Da]}]})),hw=f(16221),pw=f.n(hw),fw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:pw()}},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}})}},mw=fw,gw=mo(mw,Iy,Oy,!1,null,null,null),vw=gw.exports,bw="processmaker-modeler-boundary-signal-event",yw=ac()(hr()(Sg),er(er({},rd),{},{id:bw,component:vw,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:[{},Xy,od("Signal that will trigger this boundary event")]},Ha,Da]}]})),ww=f(50889),xw=f.n(ww),kw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:xw()}},methods:{addTimerEventDefinitionId:function(){var e="".concat(this.id,"_timer_event_definition");this.node.definition.get("eventDefinitions")[0].id=e}},mounted:function(){this.addTimerEventDefinitionId()}},Cw=kw,Sw=mo(Cw,Ny,Dy,!1,null,null,null),Ew=Sw.exports,Aw="processmaker-modeler-boundary-timer-event",_w=function(e,t,n,o){var r=y({},n,e.create("bpmn:Expression",{body:o}));return[e.create("bpmn:TimerEventDefinition",r)]},Mw=(0,Ao.merge)((0,Ao.cloneDeep)(Sg),{id:Aw,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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=Object.keys((0,Ao.omit)(r[0],["id","$type","get","set","$instanceOf"]))[0],s=r[0][i].body;e[o]={type:i,body:s}}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=r.get(i)[0][a];if(l&&l.body===c)continue;var d=_w(o,t,a,c);n(t,"eventDefinitions",d),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventTimerDefinition",value:{type:a,body:c}})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{items:[{},Xy]},{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"}}]},Da,Ha]}]});function Tw(e,t,n){var o=x(e,t,"set");return A(e,o,n),n}var Pw=new WeakMap,Iw=function(){function e(t){d(this,e),b(this,Pw,{writable:!0,value:void 0}),y(this,"preventTranslate",!1),Tw(this,Pw,t)}return g(e,[{key:"paper",get:function(){return k(this,Pw)}},{key:"scale",get:function(){return k(this,Pw).scale()},set:function(e){k(this,Pw).scale(e),k(this,Pw).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,Pw).translate(e,t),k(this,Pw).trigger("translate:changed"))}},{key:"addEventHandler",value:function(e,t,n){k(this,Pw).on(e,t,n)}},{key:"addOnceHandler",value:function(e,t){k(this,Pw).once(e,t)}},{key:"removeEventHandler",value:function(e,t,n){k(this,Pw).off(e,t,n)}},{key:"setPaperDimensions",value:function(e,t){k(this,Pw).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,Pw).freeze(),e.next=3,t(k(this,Pw));case 3:k(this,Pw).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,Pw).localToPagePoint(0,0),o=this.scale;return{x:this.roundToNearestGridMultiple((e-n.x)/o.sx),y:this.roundToNearestGridMultiple((t-n.y)/o.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,Pw)._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,o){var r=3,i=new F.dia.Paper({async:!0,el:t,model:o,sorting:"sorting-approximate",gridSize:e.gridSize,drawGrid:!0,snapLinks:!1,snapElements:!1,clickThreshold:10,perpendicularLinks:!0,interactive:n,highlighting:{default:{options:{padding:r}}}});return i.translate(168,20),new this(i)}}]),e}();function Ow(e,t,n){var o=Rw(e,t,n);Dw(o,t),e.inspectorConfig[0].items.sort(Nw)}function Nw(e,t){return Bw(e)?1:Bw(t)?-1:0}function Dw(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 Rw(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 Bw(e){return e.config&&"Advanced"===e.config.label}function Lw(e,t){Hw(e)&&Fw(e);var n=qw(e);n&&Fw(n),jw(e)&&!Hw(e)&&zw(e),Uw(t)}function jw(e){return e.component.node.type!==dl}function Fw(e){zw(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})),o=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl}));n.forEach(zw),o.forEach(zw)}}function zw(e){e.toFront({deep:!0})}function Uw(e){e.getLinks().forEach(zw)}function qw(e){return e.component.node.pool}function Hw(e){return e.component.node.type===Jr}y(Iw,"gridSize",kp);var Vw=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",e._g({attrs:{"validation-errors":e.validationErrors,warnings:e.warnings,players:e.players}},e.$listeners),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)])},Ww=[],Gw=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,o){return t("li",{key:o,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()])},$w=[function(){var e=this,t=e._self._c;return t("li",{staticClass:"breadcrumb-item"},[t("a",{attrs:{href:"/"}},[t("i",{staticClass:"fas fa-home"})])])}],Xw={name:"breadcrumb",props:{breadcrumbData:{type:Array,default:function(){return[]}}}},Yw=Xw,Jw=(f(61573),mo(Yw,Gw,$w,!1,null,"d1e148b4",null)),Zw=Jw.exports,Kw=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}}),e.isPackageAiInstalled?t("AiGenerateButton",e._g({},e.$listeners)):e._e(),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)},Qw=[],ex=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)},tx=[],nx={components:{InlineSvg:av},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()}))}},ox=nx,rx=(f(70947),mo(ox,ex,tx,!1,null,"5880bbc6",null)),ix=rx.exports,sx=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)])},ax=[],cx={components:{InlineSvg:av},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)}}},lx=cx,dx=(f(59724),mo(lx,sx,ax,!1,null,"337583fe",null)),ux=dx.exports,hx=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,o){return t("div",{key:"".concat(n.errorId,"_").concat(o),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,o){return t("div",{key:n.title+o,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)},px=[],fx={components:{VueInlineSvg:av},props:{errorList:{type:Array,required:!0},warnings:{type:Array,required:!0}},data:function(){return{issueIcon:f(4298)}}},mx=fx,gx=(f(95254),mo(mx,hx,px,!1,null,"0722e36d",null)),vx=gx.exports,bx=function(){var e=this,t=e._self._c;return t("b-avatar-group",{directives:[{name:"show",rawName:"v-show",value:e.isMultiplayer,expression:"isMultiplayer"}],staticClass:"container"},[e._l(e.players,(function(e){return[t("Avatar",{key:e.id,attrs:{badgeBackgroundColor:e.color,imgSrc:e.avatar,userName:e.name,id:e.id}})]}))],2)},yx=[],wx=function(){var e=this,t=e._self._c;return t("span",{staticClass:"b-avatar rounded-circle",style:{backgroundColor:e.backgroundColor}},[e.imgSrc?t("span",{staticClass:"b-avatar-img",attrs:{id:e.id}},[t("img",{attrs:{src:e.imgSrc,alt:e.userName}})]):t("span",{staticClass:"b-avatar-text avatar-initials",attrs:{id:e.id}},[t("span",[e._v(" "+e._s(this.getInitials(e.userName))+" ")])]),t("b-tooltip",{attrs:{target:e.id,triggers:"hover"}},[e._v(" "+e._s(e.userName)+" ")]),e.badgeBackgroundColor?t("span",{staticClass:"b-avatar-badge badge-danger",style:{bottom:"0px",right:"0px",backgroundColor:e.badgeBackgroundColor}}):e._e()],1)},xx=[],kx={props:{badgeBackgroundColor:{type:String,required:!1},imgSrc:{type:String,required:!1},userName:{type:String,required:!1},id:{type:String,required:!0}},data:function(){return{saturation:50,lightness:50,range:10,backgroundColor:"#104A75"}},methods:{getInitials:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(" "),n=t[0].charAt(0).toUpperCase(),o=t[t.length-1].charAt(0).toUpperCase();return"".concat(n).concat(o)}}},Cx=kx,Sx=(f(52682),mo(Cx,wx,xx,!1,null,"b7e12804",null)),Ex=Sx.exports,Ax={components:{Avatar:Ex},props:{players:{type:Array,required:!0}},computed:{isMultiplayer:function(){return Un.getters.isMultiplayer}}},_x=Ax,Mx=mo(_x,bx,yx,!1,null,null,null),Tx=Mx.exports,Px=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-2"},[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:["btn py-0 px-2 ai-btn",e.showPopover?"ai-btn-open":"ai-btn-closed"],attrs:{id:"aiAssetButton",title:e.$t("AI Asset Generator")},on:{click:function(t){e.showPopover=!e.showPopover}}},[t("inline-svg",{staticClass:"my-auto ai-icon",attrs:{src:e.proceC2Icon}})],1),t("b-popover",{attrs:{target:"aiAssetButton",triggers:"click",show:e.showPopover,title:e.$t("Create your assets with AI"),placement:"auto"},on:{"update:show":function(t){e.showPopover=t}}},[t("div",{staticClass:"p-3 d-flex flex-column"},[t("div",{staticClass:"m-2"},[e._v(" "+e._s(e.$t("Create any missing assets for the process, including screens and scripts."))+" ")]),t("div",{staticClass:"m-2"},[t("span",{staticClass:"text-primary"},[e._v(" "+e._s(e.$t("Optimal results need proper task naming and connections."))+" ")])]),t("button",{staticClass:"m-2 btn btn-primary",on:{click:function(t){return e.onGenerateAssets()}}},[e._v(" "+e._s(e.$t("Create Assets with AI"))+" ")])])])],1)},Ix=[],Ox={name:"CreateAssetsButton",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225),showPopover:!1}},methods:{onGenerateAssets:function(){this.showPopover=!1,this.$emit("onGenerateAssets")}}},Nx=Ox,Dx=(f(14015),f(64110),mo(Nx,Px,Ix,!1,null,"45c79e4f",null)),Rx=Dx.exports,Bx={components:{ValidateButton:ix,ValidateIssue:ux,ValidatePanel:vx,AiGenerateButton:Rx,MultiplayerViewUsers:Tx},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],o=t[1];return o.flatMap((function(e){return er(er({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))},numberOfErrors:function(){return this.errorList.length+this.warnings.length},isPackageAiInstalled:function(){var e;return null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isPackageAiInstalled}},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}}},Lx=Bx,jx=(f(8309),mo(Lx,Kw,Qw,!1,null,"691d97f7",null)),Fx=jx.exports,zx={name:"tool-bar",components:{Breadcrumb:Zw,TopRail:Fx,FontAwesomeIcon:Mr.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 Sb.getters.canUndo},canRedo:function(){return Sb.getters.canRedo},versionStatus:function(){var e=Sb.getters.isDraft?"Draft":"Published";return this.$t(e)},isVersionsInstalled:function(){return Sb.getters.isVersionsInstalled},isLoading:function(){return Sb.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||Sb.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.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)}},Ux=zx,qx=(f(91503),mo(Ux,Vw,Ww,!1,null,null,null)),Hx=qx.exports;function Vx(e,t){var n=function(e){return e.isBpmnType("bpmn:MessageFlow",To,No)||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 o="flowElements";(e.isBpmnType("bpmn:TextAnnotation")||e.isBpmnType("bpmn:Association"))&&(o="artifacts"),t.get(o).push(e.definition)}}var Wx={methods:{zoomInOutHandler:function(e,t){var n="+"===e.key||"NumpadAdd"===e.key||107===e.keyCode||187===e.keyCode,o="-"===e.key||"NumpadSubtract"===e.key||109===e.keyCode||189===e.keyCode;n&&t.mod&&this.zoomIn(e),o&&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)}}},Gx={methods:{undoRedoHandler:function(e,t){var n=e.key.toLowerCase(),o="y"===n,r="z"===n;r&&t.mod&&this.undo(e),o&&t.mod&&this.redo(e)},undo:function(e){e.preventDefault(),this.$root.$emit("undo-keyboard-shortcut")},redo:function(e){e.preventDefault(),this.$root.$emit("redo-keyboard-shortcut")}}},$x={methods:{copyPasteHandler:function(e,t){var n=e.target.nodeName.toLowerCase(),o="body"===n,r=e.key.toLowerCase(),i="c"===r,s="v"===r;o&&i&&t.mod&&this.copy(e),o&&s&&t.mod&&this.paste(e)},copy:function(e){e.preventDefault(),window.ProcessMaker.$modeler.copyElement()},paste:function(e){e.preventDefault(),window.ProcessMaker.$modeler.pasteElements()}}},Xx=(f(51532),Iw.gridSize/2),Yx=new Map;Yx.set("Up",[0,-Xx]),Yx.set("Down",[0,Xx]),Yx.set("Left",[-Xx,0]),Yx.set("Right",[Xx,0]);var Jx=["PoolLane","processmaker.components.nodes.boundaryEvent.Shape"];function Zx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(Kx(e)){var o=t.filter(Qx);if(0!==o.length){var r=ek(e),i=jt(r,2),s=i[0],a=i[1];o.forEach((function(e){e.translate(s,a,{movedWithArrowKeys:!0}),nk(e)})),n()}}}function Kx(e){var t=["up","down","left","right"];return t.some((function(t){return e.toLowerCase().includes(t)}))}function Qx(e){return e&&!Jx.includes(e.get("type"))}function ek(e){var t=e.match(/^(?:Arrow)?(Up|Down|Left|Right)$/);return null!==t?Yx.get(t[1]):[0,0]}function tk(e){return!e||"processmaker.modeler.bpmn.pool"!==e.get("type")}function nk(e){var t=e.getParentCell();tk(t)||(t.component.expandToFitElement(e,t),t.component.laneSet&&t.component.updateLaneChildren())}var ok={methods:{escapeKeyHandler:function(e){this.selectedNode&&(e.preventDefault(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e))}},computed:{selectedNode:function(){return Pg.getters.getSelectedNode},movedElement:function(){return Pg.getters.getGhostNode}}},rk={mixins:[Wx,$x,ok,Gx],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.undoRedoHandler(e,t),this.copyPasteHandler(e,t),this.escapeKeyHandler(e)},keyupListener:function(e){"Space"===e.code&&(this.panMode=!1)},keydownListener:function(e){var t=this.isAppleOS(),n=t?e.metaKey:e.ctrlKey,o={mod:n,isAppleOS:t,modeler:this};try{this.handleHotkeys(e,o)}catch(i){console.error(i)}var r=!e.target.toString().toLowerCase().includes("body");if(!r){if("Space"===e.code){if(this.panMode)return;this.panMode=!0}Zx(e.key,Un.getters.highlightedShapes,this.pushToUndoStack)}},startPanning:function(){this.panning=!0,this.paperManager.addEventHandler("blank:pointermove",this.blankMoveHandler),this.paperManager.addEventHandler("cell:pointermove",this.cellMoveHandler)},blankMoveHandler:function(e,t,n){this.checkCanvasDragPosition(t,n),this.translatePaper(e)},cellMoveHandler:function(e,t,n,o){this.checkCanvasDragPosition(n,o),this.translatePaper(t)},checkCanvasDragPosition:function(e,t){if(!this.canvasDragPosition){var n=this.paperManager.scale;this.canvasDragPosition={x:e*n.sx,y:t*n.sy}}},translatePaper:function(e){this.clientLeftPaper||this.paperManager.translate(e.offsetX-this.canvasDragPosition.x,e.offsetY-this.canvasDragPosition.y)},stopPanning:function(){this.paperManager.removeEventHandler("blank:pointermove",this.blankMoveHandler),this.paperManager.removeEventHandler("cell:pointermove",this.cellMoveHandler),this.panning=!1}}};f(74819);function ik(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Wr(e),null===e)break;return e}function sk(){return sk="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=ik(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},sk.apply(this,arguments)}var ak,ck=function(e){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"clone",value:function(e,t,o){return this.withTimerKeys(sk(Wr(n.prototype),"clone",this).call(this,e,t,o))}},{key:"withTimerKeys",value:function(e){var t=this,o=n.timerPropertyKeys.find((function(e){return t.definition.eventDefinitions[0][e]}));return e.definition.eventDefinitions[0][o]||(e.definition.eventDefinitions[0][o]={}),e.definition.eventDefinitions[0][o].body=this.definition.eventDefinitions[0][o].body,e}}]),n}(pr);function lk(e){return dk.apply(this,arguments)}function dk(){return dk=l(a().mark((function e(t){var n,o,r;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=uk(t),o=document.querySelector('[name="name"]')||document.querySelector('[name="text"]'),n&&o&&document.activeElement!==o){e.next=4;break}return e.abrupt("return");case 4:if(r=document.getElementById("accordion-button-Configuration"),!r||"false"!==r.getAttribute("aria-expanded")){e.next=10;break}return clearTimeout(ak),r.click(),e.next=10,hk();case 10:n.style.outline="1px dashed blue",o.addEventListener("blur",(function(){n.style.outline=""})),o.focus(),o.select();case 14:case"end":return e.stop()}}),e)}))),dk.apply(this,arguments)}function uk(e){if(e.selectors)return e.selectors.label||Array.from(e.selectors.root.children).find((function(e){return e.classList.contains("labels")}))}function hk(){return new Promise((function(e){ak=setTimeout(e)}))}y(ck,"timerPropertyKeys",["timeDuration","timeDate","timeCycle"]);var pk=f(93162),fk=f.n(pk),mk=new WeakMap,gk=new WeakMap,vk=function(){function e(t){d(this,e),b(this,mk,{writable:!0,value:void 0}),b(this,gk,{writable:!0,value:void 0}),Tw(this,mk,t)}return g(e,[{key:"definitions",set:function(e){Tw(this,gk,e)}},{key:"getDefinitionsFromXml",value:function(e){var t=this;return new Promise((function(n,o){k(t,mk).fromXML(e,(function(e,r){e&&o(e),r.exporter="ProcessMaker Modeler",r.exporterVersion="1.0",t.cleanBrokenReferences(r),n(r)}))}))}},{key:"cleanBrokenReferences",value:function(e){var t=e.rootElements,n=e.diagrams,o=[];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||o.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&&!o.includes(e.bpmnElement)})))}))}},{key:"download",value:function(){k(this,gk)&&k(this,mk).toXML(k(this,gk),{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"});fk().saveAs(n)}}))}}]),e}();function bk(e){return e.isStartEvent()?nr:e.isTask()?sr:e.isGateway()?cr:e.isIntermediateEvent()?dr:e.isEndEvent()?rr:null}function yk(e){if(!e)return!1;var t=bk(e);return!t||!Object.values(t).includes(e.definition.name)}function wk(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 xk(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}))}))})),o=t.filter((function(e){return!e.id}));return[].concat(W(n),W(o))}var kk=function(){function e(t,n,o,r,i,s){d(this,e),this._nodeThatWillBeReplaced=t,this._definition=n,this._graph=o,this._newNode=r,this._processes=i,this._collaboration=s}return g(e,[{key:"migrate",value:function(){var e,t,n=this;yk(this._nodeThatWillBeReplaced)&&(this._definition.name=this._nodeThatWillBeReplaced.definition.name);var o=[],r=function(e){var t,r=n._graph.getLinks().find((function(t){return t.component&&t.component.node.definition===e})),i=r.component.node;i._modelerId+="_replaced";var s=[];null===(t=i.diagram.waypoint)||void 0===t||t.forEach((function(e){s.push({x:e.x,y:e.y})})),o.push({id:i.definition.id,type:i.type,name:i.definition.name,waypoint:s,sourceRefId:i.definition.sourceRef.id,targetRefId:i.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),r(e)})),i.forEach((function(e){e.set("targetRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),r(e)}));var a=wk(this._nodeThatWillBeReplaced,this._processes);if(a.forEach((function(e){e.set("targetRef",n._newNode.definition),r(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),r(e)})),c.filter((function(e){return e.targetRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("targetRef",n._newNode.definition),r(e)}))}window.ProcessMaker.EventBus.$emit("multiplayer-updateFlows",o)}},{key:"_handleSequenceFlowForGateway",value:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type);t||delete e.conditionExpression}}]),e}(),Ck=["bpmn:ServiceTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ScriptTask"],Sk=function(e){if(-1!==Ck.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,o,r,i,s,a){t(e,n,o,r,i,s),e=cf(e,n,o,r,i,a),s(e,a)},e.inspectorData=function(e,t,o){var r=n?n(e,t,o):t(e);return lf(r,e,t,o),r}}},Ek={methods:{cloneNodesSelection:function(){var e=this,t=[],n=[],o=[],r=[],i=[],s=this.highlightedNodes,a=this.$refs.selector.$el,c=[gl,dl,eo,El,fr],l=[Oo],d=[Mo];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);r.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):o.push(p)}})),t=[].concat(W(t),o),this.connectClonedFlows(n,t),this.connectClonedDataInputAssociations(r,t),this.connectClonedDataOutputAssociations(i,t),t},getDataInputOutputAssociationTargetRef:function(e){if("bpmn:DataInput"===e.targetRef.$type){var t=e.targetRef.$parent;return Vo(t,this)}if("bpmn:DataInputAssociation"===e.targetRef.$type){var n=e.targetRef.$parent;return Vo(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(),o=n.height,r=this.paper.scale(),i=r.sy,s=o/i;return t.diagram.bounds.y+=s,t.setIds(this.nodeIdGenerator),t},connectClonedFlows:function(e,t){var n=this;e.forEach((function(e){var o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef,i=o.definition.targetRef,s=t.find((function(e){return e.cloneOf===r.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 o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef[0],i=t.find((function(e){return e.cloneOf===r.id})),s=n.getDataInputOutputAssociationTargetRef(o.definition),a=t.find((function(e){return e.cloneOf===s.id})),c=Ho(n.moddle,a,i.definition);c.$parent.$parent=a.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 o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef||o.definition.$parent,i=o.definition.targetRef,s=t.find((function(e){return e.cloneOf===r.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]))}))}}},Ak=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ScriptTask","bpmn:ServiceTask"],_k=["processmaker-modeler-task","processmaker-modeler-manual-task","processmaker-modeler-script-task","processmaker-modeler-call-activity","processmaker-modeler-intermediate-catch-timer-event","processmaker-modeler-intermediate-signal-catch-event","processmaker-modeler-intermediate-signal-throw-event","processmaker-modeler-intermediate-message-catch-event","processmaker-modeler-intermediate-message-throw-event","processmaker-modeler-intermediate-conditional-catch-event"],Mk={data:function(){return{linkModel:null,hoveredLinkModel:null,originalHoveredLink:null,originalColor:null,activeElement:null,timeout:null,tooltipEl:null,clickPosition:null,currentMovingModel:null,currentMovingModelCanBisect:null}},watch:{hoveredLinkModel:function(){this.hoveredLinkModel?(this.originalColor=this.hoveredLinkModel.attr("line/stroke"),this.originalHoveredLink=this.hoveredLinkModel,this.hoveredLinkModel.attr("line/stroke",qn),this.addElementTooltip()):(this.resetLinkColor(),this.removeElementTooltip())}},computed:{ghostNode:function(){return Pg.getters.getGhostNode}},methods:{linkEditingInit:function(){var e=this;this.paperManager.addEventHandler("cell:mouseover",(function(t){var n;null!==t&&void 0!==t&&null!==(n=t.model)&&void 0!==n&&n.isLink()&&e.addingEligibleItem()&&(e.timeout=setTimeout((function(){e.hoveredLinkModel=t.model}),1e3))})),this.paperManager.addEventHandler("cell:mouseout",(function(){clearTimeout(e.timeout),e.timeout=null,e.hoveredLinkModel&&(e.hoveredLinkModel=null)})),this.paperManager.addEventHandler("element:pointermove",(function(t,n){if(e.canBisectCached(t.model)){var o=e.findViewFromPoint(t,n),r=null===o||void 0===o?void 0:o.model;null!==r&&void 0!==r&&r.isLink()?e.hoveredLinkModel===r||e.timeout||(e.timeout=setTimeout((function(){e.hoveredLinkModel=r,e.linkModel=r,e.activeElement=t.model}),1e3)):(clearTimeout(e.timeout),e.timeout=null,e.hoveredLinkModel&&(e.hoveredLinkModel=null,e.linkModel=null,e.activeElement=null))}})),this.paperManager.addEventHandler("element:pointerup",(function(t,n){e.linkModel&&e.canBisect(t.model)&&(e.clickPosition={x:n.clientX,y:n.clientY},e.paperManager.performAtomicAction((function(){e.bisectElement(t.model,e.linkModel),e.hoveredLinkModel=null,e.linkModel=null,e.activeElement=null})))})),this.$on("node-added",(function(t){e.bisectNode(t)})),window.ProcessMaker.EventBus.$on("capture-hovered-link",(function(t){e.clickPosition={x:t.clientX,y:t.clientY},e.linkModel=e.hoveredLinkModel}))},findViewFromPoint:function(e,t){var n=Array.from(document.elementsFromPoint(t.clientX,t.clientY));while(n.length>0){var o=n.shift(),r=this.paper.findView(o);if(r&&r!==e)return r}return null},isLink:function(e){return e.component&&"standard.Link"===e.attributes.type},canBisect:function(e){var t=this.getBpmnTypes(e),n=t.some((function(e){return Ak.includes(e)}));if(n)return!0;var o=this.getAlternateType(e);return _k.includes(o)},canBisectCached:function(e){var t=!1;return this.currentMovingModel===e?t=this.currentMovingModelCanBisect:(t=this.canBisect(e),this.currentMovingModel=e,this.currentMovingModelCanBisect=t),t},getBpmnTypes:function(e){var t,n=null===(t=e.component)||void 0===t||null===(t=t.node)||void 0===t||null===(t=t.definition)||void 0===t?void 0:t.$type,o=e.bpmnType||[];return Array.isArray(o)||(o=[o]),n?[n]:o},getAlternateType:function(e){var t;return e.type?e.type:null===(t=e.component)||void 0===t||null===(t=t.node)||void 0===t?void 0:t.type},bisectNode:function(e){var t=this;if(this.linkModel){var n=e.definition.id,o=this.getElementByNodeId(n);if(this.canBisect(o)){var r=o.size();this.paperManager.performAtomicAction((function(){o.translate(-Math.round(r.width/2),-Math.round(r.height/2)),t.bisectElement(o,t.linkModel),t.$refs.selector.updateSelectionBox()})),this.hoveredLinkModel=null,this.linkModel=null}}},bisectElement:function(e,t){var n=t.getTargetCell();t.component.setTarget(e);var o=t.component.node.definition,r=e.component.node.definition,i=o.get("targetRef"),s=i.get("incoming");i.set("incoming",s.filter((function(e){return e!==o}))),o.set("targetRef",r),r.get("incoming").push(o);var a=t.vertices(),c=this.paper.findViewByModel(t),l=this.paper.clientToLocalPoint(this.clickPosition),d=c.getVertexIndex(l.x,l.y);a.length>0&&d--;var u=[];a.forEach((function(e,t){t>d&&u.push(e)}));var h=d+1;while(a.length>h)t.removeVertex(h),a=t.vertices();var p=t.component.node.diagram,f=p.get("waypoint");f.pop();var m=this.moddle.create("dc:Point",this.getCenterPosition(e));p.set("waypoint",[].concat(W(f),[m])),this.newOutgoingLink(e,n,u)},getCenterPosition:function(e){var t=e.size(),n=e.position();return{x:n.x+t.width/2,y:n.y+t.height/2}},newOutgoingLink:function(e,t,n){var o=n.map((function(e){return{x:e.x,y:e.y}})),r=new ul(this.nodeRegistry,this.moddle,this.paper),i=[this.getCenterPosition(e)].concat(W(o),[this.getCenterPosition(t)]),s=r.makeFlowNode(e,t,i);this.addNode(s)},resetLinkColor:function(){this.originalHoveredLink&&this.originalHoveredLink.attr("line/stroke",this.originalColor)},addingEligibleItem:function(){var e=Pg.getters.getSelectedNode;return!(!e||!this.canBisect(e))},addElementTooltip:function(){var e=document.createElement("div");e.innerHTML=this.$t("Drop to add to this flow"),e.classList.add("element-tooltip"),document.body.appendChild(e),document.addEventListener("mousemove",this.setTooltipPosition),e.style.zIndex="9999",this.tooltipEl=e,this.setTooltipPosition()},setTooltipPosition:function(){var e=0,t=0;if(this.activeElement){var n=this.activeElement.position(),o=this.activeElement.size(),r={x:n.x+o.width/2,y:n.y+o.height},i=this.paper.localToClientPoint(r),s={x:i.x-this.tooltipEl.offsetWidth/2,y:i.y+10};e=s.x,t=s.y}else if(this.ghostNode){var a={x:this.ghostNode.offsetLeft+this.ghostNode.offsetWidth/2,y:this.ghostNode.offsetTop+this.ghostNode.offsetHeight},c={x:a.x-this.tooltipEl.offsetWidth/2,y:a.y+10};e=c.x,t=c.y}this.tooltipEl.style.left=e+"px",this.tooltipEl.style.top=t+"px"},removeElementTooltip:function(){this.tooltipEl&&(document.removeEventListener("mousemove",this.setTooltipPosition),document.body.removeChild(this.tooltipEl),this.tooltipEl=null)}}},Tk={data:function(){return{hasTransparency:{}}},methods:{initTransparentDragging:function(){var e=this;this.paperManager.addEventHandler("cell:pointerup blank:pointerup",(function(){e.removeTransparency()})),this.graph.on("change:position",(function(t){e.addTransparency(t)})),this.$on("node-added",(function(t){var n=t.definition.id,o=e.getElementByNodeId(n),r=e.paper.findViewByModel(o);e.removeTransparency(r)}))},addTransparency:function(e){if(!(e.id in this.hasTransparency)){var t=this.paper.findViewByModel(e);F.highlighters.addClass.add(t,"root","transparent-highlighter",{className:"transparent-cell"}),this.hasTransparency[e.id]=t}},removeTransparency:function(){var e=!1;Object.values(this.hasTransparency).forEach((function(t){F.dia.HighlighterView.remove(t,"transparent-highlighter"),e=!0})),e&&this.paper.dumpViews()}}},Pk=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}}),t("PanControl",{attrs:{"pan-mode":e.panMode},on:{"set-pan-mode":function(t){return e.$emit("set-pan-mode",t)}}})],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)])},Ik=[],Ok=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)},Nk=[],Dk=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"})])},Rk=[],Bk=new WeakMap,Lk=function(){function e(t){d(this,e),b(this,Bk,{writable:!0,value:void 0}),Tw(this,Bk,t)}return g(e,[{key:"miniMap",get:function(){return k(this,Bk)}},{key:"scaleMiniMap",value:function(){this.miniMap.scaleContentToFit({padding:10,maxScaleX:.5,maxScaleY:.5})}},{key:"calculateNewPaperPosition",value:function(e,t,n,o,r,i){var s=this.miniMap.paperToLocalPoint(e,t),a=s.x,c=s.y;return{newX:r/2-a*n,newY:i/2-c*o}}}],[{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}(),jk={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,o=this.paperManager.scale,r=o.sx,i=o.sy,s=this.paperManager.paper.el,a=s.clientWidth,c=s.clientHeight,l=this.miniMapManager.calculateNewPaperPosition(t,n,r,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=Lk.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)}},Fk=jk,zk=(f(63564),mo(Fk,Dk,Rk,!1,null,"76e95759",null)),Uk=zk.exports,qk={components:{InlineSvg:av,MiniPaper:Uk},props:{paperManager:Object,graph:Object},data:function(){return{miniMapOpen:!1,miniMapIcon:f(65759)}}},Hk=qk,Vk=(f(88357),mo(Hk,Ok,Nk,!1,null,"c47d089c",null)),Wk=Vk.exports,Gk=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)])},$k=[],Xk={components:{InlineSvg:av},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}}},Yk=Xk,Jk=(f(5365),mo(Yk,Gk,$k,!1,null,"576edbd4",null)),Zk=Jk.exports,Kk=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)])},Qk=[],eC={components:{InlineSvg:av},props:{isRendering:{type:Boolean}},data:function(){return{undoIcon:f(28994),redoIcon:f(45617)}},mounted:function(){this.$root.$on("undo-keyboard-shortcut",this.undo),this.$root.$on("redo-keyboard-shortcut",this.redo)},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 Sb.getters.canUndo},canRedo:function(){return Sb.getters.canRedo}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.dispatch("redo").then((function(){return e.$emit("load-xml")}))}}},tC=eC,nC=(f(36121),mo(tC,Kk,Qk,!1,null,"0e178ceb",null)),oC=nC.exports,rC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pan-tool-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"pan-tool-button",class:e.panMode?"pan-tool-button-active":"",attrs:{type:"button","data-cy":"pan-button",title:e.$t("Pan Tool")},on:{click:function(t){return e.$emit("set-pan-mode",!e.panMode)}}},[t("inline-svg",{attrs:{src:e.icon}})],1)])},iC=[],sC={components:{InlineSvg:av},props:{panMode:{type:Boolean,default:!1}},data:function(){return{icon:f(3258)}}},aC=sC,cC=(f(86212),f(93086),mo(aC,rC,iC,!1,null,"692394e7",null)),lC=cC.exports,dC=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:{mousedown:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n,"down")},mouseup:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n,"up")}}},[t("SubmenuPopper",{attrs:{data:n,selectedItem:e.selectedSubmenuItem,popperType:e.popperType},on:{mouseDownSubmenu:function(t,n){return e.clickToSubmenuHandler(t,n,"down")},mouseUpSubmenu:function(t,n){return e.clickToSubmenuHandler(t,n,"up")}}})],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()},uC=[],hC=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,o){return t("li",{key:o,class:["control-submenu-list",{active:e.selectedItem===n.type}],attrs:{"data-test":n.type},on:{mousedown:function(t){return t.stopPropagation(),e.$emit("mouseDownSubmenu",t,n)},mouseup:function(t){return t.stopPropagation(),e.$emit("mouseUpSubmenu",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)?t("inline-svg",{attrs:{src:e.data.icon}}):t("i",{staticClass:"fa-lg",class: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)?t("inline-svg",{attrs:{src:e.data.icon}}):t("i",{staticClass:"fa-lg",class:e.data.icon})],1)},pC=[],fC=f(95951),mC=f.n(fC),gC=(f(44301),{mixins:[Ug],props:{data:{type:Object},selectedItem:{type:String},popperType:{type:String}},components:{Popper:mC(),InlineSvg:av},data:function(){return{wasClickedSubmenu:!1,element:null,wasClicked:!1}}}),vC=gC,bC=(f(19731),mo(vC,hC,pC,!1,null,"78e713ce",null)),yC=bC.exports,wC={components:{SubmenuPopper:yC,InlineSvg:av},props:{nodeTypes:Array},mixins:[qg],data:function(){return{plusIcon:f(29943),currentType:null}},created:function(){Pg.dispatch("getUserPinnedObjects")},computed:{controls:function(){return Pg.getters.getPinnedNodeTypes},explorerOpen:function(){return Pg.getters.getExplorerOpen}},methods:{clickToSubmenuHandler:function(e,t,n){"up"!==n?(window.ProcessMaker.EventBus.$off("custom-pointerclick"),this.wasClicked=!1,this.parent=this.selectedItem,this.selectedSubmenuItem=t.control.type,this.startDragNewObject(e,t)):this.cancelDragNewObject()},onClickControlHandler:function(e,t,n){"up"!==n?(this.selectedSubmenuItem=null,this.popperType=this.currentType===t.type?null:t.type,this.startDragNewObject(e,t),this.currentType=this.popperType):this.cancelDragNewObject()},toggleExplorer:function(){this.deselect(),this.popperType=null,this.selectedSubmenuItem=null,Pg.commit("toggleExplorer"),Pg.commit("clearFilteredNodes"),Pg.commit("clearFilteredPmBlockNodes")}}},xC=wC,kC=(f(32890),mo(xC,dC,uC,!1,null,"317b8b6e",null)),CC=kC.exports,SC={components:{MiniPaperControl:Wk,PanControl:lC,ZoomControl:Zk,UndoRedoControl:oC,Controls:CC},props:{paperManager:Object,graph:Object,isRendering:Boolean,nodeTypes:Array,panMode:Boolean},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,n,o=e[0].target.getBoundingClientRect(),r=null===(t=this.$refs.zoomBox)||void 0===t?void 0:t.$el.getBoundingClientRect(),i=null===(n=this.$refs.undoRedoBox)||void 0===n?void 0:n.$el.getBoundingClientRect();if(this.overlap&&i){if(o.width<this.widthOverlapControl){var s=window.getComputedStyle(this.$refs.zoomBox.$el),a=parseInt(s.paddingLeft,10)+parseInt(s.paddingRight,10),c=window.getComputedStyle(this.$refs.railLeftBox),l=parseInt(c.paddingLeft,10)+parseInt(c.paddingRight,10),d=this.leftOverlapUndoRedo+(this.widthOverlapControl-o.width)-a-l;d>r.right&&(this.overlap=!1)}}else(null===i||void 0===i?void 0:i.left)<(null===r||void 0===r?void 0:r.right)&&(this.overlap=!0,this.widthOverlapControl=o.width,this.leftOverlapUndoRedo=i.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)})))()}},EC=SC,AC=(f(59657),mo(EC,Pk,Ik,!1,null,"2a9e260d",null)),_C=AC.exports,MC=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))},TC=[],PC=function(e){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=Io(this.moddle),i=Po(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var s=new pr(Mo,i,r);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,o=$()(t,"component.node"),r=$()(n,"component.node");if(!r)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=o.definition.$type,d=r.definition.$type,u="bpmn:DataStoreReference"===o.definition.$type,h="bpmn:DataObjectReference"===o.definition.$type,p="bpmn:DataStoreReference"===r.definition.$type,f="bpmn:DataObjectReference"===r.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!Kr.isNodeDisallowedFromDataAssociation(e)}}]),n}(Kr),IC=[{type:"processmaker-modeler-text-annotation",factory:PC},{type:"processmaker-modeler-sequence-flow",factory:ul},{type:"processmaker-modeler-message-flow",factory:wl}],OC={name:fr,components:{CrownConfig:Ms},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 IC.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=IC.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),o=this.shape.findView(this.paper),r=[o.sourceAnchor.toJSON(),o.targetAnchor.toJSON()];this.$emit("replace-generic-flow",{actualFlow:n.makeFlowNode(this.sourceShape,this.target,r),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}},NC=OC,DC=mo(NC,MC,TC,!1,null,null,null),RC=DC.exports,BC=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()},LC=[],jC=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()},FC=[],zC=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()},UC=[],qC=function(e){return e.position().y+e.size().height},HC=function(e){return e.position().x},VC=function(e){return e.position().x+e.size().width/2},WC=function(e){return e.position().y+e.size().height/2},GC=function(e){return e.position().x+e.size().width},$C=function(e){return e.position().y},XC=function(e){return Boolean(e&&e.position&&e.size)},YC={poolLane:"PoolLane",boundaryEvent:"processmaker.components.nodes.boundaryEvent.Shape"},JC=[YC.boundaryEvent,YC.poolLane],ZC=function(e){return!JC.includes(e.get("type"))};function KC(e){return XC(e)&&ZC(e)}function QC(e,t){var n=t-qC(e);e.translate(0,n)}function eS(e,t){var n=t-HC(e);e.translate(n,0)}function tS(e,t){var n=t-GC(e);e.translate(n,0)}function nS(e,t){var n=t-VC(e);e.translate(n,0)}function oS(e,t){var n=t-WC(e);e.translate(0,n)}function rS(e,t){var n=t-$C(e);e.translate(0,n)}function iS(e){var t=pS(e);e.forEach((function(e){eS(e,t.left)}))}function sS(e){var t=pS(e);e.forEach((function(e){tS(e,t.right)}))}function aS(e){var t=pS(e);e.forEach((function(e){rS(e,t.top)}))}function cS(e){var t=pS(e);e.forEach((function(e){QC(e,t.bottom)}))}function lS(e){var t=pS(e);e.forEach((function(e){nS(e,t.hMiddle)}))}function dS(e){var t=pS(e);e.forEach((function(e){oS(e,t.vMiddle)}))}function uS(e){var t=pS(e),n=e.length,o=3;if(!(n<o)){var r=e.reduce((function(e,t){return t.size().height+e}),0),i=e.sort((function(e,t){return WC(e)-WC(t)})),s=t.top+e[0].size().height,a=(t.height-r)/(i.length-1);i.forEach((function(e,t){0!==t&&(rS(e,s+a),s+=a+e.size().height)}))}}function hS(e){var t=pS(e),n=e.length,o=3;if(!(n<o)){var r=e.reduce((function(e,t){return t.size().width+e}),0),i=e.sort((function(e,t){return VC(e)-VC(t)})),s=t.left+e[0].size().width,a=(t.width-r)/(i.length-1);i.forEach((function(e,t){0!==t&&(eS(e,s+a),s+=a+e.size().width)}))}}function pS(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 XC(e)?e.position().x:0},n=function(e){return XC(e)?e.position().x+e.size().width:0},o=function(e){return XC(e)?e.position().y:0},r=function(e){return XC(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(o))),c=Math.max.apply(Math,W(e.map(r))),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 fS(e){var t=e.filter((function(e){return KC(e)})),n=pS(e),o=t.length>1;return{can:{align:{left:o&&t.some((function(e){return HC(e)!==n.left})),horizontalCenter:o&&t.some((function(e){return VC(e)!==n.hMiddle})),right:o&&t.some((function(e){return GC(e)!==n.right})),bottom:o&&t.some((function(e){return qC(e)!==n.bottom})),verticalCenter:o&&t.some((function(e){return WC(e)!==n.vMiddle})),top:o&&t.some((function(e){return $C(e)!==n.top}))},distribute:{horizontally:o&&t.length>2,vertically:o&&t.length>2}},align:{left:function(){return iS(t)},horizontalCenter:function(){return lS(t)},right:function(){return sS(t)},bottom:function(){return cS(t)},verticalCenter:function(){return dS(t)},top:function(){return aS(t)}},distribute:{horizontally:function(){return hS(t)},vertically:function(){return uS(t)}}}}var mS={components:{FontAwesomeIcon:Mr.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),mr.library.add(Cr),mr.library.add(kr),mr.library.add(Sr),mr.library.add(Er),mr.library.add(xr),mr.library.add(wr),mr.library.add(_r),mr.library.add(Ar)},watch:{selectedShapes:function(){this.$root.$emit("bv::hide::tooltip")}},computed:{selectedShapes:function(){return this.disableButtons(),fS(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=fS(Un.getters.highlightedShapes);this.buttons.forEach((function(t){t.disabled=!(0,Ao.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)})))()}},gS=mS,vS=(f(81856),f(69100),mo(gS,zC,UC,!1,null,"46e3ac40",null)),bS=vS.exports,yS={props:{paper:Object,hasPools:Boolean},components:{crownAlign:bS,FontAwesomeIcon:Mr.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),mr.library.add(kr)},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)})))()}},wS=yS,xS=(f(6718),mo(wS,jC,FC,!1,null,"bcd827ec",null)),kS=xS.exports,CS={name:"Selection",components:{CrownMultiselect:kS},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:[fr],selectableBlackList:[fr],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===Jr||e.model.component.node.type===dl}))}},watch:{selected:function(e){this.prepareConectedLinks(e),this.addToHighlightedNodes(e),this.highlightNodesMultiplayer(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 o(){var r;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=t.length>1&&void 0!==t[1]&&t[1],!e.model.component||!n.selectableBlackList.includes(e.model.component.node.type)){o.next=3;break}return o.abrupt("return");case 3:return n.showLasso=!0,n.isSelected=!0,n.isSelecting=!0,n.start=null,r?n.shiftKeySelectionHandler(e):n.selected=[e],n.filterSelected(),o.next=11,n.$nextTick();case 11:!1===Un.getters.isReadOnly&&n.updateSelectionBox();case 12:case"end":return o.stop()}}),o)})))()},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 o=this.selected.find((function(e){return e.model.component.node.type===Jr}));o&&e.model.component.node.type!==Jr?this.selected=[e]:e.model.component&&e.model.component.node.type===Jr?this.hasOnlyPools(this.selected)?this.selectOrUnselectShape(e):this.selected=[e]:e.model.component&&e.model.component.node.pool&&(o=this.getPool(this.selected),o&&e.model.component.node.pool.id!==o.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),o=n.clientX,r=n.clientY,i=n.offsetX,s=n.offsetY,a=t.$el.offset();this.clearSelection(),this.isSelecting=!0,this.showLasso=!0,this.start={x:o-a.left+window.pageXOffset+t.$el.scrollLeft(),y:r-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),o=t.$el.offset(),r={x:n.clientX-o.left+window.pageXOffset+t.$el.scrollLeft(),y:n.clientY-o.top+window.pageYOffset+t.$el.scrollTop()},i={height:r.y-this.start.y,width:r.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},o=this.$el.clientWidth,r=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();o/=s.sx,r/=s.sy;var a=F.g.rect(i.x,i.y,o,r);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],o=this.paperManager.paper,r=o.findViewsInArea(e,t);return n?(this.graph.getLinks().forEach((function(t){e.intersect(t.getBBox())&&r.push(o.findViewByModel(t))})),r):r},isPositionWithinArea:function(e,t){var n=t.x,o=t.y,r=t.width,i=t.height;return e.x>=n&&e.x<=n+r&&e.y>=o&&e.y<=o+i},prepareConectedLinks:function(e){var t=this,n=this.paperManager.paper;this.connectedLinks=[],this.isValidSelectionLinks=!0,e.forEach((function(e){var o=t.graph.getConnectedLinks(e.model);if(e.model.component&&e.model.component.node.type===Jr){var r=e.model.getBBox(),i=n.model.getLinks().filter((function(e){var n=e.getSourcePoint(),o=e.getTargetPoint();return t.isPositionWithinArea(n,r)||t.isPositionWithinArea(o,r)}));i&&(o=[].concat(W(o),W(i)))}o.forEach((function(e){var o=n.findViewByModel(e);t.connectedLinks.some((function(e){return e.id===o.id}))||(t.connectedLinks.push(o),t.validateSelectionLinks(o))}))}))},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],o={x:1/0,y:1/0},r={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);o.x=Math.min(o.x,n.x),o.y=Math.min(o.y,n.y),r.width=Math.max(r.width,n.x+n.width),r.height=Math.max(r.height,n.y+n.height)})),{minX:o.x,minY:o.y,maxX:r.width,maxY:r.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,Mo,Oo,eo,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 o=n.model.getParentCell();if(o.component&&o.component.node.pool)return!t.includes(o.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===Jr}));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,o=t.clientY-this.mouseY;this.top+=o,this.left+=n,this.mouseX=t.clientX,this.mouseY=t.clientY;var r=this.paperManager.paper.scale();this.style.left="".concat(this.left,"px"),this.style.top="".concat(this.top,"px"),this.translateSelectedShapes(n/r.sx,o/r.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)),window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",e.getConnectedLinkProperties(e.connectedLinks)));case 9:case"end":return t.stop()}}),t)})))()},getProperties:function(e){var t=this,n=[],o=["PoolLane","standard.Link"];return e.filter((function(e){return!o.includes(e.model.get("type"))})).forEach((function(e){if("processmaker.modeler.bpmn.pool"===e.model.get("type")){var o=e.model.component.getElementsUnderArea(e.model,t.graph).filter((function(e){return e.component}));n=[].concat(W(n),W(t.getContainerProperties(o,n)))}else{var r,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!==(r=null===(i=e.model.component.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id)&&void 0!==r?r: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},getConnectedLinkProperties:function(e){var t=[];return null===e||void 0===e||e.forEach((function(e){var n=e.model.component.shape.vertices();if(null!==n&&void 0!==n&&n.length){var o,r=[],i=e.model.component.node;null===(o=i.diagram.waypoint)||void 0===o||o.forEach((function(e){r.push({x:e.x,y:e.y})}));var s=e.sourceView.model.component.node.definition.id,a=e.targetView.model.component.node.definition.id,c=e.model.component.node.type;t.push({id:i.definition.id,properties:{type:c,waypoint:r,sourceRefId:s,targetRefId:a}})}})),t},getBoundariesChangesForShape:function(e){var t=[],n=[Uy,Yy,nw,dw,bw,Aw],o=Un.getters.nodes.filter((function(e){return n.includes(e.type)}));return o.forEach((function(n){var o,r,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!==(o=null===(r=n.definition.get("attachedToRef"))||void 0===r?void 0:r.id)&&void 0!==o?o:null,color:null!==(i=n.definition.get("color"))&&void 0!==i?i:null}})})),t},getContainerProperties:function(e){var t=[];return e.forEach((function(e){var n,o,r={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")}};"bpmn:BoundaryEvent"===e.component.node.definition.$type&&(r.properties.attachedToRefId=null!==(n=null===(o=e.component.node.definition.get("attachedToRef"))||void 0===o?void 0:o.id)&&void 0!==n?n:null);t.push(r)})),t},updateFlowsWaypoint:function(){var e;null===(e=this.connectedLinks)||void 0===e||e.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 o=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],r=this.selected.filter((function(e){return!o.includes(e.model.get("type"))}));if(n&&r.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();r.forEach((function(n){return n.model.translate(e,t)}))},getShapesFromPoint:function(e){var t=F.util.normalizeEvent(e),n=t.clientX,o=t.clientY,r=(0,F.V)(this.paperManager.paper.viewport).toLocalPoint(n,o);return this.paperManager.paper.findViewsFromPoint(r)},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)},highlightNodesMultiplayer:function(e){window.ProcessMaker.EventBus.$emit("multiplayer-updateSelectedNodes",this.getSelectedNodeKeys(e))},getSelectedNodeKeys:function(e){var t=[];return e.forEach((function(e){var n=e.model.component.node;t.push(n.definition.id)})),t},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},o=this.$el.clientWidth,r=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();o/=s.sx,r/=s.sy;var a=F.g.rect(i.x,i.y,o,r);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===Jr&&(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===Jr})),n=e.find((function(e){var t=e.model;return t.getParentCell()&&t.getParentCell().component.node.type===Jr}));return!!t||!n}return!1},overPoolDrag:function(e){if(!this.isNotPoolChilds(this.selected)){var t=this.getPool(this.selected),n=this.getShapesFromPoint(e),o=n.find((function(e){return e.model.component&&e.model.component.node.type===Jr}));this.newPool=null,this.oldPool=null,o?(this.paperManager.setStateValid(),this.invalidPool&&(this.invalidPool.model.component.shape.attr("body/fill",Ye),this.invalidPool=null),t&&t.model.get("id")!==o.model.get("id")&&(this.newPool=o,this.oldPool=t,this.isOutOfThePool=!1,this.isValidSelectionLinks||(this.isOutOfThePool=!0,this.invalidPool=o,o.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.moveConnectedLinks(e.connectedLinks,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,o,r,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.initialPosition.left-e.left,o=e.initialPosition.top-e.top,e.style.left="".concat(e.initialPosition.left,"px"),e.style.top="".concat(e.initialPosition.top,"px"),r=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/r.sx,o/r.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===Jr})).model.getParentCell(),n=this.getSelectionVertex(this.selected,!0),o=t.getBBox(),r=o.x,i=o.y,s=o.width,a=o.height,c=n.maxX-n.minX,l=n.maxY-n.minY,d=n.minX-r,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<rm+am&&(g=s+(rm+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===Jr}));t&&(t.model.getParentCell(),t.model.component.laneSet&&t.component.updateLaneChildren())}},moveElements:function(e,t,n){var o=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"];e.filter((function(e){return!o.includes(e.model.get("type"))})).forEach((function(e){t.model.component.moveElement(e.model,n.model)}))},moveConnectedLinks:function(e,t,n){e.forEach((function(e){t.model.component.moveFlow(e.model,n.model)}))}}},SS=CS,ES=(f(86165),mo(SS,BC,LC,!1,null,"6c7ebacb",null)),AS=ES.exports,_S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"remote-cursor",style:{left:e.data.cursor.left+"px",top:e.data.cursor.top+"px"}},[t("svg",{attrs:{width:"23",height:"19",viewBox:"0 0 23 19",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{d:"M11.5 17.5L2 1L20.5 7L13 9L11.5 17.5Z",stroke:e.stroke,fill:e.data.color}})]),t("div",{staticClass:"remote-username"},[e._v(" "+e._s(e.data.name)+" ")])])},MS=[],TS={props:{data:{type:Object}},data:function(){return{cursorIcon:f(61264)}},computed:{stroke:function(){return"#212529"}}},PS=TS,IS=(f(65263),mo(PS,_S,MS,!1,null,"77208d93",null)),OS=IS.exports;function NS(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=H(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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(1439),f(87585),f(15016),f(55315);const DS=Object.create(null);DS["open"]="0",DS["close"]="1",DS["ping"]="2",DS["pong"]="3",DS["message"]="4",DS["upgrade"]="5",DS["noop"]="6";const RS=Object.create(null);Object.keys(DS).forEach((e=>{RS[DS[e]]=e}));const BS={type:"error",data:"parser error"},LS="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),jS="function"===typeof ArrayBuffer,FS=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,zS=({type:e,data:t},n,o)=>LS&&t instanceof Blob?n?o(t):US(t,o):jS&&(t instanceof ArrayBuffer||FS(t))?n?o(t):US(new Blob([t]),o):o(DS[e]+(t||"")),US=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function qS(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let HS;function VS(e,t){return LS&&e.data instanceof Blob?e.data.arrayBuffer().then(qS).then(t):jS&&(e.data instanceof ArrayBuffer||FS(e.data))?t(qS(e.data)):void zS(e,!1,(e=>{HS||(HS=new TextEncoder),t(HS.encode(e))}))}const WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",GS="undefined"===typeof Uint8Array?[]:new Uint8Array(256);for(let f=0;f<WS.length;f++)GS[WS.charCodeAt(f)]=f;const $S=e=>{let t,n,o,r,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=GS[e.charCodeAt(t)],o=GS[e.charCodeAt(t+1)],r=GS[e.charCodeAt(t+2)],i=GS[e.charCodeAt(t+3)],d[c++]=n<<2|o>>4,d[c++]=(15&o)<<4|r>>2,d[c++]=(3&r)<<6|63&i;return l},XS="function"===typeof ArrayBuffer,YS=(e,t)=>{if("string"!==typeof e)return{type:"message",data:ZS(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:JS(e.substring(1),t)};const o=RS[n];return o?e.length>1?{type:RS[n],data:e.substring(1)}:{type:RS[n]}:BS},JS=(e,t)=>{if(XS){const n=$S(e);return ZS(n,t)}return{base64:!0,data:e}},ZS=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},KS=String.fromCharCode(30),QS=(e,t)=>{const n=e.length,o=new Array(n);let r=0;e.forEach(((e,i)=>{zS(e,!1,(e=>{o[i]=e,++r===n&&t(o.join(KS))}))}))},eE=(e,t)=>{const n=e.split(KS),o=[];for(let r=0;r<n.length;r++){const e=YS(n[r],t);if(o.push(e),"error"===e.type)break}return o};function tE(){return new TransformStream({transform(e,t){VS(e,(n=>{const o=n.length;let r;if(o<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,o);else if(o<65536){r=new Uint8Array(3);const e=new DataView(r.buffer);e.setUint8(0,126),e.setUint16(1,o)}else{r=new Uint8Array(9);const e=new DataView(r.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(o))}e.data&&"string"!==typeof e.data&&(r[0]|=128),t.enqueue(r),t.enqueue(n)}))}})}let nE;function oE(e){return e.reduce(((e,t)=>e+t.length),0)}function rE(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let o=0;for(let r=0;r<t;r++)n[r]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),n}function iE(e,t){nE||(nE=new TextDecoder);const n=[];let o=0,r=-1,i=!1;return new TransformStream({transform(s,a){n.push(s);while(1){if(0===o){if(oE(n)<1)break;const e=rE(n,1);i=128===(128&e[0]),r=127&e[0],o=r<126?3:126===r?1:2}else if(1===o){if(oE(n)<2)break;const e=rE(n,2);r=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),o=3}else if(2===o){if(oE(n)<8)break;const e=rE(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue(BS);break}r=i*Math.pow(2,32)+t.getUint32(4),o=3}else{if(oE(n)<r)break;const e=rE(n,r);a.enqueue(YS(i?e:nE.decode(e),t)),o=0}if(0===r||r>e){a.enqueue(BS);break}}}})}const sE=4;function aE(e){if(e)return cE(e)}function cE(e){for(var t in aE.prototype)e[t]=aE.prototype[t];return e}aE.prototype.on=aE.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},aE.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},aE.prototype.off=aE.prototype.removeListener=aE.prototype.removeAllListeners=aE.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r=0;r<o.length;r++)if(n=o[r],n===t||n.fn===t){o.splice(r,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},aE.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(n){n=n.slice(0);o=0;for(var r=n.length;o<r;++o)n[o].apply(this,t)}return this},aE.prototype.emitReserved=aE.prototype.emit,aE.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},aE.prototype.hasListeners=function(e){return!!this.listeners(e).length};const lE=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())();function dE(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const uE=lE.setTimeout,hE=lE.clearTimeout;function pE(e,t){t.useNativeTimers?(e.setTimeoutFn=uE.bind(lE),e.clearTimeoutFn=hE.bind(lE)):(e.setTimeoutFn=lE.setTimeout.bind(lE),e.clearTimeoutFn=lE.clearTimeout.bind(lE))}const fE=1.33;function mE(e){return"string"===typeof e?gE(e):Math.ceil((e.byteLength||e.size)*fE)}function gE(e){let t=0,n=0;for(let o=0,r=e.length;o<r;o++)t=e.charCodeAt(o),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(o++,n+=4);return n}function vE(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function bE(e){let t={},n=e.split("&");for(let o=0,r=n.length;o<r;o++){let e=n[o].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}class yE extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class wE extends aE{constructor(e){super(),this.writable=!1,pE(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new yE(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=YS(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=vE(e);return t.length?"?"+t:""}}const xE="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kE=64,CE={};let SE,EE=0,AE=0;function _E(e){let t="";do{t=xE[e%kE]+t,e=Math.floor(e/kE)}while(e>0);return t}function ME(){const e=_E(+new Date);return e!==SE?(EE=0,SE=e):e+"."+_E(EE++)}for(;AE<kE;AE++)CE[xE[AE]]=AE;let TE=!1;try{TE="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(PN){}const PE=TE;function IE(e){const t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||PE))return new XMLHttpRequest}catch(n){}if(!t)try{return new(lE[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}function OE(){}function NE(){}const DE=function(){const e=new IE({xdomain:!1});return null!=e.responseType}();class RE extends wE{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=DE&&!t,this.opts.withCredentials&&(this.cookieJar=OE())}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)};eE(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,QS(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]=ME()),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 BE(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 BE extends aE{constructor(e,t){super(),pE(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=dE(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new IE(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(o){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(o){}try{n.setRequestHeader("Accept","*/*")}catch(o){}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(o){return void this.setTimeoutFn((()=>{this.onError(o)}),0)}"undefined"!==typeof document&&(this.index=BE.requestsCount++,BE.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=NE,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete BE.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(BE.requestsCount=0,BE.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",LE);else if("function"===typeof addEventListener){const e="onpagehide"in lE?"pagehide":"unload";addEventListener(e,LE,!1)}function LE(){for(let e in BE.requests)BE.requests.hasOwnProperty(e)&&BE.requests[e].abort()}const jE=(()=>{const e="function"===typeof Promise&&"function"===typeof Promise.resolve;return e?e=>Promise.resolve().then(e):(e,t)=>t(e,0)})(),FE=lE.WebSocket||lE.MozWebSocket,zE=!0,UE="arraybuffer",qE="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class HE extends wE{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=qE?{}:dE(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=zE&&!qE?t?new FE(e,t):new FE(e):new FE(e,t,n)}catch(PN){return this.emitReserved("error",PN)}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],o=t===e.length-1;zS(n,this.supportsBinary,(e=>{const t={};if(!zE&&(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{zE?this.ws.send(e):this.ws.send(e,t)}catch(r){}o&&jE((()=>{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]=ME()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!FE}}class VE extends wE{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=iE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),o=tE();o.readable.pipeTo(e.writable),this.writer=o.writable.getWriter();const r=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),r())})).catch((e=>{}))};r();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],o=t===e.length-1;this.writer.write(n).then((()=>{o&&jE((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}const WE={websocket:HE,webtransport:VE,polling:RE},GE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$E=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function XE(e){const t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let r=GE.exec(e||""),i={},s=14;while(s--)i[$E[s]]=r[s]||"";return-1!=n&&-1!=o&&(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=YE(i,i["path"]),i.queryKey=JE(i,i["query"]),i}function YE(e,t){const n=/\/{2,9}/g,o=t.replace(n,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||o.splice(0,1),"/"==t.slice(-1)&&o.splice(o.length-1,1),o}function JE(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,o){t&&(n[t]=o)})),n}class ZE extends aE{constructor(e,t={}){super(),this.binaryType=UE,this.writeBuffer=[],e&&"object"===typeof e&&(t=e,e=null),e?(e=XE(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=XE(t.host).host),pE(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=bE(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=sE,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 WE[e](n)}open(){let e;if(this.opts.rememberUpgrade&&ZE.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;ZE.priorWebsocketSuccess=!1;const o=()=>{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;ZE.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 r(){n||(n=!0,l(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,r(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function c(e){t&&e.name!==t.name&&r()}const l=()=>{t.removeListener("open",o),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",o),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",ZE.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+=mE(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,o){if("function"===typeof t&&(o=t,t=void 0),"function"===typeof n&&(o=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const r={type:e,data:t,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),o&&this.once("flush",o),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){ZE.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 o=e.length;for(;n<o;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}ZE.protocol=sE;ZE.protocol;function KE(e,t="",n){let o=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),o=XE(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const r=-1!==o.host.indexOf(":"),i=r?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+i+":"+o.port+t,o.href=o.protocol+"://"+i+(n&&n.port===o.port?"":":"+o.port),o}const QE="function"===typeof ArrayBuffer,eA=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,tA=Object.prototype.toString,nA="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===tA.call(Blob),oA="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===tA.call(File);function rA(e){return QE&&(e instanceof ArrayBuffer||eA(e))||nA&&e instanceof Blob||oA&&e instanceof File}function iA(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(iA(e[t]))return!0;return!1}if(rA(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return iA(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&iA(e[n]))return!0;return!1}function sA(e){const t=[],n=e.data,o=e;return o.data=aA(n,t),o.attachments=t.length,{packet:o,buffers:t}}function aA(e,t){if(!e)return e;if(rA(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 o=0;o<e.length;o++)n[o]=aA(e[o],t);return n}if("object"===typeof e&&!(e instanceof Date)){const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=aA(e[o],t));return n}return e}function cA(e,t){return e.data=lA(e.data,t),delete e.attachments,e}function lA(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]=lA(e[n],t);else if("object"===typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lA(e[n],t));return e}const dA=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],uA=5;var hA;(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"})(hA||(hA={}));class pA{constructor(e){this.replacer=e}encode(e){return e.type!==hA.EVENT&&e.type!==hA.ACK||!iA(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===hA.EVENT?hA.BINARY_EVENT:hA.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==hA.BINARY_EVENT&&e.type!==hA.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=sA(e),n=this.encodeAsString(t.packet),o=t.buffers;return o.unshift(n),o}}function fA(e){return"[object Object]"===Object.prototype.toString.call(e)}class mA extends aE{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===hA.BINARY_EVENT;n||t.type===hA.BINARY_ACK?(t.type=n?hA.EVENT:hA.ACK,this.reconstructor=new gA(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!rA(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===hA[n.type])throw new Error("unknown packet type "+n.type);if(n.type===hA.BINARY_EVENT||n.type===hA.BINARY_ACK){const o=t+1;while("-"!==e.charAt(++t)&&t!=e.length);const r=e.substring(o,t);if(r!=Number(r)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(r)}if("/"===e.charAt(t+1)){const o=t+1;while(++t){const n=e.charAt(t);if(","===n)break;if(t===e.length)break}n.nsp=e.substring(o,t)}else n.nsp="/";const o=e.charAt(t+1);if(""!==o&&Number(o)==o){const o=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(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(!mA.isPayloadValid(n.type,o))throw new Error("invalid payload");n.data=o}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case hA.CONNECT:return fA(t);case hA.DISCONNECT:return void 0===t;case hA.CONNECT_ERROR:return"string"===typeof t||fA(t);case hA.EVENT:case hA.BINARY_EVENT:return Array.isArray(t)&&("number"===typeof t[0]||"string"===typeof t[0]&&-1===dA.indexOf(t[0]));case hA.ACK:case hA.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class gA{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=cA(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function vA(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const bA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yA extends aE{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=[vA(e,"open",this.onopen.bind(this)),vA(e,"packet",this.onpacket.bind(this)),vA(e,"error",this.onerror.bind(this)),vA(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(bA.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:hA.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof t[t.length-1]){const e=this.ids++,o=t.pop();this._registerAckCallback(e,o),n.id=e}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,r=this.flags.volatile&&(!o||!this.connected);return r||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const o=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===o)return void(this.acks[e]=t);const r=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"))}),o);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((o,r)=>{t.push(((e,t)=>n?e?r(e):o(t):o(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,...o)=>{if(n!==this._queue[0])return;const r=null!==e;return r?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...o)),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:hA.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 hA.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 hA.EVENT:case hA.BINARY_EVENT:this.onevent(e);break;case hA.ACK:case hA.BINARY_ACK:this.onack(e);break;case hA.DISCONNECT:this.ondisconnect();break;case hA.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(...o){n||(n=!0,t.packet({type:hA.ACK,id:e,data:o}))}}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:hA.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 wA(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}wA.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)},wA.prototype.reset=function(){this.attempts=0},wA.prototype.setMin=function(e){this.ms=e},wA.prototype.setMax=function(e){this.max=e},wA.prototype.setJitter=function(e){this.jitter=e};class xA extends aE{constructor(e,t){var o;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,pE(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!==(o=t.randomizationFactor)&&void 0!==o?o:.5),this.backoff=new wA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||n;this.encoder=new r.Encoder,this.decoder=new r.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 ZE(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=vA(t,"open",(function(){n.onopen(),e&&e()})),r=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=vA(t,"error",r);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{o(),r(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(o),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(vA(e,"ping",this.onping.bind(this)),vA(e,"data",this.ondata.bind(this)),vA(e,"error",this.onerror.bind(this)),vA(e,"close",this.onclose.bind(this)),vA(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){jE((()=>{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 yA(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 kA={};function CA(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};const n=KE(e,t.path||"/socket.io"),o=n.source,r=n.id,i=n.path,s=kA[r]&&i in kA[r]["nsps"],a=t.forceNew||t["force new connection"]||!1===t.multiplex||s;let c;return a?c=new xA(o,t):(kA[r]||(kA[r]=new xA(o,t)),c=kA[r]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(CA,{Manager:xA,Socket:yA,io:CA,connect:CA});const SA=()=>new Map,EA=e=>{const t=SA();return e.forEach(((e,n)=>{t.set(n,e)})),t},AA=(e,t,n)=>{let o=e.get(t);return void 0===o&&e.set(t,o=n()),o},_A=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},MA=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},TA=()=>new Set,PA=e=>e[e.length-1],IA=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},OA=Array.from,NA=Array.isArray;class DA{constructor(){this._observers=SA()}on(e,t){AA(this._observers,e,TA).add(t)}once(e,t){const n=(...o)=>{this.off(e,n),t(...o)};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 OA((this._observers.get(e)||SA()).values()).forEach((e=>e(...t)))}destroy(){this._observers=SA()}}const RA=Math.floor,BA=(Math.ceil,Math.abs),LA=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),jA=(e,t)=>e>t?e:t,FA=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),zA=String.fromCharCode,UA=(String.fromCodePoint,zA(65535),e=>e.toLowerCase()),qA=/^\s*/g,HA=e=>e.replace(qA,""),VA=/([A-Z])/g,WA=(e,t)=>HA(e.replace(VA,(e=>`${t}${UA(e)}`))),GA=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=t.codePointAt(r);return o},$A="undefined"!==typeof TextEncoder?new TextEncoder:null,XA=e=>$A.encode(e),YA=$A?XA:GA;let JA="undefined"===typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});JA&&1===JA.decode(new Uint8Array).length&&(JA=null);const ZA=e=>void 0===e?null:e;class KA{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let QA=new KA,e_=!0;try{"undefined"!==typeof localStorage&&(QA=localStorage,e_=!1)}catch(IN){}const t_=QA,n_=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&n_(e,t,n+1)}},o_=e=>e,r_=(e,t)=>t.includes(e),i_="undefined"!==typeof process&&process.release&&/node|io\.js/.test(process.release.name);"undefined"!==typeof navigator&&/Mac/.test(navigator.platform);let s_;const a_=[],c_=()=>{if(void 0===s_)if(i_){s_=SA();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const o=e[n];"-"===o[0]?(null!==t&&s_.set(t,""),t=o):null!==t?(s_.set(t,o),t=null):a_.push(o)}null!==t&&s_.set(t,"")}else"object"===typeof location?(s_=SA(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");s_.set(`--${WA(t,"-")}`,n),s_.set(`-${WA(t,"-")}`,n)}}))):s_=SA();return s_},l_=e=>c_().has(e),d_=e=>ZA(i_?{VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}[e.toUpperCase()]:t_.getItem(e)),u_=e=>l_("--"+e)||null!==d_(e),h_=(u_("production"),i_&&r_({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"])),p_=!l_("no-colors")&&(!i_||process.stdout.isTTY||h_)&&(!i_||l_("color")||h_||null!==d_("COLORTERM")||(d_("TERM")||"").includes("color")),f_=e=>new Uint8Array(e),m_=(e,t,n)=>new Uint8Array(e,t,n),g_=e=>{const t=f_(e.byteLength);return t.set(e),t},v_=1,b_=2,y_=4,w_=8,x_=32,k_=64,C_=128,S_=31,E_=63,A_=127,__=2147483647,M_=Number.MAX_SAFE_INTEGER,T_=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"===typeof e&&isFinite(e)&&RA(e)===e));Number.isNaN,Number.parseInt;class P_{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const I_=()=>new P_,O_=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},N_=e=>{const t=new Uint8Array(O_(e));let n=0;for(let o=0;o<e.bufs.length;o++){const r=e.bufs[o];t.set(r,n),n+=r.length}return t.set(m_(e.cbuf.buffer,0,e.cpos),n),t},D_=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(m_(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*jA(n,t)),e.cpos=0)},R_=(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},B_=R_,L_=(e,t)=>{while(t>A_)R_(e,C_|A_&t),t=RA(t/128);R_(e,A_&t)},j_=(e,t)=>{const n=FA(t);n&&(t=-t),R_(e,(t>E_?C_:0)|(n?k_:0)|E_&t),t=RA(t/64);while(t>0)R_(e,(t>A_?C_:0)|A_&t),t=RA(t/128)},F_=new Uint8Array(3e4),z_=F_.length/3,U_=(e,t)=>{if(t.length<z_){const n=$A.encodeInto(t,F_).written||0;L_(e,n);for(let t=0;t<n;t++)R_(e,F_[t])}else W_(e,YA(t))},q_=(e,t)=>{const n=unescape(encodeURIComponent(t)),o=n.length;L_(e,o);for(let r=0;r<o;r++)R_(e,n.codePointAt(r))},H_=$A&&$A.encodeInto?U_:q_,V_=(e,t)=>{const n=e.cbuf.length,o=e.cpos,r=LA(n-o,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),o),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(jA(2*n,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},W_=(e,t)=>{L_(e,t.byteLength),V_(e,t)},G_=(e,t)=>{D_(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},$_=(e,t)=>G_(e,4).setFloat32(0,t,!1),X_=(e,t)=>G_(e,8).setFloat64(0,t,!1),Y_=(e,t)=>G_(e,8).setBigInt64(0,t,!1),J_=new DataView(new ArrayBuffer(4)),Z_=e=>(J_.setFloat32(0,e),J_.getFloat32(0)===e),K_=(e,t)=>{switch(typeof t){case"string":R_(e,119),H_(e,t);break;case"number":T_(t)&&BA(t)<=__?(R_(e,125),j_(e,t)):Z_(t)?(R_(e,124),$_(e,t)):(R_(e,123),X_(e,t));break;case"bigint":R_(e,122),Y_(e,t);break;case"object":if(null===t)R_(e,126);else if(NA(t)){R_(e,117),L_(e,t.length);for(let n=0;n<t.length;n++)K_(e,t[n])}else if(t instanceof Uint8Array)R_(e,116),W_(e,t);else{R_(e,118);const n=Object.keys(t);L_(e,n.length);for(let o=0;o<n.length;o++){const r=n[o];H_(e,r),K_(e,t[r])}}break;case"boolean":R_(e,t?120:121);break;default:R_(e,127)}};class Q_ extends P_{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&L_(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const eM=e=>{e.count>0&&(j_(e.encoder,1===e.count?e.s:-e.s),e.count>1&&L_(e.encoder,e.count-2))};class tM{constructor(){this.encoder=new P_,this.s=0,this.count=0}write(e){this.s===e?this.count++:(eM(this),this.count=1,this.s=e)}toUint8Array(){return eM(this),N_(this.encoder)}}const nM=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);j_(e.encoder,t),e.count>1&&L_(e.encoder,e.count-2)}};class oM{constructor(){this.encoder=new P_,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(nM(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return nM(this),N_(this.encoder)}}class rM{constructor(){this.sarr=[],this.s="",this.lensE=new tM}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 P_;return this.sarr.push(this.s),this.s="",H_(e,this.sarr.join("")),V_(e,this.lensE.toUint8Array()),N_(e)}}const iM=e=>new Error(e),sM=()=>{throw iM("Method unimplemented")},aM=()=>{throw iM("Unexpected case")},cM=iM("Unexpected end of array"),lM=iM("Integer out of Range");class dM{constructor(e){this.arr=e,this.pos=0}}const uM=e=>new dM(e),hM=e=>e.pos!==e.arr.length,pM=(e,t)=>{const n=m_(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},fM=e=>pM(e,gM(e)),mM=e=>e.arr[e.pos++],gM=e=>{let t=0,n=1;const o=e.arr.length;while(e.pos<o){const o=e.arr[e.pos++];if(t+=(o&A_)*n,n*=128,o<C_)return t;if(t>M_)throw lM}throw cM},vM=e=>{let t=e.arr[e.pos++],n=t&E_,o=64;const r=(t&k_)>0?-1:1;if(0===(t&C_))return r*n;const i=e.arr.length;while(e.pos<i){if(t=e.arr[e.pos++],n+=(t&A_)*o,o*=128,t<C_)return r*n;if(n>M_)throw lM}throw cM},bM=e=>{let t=gM(e);if(0===t)return"";{let n=String.fromCodePoint(mM(e));if(--t<100)while(t--)n+=String.fromCodePoint(mM(e));else while(t>0){const o=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+o);e.pos+=o,n+=String.fromCodePoint.apply(null,r),t-=o}return decodeURIComponent(escape(n))}},yM=e=>JA.decode(fM(e)),wM=JA?yM:bM,xM=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},kM=e=>xM(e,4).getFloat32(0,!1),CM=e=>xM(e,8).getFloat64(0,!1),SM=e=>xM(e,8).getBigInt64(0,!1),EM=[e=>{},e=>null,vM,kM,CM,SM,e=>!1,e=>!0,wM,e=>{const t=gM(e),n={};for(let o=0;o<t;o++){const t=wM(e);n[t]=AM(e)}return n},e=>{const t=gM(e),n=[];for(let o=0;o<t;o++)n.push(AM(e));return n},fM],AM=e=>EM[127-mM(e)](e);class _M extends dM{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),hM(this)?this.count=gM(this)+1:this.count=-1),this.count--,this.s}}class MM extends dM{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=vM(this);const e=FA(this.s);this.count=1,e&&(this.s=-this.s,this.count=gM(this)+2)}return this.count--,this.s}}class TM extends dM{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=vM(this),t=1&e;this.diff=RA(e/2),this.count=1,t&&(this.count=gM(this)+2)}return this.s+=this.diff,this.count--,this.s}}class PM{constructor(e){this.decoder=new MM(e),this.str=wM(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 IM=crypto.getRandomValues.bind(crypto),OM=(Math.random,()=>IM(new Uint32Array(1))[0]),NM=[1e7]+-1e3+-4e3+-8e3+-1e11,DM=()=>NM.replace(/[018]/g,(e=>(e^OM()&15>>e/4).toString(16))),RM=e=>new Promise(e);Promise.all.bind(Promise);class BM{constructor(e,t){this.left=e,this.right=t}}const LM=(e,t)=>new BM(e,t),jM="undefined"!==typeof document?document:{},FM=("undefined"!==typeof DOMParser&&new DOMParser,e=>_A(e,((e,t)=>`${t}:${e};`)).join("")),zM=(jM.ELEMENT_NODE,jM.TEXT_NODE,jM.CDATA_SECTION_NODE,jM.COMMENT_NODE,jM.DOCUMENT_NODE,jM.DOCUMENT_TYPE_NODE,jM.DOCUMENT_FRAGMENT_NODE,Symbol),UM=Date.now,qM=zM(),HM=zM(),VM=zM(),WM=zM(),GM=zM(),$M=zM(),XM=zM(),YM=zM(),JM=zM(),ZM=e=>{const t=[],n=[];let o=0;for(;o<e.length;o++){const r=e[o];r.constructor===String||r.constructor===Number?t.push(r):r.constructor===Object&&n.push(JSON.stringify(r))}return n};UM();const KM={[qM]:LM("font-weight","bold"),[HM]:LM("font-weight","normal"),[VM]:LM("color","blue"),[GM]:LM("color","green"),[WM]:LM("color","grey"),[$M]:LM("color","red"),[XM]:LM("color","purple"),[YM]:LM("color","orange"),[JM]:LM("color","black")},QM=e=>{const t=[],n=[],o=SA();let r=[],i=0;for(;i<e.length;i++){const r=e[i],s=KM[r];if(void 0!==s)o.set(s.left,s.right);else{if(r.constructor!==String&&r.constructor!==Number)break;{const e=FM(o);i>0||e.length>0?(t.push("%c"+r),n.push(e)):t.push(r)}}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||r.push(t)}return r},eT=p_?QM:ZM,tT=(...e)=>{console.log(...eT(e)),nT.forEach((t=>t.print(e)))},nT=TA();const oT=e=>({[Symbol.iterator](){return this},next:e}),rT=(e,t)=>oT((()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n})),iT=(e,t)=>oT((()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}})),sT=Object.assign,aT=Object.keys,cT=(e,t)=>{for(const n in e)t(e[n],n)},lT=e=>aT(e).length,dT=e=>{for(const t in e)return!1;return!0},uT=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},hT=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),pT=(e,t)=>e===t||lT(e)===lT(t)&&uT(e,((e,n)=>(void 0!==e||hT(t,n))&&t[n]===e));class fT{constructor(e,t){this.clock=e,this.len=t}}class mT{constructor(){this.clients=new Map}}const gT=(e,t,n)=>t.clients.forEach(((t,o)=>{const r=e.doc.store.clients.get(o);for(let i=0;i<t.length;i++){const o=t[i];wP(e,r,o.clock,o.len,n)}})),vT=(e,t)=>{let n=0,o=e.length-1;while(n<=o){const r=RA((n+o)/2),i=e[r],s=i.clock;if(s<=t){if(t<s+i.len)return r;n=r+1}else o=r-1}return null},bT=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==vT(n,t.clock)},yT=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 o=e[n-1],r=e[t];o.clock+o.len>=r.clock?o.len=jA(o.len,r.clock+r.len-o.clock):(n<t&&(e[n]=r),n++)}e.length=n}))},wT=e=>{const t=new mT;for(let n=0;n<e.length;n++)e[n].clients.forEach(((o,r)=>{if(!t.clients.has(r)){const i=o.slice();for(let t=n+1;t<e.length;t++)IA(i,e[t].clients.get(r)||[]);t.clients.set(r,i)}}));return yT(t),t},xT=(e,t,n,o)=>{AA(e.clients,t,(()=>[])).push(new fT(n,o))},kT=()=>new mT,CT=e=>{const t=kT();return e.clients.forEach(((e,n)=>{const o=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const r=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;o.push(new fT(r,i))}}o.length>0&&t.clients.set(n,o)})),t},ST=(e,t)=>{L_(e.restEncoder,t.clients.size),OA(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),L_(e.restEncoder,t);const o=n.length;L_(e.restEncoder,o);for(let r=0;r<o;r++){const t=n[r];e.writeDsClock(t.clock),e.writeDsLen(t.len)}}))},ET=e=>{const t=new mT,n=gM(e.restDecoder);for(let o=0;o<n;o++){e.resetDsCurVal();const n=gM(e.restDecoder),o=gM(e.restDecoder);if(o>0){const r=AA(t.clients,n,(()=>[]));for(let t=0;t<o;t++)r.push(new fT(e.readDsClock(),e.readDsLen()))}}return t},AT=(e,t,n)=>{const o=new mT,r=gM(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const r=gM(e.restDecoder),i=gM(e.restDecoder),s=n.clients.get(r)||[],a=uP(n,r);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<a){a<i&&xT(o,r,a,i-a);let e=pP(s,n),c=s[e];!c.deleted&&c.id.clock<n&&(s.splice(e+1,0,_O(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,_O(t,c,i-c.id.clock)),c.delete(t))}}else xT(o,r,n,i-n)}}if(o.clients.size>0){const e=new BT;return L_(e.restEncoder,0),ST(e,o),e.toUint8Array()}return null},_T=OM;class MT extends DA{constructor({guid:e=DM(),collectionid:t=null,gc:n=!0,gcFilter:o=(()=>!0),meta:r=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=o,this.clientID=_T(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new lP,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=r,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=RM((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>RM((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||MP(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(OA(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return MP(this,e,t)}get(e,t=QP){const n=AA(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),o=n.constructor;if(t!==QP&&o!==t){if(o===QP){const o=new t;o._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=o})),o._start=n._start;for(let e=o._start;null!==e;e=e.right)e.parent=o;return o._length=n._length,this.share.set(e,o),o._integrate(this,null),o}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,bI)}getText(e=""){return this.get(e,FI)}getMap(e=""){return this.get(e,xI)}getXmlFragment(e=""){return this.get(e,qI)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){OA(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new MT({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,MP(e.parent.doc,(n=>{const o=t.doc;e.deleted||n.subdocsAdded.add(o),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 TT{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return gM(this.restDecoder)}readDsLen(){return gM(this.restDecoder)}}class PT extends TT{readLeftID(){return oP(gM(this.restDecoder),gM(this.restDecoder))}readRightID(){return oP(gM(this.restDecoder),gM(this.restDecoder))}readClient(){return gM(this.restDecoder)}readInfo(){return mM(this.restDecoder)}readString(){return wM(this.restDecoder)}readParentInfo(){return 1===gM(this.restDecoder)}readTypeRef(){return gM(this.restDecoder)}readLen(){return gM(this.restDecoder)}readAny(){return AM(this.restDecoder)}readBuf(){return g_(fM(this.restDecoder))}readJSON(){return JSON.parse(wM(this.restDecoder))}readKey(){return wM(this.restDecoder)}}class IT{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=gM(this.restDecoder),this.dsCurrVal}readDsLen(){const e=gM(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class OT extends IT{constructor(e){super(e),this.keys=[],gM(e),this.keyClockDecoder=new TM(fM(e)),this.clientDecoder=new MM(fM(e)),this.leftClockDecoder=new TM(fM(e)),this.rightClockDecoder=new TM(fM(e)),this.infoDecoder=new _M(fM(e),mM),this.stringDecoder=new PM(fM(e)),this.parentInfoDecoder=new _M(fM(e),mM),this.typeRefDecoder=new MM(fM(e)),this.lenDecoder=new MM(fM(e))}readLeftID(){return new tP(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new tP(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 AM(this.restDecoder)}readBuf(){return fM(this.restDecoder)}readJSON(){return AM(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 NT{constructor(){this.restEncoder=I_()}toUint8Array(){return N_(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){L_(this.restEncoder,e)}writeDsLen(e){L_(this.restEncoder,e)}}class DT extends NT{writeLeftID(e){L_(this.restEncoder,e.client),L_(this.restEncoder,e.clock)}writeRightID(e){L_(this.restEncoder,e.client),L_(this.restEncoder,e.clock)}writeClient(e){L_(this.restEncoder,e)}writeInfo(e){B_(this.restEncoder,e)}writeString(e){H_(this.restEncoder,e)}writeParentInfo(e){L_(this.restEncoder,e?1:0)}writeTypeRef(e){L_(this.restEncoder,e)}writeLen(e){L_(this.restEncoder,e)}writeAny(e){K_(this.restEncoder,e)}writeBuf(e){W_(this.restEncoder,e)}writeJSON(e){H_(this.restEncoder,JSON.stringify(e))}writeKey(e){H_(this.restEncoder,e)}}class RT{constructor(){this.restEncoder=I_(),this.dsCurrVal=0}toUint8Array(){return N_(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,L_(this.restEncoder,t)}writeDsLen(e){0===e&&aM(),L_(this.restEncoder,e-1),this.dsCurrVal+=e}}class BT extends RT{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new oM,this.clientEncoder=new tM,this.leftClockEncoder=new oM,this.rightClockEncoder=new oM,this.infoEncoder=new Q_(B_),this.stringEncoder=new rM,this.parentInfoEncoder=new Q_(B_),this.typeRefEncoder=new tM,this.lenEncoder=new tM}toUint8Array(){const e=I_();return L_(e,0),W_(e,this.keyClockEncoder.toUint8Array()),W_(e,this.clientEncoder.toUint8Array()),W_(e,this.leftClockEncoder.toUint8Array()),W_(e,this.rightClockEncoder.toUint8Array()),W_(e,N_(this.infoEncoder)),W_(e,this.stringEncoder.toUint8Array()),W_(e,N_(this.parentInfoEncoder)),W_(e,this.typeRefEncoder.toUint8Array()),W_(e,this.lenEncoder.toUint8Array()),V_(e,N_(this.restEncoder)),N_(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){K_(this.restEncoder,e)}writeBuf(e){W_(this.restEncoder,e)}writeJSON(e){K_(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 LT=(e,t,n,o)=>{o=jA(o,t[0].id.clock);const r=pP(t,o);L_(e.restEncoder,t.length-r),e.writeClient(n),L_(e.restEncoder,o);const i=t[r];i.write(e,o-i.id.clock);for(let s=r+1;s<t.length;s++)t[s].write(e,0)},jT=(e,t,n)=>{const o=new Map;n.forEach(((e,n)=>{uP(t,n)>e&&o.set(n,e)})),dP(t).forEach(((e,t)=>{n.has(t)||o.set(t,0)})),L_(e.restEncoder,o.size),OA(o.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,o])=>{LT(e,t.clients.get(n),n,o)}))},FT=(e,t)=>{const n=SA(),o=gM(e.restDecoder);for(let r=0;r<o;r++){const o=gM(e.restDecoder),r=new Array(o),i=e.readClient();let s=gM(e.restDecoder);n.set(i,{i:0,refs:r});for(let n=0;n<o;n++){const o=e.readInfo();switch(S_&o){case 0:{const t=e.readLen();r[n]=new QI(oP(i,s),t),s+=t;break}case 10:{const t=gM(e.restDecoder);r[n]=new OO(oP(i,s),t),s+=t;break}default:{const a=0===(o&(k_|C_)),c=new MO(oP(i,s),null,(o&C_)===C_?e.readLeftID():null,null,(o&k_)===k_?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,a&&(o&x_)===x_?e.readString():null,TO(e,o));r[n]=c,s+=c.length}}}}return n},zT=(e,t,n)=>{const o=[];let r=OA(n.keys()).sort(((e,t)=>e-t));if(0===r.length)return null;const i=()=>{if(0===r.length)return null;let e=n.get(r[r.length-1]);while(e.refs.length===e.i){if(r.pop(),!(r.length>0))return null;e=n.get(r[r.length-1])}return e};let s=i();if(null===s&&0===o.length)return null;const a=new lP,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 o){const t=e.id.client,o=n.get(t);o?(o.i--,a.clients.set(t,o.refs.slice(o.i)),n.delete(t),o.i=0,o.refs=[]):a.clients.set(t,[e]),r=r.filter((e=>e!==t))}o.length=0};while(1){if(d.constructor!==OO){const r=AA(u,d.id.client,(()=>uP(t,d.id.client))),i=r-d.id.clock;if(i<0)o.push(d),l(d.id.client,d.id.clock-1),h();else{const r=d.getMissing(e,t);if(null!==r){o.push(d);const e=n.get(r)||{refs:[],i:0};if(e.refs.length!==e.i){d=e.refs[e.i++];continue}l(r,uP(t,r)),h()}else(0===i||i<d.length)&&(d.integrate(e,i),u.set(d.id.client,d.id.clock+d.length))}}if(o.length>0)d=o.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 BT;return jT(e,a,new Map),L_(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},UT=(e,t)=>jT(e,t.doc.store,t.beforeState),qT=(e,t,n,o=new OT(e))=>MP(t,(e=>{e.local=!1;let t=!1;const n=e.doc,r=n.store,i=FT(o,n),s=zT(e,r,i),a=r.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<uP(r,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=DP([a.update,s.update])}}else r.pendingStructs=s;const c=AT(o,e,r);if(r.pendingDs){const t=new OT(uM(r.pendingDs));gM(t.restDecoder);const n=AT(t,e,r);r.pendingDs=c&&n?DP([c,n]):c||n}else r.pendingDs=c;if(t){const t=r.pendingStructs.update;r.pendingStructs=null,HT(e.doc,t)}}),n,!1),HT=(e,t,n,o=OT)=>{const r=uM(t);qT(r,e,n,new o(r))},VT=(e,t,n)=>HT(e,t,n,PT),WT=(e,t,n=new Map)=>{jT(e,t.store,n),ST(e,CT(t.store))},GT=(e,t=new Uint8Array([0]),n=new BT)=>{const o=YT(t);WT(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(RP(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===DT)return OP(r.map(((e,t)=>0===t?e:zP(e))));if(n.constructor===BT)return DP(r)}return r[0]},$T=(e,t)=>GT(e,t,new DT),XT=e=>{const t=new Map,n=gM(e.restDecoder);for(let o=0;o<n;o++){const n=gM(e.restDecoder),o=gM(e.restDecoder);t.set(n,o)}return t},YT=e=>XT(new TT(uM(e)));class JT{constructor(){this.l=[]}}const ZT=()=>new JT,KT=(e,t)=>e.l.push(t),QT=(e,t)=>{const n=e.l,o=n.length;e.l=n.filter((e=>t!==e)),o===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},eP=(e,t,n)=>n_(e.l,[t,n]);class tP{constructor(e,t){this.client=e,this.clock=t}}const nP=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,oP=(e,t)=>new tP(e,t),rP=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw aM()};class iP{constructor(e,t){this.ds=e,this.sv=t}}const sP=(e,t)=>new iP(e,t),aP=(sP(kT(),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&&!bT(t.ds,e.id)),cP=(e,t)=>{const n=AA(e.meta,cP,TA),o=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<uP(o,n)&&vP(e,oP(n,t))})),gT(e,t.ds,(e=>{})),n.add(t))};class lP{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const dP=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const o=e[e.length-1];t.set(n,o.id.clock+o.length)})),t},uP=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const o=n[n.length-1];return o.id.clock+o.length},hP=(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 aM()}n.push(t)},pP=(e,t)=>{let n=0,o=e.length-1,r=e[o],i=r.id.clock;if(i===t)return o;let s=RA(t/(i+r.length-1)*o);while(n<=o){if(r=e[s],i=r.id.clock,i<=t){if(t<i+r.length)return s;n=s+1}else o=s-1;s=RA((n+o)/2)}throw aM()},fP=(e,t)=>{const n=e.clients.get(t.client);return n[pP(n,t.clock)]},mP=fP,gP=(e,t,n)=>{const o=pP(t,n),r=t[o];return r.id.clock<n&&r instanceof MO?(t.splice(o+1,0,_O(e,r,n-r.id.clock)),o+1):o},vP=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[gP(e,n,t.clock)]},bP=(e,t,n)=>{const o=t.clients.get(n.client),r=pP(o,n.clock),i=o[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==QI&&o.splice(r+1,0,_O(e,i,n.clock-i.id.clock+1)),i},yP=(e,t,n)=>{const o=e.clients.get(t.id.client);o[pP(o,t.id.clock)]=n},wP=(e,t,n,o,r)=>{if(0===o)return;const i=n+o;let s,a=gP(e,t,n);do{s=t[a++],i<s.id.clock+s.length&&gP(e,t,i),r(s)}while(a<t.length&&t[a].id.clock<i)};class xP{constructor(e,t,n){this.doc=e,this.deleteSet=new mT,this.beforeState=dP(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 kP=(e,t)=>!(0===t.deleteSet.clients.size&&!MA(t.afterState,((e,n)=>t.beforeState.get(n)!==e)))&&(yT(t.deleteSet),UT(e,t),ST(e,t.deleteSet),!0),CP=(e,t,n)=>{const o=t._item;(null===o||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&AA(e.changed,t,TA).add(n)},SP=(e,t)=>{let n=e[t],o=e[t-1],r=t;for(;r>0;n=o,o=e[--r-1]){if(o.deleted!==n.deleted||o.constructor!==n.constructor||!o.mergeWith(n))break;n instanceof MO&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,o)}const i=t-r;return i&&e.splice(t+1-i,i),i},EP=(e,t,n)=>{for(const[o,r]of e.clients.entries()){const e=t.clients.get(o);for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.clock+i.len;for(let o=pP(e,i.clock),r=e[o];o<e.length&&r.id.clock<s;r=e[++o]){const r=e[o];if(i.clock+i.len<=r.id.clock)break;r instanceof MO&&r.deleted&&!r.keep&&n(r)&&r.gc(t,!1)}}}},AP=(e,t)=>{e.clients.forEach(((e,n)=>{const o=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t],r=LA(o.length-1,1+pP(o,n.clock+n.len-1));for(let e=r,t=o[e];e>0&&t.id.clock>=n.clock;t=o[e])e-=1+SP(o,e)}}))},_P=(e,t)=>{if(t<e.length){const n=e[t],o=n.doc,r=o.store,i=n.deleteSet,s=n._mergeStructs;try{yT(i),n.afterState=dP(n.doc.store),o.emit("beforeObserverCalls",[n,o]);const e=[];n.changed.forEach(((t,o)=>e.push((()=>{null!==o._item&&o._item.deleted||o._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)),eP(t._dEH,e,n))}))})),e.push((()=>o.emit("afterTransaction",[n,o]))),n_(e,[]),n._needFormattingCleanup&&BI(n)}finally{o.gc&&EP(i,r,o.gcFilter),AP(i,r),n.afterState.forEach(((e,t)=>{const o=n.beforeState.get(t)||0;if(o!==e){const e=r.clients.get(t),n=jA(pP(e,o),1);for(let t=e.length-1;t>=n;)t-=1+SP(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,o=r.clients.get(t),i=pP(o,n);i+1<o.length&&SP(o,i+1)>1||i>0&&SP(o,i)}if(n.local||n.afterState.get(o.clientID)===n.beforeState.get(o.clientID)||(tT(YM,qM,"[yjs] ",HM,$M,"Changed the client-id because another client seems to be using it."),o.clientID=_T()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const e=new DT,t=kP(e,n);t&&o.emit("update",[e.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const e=new BT,t=kP(e,n);t&&o.emit("updateV2",[e.toUint8Array(),n.origin,o,n])}const{subdocsAdded:a,subdocsLoaded:c,subdocsRemoved:l}=n;(a.size>0||l.size>0||c.size>0)&&(a.forEach((e=>{e.clientID=o.clientID,null==e.collectionid&&(e.collectionid=o.collectionid),o.subdocs.add(e)})),l.forEach((e=>o.subdocs.delete(e))),o.emit("subdocs",[{loaded:c,added:a,removed:l},o,n]),l.forEach((e=>e.destroy()))),e.length<=t+1?(o._transactionCleanups=[],o.emit("afterAllTransactions",[o,e])):_P(e,t+1)}}},MP=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new xP(e,n,o),r.push(e._transaction),1===r.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===r[0];e._transaction=null,t&&_P(r,0)}}return s};function*TP(e){const t=gM(e.restDecoder);for(let n=0;n<t;n++){const t=gM(e.restDecoder),n=e.readClient();let o=gM(e.restDecoder);for(let r=0;r<t;r++){const t=e.readInfo();if(10===t){const t=gM(e.restDecoder);yield new OO(oP(n,o),t),o+=t}else if(0!==(S_&t)){const r=0===(t&(k_|C_)),i=new MO(oP(n,o),null,(t&C_)===C_?e.readLeftID():null,null,(t&k_)===k_?e.readRightID():null,r?e.readParentInfo()?e.readString():e.readLeftID():null,r&&(t&x_)===x_?e.readString():null,TO(e,t));yield i,o+=i.length}else{const t=e.readLen();yield new QI(oP(n,o),t),o+=t}}}}class PP{constructor(e,t){this.gen=TP(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===OO);return this.curr}}class IP{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const OP=e=>DP(e,PT,DT),NP=(e,t)=>{if(e.constructor===QI){const{client:n,clock:o}=e.id;return new QI(oP(n,o+t),e.length-t)}if(e.constructor===OO){const{client:n,clock:o}=e.id;return new OO(oP(n,o+t),e.length-t)}{const n=e,{client:o,clock:r}=n.id;return new MO(oP(o,r+t),null,oP(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},DP=(e,t=OT,n=BT)=>{if(1===e.length)return e[0];const o=e.map((e=>new t(uM(e))));let r=o.map((e=>new PP(e,!0))),i=null;const s=new n,a=new IP(s);while(1){if(r=r.filter((e=>null!==e.curr)),r.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===OO?1:-1:n}return t.curr.id.client-e.curr.id.client})),0===r.length)break;const e=r[0],t=e.curr.id.client;if(null!==i){let n=e.curr,o=!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(),o=!0;if(null===n||n.id.client!==t||o&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)LP(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===OO)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{LP(a,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length,o=new OO(oP(t,i.struct.id.clock+i.struct.length),e);i={struct:o,offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===OO?i.struct.length-=t:n=NP(n,t)),i.struct.mergeWith(n)||(LP(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!==OO;n=e.next())LP(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(LP(a,i.struct,i.offset),i=null),jP(a);const c=o.map((e=>ET(e))),l=wT(c);return ST(s,l),s.toUint8Array()},RP=(e,t,n=OT,o=BT)=>{const r=YT(t),i=new o,s=new IP(i),a=new n(uM(e)),c=new PP(a,!1);while(c.curr){const e=c.curr,t=e.id.client,n=r.get(t)||0;if(c.curr.constructor!==OO)if(e.id.clock+e.length>n){LP(s,e,jA(n-e.id.clock,0)),c.next();while(c.curr&&c.curr.id.client===t)LP(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()}jP(s);const l=ET(a);return ST(i,l),i.toUint8Array()},BP=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:N_(e.encoder.restEncoder)}),e.encoder.restEncoder=I_(),e.written=0)},LP=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&BP(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),L_(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},jP=e=>{BP(e);const t=e.encoder.restEncoder;L_(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const o=e.clientStructs[n];L_(t,o.written),V_(t,o.restEncoder)}},FP=(e,t,n,o)=>{const r=new n(uM(e)),i=new PP(r,!1),s=new o,a=new IP(s);for(let l=i.curr;null!==l;l=i.next())LP(a,t(l),0);jP(a);const c=ET(r);return ST(s,c),s.toUint8Array()},zP=e=>FP(e,o_,OT,DT),UP="You must not compute changes after the event-handler fired.";class qP{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=HP(this.currentTarget,this.target))}deletes(e){return bT(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw iM(UP);const e=new Map,t=this.target,n=this.transaction.changed.get(t);n.forEach((n=>{if(null!==n){const o=t._map.get(n);let r,i;if(this.adds(o)){let e=o.left;while(null!==e&&this.adds(e))e=e.left;if(this.deletes(o)){if(null===e||!this.deletes(e))return;r="delete",i=PA(e.content.getContent())}else null!==e&&this.deletes(e)?(r="update",i=PA(e.content.getContent())):(r="add",i=void 0)}else{if(!this.deletes(o))return;r="delete",i=PA(o.content.getContent())}e.set(n,{action:r,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 iM(UP);const t=this.target,n=TA(),o=TA(),r=[];e={added:n,deleted:o,delta:r,keys:this.keys};const i=this.transaction.changed.get(t);if(i.has(null)){let e=null;const i=()=>{e&&r.push(e)};for(let r=t._start;null!==r;r=r.right)r.deleted?this.deletes(r)&&!this.adds(r)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=r.length,o.add(r)):this.adds(r)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(r.content.getContent()),n.add(r)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=r.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const HP=(e,t)=>{const n=[];while(null!==t._item&&t!==e){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,o=t._item.parent._start;while(o!==t._item&&null!==o)o.deleted||e++,o=o.right;n.unshift(e)}t=t._item.parent}return n},VP=80;let WP=0;class GP{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=WP++}}const $P=e=>{e.timestamp=WP++},XP=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=WP++},YP=(e,t,n)=>{if(e.length>=VP){const o=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return XP(o,t,n),o}{const o=new GP(t,n);return e.push(o),o}},JP=(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)=>BA(t-e.index)<BA(t-n.index)?e:n));let o=e._start,r=0;null!==n&&(o=n.p,r=n.index,$P(n));while(null!==o.right&&r<t){if(!o.deleted&&o.countable){if(t<r+o.length)break;r+=o.length}o=o.right}while(null!==o.left&&r>t)o=o.left,!o.deleted&&o.countable&&(r-=o.length);while(null!==o.left&&o.left.id.client===o.id.client&&o.left.id.clock+o.left.length===o.id.clock)o=o.left,!o.deleted&&o.countable&&(r-=o.length);return null!==n&&BA(n.index-r)<o.parent.length/VP?(XP(n,o,r),n):YP(e._searchMarker,o,r)},ZP=(e,t,n)=>{for(let o=e.length-1;o>=0;o--){const r=e[o];if(n>0){let t=r.p;t.marker=!1;while(t&&(t.deleted||!t.countable))t=t.left,t&&!t.deleted&&t.countable&&(r.index-=t.length);if(null===t||!0===t.marker){e.splice(o,1);continue}r.p=t,t.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=jA(t,r.index+n))}},KP=(e,t,n)=>{const o=e,r=t.changedParentTypes;while(1){if(AA(r,e,(()=>[])).push(n),null===e._item)break;e=e._item.parent}eP(o._eH,n,t)};class QP{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=ZT(),this._dEH=ZT(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw sM()}clone(){throw sM()}_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){KT(this._eH,e)}observeDeep(e){KT(this._dEH,e)}unobserve(e){QT(this._eH,e)}unobserveDeep(e){QT(this._dEH,e)}toJSON(){}}const eI=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let o=n-t;const r=[];let i=e._start;while(null!==i&&o>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&&o>0;n++)r.push(e[n]),o--;t=0}}i=i.right}return r},tI=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},nI=(e,t)=>{let n=0,o=e._start;while(null!==o){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let o=0;o<r.length;o++)t(r[o],n++,e)}o=o.right}},oI=(e,t)=>{const n=[];return nI(e,((o,r)=>{n.push(t(o,r,e))})),n},rI=e=>{let t=e._start,n=null,o=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(),o=0,t=t.right}const e=n[o++];return n.length<=o&&(n=null),{done:!1,value:e}}}},iI=(e,t)=>{const n=JP(e,t);let o=e._start;for(null!==n&&(o=n.p,t-=n.index);null!==o;o=o.right)if(!o.deleted&&o.countable){if(t<o.length)return o.content.getContent()[t];t-=o.length}},sI=(e,t,n,o)=>{let r=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&&(r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new pO(l)),r.integrate(e,0),l=[])};o.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:r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new eO(new Uint8Array(n))),r.integrate(e,0);break;case MT:r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new iO(n)),r.integrate(e,0);break;default:if(!(n instanceof QP))throw new Error("Unexpected content type in insert operation");r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new EO(n)),r.integrate(e,0)}}})),d()},aI=iM("Length exceeded!"),cI=(e,t,n,o)=>{if(n>t._length)throw aI;if(0===n)return t._searchMarker&&ZP(t._searchMarker,n,o.length),sI(e,t,null,o);const r=n,i=JP(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&&vP(e,oP(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&ZP(t._searchMarker,r,o.length),sI(e,t,s,o)},lI=(e,t,n)=>{const o=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start});let r=o.p;if(r)while(r.right)r=r.right;return sI(e,t,r,n)},dI=(e,t,n,o)=>{if(0===o)return;const r=n,i=o,s=JP(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&&vP(e,oP(a.id.client,a.id.clock+n)),n-=a.length);while(o>0&&null!==a)a.deleted||(o<a.length&&vP(e,oP(a.id.client,a.id.clock+o)),a.delete(e),o-=a.length),a=a.right;if(o>0)throw aI;t._searchMarker&&ZP(t._searchMarker,r,-i+o)},uI=(e,t,n)=>{const o=t._map.get(n);void 0!==o&&o.delete(e)},hI=(e,t,n,o)=>{const r=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==o)a=new pO([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:a=new pO([o]);break;case Uint8Array:a=new eO(o);break;case MT:a=new iO(o);break;default:if(!(o instanceof QP))throw new Error("Unexpected content type");a=new EO(o)}new MO(oP(s,uP(i.store,s)),r,r&&r.lastId,null,null,t,n,a).integrate(e,0)},pI=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},fI=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},mI=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},gI=e=>rT(e.entries(),(e=>!e[1].deleted));class vI extends qP{constructor(e,t){super(e,t),this._transaction=t}}class bI extends QP{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new bI;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new bI}clone(){const e=new bI;return e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),KP(this,e,new vI(this,e))}insert(e,t){null!==this.doc?MP(this.doc,(n=>{cI(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?MP(this.doc,(t=>{lI(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?MP(this.doc,(n=>{dI(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return iI(this,e)}toArray(){return tI(this)}slice(e=0,t=this.length){return eI(this,e,t)}toJSON(){return this.map((e=>e instanceof QP?e.toJSON():e))}map(e){return oI(this,e)}forEach(e){nI(this,e)}[Symbol.iterator](){return rI(this)}_write(e){e.writeTypeRef(bO)}}const yI=e=>new bI;class wI extends qP{constructor(e,t,n){super(e,t),this.keysChanged=n}}class xI extends QP{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 xI}clone(){const e=new xI;return this.forEach(((t,n)=>{e.set(n,t instanceof QP?t.clone():t)})),e}_callObserver(e,t){KP(this,e,new wI(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const o=t.content.getContent()[t.length-1];e[n]=o instanceof QP?o.toJSON():o}})),e}get size(){return[...gI(this._map)].length}keys(){return iT(gI(this._map),(e=>e[0]))}values(){return iT(gI(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return iT(gI(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?MP(this.doc,(t=>{uI(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return pI(this,e)}has(e){return mI(this,e)}clear(){null!==this.doc?MP(this.doc,(e=>{this.forEach((function(t,n,o){uI(e,o,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(yO)}}const kI=e=>new xI,CI=(e,t)=>e===t||"object"===typeof e&&"object"===typeof t&&e&&t&&pT(e,t);class SI{constructor(e,t,n,o){this.left=e,this.right=t,this.index=n,this.currentAttributes=o}forward(){switch(null===this.right&&aM(),this.right.content.constructor){case lO:this.right.deleted||MI(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 EI=(e,t,n)=>{while(null!==t.right&&n>0){switch(t.right.content.constructor){case lO:t.right.deleted||MI(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&vP(e,oP(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},AI=(e,t,n)=>{const o=new Map,r=JP(t,n);if(r){const t=new SI(r.p.left,r.p,r.index,o);return EI(e,t,n-r.index)}{const r=new SI(null,t._start,0,o);return EI(e,r,n)}},_I=(e,t,n,o)=>{while(null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===lO&&CI(o.get(n.right.content.key),n.right.content.value)))n.right.deleted||o.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;o.forEach(((o,s)=>{const a=n.left,c=n.right,l=new MO(oP(i,uP(r.store,i)),a,a&&a.lastId,c,c&&c.id,t,null,new lO(s,o));l.integrate(e,0),n.right=l,n.forward()}))},MI=(e,t)=>{const{key:n,value:o}=t;null===o?e.delete(n):e.set(n,o)},TI=(e,t)=>{while(1){if(null===e.right)break;if(!(e.right.deleted||e.right.content.constructor===lO&&CI(t[e.right.content.key]||null,e.right.content.value)))break;e.forward()}},PI=(e,t,n,o)=>{const r=e.doc,i=r.clientID,s=new Map;for(const a in o){const c=o[a],l=n.currentAttributes.get(a)||null;if(!CI(l,c)){s.set(a,l);const{left:o,right:d}=n;n.right=new MO(oP(i,uP(r.store,i)),o,o&&o.lastId,d,d&&d.id,t,null,new lO(a,c)),n.right.integrate(e,0),n.forward()}}return s},II=(e,t,n,o,r)=>{n.currentAttributes.forEach(((e,t)=>{void 0===r[t]&&(r[t]=null)}));const i=e.doc,s=i.clientID;TI(n,r);const a=PI(e,t,n,r),c=o.constructor===String?new mO(o):o instanceof QP?new EO(o):new aO(o);let{left:l,right:d,index:u}=n;t._searchMarker&&ZP(t._searchMarker,n.index,c.getLength()),d=new MO(oP(s,uP(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(),_I(e,t,n,a)},OI=(e,t,n,o,r)=>{const i=e.doc,s=i.clientID;TI(n,r);const a=PI(e,t,n,r);e:while(null!==n.right&&(o>0||a.size>0&&(n.right.deleted||n.right.content.constructor===lO))){if(!n.right.deleted)switch(n.right.content.constructor){case lO:{const{key:t,value:i}=n.right.content,s=r[t];if(void 0!==s){if(CI(s,i))a.delete(t);else{if(0===o)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:o<n.right.length&&vP(e,oP(n.right.id.client,n.right.id.clock+o)),o-=n.right.length;break}n.forward()}if(o>0){let r="";for(;o>0;o--)r+="\n";n.right=new MO(oP(s,uP(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new mO(r)),n.right.integrate(e,0),n.forward()}_I(e,t,n,a)},NI=(e,t,n,o,r)=>{let i=t;const s=SA();while(i&&(!i.countable||i.deleted)){if(!i.deleted&&i.content.constructor===lO){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 lO:{const{key:i,value:l}=n,d=o.get(i)||null;s.get(i)===n&&d!==l||(t.delete(e),a++,c||(r.get(i)||null)!==l||d===l||(null===d?r.delete(i):r.set(i,d))),c||t.deleted||MI(r,n);break}}}t=t.right}return a},DI=(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===lO){const o=t.content.key;n.has(o)?t.delete(e):n.add(o)}t=t.left}},RI=e=>{let t=0;return MP(e.doc,(n=>{let o=e._start,r=e._start,i=SA();const s=EA(i);while(r){if(!1===r.deleted)switch(r.content.constructor){case lO:MI(s,r.content);break;default:t+=NI(n,o,r,i,s),i=EA(s),o=r;break}r=r.right}})),t},BI=e=>{const t=new Set,n=e.doc;for(const[o,r]of e.afterState.entries()){const i=e.beforeState.get(o)||0;r!==i&&wP(e,n.store.clients.get(o),i,r,(e=>{e.deleted||e.content.constructor!==lO||e.constructor===QI||t.add(e.parent)}))}MP(n,(n=>{gT(e,e.deleteSet,(e=>{if(e instanceof QI||!e.parent._hasFormatting||t.has(e.parent))return;const o=e.parent;e.content.constructor===lO?t.add(o):DI(n,e)}));for(const e of t)RI(e)}))},LI=(e,t,n)=>{const o=n,r=EA(t.currentAttributes),i=t.right;while(n>0&&null!==t.right){if(!1===t.right.deleted)switch(t.right.content.constructor){case EO:case aO:case mO:n<t.right.length&&vP(e,oP(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&NI(e,i,t.right,r,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&ZP(s._searchMarker,t.index,-o+n),t};class jI extends qP{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=[];MP(e,(e=>{const n=new Map,o=new Map;let r=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},dT(s)||(e.attributes=sT({},s))),c=0;break}e&&t.push(e),i=null}};while(null!==r){switch(r.content.constructor){case EO:case aO:this.adds(r)?this.deletes(r)||(d(),i="insert",a=r.content.getContent()[0],d()):this.deletes(r)?("delete"!==i&&(d(),i="delete"),l+=1):r.deleted||("retain"!==i&&(d(),i="retain"),c+=1);break;case mO:this.adds(r)?this.deletes(r)||("insert"!==i&&(d(),i="insert"),a+=r.content.str):this.deletes(r)?("delete"!==i&&(d(),i="delete"),l+=r.length):r.deleted||("retain"!==i&&(d(),i="retain"),c+=r.length);break;case lO:{const{key:t,value:a}=r.content;if(this.adds(r)){if(!this.deletes(r)){const c=n.get(t)||null;CI(c,a)?null!==a&&r.delete(e):("retain"===i&&d(),CI(a,o.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(r)){o.set(t,a);const e=n.get(t)||null;CI(e,a)||("retain"===i&&d(),s[t]=e)}else if(!r.deleted){o.set(t,a);const n=s[t];void 0!==n&&(CI(n,a)?null!==n&&r.delete(e):("retain"===i&&d(),null===a?delete s[t]:s[t]=a))}r.deleted||("insert"===i&&d(),MI(n,r.content));break}}r=r.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 FI extends QP{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(IN){console.error(IN)}this._pending=null}_copy(){return new FI}clone(){const e=new FI;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new jI(this,e,t);KP(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===mO&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?MP(this.doc,(n=>{const o=new SI(null,this._start,0,new Map);for(let r=0;r<e.length;r++){const i=e[r];if(void 0!==i.insert){const s=t||"string"!==typeof i.insert||r!==e.length-1||null!==o.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!==typeof s||s.length>0)&&II(n,this,o,s,i.attributes||{})}else void 0!==i.retain?OI(n,this,o,i.retain,i.attributes||{}):void 0!==i.delete&&LI(n,o,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const o=[],r=new Map,i=this.doc;let s="",a=this._start;function c(){if(s.length>0){const e={};let t=!1;r.forEach(((n,o)=>{t=!0,e[o]=n}));const n={insert:s};t&&(n.attributes=e),o.push(n),s=""}}const l=()=>{while(null!==a){if(aP(a,e)||void 0!==t&&aP(a,t))switch(a.content.constructor){case mO:{const o=r.get("ychange");void 0===e||aP(a,e)?void 0===t||aP(a,t)?void 0!==o&&(c(),r.delete("ychange")):void 0!==o&&o.user===a.id.client&&"added"===o.type||(c(),r.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==o&&o.user===a.id.client&&"removed"===o.type||(c(),r.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case EO:case aO:{c();const e={insert:a.content.getContent()[0]};if(r.size>0){const t={};e.attributes=t,r.forEach(((e,n)=>{t[n]=e}))}o.push(e);break}case lO:aP(a,e)&&(c(),MI(r,a.content));break}a=a.right}c()};return e||t?MP(i,(n=>{e&&cP(n,e),t&&cP(n,t),l()}),"cleanup"):l(),o}insert(e,t,n){if(t.length<=0)return;const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);n||(n={},r.currentAttributes.forEach(((e,t)=>{n[t]=e}))),II(o,this,r,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n={}){const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);II(o,this,r,t,n)})):this._pending.push((()=>this.insertEmbed(e,t,n)))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?MP(n,(n=>{LI(n,AI(n,this,e),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);null!==r.right&&OI(o,this,r,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?MP(this.doc,(t=>{uI(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return pI(this,e)}getAttributes(){return fI(this)}_write(e){e.writeTypeRef(wO)}}const zI=e=>new FI;class UI{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!==VI&&t.constructor!==qI||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 qI extends QP{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 qI}clone(){const e=new qI;return e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new UI(this,e)}querySelector(e){e=e.toUpperCase();const t=new UI(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)),n=t.next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),OA(new UI(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){KP(this,e,new GI(this,t,e))}toString(){return oI(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const o=e.createDocumentFragment();return void 0!==n&&n._createAssociation(o,this),nI(this,(r=>{o.insertBefore(r.toDOM(e,t,n),null)})),o}insert(e,t){null!==this.doc?MP(this.doc,(n=>{cI(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)MP(this.doc,(n=>{const o=e&&e instanceof QP?e._item:e;sI(n,this,o,t)}));else{const n=this._prelimContent,o=null===e?0:n.findIndex((t=>t===e))+1;if(0===o&&null!==e)throw iM("Reference item not found");n.splice(o,0,...t)}}delete(e,t=1){null!==this.doc?MP(this.doc,(n=>{dI(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return tI(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return iI(this,e)}slice(e=0,t=this.length){return eI(this,e,t)}forEach(e){nI(this,e)}_write(e){e.writeTypeRef(kO)}}const HI=e=>new qI;class VI extends qI{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 VI(this.nodeName)}clone(){const e=new VI(this.nodeName),t=this.getAttributes();return cT(t,((t,n)=>{"string"===typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const s in e)n.push(s);n.sort();const o=n.length;for(let s=0;s<o;s++){const o=n[s];t.push(o+'="'+e[o]+'"')}const r=this.nodeName.toLocaleLowerCase(),i=t.length>0?" "+t.join(" "):"";return`<${r}${i}>${super.toString()}</${r}>`}removeAttribute(e){null!==this.doc?MP(this.doc,(t=>{uI(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return pI(this,e)}hasAttribute(e){return mI(this,e)}getAttributes(){return fI(this)}toDOM(e=document,t={},n){const o=e.createElement(this.nodeName),r=this.getAttributes();for(const i in r){const e=r[i];"string"===typeof e&&o.setAttribute(i,e)}return nI(this,(r=>{o.appendChild(r.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(xO),e.writeKey(this.nodeName)}}const WI=e=>new VI(e.readKey());class GI extends qP{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 $I extends xI{constructor(e){super(),this.hookName=e}_copy(){return new $I(this.hookName)}clone(){const e=new $I(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const o=t[this.hookName];let r;return r=void 0!==o?o.createDom(this):document.createElement(this.hookName),r.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(CO),e.writeKey(this.hookName)}}const XI=e=>new $I(e.readKey());class YI extends FI{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 YI}clone(){const e=new YI;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const o=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(o,this),o}toString(){return this.toDelta().map((e=>{const t=[];for(const o in e.attributes){const n=[];for(const t in e.attributes[o])n.push({key:t,value:e.attributes[o][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:o,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let o=0;o<t.length;o++){const e=t[o];n+=`<${e.nodeName}`;for(let t=0;t<e.attrs.length;t++){const o=e.attrs[t];n+=` ${o.key}="${o.value}"`}n+=">"}n+=e.insert;for(let o=t.length-1;o>=0;o--)n+=`</${t[o].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(SO)}}const JI=e=>new YI;class ZI{constructor(e,t){this.id=e,this.length=t}get deleted(){throw sM()}mergeWith(e){return!1}write(e,t,n){throw sM()}integrate(e,t){throw sM()}}const KI=0;class QI extends ZI{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),hP(e.doc.store,this)}write(e,t){e.writeInfo(KI),e.writeLen(this.length-t)}getMissing(e,t){return null}}class eO{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new eO(this.content)}splice(e){throw sM()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const tO=e=>new eO(e.readBuf());class nO{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new nO(this.len)}splice(e){const t=new nO(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xT(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 oO=e=>new nO(e.readLen()),rO=(e,t)=>new MT({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class iO{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 iO(rO(this.doc.guid,this.opts))}splice(e){throw sM()}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 sO=e=>new iO(rO(e.readString(),e.readAny()));class aO{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new aO(this.embed)}splice(e){throw sM()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const cO=e=>new aO(e.readJSON());class lO{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new lO(this.key,this.value)}splice(e){throw sM()}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 dO=e=>new lO(e.readKey(),e.readJSON());class uO{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new uO(this.arr)}splice(e){const t=new uO(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 o=t;o<n;o++){const t=this.arr[o];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const hO=e=>{const t=e.readLen(),n=[];for(let o=0;o<t;o++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new uO(n)};class pO{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new pO(this.arr)}splice(e){const t=new pO(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 o=t;o<n;o++){const t=this.arr[o];e.writeAny(t)}}getRef(){return 8}}const fO=e=>{const t=e.readLen(),n=[];for(let o=0;o<t;o++)n.push(e.readAny());return new pO(n)};class mO{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new mO(this.str)}splice(e){const t=new mO(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 gO=e=>new mO(e.readString()),vO=[yI,kI,zI,WI,HI,XI,JI],bO=0,yO=1,wO=2,xO=3,kO=4,CO=5,SO=6;class EO{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new EO(this.type._copy())}splice(e){throw sM()}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 AO=e=>new EO(vO[e.readTypeRef()](e)),_O=(e,t,n)=>{const{client:o,clock:r}=t.id,i=new MO(oP(o,r+n),t,oP(o,r+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=oP(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 MO extends ZI{constructor(e,t,n,o,r,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=o,this.rightOrigin=r,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?b_:0}set marker(e){(this.info&w_)>0!==e&&(this.info^=w_)}get marker(){return(this.info&w_)>0}get keep(){return(this.info&v_)>0}set keep(e){this.keep!==e&&(this.info^=v_)}get countable(){return(this.info&b_)>0}get deleted(){return(this.info&y_)>0}set deleted(e){this.deleted!==e&&(this.info^=y_)}markDeleted(){this.info|=y_}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=uP(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=uP(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===tP&&this.id.client!==this.parent.client&&this.parent.clock>=uP(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=bP(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=vP(e,this.rightOrigin),this.rightOrigin=this.right.id),(this.left&&this.left.constructor===QI||this.right&&this.right.constructor===QI)&&(this.parent=null),this.parent){if(this.parent.constructor===tP){const e=mP(t,this.parent);e.constructor===QI?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===MO&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===MO&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=bP(e,e.doc.store,oP(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 o=new Set,r=new Set;while(null!==t&&t!==this.right){if(r.add(t),o.add(t),nP(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,o.clear();else if(nP(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!r.has(mP(e.doc.store,t.origin)))break;o.has(mP(e.doc.store,t.origin))||(n=t,o.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),hP(e.doc.store,this),this.content.integrate(e,this),CP(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new QI(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:oP(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&nP(e.origin,this.lastId)&&this.right===e&&nP(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(),xT(e.deleteSet,this.id.client,this.id.clock,this.length),CP(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw aM();this.content.gc(e),t?yP(e,this,new QI(this.id,this.length)):this.content=new nO(this.length)}write(e,t){const n=t>0?oP(this.id.client,this.id.clock+t-1):this.origin,o=this.rightOrigin,r=this.parentSub,i=this.content.getRef()&S_|(null===n?0:C_)|(null===o?0:k_)|(null===r?0:x_);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==o&&e.writeRightID(o),null===n&&null===o){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=rP(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===tP?(e.writeParentInfo(!1),e.writeLeftID(t)):aM();null!==r&&e.writeString(r)}this.content.write(e,t)}}const TO=(e,t)=>PO[t&S_](e),PO=[()=>{aM()},oO,hO,tO,gO,cO,dO,AO,fO,sO,()=>{aM()}],IO=10;class OO extends ZI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){aM()}write(e,t){e.writeInfo(IO),L_(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const NO="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:{},DO="__ $YJS$ __";!0===NO[DO]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),NO[DO]=!0;var RO,BO,LO,jO,FO=new WeakMap,zO=function(){function e(t){d(this,e),b(this,FO,{writable:!0,value:""}),Tw(this,FO,t)}return g(e,[{key:"getRoom",value:function(){return k(this,FO)}}]),e}(),UO=function(){function e(t,n){d(this,e),this.modeler=t,this.store=n}return g(e,[{key:"isSpecialProperty",value:function(e){var t=["messageRef","signalRef","signalPayload","gatewayDirection","condition","allowedUsers","allowedGroups"];return t.includes(e)}},{key:"updateNodeId",value:function(e,t){var n=this.getIndex(e),o=this.yArray.get(n);o.set("id",t);var r=this.getNodeById(e);this.store.commit("updateNodeProp",{node:r,key:"id",value:t})}},{key:"handleLoopCharacteristics",value:function(e,t){var n=JSON.parse(t);this.modeler.nodeRegistry[e.type].loopCharacteristicsHandler({type:e.definition.type,$loopCharactetistics:{id:e.id,loopCharacteristics:n}},e,this.setNodeProp,this.modeler.moddle,this.modeler.definitions,!1)}},{key:"updateEventCondition",value:function(e,t){e.get("eventDefinitions")[0].get("condition").body=t}},{key:"updateGatewayDirection",value:function(e,t){e.set("gatewayDirection",t)}},{key:"updateNodeProperty",value:function(e,t,n){this.store.commit("updateNodeProp",{node:e,key:t,value:n})}},{key:"updateMessageRef",value:function(e,t,n){var o=this.modeler.definitions.rootElements.find((function(e){return e.id===t}));o||(o=this.modeler.moddle.create("bpmn:Message",{id:t,name:(null===n||void 0===n?void 0:n.messageName)||t}),this.modeler.definitions.rootElements.push(o)),e.definition.get("eventDefinitions")[0].messageRef=o,null!==n&&void 0!==n&&n.allowedUsers&&e.definition.set("allowedUsers",n.allowedUsers),null!==n&&void 0!==n&&n.allowedGroups&&e.definition.set("allowedGroups",n.allowedGroups)}},{key:"updateSignalRef",value:function(e,t,n){var o=this.modeler.definitions.rootElements.find((function(e){return e.id===t}));o||(o=this.modeler.moddle.create("bpmn:Signal",{id:t,name:(null===n||void 0===n?void 0:n.signalName)||t}),this.modeler.definitions.rootElements.push(o)),e.definition.get("eventDefinitions")[0].signalRef=o}},{key:"updateSignalPayload",value:function(e,t){var n=e.definition.get("eventDefinitions"),o="bpmn:SignalEventDefinition";n.forEach((function(e){e.$type===o&&(e.config=t)}))}},{key:"updateEventTimerDefinition",value:function(e,t){var n=t.type,o=t.body,r=_w(this.modeler.moddle,e,n,o);this.store.commit("updateNodeProp",{node:e,key:"eventDefinitions",value:r})}}]),e}(),qO=function(){function e(t,n,o){d(this,e),y(this,"saturationRange",null),y(this,"lightnessRange",null),this.saturationRange=this.getRange(t,o),this.lightnessRange=this.getRange(n,o)}return g(e,[{key:"getRange",value:function(e,t){return[Math.max(0,e-t),Math.min(e+t,100)]}},{key:"getHashOfString",value: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}},{key:"normalizeHash",value:function(e,t,n){return Math.floor(e%(n-t)+t)}},{key:"generateHSL",value:function(e){var t=this.getHashOfString(e),n=this.normalizeHash(t,0,360),o=this.normalizeHash(t,this.saturationRange[0],this.saturationRange[1]),r=this.normalizeHash(t,this.lightnessRange[0],this.lightnessRange[1]);return[n,o,r]}},{key:"HSLtoString",value:function(e){return"hsl(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%)")}},{key:"generateColorHsl",value:function(e){return this.HSLtoString(this.generateHSL(e,this.saturationRange,this.lightnessRange))}},{key:"randomColor",value:function(e){return e?this.generateColorHsl(e):null}}]),e}(),HO=new WeakMap,VO=function(){function e(t){var n=this;d(this,e),y(this,"clientIO",null),y(this,"yDoc",null),y(this,"yArray",null),y(this,"modeler",null),b(this,HO,{writable:!0,value:null}),y(this,"room",null),y(this,"inspector",null),y(this,"deletedItem",null),y(this,"colorUtil",null),y(this,"debouncedUpdateSelectedNodes",(0,Ao.debounce)((function(e){n.updateSelectedNodes(e)}),400)),this.yDoc=new MT,this.yArray=this.yDoc.getArray("elements"),this.modeler=t}return g(e,[{key:"init",value:function(){var e,t;Tw(this,HO,B(this.modeler.definitions));var n=null!==(e=window.ProcessMaker.modeler.process.uuid)&&void 0!==e?e:window.ProcessMaker.modeler.process.id,o=(null===(t=window.ProcessMaker.app)||void 0===t?void 0:t.url)||"";this.room=new zO("room-".concat(o,"-").concat(n)),this.inspector=new UO(this.modeler,Un),this.clientIO=CA(window.ProcessMaker.multiplayer.host,{transports:["websocket","polling"]}),window.ProcessMaker.multiplayer.enabled?(this.webSocketEvents(),this.multiplayerEvents()):this.clientIO.disconnect(),this.colorUtil=new qO(50,50,10)}},{key:"webSocketEvents",value:function(){var e=this;this.clientIO.on("connect",(function(){var t,n,o,r;e.modeler.emptyPlayers(),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,clientColor:(null===(o=window.ProcessMaker.user)||void 0===o?void 0:o.color)||e.colorUtil.randomColor(null===(r=window.ProcessMaker.user)||void 0===r?void 0:r.fullName),clientCursor:{coordinates:{clientX:300,clientY:300},paperTranslate:e.modeler.paper.translate(),paperScale:e.modeler.paper.scale()}})})),this.clientIO.on("clientJoined",(function(t){e.modeler.enableMultiplayer(t.isMultiplayer),e.addPlayers(t)})),this.clientIO.on("clientLeft",(function(t){e.modeler.unhightligtNodes(t.clientId),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("updateUserCursor",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.updateClientCursor(n);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.clientIO.on("selectedNodesWasUpdated",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.updateHightligtedNodes(n);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),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:VT(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:VT(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)})),VT(e.yDoc,new Uint8Array(t.updateDoc))})),this.clientIO.on("updateElement",(function(t){var n=t.updateDoc,o=t.updatedNodes,r=t.isReplaced;r?e.replaceShape(o[0]):o.forEach((function(t){e.updateShapes(t)})),VT(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateInspector",(function(t){var n=t.updateDoc,o=t.updatedNodes;o.forEach((function(t){e.updateShapeFromInspector(t)})),VT(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateFlows",(function(t){var n=t.updateDoc,o=t.updatedNodes;o.forEach((function(t){e.updateFlowClient(t)})),VT(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.modeler.isMultiplayer&&e.updateNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-replaceNode",(function(t){var n=t.nodeData,o=t.newControl;e.replaceNode(n,o)})),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)})),window.ProcessMaker.EventBus.$on("multiplayer-updateSelectedNodes",(function(t){e.modeler.isMultiplayer&&e.debouncedUpdateSelectedNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-updateMousePosition",(function(t){e.modeler.isMultiplayer&&e.updateMousePosition(t)}))}},{key:"addPlayers",value:function(e){var t=this;e.isMultiplayer&&e.clients.map((function(e){var n={id:e.id,name:e.name,color:e.color,avatar:e.avatar,cursor:e.cursor};t.modeler.addPlayer(n)}))}},{key:"updateMousePosition",value:function(e){this.clientIO.emit("cursorTrackingUpdate",{roomName:this.room.getRoom(),clientId:this.clientIO.id,clientCursor:e})}},{key:"updateClientCursor",value:function(e){var t=this;e.clients.map((function(e){t.modeler.updateClientCursor(e)}))}},{key:"updateSelectedNodes",value:function(e){var t="Another user is working on this object, wait until they finish making changes.";this.modeler.isMultiplayerSelected(e)&&window.ProcessMaker.alert(t,"warning"),this.clientIO.emit("updateSelectedNodes",{clientId:this.clientIO.id,roomName:this.room.getRoom(),selectedNodes:e})}},{key:"updateHightligtedNodes",value:function(e){var t=this;e.clients.map((function(e){t.modeler.updateHightligtedNodes(e)}))}},{key:"syncLocalNodes",value:function(e){var t=this,n=this.modeler.nodes.map((function(e){return"bpmn:BoundaryEvent"===e.definition.$type?yg(e):"bpmn:Lane"===e.definition.$type?t.prepareLaneData(e):t.modeler.multiplayerHook(e,!1,!0)}));n.forEach((function(n){var o=new xI;t.doTransact(o,n),t.yArray.push([o]);var r=$T(t.yDoc);t.clientIO.emit("createElement",{updateDoc:r,clientId:e})}))}},{key:"addNode",value:function(e){var t=new xI;this.doTransact(t,e),this.yArray.push([t]);var n=$T(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n})}},{key:"createShape",value:function(e){var t,n=this.getNodeById(e.id);n||(null!==(t=this.modeler.nodeRegistry[e.type])&&void 0!==t&&t.multiplayerClient?this.modeler.nodeRegistry[e.type].multiplayerClient(this.modeler,e):this.modeler.addRemoteNode(e),k(this,HO).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.yArray.delete(t,1);var n=$T(this.yDoc);this.clientIO.emit("removeElement",n)}}},{key:"getIndex",value:function(e){var t,n=-1,o=!1,r=NS(this.yArray);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(n++,i.get("id")===e){o=!0;break}}}catch(PN){r.e(PN)}finally{r.f()}return o?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),o=t.yArray.get(n),r=e.poolId?er(er({},e.properties),{poolId:e.poolId}):e.properties;t.doTransact(o,r)}))}},{key:"replaceNode",value:function(e,t){var n=this.getIndex(e.nodeThatWillBeReplaced.definition.id),o=this.yArray.get(n);e.id="node_".concat(k(this,HO).getDefinitionNumber()),k(this,HO).updateCounters(),this.replaceShape({oldNodeId:e.nodeThatWillBeReplaced.definition.id,id:e.id,type:t,x:e.x,y:e.y}),this.yDoc.transact((function(){o.set("type",t),o.set("id",e.id)}));var r=$T(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:r,isReplaced:!0})}},{key:"replaceShape",value:function(e){var t=this.modeler.paper.localToClientPoint(e),n=t.x,o=t.y,r=this.getNodeById(e.oldNodeId),i={clientX:n,clientY:o,control:{type:e.type},nodeThatWillBeReplaced:r,color:r.color,id:e.id};this.modeler.replaceNodeProcedure(i,!0),k(this,HO).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=$T(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:n,isReplaced:!1})}},{key:"updateShapes",value:function(){var e=l(a().mark((function e(t){var n,o,r,i,s;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.modeler.paper,o=this.modeler.getElementByNodeId(t.id),r=this.modeler.getElementByNodeId(t.poolId),!this.modeler.flowTypes.includes(t.type)){e.next=7;break}"waypoint"in t?this.updateMovedWaypoint(o,t):(i=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:i,key:"color",value:t.color})),e.next=23;break;case 7:if(this.updateGatewayDefaultFlow(o,t),"function"===typeof o.resize&&t.width&&t.height&&o.resize(t.width,t.height),t.x&&t.y&&o.set("position",{x:t.x,y:t.y}),!t.color){e.next=14;break}return s=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:s,key:"color",value:t.color}),e.abrupt("return");case 14:return"bpmn:BoundaryEvent"===o.component.node.definition.$type&&this.attachBoundaryEventToNode(o,t),e.next=17,n.findViewByModel(o).update();case 17:return e.next=19,o.component.$nextTick();case 19:return e.next=21,this.modeler.paperManager.awaitScheduledUpdates();case 21:r&&o.component.node.pool&&o.component.node.pool.component.id!==t.poolId&&o.component.node.pool.component.moveElementRemote(o,r),this.modeler.updateLasso();case 23:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"updateGatewayDefaultFlow",value:function(e,t){if(Object.hasOwn(t,"default")){var n=this.getNodeById(t.default);e.component.node.definition.set("default",n||null)}}},{key:"updateMovedWaypoint",value:function(e,t){var n=this,o=t.waypoint,r=this.modeler.paper,i=this.modeler.getElementByNodeId(t.sourceRefId),s=this.modeler.getElementByNodeId(t.targetRefId),a=o[0],c=o[o.length-1];e.vertices(o),e.component.node.diagram.waypoint=o.map((function(e){return n.modeler.moddle.create("dc:Point",e)})),e.component.node._modelerId+="_replaced",e.source(i,{anchor:function(){return Tt(n.getConnectionPoint(i,a),i.findView(r))},connectionPoint:{name:"boundary"}}),e.target(s,{anchor:function(){return Tt(n.getConnectionPoint(s,c),s.findView(r))},connectionPoint:{name:"boundary"}})}},{key:"attachBoundaryEventToNode",value:function(e,t){var n=this.getNodeById(t.attachedToRefId),o=e.getParentCell(),r=this.modeler.getElementByNodeId(t.attachedToRefId);o&&o.unembed(e),r&&r.embed(e),e.component.node.definition.set("attachedToRef",n.definition)}},{key:"addCommonElement",value:function(e){var t=new xI;this.doTransact(t,e),this.yArray.push([t]);var n=$T(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n}),k(this,HO).updateCounters()}},{key:"addLaneNodes",value:function(e){var t=this,n=this.getPool(e),o={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}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[o]),this.yDoc.transact((function(){e.forEach((function(e){var n=new xI,o=t.prepareLaneData(e);t.doTransact(n,o),t.yArray.push([n]);var r=$T(t.yDoc);t.clientIO.emit("createElement",{updateDoc:r})}))}))}},{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,poolX:e.pool.component.node.diagram.bounds.x,poolY:e.pool.component.node.diagram.bounds.y};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(),o=n.x,r=n.y,i={x:t.x-o,y:t.y-r},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 o=e.value;"loopCharacteristics"===e.key&&(o=JSON.stringify(e.value)),n.set(e.key,o),e.extras&&Object.keys(e.extras).length>0&&n.set("extras",e.extras);var r=$T(this.yDoc);this.clientIO.emit("updateFromInspector",{updateDoc:r,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,n=null;if(e.oldNodeId&&e.oldNodeId!==e.id&&this.inspector.updateNodeId(e.oldNodeId,e.id),n=this.getNodeById(e.id),n){var o=e.extras,r=void 0===o?{}:o,i=n,s=i.definition;if(e.loopCharacteristics)this.inspector.handleLoopCharacteristics(n,e.loopCharacteristics);else if(null!==(t=this.modeler.nodeRegistry[n.type])&&void 0!==t&&t.multiplayerInspectorHandler)this.modeler.nodeRegistry[n.type].multiplayerInspectorHandler(n,e,this.setNodeProp,this.modeler.moddle);else{var a=Object.keys(e).filter((function(e){return"id"!==e})),c=a[0],l=e[c];"condition"===c?this.inspector.updateEventCondition(s,l):"gatewayDirection"===c?this.inspector.updateGatewayDirection(s,l):"messageRef"===c?this.inspector.updateMessageRef(n,l,r):"signalRef"===c?this.inspector.updateSignalRef(n,l,r):"signalPayload"===c?this.inspector.updateSignalPayload(n,l):"eventTimerDefinition"===c?this.inspector.updateEventTimerDefinition(n,l):this.inspector.isSpecialProperty(c)||this.inspector.updateNodeProperty(n,c,l)}}}},{key:"updateFlows",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),o=t.yArray.get(n);t.yDoc.transact((function(){for(var t in e)Object.hasOwn(e,t)&&o.set(t,e[t])}))}));var n=$T(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 o,r=this.getNodeById(e.sourceRefId),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]);n.definition.set("sourceRef",r.definition),t=!0}if(n&&e.targetRefId){var s,a=this.getNodeById(e.targetRefId),c=a.definition.get("incoming").find((function(e){return e.id===n.definition.id}));if(!c)(s=a.definition.get("incoming")).push.apply(s,[n.definition]);n.definition.set("targetRef",a.definition),t=!0}this.refreshNodeWaypoint(this.modeler.getElementByNodeId(e.id)),t&&(n._modelerId+="_replaced")}},{key:"refreshNodeWaypoint",value:function(e){var t=this,n=this.modeler.paper.findViewByModel(e),o=n.sourceAnchor,r=n.targetAnchor;e.component.node.diagram.waypoint=[o].concat(W(e.component.shape.vertices()),[r]).map((function(e){return t.modeler.moddle.create("dc:Point",e)}))}}]),e}(),WO={components:{PreviewPanel:Cb,ToolBar:Hx,ExplorerRail:nv,InspectorButton:Gv,InspectorPanel:ib,ProcessmakerModelerGenericFlow:RC,Selection:AS,RailBottom:_C,WelcomeMessage:pv,CreateAssetsCard:yv,GeneratingAssetsCard:Ev,AssetsCreatedCard:Iv,CreateAssetsFailCard:Lv,RemoteCursor:OS},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:[rk,Ek,Mk,Tk],data:function(){var e;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,panMode:!1,panning:!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,isAiGenerated:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isAiGenerated,assetsCreated:!1,assetFail:!1,currentNonce:null,promptSessionId:"",loadingAI:!1,cancelledJobs:[],flowTypes:["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow","processmaker-modeler-data-input-association","processmaker-modeler-data-output-association","processmaker-modeler-association"],boundaryEventTypes:["processmaker-modeler-boundary-timer-event","processmaker-modeler-boundary-error-event","processmaker-modeler-boundary-signal-event","processmaker-modeler-boundary-conditional-event","processmaker-modeler-boundary-message-event"]}},watch:{isReadOnly:function(){this.panMode=this.isReadOnly},panning:function(){this.panning||(this.canvasDragPosition=null)},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)},creatingNewNode:function(){this.creatingNewNode&&this.clearSelection()}},computed:{isReadOnly:function(){return Un.getters.isReadOnly},creatingNewNode:function(){return Pg.getters.getSelectedNode},filteredPlayers:function(){var e=_o().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())}))},showWelcomeMessage:function(){return!this.selectedNode&&!this.nodes.length&&!this.isReadOnly&&this.isLoaded&&!Sb.getters.isRunning},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 Sb.getters.currentState},copiedElements:function(){return Un.getters.copiedElements},highlightedNode:function(){return Un.getters.highlightedNodes[0]},highlightedNodes:function(){return Un.getters.highlightedNodes},invalidNodes:function(){return xk(this.validationErrors,this.nodes)},showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer},isPackageAiInstalled:function(){var e;return null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isPackageAiInstalled}},methods:{mountedInit:function(){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},addEventHandlers:function(){var e=this;this.paperManager.addEventHandler("cell:pointerdblclick",lk),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){e.panMode?e.startPanning():e.pointerDownHandler(t)}),this),this.paperManager.addEventHandler("blank:pointerup",(function(t){e.panMode&&e.stopPanning(),e.activeNode=null,e.pointerUpHandler(t)}),this),this.paperManager.addEventHandler("cell:pointerup",(function(t,n){e.panMode?e.stopPanning():(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,o){var r=e.model.get("onClick");r&&r(e,t,n,o)})),this.paperManager.addEventHandler("cell:pointerclick",(function(t,n){var o=t.model;e.isBpmnNode(o)&&(e.panMode||(o.component.$emit("click",n),e.$emit("click",{event:n,node:e.highlightedNode.definition})))})),this.paperManager.addEventHandler("cell:pointerdown",(function(t,n){var o=t.model;e.isBpmnNode(o)&&(e.panMode?e.startPanning():(e.setShapeStacking(o),e.activeNode=o.component.node,e.pointerDowInShape(n,o)))})),this.$root.$on("replace-ai-node",(function(t){e.replaceAiNode(t)})),window.ProcessMaker.EventBus.$on("save-changes",(function(t,n,o){t&&e.redirect(t),o&&e.generateAssets()}))},registerCustomNodes:function(){var e=this;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 o;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,Sb.dispatch("pushState",n);case 4:try{o=new VO(e),o.init(),e.multiplayer=o}catch(r){console.warn("Could not initialize multiplayer",r)}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)}})},initAI:function(){this.isPackageAiInstalled&&(this.currentNonce=localStorage.currentNonce,localStorage.getItem("promptSessions")&&"null"!==localStorage.getItem("promptSessions")||localStorage.setItem("promptSessions",JSON.stringify([])),localStorage.getItem("cancelledJobs")&&"null"!==localStorage.getItem("cancelledJobs")?this.cancelledJobs=JSON.parse(localStorage.getItem("cancelledJobs")):this.cancelledJobs=[],this.promptSessionId=this.getPromptSessionForUser(),this.fetchHistory(),this.subscribeToProgress(),this.subscribeToGenerationCompleted(),this.subscribeToErrors())},onNodeDefinitionChanged:function(){this.isOpenPreview&&this.handlePreview()},onStartPreviewResize:function(e){this.isResizingPreview=!0,this.currentCursorPosition=e.x},onMouseUp:function(e){window.ProcessMaker.mouseDownDrag&&(window.ProcessMaker.EventBus.$emit("custom-pointerclick",e),window.ProcessMaker.mouseDownDrag=!1),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(){if(!this.isOpenInspector){if(this.isOpenPreview&&!this.isOpenInspector){var e=screen.width/1920;this.inspectorButtonRight=65*e+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 o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=!(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,o);case 6:case"end":return n.stop()}}),n)})))()},toggleDefaultFlow:function(e){var t,n=e.definition.sourceRef;n.default&&n.default.id===e.id&&(e=null),window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[{id:n.id,properties:{default:(null===(t=e)||void 0===t?void 0:t.id)||null}}]),n.set("default",e)},cloneElement:function(e,t){var n=e.clone(this.nodeRegistry,this.moddle,this.$t),o=(e.diagram.bounds.height+30)*t;n.diagram.bounds.y+=o,this.addNode(n)},copyElement:function(){var e=[gl,Mo,Oo,fr,eb],t=[Uy,Yy,nw,dw,bw,Aw];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 o=this.paper.translate(),r=o.ty-(n.top-e.top-n.height);this.paper.translate(o.tx,r),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})),o=n.shape;return t.paper.findViewByModel(o)}))},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 o,r,i,s,c,l,d,u;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:null,r=e.length>1&&void 0!==e[1]?e[1]:null,i=e.length>2&&void 0!==e[2]&&e[2],s=document.querySelector(".mini-paper svg"),c="text { font-family: sans-serif; }",l=document.createElement("style"),l.appendChild(document.createTextNode(c)),s.appendChild(l),n.next=10,t.getXmlFromDiagram();case 10:d=n.sent,u=(new XMLSerializer).serializeToString(s),t.$emit("saveBpmn",{xml:d,svg:u,redirectUrl:o,nodeId:r,generatingAssets:i});case 13: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(){zv()(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,Sb.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,o){e?n(e):t(o)}))}))},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=_o().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,o=function(){return e.id},r=function(t){if(t.get("implementation")===e.implementation)return e.id};this.translateConfig(e.inspectorConfig[0]),Sk(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(r):n.parsers[i].default.push(o)})),Pg.commit("setNodeTypes",this.nodeTypes)},registerPmBlock:function(e,t){var n=this,o=function(){return e.id};this.translateConfig(e.inspectorConfig[0]),Sk(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.pmBlockNodes.push(e);var r=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];r.forEach((function(e){n.parsers[e]||(n.parsers[e]={custom:[],implementation:[],default:[]}),t?n.parsers[e].custom.push(t):n.parsers[e].default.push(o)})),Pg.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(o){return n.setNode(o,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 o=e.filter((function(e){return e.get("dataInputAssociations")&&e.get("dataInputAssociations").length>0}));o.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(o){return n.setNode(o,e,t)}))},loadSequenceFlows:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(o){return n.setNode(o,e,t)}))},loadFlowElements:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"!==e.$type})).forEach((function(o){return n.setNode(o,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"),o=t.get("artifacts");e.loadFlowElements(n,o),e.loadSequenceFlows(n,o),e.loadArtifacts(n,o),e.loadAssociations(n,o),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 pr("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 o=n.custom.find((function(n){return n(e,t.moddle)})),r=n.implementation.find((function(n){return n(e,t.moddle)})),i=n.default.find((function(n){return n(e,t.moddle)}));return o||r||i}},handleUnsupportedElement:function(e,t,n,o,r){this.addWarning({title:this.$t("Unsupported Element"),text:e+this.$t(" is an unsupported element type in parse")}),Cs()(t,n),Cs()(o,n),Cs()(this.planeElements,r),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 o=this.planeElements.find((function(t){return t.bpmnElement.id===e.id})),r=e.$type,i=this.getCustomParser(e);if(i){this.removeUnsupportedElementAttributes(e);var s=e.config&&(0,jv.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(r);l&&!e.get("name")&&e.set("name",""),this.createNodeAsync(a,e,o)}else this.handleUnsupportedElement(r,t,e,n,o)},createNodeAsync:function(e,t,n){var o=this;return l(a().mark((function r(){var i;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:i=o.createNode(e,t,n),o.isMultiplayer?o.loadNodeForMultiplayer(i):Un.commit("addNode",i);case 2:case"end":return r.stop()}}),r)})))()},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 pr.isTimerType(e)?new ck(e,t,n):(Object.keys(t).forEach((function(e){void 0!==t[e]&&null!==t[e]||delete t[e]})),new pr(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 o,r;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:null,r=!1,null===o&&(o=t.currentXML,r=!0),n.next=5,t.xmlManager.getDefinitionsFromXml(o);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:r&&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=Sg.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 o=t.createBoundaryEvent(n);n.get("outgoing").forEach((function(e){return e.set("sourceRef",o)})),t.replaceDefinition(n,o,e)}))},replaceDefinition:function(e,t,n){var o=n.get("flowElements").indexOf(e);n.flowElements[o]=t;var r=this.planeElements.find((function(t){return t.bpmnElement===e}));r.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 o,r,i,s;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=t.nodeRegistry[e.type].definition(t.moddle,t.$t),r=t.nodeRegistry[e.type].diagram(t.moddle),r.bounds.x=e.x,r.bounds.y=e.y,r.bounds.width=e.width,r.bounds.height=e.height,i=t.createNode(e.type,o,r),e.poolId&&(s=t.getElementByNodeId(e.poolId),t.poolTarget=s),n.next=10,t.addNode(i,e.id,!0);case 10:return n.next=12,t.$nextTick();case 12:return n.next=14,t.paperManager.awaitScheduledUpdates();case 14:t.autoValidate&&t.validateBpmnDiagram();case 15:case"end":return n.stop()}}),n)})))()},handleDrop:function(e){var t=this;return l(a().mark((function n(){var o,r,i,s,c,l,d,u,h,p,f;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.clientX,r=e.clientY,i=e.control,s=e.nodeThatWillBeReplaced,t.validateDropTarget({clientX:o,clientY:r,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(o,r),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(t.$emit("node-added",p),s){n.next=17;break}return n.abrupt("return");case 17:return f=new kk(s,c,t.graph,p,t.processes,t.collaboration),f.migrate(),n.abrupt("return",p);case 20: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 o,r;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 o=t.$refs.nodeComponent.find((function(t){return t.node===e})),r=o.shapeView,n.next=8,t.$refs.selector.selectElement(r);case 8:case"end":return n.stop()}}),n)})))()},multiplayerHook:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=["processmaker-modeler-lane","processmaker-modeler-generic-flow","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-data-input-association"].concat(W(this.boundaryEventTypes));if(this.isMultiplayer&&!t){if(!o.includes(e.type)&&!this.flowTypes.includes(e.type)){var r,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,signalRef:null,signalPayload:null,extras:{},default:null};if(null!==e&&void 0!==e&&null!==(r=e.pool)&&void 0!==r&&r.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=null===(s=e.definition.sourceRef)||void 0===s?void 0:s.id,h=null===(a=e.definition.targetRef)||void 0===a?void 0:a.id;if("processmaker-modeler-data-input-association"===e.type)u=Array.isArray(e.definition.sourceRef)&&(null===(l=e.definition.sourceRef[0])||void 0===l?void 0:l.id),h=null===(d=e.definition.targetRef)||void 0===d||null===(d=d.$parent)||void 0===d||null===(d=d.$parent)||void 0===d?void 0:d.get("id");var p=[];if(null===(c=e.diagram.waypoint)||void 0===c||c.forEach((function(e){p.push({x:e.x,y:e.y})})),u&&h){var f={id:e.definition.id,type:e.type,sourceRefId:u,targetRefId:h,waypoint:p,name:e.definition.name,conditionExpression:null,color:null};if(n)return f;window.ProcessMaker.EventBus.$emit("multiplayer-addFlow",f)}}}},addNode:function(e){var t=arguments,n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=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),Vx(e,s),e.setIds(n.nodeIdGenerator,r),n.planeElements.push(e.diagram),n.multiplayerHook(e,i),Un.commit("addNode",e),n.poolTarget=null,![gl,dl,eo,El,Mo,Oo,fr].includes(e.type)){o.next=12;break}return o.abrupt("return");case 12:return i||n.selectNewNode(e),o.abrupt("return",new Promise((function(e){setTimeout((function(){n.pushToUndoStack(),e()}))})));case 14:case"end":return o.stop()}}),o)})))()},addClonedNodes:function(e){var t=this;return l(a().mark((function n(){var o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=[],e.forEach((function(e){e.pool||(e.pool=t.poolTarget);var n=e.getTargetProcess(t.processes,t.processNode);if(Vx(e,n),t.planeElements.push(e.diagram),t.flowTypes.includes(e.type))o.push(e);else if(t.boundaryEventTypes.includes(e.type)){var r=yg(e);window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",r)}else t.multiplayerHook(e,!1);Un.commit("addNode",e),t.poolTarget=null})),o.forEach((function(e){return t.multiplayerHook(e,!1)}));case 3:case"end":return n.stop()}}),n)})))()},removeNode:function(e,t){var n=this;return l(a().mark((function o(){return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:n.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-removeNode",e),n.removeNodeProcedure(e,t);case 2:case"end":return o.stop()}}),o)})))()},removeNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=t.length>1&&void 0!==t[1]?t[1]:{},i=r.removeRelationships,s=void 0===i||i,e){o.next=3;break}return o.abrupt("return");case 3:return s&&(Lo(e,n),jo(e,n),Fo(e,n)),Uo(e),zo(n.graph,e,n.removeNode),qo(e),n.removeNodesFromLane(e),n.removeNodesFromPool(e),Un.commit("removeNode",e),Un.commit("highlightNode",n.processNode),n.$refs.selector.clearSelection(),o.next=14,n.$nextTick();case 14:return o.next=16,n.pushToUndoStack();case 16:n.processes=n.getProcesses(),n.processes&&n.processes.length>0&&(n.processNode=new pr("processmaker-modeler-process",n.processes[0],n.planeElements.find((function(e){return e.bpmnElement.id===n.processes[0].id}))));case 18:case"end":return o.stop()}}),o)})))()},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,o=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 r,i,s,c;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=n.diagram.bounds,i=r.x,s=r.y,c={x:i,y:s,control:{type:o},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 o(){var r,i,s,c;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return r=t.length>1&&void 0!==t[1]&&t[1],r&&(i=n.paper.localToClientPoint(e.nodeThatWillBeReplaced.diagram.bounds),s=i.x,c=i.y,e.clientX=s,e.clientY=c),o.next=4,n.handleDrop(e);case 4:return o.next=6,n.removeNode(e.nodeThatWillBeReplaced,{removeRelationships:!1,isReplaced:r});case 6:case"end":return o.stop()}}),o)})))()},replaceAiNode:function(e){var t=this,n=e.node,o=e.typeToReplaceWith,r=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:o},nodeThatWillBeReplaced:n});case 3:return u=e.sent,"processmaker-modeler-task"===o&&(u.definition.screenRef=r,u.definition.name=i),"processmaker-modeler-script-task"===o&&(u.definition.scriptRef=r,u.definition.name=i),"processmaker-modeler-call-activity"===o&&(u.definition.name=i,u.definition.calledElement="ProcessId-".concat(r),u.definition.config='{"calledElement":"ProcessId-'.concat(r,'","processId":').concat(r,',"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,o=e.genericFlow,r=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",o);case 6:return e.next=8,t.$nextTick();case 8:return e.next=10,t.addNode(n,o.definition.id);case 10:return e.next=12,t.$nextTick();case 12:return e.next=14,t.highlightNode(r);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 Sb.commit("disableSavingState"),n.next=3,e();case 3:return Sb.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,o=e.control,r=my(t,n,o,this.paperManager.paper,this.graph,this.collaboration,this.$refs["paper-container"]),i=r.allowDrop,s=r.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 Lw(e,t.graph)})))},showSavedNotification:function(){Sb.dispatch("saved")},enableVersions:function(){Sb.dispatch("enableVersions")},setVersionIndicator:function(e){Sb.dispatch("setVersionIndicator",e)},setLoadingState:function(e){Sb.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(),o=n.x,r=n.y,i=n.width,s=n.height;if(e.clientX>=o&&e.clientX<=o+i&&e.clientY>=r&&e.clientY<=r+s)return!0}return!1},pointerDowInShape:function(e,t){var n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=e.clientX,i=e.clientY,s=n.paper.findViewByModel(t),n.isDragging=!1,n.isSelecting=!1,n.isIntoTheSelection=!1,n.dragStart={x:r,y:i},!n.isPointInSelection(e)){o.next=10;break}n.isIntoTheSelection=!0,o.next=15;break;case 10:if(e.shiftKey){o.next=15;break}return o.next=13,n.$refs.selector.selectElement(s);case 13:return o.next=15,n.$nextTick();case 15:n.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY});case 16:case"end":return o.stop()}}),o)})))()},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,o=this.paperManager.paper,r=_o().debounce((function(){window.ProcessMaker.EventBus.$emit("multiplayer-updateMousePosition",{coordinates:{clientX:t,clientY:n},paperTranslate:o.translate(),paperScale:o.scale()})}),3e6,{leading:!0,trailing:!0});r(),this.panMode||(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)},emptyPlayers:function(){this.players=[]},addPlayer:function(e){var t=this.players.find((function(t){return t.id===e.id}));t||this.players.push(e)},updateClientCursor:function(e){e&&(this.players=this.players.map((function(t){return t.id===e.id?er(er({},t),e):t})))},prepareCursorData:function(e){var t=this.paperManager.paper,n=t.translate(),o=n.tx-e.cursor.paperTranslate.tx/e.cursor.paperScale.sx,r=n.ty-e.cursor.paperTranslate.ty/e.cursor.paperScale.sy,i=e.cursor.coordinates.clientX/e.cursor.paperScale.sx+o,s=e.cursor.coordinates.clientY/e.cursor.paperScale.sy+r;return{cursor:{left:i,top:s},color:e.color,name:e.name}},unhightligtNodes:function(e){var t,n=this,o=this.players.find((function(t){return t.id===e}));null===o||void 0===o||null===(t=o.selectedNodes)||void 0===t||t.forEach((function(e){var t=n.getElementByNodeId(e);t&&t.component.setHighlightColor(!1,o.color)}))},updateHightligtedNodes:function(e){var t,n=this;e&&(this.unhightligtNodes(e.id),this.players=this.players.map((function(t){return t.id===e.id?er(er({},t),e):t})),null===e||void 0===e||null===(t=e.selectedNodes)||void 0===t||t.forEach((function(t){var o=n.getElementByNodeId(t);o&&o.component.setHighlightColor(!0,e.color)})))},isMultiplayerSelected:function(e){var t,n=!1;e&&(null===(t=this.players)||void 0===t||t.some((function(t){var o;return!!n||(n=null===t||void 0===t||null===(o=t.selectedNodes)||void 0===o?void 0:o.some((function(t){return e.includes(t)})),!1)})));return n},removePlayer:function(e){var t=this.players.findIndex((function(t){return t.id===e}));-1!==t&&this.players.splice(t,1)},updateLasso:function(){this.$refs.selector.updateSelectionBox()},getNonce:function(){var e=999999999999999,t=Math.floor(Math.random()*e);this.currentNonce=t,localStorage.currentNonce=this.currentNonce},getPromptSessionForUser:function(){var e=localStorage.getItem("promptSessions");e=e?JSON.parse(e):[];var t=e.find((function(e){var t;return e.userId===(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id)&&e.server===window.location.host}));return t?t.promptSessionId:""},setPromptSessions:function(e){var t,n="userId",o=null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id,r=localStorage.getItem("promptSessions");r=r?JSON.parse(r):[];var i=r.find((function(e){return e[n]===o&&e.server===window.location.host}));i?i.promptSessionId=e:r.push(y(y(y({},n,o),"server",window.location.host),"promptSessionId",e)),localStorage.setItem("promptSessions",JSON.stringify(r))},removePromptSessionForUser:function(){var e=localStorage.getItem("promptSessions");e=e?JSON.parse(e):[];var t=e.find((function(e){var t;return e.userId===(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id)&&e.server===window.location.host}));t&&(t.promptSessionId=""),localStorage.setItem("promptSessions",JSON.stringify(e))},fetchHistory:function(){var e,t=this,n="/package-ai/getPromptSessionHistory",o={server:window.location.host,processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.id};this.promptSessionId&&null!==this.promptSessionId&&""!==this.promptSessionId&&(o={promptSessionId:this.promptSessionId}),window.ProcessMaker.apiClient.post(n,o).then((function(e){t.setPromptSessions(e.data.promptSessionId),t.promptSessionId=e.data.promptSessionId,localStorage.promptSessionId=e.data.promptSessionId})).catch((function(e){var n,o=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message)||e.message;t.loading=!1,404===e.response.status?(t.removePromptSessionForUser(),localStorage.promptSessionId="",t.promptSessionId="",t.fetchHistory()):window.ProcessMaker.alert(o,"danger")}))},onGenerateAssets:function(){this.isAiGenerated=!1,this.saveBpmn(null,null,!0)},generateAssets:function(){var e,t=this;this.getNonce(),this.loadingAI=!0,this.fetchHistory();var n={promptSessionId:this.promptSessionId,nonce:this.currentNonce,processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.id},o="/package-ai/generateProcessArtifacts";window.ProcessMaker.apiClient.post(o,n).then((function(e){var n;e.data&&(null!==(n=e.data)&&void 0!==n&&n.error&&(t.assetFail=!0,t.loadingAI=!1))})).catch((function(e){var n,o=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message)||e.message;window.ProcessMaker.alert(o,"danger"),t.assetFail=!0,t.loadingAI=!1}))},highlightTaskArrays:function(e){e&&(this.addAiHighlights(e.tasks),this.addAiHighlights(e.serviceTasks),this.addAiHighlights(e.scriptTasks))},unhighlightTaskArrays:function(e){e&&(this.removeAiHighlights(e.tasks),this.removeAiHighlights(e.serviceTasks),this.removeAiHighlights(e.scriptTasks))},addAiHighlights:function(e){var t=this;e.forEach((function(e){var n=t.getElementByNodeId(e.id);n.component.setAiStatusHighlight(e.status)}))},removeAiHighlights:function(e){var t=this;e.forEach((function(e){var n=t.getElementByNodeId(e.id);n.component.unsetHighlights()}))},subscribeToProgress:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsProgressEvent";window.Echo&&window.Echo.private(n).listen(o,(function(e){e.data.promptSessionId===t.promptSessionId?t.cancelledJobs.some((function(t){return t===e.data.nonce}))?t.unhighlightTaskArrays(e.data):e.data&&("running"===e.data.progress.status?(t.loadingAI=!0,t.highlightTaskArrays(e.data)):"error"===e.data.progress.status?(t.loadingAI=!1,window.ProcessMaker.alert(e.data.message,"danger"),t.assetFail=!0,t.loadingAI=!1):(t.highlightTaskArrays(e.data),setTimeout((function(){t.unhighlightTaskArrays(e.data)}),1e3),t.setPromptSessions(e.data.promptSessionId),t.assetsCreated=!0,t.fetchHistory(),setTimeout((function(){t.loadingAI=!1}),500))):t.unhighlightTaskArrays(e.data)}))},subscribeToGenerationCompleted:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsCompletedEvent";window.Echo.private(n).listen(o,(function(e){e.data&&(t.updateScreenRefs(e.data.screenIds),t.updateScriptRefs(e.data.scriptIds))}))},subscribeToErrors:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsErrorEvent";window.Echo.private(n).listen(o,(function(){t.assetFail=!0,t.loadingAI=!1}))},onStopAssetGeneration:function(){this.currentNonce&&(this.cancelledJobs.push(this.currentNonce),localStorage.setItem("cancelledJobs",JSON.stringify(this.cancelledJobs)),this.loadingAI=!1)},updateScreenRefs:function(e){var t=this;e.forEach((function(e){var n=t.nodes.find((function(t){return t.definition.id===e.node_id})),o=n.definition;"processmaker-modeler-task"===n.type&&(o.screenRef=e.screen_id,Un.commit("updateNodeProp",{node:n,key:"definition",value:o}),t.$emit("save-state"))}))},updateScriptRefs:function(e){var t=this;e.forEach((function(e){var n=t.nodes.find((function(t){return t.definition.id===e.node_id})),o=n.definition;"processmaker-modeler-script-task"===n.type&&(o.scriptRef=e.script_id,Un.commit("updateNodeProp",{node:n,key:"definition",value:o}),t.$emit("save-state"))}))}},created:function(){Ss()&&(window.store=Un,window.undoRedoStore=Sb),this.$t=this.$t.bind(this),window.ProcessMaker.EventBus.$emit("modeler-before-init",{registerComponentMixin:this.registerComponentMixin}),this.registerNode(tb),window.ProcessMaker.EventBus.$emit("modeler-init",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,registerInspectorExtension:Ow,registerBpmnExtension:this.registerBpmnExtension,registerNode:this.registerNode,registerStatusBar:this.registerStatusBar,registerPmBlock:this.registerPmBlock,registerPreview:this.registerPreview}),this.moddle=new(Ag())(this.extensions),this.linter=new Eb.Linter(fy),this.xmlManager=new vk(this.moddle),this.$emit("set-xml-manager",this.xmlManager)},mounted:function(){this.mountedInit(),this.addEventHandlers(),this.registerCustomNodes(),this.initAI(),this.linkEditingInit(),this.initTransparentDragging()}},GO=WO,$O=(f(75317),mo(GO,fg,mg,!1,null,null,null)),XO=$O.exports,YO=f(87299),JO=f.n(YO),ZO={extends:zp,mixins:[tc],data:function(){return{nodeIcon:JO(),iconName:""}}},KO=ZO,QO=mo(KO,RO,BO,!1,null,null,null),eN=QO.exports,tN=76,nN="processmaker-modeler-manual-task",oN={id:nN,component:eN,bpmnType:"bpmn:ManualTask",control:!1,category:"BPMN",icon:f(8565),label:sr[nN],loopInspectorIndex:1,definition:function(e,t){return e.create("bpmn:ManualTask",{name:t(sr[nN]),assignment:"requester",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:tN,width:116})})},inspectorConfig:[{name:sr[nN],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-manual-task"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},rN={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}})}},iN=rN,sN=mo(iN,LO,jO,!1,null,null,null),aN=sN.exports,cN="processmaker-modeler-conditional-start-event",lN=ac()(hr()(Td),er(er({},pp),{},{id:cN,component:aN,label:nr[cN],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[cN]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),dN=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))},uN=[],hN={components:{CrownConfig:Ms},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"],o="bpmn:DataStoreReference"===this.sourceNode.definition.$type,r="bpmn:DataObjectReference"===this.sourceNode.definition.$type;return!(!o||!t.includes(e))||r&&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:Vo(this.node.definition.targetRef.$parent,this.$parent)},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement(),t=Ho(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&&(Wo(this.targetNode,this.sourceNode.definition),(0,Ao.pull)(this.targetNode.definition.get("dataInputAssociations"),this.node.definition))}},pN=hN,fN=mo(pN,dN,uN,!1,null,null,null),mN=fN.exports,gN=function(){function e(t,n,o){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=o}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=Ro(this.moddle),i=Do(this.moddle),s=Ho(this.moddle,t.component.node,e.component.node.definition);i.set("targetRef",s),i.set("sourceRef",[e.component.node.definition]),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var a=new pr(Oo,i,r);return a}}]),e}(),vN=er(er({},t),{},{component:mN,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:Ds}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new gN(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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)})))()}}),bN=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))},yN=[],wN={components:{CrownConfig:Ms},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,Ao.pull)(this.sourceNode.definition.get("dataOutputAssociations"),this.node.definition)}},xN=wN,kN=mo(xN,bN,yN,!1,null,null,null),CN=kN.exports,SN=er(er({},e),{},{component:CN,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:Ds}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new PC(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),EN=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":[]}'),AN=[Id,Am,Rm,Wa,gf,Vf,oN,Bf,Wf,Bc,Wc,sl,Kc,vl,Al,Bs,vN,SN,sg,Um,em],_N=[[Ud,"bpmn:StartEvent","bpmn:SignalEventDefinition"],[Cu,"bpmn:StartEvent","bpmn:TimerEventDefinition"],[Yd,"bpmn:StartEvent","bpmn:MessageEventDefinition"],[lN,"bpmn:StartEvent","bpmn:ConditionalEventDefinition"],[fh,"bpmn:IntermediateCatchEvent","bpmn:TimerEventDefinition"],[Dh,"bpmn:IntermediateCatchEvent","bpmn:MessageEventDefinition"],[Hh,"bpmn:IntermediateCatchEvent","bpmn:SignalEventDefinition"],[Zh,"bpmn:IntermediateThrowEvent","bpmn:MessageEventDefinition"],[ip,"bpmn:IntermediateThrowEvent","bpmn:SignalEventDefinition"],[mp,"bpmn:IntermediateCatchEvent","bpmn:ConditionalEventDefinition"],[Mw,"bpmn:BoundaryEvent","bpmn:TimerEventDefinition"],[qy,"bpmn:BoundaryEvent","bpmn:ErrorEventDefinition"],[ow,"bpmn:BoundaryEvent","bpmn:EscalationEventDefinition"],[uw,"bpmn:BoundaryEvent","bpmn:MessageEventDefinition"],[yw,"bpmn:BoundaryEvent","bpmn:SignalEventDefinition"],[Jy,"bpmn:BoundaryEvent","bpmn:ConditionalEventDefinition"],[Vl,"bpmn:EndEvent","bpmn:MessageEventDefinition"],[uc,"bpmn:EndEvent","bpmn:ErrorEventDefinition"],[sd,"bpmn:EndEvent","bpmn:SignalEventDefinition"],[yc,"bpmn:EndEvent","bpmn:TerminateEventDefinition"]],MN=function(e,t,n){return function(o){var r=o.get("eventDefinitions"),i=o.$type===t&&r&&r.length&&r[0].$type===n;if(i)return e.id}};function TN(e){var t=e.registerNode,n=e.registerBpmnExtension;_N.forEach((function(e){var n=jt(e,3),o=n[0],r=n[1],i=n[2];t(o,MN(o,r,i))})),AN.forEach((function(e){return t(e)})),n("pm",EN)}}(),m}()}));
34
+ function Ut(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:o});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[o].concat(e.init):o,n.call(this,e)}}function o(){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:{},Ht=qt.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Vt(e){Ht&&(e._devtoolHook=Ht,Ht.emit("vuex:init",e),Ht.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){Ht.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){Ht.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 o=Array.isArray(e)?[]:{};return t.push({original:e,copy:o}),Object.keys(e).forEach((function(n){o[n]=Gt(e[n],t)})),o}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 o in n.modules){if(!t.getChild(o))return void 0;en(e.concat(o),t.getChild(o),n.modules[o])}}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 o=this;void 0===n&&(n=!0);var r=new Zt(t,n);if(0===e.length)this.root=r;else{var i=this.get(e.slice(0,-1));i.addChild(e[e.length-1],r)}t.modules&&$t(t.modules,(function(t,r){o.register(e.concat(r),t,n)}))},Qt.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],o=t.getChild(n);o&&o.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 o=e.strict;void 0===o&&(o=!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 r=this,i=this,s=i.dispatch,a=i.commit;this.dispatch=function(e,t){return s.call(r,e,t)},this.commit=function(e,t,n){return a.call(r,e,t,n)},this.strict=o;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&&Vt(this)},on={state:{configurable:!0}};function rn(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 o=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var r=e._wrappedGetters,i={};$t(r,(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),o&&(n&&e._withCommit((function(){o._data.$$state=null})),tn.nextTick((function(){return o.$destroy()})))}function cn(e,t,n,o,r){var i=!n.length,s=e._modules.getNamespace(n);if(o.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=o),!i&&!r){var a=mn(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){tn.set(a,c,o.state)}))}var l=o.context=ln(e,s,n);o.forEachMutation((function(t,n){var o=s+n;un(e,o,t,l)})),o.forEachAction((function(t,n){var o=t.root?n:s+n,r=t.handler||t;hn(e,o,r,l)})),o.forEachGetter((function(t,n){var o=s+n;pn(e,o,t,l)})),o.forEachChild((function(o,i){cn(e,t,n.concat(i),o,r)}))}function ln(e,t,n){var o=""===t,r={dispatch:o?e.dispatch:function(n,o,r){var i=gn(n,o,r),s=i.payload,a=i.options,c=i.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:o?e.commit:function(n,o,r){var i=gn(n,o,r),s=i.payload,a=i.options,c=i.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(r,{getters:{get:o?function(){return e.getters}:function(){return dn(e,t)}},state:{get:function(){return mn(e.state,n)}}}),r}function dn(e,t){if(!e._makeLocalGettersCache[t]){var n={},o=t.length;Object.keys(e.getters).forEach((function(r){if(r.slice(0,o)===t){var i=r.slice(o);Object.defineProperty(n,i,{get:function(){return e.getters[r]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function un(e,t,n,o){var r=e._mutations[t]||(e._mutations[t]=[]);r.push((function(t){n.call(e,o.state,t)}))}function hn(e,t,n,o){var r=e._actions[t]||(e._actions[t]=[]);r.push((function(t){var r=n.call(e,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:e.getters,rootState:e.state},t);return Yt(r)||(r=Promise.resolve(r)),e._devtoolHook?r.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):r}))}function pn(e,t,n,o){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(o.state,o.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))}on.state.get=function(){return this._vm._data.$$state},on.state.set=function(e){0},nn.prototype.commit=function(e,t,n){var o=this,r=gn(e,t,n),i=r.type,s=r.payload,a=(r.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,o.state)})))},nn.prototype.dispatch=function(e,t){var n=this,o=gn(e,t),r=o.type,i=o.payload,s={type:r,payload:i},a=this._actions[r];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 rn(e,this._subscribers,t)},nn.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return rn(n,this._actionSubscribers,t)},nn.prototype.watch=function(e,t,n){var o=this;return this._watcherVM.$watch((function(){return e(o.state,o.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,on);var bn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var o=An(this.$store,"mapState",e);if(!o)return;t=o.context.state,n=o.context.getters}return"function"===typeof r?r.call(this,t,n):t[r]},n[o].vuex=!0})),n})),yn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.commit;if(e){var i=An(this.$store,"mapMutations",e);if(!i)return;o=i.context.commit}return"function"===typeof r?r.apply(this,[o].concat(t)):o.apply(this.$store,[r].concat(t))}})),n})),wn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;r=e+r,n[o]=function(){if(!e||An(this.$store,"mapGetters",e))return this.$store.getters[r]},n[o].vuex=!0})),n})),xn=En((function(e,t){var n={};return Cn(t).forEach((function(t){var o=t.key,r=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.dispatch;if(e){var i=An(this.$store,"mapActions",e);if(!i)return;o=i.context.dispatch}return"function"===typeof r?r.apply(this,[o].concat(t)):o.apply(this.$store,[r].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 o=e._modulesNamespaceMap[n];return o}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 o=e.transformer;void 0===o&&(o=function(e){return e});var r=e.mutationTransformer;void 0===r&&(r=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=r(e),u="mutation "+e.type+a;Mn(l,u,t),l.log("%c prev state","color: #9E9E9E; font-weight: bold",o(d)),l.log("%c mutation","color: #03A9F4; font-weight: bold",c),l.log("%c next state","color: #4CAF50; font-weight: bold",o(s)),Tn(l)}d=s})),c&&e.subscribeAction((function(e,n){if(i(e,n)){var o=Pn(),r=s(e),a="action "+e.type+o;Mn(l,a,t),l.log("%c action","color: #03A9F4; font-weight: bold",r),Tn(l)}})))}}function Mn(e,t,n){var o=n?e.groupCollapsed:e.group;try{o.call(e,t)}catch(r){e.log(t)}}function Tn(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 Nn={Store:nn,install:vn,version:"3.6.2",mapState:bn,mapMutations:yn,mapGetters:wn,mapActions:xn,createNamespacedHelpers:kn,createLogger:_n},Dn=Nn,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(Dn);var Un=new Dn.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,o=t.bounds;o&&Object.entries(o).forEach((function(e){var t=jt(e,2),o=t[0],r=t[1];"$type"!==o&&n.diagram.bounds.set(o,r)}))},updateNodeProp:function(e,t){var n=t.node,o=t.key,r=t.value;"id"==o&&n.definition.id!==r&&e.nodes.some((function(e){return e.definition.id===r}))||(Fn(n.definition,o,r),null==r&&zt()["delete"](n.definition,o))},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))),o=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||!o.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,o,r;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:o=t.sent,r=o.data,n("setGlobalProcesses",r.data),window.ProcessMaker.globalProcesses=r.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",Hn="#FF0000",Vn="#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:Tt,onChangeWasFired:!1}},watch:{target:function(e,t){t&&t!==e&&Dt(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()):(Dt(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:{setHighlightColor:function(e,t){e?(this.shape.attr({line:{stroke:t},".joint-highlight-stroke":{display:"none"}}),this.shapeView.showTools()):(Dt(this.shape),this.shapeView.hideTools())},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 o=this;if(e&&Zn(e))return this.shape[t](e,{anchor:{name:"modelCenter",args:{padding:25}},connectionPoint:{name:"boundary"}});var r=function(){var t=e.position(),o=t.x,r=t.y,i=e.size(),s=i.width,a=i.height;return n?{x:o+n.x,y:r+n.y}:{x:o+s/2,y:r+a/2}};this.shape[t](e,{anchor:function(){return o.getAnchorPointFunction(t)(r(),e.findView(o.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();Dt(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),this.shape.listenTo(this.paper,"link:pointerup",this.pointerUpHandler);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,o,r,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,o=e.linkView.sourceView.model.component.node.definition.id,r=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:o,targetRefId:r}}],window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",i)),e.listeningToMouseleave=!0,e.$emit("save-state");case 7:case"end":return t.stop()}}),t)})))()},pointerUpHandler:function(){var e=this;return l(a().mark((function t(){var n,o,r,i,s;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.onChangeWasFired){t.next=2;break}return t.abrupt("return");case 2:if(n=e.target.id!==e.currentTarget.id,!n){t.next=20;break}if(e.onChangeWasFired=!1,r=$()(e.currentTarget,"component.node"),i=r&&e.nodeRegistry[r.type],s=null===(o=e.isValid)||void 0===o?void 0:o.call(e,{sourceShape:e.sourceShape,targetShape:e.currentTarget,targetConfig:i}),!s){t.next=17;break}return e.setTarget(e.currentTarget),e.target=e.currentTarget,e.updateDefinitionLinks&&e.updateDefinitionLinks(),e.listeningToMouseleave=!0,t.next=15,e.storeWaypoints();case 15:t.next=18;break;case 17:e.setTarget(e.target);case 18:t.next=21;break;case 20:e.setTarget(e.target,e.getAnchorOffset());case 21:case"end":return t.stop()}}),t)})))()},getAnchorOffset:function(){var e=this.node.diagram.waypoint,t=e[e.length-1],n=this.target.position(),o=n.x,r=n.y;return{x:t.x-o,y:t.y-r}},onChangeTargets:function(e,t,n){var o=this;return l(a().mark((function e(){var r;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(o.onChangeWasFired=!0,null===n||void 0===n||!n.ui||!t.id){e.next=15;break}if(r=o.paper.getModelById(t.id),o.currentTarget.id===r.id){e.next=8;break}o.currentTarget=r,o.listeningToMouseleave=!0,e.next=15;break;case 8:return e.next=10,o.$nextTick();case 10:return e.next=12,o.waitForUpdateWaypoints();case 12:return o.listeningToMouseleave=!1,e.next=15,o.storeWaypoints();case 15:case"end":return e.stop()}}),e)})))()},onChangeVertices:function(e,t,n){var o=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 o.updateWaypoints(),e.next=4,o.$nextTick();case 4:o.listeningToMouseleave=!1,o.$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,o=e.clientY,r=this.paper.clientToLocalPoint({x:n,y:o});if(this.target=this.graph.findModelsFromPoint(r).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:r.x,y:r.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"),Dt(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&&Dt(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")}),o=new F.dia.ToolsView({tools:[e,t,n]});"processmaker-modeler-sequence-flow"===this.shape.component.node.type&&(o=new F.dia.ToolsView({tools:[e,t,n,new F.linkTools.TargetArrowhead]})),this.currentTarget=this.shape.getTargetElement(),this.shapeView.addTools(o),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,o,r,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?(o=e.graph.getElements().find((function(e){return e.component&&e.component.node.definition===n})),e.target=o,r=e.node.diagram.waypoint,i=e.node.diagram.waypoint[0],s=r[r.length-1],c=o.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},r&&(g=r.slice(1,r.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(o,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",eo="processmaker-modeler-association",to="bpmn:Association",no={none:"None",one:"One",both:"Both"};function oo(e){return e.create(to,{associationDirection:no.none,targetRef:{x:void 0,y:void 0}})}function ro(e){return e.create("bpmndi:BPMNEdge")}var io=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()},so=[],ao=(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()}),co=[],lo=(f(85827),f.p+"img/trash-alt-solid.9d41abd9.svg"),uo=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)},ho=[],po={props:{id:String,ariaLabel:String,src:String,width:{type:Number,default:19},height:{type:Number,default:20}}},fo=po;f(21353);function mo(e,t,n,o,r,i,s,a){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),o&&(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__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):r&&(c=a?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),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 go=mo(fo,uo,ho,!1,null,"09d8a8ac",null),vo=go.exports,bo=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask"],yo=bo,wo={components:{CrownButton:vo},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lo,validPreviewElements:yo,displayIcon:!1}},mounted:function(){var e=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return e[o]=r,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)}}},xo=wo,ko=mo(xo,ao,co,!1,null,null,null),Co=ko.exports,So=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"})])},Eo=[],Ao=f(50467),_o=f.n(Ao),Mo="processmaker-modeler-data-output-association",To="bpmn:DataOutputAssociation";function Po(e){return e.create("bpmn:DataOutputAssociation",{targetRef:{x:void 0,y:void 0}})}function Io(e){return e.create("bpmndi:BPMNEdge")}var Oo="processmaker-modeler-data-input-association",No="bpmn:DataInputAssociation";function Do(e){return e.create("bpmn:DataInputAssociation",{targetRef:{x:void 0,y:void 0}})}function Ro(e){return e.create("bpmndi:BPMNEdge")}function Bo(e,t){var n=this,o=e.getConnectedLinks(t);o.forEach((function(e){return n.$emit("remove-node",e.component.node)}))}function Lo(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 jo(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 Fo(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 zo(e,t,n){var o=e.getCells().find((function(e){return e.component&&e.component.node===t}));o&&o.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 Uo(e){if(!e.isBpmnType(To,No)){var t=e.definition,n=t.sourceRef,o=t.targetRef;n&&(0,Ao.pull)(n.get("outgoing"),e.definition),o&&o.id&&(0,Ao.pull)(o.get("incoming"),e.definition)}}function qo(e){var t=(0,Ao.get)(e,"definition.sourceRef.default.id",null);t&&t===e.id&&e.definition.sourceRef.set("default",null)}function Ho(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 o=n.id,r="data_input_".concat(o);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===r}));i||(t.definition.ioSpecification.dataInputs.push(e.create("bpmn:DataInput",{id:r,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===r})),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===r}));return c||a.dataInputRefs.push(i),i}function Vo(e,t){var n,o=e.$parent;return o||(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 Wo(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,o="data_input_".concat(n);if(e.definition.ioSpecification&&e.definition.ioSpecification.dataInputs){var r=e.definition.ioSpecification.dataInputs.find((function(e){return e.id===o}));if(r&&((0,Ao.pull)(e.definition.ioSpecification.dataInputs,r),e.definition.ioSpecification.inputSets)){var i=e.definition.ioSpecification.inputSets[0];if(i){var s=i.dataInputRefs.find((function(e){return e.id===o}));if(s&&(0,Ao.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 Go={components:{CrownButton:vo},props:{graph:Object,shape:Object,node:Object},data:function(){return{trashIcon:lo}},computed:{isPoolLane:function(){return"processmaker-modeler-lane"===this.node.type}},methods:{removeFlows:Bo,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)}}},$o=Go,Xo=mo($o,So,Eo,!1,null,null,null),Yo=Xo.exports,Jo=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()},Zo=[],Ko=f.p+"img/connect-elements.ab6af00f.svg";f(38880),f(49337);function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function er(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qo(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}f(15306);var tr={"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"},nr=tr,or={"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"},rr=or,ir={"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"},sr=ir,ar={"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"},cr=ar,lr={"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"},dr=lr,ur=f(50361),hr=f.n(ur),pr=function(){function e(t,n,o){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=o}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(nr).includes(this.type)}},{key:"isEndEvent",value:function(){return Object.keys(rr).includes(this.type)}},{key:"isTask",value:function(){return Object.keys(sr).includes(this.type)}},{key:"isGateway",value:function(){return Object.keys(cr).includes(this.type)}},{key:"isIntermediateEvent",value:function(){return Object.keys(dr).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,o,r=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 o=t.get("id");o.substring(0,r.cloneOf.length)===r.cloneOf?(t.set("id",o.replace(r.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,r.cloneOf.length)===r.cloneOf?(t.set("id",n.replace(r.cloneOf+"_",l+"_")),o=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&&o&&this.definition.loopCharacteristics.set("loopDataOutputRef",o),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,o){var r=this,i=t[this.type].definition(n,o),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]=r.diagram.bounds[e]})),Object.keys(this.definition).filter((function(t){return!e.definitionPropertiesToNotCopy.includes(t)})).forEach((function(e){var t=r.definition.get(e),n="object"===s(t)?hr()(t):t;if("eventDefinitions"===e)for(var o in n)t[o].signalRef&&!n[o].signalRef&&n[o].set("signalRef",er({},t[o].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,o){var r=this,i=t[this.type].definition(n,o),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=r.definition.get(e),n="object"===s(t)?hr()(t):t;if("eventDefinitions"===e)for(var o in n)t[o].signalRef&&!n[o].signalRef&&n[o].set("signalRef",er({},t[o].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(pr,"diagramPropertiesToCopy",["x","y","width","height"]),y(pr,"definitionPropertiesToNotCopy",["$type","id","dataOutputAssociations"]),y(pr,"flowDefinitionPropertiesToNotCopy",["$type","id","sourceRef","targetRef"]),y(pr,"eventDefinitionPropertiesToNotCopy",["errorRef","messageRef"]);var fr="processmaker-modeler-generic-flow",mr=f(65554),gr={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"]},vr={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"]},br={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"]},yr={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"]},wr={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"]},xr={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"]},kr={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"]},Cr={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"]},Sr={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"]},Er={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"]},Ar={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"]},_r={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"]},Mr=f(39865),Tr=["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"],Pr={components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},props:["node","moddle","nodeRegistry"],data:function(){return{sequenceFlow:Ko}},computed:{paper:function(){return Un.getters.paper},sequenceFlowConfig:function(){return this.nodeRegistry[fr]},nodeConfig:function(){return this.nodeRegistry[this.node.type]},allowOutgoingSequenceFlow:function(){var e=this;return!Tr.some((function(t){return e.node.isType(t)}))}},methods:{addSequence:function(e,t,n,o){this.$emit("toggle-crown-state",!1);var r=e.clientX,i=e.clientY,s=null;e&&(s=(0,F.V)(this.paper.viewport).toLocalPoint(r,i));var a=this.moddle.create("bpmn:SequenceFlow",{name:"",sourceRef:this.node.definition,targetRef:{x:n||s.x,y:o||s.y}});this.$emit("add-node",new pr(fr,a,this.moddle.create("bpmndi:BPMNEdge")))}},created:function(){this.$t=this.$t.bind(this),mr.library.add(vr)}},Ir=Pr,Or=mo(Ir,Jo,Zo,!1,null,null,null),Nr=Or.exports,Dr=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()},Rr=[],Br=f.p+"img/connect-artifacts.e3e5e73f.svg",Lr={components:{CrownButton:vo},props:["node","moddle","shape"],data:function(){return{connectIcon:Br}},methods:{addAssociation:function(e,t,n,o){this.$emit("toggle-crown-state",!1);var r=this.moddle.create("bpmn:Association",{sourceRef:this.shape.component.node.definition,targetRef:{x:n,y:o},associationDirection:no.none});this.$emit("add-node",new pr("processmaker-modeler-association",r,this.moddle.create("bpmndi:BPMNEdge")))}}},jr=Lr,Fr=mo(jr,Dr,Rr,!1,null,null,null),zr=Fr.exports,Ur=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()},qr=[];function Hr(e,t){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hr(e,t)}function Vr(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&&Hr(e,t)}f(12419),f(81299);function Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wr(e)}function Gr(){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 $r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xr(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 $r(e)}function Yr(e){var t=Gr();return function(){var n,o=Wr(e);if(t){var r=Wr(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Xr(this,n)}}var Jr="processmaker-modeler-pool",Zr=function(){function e(t,n,o){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=o}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 o=e.shapeIsPool(t)?t:t.component.node.pool,r=e.shapeIsPool(n)?n:n.component.node.pool;return null!=r&&r!==o}},{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===Jr}}]),e}(),Kr=function(e){Vr(n,e);var t=Yr(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}(Zr);y(Kr,"dataNodeTypes",["bpmn:DataStoreReference","bpmn:DataObjectReference"]),y(Kr,"disallowedNodes",["bpmn:EndEvent","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation","bpmn:Association"]);var Qr={components:{CrownButton:vo},props:["node","moddle","shape"],data:function(){return{connectIcon:Br}},computed:{paper:function(){return Un.getters.paper},allowOutgoingDataAssociationFlow:function(){return Kr.isADataNode(this.node)}},methods:{addDataAssociation:function(n,o,r){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 pr(l.id,d,l.diagram(this.moddle));u.dataAssociationProps={sourceShape:this.shape,targetCoords:{x:o||a.x,y:r||a.y}},this.$emit("add-node",u)}}},ei=Qr,ti=mo(ei,Ur,qr,!1,null,null,null),ni=ti.exports,oi=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()},ri=[],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:vo},props:["node"],data:function(){return{copyCount:0,copyIcon:ii,validCopyElements:ai}},methods:{copyElement:function(){this.$emit("copy-element")}}},li=ci,di=mo(li,oi,ri,!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:vo},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=mo(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 o=n.label,r=n.nodeType,i=n.dataTest,s=n.disabled;return t("li",{key:r,staticClass:"element-list--item",attrs:{role:"listitem",id:r}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:e.isDisabled(s,e.node,r)},on:{click:function(t){return e.replaceNode({node:e.node,typeToReplaceWith:r})}}},[e._v(e._s(e.$t(o))+" ")]),e.isDisabled(s,e.node,r)?t("b-tooltip",{attrs:{target:r,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.$t(e.tooltip(s,e.node,r)))+" ")]):e._e()],1)})),0):e._e()],1):e._e()},ki=[],Ci={name:"CrownTaskDropdown",components:{CrownButton:vo},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),mo(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 o=n.label,r=n.nodeType,i=n.dataTest,s=n.disabledLabel;return t("li",{key:r,staticClass:"element-list--item",attrs:{role:"listitem",id:r}},[t("button",{staticClass:"element-list--item__button",attrs:{"data-test":i,type:"button",disabled:!e.canAddBoundaryEventToTarget(r,e.shape)},on:{click:function(t){return e.addBoundaryEvent(r)}}},[e._v(e._s(e.$t(o))+" ")]),e.canAddBoundaryEventToTarget(r,e.shape)?e._e():t("b-tooltip",{attrs:{target:r,variant:"warning",placement:"right"}},[e._v(" "+e._s(e.getErrorTooltipText(s))+" ")])],1)})),0):e._e()],1):e._e()},Mi=[],Ti=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))&&Di(t)}function Ni(e){return e&&e.node.isBpmnType("bpmn:CallActivity")}function Di(e){return 0!==Nt(e).length}var Ri={name:"CrownBoundaryEventDropdown",components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},props:{dropdownOpen:{type:Boolean,required:!0},dropdownData:Array,nodeRegistry:Object,moddle:Object,node:Object,shape:Object},data:function(){return{boundaryEventIcon:Ti}},methods:{getErrorTooltipText:function(e){return 0===this.getEmptyBoundaryEventPositionsForShape(this.shape).length?"No available space":e},canAddBoundaryEventToTarget:Oi,getEmptyBoundaryEventPositionsForShape:Nt,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),o=Nt(this.shape)[0];n.bounds.x=o.x-n.bounds.width/2,n.bounds.y=o.y-n.bounds.height/2;var r=new pr(e,t,n);r.pool=this.node.pool,r.fromCrown=!0,Un.commit("highlightNode",r),this.$emit("add-node",r)}}},created:function(){this.$t=this.$t.bind(this),mr.library.add(gr)}},Bi=Ri,Li=(f(56073),mo(Bi,_i,Mi,!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)},Hi=[],Vi=(f(64765),f(69600),f(42238)),Wi=f.n(Vi),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,o=Object.entries(Wi());n<o.length;n++){var r=jt(o[n],2),i=r[0],s=r[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 o=jt(n[t],2),r=o[0],i=o[1];$i.includes(r)||(Gi.includes(r)&&e[0].icons.push(this.parseIcon(r,i)),this.shouldIncludeIcon(r,i)&&e[1].icons.push(this.parseIcon(r,i)))}return e}},{key:"shouldIncludeIcon",value:function(e,t){var n=!1,o=["-left","-right","-up","-down"];return $i.includes(e)||Gi.includes(e)||t.styles.includes("solid")&&!t.changes.includes("5.13.0")&&(n=!0),o.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),mo(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,os=(f(18785),mo(ns,qi,Hi,!1,null,null,null)),rs=os.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:vo,"sketch-picker":Ui.Sketch,IconSelector:rs},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,n,o,r,i;Un.commit("updateNodeProp",{node:this.node,key:"color",value:e}),zt().set(this.node.definition,"color",e),this.$emit("save-state");var s={id:this.node.definition.id,properties:{color:this.node.definition.color,x:null===(t=this.node.diagram.bounds)||void 0===t?void 0:t.x,y:null===(n=this.node.diagram.bounds)||void 0===n?void 0:n.y,height:null===(o=this.node.diagram.bounds)||void 0===o?void 0:o.height,width:null===(r=this.node.diagram.bounds)||void 0===r?void 0:r.width,type:this.node.type,id:this.node.definition.id,attachedToRefId:null===(i=this.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[s])},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,mr.icon)({prefix:"fas",iconName:e}),n=t.html,o=btoa(n);Un.commit("updateNodeProp",{node:this.node,key:"customIcon",value:o}),zt().set(this.node.definition,"customIcon",o),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),mr.library.add(is.fas)}},as=ss,cs=(f(69309),mo(as,Fi,zi,!1,null,"16c02990",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),mo(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:vo},props:["node"],data:function(){return{icon:gs}},methods:{click:function(){this.$emit("default-flow",this.node)}}},bs=vs,ys=mo(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:Co,DeleteButton:Yo,GenericFlowButton:Nr,AssociationFlowButton:zr,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)},shape:function(){this.highlighted&&(this.showCrown=!0)}},data:function(){return{runningInCypressTest:Ss(),showCrown:!1,savePositionOnPointerupEventSet:!1,style:null,taskDropdownInitiallyOpen:!1,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,o=t.stroke;Ze(this.shape,n,o)},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,o=t.y,r=t.width;this.style={top:"".concat(o-52,"px"),left:"".concat(n+r-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),mo(As,io,so,!1,null,null,null)),Ms=_s.exports,Ts={components:{CrownConfig:Ms},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:no}},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 o=this.targetConfig.validateAssociationIncoming&&!this.targetConfig.validateAssociationIncoming(this.sourceNode),r=this.sourceConfig.validateAssociationOutgoing&&!this.sourceConfig.validateAssociationOutgoing(this.targetNode);return!o&&!r}},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=Ts,Is=mo(Ps,L,j,!1,null,null,null),Os=Is.exports,Ns={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]*$/"},Ds=Ns,Rs=function(){function e(t,n,o){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=o}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=ro(this.moddle),i=oo(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var s=new pr(eo,i,r);return s}}]),e}(),Bs={id:eo,component:Os,bpmnType:to,control:!1,definition:oo,diagram:ro,inspectorConfig:[{name:"Data Association",items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-association"},items:[{component:"FormInput",config:Ds},{component:"FormSelect",config:{label:"Direction",helper:"Select Direction",name:"associationDirection",options:[{value:"".concat(no.none),content:"None"},{value:"".concat(no.one),content:"One"},{value:"".concat(no.both),content:"Both"}]}}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new Rs(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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 Hs(e,t){var n=t.size(),o=n.width,r=n.height;for(var i in e)Ws(t,i,o),Gs(t,i,r),$s(t,i,e,o)}function Vs(e,t){var n=e.attr(t);return void 0===n?qs:n}function Ws(e,t,n){var o=Vs(e,t+"/ref-padding-x");-1!==t.indexOf("Right")?e.attr(t+"/ref-x",n-Us-o):-1!==t.indexOf("Left")&&e.attr(t+"/ref-x",o+(Ys(e)?16:0))}function Gs(e,t,n){var o=Vs(e,t+"/ref-padding-y");-1!==t.indexOf("bottom")&&e.attr(t+"/ref-y",n-Us-o)}function $s(e,t,n,o){for(var r=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+"."+r+"/xlink:href",n[t][a]),r++,r>=zs)break;e.attr(t+"/ref-width",Us*r),-1!==t.indexOf("Center")&&e.attr(t+"/ref-x",(o-r*Us)/2)}function Xs(e,t){if("bottomCenter"===t){var n={};return Object.keys(e[t]).sort().forEach((function(o){n[o]=e[t][o]})),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,o={};o[e]=t;for(var r=0;r<Js;r++)o[e+"."+r]={"ref-x":r*Zs*n,"ref-y":0,width:Zs,height:Zs};return o}var ea,ta,na,oa,ra,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(){Hs(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:er(er(er(er(er(er({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:Hn,"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:Vn,"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:{prepareCustomColorHighlighter:function(e){return{highlighter:{name:"stroke",options:{attrs:{stroke:e,"stroke-width":3,"data-cy":"selected"}},partial:!1,type:"default"}}},setHighlightColor:function(e,t){this.shapeView&&(e?(this.shapeView.unhighlight(this.shapeBody,ga),this.shapeView.highlight(this.shapeBody,this.prepareCustomColorHighlighter(t))):this.shapeView.unhighlight(this.shapeBody,this.prepareCustomColorHighlighter(t)))},setAiStatusHighlight:function(e){this.shapeView.unhighlight(this.shapeBody,ba),"generated"===e&&(this.shape.attr("body/fill",Yn),this.shapeView.highlight(this.shapeBody,ba)),this.shapeView.unhighlight(this.shapeBody,ya),"generating"===e&&(this.shape.attr("body/fill",Wn),this.shapeView.highlight(this.shapeBody,ya)),this.shapeView.unhighlight(this.shapeBody,wa),"previously generated"===e&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa))},unsetHighlights:function(){this.shape.attr("body/fill","#FFFFFF"),this.shapeView.unhighlight(this.shapeBody,ya),this.shapeView.unhighlight(this.shapeBody,ba),this.shapeView.unhighlight(this.shapeBody,wa)},setShapeHighlightForReadOnly:function(){this.shapeView&&(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)),this.isIdle&&(this.shape.attr("body/fill",$n),this.shapeView.highlight(this.shapeBody,wa)))},setShapeHighlightForDefault:function(){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))},setShapeHighlight:function(){this.shapeView&&(this.shapeView.unhighlight(this.shapeBody,ga),Un.getters.isReadOnly?this.setShapeHighlightForReadOnly():this.setShapeHighlightForDefault())},setBorderOutline:function(e){this.currentBorderOutline&&this.shapeView.unhighlight(this.shapeBody,this.currentBorderOutline),this.currentBorderOutline=e?hr()(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:Ms},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:rr["processmaker-modeler-end-event"],nodeType:"processmaker-modeler-end-event"},{label:rr["processmaker-modeler-message-end-event"],nodeType:"processmaker-modeler-message-end-event",dataTest:"switch-to-message-end-event"},{label:rr["processmaker-modeler-error-end-event"],nodeType:"processmaker-modeler-error-end-event",dataTest:"switch-to-error-end-event"},{label:rr["processmaker-modeler-signal-end-event"],nodeType:"processmaker-modeler-signal-end-event",dataTest:"switch-to-signal-end-event"},{label:rr["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=mo(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,Ma=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)},Ta=[],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=mo(Ia,Ma,Ta,!1,null,null,null),Na=Oa.exports,Da={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"advanced-accordion"},items:[{component:Na,config:Ds}]},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),mo(za,Ra,Ba,!1,null,null,null)),qa=Ua.exports,Ha={component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Documentation",icon:"book",name:"documentation-accordion"},items:[{component:qa,config:{label:"Description",name:"documentation",helper:""}}]},Va="processmaker-modeler-end-event",Wa={id:Va,component:Ea,bpmnType:"bpmn:EndEvent",control:!0,category:"BPMN",icon:f(48807),label:rr[Va],rank:30,items:[{icon:f(48807),label:rr[Va],control:!0,rank:31,id:"processmaker-modeler-end-event"},{icon:f(52080),label:rr["processmaker-modeler-message-end-event"],control:!0,rank:32,id:"processmaker-modeler-message-end-event"},{icon:f(95093),label:rr["processmaker-modeler-error-end-event"],control:!0,rank:33,id:"processmaker-modeler-error-end-event"},{icon:f(96425),label:rr["processmaker-modeler-signal-end-event"],control:!0,rank:34,id:"processmaker-modeler-signal-end-event"},{icon:f(47616),label:rr["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(rr[Va])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36,x:null,y:null})})},inspectorConfig:[{name:rr[Va],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-end-event"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},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"),o=n.querySelectorAll('*[fill]:not([fill="none"])'),r=n.querySelectorAll('*[stroke]:not([stroke="none"])');return o.forEach((function(e){e.setAttribute("fill",t)})),r.forEach((function(e){e.setAttribute("stroke",t)})),n.documentElement.outerHTML},Ka=function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/,o=/<svg[^>]*>/,r=e.startsWith("<xml")&&/<svg[^>]*>/.test(e);return"string"===typeof e&&(t.test(e)||n.test(e)||o.test(e)||r)},Qa=function(e,t){if(!Ka(e)){mr.library.add(is.fas,Xa.fab);var n=e.split(" "),o=jt(n,1),r=o[0],i=e.split("-"),s=jt(i,2),a=s[1],c=(0,mr.findIconDefinition)({prefix:r,iconName:a}),l=(0,mr.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)}},oc=nc,rc=mo(oc,ea,ta,!1,null,null,null),ic=rc.exports,sc=f(82492),ac=f.n(sc),cc=f(57557),lc=f.n(cc),dc="processmaker-modeler-error-end-event",uc=ac()(hr()(Wa),{id:dc,component:ic,control:!1,label:rr[dc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[dc]),eventDefinitions:[e.create("bpmn:ErrorEventDefinition")]})},inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return"eventDefinitions"===o?e.errorName=r[0].get("errorRef").name:e[o]=r,e}),{})},inspectorHandler:function(e,t,n){for(var o in lc()(e,["$type","eventDefinitions","errorName"]))t.definition[o]!==e[o]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]}),n(t,o,e[o]));var r=t.definition.get("eventDefinitions")[0].errorRef;r.name!==e.errorName&&(r.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 o=Object.keys(t).filter((function(e){return"id"!==e}));if("eventDefinitions"!==o[0])n(e,o[0],t[o[0]]);else{var r=t[o[0]][0].errorRef,i=e.definition.get("eventDefinitions")[0].errorRef;r&&i&&r.name!==i.name&&(i.name=r.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=mo(mc,na,oa,!1,null,null,null),vc=gc.exports,bc="processmaker-modeler-terminate-end-event",yc=ac()(hr()(Wa),{id:bc,component:vc,control:!1,label:rr[bc],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[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:Ms},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:cr["processmaker-modeler-exclusive-gateway"],nodeType:"processmaker-modeler-exclusive-gateway"},{label:cr["processmaker-modeler-inclusive-gateway"],nodeType:"processmaker-modeler-inclusive-gateway",dataTest:"switch-to-inclusive-gateway"},{label:cr["processmaker-modeler-parallel-gateway"],nodeType:"processmaker-modeler-parallel-gateway",dataTest:"switch-to-parallel-gateway"},{label:cr["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=mo(Ac,wc,xc,!1,null,null,null),Mc=_c.exports,Tc=f(4074),Pc=f.n(Tc),Ic={extends:Mc,mixins:[tc],data:function(){return{nodeIcon:Pc()}}},Oc=Ic,Nc=mo(Oc,ra,ia,!1,null,null,null),Dc=Nc.exports,Rc="processmaker-modeler-exclusive-gateway",Bc={id:Rc,component:Dc,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(cr[Rc])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[Rc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-exlcusive-gateway"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},Lc=f(62635),jc=f.n(Lc),Fc={diverging:"Diverging",converging:"Converging"},zc={extends:Mc,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=mo(Uc,sa,aa,!1,null,null,null),Hc=qc.exports,Vc="processmaker-modeler-inclusive-gateway",Wc={id:Vc,component:Hc,bpmnType:"bpmn:InclusiveGateway",control:!1,category:"BPMN",label:cr[Vc],definition:function(e,t){return e.create("bpmn:InclusiveGateway",{name:t(cr[Vc]),gatewayDirection:Fc.diverging})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[Vc],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-inclusive-gateway-config"},items:[{component:"FormInput",config:_a}]},Ha,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-inclusive-gateway-advanced"},items:[{component:"FormInput",config:Ds},{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:Mc,mixins:[tc],data:function(){return{nodeIcon:$c()}},watch:{"node.definition":{deep:!0,immediate:!0,handler:function(){delete this.node.definition.default}}}},Yc=Xc,Jc=mo(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}]},Ha,{component:"FormAccordion",container:!0,config:{initiallyOpen:!1,label:"Advanced",icon:"cogs",name:"inspector-accordion-parallel-gateway-direction"},items:[{component:"FormInput",config:Ds},{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:Mc,mixins:[tc],data:function(){return{nodeIcon:el()}}},nl=tl,ol=mo(nl,da,ua,!1,null,null,null),rl=ol.exports,il="processmaker-modeler-event-based-gateway",sl={id:il,component:rl,bpmnType:"bpmn:EventBasedGateway",control:!1,category:"BPMN",label:cr[il],definition:function(e,t){return e.create("bpmn:EventBasedGateway",{name:t(cr[il])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:36,width:36})})},inspectorConfig:[{name:cr[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"}}]},Ha,Da]}]},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){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=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),r.waypoint=n.map((function(e){return o.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 pr("processmaker-modeler-sequence-flow",i,r)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,o=e.targetShape,r=e.targetConfig,i=$()(o,"component.node"),s=$()(t,"component.node");return Zr.hasTargetType(o)&&Zr.targetIsNotSource(s,i)&&n.targetIsNotALane(i)&&n.targetIsInSamePool(t,o)&&n.eventBasedGatewayTarget(s,i)&&n.isValidSource(t,r)&&n.sourceIsNotPool(s)&&!Kr.isADataNode(s)&&!Kr.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,o=e.component.node.pool;return!o||o===n}},{key:"targetIsNotSource",value:function(e,t){return t.id!==e.id}},{key:"eventBasedGatewayTarget",value:function(e,t){var n=e.isBpmnType("bpmn:EventBasedGateway"),o=t.isBpmnType("bpmn:IntermediateCatchEvent");return!n||o}},{key:"sourceIsNotPool",value:function(e){return!e.isType("processmaker-modeler-pool")}}]),n}(Zr),hl={components:{CrownConfig:Ms},props:["graph","node","id","highlighted","nodeRegistry","moddle","paper","collaboration","processNode","planeElements","isRendering"],mixins:[xa,Kn],data:function(){return{shape:null}},computed:{isValidConnection:function(){return this.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:{isValid:function(e){return ul.isValid(e)},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=mo(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),o=n[0],r=n[1];return e[o]="conditionExpression"===o?r.body:r,e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition,i=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(r.sourceRef.$type);for(var s in e)if(r[s]!==e[s])if("conditionExpression"===s&&i){if(r[s].body!==e[s]){var a=o.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,o){var r=Object.keys(t).filter((function(e){return"id"!==e}));if(0!==r.length)if("conditionExpression"!==r[0])n(e,r[0],t[r[0]]);else{var i=o.create("bpmn:FormalExpression",{body:t[r[0]][0].body});n(e,r[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:er(er({},_a),{},{validation:null})}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new ul(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=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),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)})),new pr("processmaker-modeler-message-flow",i,r)}}],[{key:"isValid",value:function(e){var t=e.sourceShape,o=e.targetShape,r=e.sourceConfig,i=$()(o,"component.node"),s=$()(t,"component.node");return Zr.hasTargetType(o)&&n.isValidTargetType(i)&&Zr.targetIsValidStartEventType(i)&&Zr.targetIsValidIntermediateEventType(i)&&Zr.targetIsValidBoundaryEventType(i)&&Zr.targetIsNotContainingPool(o,s)&&Zr.targetIsInDifferentPool(o,t)&&Zr.targetIsNotSource(i,s)&&Zr.allowOutgoingFlow(r,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}(Zr),xl={components:{CrownConfig:Ms},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=mo(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}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new wl(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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),Ml=f.n(_l),Tl={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:Ml()}},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=Tl,Il=mo(Pl,ha,pa,!1,null,null,null),Ol=Il.exports,Nl=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)},Dl=[],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(o){"bpmn:MessageEventDefinition"===o.$type&&o.messageRef&&o.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,Ao.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,Ao.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,Ao.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}}),Bl=Rl,Ll=(f(53030),f(54061),mo(Bl,Nl,Dl,!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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=r[0].get("messageRef");e.messageRef=i?i.id:""}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o,r){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=r.rootElements.find((function(t){return t.id===e.messageRef}));!a&&e.messageRef&&(a=o.create("bpmn:Message",{id:e.messageRef,name:e.messageRef}),r.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")}})}},Hl="processmaker-modeler-message-end-event",Vl=ac()(hr()(Wa),er(er({},ql),{},{id:Hl,component:Ol,control:!1,label:rr[Hl],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[Hl]),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=mo(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(o){"bpmn:SignalEventDefinition"===o.$type&&o.signalRef&&o.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,Ao.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,Ao.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,Ao.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,Ao.get)(n,t.trackBy)==e})),e&&!this.selectedOption&&this.loadSelected(e)}}}},ed=Ql,td=(f(59244),f(34924),mo(ed,Zl,Kl,!1,null,"607e6d70",null)),nd=td.exports;function od(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 rd={inspectorData:function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];if("eventDefinitions"===o){var i=r[0].get("signalRef");e.signalRef=i?i.id:""}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o,r){var i;for(var s in lc()(e,["$type","eventDefinitions","signalRef"]))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=r.rootElements.find((function(t){return t.id===e.signalRef}));!a&&e.signalRef&&(a=o.create("bpmn:Signal",{id:e.signalRef,name:e.signalRef}),r.rootElements.push(a)),t.definition.get("eventDefinitions")[0].signalRef=a,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"signalRef",value:e.signalRef,extras:{signalName:null===(i=a)||void 0===i?void 0:i.name}})}},id="processmaker-modeler-signal-end-event",sd=ac()(hr()(Wa),er(er({},rd),{},{id:id,component:Jl,control:!1,label:rr[id],definition:function(e,t){return e.create("bpmn:EndEvent",{name:t(rr[id]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("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:Ms},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:nr["processmaker-modeler-start-event"],nodeType:"processmaker-modeler-start-event",dataTest:"switch-to-start-event"},{label:nr["processmaker-modeler-start-timer-event"],nodeType:"processmaker-modeler-start-timer-event",dataTest:"switch-to-start-timer-event"},{label:nr["processmaker-modeler-signal-start-event"],nodeType:"processmaker-modeler-signal-start-event",dataTest:"switch-to-signal-start-event"},{label:nr["processmaker-modeler-message-start-event"],nodeType:"processmaker-modeler-message-start-event",dataTest:"switch-to-message-start-event"},{label:nr["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:Ve,fill:He},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=mo(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=mo(Ed,gd,vd,!1,null,null,null),_d=Ad.exports,Md=36,Td={bpmnType:"bpmn:StartEvent",control:!1,category:"BPMN",diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:Md,width:Md,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}]},Ha,Da]}]},Pd="processmaker-modeler-start-event",Id=ac()(hr()(Td),{id:Pd,component:_d,control:!0,icon:f(34954),label:nr[Pd],rank:10,items:[{icon:f(34954),label:nr[Pd],control:!0,bpmnType:"bpmn:StartEvent",rank:10,id:"processmaker-modeler-start-event"},{icon:f(42123),label:nr["processmaker-modeler-message-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:11,id:"processmaker-modeler-message-start-event"},{icon:f(47658),label:nr["processmaker-modeler-conditional-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:12,id:"processmaker-modeler-conditional-start-event"},{icon:f(43762),label:nr["processmaker-modeler-signal-start-event"],control:!0,bpmnType:"bpmn:StartEvent",rank:13,id:"processmaker-modeler-signal-start-event"},{icon:f(8519),label:nr["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(nr[Pd])})}}),Od=f(69766),Nd=f.n(Od),Dd={extends:hd,data:function(){return{nodeIcon:Nd()}},mounted:function(){this.shape.attr({image:{"ref-x":5,"ref-y":3}})}},Rd=Dd,Bd=mo(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()(hr()(Td),er(er({},rd),{},{id:zd,component:Ld,label:nr[zd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[zd]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("Signal that will trigger this start event",!1),{component:"FormInput",config:Fd}]}]}]})),qd=f(47179),Hd=f.n(qd),Vd={extends:hd,data:function(){return{nodeIcon:Hd()}}},Wd=Vd,Gd=mo(Wd,wd,xd,!1,null,null,null),$d=Gd.exports,Xd="processmaker-modeler-message-start-event",Yd=ac()(hr()(Td),er(er({},ql),{},{id:Xd,component:$d,label:nr[Xd],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[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=mo(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)}),ou=[],ru=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,o,r){var i=au(e),s=au(t),a="after"===o?r:"",c="ondate"===o?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,o){var r=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=o,this._selectedWeekdays=r,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?ru.DateTime.fromISO(e).toUTC():e.isLuxonDateTime?e.toUTC():ru.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(o){var r=e.getWeekDayDate(o),i=cu(r,e._endDate,t,e._ends,e._times);n.push(i)})),n.join("|")}},{key:"getWeekDayDate",value:function(e){var t=ru.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:ru.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:ru.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),mo(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:ru.DateTime,expression:null,startDate:ru.DateTime.local().toUTC().toISO(),repeat:"1",periodicity:"week",ends:"never",endDate:ru.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=ru.DateTime.fromISO(e,{zone:"utc"}).set({seconds:0,milliseconds:0}).toUTC().toISO()},setEndDate:function(e){var t=ru.DateTime.fromISO(this.startDate,{zone:"utc"});this.endDate=ru.DateTime.fromISO(e,{zone:"utc"}).set({hours:t.hour,minutes:t.minute,seconds:0,milliseconds:0}).toUTC().toISO()},parseTimerConfig:function(e){var t,n=this;if(null!==(t=e[0])&&void 0!==t&&null!==(t=t.timeCycle)&&void 0!==t&&t.body)try{var o=!1,r=e[0].timeCycle.body.split("|");r.forEach((function(e){if("R"!==e.substr(0,1))n.startDate=e,o=!0;else{var t=e.match(/R(\d*)\/([^/]+)\/P(\d+)(\w)(?:\/([^/]+))?/);if(t){if(n.times=t[1]||"1",n.repeat=t[3],n.periodicity=Object.keys(vu).find((function(e){return vu[e]===t[4]})),o||(n.startDate=t[2],o=!0),n.isWeeklyPeriodSelected()){var r=ru.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.selectedWeekdays.push(r)}n.endDate=t[5]||ru.DateTime.local().toUTC().toISO(),n.ends=t[5]?"ondate":t[1]?"after":"never"}}o=!0}))}catch(i){this.resetTimerExpression()}},resetTimerExpression:function(){this.startDate=ru.DateTime.local().toUTC().toISO(),this.times="1",this.repeat="1",this.periodicity="week",this.endDate=ru.DateTime.local().toUTC().toISO(),this.ends="never",this.expression=null,this.selectedWeekdays=[]}}},yu=bu,wu=(f(33383),f(66667),mo(yu,nu,ou,!1,null,"72709fd0",null)),xu=wu.exports,ku="processmaker-modeler-start-timer-event",Cu=ac()(hr()(Td),{id:ku,component:tu,label:nr[ku],definition:function(e,t){var n=e.create("bpmn:StartEvent",{name:t(nr[ku])});return n.eventDefinitions=[e.create("bpmn:TimerEventDefinition",{timeCycle:e.create("bpmn:Expression",{body:""})})],n},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var a=e[i];if("object"===s(a))continue;var c=r.get(i)[0].timeCycle;if(c&&c.body===a)continue;var l={timeCycle:o.create("bpmn:Expression",{body:a})},d=[o.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"}}]},Ha,Da]}]}),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:er(er(er(er(er(er({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:Ms},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:dr["processmaker-modeler-intermediate-catch-timer-event"],nodeType:"processmaker-modeler-intermediate-catch-timer-event",dataTest:"switch-to-intermediate-timer-catch-event"},{label:dr["processmaker-modeler-intermediate-signal-catch-event"],nodeType:"processmaker-modeler-intermediate-signal-catch-event",dataTest:"switch-to-intermediate-signal-catch-event"},{label:dr["processmaker-modeler-intermediate-signal-throw-event"],nodeType:"processmaker-modeler-intermediate-signal-throw-event",dataTest:"switch-to-intermediate-signal-throw-event"},{label:dr["processmaker-modeler-intermediate-message-catch-event"],nodeType:"processmaker-modeler-intermediate-message-catch-event",dataTest:"switch-to-intermediate-message-catch-event"},{label:dr["processmaker-modeler-intermediate-message-throw-event"],nodeType:"processmaker-modeler-intermediate-message-throw-event",dataTest:"switch-to-intermediate-message-throw-event"},{label:dr["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}},Mu=_u,Tu=mo(Mu,Su,Eu,!1,null,null,null),Pu=Tu.exports,Iu=f(39653),Ou=f.n(Iu),Nu={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:Ou()}}},Du=Nu,Ru=mo(Du,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),Hu={minute:"minute",hour:"hour",day:"day",week:"week",month:"month"},Vu={props:["value","repeatInput"],data:function(){var e=[{name:Hu.minute,value:"M",isTime:!0},{name:Hu.hour,value:"H",isTime:!0},{name:Hu.day,value:"D"},{name:Hu.week,value:"W"},{name:Hu.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 o=t?Hu.minute:Hu.month;return this.periods.find((function(e){var t=e.name;return t===o}))}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=Vu,Gu=mo(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:ru.DateTime}},props:{value:String},methods:{getTimezone:function(){return"undefined"!==typeof window.ProcessMaker&&window.ProcessMaker.user&&window.ProcessMaker.user.timezone||"local"},convertFromUTC:function(e){return ru.DateTime.fromISO(e,{zone:"utc"}).setZone(this.getTimezone()).toISO()},emitValue:function(e){var t=ru.DateTime.fromISO(e).toUTC().toISO();this.$emit("input",t)}}},Zu=Ju,Ku=mo(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"},oh={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:ru.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 o=ru.DateTime.fromISO(t[2],{zone:"utc"}).toLocal().weekday;n.push(o)}})),n},getPeriodFromDelayString:function(e){var t=this.isTimePeriod(e),n=qu()(e);if("M"===n){var o=t?nh.minute:nh.month;return this.periods.find((function(e){var t=e.name;return t===o}))}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}}},rh=oh,ih=mo(rh,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:ru.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=mo(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(dr[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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=Object.keys(r[0])[1],s=r[0][i].body;e[o]={type:i,body:s}}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=r.get(i)[0][a];if(l&&l.body===c)continue;var d=y({},a,o.create("bpmn:Expression",{body:c})),u=[o.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:dr[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"}}]},Ha,Da]}]};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),Mh={extends:Pu,mixins:[tc],data:function(){return{nodeIcon:_h()}},mounted:function(){var e=mh(Ge,2,We);this.shape.attr(e)}},Th=Mh,Ph=mo(Th,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}]},Ha,Da]}]},Nh="processmaker-modeler-intermediate-message-catch-event",Dh=ac()(hr()(Oh),er(er({},ql),{},{id:Nh,component:Ih,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[Nh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[Nh]),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=mo(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}]},Ha,Da]}]},qh="processmaker-modeler-intermediate-signal-catch-event",Hh=ac()(hr()(Uh),er(er({},rd),{},{id:qh,component:zh,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[qh],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[qh]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("Signal that will catch this intermediate event",!1),{component:"FormInput",config:Fd}]}]}]})),Vh=f(98358),Wh=f.n(Vh),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=mo($h,wh,xh,!1,null,null,null),Yh=Xh.exports,Jh="processmaker-modeler-intermediate-message-throw-event",Zh=ac()(hr()(Oh),er(er({},ql),{},{id:Jh,component:Yh,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:dr[Jh],icon:f(16383),definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(dr[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=mo(tp,kh,Ch,!1,null,null,null),op=np.exports,rp="processmaker-modeler-intermediate-signal-throw-event",ip=ac()(hr()(Uh),er(er({},rd),{},{id:rp,component:op,control:!1,bpmnType:"bpmn:IntermediateThrowEvent",label:dr[rp],definition:function(e,t){return e.create("bpmn:IntermediateThrowEvent",{name:t(dr[rp]),eventDefinitions:[e.create("bpmn:SignalEventDefinition")]})},inspectorConfig:[{items:[{items:[{},od("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=mo(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),o=n[0],r=n[1];return"eventDefinitions"===o?e.condition=r[0].get("condition").body:e[o]=r,e}),{})},inspectorHandler:function(e,t,n){for(var o in lc()(e,["$type","eventDefinitions"]))t.definition[o]!==e[o]&&("condition"===o?(t.definition.get("eventDefinitions")[0].get("condition").body=e[o],window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]})):(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:o,value:e[o]}),n(t,o,e[o])))}},fp="processmaker-modeler-intermediate-conditional-catch-event",mp=ac()(hr()(Uh),er(er({},pp),{},{id:fp,component:up,control:!1,bpmnType:"bpmn:IntermediateCatchEvent",label:dr[fp],definition:function(e,t){return e.create("bpmn:IntermediateCatchEvent",{name:t(dr[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:er(er(er(er(er(er({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",Mp="bpmn:StandardLoopCharacteristics",Tp="bpmn:MultiInstanceLoopCharacteristics";function Pp(e,t,n,o){var r=e.get("loopCharacteristics"),i=[Mp,Tp];if(r&&i.includes(r.$type))if(r.$type!==Mp){var s=r.isSequential?Ep:Ap;n(t.bottomCenter,"loopCharacteristics",s)}else n(t.bottomCenter,"loopCharacteristics",_p);else o(t.bottomCenter,"loopCharacteristics")}var Ip=f.p+"img/compensation.495ae0a2.svg";function Op(e,t,n,o){e.isForCompensation?n(t.bottomCenter,"compensation",Ip):o(t.bottomCenter,"compensation")}var Np,Dp,Rp=15,Bp=2*Zs,Lp={components:{CrownConfig:Ms},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:sr["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:sr["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:sr["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:sr["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":Y()((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(),o=n.height,r=this.calculateSizeOnGrid(),i=this.useTaskHeight(r)?yp:r;o!==i&&(this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment())}),300),"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),this.$emit("definition-changed",this.node.definition)}}},methods:{getElementsUnderArea:function(e){var t=e.getBBox(),n=t.x,o=t.y,r=t.width,i=t.height,s={x:n,y:o,width:r,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,o=this.paperManager.ceilToNearestGridMultiple(n)-e;return this.middleIsOddNumber(o)&&(o+=kp),o},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=mo(jp,gp,vp,!1,null,null,null),zp=Fp.exports,Up=f(95514),qp=f.n(Up),Hp={extends:zp,mixins:[tc],data:function(){return{nodeIcon:qp()}}},Vp=Hp,Wp=mo(Vp,Np,Dp,!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=mo(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:Na,config:Ds},{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,Ao.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,Ao.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,Ao.isEqual)(this.local,this.value)||this.$emit("input",(0,Ao.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}}},of=nf,rf=mo(of,ef,tf,!1,null,null,null),sf=rf.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,o){if(e[o]instanceof Function)return n;var r="Ref"===o.substr(o.length-3)||"Refs"===o.substr(o.length-4);return e[o]instanceof Object&&e[o].id&&r?n[o]=Object&&e[o].id:e[o]instanceof Array&&r?n[o]=e[o].filter((function(e){return e})).map((function(e){return e.id})):("$type"===o||"$"!==o.substr(0,1)&&"__"!==o.substr(0,2))&&(n[o]=t.getDefinitionProps(e[o])),n}),{}):e}},{key:"setDefinitionProps",value:function(e,t,n,o,r){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(o,r){var s=i.setDefinitionProps(e[r],t,n,void 0,r);return null!==s&&void 0!==s?o[r]=s:void 0===s&&delete o[r],o}),o||this.createModdleNode(n,e))}catch(s){throw'Unable to create moddle node of type "'.concat(e.$type,'" \n ').concat(s)}return o&&void 0!==r&&void 0!==e&&null!==e&&(o[r]=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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!(o.indexOf(n)>-1)){var r;if(n instanceof Array)o.push(n),n.find((function(n){return r=t.findById(e,n,o)}));else if(n instanceof Object&&n.$type){if(o.push(n),n.id===e)return n;Object.getOwnPropertyNames(n).find((function(i){return r=!(n[i]instanceof Function)&&t.findById(e,n[i],o)}))}return r}}}]),e}()),cf=function(e,t,n,o,r,i){var s=new af(r,{prefix:"".concat(t.definition.id,"_inner")}),a=s.setDefinitionProps(e.$loopCharactetistics,n,o,{});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,o){var r=o.definitions,i=new af(r);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(sr[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,o,r,i,s){pf(e.markerFlags,t,n),cf(e,t,n,o,r,s),i(lc()(e,"markerFlags","$loopCharactetistics"),s)},inspectorData:function(e,t,n){var o=t(e);return lf(o,e,t,n),o.markerFlags={isForCompensation:o.isForCompensation},delete o.isForCompensation,o},inspectorConfig:[{name:sr[uf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-task"},items:[{component:"FormInput",config:_a}]},df,Ha,Qp]}],loopCharacteristicsHandler:cf,loopCharacteristicsData:lf};function pf(e,t,n){if(e){var o=t.definition.get("isForCompensation"),r=e.isForCompensation;null!=r&&r!==o&&n(t,"isForCompensation",r)}}var ff,mf,gf=er(er({},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:Ms},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:sr["processmaker-modeler-task"],nodeType:"processmaker-modeler-task",dataTest:"switch-to-user-task"},{label:sr["processmaker-modeler-manual-task"],nodeType:"processmaker-modeler-manual-task",dataTest:"switch-to-manual-task"},{label:sr["processmaker-modeler-script-task"],nodeType:"processmaker-modeler-script-task",dataTest:"switch-to-script-task"},{label:sr["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":Y()((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,o=this.shape.size(),r=o.height;if(n+wf+xf!==r){var i=Math.max(n+wf+xf,yp);this.node.diagram.bounds.height=i,this.shape.resize(t,i),this.recalcMarkersAlignment()}}),300),"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,o="bottomCenter.0"===t.target.getAttribute("joint-selector"),r=e.model===this.shape;o&&r&&(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 o=function(e){return e.replace('<svg width="100%"',"<svg ")},r=function(e){return e.replace("<svg ",'<svg class="border border-dark"')};n.subProcessSvg=r(o(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=mo(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)},Mf=[],Tf=f(45578),Pf=f.n(Tf),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,Nf=mo(Of,_f,Mf,!1,null,null,null),Df=Nf.exports,Rf="processmaker-modeler-call-activity",Bf={id:Rf,component:Af,bpmnType:"bpmn:CallActivity",control:!1,category:"BPMN",icon:f(12893),label:sr[Rf],definition:function(e,t){return e.create("bpmn:CallActivity",{name:t(sr[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){t.definition.get("id")!==e["id"]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"id",value:e.id}),n(t,"id",e.id)),t.definition.get("name")!==e["name"]&&(window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"name",value:e.name}),n(t,"name",e.name));var o=JSON.parse(e.config);e["calledElement"]=o.calledElement,window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"calledElement",value:o.calledElement}),n(t,"calledElement",o.calledElement),o.name!==e.name&&(o.name=e.name),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"config",value:JSON.stringify(o)}),n(t,"config",JSON.stringify(o))},inspectorConfig:[{name:sr[Rf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-subprocess"},items:[{component:"FormInput",config:_a},{component:Df,config:{name:"config"}}]},Ha,Da]}],loopCharacteristicsHandler:cf},Lf=f(87465),jf=f.n(Lf),Ff={extends:zp,mixins:[tc],data:function(){return{nodeIcon:jf(),iconName:""}}},zf=Ff,Uf=mo(zf,ff,mf,!1,null,null,null),qf=Uf.exports,Hf="processmaker-modeler-script-task",Vf={id:Hf,component:qf,bpmnType:"bpmn:ScriptTask",control:!1,category:"BPMN",icon:f(75763),label:sr[Hf],definition:function(e,t){return e.create("bpmn:ScriptTask",{name:t(sr[Hf]),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:sr[Hf],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-script-task"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},Wf=er(er({},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}]},Ha,Da]}]}),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:Ms},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 o=3,r=15,i=this.getLabelHeight(r);return i!==e?i-o:0===t.length?n-o:e-o},updateNodeText:function(e){var t=this,n=this.shape.findView(this.paperManager.paper).getBBox(),o=n.height,r="25 ".concat(o," 3 ").concat(o," 3 3 25 3"),i=this.node.diagram.bounds;this.shape.position(i.x,i.y),this.shape.attr({body:{refPoints:r},label:{text:F.util.breakText(e,{width:Xf}),textAnchor:"left"}}),this.paperManager.awaitScheduledUpdates().then((function(){t.shape.resize(t.nodeWidth,t.calculateNewHeight(o,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=mo(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"}}]},Ha,Da]}]},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=[],om=f.p+"img/highlight-shape.5f7b1ba9.svg",rm=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,o=new F.shapes.standard.EmbeddedImage,r=new F.shapes.standard.EmbeddedImage;this.anchorPoints=[t,n,o,r];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(o,"nesw-resize","top-right-resize-button"),this.setPointAttributes(r,"nwse-resize","top-left-resize-button"),t.position(s+c,a+l),n.position(s-this.pointWidth,a+l),o.position(s+c,a-this.pointHeight),r.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()})))})),o.listenTo(this.paper,"element:pointerdown",(function(t){t.model===o&&(o.on("change:position",e.resizeTopRight),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){o.off("change:position",e.resizeTopRight),e.resizeUpdate()})))})),r.listenTo(this.paper,"element:pointerdown",(function(t){t.model===r&&(r.on("change:position",e.resizeTopLeft),e.shape.listenToOnce(e.paper,"element:pointerup",(function(){r.off("change:position",e.resizeTopLeft),e.resizeUpdate()})))}))},fixResizeRounding:function(){var e=this.poolComponent.shape.getBBox(),t=e.x,n=e.y,o=e.width,r=e.height;this.poolComponent.shape.resize(Math.round(o),Math.round(r)),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,o=this.node.diagram.bounds;t===o.width&&n===o.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 o="top-left",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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-(r+this.pointWidth),a+l-this.elementLeftX+rm,sm),y=Math.max(c+d-(i+this.pointWidth),c+d-this.elementTopY,this.poolComponent.laneSet?v:im),w=Math.max(h+f-(r+this.pointWidth),h+f-this.elementLeftX+am+rm,cm),x=Math.max(p+m-(i+this.pointHeight),lm);if(this.isLane)if(this.shape===g[0]){var k=Math.max(a+l-(r+this.pointWidth)+rm,a+l-this.elementLeftX+rm,sm);this.poolComponent.shape.resize(k,y,{direction:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else e.set("previousPosition",{x:r,y:i}),this.shape.resize(b,y,{direction:o}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeTopRight:function(e,t,n){if(n.ui){var o="top-right",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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(r-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(r-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:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(g,v,{direction:o}),e.set("previousPosition",{x:r,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomLeft:function(e,t,n){if(n.ui){var o="bottom-left",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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-(r+this.pointWidth),a+l-this.elementLeftX+rm,sm),v=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?m:im),b=Math.max(u+p-(r+this.pointWidth),u+p-this.elementLeftX+am+rm,cm),y=Math.max(i-h,lm);if(this.isLane)if(this.shape===f[f.length-1]){var w=Math.max(a+l-(r+this.pointWidth)+rm,a+l-this.elementLeftX+rm,sm);this.poolComponent.shape.resize(w,v,{direction:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(g,v,{direction:o}),e.set("previousPosition",{x:r,y:i}),this.laneSet&&this.poolComponent.resizeLanes();this.updateAnchorPointPosition()}}},resizeBottomRight:function(e,t,n){if(n.ui){var o="bottom-right",r=t.x,i=t.y;if(e.get("previousPosition").x!==r||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(r-a,this.elementRightX-a,sm),m=Math.max(i-c,this.elementBottomY-c,this.poolComponent.laneSet?p:im),g=Math.max(r-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:o}),e.set("previousPosition",{x:r,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:o}),e.set("previousPosition",{x:r,y:i}),this.poolComponent.fillLanes(this.shape,o)}else this.shape.resize(f,m,{direction:o}),e.set("previousPosition",{x:r,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,o=t.y,r=t.width,i=t.height;0!==e&&this.anchorPoints[0].position(n+r,o+i),1!==e&&this.anchorPoints[1].position(n-this.pointWidth,o+i),2!==e&&this.anchorPoints[2].position(n+r,o-this.pointHeight),3!==e&&this.anchorPoints[3].position(n-this.pointWidth,o-this.pointWidth)}},setPointAttributes:function(e,t,n){e.attr({body:{fill:"#fff",stroke:" #fff",opacity:.8},image:{xlinkHref:om,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:Ms},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:rm/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=mo(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:rm/2},polyline:{refPointsKeepOffset:"".concat(rm,",0 ").concat(rm,",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:Ms},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=mo(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:sr[Em],rank:80,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataObjectReference",{name:t(sr[Em])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:36})})},inspectorConfig:[{name:sr[Em],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-object"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},_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))},Mm=[],Tm=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:Ms},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 Tm,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=mo(Im,_m,Mm,!1,null,null,null),Nm=Om.exports,Dm="processmaker-modeler-data-store",Rm={id:Dm,component:Nm,bpmnType:"bpmn:DataStoreReference",control:!0,category:"BPMN",icon:f(63427),label:sr[Dm],rank:90,validateIncoming:function(){return!1},definition:function(e,t){return e.create("bpmn:DataStoreReference",{name:t(sr[Dm])})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:50,width:50})})},inspectorConfig:[{name:sr[Dm],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-data-store"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]};function Bm(e,t){var n=new bm,o=e.diagram.bounds;return n.position(o.x,o.y),n.resize(o.width,o.height),n.attr("label/text",F.util.breakText(e.definition.get("name"),{width:o.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+rm}),e.resize(e.getBBox().width-rm,e.getBBox().height-rm),e.resize(e.getBBox().width,e.getBBox().height-rm,{direction:"top"});var n=e.get("size"),o=n.width,r=n.height,i=t.diagram.bounds;e.resize(Math.max(o,i.width),Math.max(r,i.height))}function Fm(e,t,n){var o=Bm(t,n);return e||(Lm(n,o),jm(o,t)),o}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!==Dm}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}]},Ha,Da]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.getElementByNodeId(t.poolId),r=e.moddle.create("bpmn:Lane",{name:t.name}),t.poolX&&t.poolY&&o.set("position",{x:t.poolX,y:t.poolY}),!o.component.laneSet&&o.component.createLaneSet&&(o.component.createLaneSet([t.laneSetId]),o.component.shape.getEmbeddedCells().filter((function(e){return zm(e)})).forEach((function(e){r.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 pr(t.type,r,s),c.pool=o,n.next=9,e.addNode(c,t.id,!0);case 9:e.setShapeStacking(o.component.shape);case 10: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)},Hm=[],Vm=f.p+"img/lane-above.37ee2b80.svg",Wm={components:{CrownButton:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},data:function(){return{laneAboveIcon:Vm}},created:function(){mr.library.add(br)}},Gm=Wm,$m=mo(Gm,qm,Hm,!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:vo,FontAwesomeIcon:Mr.FontAwesomeIcon},data:function(){return{laneBelowIcon:Zm}},created:function(){mr.library.add(yr)}},Qm=Km,eg=mo(Qm,Ym,Jm,!1,null,null,null),tg=eg.exports,ng={components:{CrownConfig:Ms,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(),o=n.x,r=n.y,i=n.width,s=n.height,a={x:o,y:r,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 o=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(o.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 o=this.laneSet.get("lanes").find((function(e){return e.get("flowNodeRef").includes(n)}));Cs()(o.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 o,r,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=!(e.length>0&&void 0!==e[0])||e[0],r=[],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)})),r.push(t.pushNewLane(i))),r.push(t.pushNewLane()),n.next=6,Promise.all(r).then((function(e){o&&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,o=null!==e&&void 0!==e?e:n.generate(),r=jt(o,1),i=r[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 o,r,i;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:Um.definition(t.moddle,t.$t),o.set("color",t.node.definition.get("color")),t.$emit("set-pool-target",t.shape),r=Um.diagram(t.moddle),r.bounds.width=t.shape.getBBox().width,i=new pr(Um.id,o,r),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(),o=n.width,r=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?r:i.height;e.resize(o-rm,a),e.position(rm,s?0:this.isAddingLaneAbove?-a:r,{parentRelative:!0}),t.resize(o,s?r:r+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(),o=n.x,r=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-o,f=h-r,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<rm+am&&(y=i+(rm+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 o,r=this.shape.get("size").height,i=this.sortedLanes().reduce((function(e,t){return e+t.getBBox().height}),0),s=n?e.get("size").height:r-i;switch(t){case"top-right":o="bottom-right";break;case"top-left":o="bottom-left";break;case"bottom-right":o="top-right";break;case"bottom-left":o="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:o}),this.shape.resize(l+rm,r,{direction:o}),this.sortedLanes().forEach((function(e){return e.resize(l,e.getBBox().height,{direction:o})}))},resizeLanes:function(){var e=this;this.sortedLanes().forEach((function(t,n,o){var r=e.shape.get("size"),i=r.width,s=r.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===o.length-1){var p=s-(t.position({parentRelative:!0}).y+c);u=c+p}t.resize(i-rm,u),t.position(rm,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+rm}),this.shape.resize(this.shape.getBBox().width-rm,this.shape.getBBox().height-rm),this.shape.resize(this.shape.getBBox().width,this.shape.getBBox().height-rm,{direction:"top"})},resizePool:function(e){var t=this;this.fitEmbeds();var n=this.shape.get("size"),o=n.width,r=n.height,i=this.node.diagram.bounds;this.shape.resize(Math.max(o,i.width),Math.max(r,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 o=e.graph.findModelsUnderElement(n,{searchBy:"center"}).find((function(e){return e.component&&e.component.node.type===dl}));t[o.id]?t[o.id].push(n.component.node.definition):t[o.id]=[n.component.node.definition]})),this.sortedLanes().forEach((function(e){var n=t[e.id],o=e.component.node.definition.get("flowNodeRef"),r=n?n.length!==o.length:o.length>0;r&&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(),o=n.x,r=n.y,i=e.get("size"),s=i.width,a=i.height;this.node.diagram.bounds.x=o,this.node.diagram.bounds.y=r,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)}},og=ng,rg=mo(og,tm,nm,!1,null,null,null),ig=rg.exports,sg={id:Jr,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}]},Ha,Da]}]},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,o){return[t("dt",{key:"".concat(n.errorId,"_").concat(o),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(o,"_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,o){return[t("dt",{key:n.title+o,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+o+"__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],o=t[1];return o.flatMap((function(e){return er(er({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))}var dg={components:{FontAwesomeIcon:Mr.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),mo(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.filteredPlayers},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,onGenerateAssets:function(t){return e.onGenerateAssets()}}}):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.panMode&&e.panning,"grab-cursor":e.panMode&&!e.panning}],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(),e.isAiGenerated?t("CreateAssetsCard",{ref:"createAssetsCard",on:{onGenerateAssets:function(t){return e.onGenerateAssets()},closeCreateAssets:function(t){e.isAiGenerated=!1}}}):e._e(),e.loadingAI?t("GeneratingAssetsCard",{ref:"generatingAssetsCard",on:{stopAssetGeneration:function(t){return e.onStopAssetGeneration()}}}):e._e(),e.assetsCreated?t("AssetsCreatedCard",{ref:"assetsCreatedCard",on:{closeAssetsCreated:function(t){e.assetsCreated=!1}}}):e._e(),e.assetFail?t("CreateAssetsFailCard",{ref:"createAssetsFailCard",on:{onDismiss:function(t){e.assetFail=!1}}}):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&&!(e.highlightedNodes.length>1),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){var o;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":null===(o=e.definitions)||void 0===o?void 0:o.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,"definition-changed":e.onNodeDefinitionChanged}})})),t("RailBottom",{directives:[{name:"show",rawName:"v-show",value:!e.loadingAI,expression:"!loadingAI"}],attrs:{nodeTypes:e.nodeTypes,"paper-manager":e.paperManager,graph:e.graph,"is-rendering":e.isRendering,"pan-mode":e.panMode},on:{"load-xml":e.loadXML,clearSelection:e.clearSelection,"set-cursor":function(t){e.cursor=t},onCreateElement:e.onCreateElementHandler,"set-pan-mode":function(t){e.panMode=t}}}),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(),e._l(e.filteredPlayers,(function(n){return t("RemoteCursor",{key:n.id,attrs:{data:e.prepareCursorData(n)}})}))],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=function(e){var t,n,o={bpmnType:e.diagram.$type,id:e.diagram.id,type:e.type,attachedToRef:e.definition.get("attachedToRef")},r=e.definition.get("eventDefinitions")[0],i=Object.keys(r).reduce((function(e,t){return t.startsWith("time")&&(e[t]=r[t]),e}),{}),s=Object.keys(i)[0];return{x:e.diagram.bounds.x,y:e.diagram.bounds.y,height:e.diagram.bounds.height,width:e.diagram.bounds.width,attachedToRefId:null===(t=e.definition.get("attachedToRef"))||void 0===t?void 0:t.id,control:o,type:e.type,id:e.definition.id,color:e.definition.get("color"),cancelActivity:e.definition.get("cancelActivity"),eventTimerDefinition:{type:s,body:null===(n=i[s])||void 0===n?void 0:n.body}}},wg={components:{CrownConfig:Ms},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,o=e.width,r=e.height;this.shape.position(t,n),this.shape.resize(o,r),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,o=this.previousPosition,r=o.x,i=o.y;return t!==r||n!==i},getCenterPosition:function(){var e=this.shape.position(),t=e.x,n=e.y,o=this.shape.size(),r=o.width,i=o.height;return{x:t+r/2,y:n+i/2}},updateShapePosition:function(e){if(this.hasPositionChanged()){var t=Mt(this.getCenterPosition(),e),n=t.x,o=t.y,r=this.shape.size(),i=r.width,s=r.height;this.shape.position(n-i/2,o-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&&(Dt(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&&Dt(this.invalidTargetElement),this.invalidTargetElement=e}}},addMultiplayerBoundaryEvent:function(){var e=yg(this.node);window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",e)}},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)})))()}},xg=wg,kg=mo(xg,gg,vg,!1,null,null,null),Cg=kg.exports,Sg={id:"processmaker-modeler-boundary-event",component:Cg,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}]}]}]},Eg=f(67629),Ag=f.n(Eg),_g=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)])},Mg=[],Tg=5e3;zt().use(Dn);var Pg=new Dn.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,Ao.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 er(er({},e),{},{type:e.id})}))}})).sort((function(e,t){return e.rank-t.rank}))},setPinnedNodes:function(e,t){e.pinnedNodeTypes.push(t),e.pinnedNodeTypes=(0,Ao.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,o=e.nodeTypes;e.searchTerm=t;var r=(0,Ao.uniqBy)([].concat(W(n),W(o)),"id");e.filteredNodeTypes=r.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,Ao.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 er(er({},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 o=(0,Ao.uniqBy)(W(n),"id");e.filteredPmBlockNodeTypes=o.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=e.commit;if("standalone"!==(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.user)||void 0===t?void 0:t.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){n("setPinnedNodes",e)}))})).catch((function(e){console.error(e)}))}else{var r=localStorage.pinnedNodes?JSON.parse(localStorage.pinnedNodes):[];r.forEach((function(e){n("setPinnedNodes",e)}))}},addUserPinnedObject:function(e,t){var n,o=e.commit,r=e.state;o("setPinnedNodes",t);var i=r.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(n=n.user)||void 0===n?void 0:n.id)){var s=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(s,"/update_pinned_controls"),{pinnedNodes:i}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(i)},removeUserPinnedObject:function(e,t){var n,o=e.commit,r=e.state;o("setUnpinNode",t);var i=r.pinnedNodeTypes;if("standalone"!==(null===(n=window.ProcessMaker)||void 0===n||null===(n=n.user)||void 0===n?void 0:n.id)){var s=window.ProcessMaker.user?window.ProcessMaker.user.id:"";window.ProcessMaker.apiClient.put("/users/".concat(s,"/update_pinned_controls"),{pinnedNodes:i}).catch((function(e){console.error(e)}))}else localStorage.pinnedNodes=JSON.stringify(i)}}}),Ig=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)])},Og=[],Ng={name:"FilterNodeTypes",props:["type"],data:function(){return{searchTerm:""}},watch:{searchTerm:function(e){"pmBlock"===this.type?(0===e.length&&Pg.commit("clearFilteredPmBlockNodes"),e.length>0&&Pg.commit("setFilteredPmBlockNodeTypes",e)):(0===e.length&&Pg.commit("clearFilteredNodes"),e.length>0&&Pg.commit("setFilteredNodeTypes",e))},type:function(e,t){this.searchTerm=t===e?this.searchTerm:""}},computed:{nodeTypes:function(){var e=Pg.getters.getPinnedNodeTypes,t=Pg.getters.getNodeTypes;return[].concat(W(e),W(t))},pmBlockNodes:function(){var e=Pg.getters.getPmBlockNodeTypes;return W(e)},placeholder:function(){return"pmBlock"===this.type?this.$t("Search PM Blocks"):this.$t("Search Objects")}}},Dg=Ng,Rg=(f(29062),mo(Dg,Ig,Og,!1,null,"c468f432",null)),Bg=Rg.exports,Lg=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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}}):t("img",{staticClass:"pinIcon",attrs:{src:e.pinIcon,alt:"Pin Element"},on:{click:function(t){return e.addPin(n)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],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},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)},mousedown:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}})])]}))],2)]],2)},jg=[],Fg=f.p+"img/pin-angle.95ef112b.svg",zg=f.p+"img/pin-angle-fill.45c5a07f.svg",Ug={methods:{containsSvg:function(e){var t=/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/,n=/\.svg/;return"string"===typeof e&&(t.test(e)||n.test(e))}}},qg={mixins:[Ug],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,Pg.commit("setSelectedNode",t),this.$emit("onSetCursor","crosshair"),this.parent||(this.popperType=t.type),window.ProcessMaker.EventBus.$on("custom-pointerclick",(function(e){window.ProcessMaker.EventBus.$emit("capture-hovered-link",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),Pg.commit("clearSelectedNode"),Pg.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,o=this.movedElement;o&&(o.style.left="".concat(t,"px"),o.style.top="".concat(n,"px")),Pg.commit("setGhostNode",o)},createDraggingHelper:function(e,t){this.movedElement&&(document.removeEventListener("mousemove",this.setDraggingPosition),document.body.removeChild(this.movedElement));var n=this.containsSvg(t.icon),o=n?document.createElement("img"):document.createElement("i");Object.assign(o.style,this.helperStyles),n?o.src=t.icon:(o.setAttribute("class",t.icon),o.style.fontSize="42px",o.style.width="42px",o.style.height="42px"),document.body.appendChild(o),Pg.commit("setGhostNode",o);var r=e.target;this.xOffset=e.clientX-r.getBoundingClientRect().left,this.yOffset=e.clientY-r.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,Pg.commit("clearSelectedNode"),Pg.commit("setGhostNode",null)},startDragNewObject:function(e,t){window.ProcessMaker.mouseDownDrag=!0,this.onClickHandler(e,t)},cancelDragNewObject:function(){window.ProcessMaker.mouseDownDrag=!1}},computed:{selectedItem:function(){return Pg.getters.getSelectedNode},movedElement:function(){return Pg.getters.getGhostNode}}},Hg={name:"NodeTypesLoop",mixins:[qg,Ug],data:function(){return{pinIcon:Fg,pinFillIcon:zg,showPin:!1}},created:function(){Pg.dispatch("getUserPinnedObjects")},methods:{nodeTypeAlreadyPinned:function(e,t){return!!this.pinnedObjects.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Pg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Pg.dispatch("addUserPinnedObject",e)}},computed:{pinnedObjects:function(){var e=Pg.getters.getPinnedNodeTypes,t=e.filter((function(e){var t;return!(null!==(t=e.type)&&void 0!==t&&t.includes("processmaker-pm-block"))}));return t},objects:function(){return Pg.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 Pg.getters.getFilteredNodeTypes},searchTerm:function(){return Pg.getters.getSearchTerm}}},Vg=Hg,Wg=(f(96494),mo(Vg,Lg,jg,!1,null,null,null)),Gg=Wg.exports,$g=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",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[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)))]),e.blockAlreadyPinned(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.filteredPmBlockNodes.length||e.searchTerm?e._e():[e.pinnedBlocks.length>0?t("div",{staticClass:"pinnedBlocks"},[t("p",[e._v(e._s(e.$t("Pinned PM Blocks")))]),e._l(e.pinnedBlocks,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.customIcon}),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("PM Block Category")))]),e._l(e.unpinnedBlocks,(function(n){return[t("div",{key:n.id,staticClass:"node-types__item",attrs:{"data-test":n.type},on:{mouseover:function(t){e.showPin=!0},mouseleave:function(t){e.showPin=!1},mousedown:function(t){return t.stopPropagation(),e.startDragNewObject(t,n)},mouseup:function(t){return t.stopPropagation(),e.cancelDragNewObject()}}},[e.containsSvg(n.icon)?t("img",{staticClass:"node-types__item__icon",attrs:{src:n.svgIcon,alt:e.$t(n.label)}}):t("i",{staticClass:"fa-lg",class:n.customIcon}),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)},Xg=[],Yg={name:"PmBlocksLoop",mixins:[qg,Ug],data:function(){return{pinIcon:Fg,pinFillIcon:zg,showPin:!1}},created:function(){Pg.dispatch("getUserPinnedObjects")},methods:{blockAlreadyPinned:function(e,t){return!!this.pinnedBlocks.find((function(e){return e.type===t}))},unPin:function(e){return this.deselect(),Pg.dispatch("removeUserPinnedObject",e)},addPin:function(e){return this.deselect(),Pg.dispatch("addUserPinnedObject",e)}},computed:{pinnedBlocks:function(){var e=Pg.getters.getPinnedNodeTypes,t=e.filter((function(e){var t;return null===(t=e.type)||void 0===t?void 0:t.includes("processmaker-pm-block")}));return t},unpinnedBlocks:function(){var e=this,t=this.pmBlockNodeTypes;return t.filter((function(t){return!e.pinnedBlocks.some((function(e){return e.type===t.type}))}))},pmBlockNodeTypes:function(){return Pg.getters.getPmBlockNodeTypes},filteredPmBlockNodes:function(){return Pg.getters.getFilteredPmBlockNodeTypes},searchTerm:function(){return Pg.getters.getSearchTerm}}},Jg=Yg,Zg=(f(92041),mo(Jg,$g,Xg,!1,null,null,null)),Kg=Zg.exports,Qg={name:"ExplorerRail",props:{explorerExpanded:{type:Boolean},nodeTypes:{type:Array},pmBlockNodes:{type:Array}},components:{FontAwesomeIcon:Mr.FontAwesomeIcon,FilterNodeTypes:Bg,NodeTypesLoop:Gg,PmBlocksLoop:Kg},data:function(){return{tabs:[{idx:0,label:"Add Object"},{idx:1,label:"PM Blocks"}],tabIndex:0}},computed:{explorerOpen:function(){return Pg.getters.getExplorerOpen}},created:function(){Pg.commit("setNodeTypes",this.nodeTypes)},methods:{faTimes:function(){return is.faTimes},setTabIndex:function(e){this.tabIndex!==e&&(this.tabIndex=e,this.clearFilteredObjects())},closeRail:function(){Pg.commit("closeExplorer"),this.clearFilteredObjects()},clearFilteredObjects:function(){Pg.commit("clearFilteredNodes"),Pg.commit("clearFilteredPmBlockNodes")}}},ev=Qg,tv=(f(14906),mo(ev,_g,Mg,!1,null,null,null)),nv=tv.exports,ov=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 iv={};function sv(e){return Object.keys(e).reduce(((t,n)=>(!1!==e[n]&&null!==e[n]&&void 0!==e[n]&&(t[n]=e[n]),t)),{})}const av={name:"InlineSvg",inheritAttrs:!1,render(e){return this.svgElSource?e("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),sv(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 o=n.length-1;o>=0;o--)t[n[o].name]=n[o].value;return t},getSvgContent(e){return e=e.cloneNode(!0),e=this.transformSource(e),this.title&&cv(e,this.title),e.innerHTML},getSource(e){iv[e]||(iv[e]=this.download(e)),this.svgElSource&&iv[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),iv[e].then((e=>{this.svgElSource=e,this.$nextTick((()=>{this.$emit("loaded",this.$el)}))})).catch((t=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete iv[e],this.$emit("error",t)}))},download(e){return lv(new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=()=>{if(o.status>=200&&o.status<400)try{const e=new DOMParser,r=e.parseFromString(o.responseText,"text/xml");let i=r.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"))},o.onerror=n,o.send()})))}}};function cv(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 lv(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 dv={name:"WelcomeMessage",components:{InlineSvg:av},data:function(){var e;return{proceC2Icon:f(7225),lastSession:{},history:[],processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.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,o=(null===(n=t.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.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"}}},uv=dv,hv=(f(83665),mo(uv,ov,rv,!1,null,"a8e6c808",null)),pv=hv.exports,fv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex pl-2 justify-content-between align-items-center"},[t("div",{staticClass:"col-9"},[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticStyle:{color:"#556271","font-weight":"600"}},[e._v(e._s(e.$t("Create your missing assets with AI")))])],1),t("div",{staticStyle:{color:"#556271","font-weight":"400"}},[e._v(" "+e._s(e.$t("Use AI to easily produce the necessary screens and scripts to complete the process."))+" ")])]),t("div",{staticClass:"col-3 h-100 p-0 d-flex flex-column justify-content-center"},[t("button",{staticClass:"h-100 createBtn btn btn-primary btn-block",on:{click:function(t){return e.onCreateAssets()}}},[e._v(" "+e._s(e.$t("Create now"))+" ")]),t("button",{staticClass:"h-100 m-0 cancelBtn btn btn-light btn-block",on:{click:function(t){return e.onCancel()}}},[e._v(" "+e._s(e.$t("Close"))+" ")])])])])],1)},mv=[],gv={name:"CreateAssetsCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onCreateAssets:function(){this.$emit("onGenerateAssets")},onCancel:function(){this.$emit("closeCreateAssets")}}},vv=gv,bv=(f(89841),mo(vv,fv,mv,!1,null,"46a7ce7f",null)),yv=bv.exports,wv=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100 w-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex p-3 justify-content-between align-items-center"},[t("div",[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticClass:"card-text"},[e._v(e._s(e.$t("Generating...")))])],1)]),t("div",{staticClass:"p-0"},[t("button",{staticClass:"h-100 px-3 cancel-btn btn btn-secondary",on:{click:function(t){return e.onStop()}}},[e._v(" "+e._s(e.$t("STOP"))+" ")])])])])],1)},xv=[],kv={name:"GeneratingAssetsCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onStop:function(){this.$emit("stopAssetGeneration")}}},Cv=kv,Sv=(f(24798),mo(Cv,wv,xv,!1,null,"dfb6ccb8",null)),Ev=Sv.exports,Av=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message mt-3"},[t("b-card",{staticClass:"h-100 w-100",staticStyle:{"border-radius":"8px"},attrs:{"no-body":""}},[t("div",{staticClass:"h-100 d-flex pl-2 justify-content-between align-items-center"},[t("div",{staticClass:"col-9"},[t("div",{staticClass:"text-left"},[t("inline-svg",{staticClass:"ml-0 mr-2 my-auto ai-icon",attrs:{src:e.proceC2Icon}}),t("span",{staticStyle:{color:"#556271","font-weight":"600"}},[e._v(e._s(e.$t("Assets Generated Successfully")))])],1),t("div",{staticStyle:{color:"#556271","font-weight":"400"}},[e._v(" "+e._s(e.$t("Check them on their corresponding tasks"))+" ")])]),t("div",{staticClass:"col-3 h-100 p-0 d-flex flex-column justify-content-center"},[t("button",{staticClass:"h-100 m-0 cancelBtn btn btn-light btn-block",on:{click:function(t){return e.onClose()}}},[e._v(" "+e._s(e.$t("Close"))+" ")])])])])],1)},_v=[],Mv={name:"AssetsCreatedCard",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225)}},methods:{onClose:function(){this.$emit("closeAssetsCreated")}}},Tv=Mv,Pv=(f(72858),mo(Tv,Av,_v,!1,null,"2a8117cc",null)),Iv=Pv.exports,Ov=function(){var e=this,t=e._self._c;return t("div",{staticClass:"customAlert mx-auto mt-2"},[t("b-alert",{attrs:{show:"",dismissible:"",variant:"warning"},on:{dismissed:function(t){return e.onDismiss()}}},[e._v(" "+e._s(e.$t("Generation of assets was not able to complete. Try again"))+" ")])],1)},Nv=[],Dv={name:"CreateAssetsFailCard",data:function(){return{}},methods:{onDismiss:function(){this.$emit("onDismiss")}}},Rv=Dv,Bv=(f(24700),mo(Rv,Ov,Nv,!1,null,"0b1e2c98",null)),Lv=Bv.exports,jv=f(33293),Fv=f(82729),zv=f.n(Fv),Uv=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)},qv=[],Hv={components:{InlineSvg:av},props:{showInspector:{type:Boolean,default:!0}},data:function(){return{inspectorIcon:f(28400)}},methods:{toggleInspector:function(){this.$emit("toggleInspector",!this.showInspector)}}},Vv=Hv,Wv=(f(5728),mo(Vv,Uv,qv,!1,null,"cebfb20a",null)),Gv=Wv.exports,$v=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)},Xv=[],Yv=f(43637),Jv=f(21223),Zv=(f(85780),f(50308)),Kv=f.n(Zv),Qv={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:Ds},{component:"FormInput",config:{label:"Name",helper:"The Name of the Process",name:"name",placeholder:""}}]}]}]},eb=Qv.id,tb=Qv;zt().component("FormText",Yv.renderer.FormText),zt().component("FormInput",Jv.FormInput),zt().component("FormSelect",Jv.FormSelect),zt().component("FormTextArea",Jv.FormTextArea),zt().component("FormCheckbox",Jv.FormCheckbox),zt().component("FormRadioButtonGroup",Jv.FormRadioButtonGroup),zt().component("FormAccordion",Jv.FormAccordion),zt().component("FormDatePicker",Jv.FormDatePicker),zt().component("FormMultiSelect",Jv.FormMultiSelect);var nb={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)},"highlightedNode.definition.allowInterstitial":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.interstitialScreenRef":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.screenRef":function(e,t){this.handleAssignmentChanges(e,t)},"highlightedNode.definition.scriptRef":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 Kv();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 o=n.documentation?[e.moddle.create("bpmn:Documentation",{text:n.documentation})]:void 0;e.setNodeProp(e.highlightedNode,"documentation",o),e.multiplayerHook("documentation",o,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=tb.inspectorConfig;var o=hr()(this.nodeRegistry[t].inspectorConfig),r=$()(o,"[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=r.find((function(e){return e.config&&"Name"===e.config.label})),c=r.indexOf(a);a&&c>=0?r.splice(c+1,0,s):r.push(s)}return this.config=o},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),o=n[0],r=n[1];return e[o]=r,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})}}},ob=nb,rb=(f(75766),mo(ob,$v,Xv,!1,null,"618b3b58",null)),ib=rb.exports,sb=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",{staticClass:"preview-iframe",style:{visibility:e.displayPreviewIframe},attrs:{title:"Preview",src:e.previewUrl},on:{load:e.loading,mousemove:e.onMouseMove,mouseup:e.onMouseUp}})],1)],1)},ab=[],cb=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.")])])},lb=[],db={data:function(){return{noPreviewImg:f(2431)}}},ub=db,hb=(f(79763),f(17378),mo(ub,cb,lb,!1,null,"cdc64a14",null)),pb=hb.exports,fb=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}})])},mb=[],gb={data:function(){return{previewAsset:f(74818),spinnerImg:f(95522)}}},vb=gb,bb=(f(24289),f(64346),mo(vb,fb,mb,!1,null,"0cafde2c",null)),yb=bb.exports,wb={props:["nodeRegistry","visible","previewConfigs","panelWidth"],components:{NoPreviewAvailable:pb,LoadingPreview:yb},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(){var e=this.getConfig(this.data);e?(document.activeElement.blur(),this.previewNode()):this.$emit("togglePreview",!1)}},computed:{highlightedNode:function(){return Un.getters.highlightedNodes[0]},displayPreviewIframe:function(){var e=!!this.previewUrl&&!this.showSpinner;return e?"visible":"hidden"}},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;if(!this.highlightedNode)return{};var n=function(e){return Object.entries(e.definition).reduce((function(e,t){var n=jt(t,2),o=n[0],r=n[1];return e[o]=r,e}),{})};this.data=n(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===(t=t.definition)||void 0===t?void 0:t.name},onSelectedPreview:function(e){this.selectedPreview=e},previewNode:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.highlightedNode&&(this.visible||t)){this.prepareData();var n=this.getConfig(this.data),o={};for(var r in this.data){var i;(null!==(i=null===n||void 0===n?void 0:n.receivingParams)&&void 0!==i?i:[]).includes(r)&&(o[r]=this.data[r])}var s=encodeURI(JSON.stringify(o)),a=Object.keys(o).length>0,c=!(null===n||void 0===n||!n.assetUrl(this.data));this.previewUrl=c&&n&&a?"".concat(n.url,"?node=").concat(s):null,this.taskTitle=null===(e=this.highlightedNode)||void 0===e||null===(e=e.definition)||void 0===e?void 0:e.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}}},xb=wb,kb=(f(37700),mo(xb,sb,ab,!1,null,"0475b5a0",null)),Cb=kb.exports;zt().use(Dn);var Sb=new Dn.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},isRunning:function(e){return e.isRunning}},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},isRunning:function(e,t){e.isRunning=t}},actions:{pushState:function(e,t){var n=e.state,o=e.getters,r=e.commit;t===o.currentState||n.disabled||(r("setState",t),r("setPosition",n.stack.length-1))},undo:function(e){var t=e.state,n=e.getters,o=e.commit;n.canUndo&&(o("isRunning",!0),o("setPosition",t.position-1))},redo:function(e){var t=e.state,n=e.getters,o=e.commit;n.canRedo&&(o("isRunning",!0),o("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)},done:function(e){var t=e.commit;t("isRunning",!1)}}}),Eb=f(51540),Ab=f(51248),_b=f.n(Ab),Mb=f(48909),Tb=f.n(Mb),Pb=f(82317),Ib=f.n(Pb),Ob=f(83184),Nb=f.n(Ob),Db=f(36111),Rb=f.n(Db),Bb=f(25795),Lb=f.n(Bb),jb=f(37554),Fb=f.n(jb),zb=f(19869),Ub=f.n(zb),qb=f(88687),Hb=f.n(qb),Vb=f(37028),Wb=f.n(Vb),Gb=f(89185),$b=f.n(Gb),Xb=f(34652),Yb=f.n(Xb),Jb=f(49252),Zb=f.n(Jb),Kb=f(93414),Qb=f.n(Kb),ey=f(68522),ty=f.n(ey),ny=f(7174),oy=f.n(ny),ry=f(74815),iy=f.n(ry),sy=f(24874),ay=f.n(sy),cy={};function ly(){}ly.prototype.resolveRule=function(e,t){const n=cy[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">");return n},ly.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">")};var dy=new ly,uy={"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"},hy={rules:uy},py={resolver:dy,config:hy},fy=py;function my(e,t,n,o,r,i,s){var a={allowDrop:!1,poolTarget:null};if(!wy(e,t,s))return a.allowDrop=!1,a;if(by(n.type))return a.allowDrop=!0,a;if(xy(n.bpmnType)){var c=r.findModelsFromPoint(ky(e,t,o)).sort((function(e,t){return t.get("z")-e.get("z")}))[0];return a.allowDrop=Oi(n.type,c),a}if(yy(i))return a.allowDrop=!0,a;if(gy(n.bpmnType))return a.allowDrop=!0,a;var l=vy(e,t,o,r);return l&&(a.allowDrop=!0,a.poolTarget=l),a}function gy(e){return"bpmn:TextAnnotation"===e}function vy(e,t,n,o){return o.findModelsFromPoint(ky(e,t,n)).find((function(e){var t=e.component;return t&&t.node.type===Jr}))}function by(e){return e===Jr}function yy(e){return!e||0===e.get("participants").length}function wy(e,t,n){var o=n.getBoundingClientRect(),r=o.left,i=o.top,s=o.width,a=o.height,c=new F.g.rect(r,i,s,a),l=new F.g.Point(e,t);return c.containsPoint(l)}function xy(e){return"bpmn:BoundaryEvent"===e}function ky(e,t,n){return n.clientToLocalPoint({x:e,y:t})}cy["bpmnlint/conditional-flows"]=_b(),cy["bpmnlint/end-event-required"]=Tb(),cy["bpmnlint/event-sub-process-typed-start-event"]=Ib(),cy["bpmnlint/label-required"]=Nb(),cy["bpmnlint/no-complex-gateway"]=Rb(),cy["bpmnlint/no-disconnected"]=Lb(),cy["bpmnlint/no-gateway-join-fork"]=Fb(),cy["bpmnlint/no-implicit-split"]=Ub(),cy["bpmnlint/single-event-definition"]=Hb(),cy["bpmnlint/start-event-required"]=Wb(),cy["bpmnlint/sub-process-blank-start-event"]=$b(),cy["bpmnlint/superfluous-gateway"]=Yb(),cy["bpmnlint-plugin-processmaker/custom-validation"]=Zb(),cy["bpmnlint-plugin-processmaker/gateway-direction"]=Qb(),cy["bpmnlint-plugin-processmaker/event-based-gateway"]=ty(),cy["bpmnlint-plugin-processmaker/call-activity-child-process"]=oy(),cy["bpmnlint-plugin-processmaker/id-required"]=iy(),cy["bpmnlint-plugin-processmaker/signal-ref-required"]=ay();var Cy,Sy,Ey,Ay,_y,My,Ty,Py,Iy,Oy,Ny,Dy,Ry=f(7407),By=f.n(Ry),Ly={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:By()}}},jy=Ly,Fy=mo(jy,Cy,Sy,!1,null,null,null),zy=Fy.exports,Uy="processmaker-modeler-boundary-error-event",qy=ac()(hr()(Sg),{id:Uy,component:zy,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:[{}]},Ha,Da]}]}),Hy={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:ap()}},mounted:function(){this.shape.attr({image:{"ref-x":4,"ref-y":4,width:18,height:18}})}},Vy=Hy,Wy=mo(Vy,Ey,Ay,!1,null,null,null),Gy=Wy.exports,$y={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"}},Xy=$y,Yy="processmaker-modeler-boundary-conditional-event",Jy=ac()(hr()(Sg),er(er({},pp),{},{id:Yy,component:Gy,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()),[Xy])},Da,Ha]}]})),Zy=f.p+"img/boundary-escalation-icon.c999a95e.svg",Ky={extends:Cg,mounted:function(){this.shape.attr("image/xlink:href",Zy)},methods:{isValidBoundaryEventTarget:function(e){return Ni(e.component)}}},Qy=Ky,ew=mo(Qy,_y,My,!1,null,null,null),tw=ew.exports,nw="processmaker-modeler-boundary-escalation-event",ow=ac()(hr()(Sg),{id:nw,component:tw,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:[{},Xy]},Ha,Da]}]}),rw=f(81146),iw=f.n(rw),sw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:iw()}},methods:{isValidBoundaryEventTarget:function(e){var t=e.component;return t&&t.node.isBpmnType("bpmn:CallActivity")}},mounted:function(){var e=mh();this.shape.attr(e)}},aw=sw,cw=mo(aw,Ty,Py,!1,null,null,null),lw=cw.exports,dw="processmaker-modeler-boundary-message-event",uw=ac()(hr()(Sg),er(er({},ql),{},{id:dw,component:lw,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:[{},Xy,Fl("Message that will trigger this boundary event")]},Ha,Da]}]})),hw=f(16221),pw=f.n(hw),fw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:pw()}},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}})}},mw=fw,gw=mo(mw,Iy,Oy,!1,null,null,null),vw=gw.exports,bw="processmaker-modeler-boundary-signal-event",yw=ac()(hr()(Sg),er(er({},rd),{},{id:bw,component:vw,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:[{},Xy,od("Signal that will trigger this boundary event")]},Ha,Da]}]})),ww=f(50889),xw=f.n(ww),kw={extends:Cg,mixins:[tc],data:function(){return{nodeIcon:xw()}},methods:{addTimerEventDefinitionId:function(){var e="".concat(this.id,"_timer_event_definition");this.node.definition.get("eventDefinitions")[0].id=e}},mounted:function(){this.addTimerEventDefinitionId()}},Cw=kw,Sw=mo(Cw,Ny,Dy,!1,null,null,null),Ew=Sw.exports,Aw="processmaker-modeler-boundary-timer-event",_w=function(e,t,n,o){var r=y({},n,e.create("bpmn:Expression",{body:o}));return[e.create("bpmn:TimerEventDefinition",r)]},Mw=(0,Ao.merge)((0,Ao.cloneDeep)(Sg),{id:Aw,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),o=n[0],r=n[1];if("eventDefinitions"===o){var i=Object.keys((0,Ao.omit)(r[0],["id","$type","get","set","$instanceOf"]))[0],s=r[0][i].body;e[o]={type:i,body:s}}else e[o]=r;return e}),{})},inspectorHandler:function(e,t,n,o){var r=t.definition;for(var i in e)if(r[i]!==e[i])if("eventDefinitions"===i){var s=e[i],a=s.type,c=s.body,l=r.get(i)[0][a];if(l&&l.body===c)continue;var d=_w(o,t,a,c);n(t,"eventDefinitions",d),window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:"eventTimerDefinition",value:{type:a,body:c}})}else window.ProcessMaker.EventBus.$emit("multiplayer-updateInspectorProperty",{id:t.definition.id,key:i,value:e[i]}),n(t,i,e[i])},inspectorConfig:[{items:[{items:[{},Xy]},{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"}}]},Da,Ha]}]});function Tw(e,t,n){var o=x(e,t,"set");return A(e,o,n),n}var Pw=new WeakMap,Iw=function(){function e(t){d(this,e),b(this,Pw,{writable:!0,value:void 0}),y(this,"preventTranslate",!1),Tw(this,Pw,t)}return g(e,[{key:"paper",get:function(){return k(this,Pw)}},{key:"scale",get:function(){return k(this,Pw).scale()},set:function(e){k(this,Pw).scale(e),k(this,Pw).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,Pw).translate(e,t),k(this,Pw).trigger("translate:changed"))}},{key:"addEventHandler",value:function(e,t,n){k(this,Pw).on(e,t,n)}},{key:"addOnceHandler",value:function(e,t){k(this,Pw).once(e,t)}},{key:"removeEventHandler",value:function(e,t,n){k(this,Pw).off(e,t,n)}},{key:"setPaperDimensions",value:function(e,t){k(this,Pw).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,Pw).freeze(),e.next=3,t(k(this,Pw));case 3:k(this,Pw).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,Pw).localToPagePoint(0,0),o=this.scale;return{x:this.roundToNearestGridMultiple((e-n.x)/o.sx),y:this.roundToNearestGridMultiple((t-n.y)/o.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,Pw)._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,o){var r=3,i=new F.dia.Paper({async:!0,el:t,model:o,sorting:"sorting-approximate",gridSize:e.gridSize,drawGrid:!0,snapLinks:!1,snapElements:!1,clickThreshold:10,perpendicularLinks:!0,interactive:n,highlighting:{default:{options:{padding:r}}}});return i.translate(168,20),new this(i)}}]),e}();function Ow(e,t,n){var o=Rw(e,t,n);Dw(o,t),e.inspectorConfig[0].items.sort(Nw)}function Nw(e,t){return Bw(e)?1:Bw(t)?-1:0}function Dw(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 Rw(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 Bw(e){return e.config&&"Advanced"===e.config.label}function Lw(e,t){Hw(e)&&Fw(e);var n=qw(e);n&&Fw(n),jw(e)&&!Hw(e)&&zw(e),Uw(t)}function jw(e){return e.component.node.type!==dl}function Fw(e){zw(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})),o=e.getEmbeddedCells().filter((function(e){return e.component&&e.component.node.type!==dl}));n.forEach(zw),o.forEach(zw)}}function zw(e){e.toFront({deep:!0})}function Uw(e){e.getLinks().forEach(zw)}function qw(e){return e.component.node.pool}function Hw(e){return e.component.node.type===Jr}y(Iw,"gridSize",kp);var Vw=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",e._g({attrs:{"validation-errors":e.validationErrors,warnings:e.warnings,players:e.players}},e.$listeners),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)])},Ww=[],Gw=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,o){return t("li",{key:o,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()])},$w=[function(){var e=this,t=e._self._c;return t("li",{staticClass:"breadcrumb-item"},[t("a",{attrs:{href:"/"}},[t("i",{staticClass:"fas fa-home"})])])}],Xw={name:"breadcrumb",props:{breadcrumbData:{type:Array,default:function(){return[]}}}},Yw=Xw,Jw=(f(61573),mo(Yw,Gw,$w,!1,null,"d1e148b4",null)),Zw=Jw.exports,Kw=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}}),e.isPackageAiInstalled?t("AiGenerateButton",e._g({},e.$listeners)):e._e(),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)},Qw=[],ex=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)},tx=[],nx={components:{InlineSvg:av},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()}))}},ox=nx,rx=(f(70947),mo(ox,ex,tx,!1,null,"5880bbc6",null)),ix=rx.exports,sx=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)])},ax=[],cx={components:{InlineSvg:av},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)}}},lx=cx,dx=(f(59724),mo(lx,sx,ax,!1,null,"337583fe",null)),ux=dx.exports,hx=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,o){return t("div",{key:"".concat(n.errorId,"_").concat(o),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,o){return t("div",{key:n.title+o,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)},px=[],fx={components:{VueInlineSvg:av},props:{errorList:{type:Array,required:!0},warnings:{type:Array,required:!0}},data:function(){return{issueIcon:f(4298)}}},mx=fx,gx=(f(95254),mo(mx,hx,px,!1,null,"0722e36d",null)),vx=gx.exports,bx=function(){var e=this,t=e._self._c;return t("b-avatar-group",{directives:[{name:"show",rawName:"v-show",value:e.isMultiplayer,expression:"isMultiplayer"}],staticClass:"container"},[e._l(e.players,(function(e){return[t("Avatar",{key:e.id,attrs:{badgeBackgroundColor:e.color,imgSrc:e.avatar,userName:e.name,id:e.id}})]}))],2)},yx=[],wx=function(){var e=this,t=e._self._c;return t("span",{staticClass:"b-avatar rounded-circle",style:{backgroundColor:e.backgroundColor}},[e.imgSrc?t("span",{staticClass:"b-avatar-img",attrs:{id:e.id}},[t("img",{attrs:{src:e.imgSrc,alt:e.userName}})]):t("span",{staticClass:"b-avatar-text avatar-initials",attrs:{id:e.id}},[t("span",[e._v(" "+e._s(this.getInitials(e.userName))+" ")])]),t("b-tooltip",{attrs:{target:e.id,triggers:"hover"}},[e._v(" "+e._s(e.userName)+" ")]),e.badgeBackgroundColor?t("span",{staticClass:"b-avatar-badge badge-danger",style:{bottom:"0px",right:"0px",backgroundColor:e.badgeBackgroundColor}}):e._e()],1)},xx=[],kx={props:{badgeBackgroundColor:{type:String,required:!1},imgSrc:{type:String,required:!1},userName:{type:String,required:!1},id:{type:String,required:!0}},data:function(){return{saturation:50,lightness:50,range:10,backgroundColor:"#104A75"}},methods:{getInitials:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(" "),n=t[0].charAt(0).toUpperCase(),o=t[t.length-1].charAt(0).toUpperCase();return"".concat(n).concat(o)}}},Cx=kx,Sx=(f(52682),mo(Cx,wx,xx,!1,null,"b7e12804",null)),Ex=Sx.exports,Ax={components:{Avatar:Ex},props:{players:{type:Array,required:!0}},computed:{isMultiplayer:function(){return Un.getters.isMultiplayer}}},_x=Ax,Mx=mo(_x,bx,yx,!1,null,null,null),Tx=Mx.exports,Px=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-2"},[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:["btn py-0 px-2 ai-btn",e.showPopover?"ai-btn-open":"ai-btn-closed"],attrs:{id:"aiAssetButton",title:e.$t("AI Asset Generator")},on:{click:function(t){e.showPopover=!e.showPopover}}},[t("inline-svg",{staticClass:"my-auto ai-icon",attrs:{src:e.proceC2Icon}})],1),t("b-popover",{attrs:{target:"aiAssetButton",triggers:"click",show:e.showPopover,title:e.$t("Create your assets with AI"),placement:"auto"},on:{"update:show":function(t){e.showPopover=t}}},[t("div",{staticClass:"p-3 d-flex flex-column"},[t("div",{staticClass:"m-2"},[e._v(" "+e._s(e.$t("Create any missing assets for the process, including screens and scripts."))+" ")]),t("div",{staticClass:"m-2"},[t("span",{staticClass:"text-primary"},[e._v(" "+e._s(e.$t("Optimal results need proper task naming and connections."))+" ")])]),t("button",{staticClass:"m-2 btn btn-primary",on:{click:function(t){return e.onGenerateAssets()}}},[e._v(" "+e._s(e.$t("Create Assets with AI"))+" ")])])])],1)},Ix=[],Ox={name:"CreateAssetsButton",components:{InlineSvg:av},data:function(){return{proceC2Icon:f(7225),showPopover:!1}},methods:{onGenerateAssets:function(){this.showPopover=!1,this.$emit("onGenerateAssets")}}},Nx=Ox,Dx=(f(14015),f(64110),mo(Nx,Px,Ix,!1,null,"45c79e4f",null)),Rx=Dx.exports,Bx={components:{ValidateButton:ix,ValidateIssue:ux,ValidatePanel:vx,AiGenerateButton:Rx,MultiplayerViewUsers:Tx},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],o=t[1];return o.flatMap((function(e){return er(er({},e),{},{errorKey:n},{errorId:"".concat(e.id,"_").concat(e.message.split(" ").join("_"))})}))}))},numberOfErrors:function(){return this.errorList.length+this.warnings.length},isPackageAiInstalled:function(){var e;return null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isPackageAiInstalled}},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}}},Lx=Bx,jx=(f(8309),mo(Lx,Kw,Qw,!1,null,"691d97f7",null)),Fx=jx.exports,zx={name:"tool-bar",components:{Breadcrumb:Zw,TopRail:Fx,FontAwesomeIcon:Mr.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 Sb.getters.canUndo},canRedo:function(){return Sb.getters.canRedo},versionStatus:function(){var e=Sb.getters.isDraft?"Draft":"Published";return this.$t(e)},isVersionsInstalled:function(){return Sb.getters.isVersionsInstalled},isLoading:function(){return Sb.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||Sb.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.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)}},Ux=zx,qx=(f(91503),mo(Ux,Vw,Ww,!1,null,null,null)),Hx=qx.exports;function Vx(e,t){var n=function(e){return e.isBpmnType("bpmn:MessageFlow",To,No)||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 o="flowElements";(e.isBpmnType("bpmn:TextAnnotation")||e.isBpmnType("bpmn:Association"))&&(o="artifacts"),t.get(o).push(e.definition)}}var Wx={methods:{zoomInOutHandler:function(e,t){var n="+"===e.key||"NumpadAdd"===e.key||107===e.keyCode||187===e.keyCode,o="-"===e.key||"NumpadSubtract"===e.key||109===e.keyCode||189===e.keyCode;n&&t.mod&&this.zoomIn(e),o&&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)}}},Gx={methods:{undoRedoHandler:function(e,t){var n=e.key.toLowerCase(),o="y"===n,r="z"===n;r&&t.mod&&this.undo(e),o&&t.mod&&this.redo(e)},undo:function(e){e.preventDefault(),this.$root.$emit("undo-keyboard-shortcut")},redo:function(e){e.preventDefault(),this.$root.$emit("redo-keyboard-shortcut")}}},$x={methods:{copyPasteHandler:function(e,t){var n=e.target.nodeName.toLowerCase(),o="body"===n,r=e.key.toLowerCase(),i="c"===r,s="v"===r;o&&i&&t.mod&&this.copy(e),o&&s&&t.mod&&this.paste(e)},copy:function(e){e.preventDefault(),window.ProcessMaker.$modeler.copyElement()},paste:function(e){e.preventDefault(),window.ProcessMaker.$modeler.pasteElements()}}},Xx=(f(51532),Iw.gridSize/2),Yx=new Map;Yx.set("Up",[0,-Xx]),Yx.set("Down",[0,Xx]),Yx.set("Left",[-Xx,0]),Yx.set("Right",[Xx,0]);var Jx=["PoolLane","processmaker.components.nodes.boundaryEvent.Shape"];function Zx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(Kx(e)){var o=t.filter(Qx);if(0!==o.length){var r=ek(e),i=jt(r,2),s=i[0],a=i[1];o.forEach((function(e){e.translate(s,a,{movedWithArrowKeys:!0}),nk(e)})),n()}}}function Kx(e){var t=["up","down","left","right"];return t.some((function(t){return e.toLowerCase().includes(t)}))}function Qx(e){return e&&!Jx.includes(e.get("type"))}function ek(e){var t=e.match(/^(?:Arrow)?(Up|Down|Left|Right)$/);return null!==t?Yx.get(t[1]):[0,0]}function tk(e){return!e||"processmaker.modeler.bpmn.pool"!==e.get("type")}function nk(e){var t=e.getParentCell();tk(t)||(t.component.expandToFitElement(e,t),t.component.laneSet&&t.component.updateLaneChildren())}var ok={methods:{escapeKeyHandler:function(e){this.selectedNode&&(e.preventDefault(),window.ProcessMaker.EventBus.$emit("custom-pointerclick",e))}},computed:{selectedNode:function(){return Pg.getters.getSelectedNode},movedElement:function(){return Pg.getters.getGhostNode}}},rk={mixins:[Wx,$x,ok,Gx],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.undoRedoHandler(e,t),this.copyPasteHandler(e,t),this.escapeKeyHandler(e)},keyupListener:function(e){"Space"===e.code&&(this.panMode=!1)},keydownListener:function(e){var t=this.isAppleOS(),n=t?e.metaKey:e.ctrlKey,o={mod:n,isAppleOS:t,modeler:this};try{this.handleHotkeys(e,o)}catch(i){console.error(i)}var r=!e.target.toString().toLowerCase().includes("body");if(!r){if("Space"===e.code){if(this.panMode)return;this.panMode=!0}Zx(e.key,Un.getters.highlightedShapes,this.pushToUndoStack)}},startPanning:function(){this.panning=!0,this.paperManager.addEventHandler("blank:pointermove",this.blankMoveHandler),this.paperManager.addEventHandler("cell:pointermove",this.cellMoveHandler)},blankMoveHandler:function(e,t,n){this.checkCanvasDragPosition(t,n),this.translatePaper(e)},cellMoveHandler:function(e,t,n,o){this.checkCanvasDragPosition(n,o),this.translatePaper(t)},checkCanvasDragPosition:function(e,t){if(!this.canvasDragPosition){var n=this.paperManager.scale;this.canvasDragPosition={x:e*n.sx,y:t*n.sy}}},translatePaper:function(e){this.clientLeftPaper||this.paperManager.translate(e.offsetX-this.canvasDragPosition.x,e.offsetY-this.canvasDragPosition.y)},stopPanning:function(){this.paperManager.removeEventHandler("blank:pointermove",this.blankMoveHandler),this.paperManager.removeEventHandler("cell:pointermove",this.cellMoveHandler),this.panning=!1}}};f(74819);function ik(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Wr(e),null===e)break;return e}function sk(){return sk="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=ik(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},sk.apply(this,arguments)}var ak,ck=function(e){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"clone",value:function(e,t,o){return this.withTimerKeys(sk(Wr(n.prototype),"clone",this).call(this,e,t,o))}},{key:"withTimerKeys",value:function(e){var t=this,o=n.timerPropertyKeys.find((function(e){return t.definition.eventDefinitions[0][e]}));return e.definition.eventDefinitions[0][o]||(e.definition.eventDefinitions[0][o]={}),e.definition.eventDefinitions[0][o].body=this.definition.eventDefinitions[0][o].body,e}}]),n}(pr);function lk(e){return dk.apply(this,arguments)}function dk(){return dk=l(a().mark((function e(t){var n,o,r;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=uk(t),o=document.querySelector('[name="name"]')||document.querySelector('[name="text"]'),n&&o&&document.activeElement!==o){e.next=4;break}return e.abrupt("return");case 4:if(r=document.getElementById("accordion-button-Configuration"),!r||"false"!==r.getAttribute("aria-expanded")){e.next=10;break}return clearTimeout(ak),r.click(),e.next=10,hk();case 10:n.style.outline="1px dashed blue",o.addEventListener("blur",(function(){n.style.outline=""})),o.focus(),o.select();case 14:case"end":return e.stop()}}),e)}))),dk.apply(this,arguments)}function uk(e){if(e.selectors)return e.selectors.label||Array.from(e.selectors.root.children).find((function(e){return e.classList.contains("labels")}))}function hk(){return new Promise((function(e){ak=setTimeout(e)}))}y(ck,"timerPropertyKeys",["timeDuration","timeDate","timeCycle"]);var pk=f(93162),fk=f.n(pk),mk=new WeakMap,gk=new WeakMap,vk=function(){function e(t){d(this,e),b(this,mk,{writable:!0,value:void 0}),b(this,gk,{writable:!0,value:void 0}),Tw(this,mk,t)}return g(e,[{key:"definitions",set:function(e){Tw(this,gk,e)}},{key:"getDefinitionsFromXml",value:function(e){var t=this;return new Promise((function(n,o){k(t,mk).fromXML(e,(function(e,r){e&&o(e),r.exporter="ProcessMaker Modeler",r.exporterVersion="1.0",t.cleanBrokenReferences(r),n(r)}))}))}},{key:"cleanBrokenReferences",value:function(e){var t=e.rootElements,n=e.diagrams,o=[];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||o.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&&!o.includes(e.bpmnElement)})))}))}},{key:"download",value:function(){k(this,gk)&&k(this,mk).toXML(k(this,gk),{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"});fk().saveAs(n)}}))}}]),e}();function bk(e){return e.isStartEvent()?nr:e.isTask()?sr:e.isGateway()?cr:e.isIntermediateEvent()?dr:e.isEndEvent()?rr:null}function yk(e){if(!e)return!1;var t=bk(e);return!t||!Object.values(t).includes(e.definition.name)}function wk(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 xk(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}))}))})),o=t.filter((function(e){return!e.id}));return[].concat(W(n),W(o))}var kk=function(){function e(t,n,o,r,i,s){d(this,e),this._nodeThatWillBeReplaced=t,this._definition=n,this._graph=o,this._newNode=r,this._processes=i,this._collaboration=s}return g(e,[{key:"migrate",value:function(){var e,t,n=this;yk(this._nodeThatWillBeReplaced)&&(this._definition.name=this._nodeThatWillBeReplaced.definition.name);var o=[],r=function(e){var t,r=n._graph.getLinks().find((function(t){return t.component&&t.component.node.definition===e})),i=r.component.node;i._modelerId+="_replaced";var s=[];null===(t=i.diagram.waypoint)||void 0===t||t.forEach((function(e){s.push({x:e.x,y:e.y})})),o.push({id:i.definition.id,type:i.type,name:i.definition.name,waypoint:s,sourceRefId:i.definition.sourceRef.id,targetRefId:i.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),r(e)})),i.forEach((function(e){e.set("targetRef",n._newNode.definition),n._handleSequenceFlowForGateway(e),r(e)}));var a=wk(this._nodeThatWillBeReplaced,this._processes);if(a.forEach((function(e){e.set("targetRef",n._newNode.definition),r(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),r(e)})),c.filter((function(e){return e.targetRef===n._nodeThatWillBeReplaced.definition})).forEach((function(e){e.set("targetRef",n._newNode.definition),r(e)}))}window.ProcessMaker.EventBus.$emit("multiplayer-updateFlows",o)}},{key:"_handleSequenceFlowForGateway",value:function(e){var t=["bpmn:ExclusiveGateway","bpmn:InclusiveGateway"].includes(e.sourceRef.$type);t||delete e.conditionExpression}}]),e}(),Ck=["bpmn:ServiceTask","bpmn:ManualTask","bpmn:CallActivity","bpmn:ScriptTask"],Sk=function(e){if(-1!==Ck.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,o,r,i,s,a){t(e,n,o,r,i,s),e=cf(e,n,o,r,i,a),s(e,a)},e.inspectorData=function(e,t,o){var r=n?n(e,t,o):t(e);return lf(r,e,t,o),r}}},Ek={methods:{cloneNodesSelection:function(){var e=this,t=[],n=[],o=[],r=[],i=[],s=this.highlightedNodes,a=this.$refs.selector.$el,c=[gl,dl,eo,El,fr],l=[Oo],d=[Mo];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);r.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):o.push(p)}})),t=[].concat(W(t),o),this.connectClonedFlows(n,t),this.connectClonedDataInputAssociations(r,t),this.connectClonedDataOutputAssociations(i,t),t},getDataInputOutputAssociationTargetRef:function(e){if("bpmn:DataInput"===e.targetRef.$type){var t=e.targetRef.$parent;return Vo(t,this)}if("bpmn:DataInputAssociation"===e.targetRef.$type){var n=e.targetRef.$parent;return Vo(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(),o=n.height,r=this.paper.scale(),i=r.sy,s=o/i;return t.diagram.bounds.y+=s,t.setIds(this.nodeIdGenerator),t},connectClonedFlows:function(e,t){var n=this;e.forEach((function(e){var o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef,i=o.definition.targetRef,s=t.find((function(e){return e.cloneOf===r.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 o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef[0],i=t.find((function(e){return e.cloneOf===r.id})),s=n.getDataInputOutputAssociationTargetRef(o.definition),a=t.find((function(e){return e.cloneOf===s.id})),c=Ho(n.moddle,a,i.definition);c.$parent.$parent=a.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 o=n.nodes.find((function(t){return t.definition.id===e.cloneOf})),r=o.definition.sourceRef||o.definition.$parent,i=o.definition.targetRef,s=t.find((function(e){return e.cloneOf===r.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]))}))}}},Ak=["bpmn:Task","bpmn:UserTask","bpmn:GlobalTask","bpmn:CallActivity","bpmn:ScriptTask","bpmn:ServiceTask"],_k=["processmaker-modeler-task","processmaker-modeler-manual-task","processmaker-modeler-script-task","processmaker-modeler-call-activity","processmaker-modeler-intermediate-catch-timer-event","processmaker-modeler-intermediate-signal-catch-event","processmaker-modeler-intermediate-signal-throw-event","processmaker-modeler-intermediate-message-catch-event","processmaker-modeler-intermediate-message-throw-event","processmaker-modeler-intermediate-conditional-catch-event"],Mk={data:function(){return{linkModel:null,hoveredLinkModel:null,originalHoveredLink:null,originalColor:null,activeElement:null,timeout:null,tooltipEl:null,clickPosition:null,currentMovingModel:null,currentMovingModelCanBisect:null}},watch:{hoveredLinkModel:function(){this.hoveredLinkModel?(this.originalColor=this.hoveredLinkModel.attr("line/stroke"),this.originalHoveredLink=this.hoveredLinkModel,this.hoveredLinkModel.attr("line/stroke",qn),this.addElementTooltip()):(this.resetLinkColor(),this.removeElementTooltip())}},computed:{ghostNode:function(){return Pg.getters.getGhostNode}},methods:{linkEditingInit:function(){var e=this;this.paperManager.addEventHandler("cell:mouseover",(function(t){var n;null!==t&&void 0!==t&&null!==(n=t.model)&&void 0!==n&&n.isLink()&&e.addingEligibleItem()&&(e.timeout=setTimeout((function(){e.hoveredLinkModel=t.model}),1e3))})),this.paperManager.addEventHandler("cell:mouseout",(function(){clearTimeout(e.timeout),e.timeout=null,e.hoveredLinkModel&&(e.hoveredLinkModel=null)})),this.paperManager.addEventHandler("element:pointermove",(function(t,n){if(e.canBisectCached(t.model)){var o=e.findViewFromPoint(t,n),r=null===o||void 0===o?void 0:o.model;null!==r&&void 0!==r&&r.isLink()?e.hoveredLinkModel===r||e.timeout||(e.timeout=setTimeout((function(){e.hoveredLinkModel=r,e.linkModel=r,e.activeElement=t.model}),1e3)):(clearTimeout(e.timeout),e.timeout=null,e.hoveredLinkModel&&(e.hoveredLinkModel=null,e.linkModel=null,e.activeElement=null))}})),this.paperManager.addEventHandler("element:pointerup",(function(t,n){e.linkModel&&e.canBisect(t.model)&&(e.clickPosition={x:n.clientX,y:n.clientY},e.paperManager.performAtomicAction((function(){e.bisectElement(t.model,e.linkModel),e.hoveredLinkModel=null,e.linkModel=null,e.activeElement=null})))})),this.$on("node-added",(function(t){e.bisectNode(t)})),window.ProcessMaker.EventBus.$on("capture-hovered-link",(function(t){e.clickPosition={x:t.clientX,y:t.clientY},e.linkModel=e.hoveredLinkModel}))},findViewFromPoint:function(e,t){var n=Array.from(document.elementsFromPoint(t.clientX,t.clientY));while(n.length>0){var o=n.shift(),r=this.paper.findView(o);if(r&&r!==e)return r}return null},isLink:function(e){return e.component&&"standard.Link"===e.attributes.type},canBisect:function(e){var t=this.getBpmnTypes(e),n=t.some((function(e){return Ak.includes(e)}));if(n)return!0;var o=this.getAlternateType(e);return _k.includes(o)},canBisectCached:function(e){var t=!1;return this.currentMovingModel===e?t=this.currentMovingModelCanBisect:(t=this.canBisect(e),this.currentMovingModel=e,this.currentMovingModelCanBisect=t),t},getBpmnTypes:function(e){var t,n=null===(t=e.component)||void 0===t||null===(t=t.node)||void 0===t||null===(t=t.definition)||void 0===t?void 0:t.$type,o=e.bpmnType||[];return Array.isArray(o)||(o=[o]),n?[n]:o},getAlternateType:function(e){var t;return e.type?e.type:null===(t=e.component)||void 0===t||null===(t=t.node)||void 0===t?void 0:t.type},bisectNode:function(e){var t=this;if(this.linkModel){var n=e.definition.id,o=this.getElementByNodeId(n);if(this.canBisect(o)){var r=o.size();this.paperManager.performAtomicAction((function(){o.translate(-Math.round(r.width/2),-Math.round(r.height/2)),t.bisectElement(o,t.linkModel),t.$refs.selector.updateSelectionBox()})),this.hoveredLinkModel=null,this.linkModel=null}}},bisectElement:function(e,t){var n=t.getTargetCell();t.component.setTarget(e);var o=t.component.node.definition,r=e.component.node.definition,i=o.get("targetRef"),s=i.get("incoming");i.set("incoming",s.filter((function(e){return e!==o}))),o.set("targetRef",r),r.get("incoming").push(o);var a=t.vertices(),c=this.paper.findViewByModel(t),l=this.paper.clientToLocalPoint(this.clickPosition),d=c.getVertexIndex(l.x,l.y);a.length>0&&d--;var u=[];a.forEach((function(e,t){t>d&&u.push(e)}));var h=d+1;while(a.length>h)t.removeVertex(h),a=t.vertices();var p=t.component.node.diagram,f=p.get("waypoint");f.pop();var m=this.moddle.create("dc:Point",this.getCenterPosition(e));p.set("waypoint",[].concat(W(f),[m])),this.newOutgoingLink(e,n,u)},getCenterPosition:function(e){var t=e.size(),n=e.position();return{x:n.x+t.width/2,y:n.y+t.height/2}},newOutgoingLink:function(e,t,n){var o=n.map((function(e){return{x:e.x,y:e.y}})),r=new ul(this.nodeRegistry,this.moddle,this.paper),i=[this.getCenterPosition(e)].concat(W(o),[this.getCenterPosition(t)]),s=r.makeFlowNode(e,t,i);this.addNode(s)},resetLinkColor:function(){this.originalHoveredLink&&this.originalHoveredLink.attr("line/stroke",this.originalColor)},addingEligibleItem:function(){var e=Pg.getters.getSelectedNode;return!(!e||!this.canBisect(e))},addElementTooltip:function(){var e=document.createElement("div");e.innerHTML=this.$t("Drop to add to this flow"),e.classList.add("element-tooltip"),document.body.appendChild(e),document.addEventListener("mousemove",this.setTooltipPosition),e.style.zIndex="9999",this.tooltipEl=e,this.setTooltipPosition()},setTooltipPosition:function(){var e=0,t=0;if(this.activeElement){var n=this.activeElement.position(),o=this.activeElement.size(),r={x:n.x+o.width/2,y:n.y+o.height},i=this.paper.localToClientPoint(r),s={x:i.x-this.tooltipEl.offsetWidth/2,y:i.y+10};e=s.x,t=s.y}else if(this.ghostNode){var a={x:this.ghostNode.offsetLeft+this.ghostNode.offsetWidth/2,y:this.ghostNode.offsetTop+this.ghostNode.offsetHeight},c={x:a.x-this.tooltipEl.offsetWidth/2,y:a.y+10};e=c.x,t=c.y}this.tooltipEl.style.left=e+"px",this.tooltipEl.style.top=t+"px"},removeElementTooltip:function(){this.tooltipEl&&(document.removeEventListener("mousemove",this.setTooltipPosition),document.body.removeChild(this.tooltipEl),this.tooltipEl=null)}}},Tk={data:function(){return{hasTransparency:{}}},methods:{initTransparentDragging:function(){var e=this;this.paperManager.addEventHandler("cell:pointerup blank:pointerup",(function(){e.removeTransparency()})),this.graph.on("change:position",(function(t){e.addTransparency(t)})),this.$on("node-added",(function(t){var n=t.definition.id,o=e.getElementByNodeId(n),r=e.paper.findViewByModel(o);e.removeTransparency(r)}))},addTransparency:function(e){if(!(e.id in this.hasTransparency)){var t=this.paper.findViewByModel(e);F.highlighters.addClass.add(t,"root","transparent-highlighter",{className:"transparent-cell"}),this.hasTransparency[e.id]=t}},removeTransparency:function(){var e=!1;Object.values(this.hasTransparency).forEach((function(t){F.dia.HighlighterView.remove(t,"transparent-highlighter"),e=!0})),e&&this.paper.dumpViews()}}},Pk=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}}),t("PanControl",{attrs:{"pan-mode":e.panMode},on:{"set-pan-mode":function(t){return e.$emit("set-pan-mode",t)}}})],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)])},Ik=[],Ok=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)},Nk=[],Dk=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"})])},Rk=[],Bk=new WeakMap,Lk=function(){function e(t){d(this,e),b(this,Bk,{writable:!0,value:void 0}),Tw(this,Bk,t)}return g(e,[{key:"miniMap",get:function(){return k(this,Bk)}},{key:"scaleMiniMap",value:function(){this.miniMap.scaleContentToFit({padding:10,maxScaleX:.5,maxScaleY:.5})}},{key:"calculateNewPaperPosition",value:function(e,t,n,o,r,i){var s=this.miniMap.paperToLocalPoint(e,t),a=s.x,c=s.y;return{newX:r/2-a*n,newY:i/2-c*o}}}],[{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}(),jk={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,o=this.paperManager.scale,r=o.sx,i=o.sy,s=this.paperManager.paper.el,a=s.clientWidth,c=s.clientHeight,l=this.miniMapManager.calculateNewPaperPosition(t,n,r,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=Lk.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)}},Fk=jk,zk=(f(63564),mo(Fk,Dk,Rk,!1,null,"76e95759",null)),Uk=zk.exports,qk={components:{InlineSvg:av,MiniPaper:Uk},props:{paperManager:Object,graph:Object},data:function(){return{miniMapOpen:!1,miniMapIcon:f(65759)}}},Hk=qk,Vk=(f(88357),mo(Hk,Ok,Nk,!1,null,"c47d089c",null)),Wk=Vk.exports,Gk=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)])},$k=[],Xk={components:{InlineSvg:av},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}}},Yk=Xk,Jk=(f(5365),mo(Yk,Gk,$k,!1,null,"576edbd4",null)),Zk=Jk.exports,Kk=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)])},Qk=[],eC={components:{InlineSvg:av},props:{isRendering:{type:Boolean}},data:function(){return{undoIcon:f(28994),redoIcon:f(45617)}},mounted:function(){this.$root.$on("undo-keyboard-shortcut",this.undo),this.$root.$on("redo-keyboard-shortcut",this.redo)},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 Sb.getters.canUndo},canRedo:function(){return Sb.getters.canRedo}},methods:{undo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.dispatch("undo").then((function(){return e.$emit("load-xml")}))},redo:function(){var e=this;this.$emit("clearSelection"),this.isRendering||Sb.dispatch("redo").then((function(){return e.$emit("load-xml")}))}}},tC=eC,nC=(f(36121),mo(tC,Kk,Qk,!1,null,"0e178ceb",null)),oC=nC.exports,rC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pan-tool-box"},[t("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"pan-tool-button",class:e.panMode?"pan-tool-button-active":"",attrs:{type:"button","data-cy":"pan-button",title:e.$t("Pan Tool")},on:{click:function(t){return e.$emit("set-pan-mode",!e.panMode)}}},[t("inline-svg",{attrs:{src:e.icon}})],1)])},iC=[],sC={components:{InlineSvg:av},props:{panMode:{type:Boolean,default:!1}},data:function(){return{icon:f(3258)}}},aC=sC,cC=(f(86212),f(93086),mo(aC,rC,iC,!1,null,"692394e7",null)),lC=cC.exports,dC=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:{mousedown:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n,"down")},mouseup:function(t){return t.stopPropagation(),e.onClickControlHandler(t,n,"up")}}},[t("SubmenuPopper",{attrs:{data:n,selectedItem:e.selectedSubmenuItem,popperType:e.popperType},on:{mouseDownSubmenu:function(t,n){return e.clickToSubmenuHandler(t,n,"down")},mouseUpSubmenu:function(t,n){return e.clickToSubmenuHandler(t,n,"up")}}})],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()},uC=[],hC=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,o){return t("li",{key:o,class:["control-submenu-list",{active:e.selectedItem===n.type}],attrs:{"data-test":n.type},on:{mousedown:function(t){return t.stopPropagation(),e.$emit("mouseDownSubmenu",t,n)},mouseup:function(t){return t.stopPropagation(),e.$emit("mouseUpSubmenu",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)?t("inline-svg",{attrs:{src:e.data.icon}}):t("i",{staticClass:"fa-lg",class: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)?t("inline-svg",{attrs:{src:e.data.icon}}):t("i",{staticClass:"fa-lg",class:e.data.icon})],1)},pC=[],fC=f(95951),mC=f.n(fC),gC=(f(44301),{mixins:[Ug],props:{data:{type:Object},selectedItem:{type:String},popperType:{type:String}},components:{Popper:mC(),InlineSvg:av},data:function(){return{wasClickedSubmenu:!1,element:null,wasClicked:!1}}}),vC=gC,bC=(f(19731),mo(vC,hC,pC,!1,null,"78e713ce",null)),yC=bC.exports,wC={components:{SubmenuPopper:yC,InlineSvg:av},props:{nodeTypes:Array},mixins:[qg],data:function(){return{plusIcon:f(29943),currentType:null}},created:function(){Pg.dispatch("getUserPinnedObjects")},computed:{controls:function(){return Pg.getters.getPinnedNodeTypes},explorerOpen:function(){return Pg.getters.getExplorerOpen}},methods:{clickToSubmenuHandler:function(e,t,n){"up"!==n?(window.ProcessMaker.EventBus.$off("custom-pointerclick"),this.wasClicked=!1,this.parent=this.selectedItem,this.selectedSubmenuItem=t.control.type,this.startDragNewObject(e,t)):this.cancelDragNewObject()},onClickControlHandler:function(e,t,n){"up"!==n?(this.selectedSubmenuItem=null,this.popperType=this.currentType===t.type?null:t.type,this.startDragNewObject(e,t),this.currentType=this.popperType):this.cancelDragNewObject()},toggleExplorer:function(){this.deselect(),this.popperType=null,this.selectedSubmenuItem=null,Pg.commit("toggleExplorer"),Pg.commit("clearFilteredNodes"),Pg.commit("clearFilteredPmBlockNodes")}}},xC=wC,kC=(f(32890),mo(xC,dC,uC,!1,null,"317b8b6e",null)),CC=kC.exports,SC={components:{MiniPaperControl:Wk,PanControl:lC,ZoomControl:Zk,UndoRedoControl:oC,Controls:CC},props:{paperManager:Object,graph:Object,isRendering:Boolean,nodeTypes:Array,panMode:Boolean},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,n,o=e[0].target.getBoundingClientRect(),r=null===(t=this.$refs.zoomBox)||void 0===t?void 0:t.$el.getBoundingClientRect(),i=null===(n=this.$refs.undoRedoBox)||void 0===n?void 0:n.$el.getBoundingClientRect();if(this.overlap&&i){if(o.width<this.widthOverlapControl){var s=window.getComputedStyle(this.$refs.zoomBox.$el),a=parseInt(s.paddingLeft,10)+parseInt(s.paddingRight,10),c=window.getComputedStyle(this.$refs.railLeftBox),l=parseInt(c.paddingLeft,10)+parseInt(c.paddingRight,10),d=this.leftOverlapUndoRedo+(this.widthOverlapControl-o.width)-a-l;d>r.right&&(this.overlap=!1)}}else(null===i||void 0===i?void 0:i.left)<(null===r||void 0===r?void 0:r.right)&&(this.overlap=!0,this.widthOverlapControl=o.width,this.leftOverlapUndoRedo=i.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)})))()}},EC=SC,AC=(f(59657),mo(EC,Pk,Ik,!1,null,"2a9e260d",null)),_C=AC.exports,MC=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))},TC=[],PC=function(e){Vr(n,e);var t=Yr(n);function n(){return d(this,n),t.apply(this,arguments)}return g(n,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=Io(this.moddle),i=Po(this.moddle);i.set("sourceRef",e.component.node.definition),i.set("targetRef",t.component.node.definition),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var s=new pr(Mo,i,r);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,o=$()(t,"component.node"),r=$()(n,"component.node");if(!r)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=o.definition.$type,d=r.definition.$type,u="bpmn:DataStoreReference"===o.definition.$type,h="bpmn:DataObjectReference"===o.definition.$type,p="bpmn:DataStoreReference"===r.definition.$type,f="bpmn:DataObjectReference"===r.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!Kr.isNodeDisallowedFromDataAssociation(e)}}]),n}(Kr),IC=[{type:"processmaker-modeler-text-annotation",factory:PC},{type:"processmaker-modeler-sequence-flow",factory:ul},{type:"processmaker-modeler-message-flow",factory:wl}],OC={name:fr,components:{CrownConfig:Ms},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 IC.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=IC.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),o=this.shape.findView(this.paper),r=[o.sourceAnchor.toJSON(),o.targetAnchor.toJSON()];this.$emit("replace-generic-flow",{actualFlow:n.makeFlowNode(this.sourceShape,this.target,r),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}},NC=OC,DC=mo(NC,MC,TC,!1,null,null,null),RC=DC.exports,BC=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()},LC=[],jC=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()},FC=[],zC=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()},UC=[],qC=function(e){return e.position().y+e.size().height},HC=function(e){return e.position().x},VC=function(e){return e.position().x+e.size().width/2},WC=function(e){return e.position().y+e.size().height/2},GC=function(e){return e.position().x+e.size().width},$C=function(e){return e.position().y},XC=function(e){return Boolean(e&&e.position&&e.size)},YC={poolLane:"PoolLane",boundaryEvent:"processmaker.components.nodes.boundaryEvent.Shape"},JC=[YC.boundaryEvent,YC.poolLane],ZC=function(e){return!JC.includes(e.get("type"))};function KC(e){return XC(e)&&ZC(e)}function QC(e,t){var n=t-qC(e);e.translate(0,n)}function eS(e,t){var n=t-HC(e);e.translate(n,0)}function tS(e,t){var n=t-GC(e);e.translate(n,0)}function nS(e,t){var n=t-VC(e);e.translate(n,0)}function oS(e,t){var n=t-WC(e);e.translate(0,n)}function rS(e,t){var n=t-$C(e);e.translate(0,n)}function iS(e){var t=pS(e);e.forEach((function(e){eS(e,t.left)}))}function sS(e){var t=pS(e);e.forEach((function(e){tS(e,t.right)}))}function aS(e){var t=pS(e);e.forEach((function(e){rS(e,t.top)}))}function cS(e){var t=pS(e);e.forEach((function(e){QC(e,t.bottom)}))}function lS(e){var t=pS(e);e.forEach((function(e){nS(e,t.hMiddle)}))}function dS(e){var t=pS(e);e.forEach((function(e){oS(e,t.vMiddle)}))}function uS(e){var t=pS(e),n=e.length,o=3;if(!(n<o)){var r=e.reduce((function(e,t){return t.size().height+e}),0),i=e.sort((function(e,t){return WC(e)-WC(t)})),s=t.top+e[0].size().height,a=(t.height-r)/(i.length-1);i.forEach((function(e,t){0!==t&&(rS(e,s+a),s+=a+e.size().height)}))}}function hS(e){var t=pS(e),n=e.length,o=3;if(!(n<o)){var r=e.reduce((function(e,t){return t.size().width+e}),0),i=e.sort((function(e,t){return VC(e)-VC(t)})),s=t.left+e[0].size().width,a=(t.width-r)/(i.length-1);i.forEach((function(e,t){0!==t&&(eS(e,s+a),s+=a+e.size().width)}))}}function pS(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 XC(e)?e.position().x:0},n=function(e){return XC(e)?e.position().x+e.size().width:0},o=function(e){return XC(e)?e.position().y:0},r=function(e){return XC(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(o))),c=Math.max.apply(Math,W(e.map(r))),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 fS(e){var t=e.filter((function(e){return KC(e)})),n=pS(e),o=t.length>1;return{can:{align:{left:o&&t.some((function(e){return HC(e)!==n.left})),horizontalCenter:o&&t.some((function(e){return VC(e)!==n.hMiddle})),right:o&&t.some((function(e){return GC(e)!==n.right})),bottom:o&&t.some((function(e){return qC(e)!==n.bottom})),verticalCenter:o&&t.some((function(e){return WC(e)!==n.vMiddle})),top:o&&t.some((function(e){return $C(e)!==n.top}))},distribute:{horizontally:o&&t.length>2,vertically:o&&t.length>2}},align:{left:function(){return iS(t)},horizontalCenter:function(){return lS(t)},right:function(){return sS(t)},bottom:function(){return cS(t)},verticalCenter:function(){return dS(t)},top:function(){return aS(t)}},distribute:{horizontally:function(){return hS(t)},vertically:function(){return uS(t)}}}}var mS={components:{FontAwesomeIcon:Mr.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),mr.library.add(Cr),mr.library.add(kr),mr.library.add(Sr),mr.library.add(Er),mr.library.add(xr),mr.library.add(wr),mr.library.add(_r),mr.library.add(Ar)},watch:{selectedShapes:function(){this.$root.$emit("bv::hide::tooltip")}},computed:{selectedShapes:function(){return this.disableButtons(),fS(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=fS(Un.getters.highlightedShapes);this.buttons.forEach((function(t){t.disabled=!(0,Ao.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)})))()}},gS=mS,vS=(f(81856),f(69100),mo(gS,zC,UC,!1,null,"46e3ac40",null)),bS=vS.exports,yS={props:{paper:Object,hasPools:Boolean},components:{crownAlign:bS,FontAwesomeIcon:Mr.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),mr.library.add(kr)},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)})))()}},wS=yS,xS=(f(6718),mo(wS,jC,FC,!1,null,"bcd827ec",null)),kS=xS.exports,CS={name:"Selection",components:{CrownMultiselect:kS},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:[fr],selectableBlackList:[fr],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===Jr||e.model.component.node.type===dl}))}},watch:{selected:function(e){this.prepareConectedLinks(e),this.addToHighlightedNodes(e),this.highlightNodesMultiplayer(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 o(){var r;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=t.length>1&&void 0!==t[1]&&t[1],!e.model.component||!n.selectableBlackList.includes(e.model.component.node.type)){o.next=3;break}return o.abrupt("return");case 3:return n.showLasso=!0,n.isSelected=!0,n.isSelecting=!0,n.start=null,r?n.shiftKeySelectionHandler(e):n.selected=[e],n.filterSelected(),o.next=11,n.$nextTick();case 11:!1===Un.getters.isReadOnly&&n.updateSelectionBox();case 12:case"end":return o.stop()}}),o)})))()},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 o=this.selected.find((function(e){return e.model.component.node.type===Jr}));o&&e.model.component.node.type!==Jr?this.selected=[e]:e.model.component&&e.model.component.node.type===Jr?this.hasOnlyPools(this.selected)?this.selectOrUnselectShape(e):this.selected=[e]:e.model.component&&e.model.component.node.pool&&(o=this.getPool(this.selected),o&&e.model.component.node.pool.id!==o.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),o=n.clientX,r=n.clientY,i=n.offsetX,s=n.offsetY,a=t.$el.offset();this.clearSelection(),this.isSelecting=!0,this.showLasso=!0,this.start={x:o-a.left+window.pageXOffset+t.$el.scrollLeft(),y:r-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),o=t.$el.offset(),r={x:n.clientX-o.left+window.pageXOffset+t.$el.scrollLeft(),y:n.clientY-o.top+window.pageYOffset+t.$el.scrollTop()},i={height:r.y-this.start.y,width:r.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},o=this.$el.clientWidth,r=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();o/=s.sx,r/=s.sy;var a=F.g.rect(i.x,i.y,o,r);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],o=this.paperManager.paper,r=o.findViewsInArea(e,t);return n?(this.graph.getLinks().forEach((function(t){e.intersect(t.getBBox())&&r.push(o.findViewByModel(t))})),r):r},isPositionWithinArea:function(e,t){var n=t.x,o=t.y,r=t.width,i=t.height;return e.x>=n&&e.x<=n+r&&e.y>=o&&e.y<=o+i},prepareConectedLinks:function(e){var t=this,n=this.paperManager.paper;this.connectedLinks=[],this.isValidSelectionLinks=!0,e.forEach((function(e){var o=t.graph.getConnectedLinks(e.model);if(e.model.component&&e.model.component.node.type===Jr){var r=e.model.getBBox(),i=n.model.getLinks().filter((function(e){var n=e.getSourcePoint(),o=e.getTargetPoint();return t.isPositionWithinArea(n,r)||t.isPositionWithinArea(o,r)}));i&&(o=[].concat(W(o),W(i)))}o.forEach((function(e){var o=n.findViewByModel(e);t.connectedLinks.some((function(e){return e.id===o.id}))||(t.connectedLinks.push(o),t.validateSelectionLinks(o))}))}))},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],o={x:1/0,y:1/0},r={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);o.x=Math.min(o.x,n.x),o.y=Math.min(o.y,n.y),r.width=Math.max(r.width,n.x+n.width),r.height=Math.max(r.height,n.y+n.height)})),{minX:o.x,minY:o.y,maxX:r.width,maxY:r.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,Mo,Oo,eo,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 o=n.model.getParentCell();if(o.component&&o.component.node.pool)return!t.includes(o.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===Jr}));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,o=t.clientY-this.mouseY;this.top+=o,this.left+=n,this.mouseX=t.clientX,this.mouseY=t.clientY;var r=this.paperManager.paper.scale();this.style.left="".concat(this.left,"px"),this.style.top="".concat(this.top,"px"),this.translateSelectedShapes(n/r.sx,o/r.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)),window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",e.getConnectedLinkProperties(e.connectedLinks)));case 9:case"end":return t.stop()}}),t)})))()},getProperties:function(e){var t=this,n=[],o=["PoolLane","standard.Link"];return e.filter((function(e){return!o.includes(e.model.get("type"))})).forEach((function(e){if("processmaker.modeler.bpmn.pool"===e.model.get("type")){var o=e.model.component.getElementsUnderArea(e.model,t.graph).filter((function(e){return e.component}));n=[].concat(W(n),W(t.getContainerProperties(o,n)))}else{var r,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!==(r=null===(i=e.model.component.node.definition.get("attachedToRef"))||void 0===i?void 0:i.id)&&void 0!==r?r: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},getConnectedLinkProperties:function(e){var t=[];return null===e||void 0===e||e.forEach((function(e){var n=e.model.component.shape.vertices();if(null!==n&&void 0!==n&&n.length){var o,r=[],i=e.model.component.node;null===(o=i.diagram.waypoint)||void 0===o||o.forEach((function(e){r.push({x:e.x,y:e.y})}));var s=e.sourceView.model.component.node.definition.id,a=e.targetView.model.component.node.definition.id,c=e.model.component.node.type;t.push({id:i.definition.id,properties:{type:c,waypoint:r,sourceRefId:s,targetRefId:a}})}})),t},getBoundariesChangesForShape:function(e){var t=[],n=[Uy,Yy,nw,dw,bw,Aw],o=Un.getters.nodes.filter((function(e){return n.includes(e.type)}));return o.forEach((function(n){var o,r,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!==(o=null===(r=n.definition.get("attachedToRef"))||void 0===r?void 0:r.id)&&void 0!==o?o:null,color:null!==(i=n.definition.get("color"))&&void 0!==i?i:null}})})),t},getContainerProperties:function(e){var t=[];return e.forEach((function(e){var n,o,r={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")}};"bpmn:BoundaryEvent"===e.component.node.definition.$type&&(r.properties.attachedToRefId=null!==(n=null===(o=e.component.node.definition.get("attachedToRef"))||void 0===o?void 0:o.id)&&void 0!==n?n:null);t.push(r)})),t},updateFlowsWaypoint:function(){var e;null===(e=this.connectedLinks)||void 0===e||e.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 o=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"],r=this.selected.filter((function(e){return!o.includes(e.model.get("type"))}));if(n&&r.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();r.forEach((function(n){return n.model.translate(e,t)}))},getShapesFromPoint:function(e){var t=F.util.normalizeEvent(e),n=t.clientX,o=t.clientY,r=(0,F.V)(this.paperManager.paper.viewport).toLocalPoint(n,o);return this.paperManager.paper.findViewsFromPoint(r)},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)},highlightNodesMultiplayer:function(e){window.ProcessMaker.EventBus.$emit("multiplayer-updateSelectedNodes",this.getSelectedNodeKeys(e))},getSelectedNodeKeys:function(e){var t=[];return e.forEach((function(e){var n=e.model.component.node;t.push(n.definition.id)})),t},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},o=this.$el.clientWidth,r=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();o/=s.sx,r/=s.sy;var a=F.g.rect(i.x,i.y,o,r);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===Jr&&(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===Jr})),n=e.find((function(e){var t=e.model;return t.getParentCell()&&t.getParentCell().component.node.type===Jr}));return!!t||!n}return!1},overPoolDrag:function(e){if(!this.isNotPoolChilds(this.selected)){var t=this.getPool(this.selected),n=this.getShapesFromPoint(e),o=n.find((function(e){return e.model.component&&e.model.component.node.type===Jr}));this.newPool=null,this.oldPool=null,o?(this.paperManager.setStateValid(),this.invalidPool&&(this.invalidPool.model.component.shape.attr("body/fill",Ye),this.invalidPool=null),t&&t.model.get("id")!==o.model.get("id")&&(this.newPool=o,this.oldPool=t,this.isOutOfThePool=!1,this.isValidSelectionLinks||(this.isOutOfThePool=!0,this.invalidPool=o,o.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.moveConnectedLinks(e.connectedLinks,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,o,r,i;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.initialPosition.left-e.left,o=e.initialPosition.top-e.top,e.style.left="".concat(e.initialPosition.left,"px"),e.style.top="".concat(e.initialPosition.top,"px"),r=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/r.sx,o/r.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===Jr})).model.getParentCell(),n=this.getSelectionVertex(this.selected,!0),o=t.getBBox(),r=o.x,i=o.y,s=o.width,a=o.height,c=n.maxX-n.minX,l=n.maxY-n.minY,d=n.minX-r,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<rm+am&&(g=s+(rm+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===Jr}));t&&(t.model.getParentCell(),t.model.component.laneSet&&t.component.updateLaneChildren())}},moveElements:function(e,t,n){var o=["PoolLane","standard.Link","processmaker.components.nodes.boundaryEvent.Shape"];e.filter((function(e){return!o.includes(e.model.get("type"))})).forEach((function(e){t.model.component.moveElement(e.model,n.model)}))},moveConnectedLinks:function(e,t,n){e.forEach((function(e){t.model.component.moveFlow(e.model,n.model)}))}}},SS=CS,ES=(f(86165),mo(SS,BC,LC,!1,null,"6c7ebacb",null)),AS=ES.exports,_S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"remote-cursor",style:{left:e.data.cursor.left+"px",top:e.data.cursor.top+"px"}},[t("svg",{attrs:{width:"23",height:"19",viewBox:"0 0 23 19",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{d:"M11.5 17.5L2 1L20.5 7L13 9L11.5 17.5Z",stroke:e.stroke,fill:e.data.color}})]),t("div",{staticClass:"remote-username"},[e._v(" "+e._s(e.data.name)+" ")])])},MS=[],TS={props:{data:{type:Object}},data:function(){return{cursorIcon:f(61264)}},computed:{stroke:function(){return"#212529"}}},PS=TS,IS=(f(65263),mo(PS,_S,MS,!1,null,"77208d93",null)),OS=IS.exports;function NS(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=H(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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(1439),f(87585),f(15016),f(55315);const DS=Object.create(null);DS["open"]="0",DS["close"]="1",DS["ping"]="2",DS["pong"]="3",DS["message"]="4",DS["upgrade"]="5",DS["noop"]="6";const RS=Object.create(null);Object.keys(DS).forEach((e=>{RS[DS[e]]=e}));const BS={type:"error",data:"parser error"},LS="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),jS="function"===typeof ArrayBuffer,FS=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,zS=({type:e,data:t},n,o)=>LS&&t instanceof Blob?n?o(t):US(t,o):jS&&(t instanceof ArrayBuffer||FS(t))?n?o(t):US(new Blob([t]),o):o(DS[e]+(t||"")),US=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function qS(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let HS;function VS(e,t){return LS&&e.data instanceof Blob?e.data.arrayBuffer().then(qS).then(t):jS&&(e.data instanceof ArrayBuffer||FS(e.data))?t(qS(e.data)):void zS(e,!1,(e=>{HS||(HS=new TextEncoder),t(HS.encode(e))}))}const WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",GS="undefined"===typeof Uint8Array?[]:new Uint8Array(256);for(let f=0;f<WS.length;f++)GS[WS.charCodeAt(f)]=f;const $S=e=>{let t,n,o,r,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=GS[e.charCodeAt(t)],o=GS[e.charCodeAt(t+1)],r=GS[e.charCodeAt(t+2)],i=GS[e.charCodeAt(t+3)],d[c++]=n<<2|o>>4,d[c++]=(15&o)<<4|r>>2,d[c++]=(3&r)<<6|63&i;return l},XS="function"===typeof ArrayBuffer,YS=(e,t)=>{if("string"!==typeof e)return{type:"message",data:ZS(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:JS(e.substring(1),t)};const o=RS[n];return o?e.length>1?{type:RS[n],data:e.substring(1)}:{type:RS[n]}:BS},JS=(e,t)=>{if(XS){const n=$S(e);return ZS(n,t)}return{base64:!0,data:e}},ZS=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},KS=String.fromCharCode(30),QS=(e,t)=>{const n=e.length,o=new Array(n);let r=0;e.forEach(((e,i)=>{zS(e,!1,(e=>{o[i]=e,++r===n&&t(o.join(KS))}))}))},eE=(e,t)=>{const n=e.split(KS),o=[];for(let r=0;r<n.length;r++){const e=YS(n[r],t);if(o.push(e),"error"===e.type)break}return o};function tE(){return new TransformStream({transform(e,t){VS(e,(n=>{const o=n.length;let r;if(o<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,o);else if(o<65536){r=new Uint8Array(3);const e=new DataView(r.buffer);e.setUint8(0,126),e.setUint16(1,o)}else{r=new Uint8Array(9);const e=new DataView(r.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(o))}e.data&&"string"!==typeof e.data&&(r[0]|=128),t.enqueue(r),t.enqueue(n)}))}})}let nE;function oE(e){return e.reduce(((e,t)=>e+t.length),0)}function rE(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let o=0;for(let r=0;r<t;r++)n[r]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),n}function iE(e,t){nE||(nE=new TextDecoder);const n=[];let o=0,r=-1,i=!1;return new TransformStream({transform(s,a){n.push(s);while(1){if(0===o){if(oE(n)<1)break;const e=rE(n,1);i=128===(128&e[0]),r=127&e[0],o=r<126?3:126===r?1:2}else if(1===o){if(oE(n)<2)break;const e=rE(n,2);r=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),o=3}else if(2===o){if(oE(n)<8)break;const e=rE(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue(BS);break}r=i*Math.pow(2,32)+t.getUint32(4),o=3}else{if(oE(n)<r)break;const e=rE(n,r);a.enqueue(YS(i?e:nE.decode(e),t)),o=0}if(0===r||r>e){a.enqueue(BS);break}}}})}const sE=4;function aE(e){if(e)return cE(e)}function cE(e){for(var t in aE.prototype)e[t]=aE.prototype[t];return e}aE.prototype.on=aE.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},aE.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},aE.prototype.off=aE.prototype.removeListener=aE.prototype.removeAllListeners=aE.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r=0;r<o.length;r++)if(n=o[r],n===t||n.fn===t){o.splice(r,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},aE.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(n){n=n.slice(0);o=0;for(var r=n.length;o<r;++o)n[o].apply(this,t)}return this},aE.prototype.emitReserved=aE.prototype.emit,aE.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},aE.prototype.hasListeners=function(e){return!!this.listeners(e).length};const lE=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())();function dE(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const uE=lE.setTimeout,hE=lE.clearTimeout;function pE(e,t){t.useNativeTimers?(e.setTimeoutFn=uE.bind(lE),e.clearTimeoutFn=hE.bind(lE)):(e.setTimeoutFn=lE.setTimeout.bind(lE),e.clearTimeoutFn=lE.clearTimeout.bind(lE))}const fE=1.33;function mE(e){return"string"===typeof e?gE(e):Math.ceil((e.byteLength||e.size)*fE)}function gE(e){let t=0,n=0;for(let o=0,r=e.length;o<r;o++)t=e.charCodeAt(o),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(o++,n+=4);return n}function vE(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function bE(e){let t={},n=e.split("&");for(let o=0,r=n.length;o<r;o++){let e=n[o].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}class yE extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class wE extends aE{constructor(e){super(),this.writable=!1,pE(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new yE(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=YS(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=vE(e);return t.length?"?"+t:""}}const xE="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kE=64,CE={};let SE,EE=0,AE=0;function _E(e){let t="";do{t=xE[e%kE]+t,e=Math.floor(e/kE)}while(e>0);return t}function ME(){const e=_E(+new Date);return e!==SE?(EE=0,SE=e):e+"."+_E(EE++)}for(;AE<kE;AE++)CE[xE[AE]]=AE;let TE=!1;try{TE="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(PN){}const PE=TE;function IE(e){const t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||PE))return new XMLHttpRequest}catch(n){}if(!t)try{return new(lE[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}function OE(){}function NE(){}const DE=function(){const e=new IE({xdomain:!1});return null!=e.responseType}();class RE extends wE{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=DE&&!t,this.opts.withCredentials&&(this.cookieJar=OE())}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)};eE(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,QS(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]=ME()),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 BE(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 BE extends aE{constructor(e,t){super(),pE(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=dE(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new IE(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(o){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(o){}try{n.setRequestHeader("Accept","*/*")}catch(o){}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(o){return void this.setTimeoutFn((()=>{this.onError(o)}),0)}"undefined"!==typeof document&&(this.index=BE.requestsCount++,BE.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=NE,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete BE.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(BE.requestsCount=0,BE.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",LE);else if("function"===typeof addEventListener){const e="onpagehide"in lE?"pagehide":"unload";addEventListener(e,LE,!1)}function LE(){for(let e in BE.requests)BE.requests.hasOwnProperty(e)&&BE.requests[e].abort()}const jE=(()=>{const e="function"===typeof Promise&&"function"===typeof Promise.resolve;return e?e=>Promise.resolve().then(e):(e,t)=>t(e,0)})(),FE=lE.WebSocket||lE.MozWebSocket,zE=!0,UE="arraybuffer",qE="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class HE extends wE{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=qE?{}:dE(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=zE&&!qE?t?new FE(e,t):new FE(e):new FE(e,t,n)}catch(PN){return this.emitReserved("error",PN)}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],o=t===e.length-1;zS(n,this.supportsBinary,(e=>{const t={};if(!zE&&(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{zE?this.ws.send(e):this.ws.send(e,t)}catch(r){}o&&jE((()=>{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]=ME()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!FE}}class VE extends wE{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=iE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),o=tE();o.readable.pipeTo(e.writable),this.writer=o.writable.getWriter();const r=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),r())})).catch((e=>{}))};r();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],o=t===e.length-1;this.writer.write(n).then((()=>{o&&jE((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}const WE={websocket:HE,webtransport:VE,polling:RE},GE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$E=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function XE(e){const t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let r=GE.exec(e||""),i={},s=14;while(s--)i[$E[s]]=r[s]||"";return-1!=n&&-1!=o&&(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=YE(i,i["path"]),i.queryKey=JE(i,i["query"]),i}function YE(e,t){const n=/\/{2,9}/g,o=t.replace(n,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||o.splice(0,1),"/"==t.slice(-1)&&o.splice(o.length-1,1),o}function JE(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,o){t&&(n[t]=o)})),n}class ZE extends aE{constructor(e,t={}){super(),this.binaryType=UE,this.writeBuffer=[],e&&"object"===typeof e&&(t=e,e=null),e?(e=XE(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=XE(t.host).host),pE(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=bE(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=sE,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 WE[e](n)}open(){let e;if(this.opts.rememberUpgrade&&ZE.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;ZE.priorWebsocketSuccess=!1;const o=()=>{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;ZE.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 r(){n||(n=!0,l(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,r(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function c(e){t&&e.name!==t.name&&r()}const l=()=>{t.removeListener("open",o),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",o),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",ZE.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+=mE(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,o){if("function"===typeof t&&(o=t,t=void 0),"function"===typeof n&&(o=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const r={type:e,data:t,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),o&&this.once("flush",o),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){ZE.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 o=e.length;for(;n<o;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}ZE.protocol=sE;ZE.protocol;function KE(e,t="",n){let o=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),o=XE(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const r=-1!==o.host.indexOf(":"),i=r?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+i+":"+o.port+t,o.href=o.protocol+"://"+i+(n&&n.port===o.port?"":":"+o.port),o}const QE="function"===typeof ArrayBuffer,eA=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,tA=Object.prototype.toString,nA="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===tA.call(Blob),oA="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===tA.call(File);function rA(e){return QE&&(e instanceof ArrayBuffer||eA(e))||nA&&e instanceof Blob||oA&&e instanceof File}function iA(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(iA(e[t]))return!0;return!1}if(rA(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return iA(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&iA(e[n]))return!0;return!1}function sA(e){const t=[],n=e.data,o=e;return o.data=aA(n,t),o.attachments=t.length,{packet:o,buffers:t}}function aA(e,t){if(!e)return e;if(rA(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 o=0;o<e.length;o++)n[o]=aA(e[o],t);return n}if("object"===typeof e&&!(e instanceof Date)){const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=aA(e[o],t));return n}return e}function cA(e,t){return e.data=lA(e.data,t),delete e.attachments,e}function lA(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]=lA(e[n],t);else if("object"===typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lA(e[n],t));return e}const dA=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],uA=5;var hA;(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"})(hA||(hA={}));class pA{constructor(e){this.replacer=e}encode(e){return e.type!==hA.EVENT&&e.type!==hA.ACK||!iA(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===hA.EVENT?hA.BINARY_EVENT:hA.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==hA.BINARY_EVENT&&e.type!==hA.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=sA(e),n=this.encodeAsString(t.packet),o=t.buffers;return o.unshift(n),o}}function fA(e){return"[object Object]"===Object.prototype.toString.call(e)}class mA extends aE{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===hA.BINARY_EVENT;n||t.type===hA.BINARY_ACK?(t.type=n?hA.EVENT:hA.ACK,this.reconstructor=new gA(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!rA(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===hA[n.type])throw new Error("unknown packet type "+n.type);if(n.type===hA.BINARY_EVENT||n.type===hA.BINARY_ACK){const o=t+1;while("-"!==e.charAt(++t)&&t!=e.length);const r=e.substring(o,t);if(r!=Number(r)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(r)}if("/"===e.charAt(t+1)){const o=t+1;while(++t){const n=e.charAt(t);if(","===n)break;if(t===e.length)break}n.nsp=e.substring(o,t)}else n.nsp="/";const o=e.charAt(t+1);if(""!==o&&Number(o)==o){const o=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(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(!mA.isPayloadValid(n.type,o))throw new Error("invalid payload");n.data=o}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case hA.CONNECT:return fA(t);case hA.DISCONNECT:return void 0===t;case hA.CONNECT_ERROR:return"string"===typeof t||fA(t);case hA.EVENT:case hA.BINARY_EVENT:return Array.isArray(t)&&("number"===typeof t[0]||"string"===typeof t[0]&&-1===dA.indexOf(t[0]));case hA.ACK:case hA.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class gA{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=cA(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function vA(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const bA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yA extends aE{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=[vA(e,"open",this.onopen.bind(this)),vA(e,"packet",this.onpacket.bind(this)),vA(e,"error",this.onerror.bind(this)),vA(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(bA.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:hA.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof t[t.length-1]){const e=this.ids++,o=t.pop();this._registerAckCallback(e,o),n.id=e}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,r=this.flags.volatile&&(!o||!this.connected);return r||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const o=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===o)return void(this.acks[e]=t);const r=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"))}),o);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((o,r)=>{t.push(((e,t)=>n?e?r(e):o(t):o(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,...o)=>{if(n!==this._queue[0])return;const r=null!==e;return r?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...o)),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:hA.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 hA.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 hA.EVENT:case hA.BINARY_EVENT:this.onevent(e);break;case hA.ACK:case hA.BINARY_ACK:this.onack(e);break;case hA.DISCONNECT:this.ondisconnect();break;case hA.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(...o){n||(n=!0,t.packet({type:hA.ACK,id:e,data:o}))}}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:hA.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 wA(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}wA.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)},wA.prototype.reset=function(){this.attempts=0},wA.prototype.setMin=function(e){this.ms=e},wA.prototype.setMax=function(e){this.max=e},wA.prototype.setJitter=function(e){this.jitter=e};class xA extends aE{constructor(e,t){var o;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,pE(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!==(o=t.randomizationFactor)&&void 0!==o?o:.5),this.backoff=new wA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||n;this.encoder=new r.Encoder,this.decoder=new r.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 ZE(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=vA(t,"open",(function(){n.onopen(),e&&e()})),r=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=vA(t,"error",r);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{o(),r(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(o),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(vA(e,"ping",this.onping.bind(this)),vA(e,"data",this.ondata.bind(this)),vA(e,"error",this.onerror.bind(this)),vA(e,"close",this.onclose.bind(this)),vA(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){jE((()=>{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 yA(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 kA={};function CA(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};const n=KE(e,t.path||"/socket.io"),o=n.source,r=n.id,i=n.path,s=kA[r]&&i in kA[r]["nsps"],a=t.forceNew||t["force new connection"]||!1===t.multiplex||s;let c;return a?c=new xA(o,t):(kA[r]||(kA[r]=new xA(o,t)),c=kA[r]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(CA,{Manager:xA,Socket:yA,io:CA,connect:CA});const SA=()=>new Map,EA=e=>{const t=SA();return e.forEach(((e,n)=>{t.set(n,e)})),t},AA=(e,t,n)=>{let o=e.get(t);return void 0===o&&e.set(t,o=n()),o},_A=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},MA=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},TA=()=>new Set,PA=e=>e[e.length-1],IA=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},OA=Array.from,NA=Array.isArray;class DA{constructor(){this._observers=SA()}on(e,t){AA(this._observers,e,TA).add(t)}once(e,t){const n=(...o)=>{this.off(e,n),t(...o)};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 OA((this._observers.get(e)||SA()).values()).forEach((e=>e(...t)))}destroy(){this._observers=SA()}}const RA=Math.floor,BA=(Math.ceil,Math.abs),LA=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),jA=(e,t)=>e>t?e:t,FA=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),zA=String.fromCharCode,UA=(String.fromCodePoint,zA(65535),e=>e.toLowerCase()),qA=/^\s*/g,HA=e=>e.replace(qA,""),VA=/([A-Z])/g,WA=(e,t)=>HA(e.replace(VA,(e=>`${t}${UA(e)}`))),GA=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=t.codePointAt(r);return o},$A="undefined"!==typeof TextEncoder?new TextEncoder:null,XA=e=>$A.encode(e),YA=$A?XA:GA;let JA="undefined"===typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});JA&&1===JA.decode(new Uint8Array).length&&(JA=null);const ZA=e=>void 0===e?null:e;class KA{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let QA=new KA,e_=!0;try{"undefined"!==typeof localStorage&&(QA=localStorage,e_=!1)}catch(IN){}const t_=QA,n_=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&n_(e,t,n+1)}},o_=e=>e,r_=(e,t)=>t.includes(e),i_="undefined"!==typeof process&&process.release&&/node|io\.js/.test(process.release.name);"undefined"!==typeof navigator&&/Mac/.test(navigator.platform);let s_;const a_=[],c_=()=>{if(void 0===s_)if(i_){s_=SA();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const o=e[n];"-"===o[0]?(null!==t&&s_.set(t,""),t=o):null!==t?(s_.set(t,o),t=null):a_.push(o)}null!==t&&s_.set(t,"")}else"object"===typeof location?(s_=SA(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");s_.set(`--${WA(t,"-")}`,n),s_.set(`-${WA(t,"-")}`,n)}}))):s_=SA();return s_},l_=e=>c_().has(e),d_=e=>ZA(i_?{VUE_APP_WEBSOCKET_PROVIDER_URL:"wss://collaborative-server.processmaker.net",VUE_APP_WEBSOCKET_PROVIDER:"socket.io",NODE_ENV:"production",BASE_URL:"/"}[e.toUpperCase()]:t_.getItem(e)),u_=e=>l_("--"+e)||null!==d_(e),h_=(u_("production"),i_&&r_({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"])),p_=!l_("no-colors")&&(!i_||process.stdout.isTTY||h_)&&(!i_||l_("color")||h_||null!==d_("COLORTERM")||(d_("TERM")||"").includes("color")),f_=e=>new Uint8Array(e),m_=(e,t,n)=>new Uint8Array(e,t,n),g_=e=>{const t=f_(e.byteLength);return t.set(e),t},v_=1,b_=2,y_=4,w_=8,x_=32,k_=64,C_=128,S_=31,E_=63,A_=127,__=2147483647,M_=Number.MAX_SAFE_INTEGER,T_=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"===typeof e&&isFinite(e)&&RA(e)===e));Number.isNaN,Number.parseInt;class P_{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const I_=()=>new P_,O_=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},N_=e=>{const t=new Uint8Array(O_(e));let n=0;for(let o=0;o<e.bufs.length;o++){const r=e.bufs[o];t.set(r,n),n+=r.length}return t.set(m_(e.cbuf.buffer,0,e.cpos),n),t},D_=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(m_(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*jA(n,t)),e.cpos=0)},R_=(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},B_=R_,L_=(e,t)=>{while(t>A_)R_(e,C_|A_&t),t=RA(t/128);R_(e,A_&t)},j_=(e,t)=>{const n=FA(t);n&&(t=-t),R_(e,(t>E_?C_:0)|(n?k_:0)|E_&t),t=RA(t/64);while(t>0)R_(e,(t>A_?C_:0)|A_&t),t=RA(t/128)},F_=new Uint8Array(3e4),z_=F_.length/3,U_=(e,t)=>{if(t.length<z_){const n=$A.encodeInto(t,F_).written||0;L_(e,n);for(let t=0;t<n;t++)R_(e,F_[t])}else W_(e,YA(t))},q_=(e,t)=>{const n=unescape(encodeURIComponent(t)),o=n.length;L_(e,o);for(let r=0;r<o;r++)R_(e,n.codePointAt(r))},H_=$A&&$A.encodeInto?U_:q_,V_=(e,t)=>{const n=e.cbuf.length,o=e.cpos,r=LA(n-o,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),o),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(jA(2*n,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},W_=(e,t)=>{L_(e,t.byteLength),V_(e,t)},G_=(e,t)=>{D_(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},$_=(e,t)=>G_(e,4).setFloat32(0,t,!1),X_=(e,t)=>G_(e,8).setFloat64(0,t,!1),Y_=(e,t)=>G_(e,8).setBigInt64(0,t,!1),J_=new DataView(new ArrayBuffer(4)),Z_=e=>(J_.setFloat32(0,e),J_.getFloat32(0)===e),K_=(e,t)=>{switch(typeof t){case"string":R_(e,119),H_(e,t);break;case"number":T_(t)&&BA(t)<=__?(R_(e,125),j_(e,t)):Z_(t)?(R_(e,124),$_(e,t)):(R_(e,123),X_(e,t));break;case"bigint":R_(e,122),Y_(e,t);break;case"object":if(null===t)R_(e,126);else if(NA(t)){R_(e,117),L_(e,t.length);for(let n=0;n<t.length;n++)K_(e,t[n])}else if(t instanceof Uint8Array)R_(e,116),W_(e,t);else{R_(e,118);const n=Object.keys(t);L_(e,n.length);for(let o=0;o<n.length;o++){const r=n[o];H_(e,r),K_(e,t[r])}}break;case"boolean":R_(e,t?120:121);break;default:R_(e,127)}};class Q_ extends P_{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&L_(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const eM=e=>{e.count>0&&(j_(e.encoder,1===e.count?e.s:-e.s),e.count>1&&L_(e.encoder,e.count-2))};class tM{constructor(){this.encoder=new P_,this.s=0,this.count=0}write(e){this.s===e?this.count++:(eM(this),this.count=1,this.s=e)}toUint8Array(){return eM(this),N_(this.encoder)}}const nM=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);j_(e.encoder,t),e.count>1&&L_(e.encoder,e.count-2)}};class oM{constructor(){this.encoder=new P_,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(nM(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return nM(this),N_(this.encoder)}}class rM{constructor(){this.sarr=[],this.s="",this.lensE=new tM}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 P_;return this.sarr.push(this.s),this.s="",H_(e,this.sarr.join("")),V_(e,this.lensE.toUint8Array()),N_(e)}}const iM=e=>new Error(e),sM=()=>{throw iM("Method unimplemented")},aM=()=>{throw iM("Unexpected case")},cM=iM("Unexpected end of array"),lM=iM("Integer out of Range");class dM{constructor(e){this.arr=e,this.pos=0}}const uM=e=>new dM(e),hM=e=>e.pos!==e.arr.length,pM=(e,t)=>{const n=m_(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},fM=e=>pM(e,gM(e)),mM=e=>e.arr[e.pos++],gM=e=>{let t=0,n=1;const o=e.arr.length;while(e.pos<o){const o=e.arr[e.pos++];if(t+=(o&A_)*n,n*=128,o<C_)return t;if(t>M_)throw lM}throw cM},vM=e=>{let t=e.arr[e.pos++],n=t&E_,o=64;const r=(t&k_)>0?-1:1;if(0===(t&C_))return r*n;const i=e.arr.length;while(e.pos<i){if(t=e.arr[e.pos++],n+=(t&A_)*o,o*=128,t<C_)return r*n;if(n>M_)throw lM}throw cM},bM=e=>{let t=gM(e);if(0===t)return"";{let n=String.fromCodePoint(mM(e));if(--t<100)while(t--)n+=String.fromCodePoint(mM(e));else while(t>0){const o=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+o);e.pos+=o,n+=String.fromCodePoint.apply(null,r),t-=o}return decodeURIComponent(escape(n))}},yM=e=>JA.decode(fM(e)),wM=JA?yM:bM,xM=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},kM=e=>xM(e,4).getFloat32(0,!1),CM=e=>xM(e,8).getFloat64(0,!1),SM=e=>xM(e,8).getBigInt64(0,!1),EM=[e=>{},e=>null,vM,kM,CM,SM,e=>!1,e=>!0,wM,e=>{const t=gM(e),n={};for(let o=0;o<t;o++){const t=wM(e);n[t]=AM(e)}return n},e=>{const t=gM(e),n=[];for(let o=0;o<t;o++)n.push(AM(e));return n},fM],AM=e=>EM[127-mM(e)](e);class _M extends dM{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),hM(this)?this.count=gM(this)+1:this.count=-1),this.count--,this.s}}class MM extends dM{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=vM(this);const e=FA(this.s);this.count=1,e&&(this.s=-this.s,this.count=gM(this)+2)}return this.count--,this.s}}class TM extends dM{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=vM(this),t=1&e;this.diff=RA(e/2),this.count=1,t&&(this.count=gM(this)+2)}return this.s+=this.diff,this.count--,this.s}}class PM{constructor(e){this.decoder=new MM(e),this.str=wM(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 IM=crypto.getRandomValues.bind(crypto),OM=(Math.random,()=>IM(new Uint32Array(1))[0]),NM=[1e7]+-1e3+-4e3+-8e3+-1e11,DM=()=>NM.replace(/[018]/g,(e=>(e^OM()&15>>e/4).toString(16))),RM=e=>new Promise(e);Promise.all.bind(Promise);class BM{constructor(e,t){this.left=e,this.right=t}}const LM=(e,t)=>new BM(e,t),jM="undefined"!==typeof document?document:{},FM=("undefined"!==typeof DOMParser&&new DOMParser,e=>_A(e,((e,t)=>`${t}:${e};`)).join("")),zM=(jM.ELEMENT_NODE,jM.TEXT_NODE,jM.CDATA_SECTION_NODE,jM.COMMENT_NODE,jM.DOCUMENT_NODE,jM.DOCUMENT_TYPE_NODE,jM.DOCUMENT_FRAGMENT_NODE,Symbol),UM=Date.now,qM=zM(),HM=zM(),VM=zM(),WM=zM(),GM=zM(),$M=zM(),XM=zM(),YM=zM(),JM=zM(),ZM=e=>{const t=[],n=[];let o=0;for(;o<e.length;o++){const r=e[o];r.constructor===String||r.constructor===Number?t.push(r):r.constructor===Object&&n.push(JSON.stringify(r))}return n};UM();const KM={[qM]:LM("font-weight","bold"),[HM]:LM("font-weight","normal"),[VM]:LM("color","blue"),[GM]:LM("color","green"),[WM]:LM("color","grey"),[$M]:LM("color","red"),[XM]:LM("color","purple"),[YM]:LM("color","orange"),[JM]:LM("color","black")},QM=e=>{const t=[],n=[],o=SA();let r=[],i=0;for(;i<e.length;i++){const r=e[i],s=KM[r];if(void 0!==s)o.set(s.left,s.right);else{if(r.constructor!==String&&r.constructor!==Number)break;{const e=FM(o);i>0||e.length>0?(t.push("%c"+r),n.push(e)):t.push(r)}}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||r.push(t)}return r},eT=p_?QM:ZM,tT=(...e)=>{console.log(...eT(e)),nT.forEach((t=>t.print(e)))},nT=TA();const oT=e=>({[Symbol.iterator](){return this},next:e}),rT=(e,t)=>oT((()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n})),iT=(e,t)=>oT((()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}})),sT=Object.assign,aT=Object.keys,cT=(e,t)=>{for(const n in e)t(e[n],n)},lT=e=>aT(e).length,dT=e=>{for(const t in e)return!1;return!0},uT=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},hT=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),pT=(e,t)=>e===t||lT(e)===lT(t)&&uT(e,((e,n)=>(void 0!==e||hT(t,n))&&t[n]===e));class fT{constructor(e,t){this.clock=e,this.len=t}}class mT{constructor(){this.clients=new Map}}const gT=(e,t,n)=>t.clients.forEach(((t,o)=>{const r=e.doc.store.clients.get(o);for(let i=0;i<t.length;i++){const o=t[i];wP(e,r,o.clock,o.len,n)}})),vT=(e,t)=>{let n=0,o=e.length-1;while(n<=o){const r=RA((n+o)/2),i=e[r],s=i.clock;if(s<=t){if(t<s+i.len)return r;n=r+1}else o=r-1}return null},bT=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==vT(n,t.clock)},yT=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 o=e[n-1],r=e[t];o.clock+o.len>=r.clock?o.len=jA(o.len,r.clock+r.len-o.clock):(n<t&&(e[n]=r),n++)}e.length=n}))},wT=e=>{const t=new mT;for(let n=0;n<e.length;n++)e[n].clients.forEach(((o,r)=>{if(!t.clients.has(r)){const i=o.slice();for(let t=n+1;t<e.length;t++)IA(i,e[t].clients.get(r)||[]);t.clients.set(r,i)}}));return yT(t),t},xT=(e,t,n,o)=>{AA(e.clients,t,(()=>[])).push(new fT(n,o))},kT=()=>new mT,CT=e=>{const t=kT();return e.clients.forEach(((e,n)=>{const o=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const r=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;o.push(new fT(r,i))}}o.length>0&&t.clients.set(n,o)})),t},ST=(e,t)=>{L_(e.restEncoder,t.clients.size),OA(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),L_(e.restEncoder,t);const o=n.length;L_(e.restEncoder,o);for(let r=0;r<o;r++){const t=n[r];e.writeDsClock(t.clock),e.writeDsLen(t.len)}}))},ET=e=>{const t=new mT,n=gM(e.restDecoder);for(let o=0;o<n;o++){e.resetDsCurVal();const n=gM(e.restDecoder),o=gM(e.restDecoder);if(o>0){const r=AA(t.clients,n,(()=>[]));for(let t=0;t<o;t++)r.push(new fT(e.readDsClock(),e.readDsLen()))}}return t},AT=(e,t,n)=>{const o=new mT,r=gM(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const r=gM(e.restDecoder),i=gM(e.restDecoder),s=n.clients.get(r)||[],a=uP(n,r);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<a){a<i&&xT(o,r,a,i-a);let e=pP(s,n),c=s[e];!c.deleted&&c.id.clock<n&&(s.splice(e+1,0,_O(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,_O(t,c,i-c.id.clock)),c.delete(t))}}else xT(o,r,n,i-n)}}if(o.clients.size>0){const e=new BT;return L_(e.restEncoder,0),ST(e,o),e.toUint8Array()}return null},_T=OM;class MT extends DA{constructor({guid:e=DM(),collectionid:t=null,gc:n=!0,gcFilter:o=(()=>!0),meta:r=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=o,this.clientID=_T(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new lP,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=r,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=RM((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>RM((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||MP(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(OA(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return MP(this,e,t)}get(e,t=QP){const n=AA(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),o=n.constructor;if(t!==QP&&o!==t){if(o===QP){const o=new t;o._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=o})),o._start=n._start;for(let e=o._start;null!==e;e=e.right)e.parent=o;return o._length=n._length,this.share.set(e,o),o._integrate(this,null),o}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,bI)}getText(e=""){return this.get(e,FI)}getMap(e=""){return this.get(e,xI)}getXmlFragment(e=""){return this.get(e,qI)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){OA(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new MT({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,MP(e.parent.doc,(n=>{const o=t.doc;e.deleted||n.subdocsAdded.add(o),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 TT{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return gM(this.restDecoder)}readDsLen(){return gM(this.restDecoder)}}class PT extends TT{readLeftID(){return oP(gM(this.restDecoder),gM(this.restDecoder))}readRightID(){return oP(gM(this.restDecoder),gM(this.restDecoder))}readClient(){return gM(this.restDecoder)}readInfo(){return mM(this.restDecoder)}readString(){return wM(this.restDecoder)}readParentInfo(){return 1===gM(this.restDecoder)}readTypeRef(){return gM(this.restDecoder)}readLen(){return gM(this.restDecoder)}readAny(){return AM(this.restDecoder)}readBuf(){return g_(fM(this.restDecoder))}readJSON(){return JSON.parse(wM(this.restDecoder))}readKey(){return wM(this.restDecoder)}}class IT{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=gM(this.restDecoder),this.dsCurrVal}readDsLen(){const e=gM(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class OT extends IT{constructor(e){super(e),this.keys=[],gM(e),this.keyClockDecoder=new TM(fM(e)),this.clientDecoder=new MM(fM(e)),this.leftClockDecoder=new TM(fM(e)),this.rightClockDecoder=new TM(fM(e)),this.infoDecoder=new _M(fM(e),mM),this.stringDecoder=new PM(fM(e)),this.parentInfoDecoder=new _M(fM(e),mM),this.typeRefDecoder=new MM(fM(e)),this.lenDecoder=new MM(fM(e))}readLeftID(){return new tP(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new tP(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 AM(this.restDecoder)}readBuf(){return fM(this.restDecoder)}readJSON(){return AM(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 NT{constructor(){this.restEncoder=I_()}toUint8Array(){return N_(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){L_(this.restEncoder,e)}writeDsLen(e){L_(this.restEncoder,e)}}class DT extends NT{writeLeftID(e){L_(this.restEncoder,e.client),L_(this.restEncoder,e.clock)}writeRightID(e){L_(this.restEncoder,e.client),L_(this.restEncoder,e.clock)}writeClient(e){L_(this.restEncoder,e)}writeInfo(e){B_(this.restEncoder,e)}writeString(e){H_(this.restEncoder,e)}writeParentInfo(e){L_(this.restEncoder,e?1:0)}writeTypeRef(e){L_(this.restEncoder,e)}writeLen(e){L_(this.restEncoder,e)}writeAny(e){K_(this.restEncoder,e)}writeBuf(e){W_(this.restEncoder,e)}writeJSON(e){H_(this.restEncoder,JSON.stringify(e))}writeKey(e){H_(this.restEncoder,e)}}class RT{constructor(){this.restEncoder=I_(),this.dsCurrVal=0}toUint8Array(){return N_(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,L_(this.restEncoder,t)}writeDsLen(e){0===e&&aM(),L_(this.restEncoder,e-1),this.dsCurrVal+=e}}class BT extends RT{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new oM,this.clientEncoder=new tM,this.leftClockEncoder=new oM,this.rightClockEncoder=new oM,this.infoEncoder=new Q_(B_),this.stringEncoder=new rM,this.parentInfoEncoder=new Q_(B_),this.typeRefEncoder=new tM,this.lenEncoder=new tM}toUint8Array(){const e=I_();return L_(e,0),W_(e,this.keyClockEncoder.toUint8Array()),W_(e,this.clientEncoder.toUint8Array()),W_(e,this.leftClockEncoder.toUint8Array()),W_(e,this.rightClockEncoder.toUint8Array()),W_(e,N_(this.infoEncoder)),W_(e,this.stringEncoder.toUint8Array()),W_(e,N_(this.parentInfoEncoder)),W_(e,this.typeRefEncoder.toUint8Array()),W_(e,this.lenEncoder.toUint8Array()),V_(e,N_(this.restEncoder)),N_(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){K_(this.restEncoder,e)}writeBuf(e){W_(this.restEncoder,e)}writeJSON(e){K_(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 LT=(e,t,n,o)=>{o=jA(o,t[0].id.clock);const r=pP(t,o);L_(e.restEncoder,t.length-r),e.writeClient(n),L_(e.restEncoder,o);const i=t[r];i.write(e,o-i.id.clock);for(let s=r+1;s<t.length;s++)t[s].write(e,0)},jT=(e,t,n)=>{const o=new Map;n.forEach(((e,n)=>{uP(t,n)>e&&o.set(n,e)})),dP(t).forEach(((e,t)=>{n.has(t)||o.set(t,0)})),L_(e.restEncoder,o.size),OA(o.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,o])=>{LT(e,t.clients.get(n),n,o)}))},FT=(e,t)=>{const n=SA(),o=gM(e.restDecoder);for(let r=0;r<o;r++){const o=gM(e.restDecoder),r=new Array(o),i=e.readClient();let s=gM(e.restDecoder);n.set(i,{i:0,refs:r});for(let n=0;n<o;n++){const o=e.readInfo();switch(S_&o){case 0:{const t=e.readLen();r[n]=new QI(oP(i,s),t),s+=t;break}case 10:{const t=gM(e.restDecoder);r[n]=new OO(oP(i,s),t),s+=t;break}default:{const a=0===(o&(k_|C_)),c=new MO(oP(i,s),null,(o&C_)===C_?e.readLeftID():null,null,(o&k_)===k_?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,a&&(o&x_)===x_?e.readString():null,TO(e,o));r[n]=c,s+=c.length}}}}return n},zT=(e,t,n)=>{const o=[];let r=OA(n.keys()).sort(((e,t)=>e-t));if(0===r.length)return null;const i=()=>{if(0===r.length)return null;let e=n.get(r[r.length-1]);while(e.refs.length===e.i){if(r.pop(),!(r.length>0))return null;e=n.get(r[r.length-1])}return e};let s=i();if(null===s&&0===o.length)return null;const a=new lP,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 o){const t=e.id.client,o=n.get(t);o?(o.i--,a.clients.set(t,o.refs.slice(o.i)),n.delete(t),o.i=0,o.refs=[]):a.clients.set(t,[e]),r=r.filter((e=>e!==t))}o.length=0};while(1){if(d.constructor!==OO){const r=AA(u,d.id.client,(()=>uP(t,d.id.client))),i=r-d.id.clock;if(i<0)o.push(d),l(d.id.client,d.id.clock-1),h();else{const r=d.getMissing(e,t);if(null!==r){o.push(d);const e=n.get(r)||{refs:[],i:0};if(e.refs.length!==e.i){d=e.refs[e.i++];continue}l(r,uP(t,r)),h()}else(0===i||i<d.length)&&(d.integrate(e,i),u.set(d.id.client,d.id.clock+d.length))}}if(o.length>0)d=o.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 BT;return jT(e,a,new Map),L_(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},UT=(e,t)=>jT(e,t.doc.store,t.beforeState),qT=(e,t,n,o=new OT(e))=>MP(t,(e=>{e.local=!1;let t=!1;const n=e.doc,r=n.store,i=FT(o,n),s=zT(e,r,i),a=r.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<uP(r,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=DP([a.update,s.update])}}else r.pendingStructs=s;const c=AT(o,e,r);if(r.pendingDs){const t=new OT(uM(r.pendingDs));gM(t.restDecoder);const n=AT(t,e,r);r.pendingDs=c&&n?DP([c,n]):c||n}else r.pendingDs=c;if(t){const t=r.pendingStructs.update;r.pendingStructs=null,HT(e.doc,t)}}),n,!1),HT=(e,t,n,o=OT)=>{const r=uM(t);qT(r,e,n,new o(r))},VT=(e,t,n)=>HT(e,t,n,PT),WT=(e,t,n=new Map)=>{jT(e,t.store,n),ST(e,CT(t.store))},GT=(e,t=new Uint8Array([0]),n=new BT)=>{const o=YT(t);WT(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(RP(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===DT)return OP(r.map(((e,t)=>0===t?e:zP(e))));if(n.constructor===BT)return DP(r)}return r[0]},$T=(e,t)=>GT(e,t,new DT),XT=e=>{const t=new Map,n=gM(e.restDecoder);for(let o=0;o<n;o++){const n=gM(e.restDecoder),o=gM(e.restDecoder);t.set(n,o)}return t},YT=e=>XT(new TT(uM(e)));class JT{constructor(){this.l=[]}}const ZT=()=>new JT,KT=(e,t)=>e.l.push(t),QT=(e,t)=>{const n=e.l,o=n.length;e.l=n.filter((e=>t!==e)),o===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},eP=(e,t,n)=>n_(e.l,[t,n]);class tP{constructor(e,t){this.client=e,this.clock=t}}const nP=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,oP=(e,t)=>new tP(e,t),rP=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw aM()};class iP{constructor(e,t){this.ds=e,this.sv=t}}const sP=(e,t)=>new iP(e,t),aP=(sP(kT(),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&&!bT(t.ds,e.id)),cP=(e,t)=>{const n=AA(e.meta,cP,TA),o=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<uP(o,n)&&vP(e,oP(n,t))})),gT(e,t.ds,(e=>{})),n.add(t))};class lP{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const dP=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const o=e[e.length-1];t.set(n,o.id.clock+o.length)})),t},uP=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const o=n[n.length-1];return o.id.clock+o.length},hP=(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 aM()}n.push(t)},pP=(e,t)=>{let n=0,o=e.length-1,r=e[o],i=r.id.clock;if(i===t)return o;let s=RA(t/(i+r.length-1)*o);while(n<=o){if(r=e[s],i=r.id.clock,i<=t){if(t<i+r.length)return s;n=s+1}else o=s-1;s=RA((n+o)/2)}throw aM()},fP=(e,t)=>{const n=e.clients.get(t.client);return n[pP(n,t.clock)]},mP=fP,gP=(e,t,n)=>{const o=pP(t,n),r=t[o];return r.id.clock<n&&r instanceof MO?(t.splice(o+1,0,_O(e,r,n-r.id.clock)),o+1):o},vP=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[gP(e,n,t.clock)]},bP=(e,t,n)=>{const o=t.clients.get(n.client),r=pP(o,n.clock),i=o[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==QI&&o.splice(r+1,0,_O(e,i,n.clock-i.id.clock+1)),i},yP=(e,t,n)=>{const o=e.clients.get(t.id.client);o[pP(o,t.id.clock)]=n},wP=(e,t,n,o,r)=>{if(0===o)return;const i=n+o;let s,a=gP(e,t,n);do{s=t[a++],i<s.id.clock+s.length&&gP(e,t,i),r(s)}while(a<t.length&&t[a].id.clock<i)};class xP{constructor(e,t,n){this.doc=e,this.deleteSet=new mT,this.beforeState=dP(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 kP=(e,t)=>!(0===t.deleteSet.clients.size&&!MA(t.afterState,((e,n)=>t.beforeState.get(n)!==e)))&&(yT(t.deleteSet),UT(e,t),ST(e,t.deleteSet),!0),CP=(e,t,n)=>{const o=t._item;(null===o||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&AA(e.changed,t,TA).add(n)},SP=(e,t)=>{let n=e[t],o=e[t-1],r=t;for(;r>0;n=o,o=e[--r-1]){if(o.deleted!==n.deleted||o.constructor!==n.constructor||!o.mergeWith(n))break;n instanceof MO&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,o)}const i=t-r;return i&&e.splice(t+1-i,i),i},EP=(e,t,n)=>{for(const[o,r]of e.clients.entries()){const e=t.clients.get(o);for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.clock+i.len;for(let o=pP(e,i.clock),r=e[o];o<e.length&&r.id.clock<s;r=e[++o]){const r=e[o];if(i.clock+i.len<=r.id.clock)break;r instanceof MO&&r.deleted&&!r.keep&&n(r)&&r.gc(t,!1)}}}},AP=(e,t)=>{e.clients.forEach(((e,n)=>{const o=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t],r=LA(o.length-1,1+pP(o,n.clock+n.len-1));for(let e=r,t=o[e];e>0&&t.id.clock>=n.clock;t=o[e])e-=1+SP(o,e)}}))},_P=(e,t)=>{if(t<e.length){const n=e[t],o=n.doc,r=o.store,i=n.deleteSet,s=n._mergeStructs;try{yT(i),n.afterState=dP(n.doc.store),o.emit("beforeObserverCalls",[n,o]);const e=[];n.changed.forEach(((t,o)=>e.push((()=>{null!==o._item&&o._item.deleted||o._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)),eP(t._dEH,e,n))}))})),e.push((()=>o.emit("afterTransaction",[n,o]))),n_(e,[]),n._needFormattingCleanup&&BI(n)}finally{o.gc&&EP(i,r,o.gcFilter),AP(i,r),n.afterState.forEach(((e,t)=>{const o=n.beforeState.get(t)||0;if(o!==e){const e=r.clients.get(t),n=jA(pP(e,o),1);for(let t=e.length-1;t>=n;)t-=1+SP(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,o=r.clients.get(t),i=pP(o,n);i+1<o.length&&SP(o,i+1)>1||i>0&&SP(o,i)}if(n.local||n.afterState.get(o.clientID)===n.beforeState.get(o.clientID)||(tT(YM,qM,"[yjs] ",HM,$M,"Changed the client-id because another client seems to be using it."),o.clientID=_T()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const e=new DT,t=kP(e,n);t&&o.emit("update",[e.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const e=new BT,t=kP(e,n);t&&o.emit("updateV2",[e.toUint8Array(),n.origin,o,n])}const{subdocsAdded:a,subdocsLoaded:c,subdocsRemoved:l}=n;(a.size>0||l.size>0||c.size>0)&&(a.forEach((e=>{e.clientID=o.clientID,null==e.collectionid&&(e.collectionid=o.collectionid),o.subdocs.add(e)})),l.forEach((e=>o.subdocs.delete(e))),o.emit("subdocs",[{loaded:c,added:a,removed:l},o,n]),l.forEach((e=>e.destroy()))),e.length<=t+1?(o._transactionCleanups=[],o.emit("afterAllTransactions",[o,e])):_P(e,t+1)}}},MP=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new xP(e,n,o),r.push(e._transaction),1===r.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===r[0];e._transaction=null,t&&_P(r,0)}}return s};function*TP(e){const t=gM(e.restDecoder);for(let n=0;n<t;n++){const t=gM(e.restDecoder),n=e.readClient();let o=gM(e.restDecoder);for(let r=0;r<t;r++){const t=e.readInfo();if(10===t){const t=gM(e.restDecoder);yield new OO(oP(n,o),t),o+=t}else if(0!==(S_&t)){const r=0===(t&(k_|C_)),i=new MO(oP(n,o),null,(t&C_)===C_?e.readLeftID():null,null,(t&k_)===k_?e.readRightID():null,r?e.readParentInfo()?e.readString():e.readLeftID():null,r&&(t&x_)===x_?e.readString():null,TO(e,t));yield i,o+=i.length}else{const t=e.readLen();yield new QI(oP(n,o),t),o+=t}}}}class PP{constructor(e,t){this.gen=TP(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===OO);return this.curr}}class IP{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const OP=e=>DP(e,PT,DT),NP=(e,t)=>{if(e.constructor===QI){const{client:n,clock:o}=e.id;return new QI(oP(n,o+t),e.length-t)}if(e.constructor===OO){const{client:n,clock:o}=e.id;return new OO(oP(n,o+t),e.length-t)}{const n=e,{client:o,clock:r}=n.id;return new MO(oP(o,r+t),null,oP(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},DP=(e,t=OT,n=BT)=>{if(1===e.length)return e[0];const o=e.map((e=>new t(uM(e))));let r=o.map((e=>new PP(e,!0))),i=null;const s=new n,a=new IP(s);while(1){if(r=r.filter((e=>null!==e.curr)),r.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===OO?1:-1:n}return t.curr.id.client-e.curr.id.client})),0===r.length)break;const e=r[0],t=e.curr.id.client;if(null!==i){let n=e.curr,o=!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(),o=!0;if(null===n||n.id.client!==t||o&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)LP(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===OO)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{LP(a,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length,o=new OO(oP(t,i.struct.id.clock+i.struct.length),e);i={struct:o,offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===OO?i.struct.length-=t:n=NP(n,t)),i.struct.mergeWith(n)||(LP(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!==OO;n=e.next())LP(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(LP(a,i.struct,i.offset),i=null),jP(a);const c=o.map((e=>ET(e))),l=wT(c);return ST(s,l),s.toUint8Array()},RP=(e,t,n=OT,o=BT)=>{const r=YT(t),i=new o,s=new IP(i),a=new n(uM(e)),c=new PP(a,!1);while(c.curr){const e=c.curr,t=e.id.client,n=r.get(t)||0;if(c.curr.constructor!==OO)if(e.id.clock+e.length>n){LP(s,e,jA(n-e.id.clock,0)),c.next();while(c.curr&&c.curr.id.client===t)LP(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()}jP(s);const l=ET(a);return ST(i,l),i.toUint8Array()},BP=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:N_(e.encoder.restEncoder)}),e.encoder.restEncoder=I_(),e.written=0)},LP=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&BP(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),L_(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},jP=e=>{BP(e);const t=e.encoder.restEncoder;L_(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const o=e.clientStructs[n];L_(t,o.written),V_(t,o.restEncoder)}},FP=(e,t,n,o)=>{const r=new n(uM(e)),i=new PP(r,!1),s=new o,a=new IP(s);for(let l=i.curr;null!==l;l=i.next())LP(a,t(l),0);jP(a);const c=ET(r);return ST(s,c),s.toUint8Array()},zP=e=>FP(e,o_,OT,DT),UP="You must not compute changes after the event-handler fired.";class qP{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=HP(this.currentTarget,this.target))}deletes(e){return bT(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw iM(UP);const e=new Map,t=this.target,n=this.transaction.changed.get(t);n.forEach((n=>{if(null!==n){const o=t._map.get(n);let r,i;if(this.adds(o)){let e=o.left;while(null!==e&&this.adds(e))e=e.left;if(this.deletes(o)){if(null===e||!this.deletes(e))return;r="delete",i=PA(e.content.getContent())}else null!==e&&this.deletes(e)?(r="update",i=PA(e.content.getContent())):(r="add",i=void 0)}else{if(!this.deletes(o))return;r="delete",i=PA(o.content.getContent())}e.set(n,{action:r,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 iM(UP);const t=this.target,n=TA(),o=TA(),r=[];e={added:n,deleted:o,delta:r,keys:this.keys};const i=this.transaction.changed.get(t);if(i.has(null)){let e=null;const i=()=>{e&&r.push(e)};for(let r=t._start;null!==r;r=r.right)r.deleted?this.deletes(r)&&!this.adds(r)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=r.length,o.add(r)):this.adds(r)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(r.content.getContent()),n.add(r)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=r.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const HP=(e,t)=>{const n=[];while(null!==t._item&&t!==e){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,o=t._item.parent._start;while(o!==t._item&&null!==o)o.deleted||e++,o=o.right;n.unshift(e)}t=t._item.parent}return n},VP=80;let WP=0;class GP{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=WP++}}const $P=e=>{e.timestamp=WP++},XP=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=WP++},YP=(e,t,n)=>{if(e.length>=VP){const o=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return XP(o,t,n),o}{const o=new GP(t,n);return e.push(o),o}},JP=(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)=>BA(t-e.index)<BA(t-n.index)?e:n));let o=e._start,r=0;null!==n&&(o=n.p,r=n.index,$P(n));while(null!==o.right&&r<t){if(!o.deleted&&o.countable){if(t<r+o.length)break;r+=o.length}o=o.right}while(null!==o.left&&r>t)o=o.left,!o.deleted&&o.countable&&(r-=o.length);while(null!==o.left&&o.left.id.client===o.id.client&&o.left.id.clock+o.left.length===o.id.clock)o=o.left,!o.deleted&&o.countable&&(r-=o.length);return null!==n&&BA(n.index-r)<o.parent.length/VP?(XP(n,o,r),n):YP(e._searchMarker,o,r)},ZP=(e,t,n)=>{for(let o=e.length-1;o>=0;o--){const r=e[o];if(n>0){let t=r.p;t.marker=!1;while(t&&(t.deleted||!t.countable))t=t.left,t&&!t.deleted&&t.countable&&(r.index-=t.length);if(null===t||!0===t.marker){e.splice(o,1);continue}r.p=t,t.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=jA(t,r.index+n))}},KP=(e,t,n)=>{const o=e,r=t.changedParentTypes;while(1){if(AA(r,e,(()=>[])).push(n),null===e._item)break;e=e._item.parent}eP(o._eH,n,t)};class QP{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=ZT(),this._dEH=ZT(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw sM()}clone(){throw sM()}_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){KT(this._eH,e)}observeDeep(e){KT(this._dEH,e)}unobserve(e){QT(this._eH,e)}unobserveDeep(e){QT(this._dEH,e)}toJSON(){}}const eI=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let o=n-t;const r=[];let i=e._start;while(null!==i&&o>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&&o>0;n++)r.push(e[n]),o--;t=0}}i=i.right}return r},tI=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},nI=(e,t)=>{let n=0,o=e._start;while(null!==o){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let o=0;o<r.length;o++)t(r[o],n++,e)}o=o.right}},oI=(e,t)=>{const n=[];return nI(e,((o,r)=>{n.push(t(o,r,e))})),n},rI=e=>{let t=e._start,n=null,o=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(),o=0,t=t.right}const e=n[o++];return n.length<=o&&(n=null),{done:!1,value:e}}}},iI=(e,t)=>{const n=JP(e,t);let o=e._start;for(null!==n&&(o=n.p,t-=n.index);null!==o;o=o.right)if(!o.deleted&&o.countable){if(t<o.length)return o.content.getContent()[t];t-=o.length}},sI=(e,t,n,o)=>{let r=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&&(r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new pO(l)),r.integrate(e,0),l=[])};o.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:r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new eO(new Uint8Array(n))),r.integrate(e,0);break;case MT:r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new iO(n)),r.integrate(e,0);break;default:if(!(n instanceof QP))throw new Error("Unexpected content type in insert operation");r=new MO(oP(s,uP(a,s)),r,r&&r.lastId,c,c&&c.id,t,null,new EO(n)),r.integrate(e,0)}}})),d()},aI=iM("Length exceeded!"),cI=(e,t,n,o)=>{if(n>t._length)throw aI;if(0===n)return t._searchMarker&&ZP(t._searchMarker,n,o.length),sI(e,t,null,o);const r=n,i=JP(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&&vP(e,oP(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&ZP(t._searchMarker,r,o.length),sI(e,t,s,o)},lI=(e,t,n)=>{const o=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start});let r=o.p;if(r)while(r.right)r=r.right;return sI(e,t,r,n)},dI=(e,t,n,o)=>{if(0===o)return;const r=n,i=o,s=JP(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&&vP(e,oP(a.id.client,a.id.clock+n)),n-=a.length);while(o>0&&null!==a)a.deleted||(o<a.length&&vP(e,oP(a.id.client,a.id.clock+o)),a.delete(e),o-=a.length),a=a.right;if(o>0)throw aI;t._searchMarker&&ZP(t._searchMarker,r,-i+o)},uI=(e,t,n)=>{const o=t._map.get(n);void 0!==o&&o.delete(e)},hI=(e,t,n,o)=>{const r=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==o)a=new pO([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:a=new pO([o]);break;case Uint8Array:a=new eO(o);break;case MT:a=new iO(o);break;default:if(!(o instanceof QP))throw new Error("Unexpected content type");a=new EO(o)}new MO(oP(s,uP(i.store,s)),r,r&&r.lastId,null,null,t,n,a).integrate(e,0)},pI=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},fI=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},mI=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},gI=e=>rT(e.entries(),(e=>!e[1].deleted));class vI extends qP{constructor(e,t){super(e,t),this._transaction=t}}class bI extends QP{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new bI;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new bI}clone(){const e=new bI;return e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),KP(this,e,new vI(this,e))}insert(e,t){null!==this.doc?MP(this.doc,(n=>{cI(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?MP(this.doc,(t=>{lI(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?MP(this.doc,(n=>{dI(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return iI(this,e)}toArray(){return tI(this)}slice(e=0,t=this.length){return eI(this,e,t)}toJSON(){return this.map((e=>e instanceof QP?e.toJSON():e))}map(e){return oI(this,e)}forEach(e){nI(this,e)}[Symbol.iterator](){return rI(this)}_write(e){e.writeTypeRef(bO)}}const yI=e=>new bI;class wI extends qP{constructor(e,t,n){super(e,t),this.keysChanged=n}}class xI extends QP{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 xI}clone(){const e=new xI;return this.forEach(((t,n)=>{e.set(n,t instanceof QP?t.clone():t)})),e}_callObserver(e,t){KP(this,e,new wI(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const o=t.content.getContent()[t.length-1];e[n]=o instanceof QP?o.toJSON():o}})),e}get size(){return[...gI(this._map)].length}keys(){return iT(gI(this._map),(e=>e[0]))}values(){return iT(gI(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return iT(gI(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?MP(this.doc,(t=>{uI(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return pI(this,e)}has(e){return mI(this,e)}clear(){null!==this.doc?MP(this.doc,(e=>{this.forEach((function(t,n,o){uI(e,o,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(yO)}}const kI=e=>new xI,CI=(e,t)=>e===t||"object"===typeof e&&"object"===typeof t&&e&&t&&pT(e,t);class SI{constructor(e,t,n,o){this.left=e,this.right=t,this.index=n,this.currentAttributes=o}forward(){switch(null===this.right&&aM(),this.right.content.constructor){case lO:this.right.deleted||MI(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 EI=(e,t,n)=>{while(null!==t.right&&n>0){switch(t.right.content.constructor){case lO:t.right.deleted||MI(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&vP(e,oP(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},AI=(e,t,n)=>{const o=new Map,r=JP(t,n);if(r){const t=new SI(r.p.left,r.p,r.index,o);return EI(e,t,n-r.index)}{const r=new SI(null,t._start,0,o);return EI(e,r,n)}},_I=(e,t,n,o)=>{while(null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===lO&&CI(o.get(n.right.content.key),n.right.content.value)))n.right.deleted||o.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;o.forEach(((o,s)=>{const a=n.left,c=n.right,l=new MO(oP(i,uP(r.store,i)),a,a&&a.lastId,c,c&&c.id,t,null,new lO(s,o));l.integrate(e,0),n.right=l,n.forward()}))},MI=(e,t)=>{const{key:n,value:o}=t;null===o?e.delete(n):e.set(n,o)},TI=(e,t)=>{while(1){if(null===e.right)break;if(!(e.right.deleted||e.right.content.constructor===lO&&CI(t[e.right.content.key]||null,e.right.content.value)))break;e.forward()}},PI=(e,t,n,o)=>{const r=e.doc,i=r.clientID,s=new Map;for(const a in o){const c=o[a],l=n.currentAttributes.get(a)||null;if(!CI(l,c)){s.set(a,l);const{left:o,right:d}=n;n.right=new MO(oP(i,uP(r.store,i)),o,o&&o.lastId,d,d&&d.id,t,null,new lO(a,c)),n.right.integrate(e,0),n.forward()}}return s},II=(e,t,n,o,r)=>{n.currentAttributes.forEach(((e,t)=>{void 0===r[t]&&(r[t]=null)}));const i=e.doc,s=i.clientID;TI(n,r);const a=PI(e,t,n,r),c=o.constructor===String?new mO(o):o instanceof QP?new EO(o):new aO(o);let{left:l,right:d,index:u}=n;t._searchMarker&&ZP(t._searchMarker,n.index,c.getLength()),d=new MO(oP(s,uP(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(),_I(e,t,n,a)},OI=(e,t,n,o,r)=>{const i=e.doc,s=i.clientID;TI(n,r);const a=PI(e,t,n,r);e:while(null!==n.right&&(o>0||a.size>0&&(n.right.deleted||n.right.content.constructor===lO))){if(!n.right.deleted)switch(n.right.content.constructor){case lO:{const{key:t,value:i}=n.right.content,s=r[t];if(void 0!==s){if(CI(s,i))a.delete(t);else{if(0===o)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:o<n.right.length&&vP(e,oP(n.right.id.client,n.right.id.clock+o)),o-=n.right.length;break}n.forward()}if(o>0){let r="";for(;o>0;o--)r+="\n";n.right=new MO(oP(s,uP(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new mO(r)),n.right.integrate(e,0),n.forward()}_I(e,t,n,a)},NI=(e,t,n,o,r)=>{let i=t;const s=SA();while(i&&(!i.countable||i.deleted)){if(!i.deleted&&i.content.constructor===lO){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 lO:{const{key:i,value:l}=n,d=o.get(i)||null;s.get(i)===n&&d!==l||(t.delete(e),a++,c||(r.get(i)||null)!==l||d===l||(null===d?r.delete(i):r.set(i,d))),c||t.deleted||MI(r,n);break}}}t=t.right}return a},DI=(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===lO){const o=t.content.key;n.has(o)?t.delete(e):n.add(o)}t=t.left}},RI=e=>{let t=0;return MP(e.doc,(n=>{let o=e._start,r=e._start,i=SA();const s=EA(i);while(r){if(!1===r.deleted)switch(r.content.constructor){case lO:MI(s,r.content);break;default:t+=NI(n,o,r,i,s),i=EA(s),o=r;break}r=r.right}})),t},BI=e=>{const t=new Set,n=e.doc;for(const[o,r]of e.afterState.entries()){const i=e.beforeState.get(o)||0;r!==i&&wP(e,n.store.clients.get(o),i,r,(e=>{e.deleted||e.content.constructor!==lO||e.constructor===QI||t.add(e.parent)}))}MP(n,(n=>{gT(e,e.deleteSet,(e=>{if(e instanceof QI||!e.parent._hasFormatting||t.has(e.parent))return;const o=e.parent;e.content.constructor===lO?t.add(o):DI(n,e)}));for(const e of t)RI(e)}))},LI=(e,t,n)=>{const o=n,r=EA(t.currentAttributes),i=t.right;while(n>0&&null!==t.right){if(!1===t.right.deleted)switch(t.right.content.constructor){case EO:case aO:case mO:n<t.right.length&&vP(e,oP(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&NI(e,i,t.right,r,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&ZP(s._searchMarker,t.index,-o+n),t};class jI extends qP{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=[];MP(e,(e=>{const n=new Map,o=new Map;let r=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},dT(s)||(e.attributes=sT({},s))),c=0;break}e&&t.push(e),i=null}};while(null!==r){switch(r.content.constructor){case EO:case aO:this.adds(r)?this.deletes(r)||(d(),i="insert",a=r.content.getContent()[0],d()):this.deletes(r)?("delete"!==i&&(d(),i="delete"),l+=1):r.deleted||("retain"!==i&&(d(),i="retain"),c+=1);break;case mO:this.adds(r)?this.deletes(r)||("insert"!==i&&(d(),i="insert"),a+=r.content.str):this.deletes(r)?("delete"!==i&&(d(),i="delete"),l+=r.length):r.deleted||("retain"!==i&&(d(),i="retain"),c+=r.length);break;case lO:{const{key:t,value:a}=r.content;if(this.adds(r)){if(!this.deletes(r)){const c=n.get(t)||null;CI(c,a)?null!==a&&r.delete(e):("retain"===i&&d(),CI(a,o.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(r)){o.set(t,a);const e=n.get(t)||null;CI(e,a)||("retain"===i&&d(),s[t]=e)}else if(!r.deleted){o.set(t,a);const n=s[t];void 0!==n&&(CI(n,a)?null!==n&&r.delete(e):("retain"===i&&d(),null===a?delete s[t]:s[t]=a))}r.deleted||("insert"===i&&d(),MI(n,r.content));break}}r=r.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 FI extends QP{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(IN){console.error(IN)}this._pending=null}_copy(){return new FI}clone(){const e=new FI;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new jI(this,e,t);KP(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===mO&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?MP(this.doc,(n=>{const o=new SI(null,this._start,0,new Map);for(let r=0;r<e.length;r++){const i=e[r];if(void 0!==i.insert){const s=t||"string"!==typeof i.insert||r!==e.length-1||null!==o.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!==typeof s||s.length>0)&&II(n,this,o,s,i.attributes||{})}else void 0!==i.retain?OI(n,this,o,i.retain,i.attributes||{}):void 0!==i.delete&&LI(n,o,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const o=[],r=new Map,i=this.doc;let s="",a=this._start;function c(){if(s.length>0){const e={};let t=!1;r.forEach(((n,o)=>{t=!0,e[o]=n}));const n={insert:s};t&&(n.attributes=e),o.push(n),s=""}}const l=()=>{while(null!==a){if(aP(a,e)||void 0!==t&&aP(a,t))switch(a.content.constructor){case mO:{const o=r.get("ychange");void 0===e||aP(a,e)?void 0===t||aP(a,t)?void 0!==o&&(c(),r.delete("ychange")):void 0!==o&&o.user===a.id.client&&"added"===o.type||(c(),r.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==o&&o.user===a.id.client&&"removed"===o.type||(c(),r.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case EO:case aO:{c();const e={insert:a.content.getContent()[0]};if(r.size>0){const t={};e.attributes=t,r.forEach(((e,n)=>{t[n]=e}))}o.push(e);break}case lO:aP(a,e)&&(c(),MI(r,a.content));break}a=a.right}c()};return e||t?MP(i,(n=>{e&&cP(n,e),t&&cP(n,t),l()}),"cleanup"):l(),o}insert(e,t,n){if(t.length<=0)return;const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);n||(n={},r.currentAttributes.forEach(((e,t)=>{n[t]=e}))),II(o,this,r,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n={}){const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);II(o,this,r,t,n)})):this._pending.push((()=>this.insertEmbed(e,t,n)))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?MP(n,(n=>{LI(n,AI(n,this,e),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const o=this.doc;null!==o?MP(o,(o=>{const r=AI(o,this,e);null!==r.right&&OI(o,this,r,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?MP(this.doc,(t=>{uI(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return pI(this,e)}getAttributes(){return fI(this)}_write(e){e.writeTypeRef(wO)}}const zI=e=>new FI;class UI{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!==VI&&t.constructor!==qI||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 qI extends QP{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 qI}clone(){const e=new qI;return e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new UI(this,e)}querySelector(e){e=e.toUpperCase();const t=new UI(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)),n=t.next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),OA(new UI(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){KP(this,e,new GI(this,t,e))}toString(){return oI(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const o=e.createDocumentFragment();return void 0!==n&&n._createAssociation(o,this),nI(this,(r=>{o.insertBefore(r.toDOM(e,t,n),null)})),o}insert(e,t){null!==this.doc?MP(this.doc,(n=>{cI(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)MP(this.doc,(n=>{const o=e&&e instanceof QP?e._item:e;sI(n,this,o,t)}));else{const n=this._prelimContent,o=null===e?0:n.findIndex((t=>t===e))+1;if(0===o&&null!==e)throw iM("Reference item not found");n.splice(o,0,...t)}}delete(e,t=1){null!==this.doc?MP(this.doc,(n=>{dI(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return tI(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return iI(this,e)}slice(e=0,t=this.length){return eI(this,e,t)}forEach(e){nI(this,e)}_write(e){e.writeTypeRef(kO)}}const HI=e=>new qI;class VI extends qI{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 VI(this.nodeName)}clone(){const e=new VI(this.nodeName),t=this.getAttributes();return cT(t,((t,n)=>{"string"===typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof QP?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const s in e)n.push(s);n.sort();const o=n.length;for(let s=0;s<o;s++){const o=n[s];t.push(o+'="'+e[o]+'"')}const r=this.nodeName.toLocaleLowerCase(),i=t.length>0?" "+t.join(" "):"";return`<${r}${i}>${super.toString()}</${r}>`}removeAttribute(e){null!==this.doc?MP(this.doc,(t=>{uI(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?MP(this.doc,(n=>{hI(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return pI(this,e)}hasAttribute(e){return mI(this,e)}getAttributes(){return fI(this)}toDOM(e=document,t={},n){const o=e.createElement(this.nodeName),r=this.getAttributes();for(const i in r){const e=r[i];"string"===typeof e&&o.setAttribute(i,e)}return nI(this,(r=>{o.appendChild(r.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(xO),e.writeKey(this.nodeName)}}const WI=e=>new VI(e.readKey());class GI extends qP{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 $I extends xI{constructor(e){super(),this.hookName=e}_copy(){return new $I(this.hookName)}clone(){const e=new $I(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const o=t[this.hookName];let r;return r=void 0!==o?o.createDom(this):document.createElement(this.hookName),r.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(CO),e.writeKey(this.hookName)}}const XI=e=>new $I(e.readKey());class YI extends FI{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 YI}clone(){const e=new YI;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const o=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(o,this),o}toString(){return this.toDelta().map((e=>{const t=[];for(const o in e.attributes){const n=[];for(const t in e.attributes[o])n.push({key:t,value:e.attributes[o][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:o,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let o=0;o<t.length;o++){const e=t[o];n+=`<${e.nodeName}`;for(let t=0;t<e.attrs.length;t++){const o=e.attrs[t];n+=` ${o.key}="${o.value}"`}n+=">"}n+=e.insert;for(let o=t.length-1;o>=0;o--)n+=`</${t[o].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(SO)}}const JI=e=>new YI;class ZI{constructor(e,t){this.id=e,this.length=t}get deleted(){throw sM()}mergeWith(e){return!1}write(e,t,n){throw sM()}integrate(e,t){throw sM()}}const KI=0;class QI extends ZI{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),hP(e.doc.store,this)}write(e,t){e.writeInfo(KI),e.writeLen(this.length-t)}getMissing(e,t){return null}}class eO{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new eO(this.content)}splice(e){throw sM()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const tO=e=>new eO(e.readBuf());class nO{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new nO(this.len)}splice(e){const t=new nO(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xT(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 oO=e=>new nO(e.readLen()),rO=(e,t)=>new MT({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class iO{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 iO(rO(this.doc.guid,this.opts))}splice(e){throw sM()}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 sO=e=>new iO(rO(e.readString(),e.readAny()));class aO{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new aO(this.embed)}splice(e){throw sM()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const cO=e=>new aO(e.readJSON());class lO{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new lO(this.key,this.value)}splice(e){throw sM()}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 dO=e=>new lO(e.readKey(),e.readJSON());class uO{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new uO(this.arr)}splice(e){const t=new uO(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 o=t;o<n;o++){const t=this.arr[o];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const hO=e=>{const t=e.readLen(),n=[];for(let o=0;o<t;o++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new uO(n)};class pO{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new pO(this.arr)}splice(e){const t=new pO(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 o=t;o<n;o++){const t=this.arr[o];e.writeAny(t)}}getRef(){return 8}}const fO=e=>{const t=e.readLen(),n=[];for(let o=0;o<t;o++)n.push(e.readAny());return new pO(n)};class mO{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new mO(this.str)}splice(e){const t=new mO(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 gO=e=>new mO(e.readString()),vO=[yI,kI,zI,WI,HI,XI,JI],bO=0,yO=1,wO=2,xO=3,kO=4,CO=5,SO=6;class EO{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new EO(this.type._copy())}splice(e){throw sM()}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 AO=e=>new EO(vO[e.readTypeRef()](e)),_O=(e,t,n)=>{const{client:o,clock:r}=t.id,i=new MO(oP(o,r+n),t,oP(o,r+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=oP(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 MO extends ZI{constructor(e,t,n,o,r,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=o,this.rightOrigin=r,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?b_:0}set marker(e){(this.info&w_)>0!==e&&(this.info^=w_)}get marker(){return(this.info&w_)>0}get keep(){return(this.info&v_)>0}set keep(e){this.keep!==e&&(this.info^=v_)}get countable(){return(this.info&b_)>0}get deleted(){return(this.info&y_)>0}set deleted(e){this.deleted!==e&&(this.info^=y_)}markDeleted(){this.info|=y_}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=uP(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=uP(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===tP&&this.id.client!==this.parent.client&&this.parent.clock>=uP(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=bP(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=vP(e,this.rightOrigin),this.rightOrigin=this.right.id),(this.left&&this.left.constructor===QI||this.right&&this.right.constructor===QI)&&(this.parent=null),this.parent){if(this.parent.constructor===tP){const e=mP(t,this.parent);e.constructor===QI?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===MO&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===MO&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=bP(e,e.doc.store,oP(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 o=new Set,r=new Set;while(null!==t&&t!==this.right){if(r.add(t),o.add(t),nP(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,o.clear();else if(nP(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!r.has(mP(e.doc.store,t.origin)))break;o.has(mP(e.doc.store,t.origin))||(n=t,o.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),hP(e.doc.store,this),this.content.integrate(e,this),CP(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new QI(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:oP(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&nP(e.origin,this.lastId)&&this.right===e&&nP(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(),xT(e.deleteSet,this.id.client,this.id.clock,this.length),CP(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw aM();this.content.gc(e),t?yP(e,this,new QI(this.id,this.length)):this.content=new nO(this.length)}write(e,t){const n=t>0?oP(this.id.client,this.id.clock+t-1):this.origin,o=this.rightOrigin,r=this.parentSub,i=this.content.getRef()&S_|(null===n?0:C_)|(null===o?0:k_)|(null===r?0:x_);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==o&&e.writeRightID(o),null===n&&null===o){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=rP(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===tP?(e.writeParentInfo(!1),e.writeLeftID(t)):aM();null!==r&&e.writeString(r)}this.content.write(e,t)}}const TO=(e,t)=>PO[t&S_](e),PO=[()=>{aM()},oO,hO,tO,gO,cO,dO,AO,fO,sO,()=>{aM()}],IO=10;class OO extends ZI{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){aM()}write(e,t){e.writeInfo(IO),L_(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const NO="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:{},DO="__ $YJS$ __";!0===NO[DO]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),NO[DO]=!0;var RO,BO,LO,jO,FO=new WeakMap,zO=function(){function e(t){d(this,e),b(this,FO,{writable:!0,value:""}),Tw(this,FO,t)}return g(e,[{key:"getRoom",value:function(){return k(this,FO)}}]),e}(),UO=function(){function e(t,n){d(this,e),this.modeler=t,this.store=n}return g(e,[{key:"isSpecialProperty",value:function(e){var t=["messageRef","signalRef","signalPayload","gatewayDirection","condition","allowedUsers","allowedGroups"];return t.includes(e)}},{key:"updateNodeId",value:function(e,t){var n=this.getIndex(e),o=this.yArray.get(n);o.set("id",t);var r=this.getNodeById(e);this.store.commit("updateNodeProp",{node:r,key:"id",value:t})}},{key:"handleLoopCharacteristics",value:function(e,t){var n=JSON.parse(t);this.modeler.nodeRegistry[e.type].loopCharacteristicsHandler({type:e.definition.type,$loopCharactetistics:{id:e.id,loopCharacteristics:n}},e,this.setNodeProp,this.modeler.moddle,this.modeler.definitions,!1)}},{key:"updateEventCondition",value:function(e,t){e.get("eventDefinitions")[0].get("condition").body=t}},{key:"updateGatewayDirection",value:function(e,t){e.set("gatewayDirection",t)}},{key:"updateNodeProperty",value:function(e,t,n){this.store.commit("updateNodeProp",{node:e,key:t,value:n})}},{key:"updateMessageRef",value:function(e,t,n){var o=this.modeler.definitions.rootElements.find((function(e){return e.id===t}));o||(o=this.modeler.moddle.create("bpmn:Message",{id:t,name:(null===n||void 0===n?void 0:n.messageName)||t}),this.modeler.definitions.rootElements.push(o)),e.definition.get("eventDefinitions")[0].messageRef=o,null!==n&&void 0!==n&&n.allowedUsers&&e.definition.set("allowedUsers",n.allowedUsers),null!==n&&void 0!==n&&n.allowedGroups&&e.definition.set("allowedGroups",n.allowedGroups)}},{key:"updateSignalRef",value:function(e,t,n){var o=this.modeler.definitions.rootElements.find((function(e){return e.id===t}));o||(o=this.modeler.moddle.create("bpmn:Signal",{id:t,name:(null===n||void 0===n?void 0:n.signalName)||t}),this.modeler.definitions.rootElements.push(o)),e.definition.get("eventDefinitions")[0].signalRef=o}},{key:"updateSignalPayload",value:function(e,t){var n=e.definition.get("eventDefinitions"),o="bpmn:SignalEventDefinition";n.forEach((function(e){e.$type===o&&(e.config=t)}))}},{key:"updateEventTimerDefinition",value:function(e,t){var n=t.type,o=t.body,r=_w(this.modeler.moddle,e,n,o);this.store.commit("updateNodeProp",{node:e,key:"eventDefinitions",value:r})}}]),e}(),qO=function(){function e(t,n,o){d(this,e),y(this,"saturationRange",null),y(this,"lightnessRange",null),this.saturationRange=this.getRange(t,o),this.lightnessRange=this.getRange(n,o)}return g(e,[{key:"getRange",value:function(e,t){return[Math.max(0,e-t),Math.min(e+t,100)]}},{key:"getHashOfString",value: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}},{key:"normalizeHash",value:function(e,t,n){return Math.floor(e%(n-t)+t)}},{key:"generateHSL",value:function(e){var t=this.getHashOfString(e),n=this.normalizeHash(t,0,360),o=this.normalizeHash(t,this.saturationRange[0],this.saturationRange[1]),r=this.normalizeHash(t,this.lightnessRange[0],this.lightnessRange[1]);return[n,o,r]}},{key:"HSLtoString",value:function(e){return"hsl(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%)")}},{key:"generateColorHsl",value:function(e){return this.HSLtoString(this.generateHSL(e,this.saturationRange,this.lightnessRange))}},{key:"randomColor",value:function(e){return e?this.generateColorHsl(e):null}}]),e}(),HO=new WeakMap,VO=function(){function e(t){var n=this;d(this,e),y(this,"clientIO",null),y(this,"yDoc",null),y(this,"yArray",null),y(this,"modeler",null),b(this,HO,{writable:!0,value:null}),y(this,"room",null),y(this,"inspector",null),y(this,"deletedItem",null),y(this,"colorUtil",null),y(this,"debouncedUpdateSelectedNodes",(0,Ao.debounce)((function(e){n.updateSelectedNodes(e)}),400)),this.yDoc=new MT,this.yArray=this.yDoc.getArray("elements"),this.modeler=t}return g(e,[{key:"init",value:function(){var e,t;Tw(this,HO,B(this.modeler.definitions));var n=null!==(e=window.ProcessMaker.modeler.process.uuid)&&void 0!==e?e:window.ProcessMaker.modeler.process.id,o=(null===(t=window.ProcessMaker.app)||void 0===t?void 0:t.url)||"";this.room=new zO("room-".concat(o,"-").concat(n)),this.inspector=new UO(this.modeler,Un),this.clientIO=CA(window.ProcessMaker.multiplayer.host,{transports:["websocket","polling"]}),window.ProcessMaker.multiplayer.enabled?(this.webSocketEvents(),this.multiplayerEvents()):this.clientIO.disconnect(),this.colorUtil=new qO(50,50,10)}},{key:"webSocketEvents",value:function(){var e=this;this.clientIO.on("connect",(function(){var t,n,o,r;e.modeler.emptyPlayers(),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,clientColor:(null===(o=window.ProcessMaker.user)||void 0===o?void 0:o.color)||e.colorUtil.randomColor(null===(r=window.ProcessMaker.user)||void 0===r?void 0:r.fullName),clientCursor:{coordinates:{clientX:300,clientY:300},paperTranslate:e.modeler.paper.translate(),paperScale:e.modeler.paper.scale()}})})),this.clientIO.on("clientJoined",(function(t){e.modeler.enableMultiplayer(t.isMultiplayer),e.addPlayers(t)})),this.clientIO.on("clientLeft",(function(t){e.modeler.unhightligtNodes(t.clientId),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("updateUserCursor",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.updateClientCursor(n);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.clientIO.on("selectedNodesWasUpdated",function(){var t=l(a().mark((function t(n){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.updateHightligtedNodes(n);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),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:VT(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:VT(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)})),VT(e.yDoc,new Uint8Array(t.updateDoc))})),this.clientIO.on("updateElement",(function(t){var n=t.updateDoc,o=t.updatedNodes,r=t.isReplaced;r?e.replaceShape(o[0]):o.forEach((function(t){e.updateShapes(t)})),VT(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateInspector",(function(t){var n=t.updateDoc,o=t.updatedNodes;o.forEach((function(t){e.updateShapeFromInspector(t)})),VT(e.yDoc,new Uint8Array(n))})),this.clientIO.on("updateFlows",(function(t){var n=t.updateDoc,o=t.updatedNodes;o.forEach((function(t){e.updateFlowClient(t)})),VT(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.modeler.isMultiplayer&&e.updateNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-replaceNode",(function(t){var n=t.nodeData,o=t.newControl;e.replaceNode(n,o)})),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)})),window.ProcessMaker.EventBus.$on("multiplayer-updateSelectedNodes",(function(t){e.modeler.isMultiplayer&&e.debouncedUpdateSelectedNodes(t)})),window.ProcessMaker.EventBus.$on("multiplayer-updateMousePosition",(function(t){e.modeler.isMultiplayer&&e.updateMousePosition(t)}))}},{key:"addPlayers",value:function(e){var t=this;e.isMultiplayer&&e.clients.map((function(e){var n={id:e.id,name:e.name,color:e.color,avatar:e.avatar,cursor:e.cursor};t.modeler.addPlayer(n)}))}},{key:"updateMousePosition",value:function(e){this.clientIO.emit("cursorTrackingUpdate",{roomName:this.room.getRoom(),clientId:this.clientIO.id,clientCursor:e})}},{key:"updateClientCursor",value:function(e){var t=this;e.clients.map((function(e){t.modeler.updateClientCursor(e)}))}},{key:"updateSelectedNodes",value:function(e){var t="Another user is working on this object, wait until they finish making changes.";this.modeler.isMultiplayerSelected(e)&&window.ProcessMaker.alert(t,"warning"),this.clientIO.emit("updateSelectedNodes",{clientId:this.clientIO.id,roomName:this.room.getRoom(),selectedNodes:e})}},{key:"updateHightligtedNodes",value:function(e){var t=this;e.clients.map((function(e){t.modeler.updateHightligtedNodes(e)}))}},{key:"syncLocalNodes",value:function(e){var t=this,n=this.modeler.nodes.map((function(e){return"bpmn:BoundaryEvent"===e.definition.$type?yg(e):"bpmn:Lane"===e.definition.$type?t.prepareLaneData(e):t.modeler.multiplayerHook(e,!1,!0)}));n.forEach((function(n){var o=new xI;t.doTransact(o,n),t.yArray.push([o]);var r=$T(t.yDoc);t.clientIO.emit("createElement",{updateDoc:r,clientId:e})}))}},{key:"addNode",value:function(e){var t=new xI;this.doTransact(t,e),this.yArray.push([t]);var n=$T(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n})}},{key:"createShape",value:function(e){var t,n=this.getNodeById(e.id);n||(null!==(t=this.modeler.nodeRegistry[e.type])&&void 0!==t&&t.multiplayerClient?this.modeler.nodeRegistry[e.type].multiplayerClient(this.modeler,e):this.modeler.addRemoteNode(e),k(this,HO).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.yArray.delete(t,1);var n=$T(this.yDoc);this.clientIO.emit("removeElement",n)}}},{key:"getIndex",value:function(e){var t,n=-1,o=!1,r=NS(this.yArray);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(n++,i.get("id")===e){o=!0;break}}}catch(PN){r.e(PN)}finally{r.f()}return o?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),o=t.yArray.get(n),r=e.poolId?er(er({},e.properties),{poolId:e.poolId}):e.properties;t.doTransact(o,r)}))}},{key:"replaceNode",value:function(e,t){var n=this.getIndex(e.nodeThatWillBeReplaced.definition.id),o=this.yArray.get(n);e.id="node_".concat(k(this,HO).getDefinitionNumber()),k(this,HO).updateCounters(),this.replaceShape({oldNodeId:e.nodeThatWillBeReplaced.definition.id,id:e.id,type:t,x:e.x,y:e.y}),this.yDoc.transact((function(){o.set("type",t),o.set("id",e.id)}));var r=$T(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:r,isReplaced:!0})}},{key:"replaceShape",value:function(e){var t=this.modeler.paper.localToClientPoint(e),n=t.x,o=t.y,r=this.getNodeById(e.oldNodeId),i={clientX:n,clientY:o,control:{type:e.type},nodeThatWillBeReplaced:r,color:r.color,id:e.id};this.modeler.replaceNodeProcedure(i,!0),k(this,HO).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=$T(this.yDoc);this.clientIO.emit("updateElement",{updateDoc:n,isReplaced:!1})}},{key:"updateShapes",value:function(){var e=l(a().mark((function e(t){var n,o,r,i,s;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.modeler.paper,o=this.modeler.getElementByNodeId(t.id),r=this.modeler.getElementByNodeId(t.poolId),!this.modeler.flowTypes.includes(t.type)){e.next=7;break}"waypoint"in t?this.updateMovedWaypoint(o,t):(i=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:i,key:"color",value:t.color})),e.next=23;break;case 7:if(this.updateGatewayDefaultFlow(o,t),"function"===typeof o.resize&&t.width&&t.height&&o.resize(t.width,t.height),t.x&&t.y&&o.set("position",{x:t.x,y:t.y}),!t.color){e.next=14;break}return s=this.getNodeById(t.id),Un.commit("updateNodeProp",{node:s,key:"color",value:t.color}),e.abrupt("return");case 14:return"bpmn:BoundaryEvent"===o.component.node.definition.$type&&this.attachBoundaryEventToNode(o,t),e.next=17,n.findViewByModel(o).update();case 17:return e.next=19,o.component.$nextTick();case 19:return e.next=21,this.modeler.paperManager.awaitScheduledUpdates();case 21:r&&o.component.node.pool&&o.component.node.pool.component.id!==t.poolId&&o.component.node.pool.component.moveElementRemote(o,r),this.modeler.updateLasso();case 23:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"updateGatewayDefaultFlow",value:function(e,t){if(Object.hasOwn(t,"default")){var n=this.getNodeById(t.default);e.component.node.definition.set("default",n||null)}}},{key:"updateMovedWaypoint",value:function(e,t){var n=this,o=t.waypoint,r=this.modeler.paper,i=this.modeler.getElementByNodeId(t.sourceRefId),s=this.modeler.getElementByNodeId(t.targetRefId),a=o[0],c=o[o.length-1];e.vertices(o),e.component.node.diagram.waypoint=o.map((function(e){return n.modeler.moddle.create("dc:Point",e)})),e.component.node._modelerId+="_replaced",e.source(i,{anchor:function(){return Tt(n.getConnectionPoint(i,a),i.findView(r))},connectionPoint:{name:"boundary"}}),e.target(s,{anchor:function(){return Tt(n.getConnectionPoint(s,c),s.findView(r))},connectionPoint:{name:"boundary"}})}},{key:"attachBoundaryEventToNode",value:function(e,t){var n=this.getNodeById(t.attachedToRefId),o=e.getParentCell(),r=this.modeler.getElementByNodeId(t.attachedToRefId);o&&o.unembed(e),r&&r.embed(e),e.component.node.definition.set("attachedToRef",n.definition)}},{key:"addCommonElement",value:function(e){var t=new xI;this.doTransact(t,e),this.yArray.push([t]);var n=$T(this.yDoc);this.clientIO.emit("createElement",{updateDoc:n}),k(this,HO).updateCounters()}},{key:"addLaneNodes",value:function(e){var t=this,n=this.getPool(e),o={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}};window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[o]),this.yDoc.transact((function(){e.forEach((function(e){var n=new xI,o=t.prepareLaneData(e);t.doTransact(n,o),t.yArray.push([n]);var r=$T(t.yDoc);t.clientIO.emit("createElement",{updateDoc:r})}))}))}},{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,poolX:e.pool.component.node.diagram.bounds.x,poolY:e.pool.component.node.diagram.bounds.y};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(),o=n.x,r=n.y,i={x:t.x-o,y:t.y-r},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 o=e.value;"loopCharacteristics"===e.key&&(o=JSON.stringify(e.value)),n.set(e.key,o),e.extras&&Object.keys(e.extras).length>0&&n.set("extras",e.extras);var r=$T(this.yDoc);this.clientIO.emit("updateFromInspector",{updateDoc:r,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,n=null;if(e.oldNodeId&&e.oldNodeId!==e.id&&this.inspector.updateNodeId(e.oldNodeId,e.id),n=this.getNodeById(e.id),n){var o=e.extras,r=void 0===o?{}:o,i=n,s=i.definition;if(e.loopCharacteristics)this.inspector.handleLoopCharacteristics(n,e.loopCharacteristics);else if(null!==(t=this.modeler.nodeRegistry[n.type])&&void 0!==t&&t.multiplayerInspectorHandler)this.modeler.nodeRegistry[n.type].multiplayerInspectorHandler(n,e,this.setNodeProp,this.modeler.moddle);else{var a=Object.keys(e).filter((function(e){return"id"!==e})),c=a[0],l=e[c];"condition"===c?this.inspector.updateEventCondition(s,l):"gatewayDirection"===c?this.inspector.updateGatewayDirection(s,l):"messageRef"===c?this.inspector.updateMessageRef(n,l,r):"signalRef"===c?this.inspector.updateSignalRef(n,l,r):"signalPayload"===c?this.inspector.updateSignalPayload(n,l):"eventTimerDefinition"===c?this.inspector.updateEventTimerDefinition(n,l):this.inspector.isSpecialProperty(c)||this.inspector.updateNodeProperty(n,c,l)}}}},{key:"updateFlows",value:function(e){var t=this;e.forEach((function(e){var n=t.getIndex(e.id),o=t.yArray.get(n);t.yDoc.transact((function(){for(var t in e)Object.hasOwn(e,t)&&o.set(t,e[t])}))}));var n=$T(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 o,r=this.getNodeById(e.sourceRefId),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]);n.definition.set("sourceRef",r.definition),t=!0}if(n&&e.targetRefId){var s,a=this.getNodeById(e.targetRefId),c=a.definition.get("incoming").find((function(e){return e.id===n.definition.id}));if(!c)(s=a.definition.get("incoming")).push.apply(s,[n.definition]);n.definition.set("targetRef",a.definition),t=!0}this.refreshNodeWaypoint(this.modeler.getElementByNodeId(e.id)),t&&(n._modelerId+="_replaced")}},{key:"refreshNodeWaypoint",value:function(e){var t=this,n=this.modeler.paper.findViewByModel(e),o=n.sourceAnchor,r=n.targetAnchor;e.component.node.diagram.waypoint=[o].concat(W(e.component.shape.vertices()),[r]).map((function(e){return t.modeler.moddle.create("dc:Point",e)}))}}]),e}(),WO={components:{PreviewPanel:Cb,ToolBar:Hx,ExplorerRail:nv,InspectorButton:Gv,InspectorPanel:ib,ProcessmakerModelerGenericFlow:RC,Selection:AS,RailBottom:_C,WelcomeMessage:pv,CreateAssetsCard:yv,GeneratingAssetsCard:Ev,AssetsCreatedCard:Iv,CreateAssetsFailCard:Lv,RemoteCursor:OS},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:[rk,Ek,Mk,Tk],data:function(){var e;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,panMode:!1,panning:!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,isAiGenerated:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isAiGenerated,assetsCreated:!1,assetFail:!1,currentNonce:null,promptSessionId:"",loadingAI:!1,cancelledJobs:[],flowTypes:["processmaker-modeler-sequence-flow","processmaker-modeler-message-flow","processmaker-modeler-data-input-association","processmaker-modeler-data-output-association","processmaker-modeler-association"],boundaryEventTypes:["processmaker-modeler-boundary-timer-event","processmaker-modeler-boundary-error-event","processmaker-modeler-boundary-signal-event","processmaker-modeler-boundary-conditional-event","processmaker-modeler-boundary-message-event"]}},watch:{isReadOnly:function(){this.panMode=this.isReadOnly},panning:function(){this.panning||(this.canvasDragPosition=null)},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)},creatingNewNode:function(){this.creatingNewNode&&this.clearSelection()}},computed:{isReadOnly:function(){return Un.getters.isReadOnly},creatingNewNode:function(){return Pg.getters.getSelectedNode},filteredPlayers:function(){var e=_o().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())}))},showWelcomeMessage:function(){return!this.selectedNode&&!this.nodes.length&&!this.isReadOnly&&this.isLoaded&&!Sb.getters.isRunning},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 Sb.getters.currentState},copiedElements:function(){return Un.getters.copiedElements},highlightedNode:function(){return Un.getters.highlightedNodes[0]},highlightedNodes:function(){return Un.getters.highlightedNodes},invalidNodes:function(){return xk(this.validationErrors,this.nodes)},showComponent:function(){return Un.getters.showComponent},isMultiplayer:function(){return Un.getters.isMultiplayer},isPackageAiInstalled:function(){var e;return null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e?void 0:e.isPackageAiInstalled}},methods:{mountedInit:function(){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},addEventHandlers:function(){var e=this;this.paperManager.addEventHandler("cell:pointerdblclick",lk),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){e.panMode?e.startPanning():e.pointerDownHandler(t)}),this),this.paperManager.addEventHandler("blank:pointerup",(function(t){e.panMode&&e.stopPanning(),e.activeNode=null,e.pointerUpHandler(t)}),this),this.paperManager.addEventHandler("cell:pointerup",(function(t,n){e.panMode?e.stopPanning():(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,o){var r=e.model.get("onClick");r&&r(e,t,n,o)})),this.paperManager.addEventHandler("cell:pointerclick",(function(t,n){var o=t.model;e.isBpmnNode(o)&&(e.panMode||(o.component.$emit("click",n),e.$emit("click",{event:n,node:e.highlightedNode.definition})))})),this.paperManager.addEventHandler("cell:pointerdown",(function(t,n){var o=t.model;e.isBpmnNode(o)&&(e.panMode?e.startPanning():(e.setShapeStacking(o),e.activeNode=o.component.node,e.pointerDowInShape(n,o)))})),this.$root.$on("replace-ai-node",(function(t){e.replaceAiNode(t)})),window.ProcessMaker.EventBus.$on("save-changes",(function(t,n,o){t&&e.redirect(t),o&&e.generateAssets()}))},registerCustomNodes:function(){var e=this;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 o;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,Sb.dispatch("pushState",n);case 4:try{o=new VO(e),o.init(),e.multiplayer=o}catch(r){console.warn("Could not initialize multiplayer",r)}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)}})},initAI:function(){this.isPackageAiInstalled&&(this.currentNonce=localStorage.currentNonce,localStorage.getItem("promptSessions")&&"null"!==localStorage.getItem("promptSessions")||localStorage.setItem("promptSessions",JSON.stringify([])),localStorage.getItem("cancelledJobs")&&"null"!==localStorage.getItem("cancelledJobs")?this.cancelledJobs=JSON.parse(localStorage.getItem("cancelledJobs")):this.cancelledJobs=[],this.promptSessionId=this.getPromptSessionForUser(),this.fetchHistory(),this.subscribeToProgress(),this.subscribeToGenerationCompleted(),this.subscribeToErrors())},onNodeDefinitionChanged:function(){this.isOpenPreview&&this.handlePreview()},onStartPreviewResize:function(e){this.isResizingPreview=!0,this.currentCursorPosition=e.x},onMouseUp:function(e){window.ProcessMaker.mouseDownDrag&&(window.ProcessMaker.EventBus.$emit("custom-pointerclick",e),window.ProcessMaker.mouseDownDrag=!1),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(){if(!this.isOpenInspector){if(this.isOpenPreview&&!this.isOpenInspector){var e=screen.width/1920;this.inspectorButtonRight=65*e+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 o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=!(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,o);case 6:case"end":return n.stop()}}),n)})))()},toggleDefaultFlow:function(e){var t,n=e.definition.sourceRef;n.default&&n.default.id===e.id&&(e=null),window.ProcessMaker.EventBus.$emit("multiplayer-updateNodes",[{id:n.id,properties:{default:(null===(t=e)||void 0===t?void 0:t.id)||null}}]),n.set("default",e)},cloneElement:function(e,t){var n=e.clone(this.nodeRegistry,this.moddle,this.$t),o=(e.diagram.bounds.height+30)*t;n.diagram.bounds.y+=o,this.addNode(n)},copyElement:function(){var e=[gl,Mo,Oo,fr,eb],t=[Uy,Yy,nw,dw,bw,Aw];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 o=this.paper.translate(),r=o.ty-(n.top-e.top-n.height);this.paper.translate(o.tx,r),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})),o=n.shape;return t.paper.findViewByModel(o)}))},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 o,r,i,s,c,l,d,u;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:null,r=e.length>1&&void 0!==e[1]?e[1]:null,i=e.length>2&&void 0!==e[2]&&e[2],s=document.querySelector(".mini-paper svg"),c="text { font-family: sans-serif; }",l=document.createElement("style"),l.appendChild(document.createTextNode(c)),s.appendChild(l),n.next=10,t.getXmlFromDiagram();case 10:d=n.sent,u=(new XMLSerializer).serializeToString(s),t.$emit("saveBpmn",{xml:d,svg:u,redirectUrl:o,nodeId:r,generatingAssets:i});case 13: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(){zv()(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,Sb.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,o){e?n(e):t(o)}))}))},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=_o().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,o=function(){return e.id},r=function(t){if(t.get("implementation")===e.implementation)return e.id};this.translateConfig(e.inspectorConfig[0]),Sk(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(r):n.parsers[i].default.push(o)})),Pg.commit("setNodeTypes",this.nodeTypes)},registerPmBlock:function(e,t){var n=this,o=function(){return e.id};this.translateConfig(e.inspectorConfig[0]),Sk(e),this.nodeRegistry[e.id]=e,zt().component(e.id,e.component),this.pmBlockNodes.push(e);var r=Array.isArray(e.bpmnType)?e.bpmnType:[e.bpmnType];r.forEach((function(e){n.parsers[e]||(n.parsers[e]={custom:[],implementation:[],default:[]}),t?n.parsers[e].custom.push(t):n.parsers[e].default.push(o)})),Pg.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(o){return n.setNode(o,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 o=e.filter((function(e){return e.get("dataInputAssociations")&&e.get("dataInputAssociations").length>0}));o.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(o){return n.setNode(o,e,t)}))},loadSequenceFlows:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"===e.$type&&n.hasSourceAndTarget(e)})).forEach((function(o){return n.setNode(o,e,t)}))},loadFlowElements:function(e,t){var n=this;e.filter((function(e){return"bpmn:SequenceFlow"!==e.$type})).forEach((function(o){return n.setNode(o,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"),o=t.get("artifacts");e.loadFlowElements(n,o),e.loadSequenceFlows(n,o),e.loadArtifacts(n,o),e.loadAssociations(n,o),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 pr("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 o=n.custom.find((function(n){return n(e,t.moddle)})),r=n.implementation.find((function(n){return n(e,t.moddle)})),i=n.default.find((function(n){return n(e,t.moddle)}));return o||r||i}},handleUnsupportedElement:function(e,t,n,o,r){this.addWarning({title:this.$t("Unsupported Element"),text:e+this.$t(" is an unsupported element type in parse")}),Cs()(t,n),Cs()(o,n),Cs()(this.planeElements,r),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 o=this.planeElements.find((function(t){return t.bpmnElement.id===e.id})),r=e.$type,i=this.getCustomParser(e);if(i){this.removeUnsupportedElementAttributes(e);var s=e.config&&(0,jv.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(r);l&&!e.get("name")&&e.set("name",""),this.createNodeAsync(a,e,o)}else this.handleUnsupportedElement(r,t,e,n,o)},createNodeAsync:function(e,t,n){var o=this;return l(a().mark((function r(){var i;return a().wrap((function(r){while(1)switch(r.prev=r.next){case 0:i=o.createNode(e,t,n),o.isMultiplayer?o.loadNodeForMultiplayer(i):Un.commit("addNode",i);case 2:case"end":return r.stop()}}),r)})))()},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 pr.isTimerType(e)?new ck(e,t,n):(Object.keys(t).forEach((function(e){void 0!==t[e]&&null!==t[e]||delete t[e]})),new pr(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 o,r;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:null,r=!1,null===o&&(o=t.currentXML,r=!0),n.next=5,t.xmlManager.getDefinitionsFromXml(o);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:r&&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=Sg.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 o=t.createBoundaryEvent(n);n.get("outgoing").forEach((function(e){return e.set("sourceRef",o)})),t.replaceDefinition(n,o,e)}))},replaceDefinition:function(e,t,n){var o=n.get("flowElements").indexOf(e);n.flowElements[o]=t;var r=this.planeElements.find((function(t){return t.bpmnElement===e}));r.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 o,r,i,s;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=t.nodeRegistry[e.type].definition(t.moddle,t.$t),r=t.nodeRegistry[e.type].diagram(t.moddle),r.bounds.x=e.x,r.bounds.y=e.y,r.bounds.width=e.width,r.bounds.height=e.height,i=t.createNode(e.type,o,r),e.poolId&&(s=t.getElementByNodeId(e.poolId),t.poolTarget=s),n.next=10,t.addNode(i,e.id,!0);case 10:return n.next=12,t.$nextTick();case 12:return n.next=14,t.paperManager.awaitScheduledUpdates();case 14:t.autoValidate&&t.validateBpmnDiagram();case 15:case"end":return n.stop()}}),n)})))()},handleDrop:function(e){var t=this;return l(a().mark((function n(){var o,r,i,s,c,l,d,u,h,p,f;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.clientX,r=e.clientY,i=e.control,s=e.nodeThatWillBeReplaced,t.validateDropTarget({clientX:o,clientY:r,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(o,r),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(t.$emit("node-added",p),s){n.next=17;break}return n.abrupt("return");case 17:return f=new kk(s,c,t.graph,p,t.processes,t.collaboration),f.migrate(),n.abrupt("return",p);case 20: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 o,r;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 o=t.$refs.nodeComponent.find((function(t){return t.node===e})),r=o.shapeView,n.next=8,t.$refs.selector.selectElement(r);case 8:case"end":return n.stop()}}),n)})))()},multiplayerHook:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=["processmaker-modeler-lane","processmaker-modeler-generic-flow","processmaker-modeler-sequence-flow","processmaker-modeler-association","processmaker-modeler-data-input-association"].concat(W(this.boundaryEventTypes));if(this.isMultiplayer&&!t){if(!o.includes(e.type)&&!this.flowTypes.includes(e.type)){var r,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,signalRef:null,signalPayload:null,extras:{},default:null};if(null!==e&&void 0!==e&&null!==(r=e.pool)&&void 0!==r&&r.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=null===(s=e.definition.sourceRef)||void 0===s?void 0:s.id,h=null===(a=e.definition.targetRef)||void 0===a?void 0:a.id;if("processmaker-modeler-data-input-association"===e.type)u=Array.isArray(e.definition.sourceRef)&&(null===(l=e.definition.sourceRef[0])||void 0===l?void 0:l.id),h=null===(d=e.definition.targetRef)||void 0===d||null===(d=d.$parent)||void 0===d||null===(d=d.$parent)||void 0===d?void 0:d.get("id");var p=[];if(null===(c=e.diagram.waypoint)||void 0===c||c.forEach((function(e){p.push({x:e.x,y:e.y})})),u&&h){var f={id:e.definition.id,type:e.type,sourceRefId:u,targetRefId:h,waypoint:p,name:e.definition.name,conditionExpression:null,color:null};if(n)return f;window.ProcessMaker.EventBus.$emit("multiplayer-addFlow",f)}}}},addNode:function(e){var t=arguments,n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=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),Vx(e,s),e.setIds(n.nodeIdGenerator,r),n.planeElements.push(e.diagram),n.multiplayerHook(e,i),Un.commit("addNode",e),n.poolTarget=null,![gl,dl,eo,El,Mo,Oo,fr].includes(e.type)){o.next=12;break}return o.abrupt("return");case 12:return i||n.selectNewNode(e),o.abrupt("return",new Promise((function(e){setTimeout((function(){n.pushToUndoStack(),e()}))})));case 14:case"end":return o.stop()}}),o)})))()},addClonedNodes:function(e){var t=this;return l(a().mark((function n(){var o;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=[],e.forEach((function(e){e.pool||(e.pool=t.poolTarget);var n=e.getTargetProcess(t.processes,t.processNode);if(Vx(e,n),t.planeElements.push(e.diagram),t.flowTypes.includes(e.type))o.push(e);else if(t.boundaryEventTypes.includes(e.type)){var r=yg(e);window.ProcessMaker.EventBus.$emit("multiplayer-addBoundaryEvent",r)}else t.multiplayerHook(e,!1);Un.commit("addNode",e),t.poolTarget=null})),o.forEach((function(e){return t.multiplayerHook(e,!1)}));case 3:case"end":return n.stop()}}),n)})))()},removeNode:function(e,t){var n=this;return l(a().mark((function o(){return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:n.isMultiplayer&&window.ProcessMaker.EventBus.$emit("multiplayer-removeNode",e),n.removeNodeProcedure(e,t);case 2:case"end":return o.stop()}}),o)})))()},removeNodeProcedure:function(e){var t=arguments,n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=t.length>1&&void 0!==t[1]?t[1]:{},i=r.removeRelationships,s=void 0===i||i,e){o.next=3;break}return o.abrupt("return");case 3:return s&&(Lo(e,n),jo(e,n),Fo(e,n)),Uo(e),zo(n.graph,e,n.removeNode),qo(e),n.removeNodesFromLane(e),n.removeNodesFromPool(e),Un.commit("removeNode",e),Un.commit("highlightNode",n.processNode),n.$refs.selector.clearSelection(),o.next=14,n.$nextTick();case 14:return o.next=16,n.pushToUndoStack();case 16:n.processes=n.getProcesses(),n.processes&&n.processes.length>0&&(n.processNode=new pr("processmaker-modeler-process",n.processes[0],n.planeElements.find((function(e){return e.bpmnElement.id===n.processes[0].id}))));case 18:case"end":return o.stop()}}),o)})))()},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,o=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 r,i,s,c;return a().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=n.diagram.bounds,i=r.x,s=r.y,c={x:i,y:s,control:{type:o},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 o(){var r,i,s,c;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return r=t.length>1&&void 0!==t[1]&&t[1],r&&(i=n.paper.localToClientPoint(e.nodeThatWillBeReplaced.diagram.bounds),s=i.x,c=i.y,e.clientX=s,e.clientY=c),o.next=4,n.handleDrop(e);case 4:return o.next=6,n.removeNode(e.nodeThatWillBeReplaced,{removeRelationships:!1,isReplaced:r});case 6:case"end":return o.stop()}}),o)})))()},replaceAiNode:function(e){var t=this,n=e.node,o=e.typeToReplaceWith,r=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:o},nodeThatWillBeReplaced:n});case 3:return u=e.sent,"processmaker-modeler-task"===o&&(u.definition.screenRef=r,u.definition.name=i),"processmaker-modeler-script-task"===o&&(u.definition.scriptRef=r,u.definition.name=i),"processmaker-modeler-call-activity"===o&&(u.definition.name=i,u.definition.calledElement="ProcessId-".concat(r),u.definition.config='{"calledElement":"ProcessId-'.concat(r,'","processId":').concat(r,',"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,o=e.genericFlow,r=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",o);case 6:return e.next=8,t.$nextTick();case 8:return e.next=10,t.addNode(n,o.definition.id);case 10:return e.next=12,t.$nextTick();case 12:return e.next=14,t.highlightNode(r);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 Sb.commit("disableSavingState"),n.next=3,e();case 3:return Sb.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,o=e.control,r=my(t,n,o,this.paperManager.paper,this.graph,this.collaboration,this.$refs["paper-container"]),i=r.allowDrop,s=r.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 Lw(e,t.graph)})))},showSavedNotification:function(){Sb.dispatch("saved")},enableVersions:function(){Sb.dispatch("enableVersions")},setVersionIndicator:function(e){Sb.dispatch("setVersionIndicator",e)},setLoadingState:function(e){Sb.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(),o=n.x,r=n.y,i=n.width,s=n.height;if(e.clientX>=o&&e.clientX<=o+i&&e.clientY>=r&&e.clientY<=r+s)return!0}return!1},pointerDowInShape:function(e,t){var n=this;return l(a().mark((function o(){var r,i,s;return a().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=e.clientX,i=e.clientY,s=n.paper.findViewByModel(t),n.isDragging=!1,n.isSelecting=!1,n.isIntoTheSelection=!1,n.dragStart={x:r,y:i},!n.isPointInSelection(e)){o.next=10;break}n.isIntoTheSelection=!0,o.next=15;break;case 10:if(e.shiftKey){o.next=15;break}return o.next=13,n.$refs.selector.selectElement(s);case 13:return o.next=15,n.$nextTick();case 15:n.$refs.selector.startDrag({clientX:e.clientX,clientY:e.clientY});case 16:case"end":return o.stop()}}),o)})))()},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,o=this.paperManager.paper,r=_o().debounce((function(){window.ProcessMaker.EventBus.$emit("multiplayer-updateMousePosition",{coordinates:{clientX:t,clientY:n},paperTranslate:o.translate(),paperScale:o.scale()})}),3e6,{leading:!0,trailing:!0});r(),this.panMode||(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)},emptyPlayers:function(){this.players=[]},addPlayer:function(e){var t=this.players.find((function(t){return t.id===e.id}));t||this.players.push(e)},updateClientCursor:function(e){e&&(this.players=this.players.map((function(t){return t.id===e.id?er(er({},t),e):t})))},prepareCursorData:function(e){var t=this.paperManager.paper,n=t.translate(),o=n.tx-e.cursor.paperTranslate.tx/e.cursor.paperScale.sx,r=n.ty-e.cursor.paperTranslate.ty/e.cursor.paperScale.sy,i=e.cursor.coordinates.clientX/e.cursor.paperScale.sx+o,s=e.cursor.coordinates.clientY/e.cursor.paperScale.sy+r;return{cursor:{left:i,top:s},color:e.color,name:e.name}},unhightligtNodes:function(e){var t,n=this,o=this.players.find((function(t){return t.id===e}));null===o||void 0===o||null===(t=o.selectedNodes)||void 0===t||t.forEach((function(e){var t=n.getElementByNodeId(e);t&&t.component.setHighlightColor(!1,o.color)}))},updateHightligtedNodes:function(e){var t,n=this;e&&(this.unhightligtNodes(e.id),this.players=this.players.map((function(t){return t.id===e.id?er(er({},t),e):t})),null===e||void 0===e||null===(t=e.selectedNodes)||void 0===t||t.forEach((function(t){var o=n.getElementByNodeId(t);o&&o.component.setHighlightColor(!0,e.color)})))},isMultiplayerSelected:function(e){var t,n=!1;e&&(null===(t=this.players)||void 0===t||t.some((function(t){var o;return!!n||(n=null===t||void 0===t||null===(o=t.selectedNodes)||void 0===o?void 0:o.some((function(t){return e.includes(t)})),!1)})));return n},removePlayer:function(e){var t=this.players.findIndex((function(t){return t.id===e}));-1!==t&&this.players.splice(t,1)},updateLasso:function(){this.$refs.selector.updateSelectionBox()},getNonce:function(){var e=999999999999999,t=Math.floor(Math.random()*e);this.currentNonce=t,localStorage.currentNonce=this.currentNonce},getPromptSessionForUser:function(){var e=localStorage.getItem("promptSessions");e=e?JSON.parse(e):[];var t=e.find((function(e){var t;return e.userId===(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id)&&e.server===window.location.host}));return t?t.promptSessionId:""},setPromptSessions:function(e){var t,n="userId",o=null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id,r=localStorage.getItem("promptSessions");r=r?JSON.parse(r):[];var i=r.find((function(e){return e[n]===o&&e.server===window.location.host}));i?i.promptSessionId=e:r.push(y(y(y({},n,o),"server",window.location.host),"promptSessionId",e)),localStorage.setItem("promptSessions",JSON.stringify(r))},removePromptSessionForUser:function(){var e=localStorage.getItem("promptSessions");e=e?JSON.parse(e):[];var t=e.find((function(e){var t;return e.userId===(null===(t=window.ProcessMaker)||void 0===t||null===(t=t.modeler)||void 0===t||null===(t=t.process)||void 0===t?void 0:t.user_id)&&e.server===window.location.host}));t&&(t.promptSessionId=""),localStorage.setItem("promptSessions",JSON.stringify(e))},fetchHistory:function(){var e,t=this,n="/package-ai/getPromptSessionHistory",o={server:window.location.host,processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.id};this.promptSessionId&&null!==this.promptSessionId&&""!==this.promptSessionId&&(o={promptSessionId:this.promptSessionId}),window.ProcessMaker.apiClient.post(n,o).then((function(e){t.setPromptSessions(e.data.promptSessionId),t.promptSessionId=e.data.promptSessionId,localStorage.promptSessionId=e.data.promptSessionId})).catch((function(e){var n,o=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message)||e.message;t.loading=!1,404===e.response.status?(t.removePromptSessionForUser(),localStorage.promptSessionId="",t.promptSessionId="",t.fetchHistory()):window.ProcessMaker.alert(o,"danger")}))},onGenerateAssets:function(){this.isAiGenerated=!1,this.saveBpmn(null,null,!0)},generateAssets:function(){var e,t=this;this.getNonce(),this.loadingAI=!0,this.fetchHistory();var n={promptSessionId:this.promptSessionId,nonce:this.currentNonce,processId:null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.id},o="/package-ai/generateProcessArtifacts";window.ProcessMaker.apiClient.post(o,n).then((function(e){var n;e.data&&(null!==(n=e.data)&&void 0!==n&&n.error&&(t.assetFail=!0,t.loadingAI=!1))})).catch((function(e){var n,o=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message)||e.message;window.ProcessMaker.alert(o,"danger"),t.assetFail=!0,t.loadingAI=!1}))},highlightTaskArrays:function(e){e&&(this.addAiHighlights(e.tasks),this.addAiHighlights(e.serviceTasks),this.addAiHighlights(e.scriptTasks))},unhighlightTaskArrays:function(e){e&&(this.removeAiHighlights(e.tasks),this.removeAiHighlights(e.serviceTasks),this.removeAiHighlights(e.scriptTasks))},addAiHighlights:function(e){var t=this;e.forEach((function(e){var n=t.getElementByNodeId(e.id);n.component.setAiStatusHighlight(e.status)}))},removeAiHighlights:function(e){var t=this;e.forEach((function(e){var n=t.getElementByNodeId(e.id);n.component.unsetHighlights()}))},subscribeToProgress:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsProgressEvent";window.Echo&&window.Echo.private(n).listen(o,(function(e){e.data.promptSessionId===t.promptSessionId?t.cancelledJobs.some((function(t){return t===e.data.nonce}))?t.unhighlightTaskArrays(e.data):e.data&&("running"===e.data.progress.status?(t.loadingAI=!0,t.highlightTaskArrays(e.data)):"error"===e.data.progress.status?(t.loadingAI=!1,window.ProcessMaker.alert(e.data.message,"danger"),t.assetFail=!0,t.loadingAI=!1):(t.highlightTaskArrays(e.data),setTimeout((function(){t.unhighlightTaskArrays(e.data)}),1e3),t.setPromptSessions(e.data.promptSessionId),t.assetsCreated=!0,t.fetchHistory(),setTimeout((function(){t.loadingAI=!1}),500))):t.unhighlightTaskArrays(e.data)}))},subscribeToGenerationCompleted:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsCompletedEvent";window.Echo.private(n).listen(o,(function(e){e.data&&(t.updateScreenRefs(e.data.screenIds),t.updateScriptRefs(e.data.scriptIds))}))},subscribeToErrors:function(){var e,t=this,n="ProcessMaker.Models.User.".concat(null===(e=window.ProcessMaker)||void 0===e||null===(e=e.modeler)||void 0===e||null===(e=e.process)||void 0===e?void 0:e.user_id),o=".ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsErrorEvent";window.Echo.private(n).listen(o,(function(){t.assetFail=!0,t.loadingAI=!1}))},onStopAssetGeneration:function(){this.currentNonce&&(this.cancelledJobs.push(this.currentNonce),localStorage.setItem("cancelledJobs",JSON.stringify(this.cancelledJobs)),this.loadingAI=!1)},updateScreenRefs:function(e){var t=this;e.forEach((function(e){var n=t.nodes.find((function(t){return t.definition.id===e.node_id})),o=n.definition;"processmaker-modeler-task"===n.type&&(o.screenRef=e.screen_id,Un.commit("updateNodeProp",{node:n,key:"definition",value:o}),t.$emit("save-state"))}))},updateScriptRefs:function(e){var t=this;e.forEach((function(e){var n=t.nodes.find((function(t){return t.definition.id===e.node_id})),o=n.definition;"processmaker-modeler-script-task"===n.type&&(o.scriptRef=e.script_id,Un.commit("updateNodeProp",{node:n,key:"definition",value:o}),t.$emit("save-state"))}))}},created:function(){Ss()&&(window.store=Un,window.undoRedoStore=Sb),this.$t=this.$t.bind(this),window.ProcessMaker.EventBus.$emit("modeler-before-init",{registerComponentMixin:this.registerComponentMixin}),this.registerNode(tb),window.ProcessMaker.EventBus.$emit("modeler-init",{$t:this.$t,modeler:this,registerMenuAction:this.registerMenuAction,registerInspectorExtension:Ow,registerBpmnExtension:this.registerBpmnExtension,registerNode:this.registerNode,registerStatusBar:this.registerStatusBar,registerPmBlock:this.registerPmBlock,registerPreview:this.registerPreview}),this.moddle=new(Ag())(this.extensions),this.linter=new Eb.Linter(fy),this.xmlManager=new vk(this.moddle),this.$emit("set-xml-manager",this.xmlManager)},mounted:function(){this.mountedInit(),this.addEventHandlers(),this.registerCustomNodes(),this.initAI(),this.linkEditingInit(),this.initTransparentDragging()}},GO=WO,$O=(f(75317),mo(GO,fg,mg,!1,null,null,null)),XO=$O.exports,YO=f(87299),JO=f.n(YO),ZO={extends:zp,mixins:[tc],data:function(){return{nodeIcon:JO(),iconName:""}}},KO=ZO,QO=mo(KO,RO,BO,!1,null,null,null),eN=QO.exports,tN=76,nN="processmaker-modeler-manual-task",oN={id:nN,component:eN,bpmnType:"bpmn:ManualTask",control:!1,category:"BPMN",icon:f(8565),label:sr[nN],loopInspectorIndex:1,definition:function(e,t){return e.create("bpmn:ManualTask",{name:t(sr[nN]),assignment:"requester",loopCharacteristics:null,ioSpecification:null})},diagram:function(e){return e.create("bpmndi:BPMNShape",{bounds:e.create("dc:Bounds",{height:tN,width:116})})},inspectorConfig:[{name:sr[nN],items:[{component:"FormAccordion",container:!0,config:{initiallyOpen:!0,label:"Properties",icon:"cog",name:"inspector-accordion-manual-task"},items:[{component:"FormInput",config:_a}]},Ha,Da]}]},rN={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}})}},iN=rN,sN=mo(iN,LO,jO,!1,null,null,null),aN=sN.exports,cN="processmaker-modeler-conditional-start-event",lN=ac()(hr()(Td),er(er({},pp),{},{id:cN,component:aN,label:nr[cN],definition:function(e,t){return e.create("bpmn:StartEvent",{name:t(nr[cN]),eventDefinitions:[e.create("bpmn:ConditionalEventDefinition",{condition:e.create("bpmn:FormalExpression",{body:""})})]})},inspectorConfig:[{items:[{items:[{}].concat(W(hp()))}]}]})),dN=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))},uN=[],hN={components:{CrownConfig:Ms},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"],o="bpmn:DataStoreReference"===this.sourceNode.definition.$type,r="bpmn:DataObjectReference"===this.sourceNode.definition.$type;return!(!o||!t.includes(e))||r&&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:Vo(this.node.definition.targetRef.$parent,this.$parent)},updateRouter:function(){this.shape.router("normal",{elementPadding:this.elementPadding})},updateDefinitionLinks:function(){var e=this.shape.getTargetElement(),t=Ho(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&&(Wo(this.targetNode,this.sourceNode.definition),(0,Ao.pull)(this.targetNode.definition.get("dataInputAssociations"),this.node.definition))}},pN=hN,fN=mo(pN,dN,uN,!1,null,null,null),mN=fN.exports,gN=function(){function e(t,n,o){d(this,e),this.nodeRegistry=t,this.moddle=n,this.paper=o}return g(e,[{key:"makeFlowNode",value:function(e,t,n){var o=this,r=Ro(this.moddle),i=Do(this.moddle),s=Ho(this.moddle,t.component.node,e.component.node.definition);i.set("targetRef",s),i.set("sourceRef",[e.component.node.definition]),r.waypoint=n.map((function(e){return o.moddle.create("dc:Point",e)}));var a=new pr(Oo,i,r);return a}}]),e}(),vN=er(er({},t),{},{component:mN,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:Ds}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new gN(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,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)})))()}}),bN=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))},yN=[],wN={components:{CrownConfig:Ms},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,Ao.pull)(this.sourceNode.definition.get("dataOutputAssociations"),this.node.definition)}},xN=wN,kN=mo(xN,bN,yN,!1,null,null,null),CN=kN.exports,SN=er(er({},e),{},{component:CN,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:Ds}]}]}],multiplayerClient:function(e,t){return l(a().mark((function n(){var o,r,i,s,c,l;return a().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=e.paper,r=e.getElementByNodeId(t.sourceRefId),i=e.getElementByNodeId(t.targetRefId),r&&i&&(s=new PC(e.nodeRegistry,e.moddle,o),c=s.makeFlowNode(r,i,t.waypoint),e.addNode(c,t.id,!0),l=B(e.definitions),l.updateCounters());case 4:case"end":return n.stop()}}),n)})))()}}),EN=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":[]}'),AN=[Id,Am,Rm,Wa,gf,Vf,oN,Bf,Wf,Bc,Wc,sl,Kc,vl,Al,Bs,vN,SN,sg,Um,em],_N=[[Ud,"bpmn:StartEvent","bpmn:SignalEventDefinition"],[Cu,"bpmn:StartEvent","bpmn:TimerEventDefinition"],[Yd,"bpmn:StartEvent","bpmn:MessageEventDefinition"],[lN,"bpmn:StartEvent","bpmn:ConditionalEventDefinition"],[fh,"bpmn:IntermediateCatchEvent","bpmn:TimerEventDefinition"],[Dh,"bpmn:IntermediateCatchEvent","bpmn:MessageEventDefinition"],[Hh,"bpmn:IntermediateCatchEvent","bpmn:SignalEventDefinition"],[Zh,"bpmn:IntermediateThrowEvent","bpmn:MessageEventDefinition"],[ip,"bpmn:IntermediateThrowEvent","bpmn:SignalEventDefinition"],[mp,"bpmn:IntermediateCatchEvent","bpmn:ConditionalEventDefinition"],[Mw,"bpmn:BoundaryEvent","bpmn:TimerEventDefinition"],[qy,"bpmn:BoundaryEvent","bpmn:ErrorEventDefinition"],[ow,"bpmn:BoundaryEvent","bpmn:EscalationEventDefinition"],[uw,"bpmn:BoundaryEvent","bpmn:MessageEventDefinition"],[yw,"bpmn:BoundaryEvent","bpmn:SignalEventDefinition"],[Jy,"bpmn:BoundaryEvent","bpmn:ConditionalEventDefinition"],[Vl,"bpmn:EndEvent","bpmn:MessageEventDefinition"],[uc,"bpmn:EndEvent","bpmn:ErrorEventDefinition"],[sd,"bpmn:EndEvent","bpmn:SignalEventDefinition"],[yc,"bpmn:EndEvent","bpmn:TerminateEventDefinition"]],MN=function(e,t,n){return function(o){var r=o.get("eventDefinitions"),i=o.$type===t&&r&&r.length&&r[0].$type===n;if(i)return e.id}};function TN(e){var t=e.registerNode,n=e.registerBpmnExtension;_N.forEach((function(e){var n=jt(e,3),o=n[0],r=n[1],i=n[2];t(o,MN(o,r,i))})),AN.forEach((function(e){return t(e)})),n("pm",EN)}}(),m}()}));
35
35
  //# sourceMappingURL=modeler.umd.min.js.map