PageSourceSearch

https://www.cittatec.com.br/chunk-GGS66LIV.js

js cittatec.com.br collected 2026-10-08 08:52:25 UTC 102,433 bytes, 3 lines download raw bytes

1import{a as so}from"./chunk-3IO55KQB.js";import{a as uo}from"./chunk-O2ON2TZI.js";import{a as lo}from"./chunk-E4BCVP3A.js";import"./chunk-AAQ22NZL.js";import{F as Se,N as po,b as Ee}from"./chunk-VT4M4H44.js";import{a as Fe}from"./chunk-JTZVP4CJ.js";import"./chunk-PXKOPY4W.js";import"./chunk-XM33VNJP.js";import"./chunk-KJH6VKDN.js";import{a as ri,b as ai,d as si,e as li,f as fo}from"./chunk-KQERW7FL.js";import{a as Wr}from"./chunk-47WFNGJO.js";import{a as co}from"./chunk-QQPDOYPX.js";import{B as me}from"./chunk-4RO7H3W6.js";import{$d as ao,Ad as io,Bd as no,Cb as fe,Ga as ti,Gb as An,Hb as Rn,Ib as xe,Id as oo,Jb as Dn,Jd as ro,Kb as Nn,Lb as Vn,Wa as st,Ya as In,_d as pt,aa as En,ad as Hn,bb as ii,dd as zn,eb as Pn,fb as We,fc as je,gc as Wn,gd as oi,hc as jn,ic as Fn,id as Kn,jd as Yn,ka as ae,kc as $n,kd as Qn,la as Sn,lc as Ln,ld as Xn,ma as Ve,mc as Bn,md as Jn,na as Tn,nc as qn,nd as Zn,pa as ei,q as De,qa as Te,qc as ni,r as Zt,rc as Gn,s as kn,vc as lt,wc as Un,wd as eo,xb as Mn,y as xn,yb as On,yd as ct,zd as to}from"./chunk-4DOLY3ZP.js";import{g as be,h as we,j as ke,r as wn}from"./chunk-UHCXUTTI.js";import{a as Ot}from"./chunk-UUEWT2GC.js";import{A as at,F as Ne,I as ji,l as bn}from"./chunk-LNDCK25Q.js";import{$b as re,Aa as fn,Ac as u,Ba as Ht,Bb as m,Bc as p,Cc as O,De as ot,Ea as et,Ed as ne,Ee as Jt,Fa as ze,Fd as se,Gb as Mt,Gd as _n,H as cn,Ic as vn,K as pn,Kc as V,Ke as rt,Na as v,Nb as A,Ne as Cn,Oa as g,Pc as k,Rb as Kt,Rc as h,Ta as zt,U as Ze,Ue as yn,Vb as oe,Vc as tt,Wb as Yt,Wc as it,Xc as nt,ab as mn,ad as gn,ba as un,ed as I,fd as de,g as ye,gd as _e,kd as ee,ld as te,md as ie,pa as dn,ra as q,sc as X,ta as Re,uc as J,vc as hn,x as ln,xc as Qt,yc as Xt,zc as T}from"./chunk-3NMV3A67.js";import{a as Ut,b as sn,g as Vr,h as Z,j as Wi}from"./chunk-K7KL5AIA.js";var ut=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Set allowed tasks for the module"}},Ie=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Select workflow step"}},dt=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Add inputs tasks"}},ft=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Update inputs tasks"}},mt=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Remove inputs tasks"}},ht=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Add condition to tasks"}},vt=class{constructor(t){this.payload=t}static{this.type="[Workflow Task] Remove condition to tasks"}};var Fr=new En("workflow_store"),vo=[{description:"Reparti\xE7\xE3o respons\xE1vel",input:"REPARTICAO_RESPONSAVEL",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Usu\xE1rio respons\xE1vel",input:"USUARIO_RESPONSAVEL",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Responsabilidade da reparti\xE7\xE3o que elaborou",input:"REPARTICAO_RESPONSAVEL_ELABOROU",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Responsabilidade do usu\xE1rio que elaborou",input:"USUARIO_RESPONSAVEL_ELABOROU",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Cargo respons\xE1vel",input:"CARGO_RESPONSAVEL",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1}],Fi=[...vo,{description:"Habilitar canal de notifica\xE7\xE3o",input:"HABILITAR_CANAL_NOTIFICACAO",multiple:!0,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Prazo para executar tarefa",input:"PRAZO",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1},{description:"Formato de contagem de prazos",input:"FORMA_CONTAGEM_PRAZO",multiple:!1,required:!1,runtimeValue:!1,displaySetting:!1}],mo=(e,t)=>{let i=vo.map(n=>n.input);return e.filter(n=>{let o=i.includes(n.input);return t.isResponsable?o:!o})},x=class{constructor(t,i,n,o,r){this.store=t;this.serviceTask=i;this.serviceWorkflowStep=n;this.funcoes=o;this.alerts=r;this.inputNotFound=t=>({input:t,description:"A entrada n\xE3o \xE9 mais permitida para esta tarefa",required:!1,runtimeValue:!1,multiple:!1,displaySetting:!1})}static tasks(t){return t.tasks}static conditions(t){return t.conditions}static selectedTask(t){return t.selectedTask}static selectedStep(t){return t.selectedStep}static appliedInputParsed(t){let i=n=>{let o=n.find(r=>r.input===t)?.value;return o&&JSON.parse(o)};return ei([x.appliedInputs],i)}static appliedInputs(t){return t.appliedInputs||[]}static appliedInputsFiltered(t){let i=n=>mo(n,t);return ei([x.appliedInputs],i)}static acceptedInputs(t){return t.selectedTask?t.selectedTask.acceptedInputs:Fi}static acceptedInputsFiltered(t){let i=n=>mo(n,t);return ei([x.acceptedInputs],i)}static requiredInputs(t){let i=x.acceptedInputs(t),n=x.appliedInputs(t);return i.filter(o=>o.required).filter(o=>!n.find(r=>r.input===o.input))}static appliedConditions(t){return t.appliedConditions||[]}ngxsOnInit({patchState:t}){this.store.select(We.modulo).pipe(pn(i=>!!i?.name),dn(i=>this.serviceTask.listConditions(i))).subscribe(i=>t({conditions:i}))}configureTasks({patchState:t},{payload:i}){t({tasks:i})}selectStep({getState:t,patchState:i},{payload:n}){let o=null,r=[],s=[];
1if(!n){i({selectedStep:null,selectedTask:o,appliedInputs:r,appliedConditions:s});return}o=t().tasks.find(a=>a.name===n.task);let c=o?o.acceptedInputs:Fi;r=n.inputs.map(a=>this.workflowInputToInputTaskDef(a,c)).sort(this.funcoes.sortByProperty("description")),s=n.conditions.map(a=>this.workflowConditionToConditionDef(a,t().conditions)).sort(this.funcoes.sortByProperty("description")),i({selectedStep:n,selectedTask:o,appliedInputs:r,appliedConditions:s})}addInput({getState:t,patchState:i},{payload:n}){if(!n.multiple){let r=this.findInputApplied(t().appliedInputs,n.input);if(r){this.alerts.warning(`${r.description}, j\xE1 existe nas entradas aplicadas! 
2
3					OBS: Para permitir inserir, a propriedade "Aceitar Multiplos Valores" deve estar habilitada.`);return}}let o=t().selectedTask?t().selectedTask.acceptedInputs:Fi;this.serviceWorkflowStep.saveInput(n).pipe(Ze(1),Re(r=>{i({appliedInputs:[...t().appliedInputs,this.workflowInputToInputTaskDef(r,o)]})})).subscribe()}findInputApplied(t,i){let n=t.filter(o=>o.input===i);return n.length>0?n[0]:null}updateInput({getState:t,patchState:i},{payload:n}){this.serviceWorkflowStep.saveInput(n).pipe(Ze(1)).subscribe(o=>{let r=t().appliedInputs.find(s=>s.id===n.id);r.value=o.value,r.runtimeValue=o.runtimeValue,r.required=o.required,r.multiple=o.multiple,i({appliedInputs:[...t().appliedInputs]})})}removeInput({getState:t,patchState:i},{payload:n}){this.serviceWorkflowStep.deleteInput(n.idWorkflow,n.uuid,n.id).pipe(Ze(1),Re(()=>{let o=t().appliedInputs.filter(r=>r.id!==n.id);i({appliedInputs:[...o]})})).subscribe()}addCondition({getState:t,patchState:i},{payload:n}){this.serviceWorkflowStep.saveCondition(n).pipe(Ze(1),Re(o=>{i({appliedConditions:[...t().appliedConditions,this.workflowConditionToConditionDef(o,t().conditions)]})})).subscribe()}removeCondition({getState:t,patchState:i},{payload:n}){this.serviceWorkflowStep.deleteCondition(n.idWorkflow,n.uuid,n.id).pipe(Ze(1),Re(()=>{let o=t().appliedConditions.filter(r=>r.id!==n.id);i({appliedConditions:[...o]})})).subscribe()}findInputTaskDef(t,i){return i?i.find(n=>n.input===t)||this.inputNotFound(t):this.inputNotFound(t)}workflowInputToInputTaskDef(t,i){let n=this.findInputTaskDef(t.input,i);return Ut(Ut({},n),t)}workflowConditionToConditionDef(t,i){let n=i.find(o=>o.condition===t.condition);return sn(Ut({id:t.id},n),{value:t.value})}};x.\u0275fac=function(i){return new(i||x)(et(ae),et(po),et(Se),et(In),et(ii))},x.\u0275prov=fn({token:x,factory:x.\u0275fac}),Z([Ve(ut)],x.prototype,"configureTasks",1),Z([Ve(Ie)],x.prototype,"selectStep",1),Z([Ve(dt)],x.prototype,"addInput",1),Z([Ve(ft)],x.prototype,"updateInput",1),Z([Ve(mt)],x.prototype,"removeInput",1),Z([Ve(ht)],x.prototype,"addCondition",1),Z([Ve(vt)],x.prototype,"removeCondition",1),Z([Te()],x,"tasks",1),Z([Te()],x,"conditions",1),Z([Te()],x,"selectedTask",1),Z([Te()],x,"selectedStep",1),Z([Te()],x,"appliedInputs",1),Z([Te()],x,"acceptedInputs",1),Z([Te()],x,"requiredInputs",1),Z([Te()],x,"appliedConditions",1),x=Z([Tn({name:Fr,defaults:{tasks:[],conditions:[],appliedInputs:[],appliedConditions:[]}})],x);var Rt=class e{constructor(t,i,n,o){this.store=t;this.router=i;this.route=n;this.service=o;this.workflow={};this.ngUnsubscribe=new ye}ngAfterViewInit(){this.route.snapshot.params?.id&&this.service.findById(this.route.snapshot.params.id).pipe(q(this.ngUnsubscribe)).subscribe(t=>this.workflow=t)}cancel(){this.router.navigate(["."],{relativeTo:this.route.parent})}save(){this.workflow.module=this.store.selectSnapshot(We.modulo),this.service.save(this.workflow).pipe(q(this.ngUnsubscribe)).subscribe(t=>{this.route.snapshot.params.id?this.router.navigate(["."],{relativeTo:this.route.parent}):this.router.navigate(["elaborar/"+t.id],{relativeTo:this.route.parent})})}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}static{this.\u0275fac=function(i){return new(i||e)(A(ae),A(Ne),A(at),A(Fe))}}static{this.\u0275cmp=oe({type:e,selectors:[["ng-component"]],standalone:!1,decls:9,vars:5,consts:[["form","ngForm"],[3,"serviceName"],["autocomplete","off"],["label","Descri\xE7\xE3o","name","description","maxLength","512",3,"valueChange","value","required"],["label","Cor do Workflow","name","color",3,"valueChange","value"],["label","Salvar",3,"onClick","serviceName"],["label","Cancelar",3,"onClick"]],template:function(i,n){if(i&1){let o=V();u(0,"ct-portlet",1)(1,"form",2,0)(3,"ct-row")(4,"ct-input",3),ie("valueChange",function(s){return v(o),te(n.workflow.description,s)||
3(n.workflow.description=s),g(s)}),p()(),u(5,"ct-row")(6,"ct-color-picker",4),ie("valueChange",function(s){return v(o),te(n.workflow.color,s)||(n.workflow.color=s),g(s)}),p()(),u(7,"ct-submit",5),k("onClick",function(){return v(o),g(n.save())}),p(),u(8,"ct-button",6),k("onClick",function(){return v(o),g(n.cancel())}),p()()()}i&2&&(T("serviceName",n.service.names.FINDBYID),m(4),ee("value",n.workflow.description),T("required",!0),m(2),ee("value",n.workflow.color),m(),T("serviceName",n.service.names.SAVE))},dependencies:[ke,be,we,je,fe,xe,ct,lt,Jn],encapsulation:2})}};var Lr=["form"];function Br(e,t){if(e&1&&(u(0,"tr",8)(1,"td",9),I(2),p()()),e&2){let i=t.$implicit;T("ctTableRow",i),m(2),_e(" ",i.descricao," ")}}var ui=class e{constructor(t,i,n,o,r){this.activeModal=t;this.serviceWorkflow=i;this.serviceClassificacao=n;this.cittaModuleService=o;this.destroyRef=r;this.modulos$=this.cittaModuleService.listByCurrentClient();this.classificacoes=[];this.modulosGrup=[];this.atualizar=new Mt;this.queryParams=new ti({filters:{ativo:!0},orders:["nome"],usePageable:!1})}ngOnInit(){this.carregaClassificacoes()}carregaClassificacoes(){this.serviceWorkflow.workflowClassificacaoByWorkflow(this.idWorkflow).pipe(Ot(this.destroyRef)).subscribe(t=>{this.classificacoes=t})}closeModel(){this.atualizar.next(!0),this.activeModal.close()}static{this.\u0275fac=function(i){return new(i||e)(A(De),A(Fe),A(lo),A(Pn),A(zt))}}static{this.\u0275cmp=oe({type:e,selectors:[["ng-component"]],viewQuery:function(i,n){if(i&1&&tt(Lr,7),i&2){let o;it(o=nt())&&(n.capturedForm=o.first)}},outputs:{atualizar:"atualizar"},standalone:!1,decls:14,vars:3,consts:[["form","ngForm"],["autocomplete","off"],[1,"header"],[3,"items","serviceName"],["tableSortable",""],["id","descricao"],[3,"ctTableRow",4,"ngFor","ngForOf"],["label","Voltar",1,"back",3,"onClick"],[3,"ctTableRow"],["ct-table-column","","data-label","Descri\xE7\xE3o"]],template:function(i,n){if(i&1){let o=V();u(0,"ct-portlet")(1,"form",1,0)(3,"div",2)(4,"h4"),I(5," Classifica\xE7\xE3o que este workflow esta vinculado "),p()(),u(6,"ct-table",3)(7,"thead")(8,"tr",4)(9,"th",5),I(10,"Descri\xE7\xE3o"),p()()(),u(11,"tbody"),re(12,Br,3,2,"tr",6),p()()(),u(13,"ct-button",7),k("onClick",function(){return v(o),g(n.closeModel())}),p()()}i&2&&(m(6),T("items",n.classificacoes)("serviceName",n.serviceWorkflow.names.LIST),m(6),T("ngForOf",n.classificacoes))},dependencies:[ot,ke,be,we,je,fe,ai,si,ri,li],styles:[".no-mb[_ngcontent-%COMP%]     .row{margin-bottom:1}.header[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:15px;font-weight:500;font-size:1.3rem}.back[_ngcontent-%COMP%]{margin-left:-15px}"]})}};function qr(e,t){if(e&1){let i=V();u(0,"tr",14),k("onRemove",function(){let o=v(i).$implicit,r=h();return g(r.deleteWorkflow(o.id))}),u(1,"td",15),I(2),p(),u(3,"td",16),O(4,"div",17),p(),u(5,"td",18)(6,"ct-mini-button",19),k("click",function(){let o=v(i).$implicit,r=h();return g(r.goToWorkflow(o.id))}),p(),u(7,"ct-mini-drop")(8,"ct-mini-drop-item",20),k("onClick",function(){let o=v(i).$implicit,r=h();return g(r.edit(o.id))}),p(),u(9,"ct-mini-drop-item",21),k("onClick",function(){let o=v(i).$implicit,r=h();return g(r.clonar(o.id))}),p(),u(10,"ct-mini-drop-item",22),k("onClick",function(){let o=v(i).$implicit,r=h();return g(r.deleteWorkflow(o.id))}),p(),u(11,"ct-mini-drop-item",23),k("onClick",function(){let o=v(i).$implicit,r=h();return g(r.mudaStatus(o.id))}),p(),u(12,"ct-mini-drop-item",24),k("onClick",function(){let o=v(i).$implicit,r=h();return g(r.openModalVinculo(o.id))}),p()()()()}if(e&2){let i=t.$implicit,n=h();T("ctTableRow",i),m(2),de(i.description),m(2),gn("background-color",i.color),m(6),T("serviceName",n.service.names.DELETE)("description",i.description),m(),T("serviceName",n.service.names.MUDA_STATUS)("description",i.description)("active",i.active)}}var di=class e{constructor(t,i,n,o,r){this.store=t;this.router=i;this.route=n;this.service=o;this.modalService=r;this.responsePage={};this.queryParams=new ti;this.unsubscribe$=new ye}ngOnInit(){this.filters={module:this.store.selectSnapshot(We.modulo)?.name}}list(t){this.service.listPage(t.toHttpParams()).pipe(q(this.unsubscribe$)).subscribe(i=>this.responsePage=i)}applyFilters(t){this.queryParams.filters=t,this.queryParams.resetPage(),this.list(this.queryParams)}goToWorkflow(t){this.router.navigate(["elaborar",t],{relativeTo:this.route.parent})}create(){this.router.navigate(["cadastro"],{relativeTo:this.route.parent})}edit(t){this.router.navigate(["cadastro",t],{relativeTo:this.route.parent})}openModalVinculo(t){let i=this.modalService.open(ui,{size:"lg"}).componentInstance;i.idWorkflow=t}clonar(t){this.service.clone(t).pipe(q(this.unsubscribe$)).subscribe({next:i=>this.router.navigate(["cadastro",i?.id],{relativeTo:this.route.parent}),error:i=>st.warning(i.error.message||"Problema ao clonar","Aten\xE7\xE3o!")})}ativacao(){}mudaStatus(t){this.service.inativar(t).pipe(q(this.unsubscribe$)).subscribe(()=>{this.queryParams.resetPage(),this.list(this.queryParams)})}deleteWorkflow(t){this.service.delete(t).pipe(q(this.unsubscribe$)).subscribe(()=>this.list(this.queryParams.resetPage()))}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}static{this.\u0275fac=function(i){return new(i||e)(A(ae),A(Ne),A(at),A(Fe),A(Zt))}}static{this.\u0275cmp=oe({type:e,selectors:[["ng-component"]],standalone:!1,decls:20,vars:9,consts:[[1,"filter-line"],["label","Incluir workflow",3,"onClick"],[1,"btn-separator"],[3,"onSubmit","preset","serviceName"],["ctFilterItem","","name","description","label","Descri\xE7\xE3o",3,"ctFilterPinned","inputSize"],["ctFilterItem","","name","active","label","Workflows ativos","value","true",3,"inputSize"],["label","Sim","value","true"],["label","N\xE3o","value","false"],[3,"onChange","queryParamsChange","responsePage","queryParams","serviceName"],["tableSortable",""],["id","descricao","sortField","descricao"],["id","cor"],["id","opcoes",2,"width","78px"],[3,"ctTableRow","onRemove",4,"ngFor","ngForOf"],[3,"onRemove","ctTableRow"],["ct-table-column","","data-label","Descri\xE7\xE3o"],["ct-table-column","","data-label","Cor"],[1,"workflow-color"],["ct-table-column","",1,"td-buttons"],["
3iconType","las la-sitemap","type","btn-primary",3,"click"],["label","Editar","icon","las la-pencil-alt",3,"onClick"],["label","Clonar","icon","las la-object-ungroup",3,"onClick"],["action","delete",3,"onClick","serviceName","description"],["action","status",3,"onClick","serviceName","description","active"],["label","Vinculos","icon","las la-link",3,"onClick"]],template:function(i,n){i&1&&(u(0,"ct-portlet")(1,"ct-row",0)(2,"ct-button-new",1),k("onClick",function(){return n.create()}),p(),O(3,"span",2),u(4,"ct-filter",3),k("onSubmit",function(r){return n.applyFilters(r)}),u(5,"ct-row"),O(6,"ct-input",4),u(7,"ct-choice",5),O(8,"ct-choice-item",6)(9,"ct-choice-item",7),p()()()(),u(10,"ct-table",8),k("onChange",function(r){return n.list(r)}),ie("queryParamsChange",function(r){return te(n.queryParams,r)||(n.queryParams=r),r}),u(11,"thead")(12,"tr",9)(13,"th",10),I(14,"Descri\xE7\xE3o"),p(),u(15,"th",11),I(16,"Cor"),p(),O(17,"th",12),p()(),u(18,"tbody"),re(19,qr,13,9,"tr",13),p()()()),i&2&&(m(4),T("preset",n.filters)("serviceName",n.service.names.LIST),m(2),T("ctFilterPinned",!0)("inputSize",6),m(),T("inputSize",6),m(3),T("responsePage",n.responsePage),ee("queryParams",n.queryParams),T("serviceName",n.service.names.LIST),m(9),T("ngForOf",n.responsePage.content))},dependencies:[ot,fe,xe,ai,si,ri,li,to,eo,jn,ct,ni,Bn,Ln,Qn,Yn],styles:[".workflow-color[_ngcontent-%COMP%]{width:19px;height:19px;border-radius:50%}"]})}};var Dr=Vr(Wr());function Ke(){}Ke.prototype.get=function(){return this._data};Ke.prototype.set=function(e){this._data=e};Ke.prototype.clear=function(){var e=this._data;return delete this._data,e};Ke.prototype.isEmpty=function(){return!this._data};var _o={clipboard:["type",Ke]};var fi=Object.prototype.toString,Gr=Object.prototype.hasOwnProperty;function Ct(e){return e===void 0}function yt(e){return e!==void 0}function j(e){return fi.call(e)==="[object Array]"}function Vt(e){return fi.call(e)==="[object Object]"}function $e(e){return fi.call(e)==="[object Number]"}function Co(e){var t=fi.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Me(e,t){return Gr.call(e,t)}function G(e,t){t=zr(t);var i;return S(e,function(n,o){if(t(n,o))return i=n,!1}),i}function U(e,t){var i=[];return S(e,function(n,o){t(n,o)&&i.push(n)}),i}function S(e,t){var i,n;if(!Ct(e)){var o=j(e)?Yr:Kr;for(var r in e)if(Me(e,r)&&(i=e[r],n=t(i,o(r)),n===!1))return i}}function bt(e,t,i){return S(e,function(n,o){i=t(i,n,o)}),i}function Ur(e,t){return!!bt(e,function(i,n,o){return i&&t(n,o)},!0)}function yo(e,t){return!!G(e,t)}function Oe(e,t){var i=[];return S(e,function(n,o){i.push(t(n,o))}),i}function Wt(e,t){t=Hr(t);var i=[];return S(e,function(n,o){for(var r=t(n,o),s={d:r,v:n},c=0;c<i.length;c++){var a=i[c].d;if(r<a){i.splice(c,0,s);return}}i.push(s)}),Oe(i,function(n){return n.v})}function Le(e){return function(t){return Ur(e,function(i,n){return t[n]===i})}}function Hr(e){return Co(e)?e:function(t){return t[e]}}function zr(e){return Co(e)?e:function(t){return t===e}}function Kr(e){return e}function Yr(e){return Number(e)}function qi(){return qi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},qi.apply(this,arguments)}function D(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return qi.apply(void 0,[e].concat(i))}function bo(e,t){var i={},n=Object(e);return S(t,function(o){o in n&&(i[o]=e[o])}),i}function Ye(e,t){var i={},n=Object(e);return S(n,function(o,r){t.indexOf(r)===-1&&(i[r]=o)}),i}function Gi(e,t,i){return arguments.length==2?e.getAttribute(t):i===null?e.removeAttribute(t):(e.setAttribute(t,i),e)}var Qr=[].indexOf,Ui=function(e,t){if(Qr)return e.indexOf(t);for(var i=0;i<e.length;++i)if(e[i]===t)return i;return-1},Xr=/\s+/,Jr=Object.prototype.toString;function kt(e){return new Be(e)}function Be(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Be.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),i=Ui(t,e);return~i||t.push(e),this.el.className=t.join(" "),this};Be.prototype.remove=function(e){if(Jr.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),i=Ui(t,e);return~i&&t.splice(i,1),this.el.className=t.join(" "),this};Be.prototype.removeMatching=function(e){for(var t=this.array(),i=0;i<t.length;i++)e.test(t[i])&&this.remove(t[i]);return this};Be.prototype.toggle=function(e,t){return this.list?(typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(typeof t<"u"?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)};Be.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),i=t.split(Xr);return i[0]===""&&i.shift(),i};Be.prototype.has=Be.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Ui(this.array(),e)};var wt=typeof Element<"u"?Element.prototype:{},wo=wt.matches||wt.matchesSelector||wt.webkitMatchesSelector||wt.mozMatchesSelector||wt.msMat
3chesSelector||wt.oMatchesSelector,ko=Zr;function Zr(e,t){if(!e||e.nodeType!==1)return!1;if(wo)return wo.call(e,t);for(var i=e.parentNode.querySelectorAll(t),n=0;n<i.length;n++)if(i[n]==e)return!0;return!1}function Hi(e,t,i){for(var n=i?e:e.parentNode;n&&n.nodeType!==document.DOCUMENT_NODE&&n.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(ko(n,t))return n;n=n.parentNode}return ko(n,t)?n:null}var xo=window.addEventListener?"addEventListener":"attachEvent",ea=window.removeEventListener?"removeEventListener":"detachEvent",Eo=xo!=="addEventListener"?"on":"",ta=function(e,t,i,n){return e[xo](Eo+t,i,n||!1),i},ia=function(e,t,i,n){return e[ea](Eo+t,i,n||!1),i},F={bind:ta,unbind:ia},So=["focus","blur"];function na(e,t,i,n,o){return So.indexOf(i)!==-1&&(o=!0),F.bind(e,i,function(r){var s=r.target||r.srcElement;r.delegateTarget=Hi(s,t,!0,e),r.delegateTarget&&n.call(e,r)},o)}function oa(e,t,i,n){return So.indexOf(t)!==-1&&(n=!0),F.unbind(e,t,i,n)}var jt={bind:na,unbind:oa},xt=ra,To=!1,mi;typeof document<"u"&&(mi=document.createElement("div"),mi.innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',To=!mi.getElementsByTagName("link").length,mi=void 0);var H={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:To?[1,"X<div>","</div>"]:[0,"",""]};H.td=H.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];H.option=H.optgroup=[1,'<select multiple="multiple">',"</select>"];H.thead=H.tbody=H.colgroup=H.caption=H.tfoot=[1,"<table>","</table>"];H.polyline=H.ellipse=H.polygon=H.circle=H.text=H.line=H.path=H.rect=H.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ra(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var i=/<([\w:]+)/.exec(e);if(!i)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var n=i[1];if(n=="body"){var a=t.createElement("html");return a.innerHTML=e,a.removeChild(a.lastChild)}var o=H[n]||H._default,r=o[0],s=o[1],c=o[2],a=t.createElement("div");for(a.innerHTML=s+e+c;r--;)a=a.lastChild;if(a.firstChild==a.lastChild)return a.removeChild(a.firstChild);for(var l=t.createDocumentFragment();a.firstChild;)l.appendChild(a.removeChild(a.firstChild));return l}function qe(e,t){return t=t||document,t.querySelector(e)}function Io(e,t){return t=t||document,t.querySelectorAll(e)}function Po(e){e.parentNode&&e.parentNode.removeChild(e)}function Mo(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Et(e){return e.originalEvent||e.srcEvent}function hi(e,t){Mo(e,t),Mo(Et(e),t)}function Ft(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Oo(){return/mac/i.test(navigator.platform)}function zi(e){return!(Et(e)||e).button}function Ao(e){var t=Et(e)||e;return zi(e)?Oo()?t.metaKey:t.ctrlKey:!1}function aa(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function sa(e,t){return t.appendChild(aa(e,t))}function Ce(e,t){return sa(t,e),e}var Yi=2,No={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Yi,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Yi,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode
3-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function la(e,t){return No[t]?e.style[t]:e.getAttributeNS(null,t)}function Vo(e,t,i){var n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=No[n];o?(o===Yi&&typeof i=="number"&&(i=String(i)+"px"),e.style[n]=i):e.setAttributeNS(null,t,i)}function ca(e,t){var i=Object.keys(t),n,o;for(n=0,o;o=i[n];n++)Vo(e,o,t[o])}function z(e,t,i){if(typeof t=="string")if(i!==void 0)Vo(e,t,i);else return la(e,t);else ca(e,t);return e}function Xi(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0;i<e.length;++i)if(e[i]===t)return i;return-1}var pa=/\s+/,ua=Object.prototype.toString;function Qi(e){return typeof e<"u"}function Wo(e){return new Ge(e)}function Ge(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Ge.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),i=Xi(t,e);return~i||t.push(e),Qi(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this};Ge.prototype.remove=function(e){if(ua.call(e)==="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),i=Xi(t,e);return~i&&t.splice(i,1),this.el.className.baseVal=t.join(" "),this};Ge.prototype.removeMatching=function(e){for(var t=this.array(),i=0;i<t.length;i++)e.test(t[i])&&this.remove(t[i]);return this};Ge.prototype.toggle=function(e,t){return this.list?(Qi(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Qi(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)};Ge.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),i=t.split(pa);return i[0]===""&&i.shift(),i};Ge.prototype.has=Ge.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Xi(this.array(),e)};function Qe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Ji(e){return e.cloneNode(!0)}var Zi={svg:"http://www.w3.org/2000/svg"},Ro='<svg xmlns="'+Zi.svg+'"';function da(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Zi.svg)===-1&&(e=Ro+e.substring(4)):(e=Ro+">"+e+"</svg>",t=!0);var i=fa(e);if(!t)return i;for(var n=document.createDocumentFragment(),o=i.firstChild;o.firstChild;)n.appendChild(o.firstChild);return n}function fa(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function le(e,t){var i;return e.charAt(0)==="<"?(i=da(e).firstChild,i=document.importNode(i,!0)):i=document.createElementNS(Zi.svg,e),t&&z(i,t),i}var Ki=null;function Do(){return Ki===null&&(Ki=le("svg")),Ki}function jo(e){return e?Do().createSVGTransformFromMatrix(e):Do().createSVGTransform()}function ma(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ha(e,t){var i,n;for(e.clear(),i=0;n=t[i];i++)e.appendItem(ma(e,n))}function Fo(e,t){var i=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),ha(i,t)),i.consolidate()}function $o(e){for(var t="",i=0,n;n=e[i];i++)t+=n.x+","+n.y+" ";return t}function Lo(e,t){var i=le("polyline");return z(i,{points:$o(e)}),t&&z(i,t),i}function Bo(e,t){return z(e,{points:$o(t)}),e}function va(e){return!0}var qo=500;function vi(e,t,i){var n=this;function o(C,b,w){if(!c(C,b)){var N,B,ge;w?B=t.getGraphics(w):(N=b.delegateTarget||b.target,N&&(B=N,w=t.get(B))),!(!B||!w)&&(ge=e.fire(C,{element:w,gfx:B,originalEvent:b}),ge===!1&&(b.stopPropagation(),b.preventDefault()))}}var r={};function s(C){return r[C]}function c(C,b){var w=l[C]||zi;return!w(b)}var a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":va};function d(C,b,w){var N=a[C];if(!N)throw new Error("unmapped DOM event name <"+C+">");return o(N,b,w)}var f="svg, .djs-element";function y(C,b,w,N){var B=r[w]=function(ge){o(w,ge)};N&&(l[w]=N),B.$delegate=jt.bind(C,f,b,B)}function _(C,b,w){var N=s(w);N&&jt.unbind(C,b,N.$delegate)}function W(C){S(a,function(b,w){y(C,w,b)})}function $(C){S(a,function(b,w){_(C,w,b)})}e.on("canvas.destroy",function(C){$(C.svg)}),e.on("canvas.init",function(C){W(C.svg)}),e.on(["shape.added","connection.added"],function(C){var b=C.element,w=C.gfx;e.fire("interactionEvents.createHit",{element:b,gfx:w})}),e.on(["shape.changed","connection.changed"],qo,function(C){var b=C.element,w=C.gfx;e.fire("interactionEvents.updateHit",{element:b,gfx:w})}),e.on("interactionEvents.createHit",qo,function(C){var b=C.element,w=C.gfx;n.createDefaultHit(b,w)}),e.on("interactionEvents.updateHit",function(C){var b=C.element,w=C.gfx;n.updateDefaultHit(b,w)});var L=M("djs-hit djs-hit-stroke"),pe=M("djs-hit djs-hit-click-stroke"),ue=M("djs-hit djs-hit-all"),P={all:ue,"click-stroke":pe,stroke:L};function M(C,b){return b=D({stroke:"white",strokeWidth:15},b||{}),i.cls(C,["no-fill","no-border"],b)}function R(C,b){var w=P[b];if(!w)throw new Error("invalid hit type <"+b+">");return z(C,w),C}function Q(C,b){Ce(C,b)}this.removeHits=function(C){var b=Io(".djs-hit",C);S(b,Qe)},this.createDefaultHit=function(C,b){var w=C.waypoints,N=C.isFrame,B;return w?this.createWaypointsHit(b,w):(B=N?"stroke":"all",this.createBoxHit(b,B,{width:C.width,height:C.height}))},this.createWaypointsHit=function(C,b){var w=Lo(b);return R(w,"stroke"),Q(C,w),w},this.createBoxHit=function(C,b,w){w=D({x:0,y:0},w);var N=le("rect");return R(N,b),z(N,w),Q(C,N),N},this.updateDefaultHit=function(C,b){var w=qe(".djs-hit",b);if(w)return C.waypoints?Bo(w,C.waypoints):z(w,{width:C.width,height:C.height}),w},this.fire=o,this.triggerMouseEvent=d,this.mouseHandler=s,this.registerEvent=y,this.unregisterEvent=_}vi.$inject=["eventBus","elementRegistry","styles"];var Go={__init__:["interactionEvents"],interactionEvents:["type",vi]};function Uo(e){return U(e,function(t){return!G(e,function(i){return i!==t&&Ho(t,i)})})}function Ho(e,t){if(t){if(e===t)return t;if(e.parent)return Ho(e.parent,t)}}function en(e,t,i){i=i||0,j(e)||(e=[e]),S(e,function(n,o){var r=t(n,o,i);j(r)&&r.length&&en(r,t,i+1)})}function Xe(e,t){t=!!t,j(e)||(e=[e]);var i,n,o,r;return S(e,function(s){var c=s;s.waypoints&&!t&&(c=Xe(s.waypoints,!0));var a=c.x,l=c.y,d=c.height||0,f=c.width||0;(a<i||i===void 0)&&(i=a),(l<n||n===void 0)&&(n=l),(a+f>o||o===void 0)&&(o=a+f),(l+d>r||r===void 0)&&(r=l+d)}),{x:i,y:n,height:r-n,width:o-i}}var ga=500;function St(e,t,i){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),o=this;function r(s,c){var a=le("rect");return z(a,D({x:10,y:10,width:100,height:100},n)),Ce(s,a),a}e.on(["shape.added","shape.changed"],ga,function(s){var c=s.element,a=s.gfx,l=qe(".djs-outline",a);l||(l=r(a,c)),o.updateShapeOutline(l,c)}),e.on(["connection.added","connection.changed"],function(s){var c=s.element,a=s.gfx,l=qe(".djs-outline",a);l||(l=r(a,c)),o.updateConnectionOutline(l,c)})}St.prototype.updateShapeOutline=function(e,t){z(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};St.prototype.updateConnectionOutline=function(e,t){var i=Xe(t);z(e,{x:i.x-this.offset,y:i.y-this.offset,width:i.width+this.offset*2,height:i.height+this.offset*2})};St.$inject=["eventBus","styles","elementRegistry"];var zo={__init__:["outline"],outline:["type",St]};function Ue(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(i){var n=i.element;t.deselect(n)}),e.on(["diagram.clear"],function(i){t.select(null)})}Ue.$inject=["eventBus"];Ue.prototype.deselect=function(e){var t=this._selectedElements,i=t.indexOf(e);if(i!==-1){var n=t.slice();t.splice(i,1),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:t})}};Ue.prototype.get=function(){return this._selectedElements};Ue.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Ue.prototype.select=function(e,t){var i=this._selectedElements,n=i.slice();j(e)||(e=e?[e]:[]),t?S(e,function(o){i.indexOf(o)===-1&&i.push(o)}):this._selectedElements=i=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:i})};var Ko="hover",Yo="selected";function gi(e,t,i,n){this._multiSelectionBox=null;function o(s,c){t.addMarker(s,c)}function r(s,c){t.removeMarker(s,c)}e.on("element.hover",function(s){o(s.element,Ko)}),e.on("element.out",function(s){r(s.element,Ko)}),e.on("selection.changed",function(s){function c(f){r(f,Yo)}function a(f){o(f,Yo)}var l=s.oldSelection,d=s.newSelection;S(l,function(f){d.indexOf(f)===-1&&c(f)}),S(d,function(f){l.indexOf(f)===-1&&a(f)})})}gi.$inject=["eventBus","canvas","selection","styles"];function _i(e,t,i,n){e.on("create.end",500,function(o){var r=o.context,s=r.canExecute,c=r.elements,a=r.hints||{},l=a.autoSelect;if(s){if(l===!1)return;j(l)?t.select(l):t.select(c)}}),e.on("connect.end",500,function(o){o.context.canExecute&&o.context.target&&t.select(o.context.target)}),e.on("shape.move.end",500,function(o){var r=o.previousSelection||[],s=n.get(o.context.shape.id),c=G(r,function(a){return s.id===a.id});c||t.select(s)}),e.on("element.click",function(o){var r=o.element;
3r===i.getRootElement()&&(r=null);var s=t.isSelected(r),c=t.get().length>1,a=Ao(o);if(s&&c)return a?t.deselect(r):t.select(r);s?t.deselect(r):t.select(r,a)})}_i.$inject=["eventBus","selection","canvas","elementRegistry"];var Tt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Go,zo],selection:["type",Ue],selectionVisuals:["type",gi],selectionBehavior:["type",_i]};var _a=/^djs-cursor-.*$/;function tn(e){var t=kt(document.body);t.removeMatching(_a),e&&t.add("djs-cursor-"+e)}function Qo(){tn(null)}var Ca=5e3;function Xo(e,t){t=t||"element.click";function i(){return!1}return e.once(t,Ca,i),function(){e.off(t,i)}}function Ci(e,t){return{x:e.x-t.x,y:e.y-t.y}}var It=Math.round,Jo="djs-drag-active";function Je(e){e.preventDefault()}function ya(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function ba(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function yi(e,t,i,n){var o={threshold:5,trapClick:!0},r;function s(P){var M=t.viewbox(),R=t._container.getBoundingClientRect();return{x:M.x+(P.x-R.left)/M.scale,y:M.y+(P.y-R.top)/M.scale}}function c(P,M){M=M||r;var R=e.createEvent(D({},M.payload,M.data,{isTouch:M.isTouch}));return e.fire("drag."+P,R)===!1?!1:e.fire(M.prefix+"."+P,R)}function a(P){var M=P.filter(function(R){return n.get(R.id)});M.length&&i.select(M)}function l(P,M){var R=r.payload,Q=r.displacement,C=r.globalStart,b=Ft(P),w=Ci(b,C),N=r.localStart,B=s(b),ge=Ci(B,N);if(!r.active&&(M||ba(w)>r.threshold)){if(D(R,{x:It(N.x+Q.x),y:It(N.y+Q.y),dx:0,dy:0},{originalEvent:P}),c("start")===!1)return L();r.active=!0,r.keepSelection||(R.previousSelection=i.get(),i.select(null)),r.cursor&&tn(r.cursor),t.addMarker(t.getRootElement(),Jo)}hi(P),r.active&&(D(R,{x:It(B.x+Q.x),y:It(B.y+Q.y),dx:It(ge.x),dy:It(ge.y)},{originalEvent:P}),c("move"))}function d(P){var M,R=!0;r.active&&(P&&(r.payload.originalEvent=P,hi(P)),R=c("end")),R===!1&&c("rejected"),M=pe(R!==!0),c("ended",M)}function f(P){P.which===27&&(Je(P),L())}function y(P){var M;r.active&&(M=Xo(e),setTimeout(M,400),Je(P)),d(P)}function _(P){l(P)}function W(P){var M=r.payload;M.hoverGfx=P.gfx,M.hover=P.element,c("hover")}function $(P){c("out");var M=r.payload;M.hoverGfx=null,M.hover=null}function L(P){var M;if(r){var R=r.active;R&&c("cancel"),M=pe(P),R&&c("canceled",M)}}function pe(P){var M,R;c("cleanup"),Qo(),r.trapClick?R=y:R=d,F.unbind(document,"mousemove",l),F.unbind(document,"dragstart",Je),F.unbind(document,"selectstart",Je),F.unbind(document,"mousedown",R,!0),F.unbind(document,"mouseup",R,!0),F.unbind(document,"keyup",f),F.unbind(document,"touchstart",_,!0),F.unbind(document,"touchcancel",L,!0),F.unbind(document,"touchmove",l,!0),F.unbind(document,"touchend",d,!0),e.off("element.hover",W),e.off("element.out",$),t.removeMarker(t.getRootElement(),Jo);var Q=r.payload.previousSelection;return P!==!1&&Q&&!i.get().length&&a(Q),M=r,r=null,M}function ue(P,M,R,Q){r&&L(!1),typeof M=="string"&&(Q=R,R=M,M=null),Q=D({},o,Q||{});var C=Q.data||{},b,w,N,B,ge;Q.trapClick?B=y:B=d,P?(b=Et(P)||P,w=Ft(P),hi(P),b.type==="dragstart"&&Je(b)):(b=null,w={x:0,y:0}),N=s(w),M||(M=N),ge=ya(b),r=D({prefix:R,data:C,payload:{},globalStart:w,displacement:Ci(M,N),localStart:N,isTouch:ge},Q),Q.manual||(ge?(F.bind(document,"touchstart",_,!0),F.bind(document,"touchcancel",L,!0),F.bind(document,"touchmove",l,!0),F.bind(document,"touchend",d,!0)):(F.bind(document,"mousemove",l),F.bind(document,"dragstart",Je),F.bind(document,"selectstart",Je),F.bind(document,"mousedown",B,!0),F.bind(document,"mouseup",B,!0)),F.bind(document,"keyup",f),e.on("element.hover",W),e.on("element.out",$)),c("init"),Q.autoActivate&&l(P,!0)}e.on("diagram.destroy",L),this.init=ue,this.move=l,this.hover=W,this.out=$,this.end=d,this.cancel=L,this.context=function(){return r},this.setOptions=function(P){D(o,P)}}yi.$inject=["eventBus","canvas","selection","elementRegistry"];var Zo=1500;function bi(e,t,i){var n=this;function o(r){if(!r.hover){var s=r.originalEvent,c=n._findTargetGfx(s),a=c&&i.get(c);c&&a&&(r.stopPropagation(),t.hover({element:a,gfx:c}),t.move(s))}}e.on("drag.start",function(r){e.once("drag.move",Zo,function(s){o(s)})}),e.on("drag.init",function(){var r,s;function c(d){r=d.hover,s=d.hoverGfx}function a(){r=null,s=null}function l(){if(r){var d=r,f=s;r=null,s=null,t.out({element:d,gfx:f})}}e.on("drag.hover",c),e.on("element.out",a),e.on("element.hover",Zo,l),e.once("drag.cleanup",function(){e.off("drag.hover",c),e.off("element.out",a),e.off("element.hover",l)})}),this._findTargetGfx=function(r){var s,c;if(r instanceof MouseEvent)return s=Ft(r),c=document.elementFromPoint(s.x,s.y),wa(c)}}bi.$inject=["eventBus","dragging","elementRegistry"];function wa(e){return Hi(e,"svg, .djs-element",!0)}var er={__init__:["hoverFix"],__depends__:[Tt],dragging:["type",yi],hoverFix:["type",bi]};function $t(e){return e.childNodes[0]}var ka=["marker-start","marker-mid","marker-end"],xa=["circle","ellipse","line","path","polygon","polyline","rect"];function Ae(e,t,i,n){this._elementRegistry=e,this._canvas=i,this._styles=n,this._clonedMarkers={};var o=this;t.on("drag.cleanup",function(){S(o._clonedMarkers,function(r){Qe(r)}),o._clonedMarkers={}})}Ae.$inject=["elementRegistry","eventBus","canvas","styles"];Ae.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};Ae.prototype.addDragger=function(e,t,i){i=i||this.getGfx(e);var n=Ji(i),o=i.getBoundingClientRect();return this._cloneMarkers($t(n)),z(n,this._styles.cls("djs-dragger",[],{x:o.top,y:o.left})),Ce(t,n),n};Ae.prototype.addFrame=function(e,t){var i=le("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ce(t,i),i};Ae.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var i=0;i<e.childNodes.length;i++)t._cloneMarkers(e.childNodes[i]);
3Ia(e)&&ka.forEach(function(n){if(z(e,n)){var o=Ea(e,n,t._canvas.getContainer());t._cloneMarker(e,o,n)}})};Ae.prototype._cloneMarker=function(e,t,i){var n=t.id,o=this._clonedMarkers[n];if(!o){o=Ji(t);var r=n+"-clone";o.id=r,Wo(o).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[n]=o;var s=qe("defs",this._canvas._svg);s||(s=le("defs"),Ce(this._canvas._svg,s)),Ce(s,o)}var c=Ta(this._clonedMarkers[n].id);z(e,i,c)};function Ea(e,t,i){var n=Sa(z(e,t));return qe("marker#"+n,i||document)}function Sa(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Ta(e){return"url(#"+e+")"}function Ia(e){return xa.indexOf(e.nodeName)!==-1}var tr={__init__:["previewSupport"],previewSupport:["type",Ae]};function Lt(e){this._commandStack=e.get("commandStack",!1)}Lt.$inject=["injector"];Lt.prototype.allowed=function(e,t){var i=!0,n=this._commandStack;return n&&(i=n.canExecute(e,t)),i===void 0?!0:i};var wi={__init__:["rules"],rules:["type",Lt]};var Pa="drop-ok",ir="drop-not-ok",nr="attach-ok",or="new-parent",rr="create",Ma=2e3;function ki(e,t,i,n,o){function r(a,l,d,f){if(!l)return!1;a=U(a,function(L){var pe=L.labelTarget;return!L.parent&&!(Oa(L)&&a.indexOf(pe)!==-1)});var y=G(a,function(L){return!Bt(L)}),_=!1,W=!1,$=!1;return sr(a)&&(_=o.allowed("shape.attach",{position:d,shape:y,target:l})),_||(sr(a)?$=o.allowed("shape.create",{position:d,shape:y,source:f,target:l}):$=o.allowed("elements.create",{elements:a,position:d,target:l})),$||_?(y&&f&&(W=o.allowed("connection.create",{source:f,target:y,hints:{targetParent:l,targetAttach:_}})),{attach:_,connect:W}):$===null||_===null?null:!1}function s(a,l){[nr,Pa,ir,or].forEach(function(d){d===l?e.addMarker(a,d):e.removeMarker(a,d)})}i.on(["create.move","create.hover"],function(a){var l=a.context,d=l.elements,f=a.hover,y=l.source;if(!f){l.canExecute=!1,l.target=null;return}ar(a);var _={x:a.x,y:a.y},W=l.canExecute=f&&r(d,f,_,y);f&&W!==null&&(l.target=f,W&&W.attach?s(f,nr):s(f,W?or:ir))}),i.on(["create.end","create.out","create.cleanup"],function(a){var l=a.hover;l&&s(l,null)}),i.on("create.end",function(a){var l=a.context,d=l.source,f=l.shape,y=l.elements,_=l.target,W=l.hints,$=l.canExecute,L=$&&$.attach,pe=$&&$.connect;if($===!1||!_)return!1;ar(a);var ue={x:a.x,y:a.y};pe?f=n.appendShape(d,f,ue,_,{attach:L,connection:pe===!0?{}:pe}):(y=n.createElements(y,ue,_,D({},W,{attach:L})),f=G(y,function(P){return!Bt(P)})),D(l,{elements:y,shape:f}),D(a,{elements:y,shape:f})});function c(){var a=t.context();a&&a.prefix===rr&&t.cancel()}i.on("create.init",function(){i.on("elements.changed",c),i.once(["create.cancel","create.end"],Ma,function(){i.off("elements.changed",c)})}),this.start=function(a,l,d){j(l)||(l=[l]);var f=G(l,function(_){return!Bt(_)});if(f){d=D({elements:l,hints:{},shape:f},d||{}),S(l,function(_){$e(_.x)||(_.x=0),$e(_.y)||(_.y=0)});var y=Xe(l);S(l,function(_){Bt(_)&&(_.waypoints=Oe(_.waypoints,function(W){return{x:W.x-y.x-y.width/2,y:W.y-y.y-y.height/2}})),D(_,{x:_.x-y.x-y.width/2,y:_.y-y.y-y.height/2})}),t.init(a,rr,{cursor:"grabbing",autoActivate:!0,data:{shape:f,elements:l,context:d}})}}}ki.$inject=["canvas","dragging","eventBus","modeling","rules"];function ar(e){var t=e.context,i=t.createConstraints;i&&(i.left&&(e.x=Math.max(e.x,i.left)),i.right&&(e.x=Math.min(e.x,i.right)),i.top&&(e.y=Math.max(e.y,i.top)),i.bottom&&(e.y=Math.min(e.y,i.bottom)))}function Bt(e){return!!e.waypoints}function sr(e){return e&&e.length===1&&!Bt(e[0])}function Oa(e){return!!e.labelTarget}function nn(e,t,i){var n=jo();n.setTranslate(t,i),Fo(e,n)}var Aa=750;function xi(e,t,i,n,o){function r(s){var c=le("g");z(c,o.cls("djs-drag-group",["no-events"]));var a=le("g");return s.forEach(function(l){var d;l.waypoints?(d=i._createContainer("connection",a),i.drawConnection($t(d),l)):(d=i._createContainer("shape",a),i.drawShape($t(d),l),nn(d,l.x,l.y)),n.addDragger(l,c,d)}),c}t.on("create.move",Aa,function(s){var c=s.hover,a=s.context,l=a.elements,d=a.dragGroup;d||(d=a.dragGroup=r(l));var f;c?(d.parentNode||(f=e.getDefaultLayer(),Ce(f,d)),nn(d,s.x,s.y)):Qe(d)}),t.on("create.cleanup",function(s){var c=s.context,a=c.dragGroup;a&&Qe(a)})}xi.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var lr={__depends__:[er,tr,wi,Tt],__init__:["create","createPreview"],create:["type",ki],createPreview:["type",xi]};function qt(e){var t=this;this._lastMoveEvent=null;function i(n){t._lastMoveEvent=n}e.on("canvas.init",function(n){var o=t._svg=n.svg;o.addEventListener("mousemove",i)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",i)})}qt.$inject=["eventBus"];qt.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||Ra(0,0)};function Ra(e,t){var i=document.createEvent("MouseEvent"),n=e,o=t,r=e,s=t;return i.initMouseEvent&&i.initMouseEvent("mousemove",!0,!0,window,0,n,o,r,s,!1,!1,
3!1,!1,0,null),i}var cr={__init__:["mouse"],mouse:["type",qt]};function ce(e,t,i,n,o,r,s,c){this._canvas=e,this._create=t,this._clipboard=i,this._elementFactory=n,this._eventBus=o,this._modeling=r,this._mouse=s,this._rules=c,o.on("copyPaste.copyElement",function(a){var l=a.descriptor,d=a.element,f=a.elements;l.priority=1,l.id=d.id;var y=G(f,function(_){return _===d.parent});y&&(l.parent=d.parent.id),Da(d)&&(l.priority=2,l.host=d.host.id),Ei(d)&&(l.priority=3,l.source=d.source.id,l.target=d.target.id,l.waypoints=Na(d)),Si(d)&&(l.priority=4,l.labelTarget=d.labelTarget.id),S(["x","y","width","height"],function(_){$e(d[_])&&(l[_]=d[_])})}),o.on("copyPaste.pasteElements",function(a){var l=a.hints;D(l,{createElementsBehavior:!1})})}ce.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"];ce.prototype.copy=function(e){var t,i;return j(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?i={}:i=this.createTree(j(t)?t:e),this._clipboard.set(i),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:i}),i};ce.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var i=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:i});var n=this._createElements(t);if(e&&e.element&&e.point)return this._paste(n,e.element,e.point,i);this._create.start(this._mouse.getLastMoveEvent(),n,{hints:i||{}})}};ce.prototype._paste=function(e,t,i,n){S(e,function(r){$e(r.x)||(r.x=0),$e(r.y)||(r.y=0)});var o=Xe(e);return S(e,function(r){Ei(r)&&(r.waypoints=Oe(r.waypoints,function(s){return{x:s.x-o.x-o.width/2,y:s.y-o.y-o.height/2}})),D(r,{x:r.x-o.x-o.width/2,y:r.y-o.y-o.height/2})}),this._modeling.createElements(e,i,t,D({},n))};ce.prototype._createElements=function(e){var t=this,i=this._eventBus,n={},o=[];return S(e,function(r,s){s=parseInt(s,10),r=Wt(r,"priority"),S(r,function(c){var a=D({},Ye(c,["priority"]));n[c.parent]?a.parent=n[c.parent]:delete a.parent,i.fire("copyPaste.pasteElement",{cache:n,descriptor:a});var l;if(Ei(a)){a.source=n[c.source],a.target=n[c.target],l=n[c.id]=t.createConnection(a),o.push(l);return}if(Si(a)){a.labelTarget=n[a.labelTarget],l=n[c.id]=t.createLabel(a),o.push(l);return}a.host&&(a.host=n[a.host]),l=n[c.id]=t.createShape(a),o.push(l)})}),o};ce.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(Ye(e,["id"]));return t};ce.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(Ye(e,["id"]));return t};ce.prototype.createShape=function(e){var t=this._elementFactory.createShape(Ye(e,["id"]));return t};ce.prototype.hasRelations=function(e,t){var i,n,o;return!(Ei(e)&&(n=G(t,Le({id:e.source.id})),o=G(t,Le({id:e.target.id})),!n||!o)||Si(e)&&(i=G(t,Le({id:e.labelTarget.id})),!i))};ce.prototype.createTree=function(e){var t=this._rules,i=this,n={},o=[],r=Uo(e);function s(l,d){return t.allowed("element.copy",{element:l,elements:d})}function c(l,d){var f=G(o,function(y){return l===y.element});if(!f){o.push({element:l,depth:d});return}f.depth<d&&(o=a(f,o),o.push({element:f.element,depth:d}))}function a(l,d){var f=d.indexOf(l);return f!==-1&&d.splice(f,1),d}return en(r,function(l,d,f){if(Si(l))return;S(l.labels,function(_){c(_,f)});function y(_){_&&_.length&&S(_,function(W){S(W.labels,function($){c($,f)}),c(W,f)})}return S([l.attachers,l.incoming,l.outgoing],y),c(l,f),l.children}),e=Oe(o,function(l){return l.element}),o=Oe(o,function(l){return l.descriptor={},i._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),o=Wt(o,function(l){return l.descriptor.priority}),e=Oe(o,function(l){return l.element}),S(o,function(l){var d=l.depth;if(!i.hasRelations(l.element,e)){ur(l.element,e);return}if(!s(l.element,e)){ur(l.element,e);return}n[d]||(n[d]=[]),n[d].push(l.descriptor)}),n};function Da(e){return!!e.host}function Ei(e){return!!e.waypoints}function Si(e){return!!e.labelTarget}function Na(e){return Oe(e.waypoints,function(t){return t=pr(t),t.original&&(t.original=pr(t.original)),t})}function pr(e){return D({},e)}function ur(e,t){var i=t.indexOf(e);return i===-1?t:t.splice(i,1)}var dr={__depends__:[_o,lr,cr,wi],__init__:["copyPaste"],copyPaste:["type",ce]};function E(e,t){var i=K(e);return i&&typeof i.$instanceOf=="function"&&i.$instanceOf(t)}function K(e){return e&&e.businessObject||e}function Ti(e,t,i){j(i)||(i=[i]),S(i,function(n){Ct(e[n])||(t[n]=e[n])})}function Va(e,t){j(t)||(t=[t]),S(t,function(i){e[i]&&delete e[i]})}var Wa=750;function Ii(e,t,i){t.on("copyPaste.copyElement",Wa,function(r){var s=r.descriptor,c=r.element,a=s.oldBusinessObject=K(c);if(s.type=c.type,Ti(a,s,"name"),s.di={},Ti(a.di,s.di,["fill","stroke"]),Ti(a.di,s,"isExpanded"),fr(s))return s;a.default&&(s.default=a.default.id)}),t.on("moddleCopy.canCopyProperty",function(r){var s=r.parent,c=r.property,a=r.propertyName,l;if(a==="processRef"&&E(s,"bpmn:Participant")&&E(c,"bpmn:Process"))return l=e.create("bpmn:Process"),i.copyElement(c,l)});var n;function o(r,s){var c=K(r);r.default&&(n[r.default]={element:c,property:"default"}),r.host&&(K(r).attachedToRef=K(s[r.host])),n=Ye(n,bt(n,function(a,l,d){var f=l.element,y=l.property;
3return d===r.id&&(f[y]=c,a.push(r.id)),a},[]))}t.on("copyPaste.pasteElements",function(){n={}}),t.on("copyPaste.pasteElement",function(r){var s=r.cache,c=r.descriptor,a=c.oldBusinessObject,l;if(fr(c)){c.businessObject=K(s[c.labelTarget]);return}l=e.create(a.$type),c.businessObject=i.copyElement(a,l),o(c,s),Ti(c,l,["isExpanded","name"]),Va(c,"oldBusinessObject")})}Ii.$inject=["bpmnFactory","eventBus","moddleCopy"];function fr(e){return!!e.labelTarget}var ja=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function Pt(e,t,i){this._bpmnFactory=t,this._eventBus=e,this._moddle=i,e.on("moddleCopy.canCopyProperties",function(n){var o=n.propertyNames;if(!(!o||!o.length))return Wt(o,function(r){return r==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(n){var o=n.parent,r=Vt(o)&&o.$descriptor,s=n.propertyName;if(s&&ja.indexOf(s)!==-1||s&&r&&!G(r.properties,Le({name:s})))return!1}),e.on("moddleCopy.canSetCopiedProperty",function(n){var o=n.property;if(Fa(o,"bpmn:ExtensionElements")&&(!o.values||!o.values.length))return!1})}Pt.$inject=["eventBus","bpmnFactory","moddle"];Pt.prototype.copyElement=function(e,t,i){var n=this;i&&!j(i)&&(i=[i]),i=i||Pi(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:i,sourceElement:e,targetElement:t});return o===!1||(j(o)&&(i=o),S(i,function(r){var s;Me(e,r)&&(s=e.get(r));var c=n.copyProperty(s,t,r),a=n._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent,property:c,propertyName:r});a!==!1&&yt(c)&&t.set(r,c)})),t};Pt.prototype.copyProperty=function(e,t,i){var n=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:i});if(o!==!1){if(o)return Vt(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var r=this._moddle.getPropertyDescriptor(t,i);if(!(r.isId||r.isReference))return j(e)?bt(e,function(s,c){return o=n.copyProperty(c,t,i),o?(o.$parent=t,s.concat(o)):s},[]):Vt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(o=n._bpmnFactory.create(e.$type),o.$parent=t,o=n.copyElement(e,o),o):e}};function Pi(e,t){return bt(e.properties,function(i,n){return t&&n.default?i:i.concat(n.name)},[])}function Fa(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}var mr={__depends__:[dr],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Ii],moddleCopy:["type",Pt]};var hr=Math.round;function Gt(e){this._modeling=e}Gt.$inject=["modeling"];Gt.prototype.replaceElement=function(e,t,i){var n=this._modeling,o=null;return e.waypoints||(t.x=hr(e.x+(t.width||e.width)/2),t.y=hr(e.y+(t.height||e.height)/2),o=n.replaceShape(e,t,i)),o};var vr={__init__:["replace"],replace:["type",Gt]};function on(e,t){return yo(t,function(i){return E(e,i)})}function he(e){return E(e,"bpmn:CallActivity")?!1:E(e,"bpmn:SubProcess")?!!K(e).di.isExpanded:E(e,"bpmn:Participant")?!!K(e).processRef:!0}function He(e){return e&&!!K(e).triggeredByEvent}function $a(e,t,i){j(i)||(i=[i]),S(i,function(n){Ct(e[n])||(t[n]=e[n])})}var La=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function Ba(e,t){var i=e&&Me(e,"collapsed")?e.collapsed:!he(e),n;return t&&(Me(t,"collapsed")||Me(t,"isExpanded"))?n=Me(t,"collapsed")?t.collapsed:!t.isExpanded:n=i,i!==n?(e.collapsed=i,!0):!1}function Oi(e,t,i,n,o,r){function s(c,a,l){l=l||{};var d=a.type,f=c.businessObject;if(Mi(f)&&d==="bpmn:SubProcess"&&Ba(c,a))return n.toggleCollapse(c),c;var y=e.create(d),_={type:d,businessObject:y},W=Pi(f.$descriptor),$=Pi(y.$descriptor,!0),L=qa(W,$);D(y,bo(a,La));var pe=U(L,function(ue){return ue==="eventDefinitions"?gr(c,a.eventDefinitionType):ue==="loopCharacteristics"?!He(y):!(y.hasOwnProperty(ue)||ue==="processRef"&&a.isExpanded===!1||ue==="triggeredByEvent")});return y=i.copyElement(f,y,pe),a.eventDefinitionType&&(gr(y,a.eventDefinitionType)||(_.eventDefinitionType=a.eventDefinitionType)),E(f,"bpmn:Activity")&&(Mi(f)?_.isExpanded=he(f):a&&Me(a,"isExpanded")&&(_.isExpanded=a.isExpanded),he(f)&&!E(f,"bpmn:Task")&&_.isExpanded&&(_.width=c.width,_.height=c.height)),Mi(f)&&!Mi(y)&&(l.moveChildren=!1),E(f,"bpmn:Participant")&&(a.isExpanded===!0?y.processRef=e.create("bpmn:Process"):l.moveChildren=!1,_.width=c.width,_.height=t._getDefaultSize(y).height),y.name=f.name,on(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&on(y,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(y.default=f.default),a.host&&!E(f,"bpmn:BoundaryEvent")&&E(y,"bpmn:BoundaryEvent")&&(_.host=a.host),_.di={},$a(f.di,_.di,["fill","stroke"]),_=o.replaceElement(c,_,l),l.select!==!1&&r.select(_),_}this.replaceElement=s}Oi.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","selection"];function Mi(e){return E(e,"bpmn:SubProcess")}function gr(e,t){var i=K(e);return t&&i.get("eventDefinitions").some(function(n){return E(n,t)})}function qa(e,t){return e.filter(function(i){return t.indexOf(i)!==-1})}var _r={__depends__:[mr,vr,Tt],bpmnReplace:["type",Oi]};var Cr="data-id";function Y(e,t,i){var n=yt(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:n},this._eventBus=t,this._canvas=i,this._providers={},this._current={}}Y.$inject=["config.popupMenu","eventBus","canvas"];Y.prototype.registerProvider=function(e,t){this._providers[e]=t};Y.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var i=this._providers[t],n=i.getEntries(e),o=i.getHeaderEntries&&i.getHeaderEntries(e),r=n.length>0,s=o&&o.length>0;return!r&&!s};Y.prototype.open=function(e,t,i){var n=this._providers[t];if(!e)throw new Error("Element is missing");if(!n)throw new Error("Provider is not registered: "+t);if(!i)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var o=this._current={provider:n,className:t,element:e,position:i};n.getHeaderEntries&&(o.headerEntries=n.getHeaderEntries(e)),o.entries=n.getEntries(e),o.container=this._createContainer();var r=o.headerEntries||[],s=o.entries||[];r.length&&o.container.appendChild(this._createEntries(o.headerEntries,"djs-popup-header")),s.length&&o.container.appendChild(this._createEntries(o.entries,"djs-popup-body"));var c=this._canvas,a=c.getContainer();this._attachContainer(o.container,a,i.cursor)};Y.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindHandlers(),Po(this._current.container),this._current.container=null)};Y.prototype.isOpen=function(){return!!this._current.container};Y.prototype.trigger=function(e){e.preventDefault();var t=e.delegateTarget||e.target,i=Gi(t,Cr),n=this._getEntry(i);if(n.action)return n.action.call(null,e,n)};Y.prototype._getEntry=function(e){var t=Le({id:e}),i=G(this._current.entries,t)||G(this._current.headerEntries,t);if(!i)throw new Error("entry not found");return i};Y.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)};Y.prototype._createContainer=function(){var e=xt('<div class="djs-popup">'),t=this._current.position,i=this._current.className;return D(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),kt(e).add(i),e};Y.prototype._attachContainer=function(e,t,i){var n=this;jt.bind(e,".entry","click",function(o){n.trigger(o)}),this._updateScale(e),t.appendChild(e),i&&this._assureIsInbounds(e,i),this._bindHandlers()};Y.prototype._updateScale=function(e){var t=this._canvas.zoom(),i=this._config.scale,n,o,r=t;i!==!0&&(i===!1?(n=1,o=1):(n=i.min,o=i.max),yt(n)&&t<n&&(r=n),yt(o)&&t>o&&(r=o)),Ga(e,"scale("+r+")")};Y.prototype._assureIsInbounds=function(e,t){var i=this._canvas,n=i._container.getBoundingClientRect(),o=e.offsetLeft,r=e.offsetTop,s=e.scrollWidth,c=e.scrollHeight,a={},l,d,f={x:t.x-n.left,y:t.y-n.top};o+s>n.width&&(a.x=!0),r+c>n.height&&(a.y=!0),a.x&&a.y?(l=f.x-s+"px",d=f.y-c+"px"):a.x?(l=f.x-s+"px",d=f.y+"px"):a.y&&f.y<c?(l=f.x+"px",d="10px"):a.y&&(l=f.x+"px",d=f.y-c+"px"),D(e.style,{left:l,top:d},{visibility:"visible","z-index":1e3})};Y.prototype._createEntries=function(e,t){var i=xt("<div>"),n=this;return kt(i).add(t),S(e,function(o){var r=n._createEntry(o,i);i.appendChild(r)}),i};Y.prototype._createEntry=function(e){if(!e.id)throw new Error("every entry must have the id property set");var t=xt("<div>"),i=kt(t);if(i.add("entry"),e.className&&e.className.split(" ").forEach(function(o){i.add(o)}),Gi(t,Cr,e.id),e.label){var n=xt("<span>");n.textContent=e.label,t.appendChild(n)}return e.imageUrl&&t.appendChild(xt('<img src="'+e.imageUrl+'" />')),e.active===!0&&i.add("active"),e.disabled===!0&&i.add("disabled"),e.title&&(t.title=e.title),t};Y.prototype._bindHandlers=function(){var e=this._eventBus,t=this;function i(){t.close()}e.once("contextPad.close",i),e.once("canvas.viewbox.changing",i),e.once("commandStack.changed",i)};Y.prototype._unbindHandlers=function(){var e=this._eventBus,t=this;function i(){t.close()}e.off("contextPad.close",i),e.off("canvas.viewbox.changed",i),e.off("commandStack.changed",i)};function Ga(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(i){e.style[i+"transform"]=t})}var yr={__init__:["popupMenu"],popupMenu:["type",Y]};function rn(e){return function(t){var i=t.target,n=K(e),o=n.eventDefinitions&&n.eventDefinitions[0],r=n.$type===i.type,s=(o&&o.$type)===i.eventDefinitionType,c=n.triggeredByEvent===i.triggeredByEvent,a=i.isExpanded===void 0||i.isExpanded===he(n);return!r||!s||!c||!a}}var br=[{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-e
3nd-event-none",target:{type:"bpmn:EndEvent"}}],wr=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}}],kr=[{label:"Desis\xE3o",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Tarefas Paralelas (Dividir/Unir)",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}}],an=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Tarefa Autom\xE1tica",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}}],xr=[],Er=[],Sr=[],Tr=[],Ir=[],Pr=[],Mr=[],Or=[];function ve(e,t,i,n,o,r){this._popupMenu=e,this._modeling=t,this._moddle=i,this._bpmnReplace=n,this._rules=o,this._translate=r,this.register()}ve.$inject=["popupMenu","modeling","moddle","bpmnReplace","rules","translate"];ve.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};ve.prototype.getEntries=function(e){let t=e.businessObject,i=this._rules,n;if(!i.allowed("shape.replace",{element:e}))return[];let o=rn(e);return E(t,"bpmn:StartEvent")&&!He(t.$parent)?(n=U(br,o),this._createEntries(e,n)):E(t,"bpmn:Participant")?(n=U(Or,function(r){return he(t)!==r.target.isExpanded}),this._createEntries(e,n)):E(t,"bpmn:StartEvent")&&He(t.$parent)?(n=U(Pr,function(r){let c=r.target.isInterrupting!==!1,a=K(e).isInterrupting===c;return o(r)||!o(r)&&!a}),this._createEntries(e,n)):E(t,"bpmn:EndEvent")?(n=U(wr,function(r){return r.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!E(t.$parent,"bpmn:Transaction")?!1:o(r)}),this._createEntries(e,n)):E(t,"bpmn:BoundaryEvent")?(n=U(Ir,function(r){let s=r.target;if(s.eventDefinition=="bpmn:CancelEventDefinition"&&!E(t.attachedToRef,"bpmn:Transaction"))return!1;
3let c=s.cancelActivity!==!1,a=t.cancelActivity==c;return o(r)||!o(r)&&!a}),this._createEntries(e,n)):E(t,"bpmn:IntermediateCatchEvent")||E(t,"bpmn:IntermediateThrowEvent")?(n=U(Tr,o),this._createEntries(e,n)):E(t,"bpmn:Gateway")?(n=U(kr,o),this._createEntries(e,n)):E(t,"bpmn:Transaction")?(n=U(Er,o),this._createEntries(e,n)):He(t)&&he(t)?(n=U(Sr,o),this._createEntries(e,n)):E(t,"bpmn:SubProcess")&&he(t)?(n=U(xr,o),this._createEntries(e,n)):E(t,"bpmn:AdHocSubProcess")&&!he(t)?(n=U(an,function(r){let s=r.target,c=s.type==="bpmn:SubProcess",a=s.isExpanded===!0;return rn(e,s)&&(!c||a)}),this._createEntries(e,n)):E(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Mr):E(t,"bpmn:FlowNode")?(n=U(an,o),E(t,"bpmn:SubProcess")&&!he(t)&&(n=U(n,function(r){return r.label!=="Sub Process (collapsed)"})),this._createEntries(e,n)):[]};ve.prototype.getHeaderEntries=function(e){let t=[];return E(e,"bpmn:Activity")&&!He(e)&&(t=t.concat(this._getLoopEntries(e))),E(e,"bpmn:SubProcess")&&!E(e,"bpmn:Transaction")&&!He(e)&&t.push(this._getAdHocEntry(e)),t};ve.prototype._createEntries=function(e,t){let i=[],n=this;return S(t,function(o){let r=n._createMenuEntry(o,e);i.push(r)}),i};ve.prototype._createSequenceFlowEntries=function(e,t){let i=K(e),n=[],o=this._modeling,r=this._moddle,s=this;return S(t,function(c){switch(c.actionName){case"replace-with-default-flow":i.sourceRef.default!==i&&(E(i.sourceRef,"bpmn:ExclusiveGateway")||E(i.sourceRef,"bpmn:InclusiveGateway")||E(i.sourceRef,"bpmn:ComplexGateway")||E(i.sourceRef,"bpmn:Activity"))&&n.push(s._createMenuEntry(c,e,function(){o.updateProperties(e.source,{default:i})}));break;case"replace-with-conditional-flow":!i.conditionExpression&&E(i.sourceRef,"bpmn:Activity")&&n.push(s._createMenuEntry(c,e,function(){let a=r.create("bpmn:FormalExpression",{body:""});o.updateProperties(e,{conditionExpression:a})}));break;default:if(E(i.sourceRef,"bpmn:Activity")&&i.conditionExpression)return n.push(s._createMenuEntry(c,e,function(){o.updateProperties(e,{conditionExpression:void 0})}));if((E(i.sourceRef,"bpmn:ExclusiveGateway")||E(i.sourceRef,"bpmn:InclusiveGateway")||E(i.sourceRef,"bpmn:ComplexGateway")||E(i.sourceRef,"bpmn:Activity"))&&i.sourceRef.default===i)return n.push(s._createMenuEntry(c,e,function(){o.updateProperties(e.source,{default:void 0})}))}}),n};ve.prototype._createMenuEntry=function(e,t,i){let n=this._translate,o=this._bpmnReplace.replaceElement;return i=i||function(){return o(t,e.target)},{label:n(e.label),className:e.className,id:e.actionName,action:i}};ve.prototype._getLoopEntries=function(e){let t=this,i=this._translate;function n(d,f){let y;f.active?y=void 0:(y=t._moddle.create(f.options.loopCharacteristics),f.options.isSequential&&(y.isSequential=f.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:y})}let o=K(e),r=o.loopCharacteristics,s,c,a;return r&&(s=r.isSequential,c=r.isSequential===void 0,a=r.isSequential!==void 0&&!r.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:i("Parallel Multi Instance"),active:a,action:n,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:i("Sequential Multi Instance"),active:s,action:n,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:i("Loop"),active:c,action:n,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]};ve.prototype._getAdHocEntry=function(e){let t=this._translate,i=K(e),n=E(i,"bpmn:AdHocSubProcess"),o=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(s,c){return n?o(e,{type:"bpmn:SubProcess"}):o(e,{type:"bpmn:AdHocSubProcess"})}}};var Ar={__depends__:[yr,_r],__init__:["customMenuProvider"],customMenuProvider:["type",ve]};var za=["viewContainerRef"],Ai=class e{constructor(t,i,n,o){this.store=t;this.service=i;this.activeModal=n;this.inputTaskFactory=o;this.selectedStep$=this.store.select(x.selectedStep);this.unsubscribe$=new ye}ngOnInit(){let t=this.store.selectSnapshot(x.selectedStep),i=n=>n.filter(o=>!o.module||o.module?.name===t.module?.name);this.conditions$=this.store.select(x.conditions).pipe(ln(i))}clearCondition(){this.selectedCondition=null,this.currentConditionStep=null,this.viewContainerRef.clear()}conditionChange(){this.viewContainerRef.clear(),this.currentConditionStep=null,this.selectedCondition&&(this._createConditionStep(),this._createViewComponent(),this._setInputValueOnChange())}_createConditionStep(){this.currentConditionStep={step:this.store.selectSnapshot(x.selectedStep),condition:this.selectedCondition.condition}}_createViewComponent(){let t={idWorkflow:this.currentConditionStep.step.workflow.id};this.dynamicComponent=this.inputTaskFactory.getInstance(this.selectedCondition.condition,this.viewContainerRef,{params:t,title:this.selectedCondition.description,required:!0})}_setInputValueOnChange(){this.dynamicComponent.valueChange.pipe(q(this.unsubscribe$)).subscribe(t=>this.currentConditionStep.value=JSON.stringify(t))}save(t=!0){this.store.dispatch(new ht(this.currentConditionStep)).subscribe(()=>{this.clearCondition(),t&&this.closeModal()})}closeModal(){this.activeModal.close()}static{this.\u0275fac=function(i){return new(i||e)(A(ae),A(Se),A(De),A(Ee))}}static{this.\u0275cmp=oe({type:e,selectors:[["ct-task-condition-config"]],viewQuery:function(i,n){if(i&1&&tt(za,7,Kt),i&2){let o;
3it(o=nt())&&(n.viewContainerRef=o.first)}},standalone:!1,decls:18,vars:9,consts:[["form","ngForm"],["viewContainerRef",""],["autocomplete","off"],[1,"modal-header"],[1,"modal-title"],[1,"condition-content"],["label","Condicionantes dispon\xEDveis","name","listConditions","bindLabel","description","placeholder","Seleciona uma condi\xE7\xE3o",3,"valueChange","onChange","value","items"],[1,"modal-footer"],["label","Salvar Novo",3,"onClick","serviceName"],["label","Salvar Voltar",3,"onClick","serviceName"],["label","Voltar",3,"onClick"]],template:function(i,n){if(i&1){let o=V();u(0,"ct-portlet")(1,"form",2,0)(3,"div",3)(4,"h4",4),I(5),ne(6,"async"),p()(),u(7,"div",5)(8,"ct-row")(9,"ct-select",6),ne(10,"async"),ie("valueChange",function(s){return v(o),te(n.selectedCondition,s)||(n.selectedCondition=s),g(s)}),k("onChange",function(){return v(o),g(n.conditionChange())}),p()(),u(11,"ct-row"),O(12,"div",null,1),p()(),u(14,"div",7)(15,"ct-submit",8),k("onClick",function(){return v(o),g(n.save(!1))}),p(),u(16,"ct-submit",9),k("onClick",function(){return v(o),g(n.save())}),p(),u(17,"ct-button",10),k("onClick",function(){return v(o),g(n.closeModal())}),p()()()()}if(i&2){let o;m(5),_e(" CONDI\xC7\xD5ES PARA EXECUTAR A TAREFA - ",(o=se(6,5,n.selectedStep$))==null?null:o.name.toUpperCase()," "),m(4),ee("value",n.selectedCondition),T("items",se(10,7,n.conditions$)),m(6),T("serviceName",n.service.names.SAVE),m(),T("serviceName",n.service.names.SAVE)}},dependencies:[ke,be,we,je,fe,xe,pt,lt,rt],styles:[".condition-content[_ngcontent-%COMP%]{padding-top:15px;padding-bottom:15px}"]})}};var Ka=["viewContainerRef"];function Ya(e,t){if(e&1){let i=V();u(0,"li")(1,"span",14),O(2,"i",15),p(),u(3,"a",16),k("click",function(){let o=v(i).$implicit,r=h(2);return g(r.selectRequiredInput(o))}),u(4,"span"),I(5),p()()()}if(e&2){let i=t.$implicit;m(5),de(i.description)}}function Qa(e,t){if(e&1&&(u(0,"div")(1,"h5"),I(2,"Entradas obrigat\xF3rias ainda n\xE3o configuradas"),p(),u(3,"ul",12),re(4,Ya,6,1,"li",13),ne(5,"async"),p()()),e&2){let i=h();m(4),T("ngForOf",se(5,1,i.requiredInputs$))}}function Xa(e,t){if(e&1){let i=V();u(0,"ct-check",20),ie("valueChange",function(o){v(i);let r=h(2);return te(r.currentInputStep.multiple,o)||(r.currentInputStep.multiple=o),g(o)}),p()}if(e&2){let i=h(2);ee("value",i.currentInputStep.multiple)}}function Ja(e,t){if(e&1){let i=V();u(0,"ct-row")(1,"ct-check",17),ie("valueChange",function(o){v(i);let r=h();return te(r.currentInputStep.required,o)||(r.currentInputStep.required=o),g(o)}),k("onChange",function(){v(i);let o=h();return g(o.inputConfigChange())}),p(),u(2,"ct-check",18),ie("valueChange",function(o){v(i);let r=h();return te(r.currentInputStep.runtimeValue,o)||(r.currentInputStep.runtimeValue=o),g(o)}),k("onChange",function(){v(i);let o=h();return g(o.inputConfigChange())}),p(),re(3,Xa,1,1,"ct-check",19),p()}if(e&2){let i=h();m(),T("disabled",!!(i.selectedInputTask!=null&&i.selectedInputTask.required)),ee("value",i.currentInputStep.required),m(),ee("value",i.currentInputStep.runtimeValue),m(),T("ngIf",!!(i.selectedInputTask!=null&&i.selectedInputTask.multiple))}}var Ri=class e{constructor(t,i,n,o){this.store=t;this.service=i;this.activeModal=n;this.inputTaskFactory=o;this.selectedStep$=this.store.select(x.selectedStep);this.requiredInputs$=this.store.select(x.requiredInputs);this.unsubscribe$=new ye}ngOnInit(){this.acceptedInputs$=this.store.select(x.acceptedInputsFiltered({isResponsable:this.inputsResponability})),this.selectedInputTask&&this.inputChange()}_clearInputTask(){this.selectedInputTask=null,this.currentInputStep=null,this.viewContainerRef.clear()}inputChange(){this.viewContainerRef.clear(),this.currentInputStep=null,this.selectedInputTask&&(this._createInputStep(this.selectedInputTask),this._createViewComponent(),this._setInputValueOnChange())}_createInputStep(t){let i=this.store.selectSnapshot(x.selectedStep);this.currentInputStep={id:t.id,step:i,input:t.input,value:t.value,required:t.required,multiple:t.multiple,runtimeValue:t.runtimeValue,displaySetting:t.displaySetting}}_setInputValueOnChange(){this.dynamicComponent.valueChange.pipe(q(this.unsubscribe$)).subscribe(t=>{let i=Ee.isMarkdownText(this.currentInputStep.input);this.currentInputStep.value=i?t:JSON.stringify(t)})}_createViewComponent(){let i={idWorkflow:this.store.selectSnapshot(x.appliedInputParsed("WORKFLOW"))?.id??this.currentInputStep.step.workflow.id};this.dynamicComponent=this.inputTaskFactory.getInstance(this.selectedInputTask.input,this.viewContainerRef,{params:i,title:this.selectedInputTask.description,required:this.selectedInputTask.required&&!this.selectedInputTask.runtimeValue,value:this.selectedInputTask.value})}inputConfigChange(){this.dynamicComponent.required=this.currentInputStep.required&&!this.currentInputStep.runtimeValue}save(t=!0){let i=this.currentInputStep.id?new ft(this.currentInputStep):new dt(this.currentInputStep);this.store.dispatch(i).subscribe(()=>{this._clearInputTask(),t&&this.closeModal()})}selectRequiredInput(t){this.selectedInputTask=t,this.inputChange()}closeModal(){this.activeModal.close()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}static{this.\u0275fac=function(i){return new(i||e)(A(ae),A(Se),A(De),A(Ee))}}static{this.\u0275cmp=oe({type:e,selectors:[["ct-task-input-config"]],viewQuery:function(i,n){if(i&1&&tt(Ka,7,Kt),i&2){let o;
3it(o=nt())&&(n.viewContainerRef=o.first)}},standalone:!1,decls:21,vars:13,consts:[["form","ngForm"],["viewContainerRef",""],["autocomplete","off"],[1,"modal-header"],[1,"modal-title"],[1,"input-content"],[4,"ngIf"],["label","Entradas dispon\xEDveis","name","listInputs","bindLabel","description","placeholder","Seleciona uma entrada",3,"valueChange","onChange","value","items"],[1,"modal-footer"],["label","Salvar Novo",3,"onClick","serviceName"],["label","Salvar Voltar",3,"onClick","serviceName"],["label","Voltar",3,"onClick"],[1,"fa-ul"],[4,"ngFor","ngForOf"],[1,"fa-li"],[1,"fa","fa-exclamation-triangle","text-warning"],[1,"kt-link",3,"click"],["name","inputRequired","label","Obrigat\xF3rio",3,"valueChange","onChange","disabled","value"],["name","inputRuntime","label","Permite alterar valor na execu\xE7\xE3o",3,"valueChange","onChange","value"],["name","inputMultiple","label","Aceita multiplos valores",3,"value","valueChange",4,"ngIf"],["name","inputMultiple","label","Aceita multiplos valores",3,"valueChange","value"]],template:function(i,n){if(i&1){let o=V();u(0,"ct-portlet")(1,"form",2,0)(3,"div",3)(4,"h4",4),I(5),ne(6,"async"),p()(),u(7,"div",5),re(8,Qa,6,3,"div",6),ne(9,"async"),u(10,"ct-row")(11,"ct-select",7),ne(12,"async"),ie("valueChange",function(s){return v(o),te(n.selectedInputTask,s)||(n.selectedInputTask=s),g(s)}),k("onChange",function(){return v(o),g(n.inputChange())}),p()(),re(13,Ja,4,4,"ct-row",6),u(14,"ct-row"),vn(15,null,1),p()(),u(17,"div",8)(18,"ct-submit",9),k("onClick",function(){return v(o),g(n.save(!1))}),p(),u(19,"ct-submit",10),k("onClick",function(){return v(o),g(n.save())}),p(),u(20,"ct-button",11),k("onClick",function(){return v(o),g(n.closeModal())}),p()()()()}if(i&2){let o,r;m(5),_e(" ENTRADAS PARA TAREFA - ",(o=se(6,7,n.selectedStep$))==null?null:o.name.toUpperCase()," "),m(3),T("ngIf",((r=se(9,9,n.requiredInputs$))==null?null:r.length)&&!n.inputsResponability),m(3),ee("value",n.selectedInputTask),T("items",se(12,11,n.acceptedInputs$)),m(2),T("ngIf",!!n.currentInputStep),m(5),T("serviceName",n.service.names.SAVE),m(),T("serviceName",n.service.names.SAVE)}},dependencies:[ot,Jt,ke,be,we,je,fe,xe,oi,pt,lt,rt],styles:[".input-content[_ngcontent-%COMP%]{padding-top:15px;padding-bottom:15px}li[_ngcontent-%COMP%]{padding:5px}span[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:small}a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#5d78ff;cursor:pointer;font-weight:400;font-size:small}"]})}};var Rr=(e,t)=>t.id;function Za(e,t){if(e&1){let i=V();u(0,"ct-row")(1,"ct-select",19),ne(2,"async"),ie("valueChange",function(o){v(i);let r=h(2);return te(r.currentElement.task,o)||(r.currentElement.task=o),g(o)}),k("onChange",function(){v(i);let o=h(2);return g(o.applyTask())}),p()()}if(e&2){let i=h(2);m(),T("disabled",i.disableEditionTask)("required",!0)("items",se(2,4,i.tasks$)),ee("value",i.currentElement.task)}}function es(e,t){if(e&1){let i=V();u(0,"ct-row")(1,"ct-input",20),ie("valueChange",function(o){v(i);let r=h(2);return te(r.currentElement.step.nameDone,o)||(r.currentElement.step.nameDone=o),g(o)}),k("onBlur",function(){v(i);let o=h(2);return g(o.updateTask(o.currentElement.step))}),p()()}if(e&2){let i=h(2);m(),T("upperCase",!1),ee("value",i.currentElement.step.nameDone)}}function ts(e,t){if(e&1){let i=V();u(0,"ct-row")(1,"ct-check",21),ie("valueChange",function(o){v(i);let r=h(2);return te(r.currentElement.step.shortcut,o)||(r.currentElement.step.shortcut=o),g(o)}),k("onChange",function(){v(i);let o=h(2);return g(o.updateTask(o.currentElement.step))}),p()()}if(e&2){let i=h(2);m(),ee("value",i.currentElement.step.shortcut)}}function is(e,t){e&1&&O(0,"i",16)}function ns(e,t){e&1&&O(0,"i",17)}function os(e,t){e&1&&O(0,"i",18)}function rs(e,t){if(e&1&&(u(0,"div",26),I(1),p()),e&2){let i=h().$implicit,n=h(3);m(),de(n.getInputText(i))}}function as(e,t){if(e&1&&(u(0,"div"),O(1,"ct-markdown",28),p()),e&2){let i=h().$implicit,n=h(3);m(),T("name",i.input)("readOnly",!0)("value",n.getInputText(i))}}function ss(e,t){if(e&1){let i=V();u(0,"i",31),k("click",function(){v(i);let o=h(2).$implicit,r=h(3);return g(r.editInputTask(o,!0))}),p()}}function ls(e,t){if(e&1){let i=V();u(0,"div",27),X(1,ss,1,0,"i",29),u(2,"i",30),k("click",function(){v(i);let o=h().$implicit,r=h(3);return g(r.inputDeleting=o)}),p()()}if(e&2){let i=h().$implicit;m(),J(i!=null&&i.value?1:-1)}}function cs(e,t){if(e&1){let i=V();u(0,"div")(1,"span"),I(2,"Deseja realmente excluir?"),p(),u(3,"div",24)(4,"span",32),k("click",function(){v(i);let o=h().$implicit,r=h(3);return g(r.removeInputTask(o))}),I(5,"Confirmar Exclus\xE3o"),p(),u(6,"span",33),k("click",function(){v(i);let o=h(4);return g(o.inputDeleting=null)}),I(7,"Cancelar"),p()()()}}function ps(e,t){if(e&1&&(u(0,"div",22)(1,"div",23)(2,"div",24)(3,"div",25),I(4),p(),X(5,is,1,0,"i",16),X(6,ns,1,0,"i",17),X(7,os,1,0,"i",18),p(),X(8,rs,2,1,"div",26)(9,as,2,3,"div"),p(),X(10,ls,3,1,"div",27)(11,cs,8,0,"div"),p()),e&2){let i=t.$implicit,n=h(3);m(4),de(i.description),m(),J(i.required?5:-1),m(),J(i.runtimeValue?6:-1),m(),J(i.multiple?7:-1),m(),J(n.InputTaskFactory.isMarkdownText(i.input)?9:8),m(2),J((n.inputDeleting==null?null:n.inputDeleting.id)!==i.id?10:11)}}function us(e,t){e&1&&(u(0,"div"),I(1,"Responsabilidade desta tarefa definida pela tarefa anterior."),p())}function ds(e,t){e&1&&Qt(0,ps,12,6,"div",22,Rr,!1,us,2,0,"div"),e&2&&Xt(t)}function fs(e,t){e&1&&O(0,"i",16)}function ms(e,t){e&1&&O(0,"i",17)}function hs(e,t){e&1&&O(0,"i",18)}function vs(e,t){if(e&1&&(u(0,"div",26),I(1),p()),e&2){let i=h().$implicit,n=h(3);m(),de(n.getInputText(i))}}function gs(e,t){if(e&1&&(u(0,"div"),O(1,"ct-markdown",28),p()),e&2){let i=h().$implicit,n=h(3);m(),T("name",i.input)("readOnly",!0)("value",n.getInputText(i))}}function _s(e,t){if(e&1){let i=V();u(0,"div",27)(1,"i",31),k("click",function(){v(i);let o=h().$implicit,r=h(3);return g(r.editInputTask(o))}),p(),u(2,"i",30),k("click",function(){v(i);let o=h().$implicit,r=h(3);return g(r.inputDeleting=o)}),p()()}}function Cs(e,t){if(e&1){let i=V();u(0,"div")(1,"span"),I(2,"Deseja realmente excluir?"),p(),u(3,"div",24)(4,"span",32),k("click",function(){v(i);let o=h().$implicit,r=h(3);return g(r.removeInputTask(o))}),I(5,"Confirmar Exclus\xE3o"),p(),u(6,"span",33),k("click",function(){v(i);let o=h(4);return g(o.inputDeleting=null)}),I(7,"Cancelar"),p()()()}}function ys(e,t){if(e&1&&(u(0,"div",22)(1,"div",23)(2,"div",24)(3,"div",25),I(4),p(),X(5,fs,1,0,"i",16),X(6,ms,1,0,"i",17),X(7,hs,1,0,"i",18),p(),X(8,vs,2,1,"div",26)(9,gs,2,3,"div"),p(),X(10,_s,3,0,"div",27)(11,Cs,8,0,"div"),p()),e&2){let i=t.$implicit,n=h(3);m(4),de(i.description),m(),J(i.required?5:-1),m(),J(i.runtimeValue?6:-1),m(),J(i.multiple?7:-1),m(),J(n.InputTaskFactory.isMarkdownText(i.input)?9:8),m(2),J((n.inputDeleting==null?null:n.inputDeleting.id)!==i.id?10:11)}}function bs(e,t){e&1&&(u(0,"div"),I(1,"Nenhuma entrada encontrada"),p())}function ws(e,t){e&1&&Qt(0,ys,12,6,"div",22,Rr,!1,bs,2,0,"div"),e&2&&Xt(t)}function ks(e,t){if(e&1){let i=V();u(0,"div",22)(1,"div",25),I(2),p(),u(3,"div",26),I(4),p(),u(5,"div")(6,"i",34),k("click",function(){let o=v(i).$implicit,r=h(3);return g(r.removeConditionTask(o))}),p()()()}if(e&2){let i=t.$implicit,n=h(3);m(2),_e("",i.description,":"),m(2),de(n.getConditionText(i))}}function xs(e,t){e&1&&(u(0,"div"),I(1,"Nenhuma condicionante encontrada"),p())}function Es(e,t){e&1&&Qt(0,ks,7,2,"div",22,hn,!1,xs,2,0,"div"),e&2&&Xt(t)}function Ss(e,t){if(e&1){let i=V();u(0,"div",1)(1,"span"),I(2),p(),u(3,"button",2),k("click",function(){v(i);let o=h();return g(o.openInfo(o.currentElement==null||o.currentElement.step==null?null:o.currentElement.step.task))}),O(4,"i",3),p()(),u(5,"div",4),k("click",function(){v(i);let o=h();return g(o.closePanel())}),O(6,"i",5),p(),X(7,Za,3,6,"ct-row"),X(8,es,2,2,"ct-row"),X(9,t
3s,2,1,"ct-row"),u(10,"div",6)(11,"div",7),O(12,"i",8),I(13," Responsabilidade "),p(),O(14,"span",9),X(15,ds,3,1),ne(16,"async"),u(17,"ct-button-new",10),k("onClick",function(){v(i);let o=h();return g(o.openModalInput(null,!0))}),p()(),u(18,"div",6)(19,"div",7),O(20,"i",11),I(21," Entradas "),p(),O(22,"span",9),X(23,ws,3,1),ne(24,"async"),u(25,"ct-button-new",12),k("onClick",function(){v(i);let o=h();return g(o.openModalInput())}),p()(),u(26,"div",6)(27,"div",7),O(28,"i",13),I(29," Condicionantes "),p(),O(30,"span",9),X(31,Es,3,1),ne(32,"async"),u(33,"ct-button-new",14),k("onClick",function(){v(i);let o=h();return g(o.openModalCondition())}),p()(),u(34,"div",15)(35,"div"),O(36,"i",16),I(37,"Obrigat\xF3rio"),p(),u(38,"div"),O(39,"i",17),I(40,"Permite Altera\xE7\xE3o"),p(),u(41,"div"),O(42,"i",18),I(43,"M\xFAltiplo"),p()()}if(e&2){let i,n,o,r=h();m(2),_e("Propriedades para ",r.currentElement==null||r.currentElement.step==null?null:r.currentElement.step.name),m(5),J(r.currentElement.isTask?7:-1),m(),J(r.currentElement.step!=null&&r.currentElement.step.id?8:-1),m(),J(r.currentElement.step!=null&&r.currentElement.step.id&&(r.currentElement.step!=null&&r.currentElement.step.outOfFlow)?9:-1),m(6),J((i=se(16,7,r.appliedInputsResponability$))?15:-1,i),m(8),J((n=se(24,9,r.appliedInputsNotResponability$))?23:-1,n),m(8),J((o=se(32,11,r.appliedConditions$))?31:-1,o)}}var Di=class e{constructor(){this.store=ze(ae);this.router=ze(Ne);this.http=ze(bn);this.modalService=ze(Zt);this.serviceStep=ze(Se);this.destroyRef=ze(zt);this.tasks$=this.store.select(x.tasks);this.selectedStep$=this.store.select(x.selectedStep);this.appliedInputsResponability$=this.store.select(x.appliedInputsFiltered({isResponsable:!0}));this.appliedInputsNotResponability$=this.store.select(x.appliedInputsFiltered({isResponsable:!1}));this.appliedConditions$=this.store.select(x.appliedConditions);this.conditions=null;this.appliedInputs=[];this.disableEditionTask=!1;this.inputDeleting=null;this.InputTaskFactory=Ee;this.workflow={};this.currentElement={};this.taskSelected=new Mt;this.close=new Mt}ngOnInit(){this.selectedStep$.pipe(Ot(this.destroyRef)).subscribe(t=>this.currentElement.step=t)}ngOnChanges(t){this.disableEditionTask=!!this.currentElement.task}applyTask(){this.taskSelected.emit(this.currentElement)}updateTask(t){t.nameDone=t.nameDone||void 0,this.serviceStep.save(t).pipe(Ot(this.destroyRef)).subscribe({next:i=>{this.currentElement.step=i,st.success("Passo do fluxo atualizado com sucesso!")},error:()=>st.error("N\xE3o foi poss\xEDvel atualizar o passo do fluxo")})}openModalInput(t=null,i=!1){let n=this.modalService.open(Ri,{size:"xl"}).componentInstance;n.selectedInputTask=t,n.inputsResponability=i}editInputTask(t,i=!1){this.openModalInput(t,i)}removeInputTask(t){this.store.dispatch(new mt({idWorkflow:this.workflow.id,uuid:this.currentElement.step.uuid,id:t.id})),this.inputDeleting=null}openModalCondition(){this.modalService.open(Ai,{size:"lg"})}closePanel(){this.close.emit()}removeConditionTask(t){this.store.dispatch(new vt({idWorkflow:this.workflow.id,uuid:this.currentElement.step.uuid,id:t.id}))}getConditionText(t){return Ee.getText(t.condition,t.value)}getInputText(t){return Ee.getText(t.input,t.value)}openInfo(t){this.serviceStep.getUrlDocs(t).subscribe({next:i=>this.abrirAjuda(i),error:()=>st.error("N\xE3o foi poss\xEDvel carregar a ajuda para esta tarefa.")})}abrirAjuda(t){let i=this.router.serializeUrl(this.router.createUrlTree(["/processo/ajuda"],{queryParams:{src:t}}));window.open(i,"_blank")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=oe({type:e,selectors:[["ct-taks-config"]],inputs:{workflow:"workflow",currentElement:"currentElement"},outputs:{taskSelected:"taskSelected",close:"close"},standalone:!1,features:[mn],decls:2,vars:1,consts:[[1,"painel-lateral","open"],[1,"painel-title"],["title","Documenta\xE7\xE3o",1,"painel-info",3,"click"],[1,"las","la-question-circle"],[1,"painel-close",3,"click"],[1,"las","la-times"],[1,"painel-config"],[1,"painel-config-title"],[1,"las","la-user-cog",2,"color","var(--success)"],[1,"horizontal-separator"],["label","Adicionar Responsabilidade","classe","kt-link",3,"onClick"],[1,"las","la-cog",2,"color","var(--primary)"],["label","Adicionar Entrada","classe","kt-link",3,"onClick"],[1,"las","la-list-alt",2,"color","var(--dark)"],["label","Adicionar Condicionante","classe","kt-link",3,"onClick"],[1,"legenda"],[1,"las","la-asterisk","icon-legenda"],[1,"las","la-edit","icon-legenda"],[1,"las","la-list-alt","icon-legenda"],["label","Tarefa","name","selectTask","bindLabel","description",3,"valueChange","onChange","disabled","required","items","value"],["label","Nome da tarefa ap\xF3s execu\xE7\xE3o","name","nameDone","placeholder","Ex: Protocolar -> Protocolado",3,"valueChange","onBlur","upperCase","value"],["label","Fixar como atalho na linha do tempo","name","fixarAtalho",3,"valueChange","onChange","value"],[1,"box-config"],[1,"container-task-description"],[2,"display","flex"],[1,"item-label"],[1,"box-config-item","item-value"],[1,"box-config-button"],[3,"name","readOnly","value"],[1,"las","la-
3pen","kt-font-info","config-button"],[1,"las","la-trash-alt","kt-font-danger","config-button",3,"click"],[1,"las","la-pen","kt-font-info","config-button",3,"click"],[1,"confirmation-button","delete-button",3,"click"],[1,"confirmation-button",3,"click"],[1,"las","la-trash-alt","kt-font-danger","box-config-button",3,"click"]],template:function(i,n){i&1&&(u(0,"div",0),X(1,Ss,44,13),p()),i&2&&(m(),J(n.currentElement.isTask||n.currentElement.isGateway?1:-1))},dependencies:[xe,ct,oi,pt,oo,ni,rt],styles:[".painel-lateral[_ngcontent-%COMP%]{position:fixed;-webkit-overflow-scrolling:touch;overflow-y:auto;-webkit-transform:translate3d(0,0,0);transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden;width:425px!important;-webkit-transition:left .3s ease,right .3s ease;transition:left .3s ease,right .3s ease;background:#fff;-webkit-box-shadow:0px 1px 9px -3px rgba(0,0,0,.75);box-shadow:0 1px 9px -3px #000000bf;inset:96px -445px 0 auto;z-index:78;padding:18px}  .ct-horizontal ct-taks-config .painel-lateral{z-index:78;top:120px}@media screen and (max-width:1024px){  .ct-horizontal ct-taks-config .painel-lateral{top:50px}}.painel-lateral.open[_ngcontent-%COMP%]{-webkit-transition:left .3s ease,right .3s ease;transition:left .3s ease,right .3s ease;right:0;left:auto}.painel-close[_ngcontent-%COMP%]{position:absolute;right:15px;top:15px;font-size:20px;cursor:pointer;display:none}.painel-info[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:24px;cursor:pointer;background:none;border:none;padding:2px;color:var(--info);line-height:1;flex-shrink:0}.painel-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font-size:15px;font-weight:500;padding-bottom:10px;gap:8px}.painel-config[_ngcontent-%COMP%]{margin-bottom:20px}.painel-config-title[_ngcontent-%COMP%]{font-size:1.2em;margin-bottom:5px;font-weight:500}.painel-config-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.5em}.item-label[_ngcontent-%COMP%]{max-width:calc(100% - 50px);font-size:12px}.item-value[_ngcontent-%COMP%]{font-size:14px;font-weight:500}.box-config[_ngcontent-%COMP%]{display:flex;margin:5px;align-items:center}.box-config-item[_ngcontent-%COMP%]{flex:1}.box-config-button[_ngcontent-%COMP%]{display:flex;align-items:center}.config-button[_ngcontent-%COMP%]{cursor:pointer;width:20px;margin-right:0;font-size:20px}  .bjs-powered-by{z-index:90!important}.legenda[_ngcontent-%COMP%]{display:flex;margin-top:5px}.legenda[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{margin-right:10px}.legenda[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .icon-legenda[_ngcontent-%COMP%], .box-config[_ngcontent-%COMP%]   .icon-legenda[_ngcontent-%COMP%]{font-size:12px;margin-left:3px;border-radius:50%;color:#fff;padding:2px}.box-config[_ngcontent-%COMP%]   .icon-legenda[_ngcontent-%COMP%]{height:15px}.legenda[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .la-asterisk[_ngcontent-%COMP%], .box-config[_ngcontent-%COMP%]   .la-asterisk[_ngcontent-%COMP%]{background-color:#f95050}.legenda[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .la-edit[_ngcontent-%COMP%], .box-config[_ngcontent-%COMP%]   .la-edit[_ngcontent-%COMP%]{background-color:#508cf9}.legenda[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .la-list-alt[_ngcontent-%COMP%], .box-config[_ngcontent-%COMP%]   .la-list-alt[_ngcontent-%COMP%]{background-color:#0abb87}.container-task-description[_ngcontent-%COMP%]{flex-grow:1}.legenda[_ngcontent-%COMP%]   .icon-legenda[_ngcontent-%COMP%]{margin-right:3px;margin-left:0}@media(max-width:576px){.painel-lateral[_ngcontent-%COMP%]{width:100%!important}.painel-close[_ngcontent-%COMP%]{display:block}}.confirmation-button[_ngcontent-%COMP%]{padding:2px 5px;border-radius:4px;font-size:12px;margin-right:7px;cursor:pointer;font-weight:500}.delete-button[_ngcontent-%COMP%]{background-color:#fd397a1a;color:#fd397a}"]})}};function Is(e,t){if(e&1){let i=V();u(0,"span",19),k("click",function(){v(i);let o=h();return g(o.saveDiagram())}),O(1,"i",20),I(2,"Salvar "),p()}}function Ps(e,t){e&1&&(u(0,"span",21),I(1,"Todas as altera\xE7\xF5es do fluxograma est\xE3o salvas."),p())}function Ms(e,t){if(e&1&&(u(0,"span"),I(1),ne(2,"date"),p()),e&2){let i=h(2);m(),_e("Salvo pela \xFAltima vez \xE0s ",_n(2,1,i.lastDiagramSaved,"HH:mm"),".")}}function Os(e,t){if(e&1&&(u(0,"span",21),I(1,"H\xE1 altera\xE7\xF5es no fluxograma que n\xE3o est\xE3o salvas. "),re(2,Ms,3,4,"span",8),p()),e&2){let i=h();m(2),T("ngIf",!!i.lastDiagramSaved)}}function As(e,t){e&1&&(u(0,"span"),O(1,"ct-loading-small",22),p())}function Rs(e,t){if(e&1&&O(0,"ct-alert",23),e&2){let i=h();T("text",i.workflow==null?null:i.workflow.inconsistencies)}}function Ds(e,t){e&1&&(u(0,"div",24),O(1,"ct-loading"),p())}var Ni=class e{constructor(t,i,n,o,r,s,c){this.store=t;this.route=i;this.alerts=n;this.router=o;this.service=r;this.serviceStep=s;this.serviceApp=c;this.unsubscribe$=new ye;this.autoUpdateTime$=cn(3e4);
3this.workflowLoad$=this.service.findById(this.route.snapshot.params.id).pipe(q(this.unsubscribe$),Re(t=>this.workflow=t));this.stepTypeName=new Map([[me.START,"In\xEDcio"],[me.END,"Fim"],[me.GATEWAY,"Decis\xE3o"],[me.GATEWAY_PARALLEL,"Tarefas em paralelo"]]);this.currentElement={};this.workflow={};this.isDiagramChanged=!1;this.savingDiagram=!1;this.loading=!0;this.readonly=!1}ngAfterViewInit(){let t=this.route.snapshot?.data?.tarefas;this.store.dispatch(new ut(t)),this.serviceApp.menuMinimize(!0),this.viewer=new Dr.default({container:"#canvas",width:"100%",height:"100%",keyboard:{bindTo:document},additionalModules:[Ar]}),this.workflowLoad$.subscribe(()=>this.openDiagram()),this.serviceApp.eventCopyText()}verifyConsistence(){this.workflowLoad$.subscribe()}workflowElementById(t){return this.viewer.get("elementRegistry").get(t)}isTask(t){return t.endsWith("Task")}isGateway(t){return t.endsWith("ExclusiveGateway")}findStepType(t){return{task:me.TASK,servicetask:me.TASK,startevent:me.START,endevent:me.END,exclusivegateway:me.GATEWAY,parallelgateway:me.GATEWAY_PARALLEL}[t.toLowerCase()]||null}extractElementType(t){let i=t.type||t.$type;return i?.substring(i.indexOf(":")+1)}applyStepProperties(t){let i=this.extractElementType(t),n=this.idTaskReplacing||co(),o=i+"_"+n,r=this.findStepType(i);this.viewer.get("modeling").updateProperties(t,{id:o,stepType:r}),this.viewer.get("canvas").addMarker(o,"shape"+i)}registerViewerEvents(t){t.on("popupMenu.open",i=>{this.idTaskReplacing=this.service.getUUID(this.currentElement.id)}),t.on("commandStack.shape.create.postExecuted",i=>{this.idTaskReplacing||(this.findStep(i.context.shape),this.applyStepProperties(i.context.shape))}),t.on("element.click",1e4,i=>{this.findStep(i.element)}),t.on("shape.added",i=>{this.viewer.get("canvas").addMarker(i.element.id,"shape"+this.extractElementType(i.element))}),t.on("shape.remove",i=>Wi(this,null,function*(){!i.element.businessObject.get("stepType")||this.idTaskReplacing||(yield this.deleteStep(i))})),t.on("element.changed",()=>{this.isDiagramChanged=!0,this.idTaskReplacing=null}),t.on("directEditing.complete",()=>{this.currentElement?.get("stepType")&&this.saveStep(this.currentElement)}),t.on("commandStack.shape.replace.postExecuted",i=>{i.context.oldShape?.businessObject?.get("stepType")&&(i.context.newShape.businessObject.step=i.context.oldShape.businessObject.step,i.context.newShape.businessObject.task=i.context.oldShape.businessObject.task,this.applyStepProperties(i.context.newShape),this.saveStep(i.context.newShape.businessObject),this.currentElement.isGateway=this.isGateway(i.context.newShape.businessObject.$type))}),t.on("commandStack.element.updateProperties.postExecuted",i=>{!i.context.properties.stepType||this.idTaskReplacing||this.saveStep(i.context.element.businessObject)})}openDiagram(){this.service.findDiagram(this.workflow).pipe(q(this.unsubscribe$)).subscribe({next:t=>{this.viewer.importXML(t,i=>{i&&console.error("Erro ao carregar diagrama:",i)}),this.loading=!1,this.registerDiagramAutoUpdate(),this.registerViewerEvents(this.viewer.get("eventBus"))},error:t=>{t?.status===404?this.alerts.warning("Diagrama n\xE3o encontrado!"):this.alerts.error("Problemas ao carregar diagrama!"),this.loading=!1}})}registerDiagramAutoUpdate(){this.autoUpdateTime$.pipe(q(this.unsubscribe$)).subscribe(()=>this.saveDiagram())}saveDiagram(){this.isDiagramChanged&&(this.savingDiagram=!0,this.viewer.saveXML((t,i)=>{this.service.saveDiagram(this.workflow.id,i).pipe(q(this.unsubscribe$)).subscribe(()=>{this.isDiagramChanged=!1,this.savingDiagram=!1,this.lastDiagramSaved=new Date})}))}voltar(t=["."],i={}){this.serviceApp.menuMinimize(!1),this.router.navigate(t,{relativeTo:this.route.parent,queryParams:i})}getHeight(){return window.innerHeight-250}taskSelected(t){let i=this.workflowElementById(t.id);this.viewer.get("modeling").updateProperties(i,{name:t.task.description,stepType:me.TASK})}clearStep(){this.store.dispatch(new Ie(null)),this.currentElement={}}findStep(t){let i=t.businessObject;if(i.isTask=this.isTask(i.$type),i.isGateway=this.isGateway(i.$type),!i.get("stepType")){this.store.dispatch(new Ie(null)),this.currentElement=i;return}this.serviceStep.findById(this.workflow.id,this.service.getUUID(i.id)).pipe(q(this.unsubscribe$),Re(n=>this.store.dispatch(new Ie(n)))).subscribe({next:n=>{i.step=n,i.task=this.store.selectSnapshot(x.selectedTask),this.currentElement=i},error:()=>this.alerts.error("Erro ao carregar tarefa")})}
3saveStep(t){let i={name:t.get("stepType")},n=this.getStepName(t.name,i.name),o=this.createStep(t,i,n);(o.id?this.serviceStep.update(o):this.serviceStep.save(o)).pipe(q(this.unsubscribe$)).subscribe({next:s=>this.store.dispatch(new Ie(s)),error:s=>this.alerts.error(`Erro ao salvar tarefa: ${s?.message??"Sem Mensagem"}`)})}deleteStep(t){return Wi(this,null,function*(){let i=this.service.getUUID(t.element.id);yield this.serviceStep.delete(this.workflow.id,i).pipe(q(this.unsubscribe$),un(()=>this.currentElement={})).toPromise()})}getStepName(t,i){return t||this.stepTypeName.get(i)}createStep(t,i,n){return{id:t.step?.id,workflow:this.workflow,name:n||i.name,nameDone:t.step?.nameDone,task:t.task?.name,uuidHash:this.service.getUUID(t.id),stepType:i,shortcut:t.step?.shortcut,module:t.task?.module??this.store.selectSnapshot(We.modulo),autoExecutable:this.isTaskAutoExecutable(t)}}isTaskAutoExecutable(t){return this.extractElementType(t)==="ServiceTask"}exportDiagram(){this.viewer.saveSVG((t,i)=>{if(t){console.error("Erro ao exportar SVG",t);return}let n=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),o=window.URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download="diagrama-bpmn.svg",r.click(),window.URL.revokeObjectURL(o)})}ngOnDestroy(){this.serviceApp.menuMinimize(!1),this.viewer.destroy(),this.unsubscribe$.next(),this.unsubscribe$.complete()}static{this.\u0275fac=function(i){return new(i||e)(A(ae),A(at),A(ii),A(Ne),A(Fe),A(Se),A(so))}}static{this.\u0275cmp=oe({type:e,selectors:[["ng-component"]],standalone:!1,decls:27,vars:10,consts:[["form","ngForm"],[1,"header-container"],[1,"left-header-container"],[1,"kt-link","btn-voltar",3,"click"],[1,"las","la-angle-left"],[1,"save-container"],["class","btn btn-success btn-salvar",3,"click",4,"ngIf"],["class","label-salvar",4,"ngIf"],[4,"ngIf"],[1,"kt-link",3,"click"],[1,"las","la-sync"],[1,"kt-link","ml-2",3,"click"],[1,"las","la-image"],["type","danger",3,"text",4,"ngIf"],["autocomplete","off",2,"position","relative"],[1,"modeler"],["id","canvas"],["class","loading-workflow-container",4,"ngIf"],[3,"close","taskSelected","hidden","workflow","currentElement"],[1,"btn","btn-success","btn-salvar",3,"click"],[1,"las","la-check"],[1,"label-salvar"],["label","Salvando"],["type","danger",3,"text"],[1,"loading-workflow-container"]],template:function(i,n){if(i&1){let o=V();u(0,"ct-portlet")(1,"div",1)(2,"div",2)(3,"span",3),k("click",function(){return v(o),g(n.voltar())}),O(4,"i",4),I(5,"Voltar "),p(),u(6,"div",5),re(7,Is,3,0,"span",6)(8,Ps,2,0,"span",7)(9,Os,3,1,"span",7)(10,As,2,0,"span",8),p()(),u(11,"h4"),I(12),p(),u(13,"div")(14,"span",9),k("click",function(){return v(o),g(n.verifyConsistence())}),O(15,"i",10),I(16," Verificar consist\xEAncia "),p(),u(17,"span",11),k("click",function(){return v(o),g(n.exportDiagram())}),O(18,"i",12),I(19," Exportar imagem "),p()()(),re(20,Rs,1,1,"ct-alert",13),u(21,"form",14,0)(23,"div",15),O(24,"div",16),p(),re(25,Ds,2,0,"div",17),u(26,"ct-taks-config",18),k("close",function(){return v(o),g(n.clearStep())})("taskSelected",function(s){return v(o),g(n.taskSelected(s))}),p()()()}i&2&&(m(7),T("ngIf",!!n.isDiagramChanged&&!n.savingDiagram),m(),T("ngIf",!n.isDiagramChanged&&!!n.lastDiagramSaved),m(),T("ngIf",!!n.isDiagramChanged&&!n.savingDiagram),m(),T("ngIf",!!n.savingDiagram),m(2),de(n.workflow.description),m(8),T("ngIf",!!(n.workflow!=null&&n.workflow.inconsistencies)),m(5),T("ngIf",!!n.loading),m(),T("hidden",!(n.currentElement!=null&&n.currentElement.isTask)&&
3!(n.currentElement!=null&&n.currentElement.isGateway))("workflow",n.workflow)("currentElement",n.currentElement))},dependencies:[Jt,ke,be,we,fe,Mn,Nn,An,Di,Cn],styles:["[_nghost-%COMP%]     .shapeTask .djs-visual rect, [_nghost-%COMP%]     .shapeServiceTask .djs-visual rect{stroke:#6993ff!important;stroke-width:1px!important;fill:#e1e9ff!important;fill-opacity:1!important}[_nghost-%COMP%]     .shapeTask .djs-visual text, [_nghost-%COMP%]     .shapeServiceTask .djs-visual text{fill:#464646!important}[_nghost-%COMP%]     .shapeStartEvent .djs-visual circle{stroke:#1bc5bd!important;stroke-width:1px!important;fill:#c9f7f5!important;fill-opacity:1!important}[_nghost-%COMP%]     .shapeEndEvent .djs-visual circle{stroke:#cc5151!important;stroke-width:3px!important;fill:#f7c9c9!important;fill-opacity:1!important}[_nghost-%COMP%]     .shapeExclusiveGateway .djs-visual polygon, [_nghost-%COMP%]     .shapeParallelGateway .djs-visual polygon{stroke:#ff7600!important;stroke-width:1px!important;fill:#ffe5db!important;fill-opacity:1!important}[_nghost-%COMP%]     .djs-connection .djs-visual path{stroke-width:1px!important}[_nghost-%COMP%]     .entry.bpmn-icon-task, [_nghost-%COMP%]     .entry.bpmn-icon-service-task{color:#6993ff}[_nghost-%COMP%]     .entry.bpmn-icon-task span, [_nghost-%COMP%]     .entry.bpmn-icon-service span, [_nghost-%COMP%]     .entry.bpmn-icon-end-event-none span, [_nghost-%COMP%]     .entry.bpmn-icon-start-event-none span{color:#464646}[_nghost-%COMP%]     .entry.bpmn-icon-gateway-none{color:#ff7600}[_nghost-%COMP%]     .entry.bpmn-icon-start-event-none{color:#1bc5bd}[_nghost-%COMP%]     .entry.bpmn-icon-end-event-none{color:#cc5151}[_nghost-%COMP%]     .djs-direct-editing-parent{border-radius:10px;border:0}[_nghost-%COMP%]     .entry.bpmn-icon-space-tool, [_nghost-%COMP%]     .entry.bpmn-icon-intermediate-event-none, [_nghost-%COMP%]     .entry.bpmn-icon-subprocess-expanded, [_nghost-%COMP%]     .entry.bpmn-icon-data-object, [_nghost-%COMP%]     .entry.bpmn-icon-data-store, [_nghost-%COMP%]     .entry.bpmn-icon-participant, [_nghost-%COMP%]     .entry.bpmn-icon-group, [_nghost-%COMP%]     .shapeExclusiveGateway .djs-visual path, [_nghost-%COMP%]     .bpmn-replace .djs-popup-header{display:none}[_nghost-%COMP%]     .shapeParallelGateway .djs-visual path{fill:#ff7600!important;stroke-width:0!important}[_nghost-%COMP%]     .currentTask .djs-visual rect{stroke:#1bc5bd!important;stroke-width:1px!important;fill:#c9f7f5!important;fill-opacity:1!important}[_nghost-%COMP%]     .currentTask .djs-visual text{filter:invert(0%) sepia(0%) saturate(0%) hue-rotate(126deg) brightness(93%) contrast(104%)}form[_ngcontent-%COMP%]{border:1px solid #e8e8e8;box-shadow:0 0 13px #afafaf54}.header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;font-size:12px;padding:2px 4px}.left-header-container[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.btn-voltar[_ngcontent-%COMP%]{font-size:15px}.save-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.btn-salvar[_ngcontent-%COMP%]{padding:2px 7px;font-size:15px;cursor:pointer}.loading-workflow-container[_ngcontent-%COMP%]{position:absolute;margin:auto;top:100px;text-align:center;width:100%}[_nghost-%COMP%]     .kt-portlet, [_nghost-%COMP%]     .kt-portlet__body{margin-bottom:0;padding:5px}[_nghost-%COMP%]     .bjs-powered-by{display:none}.modeler[_ngcontent-%COMP%], #canvas[_ngcontent-%COMP%]{height:72vh}"]})}};var Ns=[{path:"",component:di,data:{breadcrumb:"Consulta"}},{path:"cadastro",component:Rt,data:{breadcrumb:"Cadastro"}},{path:"cadastro/:id",component:Rt,data:{breadcrumb:"Edi\xE7\xE3o"}},{path:"elaborar/:id",component:Ni,data:{breadcrumb:"Elabora\xE7\xE3o"}}],Vi=class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Yt({type:e})}static{this.\u0275inj=Ht({imports:[ji.forChild(Ns),ji]})}};var Nr=class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Yt({type:e})}static{this.\u0275inj=Ht({providers:[De],imports:[Sn.forFeature([x]),Vi,kn,xn,yn,wn,uo,Wn,Dn,fo,no,Fn,io,zn,Kn,ao,ro,Gn,$n,qn,Un,Zn,Hn,On,Vn,Rn,Xn]})}};export{Nr as ProcessoWorkflowModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.