1import{a as ht}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VVIDNJHO.js";import{f as fe,h as _t}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-HNGTKKL5.js";import{a as g}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VCDYWJ5I.js";import{a as N,b as B}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UQ5TPK3T.js";import{b as je}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-5ZEIPDE7.js";import{a as qe,b as ie,c as de}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-JL3SKJDV.js";import{a as ge,b as dt,c as ut}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-E26EN2XH.js";import{e as ct}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GA4O4M33.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-7LCCCH6I.js";import{a as gt,b as ft,c as M,d as vt,e as wt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-S224B24G.js";import{a as He}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3LQ6L62N.js";import{b as pe,d as ce}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-T2GBFYLV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LQT2ORM5.js";import{a as Xe,b as ot}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LFEOCXYM.js";import{a as Qe,b as ze}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-FTG5GQXB.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-E4O32IR2.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-PUQUU7JY.js";import{a as Je}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BLIUWKZQ.js";import{a as it,b as pt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-YLOWR4MM.js";import{a as Ze,b as et,c as tt,d as st,e as lt,f as mt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NECBEVUU.js";import{a as Ke,b as rt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IGYG2522.js";import{a as Ye,b as ue,c as nt,d as at}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-EZPRQS2I.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GDQANC6E.js";import{a as j,b as Be,c as We,d as $e}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-67DEGCHT.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DWJKZWXS.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UVYG5FUX.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-A5A4ON67.js";import{j as Pe}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3SUTNENN.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-HIN7FM5G.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UKWSJFPI.js";import{a as K}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-RL4ODNTR.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-7NUKZQYM.js";import{g as Ve}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TD5QIOTL.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IGZIRJQN.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DIOHHI3M.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VXQ22NXX.js";import{A as ke,a as X,e as De,y as Re}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IIEKFVOQ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IQPPX6NZ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-R6ATEHOJ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ZYTMMI5R.js";import{a as G}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ME6OOKIW.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TZWBTES7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ALL77O67.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-X6HZOHA2.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-55LBUOLS.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-2IMUUWJB.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-HV7NZ3T3.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ASPNFSTE.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-OTH5IOCH.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-5FXY6EHC.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UYV7J5M3.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-FJVWFSSK.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WSQHVBSB.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-KHZYCMEO.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LUVC62E7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ZOQH4BRJ.js";import{B as z,D as E,I as le,Q as me,R as Y,X as J,s as Q}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-AKPUID3S.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3KHHOKR7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NJNVRHKN.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ODNOXG5K.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BYG2IWSB.js";import{f as ye,g as Ue,j as Ge,p as q,t as Me}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-FTWOOITD.js";import{A as x,B as ae,C as se,E as Le,H as Ee,a as F,c as d}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LBCPBUBK.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ILLEOMOT.js";import{e as y}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-KFW34AI3.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-G3XYAJPK.js";import{a as k,b as V}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WXUJ2XVZ.js";import"@angular/core";import{CommonModule as Uo}from"@angular/common";import{TranslateModule as Go}from"@ngx-translate/core";import{ReactiveFormsModule as Mo}from"@angular/forms";import"@angular/core";import{filter as Oe,of as yo,switchMap as Ae,tap as Eo}from"rxjs";import"@ngx-translate/core";import"@angular/material/dialog";var L=(function(o){return o.TABLE_SECTION="table-section",o.UPSERT_SECTION="upsert-section",o.VIEW_SECTION="view-section",o})(L||{});
1var P=(function(o){return o.HIDE="HIDE",o.EDIT="EDIT",o.DELETE="DELETE",o})(P||{});import*as r from"@angular/core";import*as Se from"@ngx-translate/core";import*as ii from"@angular/material/dialog";import*as Ce from"@angular/common";import*as oi from"@telenet/ng-lib-ocapi";import{EventEmitter as oo}from"@angular/core";import"@ngxs/store";var f;(function(o){let l=(()=>{class C{static{this.type="[CallFlowStore] Set address id"}constructor(b){this.addressId=b}}return C})();o.SetAddressId=l;let e=(()=>{class C{static{this.type="[CallFlowStore] Set call fLow"}constructor(b){this.callFlow=b}}return C})();o.SetCallFLow=e;let i=(()=>{class C{static{this.type="[CallFlowStore] Save call flow type"}constructor(b){this.callFlowTypeViewModel=b}}return C})();o.SaveType=i;let n=(()=>{class C{static{this.type="[CallFlowStore] Save call flow configuration"}constructor(b){this.callFlowConfigurationViewModel=b}}return C})();o.SaveConfiguration=n;let c=(()=>{class C{static{this.type="[CallFlowStore] Save call flow users"}constructor(b){this.callFlowUsersViewModel=b}}return C})();o.SaveUsers=c;let h=(()=>{class C{static{this.type="[CallFlowStore] Save call flow welcome message"}constructor(b){this.callFlowWelcomeMessageViewModel=b}}return C})();o.SaveWelcomeMessage=h;let W=(()=>{class C{static{this.type="[CallFlowStore] Save call flow schedules"}constructor(b){this.linkingScheduleViewModel=b}}return C})();o.SaveSchedules=W;let be=(()=>{class C{static{this.type="[CallFlowStore] Set configured users"}constructor(b){this.configuredUsers=b}}return C})();o.SetConfiguredUsers=be;let ni=(()=>{class C{static{this.type="[CallFlowStore] After save"}}return C})();o.AfterSave=ni;let ai=(()=>{class C{static{this.type="[CallFlowStore] Set action type"}constructor(b){this.actionType=b}}return C})();o.SetActionType=ai})(f||(f={}));var H=(function(o){return o.TYPE="ng.add-edit-call-flow.select-type-step",o.CONFIGURATION="ng.add-edit-call-flow.configuration-step",o.USERS="ng.add-edit-call-flow.select-users-step",o.WELCOMEMESSAGE="ng.add-edit-call-flow.welcome-message-step",o.SCHEDULE="ng.add-edit-call-flow.schedule-step",o})(H||{});import"@angular/core";import"@angular/core";import{Validators as pi}from"@angular/forms";import"@ngxs/store";import{Selector as oe}from"@ngxs/store";var Z=(function(o){return o.CREATE_TYPE="create",o.UPDATE_TYPE="update",o})(Z||{});import"@angular/core";var xe={callFlow:void 0,actionType:void 0,addressId:void 0,isActionSaved:!1,configuredUsers:[]};import{Action as D,State as si}from"@ngxs/store";import*as Tt from"@angular/core";var St=f.SaveType,Ct=f.SaveConfiguration,Ft=f.SaveSchedules,bt=f.SaveWelcomeMessage,yt=f.SaveUsers,Et=f.SetAddressId,xt=f.SetConfiguredUsers,li=f.AfterSave,It=f.SetActionType,Nt=f.SetCallFLow,S=class he{setConfiguredUsers(l,e){l.patchState(G(l.getState(),i=>{i.configuredUsers=e.configuredUsers}))}setAddressId(l,e){l.patchState(G(l.getState(),i=>{i.addressId=e.addressId}))}setActionType(l,e){l.patchState(G(l.getState(),i=>{i.actionType=e.actionType}))}setCallFLow(l,e){l.patchState(G(l.getState(),i=>{i.callFlow=e.callFlow}))}saveType(l,{callFlowTypeViewModel:e}){l.setState(G(l.getState(),i=>{i.callFlow=this.updateType(e,i.callFlow)}))}saveConfiguration(l,{callFlowConfigurationViewModel:e}){l.setState(G(l.getState(),i=>{i.callFlow=this.updateConfiguration(e,i.callFlow)}))}saveUsers(l,{callFlowUsersViewModel:e}){l.setState(G(l.getState(),i=>{i.callFlow=this.updateUsers(e,i.callFlow)}))}saveWelcomeMessage(l,{callFlowWelcomeMessageViewModel:e}){l.setState(G(l.getState(),i=>{i.callFlow=this.updateWelcomeMessage(e,i.callFlow)}))}saveSchedules(l,{linkingScheduleViewModel:e}){l.setState(G(l.getState(),i=>{i.callFlow=this.updateSchedule(e,i.callFlow)}))}afterSave(l){l.patchState(G(l.getState(),e=>{e.isActionSaved=!0})),l.patchState(xe)}updateType(l,e){return V(k({},e),{type:l.type})}updateConfiguration(l,e){return V(k({},e),{name:l.name,phoneNumber:y(l.phoneNumber)?null:l.phoneNumber,extension:l.extension,language:l.language,huntPolicy:l.huntPolicy,agentRingTime:l.agentRingTime,overflowEnabled:l.overflowEnabled,overflowTimeout:l.overflowTimeout,overflowDestination:y(l.overflowDestination)?null:l.overflowDestination,overflowNumber:y(l.overflowNumber)?null:l.overflowNumber})}updateUsers(l,e){return V(k({},e),{agentUserIds:l.userIds,agentUsers:l.userDetails})}updateWelcomeMessage(l,e){return V(k({},e),{welcomeMessageFileName:l.welcomeMessage,musicOnHoldFileName:l.musicOnHold,estimatedWaitMessageEnabled:l.estimatedWaitMessageEnabled,estimatedWaitMessageRepetitionEnabled:l.estimatedWaitMessageRepetitionEnabled,estimatedWaitMessageRepetitionPeriod:l.estimatedWaitMessageRepetitionPeriod})}updateSchedule(l,e){return V(k({},e),{holidayScheduleId:l?.holidayScheduleId,holidayScheduleForwardNumber:l?.holidayForwardNumber,openingHoursScheduleId:l?.openingHoursScheduleId,outsideOpeningHoursForwardNumber:l?.closedForwardNumber})}static{this.\u0275fac=function(e){return new(e||he)}}static{this.\u0275prov=Tt.\u0275\u0275defineInjectable({token:he,factory:he.\u0275fac})}};F([D(xt),d("design:type",Function),d("design:paramtypes",[Object,xt]),d("design:returntype",void 0)],S.prototype,"setConfiguredUsers",null);F([D(Et),d("design:type",Function),d("design:paramtypes",[Object,Et]),d("design:returntype",void 0)],S.prototype,"setAddressId",null);F([D(It),d("design:type",Function),d("design:paramtypes",[Object,It]),d("design:returntype",void 0)],S.prototype,"setActionType",null);F([D(Nt),d("design:type",Function),d("design:paramtypes",[Object,Nt]),d("design:returntype",void 0)],S.prototype,"setCallFLow",null);F([D(St),d("design:type",Function),d("design:paramtypes",[Object,St]),d("design:returntype",void 0)],S.prototype,"saveType",null);F([D(Ct),d("design:type",Function),d("design:paramtypes",[Object,Ct]),d("design:returntype",void 0)],S.prototype,"saveConfiguration",null);F([D(yt),d("design:type",Function),d("design:paramtypes",[Object,yt]),d("design:returntype",void 0)],S.prototype,"saveUsers",null);F([D(bt),d("design:type",Function),d("design:paramtypes",[Object,bt]),d("design:returntype",void 0)],S.prototype,"saveWelcomeMessage",null);
1F([D(Ft),d("design:type",Function),d("design:paramtypes",[Object,Ft]),d("design:returntype",void 0)],S.prototype,"saveSchedules",null);F([D(li),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",void 0)],S.prototype,"afterSave",null);S=F([si({name:"callFlowState",defaults:xe})],S);var v=class{static callFLow(l){return l.callFlow}static actionType(l){return l.actionType}static addressId(l){return l.addressId}static isActionSaved(l){return l.isActionSaved}static configuredUsers(l){return l.configuredUsers}};F([oe([S]),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",Object)],v,"callFLow",null);F([oe([S]),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",String)],v,"actionType",null);F([oe([S]),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",String)],v,"addressId",null);F([oe([S]),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",Boolean)],v,"isActionSaved",null);F([oe([S]),d("design:type",Function),d("design:paramtypes",[Object]),d("design:returntype",Array)],v,"configuredUsers",null);import{iif as ci,map as di,mergeMap as ui,of as gi,take as fi,tap as hi}from"rxjs";import*as a from"@angular/core";import*as O from"@angular/forms";import*as Ot from"@ngxs/store";import*as ve from"@angular/common";import*as At from"@ngx-translate/core";var vi=f.SaveUsers,wi=f.SetConfiguredUsers;function _i(o,l){if(o&1&&(a.\u0275\u0275elementStart(0,"div",8)(1,"span",9),a.\u0275\u0275text(2),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd()()),o&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(3,1,"ng."+e.messageGroup+".atleast-two-users-validation-error"))}}function Si(o,l){if(o&1){let e=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",10)(1,"span",15),a.\u0275\u0275text(2),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(3,"span",16),a.\u0275\u0275text(4),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(5,"span",17),a.\u0275\u0275text(6),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"div",13)(8,"span",18),a.\u0275\u0275listener("click",function(){let n=a.\u0275\u0275restoreView(e).index,c=a.\u0275\u0275nextContext(3);return a.\u0275\u0275resetView(c.increaseLinkedUsersPriority(n))}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"span",19),a.\u0275\u0275listener("click",function(){let n=a.\u0275\u0275restoreView(e).index,c=a.\u0275\u0275nextContext(3);return a.\u0275\u0275resetView(c.reduceLinkedUsersPriority(n))}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(10,"span",20),a.\u0275\u0275listener("click",function(){let n=a.\u0275\u0275restoreView(e).index,c=a.\u0275\u0275nextContext(3);return a.\u0275\u0275resetView(c.deleteLinkedUser(n))}),a.\u0275\u0275elementEnd()()()}if(o&2){let e=l.$implicit,i=l.index,n=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275attribute("data-cy",n.messageGroup+".user."+i+".name"),a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1("",e.firstName+" "+e.lastName," "),a.\u0275\u0275advance(),a.\u0275\u0275attribute("data-cy",n.messageGroup+".user."+i+".phone-number"),a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate(e.phoneNumber),a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate(i),a.\u0275\u0275advance(2),a.\u0275\u0275attribute("data-cy",n.messageGroup+".user."+i+".icon.increase-linked-users-priority"),a.\u0275\u0275advance(),a.\u0275\u0275attribute("data-cy",n.messageGroup+".user."+i+".icon.reduce-linked-users-priority"),a.\u0275\u0275advance(),a.\u0275\u0275attribute("data-cy",n.messageGroup+".user."+i+".icon.delete-linked-users")}}function Ci(o,l){if(o&1&&(a.\u0275\u0275elementStart(0,"div",10)(1,"div",10)(2,"span",11),a.\u0275\u0275text(3),a.\u0275\u0275pipe(4,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(5,"span",12),a.\u0275\u0275text(6),a.\u0275\u0275pipe(7,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(8,"span",13),a.\u0275\u0275text(9),a.\u0275\u0275pipe(10,"translate"),a.\u0275\u0275elementEnd()(),a.\u
10275\u0275template(11,Si,11,8,"div",14),a.\u0275\u0275elementEnd()),o&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(4,4,"ng."+e.messageGroup+".linked-user-name-label")),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(7,6,"ng."+e.messageGroup+".phone-number-label")),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(10,8,"ng."+e.messageGroup+".prio-label")),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngForOf",e.callFlowUsersList)}}function Fi(o,l){if(o&1&&(a.\u0275\u0275elementStart(0,"form",3),a.\u0275\u0275template(1,_i,4,3,"div",4),a.\u0275\u0275elementStart(2,"div",5),a.\u0275\u0275element(3,"tg-form-dropdown-with-multiple-select",6),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(4,Ci,12,10,"div",7),a.\u0275\u0275elementEnd()),o&2){let e=a.\u0275\u0275nextContext();a.\u0275\u0275property("formGroup",e.callFlowUsersForm),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.showUserValidator),a.\u0275\u0275advance(2),a.\u0275\u0275property("optionList",e.usersOptions)("selectedOptions",e.selectedUsersList),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.callFlowUsersList.length!==0)}}var Ut=(()=>{class o extends M{constructor(e,i,n,c,h){super(h),this.formBuilder=e,this.messageService=i,this.userService=n,this.cdr=c,this.store=h,this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.callFlowUsersList=[],this.selectedUsersList=[],this.showUserValidator=!1}ngOnInit(){this.initializeAndPopulateForm(),this.selectedCallFlowDetails=this.store.selectSnapshot(v.callFLow);let e=this.store.selectSnapshot(v.addressId);this.obs(this.getConfiguredUsersFromStore()).pipe(this.preventInfiniteLoading(),this.fetchConfiguredUsersIfNotInStore(e)).subscribe(i=>{this.existingUsers=i,this.initUsersOption(),this.initializeCallFlowUsers(),this.setSelectedUserToDropDown()})}ngAfterViewInit(){this.obs(this.callFlowUsersForm.valueChanges).subscribe(()=>{this.addSelectedUsersToView(),this.cdr.detectChanges()})}deleteLinkedUser(e){this.callFlowUsersList.splice(e,1),this.setSelectedUserToDropDown()}reduceLinkedUsersPriority(e){if(this.callFlowUsersList.length>=2){let i=this.callFlowUsersList.splice(e,1)[0];this.callFlowUsersList.splice(e+1,0,i)}}increaseLinkedUsersPriority(e){if(this.callFlowUsersList.length>=2&&e!==0){let i=this.callFlowUsersList.splice(e,1)[0];this.callFlowUsersList.splice(e-1,0,i)}}addSelectedUsersToView(){let e=this.callFlowUsersForm.get("users").value;e?.forEach(i=>{if(!this.callFlowUsersList.find(c=>c.uuid===i)){let c=this.existingUsers.find(h=>h.uuid===i);this.callFlowUsersList.push(c)}}),this.callFlowUsersList=this.callFlowUsersList.filter(i=>e?.includes(i.uuid)),this.showUserValidator=!e?.length||!this.callFlowUsersList?.some(i=>!y(i.firstName))}storeData(){this.store.dispatch(new vi(this.getCallFlowUsersViewModel()))}isDataValid(){return this.messageService.clearMessages(this.messageGroup),this.callFlowUsersListIsValid()?(this.showUserValidator=!1,!0):(this.showUserValidator=!0,!1)}fetchConfiguredUsersIfNotInStore(e){return ui(i=>ci(()=>y(i),this.fetchConfiguredUsers(e),gi(i)))}preventInfiniteLoading(){return fi(1)}getConfiguredUsersFromStore(){return this.store.select(v.configuredUsers)}fetchConfiguredUsers(e){return this.userService.getUsers(pe.MESSAGE_GROUP,e,g.sortByFirstNamePageRequest,!1,{configured:!0}).pipe(di(i=>i.content),hi(i=>this.store.dispatch(new wi(i))))}isSelectedCallFlowOfType(e){return this.selectedCallFlowDetails?.type===e}initializeCallFlowUsers(){return this.callFlowUsersList=[],this.selectedCallFlowDetails.agentUsers?.forEach(e=>{let i=this.existingUsers.find(n=>n.uuid===e.uuid);i&&this.callFlowUsersList.push(i)}),this.callFlowUsersList}initializeAndPopulateForm(){this.callFlowUsersForm=this.formBuilder.group({users:[[],[pi.required]]})}callFlowUsersListIsValid(){return this.isSelectedCallFlowOfType(N.QUEUE)?this.callFlowUsersList.length>=g.MIN_QUEUE_USERS:this.callFlowUsersList.length>=g.MIN_HUNT_GROUP_USERS}initUsersOption(){this.usersOptions=this.existingUsers.map(e=>new E().withValue(e.uuid).withLabel(`${e.firstName} ${e.lastName}`))}setSelectedUserToDropDown(){this.selectedUsersList=this.usersOptions.filter(e=>this.callFlowUsersList.map(i=>i?.uuid).includes(e.value))}getCallFlowUsersViewModel(){return{userIds:this.getSelectedCallFlowUserIds(),userDetails:this.callFlowUsersList}}getSelectedCallFlowUserIds(){return this.callFlowUsersList?.map(e=>e.uuid)??[]}static{this.\u0275fac=function(i){return new(i||o)(a.\u0275\u0275directiveInject(O.FormBuilder),a.\u0275\u0275directiveInject(x),a.\u0275\u0275directiveInject(ce),a.\u0275\u0275directiveInject(a.ChangeDetectorRef),a.\u0275\u0275directiveInject(Ot.Store))}}static{this.\u0275cmp=a.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flow-users"]],standalone:!1,features:[a.\u
10275\u0275InheritDefinitionFeature],decls:3,vars:1,consts:[[1,"row","m--n","py--m"],[1,"col-12","col-md-7","p--n"],["class","editForm row m--n p--n",3,"formGroup",4,"ngIf"],[1,"editForm","row","m--n","p--n",3,"formGroup"],["class","notification notification--errorfield",4,"ngIf"],[1,"form-group","col-12","mt--s","p--n","display--flex","flex-direction--column","flex-direction--row--md","align-items--end"],["formControlName","users",1,"mr--m--md","col-md-8","col-12","mb--m","mb--n--md","width--full",3,"optionList","selectedOptions"],["class","row m--n p--n width--full",4,"ngIf"],[1,"notification","notification--errorfield"],[1,"icon","icon-error-shape","errorfield"],[1,"row","m--n","p--n","width--full"],[1,"col-4","mr--m--md","mr--xxs","p--n","word-break--ellipsis"],[1,"col-3","mr--m--md","mr--xxs","p--n","word-break--ellipsis"],[1,"col-3","p--n"],["class","row m--n p--n width--full",4,"ngFor","ngForOf"],[1,"col-4","mr--m--md","mr--xxs","p--n","color-dark-brown","opacity--small-transparency","word-break--ellipsis"],[1,"col-3","mr--m--md","mr--xxs","p--n","color-dark-brown","opacity--small-transparency","word-break--ellipsis"],[1,"col-1","p--n","color-dark-brown","opacity--small-transparency"],[1,"icon","icon-arrow-up","cursor--pointer","mr--xs",3,"click"],[1,"icon","icon-arrow-down","cursor--pointer","mr--xs",3,"click"],[1,"icon","icon-trash","cursor--pointer",3,"click"]],template:function(i,n){i&1&&(a.\u0275\u0275elementStart(0,"div",0)(1,"div",1),a.\u0275\u0275template(2,Fi,5,5,"form",2),a.\u0275\u0275elementEnd()()),i&2&&(a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",n.callFlowUsersForm))},dependencies:[ve.NgForOf,ve.NgIf,O.\u0275NgNoValidate,O.NgControlStatus,O.NgControlStatusGroup,O.FormGroupDirective,O.FormControlName,me,At.TranslatePipe],encapsulation:2})}}return o})();import"@angular/core";import{Validators as Ie}from"@angular/forms";import{map as Ei}from"rxjs";import"@ngxs/store";import"@ngx-translate/core";import"@angular/material/dialog";import"@angular/core";import{MAT_DIALOG_DATA as bi}from"@angular/material/dialog";import*as _ from"@angular/core";import*as Gt from"@angular/material/dialog";var Mt=(()=>{class o{constructor(e,i,n){this.messageService=e,this.dialogRef=i,this.data=n}close(e=void 0){this.messageService.clearMessages(this.data.messageGroupName),this.dialogRef.close(e)}static{this.\u0275fac=function(i){return new(i||o)(_.\u0275\u0275directiveInject(x),_.\u0275\u0275directiveInject(Gt.MatDialogRef),_.\u0275\u0275directiveInject(bi))}}static{this.\u0275cmp=_.\u0275\u0275defineComponent({type:o,selectors:[["ng-component"]],standalone:!1,decls:7,vars:2,consts:[[1,"overlay"],[1,"overlay__mask","overlay__mask--backdrop","backdrop-filter--3","animation--fade-in"],[1,"overlay__section","overlay__section--align-top","py--g--sm","py--l","py--xxxg--md"],[1,"overlay__section__content--wrapper","animation--slide-down-to-screen"],[1,"overlay__section__content__close"],[1,"icon","icon-cross",3,"click"],[3,"backToAudioAfterUpload","messageGroupName","addressId"]],template:function(i,n){i&1&&(_.\u0275\u0275elementStart(0,"div",0),_.\u0275\u0275element(1,"div",1),_.\u0275\u0275elementStart(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),_.\u0275\u0275listener("click",function(){return n.close()}),_.\u0275\u0275elementEnd()(),_.\u0275\u0275elementStart(6,"tg-create-audio-file",6),_.\u0275\u0275listener("backToAudioAfterUpload",function(h){return n.close(h)}),_.\u0275\u0275elementEnd()()()()),i&2&&(_.\u0275\u0275advance(6),_.\u0275\u0275property("messageGroupName",n.data.messageGroupName)("addressId",n.data.addressId))},dependencies:[dt],encapsulation:2})}}return o})();import{provideNgxMask as Ii}from"ngx-mask";import*as m from"@angular/core";import*as A from"@angular/forms";import*as Lt from"@ngxs/store";import*as we from"@ngx-translate/core";import*as Dt from"@angular/material/dialog";import*as Rt from"@angular/common";var xi=f.SaveWelcomeMessage;function Ni(o,l){if(o&1&&(m.\u0275\u0275elementStart(0,"div",13),m.\u0275\u0275element(1,"tg-form-dropdown-single-select",16),m.\u0275\u0275elementEnd()),o&2){let e=m.\u0275\u0275nextContext(3);m.\u0275\u0275advance(),m.\u0275\u0275property("optionList",e.timeOptions)}}function Ti(o,l){if(o&1){let e=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"div",8),m.\u0275\u0275element(1,"div",9),m.\u0275\u0275elementStart(2,"div")(3,"h4",10),m.\u0275\u0275text(4),m.\u0275\u0275pipe(5,"translate"),m.\u0275\u0275elementEnd()(),m.\u0275\u0275elementStart(6,"div",4),m.\u0275\u0275element(7,"tg-form-dropdown-single-select",11),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(8,"div",4),m.\u0275\u0275element(9,"tg-form-input-checkbox",12),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(10,"div",13)(11,"tg-form-input-checkbox",14),m.\u0275\u0275listener("ngModelChange",function(){m.\u0275\u0275restoreView(e);let n=m.\u0275\u0275nextContext(2);
1return m.\u0275\u0275resetView(n.setEstimatedWaitMessageRepetitionEnabled())}),m.\u0275\u0275elementEnd()(),m.\u0275\u0275template(12,Ni,2,1,"div",15),m.\u0275\u0275elementEnd()}if(o&2){let e=m.\u0275\u0275nextContext(2);m.\u0275\u0275advance(4),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(5,4,"ng.add-edit-call-flow.lbl.music-on-hold")),m.\u0275\u0275advance(3),m.\u0275\u0275property("optionList",e.audioFilesOptions)("customLabel",!0),m.\u0275\u0275advance(5),m.\u0275\u0275property("ngIf",e.waitMessageRepetitionEnabled)}}function Oi(o,l){if(o&1){let e=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"form",3)(1,"div",4),m.\u0275\u0275element(2,"tg-form-dropdown-single-select",5),m.\u0275\u0275elementStart(3,"div")(4,"a",6),m.\u0275\u0275listener("click",function(){m.\u0275\u0275restoreView(e);let n=m.\u0275\u0275nextContext();return m.\u0275\u0275resetView(n.navigateToAudioFileSection())}),m.\u0275\u0275text(5),m.\u0275\u0275pipe(6,"translate"),m.\u0275\u0275elementEnd()()(),m.\u0275\u0275template(7,Ti,13,6,"div",7),m.\u0275\u0275elementEnd()}if(o&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275property("formGroup",e.callFlowWelcomeMessageForm),m.\u0275\u0275advance(2),m.\u0275\u0275property("optionList",e.audioFilesOptions)("customLabel",!0),m.\u0275\u0275advance(2),m.\u0275\u0275attribute("data-cy",e.messageGroup+".link.create-audio-file"),m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(6,6,"ng.add-edit-call-flow.create-audio-file")),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",!e.isCallFlowTypeHuntGroup)}}var kt=(()=>{class o extends M{constructor(e,i,n,c,h,W){super(i),this.formBuilder=e,this.store=i,this.audioFileService=n,this.messageService=c,this.translateService=h,this.dialog=W,this.DEFAULT_MESSAGE_KEY="##DEFAULT_TELENET##",this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.waitMessageRepetitionEnabled=!1}ngOnInit(){this.selectedCallFlowDetails=this.store.selectSnapshot(v.callFLow),this.addressId=this.store.selectSnapshot(v.addressId),this.obs(this.getAudioFiles(this.addressId)).subscribe(e=>{this.existingAudioFiles=e,this.initializeAndPopulateForm()}),this.isCallFlowTypeHuntGroup=this.isTypeHuntGroup()}setEstimatedWaitMessageRepetitionEnabled(){this.waitMessageRepetitionEnabled=this.callFlowWelcomeMessageForm.get("estimatedWaitMessageRepetitionEnabled").value,this.setRepetitionPeriodDefault(),this.addEstimatedWaitMessageRepetitionPeriodValidator()}navigateToAudioFileSection(){this.dialog.open(Mt,{data:{addressId:this.addressId,messageGroupName:this.messageGroup}}).afterClosed().subscribe(i=>this.reloadAudioOptions(i))}storeData(){this.store.dispatch(new xi(this.callFlowWelcomeMessageForm.value))}isDataValid(){return this.messageService.clearMessages(this.messageGroup),this.callFlowWelcomeMessageForm.valid?!0:(this.triggerFormValidation(this.callFlowWelcomeMessageForm),!1)}isTypeHuntGroup(){return this.selectedCallFlowDetails?.type===N.HUNT_GROUP}initializeAndPopulateForm(){let e=this.selectedCallFlowDetails?.estimatedWaitMessageRepetitionPeriod;this.callFlowWelcomeMessageForm=this.formBuilder.group({welcomeMessage:[this.selectedCallFlowDetails?.welcomeMessageFileName??"",[Ie.required]],musicOnHold:this.getMusicOnHold(),estimatedWaitMessageEnabled:[this.selectedCallFlowDetails?.estimatedWaitMessageEnabled??!1],estimatedWaitMessageRepetitionEnabled:[this.selectedCallFlowDetails?.estimatedWaitMessageRepetitionEnabled??!1],estimatedWaitMessageRepetitionPeriod:[e?`${e}`:null]}),this.setEstimatedWaitMessageRepetitionEnabled(),this.initOtherOption()}getMusicOnHold(){return this.isTypeHuntGroup()?"":[this.selectedCallFlowDetails?.musicOnHoldFileName??"",[Ie.required]]}setRepetitionPeriodDefault(){this.waitMessageRepetitionEnabled||this.callFlowWelcomeMessageForm.get("estimatedWaitMessageRepetitionPeriod").setValue(null)}addEstimatedWaitMessageRepetitionPeriodValidator(){this.callFlowWelcomeMessageForm.get("estimatedWaitMessageRepetitionPeriod").setValidators(this.waitMessageRepetitionEnabled?Ie.required:[]),this.callFlowWelcomeMessageForm.controls.estimatedWaitMessageRepetitionPeriod.updateV
1alueAndValidity()}initOtherOption(){this.audioFilesOptions=this.existingAudioFiles.map(e=>new E().withValueAndLabel(e.name)),this.timeOptions=Array.from({length:19},(e,i)=>(i+2)*6).map(e=>e.toString()).map(e=>new E().withValueAndLabel(e)),this.addDefaultMessageOption(this.audioFilesOptions,"default-message")}reloadAudioOptions(e){e&&(this.audioFilesOptions.unshift(new E(e,e)),this.callFlowWelcomeMessageForm.get("welcomeMessage").setValue(e))}addDefaultMessageOption(e,i){e.unshift(new E(this.DEFAULT_MESSAGE_KEY,this.getTranslation(i)))}getTranslation(e){let i=`ng.${this.messageGroup}.${e}.lbl`;return this.translateService.instant(i)}getAudioFiles(e){return this.audioFileService.getAudioFiles(ct.MESSAGE_GROUP,e).pipe(Ei(i=>(i.forEach(n=>{n.source=this.audioFileService.getAudioFileURI(n.name,e)}),i)))}static{this.\u0275fac=function(i){return new(i||o)(m.\u0275\u0275directiveInject(A.FormBuilder),m.\u0275\u0275directiveInject(Lt.Store),m.\u0275\u0275directiveInject(ge),m.\u0275\u0275directiveInject(x),m.\u0275\u0275directiveInject(we.TranslateService),m.\u0275\u0275directiveInject(Dt.MatDialog))}}static{this.\u0275cmp=m.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flow-welcome-message"]],standalone:!1,features:[m.\u0275\u0275ProvidersFeature([Ii()]),m.\u0275\u0275InheritDefinitionFeature],decls:3,vars:1,consts:[[1,"row","m--n","py--m"],[1,"col-12","col-md-7","p--n"],["class","editForm row m--n p--n",3,"formGroup",4,"ngIf"],[1,"editForm","row","m--n","p--n",3,"formGroup"],[1,"form-group","col-12","mt--s","p--n"],["formControlName","welcomeMessage",3,"optionList","customLabel"],["href","JavaScript:void(0);",1,"link","text--m",3,"click"],["class","row m--n p--n",4,"ngIf"],[1,"row","m--n","p--n"],[1,"whitespace","whitespace--medium"],[1,"heading--label"],["formControlName","musicOnHold",3,"optionList","customLabel"],["formControlName","estimatedWaitMessageEnabled",1,"form__checkbox__input"],[1,"form-group","col-12","p--n"],["formControlName","estimatedWaitMessageRepetitionEnabled",1,"form__checkbox__input",3,"ngModelChange"],["class","form-group col-12 p--n",4,"ngIf"],["formControlName","estimatedWaitMessageRepetitionPeriod",3,"optionList"]],template:function(i,n){i&1&&(m.\u0275\u0275elementStart(0,"div",0)(1,"div",1),m.\u0275\u0275template(2,Oi,8,8,"form",2),m.\u0275\u0275elementEnd()()),i&2&&(m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",n.callFlowWelcomeMessageForm))}
1,dependencies:[Rt.NgIf,A.\u0275NgNoValidate,A.NgControlStatus,A.NgControlStatusGroup,A.FormGroupDirective,A.FormControlName,Y,z,we.TranslatePipe],encapsulation:2})}}return o})();import"@angular/core";import{Validators as T}from"@angular/forms";var ne=(function(o){return o.REGULAR="REGULAR",o.SIMULTANEOUS="SIMULTANEOUS",o.CIRCULAR="CIRCULAR",o.UNIFORM="UNIFORM",o})(ne||{});var $=(function(o){return o.BUSY="BUSY",o.VOICEMAIL="VOICEMAIL",o.CALL_FORWARD="CALL_FORWARD",o})($||{});import"@ngxs/store";import{map as Ui}from"rxjs";import"@ngx-translate/core";import{provideNgxMask as Mi}from"ngx-mask";import*as s from"@angular/core";import*as Vt from"@ngxs/store";import*as I from"@angular/forms";import*as _e from"@ngx-translate/core";import*as Pt from"@angular/common";var Gi=f.SaveConfiguration,Li=()=>({maskValue:"0*",dropSpecialCharacters:!0});function Di(o,l){o&1&&(s.\u0275\u0275elementStart(0,"div",4),s.\u0275\u0275element(1,"tg-form-input",19),s.\u0275\u0275elementEnd()),o&2&&(s.\u0275\u0275advance(),s.\u0275\u0275property("showPlaceHolder",!1))}function Ri(o,l){if(o&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",15)(1,"div",4),s.\u0275\u0275element(2,"tg-form-dropdown-single-select",16),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(3,"div",4)(4,"div",9)(5,"label"),s.\u0275\u0275text(6),s.\u0275\u0275pipe(7,"translate"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275elementStart(8,"tg-form-radio-default",17),s.\u0275\u0275listener("ngModelChange",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext(2);return s.\u0275\u0275resetView(n.setOverFlowDestination())}),s.\u0275\u0275elementEnd()(),s.\u0275\u0275template(9,Di,2,1,"div",18),s.\u0275\u0275elementEnd()}if(o&2){let e=s.\u0275\u0275nextContext(2);s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.timeOptions)("customLabel",!0),s.\u0275\u0275advance(4),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(7,5,"ng."+e.messageGroup+".overflow-destination.lbl")," "),s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.overflowDestinationOptions),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.overflowDestinationCallForward)}}function ki(o,l){if(o&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"form",3)(1,"div",4),s.\u0275\u0275element(2,"tg-form-input",5),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(3,"div",6),s.\u0275\u0275element(4,"tg-form-dropdown-single-select",7),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(5,"div",4),s.\u0275\u0275element(6,"tg-form-input",8),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(7,"div",4)(8,"div",9)(9,"label"),s.\u0275\u0275text(10),s.\u0275\u0275pipe(11,"translate"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275element(12,"tg-form-radio-default",10),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(13,"div",4)(14,"div",9)(15,"label"),s.\u0275\u0275text(16),s.\u0275\u0275pipe(17,"translate"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275element(18,"tg-form-radio-default",11),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(19,"div",4),s.\u0275\u0275element(20,"tg-form-dropdown-single-select",12),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(21,"div",4)(22,"tg-form-input-checkbox",13),s.\u0275\u0275listener("change",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.setOverflowEnabled())}),s.\u0275\u0275elementEnd()(),s.\u0275\u0275template(23,Ri,10,7,"div",14),s.\u0275\u0275elementEnd()}if(o&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275property("formGroup",e.callFlowConfigurationForm),s.\u0275\u0275advance(2),s.\u0275\u0275property("showPlaceHolder",!1)("required",!0),s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.phoneNumberOptions)("showPlaceHolder",!1)("customLabel",!0)("required",!1)("messageGroup",e.messageGroup),s.\u0275\u0275advance(2),s.\u0275\u0275property("mask",s.\u0275\u0275pureFunction0(22,Li))("showPlaceHolder",!1)("required",!0),s.\u0275\u0275advance(4),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(11,18,"ng."+e.messageGroup+".language.lbl")," "),s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.languageOptions),s.\u0275\u0275advance(4),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(17,20,"ng."+e.messageGroup+".hunt-policy.lbl")," "),s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.huntPolicyOptions),s.\u0275\u0275advance(2),s.\u0275\u0275property("optionList",e.timeOptions)("customLabel",!0),s.\u0275\u0275advance(3),s.\u0275\u0275property("ngIf",e.overflowEnabled)}}var Bt=(()=>{class o extends M{constructor(e,i,n,c,h,W){super(e),this.store=e,this.formBuilder=i,this.messageService=n,this.numberService=c,this.translateService=h,this.languageService=W,this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.phoneNumberOptions=[],this.overflowEnabled=!1,this.overflowDestinationCallForward=!1,this.OVERFLOW_ENABLED="overflowEnabled",this.OVERFLOW_DESTINATION="overflowDestination",this.OVERFLOW_TIMEOUT="overflowTimeout",this.OVERFLOW_NUMBER="overflowNumber"}ngOnInit(){this.selectedCallFlowDetails=this.store.selectSnapshot(v.callFLow);let e=this.store.selectSnapshot(v.addressId);this.obs(this.fetchNumbers(e)).subscribe(i=>{this.initializeAndPopulateForm(),this.initPhoneNumberOptions(i)})}setOverflowEnabled(){this.overflowEnabled=this.callFlowConfigurationForm.get(this.OVERFLOW_ENABLED).value,this.setOverFLowTimeoutAndDestinationDefault(),this.addOverFlowTimeOutAndDestinationValidations()}setOverFlowDestination(){this.overflowDestinationCallForward=this.callFlowConfigurationForm.get(this.OVERFLOW_DESTINATION).value===$.CALL_FORWARD,this.setOverFlowNumberDefault(),this.addValidationToOverFlowNumber()}isDataValid(){return this.messageService.clearMessages(this.messageGroup),this.callFlowConfigurationForm.valid?!0:(this.triggerFormValidation(this.callFlowConfigurationForm),!1)}storeData(){this.store.dispatch(new Gi(this.callFlowConfigurationForm.value))}initializeAndPopulateForm(){this.callFlowConfigurationForm=this.formBuilder.group({name:[this.selectedCallFlowDetails?.name,[T.required,T.maxLength(g.USER_NAME_MAX_LENGTH)]],phoneNumber:[this.selectedCallFlowDetails?.phoneNumber],extension:[this.selectedCallFlowDetails?.extension,[T.required,T.pattern(g.EXTENSION_REGEX)]],language:[this.selectedCallFlowDetails?.language??this.get
1SelectedLanguage(),[T.required]],huntPolicy:[this.selectedCallFlowDetails?.huntPolicy??ne.REGULAR,[T.required]],agentRingTime:[this.selectedCallFlowDetails?.agentRingTime,[T.required]],overflowEnabled:[this.selectedCallFlowDetails?.overflowEnabled??!0],overflowTimeout:[this.selectedCallFlowDetails?.overflowTimeout??null],overflowDestination:[this.selectedCallFlowDetails?.overflowDestination??$.BUSY],overflowNumber:[this.selectedCallFlowDetails?.overflowNumber]}),this.setOverflowEnabled(),this.setOverFlowDestination(),this.initOtherOptions()}initOtherOptions(){this.languageOptions=this.getLanguageOptions(),this.huntPolicyOptions=this.getHuntPolicyOptions(),this.timeOptions=this.getTimeOptions(),this.overflowDestinationOptions=this.getOverflowDestinationOptions()}getOverflowDestinationOptions(){return Object.keys($).map(e=>new E().withValue($[e]).withLabel(e.toLowerCase()))}getTimeOptions(){let e=[...Array(20).keys()].map(i=>(i+1)*6);return Object.keys(e).map((i,n)=>new E().withValue(e[i]).withLabel(`${n+1}`))}getHuntPolicyOptions(){return Object.keys(ne).map(e=>new E().withValue(ne[e]).withLabel(e.toLowerCase()))}getLanguageOptions(){return Object.keys(ye).map(e=>new E(e,ye[e],!1))}initPhoneNumberOptions(e){let i=this.getPhoneNumbersWithoutDuplicates(e);this.phoneNumberOptions=i.map(n=>new E(n,n)),this.phoneNumberOptions.length?this.addFirstDefaultOption(this.phoneNumberOptions,`ng.${this.messageGroup}.no-phone-number-selected`):this.addFirstDefaultOption(this.phoneNumberOptions,`ng.${this.messageGroup}.no-phone-number-available`)}getPhoneNumbersWithoutDuplicates(e){let i=e.map(c=>c.phoneNumber),n=this.selectedCallFlowDetails.phoneNumber;return y(n)?[...i]:this.addExistingPhoneNumber(i,n)}addExistingPhoneNumber(e,i){return e.push(i),[...new Set(e)]}addFirstDefaultOption(e,i){e?.unshift(new E().withValue("").withLabel(this.getTranslation(i)))}setOverFLowTimeoutAndDestinationDefault(){this.overflowEnabled||(this.callFlowConfigurationForm.get(this.OVERFLOW_TIMEOUT).setValue(null),this.callFlowConfigurationForm.get(this.OVERFLOW_DESTINATION).setValue($.BUSY))}setOverFlowNumberDefault(){this.overflowDestinationCallForward||this.callFlowConfigurationForm.get(this.OVERFLOW_NUMBER).setValue("")}addOverFlowTimeOutAndDestinationValidations(){this.callFlowConfigurationForm.get(this.OVERFLOW_TIMEOUT).setValidators(this.overflowEnabled?[T.required]:[]),this.callFlowConfigurationForm.controls.overflowTimeout.updateValueAndValidity(),this.callFlowConfigurationForm.get(this.OVERFLOW_DESTINATION).setValidators(this.overflowEnabled?[T.required]:[]),this.callFlowConfigurationForm.controls.overflowDestination.updateValueAndValidity()}addValidationToOverFlowNumber(){this.callFlowConfigurationForm.get(this.OVERFLOW_NUMBER).setValidators(this.overflowDestinationCallForward?[T.required,T.minLength(g.PHONE_NUMBER_MIN_LENGTH),T.maxLength(g.PHONE_NUMBER_MAX_LENGTH),T.pattern(g.PHONE_REGEX)]:[]),this.callFlowConfigurationForm.controls.overflowNumber.updateValueAndValidity()}fetchNumbers(e){let i={assignableFor:ht.CALL_FLOWS};return this.numberService.getNumbers(g.MESSAGE_GROUP,e,g.sortByPhoneNumberPageRequest,i).pipe(Ui(n=>n.content))}getSelectedLanguage(){return this.languageService.getLanguage().toUpperCase()}getTranslation(e){return this.translateService.instant(e)}static{this.\u0275fac=function(i){return new(i||o)(s.\u0275\u0275directiveInject(Vt.Store),s.\u0275\u0275directiveInject(I.FormBuilder),s.\u0275\u0275directiveInject(x),s.\u0275\u0275directiveInject(He),s.\u0275\u0275directiveInject(_e.TranslateService),s.\u0275\u0275directiveInject(Ue))}}static{this.\u0275cmp=s.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flow-configuration"]],standalone:!1,features:[s.\u0275\u0275ProvidersFeature([Mi()]),s.\u0275\u0275InheritDefinitionFeature],decls:3,vars:1,consts:[[1,"row","m--n","py--m"],[1,"col-12","col-md-7","p--n"],["class","editForm row m--n p--n",3,"formGroup",4,"ngIf"],[1,"editForm","row","m--n","p--n",3,"formGroup"],[1,"form-group","col-12","p--n"],["appSanitizeInput","","formControlName","name","labelStyle","FormGroup__label",3,"showPlaceHolder","required"],[1,"form-group","col-12","mt--s","p--n"],["formControlName","phoneNumber",1,"mb--s",3,"optionList","showPlaceHolder","customLabel","required","messageGroup"],["appSanitizeInput","","formControlName","extension","labelStyle","FormGroup__label",3,"mask","showPlaceHolder","required"],[1,"labelStyle"],["customLabel","true","formControlName","language",3,"optionList"],["customLabel","true","formControlName","huntPolicy",3,"optionList"],["formControlName","agentRingTime",3,"optionList","customLabel"],["formControlName","overflowEnabled",1,"form__checkbox__input",3,"change"],["class","col-12 p--n",4,"ngIf"],[1,"col-12","p--n"],["formControlName","overflowTimeout",3,"optionList","customLabel"],["customLabel","true","formControlName","overflowDestination",3,"ngModelChange","optionList"],["class","form-group col-12 p--n",4,"ngIf"],["appSanitizeInput","","labelStyle","FormGroup__label","formControlName","overflowNumber",3,"showPlaceHolder"]],template:function(i,n){i&1&&(s.\u0275\u0275elementStart(0,"div",0)(1,"div",1),s.\u0275\u0275template(2,ki,24,23,"form",2),s.\u0275\u0275elementEnd()()),i&2&&(s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",n.callFlowConfigurationForm))},dependencies:[Pt.NgIf,I.\u0275NgNoValidate,I.NgControlStatus,I.NgControlStatusGroup,I.RequiredValidator,I.FormGroupDirective,I.FormControlName,it,J,le,Y,z,Q,_e.TranslatePipe],encapsulation:2})}}return o}
1)();import"@angular/core";import{Validators as Vi}from"@angular/forms";import"@ngxs/store";import{iif as Pi,map as Wt,mergeMap as Bi,of as Wi,take as ji,tap as Hi}from"rxjs";import*as p from"@angular/core";import*as U from"@angular/forms";import*as jt from"@ngxs/store";import*as Ht from"@angular/common";import*as $t from"@ngx-translate/core";var $i=f.SaveType,qi=f.SetConfiguredUsers;function Qi(o,l){if(o&1&&(p.\u0275\u0275elementStart(0,"div",7)(1,"span",8),p.\u0275\u0275text(2),p.\u0275\u0275pipe(3,"translate"),p.\u0275\u0275elementEnd()()),o&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275textInterpolate(p.\u0275\u0275pipeBind1(3,1,"ng."+e.messageGroup+".no-configured-users-error"))}}function zi(o,l){if(o&1&&(p.\u0275\u0275elementStart(0,"div",7)(1,"span",8),p.\u0275\u0275text(2),p.\u0275\u0275pipe(3,"translate"),p.\u0275\u0275elementEnd()()),o&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275textInterpolate(p.\u0275\u0275pipeBind1(3,1,"ng."+e.messageGroup+".call-queue-existing-error"))}}function Yi(o,l){if(o&1&&(p.\u0275\u0275elementStart(0,"div",7)(1,"span",8),p.\u0275\u0275text(2),p.\u0275\u0275pipe(3,"translate"),p.\u0275\u0275elementEnd()()),o&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275textInterpolate(p.\u0275\u0275pipeBind1(3,1,"ng."+e.messageGroup+".hunt-group-existing-error"))}}function Ji(o,l){if(o&1&&(p.\u0275\u0275elementStart(0,"form",3),p.\u0275\u0275template(1,Qi,4,3,"div",4)(2,zi,4,3,"div",4)(3,Yi,4,3,"div",4),p.\u0275\u0275elementStart(4,"div",5),p.\u0275\u0275element(5,"tg-form-radio-default",6),p.\u0275\u0275elementEnd()()),o&2){let e=p.\u0275\u0275nextContext();p.\u0275\u0275property("formGroup",e.callFlowTypeForm),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",!e.hasAnyConfiguredUser),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.isCallQueueCreationNotAllowed()),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.isHuntGroupCreationNotAllowed()),p.\u0275\u0275advance(2),p.\u0275\u0275property("optionList",e.callFlowTypeOptions)}}var qt=(()=>{class o extends M{constructor(e,i,n,c){super(c),this.formBuilder=e,this.callFlowService=i,this.userService=n,this.store=c,this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.isCallQueueExisting=!1,this.isMaxAmountOfHuntGroupsReached=!1,this.hasAnyConfiguredUser=!0}ngOnInit(){this.selectedCallFlowDetails=this.store.selectSnapshot(v.callFLow);let e=this.store.selectSnapshot(v.addressId);this.obs(this.getConfiguredUsersFromStore().pipe(this.preventInfiniteLoading(),this.fetchConfiguredUsersIfNotInStore(e))).subscribe(i=>{this.hasAnyConfiguredUser=i.some(n=>!y(n?.firstName))}),this.obs(this.fetchCallFlows(e)).subscribe(i=>{this.setMaxedAmountOfHuntGroupReached(i),this.setCallQueueExisting(i),this.initializeAndPopulateForm()})}setCallQueueExisting(e){this.isCallQueueExisting=e.some(i=>i.type===N.QUEUE)}setMaxedAmountOfHuntGroupReached(e){this.isMaxAmountOfHuntGroupsReached=e.filter(i=>i.type===N.HUNT_GROUP)?.length>=g.MAX_HUNT_GROUPS}getConfiguredUsersFromStore(){return this.store.select(v.configuredUsers)}fetchConfiguredUsersIfNotInStore(e){return Bi(i=>Pi(()=>y(i),this.fetchConfiguredUsers(e),Wi(i)))}preventInfiniteLoading(){return ji(1)}isCallQueueCreationNotAllowed(){return this.isCallQueueExisting&&this.callFlowTypeForm.get("type").value===N.QUEUE}isHuntGroupCreationNotAllowed(){return this.isMaxAmountOfHuntGroupsReached&&this.callFlowTypeForm.get("type").value===N.HUNT_GROUP}storeData(){this.store.dispatch(new $i(this.callFlowTypeForm.value))}isDataValid(){return this.callFlowTypeForm.valid&&!this.checkCallFlowExisting()&&this.hasAnyConfiguredUser?!0:(this.triggerFormValidation(this.callFlowTypeForm),!1)}fetchCallFlows(e){return this.callFlowService.getCallFlows(this.messageGroup,e,g.sortByNamePageRequest).pipe(Wt(i=>i.content))}fetchConfiguredUsers(e){return this.userService.getUsers(pe.MESSAGE_GROUP,e,g.sortByFirstNamePageRequest,!1,{configured:!0}).pipe(Wt(i=>i.content),Hi(i=>this.store.dispatch(new qi(i))))}initializeAndPopulateForm(){this.callFlowTypeForm=this.formBuilder.group({type:[this.selectedCallFlowDetails?.type??"",[Vi.required]]}),this.initOptions()}
1checkCallFlowExisting(){let e=this.callFlowTypeForm.get("type").value;if(e===N.QUEUE)return this.isCallQueueExisting;if(e===N.HUNT_GROUP)return this.isMaxAmountOfHuntGroupsReached}initOptions(){this.callFlowTypeOptions=Object.keys(N).map(e=>new E().withValue(N[e]).withLabel(e.toLowerCase()))}static{this.\u0275fac=function(i){return new(i||o)(p.\u0275\u0275directiveInject(U.FormBuilder),p.\u0275\u0275directiveInject(B),p.\u0275\u0275directiveInject(ce),p.\u0275\u0275directiveInject(jt.Store))}}static{this.\u0275cmp=p.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flow-type"]],standalone:!1,features:[p.\u0275\u0275InheritDefinitionFeature],decls:3,vars:1,consts:[[1,"row","m--n","py--m"],[1,"col-12","col-md-7","p--n"],["class","editForm row m--n p--n",3,"formGroup",4,"ngIf"],[1,"editForm","row","m--n","p--n",3,"formGroup"],["class","notification notification--errorfield",4,"ngIf"],[1,"form-group","col-12","mt--s","p--n"],["formControlName","type",3,"optionList"],[1,"notification","notification--errorfield"],[1,"icon","icon-error-shape","errorfield"]],template:function(i,n){i&1&&(p.\u0275\u0275elementStart(0,"div",0)(1,"div",1),p.\u0275\u0275template(2,Ji,6,5,"form",2),p.\u0275\u0275elementEnd()()),i&2&&(p.\u0275\u0275advance(2),p.\u0275\u0275property("ngIf",n.callFlowTypeForm))},dependencies:[Ht.NgIf,U.\u0275NgNoValidate,U.NgControlStatus,U.NgControlStatusGroup,U.FormGroupDirective,U.FormControlName,J,$t.TranslatePipe],encapsulation:2})}}return o})();import"@angular/core";import"@ngxs/store";import{catchError as Xi,iif as Ki,map as Zi,of as Qt,tap as eo}from"rxjs";import*as w from"@angular/core";import*as zt from"@ngxs/store";var to=f.SaveSchedules,io=f.AfterSave,Yt=(()=>{class o extends M{constructor(e,i,n){super(e),this.store=e,this.callFlowService=i,this.messageService=n,this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP}ngOnInit(){this.selectedCallFlowDetails=this.store.selectSnapshot(v.callFLow),this.addressId=this.store.selectSnapshot(v.addressId),this.linkedScheduleDetails=this.getLinkedSchedule()}onSave(){if(!this.isDataValid())return Qt(!1);this.storeData();let e=this.store.selectSnapshot(v.callFLow),i=this.store.selectSnapshot(v.actionType),n=this.callFlowService.updateCallFlow(g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.addressId,e),c=this.callFlowService.createCallFlow(g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP,this.addressId,e);return Ki(()=>i===Z.CREATE_TYPE,c,n).pipe(eo(()=>this.store.dispatch(new io)),Zi(()=>!0),Xi(()=>Qt(!1)))}isDataValid(){return this.messageService.clearMessages(this.messageGroup),this.linkingScheduleComponent.isFormValid()?!0:(this.linkingScheduleComponent.triggerFormValidation(),!1)}storeData(){let e=this.linkingScheduleComponent.getLinkingScheduleFormValue();this.store.dispatch(new to(e))}getLinkedSchedule(){return{holidayScheduleId:this.selectedCallFlowDetails?.holidayScheduleId,holidayForwardNumber:this.selectedCallFlowDetails?.holidayScheduleForwardNumber,openingHoursScheduleId:this.selectedCallFlowDetails?.openingHoursScheduleId,closedForwardNumber:this.selectedCallFlowDetails?.outsideOpeningHoursForwardNumber}}static{this.\u0275fac=function(i){return new(i||o)(w.\u0275\u0275directiveInject(zt.Store),w.\u0275\u0275directiveInject(B),w.\u0275\u0275directiveInject(x))}}static{this.\u0275cmp=w.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flow-schedule"]],viewQuery:function(i,n){if(i&1&&w.\u0275\u0275viewQuery(fe,5),i&2){let c;w.\u0275\u0275queryRefresh(c=w.\u0275\u0275loadQuery())&&(n.linkingScheduleComponent=c.first)}},standalone:!1,features:[w.\u0275\u0275InheritDefinitionFeature],decls:3,vars:2,consts:[[1,"row","m--n","py--m"],[1,"col-12","col-md-7","p--n"],[3,"selectedScheduleDetails","addressId"]],template:function(i,n){i&1&&(w.\u0275\u0275elementStart(0,"div",0)(1,"div",1),w.\u0275\u0275element(2,"tg-linking-schedule",2),w.\u0275\u0275elementEnd()()),i&2&&(w.\u0275\u0275advance(2),w.\u0275\u0275property("selectedScheduleDetails",n.linkedScheduleDetails)("addressId",n.addressId))},dependencies:[fe],encapsulation:2})}}return o})();import*as Jt from"@angular/core";var Te=(()=>{class o{static stepsForEditCallFlow(){let e=[];return e.push(this.configurationStep()),e.push(this.usersStep()),e.push(this.welcomeMessageStep()),e.push(this.scheduleStep()),e}static stepsForAddCallFlow(){let e=[];return e.push(this.typeOfFlowStep()),e.push(this.configurationStep()),e.push(this.usersStep()),e.push(this.welcomeMessageStep()),e.push(this.scheduleStep()),e}static typeOfFlowStep(){return X.builder(H.TYPE).withTemplate(K).withComponent(qt).build()}
1static configurationStep(){return X.builder(H.CONFIGURATION).withTemplate(K).withComponent(Bt).build()}static usersStep(){return X.builder(H.USERS).withTemplate(K).withComponent(Ut).build()}static welcomeMessageStep(){return X.builder(H.WELCOMEMESSAGE).withTemplate(K).withComponent(kt).build()}static scheduleStep(){return X.builder(H.SCHEDULE).withTemplate(K).withComponent(Yt).withPreviousStepDisabled(!1).withFinalState().build()}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=Jt.\u0275\u0275defineInjectable({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();import{filter as so}from"rxjs";import*as u from"@angular/core";import*as Xt from"@ngxs/store";import*as Kt from"@ngx-translate/core";var ro=f.SetAddressId,no=f.SetCallFLow,ao=f.SetActionType,Zt=(()=>{class o extends q{constructor(e,i){super(),this.store=e,this.messageService=i,this.backActionEmitter=new oo,this.messageGroup=g.EDIT_ADD_CALL_FLOW_MESSAGE_GROUP}ngOnInit(){this.messageService.clearErrorMessages(this.messageGroup),this.store.dispatch(new ro(this.addressId)),this.store.dispatch(new no(this.selectedCallFlow));let e;this.selectedCallFlow?(e=Te.stepsForEditCallFlow(),this.actionType=Z.UPDATE_TYPE):(e=Te.stepsForAddCallFlow(),this.actionType=Z.CREATE_TYPE),this.store.dispatch(new ao(this.actionType)),this.store.dispatch(new De(e)),this.obs(this.store.select(v.isActionSaved).pipe(so(i=>i))).subscribe(()=>this.backActionEmitter.emit(this.actionType))}backToOverview(){this.backActionEmitter.emit()}static{this.\u0275fac=function(i){return new(i||o)(u.\u0275\u0275directiveInject(Xt.Store),u.\u0275\u0275directiveInject(x))}}static{this.\u0275cmp=u.\u0275\u0275defineComponent({type:o,selectors:[["app-upsert-call-flow"]],inputs:{addressId:"addressId",selectedCallFlow:"selectedCallFlow"},outputs:{backActionEmitter:"backActionEmitter"},standalone:!1,features:[u.\u0275\u0275InheritDefinitionFeature],decls:9,vars:7,consts:[[3,"messageGroupName"],[1,"text-align--left--md","py--s"],["href","JavaScript:void(0);",1,"link","link--chevron-left","text--m","mr-20",3,"click"],[1,"fpb-create-users"],[3,"messageGroup"]],template:function(i,n){i&1&&(u.\u0275\u0275element(0,"app-message",0),u.\u0275\u0275elementStart(1,"div",1)(2,"a",2),u.\u0275\u0275listener("click",function(){return n.backToOverview()}),u.\u0275\u0275text(3),u.\u0275\u0275pipe(4,"translate"),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(5,"div",3),u.\u0275\u0275element(6,"tg-fpb-step-flow-header",4)(7,"app-step-container",4)(8,"tg-fpb-step-flow-navigation",4),u.\u0275\u0275elementEnd()),i&2&&(u.\u0275\u0275property("messageGroupName",n.messageGroup),u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(4,5,"ng."+n.messageGroup+".lbl.back-to-overview")),u.\u0275\u0275advance(3),u.\u0275\u0275property("messageGroup",n.messageGroup),u.\u0275\u0275advance(),u.\u0275\u0275property("messageGroup",n.messageGroup),u.\u0275\u0275advance(),u.\u0275\u0275property("messageGroup",n.messageGroup))},dependencies:[vt,gt,Re,ae,Q,Kt.TranslatePipe],encapsulation:2})}}return o})();import{EventEmitter as po}from"@angular/core";import{filter as co,map as uo,switchMap as go}from"rxjs";import*as t from"@angular/core";import*as te from"@angular/common";import*as ei from"@ngx-translate/core";function fo(o,l){if(o&1&&(t.\u0275\u0275elementStart(0,"div",17)(1,"b",21),t.\u0275\u0275text(2),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(3,"b",22),t.\u0275\u0275text(4),t.\u0275\u0275elementEnd()()),o&2){let e=l.$implicit,i=l.index,n=t.\u0275\u0275nextContext(3);t.\u0275\u0275advance(),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.user.name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate1("",e.firstName+" "+e.lastName," "),t.\u0275\u0275advance(),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.user.index"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(i)}}function ho(o,l){if(o&1&&(t.\u0275\u0275elementStart(0,"div",17)(1,"div",17)(2,"label",18),t.\u0275\u0275text(3),t.\u0275\u0275pipe(4,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(5,"label",19),t.\u0275\u0275text(6),t.\u0275\u0275pipe(7,"translate"),t.\u0275\u0275elementEnd()(),t.\u0275\u0275template(8,fo,5,4,"div",20),t.\u0275\u0275elementEnd()),o&2){let e=t.\u0275\u0275nextContext().ngIf,i=t.\u0275\u0275nextContext();t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(4,3,"ng."+i.messageGroupName+".linked-user-name-label")),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(7,5,"ng."+i.messageGroupName+".prio-label")),t.\u0275\u0275advance(2),t.\u0275\u0275property("ngForOf",e.agentUsers)}}function vo(o,l){if(o&1&&(t.\u0275\u0275elementStart(0,"div",23),t.\u0275\u0275element(1,"app-fpb-audio-player",24),t.\u0275\u0275elementStart(2,"b",11),t.\u0275\u0275text(3),t.\u0275\u0275elementEnd()()),o&2){let e=l.async,i=t.\u0275\u0275nextContext().ngIf,n=t.\u0275\u0275nextContext();t.\u0275\u0275advance(),t.\u0275\u0275property("audioName",i.welcomeMessageFileName)("audio",e),t.\u0275\u0275advance(),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.welcome-message.file-name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(i.welcomeMessageFileName)}}function wo(o,l){if(o&1&&(t.\u0275\u0275elementStart(0,"div",23),t.\u0275\u0275element(1,"app-fpb-audio-player",24),t.\u0275\u0275elementStart(2,"b",11),t.\u0275\u0275text(3),t.\u0275\u0275elementEnd()()),o&2){let e=l.async,i=t.\u0275\u0275nextContext().ngIf,n=t.\u0275\u0275nextContext();t.\u0275\u0275advance(),t.\u0275\u0275property("audioName",i.musicOnHoldFileName)("audio",e),t.\u0275\u0275advance(),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.welcome-message.music-on-hold.file-name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(i.musicOnHoldFileName)}}function _o(o,l){if(o&1){let e=t.\u0275\u0275getCurrentView();t.\u0275\u0275elementStart(0,"div",27)(1,"div",28),t.\u0275\u0275listener("click",function(){let n=t.\u0275\u0275restoreView(e).ngIf,c=t.\u0275\u0275nextContext(3);
1return t.\u0275\u0275resetView(c.navigateToItem("schedules",n.uuid))}),t.\u0275\u0275elementStart(2,"label"),t.\u0275\u0275text(3),t.\u0275\u0275pipe(4,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(5,"br"),t.\u0275\u0275elementStart(6,"b",29),t.\u0275\u0275text(7),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(8,"div",30)(9,"label"),t.\u0275\u0275text(10),t.\u0275\u0275pipe(11,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(12,"br"),t.\u0275\u0275elementStart(13,"b",11),t.\u0275\u0275text(14),t.\u0275\u0275elementEnd()()()}if(o&2){let e=l.ngIf,i=t.\u0275\u0275nextContext(2).ngIf,n=t.\u0275\u0275nextContext();t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(4,6,"ng."+n.messageGroupName+".holiday-schedule")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.holiday-schedule.name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.name),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(11,8,"ng."+n.messageGroupName+".extension")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.holiday-schedule.forward-number"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(i.holidayScheduleForwardNumber)}}function So(o,l){if(o&1){let e=t.\u0275\u0275getCurrentView();t.\u0275\u0275elementStart(0,"div")(1,"div",31),t.\u0275\u0275listener("click",function(){let n=t.\u0275\u0275restoreView(e).ngIf,c=t.\u0275\u0275nextContext(3);return t.\u0275\u0275resetView(c.navigateToItem("schedules",n.uuid))}),t.\u0275\u0275elementStart(2,"label"),t.\u0275\u0275text(3),t.\u0275\u0275pipe(4,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(5,"br"),t.\u0275\u0275elementStart(6,"b",29),t.\u0275\u0275text(7),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(8,"div",10)(9,"label"),t.\u0275\u0275text(10),t.\u0275\u0275pipe(11,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(12,"br"),t.\u0275\u0275elementStart(13,"b",11),t.\u0275\u0275text(14),t.\u0275\u0275elementEnd()()()}if(o&2){let e=l.ngIf,i=t.\u0275\u0275nextContext(2).ngIf,n=t.\u0275\u0275nextContext();t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(4,6,"ng."+n.messageGroupName+".opening-hours-schedule")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.opening-hours-schedule.name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.name),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(11,8,"ng."+n.messageGroupName+".extension")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",n.messageGroupName+".b.call-flow.opening-hours-schedule.forward-number"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(i.outsideOpeningHoursForwardNumber)}}function Co(o,l){if(o&1&&(t.\u0275\u0275elementStart(0,"div",8)(1,"h4",25),t.\u0275\u0275text(2),t.\u0275\u0275pipe(3,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275template(4,_o,15,10,"div",26),t.\u0275\u0275pipe(5,"async"),t.\u0275\u0275template(6,So,15,10,"div",0),t.\u0275\u0275pipe(7,"async"),t.\u0275\u0275elementEnd()),o&2){let e=t.\u0275\u0275nextContext(2);t.\u0275\u0275advance(2),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(3,3,"ng."+e.messageGroupName+".title.call-flow-schedule")),t.\u0275\u0275advance(2),t.\u0275\u0275property("ngIf",t.\u0275\u0275pipeBind1(5,5,e.holiday$)),t.\u0275\u0275advance(2),t.\u0275\u0275property("ngIf",t.\u0275\u0275pipeBind1(7,7,e.openingHours$))}}function Fo(o,l){if(o&1){let e=t.\u0275\u0275getCurrentView();t.\u0275\u0275elementContainerStart(0),t.\u0275\u0275elementStart(1,"div",1)(2,"a",2),t.\u0275\u0275listener("click",function(){t.\u0275\u0275restoreView(e);let n=t.\u0275\u0275nextContext();return t.\u0275\u0275resetView(n.backToOverview())}),t.\u0275\u0275text(3),t.\u0275\u0275pipe(4,"translate"),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(5,"div",3)(6,"h3",4),t.\u0275\u0275text(7),t.\u0275\u0275pipe(8,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(9,"div",5)(10,"div")(11,"a",6),t.\u0275\u0275listener("click",function(){t.\u0275\u0275restoreView(e);let n=t.\u0275\u0275nextContext();
1return t.\u0275\u0275resetView(n.edit())}),t.\u0275\u0275text(12),t.\u0275\u0275pipe(13,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(14,"a",7),t.\u0275\u0275listener("click",function(){t.\u0275\u0275restoreView(e);let n=t.\u0275\u0275nextContext();return t.\u0275\u0275resetView(n.delete())}),t.\u0275\u0275text(15),t.\u0275\u0275pipe(16,"translate"),t.\u0275\u0275elementEnd()()()(),t.\u0275\u0275elementStart(17,"div",8)(18,"h4",9),t.\u0275\u0275text(19),t.\u0275\u0275pipe(20,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(21,"div",10)(22,"label"),t.\u0275\u0275text(23),t.\u0275\u0275pipe(24,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(25,"br"),t.\u0275\u0275elementStart(26,"b",11),t.\u0275\u0275text(27),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(28,"div",10)(29,"label"),t.\u0275\u0275text(30),t.\u0275\u0275pipe(31,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(32,"br"),t.\u0275\u0275elementStart(33,"b",11),t.\u0275\u0275text(34),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(35,"div",10)(36,"label"),t.\u0275\u0275text(37),t.\u0275\u0275pipe(38,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(39,"br"),t.\u0275\u0275elementStart(40,"b",11),t.\u0275\u0275text(41),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(42,"div",10)(43,"label"),t.\u0275\u0275text(44),t.\u0275\u0275pipe(45,"translate"),t.\u0275\u0275pipe(46,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(47,"br"),t.\u0275\u0275elementStart(48,"b",11),t.\u0275\u0275text(49),t.\u0275\u0275pipe(50,"translate"),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(51,"div",10)(52,"label"),t.\u0275\u0275text(53),t.\u0275\u0275pipe(54,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(55,"br"),t.\u0275\u0275elementStart(56,"b",11),t.\u0275\u0275text(57),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(58,"div",10)(59,"label"),t.\u0275\u0275text(60),t.\u0275\u0275pipe(61,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(62,"br"),t.\u0275\u0275elementStart(63,"b",11),t.\u0275\u0275text(64),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(65,"div",10)(66,"label"),t.\u0275\u0275text(67),t.\u0275\u0275pipe(68,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275element(69,"br"),t.\u0275\u0275elementStart(70,"b",11),t.\u0275\u0275text(71),t.\u0275\u0275pipe(72,"translate"),t.\u0275\u0275elementEnd()()(),t.\u0275\u0275elementStart(73,"div",12)(74,"h4",9),t.\u0275\u0275text(75),t.\u0275\u0275pipe(76,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275template(77,ho,9,7,"div",13),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(78,"div",8)(79,"h4",9),t.\u0275\u0275text(80),t.\u0275\u0275pipe(81,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275template(82,vo,4,4,"div",14)(83,wo,4,4,"div",15),t.\u0275\u0275elementEnd(),t.\u0275\u0275template(84,Co,8,9,"div",16),t.\u0275\u0275elementContainerEnd()}if(o&2){let e=l.ngIf,i=t.\u0275\u0275nextContext();t.\u0275\u0275advance(2),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".link.back-to-overview"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate1("",t.\u0275\u0275pipeBind1(4,38,"ng."+i.messageGroupName+".lbl.back-to-overview")," "),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".title.call-flow"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate2("",t.\u0275\u0275pipeBind1(8,40,"ng."+i.messageGroupName+".title.callFlow")," - ",e.name),t.\u0275\u0275advance(4),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".link.edit.call-flow"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(13,42,"ng."+i.messageGroupName+".link.edit.callFlow")),t.\u0275\u0275advance(2),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".link.delete.call-flow"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(16,44,"ng."+i.messageGroupName+".link.delete.callFlow")),t.\u0275\u0275advance(4),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(20,46,"ng."+i.messageGroupName+".heading.title.configuration")),t.\u0275\u0275advance(4),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(24,48,"ng."+i.messageGroupName+".lbl.name")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.name"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.name),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(31,50,"ng."+i.messageGroupName+".lbl.phoneNumber")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.phone-number"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.phoneNumber),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(38,52,"ng."+i.messageGroupName+".lbl.extension")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.extension"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.extension),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(46,56,t.\u0275\u0275pipeBind1(45,54,"ng."+i.messageGroupName+".lbl.huntPolicy"))),t.\u0275\u0275advance(4),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.hunt-policy"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(50,58,"ng."+i.messageGroupName+".lbl.hunt.policy."+e.huntPolicy.toLocaleLowerCase())),t.\u0275\u0275advance(4),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(54,60,"ng."+i.messageGroupName+".lbl.agentRingTime")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.agent-ring-time"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.agentRingTime),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(61,62,"ng."+i.messageGroupName+".lbl.overflowTimeout")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.overflow-timeout"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(e.overflowTimeout),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(68,64,"ng."+i.messageGroupName+".lbl.overflowDestination")),t.\u0275\u0275advance(3),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".b.call-flow.overflow-destination"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(72,66,"ng."+i.messageGroupName+".lbl.overflow.destination."+e.overflowDestination.toLocaleLowerCase())),t.\u0275\u0275advance(4),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(76,68,"ng."+i.messageGroupName+".heading.title.users")),t.\u0275\u0275advance(2),t.\u0275\u0275property("ngIf",e.agentUsers.length!==0),t.\u0275\u0275advance(2),t.\u0275\u0275attribute("data-cy",i.messageGroupName+".title.call-flow.welcome.message"),t.\u0275\u0275advance(),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(81,70,"ng."+i.messageGroupName+".heading.title.welcome.message")),t.\u0275\u0275advance(2),t.\u0275\u0275property("ngIf",i.welcomeMessageUrl$),t.\u0275\u0275advance(),t.\u0275\u0275property("ngIf",i.musicOnHoldUrl$),t.\u0275\u0275advance(),t.\u0275\u0275property("ngIf",e.holidayScheduleId||e.openingHoursScheduleId)}}var ti=(()=>{class o extends q{constructor(e,i,n,c){super(),this.callFlowService=e,this.audioFileService=i,this.scheduleService=n,this.navigationService=c,this.viewAction=new po}ngAfterViewInit(){this.callFlow$=this.callFlowService.getCallFlow(this.messageGroupName,this.addressId,this.callFlowId),this.welcomeMessageUrl$=this.getAudioFileUrl("welcomeMessageFileName"),this.musicOnHoldUrl$=this.getAudioFileUrl("musicOnHoldFileName"),this.openingHours$=this.getScheduleDetails("openingHoursScheduleId"),this.holiday$=this.getScheduleDetails("holidayScheduleId")}getAudioFileUrl(e){return this.callFlow$.pipe(uo(i=>this.audioFileService.getAudioFileURI(i[e],this.addressId,!0)))}getScheduleDetails(e){return this.callFlow$.pipe(co(i=>!!i[e]),go(i=>this.scheduleService.getScheduleDetails(this.messageGroupName,this.addressId,i[e])))}backToOverview(){this.viewAction.emit(P.HIDE)}edit(){this.viewAction.emit(P.EDIT)}delete(){this.viewAction.emit(P.DELETE)}navigateToItem(e,i){this.navigationService.navigateToItem(e,i)}static{this.\u0275fac=function(i){return new(i||o)(t.\u0275\u0275directiveInject(B),t.\u0275\u0275directiveInject(ge),t.\u0275\u0275directiveInject(je),t.\u0275\u0275directiveInject(de))}}static{this.\u0275cmp=t.\u0275\u0275defineComponent({type:o,selectors:[["app-call-flow-view"]],inputs:{messageGroupName:"messageGroupName",callFlowId:"callFlowId",addressId:"addressId"},outputs:{viewAction:"viewAction"},standalone:!1,features:[t.\u0275\u0275InheritDefinitionFeature],decls:2,vars:3,consts:[[4,"ngIf"],[1,"text-align--left--md","py--s"],["href","JavaScript:void(0);",1,"link","link--chevron-left","text--m","mr-20",3,"click"],[1,"row","m--n","p--n","display--flex","justify-content--end","align-items--center"],[1,"col-12","col-md-5"],[1,"text-align--right","col-12","col-md-7"],["href","JavaScript:void(0);",1,"link","text--m","mr--m",3,"click"],["href","JavaScript:void(0);",1,"link","text--m",3,"click"],[1,"background-white","p--m","mb--m","row"],[1,"col-12","heading--nomargin","pb--s"],[1,"col-3"],[1,"text--s"],[1,"background-white","p--m","col-12","mb--m","row"],["class","row m--n p--n width--full",4,"ngIf"],["class","col-12 mb--s",4,"ngIf"],["class","col-12 mb--s",4,"ngIf"],["class","background-white p--m mb--m row",4,"ngIf"],[1,"row","m--n","p--n","width--full"],[1,"col-3","mr--m--md","mr--xxs","word-break--ellipsis"],[1,"col-3","p--n"],["class","row m--n p--n width--full",4,"ngFor","ngForOf"],[1,"col-3","mr--m--md","mr--xxs","text--s","opacity--small-transparency","word-break--ellipsis"],[1,"col-1","p--n","opacity--small-transparency","text--s"],[1,"col-12","mb--s"],[1,"fl-left","mt--xs","mr--l","ml--m",3,"audioName","audio"],[1,"col-12"],["class","row width--full",4,"ngIf"],[1,"row","width--full"],[1,"col-6","cursor--pointer",3,"click"],[1,"text--s","link"],[1,"col-6`"],[1,"col-3","cursor--pointer",3,"click"]],template:function(i,n){i&1&&(t.\u0275\u0275template(0,Fo,85,72,"ng-container",0),t.\u0275\u0275pipe(1,"async")),i&2&&t.\u0275\u0275property("ngIf",t.\u0275\u0275pipeBind1(1,1,n.callFlow$))},dependencies:[te.NgForOf,te.NgIf,Ye,te.AsyncPipe,ei.TranslatePipe],encapsulation:2})}}return o}
1)();function xo(o,l){if(o&1){let e=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementStart(0,"div")(1,"tg-fpb-table",11),r.\u0275\u0275listener("amountOfSelectedEntriesEvent",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(3);return r.\u0275\u0275resetView(c.changePossibleActions(n))})("sortOrderEvent",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(2).ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.changeSortingOrder(n,c))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(2,"tg-fpb-pagination",12),r.\u0275\u0275listener("pageChangeEvent",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(2).ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.navigateToPage(n,c))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(3,"tg-fpb-sticky-action",13),r.\u0275\u0275listener("actionEvent",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(2).ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.handleAction(n,c))}),r.\u0275\u0275elementEnd()()}if(o&2){let e=r.\u0275\u0275nextContext(3);r.\u0275\u0275advance(),r.\u0275\u0275property("dataTable",e.dataTable)("messageGroup",e.messageGroupName)("isMultipleSelectionAllowed",!1),r.\u0275\u0275advance(),r.\u0275\u0275property("totalPages",e.pagedFlows.totalPages)("currentPageNumber",e.pagedFlows.pageNumber+1),r.\u0275\u0275advance(),r.\u0275\u0275property("actions",e.actions)("messageGroup",e.messageGroupName)}}function Io(o,l){if(o&1&&r.\u0275\u0275element(0,"tg-no-records-section",14),o&2){let e=r.\u0275\u0275nextContext(3);r.\u0275\u0275property("noSearchResultsUrl",e.noSearchResultsUrl)("noEntriesUrl",e.noCallFlowsUrl)("searchBy",e.searchBy)("messageGroup",e.messageGroupName)}}function No(o,l){if(o&1){let e=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275elementStart(1,"app-upsert-call-flow",15),r.\u0275\u0275listener("backActionEmitter",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(2).ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.backToOverview(n,c))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementContainerEnd()}if(o&2){let e=r.\u0275\u0275nextContext(2).ngIf,i=r.\u0275\u0275nextContext();r.\u0275\u0275advance(),r.\u0275\u0275property("addressId",e)("selectedCallFlow",i.selectedEntry)}}function To(o,l){if(o&1){let e=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275elementStart(1,"app-call-flow-view",16),r.\u0275\u0275listener("viewAction",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext(2).ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.viewAction(n,c))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementContainerEnd()}if(o&2){let e=r.\u0275\u0275nextContext(2).ngIf,i=r.\u0275\u0275nextContext();r.\u0275\u0275advance(),r.\u0275\u0275property("addressId",e)("callFlowId",i.viewCallFlowId)("messageGroupName",i.messageGroupName)}}function Oo(o,l){if(o&1){let e=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementStart(0,"div")(1,"app-get-started",4),r.\u0275\u0275listener("actionEmitter",function(){r.\u0275\u0275restoreView(e);let n=r.\u0275\u0275nextContext(2);return r.\u0275\u0275resetView(n.createCallFlow())}),r.\u0275\u0275elementStart(2,"div",5)(3,"div",6)(4,"tg-fpb-search",7),r.\u0275\u0275listener("suggestionEvent",function(n){r.\u0275\u0275restoreView(e);let c=r.\u0275\u0275nextContext().ngIf,h=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(h.updateSearchResults(n,c))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(5,"div",8)(6,"a",9),r.\u0275\u0275listener("click",function(){r.\u0275\u0275restoreView(e);let n=r.\u0275\u0275nextContext(2);return r.\u0275\u0275resetView(n.createCallFlow())}),r.\u0275\u0275text(7),r.\u0275\u0275pipe(8,"translate"),r.\u0275\u0275elementEnd()()(),r.\u0275\u0275template(9,xo,4,7,"div",10)(10,Io,1,4,"ng-template",null,0,r.\u0275\u0275templateRefExtractor),r.\u0275\u0275elementEnd(),r.\u0275\u0275template(12,No,2,2,"ng-container",3)(13,To,2,3,"ng-container",3),r.\u0275\u0275elementEnd()()}if(o&2){let e=r.\u0275\u0275reference(11),i=r.\u0275\u0275nextContext(2);r.\u0275\u0275advance(),r.\u0275\u0275property("messageGroup",i.messageGroupName)("showGetStartedContent",i.showGetStartedContent)("possibleActions",i.getStartedPossibleActions),r.\u0275\u0275advance(),r.\u0275\u0275property("hidden",i.currentSection!==i.callFlowEnum.TABLE_SECTION),r.\u0275\u0275advance(2),r.\u0275\u0275property("messageGroup",i.messageGroupName),r.\u0275\u0275advance(2),r.\u0275\u0275attribute("data-cy",i.messageGroupName+".link.create-call-flow"),r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate(r.\u0275\u0275pipeBind1(8,11,"ng.search-call-flows.create.label")),r.\u0275\u0275advance(2),r.\u0275\u0275property("ngIf",i.pagedFlows.content.length!==0)("ngIfElse",e),r.\u0275\u0275advance(3),r.\u0275\u0275property("ngIf",i.currentSection===i.callFlowEnum.UPSERT_SECTION),r.\u0275\u0275advance(),r.\u0275\u0275property("ngIf",i.currentSection===i.callFlowEnum.VIEW_SECTION)}}function Ao(o,l){if(o&1&&(r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275template(1,Oo,14,13,"div",3),r.\u0275\u0275elementContainerEnd()),o&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(),r.\u0275\u0275property("ngIf",e.isSubscriptionSmart&&e.pagedFlows)}}var ri=(()=>{class o extends q{constructor(e,i,n,c,h,W,be){super(),this.flowsService=e,this.messageService=i,this.productDetailsService=n,this.translateService=c,this.urlService=h,this.dialog=W,this.navigationService=be,this.messageGroupName=g.MESSAGE_GROUP,this.scopes=g.SCOPES,this.actions=[],this.pageNumber=g.DEFAULT_PAGE_NUMBER,this.sortOrder=We.ASC,this.sortBy=g.DEFAULT_SORT_BY,this.get
1StartedPossibleActions=[Be.CREATE],this.currentSection=L.TABLE_SECTION,this.callFlowEnum=L,this.shouldShowBanner=!0,this.isMigrationInProgress=!1}initAfterLoggedIn(){this.messageService.clearMessages(this.messageGroupName),this.obs(this.productDetailsService.getProductDetails().pipe(Oe(e=>!!e.addressId),Eo(e=>this.setAddressIdAndSubscription(e)),Oe(()=>this.isSubscriptionSmart),Ae(e=>this.getCallFlows(e.addressId)))).subscribe({next:e=>{this.processResults(e),this.showGetStartedContent=y(e.content)},error:()=>this.messageService.addMessage(this.createErrorMessage("general"))}),y(this.urlService.getHashParameter(ie.ITEM_ID))||this.loadViewPageFromUrl()}loadViewPageFromUrl(){this.viewCallFlowId=this.urlService.getHashParameter(ie.ITEM_ID),this.currentSection=L.VIEW_SECTION}updateSearchResults(e,i){this.messageService.clearMessages(this.messageGroupName),this.pageNumber=g.DEFAULT_PAGE_NUMBER,this.searchBy=e,this.loadCallFlows(i,!0)}navigateToPage(e,i){this.messageService.clearMessages(this.messageGroupName),this.pageNumber=e-1,this.loadCallFlows(i)}changePossibleActions(e){this.messageService.clearMessages(this.messageGroupName),this.actions=this.createPossibleActions(e)}changeSortingOrder(e,i){this.messageService.clearMessages(this.messageGroupName),this.sortOrder=e.sortOrder,this.sortBy=e.sortBy,this.loadCallFlows(i)}handleAction(e,i){switch(this.messageService.clearMessages(this.messageGroupName),e.key){case j.DELETE:this.deleteC
1allFlow(i);break;case j.EDIT:this.editCallFlow();break;case j.VIEW:this.viewCallFlow();break}}viewAction(e,i){switch(this.messageService.clearMessages(this.messageGroupName),e){case P.DELETE:this.deleteCallFlow(i);break;case P.EDIT:this.editCallFlow();break;case P.HIDE:this.currentSection=L.TABLE_SECTION,this.viewCallFlowId=null;break}}backToOverview(e,i){if(!y(this.urlService.getHashParameter(ie.ITEM_ID))){let n=new qe(ie.NAV_ITEM,"callFlows");this.navigationService.setNavigationParameters([n])}this.messageService.clearMessages(this.messageGroupName),this.currentSection=L.TABLE_SECTION,this.showGetStartedContent=!1,e&&(this.removeSelectedEntry(),this.messageService.addMessage(new Ee(this.messageGroupName,`${this.messageGroupName}.txt.${e}-call-flow`)),this.loadCallFlows(i))}createCallFlow(){this.showGetStartedContent=!1,this.messageService.clearMessages(this.messageGroupName),this.selectedEntry=null,this.currentSection=L.UPSERT_SECTION}setAddressIdAndSubscription(e){this.addressId$=yo(e.addressId),this.isSubscriptionSmart=e.isSubscriptionSmart,this.isSubscriptionSmart||this.messageService.addMessage(this.createErrorMessage("wrong-subscription-type"))}viewCallFlow(){this.viewCallFlowId=this.tableComponent.getFirstSelectedEntry().uuid,this.currentSection=L.VIEW_SECTION}editCallFlow(){this.selectedEntry=this.tableComponent.getFirstSelectedEntry(),this.currentSection=L.UPSERT_SECTION}removeSelectedEntry(){this.tableComponent?.isAnyEntrySelected()&&this.tableComponent.removeAllSelectedEntries()}createErrorMessage(e){return new Le(this.messageGroupName,`${this.messageGroupName}.${e}`)}showNoSearchResults(e){this.pagedFlows=e}populateDataTable(e){this.pagedFlows=this.translateCallFlows(e),this.dataTable={entryKey:"uuid",entryProperties:["name","phoneNumber","extension","agentUsersSize","typeName"],sortByProperties:["name"],entries:this.pagedFlows.content}}translateCallFlows(e){return V(k({},e),{content:e.content.map(i=>V(k({},i),{typeName:this.translateService.instant(`ng.${this.messageGroupName}.${i.typeName}`)}))})}getCallFlows(e,i=g.DEFAULT_PAGE_NUMBER,n="",c=!1){let h={pageNumber:i,pageSize:this.pageSize,filterBy:n,sortBy:this.sortBy,sortOrder:this.sortOrder};return this.flowsService.getCallFlows(g.MESSAGE_GROUP,e,h,c)}loadCallFlows(e,i=!1){this.obs(this.getCallFlows(e,this.pageNumber,this.searchBy,i)).subscribe(n=>this.processResults(n))}processResults(e){e.content.length!==0?this.populateDataTable(e):this.showNoSearchResults(e)}createPossibleActions(e){return e>0?[{key:j.VIEW,icon:"icon-eye"},{key:j.EDIT,icon:"icon-pencil"},{key:j.DELETE,icon:"icon-trash"}]:[]}deleteCallFlow(e){let i=this.dialog.open(Je,{data:{multipleEntries:!1,messageGroup:this.messageGroupName,prefix:".delete-call-flow"}});this.obs(i.afterClosed().pipe(Oe(n=>!!n),Ae(()=>this.flowsService.deleteCallFlow(this.messageGroupName,e,this.tableComponent.getFirstSelectedEntry().uuid)),Ae(()=>this.getCallFlows(e)))).subscribe(n=>{this.tableComponent.removeAllSelectedEntries(),this.messageService.addMessage(new Ee(this.messageGroupName,`${this.messageGroupName}.txt.delete`)),this.populateDataTable(n)})}static{this.\u0275fac=function(i){return new(i||o)(r.\u0275\u0275directiveInject(B),r.\u0275\u0275directiveInject(x),r.\u0275\u0275directiveInject($e),r.\u0275\u0275directiveInject(Se.TranslateService),r.\u0275\u0275directiveInject(Ge),r.\u0275\u0275directiveInject(ii.MatDialog),r.\u0275\u0275directiveInject(de))}}static{this.\u0275cmp=r.\u0275\u0275defineComponent({type:o,selectors:[["tg-call-flows"]],viewQuery:function(i,n){if(i&1&&r.\u0275\u0275viewQuery(ue,5),i&2){let c;r.\u0275\u0275queryRefresh(c=r.\u0275\u0275loadQuery())&&(n.tableComponent=c.first)}},inputs:{noCallFlowsUrl:"noCallFlowsUrl",noSearchResultsUrl:"noSearchResultsUrl",pageSize:"pageSize",amountOfSuggestions:"amountOfSuggestions",audioFilesPageUrl:"audioFilesPageUrl"},standalone:!1,features:[r.\u0275\u0275InheritDefinitionFeature],decls:6,vars:6,consts:[["noRecordsFound",""],[3,"componentCanRender","messageGroupName","scopes"],[3,"messageGroupName"],[4,"ngIf"],[3,"actionEmitter","messageGroup","showGetStartedContent","possibleActions"],[3,"hidden"],[1,"row","m--n","p--n","display--flex","justify-content--between","align-items--center"],[1,"col-12","col-md-6","mb--l--md","p--n",3,"suggestionEvent","messageGroup"],[1,"col-12","col-md-5","p--n","text-align--right"],["href","JavaScript:void(0);",1,"link","text--m",3,"click"],[4,"ngIf","ngIfElse"],[3,"amountOfSelectedEntriesEvent","sortOrderEvent","dataTable","messageGroup","isMultipleSelectionAllowed"],[3,"pageChangeEvent","totalPages","currentPageNumber"],[3,"actionEvent","actions","messageGroup"],[3,"noSearchResultsUrl","noEntriesUrl","searchBy","messageGroup"],[3,"backActionEmitter","addressId","selectedCallFlow"],[3,"viewAction","addressId","callFlowId","messageGroupName"]],template:function(i,n){i&1&&(r.\u0275\u0275elementStart(0,"tg-login",1),r.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),r.\u0275\u0275elementStart(1,"app-migration-banner"),r.\u0275\u0275text(2,' [showMigrationBanner]="shouldShowBanner" [migrationInProgress]="isMigrationInProgress" '),r.\u0275\u0275elementEnd(),r.\u0275\u0275element(3,"app-message-flow",2),r.\u0275\u0275template(4,Ao,2,1,"ng-container",3),r.\u0275\u0275pipe(5,"async"),r.\u0275\u0275elementEnd()),i&2&&(r.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.scopes),r.\u0275\u0275advance(3),r.\u0275\u0275property("messageGroupName",n.messageGroupName),r.\u0275\u0275advance(),r.\u0275\u0275property("ngIf",r.\u0275\u0275pipeBind1(5,4,n.addressId$)))},dependencies:[Ce.NgIf,oi.LoginComponent,Xe,ue,Ke,Ze,et,tt,Qe,se,Q,Zt,ti,Ce.AsyncPipe,Se.TranslatePipe],encapsulation:2})}}return o}
1)();import{provideStates as Lo}from"@ngxs/store";import{provideEnvironmentNgxMask as Do}from"ngx-mask";import*as Fe from"@angular/core";var Gl=(()=>{class o{static{this.components={"tg-call-flows":ri}}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275mod=Fe.\u0275\u0275defineNgModule({type:o})}static{this.\u0275inj=Fe.\u0275\u0275defineInjector({providers:[Do(),Lo([S])],imports:[Uo,Go,Pe,ot,at,rt,lt,st,Me,Mo,wt,ft,ke,Ve,_t,mt,ut,nt,pt,ze,se,ae,me,J,le,Y,z]})}}return o})();export{Gl as FpbCallFlowNcModule};
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.