1"use strict";(self.webpackChunkprivacypillar_sfo3=self.webpackChunkprivacypillar_sfo3||[]).push([["default-src_app_privacy_dsar_createworkflow_createworkflow_module_ts"],{67906:(It,_,d)=>{d.r(_),d.d(_,{CreateworkflowModule:()=>yt});var g=d(36895),h=d(51692),t=d(94650),p=d(3940),O=d(68078),b=d(92340),T=d(67075),y=d(37407),P=d(64491),k=d(20388),I=d(11481),f=d(24006),Z=d(1637),D=d(62976),A=d(22096),C=d(32320),E=d(4358),q=d(12553),x=d(2854);const N=["panel"],W=["inputDataIdentifier"],J=["confirmDeleteStageAlert"];function U(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"div",16),t.NdJ("click",function(){t.CHM(s);const o=t.oxw().index,n=t.oxw();return t.KtG(n.deleteNewStage(o))}),t._UZ(1,"i",17),t.qZA()}}function Q(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"button",18),t.NdJ("click",function(){t.CHM(s);const o=t.oxw(),n=o.index,a=o.$implicit,l=t.oxw(),c=t.MAs(11);return t.KtG(l.openModal(c,n,a))}),t._UZ(1,"i",19),t.qZA()}if(2&i){const s=t.oxw(2);t.Q6J("disabled","active"===s.flowStatus)}}function Y(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"button",20),t.NdJ("click",function(){t.CHM(s);const o=t.oxw(),n=o.index,a=o.$implicit,l=t.oxw();return t.KtG(l.addCustomStages(n,a.order))}),t.TgZ(1,"span"),t._UZ(2,"i",21),t.qZA()()}if(2&i){const s=t.oxw(2);t.Q6J("disabled","active"===s.flowStatus)}}function L(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"li")(1,"div",10)(2,"div",11),t.YNc(3,U,2,0,"div",12),t.YNc(4,Q,2,1,"button",13),t.TgZ(5,"div",14),t.NdJ("click",function(){const n=t.CHM(s).$implicit,a=t.oxw();return t.KtG(a.selectCurrentStage(n))}),t._uU(6),t.qZA()(),t.YNc(7,Y,3,1,"button",15),t.qZA()()}if(2&i){const s=r.$implicit,e=r.index,o=t.oxw();t.xp6(2),t.ekj("selectedTab",o.currentTab==s.order),t.xp6(1),t.Q6J("ngIf",o.currentSelectedStage(s.id)&&o.isnewlyAddedStage),t.xp6(1),t.Q6J("ngIf",o.customStages(s)),t.xp6(2),t.hij(" ",s.stage_title," "),t.xp6(1),t.Q6J("ngIf",e!==s.order&&e<o.inputData.length-1&&"UNVERIFIED"!==s.stage_title)}}function F(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"div",22)(1,"p"),t._uU(2,"Do you want to delete selected stage?"),t.qZA(),t.TgZ(3,"button",23),t.NdJ("click",function(){t.CHM(s);const o=t.oxw();return t.KtG(o.confirm())}),t._uU(4,"Yes"),t.qZA(),t.TgZ(5,"button",24),t.NdJ("click",function(){t.CHM(s);const o=t.oxw();return t.KtG(o.decline())}),t._uU(6,"No"),t.qZA()()}}const v=function(i){return{hidebtns:i}},R=function(i){return{transform:i}};let B=(()=>{const r=class{constructor(e,o){this.cdRef=e,this.bsmodalService=o,this.inputData=[],this.currentStageEvent=ne
1w t.vpe,this.deleteCustomStage=new t.vpe,this.newitemAdded=[],this.translateX=0,this.leftbtnVisibility=!1,this.rightbtnVisibility=!0,this.isnewlyAddedStage=!1}ngOnInit(){if(this.currentTab)return this.currentTab;this.currentTab=this.inputData[0].order}addCustomStages(e,o){if(this.inputData.filter(u=>u.order===o+1).length>0){let u=this.inputData.findIndex(m=>m.order===o+1);this.inputData[u].order=u+2}const a={guidance_text:"Add your guidance text ",order:o+1,stage_title:this.stageTitle||"New stage",ws_stage_status:"custom",active:!0};let l=e+1;if(this.newitemAdded.push(a),this.isnewlyAddedStage=!this.isnewlyAddedStage,this.inputData.splice(l,0,a),this.currentStageEvent.emit(a),this.updateOrders(this.inputData),this.currentTab=this.inputData[a.order-1].order,this.newitemAdded.length>=12)return console.log("You have reach limit of 12 stages!"),!1}selectCurrentStage(e){this.currentTab=e.order,this.currentStageEvent.emit(e)}deleteNewStage(e){this.inputData.splice(e,1),this.updateOrders(this.inputData)}deleteSelectedStage(e,o){this.inputData.splice(e,1),this.updateOrders(this.inputData),this.deleteCustomStage.emit(o)}onPreviousSearchPosition(){this.translateX+=150}onNextSearchPosition(){this.translateX-=150}generateUUID(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{let a=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?a:3&a|8).toString(16)})}isOrderIDExist(e){return this.inputData.some(o=>o.order===e)}updateOrders(e){for(let o=0;o<e.length;o++)e[o].order!==o+1&&(e[o].order=o+1)}currentSelectedStage(e){return this.newitemAdded.some(o=>""===o.id)}customStages(e){return"custom"==e.ws_stage_status}leftClickStatus(){if(this.translateX>=0)return!0}rightClickStatus(){if(this.translateX<=this.scrollLimit)return!0}ngAfterContentChecked(){this.cdRef.detectChanges();const e=this.inputDataIdentifier.nativeElement.parentElement.offsetWidth,o=this.inputDataIdentifier.nativeElement.querySelector("li + li").offsetWidth;this.scrollLimit=-(o*this.inputDataIdentifier.nativeElement.childElementCount-e)}openModal(e,o,n){this.selectedDelIndex=o,this.selectedDelObject=n,this.modalRef=this.bsmodalService.show(e,{class:"",keyboard:!1,backdrop:!0,ignoreBackdropClick:!0})}confirm(){this.deleteSelectedStage(this.selectedDelIndex,this.selectedDelObject),this.modalRef.hide()}decline(){this.modalRef.hide()}};let i=r;return r.\u0275fac=function(o){return new(o||r)(t.Y36(t.sBO),t.Y36(k.tT))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-customtabs"]],viewQuery:function(o,n){if(1&o&&(t.Gf(N,7),t.Gf(W,7),t.Gf(J,5)),2&o){let a;t.iGM(a=t.CRH())&&(n.panel=a.first),t.iGM(a=t.CRH())&&(n.inputDataIdentifier=a.first),t.iGM(a=t.CRH())&&(n.confirmDeleteStageAlert=a.first)}},inputs:{inputData:"inputData",editStatus:"editStatus",currentTab:"currentTab",flowStatus:"flowStatus"},outputs:{currentStageEvent:"currentStageEvent",deleteCustomStage:"deleteCustomStage"},decls:12,vars:10,consts:[["appTheme","",1,"divflex"],[1,"arrowbtn",3,"ngClass","click"],[1,"fa","fa-angle-left"],[1,"customtab"],["panel",""],[3,"ngStyle"],["inputDataIdentifier",""],[4,"ngFor","ngForOf"],[1,"fa","fa-angle-right"],["confirmDeleteStageAlert",""],[1,"displayflex"],[1,"tabTitleWrapper"],["class","deleteicon",3,"click",4,"ngIf"],["class","deleteicon",3,"disabled","click",4,"ngIf"],[1,"stageTitle",3,"click"],["class","btn btn-xs btn-primary small-btn","title","Add a new stage",3,"disabled","click",4,"ngIf"],[1,"deleteicon",3,"click"],["aria-hidden","true",1,"fa","fa-trash"],[1,"deleteicon",3,"disabled","click"],["aria-hidden","true","tooltip","Delete this stage","placement","left",1,"fa","fa-trash"],["title","Add a new stage",1,"btn","btn-xs","btn-primary","small-btn",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-plus"],["appTheme","",1,"modal-body","text-center"],["type","button",1,"btn","btn-sm","btn-uppercase","btn-primary","mr-2",3,"click"],["type","button",1,"btn","btn-sm","btn-outline-secondary","btn-uppercase","mr-2",3,"click"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"button",1),t.NdJ("click",function(){return n.onPreviousSearchPosition()}),t._UZ(2,"i",2),t.qZA(),t.TgZ(3,"div",3,4)(5,"ul",5,6),t.YNc(7,L,8,6,"li",7),t.qZA()(),t.TgZ(8,"button",1),t.NdJ("click",function(){return n.onNextSearchPosition()}
1),t._UZ(9,"i",8),t.qZA()(),t.YNc(10,F,7,0,"ng-template",null,9,t.W1O)),2&o&&(t.xp6(1),t.Q6J("ngClass",t.VKq(4,v,n.leftClickStatus())),t.xp6(4),t.Q6J("ngStyle",t.VKq(6,R,"translateX("+n.translateX+"px)")),t.xp6(2),t.Q6J("ngForOf",n.inputData),t.xp6(1),t.Q6J("ngClass",t.VKq(8,v,n.rightClickStatus())))},dependencies:[g.mk,g.sg,g.O5,g.PC,C.i9,x.E],styles:['.customtab[_ngcontent-%COMP%]{flex-grow:1;height:38px;overflow-x:hidden;overflow-y:hidden;white-space:nowrap;width:1000px;margin:0 auto}.customtab[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding:0;transition:all .3s ease-in-out;display:inline-flex;align-items:stretch}.customtab[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline;margin:0 3px}.customtab[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){margin-left:15px!important}.customtab[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{margin-left:0!important}.displayflex[_ngcontent-%COMP%]{display:inline-flex}.divflex[_ngcontent-%COMP%]{display:flex;margin:20px 10px}.arrowbtn[_ngcontent-%COMP%]{height:35px;width:35px;background:none;font-size:24px;border:0;outline:none;margin:2px 0 0}.small-btn[_ngcontent-%COMP%]{border-radius:30px;height:26px;padding:4px 0;margin:4px 0 0 20px;width:26px}.tabTitleWrapper[_ngcontent-%COMP%]{font-size:14px;text-align:center;color:#666;display:flex;cursor:default;margin:0 3px;padding:0;min-width:180px;float:left;height:36px;position:relative;background-color:#d9e3f7;-webkit-user-select:none;user-select:none;transition:background-color .2s ease}.tabTitleWrapper[_ngcontent-%COMP%]:after{border-left:17px solid #23468c}.tabTitleWrapper[_ngcontent-%COMP%]:after, .tabTitleWrapper[_ngcontent-%COMP%]:before{content:" ";position:absolute;top:0;right:-17px;width:0;height:0;border-top:19px solid transparent;border-bottom:17px solid transparent;border-left:17px solid #d9e3f7;z-index:2;transition:border-color .2s ease}.deleteicon[_ngcontent-%COMP%]{margin:0;padding:9px 10px 7px;cursor:pointer;outline:none;background:transparent;border:0}.stageTitle[_ngcontent-%COMP%]{padding:9px;text-align:center;width:100%}.selectedTab[_ngcontent-%COMP%]{background-color:#3c65b7;color:#fff}.tabTitleWrapper.selectedTab[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff}.selectedTab[_ngcontent-%COMP%]:after{border-left:17px solid #3c65b7}.disabled[_ngcontent-%COMP%]{cursor:not-allowed}.btn-primary.disabled[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:disabled{cursor:default}.hidebtns[_ngcontent-%COMP%]{visibility:hidden}'],changeDetection:0}),i})();const G=["quillEditorText"],z=["confirmDeleteStageAlert"];function K(i,r){1&i&&t._UZ(0,"i",45)}const S=function(i,r){return{"hideEditSave-btn":i,"":r}};function j(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"div",39)(1,"button",40),t.NdJ("click",function(o){t.CHM(s);const n=t.oxw();return t.KtG(n.editWorkflow(o,n.workflowStatus))}),t.TgZ(2,"span",41),t.YNc(3,K,1,0,"i",42),t._uU(4),t.qZA()(),t.TgZ(5,"button",43),t.NdJ("click",function(){t.CHM(s);const o=t.oxw(),n=t.MAs(29);return t.KtG(o.saveWorkflow(n,o.workflowStatus))}),t.TgZ(6,"span",41),t._UZ(7,"i",44),t._uU(8," Save"),t.qZA()()()}if(2&i){const s=t.oxw();t.xp6(1),t.Q6J("ngClass",t.WLB(6,S,"default"==s.workflowType,"default"!==s.workflowType)),t.uIk("disabled",!(!s.isActivateBtnClicked&&("draft"!==s.workflowStatus||s.isworkflowSaved))||null),t.xp6(2),t.Q6J("ngIf","active"==s.workflowStatus),t.xp6(1),t.hij(" ","active"==s.workflowStatus?"Edit":"Activate",""),t.xp6(1),t.Q6J("ngClass",t.WLB(9,S,"default"==s.workflowType,"default"!==s.workflowType)),t.uIk("disabled","active"==s.workflowStatus||null)}}function H(i,r){1&i&&t._UZ(0,"ngx-skeleton-loader",49)}function V(i,r){1&i&&(t.TgZ(0,"span",50),t._uU(1,"No data found"),t.qZA())}function X(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"app-customtabs",51),t.NdJ("currentStageEvent",function(o){t.CHM(s);const n=t.oxw(2);return t.KtG(n.clickOnWorkflowStages(o))})("deleteCustomStage",function(o){t.CHM(s);const n=t.oxw(2);return t.KtG(n.deleteCustomStages(o))}),t.qZA()}if(2&i){const s=t.oxw(2);t.Q6J("flowStatus",s.workflowStatus)("inputData",s.workflowStages)("currentTab",s.order)}}function $(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"div",46),t.YNc(2,H,1,0,"ngx-skeleton-loader",47),t.YNc(3,V,2,0,"span",17),t.qZA(),t.YNc(4,X,1,3,"app-customtabs",48),t.BQk()),2&i){const s=t.oxw();
1t.xp6(2),t.Q6J("ngIf",s.skeletonLoading&&0!==(null==s.workflowStages?null:s.workflowStages.length)),t.xp6(1),t.Q6J("ngIf",!s.skeletonLoading&&0===(null==s.workflowStages?null:s.workflowStages.length)),t.xp6(1),t.Q6J("ngIf",!s.skeletonLoading)}}function tt(i,r){1&i&&(t.TgZ(0,"span",50),t._uU(1,"No data found"),t.qZA())}function et(i,r){1&i&&(t.TgZ(0,"div"),t._uU(1,"Workflow is required"),t.qZA())}function nt(i,r){if(1&i&&(t.TgZ(0,"div",52),t.YNc(1,et,2,0,"div",16),t.qZA()),2&i){const s=t.oxw(),e=t.MAs(37);t.xp6(1),t.Q6J("ngIf",(null==e?null:e.invalid)&&s.submitted)}}function ot(i,r){1&i&&t._UZ(0,"i-feather",55)}function it(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"button",53),t.NdJ("click",function(){t.CHM(s);const o=t.oxw();return t.KtG(o.updateWorkflowname())}),t.YNc(1,ot,1,0,"i-feather",54),t._uU(2," Save"),t.qZA()}if(2&i){const s=t.oxw();t.xp6(1),t.Q6J("ngIf",s.isWorkflownameEdit)}}function st(i,r){1&i&&t._UZ(0,"i-feather",58)}function rt(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"button",56),t.NdJ("click",function(){t.CHM(s);const o=t.oxw();return t.KtG(o.isWorkflownameEdit=!o.isWorkflownameEdit)}),t.YNc(1,st,1,0,"i-feather",57),t._uU(2),t.qZA()}if(2&i){const s=t.oxw();t.xp6(1),t.Q6J("ngIf",!s.isWorkflownameEdit),t.xp6(1),t.hij(" ",s.isWorkflownameEdit?"Cancel":"Edit"," ")}}function at(i,r){1&i&&t._UZ(0,"i-feather",59)}function lt(i,r){1&i&&(t.TgZ(0,"div"),t._uU(1,"Stage is required"),t.qZA())}function dt(i,r){if(1&i&&(t.TgZ(0,"div",52),t.YNc(1,lt,2,0,"div",16),t.qZA()),2&i){const s=t.oxw(),e=t.MAs(48);t.xp6(1),t.Q6J("ngIf",(null==e?null:e.invalid)&&s.submitted)}}function ct(i,r){1&i&&t._UZ(0,"i-feather",60)}function ut(i,r){1&i&&(t.TgZ(0,"div"),t._uU(1,"Guidance text is required"),t.qZA())}function ft(i,r){if(1&i&&(t.TgZ(0,"div",61),t.YNc(1,ut,2,0,"div",16),t.qZA()),2&i){t.oxw();const s=t.MAs(57);t.xp6(1),t.Q6J("ngIf",null==s?null:s.invalid)}}function gt(i,r){if(1&i){const s=t.EpF();t.TgZ(0,"alert",62),t.NdJ("onClosed",function(){t.CHM(s);const o=t.oxw();return t.KtG(o.onClosed(o.alertMsg))}),t._uU(1),t.qZA()}if(2&i){const s=t.oxw();t.Q6J("type",s.alertType)("dismissible",s.dismissible),t.xp6(1),t.Oqu(s.alertMsg)}}const pt=function(i,r){return{oid:i,pid:r}},w=function(i){return{"is-invalid":i}},ht=function(i,r){return{hide:i,showerror:r}},wt=function(i){return{"quilleditor-invalid":i}},mt=function(i){return{hide:i}};let _t=(()=>{const r=class{constructor(e,o,n,a,l,c,u,m,Pt){this.activatedRoute=e,this.router=o,this.workflowService=n,this.loadingBar=a,this.orgservice=l,this.bsmodalService=c,this.cd=u,this.titleService=m,this.location=Pt,this.dismissible=!0,this.isOpen=!1,this.workflowStages=[],this.guidancetext="",this.submitted=!0,this.isControlDisabled=!1,this.isWorkflownameEdit=!1,this.quillConfig={toolbar:{container:[["bold","italic","underline","strike"],[{header:1},{header:2}],["clean"],["link"],[{align:[]}],[{size:["small",!1,"large","huge"]}]]}},this.isworkflowSaved=!1,this.skeletonLoading=!0,this.isActivateBtnClicked=!1,this.activatedRoute.queryParamMap.subscribe(M=>{this.queryOID=M.get("oid"),this.queryPID=M.get("pid")}),this.titleService.setTitle("DSAR Create Workflow - "+b.N.portalPrefix),this.router.routeReuseStrategy.shouldReuseRoute=()=>!1}ngOnInit(){this.onGetOrgId(),this.isWorkflowEditing=!1,this.loadWorkflowList(),this.activatedRoute.paramMap.subscribe(e=>{this.selectedWorkflowId=e.get("id")}),this.workflowService.selectedWorkflow.subscribe(e=>{this.workflowName=e.workflow_name},e=>{this.isOpen=!0,this.alertMsg=e,this.alertType="danger"}),this.loadWorkflowById(this.selectedWorkflowId),this.defaultStages=["UNVERIFIED","NEW","VERIFY REQUEST","VERIFY CONSUMER REQUEST","LEGAL/PRIVACY REVIEW","REQUEST FULFILL","CONSUMER NOTIFICATION","IN PROGRESS","COMPLETE","NOTIFY"]}previousTab(){"tab3"==this.viewMode?this.viewMode="tab2":"tab2"==this.viewMode&&(this.viewMode="tab1")}onGetOrgId(){null!=this.queryOID?this.currentManagedOrgID=this.queryOID:this.getOIDPIDFromURL()}loadWorkflowList(){this.loadingBar.start(),this.workflowService.getWorkflow(this.constructor.name,p.e.workFlowModule,this.currentManagedOrgID).subscribe(e=>{this.workflowList=e.response,this.loadingBar.stop()})}onWorkflowChange(e){this.loadWorkflowById(e.target.value)}
1clickOnWorkflowStages(e){""==e.id&&(this.isDirty=!0),this.selectedTab=e,this.selectedStageId=e.id,this.isTabSelected=!0,this.stageTitle=e.stage_title,this.guidancetext=e.guidance_text,this.order=e.order,this.isDefaultStage="default"==e.ws_stage_status||!1,this.isworkflowSaved="default"!==e.ws_stage_status,this.isDefaultWorkflowStage()}update(e){if(void 0!==this.selectedTab){const o=this.workflowStages.findIndex(n=>n.order===this.selectedTab.order);this.workflowStages[o].stage_title=e.currentTarget.value,this.isworkflowSaved="custom"!=this.workflowStages[o].ws_stage_status,this.stageTitle=e.currentTarget.value,this.isDirty=!0}else this.workflowStages[0].stage_title=e.currentTarget.value,this.stageTitle=e.currentTarget.value}updateGuidanceText(e){this.isDefaultStage&&this.quillTextEditor.nativeElement.querySelectorAll(".ql-formats").forEach(n=>{n.style.display="none",n.style.cursor="not-allowed"});const o=this.workflowStages.findIndex(n=>n.id===this.selectedStageId);this.guidancetext=e.html,-1!==o?(this.workflowStages[o].guidance_text=this.guidancetext,this.isworkflowSaved="custom"!=this.workflowStages[o].ws_stage_status):(this.workflowStages[0].guidance_text=this.guidancetext,this.isworkflowSaved="custom"!=this.workflowStages[0].ws_stage_status)}rearrangeArrayResponse(e){return e.sort((o,n)=>o.order-n.order),e}onClickWorflowTab(e){if("tab1"==e&&(this.viewMode=e),"tab2"==e){if(0===this.workflowStages.length)return!1;this.viewMode=e}if("tab3"==e){if(0===this.workflowStages.length)return!1;this.viewMode=e}}activateWorkflowById(e){this.workflowService.updateWorkflow(this.constructor.name,p.e.workFlowModule,e,{workflow_status:"Active",oid:this.currentManagedOrgID}).subscribe(n=>{n&&(this.alertMsg=n.response,this.isOpen=!0,this.alertType="success",this.loadWorkflowList())},n=>{console.log(JSON.stringify(n)),this.isOpen=!0,this.alertMsg=n,this.alertType="danger"})}saveWorkflow(e,o){if(this.submitted=!0,e.invalid)return this.skeletonLoading=!1,!1;{const a={workflow_name:this.workflowName,workflow_stages:this.workflowStages,workflow_status:o,oid:this.currentManagedOrgID};this.skeletonLoading=!0,this.workflowService.updateWorkflow(this.constructor.name,p.e.workFlowModule,this.selectedWorkflowId,a).subscribe(l=>{l&&(this.isWorkflownameEdit=!1,this.isworkflowSaved=!0,this.isControlDisabled=!0,this.alertMsg=l.response,this.isOpen=!0,this.alertType="success",this.skeletonLoading=!1,this.isDirty=!1,this.loadWorkflowById(this.selectedWorkflowId))},l=>{"Bad Request"==l?(this.alertMsg="No Default stages are cannot be edited",this.isOpen=!0,this.alertType="danger",this.skeletonLoading=!1,this.loadWorkflowById(this.selectedWorkflowId)):(this.alertMsg=l,this.isOpen=!0,this.alertType="danger",this.skeletonLoading=!1,this.loadWorkflowById(this.selectedWorkflowId))})}}editWorkflow(e,o){const n="active"===o?"draft":"active";"Activate"===e.target.innerText&&this.isControlDisabled?(this.activateWorkflow(o),this.isControlDisabled=!0):this.workflowStatus=n}activateWorkflow(e){this.isworkflowSaved=!0;const o="draft"===e?"active":"draft";"draft"===o&&(this.isControlDisabled=!1);const n={workflow_status:o,oid:this.currentManagedOrgID};this.isActivateBtnClicked=!0,this.workflowService.activateWorkflow(this.constructor.name,p.e.workFlowModule,this.selectedWorkflowId,n).subscribe(a=>{a&&(this.alertMsg=a.response,this.isOpen=!0,this.alertType="success",this.isActivateBtnClicked=!1,this.loadWorkflowById(this.selectedWorkflowId),this.workflowStatus="Active")},a=>{this.isOpen=!0,this.alertMsg=a,this.alertType="danger",this.isActivateBtnClicked=!1,console.log(JSON.stringify(a))})}checkFormStatus(){if(this.isControlDisabled&&"active"===this.workflowStatus)return this.isControlDisabled=!1}updateWorkflowname(){this.workflowService.updateWorkflowName(this.constructor.name,p.e.workFlowModule,this.selectedWorkflowId,{workflow_name:this.workflowName,oid:this.currentManagedOrgID}).subscribe(o=>{o&&(this.isWorkflownameEdit=!1,this.alertMsg=o.response,this.isOpen=!0,this.alertType="success")},o=>{this.isOpen=!0,this.alertMsg=o,this.alertType="danger",console.log(JSON.stringify(o))})}loadWorkflowById(e){let o,n,a;this.skeletonLoading=!0,this.workflowService.getWorkflowById(this.constructor.name,p.e.workFlowModule,this.currentManagedOrgID,e).subscribe(l=>{if(l.length>0){o=this.rearrangeArrayResponse(l[0].workflow_stages),this.workflowStages=o,this.selectedStageId=this.selectedStageId||this.workflowStages[0].id;const c=this.workflowStages.findIndex(u=>u.id===this.selectedStageId);
1-1!==c?(n=this.workflowStages[c].stage_title,a=this.workflowStages[c].guidance_text,this.order=this.workflowStages[c].order):(n=this.workflowStages[0].stage_title,a=this.workflowStages[0].guidance_text,this.order=this.workflowStages[0].order),this.workflowStatus=l[0].workflow_status,this.workflowType=l[0].workflow_type,this.isControlDisabled=!0,this.isDefaultStage=!0,this.workflowName=l[0].workflow_name,this.stageTitle=n,this.guidancetext=a,this.skeletonLoading=!1}else this.skeletonLoading=!1,this.alertMsg="No data found!",this.isOpen=!0,this.alertType="info"},l=>{this.skeletonLoading=!1,this.alertMsg=l,this.isOpen=!0,this.alertType="danger"})}onClosed(e){this.alertMsg=!e,this.isOpen=!1}isEditorDisabled(){return this.isControlDisabled||"active"==this.workflowStatus?{"background-color":"#f5f6fa",cursor:"not-allowed"}:{"background-color":"#ffffff"}}isDefaultWorkflowStage(){return this.isControlDisabled=this.defaultStages.some(e=>e==this.stageTitle),this.isControlDisabled}canDeactivate(){return this.isDirty}deleteCustomStages(e){if(void 0!==e.id)this.workflowService.deleteWorkflowStage(this.constructor.name,p.e.workFlowModule,e.id,this.selectedWorkflowId).subscribe(o=>{const n=this.workflowStages.findIndex(a=>a.order==e.order);void 0!==this.workflowStages[n]&&(this.stageTitle=this.workflowStages[n].stage_title,this.guidancetext=this.workflowStages[n].guidance_text),this.alertMsg=o.response,this.isOpen=!0,this.alertType="info"},o=>{this.alertMsg=o,this.isOpen=!0,this.alertType="danger"});else{const o=this.workflowStages.findIndex(n=>n.order==e.order);void 0!==this.workflowStages[o]&&(this.stageTitle=this.workflowStages[o].stage_title,this.guidancetext=this.workflowStages[o].guidance_text)}}ngAfterViewChecked(){this.cd.detectChanges(),void 0!==this.quillTextEditor&&("active"===this.workflowStatus?(this.quillTextEditor.nativeElement.querySelector(".ql-toolbar").style.cursor="not-allowed",this.quillTextEditor.nativeElement.querySelectorAll(".ql-formats").forEach(e=>{e.style.display="none",e.style.cursor="not-allowed"})):!this.isDefaultStage&&void 0!==this.isDefaultStage&&null!==this.quillTextEditor.nativeElement.querySelector(".ql-toolbar")&&(this.quillTextEditor.nativeElement.querySelector(".ql-toolbar").style.cursor="pointer",this.quillTextEditor.nativeElement.querySelectorAll(".ql-formats").forEach(e=>{e.style.display="inline-flex"})))}openModal(e){this.modalRef=this.bsmodalService.show(e,{class:"",keyboard:!1,backdrop:!0,ignoreBackdropClick:!0})}getOIDPIDFromURL(){let e=(0,O.Dq)(this.location.path());null!=e&&(this.currentManagedOrgID=e[0])}};let i=r;return r.\u0275fac=function(o){return new(o||r)(t.Y36(h.gz),t.Y36(h.F0),t.Y36(T.z),t.Y36(y.LA),t.Y36(P.Mn),t.Y36(k.tT),t.Y36(t.sBO),t.Y36(I.Dx),t.Y36(g.Ye))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-createworkflow"]],viewQuery:function(o,n){if(1&o&&(t.Gf(G,5,t.SBq),t.Gf(z,5)),2&o){let a;t.iGM(a=t.CRH())&&(n.quillTextEditor=a.first),t.iGM(a=t.CRH())&&(n.confirmDeleteStageAlert=a.first)}},decls:62,vars:52,consts:[["appTheme","",1,"container-fluid","mb
1-0"],[1,"mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb","breadcrumb-style1","mg-b-0"],[1,"breadcrumb-item"],["routerLink","/privacy/dsar/workflows",3,"queryParams"],["aria-current","page",1,"breadcrumb-item","active"],["appTheme",""],[1,"col-md-12","col-xl-12","workflowcontainer"],[1,"card"],[1,"card-header","d-flex","align-items-center","justify-content-between","pd-y-10","pr-2"],[1,"tx-12","tx-color-03","mg-b-0"],[1,"mg-b-0","txt-caps"],["class","d-flex",4,"ngIf"],[1,"card-body"],[1,"wrapper"],[4,"ngIf"],["class","nodatafound",4,"ngIf"],[1,"col-sm-6","mb-3"],["quillEditorForm","ngForm"],[1,"col-sm-12","p-0"],[1,"tx-11","tx-medium"],[1,"red"],[2,"display","flex","flex-direction","row"],["type","text","name","workflowName","required","",1,"form-control","mb-1",3,"ngModel","ngClass","ngModelChange"],["workflow_name","ngModel"],["class","invalid-feedback",4,"ngIf"],["class","btn btn-primary btn-sm btn-wf-save d-flex",3,"click",4,"ngIf"],["class","btn btn-link d-flex",3,"click",4,"ngIf"],[3,"ngClass"],["name","info","class","feather-16","tooltip","You can't edit the predefined stage name",4,"ngIf"],["type","text","name","stageTitle","required","",1,"form-control","mb-1",3,"ngModel","ngClass","ngModelChange","keyup"],["stage_title","ngModel"],["name","info","class","feather-16","tooltip","You can't edit the predefined guidance text",4,"ngIf"],["name","guidancetext",2,"height","200px",3,"ngModel","modules","readOnly","ngClass","styles","required","ngModelChange","onContentChanged"],["guidanceText","ngModel","quillEditorText",""],["class","invalid-feedback position-absolute",4,"ngIf"],[1,"col-sm-5","mr-0","float-right","flotingdiv",3,"ngClass"],["dismissOnTimeout","5000",3,"type","dismissible","onClosed",4,"ngIf"],[1,"d-flex"],[1,"btn","btn-xs","btn-primary","d-flex","align-items-center","mg-r-5",3,"ngClass","click"],[1,"d-none","d-sm-inline"],["class","fa fa-pen mr-1","aria-hidden","true",4,"ngIf"],["type","button",1,"btn","btn-xs","btn-white","d-flex","align-items-center","mg-r-5",3,"ngClass","click"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-pen","mr-1"],[1,"loader-margin"],["count","1",4,"ngIf"],[3,"flowStatus","inputData","currentTab","currentStageEvent","deleteCustomStage",4,"ngIf"],["count","1"],[1,"nodatafound"],[3,"flowStatus","inputData","currentTab","currentStageEvent","deleteCustomStage"],[1,"invalid-feedback"],[1,"btn","btn-primary","btn-sm","btn-wf-save","d-flex",3,"click"],["name","save","class","feather-16 mr-2",4,"ngIf"],["name","save",1,"feather-16","mr-2"],[1,"btn","btn-link","d-flex",3,"click"],["name","edit","class","feather-16 mr-2",4,"ngIf"],["name","edit",1,"feather-16","mr-2"],["name","info","tooltip","You can't edit the predefined stage name",1,"feather-16"],["name","info","tooltip","You can't edit the predefined guidance text",1,"feather-16"],[1,"invalid-feedback","position-absolute"],["dismissOnTimeout","5000",3,"type","dismissible","onClosed"]],template:function(o,n){if(1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"nav",2)(3,"ol",3)(4,"li",4),t._uU(5," Privacy"),t.qZA(),t.TgZ(6,"li",4),t._uU(7," Privacy Rights "),t.qZA(),t.TgZ(8,"li",4)(9,"a",5),t._uU(10,"Workflow"),t.qZA()(),t.TgZ(11,"li",6),t._uU(12),t.qZA()()()()(),t.TgZ(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"span",11)(18,"h6",12),t._uU(19),t.TgZ(20,"span"),t._uU(21),t.qZA()()(),t.YNc(22,j,9,12,"div",13),t.qZA(),t.TgZ(23,"div",14)(24,"div",15),t.YNc(25,$,5,3,"ng-container",16),t.YNc(26,tt,2,0,"span",17),t.TgZ(27,"div",18)(28,"form",null,19)(30,"div",20)(31,"label",21)(32,"span",22),t._uU(33,"*"),t.qZA(),t._uU(34," Workflow"),t.qZA(),t.TgZ(35,"div",23)(36,"input",24,25),t.NdJ("ngModelChange",function(l){return n.workflowName=l}),t.qZA(),t.YNc(38,nt,2,1,"div",26),t.YNc(39,it,3,1,"button",27),t.YNc(40,rt,3,2,"button",28),t.qZA()(),t.TgZ(41,"div",29)(42,"label",21)(43,"span",22),t._uU(44,"*"),t.qZA(),t._uU(45," Stage "),t.YNc(46,at,1,0,"i-feather",30),t.qZA(),t.TgZ(47,"input",31,32),t.NdJ("ngModelChange",function(l){return n.stageTitle=l})("keyup",function(l){return n.update(l)}),t.qZA(),t.YNc(49,dt,2,1,"div",26),t.TgZ(50,"label",21)(51,"span",22),t._uU(52,"*"),t.qZA(),t._uU(53," Guidance Text "),t.YNc(54,ct,1,0,"i-feather",33),t.qZA(),t.TgZ(55,"div",29)(56,"quill-editor",34,35),t.NdJ("ngModelChange",function(l){return n.guidancetext=l})("onContentChanged",function(l){return n.updateGuidanceText(l)}),t.qZA(),t.YNc(59,ft,2,1,"div",36),t.qZA()()()()()()()()(),t.TgZ(60,"div",37),t.YNc(61,gt,2,3,"alert",38),t.qZA()),2&o){const a=t.MAs(29),l=t.MAs(37),c=t.MAs(48),u=t.MAs(57);t.xp6(9),t.Q6J("queryParams",t.WLB(36,pt,n.queryOID,n.queryPID)),t.xp6(3),t.hij(" ",n.workflowName?n.workflowName:"Create Workflow",""),t.xp6(7),t.Oqu(n.workflowName?n.workflowName:"Create workflow"),t.xp6(1),t.ekj("workflowname",""!==n.workflowName),t.xp6(1),t.Oqu(n.workflowStatus?n.workflowStatus:""),t.xp6(1),t.Q6J("ngIf",!n.skeletonLoading&&a.valid),t.xp6(3),t.Q6J("ngIf",(null==n.workflowStages?null:n.workflowStages.length)>0),t.xp6(1),t.Q6J("ngIf",!n.skeletonLoading&&0===(null==n.workflowStages?null:n.workflowStages.length)),t.xp6(10),t.ekj("disabled",!n.isWorkflownameEdit),t.Q6J("ngModel",n.workflowName)("ngClass",t.VKq(39,w,(null==l?null:l.invalid)&&
1((null==l?null:l.dirty)||(null==l?null:l.touched))&&n.submitted&&!n.skeletonLoading)),t.uIk("disabled",!n.isWorkflownameEdit||null),t.xp6(2),t.Q6J("ngIf",(null==l?null:l.invalid)&&!n.skeletonLoading),t.xp6(1),t.Q6J("ngIf",n.isWorkflownameEdit),t.xp6(1),t.Q6J("ngIf","draft"==n.workflowStatus),t.xp6(1),t.Q6J("ngClass",t.WLB(41,ht,!n.skeletonLoading&&!a.valid&&0==(null==n.workflowStages?null:n.workflowStages.length),!n.skeletonLoading&&!a.valid&&0!=(null==n.workflowStages?null:n.workflowStages.length))),t.xp6(5),t.Q6J("ngIf",n.isControlDisabled),t.xp6(1),t.ekj("disabled",n.isControlDisabled||"active"==n.workflowStatus),t.Q6J("ngModel",n.stageTitle)("ngClass",t.VKq(44,w,(null==c?null:c.invalid)&&((null==c?null:c.dirty)||(null==c?null:c.touched))&&n.submitted&&!n.skeletonLoading)),t.uIk("disabled",!(!n.isControlDisabled&&"active"!=n.workflowStatus)||null),t.xp6(2),t.Q6J("ngIf",(null==c?null:c.invalid)&&!n.skeletonLoading),t.xp6(5),t.Q6J("ngIf",n.isControlDisabled),t.xp6(1),t.Q6J("ngClass",t.VKq(46,wt,u.invalid&&n.submitted&&!n.skeletonLoading)),t.xp6(1),t.Q6J("ngModel",n.guidancetext)("modules",n.isControlDisabled?"":n.quillConfig)("readOnly",n.isControlDisabled||"active"==n.workflowStatus)("ngClass",t.VKq(48,w,(null==u?null:u.invalid)&&((null==u?null:u.dirty)||(null==u?null:u.touched))&&n.submitted))("styles",n.isEditorDisabled())("required",!0),t.xp6(3),t.Q6J("ngIf",(null==u?null:u.invalid)&&n.submitted&&!n.skeletonLoading),t.xp6(1),t.Q6J("ngClass",t.VKq(50,mt,!n.isOpen)),t.xp6(1),t.Q6J("ngIf",n.isOpen)}},dependencies:[g.mk,g.O5,f._Y,f.Fj,f.JJ,f.JL,f.Q7,f.On,f.F,Z.xr,D.g6,A.u,C.i9,E.wx,q.mh,h.rH,x.E,B],styles:['@charset "UTF-8";.nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]{background-color:#ddd}.nav-tabs[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%] + .nav-item[_ngcontent-%COMP%]{margin-left:0!important}.nav-tabs[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:before{content:" ";display:block;width:0;height:0;border-top:20px solid transparent;border-bottom:20px solid transparent;border-left:15px solid #ddd;position:absolute;top:0;margin-top:0;margin-left:0;left:100%;z-index:1}.nav-tabs[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:after{border-left:30px solid #5cb85c!important}.nav-tabs[_ngcontent-%COMP%] .nav-item.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:before{content:" ";display:block;width:0;height:0;border-top:20px solid transparent;border-bottom:20px solid transparent;border-left:15px solid #8ff;position:absolute;top:0;margin-top:0;margin-left:0;left:100%;z-index:1}.clearfix[_ngcontent-%COMP%]:after{clear:both;content:"";display:block;height:0}.container[_ngcontent-%COMP%]{font-family:Lato,sans-serif;margin:0 auto}.wrapper[_ngcontent-%COMP%]{display:inline;vertical-align:middle}.pull-right[_ngcontent-%COMP%]{float:right}a[_ngcontent-%COMP%], a[_ngcontent-%COMP%]:active{color:#333;text-decoration:none}a[_ngcontent-%COMP%]:hover{color:#999}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]{font-size:14px;text-align:center;color:#666;cursor:default;margin:0 3px;padding:8px 10px 7px 30px;min-width:180px;float:left;position:relative;background-color:#d9e3f7;-webkit-user-select:none;user-select:none;transition:background-color .2s ease}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]:after, .arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]:before{content:" ";position:absolute;top:0;right:-17px;width:0;height:0;border-top:19px solid transparent;border-bottom:17px solid transparent;border-left:17px solid #d9e3f7;z-index:2;transition:border-color .2s ease}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]:before{right:auto;left:0;border-left:17px solid #fff;z-index:0}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]:first-child:before{border:none}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.arrow-steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:before{opacity:0;content:"\\2714";position:absolute;top:-2px;left:-20px}.arrow-steps[_ngcontent-%COMP%] .step.done[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:before{opacity:1;transition:opacity .3s ease .5s}.arrow-steps[_ngcontent-%COMP%] .step.current[_ngcontent-%COMP%]{color:#fff;background-color:#23468c}.arrow-steps[_ngcontent-%COMP%] .step.current[_ngcontent-%COMP%]:after{border-left:17px solid #23468c}.active-tab[_ngcontent-%COMP%]{display:flex}.deactive-tab[_ngcontent-%COMP%]{display:none}.workflowcontainer[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding:0}.small-btn[_ngcontent-%COMP%]{border-radius:10px;height:18px;padding:0 3px;margin:0 5px}.stages[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column}.stages[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding:0}.displayflex[_ngcontent-%COMP%]{display:flex;flex-direction:row}.stages[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row}.wrapper[_ngcontent-%COMP%] #tab-content[_ngcontent-%COMP%]{padding:10px 0 0}.red[_ngcontent-%COMP%]{color:red}
1.workflowname[_ngcontent-%COMP%]{border:1px solid #ccc;border-radius:30px;font-size:11px;color:#596882;text-transform:uppercase;background:aliceblue;margin:3px 10px;padding:5px 10px 3px}.txt-caps[_ngcontent-%COMP%]{text-transform:capitalize}.disabled[_ngcontent-%COMP%]{cursor:not-allowed}.alert-success[_ngcontent-%COMP%]{background-color:#10b759;border-color:#10b759;color:#fff}.alert-danger[_ngcontent-%COMP%]{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.flotingdiv[_ngcontent-%COMP%]{position:fixed;bottom:0;top:84%;right:0;overflow-x:hidden;overflow-y:auto;z-index:0}.hide[_ngcontent-%COMP%]{display:none}.hideEditSave-btn[_ngcontent-%COMP%]{display:none!important}.loader-margin[_ngcontent-%COMP%]{margin:4px auto 0;width:auto;padding:4px 4px 0;height:auto}.quilleditor-invalid[_ngcontent-%COMP%]{border:1px solid #f00;border-radius:5px}.nodatafound[_ngcontent-%COMP%]{top:8px;position:relative;margin:0 20px}.showerror[_ngcontent-%COMP%]{display:block}.quill-disabled[_ngcontent-%COMP%]{background-color:#ccc;cursor:not-allowed}.ql-disabled[_ngcontent-%COMP%]{background-color:#ccc!important}.btn-wf-save[_ngcontent-%COMP%]{line-height:15px;display:flex;height:38px;margin-left:10px;align-items:center;justify-content:center;align-content:center;flex-wrap:nowrap}']}),i})();var bt=d(85493),kt=d(31456),Ct=d(19688);const xt=[{path:"",component:_t,canActivate:[bt.a1,kt.p],canDeactivate:[Ct.c]}];let vt=(()=>{const r=class{};let i=r;return r.\u0275fac=function(o){return new(o||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[h.Bz.forChild(xt),h.Bz]}),i})();var St=d(19119),Mt=d(23501),Ot=d(55466),Tt=d(91742);let yt=(()=>{const r=class{};let i=r;return r.\u0275fac=function(o){return new(o||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[g.ez,f.u5,f.UX,St.J,vt,Mt.O.forRoot({themes:[Ot.W,Tt.$],active:b.N.theme})]}),i})()}}]);
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.