1import{a as gn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-SE6NNOVT.js";import{a as Ee}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-I4MOKDPM.js";import{a as Me,b as Tt,c as mn,d as se}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-PJ54XVFT.js";import{a as _i}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-QMHLASMS.js";import{a as j}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-W3T7O6QI.js";import{a as un}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-2X4YODSA.js";import{a as pn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-O5XZRYLC.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-YN4QFCVV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-RN3DWXEX.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-JWHO7CT7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-FANBPF4F.js";import{a as Pi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-QLQYJFZH.js";import{a as Ai,b as cn,f as dn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-I7JKRBOI.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-XFFUT5HO.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ES2GOXLD.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-MEANCS2Z.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ZWVLFM33.js";import{a as qe}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-L5RR2V3K.js";import{a as K}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-M43TLWPF.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GI2BLEMG.js";import{h as Be}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BVF44KUV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UN4I5ARV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-II6HY24G.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-7KS57OA2.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-SNQA2H4L.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-2CVC5BBX.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VM6WTIWS.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-SRR7BYAK.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-RA6BOML4.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-XKZAHTSE.js";import{a as ln}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3E62RMRJ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-RUMO4SWU.js";import{a as ae}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-AGJCFL6D.js";import{j as sn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-X5RNINAL.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GM7QTX3Q.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3VE4T5X3.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WB5FSQCV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NA7KRUKM.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-W5YER7AF.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IGZIRJQN.js";import{f as xt,q as Z}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-JH7E5ALJ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VDTBCEHH.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GUJRV77H.js";import{a as Ue}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-OAFWGKHG.js";import{a as on}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-R6ATEHOJ.js";import{e as Oe}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TMQTKFW7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ME6OOKIW.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TZWBTES7.js";import{B as U,K as re,a as ze,f as wi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LXVF7CF2.js";import{a as rn,b as Ne,n as an}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-MXMRLGMX.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-VXK3FO45.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ASPNFSTE.js";import{a as J}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-OTH5IOCH.js";import{a as nn}from"/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{p as gi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GWKWBQ3P.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3KHHOKR7.js";import{a as We,b as Ke,c as en}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NJNVRHKN.js";import{m as tn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DKZN7K64.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BYG2IWSB.js";import{c as qt,h as Li,i as Xt,j as $,m as Oi,o as Ui,p as G,s as be,v as Ni,w as Qt,x as Zt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DKUNSAXA.js";import{A as W,B as Bi,C as Se,E as ne,F as Et,G as Mi,J as ke,e as $e,
1w as oe,y as Jt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LBCPBUBK.js";import{A as Fe,Aa as Le,C as X,E as ye,F as Ii,Ja as Wt,Ka as Kt,L as jt,O as Ht,P as Yt,Qa as zt,V as Q,aa as pe,ea as St,g as Ye,h as Ti,o as k,oa as yi,p as Vt,ua as $t,y as Y}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VLHNUVO3.js";import{e as w}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 Ei,b as xi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WXUJ2XVZ.js";import"@angular/core";import{CommonModule as ap}from"@angular/common";import{TranslateModule as sp}from"@ngx-translate/core";import"@angular/core";var R=(()=>{class i{static{this.MESSAGE_GROUP="mobile-barring"}static{this.CUSTOMER_BAR_ALL="bar-all-incoming-and-outgoing-calls-texting-and-mobile-data"}static{this.ROAMING_DATA_GUARD="roaming-data-guard"}static{this.STATUS_SUSPENDED="Suspended"}static{this.EVENT_NAME_SET_BARRING="barring settings changed"}static{this.EVENT_TYPE_CHANGE_MOBILE_SERVICE_SETTINGS="change-mobile-service-settings"}static{this.EVENT_TYPE_CHANGE_FIXED_SERVICE_SETTINGS="change-fixed-service-settings"}static{this.EVENT_ACTION_SET_BARRING="set barring"}static{this.EVENT_ATTRIBUTE_VALUE_ACTIVATED="activated"}static{this.EVENT_ATTRIBUTE_VALUE_DEACTIVATED="deactivated"}static{this.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP="mobile-barring-custom-message"}static{this.DEVICE_TYPE_MOBILE="mobile"}static{this.DEVICE_TYPE_FIXED_LINE="fixed"}static{this.QUERY_PARAM_MSISDN="msisdn"}static{this.MSISDN_DYNAMIC_KEY_INPUT="$$MSISDN$$"}static{this.STATUS_SUSPENDED_FROM_PRODUCTS_IDENTIFIER="SUSPENDED"}static{this.FIXED_LINE="FixedLine"}static{this.ITEM_DATA_ON="On"}static{this.ITEM_DATA_OFF="Off"}static{this.FRAUD_BARRINGS_MESSAGE="fraud barrings message showed"}static{this.VIEW_NOTIFICATION="view-notification"}}return i})();import"@telenet/ng-lib-ocapi";import{finalize as In}from"rxjs";import"@angular/core";import{BehaviorSubject as dr}from"rxjs";import*as _n from"@angular/core";var Di=(()=>{class i{constructor(){this.stickyDisplay=new dr(!1)}setStickyDisplay(e){this.stickyDisplay.next(e)}getStickyDisplay(){return this.stickyDisplay}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=_n.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import{EventCategoryEnum as yn}from"@telenet/ng-lib-datalayer";import"@angular/core";import"@ngx-translate/core";import*as Ri from"@angular/core";import*as hn from"@ngx-translate/core";var Fi=(()=>{class i{constructor(e){this.translateService=e}getTranslationsAndGroupByCategory(e){let t=e.barringSettings.map(n=>this.getUpdatedSettingWithLocalizedLabels(n));return Ht(jt(Le(t,"barringOrder"),"barringGroup"))}getTranslatedLabel(e){return this.translateService.instant("ng.barrings.lbl.".concat(this.normalizeKey(e)))}getUpdatedSettingWithLocalizedLabels(e){return xi(Ei({},e),{nameLocalized:this.getTranslatedLabel(e.name),barringGroupLocalized:this.getTranslatedLabel(e.barringGroup),name:this.normalizeKey(e.name)})}normalizeKey(e){if(!w(e))return e.replace(/\(.+/g,"$'").trim().replace(/ /g,"-").replace(/\./g,"-").replace(/[^0-9a-zA-Z_-]/g,"").replace(/\-$/,"").toLowerCase()}static{this.\u0275fac=function(t){return new(t||i)(Ri.\u0275\u0275inject(hn.TranslateService))}}static{this.\u0275prov=Ri.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import*as c from"@angular/core";import*as Gi from"@telenet/ng-lib-ocapi";import*as Ln from"@telenet/ng-lib-datalayer";import*as Vi from"@angular/common";import{EventEmitter as mr}from"@angular/core";import*as A from"@angular/core";import*as ki from"@angular/common";
1import*as Cn from"@ngx-translate/core";function pr(i,r){if(i&1){let e=A.\u0275\u0275getCurrentView();A.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3),A.\u0275\u0275element(3,"div",4),A.\u0275\u0275elementStart(4,"div",5)(5,"button",6),A.\u0275\u0275listener("click",function(){A.\u0275\u0275restoreView(e);let n=A.\u0275\u0275nextContext();return A.\u0275\u0275resetView(n.submit())}),A.\u0275\u0275elementStart(6,"span"),A.\u0275\u0275text(7),A.\u0275\u0275pipe(8,"translate"),A.\u0275\u0275elementEnd()()()()()()}if(i&2){let e=A.\u0275\u0275nextContext();A.\u0275\u0275advance(5),A.\u0275\u0275property("disabled",e.disable),A.\u0275\u0275advance(2),A.\u0275\u0275textInterpolate(A.\u0275\u0275pipeBind1(8,2,"ng.barrings.btn.save"))}}var bn=(()=>{class i extends G{constructor(e){super(),this.barringSharedService=e,this.submitBarringSettings=new mr}ngOnInit(){this.isStickyDisplay$=this.barringSharedService.getStickyDisplay()}submit(){this.disable||this.submitBarringSettings.emit()}static{this.\u0275fac=function(t){return new(t||i)(A.\u0275\u0275directiveInject(Di))}}static{this.\u0275cmp=A.\u0275\u0275defineComponent({type:i,selectors:[["app-save-button"]],inputs:{isMaster:"isMaster",disable:"disable"},outputs:{submitBarringSettings:"submitBarringSettings"},standalone:!1,features:[A.\u0275\u0275InheritDefinitionFeature],decls:2,vars:3,consts:[["class","sticky-section",4,"ngIf"],[1,"sticky-section"],[1,"sticky-footer-v2","position--fixed","background-white","width--full","py--m","px--xm","p--xm--md","display--flex","justify-content--center","align-items--center","box-sizing--inherit","shadow--xs-inverse","position--bottom","position--left"],[1,"sticky-footer-v2__container","width--full","default-max-site-width","display--flex","justify-content--between","align-items--center"],[1,"back-section","visibility--hide-only"],[1,"next-section"],["type","submit",1,"button","button--primary",3,"click","disabled"]],template:function(t,n){t&1&&(A.\u0275\u0275template(0,pr,9,4,"div",0),A.\u0275\u0275pipe(1,"async")),t&2&&A.\u0275\u0275property("ngIf",A.\u0275\u0275pipeBind1(1,1,n.isStickyDisplay$))},dependencies:[ki.NgIf,ki.AsyncPipe,Cn.TranslatePipe],encapsulation:2})}}return i})();import{EventEmitter as Sn}from"@angular/core";import*as O from"@angular/core";import*as Xe from"@angular/common";import*as En from"@telenet/ng-lib-ocapi";import*as xn from"@ngx-translate/core";var gr=i=>({"content-section__details--disabled":i}),_r=(i,r,e)=>({"cursor--default":i,"label--large":r,"label--large--disabled":e});function fr(i,r){i&1&&(O.\u0275\u0275elementStart(0,"div",12)(1,"span",13),O.\u0275\u0275text(2),O.\u0275\u0275pipe(3,"translate"),O.\u0275\u0275elementEnd()()),i&2&&(O.\u0275\u0275advance(2),O.\u0275\u0275textInterpolate(O.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.disabled-fixed-barring")))}function hr(i,r){if(i&1){let e=O.\u0275\u0275getCurrentView();O.\u0275\u0275elementStart(0,"div",14)(1,"div",15)(2,"div",16)(3,"input",17),O.\u0275\u0275listener("change",function(){let n=O.\u0275\u0275restoreView(e).$implicit,o=O.\u0275\u0275nextContext();return O.\u0275\u0275resetView(o.onChangeBarringSetting(n))}),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(4,"label",18),O.\u0275\u0275text(5,"\xA0 "),O.\u0275\u0275elementEnd()(),O.\u0275\u0275element(6,"label",19),O.\u0275\u0275elementEnd()()}if(i&2){let e=r.$implicit,t=O.\u0275\u0275nextContext();O.\u0275\u0275advance(3),O.\u0275\u0275property("id",O.\u0275\u0275interpolate1("radio-group-id-",e.id))("checked",e.isbarred)("disabled",!t.hasNoFraudBarring),O.\u0275\u0275advance(),O.\u0275\u0275property("for",O.\u0275\u0275interpolate1("radio-group-id-",e.id)),O.\u0275\u0275advance(2),O.\u0275\u0275property("for",O.\u0275\u0275interpolate1("radio-group-id-",e.id))("innerHtml",t.getTranslatedLabel(e.name),O.\u0275\u0275sanitizeHtml)("ngClass",O.\u0275\u0275pureFunction3(10,_r,!t.hasNoFraudBarring,!(!t.hasNoFraudBarring&&e.isbarred),!t.hasNoFraudBarring&&e.isbarred))}}function vr(i,r){if(i&1){let e=O.\u0275\u0275getCurrentView();O.\u0275\u0275elementStart(0,"div",20)(1,"button",21),O.\u0275\u0275listener("click",function(){O.\u0275\u0275restoreView(e);let n=O.\u0275\u0275nextContext();
1return O.\u0275\u0275resetView(n.submit())}),O.\u0275\u0275text(2),O.\u0275\u0275pipe(3,"translate"),O.\u0275\u0275elementEnd()()}i&2&&(O.\u0275\u0275advance(2),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(3,1,"ng.barrings.btn.save")," "))}var Tn=(()=>{class i extends G{constructor(e,t,n){super(),this.barringsHelper=e,this.messageService=t,this.cdRef=n,this.submitBarringSettings=new Sn,this.createFraudBarringsAnalyticsDataLayer=new Sn,this.hasNoFraudBarring=!0,this.messageGroupName=R.MESSAGE_GROUP,this.requiredScopes=["fixedphonerestriction"],this.hasChangedBarrings=!1}ngOnInit(){this.init()}ngOnChanges(e){e.barringSettings.currentValue!==e.barringSettings.previousValue&&this.init()}init(){let e=X(this.barringSettings,["fraudManagerSet",!0]);e&&this.createFraudBarringsAnalyticsDataLayer.emit(),this.hasNoFraudBarring=pe(e),this.hasNoFraudBarring&&(this.defaultEnabledBarring=X(this.barringSettings,["isbarred",!0]))}onChangeBarringSetting(e){this.messageService.clearMessages(R.MESSAGE_GROUP),e.isbarred=!e.isbarred,e.hasChanged=!0,this.defaultEnabledBarring?this.hasChangedBarrings=!1:this.hasChangedBarrings=!0,this.updateFixedBarrings(e),this.cdRef.detectChanges()}updateFixedBarrings(e){if(Y(this.barringSettings,t=>{t.id!==e.id&&(t.isbarred=!1,t.hasChanged=!1)}),e.id===this.defaultEnabledBarring.id)e.hasChanged=!1,this.hasChangedBarrings=!1;else{let t=X(this.barringSettings,["id",this.defaultEnabledBarring.id]);t.hasChanged=!0,this.hasChangedBarrings=!0}}submit(){this.submitBarringSettings.emit()}getTranslatedLabel(e){return this.barringsHelper.getTranslatedLabel(e)}static{this.\u0275fac=function(t){return new(t||i)(O.\u0275\u0275directiveInject(Fi),O.\u0275\u0275directiveInject(W),O.\u0275\u0275directiveInject(O.ChangeDetectorRef))}}static{this.\u0275cmp=O.\u0275\u0275defineComponent({type:i,selectors:[["app-fixed-telephone-barrings"]],inputs:{barringSettings:"barringSettings",isConfirmationMsgToBeShown:"isConfirmationMsgToBeShown"},outputs:{submitBarringSettings:"submitBarringSettings",createFraudBarringsAnalyticsDataLayer:"createFraudBarringsAnalyticsDataLayer"},standalone:!1,features:[O.\u0275\u0275InheritDefinitionFeature,O.\u0275\u0275NgOnChangesFeature],decls:15,vars:11,consts:[[3,"messageGroupName","scopes"],["class","notification notification--warning mb-20",4,"ngIf"],[1,"row","mobile-barrings--fixed-barrings"],[1,"col-sm-12"],[1,"content-section"],[1,"content-section__header"],[1,"header-icon","icon","icon-barring"],[1,"header-title"],[1,"content-section__details",3,"ngClass"],[1,"form-group"],["class","mb--xs",4,"ngFor","ngForOf"],["class","mobile-barrings--fixed-barrings__button-section",4,"ngIf"],[1,"notification","notification--warning","mb-20"],[1,"icon","icon-alert-shape","warning","mb-0"],[1,"mb--xs"],[1,"radio-checkbox"],[1,"radio","form__radio"],["type","radio","name","radio-group-name",1,"form__radio__input",3,"change","id","checked","disabled"],[1,"form__radio__label",3,"for"],[3,"for","innerHtml","ngClass"],[1,"mobile-barrings--fixed-barrings__button-section"],[1,"button",3,"click"]],template:function(t,n){t&1&&(O.\u0275\u0275elementStart(0,"tg-login",0),O.\u0275\u0275template(1,fr,4,3,"div",1),O.\u0275\u0275elementStart(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),O.\u0275\u0275element(6,"div",6),O.\u0275\u0275elementStart(7,"div",7),O.\u0275\u0275text(8),O.\u0275\u0275pipe(9,"translate"),O.\u0275\u0275elementEnd()(),O.\u0275\u0275elementStart(10,"div",8)(11,"section")(12,"div",9),O.\u0275\u0275template(13,hr,7,14,"div",10),O.\u0275\u0275elementEnd()()()(),O.\u0275\u0275template(14,vr,4,3,"div",11),O.\u0275\u0275elementEnd()()()),t&2&&(O.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.requiredScopes),O.\u0275\u0275advance(),O.\u0275\u0275property("ngIf",!n.hasNoFraudBarring),O.\u0275\u0275advance(7),O.\u0275\u0275textInterpolate(O.\u0275\u0275pipeBind1(9,7,"ng.barrings.lbl.fixed-barring")),O.\u0275\u0275advance(2),O.\u0275\u0275property("ngClass",O.\u0275\u0275pureFunction1(9,gr,!n.hasNoFraudBarring)),O.\u0275\u0275advance(3),O.\u0275\u0275property("ngForOf",n.barringSettings),O.\u0275\u0275advance(),O.\u0275\u0275property("ngIf",n.hasNoFraudBarring&&n.hasChangedBarrings&&!n.isConfirmationMsgToBeShown))},dependencies:[Xe.NgClass,Xe.NgForOf,Xe.NgIf,En.LoginComponent,xn.TranslatePipe],encapsulation:2})}}return i})();import*as On from"@ngx-translate/core";var Un=i=>({disabled:i}),Nn=i=>({"cursor--default":i}),Bn=i=>
1({"opacity--mid-transparency":i});function br(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",5)(1,"span",9),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.child-read-only")))}function Sr(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",6)(1,"span",9),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.member-read-only")))}function Er(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",10)(1,"span",11),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.blockoptions-update-confirmation-message")))}function xr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div",7),c.\u0275\u0275conditionalCreate(1,Er,4,3,"div",10),c.\u0275\u0275elementEnd()),i&2){let e=c.\u0275\u0275nextContext();c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.isConfirmationMsgToBeShown?1:-1)}}function Tr(i,r){if(i&1){let e=c.\u0275\u0275getCurrentView();c.\u0275\u0275elementStart(0,"app-fixed-telephone-barrings",12),c.\u0275\u0275listener("createFraudBarringsAnalyticsDataLayer",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext();return c.\u0275\u0275resetView(n.createFraudBarringsAnalyticsDataLayer())})("submitBarringSettings",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext();return c.\u0275\u0275resetView(n.submitBarringSettings())}),c.\u0275\u0275elementEnd()}if(i&2){let e=c.\u0275\u0275nextContext();c.\u0275\u0275property("barringSettings",e.selectedMobileBarring.barringSettings)("isConfirmationMsgToBeShown",e.isConfirmationMsgToBeShown)}}function Ir(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",10)(1,"span",16),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.warning.suspended-mobile-line")))}function yr(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",10)(1,"span",11),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.blockoptions-update-confirmation-message")))}function Lr(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",10)(1,"span",16),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd()()),i&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(3,1,"ng.barrings.info.disabled-mobile-barring")))}function Or(i,r){i&1&&(c.\u0275\u0275elementStart(0,"div",13)(1,"div",17),c.\u0275\u0275element(2,"i",18),c.\u0275\u0275elementStart(3,"h2"),c.\u0275\u0275text(4),c.\u0275\u0275pipe(5,"translate"),c.\u0275\u0275elementEnd()()()),i&2&&(c.\u0275\u0275advance(4),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(5,1,"ng.barrings.lbl.barring")))}function Ur(i,r){if(i&1){let e=c.\u0275\u0275getCurrentView();c.\u0275\u0275elementStart(0,"a",24),c.\u0275\u0275listener("click",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext(3);return c.\u0275\u0275resetView(n.gotoSimManagement())}),c.\u0275\u0275text(1),c.\u0275\u0275pipe(2,"translate"),c.\u0275\u0275elementEnd()}i&2&&(c.\u0275\u0275advance(),c.\u0275\u0275textInterpolate1(" ",c.\u0275\u0275pipeBind1(2,1,"ng.barrings.link.sim-management")," "))}function Nr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div",14)(1,"div",19),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd(),c.\u0275\u0275elementStart(4,"div",20)(5,"div",21)(6,"label",22),c.\u0275\u0275text(7),c.\u0275\u0275pipe(8,"translate"),c.\u0275\u0275elementEnd(),c.\u0275\u0275conditionalCreate(9,Ur,3,3,"a",23),c.\u0275\u0275elementEnd()()()),i&2){let e=c.\u0275\u0275nextContext(2);c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate1("",c.\u0275\u0275pipeBind1(3,3,"ng.barrings.lbl.sim-management")," "),c.\u0275\u0275advance(5),c.\u0275\u0275textInterpolate1(" ",c.\u0275\u0275pipeBind1(8,5,"ng.barrings.text.sim-management")," "),c.\u0275\u0275advance(2),c.\u0275\u0275conditional(e.simManagementLink?9:-1)}}function Br(i,r){if(i&1){let e=c.\u0275\u0275getCurrentView();c.\u0275\u0275elementStart(0,"div",26)(1,"div",27),c.\u0275\u0275text(2),c.\u0275\u0275pipe(3,"translate"),c.\u0275\u0275elementEnd(),c.\u0275\u0275elementStart(4,"div",29)(5,"div",30)(6,"label",31),c.\u0275\u0275text(7),c.\u0275\u0275elementEnd()(),c.\u0275\u0275elementStart(8,"div",32)(9,"div",33)(10,"input",34),c.\u0275\u0275listener("change",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext().$implicit,o=c.\u0275\u0275nextContext(3);
1return c.\u0275\u0275resetView(o.onChangeBarringSetting(n[0]))}),c.\u0275\u0275elementEnd(),c.\u0275\u0275elementStart(11,"label",35),c.\u0275\u0275text(12,"\xA0"),c.\u0275\u0275elementEnd()()()()()}if(i&2){let e=c.\u0275\u0275nextContext().$implicit,t=c.\u0275\u0275nextContext(3);c.\u0275\u0275advance(2),c.\u0275\u0275textInterpolate1(" ",c.\u0275\u0275pipeBind1(3,16,"ng.barrings.lbl.bar-all-services")," "),c.\u0275\u0275advance(3),c.\u0275\u0275property("ngClass",c.\u0275\u0275pureFunction1(18,Un,!t.isMaster||t.isMobileLineSuspended||e[0].fraudManagerSet)),c.\u0275\u0275advance(),c.\u0275\u0275property("for",c.\u0275\u0275interpolate2("checkbox-switch-",e[0].barringGroup,"-",e[0].name))("ngClass",c.\u0275\u0275pureFunction1(20,Nn,!t.isMaster||t.isMobileLineSuspended)),c.\u0275\u0275advance(),c.\u0275\u0275textInterpolate1(" ",e[0].nameLocalized," "),c.\u0275\u0275advance(3),c.\u0275\u0275property("id",c.\u0275\u0275interpolate2("checkbox-switch-",e[0].barringGroup,"-",e[0].name))("checked",e[0].isbarred)("disabled",t.isMobileLineSuspended||e[0].fraudManagerSet||e[0].isDisabled||!t.isMaster),c.\u0275\u0275advance(),c.\u0275\u0275property("for",c.\u0275\u0275interpolate2("checkbox-switch-",e[0].barringGroup,"-",e[0].name))("ngClass",c.\u0275\u0275pureFunction1(22,Bn,t.isMobileLineSuspended||e[0].fraudManagerSet||e[0].isDisabled||!t.isMaster))}}function Mr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div",27),c.\u0275\u0275text(1),c.\u0275\u0275elementEnd()),i&2){let e=c.\u0275\u0275nextContext().$implicit;c.\u0275\u0275advance(),c.\u0275\u0275textInterpolate1(" ",e[0].barringGroupLocalized," ")}}function wr(i,r){i&1&&(c.\u0275\u0275elementStart(0,"small"),c.\u0275\u0275text(1),c.\u0275\u0275pipe(2,"translate"),c.\u0275\u0275elementEnd()),i&2&&(c.\u0275\u0275advance(),c.\u0275\u0275textInterpolate(c.\u0275\u0275pipeBind1(2,1,"ng.barrings.info.Roaming_Data_Guard")))}function Pr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div",30)(1,"label",31),c.\u0275\u0275text(2),c.\u0275\u0275elementEnd(),c.\u0275\u0275conditionalCreate(3,wr,3,3,"small"),c.\u0275\u0275elementEnd()),i&2){let e=c.\u0275\u0275nextContext(),t=e.$implicit,n=e.index,o=c.\u0275\u0275nextContext(4);c.\u0275\u0275property("ngClass",c.\u0275\u0275pureFunction1(8,Un,!o.isMaster||o.isMobileLineSuspended||o.isCommonReadOnlyEnabled||t.fraudManagerSet)),c.\u0275\u0275advance(),c.\u0275\u0275property("for",c.\u0275\u0275interpolate3("checkbox-switch-",t.barringGroup,"-",t.name,"-",n))("ngClass",c.\u0275\u0275pureFunction1(10,Nn,!o.isMaster||o.isMobileLineSuspended||o.isCommonReadOnlyEnabled)),c.\u0275\u0275advance(),c.\u0275\u0275textInterpolate1(" ",t.nameLocalized," "),c.\u0275\u0275advance(),c.\u0275\u0275conditional(o.isBarringName(t.name,o.BarringsConstants.ROAMING_DATA_GUARD)?3:-1)}}function Ar(i,r){if(i&1){let e=c.\u0275\u0275getCurrentView();c.\u0275\u0275elementStart(0,"div",32)(1,"div",33)(2,"input",34),c.\u0275\u0275listener("change",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext().$implicit,o=c.\u0275\u0275nextContext(4);return c.\u0275\u0275resetView(o.onChangeBarringSetting(n))}),c.\u0275\u0275elementEnd(),c.\u0275\u0275elementStart(3,"label",35),c.\u0275\u0275text(4,"\xA0"),c.\u0275\u0275elementEnd()()()}if(i&2){let e=c.\u0275\u0275nextContext(),t=e.$implicit,n=e.index,o=c.\u0275\u0275nextContext(4);c.\u0275\u0275advance(2),c.\u0275\u0275property("id",c.\u0275\u0275interpolate3("checkbox-switch-",t.barringGroup,"-",t.name,"-",n))("checked",t.isbarred)("disabled",o.isMobileLineSuspended||o.isCommonReadOnlyEnabled||t.fraudManagerSet||t.isDisabled||!o.isMaster),c.\u0275\u0275advance(),c.\u0275\u0275property("for",c.\u0275\u0275interpolate3("checkbox-switch-",t.barringGroup,"-",t.name,"-",n))("ngClass",c.\u0275\u0275pureFunction1(11,Bn,!o.isMaster||o.isMobileLineSuspended||o.isCommonReadOnlyEnabled||t.fraudManagerSet||t.isDisabled||!o.isMaster))}}function Dr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div",29),c.\u0275\u0275conditionalCreate(1,Pr,4,12,"div",30),c.\u0275\u0275conditionalCreate(2,Ar,5,13,"div",32),c.\u0275\u0275elementEnd()),i&2){let e=r.$implicit,t=c.\u0275\u0275nextContext(4);c.\u0275\u0275advance(),c.\u0275\u0275conditional(t.isBarringName(e.name,t.BarringsConstants.CUSTOMER_BAR_ALL)?-1:1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(t.isBarringName(e.name,t.BarringsConstants.CUSTOMER_BAR_ALL)?-1:2)}}function Rr(i,r){if(i&1&&(c.\u0275\u0275elementStart(0,"div"),c.\u0275\u0275conditionalCreate(1,Br,13,24,"div",26),c.\u0275\u0275elementStart(2,"div",26),c.\u0275\u0275conditionalCreate(3,Mr,2,1,"div",27),c.\u0275\u0275template(4,Dr,3,2,"div",28),c.\u0275\u0275elementEnd()()),i&2){let e=r.$implicit,t=r.first,n=c.\u0275\u0275nextContext(3);c.\u0275\u0275advance(),c.\u0275\u0275conditional(t&&(e==null?null:e.length)>0&&e[0].name===n.BarringsConstants.CUSTOMER_BAR_ALL?1:-1),c.\u0275\u0275advance(2),c.\u0275\u0275conditional((e==null?null:e.length)>0?3:-1),c.\u0275\u0275advance(),c.\u0275\u0275property("ngForOf",e)}}function Fr(i,r){if(i&1&&c.\u0275\u0275template(0,Rr,5,3,"div",25),i&2){let e=c.\u0275\u0275nextContext(2);c.\u0275\u0275property("ngForOf",e.groupedBarringList)}}function kr(i,r){if(i&1){let e=c.\u0275\u0275getCurrentView();c.\u0275\u0275elementStart(0,"div",7),c.\u0275\u0275conditionalCreate(1,Ir,4,3,"div",10),c.\u0275\u0275conditionalCreate(2,yr,4,3,"div",10),c.\u0275\u0275conditionalCreate(3,Lr,4,3,"div",10),c.\u0275\u0275element(4,"app-bundle-line-selector",4),c.\u0275\u0275conditionalCreate(5,Or,6,3,"div",13),c.\u0275\u0275conditionalCreate(6,Nr,10,7,"div",14),c.\u0275\u0275conditionalCreate(7,Fr,1,1,"div"),c.\u0275\u0275elementStart(8,"app-save-button",15),c.\u0275\u0275listener("submitBarringSettings",function(){c.\u0275\u0275restoreView(e);let n=c.\u0275\u0275nextContext();
1return c.\u0275\u0275resetView(n.submitBarringSettings())}),c.\u0275\u0275elementEnd()()}if(i&2){let e=c.\u0275\u0275nextContext();c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.isMobileLineSuspended?1:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.isConfirmationMsgToBeShown?2:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.hasNoFraudBarring?-1:3),c.\u0275\u0275advance(),c.\u0275\u0275property("messageGroupName",e.messageGroupName),c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.isUseHeaderEnabled()?5:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.selectedMobileBarring&&e.msisdn?6:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(e.groupedBarringList!=null&&e.groupedBarringList.length?7:-1),c.\u0275\u0275advance(),c.\u0275\u0275property("disable",e.disableSubmit)("isMaster",e.isMaster)}}var Mn=(()=>{class i extends G{constructor(e,t,n,o,C,N,P,F,q,te,Te){super(),this.loginService=e,this.urlService=t,this.productService=n,this.messageService=o,this.barringsSharedService=C,this.dataLayerService=N,this.barringsHelper=P,this.cdRef=F,this.accountSelectorService=q,this.domService=te,this.window=Te,this.BarringsConstants=R,this.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP=R.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP,this.messageGroupName=R.MESSAGE_GROUP,this.changedBarringSettingsIdList=[],this.isMobileLineSuspended=!1,this.isConfirmationMsgToBeShown=!1,this.isCommonReadOnlyEnabled=!1,this.groupedBarringList=[],this.hasNoFraudBarring=!0,this.loaderObj=this.window.telenetgroupLoader,this.requiredScopes=["barringsettings"],this.messageGroupList=[R.MESSAGE_GROUP,R.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP]}initAfterLoggedIn(){this.domService.scrollToTop(),this.loadUserDetails(),this.consultMobileBarring()}isBarringName(e,t){return e===t}isUseHeaderEnabled(){return this.useHeader==="true"}consultMobileBarring(){setTimeout(()=>{this.loaderObj.hidePageLoader()},1e3),this.getMsisdnFromURL()!==""?(this.msisdn=this.getMsisdnFromURL(),this.checkLineStatus(),this.loadMobileBarringSettings()):!this.msisdn&&this.isAccountSectorInPage?this.getMsisdnFromAccountSelector():this.getMsisdnFromLoggedInPid()}checkLineStatus(){this.obs(this.productService.getProductByIdentifier(this.messageGroupName,this.msisdn)).subscribe(e=>{this.isMobileLineSuspended=e.status===R.STATUS_SUSPENDED_FROM_PRODUCTS_IDENTIFIER})}getMsisdnFromAccountSelector(){this.obs(this.accountSelectorService.getSelectedAccount()).subscribe({next:e=>{this.mobileLineStatus=e.status,this.isMobileLineSuspended=this.mobileLineStatus===R.STATUS_SUSPENDED,this.msisdn=e.msisdn,this.msisdn&&this.loadMobileBarringSettings()},error:e=>{if(!e.serviceError)this.messageService.addMessage(new ne(this.messageGroupName,"account-selector.error.empty-"+e.keyLabel));else{let t=this.messageService.getMessagesByGroupName(Z.MESSAGE_GROUP),n=t&&t[0].key;this.messageService.clearMessages(Z.MESSAGE_GROUP),this.messageService.addMessage(new ne(this.messageGroupName,n))}}})}getMsisdnFromLoggedInPid(){this.productService.getProductLinesByType(this.messageGroupName,this.deviceType).subscribe(e=>{w(e)?this.accountSelectorService.setError(!1,"mobile-line"):(this.msisdn=this.getMobileLineByUserPIDLinked(e),this.loadMobileBarringSettings())})}getMobileLineByUserPIDLinked(e){let t;if(t=Fe(e,n=>n.userPIDLinked&&!n.isDataOnlyPlan),t&&t.length===1)return this.isMobileLineSuspended=t[0].status===R.STATUS_SUSPENDED,t[0].identifier}getMsisdnFromURL(){return this.urlService.getRequestParamValue(R.QUERY_PARAM_MSISDN,"")}loadUserDetails(){this.loginService.getLoginDetails().subscribe(e=>{this.isFleetUser=e.isFleetUser(),this.isMaster=e.isFleetManager()||e.isContractHolder()||e.isMaster(),this.impersonated=e.isImpersonated?e.isImpersonated:!1,this.advisorId=e.advisorId?e.advisorId:""})}loadMobileBarringSettings(){this.obs(this.productService.getBarringSettings(this.messageGroupName,this.msisdn,this.deviceType)).pipe(In(()=>{this.isConfirmationMsgToBeShown=!1,this.changedBarringSettingsIdList=[],this.setStickyDisplay(),this.cdRef.detectChanges()})).subscribe(e=>{if(e){if(this.selectedMobileBarring=e,this.selectedMobileBarring.impersonated=this.impersonated,this.selectedMobileBarring.advisorId=this.advisorId,this.selectedMobileBarringCopy=k(e),this.deviceType===R.DEVICE_TYPE_MOBILE){this.groupedBarringList=this.barringsHelper.getTranslationsAndGroupByCategory(e);let t=X(this.selectedMobileBarring.barringSettings,["fraudManagerSet",!0]);t&&this.createFraudBarringsAnalyticsDataLayer();let n=Ii(this.groupedBarringList,function(o){return Fe(o,["name",R.CUSTOMER_BAR_ALL]
1)});this.isCommonReadOnlyEnabled=n[0][0]?n[0][0].isbarred:!1,this.hasNoFraudBarring=pe(t),this.hasNoFraudBarring||this.domService.scrollToTop()}this.cdRef.detectChanges()}})}onChangeBarringSetting(e){this.messageService.clearMessages(R.MESSAGE_GROUP),e.isbarred=!e.isbarred,e.hasChanged=!0,this.updateMobileBarrings(e),this.cdRef.detectChanges()}updateMobileBarrings(e){let t=X(this.selectedMobileBarring.barringSettings,["id",e.id]);this.updateBarrings(e.id,t),Y(e.mutualExclusionBarringIdSet,n=>{let o=X(this.selectedMobileBarring.barringSettings,["id",n]);o&&Y(this.groupedBarringList,C=>{let N=X(C,["id",n]),P=X(this.selectedMobileBarringCopy.barringSettings,["id",n]);N&&(!o.hasChanged&&o.isbarred||o.hasChanged&&!P.isbarred)&&(N.isbarred=!1,this.updateBarrings(n,o))})}),e.name===R.CUSTOMER_BAR_ALL&&(this.isCommonReadOnlyEnabled=t.isbarred),this.setStickyDisplay()}updateBarrings(e,t){Yt(this.changedBarringSettingsIdList,e)?(t.isbarred=!t.isbarred,X(this.selectedMobileBarringCopy.barringSettings,["id",e]).isbarred===t.isbarred?t.hasChanged=!1:t.hasChanged=!0,t.hasChanged||$t(this.changedBarringSettingsIdList,o=>o===e)):(t.isbarred=!t.isbarred,X(this.selectedMobileBarringCopy.barringSettings,["id",e]).isbarred===t.isbarred?t.hasChanged=!1:t.hasChanged=!0,t.hasChanged&&this.changedBarringSettingsIdList.push(e))}submitBarringSettings(){this.messageService.clearErrorMessages(this.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP),this.disableSubmit=!0,this.obs(this.productService.updateBarringSettings(this.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP,this.msisdn,this.selectedMobileBarring,this.deviceType)).pipe(In(()=>{this.changedBarringSettingsIdList=[],this.groupedBarringList=this.barringsHelper.getTranslationsAndGroupByCategory(this.selectedMobileBarring),this.setStickyDisplay(),this.cdRef.detectChanges()})).subscribe({next:e=>{this.createChangedBarringsAnalyticsData(),this.selectedMobileBarring=e,this.isConfirmationMsgToBeShown=!0,this.domService.scrollToTop(),this.cdRef.detectChanges()},complete:()=>this.disableSubmit=!1,error:()=>this.disableSubmit=!1})}createChangedBarringsAnalyticsData(){let e=this.selectedMobileBarring.barringSettings.filter(C=>C.hasChanged),t=this.deviceType===R.DEVICE_TYPE_MOBILE?this.dataLayerService.createEventInfo(R.EVENT_NAME_SET_BARRING,R.EVENT_TYPE_CHANGE_MOBILE_SERVICE_SETTINGS,this.messageGroupList):this.dataLayerService.createEventInfo(R.EVENT_NAME_SET_BARRING,R.EVENT_TYPE_CHANGE_FIXED_SERVICE_SETTINGS,this.messageGroupList),n=this.getCategory(),o={itemName:this.getItemNames(e),itemData:this.getItemData(e)};this.addEventToDataLayer(t,n,o)}getItemNames(e){return this.deviceType===R.DEVICE_TYPE_MOBILE?e.map(t=>t.barringGroup+":"+t.name).join():e.map(t=>R.FIXED_LINE+":"+t.name).join()}getItemData(e){return e.map(t=>t.isbarred?R.ITEM_DATA_ON:R.ITEM_DATA_OFF).join()}getCategory(){return this.deviceType===R.DEVICE_TYPE_MOBILE?this.dataLayerService.createCategory(yn.PRIMARY_CATEGORY_CARE,R.DEVICE_TYPE_MOBILE):this.dataLayerService.createCategory(yn.PRIMARY_CATEGORY_CARE,R.DEVICE_TYPE_FIXED_LINE)}createFraudBarringsAnalyticsDataLayer(){let e=this.dataLayerService.createEventInfo(R.FRAUD_BARRINGS_MESSAGE,R.VIEW_NOTIFICATION,this.messageGroupList),t=this.getCategory();this.addEventToDataLayer(e,t)}gotoSimManagement(){this.simManagementLink&&(this.simManagementLink.indexOf(R.MSISDN_DYNAMIC_KEY_INPUT)!==-1&&(this.simManagementLink=this.simManagementLink.replace(R.MSISDN_DYNAMIC_KEY_INPUT,this.msisdn)),this.urlService.redirectTo(this.simManagementLink))}setStickyDisplay(){let e=this.changedBarringSettingsIdList.length>0;this.barringsSharedService.setStickyDisplay(e)}addEventToDataLayer(e,t,n){n=n||{},this.dataLayerService.addEvent(e,n,t)}static{this.\u0275fac=function(t){return new(t||i)(c.\u0275\u0275directiveInject(Gi.LoginService),c.\u0275\u0275directiveInject($),c.\u0275\u0275directiveInject(re),c.\u0275\u0275directiveInject(W),c.\u0275\u0275directiveInject(Di),c.\u0275\u0275directiveInject(Ln.DataLayerService),c.\u0275\u0275directiveInject(Fi),c.\u0275\u0275directiveInject(c.ChangeDetectorRef),c.\u0275\u0275directiveInject(Ue),c.\u0275\u0275directiveInject(oe),c.\u0275\u0275directiveInject("Window"))}}static{this.\u0275cmp=c.\u0275\u0275defineComponent({type:i,selectors:[["tg-barrings"]],inputs:{useHeader:"useHeader",simManagementLink:"simManagementLink",deviceType:"deviceType",componentInstanceId:"componentInstanceId",pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",isAccountSectorInPage:"isAccountSectorInPage"},standalone:!1,features:[c.\u0275\u0275InheritDefinitionFeature],decls:11,vars:13,consts:[[1,"row"],[1,"col-sm-12"],[3,"componentCanRender","messageGroupName","scopes"],[3,"enableLoader","pageType","enableMask","startByDefault"],[3,"messageGroupName"],[1,"notification","notification--info","mb-20"],[1,"n
1otification","notification--info","notification-hide-base","mb-20"],[1,"usage-settings"],[3,"barringSettings","isConfirmationMsgToBeShown"],[1,"icon","icon-information-shape","info"],[1,"notification","notification--warning","mb-20"],[1,"icon","icon-alert-shape","warning"],[3,"createFraudBarringsAnalyticsDataLayer","submitBarringSettings","barringSettings","isConfirmationMsgToBeShown"],[1,"navigation-content__header","mobile-barring"],[1,"usage-settings__bar-general","sim-manage-link"],[3,"submitBarringSettings","disable","isMaster"],[1,"icon","icon-alert-shape","warning","mb-0"],[1,"title"],[1,"header-icon","icon","icon-barring"],[1,"usage-settings__header"],[1,"pt--m"],[1,"pl-0","display--flex--md","justify-content--between","pt--xxs"],[1,"cursor--default"],["href","JavaScript:void(0);"],["href","JavaScript:void(0);",3,"click"],[4,"ngFor","ngForOf"],[1,"usage-settings__bar-general"],[1,"usage-settings__header","display--flex"],["class","barring-option",4,"ngFor","ngForOf"],[1,"barring-option"],[1,"col-9","settings-label","pl-0",3,"ngClass"],[3,"ngClass","for"],[1,"settings-checkbox"],[1,"CheckboxSwitch"],["type","checkbox",1,"CheckboxSwitch-input",3,"change","checked","disabled","id"],[1,"CheckboxSwitch-control",3,"ngClass","for"]],template:function(t,n){t&1&&(c.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"tg-login",2),c.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),c.\u0275\u0275element(3,"app-loader",3)(4,"app-message-flow",4),c.\u0275\u0275conditionalCreate(5,br,4,3,"div",5),c.\u0275\u0275conditionalCreate(6,Sr,4,3,"div",6),c.\u0275\u0275elementStart(7,"app-message-flow",4),c.\u0275\u0275conditionalCreate(8,xr,2,1,"div",7),c.\u0275\u0275conditionalCreate(9,Tr,1,2,"app-fixed-telephone-barrings",8),c.\u0275\u0275conditionalCreate(10,kr,9,9,"div",7),c.\u0275\u0275elementEnd()()()()),t&2&&(c.\u0275\u0275advance(2),c.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.requiredScopes),c.\u0275\u0275advance(),c.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask)("startByDefault",!1),c.\u0275\u0275advance(),c.\u0275\u0275property("messageGroupName",n.MOBILE_BARRING_CUSTOM_MESSAGE_GROUP),c.\u0275\u0275advance(),c.\u0275\u0275conditional(!n.isMaster&&!n.isMobileLineSuspended&&!n.isFleetUser?5:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(n.isFleetUser&&!n.isMobileLineSuspended?6:-1),c.\u0275\u0275advance(),c.\u0275\u0275property("messageGroupName",n.messageGroupName),c.\u0275\u0275advance(),c.\u0275\u0275conditional(n.deviceType==="fixedtelephone"?8:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(n.selectedMobileBarring&&n.deviceType==="fixedtelephone"?9:-1),c.\u0275\u0275advance(),c.\u0275\u0275conditional(n.deviceType==="mobile"?10:-1))},dependencies:[Vi.NgClass,Vi.NgForOf,be,Gi.LoginComponent,Se,Ee,bn,Tn,On.TranslatePipe],encapsulation:2})}}return i})();import"@angular/core";var I=(()=>{class i{static{this.PRODUCT_TYPE_MOBILE="mobile"}static{this.PRODUCT_TYPE_BUNDLE="bundle"}static{this.MESSAGE_GROUP_NAME="mobile-usage-overview"}static{this.CUSTOM_MESSAGE_GROUP_NAME="mobile-usage-overview-custom"}static{this.SCOPES=["D_mobileusage"]}static{this.TITLE_UNLIMITED="ng.mobile-usage-overview.lbl.unlimited"}static{this.SUBTITLE_DATA="ng.mobile-usage-overview.lbl.data-remaining"}static{this.SUBTITLE_VOICE="ng.mobile-usage-overview.lbl.remaining"}static{this.SUBTITLE_UNLIMITED="ng.mobile-usage-overview.lbl.data-used"}static{this.ICON_NAME_DATA="ng.mobile-usage-overview.txt.data"}static{this.ICON_NAME_CALLS="ng.mobile-usage-overview.txt.calls"}static{this.CAROUSEL_CONFIG={slidesToShow:1,slidesToScroll:1,dots:!0,arrows:!1,infinite:!1}}static{this.USAGE_BLOB_TYPES=["data","voice"]}static{this.USAGE_BLOB_TYPE_DATA="data"}static{this.USAGE_TYPE_ZBR="ZBR"}static{this.ALL_CONSUMPTION_DATA_TYPES=["monetary","data","text","voice"]}static{this.DATA_SIM_CONSUMPTION_DATA_TYPES=["monetary","data"]}static{this.EMPTY=""}static{this.EMPTY_SPACE=" "}static{this.TITLE="Mobile Usage Overview"}static{this.REACHING_THRESHOLD_WARNING="mobile-usage-overview.reaching-threshold"}static{this.REACHED_THRESHOLD_WARNING="mobile-usage-overview.reached-threshold"}static{this.BAR_PERCENTAGE_FOR_WARNING=90}static{this.ZBR_BAR_PERCENTAGE_FOR_WARNING=95}static{this.MAX_BLOB_ON_CARD_VIEW=2}static{this.PAY_AS_YOU_GO="Pay as you go"}static{this.SUBTITLE_PAY_AS_YOU_GO="ng.mobile-usage-overview.lbl.pay-as-you-go"}static{this.BUCKET_TYPE_SPLIT_BILL_CAP="Split Billing Cap"}static{this.TRANSLATION_KEY_PREFIX="ng."}static{this.GROUP_VIEW="ng.mobile-usage-overview.lbl.group-view"}static{this.SUBTITLE_USED="ng.mobile-usage-overview.lbl.used"}static{this.SUBTITLE_PAUSED="ng.mobile-usage-overview.lbl.paused"}static{this.DATA_PAUSE_MSG="mobile-usage-overview.lbl.paused-msg"}static{this.DATA_UNPAUSE_MSG="mobile-usage-overview.lbl.unpaused-msg"}static{this.UPGRADE="Upgrade"}static{this.DOWNGRADE="Downgrade"}static{this.UPGRADE_WARNING="mobile-usage-overview.lbl.upgrade"}static{this.DOWNGRADE_WARNING="mobile-usage-overview.lbl.downgrade"}static{this.NATIONAL_ZBR_REACHING_THRESHOLD_WARNING="mobile-usage-overview.lbl.reaching-threshold-national-zbr"}static{this.NATIONAL_ZBR_REACHED_THRESHOLD_WARNING="mobile-usage-overview.lbl.reached-threshold-national-zbr"}static{this.INTERNATIONAL_ZBR_REACHED_THRESHOLD_WARNING="mobile-usage-overview.lbl.reached-threshold-international-zbr"}static{this.OCAPI_RESOURCE_URL="-resource/public?p=profilepicture&f="}static{this.KEY_MOBILE_USAGE_OVERVIEW_LABEL="ng.mobile-usage-overview.lbl."}static{this.BUCKET_TYPE_EU_DATA="data in EU"}static{this.BUCKET_EU_DATA="Data EU"}static{this.BUCKET_DATA_NATIONAL="Data National"}static{this.BUNDLE_TYPE_C5="C5"}static{this.DATA_UNITS=["GB","MB"]}static{this.VOICE_UNITS=["MINUTES","mins","SECONDS"]}static{this.CONVERT_TO_SECONDS=.6}static{this.OUT_OF_BUNDLE="Out of bundle"}
1static{this.UNLIMITED_PLAN="Unlimited"}static{this.INTERNATIONAL="International"}static{this.ANALYTICS_MOBILE_USAGE_INTERNATIONAL="Free EU"}static{this.BUCKET_TYPE_OUTSIDE_EUROPE="data outside Europe"}static{this.KINGBUSINESSINTERNATION="Kong Bus. Intern. (23C) data"}static{this.MOBILE_EU_DATA="EU Data"}}return i})();import"@telenet/ng-lib-ocapi";import"@angular/core";import"@telenet/ng-lib-datalayer";import*as ji from"@angular/core";import*as wn from"@telenet/ng-lib-datalayer";var Hi=(()=>{class i{constructor(e){this.dataLayerService=e,this.messageGroups=[I.MESSAGE_GROUP_NAME]}addEvent(e,t,n,o){let C=this.dataLayerService.createEventInfo(e,t,this.messageGroups),N=o||{},P=this.category(n);this.dataLayerService.addEvent(C,N,P)}category(e){return this.dataLayerService.getCategory(e)||this.dataLayerService.createCategory("care","mobile")}static{this.\u0275fac=function(t){return new(t||i)(ji.\u0275\u0275inject(wn.DataLayerService))}}static{this.\u0275prov=ji.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import{EventNameEnum as Sl,EventTypeEnum as El}from"@telenet/ng-lib-datalayer";import"@angular/core";import{catchError as An,forkJoin as Gr,of as Dn}from"rxjs";var Pe=(function(i){return i.TYPE="type",i.LINE_IDENTIFIER="lineIdentifier",i.MSISDN="msisdn",i})(Pe||{});import"@ngx-translate/core";import*as fi from"@angular/core";import*as Fn from"@ngx-translate/core";var ue=(()=>{class i{constructor(e,t){this.translateService=e,this.mobileService=t}getOptionName(e,t,n,o){return o?I.MOBILE_EU_DATA:n?this.translateService.instant(I.KEY_MOBILE_USAGE_OVERVIEW_LABEL+t).replace(I.KEY_MOBILE_USAGE_OVERVIEW_LABEL,"").toUpperCase():t.replace(e+" - ","")}addCommonBuckets(e){if(e.included){let t=this.getFlattenIncludedBuckets(e.included);this.getCommonBuckets(e.options,t).forEach(o=>{let C=t.find(N=>N.bucketType===o.bucketType);this.normalizingBucketUnits(C,o,e),this.addBucketProperties(C,o)})}}getNameByLabel(e){return e.split("/")[0].trimEnd()}getUsageForProductSubscriptions(e){let t=e.map(n=>n.productType===J.PRODUCT_TYPE_BUNDLE?this.getBundleUsage(n):this.getStandaloneLineUsage(n));return Gr(t)}isGroupBundle(e){return!!(e&&e.label===I.GROUP_VIEW)}getAutoPause(e,t){return this.mobileService.getAutoPause(e,t)}updateDataUsagePauseInfo(e,t,n){return this.mobileService.updateDataUsagePauseInfo(e,t,n)}getDataUsagePauseInfo(e,t){return this.mobileService.getDataUsagePauseInfo(e,t)}getCommonBuckets(e,t){let n=[];return w(e)||(n=e.reduce((o,C)=>(I.ALL_CONSUMPTION_DATA_TYPES.forEach(N=>{C[N]&&C[N].forEach((P,F,q)=>{t.find(te=>te.bucketType&&te.bucketType===P.bucketType)&&(o.push(P),q.splice(F,1))})}),o),[])),n}getFlattenIncludedBuckets(e){let t=[];return Object.keys(e).forEach(n=>{t=[...t,...e[n]]}),t}addBucketProperties(e,t){e.name=`${e.name} + ${t.name}`,e.usedUnits=this.formatUnits(e.usedUnits,t.usedUnits),e.remainingUnits=this.formatUnits(e.remainingUnits,t.remainingUnits),e.startUnits=this.formatUnits(e.startUnits,t.startUnits),e.usedPercentage=this.calculatePercentage(e.usedUnits,e.startUnits),(e.unlimited||t.unlimited)&&(e.unlimited=!0)}normalizingBucketUnits(e,t,n){e.unitType!==t.unitType&&(Object.assign(e,n.convertUnits(e,!0)),Object.assign(t,n.convertUnits(t,!0)))}formatUnits(e,t){return(parseFloat(e.replace(",","."))+parseFloat(t.replace(",","."))).toFixed(2).replace(".",",").replace(",00","")}calculatePercentage(e,t){let n=100*parseFloat(e.replace(",","."))/parseFloat(t.replace(",","."));return parseFloat(n.toFixed(0))}getStandaloneLineUsage(e){return this.mobileService.getMobileUsage(I.MESSAGE_GROUP_NAME,e.identifier?e.identifier:e.msisdn,!0).pipe(An(t=>Dn(null)))}getBundleUsage(e){let t=new Map;return t.set(Pe.TYPE,J.PRODUCT_TYPE_BUNDLE),this.isGroupBundle(e)||t.set(Pe.LINE_IDENTIFIER,e.identifier),this.mobileService.getMobileUsage(I.MESSAGE_GROUP_NAME,e.bundleIdentifier?e.bundleIdentifier:e.msisdn,!0,t).pipe(An(n=>Dn(null)))}static{this.\u0275fac=function(t){return new(t||i)(fi.\u0275\u0275inject(Fn.TranslateService),fi.\u0275\u0275inject(qe))}}static{this.\u0275prov=fi.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ve=(function(i){return i.NATIONAL="FreeG",i.INTERNATIONAL="Free EU",i.INTERNATIONAL_CALL="minutes outside Europe",i.INTERNATIONAL_DATA="data outside Europe",i.INTERNATIONAL_TEXT="texts outside Europe",i})(ve||{});import*as T from"@angular/core";import*as Zi from"@telenet/ng-lib-ocapi";import*as Ji from"@angular/common";import{EventEmitter as Yn}from"@angular/core";import"@angular/core";import"@ngx-translate/core";var Ie=(function(i){return i.MINS="min",i.SECS="secs",i.SMS="SMS",i})(Ie||{});import*as Yi from"@angular/core";
1import*as kn from"@ngx-translate/core";var xe=(()=>{class i{constructor(e){this.translateService=e}chartConfigurationBuilder(e,t,n,o,C,N,P){let F=e.usedUnitType?e.usedUnitType:e.unitType;return new mn().setLiquidColor(this.getLiquidColor(e,t,n,C)).setIconClass(this.getIconClass(e.unitType)).setSubtitle(this.getSubtitle(t,e.usedUnits,F,n,o,C)).setLiquidLevelPercentage(this.getLiquidLevelPercentage(t,e.usedPercentage)).setTitleColor(P).setSubtitleColor(P).setIconColor(P).setHideShadow(C).setIconName(this.getIconName(e.unitType,N)).setShowBorderWaves(t)}getChartConfiguration(e,t,n,o,C,N){let P=this.getForegroundColor(t,e.usedPercentage);return this.chartConfigurationBuilder(e,t,n,o,C,N,P).setTitle(this.getTitle(e,t,n,C,o)).getChartConfiguration()}getChartConfigurationNewOneUpBundle(e,t,n,o,C,N){let P=this.getForegroundColor(t,e.usedPercentage);return this.chartConfigurationBuilder(e,t,n,o,C,N,P).setTitle(this.getTitleNewOneUpBundle(e,t)).getChartConfiguration()}getStartUnit(e,t,n){switch(!0){case e:return this.translateService.instant(I.TITLE_UNLIMITED);case t===K.EUR:return this.translateService.instant("ng.mobile-usage-overview.lbl.monetary-balance",{value:n});default:return n}}getModifiedUnitType(e,t){switch(!0){case e.unitType===K.MINUTES:return Ie.MINS;case e.unitType===K.SECONDS:return Ie.SECS;case e.unitType===K.EUR:return I.EMPTY;case e.unitType===K.NUMBER:return Ie.SMS;case(e.usedUnitType&&t):return K.MB;default:return e.unitType}}getForegroundColor(e,t){return e&&t>=90?Tt.WHITE:Tt.BLACK}getLiquidColor(e,t,n,o){return t?this.getLiquidColorForUnlimitedPlan(e):this.getLiquidColorForLimitedPlan(e,n,o)}getLiquidColorForUnlimitedPlan(e){switch(!0){case e.usedPercentage>=100:return Me.MAROON_WAVE;case e.usedPercentage>=90:return Me.ORANGE_WAVE;default:return Me.YELLOW_WAVE}}getLiquidColorForLimitedPlan(e,t,n){switch(!0){case n:return Me.GREY;case(!t&&e.usedPercentage>=90):return Me.MAROON;case(e.usedPercentage>=75&&e.usedPercentage<90):return Me.ORANGE;default:return Me.YELLOW}}getIconClass(e){switch(!0){case e===K.GB:case e===K.MB:return xt.DATA;case e===K.MINUTES:case e===Ie.MINS:case e===K.SECONDS:case e===Ie.SECS:return xt.CALLS}}getLiquidLevelPercentage(e,t){return e?100:100-t}getTitle(e,t,n,o,C){return o?this.translateService.instant(I.SUBTITLE_PAUSED):t||n?this.getStartUnit(t,e.unitType,e.startUnits):`${e.remainingUnits||"0"} ${this.getModifiedUnitType(e,C)}`}getTitleNewOneUpBundle(e,t){return t?this.getStartUnit(t,e.unitType,e.startUnits):this.toRemainingUnits(e)}toRemainingUnits(e){return e.remainingUnits+" "+this.getModifiedUnitType(e)}unitType(e){return e.usedUnitType?e.usedUnitType:e.unitType}getSubtitle(e,t,n,o,C,N){switch(!0){case e:case N:return this.translateService.instant(I.SUBTITLE_UNLIMITED,{value:`${t} ${n}`});case o:return this.translateService.instant(I.SUBTITLE_PAY_AS_YOU_GO);case C:return this.translateService.instant(I.SUBTITLE_USED);case I.DATA_UNITS.includes(n):return this.translateService.instant(I.SUBTITLE_DATA);case I.VOICE_UNITS.includes(n):return this.translateService.instant(I.SUBTITLE_VOICE);default:return I.EMPTY}}getIconName(e,t){switch(!0){case!w(t):return t;case e===K.GB:case e===K.MB:return this.translateService.instant(I.ICON_NAME_DATA);case e===K.MINUTES:case e===Ie.MINS:case e===K.SECONDS:case e===Ie.SECS:return this.translateService.instant(I.ICON_NAME_CALLS);default:return I.EMPTY}}static{this.\u0275fac=function(t){return new(t||i)(Yi.\u0275\u0275inject(kn.TranslateService))}}static{this.\u0275prov=Yi.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import{EventNameEnum as $n,EventTypeEnum as jr}from"@telenet/ng-lib-datalayer";import"@angular/core";import"@ngx-translate/core";import"@angular/core";import"@ngx-translate/core";import*as $i from"@angular/core";import*as Gn from"@ngx-translate/core";var Wi=(()=>{class i{constructor(e){this.translateService=e}getRemainingTimeLabel(e){let t=new Date,o=new Date(e).getTime()-t.getTime(),C=Math.floor(o/(1e3*60*60)),N=Math.floor(C/24),P=C%24;return N>1?this.getTranslatedLabel("roaming-usage-remaining-days-hours-left",N,P):N===1?P>1?this.getTranslatedLabel("roaming-usage-remaining-day-hours-left",1,P):this.getTranslatedLabelRemainingDayAndHoursLeft(P):P>1?this.getTranslatedLabel("roaming-usage-remaining-hours-left",0,P):this.getTranslatedLabelRemainingHoursLeft(P)}getTranslatedLabelRemainingDayAndHoursLeft(e){return e===1?this.getTranslatedLabel("roaming-usage-remaining-day-hour-left"):this.getTranslatedLabel("roaming-usage-remaining-day-left")}getTranslatedLabelRemainingHoursLeft(e){return e===1?this.getTranslatedLabel("roaming-usage-remaining-hour-left"):this.getTranslatedLabel("roaming-usage-remaining-under-an-hour-left")}getTranslatedLabel(e,t,n){if(t>0&&n>0){let o=t>1?{days:t,hours:n}:{day:1,hours:n};return this.translateService.instant(this.getLabelKey(e),o)}else return n>0?this.translateService.instant(this.getLabelKey(e),{hours:n}):this.translateService.instant(this.getLabelKey(e))}getLabelKey(e){return"ng.mobile-usage-overview.lbl."+e}static{this.\u0275fac=function(t){return new(t||i)($i.\u0275\u0275inject(Gn.TranslateService))}}static{this.\u0275prov=$i.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import*as ei from"@angular/core";
1import*as jn from"@ngx-translate/core";var Hn=(()=>{class i{constructor(e,t,n){this.mobileUsageChartConfigurationService=e,this.usageBlobService=t,this.translateService=n,this.DATA_BUCKET_TYPES=["Data National","Data EU","Data NAT/EU"]}buildViewModelForNewOneUpBundle(e,t){let n=this.getBuilderOptionsForBlob(e.included.data,e,t);return e.options.forEach(o=>{o.isRoaming&&I.USAGE_BLOB_TYPES.forEach(C=>{n=[...n,...this.getBuilderOptionsForBlob(o[C],e,t,!0)]})}),n}getBuilderOptionsForBlob(e,t,n,o=!1){return e.map(C=>Jt().name(t.isLineBundleUsage&&!o?I.EMPTY_SPACE:C.name).config(this.mobileUsageChartConfigurationService.getChartConfigurationNewOneUpBundle(C,C.unlimited,t.productInfo.usageBasedRatePlan,t.isLineBundleUsage??!1,this.dataPaused(t,n),this.toIconName(C.bucketType))).validityDate(o?this.getValidityDateLabel(C.validity):void 0).build())}toIconName(e){if(this.DATA_BUCKET_TYPES.indexOf(e)>-1)return this.translateService.instant("ng.mobile-usage-overview.txt."+this.toLocalizeKey(e))}toLocalizeKey(e){return e.replace(/\/|\s/g,"-").toLowerCase()}dataPaused(e,t){return e.dataPause||t&&t.isUsageLimitReached()||!1}getValidityDateLabel(e){return this.usageBlobService.getRemainingTimeLabel(e)}static{this.\u0275fac=function(t){return new(t||i)(ei.\u0275\u0275inject(xe),ei.\u0275\u0275inject(Wi),ei.\u0275\u0275inject(jn.TranslateService))}}static{this.\u0275prov=ei.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import*as _ from"@angular/core";import*as Ki from"@angular/common";import*as Kn from"@ngx-translate/core";var zn=i=>({value:i});function Hr(i,r){if(i&1){let e=_.\u0275\u0275getCurrentView();_.\u0275\u0275elementStart(0,"div",14)(1,"button",15),_.\u0275\u0275listener("click",function(){_.\u0275\u0275restoreView(e);let n=_.\u0275\u0275nextContext(2);return _.\u0275\u0275resetView(n.pauseUnpauseUsage(!(n.usage!=null&&n.usage.dataPause)))}),_.\u0275\u0275text(2),_.\u0275\u0275pipe(3,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(4,"div",16),_.\u0275\u0275text(5),_.\u0275\u0275pipe(6,"translate"),_.\u0275\u0275elementEnd()()}if(i&2){let e=_.\u0275\u0275nextContext(2);_.\u0275\u0275advance(2),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-overview.lbl."+(e.usage!=null&&e.usage.dataPause?"unpause-data":"pause-data"))," "),_.\u0275\u0275advance(3),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(6,4,"ng.mobile-usage-overview.lbl.pause-date-msg")," ")}}function Yr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"span"),_.\u0275\u0275text(1),_.\u0275\u0275pipe(2,"translate"),_.\u0275\u0275elementEnd()),i&2){let e=_.\u0275\u0275nextContext().$implicit;_.\u0275\u0275advance(),_.\u0275\u0275textInterpolate2(" ",_.\u0275\u0275pipeBind1(2,2,"ng.mobile-usage-overview.lbl.roaming-usage-remaining-expires")," ",e.validityDate," ")}}function $r(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"span"),_.\u0275\u0275text(1),_.\u0275\u0275pipe(2,"translate"),_.\u0275\u0275elementEnd()),i&2){let e=_.\u0275\u0275nextContext(2);_.\u0275\u0275advance(),_.\u0275\u0275textInterpolate2(" ",e.usage.daysForNextBill," ",_.\u0275\u0275pipeBind1(2,2,"ng.mobile-usage-overview.lbl.days-untils")," ")}}function Wr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"div",9),_.\u0275\u0275element(1,"span",10)(2,"app-liquid-chart",11),_.\u0275\u0275template(3,Hr,7,6,"div",12),_.\u0275\u0275elementStart(4,"div",13),_.\u0275\u0275conditionalCreate(5,Yr,3,4,"span")(6,$r,3,4,"span"),_.\u0275\u0275elementEnd()()),i&2){let e=r.$implicit,t=_.\u0275\u0275nextContext();_.\u0275\u0275advance(),_.\u0275\u0275property("innerHTML",e.name,_.\u0275\u0275sanitizeHtml),_.\u0275\u0275advance(),_.\u0275\u0275property("config",e.config),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",(t.usage==null||t.usage.productInfo==null?null:t.usage.productInfo.isEligibleForPauseProfile)&&!t.usage.isGroupBundleUsage),_.\u0275\u0275advance(2),_.\u0275\u0275conditional(e.validityDate?5:6)}}function Kr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"div",17),_.\u0275\u0275element(1,"hr"),_.\u0275\u0275elementStart(2,"div",18)(3,"div",19),_.\u0275\u0275text(4),_.\u0275\u0275pipe(5,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(6,"div",20)(7,"div",21)(8,"span"),_.\u0275\u0275text(9),_.\u0275\u0275pipe(10,"translate"),_.\u0275\u0275elementEnd()()()(),_.\u0275\u0275elementStart(11,"div",22),_.\u0275\u0275text(12),_.\u0275\u0275pipe(13,"translate"),_.\u0275\u0275elementEnd()()),i&2){let e=_.\u0275\u0275nextContext();_.\u0275\u0275advance(4),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(5,3,"ng.mobile-usage-overview.lbl.extra-cost")," "),_.\u0275\u0275advance(5),_.\u0275\u0275textInterpolate(_.\u0275\u0275pipeBind2(10,5,"ng.mobile-usage-overview.lbl.monetary-balance",_.\u0275\u0275pureFunction1(10,zn,e.usage==null||e.usage.outOfBundle==null?null:e.usage.outOfBundle.usedUnits))),_.\u0275\u0275advance(3),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(13,8,"ng.mobile-usage-overview.lbl.out-of-bundle-description")," ")}}function zr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"span"),_.\u0275\u0275text(1),_.\u0275\u0275pipe(2,"translate"),_.\u0275\u0275elementEnd()),i&2){let e=_.\u0275\u0275nextContext().$implicit;_.\u0275\u0275advance(),_.\u0275\u0275textInterpolate2(" ",_.\u0275\u0275pipeBind1(2,2,"ng.mobile-usage-overview.lbl.roaming-usage-remaining-expires")," ",e.validityDate," ")}}function qr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"span"),_.\u0275\u0275text(1),_.\u0275\u0275pipe(2,"translate"),_.\u0275\u0275elementEnd()),i&2){let e=_.\u0275\u0275nextContext(2);_.\u0275\u0275advance(),_.\u0275\u0275textInterpolate2(" ",e.usage.daysForNextBill," ",_.\u0275\u0275pipeBind1(2,2,"ng.mobile-usage-overview.lbl.days-untils")," ")}}function Xr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"div",23)(1,"div",9),_.\u0275\u0275element(2,"span",10)(3,"app-liquid-chart",11),_.\u0275\u0275elementStart(4,"div",24),_.\u0275\u0275conditionalCreate(5,zr,3,4,"span")(6,qr,3,4,"span"),_.\u0275\u0275elementEnd()()()),i&2){let e=r.$implicit;_.\u0275\u0275advance(2),_.\u0275\u0275property("innerHTML",e.name,_.\u0275\u0275sanitizeHtml),_.\u0275\u0275advance(),_.\u0275\u0275property("config",e.config),_.\u0275\u0275advance(2),_.\u0275\u0275conditional(e.validityDate?5:6)}}function Qr(i,r){if(i&1&&(_.\u0275\u0275elementStart(0,"div",17)(1,"div",18)(2,"div",19),_.\u0275\u0275text(3),_.\u0275\u0275pipe(4,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(5,"div",20)(6,"div",21)(7,"span"),_.\u0275\u0275text(8),_.\u0275\u0275pipe(9,"translate"),_.\u0275\u0275elementEnd()()()(),_.\u0275\u0275elementStart(10,"div",22),_.\u0275\u0275text(11),_.\u0275\u0275pipe(12,"translate"),_.\u0275\u0275elementEnd()()),i&2){let e=_.\u0275\u0275nextContext();_.\u0275\u0275advance(3),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(4,3,"ng.mobile-usage-overview.lbl.extra-cost")," "),_.\u0275\u0275advance(5),_.\u0275\u0275textInterpolate(_.\u0275\u0275pipeBind2(9,5,"ng.mobile-usage-overview.lbl.monetary-balance",_.\u0275\u0275pureFunction1(10,zn,e.usage==null||e.usage.outOfBundle==null?null:e.usage.outOfBundle.usedUnits))),_.\u0275\u0275advance(3),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(12,8,"ng.mobile-usage-overview.lbl.out-of-bundle-description")," ")}}function Zr(i,r){if(i&1){let e=_.\u0275\u0275getCurrentView();_.\u0275\u0275elementStart(0,"div",25)(1,"button",15),_.\u0275\u0275listener("click",function(){_.\u0275\u0275restoreView(e);let n=_.\u0275\u0275nextContext();
1return _.\u0275\u0275resetView(n.pauseUnpauseUsage(!(n.usage!=null&&n.usage.dataPause)))}),_.\u0275\u0275text(2),_.\u0275\u0275pipe(3,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(4,"div",26),_.\u0275\u0275text(5),_.\u0275\u0275pipe(6,"translate"),_.\u0275\u0275elementEnd()()}if(i&2){let e=_.\u0275\u0275nextContext();_.\u0275\u0275advance(2),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-overview.lbl."+(e.usage!=null&&e.usage.dataPause?"unpause-data":"pause-data"))," "),_.\u0275\u0275advance(3),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(6,4,"ng.mobile-usage-overview.lbl.pause-date-msg")," ")}}var qn=(()=>{class i{constructor(e,t,n,o,C,N,P,F){this.messageService=e,this.normalizationService=t,this.domService=n,this.mobileUsageChartConfigurationService=o,this.mobileUsageOverviewService=C,this.mobileUsageDatalayer=N,this.usageBlobBuilder=P,this.usageBlobService=F,this.messageEvent=new Yn,this.updateUsage=new Yn,this.blobCards=[],this.slideConfig=I.CAROUSEL_CONFIG,this.messageGroups=[]}ngOnInit(){this.createChartConfigs()}ngOnChanges(e){this.createChartConfigs()}createChartConfigs(){this.blobCards=[],this.isNewOneUpBundle?(this.blobCards=this.usageBlobBuilder.buildViewModelForNewOneUpBundle(this.usage,this.autoPause),this.addPvvCardAndUsageWarnings()):this.calculateChartConfigs()}calculateChartConfigs(){I.USAGE_BLOB_TYPES.forEach(e=>{this.usage.included?.[e].length&&(this.blobCards=[...this.blobCards,...this.populateBlobCards(this.usage.included[e])]);let t=this.usage.options?.filter(n=>n.isRoaming);t?.length&&t.forEach(n=>{n[e].length&&(this.blobCards=[...this.blobCards,...this.populateBlobCards(n[e],!0)])})}),(this.usage.isLineBundleUsage||this.usage.isGroupBundleUsage)&&this.getBundleUsageCard(),this.addPvvCardAndUsageWarnings()}populateBlobCards(e,t=!1){return e.filter(n=>n&&(this.usage.isDataUnlimited(n.unitType,n.unlimited)||!n.unlimited)).map(n=>{let o={name:this.mobileUsageOverviewService.getOptionName(this.usage.productInfo.name,n.name,n.isManual)};return t&&(o.validityDate=this.getValidityDateLabel(n.validity)),o.config=this.mobileUsageChartConfigurationService.getChartConfiguration(n,n.unlimited,null,null,null,n.bucketType===I.BUCKET_TYPE_EU_DATA||n.bucketType===I.BUCKET_EU_DATA||n.bucketType===I.BUCKET_TYPE_OUTSIDE_EUROPE?this.mobileUsageOverviewService.getOptionName(this.usage.productInfo.name,n.name,!1,n.bucketType===I.BUCKET_TYPE_OUTSIDE_EUROPE):null),o})}addPvvCardAndUsageWarnings(){this.usage.productInfo.usageBasedRatePlan&&this.blobCards.push(this.getPvvCard()),(this.usage.included||this.usage.shared)&&this.addUsageWarnings(),this.slideConfig.dots=this.blobCards.length>1}getPvvCard(){let e={name:I.EMPTY},t=this.usage.outOfBundle;return t.usedPercentage=0,t.remainingUnits=t.usedUnits,t.startUnits=t.usedUnits,e.config=this.mobileUsageChartConfigurationService.getChartConfiguration(t,t.unlimited,this.usage.productInfo.usageBasedRatePlan),e}getBundleUsageCard(){this.usage.shared?.[I.USAGE_BLOB_TYPE_DATA].forEach(e=>{let t={name:this.usage.isLineBundleUsage?I.EMPTY_SPACE:e.name},n=this.dataPaused();this.usage.isLineBundleUsage&&(e.remainingUnits=e.usedUnits),t.config=this.mobileUsageChartConfigurationService.getChartConfiguration(e,e.unlimited,this.usage.productInfo.usageBasedRatePlan,this.usage.isLineBundleUsage,n),this.blobCards.push(t)})}dataPaused(){return this.usage.dataPause||this.autoPause&&this.autoPause.isUsageLimitReached()||!1}addUsageWarnings(){this.clearMessages(),(w(this.usage.shared)?this.usage.included:this.usage.shared).data.filter(t=>w(this.usage.shared)?this.usage.isDataUnlimited(t.unitType,t.unlimited):!0).forEach(t=>{this.addThresholdMessage(t)}),this.messageEvent.emit(this.messageGroups)}addThresholdMessage(e){e.usedPercentage>=100?this.usage.productInfo.name.substring(0,4).toLowerCase()!=="wigo"&&this.addReachedThresholdMessage(e.startUnits,e.name):e.usedPercentage>=I.BAR_PERCENTAGE_FOR_WARNING&&this.addReachingThresholdMessage(e.startUnits,e.name)}addReachedThresholdMessage(e,t){this.messageService.addMessage(new ne(this.getMessageGroupName(t),I.REACHED_THRESHOLD_WARNING,{value:e+K.GB,name:this.mobileUsageOverviewService.getOptionName(this.usage.productInfo.name,t)}))}addReachingThresholdMessage(e,t){this.messageService.addMessage(new ke(this.getMessageGroupName(t),I.REACHING_THRESHOLD_WARNING,{value:e+K.GB,name:this.mobileUsageOverviewService.getOptionName(this.usage.productInfo.name,t)}))}
1getMessageGroupName(e){let t=this.normalizationService.normalizeKey(e);return this.messageGroups.push(t),t}clearMessages(){this.messageGroups.forEach(e=>{this.messageService.clearMessages(e)}),this.messageGroups=[]}pauseUnpauseUsage(e){this.messageService.clearMessages(I.CUSTOM_MESSAGE_GROUP_NAME);let t={dataPause:e},n=new Map;n.set(Pe.MSISDN,this.selectedAccountIdentifier),this.mobileUsageOverviewService.updateDataUsagePauseInfo(I.CUSTOM_MESSAGE_GROUP_NAME,t,n).subscribe(o=>{this.pauseUnpauseAnalytics(e),this.mobileUsageOverviewService.getDataUsagePauseInfo(I.CUSTOM_MESSAGE_GROUP_NAME,n).subscribe(C=>{this.usage.dataPause=C.dataPause,this.calculateChartConfigs(),this.updateUsage.emit(this.usage),this.messageService.addMessage(new Mi(I.CUSTOM_MESSAGE_GROUP_NAME,e?I.DATA_PAUSE_MSG:I.DATA_UNPAUSE_MSG)),this.domService.scrollToTop()})})}pauseUnpauseAnalytics(e){this.mobileUsageDatalayer.addEvent(e?$n.EVENT_NAME_MOBILE_USAGE_PAUSED:$n.EVENT_NAME_MOBILE_USAGE_UNPAUSED,jr.EVENT_TYPE_CLICK,this.componentInstanceID)}getValidityDateLabel(e){return this.usageBlobService.getRemainingTimeLabel(e)}static{this.\u0275fac=function(t){return new(t||i)(_.\u0275\u0275directiveInject(W),_.\u0275\u0275directiveInject(Li),_.\u0275\u0275directiveInject(oe),_.\u0275\u0275directiveInject(xe),_.\u0275\u0275directiveInject(ue),_.\u0275\u0275directiveInject(Hi),_.\u0275\u0275directiveInject(Hn),_.\u0275\u0275directiveInject(Wi))}}static{this.\u0275cmp=_.\u0275\u0275defineComponent({type:i,selectors:[["app-usage-blob"]],inputs:{usage:"usage",selectedAccountIdentifier:"selectedAccountIdentifier",autoPause:"autoPause",componentInstanceID:"componentInstanceID",isConnect5Bundle:"isConnect5Bundle",isNewOneUpBundle:"isNewOneUpBundle"},outputs:{messageEvent:"messageEvent",updateUsage:"updateUsage"},standalone:!1,features:[_.\u0275\u0275NgOnChangesFeature],decls:11,vars:6,consts:[["slickModal","slick-carousel"],[1,"hidden-mobile","mt--xl"],[1,"mobile-overview-usage__content__wave-section"],["class","text-align--center wave-section__wave",4,"ngFor","ngForOf"],["class","mobile-overview-usage__cost-section cursor--default",4,"ngIf"],[1,"hidden-desktop"],[1,"carousel",3,"config"],["ngxSlickItem","","class","slide",4,"ngFor","ngForOf"],["class","mobile-overview-usage__content__paused-section hidden-desktop",4,"ngIf"],[1,"text-align--center","wave-section__wave"],[1,"text-weight--g",3,"innerHTML"],[3,"config"],["class","mobile-overview-usage__content__paused-section hidden-mobile text-align--center",4,"ngIf"],[1,"mb--xl","font--body-small"],[1,"mobile-overview-usage__content__paused-section","hidden-mobile","text-align--center"],[1,"button","button--primary",3,"click"],[1,"font--caption","text-align--center","mb--m"],[1,"mobile-overview-usage__cost-section","cursor--default"],[1,"cost-section__cost-field","display--flex","justify-content--center","justify-content--between--sm","align-items--center"],[1,"cost-field__cost-area","color-red","text-weight--g"],[1,"cost-field__cost-value"],[1,"price","price__red-bold"],[1,"cost-section__cost-description","text-align--left--md","text-align--center"],["ngxSlickItem","",1,"slide"],[1,"mobile-overview-usage__content__note"],[1,"mobile-overview-usage__content__paused-section","hidden-desktop"],[1,"mobile-overview-usage__content__paused-section__pause-note","text-align--center"]],template:function(t,n){t&1&&(_.\u0275\u0275elementStart(0,"div",1)(1,"div",2),_.\u0275\u0275template(2,Wr,7,4,"div",3),_.\u0275\u0275elementEnd(),_.\u0275\u0275template(3,Kr,14,12,"div",4),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(4,"div",5)(5,"div",2)(6,"ngx-slick-carousel",6,0),_.\u0275\u0275template(8,Xr,7,3,"div",7),_.\u0275\u0275elementEnd()(),_.\u0275\u0275template(9,Qr,13,12,"div",4)(10,Zr,7,6,"div",8),_.\u0275\u0275elementEnd()),t&2&&(_.\u0275\u0275advance(2),_.\u0275\u0275property("ngForOf",n.blobCards),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",!(!(n.usage==null||n.usage.productInfo==null)&&n.usage.productInfo.usageBasedRatePlan)&&(n.usage==null||n.usage.outOfBundle==null?null:n.usage.outOfBundle.usedUnits)!=="0"),_.\u0275\u0275advance(3),_.\u0275\u0275property("config",n.slideConfig),_.\u0275\u0275advance(2),_.\u0275\u0275property("ngForOf",n.blobCards),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",!(!(n.usage==null||n.usage.productInfo==null)&&n.usage.productInfo.usageBasedRatePlan)&&(n.usage==null||n.usage.outOfBundle==null?null:n.usage.outOfBundle.usedUnits)!=="0"),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",(n.usage==null||n.usage.productInfo==null?null:n.usage.productInfo.isEligibleForPauseProfile)&&!n.usage.isGroupBundleUsage))},dependencies:[Ki.NgForOf,Ki.NgIf,We,Ke,se,Kn.TranslatePipe],encapsulation:2})}}return i})();import{EventEmitter as ea}from"@angular/core";import"@ngx-translate/core";import*as l from"@angular/core";import*as zi from"@ngx-translate/core";import*as ii from"@angular/common";var Ot=i=>({mins:i}),Xn=i=>({secs:i}),ia=i=>({name:i}),Lt=i=>({value:i});function ta(i,r){if(i&1&&l.\u0275\u0275elementContainer(0,10),i&2){l.\u0275\u0275nextContext();let e=l.\u0275\u0275reference(7);l.\u0275\u0275property("ngTemplateOutlet",e)}}function na(i,r){if(i&1&&l.\u0275\u0275elementContainer(0,10),i&2){l.\u0275\u0275nextContext();let e=l.\u0275\u0275reference(9);l.\u0275\u0275property("ngTemplateOutlet",e)}}function oa(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",e.usedUnits," ",e.usedUnitType?e.usedUnitType:e.unitType," ")}}function ra(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit,t=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.used-voice-data-secs",l.\u0275\u0275pureFunction1(4,Xn,t.convertToSeconds(e.usedUnits.split(",")[1])))," ")}}function aa(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275template(3,ra,3,6,"span",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind2(2,2,"ng.mobile-usage-overview.lbl.used-voice-data-mins",l.\u0275\u0275pureFunction1(5,Ot,e.usedUnits.split(",")[0]))," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",e.usedUnits.split(",")[1]&&e.usedUnits.split(",")[1]!="0")}}function sa(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1("/ ",e.startUnits)}}function la(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275template(1,oa,2,2,"span",6)(2,aa,4,7,"span",6)(3,sa,2,1,"span",6),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(2).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.unitType!=="min"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.unitType==="min"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.startUnits)}}function ca(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate(e.startUnits)}}function da(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275template(1,ca,2,1,"span",6),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(2).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.startUnits)}}function ma(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275template(1,la,4,3,"ng-container",6)(2,da,2,1,"ng-container",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext().$implicit;l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.usedUnits!="0"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.usedUnits=="0")}}function pa(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275text(1),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1("/ ",e.startUnits)}}function ua(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275text(1),l.\u0275\u0275template(2,pa,2,1,"ng-container",6),l.\u0275\u0275text(3),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",e.usedUnits),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.startUnits),l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",e.unitType," ")}}function ga(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(5).$implicit,t=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.used-voice-data-secs",l.\u0275\u0275pureFunction1(4,Xn,t.convertToSeconds(e.usedUnits.split(",")[1])))," ")}}function _a(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275template(3,ga,3,6,"span",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind2(2,2,"ng.mobile-usage-overview.lbl.used-voice-data-mins",l.\u0275\u0275pureFunction1(5,Ot,e.usedUnits.split(",")[0]))," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",e.usedUnits.split(",")[1]&&e.usedUnits.split(",")[1]!="0")}}function fa(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275elementStart(1,"span"),l.\u0275\u0275text(2),l.\u0275\u0275pipe(3,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit;l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate(l.\u0275\u0275pipeBind2(3,1,"ng.mobile-usage-overview.lbl.used-voice-data-mins",l.\u0275\u0275pureFunction1(4,Ot,e.usedUnits.split(",")[0])))}}function ha(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275text(1),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2("/ ",e.startUnits," ",e.unitType)}}function va(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275template(1,_a,4,7,"span",6)(2,fa,4,6,"ng-container",6)(3,ha,2,2,"ng-container",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.usedUnits!="0"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.usedUnits=="0"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.startUnits)}}function Ca(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(4).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" / ",e.startUnits," ",e.unitType," ")}}function ba(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1),l.\u0275\u0275template(2,Ca,2,2,"span",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3).$implicit,t=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",t.getUsedUnitsAndUnitType(e)," "),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.startUnits&&e.unitType==="GB")}}function Sa(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275template(1,ua,4,3,"ng-container",6)(2,va,4,3,"span",6)(3,ba,3,2,"span",6),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(2).$implicit,t=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",t.usage.isGroupBundleUsage&&t.isShowTotalZBR(e)),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.unitType==="min"),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.unitType!=="min")}}function Ea(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(2).$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",e.startUnits," ",e.unitType," ")}}function xa(i,r){if(i&1&&l.\u0275\u0275template(0,Sa,4,3,"span",12)(1,Ea,2,2,"span",12),i&2){let e=l.\u0275\u0275nextContext().$implicit;l.\u0275\u0275property("ngIf",!e.isManual),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.isManual)}}function Ta(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"div",7)(1,"span",8),l.\u0275\u0275text(2),l.\u0275\u0275pipe(3,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(4,ta,1,1,"ng-container",9)(5,na,1,1,"ng-container",9)(6,ma,3,2,"ng-template",null,0,l.\u0275\u0275templateRefExtractor)(8,xa,2,2,"ng-template",null,1,l.\u0275\u0275templateRefExtractor),l.\u0275\u0275elementEnd()),i&2){let e=r.$implicit,t=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275property("className","icon-"+t.getUsageTypeIcon(e)),l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(3,4,t.getUsageTypeLabelKey(e))),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",t.hasUnlimitedUsage(e)),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",!t.hasUnlimitedUsage(e))}}function Ia(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275pipe(3,"translate"),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext().$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",l.\u0275\u0275pipeBind2(2,2,"ng.mobile-usage-overview.lbl.monetary-balance",l.\u0275\u0275pureFunction1(8,Lt,e==null?null:e.usedUnits)),"/",l.\u0275\u0275pipeBind2(3,5,"ng.mobile-usage-overview.lbl.monetary-balance",l.\u0275\u0275pureFunction1(10,Lt,e==null?null:e.startUnits))," ")}}function ya(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275pipe(3,"translate"),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext().$implicit;l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",l.\u0275\u0275pipeBind2(2,2,"ng.mobile-usage-overview.lbl.monetary-balance",l.\u0275\u0275pureFunction1(7,Lt,e==null?null:e.usedUnits)),"/",l.\u0275\u0275pipeBind1(3,5,"ng.mobile-usage-overview.lbl.unlimited")," ")}}function La(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"div",7)(1,"span",13),l.\u0275\u0275text(2),l.\u0275\u0275pipe(3,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(4,Ia,4,12,"span",12)(5,ya,4,9,"span",12),l.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind2(3,3,"ng.mobile-usage-overview.lbl.extra-usages",l.\u0275\u0275pureFunction1(6,ia,e==null?null:e.name))," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",!(e!=null&&e.unlimited)),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e==null?null:e.unlimited)}}function Oa(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275template(1,La,6,8,"div",5),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(),l.\u0275\u0275property("ngForOf",e.getExtraUsages())}}function Ua(i,r){i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),i&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-overview.lbl.no-auto-pause-limit")," "))}function Na(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3);l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",e.autoPause.limit.value," ",e.autoPause.limit.unitType," ")}}function Ba(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"span",11),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),i&2){let e=l.\u0275\u0275nextContext(3);l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate2(" ",e.autoPause.limit.valu
1e," ",e.autoPause.limit.unitType," ")}}function Ma(i,r){if(i&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275elementStart(1,"div",7)(2,"span",13),l.\u0275\u0275text(3),l.\u0275\u0275pipe(4,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(5,Ua,3,3,"span",12)(6,Na,2,2,"span",12)(7,Ba,2,2,"span",12),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementContainerEnd()),i&2){let e=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(4,4,"ng.mobile-usage-overview.lbl.auto-pause")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",!(e.autoPause!=null&&e.autoPause.isAutopauseEnabled())),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.autoPause==null?null:e.autoPause.isUsageWithinLimit()),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.autoPause==null?null:e.autoPause.isUsageLimitReached())}}function wa(i,r){if(i&1&&(l.\u0275\u0275elementStart(0,"div",3),l.\u0275\u0275element(1,"hr"),l.\u0275\u0275elementStart(2,"div",4),l.\u0275\u0275template(3,Ta,10,6,"div",5)(4,Oa,2,1,"ng-container",6)(5,Ma,8,6,"ng-container",6),l.\u0275\u0275elementEnd()()),i&2){let e=l.\u0275\u0275nextContext();l.\u0275\u0275advance(3),l.\u0275\u0275property("ngForOf",e.consumptionData),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",(e.usage==null||e.usage.extraUsages==null?null:e.usage.extraUsages.length)>0),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",(e.autoPause==null?null:e.autoPause.limit)&&!(e.usage!=null&&e.usage.isGroupBundleUsage)&&(e.autoPause==null?null:e.autoPause.limit.value))}}var Qn=(()=>{class i{constructor(e,t,n,o,C){this.mobileUsageOverviewService=e,this.messageService=t,this.normalizationService=n,this.mobileUsageChartConfigurationService=o,this.translateService=C,this.messageEvent=new ea,this.consumptionData=[],this.messageGroups=[],this.USAGE_TYPES=["DATA","SMS","TEXT","VOICE"],this.DATA_BUCKET_TYPES=["Data National","Data EU","Data NAT/EU"]}ngOnInit(){this.calculateConsumptionData()}ngOnChanges(e){this.calculateConsumptionData()}calculateConsumptionData(){this.consumptionData=[],this.clearMessages();let e=this.usage.options?.filter(n=>n.isRoaming)||[];(w(this.usage.shared)?[this.usage.included,...this.usage.options]:[this.usage.shared,...e]).forEach(n=>{this.buildConsumptionData(n),n.option&&this.usage.isGroupBundleUsage&&this.buildConsumptionData(n.option)})}buildConsumptionData(e){this.getConsumptionDataTypesForLine().forEach(t=>{e&&!w(e[t])&&(this.updateConsumptionDataUnits(e,t),this.consumptionData=[...this.consumptionData,...e[t]])}),e&&!w(e[I.USAGE_TYPE_ZBR])&&(this.consumptionData=[...this.consumptionData,...this.getZBRUsage(e[I.USAGE_TYPE_ZBR])]),w(this.messageGroups)||this.messageEvent.emit(this.messageGroups)}getConsumptionDataTypesForLine(){return this.mobileLine.isDataOnlyPlan?I.DATA_SIM_CONSUMPTION_DATA_TYPES:I.ALL_CONSUMPTION_DATA_TYPES}getZBRUsage(e){return Fe(Ii(e,t=>(t.usedPercentage>=95&&t.usedPercentage<100&&t.name===ve.NATIONAL?this.addReachingThresholdMessage(t.name):t.usedPercentage>=100&&this.addReachedThresholdMessage(t.name),t)),t=>t.usedPercentage>0||pe(t.usedPercentage))}isShowTotalZBR(e){return e.name===ve.INTERNATIONAL||e.name===ve.NATIONAL&&e.usedPercentage&&e.usedPercentage>=95}convertToSeconds(e){return e?(e=e.length>1?e:(parseInt(e)*10).toFixed(0),(parseInt(e)*I.CONVERT_TO_SECONDS).toFixed(0)):"0"}updateConsumptionDataUnits(e,t){e[t]=e[t].map(n=>(n.name=this.mobileUsageOverviewService.getOptionName(this.usage.productInfo.name,n.name,n.isManual),n.startUnits=this.mobileUsageChartConfigurationService.getStartUnit(this.hasUnlimitedUsage(n),n.unitType,n.startUnits),n.unitType=this.mobileUsageChartConfigurationService.getModifiedUnitType(n),n))}hasUnlimitedUsage(e){return e.name==="VOICE"||e.name==="TEXT"?this.usage.productInfo?.services.filter(t=>t.serviceType==="MOBILE_CALLING").map(t=>t.specifications).flat().some(t=>e.name.toLowerCase()===t.labelKey&&t.value==="unlimited"):e.unlimited}getExtraUsages(){return this.usage.extraUsages.filter(e=>e.bucketType===I.BUCKET_TYPE_SPLIT_BILL_CAP)}getUsageTypeLabelKey(e){return this.USAGE_TYPES.indexOf(e.name)>-1?this.translateService.instant("ng.mobile-usage-overview.lbl."+e.name.toLowerCase()):this.DATA_BUCKET_TYPES.indexOf(e.bucketType)>-1?this.translateService.instant("ng.mobile-usage-overview.lbl."+this.toBucketTypeKey(e)):e.name}toBucketTypeKey(e){return e.bucketType.replace(/\/|\s/g,"-").toLowerCase()}getUsageTypeIcon(e){switch(e.name){case"TEXT":case"SMS":return"language";
1case"VOICE":return"telephone";case"DATA":return"data"}return this.DATA_BUCKET_TYPES.indexOf(e.bucketType)>-1?"data":"none"}addReachedThresholdMessage(e){this.messageService.addMessage(new ke(this.getMessageGroupName(e),e===ve.NATIONAL?I.NATIONAL_ZBR_REACHED_THRESHOLD_WARNING:I.INTERNATIONAL_ZBR_REACHED_THRESHOLD_WARNING))}addReachingThresholdMessage(e){this.messageService.addMessage(new ke(this.getMessageGroupName(e),I.NATIONAL_ZBR_REACHING_THRESHOLD_WARNING))}getMessageGroupName(e){let t=this.normalizationService.normalizeKey(e);return this.messageGroups.push(t),t}clearMessages(){this.messageGroups.forEach(e=>{this.messageService.clearMessages(e)}),this.messageGroups=[]}getUsedUnitsAndUnitType(e){return e.usedUnits+" "+this.getUnitType(e)}getUnitType(e){return e.usedUnitType?e.usedUnitType:e.unitType}static{this.\u0275fac=function(t){return new(t||i)(l.\u0275\u0275directiveInject(ue),l.\u0275\u0275directiveInject(W),l.\u0275\u0275directiveInject(Li),l.\u0275\u0275directiveInject(xe),l.\u0275\u0275directiveInject(zi.TranslateService))}}static{this.\u0275cmp=l.\u0275\u0275defineComponent({type:i,selectors:[["app-consumption-data"]],inputs:{usage:"usage",mobileLine:"mobileLine",autoPause:"autoPause"},outputs:{messageEvent:"messageEvent"},standalone:!1,features:[l.\u0275\u0275NgOnChangesFeature],decls:1,vars:1,consts:[["unlimitedData",""],["limitedData",""],["class","mobile-overview-usage__consumption-part",4,"ngIf"],[1,"mobile-overview-usage__consumption-part"],[1,"consumption-part__consumption-section","p--n","cursor--default"],["class","row consumption-section__consumption-field py--m justify-content--between border--b--r border-width--b--r border-style--b--solid",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"row","consumption-section__consumption-field","py--m","justify-content--between","border--b--r","border-width--b--r","border-style--b--solid"],[1,"col-md-8","col-xs-7","consumption-field__plan","text-weight--g","text--xm--md","text--s",3,"className"],[3,"ngTemplateOutlet",4,"ngIf"],[3,"ngTemplateOutlet"],[1,"col-md-4","col-xs-5","consumption-field__value","text-weight--g","text-align--right"],["class","col-md-4 col-xs-5 consumption-field__value text-weight--g text-align--right",4,"ngIf"],[1,"col-md-8","col-xs-7","consumption-field__plan","text-weight--g","text--xm--md","text--s"]],template:function(t,n){t&1&&l.\u0275\u0275template(0,wa,6,3,"div",2),t&2&&l.\u0275\u0275property("ngIf",(n.consumptionData==null?null:n.consumptionData.length)>0)},dependencies:[ii.NgForOf,ii.NgIf,ii.NgTemplateOutlet,zi.TranslatePipe],encapsulation:2})}}return i})();import{DOCUMENT as hs}from"@angular/common";import"@angular/core";import"@telenet/ng-lib-ocapi";var Ae=class{};import*as E from"@angular/core";import*as oo from"@telenet/ng-lib-ocapi";import*as qi from"@angular/common";import"@angular/core";import{ConfigConstants as Aa}from"@telenet/ng-lib-config";import*as m from"@angular/core";import*as Zn from"@telenet/ng-lib-config";import*as De from"@angular/common";import*as Jn from"@ngx-translate/core";var Nt=i=>({value:i}),Da=i=>({count:i});function Ra(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"span",13),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"translate"),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.your-plan",m.\u0275\u0275pureFunction1(4,Nt,e.card==null?null:e.card.bundleName))," ")}}function Fa(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"span",14),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"translate"),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.plan-members",m.\u0275\u0275pureFunction1(4,Nt,e.card==null?null:e.card.bundleName))," ")}}function ka(i,r){i&1&&(m.\u0275\u0275elementStart(0,"div",15)(1,"span"),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()),i&2&&(m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-overview.lbl.group-totals")))}function Ga(i,r){i&1&&m.\u0275\u0275elementContainer(0)}function Va(i,r){if(i&1&&(m.\u0275\u0275elementContainerStart(0),m.\u0275\u0275template(1,Ga,1,0,"ng-container",16),m.\u0275\u0275elementContainerEnd()),i&2){m.\u0275\u0275nextContext();let e=m.\u0275\u0275reference(15);m.\u0275\u0275advance(),m.\u0275\u0275property("ngTemplateOutlet",e)}}function ja(i,r){i&1&&m.\u0275\u0275elementContainer(0)}function Ha(i,r){if(i&1&&(m.\u0275\u0275elementContainerStart(0),m.\u0275\u0275template(1,ja,1,0,"ng-container",16),m.\u0275\u0275elementContainerEnd()),i&2){m.\u0275\u0275nextContext();let e=m.\u0275\u0275reference(17);m.\u0275\u0275advance(),m.\u0275\u0275property("ngTemplateOutlet",e)}}function Ya(i,r){i&1&&(m.\u0275\u0275elementStart(0,"div",17),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"translate"),m.\u0275\u0275elementEnd()),i&2&&(m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-overview.lbl.group-totals")," "))}function $a(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div",18)(1,"span"),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate2(" ",e.card==null?null:e.card.nextUpdateDate," ",m.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-overview.lbl.days-untils")," ")}}function Wa(i,r){i&1&&m.\u0275\u0275elementContainer(0)}function Ka(i,r){if(i&1&&(m.\u0275\u0275elementContainerStart(0),m.\u0275\u0275template(1,Wa,1,0,"ng-container",16),m.\u0275\u0275elementContainerEnd()),i&2){m.\u0275\u0275nextContext();let e=m.\u0275\u0275reference(19);m.\u0275\u0275advance(),m.\u0275\u0275property("ngTemplateOutlet",e)}}function za(i,r){if(i&1&&(m.\u0275\u0275elementContainerStart(0),m.\u0275\u0275element(1,"app-liquid-chart",21),m.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;m.\u0275\u0275advance(),m.\u0275\u0275property("config",e)}}function qa(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div",19),m.\u0275\u0275template(1,za,2,1,"ng-container",20),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(),m.\u0275\u0275property("ngForOf",e.card==null?null:e.card.chartConfigs)}}function Xa(i,r){if(i&1&&(m.\u0275\u0275elementContainerStart(0),m.\u0275\u0275element(1,"app-liquid-chart",21),m.\u0275\u0275elementContainerEnd()),i&2){let e=m.\u0275\u0275nextContext(2);m.\u0275\u0275advance(),m.\u0275\u0275property("config",e.card.chartConfig)}}function Qa(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div",19),m.\u0275\u0275template(1,Xa,2,1,"ng-container",10),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",!e.card.hasTableView)}}function Za(i,r){i&1&&m.\u0275\u0275element(0,"i",36)}function Ja(i,r){if(i&1){let e=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"img",37),m.\u0275\u0275listener("error",function(){m.\u0275\u0275restoreView(e);let n=m.\u0275\u0275nextContext().$implicit;
1return m.\u0275\u0275resetView(n.showIcon=!0)}),m.\u0275\u0275elementEnd()}if(i&2){let e=m.\u0275\u0275nextContext().$implicit,t=m.\u0275\u0275nextContext(2);m.\u0275\u0275property("src",t.getProfileImageUrl(e),m.\u0275\u0275sanitizeUrl)("override",!0)}}function es(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"span"),m.\u0275\u0275text(1),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext().$implicit,t=m.\u0275\u0275nextContext(2);m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate(t.getLabelName(e==null?null:e.label))}}function is(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"span"),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"phoneNumber"),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext().$implicit;m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(2,1,e.identifier)," ")}}function ts(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div"),m.\u0275\u0275text(1),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext().$implicit;m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate2(" ",e==null||e.usage==null||e.usage.shared==null?null:e.usage.shared.data[0].usedUnits,"\xA0",(e==null||e.usage==null||e.usage.shared==null?null:e.usage.shared.data[0].usedUnitType)||(e==null||e.usage==null||e.usage.shared==null?null:e.usage.shared.data[0].unitType)," ")}}function ns(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div")(1,"span",38),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()),i&2){let e=m.\u0275\u0275nextContext().$implicit;m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind2(3,1,"ng.mobile-usage-overview.lbl.monetary-balance",m.\u0275\u0275pureFunction1(4,Nt,e==null||e.usage==null||e.usage.outOfBundle==null?null:e.usage.outOfBundle.usedUnits)))}}function os(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"p",39),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"phoneNumber"),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext().$implicit;m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(2,1,e.identifier)," ")}}function rs(i,r){i&1&&(m.\u0275\u0275elementStart(0,"div",40),m.\u0275\u0275element(1,"div",41),m.\u0275\u0275elementEnd())}function as(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"li")(1,"div")(2,"div",24)(3,"div",25),m.\u0275\u0275template(4,Za,1,0,"i",26)(5,Ja,1,2,"img",27),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(6,"div",28)(7,"div",29)(8,"div",30)(9,"div",31),m.\u0275\u0275template(10,es,2,1,"span",10)(11,is,3,3,"span",10),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(12,"div",32),m.\u0275\u0275template(13,ts,2,2,"div",10)(14,ns,4,6,"div",10),m.\u0275\u0275elementEnd()()(),m.\u0275\u0275elementStart(15,"div",33),m.\u0275\u0275template(16,os,3,3,"p",34),m.\u0275\u0275elementEnd(),m.\u0275\u0275template(17,rs,2,0,"div",35),m.\u0275\u0275elementEnd()()()()),i&2){let e=r.$implicit,t=r.last;m.\u0275\u0275advance(4),m.\u0275\u0275property("ngIf",e.showIcon),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",!e.showIcon),m.\u0275\u0275advance(5),m.\u0275\u0275property("ngIf",e==null?null:e.pid),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",!(e!=null&&e.pid)),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",e==null||e.usage==null||e.usage.shared==null||e.usage.shared.data[0]==null?null:e.usage.shared.data[0].usedUnits),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",(e==null||e.usage==null||e.usage.outOfBundle==null?null:e.usage.outOfBundle.usedUnits)!=="0"),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",e==null?null:e.pid),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",!t)}}function ss(i,r){if(i&1){let e=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"div",42)(1,"a",43),m.\u0275\u0275listener("click",function(){m.\u0275\u0275restoreView(e);let n=m.\u0275\u0275nextContext(2);return m.\u0275\u0275resetView(n.navigateToMobileUsage())}),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()}if(i&2){let e=m.\u0275\u0275nextContext(2);m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind2(3,1,"ng.mobile-usage-overview.lbl.usage-details",m.\u0275\u0275pureFunction1(4,Da,e.card==null||e.card.bundleTableData==null?null:e.card.bundleTableData.length))," ")}}function ls(i,r){if(i&1&&(m.\u0275\u0275elementStart(0,"div",22)(1,"ul"),m.\u0275\u0275template(2,as,18,8,"li",20),m.\u0275\u0275pipe(3,"slice"),m.\u0275\u0275elementEnd(),m.\u0275\u0275template(4,ss,4,6,"div",23),m.\u0275\u0275elementEnd()),i&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(2),m.\u0275\u0275property("ngForOf",m.\u0275\u0275pipeBind3(3,2,e.card==null?null:e.card.bundleTableData,0,4)),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",e.card==null||e.card.bundleTableData==null?null:e.card.bundleTableData.length)}}var eo=(()=>{class i extends ae{constructor(e,t,n){super(n,document),this.mobileUsageOverviewService=e,this.configService=t}getProfileImageUrl(e){if(e&&e.pid)return this.configService.getConfig(Aa.OCAPI_URl)+I.OCAPI_RESOURCE_URL+e.pid}getLabelName(e){return this.mobileUsageOverviewService.getNameByLabel(e)}navigateToMobileUsage(){this.processClick(this.card.redirectionUrl)}static{this.\u0275fac=function(t){return new(t||i)(m.\u0275\u0275directiveInject(ue),m.\u0275\u0275directiveInject(Zn.C
1onfigService),m.\u0275\u0275directiveInject(m.ElementRef))}}static{this.\u0275cmp=m.\u0275\u0275defineComponent({type:i,selectors:[["app-group-view"]],inputs:{card:"card"},standalone:!1,features:[m.\u0275\u0275InheritDefinitionFeature],decls:20,vars:8,consts:[["liquidChartDesktop",""],["liquidChartMobile",""],["table",""],[1,"card-content--wave-data-card--group-view","pr--xxs",3,"click"],[1,"group-view__title-section","js-hide-card-skeleton-identifier","text--m","line-height--20"],[1,"title-section__first-content","font--body-small","mb--s"],["class","text-weight--g",4,"ngIf"],["class","text-weight--g hide-from-sm",4,"ngIf"],["class","hide-from-sm",4,"ngIf"],[1,"group-view__body","group-view__body--with-list"],[4,"ngIf"],["class","font--body-small mb--xxs group-view__footer-section hide-until-sm",4,"ngIf"],["class","mb--n font--caption color-shade_64 text-align--center",4,"ngIf"],[1,"text-weight--g"],[1,"text-weight--g","hide-from-sm"],[1,"hide-from-sm"],[4,"ngTemplateOutlet"],[1,"font--body-small","mb--xxs","group-view__footer-section","hide-until-sm"],[1,"mb--n","font--caption","color-shade_64","text-align--center"],[1,"wave-data-card__wave-section"],[4,"ngFor","ngForOf"],[3,"config"],[1,"group-view__body__list"],["class","group-view__footer-section group-view__footer-section-list fl-right--md ml--s--md",4,"ngIf"],[1,"list-item"],[1,"group-view__content-section__image","display--flex","align-items--center","justify-content--center"],["class","icon icon-md text-weight--xxs icon-sim-card",4,"ngIf"],["class","icon-circle account-selector__list__image","alt","profile",3,"src","override","error",4,"ngIf"],[1,"item-details","pl--xs"],[1,"item-details--username"],[1,"item-details--user-consumption","align-items--start"],[1,"font--caption-bold"],[1,"text--xs","text-weight--xl","text-align--right","pl--xxs"],[1,"item-details--user-consumption"],["class","font--caption-small color-shade_64",4,"ngIf"],["class","pt--xxs",4,"ngIf"],[1,"icon","icon-md","text-weight--xxs","icon-sim-card"],["alt","profile",1,"icon-circle","account-selector__list__image",3,"error","src","override"],[1,"color-notification--error--light"],[1,"font--caption-small","color-shade_64"],[1,"pt--xxs"],[1,"divider","divider--xs__very-light-grey"],[1,"group-view__footer-section","group-view__footer-section-list","fl-right--md","ml--s--md"],["href","javascript:void(0)",1,"footer-section--more-info","font--caption-bold","mb-5","link",3,"click"]],template:function(t,n){if(t&1){let o=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"div",3),m.\u0275\u0275listener("click",function(){return m.\u0275\u0275restoreView(o),m.\u0275\u0275resetView(n.navigateToMobileUsage())}),m.\u0275\u0275elementStart(1,"div",4)(2,"div",5)(3,"div"),m.\u0275\u0275template(4,Ra,3,6,"span",6)(5,Fa,3,6,"span",7),m.\u0275\u0275elementEnd()(),m.\u0275\u0275template(6,ka,4,3,"div",8),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(7,"div",9)(8,"div"),m.\u0275\u0275template(9,Va,2,1,"ng-container",10)(10,Ha,2,1,"ng-container",10)(11,Ya,3,3,"div",11)(12,$a,4,4,"div",12),m.\u0275\u0275elementEnd(),m.\u0275\u0275template(13,Ka,2,1,"ng-container",10),m.\u0275\u0275elementEnd()(),m.\u0275\u0275template(14,qa,2,1,"ng-template",null,0,m.\u0275\u0275templateRefExtractor)(16,Qa,2,1,"ng-template",null,1,m.\u0275\u0275templateRefExtractor)(18,ls,5,6,"ng-template",null,2,m.\u0275\u0275templateRefExtractor)}t&2&&(m.\u0275\u0275advance(4),m.\u0275\u0275property("ngIf",n.card.chartConfig||n.card.chartConfigs),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card.hasTableView),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card.chartConfig),m.\u0275\u0275advance(3),m.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfigs),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfig),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card.chartConfig||n.card.chartConfigs),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card.chartConfig||n.card.chartConfigs),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.card.hasTableView))},dependencies:[De.NgForOf,De.NgIf,De.NgTemplateOutlet,Ni,se,De.SlicePipe,Oe,Jn.TranslatePipe],encapsulation:2})}}return i})();import"@angular/core";import*as y from"@angular/core";import*as ti from"@angular/common";import*as io from"@ngx-translate/core";var ds=i=>({"card-content--wave-data-card__with-double-waves":i}),to=i=>({value:i}),ms=i=>({"group-view__body--without-wave":i});
1function ps(i,r){if(i&1&&(y.\u0275\u0275elementStart(0,"div",14),y.\u0275\u0275text(1),y.\u0275\u0275pipe(2,"translate"),y.\u0275\u0275elementEnd()),i&2){let e=y.\u0275\u0275nextContext();y.\u0275\u0275advance(),y.\u0275\u0275textInterpolate1(" ",y.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.out-of-bundle-description-card",y.\u0275\u0275pureFunction1(4,to,e.card==null?null:e.card.outOfBundle))," ")}}function us(i,r){if(i&1&&(y.\u0275\u0275elementContainerStart(0),y.\u0275\u0275element(1,"app-liquid-chart",16),y.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;y.\u0275\u0275advance(),y.\u0275\u0275property("config",e)}}function gs(i,r){if(i&1&&(y.\u0275\u0275elementContainerStart(0),y.\u0275\u0275template(1,us,2,1,"ng-container",15),y.\u0275\u0275elementContainerEnd()),i&2){let e=y.\u0275\u0275nextContext();y.\u0275\u0275advance(),y.\u0275\u0275property("ngForOf",e.card==null?null:e.card.chartConfigs)}}function _s(i,r){if(i&1&&(y.\u0275\u0275elementContainerStart(0),y.\u0275\u0275element(1,"app-liquid-chart",16),y.\u0275\u0275elementContainerEnd()),i&2){let e=y.\u0275\u0275nextContext();y.\u0275\u0275advance(),y.\u0275\u0275property("config",e.card.chartConfig)}}var no=(()=>{class i extends ae{constructor(e){super(e,document)}navigateToMobileUsage(){this.processClick(this.card.redirectionUrl)}static{this.\u0275fac=function(t){return new(t||i)(y.\u0275\u0275directiveInject(y.ElementRef))}}static{this.\u0275cmp=y.\u0275\u0275defineComponent({type:i,selectors:[["app-line-view"]],inputs:{card:"card"},standalone:!1,features:[y.\u0275\u0275InheritDefinitionFeature],decls:26,vars:25,consts:[[1,"card-content--wave-data-card--group-view",3,"click","ngClass"],[1,"group-view__title-section","js-hide-card-skeleton-identifier","text--m","line-height--20"],[1,"title-section__first-content"],[1,"display--flex"],[1,"icon","icon-usage","mr--m","hide-until-sm"],[1,"text-weight--g"],[1,"pr--xxs","pl--xxs"],["class","color-red text-weight--g text-align--right mr--xs",4,"ngIf"],[1,"group-view__body",3,"ngClass"],[1,"wave-data-card__wave-section","no-scroll","p--xs","pt--n","pb-0"],[4,"ngIf"],[1,"group-view__footer-section"],[1,"mb-0"],["href","javascript:void(0)",1,"footer-section--more-info",3,"click"],[1,"color-red","text-weight--g","text-align--right","mr--xs"],[4,"ngFor","ngForOf"],[3,"config"]],template:function(t,n){t&1&&(y.\u
10275\u0275elementStart(0,"div",0),y.\u0275\u0275listener("click",function(){return n.navigateToMobileUsage()}),y.\u0275\u0275elementStart(1,"div",1)(2,"div",2)(3,"div",3),y.\u0275\u0275element(4,"i",4),y.\u0275\u0275elementStart(5,"span",5),y.\u0275\u0275text(6),y.\u0275\u0275pipe(7,"translate"),y.\u0275\u0275elementEnd()(),y.\u0275\u0275elementStart(8,"div")(9,"span",6),y.\u0275\u0275text(10,"|"),y.\u0275\u0275elementEnd(),y.\u0275\u0275elementStart(11,"span"),y.\u0275\u0275text(12),y.\u0275\u0275pipe(13,"phoneNumber"),y.\u0275\u0275elementEnd()()(),y.\u0275\u0275template(14,ps,3,6,"div",7),y.\u0275\u0275elementEnd(),y.\u0275\u0275elementStart(15,"div",8)(16,"div",9),y.\u0275\u0275template(17,gs,2,1,"ng-container",10)(18,_s,2,1,"ng-container",10),y.\u0275\u0275elementEnd()(),y.\u0275\u0275elementStart(19,"div",11)(20,"div",12),y.\u0275\u0275text(21),y.\u0275\u0275pipe(22,"translate"),y.\u0275\u0275elementEnd(),y.\u0275\u0275elementStart(23,"a",13),y.\u0275\u0275listener("click",function(){return n.navigateToMobileUsage()}),y.\u0275\u0275text(24),y.\u0275\u0275pipe(25,"translate"),y.\u0275\u0275elementEnd()()()),t&2&&(y.\u0275\u0275property("ngClass",y.\u0275\u0275pureFunction1(19,ds,(n.card==null||n.card.chartConfigs==null?null:n.card.chartConfigs.length)>1)),y.\u0275\u0275advance(6),y.\u0275\u0275textInterpolate1(" ",y.\u0275\u0275pipeBind2(7,10,"ng.mobile-usage-overview.lbl.your-plan",y.\u0275\u0275pureFunction1(21,to,n.card==null?null:n.card.bundleName))," "),y.\u0275\u0275advance(6),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(13,13,n.card==null?null:n.card.lineIdentifier)),y.\u0275\u0275advance(2),y.\u0275\u0275property("ngIf",n.card==null?null:n.card.outOfBundle),y.\u0275\u0275advance(),y.\u0275\u0275property("ngClass",y.\u0275\u0275pureFunction1(23,ms,(n.card==null||n.card.chartConfigs==null?null:n.card.chartConfigs.length)===0||!(n.card!=null&&n.card.chartConfigs)&&!(n.card!=null&&n.card.chartConfig))),y.\u0275\u0275advance(2),y.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfigs),y.\u0275\u0275advance(),y.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfig),y.\u0275\u0275advance(3),y.\u0275\u0275textInterpolate2(" ",n.card.nextUpdateDate," ",y.\u0275\u0275pipeBind1(22,15,"ng.mobile-usage-overview.lbl.days-untils")," "),y.\u0275\u0275advance(3),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(25,17,"ng.mobile-usage-overview.lbl.more-usage-details")))},dependencies:[ti.NgClass,ti.NgForOf,ti.NgIf,se,Oe,io.TranslatePipe],encapsulation:2})}}return i})();import*as ro from"@ngx-translate/core";function vs(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-line-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext(3);E.\u0275\u0275advance(),E.\u0275\u0275property("card",e.bundleCards[0])}}function Cs(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-group-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext().$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("card",e)}}function bs(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-line-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext().$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("card",e)}}function Ss(i,r){if(i&1&&(E.\u0275\u0275elementStart(0,"div",9),E.\u0275\u0275template(1,Cs,2,1,"ng-container",2)(2,bs,2,1,"ng-container",2),E.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.isGroupView),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",!e.isGroupView)}}function Es(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275elementStart(1,"ngx-slick-carousel",7,0),E.\u0275\u0275template(3,Ss,3,2,"div",8),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext(3);E.\u0275\u0275advance(),E.\u0275\u0275property("config",e.slickConfig),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngForOf",e.bundleCards)}}function xs(i,r){if(i&1&&(E.\u0275\u0275elementStart(0,"div",5),E.\u0275\u0275template(1,vs,2,1,"ng-container",2)(2,Es,4,2,"ng-container",2),E.\u0275\u0275elementEnd()),i&2){let e=E.\u
10275\u0275nextContext(2);E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCards.length===1),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCards.length>1)}}function Ts(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-line-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext(3);E.\u0275\u0275advance(),E.\u0275\u0275property("card",e.bundleCardsMobile[0])}}function Is(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-group-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext().$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("card",e)}}function ys(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-line-view",6),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext().$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("card",e)}}function Ls(i,r){if(i&1&&(E.\u0275\u0275elementStart(0,"div",9),E.\u0275\u0275template(1,Is,2,1,"ng-container",2)(2,ys,2,1,"ng-container",2),E.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.isGroupView),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",!e.isGroupView)}}function Os(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275elementStart(1,"ngx-slick-carousel",7,0),E.\u0275\u0275template(3,Ls,3,2,"div",8),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext(3);E.\u0275\u0275advance(),E.\u0275\u0275property("config",e.slickConfigMobile),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngForOf",e.bundleCardsMobile)}}function Us(i,r){if(i&1&&(E.\u0275\u0275elementStart(0,"div",5),E.\u0275\u0275template(1,Ts,2,1,"ng-container",2)(2,Os,4,2,"ng-container",2),E.\u0275\u0275elementEnd()),i&2){let e=E.\u0275\u0275nextContext(2);E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCardsMobile.length===1),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCardsMobile.length>1)}}function Ns(i,r){if(i&1&&(E.\u0275\u0275elementStart(0,"div",10)(1,"div",11)(2,"div",12)(3,"span"),E.\u0275\u0275text(4),E.\u0275\u0275pipe(5,"translate"),E.\u0275\u0275elementEnd()()(),E.\u0275\u0275element(6,"app-liquid-chart",13),E.\u0275\u0275elementEnd()),i&2){let e=E.\u0275\u0275nextContext(2);E.\u0275\u0275advance(4),E.\u0275\u0275textInterpolate(E.\u0275\u0275pipeBind1(5,2,"ng.mobile-usage-overview.lbl.usage")),E.\u0275\u0275advance(2),E.\u0275\u0275property("hasActivationInProgressProduct",e.hasNotActiveAndPendingActivationMobileLines)}}function Bs(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275template(1,xs,3,2,"div",3)(2,Us,3,2,"div",3)(3,Ns,7,4,"div",4),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext();E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCards.length>0&&!e.isMobileView),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.bundleCardsMobile.length>0&&e.isMobileView),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",e.hasNotActiveAndPendingActivationMobileLines)}}function Ms(i,r){if(i&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275elementStart(1,"div",14),E.\u0275\u0275element(2,"i",15),E.\u0275\u0275elementStart(3,"div",16)(4,"div",17),E.\u0275\u0275text(5),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(6,"div",18),E.\u0275\u0275text(7),E.\u0275\u0275pipe(8,"translate"),E.\u0275\u0275elementEnd()()(),E.\u0275\u0275elementContainerEnd()),i&2){let e=E.\u0275\u0275nextContext();E.\u0275\u0275advance(5),E.\u0275\u0275textInterpolate(e.cardTitle),E.\u0275\u0275advance(2),E.\u0275\u0275textInterpolate1(" ",E.\u0275\u0275pipeBind1(8,2,"ng.mobile-usage-overview.error.service-not-available")," ")}}var ao=(()=>{class i extends ae{constructor(e,t,n,o,C,N,P,F,q){super(q,F),this.loginService=e,this.productService=t,this.cdr=n,this.mediaQueryService=o,this.mobileUsageChartConfigurationService=C,this.mobileUsageOverviewService=N,this.productsStoreService=P,this.mobileUsageOverviewURL="",this.bundleCards=[],this.bundleCardsMobile=[],this.selectedAccounts=[],this.commonBundleAccounts=[],this.slickConfig=Object.assign({},I.CAROUSEL_CONFIG),this.slickConfigMobile=Object.assign({},I.CAROUSEL_CONFIG),this.showErrorCard=!1,this.isBundle=!1}ngOnInit(){this.hasMobileProduct&&(this.isMobileView=this.mediaQueryService.getDeviceName()===Oi.MOBILE,this.obs(this.loginService.getLoginDetail
1s()).subscribe(e=>{this.loginDetails=e,this.hasNotActiveAndPendingActivationMobileLines||this.loadMobileLines()}))}ngAfterViewInit(){this.hasMobileProduct?this.hideForBundle==="true"?this.hideBundleCardforOverviewSection():setTimeout(()=>this.disableCardClickEvent("#mobile-usage-overview")):this.hideCard()}loadMobileLines(){this.productService.getProductLinesByType(I.MESSAGE_GROUP_NAME,Z.PRODUCT_TYPE_MOBILE).subscribe({next:e=>{w(e)?this.hideCard():(this.isBundle=e[0].productType===wi.BUNDLE.toLowerCase(),this.moveLoggedinLineToFirstPosition(e),this.commonBundleAccounts=this.filterBundleAccounts(),this.selectedAccounts=this.selectedAccounts.concat(this.commonBundleAccounts),this.selectedAccounts=this.selectedAccounts.concat(this.mobileLines.filter(t=>t.productType===J.PRODUCT_TYPE_MOBILE)),this.fetchUsagesData())},error:e=>{this.showErrorCard=!0}})}hideBundleCardforOverviewSection(){this.productsStoreService.getStoreData().subscribe(e=>{this.hasNotActiveAndPendingActivationMobileLines=e.hasNotActiveAndPendingActivationMobileLines,(!this.hasMobileProduct||e.hasBundleProduct&&e.hasInternetProduct&&e.hasBundleMobileProduct)&&this.hideCard(),this.hasNotActiveAndPendingActivationMobileLines&&this.disableCardClickEvent("#mobile-usage-overview")})}moveLoggedinLineToFirstPosition(e){this.mobileLines=Le(e,n=>n.identifier);let t=this.mobileLines.splice(this.mobileLines.findIndex(n=>n.identifier===this.loginDetails.username.replace(/(\+32)/,"0")),1);this.mobileLines.splice(0,0,t[0])}setSlickConfig(){this.slickConfigMobile.dots=this.bundleCardsMobile.length>1,this.slickConfigMobile.arrows=!1,this.slickConfig.dots=this.bundleCards.length>1,this.slickConfig.arrows=this.bundleCards.length>1,this.slickConfig.nextArrow='<div class="cards-slider-button arrow arrow--right slick-arrow cursor--pointer" aria-disabled="false"></div>',this.slickConfig.prevArrow='<div class="cards-slider-button arrow arrow--left slick-arrow cursor--pointer" aria-disabled="false"></div>',this.cdr.detectChanges()}getUsageDetailsUrl(e){let t=this.mobileUsageOverviewURL.includes("?")?"&":"?";return e.lineIdentifier?this.mobileUsageOverviewURL+t+Z.IDENTIFIER+"="+e.lineIdentifier:this.mobileUsageOverviewURL}filterBundleAccounts(){let e=Le(this.mobileLines.filter(t=>t.productType===J.PRODUCT_TYPE_BUNDLE),"usage.shared.data[0].usedUnits").reverse();if((this.loginDetails.isMaster()||this.loginDetails.isContractHolder())&&e.length>0){let t={label:I.GROUP_VIEW,productType:J.PRODUCT_TYPE_BUNDLE,bundleIdentifier:ye(e).bundleIdentifier,description:ye(e).label};e.splice(0,0,t)}return e}fetchUsagesData(){this.mobileUsageOverviewService.getUsageForProductSubscriptions(this.selectedAccounts).subscribe(e=>{e.includes(null)?this.showErrorCard=!0:(e.forEach((t,n)=>{Ye(t,"shared.data")&&t.shared.data.length>1&&(t.shared.data=yi(t.shared.data,["name"],["desc"]));let o=this.selectedAccounts[n];this.convertMobileUsageUnits(t),this.mobileUsageOverviewService.addCommonBuckets(t),o.usage=t,o.usage.isGroupBundleUsage=this.mobileUsageOverviewService.isGroupBundle(o),o.usage.isLineBundleUsage=!this.mobileUsageOverviewService.isGroupBundle(o),this.calculateBundleCard(o)}),this.setSlickConfig())})}convertMobileUsageUnits(e){e.included&&I.ALL_CONSUMPTION_DATA_TYPES.forEach(t=>{e.included[t]&&(e.included[t]=e.included[t].map(n=>e.convertUnits(n)))}),e.options&&e.options.forEach(t=>{I.ALL_CONSUMPTION_DATA_TYPES.forEach(n=>{t[n]&&(t[n]=t[n].map(o=>e.convertUnits(o)))})})}calculateBundleCard(e){let t=new Ae,n=e.productType===J.PRODUCT_TYPE_BUNDLE;t.isGroupView=this.mobileUsageOverviewService.isGroupBundle(e),t.bundleName=e.usage.productInfo.labelKey,t.nextUpdateDate=e.usage.daysForNextBill,t.isGroupView||(t.lineIdentifier=e.identifier),t.isGroupView&&(t.hasTableView=!0,t.bundleTableData=this.commonBundleAccounts.slice(1)),e.usage.outOfBundle.usedUnits!=="0"&&(t.outOfBundle=e.usage.outOfBundle.usedUnits),t.redirectionUrl=this.getUsageDetailsUrl(t),t.chartConfigs=this.calculateChartConfigs(e.usage,n),this.calculateBundleCardsForMobileView(t),this.bundleCards.push(t)}calculateBundleCardsForMobileView(e){if(w(e.chartConfigs)&&e){let t=this.getNewMobileCard(e);this.bundleCardsMobile.push(t);return}
1if(e&&e.chartConfigs.forEach(t=>{let n=this.getNewMobileCard(e);n.chartConfig=t,this.bundleCardsMobile.push(n)}),e.hasTableView){let t=this.getNewMobileCard(e);t.hasTableView=e.hasTableView,t.bundleTableData=e.bundleTableData,this.bundleCardsMobile.push(t)}}getNewMobileCard(e){let t=new Ae;return t.bundleName=e.bundleName,t.lineIdentifier=e.lineIdentifier,t.nextUpdateDate=e.nextUpdateDate,t.isGroupView=e.isGroupView,t.redirectionUrl=e.redirectionUrl,t.outOfBundle=e.outOfBundle,t}calculateChartConfigs(e,t){let n=t?this.getBundleUsageChartConfig(e):this.getMobileUsageChartConfig(e);return n.length>I.MAX_BLOB_ON_CARD_VIEW&&n.splice(I.MAX_BLOB_ON_CARD_VIEW),n}getMobileUsageChartConfig(e){let t=Ti(I.USAGE_BLOB_TYPES.map(n=>e.included[n].filter(o=>o&&(e.isDataUnlimited(o.unitType,o.unlimited)||!o.unlimited)).map(o=>this.mobileUsageChartConfigurationService.getChartConfiguration(o,o.unlimited,null,null,null,o.bucketType===I.BUCKET_TYPE_EU_DATA||o.bucketType===I.BUCKET_EU_DATA||o.bucketType===I.BUCKET_TYPE_OUTSIDE_EUROPE?this.mobileUsageOverviewService.getOptionName(e.productInfo.name,o.name,!1,o.bucketType===I.BUCKET_TYPE_OUTSIDE_EUROPE):null))));return e.productInfo.usageBasedRatePlan&&t.push(this.getPvvUsage(e)),t}getBundleUsageChartConfig(e){let t=ye(e.shared[I.USAGE_BLOB_TYPE_DATA]);return e.isLineBundleUsage&&(t.usedPercentage=0,t.remainingUnits=t.usedUnits),[this.mobileUsageChartConfigurationService.getChartConfiguration(t,t.unlimited,e.productInfo.usageBasedRatePlan,e.isLineBundleUsage,e.dataPause)]}getPvvUsage(e){let t=e.outOfBundle;return t.usedPercentage=0,t.remainingUnits=t.usedUnits,t.startUnits=t.usedUnits,this.mobileUsageChartConfigurationService.getChartConfiguration(t,t.unlimited,e.productInfo.usageBasedRatePlan)}static{this.\u0275fac=function(t){return new(t||i)(E.\u0275\u0275directiveInject(oo.LoginService),E.\u0275\u0275directiveInject(re),E.\u0275\u0275directiveInject(E.ChangeDetectorRef),E.\u0275\u0275directiveInject(Ui),E.\u0275\u0275directiveInject(xe),E.\u0275\u0275directiveInject(ue),E.\u0275\u0275directiveInject(Be),E.\u0275\u0275directiveInject(hs),E.\u0275\u0275directiveInject(E.ElementRef))}}static{this.\u0275cmp=E.\u0275\u0275defineComponent({type:i,selectors:[["app-bundle-card"]],inputs:{mobileUsageOverviewURL:"mobileUsageOverviewURL",cardTitle:"cardTitle",hasMobileProduct:"hasMobileProduct",hideForBundle:"hideForBundle",hasNotActiveAndPendingActivationMobileLines:"hasNotActiveAndPendingActivationMobileLines"},standalone:!1,features:[E.\u0275\u0275InheritDefinitionFeature],decls:3,vars:2,consts:[["slickModal","slick-carousel"],["id","bundle-card"],[4,"ngIf"],["class","wave-data-card__wave-section js-hide-card-skeleton-identifier",4,"ngIf"],["class","wave-data-card__wave-section",4,"ngIf"],[1,"wave-data-card__wave-section","js-hide-card-skeleton-identifier"],[3,"card"],[1,"carousel",3,"config"],["ngxSlickItem","","class","slide",4,"ngFor","ngForOf"],["ngxSlickItem","",1,"slide"],[1,"wave-data-card__wave-section"],[1,"group-view__title-section","js-hide-card-skeleton-identifier","text-align--center","pt--xl"],[1,"text-weight--g"],[3,"hasActivationInProgressProduct"],[1,"notification--card"],[1,"icon","icon-error-shape"],[1,"notification--card__message","js-hide-card-skeleton-identifier"],[1,"notification--card__message__header"],[1,"notification--card__message__description"]],template:function(t,n){t&1&&(E.\u0275\u0275elementStart(0,"div",1),E.\u0275\u0275template(1,Bs,4,3,"ng-container",2)(2,Ms,9,4,"ng-container",2),E.\u0275\u0275elementEnd()),t&2&&(E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",!n.showErrorCard),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",n.showErrorCard))},dependencies:[qi.NgForOf,qi.NgIf,We,Ke,se,eo,no,ro.TranslatePipe],encapsulation:2})}}return i})();import{DOCUMENT as ol}from"@angular/common";import"@angular/core";import"@telenet/ng-lib-ocapi";import*as S from"@angular/core";import*as uo from"@telenet/ng-lib-ocapi";import*as Qi from"@angular/common";import"@angular/core";import*as f from"@angular/core";import*as Xi from"@angular/common";import*as so from"@ngx-translate/core";var Ps=i=>({value:i});function As(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"span",9),f.\u0275\u0275text(1),f.\u0275\u0275pipe(2,"translate"),f.\u0275\u0275elementEnd()),i&2){let e=f.\u0275\u0275nextContext();f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate1(" ",f.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.your-plan",f.\u0275\u0275pureFunction1(4,Ps,e.card==null?null:e.card.bundleName))," ")}}function Ds(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"p",22)(1,"b"),f.\u0275\u0275text(2),f.\u0275\u0275elementEnd()()),i&2){let e=f.\u0275\u0275nextContext().$implicit,t=f.\u0275\u0275nextContext(3);f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate(t.getUsedUnits(e.usage.included.data[0]))}}function Rs(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"p",23),f.\u0275\u0275text(1),f.\u0275\u0275elementEnd()),i&2){let e=f.\u0275\u0275nextContext().$implicit;f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate1("+\u20AC",e.usage.outOfBundle.usedUnits)}}function Fs(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15),f.\u0275\u0275element(5,"i",16),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(6,"div",17)(7,"span",18),f.\u0275\u0275text(8),f.\u0275\u0275pipe(9,"phoneNumber"),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(10,"div",19),f.\u0275\u0275template(11,Ds,3,1,"p",20)(12,Rs,2,1,"p",21),f.\u0275\u0275elementEnd()()(),f.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;f.\u0275\u0275advance(8),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(9,3,e.identifier)),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngIf",e.usage.included.data[0].usedUnits!=="0"),f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.usage.outOfBundle.usedUnits!=="0")}}function ks(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"p",10)(2,"b"),f.\u0275\u0275text(3),f.\u0275\u0275pipe(4,"translate"),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(5,"div",6),f.\u0275\u0275template(6,Fs,13,5,"ng-container",11),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementContainerEnd()),i&2){let e=f.\u0275\u0275nextContext(2);f.\u0275\u0275advance(3),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(4,2,"ng.mobile-usage-overview.lbl.ongelimiteerde-sim")),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngForOf",e.unlimitedMobileLines)}}function Gs(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"p",22)(1,"b"),f.\u0275\u0275text(2),f.\u0275\u0275elementEnd()()),i&2){let e=f.\u0275\u0275nextContext().$implicit,t=f.\u0275\u0275nextContext(3);f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate(t.getUsedUnits(e.usage.included.data[0]))}}function Vs(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"p",23),f.\u0275\u0275text(1),f.\u0275\u0275elementEnd()),i&2){let e=f.\u0275\u0275nextContext().$implicit;f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate1("+\u20AC",e.usage.outOfBundle.usedUnits)}}function js(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15),f.\u0275\u0275element(5,"i",16),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(6,"div",17)(7,"span",18),f.\u0275\u0275text(8),f.\u0275\u0275pipe(9,"phoneNumber"),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(10,"div",19),f.\u0275\u0275template(11,Gs,3,1,"p",20)(12,Vs,2,1,"p",21),f.\u0275\u0275elementEnd()()(),f.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;f.\u0275\u0275advance(8),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(9,3,e.identifier)),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngIf",e.usage.included.data[0].usedUnits!=="0"),f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.usage.outOfBundle.usedUnits!=="0")}}function Hs(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"div",27)(1,"span",28),f.\u0275\u0275text(2),f.\u0275\u0275pipe(3,"translate"),f.\u0275\u0275elementEnd()()),i&2){let e=f.\u0275\u0275nextContext(4);f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate2("",e.card==null?null:e.card.nextUpdateDate," ",f.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-overview.lbl.days-untils"))}}function Ys(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"div",25),f.\u0275\u0275template(2,Hs,4,4,"div",26),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementContainerEnd()),i&2){let e=f.\u0275\u0275nextContext(3);f.\u0275\u0275advance(2),f.\u0275\u0275property("ngIf",e.card.chartConfig||e.card.chartConfigs)}}function $s(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"p",24)(2,"b"),f.\u0275\u0275text(3),f.\u0275\u0275pipe(4,"translate"),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(5,"div",6),f.\u0275\u0275template(6,js,13,5,"ng-container",11)(7,Ys,3,1,"ng-container",5),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementContainerEnd()),i&2){let e=f.\u0275\u0275nextContext(2);f.\u0275\u0275advance(3),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(4,3,"ng.mobile-usage-overview.lbl.gelimiteerde-sim")),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngForOf",e.limitedMobileLines),f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.limitedMobileLines.length%2!==0)}}function Ws(i,r){if(i&1&&(f.\u0275\u0275elementStart(0,"div",27)(1,"span",28),f.\u0275\u0275text(2),f.\u0275\u0275pipe(3,"translate"),f.\u0275\u0275elementEnd()()),i&2){let e=f.\u0275\u0275nextContext(3);f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate2("",e.card==null?null:e.card.nextUpdateDate," ",f.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-overview.lbl.days-untils"))}}function Ks(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275elementStart(1,"div",6)(2,"div",29),f.\u0275\u0275template(3,Ws,4,4,"div",26),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementContainerEnd()),i&2){let e=f.\u0275\u0275nextContext(2);f.\u0275\u0275advance(3),f.\u0275\u0275property("ngIf",e.card.chartConfig||e.card.chartConfigs)}}function zs(i,r){if(i&1&&(f.\u0275\u0275elementContainerStart(0),f.\u0275\u0275template(1,ks,7,4,"ng-container",5)(2,$s,8,5,"ng-container",5)(3,Ks,4,1,"ng-container",5),f.\u0275\u0275elementContainerEnd()),i&2){let e=f.\u0275\u0275nextContext();f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.unlimitedMobileLines&&e.unlimitedMobileLines.length>0),f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.limitedMobileLines&&e.limitedMobileLines.length>0),f.\u0275\u0275advance(),f.\u0275\u0275property("ngIf",e.limitedMobileLines.length%2===0)}}function qs(i,r){if(i&1){let e=f.\u0275\u0275getCurrentView();f.\u0275\u0275elementStart(0,"div",30)(1,"a",31),f.\u0275\u0275listener("click",function(){f.\u0275\u0275restoreView(e);let n=f.\u0275\u0275nextContext();
1return f.\u0275\u0275resetView(n.navigateToMobileUsage())}),f.\u0275\u0275text(2),f.\u0275\u0275pipe(3,"translate"),f.\u0275\u0275elementEnd()()}i&2&&(f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate1(" ",f.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-overview.lbl.new-one-up-bundle-usage-details")," "))}var lo=(()=>{class i extends ae{constructor(e){super(e,document),this.mobileLines=[],this.unlimitedMobileLines=[],this.limitedMobileLines=[]}ngOnInit(){this.card.bundleTableData&&(this.unlimitedMobileLines=this.card.bundleTableData.filter(e=>e.usage.included.data.length>1),this.limitedMobileLines=this.card.bundleTableData.filter(e=>e.usage.included.data.length==1))}navigateToMobileUsage(){this.processClick(this.card.redirectionUrl)}getUsedUnits(e){return e.usedUnits+this.getUnitType(e)}getUnitType(e){return e.usedUnitType?e.usedUnitType:e.unitType}static{this.\u0275fac=function(t){return new(t||i)(f.\u0275\u0275directiveInject(f.ElementRef))}}static{this.\u0275cmp=f.\u0275\u0275defineComponent({type:i,selectors:[["app-group-view-new-one-up-bundle"]],inputs:{card:"card",isNewBundle:"isNewBundle"},standalone:!1,features:[f.\u0275\u0275InheritDefinitionFeature],decls:10,vars:3,consts:[[1,"card-content--wave-data-card--group-view","pr--xxs",3,"click"],[1,"group-view__title-section","js-hide-card-skeleton-identifier","text--m","line-height--20"],[1,"title-section__first-content","font--body-small","mb-5"],["class","text-weight--g",4,"ngIf"],[1,"group-view__body","group-view__body--with-list"],[4,"ngIf"],[1,"row"],[1,"col-12","color-shade_64","text-align--center"],["class","group-view__footer-section group-view__footer-section-list fl-left--md mt-15",4,"ngIf"],[1,"text-weight--g"],[2,"font-size","0.8em"],[4,"ngFor","ngForOf"],[1,"col-6"],[1,"row","pb-0","mr-10","pb-5",2,"border-bottom","2px solid #f7f6f6"],[1,"col-2","pl-5","pt-5","pr-5"],[1,"circle-wave__wave--paused",2,"padding","2px 24px 2px 2px"],[1,"icon","icon-md","text-weight--xxs","icon-sim-card"],[1,"col-5","pl-0","pr-0","center-align"],[1,"color-shade_64","font--caption","pt--xxs","font--caption-small"],[1,"col-5","pl-5","pr-0","text-align--right","display--grid","center-align"],["class","font--caption pt--xxs pr-0",4,"ngIf"],["style","font-size: 0.5em; line-height: 10px;","class","color-red text-weight--g font--caption pt--xxs text-align--right pr-0 pl-5 pt-0",4,"ngIf"],[1,"font--caption","pt--xxs","pr-0"],[1,"color-red","text-weight--g","font--caption","pt--xxs","text-align--right","pr-0","pl-5","pt-0",2,"font-size","0.5em","line-height","10px"],[1,"mt-5",2,"font-size","0.8em"],[1,"col-6","display--grid","center-align"],["class","color-shade_64 text-align--center",4,"ngIf"],[1,"color-shade_64","text-align--center"],[1,"color-shade_64","font--caption","pt--xxs"],[1,"col-12","mt-20"],[1,"group-view__footer-section","group-view__footer-section-list","fl-left--md","mt-15"],["href","javascript:void(0)",1,"footer-section--more-info","font--caption-bold","mb-5","link",3,"click"]],template:function(t,n){t&1&&(f.\u0275\u0275elementStart(0,"div",0),f.\u0275\u0275listener("click",function(){return n.navigateToMobileUsage()}),f.\u0275\u0275elementStart(1,"div",1)(2,"div",2)(3,"div"),f.\u0275\u0275template(4,As,3,6,"span",3),f.\u0275\u0275elementEnd()()(),f.\u0275\u0275element(5,"div",4),f.\u0275\u0275elementEnd(),f.\u0275\u0275template(6,zs,4,3,"ng-container",5),f.\u0275\u0275elementStart(7,"div",6)(8,"div",7),f.\u0275\u0275template(9,qs,4,3,"div",8),f.\u0275\u0275elementEnd()()),t&2&&(f.\u0275\u0275advance(4),f.\u0275\u0275property("ngIf",n.card.chartConfig||n.card.chartConfigs),f.\u0275\u0275advance(2),f.\u0275\u0275property("ngIf",n.card.bundleTableData),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngIf",n.card==null||n.card.bundleTableData==null?null:n.card.bundleTableData.length))},dependencies:[Xi.NgForOf,Xi.NgIf,Oe,so.TranslatePipe],encapsulation:2})}}return i})();import"@angular/core";import*as L from"@angular/core";import*as ni from"@angular/common";import*as co from"@ngx-translate/core";var Qs=i=>({"card-content--wave-data-card__with-double-waves":i}),mo=i=>({value:i}),Zs=i=>({"group-view__body--without-wave":i});function Js(i,r){if(i&1&&(L.\u0275\u0275elementStart(0,"div",15),L.\u0275\u0275text(1),L.\u0275\u0275pipe(2,"translate"),L.\u0275\u0275elementEnd()),i&2){let e=L.\u0275\u0275nextContext();L.\u0275\u0275advance(),L.\u0275\u0275textInterpolate1(" ",L.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-overview.lbl.out-of-bundle-description-card",L.\u0275\u0275pureFunction1(4,mo,e.card==null?null:e.card.outOfBundle))," ")}}function el(i,r){if(i&1&&(L.\u0275\u0275elementContainerStart(0),L.\u0275\u0275element(1,"app-liquid-chart",17),L.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;L.\u0275\u0275advance(),L.\u0275\u0275property("config",e)}}function il(i,r){if(i&1&&(L.\u0275\u0275elementContainerStart(0),L.\u0275\u0275template(1,el,2,1,"ng-container",16),L.\u0275\u0275elementContainerEnd()),i&2){let e=L.\u0275\u0275nextContext();L.\u0275\u0275advance(),L.\u0275\u0275property("ngForOf",e.card==null?null:e.card.chartConfigs)}}function tl(i,r){if(i&1&&(L.\u0275\u0275elementContainerStart(0),L.\u0275\u0275element(1,"app-liquid-chart",17),L.\u0275\u0275elementContainerEnd()),i&2){let e=L.\u0275\u0275nextContext();L.\u0275\u0275advance(),L.\u0275\u0275property("config",e.card.chartConfig)}}var po=(()=>{class i extends ae{constructor(e){super(e,document)}navigateToMobileUsage(){this.processClick(this.card.redirectionUrl)}static{this.\u0275fac=function(t){return new(t||i)(L.\u0275\u0275directiveInject(L.ElementRef))}}static{this.\u0275cmp=L.\u0275\u0275defineComponent({type:i,selectors:[["app-line-view-new-one-up-bundle"]],inputs:{card:"card"},standalone:!1,features:[L.\u0275\u0275InheritDefinitionFeature],decls:26,vars:25,consts:[[1,"card-content--wave-data-card--group-view",3,"click","ngClass"],[1,"group-view__title-section","text--m","line-height--20"],[1,"title-section__first-content","js-hide-card-skeleton-identifier",2,"width","100%"],[1,"display--flex"],[1,"icon","icon-usage","mr--m","hide-until-sm"],[1,"text-weight--g",2,"font-size","0.8em"],[2,"padding-right","10px","font-size","0.8em"],[1,"pr--xxs","pl--xxs"],["class","color-red text-weight--g text-align--right mr--xs font--caption",4,"ngIf"],[1,"group-view__body",2,"margin-top","-5px",3,"ngClass"],[1,"wave-data-card__wave-section","no-scroll","p--xs","pt--n","pb-0"],[4,"ngIf"],[1,"group-view__footer-section",2,"position","relative","top","-3px"],[1,"mb-0","font--caption"],["href","javascript:void(0)",1,"footer-section--more-info","font--caption",3,"click"],[1,"color-red","text-weight--g","text-align--right","mr--xs","font--caption"],[4,"ngFor","ngForOf"],[3,"config"]],template:function(t,n){t&1&&(L.\u0275\u0275elementStart(0,"div",0),L.\u0275\u0275listener("click",function(){return n.navigateToMobileUsage()}),L.\u0275\u0275elementStart(1,"div",1)(2,"div",2)(3,"div",3),L.\u0275\u0275element(4,"i",4),L.\u0275\u0275elementStart(5,"span",5),L.\u0275\u0275text(6),L.\u0275\u0275pipe(7,"translate"),L.\u0275\u0275elementEnd()(),L.\u0275\u0275elementStart(8,"div",6)(9,"span",7),L.\u0275\u0275text(10,"|"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(11,"span"),L.\u0275\u0275text(12),L.\u0275\u0275pipe(13,"phoneNumber"),L.\u0275\u0275elementEnd()()()(),L.\u0275\u0275template(14,Js,3,6,"div",8),L.\u0275\u0275elementStart(15,"div",9)(16,"div",10),L.\u0275\u0275template(17,il,2,1,"ng-container",11)(18,tl,2,1,"ng-container",11),L.\u0275\u0275elementEnd()(),L.\u0275\u0275elementStart(19,"div",12)(20,"div",13),L.\u0275\u0275text(2
11),L.\u0275\u0275pipe(22,"translate"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(23,"a",14),L.\u0275\u0275listener("click",function(){return n.navigateToMobileUsage()}),L.\u0275\u0275text(24),L.\u0275\u0275pipe(25,"translate"),L.\u0275\u0275elementEnd()()()),t&2&&(L.\u0275\u0275property("ngClass",L.\u0275\u0275pureFunction1(19,Qs,(n.card==null||n.card.chartConfigs==null?null:n.card.chartConfigs.length)>1)),L.\u0275\u0275advance(6),L.\u0275\u0275textInterpolate1(" ",L.\u0275\u0275pipeBind2(7,10,"ng.mobile-usage-overview.lbl.your-plan",L.\u0275\u0275pureFunction1(21,mo,n.card==null?null:n.card.bundleName))," "),L.\u0275\u0275advance(6),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(13,13,n.card==null?null:n.card.lineIdentifier)),L.\u0275\u0275advance(2),L.\u0275\u0275property("ngIf",n.card==null?null:n.card.outOfBundle),L.\u0275\u0275advance(),L.\u0275\u0275property("ngClass",L.\u0275\u0275pureFunction1(23,Zs,(n.card==null||n.card.chartConfigs==null?null:n.card.chartConfigs.length)===0||!(n.card!=null&&n.card.chartConfigs)&&!(n.card!=null&&n.card.chartConfig))),L.\u0275\u0275advance(2),L.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfigs),L.\u0275\u0275advance(),L.\u0275\u0275property("ngIf",n.card==null?null:n.card.chartConfig),L.\u0275\u0275advance(3),L.\u0275\u0275textInterpolate2(" ",n.card.nextUpdateDate," ",L.\u0275\u0275pipeBind1(22,15,"ng.mobile-usage-overview.lbl.days-untils")," "),L.\u0275\u0275advance(3),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(25,17,"ng.mobile-usage-overview.lbl.more-usage-details")))},dependencies:[ni.NgClass,ni.NgForOf,ni.NgIf,se,Oe,co.TranslatePipe],encapsulation:2})}}return i})();import*as go from"@ngx-translate/core";function rl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-line-view-new-one-up-bundle",6),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext(3);S.\u0275\u0275advance(),S.\u0275\u0275property("card",e.bundleCards[0])}}function al(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-group-view-new-one-up-bundle",10),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext().$implicit,t=S.\u0275\u0275nextContext(4);S.\u0275\u0275advance(),S.\u0275\u0275property("card",e)("isNewBundle",t.isBundle)}}function sl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-line-view-new-one-up-bundle",6),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext().$implicit;S.\u0275\u0275advance(),S.\u0275\u0275property("card",e)}}function ll(i,r){if(i&1&&(S.\u0275\u0275elementStart(0,"div",9),S.\u0275\u0275template(1,al,2,2,"ng-container",2)(2,sl,2,1,"ng-container",2),S.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.isGroupView),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",!e.isGroupView)}}function cl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275elementStart(1,"ngx-slick-carousel",7,0),S.\u0275\u0275template(3,ll,3,2,"div",8),S.\u0275\u0275elementEnd(),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext(3);S.\u0275\u0275advance(),S.\u0275\u0275property("config",e.slickConfig),S.\u0275\u0275advance(2),S.\u0275\u0275property("ngForOf",e.bundleCards)}}function dl(i,r){if(i&1&&(S.\u0275\u0275elementStart(0,"div",5),S.\u0275\u0275template(1,rl,2,1,"ng-container",2)(2,cl,4,2,"ng-container",2),S.\u0275\u0275elementEnd()),i&2){let e=S.\u0275\u0275nextContext(2);S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCards.length===1),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCards.length>1)}}function ml(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-line-view-new-one-up-bundle",6),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext(3);S.\u0275\u0275advance(),S.\u0275\u0275property("card",e.bundleCardsMobile[0])}}function pl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-group-view-new-one-up-bundle",10),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext().$implicit,t=S.\u0275\u0275nextContext(4);S.\u0275\u0275advance(),S.\u0275\u0275property("card",e)("isNewBundle",t.isBundle)}}
1function ul(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275element(1,"app-line-view-new-one-up-bundle",6),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext().$implicit;S.\u0275\u0275advance(),S.\u0275\u0275property("card",e)}}function gl(i,r){if(i&1&&(S.\u0275\u0275elementStart(0,"div",9),S.\u0275\u0275template(1,pl,2,2,"ng-container",2)(2,ul,2,1,"ng-container",2),S.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.isGroupView),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",!e.isGroupView)}}function _l(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275elementStart(1,"ngx-slick-carousel",7,0),S.\u0275\u0275template(3,gl,3,2,"div",8),S.\u0275\u0275elementEnd(),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext(3);S.\u0275\u0275advance(),S.\u0275\u0275property("config",e.slickConfigMobile),S.\u0275\u0275advance(2),S.\u0275\u0275property("ngForOf",e.bundleCardsMobile)}}function fl(i,r){if(i&1&&(S.\u0275\u0275elementStart(0,"div",5),S.\u0275\u0275template(1,ml,2,1,"ng-container",2)(2,_l,4,2,"ng-container",2),S.\u0275\u0275elementEnd()),i&2){let e=S.\u0275\u0275nextContext(2);S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCardsMobile.length===1),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCardsMobile.length>1)}}function hl(i,r){if(i&1&&(S.\u0275\u0275elementStart(0,"div",11)(1,"div",12)(2,"div",13)(3,"span"),S.\u0275\u0275text(4),S.\u0275\u0275pipe(5,"translate"),S.\u0275\u0275elementEnd()()(),S.\u0275\u0275element(6,"app-liquid-chart",14),S.\u0275\u0275elementEnd()),i&2){let e=S.\u0275\u0275nextContext(2);S.\u0275\u0275advance(4),S.\u0275\u0275textInterpolate(S.\u0275\u0275pipeBind1(5,2,"ng.mobile-usage-overview.lbl.usage")),S.\u0275\u0275advance(2),S.\u0275\u0275property("hasActivationInProgressProduct",e.hasNotActiveAndPendingActivationMobileLines)}}function vl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275template(1,dl,3,2,"div",3)(2,fl,3,2,"div",3)(3,hl,7,4,"div",4),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext();S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCards.length>0&&!e.isMobileView),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.bundleCardsMobile.length>0&&e.isMobileView),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",e.hasNotActiveAndPendingActivationMobileLines)}}function Cl(i,r){if(i&1&&(S.\u0275\u0275elementContainerStart(0),S.\u0275\u0275elementStart(1,"div",15),S.\u0275\u0275element(2,"i",16),S.\u0275\u0275elementStart(3,"div",17)(4,"div",18),S.\u0275\u0275text(5),S.\u0275\u0275elementEnd(),S.\u0275\u0275elementStart(6,"div",19),S.\u0275\u0275text(7),S.\u0275\u0275pipe(8,"translate"),S.\u0275\u0275elementEnd()()(),S.\u0275\u0275elementContainerEnd()),i&2){let e=S.\u0275\u0275nextContext();S.\u0275\u0275advance(5),S.\u0275\u0275textInterpolate(e.cardTitle),S.\u0275\u0275advance(2),S.\u0275\u0275textInterpolate1(" ",S.\u0275\u0275pipeBind1(8,2,"ng.mobile-usage-overview.error.service-not-available")," ")}}var _o=(()=>{class i extends ae{constructor(e,t,n,o,C,N,P,F,q){super(q,F),this.loginService=e,this.productService=t,this.cdr=n,this.mediaQueryService=o,this.mobileUsageChartConfigurationService=C,this.mobileUsageOverviewService=N,this.productsStoreService=P,this.mobileUsageOverviewURL="",this.bundleCards=[],this.bundleCardsMobile=[],this.selectedAccounts=[],this.commonBundleAccounts=[],this.slickConfig=Object.assign({},I.CAROUSEL_CONFIG),this.slickConfigMobile=Object.assign({},I.CAROUSEL_CONFIG),this.showErrorCard=!1,this.isBundle=!1}ngOnInit(){this.hasMobileProduct&&(this.isMobileView=this.mediaQueryService.getDeviceName()===Oi.MOBILE,this.obs(this.loginService.getLoginDetails()).subscribe(e=>{this.loginDetails=e,this.hasNotActiveAndPendingActivationMobileLines||this.loadMobileLines()}))}ngAfterViewInit(){this.hasMobileProduct?this.hideForBundle==="true"?this.hideBundleCardforOverviewSection():setTimeout(()=>this.disableCardClickEvent("#mobile-usage-overview")):this.hideCard()}loadMobileLines(){this.productService.getProductLinesByType(I.MESSAGE_GROUP_NAME,Z.PRODUCT_TYPE_MOBILE).subscribe({next:e=>{w(e)?this.hideCard():(this.isBundle=e[0].productType===wi.BUNDLE.toLowerCase(),this.moveLoggedinLineToFirstPosition(e),this.commonBundleAccounts=this.filterBundleAccounts(),this.selectedAccounts=this.selectedAccounts.concat(this.commonBundleAccounts),this.selectedAccounts=this.selectedAccounts.concat(this.mobileLines.filter(t=>t.productType===J.PRODUCT_TYPE_MOBILE)),this.fetchUsagesData())},error:()=>{this.showErrorCard=!0}})}hideBundleCardforOverviewSection(){this.productsStoreService.getStoreData().subscribe(e=>{this.hasNotActiveAndPendingActivationMobileLines=e.hasNotActiveAndPendingActivationMobileLines,(!this.hasMobileProduct||e.hasBundleProduct&&e.hasInternetProduct&&e.hasBundleMobileProduct)&&this.hideCard(),this.hasNotActiveAndPendingActivationMobileLines&&this.disableCardClickEvent("#mobile-usage-overview")})}moveLoggedinLineToFirstPosition(e){this.mobileLines=Le(e,n=>n.identifier);let t=this.mobileLines.splice(this.mobileLines.findIndex(n=>
1n.identifier===this.loginDetails.username.replace(/(\+32)/,"0")),1);this.mobileLines.splice(0,0,t[0])}setSlickConfig(){this.slickConfigMobile.dots=this.bundleCardsMobile.length>1,this.slickConfigMobile.arrows=!1,this.slickConfig.dots=this.bundleCards.length>1,this.slickConfig.arrows=this.bundleCards.length>1,this.slickConfig.nextArrow='<div class="cards-slider-button arrow arrow--right slick-arrow cursor--pointer" aria-disabled="false"></div>',this.slickConfig.prevArrow='<div class="cards-slider-button arrow arrow--left slick-arrow cursor--pointer" aria-disabled="false"></div>',this.cdr.detectChanges()}getUsageDetailsUrl(e){let t=this.mobileUsageOverviewURL.includes("?")?"&":"?";return e.lineIdentifier?this.mobileUsageOverviewURL+t+Z.IDENTIFIER+"="+e.lineIdentifier:this.mobileUsageOverviewURL}filterBundleAccounts(){let e=Le(this.mobileLines.filter(t=>t.productType===J.PRODUCT_TYPE_BUNDLE),"usage.included.data[0].usedUnits").reverse();if((this.loginDetails.isMaster()||this.loginDetails.isContractHolder())&&e.length>0){let t={label:I.GROUP_VIEW,productType:J.PRODUCT_TYPE_BUNDLE,bundleIdentifier:ye(e).bundleIdentifier,description:ye(e).label};e.splice(0,0,t)}return e}fetchUsagesData(){this.mobileUsageOverviewService.getUsageForProductSubscriptions(this.selectedAccounts).subscribe(e=>{e.includes(null)?this.showErrorCard=!0:(e.forEach((t,n)=>{Ye(t,"included.data")&&t.included.data.length>1&&(t.included.data=yi(t.included.data,["name"],["desc"]));let o=this.selectedAccounts[n];this.convertMobileUsageUnits(t),this.mobileUsageOverviewService.addCommonBuckets(t),o.usage=t,o.usage.isGroupBundleUsage=this.mobileUsageOverviewService.isGroupBundle(o),o.usage.isLineBundleUsage=!this.mobileUsageOverviewService.isGroupBundle(o),this.calculateBundleCard(o)}),this.setSlickConfig())})}convertMobileUsageUnits(e){I.ALL_CONSUMPTION_DATA_TYPES.forEach(t=>{e.included[t]&&(e.included[t]=e.included[t].map(n=>e.convertUnits(n)))})}calculateBundleCard(e){let t=new Ae;t.isGroupView=this.mobileUsageOverviewService.isGroupBundle(e),t.bundleName=e.usage.productInfo.labelKey,t.nextUpdateDate=e.usage.daysForNextBill,t.isGroupView||(t.lineIdentifier=e.identifier),t.isGroupView&&(t.hasTableView=!0,t.bundleTableData=this.commonBundleAccounts.slice(1)),e.usage.outOfBundle.usedUnits!=="0"&&(t.outOfBundle=e.usage.outOfBundle.usedUnits),t.redirectionUrl=this.getUsageDetailsUrl(t),t.chartConfigs=this.calculateChartConfigs(e.usage),this.calculateBundleCardsForMobileView(t),this.bundleCards.push(t)}calculateBundleCardsForMobileView(e){if(w(e.chartConfigs)&&e){let t=this.getNewMobileCard(e);this.bundleCardsMobile.push(t);return}if(e&&e.chartConfigs.forEach(t=>{let n=this.getNewMobileCard(e);n.chartConfig=t,this.bundleCardsMobile.push(n)}),e.hasTableView){let t=this.getNewMobileCard(e);t.hasTableView=e.hasTableView,t.bundleTableData=e.bundleTableData,this.bundleCardsMobile.push(t)}}getNewMobileCard(e){let t=new Ae;return t.bundleName=e.bundleName,t.lineIdentifier=e.lineIdentifier,t.nextUpdateDate=e.nextUpdateDate,t.isGroupView=e.isGroupView,t.redirectionUrl=e.redirectionUrl,t.outOfBundle=e.outOfBundle,t}calculateChartConfigs(e){let t=this.getBundleUsageChartConfig(e);return t.length>I.MAX_BLOB_ON_CARD_VIEW&&t.splice(I.MAX_BLOB_ON_CARD_VIEW),t}getBundleUsageChartConfig(e){let t=ye(e.included[I.USAGE_BLOB_TYPE_DATA]);return[this.mobileUsageChartConfigurationService.getChartConfigurationNewOneUpBundle(t,t.unlimited,e.productInfo.usageBasedRatePlan,e.isLineBundleUsage??!1,e.dataPause,"")]}static{this.\u0275fac=function(t){return new(t||i)(S.\u0275\u0275directiveInject(uo.LoginService),S.\u0275\u0275directiveInject(re),S.\u0275\u0275directiveInject(S.ChangeDetectorRef),S.\u0275\u0275directiveInject(Ui),S.\u0275\u0275directiveInject(xe),S.\u0275\u0275directiveInject(ue),S.\u0275\u0275directiveInject(Be),S.\u0275\u0275directiveInject(ol),S.\u0275\u0275directiveInject(S.ElementRef))}}static{this.\u0275cmp=S.\u0275\u0275defineComponent({type:i,selectors:[["app-new-one-up-bundle-card"]],inputs:{mobileUsageOverviewURL:"mobileUsageOverviewURL",cardTitle:"cardTitle",hasMobileProduct:"hasMobileProduct",hideForBundle:"hideForBundle",hasNotActiveAndPendingActivationMobileLines:"hasNotActiveAndPendingActivationMobileLines",isNewBundle:"isNewBundle",isNewOneUpBundle:"isNewOneUpBundle"},standalone:!1,features:[S.\u0275\u0275InheritDefinitionFeature],decls:3,vars:2,consts:[["slickModal","slick-carousel"],["id","bundle-card"],[4,"ngIf"],["class","wave-data-card__wave-section js-hide-card-skeleton-identifier",4,"ngIf"],["class","wave-data-card__wave-section",4,"ngIf"],[1,"wave-data-card__wave-section","js-hide-card-skeleton-identifier"],[3,"card"],[1,"carousel",3,"config"],["ngxSlickItem","","class","slide",4,"ngFor","ngForOf"],["ngxSlickItem","",1,"slide"],[3,"card","isNewBundle"],[1,"wave-data-card__wave-section"],[1,"group-view__title-section","js-hide-card-skeleton-identifier","text-align--center","pt--xl"],[1,"text-weight--g"],[3,"hasActivationInProgressProduct"],[1,"notification--card"],[1,"icon","icon-error-shape"],[1,"notification--card__message","js-hide-card-skeleton-identifier"],[1,"notification--card__message__header"],[1,"notification--card__message__description"]],template:function(t,n){t&1&&(S.\u
10275\u0275elementStart(0,"div",1),S.\u0275\u0275template(1,vl,4,3,"ng-container",2)(2,Cl,9,4,"ng-container",2),S.\u0275\u0275elementEnd()),t&2&&(S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",!n.showErrorCard),S.\u0275\u0275advance(),S.\u0275\u0275property("ngIf",n.showErrorCard))},dependencies:[Qi.NgForOf,Qi.NgIf,We,Ke,se,lo,po,go.TranslatePipe],encapsulation:2})}}return i})();function xl(i,r){if(i&1&&T.\u0275\u0275element(0,"app-message-flow",3),i&2){let e=r.$implicit;T.\u0275\u0275property("messageGroupName",e)}}function Tl(i,r){if(i&1&&(T.\u0275\u0275elementContainerStart(0),T.\u0275\u0275template(1,xl,1,1,"app-message-flow",5),T.\u0275\u0275elementContainerEnd()),i&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(),T.\u0275\u0275property("ngForOf",e.messageGroupNames)}}function Il(i,r){if(i&1){let e=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"app-bundle-line-selector",7),T.\u0275\u0275listener("bundleLines",function(n){T.\u0275\u0275restoreView(e);let o=T.\u0275\u0275nextContext(2);return T.\u0275\u0275resetView(o.getBundleLines(n))}),T.\u0275\u0275elementEnd()}if(i&2){let e=T.\u0275\u0275nextContext(2);T.\u0275\u0275property("messageGroupName",e.messageGroupName)("showGroupView",!e.isNewOneUpBundle)("isNewOneUpBundle",e.isNewOneUpBundle)}}function yl(i,r){if(i&1){let e=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementContainerStart(0),T.\u0275\u0275elementStart(1,"div",8)(2,"div",9)(3,"app-usage-blob",10),T.\u0275\u0275listener("messageEvent",function(n){T.\u0275\u0275restoreView(e);let o=T.\u0275\u0275nextContext(2);return T.\u0275\u0275resetView(o.setMessageGroups(n))})("updateUsage",function(n){T.\u0275\u0275restoreView(e);let o=T.\u0275\u0275nextContext(2);return T.\u0275\u0275resetView(o.updateUsage(n))}),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(4,"app-consumption-data",11),T.\u0275\u0275listener("messageEvent",function(n){T.\u0275\u0275restoreView(e);let o=T.\u0275\u0275nextContext(2);return T.\u0275\u0275resetView(o.setMessageGroups(n))}),T.\u0275\u0275elementEnd()()(),T.\u0275\u0275elementContainerEnd()}if(i&2){let e=T.\u0275\u0275nextContext(2);T.\u0275\u0275advance(3),T.\u0275\u0275property("usage",e.mobileUsage)("autoPause",e.mobileAutoPause)("selectedAccountIdentifier",e.selectedAccountIdentifier)("isConnect5Bundle",e.isConnect5Bundle)("isNewOneUpBundle",e.isNewOneUpBundle)("componentInstanceID",e.componentInstanceID),T.\u0275\u0275advance(),T.\u0275\u0275property("mobileLine",e.mobile)("usage",e.mobileUsage)("autoPause",e.mobileAutoPause)}}function Ll(i,r){if(i&1&&(T.\u0275\u0275elementStart(0,"app-message-flow",3),T.\u0275\u0275template(1,Il,1,3,"app-bundle-line-selector",6)(2,yl,5,9,"ng-container",2),T.\u0275\u0275elementEnd()),i&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275property("messageGroupName",e.messageGroupName),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",e.isContexthubLoaded),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",e.mobileUsage)}}function Ol(i,r){if(i&1&&(T.\u0275\u0275elementContainerStart(0),T.\u0275\u0275element(1,"app-bundle-card",12),T.\u0275\u0275elementContainerEnd()),i&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(),T.\u0275\u0275property("mobileUsageOverviewURL",e.usageDetailsLink)("hideForBundle",e.hideForBundle)("cardTitle",e.cardTitle)("hasMobileProduct",e.hasMobileProduct)("hasNotActiveAndPendingActivationMobileLines",e.hasNotActiveAndPendingActivationMobileLines)}}function Ul(i,r){if(i&1&&(T.\u0275\u0275elementContainerStart(0),T.\u0275\u0275element(1,"app-new-one-up-bundle-card",13),T.\u0275\u0275elementContainerEnd()),i&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(),T.\u0275\u0275property("mobileUsageOverviewURL",e.usageDetailsLink)("hideForBundle",e.hideForBundle)("cardTitle",e.cardTitle)("hasMobileProduct",e.hasMobileProduct)("isNewOneUpBundle",e.isNewOneUpBundle)("hasNotActiveAndPendingActivationMobileLines",e.hasNotActiveAndPendingActivationMobileLines)}}var fo=(()=>{class i extends G{constructor(e,t,n,o,C,N,P,F,q,te){super(),this.loginService=e,this.accountSelectorService=t,this.messageService=n,this.mobileUsageDatalayer=o,this.cdr=C,this.productsStoreService=N,this.domService=P,this.mobileUsageOverviewService=F,this.mobileService=q,this.productService=te,this.showCardView=!1,this.cardTitle=I.TITLE,this.isContexthubLoaded=!1,this.messageGroupName=I.MESSAGE_GROUP_NAME,this.customMessageGroupName=I.CUSTOM_MESSAGE_GROUP_NAME,this.scopes=I.SCOPES,this.mobileUsageRetrieved=!1,this.hasBundleLineLoaded=!1}initAfterLoggedIn(){this.obs(this.productsStoreService.getStoreData()).subscribe(e=>{this.isNewOneUpBundle=this.checkBundleType(e.productHoldings),this.isContexthubLoaded=!0,this.showCardView?(this.hasMobileProduct=!!(e.hasStandaloneMobileProduct||e.hasBundleMobileProduct),this.hasNotActiveAndPendingActivationMobileLines=e.hasNotActiveAndPendingActivationMobileLines,this.hasMobileProduct&&this.getLoggedInAccount()):(this.setBundleLoaded(),this.profilePendingOperations(),this.loadSelectedAccount())})}checkBundleType(e){return e?.map(t=>t?.productInfo?.chars?.some(this.isLimitedMobileVolumeSupported)).includes(!0)}isLimitedMobileVolumeSupported(e){return e.key.toString()=="LimitedMobileVolumeSupported"&&e.values.includes("true")}setBundleLoaded(){this.accountSelectorService.getMobileUsageRetrieved().subscribe(e=>{this.mobileUsageRetrieved=e})}bundleLineSelected(e){this.selectedAccountIdentifier=e.identifier,w(e.usage)||(this.mobileUsage=e.usage,this.LoadAutoPause()),this.cdr.detectChanges()}
1getBundleLines(e){this.mobileUsageOverviewService.getUsageForProductSubscriptions(e).subscribe(t=>{t.forEach((n,o)=>{if(n){let C=e[o];C.usage=n,C.usage.isGroupBundleUsage=this.mobileUsageOverviewService.isGroupBundle(C),C.usage.isLineBundleUsage=!this.mobileUsageOverviewService.isGroupBundle(C)&&!this.isNewOneUpBundle,this.bundleLineSelected(C)}}),this.isNewOneUpBundle&&this.accountSelectorService.getSelectedAccount().subscribe(n=>this.bundleLineSelected(n))})}loadSelectedAccount(){this.obs(this.accountSelectorService.getSelectedAccount()).subscribe({next:e=>{this.mobile=e,this.mobile&&(this.selectedAccountIdentifier=this.mobile.msisdn,w(e.usage)||(this.mobileUsage=e.usage),Ye(this.mobile,"usage.productInfo.isEligibleForPauseProfile")&&this.selectedAccountIdentifier&&this.getDataPauseUsage(),this.LoadAutoPause(),this.showPendingOperationsWarning(),(!this.mobileUsageRetrieved||this.mobile.productType!==I.PRODUCT_TYPE_BUNDLE)&&this.getMobileUsage(e),this.mobileUsageRetrieved=!0,this.accountSelectorService.setMobileUsageRetrieved(this.mobileUsageRetrieved),this.cdr.detectChanges())},error:e=>{this.handleAccountSelectorError(e)}}),this.domService.scrollToTop()}profilePendingOperations(){this.productService.getPendingOperations(I.MESSAGE_GROUP_NAME).subscribe(e=>{this.pendingOperations=e})}getDataPauseUsage(){let e=new Map;e.set(Pe.MSISDN,this.selectedAccountIdentifier),this.mobileService.getDataUsagePauseInfo(I.MESSAGE_GROUP_NAME,e).subscribe(t=>{this.mobile.usage&&(this.mobile.usage.dataPause=t.dataPause)})}showPendingOperationsWarning(){let e=this.mobile.bundleIdentifier?this.mobile.bundleIdentifier:this.mobile.identifier;this.messageService.clearMessages(I.CUSTOM_MESSAGE_GROUP_NAME),Y(this.pendingOperations,t=>{t.productIdentifierValue===e&&(t.pendingOperationType===I.UPGRADE&&this.messageService.addMessage(new Et(I.CUSTOM_MESSAGE_GROUP_NAME,I.UPGRADE_WARNING)),t.pendingOperationType===I.DOWNGRADE&&this.messageService.addMessage(new Et(I.CUSTOM_MESSAGE_GROUP_NAME,I.DOWNGRADE_WARNING)))})}handleAccountSelectorError(e){if(!e.serviceError)this.messageService.addMessage(new ne(this.messageGroupName,"account-selector.error.empty-"+e.keyLabel));else{let t=this.messageService.getMessagesByGroupName(Z.MESSAGE_GROUP);if(t[0]){let n=t&&t[0].key;this.messageService.clearMessages(Z.MESSAGE_GROUP),this.messageService.clearMessages(this.customMessageGroupName),this.messageService.addMessage(new ne(this.messageGroupName,n))}}}getLoggedInAccount(){this.showSharedBundleLineSelector!=="true"&&this.obs(this.loginService.getLoginDetails()).subscribe(e=>{this.selectedAccountIdentifier=e.username.replace(/(\+32)/,"0");let t={productType:I.PRODUCT_TYPE_MOBILE,identifier:this.selectedAccountIdentifier};this.getMobileUsage(t)})}getMobileUsage(e){this.obs(this.mobileUsageOverviewService.getUsageForProductSubscriptions([e])).subscribe(t=>{this.mobileUsage=t[0],this.mobileUsage&&this.mobileUsage.included&&(this.mobileUsage.addManuallyConfiguredSpec(),this.convertMobileUsageUnits(),this.mobileUsageOverviewService.addCommonBuckets(this.mobileUsage)),this.pushDataToAnalytics(),this.cdr.detectChanges()})}convertMobileUsageUnits(){I.ALL_CONSUMPTION_DATA_TYPES.forEach(e=>{this.mobileUsage.included[e]=this.mobileUsage.included[e].map(t=>this.mobileUsage.convertUnits(t))}),this.mobileUsage.options.forEach(e=>{I.ALL_CONSUMPTION_DATA_TYPES.forEach(t=>{e[t]=e[t].map(n=>this.mobileUsage.convertUnits(n))})})}pushDataToAnalytics(){let e="";this.mobileUsage.included&&this.checkInternationalStandaloneMobileLines()&&(e=I.INTERNATIONAL),this.mobileUsage.shared&&this.mobileUsage.shared.ZBR.find(n=>n.name===ve.INTERNATIONAL)&&(e=I.INTERNATIONAL),this.mobileUsage.outOfBundle&&this.mobileUsage.outOfBundle.usedUnits!=="0"&&(e+=w(e)?I.OUT_OF_BUNDLE:","+I.OUT_OF_BUNDLE),this.mobileUsage.isUnlimitedPlan&&(e+=w(e)?I.UNLIMITED_PLAN:","+I.UNLIMITED_PLAN),this.mobileUsageDatalayer.addEvent(Sl.EVENT_NAME_MOBILE_USAGE,El.EVENT_TYPE_VIEW_MOBILE_USAGE,this.componentInstanceID,{itemName:e})}checkInternationalStandaloneMobileLines(){return!!(this.mobileUsage.included.data.find(e=>e?.bucketType===ve.INTERNATIONAL_DATA)||this.mobileUsage.included.text.find(e=>e?.bucketType===ve.INTERNATIONAL_TEXT)||this.mobileUsage.included.voice.find(e=>e?.bucketType===ve.INTERNATIONAL_CALL))}LoadAutoPause(){this.mobile&&this.mobile.productInfo&&(this.mobile.productInfo.isEligibleForAutoPause||this.mobile.productInfo.isEligibleForSettinglimits)&&this.selectedAccountIdentifier&&this.mobileUsageOverviewService.getAutoPause(this.messageGroupName,this.selectedAccountIdentifier).subscribe(e=>{this.mobileAutoPause=e})}setMessageGroups(e){this.messageGroupNames=e}updateUsage(e){this.mobileUsage=e}static{this.\u0275fac=function(t){return new(t||i)(T.\u0275\u0275directiveInject(Zi.LoginService),T.\u0275\u0275directiveInject(Ue),T.\u0275\u0275directiveInject(W),T.\u0275\u0275directiveInject(Hi),T.\u0275\u0275directiveInject(T.ChangeDetectorRef),T.\u0275\u0275directiveInject(Be),T.\u0275\u0275directiveInject(oe),T.\u0275\u0275directiveInject(ue),T.\u0275\u0275directiveInject(qe),T.\u0275\u0275directiveInject(re))}}static{this.\u0275cmp=T.\u0275\u0275defineComponent({type:i,selectors:[["tg-mobile-usage-overview"]],inputs:{usageDetailsLink:"usageDetailsLink",showCardView:"showCardView",cardTitle:"cardTitle",componentInstanceID:"componentInstanceID",pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",showSharedBundleLineSelector:"showSharedBundleLineSelector",hideForBundle:"hideForBundle"},standalone:!1,features:[T.\u0275\u0275InheritDefinitionFeature],decls:7,vars:11,consts:[["id","mobile-usage-overview",3,"componentCanRender","messageGroupName","scopes"],[3,"enableLoader","pageType","enableMask","startByDefault"],[4,"ngIf"],[3,"messageGroupName"],[3,"messageGroupName",4,"ngIf"],[3,"messageGroupName",4,"ngFor","ngForOf"],[3,"messageGroupName","showGroupView","isNewOneUpBundle","bundleLines",4,"ngIf"],[3,"bundleLines","messageGroupName","showGroupView","isNewOneUpBundle"],[1,"mobile-overview-usage","content-section"],[1,"content-section__details"],[3,"messageEvent","updateUsage","usage","autoPause","selectedAccountIdentifier","isConnect5Bundle","isNewOneUpBundle","componentInstanceID"],[3,"messageEvent","mobileLine","usage","autoPause"],[3,"mobileUsageOverviewURL","hideForBundle","cardTitle","hasMobileProduct","hasNotActiveAndPendingActivationMobileLines"],[3,"mobileUsageOverviewURL","hideForBundle","cardTitle","hasMobileProduct","isNewOneUpBundle","hasNotActiveAndPendingActivationMobileLines"]],template:function(t,n){t&1&&(T.\u0275\u0275elementStart(0,"tg-login",0),T.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),T.\u0275\u0275element(1,"app-loader",1),T.\u0275\u0275template(2,Tl,2,1,"ng-container",2),T.\u0275\u0275element(3,"app-message-flow",3),T.\u0275\u0275template(4,Ll,3,3,"app-message-flow",4)(5,Ol,2,5,"ng-container",2)(6,Ul,2,6,"ng-container",2),T.\u0275\u0275elementEnd()),t&2&&(T.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.scopes),T.\u0275\u0275advance(),T.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask)("startByDefault",!1),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",(n.messageGroupNames==null?null:n.messageGroupNames.length)>0),T.\u0275\u0275advance(),T.\u0275\u0275property("messageGroupName",n.customMessageGroupName),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",!n.showCardView),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",n.showCardView&&n.isContexthubLoaded&&!n.isNewOneUpBundle),T.\u0275\u0275advance(),T.\u0275\u0275property("ngIf",n.showCardView&&n.isContexthubLoaded&&n.isNewOneUpBundle))},dependencies:[Ji.NgForOf,Ji.NgIf,be,Zi.LoginComponent,Se,Ee,qn,Qn,ao,_o],encapsulation:2})}}return i})();import{FormsModule as lp,ReactiveFormsModule as cp}from"@angular/forms";import"@angular/core";var D=class{static{this.MESSAGE_GROUP_NAME="mobile-usage-limits"}static{this.CUSTOM_MESSAGE_GROUP_NAME="mobile-usage-limits-custom"}static{this.SCOPES=["D_usagelimits"]}static{this.PRODUCT_TYPE_MOBILE="mobile"}static{this.EMPTY=""}static{this.MAX_PREMIUM_SERVICE_LIMIT=300}static{this.MIN_PREMIUM_SERVICE_LIMIT=0}static{this.PREMIUM_SERVICE_LIMIT_PATTERN=/^[0-9]+$/}static{this.DYNAMIC_QUERY_KEY_PATTERN=/\$\$MSISDN\$\$/}static{this.COMBINED_WARNING_DIALOG_DATA=new ze("ng.mobile-usage-limits.lbl.usage-limits-warning","ng.mobile-usage-limits.lbl.combined-usage-limits-warning-description","ng.mobile-usage-limits.btn.ok","ng.mobile-usage-limits.btn.cancel")}static{this.OUT_OF_BUNDLE_WARNING_DIALOG_DATA=new ze("ng.mobile-usage-limits.lbl.usage-limits-warning","ng.mobile-usage-limits.lbl.out-of-bundle-warning-description","ng.mobile-usage-limits.btn.ok","ng.mobile-usage-limits.btn.cancel")}static{this.PREMIUM_SERVICE_LIMIT_WARNING_DIALOG_DATA=new ze("ng.mobile-usage-limits.lbl.usage-limits-warning","ng.mobile-usage-limits.lbl.premium-service-limits-warning-description","ng.mobile-usage-limits.btn.ok","ng.mobile-usage-limits.btn.cancel")}static{this.SUCCESSFULLY_SAVE_MESSAGE="mobile-usage-limits.success.updated-successfully"}static{this.PREMIUM_LIMITS_CONTROL="premiumLimit"}static{this.OUT_OF_BUNDLE_CONTROL="outofbundle"}static{this.EURO="Euro"}static{this.TYPE_OUT_OF_BUNDLE="outofbundle"}static{this.TYPE_PREMIUM_SERVICE="premiumservice"}};import{FormGroup as fc}from"@angular/forms";import{BehaviorSubject as hc}from"rxjs";import"@angular/core";import{EventTypeEnum as ho,EventNameEnum as vo}from"@telenet/ng-lib-datalayer";import*as et from"@angular/core";import*as Co from"@telenet/ng-lib-datalayer";var bo=(()=>{class i{constructor(e){this.dataLayerService=e,this.messageGroups=[D.MESSAGE_GROUP_NAME],this.ITEMNAME_OUT_OF_BUNDLE="Out of Bundle",this.ITEMNAME_PREMIUM_SERVICE_LIMIT
1S="Premium Service Limits"}sendUsageLimitUpdateEvent(e){w(e.mobile.outOfBundle)||this.sendOutOfBundleUpdateEvent(e.mobile.outOfBundle),w(e.mobile.premiumService)||this.sendPremiumServiceUpdateEvent(e.mobile.premiumService)}sendOutOfBundleUpdateEvent(e){let t=this.getEventInfo(vo.EVENT_NAME_MOBILE_USAGE_LIMITS_CHANGED,ho.EVENT_TYPE_CLICK),n=this.getAttributes(this.ITEMNAME_OUT_OF_BUNDLE,e.limit.value);this.addEvent(t,n)}sendPremiumServiceUpdateEvent(e){let t=this.getEventInfo(vo.EVENT_NAME_MOBILE_USAGE_LIMITS_CHANGED,ho.EVENT_TYPE_CLICK),n=this.getAttributes(this.ITEMNAME_PREMIUM_SERVICE_LIMITS,e.limit.value);this.addEvent(t,n)}getEventInfo(e,t){return this.dataLayerService.createEventInfo(e,t,this.messageGroups)}getAttributes(e="",t=""){return{itemName:e,itemData:t}}get category(){return this.dataLayerService.getCategory(this.componentInstanceId)||this.dataLayerService.createCategory("care","mobile")}addEvent(e,t){this.dataLayerService.addEvent(e,t,this.category)}static{this.\u0275fac=function(t){return new(t||i)(et.\u0275\u0275inject(Co.DataLayerService))}}static{this.\u0275prov=et.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import"@telenet/ng-lib-ocapi";import*as x from"@angular/core";import*as nt from"@telenet/ng-lib-ocapi";import{EventEmitter as Bl}from"@angular/core";import{FormControl as Ml}from"@angular/forms";import{MAT_SELECT_SCROLL_STRATEGY_PROVIDER as wl}from"@angular/material/select";import*as v from"@angular/core";import*as it from"@angular/common";import*as So from"@angular/material/select";import*as Eo from"@angular/material/autocomplete";import*as ie from"@angular/forms";import*as xo from"@ngx-translate/core";var Pl=["selectDropdown"],Mt=i=>({value:i});function Al(i,r){i&1&&(v.\u0275\u0275elementStart(0,"p",15),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementEnd()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.usage-on-top-of-bundle")))}function Dl(i,r){i&1&&(v.\u0275\u0275elementStart(0,"h6",16),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementEnd()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.out-of-bundle-usage-top")))}function Rl(i,r){if(i&1&&(v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementContainerEnd()),i&2){let e=v.\u0275\u0275nextContext().$implicit;v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.lbl.price",v.\u0275\u0275pureFunction1(4,Mt,e.split(" ")[0]))," ")}}function Fl(i,r){i&1&&(v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementContainerEnd()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.no-limits")," "))}function kl(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"mat-option",21),v.\u0275\u0275template(1,Rl,3,6,"ng-container",14)(2,Fl,3,3,"ng-container",14),v.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;v.\u0275\u0275property("value",e.split(" ")[0]),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",e!==""),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",e==="")}}function Gl(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"div",17)(1,"label",18),v.\u0275\u0275text(2),v.\u0275\u0275pipe(3,"translate"),v.\u0275\u0275elementEnd(),v.\u0275\u0275elementStart(4,"mat-select",19,0),v.\u0275\u0275template(6,kl,3,3,"mat-option",20),v.\u0275\u0275elementEnd()()),i&2){let e=v.\u0275\u0275nextContext();v.\u0275\u0275advance(2),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind1(3,3,"ng.mobile-usage-limits.lbl.max-additional-usage")),v.\u0275\u0275advance(2),v.\u0275\u0275property("formControl",e.dropdownControl),v.\u0275\u0275advance(2),v.\u0275\u0275property("ngForOf",e.getAllOutOfBundleList())}}function Vl(i,r){if(i&1&&(v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementContainerEnd()),i&2){let e=v.\u0275\u0275nextContext().$implicit;v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.lbl.price",v.\u0275\u0275pureFunction1(4,Mt,e.split(" ")[0]))," ")}}function jl(i,r){i&1&&(v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementContainerEnd()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.no-limits")," "))}function Hl(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"option",21),v.\u0275\u0275template(1,Vl,3,6,"ng-container",14)(2,jl,3,3,"ng-container",14),v.\u0275\u0275elementEnd()),i&2){let e=r.$implicit;v.\u0275\u0275property("value",e.split(" ")[0]),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",e!==""),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",e==="")}}function Yl(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"div",22)(1,"label",18),v.\u0275\u0275text(2),v.\u0275\u0275pipe(3,"translate"),v.\u0275\u0275elementEnd(),v.\u0275\u0275elementStart(4,"div",17)(5,"div",23)(6,"select",24),v.\u0275\u0275template(7,Hl,3,3,"option",20),v.\u0275\u0275elementEnd(),v.\u0275\u0275element(8,"div",25),v.\u0275\u0275elementEnd()()()),i&2){let e=v.\u0275\u0275nextContext();v.\u0275\u0275advance(2),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind1(3,3,"ng.mobile-usage-limits.lbl.max-additional-usage")),v.\u0275\u0275advance(4),v.\u0275\u0275property("formControl",e.dropdownControl),v.\u0275\u0275advance(),v.\u0275\u0275property("ngForOf",e.getAllOutOfBundleList())}}function $l(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"span",28),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementEnd()),i&2){let e=v.\u0275\u0275nextContext(2);v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.lbl.price",v.\u0275\u0275pureFunction1(4,Mt,e.currentOutOfBundleLimit)))}}function Wl(i,r){i&1&&(v.\u0275\u0275elementStart(0,"span",28),v.\u0275\u0275text(1),v.\u0275\u0275pipe(2,"translate"),v.\u0275\u0275elementEnd()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.no-limits")))}function Kl(i,r){if(i&1&&(v.\u0275\u0275elementStart(0,"div")(1,"span",26),v.\u0275\u0275text(2),v.\u0275\u0275pipe(3,"translate"),v.\u0275\u0275elementEnd(),v.\u0275\u0275template(4,$l,3,6,"span",27)(5,Wl,3,3,"span",27),v.\u0275\u0275elementEnd()),i&2){let e=v.\u0275\u0275nextContext();v.\u0275\u0275advance(2),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(3,3,"ng.mobile-usage-limits.lbl.max-additional-usage"),":"),v.\u0275\u0275advance(2),v.\u0275\u0275property("ngIf",e.currentOutOfBundleLimit),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",!e.currentOutOfBundleLimit)}}var To=(()=>{class i extends G{constructor(e){super(),this.cdf=e,this.isFormChanged=new Bl}ngOnInit(){this.buildForm(),this.cdf.detectChanges(),this.currentOutOfBundleLimit=this.outOfBundleControl?.value}ngOnChanges(){this.buildForm(),this.cdf.detectChanges()}buildForm(){let e=new Ml(this.getCurrentUsageLimit());this.parentForm.addControl(D.OUT_OF_BUNDLE_CONTROL,e),this.watchFormChanges(e)}get outOfBundleControl(){return this.parentForm.get(D.OUT_OF_BUNDLE_CONTROL)}watchFormChanges(e){this.obs(e.valueChanges).subscribe(t=>{this.isFormChanged.emit(!0)})}getAllOutOfBundleList(){let e=this.selectedAccount.productInfo?this.selectedAccount.productInfo.getUniqOutOfBundlesLimits():this.selectedAccount.plan.getUniqOutOfBundlesLimits();return e.push(D.EMPTY),e}getCurrentUsageLimit(){return this.usageLimit.mobile.outOfBundle.limit.enabled?this.usageLimit.mobile.outOfBundle.limit.value:D.EMPTY}get dropdownControl(){return this.parentForm.get(D.OUT_OF_BUNDLE_CONTROL)}handleOutsideClick(e){this.select&&!this.select._elementRef.nativeElement.contains(e.target)&&this.select.close()}static{this.\u0275fac=function(t){return new(t||i)(v.\u0275\u0275directiveInject(v.ChangeDetectorRef))}}static{this.\u0275cmp=v.\u0275\u0275defineComponent({type:i,selectors:[["app-out-
1of-bundle-limits"]],viewQuery:function(t,n){if(t&1&&v.\u0275\u0275viewQuery(Pl,5),t&2){let o;v.\u0275\u0275queryRefresh(o=v.\u0275\u0275loadQuery())&&(n.select=o.first)}},hostBindings:function(t,n){t&1&&v.\u0275\u0275listener("click",function(C){return n.handleOutsideClick(C)},v.\u0275\u0275resolveDocument)("touchstart",function(C){return n.handleOutsideClick(C)},v.\u0275\u0275resolveDocument)},inputs:{usageLimit:"usageLimit",selectedAccount:"selectedAccount",parentForm:"parentForm",isMember:"isMember"},outputs:{isFormChanged:"isFormChanged"},standalone:!1,features:[v.\u0275\u0275ProvidersFeature([wl]),v.\u0275\u0275InheritDefinitionFeature,v.\u0275\u0275NgOnChangesFeature],decls:16,vars:9,consts:[["selectDropdown",""],[1,"mobile-usage-limits","mb--xl"],[1,"content-section"],[1,"p--xl--md","p--l"],[1,"heading--nomargin"],["class","font--body-regular pt--xxs",4,"ngIf"],[1,"divider","divider--xxs__very-light-grey"],[1,"px--xl--md","pb--xl--md","p--l"],["class","heading--notopmargin pb--m",4,"ngIf"],[3,"formGroup"],[1,"col-sm-5","pr-0","pl-0"],[1,"hide-until-md"],["class","form-group",4,"ngIf"],["class","hide-from-md",4,"ngIf"],[4,"ngIf"],[1,"font--body-regular","pt--xxs"],[1,"heading--notopmargin","pb--m"],[1,"form-group"],["for","dropdownControl",1,"font--caption","color-shade_64","cursor--default"],["id","dropdownControl","name","dropdownControl","panelClass","mt-45","disableOptionCentering","",3,"formControl"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"hide-from-md"],[1,"select-dropdown-section"],["id","dropdownControl","name","dropdownControl",1,"form-control","select-dropdown",3,"formControl"],[1,"icon","icon-chevron-down","position--absolute","text--m","text-weight--g"],[1,"font--body-regular","mr--xxs--md"],["class","text-weight--l",4,"ngIf"],[1,"text-weight--l"]],template:function(t,n){t&1&&(v.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"h4",4),v.\u0275\u0275text(4),v.\u0275\u0275pipe(5,"translate"),v.\u0275\u0275elementEnd(),v.\u0275\u0275template(6,Al,3,3,"p",5),v.\u0275\u0275elementEnd(),v.\u0275\u0275element(7,"div",6),v.\u0275\u0275elementStart(8,"div",7),v.\u0275\u0275template(9,Dl,3,3,"h6",8),v.\u0275\u0275elementStart(10,"form",9)(11,"div",10)(12,"div",11),v.\u0275\u0275template(13,Gl,7,5,"div",12),v.\u0275\u0275elementEnd(),v.\u0275\u0275template(14,Yl,9,5,"div",13),v.\u0275\u0275elementEnd(),v.\u0275\u0275template(15,Kl,6,5,"div",14),v.\u0275\u0275elementEnd()()()()),t&2&&(v.\u0275\u0275advance(4),v.\u0275\u0275textInterpolate1("",v.\u0275\u0275pipeBind1(5,7,"ng.mobile-usage-limits.lbl.out-of-bundle-limits")," "),v.\u0275\u0275advance(2),v.\u0275\u0275property("ngIf",!n.isMember),v.\u0275\u0275advance(3),v.\u0275\u0275property("ngIf",n.isMember),v.\u0275\u0275advance(),v.\u0275\u0275property("formGroup",n.parentForm),v.\u0275\u0275advance(3),v.\u0275\u0275property("ngIf",!n.isMember),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",!n.isMember),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",n.isMember))},dependencies:[it.NgForOf,it.NgIf,So.MatSelect,Eo.MatOption,ie.\u0275NgNoValidate,ie.NgSelectOption,ie.\u0275NgSelectMultipleOption,ie.SelectControlValueAccessor,ie.NgControlStatus,ie.NgControlStatusGroup,ie.FormControlDirective,ie.FormGroupDirective,xo.TranslatePipe],encapsulation:2})}}return i})();import{EventEmitter as Xl}from"@angular/core";import{FormControl as Ql,Validators as tt}from"@angular/forms";import"rxjs";import{DOCUMENT as Zl}from"@angular/common";import*as h from"@angular/core";import*as Io from"@angular/common";import*as ge from"@angular/forms";import*as yo from"@ngx-translate/core";var wt=i=>({value:i}),Jl=i=>({"form__input-container--invalid":i}),ec=i=>({"form__input--error":i}),Lo=i=>({max:i,min:0});function ic(i,r){i&1&&(h.\u0275\u0275elementStart(0,"p",3),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2&&(h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.premium-services-purchase-additional-service")))}function tc(i,r){i&1&&(h.\u0275\u0275elementStart(0,"p",3),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2&&(h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.premium-services-description")))}function nc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"span",8),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2){let e=h.\u0275\u0275nextContext(2);h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.lbl.price",h.\u0275\u0275pureFunction1(4,wt,e.currentPremiumLimit)))}}function oc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"span",7),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd(),h.\u0275\u0275conditionalCreate(3,nc,3,6,"span",8)),i&2){let e=h.\u0275\u0275nextContext();
1h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind1(2,2,"ng.mobile-usage-limits.lbl.max-additional-premium-usages")),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(e.currentPremiumLimit?3:-1)}}function rc(i,r){if(i&1){let e=h.\u0275\u0275getCurrentView();h.\u0275\u0275elementStart(0,"div",12)(1,"div",15)(2,"wink-button",16),h.\u0275\u0275listener("winkButtonClicked",function(n){h.\u0275\u0275restoreView(e);let o=h.\u0275\u0275nextContext(2);return h.\u0275\u0275resetView(o.onEdit(n))}),h.\u0275\u0275text(3),h.\u0275\u0275pipe(4,"translate"),h.\u0275\u0275elementEnd()()()}i&2&&(h.\u0275\u0275advance(3),h.\u0275\u0275textInterpolate1(" ",h.\u0275\u0275pipeBind1(4,1,"ng.mobile-usage-limits.lnk.edit")," "))}function ac(i,r){i&1&&(h.\u0275\u0275elementStart(0,"p"),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2&&(h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.error.invalid-character-error")))}function sc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"p"),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2){let e=h.\u0275\u0275nextContext(4);h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.error.invalid-range-error",h.\u0275\u0275pureFunction1(4,Lo,e.maxPremiumLimit)))}}function lc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"p"),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()),i&2){let e=h.\u0275\u0275nextContext(4);h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-limits.error.required-error",h.\u0275\u0275pureFunction1(4,Lo,e.maxPremiumLimit)))}}function cc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"div",20),h.\u0275\u0275conditionalCreate(1,ac,3,3,"p"),h.\u0275\u0275conditionalCreate(2,sc,3,6,"p"),h.\u0275\u0275conditionalCreate(3,lc,3,6,"p"),h.\u0275\u0275elementEnd()),i&2){let e=h.\u0275\u0275nextContext(3);h.\u0275\u0275advance(),h.\u0275\u0275conditional(!(e.premiumLimitControl==null||e.premiumLimitControl.errors==null)&&e.premiumLimitControl.errors.pattern?1:-1),h.\u0275\u0275advance(),h.\u0275\u0275conditional(!(e.premiumLimitControl==null||e.premiumLimitControl.errors==null)&&e.premiumLimitControl.errors.min||!(e.premiumLimitControl==null||e.premiumLimitControl.errors==null)&&e.premiumLimitControl.errors.max?2:-1),h.\u0275\u0275advance(),h.\u0275\u0275conditional(!(e.premiumLimitControl==null||e.premiumLimitControl.errors==null)&&e.premiumLimitControl.errors.required&&(e.premiumLimitControl!=null&&e.premiumLimitControl.dirty)?3:-1)}}function dc(i,r){if(i&1){let e=h.\u0275\u0275getCurrentView();h.\u0275\u0275elementStart(0,"form",14)(1,"div",17)(2,"div",18)(3,"input",19),h.\u0275\u0275listener("blur",function(){h.\u0275\u0275restoreView(e);let n=h.\u0275\u0275nextContext(2);return h.\u0275\u0275resetView(n.onBlur())}),h.\u0275\u0275elementEnd()(),h.\u0275\u0275conditionalCreate(4,cc,4,3,"div",20),h.\u0275\u0275elementEnd()()}if(i&2){let e=h.\u0275\u0275nextContext(2);h.\u0275\u0275property("formGroup",e.parentForm),h.\u0275\u0275advance(2),h.\u0275\u0275property("ngClass",h.\u0275\u0275pureFunction1(4,Jl,e.premiumLimitControl.invalid&&e.premiumLimitControl.dirty)),h.\u0275\u0275advance(),h.\u0275\u0275property("ngClass",h.\u0275\u0275pureFunction1(6,ec,e.premiumLimitControl.invalid&&e.premiumLimitControl.dirty)),h.\u0275\u0275advance(),h.\u0275\u0275conditional(e.premiumLimitControl.invalid?4:-1)}}function mc(i,r){if(i&1&&(h.\u0275\u0275elementStart(0,"div",9)(1,"span",10),h.\u0275\u0275text(2),h.\u0275\u0275pipe(3,"translate"),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(4,"span",3),h.\u0275\u0275text(5),h.\u0275\u0275pipe(6,"translate"),h.\u0275\u0275elementEnd()(),h.\u0275\u0275elementStart(7,"div",9)(8,"div",11),h.\u0275\u0275text(9),h.\u0275\u0275pipe(10,"translate"),h.\u0275\u0275elementEnd(),h.\u0275\u0275conditionalCreate(11,rc,5,3,"div",12),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(12,"div",13),h.\u0275\u0275conditionalCreate(13,dc,5,8,"form",14),h.\u0275\u0275elementEnd()),i&2){let e=h.\u0275\u0275nextContext();
1h.\u0275\u0275advance(2),h.\u0275\u0275textInterpolate(h.\u0275\u0275pipeBind1(3,5,"ng.mobile-usage-limits.lbl.max-additional-premium-usages")),h.\u0275\u0275advance(3),h.\u0275\u0275textInterpolate1(" ",h.\u0275\u0275pipeBind2(6,7,"ng.mobile-usage-limits.lbl.price",h.\u0275\u0275pureFunction1(13,wt,e.currentPremiumLimit))," "),h.\u0275\u0275advance(4),h.\u0275\u0275textInterpolate1(" ",h.\u0275\u0275pipeBind2(10,10,"ng.mobile-usage-limits.lbl.max-limit",h.\u0275\u0275pureFunction1(15,wt,e.maxPremiumLimit))," "),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(!e.isEditMode&&e.currentPremiumLimit&&!e.isMember?11:-1),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(e.isEditMode?13:-1)}}function pc(i,r){if(i&1){let e=h.\u0275\u0275getCurrentView();h.\u0275\u0275elementStart(0,"wink-button",16),h.\u0275\u0275listener("winkButtonClicked",function(n){h.\u0275\u0275restoreView(e);let o=h.\u0275\u0275nextContext();return h.\u0275\u0275resetView(o.openUrl(n))}),h.\u0275\u0275text(1),h.\u0275\u0275pipe(2,"translate"),h.\u0275\u0275elementEnd()}i&2&&(h.\u0275\u0275advance(),h.\u0275\u0275textInterpolate1(" ",h.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-limits.lbl.manage-premium-service-barring")," "))}var Oo=(()=>{class i extends G{constructor(e,t,n){super(),this._element=e,this.document=t,this.urlservice=n,this.isFormChanged=new Xl,this.isEditMode=!1,this.showWarningDialog=!1,this.maxPremiumLimit=D.MAX_PREMIUM_SERVICE_LIMIT}ngOnInit(){this.buildForm(),this.obs(this.onSuccessfulSubmit).subscribe(e=>{this.isEditMode=!1,this.currentPremiumLimit=this.premiumLimitControl.value})}ngOnChanges(){this.buildForm(),this.isEditMode=!1}buildForm(){this.currentPremiumLimit=this.usageLimit.mobile.premiumService.limit.value;let e=new Ql(this.currentPremiumLimit,[tt.required,tt.max(D.MAX_PREMIUM_SERVICE_LIMIT),tt.min(D.MIN_PREMIUM_SERVICE_LIMIT),tt.pattern(D.PREMIUM_SERVICE_LIMIT_PATTERN)]);this.parentForm.addControl(D.PREMIUM_LIMITS_CONTROL,e),this.watchFormChanges(e)}watchFormChanges(e){this.obs(e.valueChanges).subscribe(t=>{this.isFormChanged.emit(!this.premiumLimitControl.invalid)})}get premiumBarringsLink(){return this.premiumServiceBarringsLink.replace(D.DYNAMIC_QUERY_KEY_PATTERN,this.selectedAccount.identifier)}get premiumLimitControl(){return this.parentForm.get(D.PREMIUM_LIMITS_CONTROL)}onBlur(){this.premiumLimitControl.pristine&&(this.isEditMode=!1)}onEdit(e){e.preventDefault(),this.isEditMode=!0,setTimeout(()=>{let t=this._element.nativeElement.querySelector('[formcontrolname="'+D.PREMIUM_LIMITS_CONTROL+'"]');t&&t.focus()})}openUrl(e){e.preventDefault(),this.openLinkIn==="navigation-content"?this.document.dispatchEvent(new CustomEvent("loadpage",{bubbles:!0,detail:{pageUrl:this.premiumBarringsLink,title:""}})):this.urlservice.redirectTo(this.premiumBarringsLink)}static{this.\u0275fac=function(t){return new(t||i)(h.\u0275\u0275directiveInject(h.ElementRef),h.\u0275\u0275directiveInject(Zl),h.\u0275\u0275directiveInject($))}}static{this.\u0275cmp=h.\u0275\u0275defineComponent({type:i,selectors:[["app-premium-services"]],inputs:{usageLimit:"usageLimit",selectedAccount:"selectedAccount",parentForm:"parentForm",premiumServiceBarringsLink:"premiumServiceBarringsLink",openLinkIn:"openLinkIn",onSuccessfulSubmit:"onSuccessfulSubmit",isMember:"isMember"},outputs:{isFormChanged:"isFormChanged"},standalone:!1,features:[h.\u0275\u0275InheritDefinitionFeature,h.\u0275\u0275NgOnChangesFeature],decls:12,vars:7,consts:[[1,"content-section"],[1,"mobile-usage-limits","padding--xl--md","padding--l"],[1,"font--body-large-bold"],[1,"font--body-regular"],[1,"mobile-usage-limits__premium","pt--s",3,"ngClass"],[1,"width--full","padding--lg","border-radius--card-md","background--default","margin-bottom--lg"],["appearance","tertiary","size","sm","width","none","is-alternate","false","status","none","element","button","type","button","pointer-event","auto"],[1,"font--body-regular","mr--xxs--md"],[1,"text-weight--l"],[1,"display--flex","justify-content--between","align-items--center"],["for","premiumLimits",1,"font--body-regular-bold","margin-bottom--3xs"],[1,"font-body-caption-regular"],[1,"mobile-usage-limits","premium-input"],[1,"display--flex","width--full"],[1,"width--full","margin-top--3xs",3,"formGroup"],[1,"mobile-usage-limits","premium-edit"],["appearance","tertiary","size","sm","width","none","is-alternate","false","status","none","element","button","type","button","pointer-event","auto",3,"winkButtonClicked"],[1,"width--full"],[1,"form__input-container",3,"ngClass"],["type","text","id","premiumLimits","name","premiumLimit","formControlName","premiumLimit",1,"form__input","form__input--max-width",3,"blur","ngClass"],[1,"form__msg--error","form__input__invalid-message"]],template:function(t,n){t&1&&(h.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"p",2),h.\u0275\u0275text(3),h.\u0275\u0275pipe(4,"translate"),h.\u0275\u0275elementEnd(),h.\u0275\u0275conditionalCreate(5,ic,3,3,"p",3)(6,tc,3,3,"p",3),h.\u0275\u0275elementStart(7,"div",4)(8,"div",5),h.\u0275\u0275conditionalCreate(9,oc,4,4)(10,mc,14,17),h.\u0275\u0275elementEnd()(),h.\u0275\u0275conditionalCreate(11,pc,3,3,"wink-button",6),h.\u0275\u0275elementEnd()()),t&2&&(h.\u0275\u0275advance(3),h.\u0275\u0275textInterpolate1(" ",h.\u0275\u0275pipeBind1(4,5,"ng.mobile-usage-limits.lbl.premium-service-limits")," "),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(n.isMember?5:6),h.\u0275\u0275advance(2),h.\u0275\u0275property("ngClass",n.isEditMode&&!n.isMember?"":"display--flex--sm flex-direction--row--sm"),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(n.isMember?9:10),h.\u0275\u0275advance(2),h.\u0275\u0275conditional(n.premiumServiceBarringsLink&&!n.isMember?11:-1))},dependencies:[Io.NgClass,ge.\u0275NgNoValidate,ge.DefaultValueAccessor,ge.NgControlStatus,ge.NgControlStatusGroup,ge.FormGroupDirective,ge.FormControlName,$e,y
1o.TranslatePipe],encapsulation:2})}}return i})();import*as Uo from"@ngx-translate/core";function vc(i,r){if(i&1){let e=x.\u0275\u0275getCurrentView();x.\u0275\u0275elementStart(0,"app-warning-dialog",4),x.\u0275\u0275listener("clickEvent",function(n){x.\u0275\u0275restoreView(e);let o=x.\u0275\u0275nextContext();return x.\u0275\u0275resetView(o.warningDialogEvent(n))}),x.\u0275\u0275elementEnd()}if(i&2){let e=x.\u0275\u0275nextContext();x.\u0275\u0275property("dialogData",e.warningDialogData)}}function Cc(i,r){i&1&&(x.\u0275\u0275elementStart(0,"div",5)(1,"span",12),x.\u0275\u0275text(2),x.\u0275\u0275pipe(3,"translate"),x.\u0275\u0275elementEnd()()),i&2&&(x.\u0275\u0275advance(2),x.\u0275\u0275textInterpolate1(" ",x.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-limits.lbl.member-notification-admin")," "))}function bc(i,r){if(i&1){let e=x.\u0275\u0275getCurrentView();x.\u0275\u0275elementStart(0,"app-out-of-bundle-limits",13),x.\u0275\u0275listener("isFormChanged",function(n){x.\u0275\u0275restoreView(e);let o=x.\u0275\u0275nextContext(2);return x.\u0275\u0275resetView(o.onFormChange(n))}),x.\u0275\u0275elementEnd()}if(i&2){let e=x.\u0275\u0275nextContext(2);x.\u0275\u0275property("usageLimit",e.usageLimit)("selectedAccount",e.selectedAccount)("parentForm",e.mobileUsageLimitForm)("isMember",e.isMember)}}function Sc(i,r){if(i&1){let e=x.\u0275\u0275getCurrentView();x.\u0275\u0275elementStart(0,"div",11)(1,"div",14)(2,"div",15)(3,"div",16),x.\u0275\u0275element(4,"div",17),x.\u0275\u0275elementStart(5,"button",18),x.\u0275\u0275listener("click",function(){x.\u0275\u0275restoreView(e);let n=x.\u0275\u0275nextContext(2);return x.\u0275\u0275resetView(n.submit())}),x.\u0275\u0275text(6),x.\u0275\u0275pipe(7,"translate"),x.\u0275\u0275elementEnd()()()()()}i&2&&(x.\u0275\u0275advance(6),x.\u0275\u0275textInterpolate1(" ",x.\u0275\u0275pipeBind1(7,1,"ng.mobile-usage-limits.btn.save-changes")," "))}function Ec(i,r){if(i&1){let e=x.\u0275\u0275getCurrentView();x.\u0275\u0275conditionalCreate(0,Cc,4,3,"div",5),x.\u0275\u0275elementStart(1,"div",6)(2,"div",7),x.\u0275\u0275element(3,"wink-icon",8),x.\u0275\u0275elementStart(4,"h2"),x.\u
10275\u0275text(5),x.\u0275\u0275pipe(6,"translate"),x.\u0275\u0275elementEnd()()(),x.\u0275\u0275conditionalCreate(7,bc,1,4,"app-out-of-bundle-limits",9),x.\u0275\u0275elementStart(8,"app-premium-services",10),x.\u0275\u0275listener("isFormChanged",function(n){x.\u0275\u0275restoreView(e);let o=x.\u0275\u0275nextContext();return x.\u0275\u0275resetView(o.onFormChange(n))}),x.\u0275\u0275elementEnd(),x.\u0275\u0275conditionalCreate(9,Sc,8,3,"div",11)}if(i&2){let e=x.\u0275\u0275nextContext();x.\u0275\u0275conditional(e.isMember?0:-1),x.\u0275\u0275advance(5),x.\u0275\u0275textInterpolate(x.\u0275\u0275pipeBind1(6,11,"ng.line-navigation-list.link.payByMobile.tln")),x.\u0275\u0275advance(2),x.\u0275\u0275conditional(e.hideOutOfBundleSection==="false"&&e.showOutOfBundleSection?7:-1),x.\u0275\u0275advance(),x.\u0275\u0275property("selectedAccount",e.selectedAccount)("usageLimit",e.usageLimit)("parentForm",e.mobileUsageLimitForm)("onSuccessfulSubmit",e.onSuccessfulSubmit)("isMember",e.isMember)("openLinkIn",e.openLinkIn)("premiumServiceBarringsLink",e.premiumServiceBarringsLink),x.\u0275\u0275advance(),x.\u0275\u0275conditional(e.showSaveButton?9:-1)}}var No=(()=>{class i extends ae{constructor(e,t,n,o,C,N,P,F,q){super(C),this.loginService=e,this._productService=t,this._accountSelectorService=n,this._messageService=o,this.domService=N,this.mobileUsageLimitsDataLayer=P,this.invalidInputControlScrollService=F,this.urlService=q,this.messageGroupName=D.MESSAGE_GROUP_NAME,this.scopes=D.SCOPES,this.customMessageGroupName=D.CUSTOM_MESSAGE_GROUP_NAME,this.showSaveButton=!1,this.showWarningDialog=!1,this.onSuccessfulSubmit=new hc(!1),this.mobileUsageLimitsDataLayer.componentInstanceId=this.componentInstanceId}ngAfterViewInit(){this.getUserDetails()}initAfterLoggedIn(){this._messageService.clearMessages(D.CUSTOM_MESSAGE_GROUP_NAME);let e=this.urlService.getRequestParamValue("msisdn","");w(e)||this._productService.getProductByIdentifier(this.messageGroupName,e,!0).subscribe(t=>
1{this.processDetailsForUsageLimits(t)}),this.obs(this._accountSelectorService.getSelectedAccount()).subscribe({next:t=>{this.processDetailsForUsageLimits(t)},error:t=>{if(!t.serviceError)this._messageService.addMessage(new ne(this.messageGroupName,"account-selector.error.empty-"+t.keyLabel));else{let n=this._messageService.getMessagesByGroupName(Z.MESSAGE_GROUP),o=n&&n[0].key;this._messageService.clearMessages(Z.MESSAGE_GROUP),this._messageService.clearMessages(this.customMessageGroupName),this._messageService.addMessage(new ne(this.messageGroupName,o))}}})}processDetailsForUsageLimits(e){this.selectedAccount=e,this.selectedAccountIdentifier=this.selectedAccount.identifier||this.selectedAccount.msisdn,this.selectedAccountIdentifier&&this.getUsageLimits(),this.showSaveButton=!1,this.domService.scrollToTop()}getUsageLimits(){this.obs(this._productService.getMobileUsageLimits(this.messageGroupName,this.selectedAccountIdentifier)).subscribe(e=>{if(this.usageLimit=e,this.selectedAccount.productType)this.showOutOfBundleSection=this.selectedAccount.productType!==J.PRODUCT_TYPE_BUNDLE&&!w(e.mobile.outOfBundle.limit);else{this.selectedPlanAccount=this.selectedAccount;let t=this.selectedPlanAccount.plan.productType.toLowerCase();this.showOutOfBundleSection=t!==J.PRODUCT_TYPE_BUNDLE&&!w(e.mobile.outOfBundle.limit)}this.buildForm()})}buildForm(){this.mobileUsageLimitForm=new fc({}),setTimeout(()=>{this.initialFormState=St(this.mobileUsageLimitForm.controls,e=>e.value)},100)}onFormChange(e){let t=St(this.mobileUsageLimitForm.controls,n=>n.value);this.showSaveButton=!1,Q(this.initialFormState,t)||(this.showSaveButton=e)}submit(){this.invalidInputControlScrollService.getFocusOnFirstErrorField(this.mobileUsageLimitForm)||(this.isSelectedPremiumLimitLessThanCurrentUsage()||this.isSelectedOOBLimitLessThanCurrentUsage()?(this.setWarningLabels(),this.showWarningDialog=!0):this.selectedAccount&&this.selectedAccountIdentifier&&this.saveData())}setWarningLabels(){this.isSelectedOOBLimitLessThanCurrentUsage()&&this.isSelectedPremiumLimitLessThanCurrentUsage()?this.warningDialogData=D.COMBINED_WARNING_DIALOG_DATA:this.isSelectedOOBLimitLessThanCurrentUsage()?this.warningDialogData=D.OUT_OF_BUNDLE_WARNING_DIALOG_DATA:this.isSelectedPremiumLimitLessThanCurrentUsage()&&(this.warningDialogData=D.PREMIUM_SERVICE_LIMIT_WARNING_DIALOG_DATA)}getUserDetails(){this.obs(this.loginService.getLoginDetails()).subscribe(e=>{this.loginDetails=e,(this.loginDetails.isMember()||this.loginDetails.isChild())&&(this.isMember=!0)})}get outOfBundleControl(){return this.mobileUsageLimitForm.get(D.OUT_OF_BUNDLE_CONTROL)}get premiumLimitsControl(){return this.mobileUsageLimitForm.get(D.PREMIUM_LIMITS_CONTROL)}isSelectedPremiumLimitLessThanCurrentUsage(){return+this.premiumLimitsControl.value<+this.usageLimit.mobile.premiumService.currentUsage&&this.premiumLimitsControl.dirty}isSelectedOOBLimitLessThanCurrentUsage(){let e=this.mobileUsageLimitForm.get(D.OUT_OF_BUNDLE_CONTROL);return e&&e.value!==""&&+e.value<+this.usageLimit.mobile.outOfBundle.currentUsage&&e.dirty}warningDialogEvent(e){if(this.showWarningDialog=!1,e)this.selectedAccount&&this.selectedAccountIdentifier&&this.saveData();else{if(this.isSelectedOOBLimitLessThanCurrentUsage()){let t=this.usageLimit.mobile.outOfBundle.limit.value,n=t==="10000000000"?"":t;this.mobileUsageLimitForm.get(D.OUT_OF_BUNDLE_CONTROL).patchValue(n)}this.isSelectedPremiumLimitLessThanCurrentUsage()&&this.mobileUsageLimitForm.get(D.PREMIUM_LIMITS_CONTROL).patchValue(this.usageLimit.mobile.premiumService.limit.value)}}saveData(){this._messageService.clearMessages(this.customMessageGroupName);let e=this.getRequestBody();this.obs(this._productService.putMobileUsageLimits(this.messageGroupName,J.PRODUCT_TYPE_MOBILE,this.selectedAccountIdentifier,e,this.typeOfModification)).subscribe(t=>{this._messageService.addMessage(new Mi(D.CUSTOM_MESSAGE_GROUP_NAME,D.SUCCESSFULLY_SAVE_MESSAGE)),this.mobileUsageLimitForm.markAsPristine(),this.mobileUsageLimitForm.markAsUntouched(),this.onSuccessfulSubmit.next(!0),this.showSaveButton=!1,this.mobileUsageLimits
1DataLayer.sendUsageLimitUpdateEvent(e)})}getRequestBody(){return{mobile:this.generatePayLoad()}}generatePayLoad(){let e={},t=this.mobileUsageLimitForm.get(D.OUT_OF_BUNDLE_CONTROL),n=this.mobileUsageLimitForm.get(D.PREMIUM_LIMITS_CONTROL);return t&&n&&t.dirty&&n.dirty?(e.outOfBundle=this.getOutOfBundlePayload(),e.premiumService=this.getPremiumServiceLimitsPayLoad()):n&&n.dirty?(e.premiumService=this.getPremiumServiceLimitsPayLoad(),this.typeOfModification=D.TYPE_PREMIUM_SERVICE):t&&t.dirty&&(e.outOfBundle=this.getOutOfBundlePayload(),this.typeOfModification=D.TYPE_OUT_OF_BUNDLE),e}getOutOfBundlePayload(){let e=this.outOfBundleControl&&this.outOfBundleControl.value,t=xi(Ei({},this.usageLimit.mobile.outOfBundle),{preferenceGroup:this.selectedAccount.plan.usageLimits.outOfBundle.preferenceGroup,preferenceTypes:this.selectedAccount.plan.usageLimits.outOfBundle.limits.filter(n=>n.communicationPreferenceTypeValue==="100"||n.isEditable===!1).map(n=>n.communicationPreferenceType)});return t.limit.value=e,t.limit.enabled=this.outOfBundleControl&&this.outOfBundleControl.value!=="",t}getPremiumServiceLimitsPayLoad(){let e=k(this.usageLimit.mobile.premiumService);return e.preferenceGroup=this.selectedAccount.plan.usageLimits.premiumService.preferenceGroup,e.limit.value=this.premiumLimitsControl.value,e}static{this.\u0275fac=function(t){return new(t||i)(x.\u0275\u0275directiveInject(nt.LoginService),x.\u0275\u0275directiveInject(re),x.\u0275\u0275directiveInject(Ue),x.\u0275\u0275directiveInject(W),x.\u0275\u0275directiveInject(x.ElementRef),x.\u0275\u0275directiveInject(oe),x.\u0275\u0275directiveInject(bo),x.\u0275\u0275directiveInject(Pi),x.\u0275\u0275directiveInject($))}}static{this.\u0275cmp=x.\u0275\u0275defineComponent({type:i,selectors:[["tg-mobile-usage-limits"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",premiumServiceBarringsLink:"premiumServiceBarringsLink",openLinkIn:"openLinkIn",hideOutOfBundleSection:"hideOutOfBundleSection",componentInstanceId:"componentInstanceId",showCardView:"showCardView"},standalone:!1,features:[x.\u0275\u0275InheritDefinitionFeature],decls:7,vars:10,consts:[[3,"componentCanRender","messageGroupName","scopes"],[3,"enableLoader","pageType","enableMask"],[3,"dialogData"],[3,"messageGroupName"],[3,"clickEvent","dialogData"],[1,"notification","notification--info","mb-15"],[1,"navigation-content__header","mobile-usage-limits","padding--xl--md"],[1,"title","align-items--center"],["icon","password","type","stroked","appearance","default","size","md","icon-color","default","part","","exportparts","icon, icon-password",1,"margin-right--xs"],[3,"usageLimit","selectedAccount","parentForm","isMember"],[3,"isFormChanged","selectedAccount","usageLimit","parentForm","onSuccessfulSubmit","isMember","openLinkIn","premiumServiceBarringsLink"],[1,"sticky-section"],[1,"icon","icon-information-shape","info"],[3,"isFormChanged","usageLimit","selectedAccount","parentForm","isMember"],[1,"sticky-footer-v2","position--fixed","background-white","width--full","py--m","px--xm","p--xm--md","display--flex","justify-content--center","align-items--center","box-sizing--inherit","shadow--xs-inverse","position--bottom","position--left"],[1,"sticky-footer-v2__container","width--full","default-max-site-width","display--flex","justify-content--between","align-items--center"],[1,"next-section","display--flex","flex-direction--column","width--full","justify-content--end--sm","align-items--center","flex-direction--row--sm"],[1,"sticky-footer-v2__message","mb--xxs","mb--n--sm","mr--m--sm"],[1,"button","button--primary",3,"click"]],template:function(t,n){t&1&&(x.\u0275\u0275elementStart(0,"tg-login",0),x.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),x.\u0275\u0275element(1,"app-loader",1),x.\u0275\u0275conditionalCreate(2,vc,1,1,"app-warning-dialog",2),x.\u0275\u0275element(3,"app-message-flow",3),x.\u0275\u0275elementStart(4,"app-message-flow",3),x.\u0275\u0275element(5,"app-bundle-line-selector",3),x.\u0275\u0275conditionalCreate(6,Ec,10,13),x.\u0275\u0275elementEnd()()),t&2&&(x.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.scopes),x.\u0275\u0275advance(),x.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask),x.\u0275\u0275advance(),x.\u0275\u0275conditional(n.showWarningDialog?2:-1),x.\u0275\u0275advance(),x.\u0275\u0275property("messageGroupName",n.customMessageGroupName),x.\u0275\u0275advance(),x.\u0275\u0275property("messageGroupName",n.messageGroupName),x.\u0275\u0275advance(),x.\u0275\u0275property("messageGroupName",n.messageGroupName),x.\u0275\u0275advance(),x.\u0275\u0275conditional(n.usageLimit?6:-1))},dependencies:[be,nt.LoginComponent,Ai,Se,Ee,To,Oo,Uo.TranslatePipe],encapsulation:2})}}return i})();import{MatSelectModule as dp}from"@angular/material/select";import{MatInputModule as mp}from"@angular/material/input";import"@angular/core";import{forkJoin as $o,of as Wo}from"rxjs";import{FormGroup as Wd}from"@angular/forms";var ot=class{constructor(){this.categories=[]}createEnhancedNotifications(){this.productInfo.usagenotifications&&(this.categories=zt.chain(this.productInfo.usagenotifications[this.product]).groupBy(r=>r.category).map(r=>({category:r&&r[0].category,preferenceGroups:this.addPreferenceGroups(k(r),this.isOutOfBundleLimitEnabled,this.productInfo.usageLimits),pids:k(this.profileDetails)}
1)).value(),this.updateSelectedStatus(this.usageNotificationsRes,this.isPrepaid))}addPreferenceGroups(r,e,t){return e&&r[0].category===U.OUT_OF_BUNDLE_SECTION&&(r=[{category:r[0].category,preferenceGroup:t.outOfBundle.preferenceGroup,threshold:t.outOfBundle.limits}]),r}updateSelectedStatus(r,e){Y(this.categories,t=>{let n=[];Y(t.preferenceGroups,o=>{let C=Fe(r,N=>!!X(N.pidPreferences,P=>P.preferenceGroup===o.preferenceGroup));this.updatedThresholdStatus(C[0],o,e),n=[...n,...C]}),n=Kt(n,o=>o.pid),this.updateProfileStatus(n,t)})}updatedThresholdStatus(r,e,t){if(r){let n=X(r.pidPreferences,o=>o.preferenceGroup===e.preferenceGroup);Y(e.threshold,o=>{let C=X(n.preferences,N=>N.preferenceType===o.communicationPreferenceType);o.selected=!!C,t&&e.category===U.INCLUDED_SECTION&&o.communicationPreferenceType!=="BucketNearlyExpired"&&(o.communicationPreferenceTypeValue=U.PREPAID_BUCKET_THRESHOLD_MAP[o.communicationPreferenceType]),o.values&&C&&(o.selectedValues=C.values)})}}updateProfileStatus(r,e){Y(e.pids,t=>{let n=!!X(r,o=>o.pid===t.pid);t.selected=n,t.hasChanged=!1})}};import"@telenet/ng-lib-ocapi";import"@angular/core";import*as Ge from"@angular/core";var Bo=(()=>{class i{constructor(e,t,n,o){this.customerService=e,this.internetProductService=t,this.productService=n,this.mobileService=o}createPostData(e,t,n,o){let C=k(e),N=k(t);return this.mobileUsageLimit=k(o),this.isBundleLine=n,Y(N.categories,P=>{Y(P.pids,F=>{C=this.updateNotifications(F,P.preferenceGroups,C)})}),C.filter(P=>!w(P.pidPreferences))}createAutoPausePostRequest(e,t,n,o){let C=e.controls[U.PERSONAL_USAGE_LIMIT_CONTROL].value.split(" ");return{id:t.id,limit:{id:t.limit.id,enabled:n?o:e.controls[U.ACTIVATE_AUTO_PAUSE_CONTROL].value,value:w(C[0])?0:C[0],unitType:t.limit.unitType,originalUnitType:t.limit.originalUnitType}}}loadCategory(e){return e.productInfo.usagenotifications[U.PRODUCT_TYPE_MOBILE].map(t=>{if(t.category===U.BUNDLE_SECTION)switch(t.preferenceGroup){case U.BUNDLE_PREFERENCE_GROUP_SINGLE_SECTION:return t.category=U.BUNDLE_SINGLE_SECTION,t;case U.BUNDLE_PREFERENCE_GROUP_NATIONAL_SECTION:case U.C5_BUNDLE_PREFERENCE_GROUP_NATIONAL_SECTION:return t.category=U.BUNDLE_NATIONAL_SECTION,t;case U.BUNDLE_PREFERENCE_GROUP_EU_SECTION:case U.C5_BUNDLE_PREFERENCE_GROUP_EU_SECTION:return t.category=U.BUNDLE_EU_SECTION,t}return t})}getBundlePostData(e,t){let n=k(e),o=t.categories.filter(N=>U.BUNDLE_CATEGORIES.includes(N.category)),C=[];return n.forEach(N=>{let F={pid:N.pid,pidPreferences:[]};N.pidPreferences.forEach(q=>{o.forEach(te=>{te.preferenceGroups.forEach(Te=>{if(Te.preferenceGroup===q.preferenceGroup){let cr={preferenceGroup:Te.preferenceGroup,preferences:q.preferences};F.pidPreferences.push(cr),C.push(F)}})})})}),Wt(C)}getProfileDetails(e){return this.customerService.getProfileIdentityDetails(e)}manageAutoPause(e,t){return this.mobileService.manageAutoPause(e,t)}getMobileUsageNotifications(e,t,n){return this.internetProductService.getInternetUsageNotifications(e,t,n)}getUsageLimits(e,t){return this.productService.getMobileUsageLimits(e,t)}getAutoPause(e,t){return this.mobileService.getAutoPause(e,t)}updateNotificationsRequest(e,t,n,o,C){return this.internetProductService.updateUsageNotifications(n,o,e,C,t)}updateNotifications(e,t,n){let o,C=k(n),N=C.find((P,F)=>{if(P.pid===e.pid)return o=F,!0});return N||(N={},N.pid=e.pid,N.channels=U.CHANNELS,N.pidPreferences=[],C.push(N)),e.selected?N=this.createNotificationPreferences(N,t):N=this.removeNotificationPreferences(N,t),C[o]=N,C}createNotificationPreferences(e,t){let n=k(e);return Y(t,o=>{let C=n.pidPreferences.find(N=>N.preferenceGroup===o.preferenceGroup);this.clonedPidPreference=k(C),C?C.preferences=this.createPreferences(o):(C={},C.preferenceGroup=o.preferenceGroup,C.preferences=this.createPreferences(o),n.pidPreferences.push(C))}),n}createPreferences(e){return Vt(e.threshold.map(t=>{if(t.selected||t.isEditable===!1||U.PID_GROUP_PREFERENCE_CATEGORY.includes(e.category)&&pe(this.clonedPidPreference)&&!this.mobileUsageLimit.isOutOfBundleLimitEnabled()){let n={preferenceType:t.communicationPreferenceType,channels:U.CHANNELS};return U.PID_GROUP_PREFERENCE_CATEGORY.includes(e.category)&&(n.values=t.selectedValues),n}}))}removeNotificationPreferences(e,t){let n=k(e);return Y(t,o=>{let C=n.pidPreferences.find(N=>N.preferenceGroup===o.preferenceGroup);C&&(C.preferences=[])}),n}static{this.\u0275fac=function(t){return new(t||i)(Ge.\u0275\u0275inject(an),Ge.\u0275\u0275inject(ln),Ge.\u0275\u0275inject(re),Ge.\u0275\u0275inject(qe))}}static{this.\u0275prov=Ge.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import"@angular/core";import{EventCategoryEnum as Tc}from"@telenet/ng-lib-datalayer";import*as rt from"@angular/core";import*as Mo from"@telenet/ng-lib-datalayer";var wo=(()=>{class i{constructor(e){this.dataLayerService=e,this.messageGroups=[U.CUSTOM_MESSAGE_GROUP_NAME]}createSectionEvent(e,t){let n=this.dataLayerService.createEventInfo(U.EVENT_NAME_SET_MOBILE_NOTIFICATION,U.EVENT_TYPE_CHANGE_MOBILE_SERVICE_SETTINGS,this.messageGroups),o=U.NOTIFICATIONS_SECTION.find(N=>e.category===N.name).value,C={itemName:t+":"+o+":"+e.preferenceGroups[0].preferenceGroup,itemData:this.createItemData(e)};C.itemData=this.createAttributes(C,e),this.addEventToDataLayer(n,C)}createAutopauseEventDataLayerEvent(e){let t=e?this.dataLayerService.createEventInfo(U.AUTOPAUSE_ON,U.CLICK,this.messageGroups):this.dataLayerService.createEventInfo(U.AUTOPAUSE_OFF,U.CLICK,this.messageGroups);this.addEventToDataLayer(t)}pushDataToAnalytics(e,t,n,o,C,N){t&&this.createEvent(e,U.OPTION_SECTION,N),n&&this.createEvent(e,U.CREDIT_SECTION,N),o&&this.createAutopauseEventDataLayerEvent(C.get(U.ACTIVATE_AUTO_PAUSE_CONTROL).value)}prepaidAnalytics(e,t,n,o,C){t&&this.createEvent(e,U.INCLUDED_SECTION,C),n&&this.createEvent(e,U.OUT_OF_BUNDLE_SECTION,C),o&&this.createEvent(e,U.PERSONAL_MOBILE_DATA_SECTION,C)}createEvent(e,t,n){let o=n.categories.find(C=>C.category.toLowerCase().includes(t.toLowerCase()));o&&this.createSectionEvent(o,e)}createItemData(e){return e.preferenceGroups[0].threshold.map(t=>{if(!w(t.selectedValues)&&!Q(t.communicationPreferenceTypeValue,"NA")&&t.selected)return t.communicationPreferenceTypeValue+"%,"+t.selectedValues;if(!w(t.selectedValues))return t.selectedValues;if(t.selected)return t.communicationPreferenceTypeValue+"%"}).filter(t=>t).join()}createAttributes(e,t){return t.pids.some(n=>n.hasChanged)?e.itemData+","+U.PROFILE_CHANGED:e.itemData}addEventToDataLayer(e,t){let n=this.dataLayerService.createCategory(Tc.PRIMARY_CATEGORY_CARE,U.PRODUCT_TYPE_MOBILE),o=t||{};this.dataLayerService.addEvent(e,o,n)}static{this.\u0275fac=function(t){return new(t||i)(rt.\u0275\u0275inject(Mo.DataLayerService))}}static{this.\u0275prov=rt.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import{DOCUMENT as Kd}from"@angular/common";import*as d from"@angular/core";import*as pt from"@telenet/ng-lib-ocapi";import*as si from"@angular/common";import{EventEmitter as Ci}from"@angular/core";import{FormArray as Po,FormControl as Ao}
1from"@angular/forms";import{DOCUMENT as Nc}from"@angular/common";import"@ngx-translate/core";import*as a from"@angular/core";import*as st from"@ngx-translate/core";import*as _e from"@angular/common";import*as ce from"@angular/forms";import{EventEmitter as yc}from"@angular/core";import"@angular/forms";import*as M from"@angular/core";import*as at from"@angular/common";import*as le from"@angular/forms";function Lc(i,r){if(i&1&&M.\u0275\u0275element(0,"img",13),i&2){let e=M.\u0275\u0275nextContext(2);M.\u0275\u0275property("src",e.profileIcon,M.\u0275\u0275sanitizeUrl)("override",!0)}}function Oc(i,r){if(i&1){let e=M.\u0275\u0275getCurrentView();M.\u0275\u0275elementStart(0,"img",14),M.\u0275\u0275listener("error",function(){M.\u0275\u0275restoreView(e);let n=M.\u0275\u0275nextContext().index,o=M.\u0275\u0275nextContext();return M.\u0275\u0275resetView(o.categoryDetails.pids[n].showIcon=!0)}),M.\u0275\u0275elementEnd()}if(i&2){let e=M.\u0275\u0275nextContext().index,t=M.\u0275\u0275nextContext();M.\u0275\u0275property("src",t.getProfileImageUrl(t.categoryDetails.pids[e].pid),M.\u0275\u0275sanitizeUrl)("override",!0)}}function Uc(i,r){if(i&1){let e=M.\u0275\u0275getCurrentView();M.\u0275\u0275elementStart(0,"div",3)(1,"div",4),M.\u0275\u0275element(2,"input",5),M.\u0275\u0275elementStart(3,"label",6),M.\u0275\u0275listener("click",function(){let n=M.\u0275\u0275restoreView(e).index,o=M.\u0275\u0275nextContext();return M.\u0275\u0275resetView(o.toggleProfile(n))}),M.\u0275\u0275elementStart(4,"div",7),M.\u0275\u0275template(5,Lc,1,2,"img",8)(6,Oc,1,2,"img",9),M.\u0275\u0275elementEnd(),M.\u0275\u0275elementStart(7,"div",10)(8,"div",11)(9,"div",12),M.\u0275\u0275text(10),M.\u0275\u0275elementEnd()(),M.\u0275\u0275elementStart(11,"div",12),M.\u0275\u0275text(12),M.\u0275\u0275elementEnd()()()()()}if(i&2){let e=r.$implicit,t=r.index,n=M.\u0275\u0275nextContext();M.\u0275\u0275property("formArrayName",n.profileControlName),M.\u0275\u0275advance(2),M.\u0275\u0275property("formControlName",t)("checked",e.value),M.\u0275\u0275advance(),M.\u0275\u0275property("for",M.\u0275\u0275interpolate1("checkboxCard-",t)),M.\u0275\u0275advance(2),M.\u0275\u0275property("ngIf",n.categoryDetails.pids[t].showIcon),M.\u0275\u0275advance(),M.\u0275\u0275property("ngIf",!n.categoryDetails.pids[t].showIcon),M.\u0275\u0275advance(4),M.\u0275\u0275textInterpolate(n.categoryDetails.pids[t]==null?null:n.categoryDetails.pids[t].firstname),M.\u0275\u0275advance(2),M.\u0275\u0275textInterpolate1(" ",n.categoryDetails.pids[t]==null?null:n.categoryDetails.pids[t].lastname," ")}}var oi=(()=>{class i{constructor(e){this.profileDetailsService=e,this.isProfilesFormHasError=new yc,this.profileIcon=U.PROFILE_ICON}toggleProfile(e){this.categoryDetails.pids[e].selected=!this.categoryDetails.pids[e].selected,this.categoryDetails.pids[e].hasChanged=!this.categoryDetails.pids[e].hasChanged,this.profiles.controls[e].markAsTouched(),this.profiles.controls[e].patchValue(!this.profiles.controls[e].value),this.isProfilesFormHasError.emit(this.profiles.hasError("checkboxReq"))}getProfileImageUrl(e){return this.profileDetailsService.getProfileImageUrl(e)}static{this.\u0275fac=function(t){return new(t||i)(M.\u0275\u0275directiveInject(pn))}}static{this.\u0275cmp=M.\u0275\u0275defineComponent({type:i,selectors:[["app-profile-selector"]],inputs:{parentForm:"parentForm",profiles:"profiles",categoryDetails:"categoryDetails",profileControlName:"profileControlName"},outputs:{isProfilesFormHasError:"isProfilesFormHasError"},standalone:!1,decls:3,vars:2,consts:[[3,"formGroup"],[1,"row"],["class","col-md-4 col-sm-12 mb--xs",3,"formArrayName",4,"ngFor","ngForOf"],[1,"col-md-4","col-sm-12","mb--xs",3,"formArrayName"],[1,"checkbox-container"],["type","checkbox","name","card-checkbox",1,"checkbox-container__input",3,"formControlName","checked"],[1,"checkbox-container__label","border-radius--lg","profile-label",3,"click","for"],[1,"checkbox-container__label__tick","icon-circle","profile-icon","mr-20"],["alt","profile icon",3,"src","override",4,"ngIf"],["class","profile-icon","alt","profile icon",3,"src","override","error",4,"ngIf"],[1,"checkbox-container__label__content","border-radius--lg","word-break--ellipsis","line-height--20"],[1,"display--block"],[1,"ellipsis"],["alt","profile icon",3,"src","override"],["alt","profile icon",1,"profile-icon",3,"error","src","override"]],template:function(t,n){t&1&&(M.\u0275\u0275elementStart(0,"form",0)(1,"div",1),M.\u0275\u0275template(2,Uc,13,9,"div",2),M.\u
10275\u0275elementEnd()()),t&2&&(M.\u0275\u0275property("formGroup",n.parentForm),M.\u0275\u0275advance(2),M.\u0275\u0275property("ngForOf",n.profiles==null?null:n.profiles.controls))},dependencies:[at.NgForOf,at.NgIf,le.\u0275NgNoValidate,le.CheckboxControlValueAccessor,le.NgControlStatus,le.NgControlStatusGroup,le.FormGroupDirective,le.FormControlName,le.FormArrayName,Ni],encapsulation:2})}}return i})();var Do=i=>({price:i}),Bc=i=>({disabled:i}),Mc=i=>({"cursor--default opacity--mid-transparency":i}),Ro=i=>({value:i});function wc(i,r){i&1&&(a.\u0275\u0275elementStart(0,"div",11),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementEnd()),i&2&&(a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-notifications.lbl.header-description")," "))}function Pc(i,r){i&1&&a.\u0275\u0275elementContainer(0)}function Ac(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h4",8),a.\u0275\u0275text(6),a.\u0275\u0275pipe(7,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(8,wc,3,3,"div",9),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(9,Pc,1,0,"ng-container",10),a.\u0275\u0275elementEnd()()()()),i&2){let e=a.\u0275\u0275nextContext(),t=a.\u0275\u0275reference(3);a.\u0275\u0275advance(6),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(7,3,e.section.label)," "),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",e.isPrepaid&&(e.section==null?null:e.section.name)==="included"),a.\u0275\u0275advance(),a.\u0275\u0275property("ngTemplateOutlet",t)}}function Dc(i,r){i&1&&a.\u0275\u0275elementContainer(0)}function Rc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275template(1,Dc,1,0,"ng-container",10),a.\u0275\u0275element(2,"div",12),a.\u0275\u0275elementEnd()),i&2){a.\u0275\u0275nextContext(2);let e=a.\u0275\u0275reference(3);a.\u0275\u0275advance(),a.\u0275\u0275property("ngTemplateOutlet",e)}}function Fc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275template(1,Rc,3,1,"div",2),a.\u0275\u0275elementEnd()),i&2){let e=a.\u0275\u0275nextContext();a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",!e.collapsePanel)}}function kc(i,r){i&1&&(a.\u0275\u0275elementStart(0,"div",24)(1,"div",25),a.\u0275\u0275element(2,"span",26),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd()()),i&2&&(a.\u0275\u0275advance(2),a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.profile.error"),a.\u0275\u0275sanitizeHtml))}function Gc(i,r){i&1&&(a.\u0275\u0275elementStart(0,"div",24)(1,"div",25),a.\u0275\u0275element(2,"span",26),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd()()),i&2&&(a.\u0275\u0275advance(2),a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.threshold.error"),a.\u0275\u0275sanitizeHtml))}function Vc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div",17),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementEnd()),i&2){let e=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(2,1,e.section.subLabel)," ")}}function jc(i,r){if(i&1){let e=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementContainerStart(0),a.\u0275\u0275elementStart(1,"div",17),a.\u0275\u0275text(2),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",27)(5,"div",28)(6,"span",29),a.\u0275\u0275text(7),a.\u0275\u0275pipe(8,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"a",30),a.\u0275\u0275listener("click",function(n){a.\u0275\u0275restoreView(e);let o=a.\u0275\u0275nextContext(3);return a.\u0275\u0275resetView(o.openUrl(n))}),a.\u0275\u0275text(10),a.\u0275\u0275pipe(11,"translate"),a.\u0275\u0275elementEnd()()(),a.\u0275\u0275elementContainerEnd()}if(i&2){let e=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(3,4,"ng.mobile-usage-notifications.lbl.your-usage-limit")," "),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind2(8,6,"ng.mobile-usage-notifications.lbl.price",a.\u0275\u0275pureFunction1(11,Do,e.usageLimit==null||e.usageLimit.mobile==null||e.usageLimit.mobile.outOfBundle==null||e.usageLimit.mobile.outOfBundle.limit==null?null:e.usageLimit.mobile.outOfBundle.limit.value))," "),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngClass",a.\u0275\u0275pureFunction1(13,Bc,e.parentForm.disabled)),a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(11,9,"ng.mobile-usage-notifications.lbl.change-your-usage-limit")," ")}}function Hc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div",34),a.\u0275\u0275text(1),a.\u
10275\u0275elementEnd()),i&2){let e=r.$implicit;a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",e.productInfo.name," ")}}function Yc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div")(1,"div",31),a.\u0275\u0275text(2),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",32),a.\u0275\u0275template(5,Hc,2,1,"div",33),a.\u0275\u0275elementEnd()()),i&2){let e=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(3,2,"ng.mobile-usage-notifications.lbl.your-active-options")," "),a.\u0275\u0275advance(3),a.\u0275\u0275property("ngForOf",e.options)}}function $c(i,r){if(i&1&&(a.\u0275\u0275elementContainerStart(0),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementContainerEnd()),i&2){let e=a.\u0275\u0275nextContext().index,t=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-notifications.lbl.price",a.\u0275\u0275pureFunction1(4,Do,t.categoryDetails==null||t.categoryDetails.preferenceGroups[0]==null||t.categoryDetails.preferenceGroups[0].threshold[e]==null?null:t.categoryDetails.preferenceGroups[0].threshold[e].communicationPreferenceTypeValue.split(" ")[0]))," ")}}function Wc(i,r){if(i&1&&(a.\u0275\u0275elementContainerStart(0),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementContainerEnd()),i&2){let e=a.\u0275\u0275nextContext().index,t=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(2,1,t.categoryDetails==null||t.categoryDetails.preferenceGroups[0]==null||t.categoryDetails.preferenceGroups[0].threshold[e]==null?null:t.categoryDetails.preferenceGroups[0].threshold[e].communicationPreferenceTypeValue)," ")}}function Kc(i,r){if(i&1&&(a.\u0275\u0275elementContainerStart(0),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementContainerEnd()),i&2){let e=a.\u0275\u0275nextContext().index,t=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-notifications.lbl.bucket-nearly-expired",a.\u0275\u0275pureFunction1(4,Ro,t.categoryDetails==null||t.categoryDetails.preferenceGroups[0]==null||t.categoryDetails.preferenceGroups[0].threshold[e]==null?null:t.categoryDetails.preferenceGroups[0].threshold[e].communicationPreferenceTypeValue))," ")}}function zc(i,r){if(i&1&&(a.\u0275\u0275elementContainerStart(0),a.\u0275\u0275text(1),a.\u0275\u0275elementContainerEnd()),i&2){let e=a.\u0275\u0275nextContext().index,t=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",(t.categoryDetails==null||t.categoryDetails.preferenceGroups[0]==null||t.categoryDetails.preferenceGroups[0].threshold[e]==null?null:t.categoryDetails.preferenceGroups[0].threshold[e].communicationPreferenceTypeValue)+"%"," ")}}function qc(i,r){i&1&&(a.\u0275\u0275elementStart(0,"div",44)(1,"div",45)(2,"div",46),a.\u0275\u0275element(3,"i",47)(4,"div",48),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(5,"div",49)(6,"div",50),a.\u0275\u0275element(7,"i",51),a.\u0275\u0275elementStart(8,"div",52)(9,"b")(10,"div",53),a.\u0275\u0275text(11),a.\u0275\u0275pipe(12,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(13,"div",54),a.\u0275\u0275text(14),a.\u0275\u0275pipe(15,"translate"),a.\u0275\u0275elementEnd()()()()()()),i&2&&(a.\u0275\u0275advance(11),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(12,2,"ng.mobile-usage-notifications.title.bucket-threshold-reached")," "),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(15,4,"ng.mobile-usage-notifications.lbl.bucket-threshold-reached-description")," "))}function Xc(i,r){if(i&1){let e=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",35)(1,"div",36),a.\u0275\u0275listener("click",function(){let n=a.\u0275\u0275restoreView(e).index,o=a.\u0275\u0275nextContext(3);return a.\u0275\u0275resetView(o.toggleThreshold(n))}
1),a.\u0275\u0275elementStart(2,"div")(3,"div",37),a.\u0275\u0275element(4,"input",38),a.\u0275\u0275elementStart(5,"label",39),a.\u0275\u0275text(6,"\xA0"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(7,"label",40),a.\u0275\u0275elementContainerStart(8,41),a.\u0275\u0275template(9,$c,3,6,"ng-container",42)(10,Wc,3,3,"ng-container",42)(11,Kc,3,6,"ng-container",42)(12,zc,2,1,"ng-container",42),a.\u0275\u0275elementContainerEnd(),a.\u0275\u0275elementEnd()(),a.\u0275\u0275template(13,qc,16,6,"div",43),a.\u0275\u0275elementEnd()()}if(i&2){let e=r.$implicit,t=r.index,n=a.\u0275\u0275nextContext(3);a.\u0275\u0275property("formArrayName",n.thresholdControlName),a.\u0275\u0275advance(4),a.\u0275\u0275property("formControlName",t)("checked",e.value),a.\u0275\u0275advance(),a.\u0275\u0275property("for","limit-checkbox-"+t),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngClass",a.\u0275\u0275pureFunction1(12,Mc,n.parentForm.disabled||e.disabled))("for","limit-checkbox-"+t),a.\u0275\u0275advance(),a.\u0275\u0275property("ngSwitch",!0),a.\u
10275\u0275advance(),a.\u0275\u0275property("ngSwitchCase",n.section.name==="credit"),a.\u0275\u0275advance(),a.\u0275\u0275property("ngSwitchCase",n.isPrepaid&&(n.section==null?null:n.section.name)==="included"&&(n.categoryDetails==null||n.categoryDetails.preferenceGroups[0]==null||n.categoryDetails.preferenceGroups[0].threshold[t]==null?null:n.categoryDetails.preferenceGroups[0].threshold[t].communicationPreferenceType)!=="BucketNearlyExpired"),a.\u0275\u0275advance(),a.\u0275\u0275property("ngSwitchCase",n.isPrepaid&&(n.section==null?null:n.section.name)==="included"&&(n.categoryDetails==null||n.categoryDetails.preferenceGroups[0]==null||n.categoryDetails.preferenceGroups[0].threshold[t]==null?null:n.categoryDetails.preferenceGroups[0].threshold[t].communicationPreferenceType)==="BucketNearlyExpired"),a.\u0275\u0275advance(),a.\u0275\u0275property("ngSwitchCase",!n.isPrepaid),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",n.isPrepaid&&(n.section==null?null:n.section.name)==="included"&&(n.categoryDetails==null||n.categoryDetails.preferenceGroups[0]==null||n.categoryDetails.preferenceGroups[0].threshold[t]==null?null:n.categoryDetails.preferenceGroups[0].threshold[t].communicationPreferenceType)==="BucketThresholdReached")}}function Qc(i,r){i&1&&(a.\u0275\u0275elementStart(0,"div",55)(1,"div",56)(2,"div",57),a.\u0275\u0275element(3,"i",58),a.\u0275\u0275elementStart(4,"div",59)(5,"b")(6,"div",53),a.\u0275\u0275text(7),a.\u0275\u0275pipe(8,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(9,"div",54),a.\u0275\u0275text(10),a.\u0275\u0275pipe(11,"translate"),a.\u0275\u0275elementEnd()()()()()),i&2&&(a.\u0275\u0275advance(7),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(8,2,"ng.mobile-usage-notifications.title.bucket-threshold-reached")," "),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(11,4,"ng.mobile-usage-notifications.lbl.bucket-threshold-reached-description")," "))}function Zc(i,r){if(i&1){let e=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",14),a.\u0275\u0275template(1,kc,4,3,"div",15)(2,Gc,4,3,"div",15)(3,Vc,3,3,"div",16)(4,jc,12,15,"ng-container",2)(5,Yc,6,4,"div",2),a.\u0275\u0275elementStart(6,"div",17),a.\u0275\u0275text(7),a.\u0275\u0275pipe(8,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"form",18)(10,"div",19),a.\u0275\u0275template(11,Xc,14,14,"div",20),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(12,Qc,12,6,"div",21),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(13,"div",22),a.\u0275\u0275text(14),a.\u0275\u0275pipe(15,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(16,"app-profile-selector",23),a.\u0275\u0275listener("isProfilesFormHasError",function(n){a.\u0275\u0275restoreView(e);let o=a.\u0275\u0275nextContext(2);return a.\u0275\u0275resetView(o.showErrorNotification(n))}),a.\u0275\u0275elementEnd()()}if(i&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.profileSelected),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.hasThresholdsError),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.isBundleLine&&e.section.subLabel),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.section.name==="outofbundle"),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.section.name==="option"),a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(8,14,"ng.mobile-usage-notifications.lbl.consumption-reminder-"+e.section.name)," "),a.\u0275\u0275advance(2),a.\u0275\u0275property("formGroup",e.parentForm),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngForOf",e.thresholds==null?null:e.thresholds.controls),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.isPrepaid&&(e.section==null?null:e.section.name)==="included"),a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(15,16,"ng.mobile-usage-notifications.lbl.profiles-"+e.section.name)," "),a.\u0275\u0275advance(2),a.\u0275\u0275property("parentForm",e.parentForm)("profiles",e.profiles)("categoryDetails",e.categoryDetails)("profileControlName",e.profileControlName)}}
1function Jc(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div",17),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementEnd()),i&2){let e=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",a.\u0275\u0275pipeBind1(2,1,e.section.subLabel)," ")}}function ed(i,r){if(i&1&&(a.\u0275\u0275element(0,"div",61),a.\u0275\u0275pipe(1,"translate")),i&2){let e=a.\u0275\u0275nextContext(3);a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind2(1,1,"ng.mobile-usage-notifications.lbl.member-notification-"+e.section.name,a.\u0275\u0275pureFunction1(4,Ro,e.selectedThresholds)),a.\u0275\u0275sanitizeHtml)}}function id(i,r){i&1&&(a.\u0275\u0275element(0,"div",61),a.\u0275\u0275pipe(1,"translate")),i&2&&a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind1(1,1,"ng.mobile-usage-notifications.lbl.no-member-notification-received"),a.\u0275\u0275sanitizeHtml)}function td(i,r){if(i&1&&(a.\u0275\u0275elementStart(0,"div",14),a.\u0275\u0275template(1,Jc,3,3,"div",16)(2,ed,2,6,"div",60)(3,id,2,3,"div",60),a.\u0275\u0275elementEnd()),i&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.isBundleLine),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.selectedThresholds!==""),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.selectedThresholds==="")}}function nd(i,r){if(i&1&&a.\u0275\u0275template(0,Zc,17,18,"div",13)(1,td,4,3,"div",13),i&2){let e=a.\u0275\u0275nextContext();a.\u0275\u0275property("ngIf",!e.isMember),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.isMember)}}var Fo=(()=>{class i extends G{constructor(e,t,n){super(),this.document=e,this.urlservice=t,this._translateService=n,this.hasOutOfBundleFormError=new Ci,this.isIncludedBundleChanged=new Ci,this.isOutOfBundleChanged=new Ci,this.isOptionsChanged=new Ci,this.isCreditsChanged=new Ci,this.thresholdControlName=U.THRESHOLD_CONTROL,this.profileControlName=U.PROFILE_CONTROL,this.showProfileWarning=!1,this.profileSelected=!1,this.selectedThresholds="",this.hasThresholdsError=!1}ngOnInit(){if(!this.isMember)this.categoryDetails.preferenceGroups&&(this.C5Bundle=this.categoryDetails.preferenceGroups.filter(e=>e.preferenceGroup===U.C5_BUNDLE_PREFERENCE_GROUP_EU_SECTION||e.preferenceGroup===U.C5_BUNDLE_PREFERENCE_GROUP_NATIONAL_SECTION)),this.thresholdControlName+=this.section.name,this.profileControlName+=this.section.name,this.addThresholdsControl(),this.addProfilesControl(),this.getInitialFormValues();else{let e=this.categoryDetails.pids.filter(t=>t.pid===this.loggedInPid&&t.selected);if(!w(e)){let t=this.categoryDetails.preferenceGroups[0].threshold.filter(n=>n.selected).map(n=>this.isPrepaid?`${this._translateService.instant(n.communicationPreferenceTypeValue)}`:`${n.communicationPreferenceTypeValue}%`);this.selectedThresholds=t.join(", ").replace(U.REGEX_REPLACE_LAST_COMMA," "+this._translateService.instant("ng.mobile-usage-notifications.lbl.and")+"$1")}}}addThresholdsControl(){this.thresholds=new Po(this.categoryDetails.preferenceGroups[0].threshold.map(e=>{let t=new Ao(e.selected);return e.communicationPreferenceTypeValue==="100"&&this.section.name!==U.OUT_OF_BUNDLE_SECTION&&t.disable(),e.communicationPreferenceTypeValue==="90"&&!w(this.C5Bundle)&&t.disable(),t})),this.obs(this.thresholds.valueChanges).subscribe(e=>{let t=!this.profiles.value.some(n=>n)&&this.thresholds.controls.some(n=>n.value)&&this.userPidLinked?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null;this.profiles.setErrors(t),this.profileSelected=!!t,this.checkForNoThresholdSelected(),this.checkForFormUpdates()}),this.parentForm.addControl(this.thresholdControlName,this.thresholds)}addProfilesControl(){this.profiles=new Po(this.categoryDetails.pids.map(e=>new Ao(e.selected)),[this.formValidator.bind(this)]),this.obs(this.profiles.valueChanges).subscribe(e=>{this.checkForNoThresholdSelected(),this.checkForFormUpdates()}),this.parentForm.addControl(this.profileControlName,this.profiles),this.profileSelected=this.profiles.hasError("checkboxReq")}toggleThreshold(e){this.userPidLinked&&(this.section.name===U.OUT_OF_BUNDLE_SECTION||this.categoryDetails.preferenceGroups[0].threshold[e].communicationPreferenceTypeValue!=="100"&&w(this.C5Bundle)&&this.parentForm.enabled)&&(this.isBundleLine?this.categoryDetails.preferenceGroups[0].threshold[e].selected=!this.categoryDetails.preferenceGroups[0].threshold[e].selected:Y(this.categoryDetails.preferenceGroups,t=>{t.threshold[e].selected=!t.threshold[e].selected}),this.thresholds.controls[e].markAsTouched(),this.thresholds.controls[e].patchValue(!this.thresholds.controls[e].value))}formValidator(e){return!e.controls.some(t=>t.value)&&this.thresholds.controls.some(t=>t.value)&&e.touched?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null}get modifiedMobileUsageLimitsLink(){return this.mobileUsageLimitsLink.replace(U.DYNAMIC_QUERY_KEY_PATTERN,this.selectedLine)}openUrl(e){e.preventDefault(),this.openLimitsLinkIn==="navigation-content"?this.document.dispatchEvent(new CustomEvent("loadpage",{bubbles:!0,detail:{pageUrl:this.modifiedMobileUsageLimitsLink,title:""}})):this.urlservice.redirectTo(this.modifiedMobileUsageLimitsLink)}checkForNoThresholdSelected(){this.categoryDetails.category===U.OUT_OF_BUNDLE_SECTION&&(this.hasThresholdsError=w(this.thresholds.value.filter(e=>e===!0))&&!w(this.profiles.value.filter(e=>e===!0)),this.hasOutOfBundleFormError.emit(this.hasThresholdsError))}showErrorNotification(e){this.profileSelected=e}getInitialFormValues(){setTimeout(()=>{this.initialProfilesState=k(this.parentForm.controls[this.profileControlName].value),this.initialThresholdState=k(this.parentForm.controls[this.thresholdControlName].value)},100)}checkForFormUpdates(){let e=!Q(this.initialProfilesState,this.parentForm.controls[this.profileControlName].value)||!Q(this.initialThresholdState,this.parentForm.controls[this.thresholdControlName].value);switch(this.section.name){case U.OUT_OF_BUNDLE_SECTION:this.isOutOfBundleChanged.emit(e);break;case U.OPTION_SECTION:this.isOptionsChanged.emit(e);break;case U.CREDIT_SECTION:this.isCreditsChanged.emit(e);break;default:this.isIncludedBundleChanged.emit(e);break}}static{this.\u0275fac=function(t){return new(t||i)(a.\u0275\u0275directiveInject(Nc),a.\u0275\u0275directiveInject($),a.\u0275\u0275directiveInject(st.TranslateService))}}static{this.\u0275cmp=a.\u0275\u0275defineComponent({type:i,selectors:[["app-notification"]],inputs:{parentForm:"parentForm",section:"section",categoryDetails:"categoryDetails",options:"options",openLimitsLinkIn:"openLimitsLinkIn",mobileUsageLimitsLink:"mobileUsageLimitsLink",selectedLine:"selectedLine",usageLimit:"usageLimit",isPrepaid:"isPrepaid",isMember:"isMember",loggedInPid:"loggedInPid",collapsePanel:"collapsePanel",isBundleLine:"isBundleLine",userPidLinked:"userPidLinked"},outputs:{hasOutOfBundleFormError:"hasOutOfBundleFormError",isIncludedBundleChanged:"isIncludedBundleChanged",isOutOfBundleChanged:"isOutOfBundleChanged",isOptionsChanged:"isOptionsChanged",isCreditsChanged:"isCreditsChanged"}
1,standalone:!1,features:[a.\u0275\u0275InheritDefinitionFeature],decls:4,vars:2,consts:[["notificationsContent",""],["class","box box--main box--elevation box--no-padding ml--xxxs mr--xxxs ml--n--md mr--n--md mb--l",4,"ngIf"],[4,"ngIf"],[1,"box","box--main","box--elevation","box--no-padding","ml--xxxs","mr--xxxs","ml--n--md","mr--n--md","mb--l"],[1,"cards--body"],[1,"cards--body--inner-container"],[1,"internet-usage-notifications"],[1,"content-section__header"],[1,"heading--4","heading--nomargin"],["class","pt--s",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"pt--s"],[1,"divider","divider--s__very-light-grey"],["class","content-section__details",4,"ngIf"],[1,"content-section__details"],["class","mb--l",4,"ngIf"],["class","heading--6 mt--n text-font-family--t7 mb--xs",4,"ngIf"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs"],[3,"formGroup"],[1,"row","ml-0"],["class","pb--s pb--n--sm mr--xxxl",3,"formArrayName",4,"ngFor","ngForOf"],["class","hidden-desktop pb--l",4,"ngIf"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs","mb--l--md","mt--l--md"],[3,"isProfilesFormHasError","parentForm","profiles","categoryDetails","profileControlName"],[1,"mb--l"],[1,"notification","notification--errorfield"],[1,"icon","icon-error-shape","errorfield","mb-0",3,"innerHTML"],[1,"pt--xxs","pb--xxs"],[1,"mb--xl","display--flex","align-items--center"],[1,"pr--xs","pr--m--md"],["href","javascript:void(0)",1,"text--m","text-weight--l",3,"click","ngClass"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs","mb--l--md"],[1,"pb--xl--md","pb--l"],["class","mb--xs",4,"ngFor","ngForOf"],[1,"mb--xs"],[1,"pb--s","pb--n--sm","mr--xxxl",3,"formArrayName"],[1,"display--flex","align-items--center",3,"click"],[1,"form__checkbox"],["type","checkbox",1,"form__checkbox__input",3,"formControlName","checked"],[1,"form__checkbox__label",3,"for"],[1,"label--large","color-text",3,"ngClass","for"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","pl--xxs--md pl--n",4,"ngIf"],[1,"pl--xxs--md","pl--n"],[1,"tooltip","position--relative","display--inline-block"],[1,"tooltip__icon-section","display--flex","flex-direction--row--sm","flex-direction--row-reverse","align-items--center","justify-content--center","cursor--pointer","my--xxxs"],[1,"icon","icon-information-shape","icon-md"],[1,"icon-label","display--flex","align-items--center"],[1,"tooltip__info-section","tooltip__info-section__arrow-left","mt--xxs","tooltip__info-section--hidden-mobile"],[1,"horizontal-center-align"],[1,"info-section__icon","icon","icon-information-shape","p-0","mr--xs","icon-no-size-override","icon-md"],[1,"info-section__description"],[1,"info-section__description__title"],[1,"info-section__description__text","mt--xs"],[1,"hidden-desktop","pb--l"],[1,"p--l","background-grey"],[1,"display--flex"],[1,"info-section__icon","icon","icon-information-shape"],[1,"info-section__description","pl--xs"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(t,n){t&1&&a.\u0275\u0275template(0,Ac,10,5,"div",1)(1,Fc,2,1,"div",2)(2,nd,2,2,"ng-template",null,0,a.\u0275\u0275templateRefExtractor),t&2&&(a.\u0275\u0275property("ngIf",!n.isBundleLine),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",n.isBundleLine))},dependencies:[_e.NgClass,_e.NgForOf,_e.NgIf,_e.NgTemplateOutlet,_e.NgSwitch,_e.NgSwitchCase,ce.\u0275NgNoValidate,ce.CheckboxControlValueAccessor,ce.NgControlStatus,ce.NgControlStatusGroup,ce.FormGroupDirective,ce.FormControlName,ce.FormArrayName,oi,st.TranslatePipe],encapsulation:2,changeDetection:0})}}return i})();import{EventEmitter as ko}from"@angular/core";import{FormArray as Go,FormControl as At}from"@angular/forms";import"@ngx-translate/core";import*as b from"@angular/core";import*as lt from"@ngx-translate/core";import*as ri from"@angular/common";import*as de from"@angular/forms";var rd=i=>({"cursor--default opacity--mid-transparency":i}),ad=i=>({price:i}),sd=i=>({value:i});function ld(i,r){if(i&1&&(b.\u0275\u0275elementStart(0,"h4",8),b.\u0275\u0275text(1),b.\u0275\u0275pipe(2,"translate"),b.\u0275\u0275elementEnd()),i&2){let e=b.\u0275\u0275nextContext();b.\u0275\u0275advance(),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(2,1,e.section.label)," ")}}function cd(i,r){if(i&1&&(b.\u0275\u0275elementStart(0,"div",9)(1,"h4",10),b.\u0275\u0275text(2),b.\u0275\u0275pipe(3,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275elementStart(4,"div",11),b.\u0275\u0275element(5,"i",12),b.\u0275\u0275elementEnd()()),i&2){let e=b.\u0275\u0275nextContext();b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(3,2,e.section.label)),b.\u0275\u0275advance(3),b.\u0275\u0275property("ngClass",e.collapseBundlePanel?"icon-chevron-down":"icon-chevron-up")}}function dd(i,r){i&1&&(b.\u0275\u0275elementStart(0,"div",24)(1,"div",25),b.\u0275\u0275element(2,"span",26),b.\u0275\u0275pipe(3,"translate"),b.\u0275\u0275elementEnd()()),i&2&&(b.\u0275\u0275advance(2),b.\u0275\u0275property("innerHTML",b.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.profile.error"),b.\u0275\u0275sanitizeHtml))}function md(i,r){i&1&&(b.\u0275\u0275elementStart(0,"div",24)(1,"div",25),b.\u0275\u0275element(2,"span",26),b.\u0275\u0275pipe(3,"translate"),b.\u0275\u0275elementEnd()()),i&2&&(b.\u0275\u0275advance(2),b.\u0275\u0275property("innerHTML",b.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.threshold.error"),b.\u0275\u0275sanitizeHtml))}function pd(i,r){if(i&1){let e=b.\u0275\u0275getCurrentView();b.\u0275\u0275elementStart(0,"div",27)(1,"div",28),b.\u0275\u0275listener("click",function(){let n=b.\u0275\u0275restoreView(e).index,o=b.\u0275\u0275nextContext(3);
1return b.\u0275\u0275resetView(o.toggleThreshold(n))}),b.\u0275\u0275elementStart(2,"div",29),b.\u0275\u0275element(3,"input",30),b.\u0275\u0275elementStart(4,"label",31),b.\u0275\u0275text(5,"\xA0"),b.\u0275\u0275elementEnd()(),b.\u0275\u0275elementStart(6,"label",32),b.\u0275\u0275text(7),b.\u0275\u0275pipe(8,"translate"),b.\u0275\u0275elementEnd()()()}if(i&2){let e=r.$implicit,t=r.index,n=b.\u0275\u0275nextContext(3);b.\u0275\u0275property("formArrayName",n.thresholdControlName),b.\u0275\u0275advance(3),b.\u0275\u0275property("formControlName",t)("checked",e.value),b.\u0275\u0275advance(),b.\u0275\u0275property("for","limit-checkbox-"+t),b.\u0275\u0275advance(2),b.\u0275\u0275property("ngClass",b.\u0275\u0275pureFunction1(10,rd,n.parentForm.disabled))("for","limit-checkbox-"+t),b.\u0275\u0275advance(),b.\u0275\u0275textInterpolate(b.\u0275\u0275pipeBind2(8,7,"ng.mobile-usage-notifications.lbl.price",b.\u0275\u0275pureFunction1(12,ad,n.categoryDetails.preferenceGroups[0].threshold[0]==null?null:n.categoryDetails.preferenceGroups[0].threshold[0].values[t].split(" ")[0])))}}function ud(i,r){if(i&1){let e=b.\u0275\u0275getCurrentView();b.\u0275\u0275elementStart(0,"div",15),b.\u0275\u0275template(1,dd,4,3,"div",16)(2,md,4,3,"div",16),b.\u0275\u0275elementStart(3,"form",17)(4,"div",18),b.\u0275\u0275text(5),b.\u0275\u0275pipe(6,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275elementStart(7,"div",19)(8,"div",20)(9,"div",19),b.\u0275\u0275template(10,pd,9,14,"div",21),b.\u0275\u0275elementEnd()()()(),b.\u0275\u0275elementStart(11,"div",22),b.\u0275\u0275text(12),b.\u0275\u0275pipe(13,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275elementStart(14,"app-profile-selector",23),b.\u0275\u0275listener("isProfilesFormHasError",function(n){b.\u0275\u0275restoreView(e);let o=b.\u0275\u0275nextContext(2);return b.\u0275\u0275resetView(o.showErrorNotification(n))}),b.\u0275\u0275elementEnd()()}if(i&2){let e=b.\u0275\u0275nextContext(2);b.\u0275\u0275property("id",b.\u0275\u0275interpolate(e.section.name)),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",e.profileSelected),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",e.hasThresholdsError),b.\u0275\u0275advance(),b.\u0275\u0275property("formGroup",e.parentForm),b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(6,12,"ng.mobile-usage-notifications.lbl.consumption-limit-"+e.section.name)," "),b.\u0275\u0275advance(5),b.\u0275\u0275property("ngForOf",e.thresholds==null?null:e.thresholds.controls),b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(13,14,"ng.mobile-usage-notifications.lbl.profiles-"+e.section.name)," "),b.\u0275\u0275advance(2),b.\u0275\u0275property("parentForm",e.parentForm)("profiles",e.profiles)("categoryDetails",e.categoryDetails)("profileControlName",e.profileControlName)}}function gd(i,r){if(i&1&&(b.\u0275\u0275element(0,"div",35),b.\u0275\u0275pipe(1,"translate")),i&2){let e=b.\u0275\u0275nextContext(3);b.\u0275\u0275property("innerHTML",b.\u0275\u0275pipeBind2(1,1,"ng.mobile-usage-notifications.lbl.member-notification-"+e.section.name,b.\u0275\u0275pureFunction1(4,sd,e.selectedThresholds)),b.\u0275\u0275sanitizeHtml)}}function _d(i,r){i&1&&(b.\u0275\u0275element(0,"div",35),b.\u0275\u0275pipe(1,"translate")),i&2&&b.\u0275\u0275property("innerHTML",b.\u0275\u0275pipeBind1(1,1,"ng.mobile-usage-notifications.lbl.no-member-notification-received"),b.\u0275\u0275sanitizeHtml)}function fd(i,r){if(i&1&&(b.\u0275\u0275elementStart(0,"div",33),b.\u0275\u0275template(1,gd,2,6,"div",34)(2,_d,2,3,"div",34),b.\u0275\u0275elementEnd()),i&2){let e=b.\u0275\u0275nextContext(2);b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",e.selectedThresholds!==""),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",e.selectedThresholds==="")}}function hd(i,r){if(i&1&&(b.\u0275\u0275elementStart(0,"div"),b.\u0275\u0275template(1,ud,15,16,"div",13)(2,fd,3,2,"div",14),b.\u0275\u0275elementEnd()),i&2){let e=b.\u0275\u0275nextContext();b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",!e.isMember),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",e.isMember)}}var Vo=(()=>{class i extends G{constructor(e,t,n){super(),this.messageService=e,this._translateService=t,this.domService=n,this.hasOutOfBundleFormError=new ko,this.isPersonalOutOfBundleChanged=new ko,this.thresholdControlName=U.THRESHOLD_CONTROL,this.profileControlName=U.PROFILE_CONTROL,this.profileIcon=U.PROFILE_ICON,this.showProfileWarning=!1,this.profileSelected=!1,this.messageGroupName=U.MOBILE_USAGE_NOTIFICATION_MESSAGE_GROUP,this.selectedThresholds="",this.hasThresholdsError=!1,this.collapseBundlePanel=!0}ngOnInit(){if(this.collapseBundlePanel=this.isBundleLine,!this.isMember)this.buildForm();else{let e=this.categoryDetails.pids.filter(t=>t.pid===this.loggedInPid&&t.selected);w(e)||(this.selectedThresholds=Ti(this.categoryDetails.preferenceGroups[0].threshold.filter(t=>t.selected).map(t=>t.selectedValues.map(n=>parseInt(n.split(" ")[0],10)).sort((n,o)=>n-o).map(n=>`<b>${this._translateService.instant("ng.mobile-usage-notifications.lbl.euro",{value:n})}</b>`))).join(", ").replace(U.REGEX_REPLACE_LAST_COMMA," "+this._translateService.instant("ng.mobile-usage-notifications.lbl.and")+"$1"))}}buildForm(){this.thresholdControlName+=this.section.name,this.profileControlName+=this.section.name,this.addThresholdsControl(),this.addProfilesControl(),this.getInitialFormValues()}addThresholdsControl(){let e;for(let t of this.usageNotification)if(e=t.pidPreferences.find(n=>n.preferenceGroup===this.categoryDetails.preferenceGroups[0].preferenceGroup),!pe(e))break;pe(e)&&(this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues=[]),this.thresholds=new Go(this.categoryDetails.preferenceGroups[0].threshold[0].values.map(t=>pe(e)?new At(!1):new At(e.preferences[0].values.includes(t)))),this.userPidLinked&&this.obs(this.thresholds.valueChanges).subscribe(t=>{let n=!this.profiles.value.some(o=>o)&&this.thresholds.controls.some(o=>o.value)?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null;this.profiles.setErrors(n),this.profileSelected=!!n,this.checkForNoThresholdSelected(),this.checkForFormUpdates()}),this.parentForm.addControl(this.thresholdControlName,this.thresholds)}addProfilesControl(){this.profiles=new Go(this.categoryDetails.pids.map(e=>new At(e.selected)),[this.formValidator.bind(this)]),this.obs(this.profiles.valueChanges).subscribe(e=>{this.checkForNoThresholdSelected()}),this.parentForm.addControl(this.profileControlName,this.profiles),this.profileSelected=this.profiles.hasError("checkboxReq")}getInitialFormValues(){setTimeout(()=>{this.initialProfilesState=k(this.parentForm.controls[this.profileControlName].value),this.initialThresholdState=k(this.parentForm.controls[this.thresholdControlName].value)},100)}toggleThreshold(e){if(this.parentForm.enabled){let t=this.categoryDetails.preferenceGroups[0].threshold[0].values[e];this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues.includes(t)?this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues=this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues.filter(n=>n!==t):this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues.push(t),this.thresholds.controls[e].markAsTouched(),this.messageService.clearMessages(U.CUSTOM_MESSAGE_GROUP_NAME),this.thresholds.controls[e].patchValue(!this.thresholds.controls[e].value)}}formValidator(e){return!e.value.some(t=>t)&&this.parentForm.get(this.thresholdControlName).value.some(t=>t)&&e.touched?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null}checkForNoThresholdSelected(){this.checkThresholdAndProfileSelected()?!w(this.profiles.value.filter(e=>e===!0))&&w(this.thresholds.value.filter(e=>e===!0))?(this.hasThresholdsError=!0,this.hasOutOfBundleFormError.emit(this.hasThresholdsError)):w(this.profiles.value.filter(e=>e===!0))&&w(this.thresholds.value.filter(e=>e===!0))&&(this.hasThresholdsError=!1,this.hasOutOfBundleFormError.emit(this.hasThresholdsError)):(this.hasThresholdsError=!1,this.hasOutOfBundleFormError.emit(this.hasThresholdsError),w(this.profiles.value.filter(e=>
1e===!0))||(this.profiles.setErrors(null),this.profileSelected=!1,this.profiles.hasError(null),w(this.thresholds.value.filter(e=>e===!0))&&(this.hasThresholdsError=!0,this.hasOutOfBundleFormError.emit(this.hasThresholdsError)))),this.hasThresholdsError&&this.domService.scrollElementToTop("#"+this.section.name),this.checkForFormUpdates()}checkThresholdAndProfileSelected(){return this.userPidLinked?w(this.thresholds.value.filter(e=>e===!0))&&w(this.profiles.value.filter(e=>e===!0)):!1}checkForFormUpdates(){let e=!Q(this.initialProfilesState,this.parentForm.controls[this.profileControlName].value)||!Q(this.initialThresholdState,this.parentForm.controls[this.thresholdControlName].value);this.isPersonalOutOfBundleChanged.emit(e)}showErrorNotification(e){this.profileSelected=e,this.profileSelected&&this.domService.scrollElementToTop("#"+this.section.name)}accordian(){this.isBundleLine&&(this.collapseBundlePanel=!this.collapseBundlePanel)}static{this.\u0275fac=function(t){return new(t||i)(b.\u0275\u0275directiveInject(W),b.\u0275\u0275directiveInject(lt.TranslateService),b.\u0275\u0275directiveInject(oe))}}static{this.\u0275cmp=b.\u0275\u0275defineComponent({type:i,selectors:[["app-out-of-bundle-usage"]],inputs:{parentForm:"parentForm",section:"section",categoryDetails:"categoryDetails",usageNotification:"usageNotification",isMember:"isMember",isBundleLine:"isBundleLine",loggedInPid:"loggedInPid",userPidLinked:"userPidLinked"},outputs:{hasOutOfBundleFormError:"hasOutOfBundleFormError",isPersonalOutOfBundleChanged:"isPersonalOutOfBundleChanged"},standalone:!1,features:[b.\u0275\u0275InheritDefinitionFeature],decls:8,vars:5,consts:[[1,"box","box--main","box--elevation","box--no-padding","mb--xl","ml--xxxs","mr--xxxs","ml--n--md","mr--n--md"],[1,"cards--body"],[1,"cards--body--inner-container"],[1,"internet-usage-notifications",3,"ngClass"],[1,"content-section__header",3,"click","ngClass"],["class","heading--4 heading--nomargin",4,"ngIf"],["class","row ml-0 mr-0",4,"ngIf"],[4,"ngIf"],[1,"heading--4","heading--nomargin"],[1,"row","ml-0","mr-0"],[1,"heading--nomargin","col-md-5","col-xs-10"],[1,"col-md-7","col-xs-2","text-align--right"],[1,"text--xm","cursor--pointer",3,"ngClass"],["class","content-section__details",3,"id",4,"ngIf"],["class","content-section__details",4,"ngIf"],[1,"content-section__details",3,"id"],["class","mb--l",4,"ngIf"],[3,"formGroup"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs"],[1,"row"],[1,"col-md-11","col-xs-12"],["class","col-md-3 col-xs-5 pb--s pr-0",3,"formArrayName",4,"ngFor","ngForOf"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs","mt--l--md"],[3,"isProfilesFormHasError","parentForm","profiles","categoryDetails","profileControlName"],[1,"mb--l"],[1,"notification","notification--errorfield"],[1,"icon","icon-error-shape","errorfield","mb-0",3,"innerHTML"],[1,"col-md-3","col-xs-5","pb--s","pr-0",3,"formArrayName"],[1,"display--flex","align-items--center",3,"click"],[1,"form__checkbox"],["type","checkbox",1,"form__checkbox__input",3,"formControlName","checked"],[1,"form__checkbox__label",3,"for"],[1,"label--large","color-text",3,"ngClass","for"],[1,"content-section__details"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(t,n){t&1&&(b.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),b.\u0275\u0275listener("click",function(){return n.accordian()}),b.\u0275\u0275template(5,ld,3,3,"h4",5)(6,cd,6,4,"div",6),b.\u0275\u0275elementEnd(),b.\u0275\u0275template(7,hd,3,2,"div",7),b.\u0275\u0275elementEnd()()()()),t&2&&(b.\u0275\u0275advance(3),b.\u0275\u0275property("ngClass",n.isBundleLine?"mobile-usage-notifications":""),b.\u0275\u0275advance(),b.\u0275\u0275property("ngClass",n.isBundleLine?"cursor--pointer":""),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",!n.isBundleLine),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",n.isBundleLine),b.\u0275\u0275advance(),b.\u0275\u0275property("ngIf",!n.collapseBundlePanel))},dependencies:[ri.NgClass,ri.NgForOf,ri.NgIf,de.\u0275NgNoValidate,de.CheckboxControlValueAccessor,de.NgControlStatus,de.NgControlStatusGroup,de.FormGroupDirective,de.FormControlName,de.FormArrayName,oi,lt.TranslatePipe],encapsulation:2,changeDetection:0})}}return i})();import{EventEmitter as Dt}from"@angular/core";import{FormArray as Cd,FormControl as ct}from"@angular/forms";import"@ngx-translate/core";import{MAT_SELECT_SCROLL_STRATEGY_PROVIDER as bd}from"@angular/material/select";import{DOCUMENT as Sd}from"@angular/common";import*as s from"@angular/core";import*as dt from"@ngx-translate/core";import*as ai from"@angular/common";import*as jo from"@angular/material/select";import*as Ho from"@angular/material/autocomplete";import*as H from"@angular/forms";var Ed=["selectDropdown"],mt=i=>({value:i}),xd=i=>({"cursor--default":i});function Td(i,r){i&1&&(s.\u0275\u0275elementStart(0,"div",40)(1,"div",41),s.\u0275\u0275element(2,"span",42),s.\u0275\u0275pipe(3,"translate"),s.\u0275\u0275elementEnd()()),i&2&&(s.\u0275\u0275advance(2),s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.profile.error"),s.\u0275\u0275sanitizeHtml))}function Id(i,r){i&1&&(s.\u0275\u0275elementStart(0,"div",40)(1,"div",41),s.\u0275\u0275element(2,"span",42),s.\u0275\u0275pipe(3,"translate"),s.\u0275\u0275elementEnd()()),i&2&&(s.\u0275\u0275advance(2),s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.threshold.error"),s.\u0275\u0275sanitizeHtml))}function yd(i,r){i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2&&(s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-notifications.lbl.thresholdNoNotification")," "))}function Ld(i,r){i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2&&(s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-notifications.lbl.block-line-immediately")," "))}function Od(i,r){if(i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2){let e=s.\u0275\u0275nextContext().$implicit;s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-notifications.lbl.personalUsageLimitInGB",s.\u0275\u0275pureFunction1(4,mt,e.split(" ")[0]))," ")}}function Ud(i,r){if(i&1&&(s.\u0275\u0275elementStart(0,"mat-option",43)(1,"span",44),s.\u0275\u0275template(2,yd,3,3,"ng-container",10)(3,Ld,3,3,"ng-container",10)(4,Od,3,6,"ng-container",10),s.\u0275\u0275elementEnd()()),i&2){let e=r.$implicit,t=s.\u0275\u0275nextContext(3);s.\u0275\u0275property("value",e),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",e===""),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",t.checkZeroThreshold(e)),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e!==""&&!t.checkZeroThreshold(e))}}function Nd(i,r){i&1&&(s.\u0275\u0275elementStart(0,"div",45)(1,"span",46),s.\u0275\u0275text(2),s.\u0275\u0275pipe(3,"translate"),s.\u0275\u0275elementEnd()()),i&2&&(s.\u0275\u0275advance(2),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(3,1,"ng.mobile-usage-notifications.lbl.mobile-data-blocked")))}function Bd(i,r){i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2&&(s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-notifications.lbl.thresholdNoNotification")," "))}function Md(i,r){i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2&&(s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(2,1,"ng.mobile-usage-notifications.lbl.blockLineImmediately")," "))}function wd(i,r){if(i&1&&(s.\u0275\u0275elementContainerStart(0),s.\u0275\u0275text(1),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementContainerEnd()),i&2){let e=s.\u0275\u0275nextContext().$implicit;s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind2(2,1,"ng.mobile-usage-notifications.lbl.personalUsageLimitInGB",s.\u0275\u0275pureFunction1(4,mt,e.split(" ")[0]))," ")}}function Pd(i,r){if(i&1&&(s.\u0275\u0275elementStart(0,"option",43),s.\u0275\u0275template(1,Bd,3,3,"ng-container",10)(2,Md,3,3,"ng-container",10)(3,wd,3,6,"ng-container",10),s.\u0275\u0275elementEnd()),i&2){let e=r.$implicit,t=s.\u0275\u0275nextContext(3);s.\u0275\u0275property("value",e),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e===""),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",t.checkZeroThreshold(e)),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e!==""&&!t.checkZeroThreshold(e))}}function Ad(i,r){if(i&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",47)(1,"div",48)(2,"div",49)(3,"div",50)(4,"input",51),s.\u0275\u0275twoWayListener("ngModelChange",function(n){s.\u0275\u0275restoreView(e);let o=s.\u0275\u0275nextContext(3);return s.\u0275\u0275twoWayBindingSet(o.autoPauseCheck,n)||(o.autoPauseCheck=n),s.\u0275\u0275resetVie
1w(n)}),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(5,"label",52),s.\u0275\u0275text(6,"\xA0"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275elementStart(7,"label",53),s.\u0275\u0275text(8),s.\u0275\u0275pipe(9,"translate"),s.\u0275\u0275elementEnd()()()()}if(i&2){let e=s.\u0275\u0275nextContext(3);s.\u0275\u0275advance(4),s.\u0275\u0275property("checked",e.autoPauseCheck),s.\u0275\u0275twoWayProperty("ngModel",e.autoPauseCheck),s.\u0275\u0275advance(3),s.\u0275\u0275property("ngClass",s.\u0275\u0275pureFunction1(6,xd,e.parentForm.get("personalMobileUsageLimit").value==="")),s.\u0275\u0275advance(),s.\u0275\u0275textInterpolate1("",s.\u0275\u0275pipeBind1(9,4,"ng.mobile-usage-notifications.lbl.activate-autopause-text")," ")}}function Dd(i,r){if(i&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",54)(1,"div",33)(2,"span",34)(3,"div"),s.\u0275\u0275element(4,"span",55),s.\u0275\u0275pipe(5,"translate"),s.\u0275\u0275elementStart(6,"a",56),s.\u0275\u0275listener("click",function(n){s.\u0275\u0275restoreView(e);let o=s.\u0275\u0275nextContext(3);return s.\u0275\u0275resetView(o.openUrl(n))}),s.\u0275\u0275text(7),s.\u0275\u0275pipe(8,"translate"),s.\u0275\u0275elementEnd()()()()()}i&2&&(s.\u0275\u0275advance(4),s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind1(5,2,"ng.mobile-usage-notifications.info.autopause-barrings-text"),s.\u0275\u0275sanitizeHtml),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(8,4,"ng.mobile-usage-notifications.lbl.autopause-barrings-link")," "))}function Rd(i,r){i&1&&(s.\u0275\u0275elementStart(0,"div",57)(1,"div",45)(2,"span",46),s.\u0275\u0275text(3),s.\u0275\u0275pipe(4,"translate"),s.\u0275\u0275elementEnd()()()),i&2&&(s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(4,1,"ng.mobile-usage-notifications.info.activate-autopause-warning-text")))}function Fd(i,r){if(i&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",13),s.\u0275\u0275template(1,Td,4,3,"div",14)(2,Id,4,3,"div",14),s.\u0275\u0275elementStart(3,"form",15)(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19)(8,"div",20),s.\u0275\u0275text(9),s.\u0275\u0275pipe(10,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(11,"div",21)(12,"label",22),s.\u0275\u0275text(13),s.\u0275\u0275pipe(14,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(15,"mat-select",23,0),s.\u0275\u0275template(17,Ud,5,4,"mat-option",24),s.\u0275\u0275elementEnd()()()(),s.\u0275\u0275elementStart(18,"div",25)(19,"div",26),s.\u0275\u0275template(20,Nd,4,3,"div",27),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(21,"div",20),s.\u0275\u0275text(22),s.\u0275\u0275pipe(23,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(24,"label",28),s.\u0275\u0275text(25),s.\u0275\u0275pipe(26,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(27,"div",19)(28,"div",29)(29,"select",30),s.\u0275\u0275template(30,Pd,4,4,"option",24),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(31,"div",31),s.\u0275\u0275elementEnd()()()(),s.\u0275\u0275elementStart(32,"div",32)(33,"div",33)(34,"span",34),s.\u0275\u0275text(35),s.\u0275\u0275pipe(36,"translate"),s.\u0275\u0275elementEnd()()()(),s.\u0275\u0275elementStart(37,"div",35),s.\u0275\u0275text(38),s.\u0275\u0275pipe(39,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(40,"app-profile-selector",36),s.\u0275\u0275listener("isProfilesFormHasError",function(n){s.\u0275\u0275restoreView(e);let o=s.\u0275\u0275nextContext(2);return s.\u0275\u0275resetView(o.showErrorNotification(n))}),s.\u0275\u0275elementEnd(),s.\u0275\u0275template(41,Ad,10,8,"div",37)(42,Dd,9,6,"div",38)(43,Rd,5,3,"div",39),s.\u0275\u0275elementEnd()()}if(i&2){let e=s.\u0275\u0275nextContext(2);s.\u0275\u0275property("id",s.\u0275\u0275interpolate(e.section.name)),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.profileSelected),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.hasThresholdsError),s.\u0275\u0275advance(),s.\u0275\u0275property("formGroup",e.parentForm),s.\u0275\u0275advance(6),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(10,21,"ng.mobile-usage-notifications.lbl.consumption-limit-"+e.section.name)," "),s.\u0275\u0275advance(4),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(14,23,"ng.mobile-usage-notifications.lbl.blockUsageWhenReached")),s.\u0275\u0275advance(4),s.\u0275\u0275property("ngForOf",e.thresholdValues),s.\u0275\u0275advance(3),s.\u0275\u0275property("ngIf",e.isEligibleForAutoPause),s.\u0275\u0275advance(2),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(23,25,"ng.mobile-usage-notifications.lbl.consumption-limit-"+e.section.name)," "),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(26,27,"ng.mobile-usage-notifications.lbl.blockUsageWhenReached")),s.\u0275\u0275advance(5),s.\u0275\u0275property("ngForOf",e.thresholdValues),s.\u0275\u0275advance(5),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(36,29,"ng.mobile-usage-notifications.lbl.thresholdAppliedNationalAndEU")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(39,31,"ng.mobile-usage-notifications.lbl.profiles-"+e.section.name)," "),s.\u0275\u0275advance(2),s.\u0275\u0275property("parentForm",e.parentForm)("profiles",e.profiles)("categoryDetails",e.categoryDetails)("profileControlName",e.profileControlName),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",!e.isEligibleForSettinglimits&&e.isEligibleForAutoPause),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.isBundleLine),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.isBundleLine)}}function kd(i,r){if(i&1&&(s.\u0275\u0275element(0,"div",55),s.\u0275\u0275pipe(1,"translate")),i&2){let e=s.\u0275\u0275nextContext(3);s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind2(1,1,"ng.mobile-usage-notifications.lbl.member-notification-"+e.section.name,s.\u0275\u0275pureFunction1(4,mt,e.selectedThresholds)),s.\u0275\u0275sanitizeHtml)}}function Gd(i,r){i&1&&(s.\u0275\u0275element(0,"div",55),s.\u0275\u0275pipe(1,"translate")),i&2&&s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind1(1,1,"ng.mobile-usage-notifications.lbl.no-member-notification-received"),s.\u0275\u0275sanitizeHtml)}function Vd(i,r){if(i&1&&(s.\u0275\u0275element(0,"div",55),s.\u0275\u0275pipe(1,"translate")),i&2){let e=s.\u0275\u0275nextContext(3);s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind2(1,1,"ng.mobile-usage-notifications.lbl.member-notification-autoPause-"+e.section.name,s.\u0275\u0275pureFunction1(4,mt,e.mobileAutoPause.limit.value)),s.\u0275\u0275sanitizeHtml)}}
1function jd(i,r){if(i&1&&(s.\u0275\u0275element(0,"div",55),s.\u0275\u0275pipe(1,"translate")),i&2){let e=s.\u0275\u0275nextContext(3);s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind1(1,1,"ng.mobile-usage-notifications.lbl.member-notification-autoPause-disabled-"+e.section.name),s.\u0275\u0275sanitizeHtml)}}function Hd(i,r){if(i&1&&(s.\u0275\u0275elementStart(0,"div",58),s.\u0275\u0275template(1,kd,2,6,"div",59)(2,Gd,2,3,"div",59)(3,Vd,2,6,"div",59)(4,jd,2,3,"div",59),s.\u0275\u0275elementEnd()),i&2){let e=s.\u0275\u0275nextContext(2);s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.selectedThresholds!==""),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.selectedThresholds===""),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.mobileAutoPause==null||e.mobileAutoPause.limit==null?null:e.mobileAutoPause.limit.enabled),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",!(!(e.mobileAutoPause==null||e.mobileAutoPause.limit==null)&&e.mobileAutoPause.limit.enabled))}}function Yd(i,r){if(i&1&&(s.\u0275\u0275elementStart(0,"div"),s.\u0275\u0275template(1,Fd,44,33,"div",11)(2,Hd,5,4,"div",12),s.\u0275\u0275elementEnd()),i&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",!e.isMember),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",e.isMember)}}var Yo=(()=>{class i extends G{constructor(e,t,n,o){super(),this._translateService=e,this.domService=t,this.document=n,this.urlservice=o,this.hasOutOfBundleFormError=new Dt,this.isPersonalMobileUsageChanged=new Dt,this.autoPauseCheckedState=new Dt,this.thresholdControlName=U.PERSONAL_USAGE_LIMIT_CONTROL,this.profileControlName=U.PROFILE_CONTROL,this.showProfileWarning=!1,this.profileSelected=!1,this.selectedThresholds="",this.hasThresholdsError=!1,this.autoPauseCheck=!1,this.autoPauseControlName=U.ACTIVATE_AUTO_PAUSE_CONTROL}ngOnInit(){if(this.collapseBundlePanel=!0,this.mobileAutoPause&&(this.autoPauseCheck=this.mobileAutoPause.limit&&this.mobileAutoPause.limit.enabled),!this.isMember)this.profileControlName+=this.section.name,this.addThresholdsControl(),this.addProfilesControl(),this.addAutoPauseControl(),this.getInitialFormValues(),this.checkForProfileError();else{let e=this.categoryDetails.pids.filter(t=>t.pid===this.loggedInPid&&t.selected);if(!w(e)){let t=this.categoryDetails.preferenceGroups[0].threshold.filter(n=>n.selected).map(n=>`<b>${this._translateService.instant("ng.mobile-usage-notifications.lbl.personalUsageLimitInGB",{value:n.selectedValues[0].split(" ")[0]})}</b>`);this.selectedThresholds=t.join(", ").replace(U.REGEX_REPLACE_LAST_COMMA," "+this._translateService.instant("ng.mobile-usage-notifications.lbl.and")+"$1")}}}addThresholdsControl(){this.thresholdValues=this.categoryDetails.preferenceGroups[0].threshold[0].values,this.thresholdValues.unshift("");let e=this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues;this.thresholds=w(e)?new ct(""):new ct(this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues[0]),this.obs(this.thresholds.valueChanges).subscribe(t=>{this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues=[],this.thresholds.value!==""?(this.autoPause&&this.autoPause.enable(),this.categoryDetails.preferenceGroups[0].threshold[0].selectedValues.push(this.thresholds.value)):(this.autoPause.disable(),this.autoPauseCheck=!1,this.categoryDetails.pids.forEach(n=>{n.selected=!1}),this.profiles.setErrors(null),this.profiles.controls.forEach(n=>{n.markAsTouched(),n.patchValue(!1)}),this.addProfilesControl()),this.thresholds.markAsTouched(),this.checkForProfileError(),this.checkForFormUpdates(),this.checkformAutopause()}),this.parentForm.addControl(this.thresholdControlName,this.thresholds)}addProfilesControl(){this.profiles=new Cd(this.categoryDetails.pids.map(e=>new ct(e.selected)),[this.formValidator.bind(this)]),this.obs(this.profiles.valueChanges).subscribe(e=>{this.checkForNoThresholdSelected(),this.checkForFormUpdates()}),this.parentForm.addControl(this.profileControlName,this.profiles),this.profileSelected=this.profiles.hasError("checkboxReq")}addAutoPauseControl(){this.mobileAutoPause&&(this.autoPause=new ct(this.mobileAutoPause.limit.enabled),this.thresholds.value===""&&this.autoPause.disable(),this.obs(this.autoPause.valueChanges).subscribe(e=>{this.autoPause.markAsTouched(),this.checkformAutopause()}),this.parentForm.addControl(this.autoPauseControlName,this.autoPause))}formValidator(e){return!e.controls.some(t=>t.value)&&this.thresholds.value!==""?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null}checkForNoThresholdSelected(){this.categoryDetails.category===U.PERSONAL_MOBILE_DATA_SECTION&&(this.hasThresholdsError=this.thresholds.value===""&&!w(this.profiles.value.filter(e=>e===!0)),this.hasOutOfBundleFormError.emit(this.hasThresholdsError),this.hasThresholdsError&&this.domService.scrollElementToTop("#"+this.section.name))}checkForProfileError(){let e=!this.profiles.value.some(t=>t)&&this.thresholds.value!==""?{checkboxReq:"ng.mobile-usage-notifications.lbl.profile.error"}:null;this.profiles.setErrors(e),this.profileSelected=!!e,this.profileSelected&&this.domService.scrollElementToTop("#"+this.section.name),this.checkForNoThresholdSelected()}getInitialFormValues(){setTimeout(()=>{this.initialProfilesState=k(this.parentForm.controls[this.profileControlName].value),this.initialThresholdState=k(this.parentForm.controls[this.thresholdControlName].value),this.initialAutoPauseState=k(this.parentForm.controls[this.autoPauseControlName].value)},100)}showErrorNotification(e){this.profileSelected=e}accordian(){this.collapseBundlePanel=!this.collapseBundlePanel}checkZeroThreshold(e){return this.isEligibleForSettinglimits&&e===U.zeroGb}checkForFormUpdates(){this.isPersonalMobileUsageChanged.emit(!Q(this.initialProfilesState,this.parentForm.controls[this.profileControlName].value)||!Q(this.initialThresholdState,this.parentForm.controls[this.thresholdControlName].value))}checkformAutopause(){this.autoPauseCheckedState.emit(!Q(this.initialAutoPauseState,this.parentForm.controls[this.autoPauseControlName].value)||this.initialAutoPauseState===!0&&!Q(this.initialThresholdState,this.parentForm.controls[this.thresholdControlName].value))}get modifiedMobileBarringSettingsLink(){return this.premiumServiceBarringsLink.replace(U.DYNAMIC_QUERY_KEY_PATTERN,this.selectedLine)}openUrl(e){e.preventDefault(),this.openPremiumBarringsLinkIn==="navigation-content"?this.document.dispatchEvent(new CustomEvent("loadpage",{bubbles:!0,detail:{pageUrl:this.premiumServiceBarringsLink,title:""}})):this.urlservice.redirectTo(this.premiumServiceBarringsLink)}handleOutsideClick(e){this.select&&!this.select._elementRef.nativeElement.contains(e.target)&&this.select.close()}static{this.\u0275fac=function(t){return new(t||i)(s.\u0275\u0275directiveInject(dt.TranslateService),s.\u0275\u0275directiveInject(oe),s.\u0275\u0275directiveInject(Sd),s.\u0275\u0275directiveInject($))}}static{this.\u0275cmp=s.\u0275\u0275defineComponent({type:i,selectors:[["app-personal-mobile-data"]],viewQuery:function(t,n){if(t&1&&s.\u0275\u0275viewQuery(Ed,5),t&2){let o;s.\u0275\u0275queryRefresh(o=s.\u0275\u0275loadQuery())&&(n.select=o.first)}},hostBindings:function(t,n){t&1&&s.\u0275\u0275listener("click",function(C){return n.handleOutsideClick(C)},s.\u0275\u0275resolveDocument)("touchstart",function(C){return n.handleOutsideClick(C)},s.\u0275\u0275resolveDocument)},inputs:{parentForm:"parentForm",section:"section",categoryDetails:"categoryDetails",usageNotification:"usageNotification",isMember:"isMember",loggedInPid:"loggedInPid",isBundleLine:"isBundleLine",mobileAutoPause:"mobileAutoPause",premiumServiceBarringsLink:"premiumServiceBarringsLink",selectedLine:"selectedLine",openPremiumBarringsLinkIn:"openPremiumBarringsLinkIn",C5Bundle:"C5Bundle",isEligibleForSettinglimits:"isEligibleForSettinglimits",isEligibleForAutoPause:"isEligibleForAutoPause"},outputs:{hasOutOfBundleFormError:"hasOutOfBundleFormError",isPersonalMobileUsageChanged:"isPersonalMobileUsageChanged",autoPauseCheckedState:"autoPauseCheckedState"},standalone:!1,features:[s.\u0275\u0275ProvidersFeature([bd]),s.\u0275\u0275InheritDefinitionFeature],decls:12,vars:6,consts:[["selectDropdown",""],[1,"box","box--main","box--elevation","box--no-padding","mb--xl","ml--xxxs","mr--xxxs","ml--n--md","mr--n--md"],[1,"cards--body"],[1,"cards--body--inner-container"],[1,"internet-usage-notifications",3,"ngClass"],[1,"content-section__header","cursor--pointer",3,"click"],[1,"row","ml-0","mr-0"],[1,"heading--nomargin","col-md-5","col-xs-10"],[1,"col-md-7","col-xs-2","text-align--right"],[1,"text--xm","cursor--pointer",3,"ngClass"],[4,"ngIf"],["class","content-section__details",3,"id",4,"ngIf"],["class","content-section__details",4,"ngIf"],[1,"content-section__details",3,"id"],["class","mb--l",4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-sm-12"],[1,"mt--xxs","hidden-mobile"],[1,"form-group"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs"],[1,"col-md-6","col-sm-12","p-0"],["for","thresholdSelect",1,"color-shade_64"],["formControlName","personalMobileUsageLimit","id","thresholdSelect","name","thresholdSelectField","panelClass","mt-45","ngDefaultControl","","disableOptionCentering",""],[3,"value",4,"ngFor","ngForOf"],[1,"hidden-desktop"],[1,"mb--xl"],["class","notification notification--warning",4,"ngIf"],["for","thresholdSelect"],[1,"select-dropdown-section"],["id","thresholdSelect","name","thresholdSelectField","formControlName","personalMobileUsageLimit",1,"form-control","select-dropdown"],[1,"icon","icon-chevron-down","position--absolute","text--m","text-weight--g","pointer-events--none"],[1,"col-sm-12","pt--m","pb--n--md","pb--m"],[1,"notification","notification--info"],[1,"icon","icon-information-shape","info"],[1,"heading--6","mt--n","text-font-family--t7","mb--xs","mt--l--md"],[3,"isProfilesFormHasError","parentForm","profiles","categoryDetails","profileControlName"],["class","row pt--m",4,"ngIf"],["class","pt--m",4,"ngIf"],["class","pt--s--md pt--xs",4,"ngIf"],[1,"mb--l"],[1,"notification","notification--errorfield"],[1,"icon","icon-error-shape","errorfield","mb-0",3,"innerHTML"],[3,"value"],[1,"mat-option-text"],[1,"notification","notification--warning"],[1,"icon","icon-alert-shape","warning"],[1,"row","pt--m"],[1,"col-md-6","col-xs-12"],[1,"display--flex","align-items--center"],[1,"form__checkbox"],["type","checkbox","formControlName","activateAutoPause","id","mobileAutoPause",1,"form__checkbox__input",3,"ngModelChange","checked","ngModel"],["for","mobileAutoPause",1,"form__checkbox__label"],["for","mobileAutoPause",1,"label--large",3,"ngClass"],[1,"pt--m"],[3,"innerHTML"],["href","javascript:void(0)",3,"click"],[1,"pt--s--md","pt--xs"],[1,"content-section__details"],[3,"innerHTML",4,"ngIf"]],template:function(t,n){t&1&&(s.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5),s.\u0275\u0275listener("click",function(){return n.accordian()}),s.\u0275\u0275elementStart(5,"div",6)(6,"h4",7),s.\u0275\u0275text(7),s.\u0275\u0275pipe(8,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(9,"div",8),s.\u0275\u0275element(10,"i",9),s.\u0275\u0275elementEnd()()(),s.\u0275\u0275template(11,Yd,3,2,"div",10),s.\u0275\u0275elementEnd()()()()),t&2&&(s.\u0275\u0275advance(3),s.\u0275\u0275property("ngClass",n.isBundleLine?"mobile-usage-notifications":""),s.\u0275\u0275advance(4),s.\u0275\u0275textInterpolate1(" ",s.\u0275\u0275pipeBind1(8,4,n.section.label)),s.\u0275\u0275advance(3),s.\u0275\u0275property("ngClass",n.collapseBundlePanel?"icon-chevron-down":"icon-chevron-up"),s.\u0275\u0275advance(),s.\u0275\u0275property("ngIf",!n.collapseBundlePanel))},dependencies:[ai.NgClass,ai.NgForOf,ai.NgIf,jo.MatSelect,Ho.MatOption,H.\u0275NgNoValidate,H.NgSelectOption,H.\u0275NgSelectMultipleOption,H.DefaultValueAccessor,H.CheckboxControlValueAccessor,H.SelectControlValueAccessor,H.NgControlStatus,H.NgControlStatusGroup,H.FormGroupDirective,H.FormControlName,oi,dt.TranslatePipe],encapsulation:2,changeDetection:0})}}return i})();import*as Ko from"@ngx-translate/core";var zd=i=>({value:i});function qd(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275elementStart(1,"app-warning-dialog",4),d.\u0275\u0275listener("clickEvent",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext();
1return d.\u0275\u0275resetView(o.warningDialogEvent(n))}),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementContainerEnd()}if(i&2){let e=d.\u0275\u0275nextContext();d.\u0275\u0275advance(),d.\u0275\u0275property("dialogData",e.getWarningDialog())}}function Xd(i,r){i&1&&(d.\u0275\u0275elementStart(0,"div")(1,"div",6)(2,"span",7),d.\u0275\u0275text(3),d.\u0275\u0275pipe(4,"translate"),d.\u0275\u0275elementEnd()()()),i&2&&(d.\u0275\u0275advance(3),d.\u0275\u0275textInterpolate(d.\u0275\u0275pipeBind1(4,1,"ng.mobile-usage-notifications.lbl.member-notification-admin")))}function Qd(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275elementStart(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12)(6,"div",13)(7,"div",14)(8,"div",15),d.\u0275\u0275element(9,"div",16),d.\u0275\u0275elementStart(10,"div",17),d.\u0275\u0275text(11),d.\u0275\u0275pipe(12,"translate"),d.\u0275\u0275elementEnd()(),d.\u0275\u0275elementStart(13,"div",18),d.\u0275\u0275text(14),d.\u0275\u0275pipe(15,"translate"),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementStart(16,"div",19),d.\u0275\u0275text(17),d.\u0275\u0275pipe(18,"translate"),d.\u0275\u0275elementEnd()(),d.\u0275\u0275elementStart(19,"div",20)(20,"button",21)(21,"span",22),d.\u0275\u0275listener("click",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(2);return d.\u0275\u0275resetView(o.openUrl(n))}),d.\u0275\u0275text(22),d.\u0275\u0275pipe(23,"translate"),d.\u0275\u0275elementEnd()()()()()()()()(),d.\u0275\u0275elementContainerEnd()}if(i&2){let e=d.\u0275\u0275nextContext(2);d.\u0275\u0275advance(11),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(12,4,"ng.mobile-usage-notifications.lbl.userpidnotlinked-access")," "),d.\u0275\u0275advance(3),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(15,6,"ng.mobile-usage-notifications.lbl.userpidnotlinked-notification")," "),d.\u0275\u0275advance(3),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind2(18,8,"ng.mobile-usage-notifications.lbl.userpidnotlinked-text-notifications",d.\u0275\u0275pureFunction1(13,zd,e.mobileLine.identifier))," "),d.\u0275\u0275advance(5),d.\u0275\u0275textInterpolate(d.\u0275\u0275pipeBind1(23,11,"ng.mobile-usage-notifications.lbl.sim-management-link"))}}function Zd(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"app-notification",26),d.\u0275\u0275listener("hasOutOfBundleFormError",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.showErrorNotification(n))})("isIncludedBundleChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasIncludedBundleChanged(n))})("isOutOfBundleChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasPersonalOutOfBundleChanged(n))})("isOptionsChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasOptionsChanged(n))})("isCreditsChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasCreditsChanged(n))}),d.\u0275\u0275elementEnd()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275property("parentForm",t.parentForm)("categoryDetails",t.getCategoryDetails(e.name))("section",e)("options",t.mobileLine.options)("mobileUsageLimitsLink",t.mobileUsageLimitsLink)("selectedLine",t.mobileLine.identifier)("usageLimit",t.usageLimit)("isPrepaid",t.mobileLine.productInfo.hasCategory("prepaid-mobile"))("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("userPidLinked",t.userPidLinked)("openLimitsLinkIn",t.openLimitsLinkIn)}}function Jd(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"app-out-of-bundle-usage",27),d.\u0275\u0275listener("hasOutOfBundleFormError",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.showErrorNotification(n))})("isPersonalOutOfBundleChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);
1return d.\u0275\u0275resetView(o.hasPersonalOutOfBundleChanged(n))}),d.\u0275\u0275elementEnd()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275property("parentForm",t.parentForm)("categoryDetails",t.getCategoryDetails(e.name))("section",e)("usageNotification",t.mobileUsageNotifications)("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("userPidLinked",t.userPidLinked)}}function em(i,r){if(i&1&&(d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275template(1,Zd,1,12,"app-notification",24)(2,Jd,1,7,"app-out-of-bundle-usage",25),d.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&t.showNotificationSection(e.name)),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&!(t.usageLimit!=null&&t.usageLimit.isOutOfBundleLimitEnabled())&&e.name==="outofbundle")}}function im(i,r){if(i&1&&(d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275template(1,em,3,2,"ng-container",23),d.\u0275\u0275elementContainerEnd()),i&2){let e=d.\u0275\u0275nextContext(2);d.\u0275\u0275advance(),d.\u0275\u0275property("ngForOf",e.sectionsList)}}function tm(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"app-notification",35),d.\u0275\u0275listener("isIncludedBundleChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasIncludedBundleChanged(n))}),d.\u0275\u0275elementEnd()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275property("parentForm",t.parentForm)("categoryDetails",t.getCategoryDetails(e.name))("section",e)("collapsePanel",t.collapseBundlePanel)("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("isBundleLine",t.isBundleLine)("userPidLinked",t.userPidLinked)}}function nm(i,r){if(i&1&&(d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275template(1,tm,1,8,"app-notification",34),d.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&t.showBundleSection(e.name))}}function om(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"app-personal-mobile-data",39),d.\u0275\u0275listener("autoPauseCheckedState",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.autoPauseCheckedStateEvent(n))})("isPersonalMobileUsageChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasPersonalMobileUsageChanged(n))})("hasOutOfBundleFormError",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.showErrorNotification(n))}),d.\u0275\u0275elementEnd()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275property("categoryDetails",t.getCategoryDetails(e.name))("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("isBundleLine",t.isBundleLine)("mobileAutoPause",t.mobileAutoPause)("openPremiumBarringsLinkIn",t.openPremiumBarringsLinkIn)("parentForm",t.parentForm)("premiumServiceBarringsLink",t.premiumServiceBarringsLink)("section",e)("selectedLine",t.mobileLine.identifier)("usageNotification",t.mobileUsageNotifications)("isEligibleForSettinglimits",t.mobileLine.productInfo.isEligibleForSettinglimits)("isEligibleForAutoPause",t.mobileLine.productInfo.isEligibleForAutoPause)}}function rm(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"div",28)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",29),d.\u0275\u0275listener("click",function(){d.\u0275\u0275restoreView(e);let n=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(n.accordianOptions())}),d.\u0275\u0275elementStart(5,"div",30)(6,"h4",31),d.\u0275\u0275text(7),d.\u0275\u0275pipe(8,"translate"),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementStart(9,"div",32),d.\u0275\u0275element(10,"i",33),d.\u0275\u0275elementEnd()()(),d.\u0275\u0275elementStart(11,"app-notification",40),d.\u0275\u0275listener("isOptionsChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);
1return d.\u0275\u0275resetView(o.hasOptionsChanged(n))}),d.\u0275\u0275elementEnd()()()()()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275advance(7),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(8,11,e.label)),d.\u0275\u0275advance(3),d.\u0275\u0275property("ngClass",t.collapseOptionsPanel?"icon-chevron-down":"icon-chevron-up"),d.\u0275\u0275advance(),d.\u0275\u0275property("options",t.getRoamingOptions())("isBundleLine",!0)("collapsePanel",t.collapseOptionsPanel)("parentForm",t.parentForm)("categoryDetails",t.getCategoryDetails(e.name))("section",e)("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("userPidLinked",t.userPidLinked)}}function am(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"app-out-of-bundle-usage",41),d.\u0275\u0275listener("hasOutOfBundleFormError",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.showErrorNotification(n))})("isPersonalOutOfBundleChanged",function(n){d.\u0275\u0275restoreView(e);let o=d.\u0275\u0275nextContext(4);return d.\u0275\u0275resetView(o.hasPersonalOutOfBundleChanged(n))}),d.\u0275\u0275elementEnd()}if(i&2){let e=d.\u0275\u0275nextContext().$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275property("parentForm",t.parentForm)("categoryDetails",t.getCategoryDetails(e.name))("section",e)("usageNotification",t.mobileUsageNotifications)("isMember",t.isMember)("loggedInPid",t.mobileLine.pid?t.mobileLine.pid:"")("isBundleLine",t.isBundleLine)("userPidLinked",t.userPidLinked)}}function sm(i,r){if(i&1&&(d.\u0275\u0275elementStart(0,"div"),d.\u0275\u0275template(1,om,1,13,"app-personal-mobile-data",36)(2,rm,12,13,"div",37)(3,am,1,8,"app-out-of-bundle-usage",38),d.\u0275\u0275elementEnd()),i&2){let e=r.$implicit,t=d.\u0275\u0275nextContext(3);d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&e.name==="personalMobileData"),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&e.name==="option"&&t.hasRoamingOptions()),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",t.getCategoryDetails(e.name)&&e.name==="personalOutOfBundle")}}function lm(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275elementStart(1,"div",28)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",29),d.\u0275\u0275listener("click",function(){d.\u0275\u0275restoreView(e);let n=d.\u0275\u0275nextContext(2);return d.\u0275\u0275resetView(n.accordian())}),d.\u0275\u0275elementStart(6,"div",30)(7,"h4",31),d.\u0275\u0275text(8),d.\u0275\u0275pipe(9,"translate"),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementStart(10,"div",32),d.\u0275\u0275element(11,"i",33),d.\u0275\u0275elementEnd()()(),d.\u0275\u0275template(12,nm,2,1,"ng-container",23),d.\u0275\u0275elementEnd()()()(),d.\u0275\u0275template(13,sm,4,3,"div",23),d.\u0275\u0275elementContainerEnd()}if(i&2){let e=d.\u0275\u0275nextContext(2);d.\u0275\u0275advance(8),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(9,4,"ng.mobile-usage-notifications.lbl.usage-bundle")),d.\u0275\u0275advance(3),d.\u0275\u0275property("ngClass",e.collapseBundlePanel?"icon-chevron-down":"icon-chevron-up"),d.\u0275\u0275advance(),d.\u0275\u0275property("ngForOf",e.sectionsList),d.\u0275\u0275advance(),d.\u0275\u0275property("ngForOf",e.sectionsList)}}function cm(i,r){if(i&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"div",42)(1,"div",43)(2,"div",44),d.\u0275\u0275element(3,"div",45),d.\u0275\u0275elementStart(4,"div",46)(5,"button",47),d.\u0275\u0275pipe(6,"translate"),d.\u0275\u0275listener("click",function(){d.\u0275\u0275restoreView(e);let n=d.\u0275\u0275nextContext(2);return d.\u0275\u0275resetView(n.saveUsageNotification())}),d.\u0275\u0275elementEnd()()()()()}i&2&&(d.\u0275\u0275advance(5),d.\u0275\u0275property("innerHTML",d.\u0275\u0275pipeBind1(6,1,"ng.mobile-usage-notifications.btn.save"),d.\u0275\u0275sanitizeHtml))}function dm(i,r){if(i&1&&(d.\u0275\u0275elementContainerStart(0),d.\u0275\u0275template(1,Xd,5,3,"div",1)(2,Qd,24,15,"ng-container",1)(3,im,2,1,"ng-container",1)(4,lm,14,6,"ng-container",1)(5,cm,7,3,"div",5),d.\u0275\u0275elementContainerEnd()),i&2){let e=d.\u0275\u0275nextContext();d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",e.isMember),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",!e.userPidLinked),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",!e.isBundleLine),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",e.isBundleLine),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",e.enableSave&&!e.isMember)}}var zo=(()=>{class i extends G{constructor(e,t,n,o,C,N,P,F){super(),this.document=e,this.accountSelectorService=t,this.messageService=n,this.loginService=o,this.domService=C,this.mobileUsageNotificationService=N,this.mobileUsageNotificationsDatalayerService=P,this.urlservice=F,this.scopes=U.SCOPES,this.sectionsList=U.NOTIFICATIONS_SECTION,this.enableSave=!1,this.isMember=!1,this.collapseBundlePanel=!0,this.collapseOptionsPanel=!0,this.isEnableAutoPauseSoho=!1,this.showWarningDialog=!1,this.messageGroupName=U.MOBILE_USAGE_NOTIFICATION_MESSAGE_GROUP,this.customMessageGroupName=U.CUSTOM_MESSAGE_GROUP_NAME,this.isBundleLine=!1,this.isEligibleForSettinglimits=!1}initAfterLoggedIn(){this.messageService.clearMessages(this.customMessageGroupName),this.subscribeToSelectedAccount(),this.getUserDetails(),this.domService.scrollToTop()}
1getUserDetails(){this.obs(this.loginService.getLoginDetails()).subscribe(e=>{this.userDetails=e,(this.userDetails.isMember()||this.userDetails.isChild())&&(this.isMember=!0)})}buildForm(){this.parentForm=new Wd({}),this.obs(this.parentForm.valueChanges).subscribe(e=>{let t=Object.keys(this.parentForm.controls).map(n=>this.parentForm.controls[n].value);this.enableSave=this.parentForm.touched&&this.parentForm.valid&&!Q(this.initialFormState,t)&&!this.isNoThresholdSelected})}showErrorNotification(e){this.isNoThresholdSelected=e}hasPersonalOutOfBundleChanged(e){this.isPersonalOutOfBundleChanged=e}hasPersonalMobileUsageChanged(e){this.isPersonalMobileUsageChanged=e,this.isEnableAutoPauseSoho=e&&this.isEligibleForSettinglimits&&!w(this.parentForm.controls.personalMobileUsageLimit.value)}hasIncludedBundleChanged(e){this.isIncludedBundleChanged=e}hasOptionsChanged(e){this.isOptionsChanged=e}hasCreditsChanged(e){this.isCreditsChanged=e}autoPauseCheckedStateEvent(e){this.autoPauseCheckedState=e}subscribeToSelectedAccount(){this.obs(this.accountSelectorService.getSelectedAccount()).subscribe({next:this.loadComponentDataForSelectedAccount(),error:this.addErrorMessage()})}addErrorMessage(){return e=>{if(!e.serviceError)this.messageService.addMessage(new ne(this.messageGroupName,"account-selector.error.empty-"+e.keyLabel));else{let t=this.messageService.getMessagesByGroupName(Z.MESSAGE_GROUP),n=t&&t[0].key;this.messageService.addMessage(new ne(this.messageGroupName,n))}}}loadComponentDataForSelectedAccount(){return e=>{this.mobileLine!==e&&(this.mobileLine=e,this.isBundleLine=this.mobileLine.productType===U.BUNDLE,this.isEligibleForSettinglimits=this.mobileLine.productInfo&&this.mobileLine.productInfo.isEligibleForSettinglimits,this.loadData())}}loadData(){this.isInitialized=!1;let e=this.createNotificationsRequest();$o(e).subscribe(([t,n,o,C])=>{this.profileDetails=t,this.mobileUsageNotifications=n,this.checkUserPidLinked(),w(o)||(this.usageLimit=o),w(C)||(this.mobileAutoPause=C),w(this.profileDetails)||this.profileDetails.length===1&&w(this.profileDetails[0])||this.mobileUsageNotifications.length===1&&w(this.mobileUsageNotifications[0])?this.messageService.addMessage(new ne(this.customMessageGroupName,"ocapi.422-OCAPI-ERR-ODCS205")):(this.createEnhancedModel(),this.buildForm(),this.isInitialized=!0,this.enableSave=!1,this.collapseBundlePanel=!0,this.domService.scrollToTop())})}checkUserPidLinked(){return this.mobileLine.pid?w(this.mobileUsageNotifications.find(e=>e.pid===this.mobileLine.pid))||!w(this.mobileUsageNotifications.find(e=>e.pid===""))?this.userPidLinked=!1:this.userPidLinked=!0:this.userPidLinked=!1,this.userPidLinked}createNotificationsRequest(){let e=[];return e.push(this.getProfileDetails(this.messageGroupName)),e.push(this.getUsageNotifications(this.messageGroupName)),e.push(this.getUsageLimits(this.messageGroupName)),e.push(this.getAutoPause(this.messageGroupName)),e}getProfileDetails(e){return this.mobileUsageNotificationService.getProfileDetails(e)}getUsageNotifications(e){return this.mobileUsageNotificationService.getMobileUsageNotifications(e,this.mobileLine.identifier,U.MOBILE)}getUsageLimits(e){return this.mobileLine.productInfo.hasCategory(_i.PREPAID)?Wo({}):this.mobileUsageNotificationService.getUsageLimits(e,this.mobileLine.identifier)}getAutoPause(e){return this.mobileLine.productInfo.isEligibleForAutoPause||this.mobileLine.productInfo.isEligibleForSettinglimits?this.mobileUsageNotificationService.getAutoPause(e,this.mobileLine.identifier):Wo({})}createEnhancedModel(){if(this.isBundleLine){let e=k(this.mobileLine);this.mobileLine.productInfo.usagenotifications[U.PRODUCT_TYPE_MOBILE]=this.mobileUsageNotificationService.loadCategory(e)}this.enhancedNotification=rn(ot).product(U.PRODUCT_TYPE_MOBILE).productInfo(this.mobileLine.productInfo).usageNotificationsRes(this.mobileUsageNotifications).profileDetails(this.profileDetails).isOutOfBundleLimitEnabled(this.mobileLine.productInfo.hasCategory(_i.PREPAID)?!1:this.usageLimit.isOutOfBundleLimitEnabled()).isPrepaid(this.mobileLine.productInfo.hasCategory(_i.PREPAID)).build(),this.enhancedNotification.createEnhancedNotifications(),setTimeout(()=>{this.userPidLinked?(this.initialFormState=Object.keys(this.parentForm.controls).map(e=>this.parentForm.controls[e].value),this.parentFormValue=this.parentForm.value):this.parentForm.disable()},100)}getCategoryDetails(e){return this.enhancedNotification.categories.find(t=>t.category===e)}accordian(){this.collapseBundlePanel=!this.collapseBundlePanel}accordianOptions(){this.collapseOptionsPanel=!this.collapseOptionsPanel}showNotificationSection(e){return this.usageLimit&&this.usageLimit.isOutOfBundleLimitEnabled()&&e===U.OUT_OF_BUNDLE_SECTION||e===U.INCLUDED_SECTION&&!this.mobileLine.productInfo.usageBasedRatePlan||e===U.CREDIT_SECTION||e===U.OPTION_SECTION&&!w(this.mobileLine.options)}showBundleSection(e){return this.isBundleLine&&U.BUNDLE_CATEGORIES.includes(e)}getRoamingOptions(){return this.mobileLine.options.filter(e=>e.productInfo.categories.includes(U.ROAMING_OPTION))}hasRoamingOptions(){return this.mobileLine.options.some(e=>e.productInfo.categories.includes(U.ROAMING_OPTION))}saveUsageNotification(){let e=this.mobileUsageNotificationService.createPostData(this.mobileUsageNotifications,this.enhancedNotification,this.isBundleLine,this.usageLimit);this.submitUsageNotification$=[],this.mobileLine.productType!==U.BUNDLE?this.submitUsageNotification$.push(this.mobileUsageNotificationService.updateNotificationsRequest(e,"",this.customMessageGroupName,this.mobileLine.identifier,U.MOBILE)):this.setautoPauseUsage(e),this.showWarningDialog||this.submit()}setautoPauseUsage(e){if((this.autoPauseCheckedState||this.isEligibleForSettinglimits&&
1!w(this.mobileAutoPause.limit)&&!w(this.parentForm.controls.personalMobileUsageLimit))&&!this.mobileLine.isConnect5Bundle()){let t=this.mobileAutoPause.limit,n=parseFloat(t.currentUsage.replace("GB","")),o=parseFloat(this.parentForm.controls.personalMobileUsageLimit.value.replace("GB",""));!w(this.parentForm.controls.personalMobileUsageLimit.value)&&n>o&&(this.parentForm.controls[U.ACTIVATE_AUTO_PAUSE_CONTROL].value===!0||this.isEligibleForSettinglimits)?this.showWarningDialog=!0:this.submitUsageNotification$.push(this.submitAutoPause())}this.isIncludedPersonalPostDataRequest(e)}isIncludedPersonalPostDataRequest(e){if(this.isIncludedBundleChanged&&this.isBundleLine){let t=this.mobileUsageNotificationService.getBundlePostData(e,this.enhancedNotification);this.submitUsageNotification$.push(this.mobileUsageNotificationService.updateNotificationsRequest(t,this.mobileLine.isBundleProduct()?this.mobileLine.bundleIdentifier:"",this.customMessageGroupName,this.mobileLine.identifier,U.MOBILE))}((this.isPersonalOutOfBundleChanged||this.isOptionsChanged)&&this.isBundleLine||this.isPersonalMobileUsageChanged)&&this.submitUsageNotification$.push(this.mobileUsageNotificationService.updateNotificationsRequest(e,"",this.customMessageGroupName,this.mobileLine.identifier,U.MOBILE))}getWarningDialog(){return new ze(U.AUTO_PAUSE_SETTINGS_WARNING_KEY,U.AUTO_PAUSE_SETTINGS_DESCRIPTION_KEY,U.EXPERT_SETTINGS_CONFIRM_BUTTON_KEY,U.CANCEL_BUTTON_KEY)}warningDialogEvent(e){this.showWarningDialog=!1,e?(this.submitUsageNotification$.push(this.submitAutoPause()),this.submit()):this.parentForm.reset(this.parentFormValue)}submitAutoPause(){return this.obs(this.mobileUsageNotificationService.manageAutoPause(this.messageGroupName,this.mobileUsageNotificationService.createAutoPausePostRequest(this.parentForm,this.mobileAutoPause,this.isEligibleForSettinglimits,this.isEnableAutoPauseSoho)))}submit(){$o(this.submitUsageNotification$).subscribe(e=>{this.messageService.clearMessages(this.customMessageGroupName),this.messageService.addMessage(new ke(this.customMessageGroupName,U.WARNING_NOTIFICATION_MESSAGE)),this.pushDataToAnalytics(),this.enableSave=!1})}pushDataToAnalytics(){let e=this.mobileLine.productInfo&&this.mobileLine.productInfo.hasCategory(_i.PREPAID)?U.PREPAID:U.POSTPAID;this.mobileUsageNotificationsDatalayerService.pushDataToAnalytics(e,this.isOptionsChanged,this.isCreditsChanged,this.autoPauseCheckedState,this.parentForm,this.enhancedNotification),this.prepaidAnalytics(e)}prepaidAnalytics(e){this.mobileUsageNotificationsDatalayerService.prepaidAnalytics(e,this.isIncludedBundleChanged,this.isPersonalOutOfBundleChanged,this.isPersonalMobileUsageChanged,this.enhancedNotification)}get redirectSimManagementLink(){return this.simManagementLink.replace(U.DYNAMIC_QUERY_KEY_PATTERN,this.mobileLine.identifier)}openUrl(e){e.preventDefault(),this.openSimManagementLinkIn==="navigation-content"?this.document.dispatchEvent(new CustomEvent("loadpage",{bubbles:!0,detail:{pageUrl:this.simManagementLink,title:""}})):this.urlservice.redirectTo(this.redirectSimManagementLink)}static{this.\u0275fac=function(t){return new(t||i)(d.\u0275\u0275directiveInject(Kd),d.\u0275\u0275directiveInject(Ue),d.\u0275\u0275directiveInject(W),d.\u0275\u0275directiveInject(pt.LoginService),d.\u0275\u0275directiveInject(oe),d.\u0275\u0275directiveInject(Bo),d.\u0275\u0275directiveInject(wo),d.\u0275\u0275directiveInject($))}}static{this.\u0275cmp=d.\u0275\u0275defineComponent({type:i,selectors:[["tg-mobile-usage-notifications"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",mobileUsageLimitsLink:"mobileUsageLimitsLink",openLimitsLinkIn:"openLimitsLinkIn",premiumServiceBarringsLink:"premiumServiceBarringsLink",openPremiumBarringsLinkIn:"openPremiumBarringsLinkIn",simManagementLink:"simManagementLink",openSimManagementLinkIn:"openSimManagementLinkIn"},standalone:!1,features:[d.\u0275\u0275InheritDefinitionFeature],decls:7,vars:10,consts:[[3,"componentCanRender","messageGroupName","scopes"],[4,"ngIf"],[3,"enableLoader","pageType","enableMask"],[3,"messageGroupName"],[3,"clickEvent","dialogData"],["class","sticky-section",4,"ngIf"],[1,"notification","notification--info","mb-15"],[1,"icon","icon-information-shape","info"],[1,"ml--l--xxxs","mr--l--xxxs","ml--n--md","mr--n--md","mb--l","box","box--main","box--elevation","box--no-padding"],[1,"cards--body"],[1,"cards--body--inner-container"],[1,"mobile-usage-notifications"],[1,"content-section__details"],[1,"row"],[1,"col-md-8"],[1,"display--flex","align-items--center"],[1,"icon-user","icon-md"],[1,"text-weight--l","ml--m","text-font-family--t7"],[1,"pt--s--md","pt--l","line-height--24"],[1,"pt--s--md","pt--l"],[1,"col-md-4","pt--n--md","pt--l","text-align--center"],[1,"button"],[3,"click"],[4,"ngFor","ngForOf"],[3,"parentForm","categoryDetails","section","options","mobileUsageLimitsLink","selectedLine","usageLimit","isPrepaid","isMember","loggedInPid","userPidLinked","openLimitsLinkIn","hasOutOfBundleFormError","isIncludedBundleChanged","isOutOfBundleChanged","isOptionsChanged","isCreditsChanged",4,"ngIf"],[3,"parentForm","categoryDetails","section","usageNotification","isMember","loggedInPid","userPidLinked","hasOutOfBundleFormError","isPersonalOutOfBundleChanged",4,"ngIf"],[3,"hasOutOfBundleFormError","isIncludedBundleChanged","isOutOfBundleChanged","isOptionsChanged","isCreditsChanged","parentForm","categoryDetails","section","options","mobileUsageLimitsLink","selectedLine","usageLimit","isPrepaid","isMember","loggedInPid","userPidLinked","openLimitsLinkIn"],[3,"hasOutOfBundleFormError","isPersonalOutOfBundleChanged","parentForm","categoryDetails","section","usageNotification","isMember","loggedInPid","userPidLinked"],[1,"ml--xxxs","mr--xxxs","ml--n--md","mr--n--md","mb--xl","box","box--main","box--elevation","box--no-padding"],[1,"content-section__header","cursor--pointer",3,"click"],[1,"row","ml-0","mr-0"],[1,"heading--nomargin","col-md-5","col-xs-10"],[1,"col-md-7","col-xs-2","text-align--right"],[1,"text--xm",3,"ngClass"],["class","bundle-section__notification",3,"parentForm","categoryDetails","section","collapsePanel","isMember","loggedInPid","isBundleLine","userPidLinked","isIncludedBundleChanged",4,"ngIf"],[1,"bundle-section__notification",3,"isIncludedBundleChanged","parentForm","categoryDetails","section","collapsePanel","isMember","loggedInPid","isBundleLine","userPidLinked"],[3,"C5Bundle","categoryDetails","isMember","loggedInPid","isBundleLine","mobileAutoPause","openPremiumBarringsLinkIn","parentForm","premiumServiceBarringsLink","section","selectedLine","usageNotification","isEligibleForSettinglimits","isEligibleForAutoPause","autoPauseCheckedState","isPersonalMobileUsageChanged","hasOutOfBundleFormError",4,"ngIf"],["class","ml--xxxs mr--xxxs ml--n--md mr--n--md mb--xl box box--main box--elevation box--no-padding",4,"ngIf"],[3,"parentForm","categoryDetails","section","usageNotification","isMember","loggedInPid","isBundleLine","userPidLinked","hasOutOfBundleFormError","isPersonalOutOfBundleChanged",4,"ngIf"],[3,"autoPauseCheckedState","isPersonalMobileUsageChanged","hasOutOfBundleFormError","C5Bundle","categoryDetails","isMember","loggedInPid","isBundleLine","mobileAutoPause","openPremiumBarringsLinkIn","parentForm","premiumServiceBarringsLink","section","selectedLine","usageNotification","isEligibleForSettinglimits","isEligibleForAutoPause"],[1,"bundle-section__notification",3,"isOptionsChanged","options","isBundleLine","collapsePanel","parentForm","categoryDetails","section","isMember","loggedInPid","userPidLinked"],[3,"hasOutOfBundleFormError","isPersonalOutOfBundleChanged","parentForm","categoryDetails","section","usageNotification","isMember","loggedInPid","isBundleLine","userPidLinked"],[1,"sticky-section"],[1,"sticky-footer-v2","position--fixed","background-white","width--full","py--m","px--xm","p--xm--md","display--flex","justify-content--center","align-items--center","box-sizing--inherit","shadow--xs-inverse","position--bottom","position--left"],[1,"sticky-footer-v2__c
1ontainer","width--full","default-max-site-width","display--flex","justify-content--between","align-items--center"],[1,"back-section","visibility--hide-only"],[1,"next-section"],[1,"button","button--primary",3,"click","innerHTML"]],template:function(t,n){t&1&&(d.\u0275\u0275elementStart(0,"tg-login",0),d.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),d.\u0275\u0275template(1,qd,2,1,"ng-container",1),d.\u0275\u0275element(2,"app-loader",2)(3,"app-message-flow",3),d.\u0275\u0275elementStart(4,"app-message-flow",3),d.\u0275\u0275element(5,"app-bundle-line-selector",3),d.\u0275\u0275template(6,dm,6,5,"ng-container",1),d.\u0275\u0275elementEnd()()),t&2&&(d.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.scopes),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",n.showWarningDialog),d.\u0275\u0275advance(),d.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask),d.\u0275\u0275advance(),d.\u0275\u0275property("messageGroupName",n.customMessageGroupName),d.\u0275\u0275advance(),d.\u0275\u0275property("messageGroupName",n.messageGroupName),d.\u0275\u0275advance(),d.\u0275\u0275property("messageGroupName",n.messageGroupName),d.\u0275\u0275advance(),d.\u0275\u0275property("ngIf",n.isInitialized))},dependencies:[si.NgClass,si.NgForOf,si.NgIf,be,pt.LoginComponent,Ai,Se,Ee,Fo,Vo,Yo,Ko.TranslatePipe],encapsulation:2})}}return i})();import"@angular/core";import{FormControl as Rt,FormGroup as Em,Validators as li}from"@angular/forms";var V=(()=>{class i{static{this.MESSAGE_GROUP="third-party-services"}static{this.PARAM_START_DATE="startDate"}static{this.PARAM_END_DATE="endDate"}static{this.PARAM_SHORT_CODE="shortCode"}static{this.EMPTY=""}static{this.DATE_RANGE_FORMAT="YYYY-MM-DD"}static{this.DATE_FORMAT="DD-MM-YYYY"}static{this.MAX_YEARS_ALLOWED_IN_PAST=2}static{this.SHORT_CODE_PATTERN=/^[^'"]+$/}static{this.DATE_PATTERN=/(19|20)\d{2}\-(0[1-9]|1[0-2])\-(0[1-9]|1\d|2\d|3[01])/}static{this.VOICE_NUMBER_PATTERN=/(0[0-9]{7,9}$)|(00[0-9]{13}$)/}static{this.PAY_BY_MOBILE_PATTERN=/[A-Za-z\-\s]+/}static{this.VOICE_ERROR_KEY="third-party-services.lbl.check-crdc"}static{this.NON_VOICE_ERROR_KEY="third-party-services.lbl.no-results-found"}static{this.QUERY_TYPE_PAY_BY_MOBILE="pay-by-mobile"}static{this.QUERY_TYPE_PHONE_NUMBER="phone-number"}static{this.QUERY_TYPE_SHORT_CODE="short-number"}}return i})();import*as u from"@angular/core";import*as gt from"@angular/common";import*as fe from"@angular/forms";import"@angular/core";import*as g from"@angular/core";import*as ut from"@angular/common";import*as qo from"@ngx-translate/core";var Ve=i=>({value:i}),mm=(i,r)=>({from:i,until:r});function pm(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.send-sms-rate")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.sms-price",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.sendSms)))}}function um(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.send-mms-rate")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.mms-price",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.sendMms)))}}function gm(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.rate-sms-recieve")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.sms-price",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.receiveSms)))}}function _m(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.rate-mms-recieve")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.mms-price",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.receiveMms)))}}function fm(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.call-per-minute")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.call-price-minute",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.callPerMinute)))}}function hm(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",5)(2,"div",6)(3,"div",7),g.\u0275\u0275text(4),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(6,"div",8)(7,"div",7),g.\u0275\u0275text(8),g.\u0275\u0275pipe(9,"translate"),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(10,"div",0),g.\u0275\u0275elementContainerEnd()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(5,2,"ng.third-party-services.lbl.connection-cost")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1("",g.\u0275\u0275pipeBind2(9,4,"ng.third-party-services.lbl.connection-cost-price",g.\u0275\u0275pureFunction1(7,Ve,e==null?null:e.setUpCost))," ")}}function vm(i,r){if(i&1&&(g.\u0275\u0275elementStart(0,"div",17)(1,"a",18),g.\u0275\u0275text(2),g.\u0275\u0275elementEnd()()),i&2){let e=g.\u0275\u0275nextContext().$implicit;g.\u0275\u0275advance(),g.\u0275\u0275property("href",g.\u0275\u0275interpolate(e==null?null:e.customerCareUrl),g.\u0275\u0275sanitizeUrl),g.\u0275\u0275advance(),g.\u0275\u0275textInterpolate(e==null?null:e.customerCareUrl)}}function Cm(i,r){i&1&&g.\u0275\u0275element(0,"div",0)}function bm(i,r){if(i&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275elementStart(1,"div",3)(2,"div",4),g.\u0275\u0275text(3),g.\u0275\u0275pipe(4,"translate"),g.\u0275\u0275pipe(5,"translate"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(6,"div",5)(7,"div",6)(8,"div",7),g.\u0275\u0275text(9),g.\u0275\u0275pipe(10,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(11,"div",8)(12,"div",9),g.\u0275\u0275text(13),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(14,"div",0),g.\u0275\u0275template(15,pm,11,9,"ng-container",10)(16,um,11,9,"ng-container",10)(17,gm,11,9,"ng-container",10)(18,_m,11,9,"ng-container",10)(19,fm,11,9,"ng-container",10)(20,hm,11,9,"ng-container",10),g.\u0275\u0275elementStart(21,"div",5)(22,"div",11)(23,"div",7),g.\u0275\u0275text(24),g.\u0275\u0275pipe(25,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(26,"div",12)(27,"div",7),g.\u0275\u0275text(28),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275element(29,"div",0),g.\u0275\u0275elementStart(30,"div",13)(31,"div",11)(32,"div",7),g.\u0275\u0275text(33),g.\u0275\u0275pipe(34,"translate"),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(35,"div",12)(36,"div",14),g.\u0275\u0275text(37),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(38,vm,3,3,"div",15),g.\u0275\u0275elementEnd()()(),g.\u0275\u0275template(39,Cm,1,0,"div",16),g.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit,t=r.last,n=g.\u0275\u0275nextContext();g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind2(5,17,"ng.third-party-services.lbl.date-range",g.\u0275\u0275pureFunction2(26,mm,e==null?null:e.priceStartDate,g.\u0275\u0275pipeBind1(4,15,(e==null?null:e.priceEndDate)||"ng.third-party-services.lbl.present")))," "),g.\u0275\u0275advance(6),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(10,20,"ng.third-party-services.lbl.start-
1date-of-service")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(e==null?null:e.serviceConfirmedDate),g.\u0275\u0275advance(2),g.\u0275\u0275property("ngIf",e==null?null:e.sendSms),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e==null?null:e.sendMms),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e==null?null:e.receiveSms),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e==null?null:e.receiveMms),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e==null?null:e.callPerMinute),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",(e==null?null:e.setUpCost)&&n.parseToNumber(e==null?null:e.setUpCost)>0),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(25,22,"ng.third-party-services.lbl.name-organisation")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(e==null?null:e.contentProviderName),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(34,24,"ng.third-party-services.lbl.customer-service")),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(e==null?null:e.customerCareTelephoneOrEmail),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e==null?null:e.customerCareUrl),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",!t)}}var Xo=(()=>{class i extends G{constructor(){super()}getShortCodeType(){return this.results.premiumSerivceId.match(V.PAY_BY_MOBILE_PATTERN)?V.QUERY_TYPE_PAY_BY_MOBILE:this.results.premiumSerivceId.match(V.VOICE_NUMBER_PATTERN)?V.QUERY_TYPE_PHONE_NUMBER:V.QUERY_TYPE_SHORT_CODE}parseToNumber(e){return parseInt(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=g.\u0275\u0275defineComponent({type:i,selectors:[["app-search-results"]],inputs:{results:"results"},standalone:!1,features:[g.\u0275\u0275InheritDefinitionFeature],decls:6,vars:7,consts:[[1,"divider","divider--xxs__very-light-grey"],[1,"text-font-family--t7","p--xl","text--l"],[4,"ngFor","ngForOf"],[1,"p--xl--md","p--l"],[1,"pb--xxs","third-party-services__title","text--xxm"],[1,"row","pb--m","pt--m"],[1,"col-md-4","col-xs-5","pr--n"],[1,"text--xm"],[1,"col-md-8","col-xs-7","text-align--right","pl--n"],[1,"text--xm","text-weight--l"],[4,"ngIf"],[1,"col-md-4","col-xs-6","pr--n"],[1,"col-md-8","col-xs-6","text-align--right","pl--n"],[1,"row","pt--m"],[1,"text--xm","woword-break--break-word","pl--xxxl--md","ml--xxxl--md"],["class","text--xm mt--xxs",4,"ngIf"],["class","divider divider--xxs__very-light-grey",4,"ngIf"],[1,"text--xm","mt--xxs"],[1,"link","link--unstyled","word-break--break-word","pl--xxxl--md","ml--xxxl--md",3,"href"]],template:function(t,n){t&1&&(g.\u0275\u0275element(0,"div",0),g.\u0275\u0275elementStart(1,"div",1),g.\u0275\u0275text(2),g.\u0275\u0275pipe(3,"translate"),g.\u0275\u0275elementEnd(),g.\u0275\u0275element(4,"div",0),g.\u0275\u0275template(5,bm,40,29,"ng-container",2)),t&2&&(g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind2(3,2,"ng.third-party-services.info."+n.getShortCodeType(),g.\u0275\u0275pureFunction1(5,Ve,n.results==null?null:n.results.premiumSerivceId)),` 2`),g.\u0275\u0275advance(3),g.\u0275\u0275property("ngForOf",n.results.details))},dependencies:[ut.NgForOf,ut.NgIf,qo.TranslatePipe],encapsulation:2})}}return i})();import*as Qo from"@ngx-translate/core";var xm=i=>({"form__input--error":i}),Tm=i=>({number:i});function Im(i,r){i&1&&(u.\u0275\u0275elementContainerStart(0),u.\u0275\u0275elementStart(1,"p"),u.\u0275\u0275text(2),u.\u0275\u0275pipe(3,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementContainerEnd()),i&2&&(u.\u0275\u0275advance(2),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(3,1,"ng.third-party-services.lbl.invalid-shortcode")))}function ym(i,r){i&1&&(u.\u0275\u0275elementContainerStart(0),u.\u0275\u0275elementStart(1,"p"),u.\u0275\u0275text(2),u.\u0275\u0275pipe(3,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementContainerEnd()),i&2&&(u.\u0275\u0275advance(2),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(3,1,"ng.third-party-services.lbl.required")))}function Lm(i,r){if(i&1&&(u.\u0275\u0275elementStart(0,"div",50),u.\u0275\u0275template(1,Im,4,3,"ng-container",49)(2,ym,4,3,"ng-container",49),u.\u0275\u0275elementEnd()),i&2){let e=u.\u0275\u0275nextContext();u.\u0275\u0275advance(),u.\u0275\u0275property("ngIf",e.shortCodeControl==null||e.shortCodeControl.errors==null?null:e.shortCodeControl.errors.pattern),u.\u0275\u0275advance(),u.\u0275\u0275property("ngIf",(e.shortCodeControl==null||e.shortCodeControl.errors==null?null:e.shortCodeControl.errors.required)&&(e.shortCodeControl==null?null:e.shortCodeControl.dirty))}}
2function Om(i,r){if(i&1&&(u.\u0275\u0275elementContainerStart(0),u.\u0275\u0275element(1,"app-search-results",51),u.\u0275\u0275elementContainerEnd()),i&2){let e=u.\u0275\u0275nextContext();u.\u0275\u0275advance(),u.\u0275\u0275property("results",e.searchData)}}function Um(i,r){if(i&1&&(u.\u0275\u0275elementStart(0,"span",57),u.\u0275\u0275text(1),u.\u0275\u0275pipe(2,"translate"),u.\u0275\u0275elementEnd()),i&2){let e=u.\u0275\u0275nextContext(2);u.\u0275\u0275advance(),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind2(2,1,"ng.third-party-services.warning.no-result-found-for-id",u.\u0275\u0275pureFunction1(4,Tm,e.shortCode))," ")}}function Nm(i,r){i&1&&(u.\u0275\u0275element(0,"span",58),u.\u0275\u0275pipe(1,"translate")),i&2&&u.\u0275\u0275property("innerHTML",u.\u0275\u0275pipeBind1(1,1,"ng.third-party-services.lbl.check-crdc-errorfield"),u.\u0275\u0275sanitizeHtml)}function Bm(i,r){if(i&1&&(u.\u0275\u0275elementContainerStart(0),u.\u0275\u0275element(1,"div",18),u.\u0275\u0275elementStart(2,"div",52),u.\u0275\u0275text(3),u.\u0275\u0275pipe(4,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementStart(5,"div",53)(6,"div",54),u.\u0275\u0275template(7,Um,3,6,"span",55)(8,Nm,2,3,"span",56),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementContainerEnd()),i&2){let e=u.\u0275\u0275nextContext();u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(4,3,"ng.third-party-services.lbl.no-results-found-errorfield")," "),u.\u0275\u0275advance(4),u.\u0275\u0275property("ngIf",!e.voiceNumber),u.\u0275\u0275advance(),u.\u0275\u0275property("ngIf",e.voiceNumber)}}var Zo=(()=>{class i extends G{constructor(e,t,n,o,C){super(),this.urlService=e,this._element=t,this.omapiPremiumService=n,this.messageService=o,this.invalidInputControlScrollService=C,this.messageGroup=V.MESSAGE_GROUP}ngOnInit(){this.shortCode=this.urlService.getRequestParamValue(V.PARAM_SHORT_CODE,V.EMPTY),this.startDate=this.getDate(this.urlService.getRequestParamValue(V.PARAM_START_DATE,V.EMPTY)),this.endDate=this.getDate(this.urlService.getRequestParamValue(V.PARAM_END_DATE,V.EMPTY)),this.maxDateRange=Ne().format(V.DATE_RANGE_FORMAT),this.minDateRange=Ne().subtract(V.MAX_YEARS_ALLOWED_IN_PAST,"years").format(V.DATE_RANGE_FORMAT),this.buildForm()}buildForm(){this.thirdPartyServiceform=new Em({short_code:new Rt(this.shortCode,[li.required,li.pattern(V.SHORT_CODE_PATTERN)]),from_date:new Rt(this.startDate,[li.required,li.pattern(V.DATE_PATTERN),this.fromDateValidator.bind(this)]),until_date:new Rt(this.endDate,[li.required,li.pattern(V.DATE_PATTERN),this.untilDateValidator.bind(this)])})}fromDateValidator(e){let t=Ne(e.value);return t.isAfter(this.maxDateRange)||t.isBefore(this.minDateRange)?{range:"ng.mobile-usage-notifications.lbl.profile.error"}:null}untilDateValidator(e){let t=Ne(e.value),n=this.thirdPartyServiceform&&this.fromDateControl.value;return t.isAfter(this.maxDateRange)||t.isBefore(n||this.minDateRange)?{range:"ng.mobile-usage-notifications.lbl.profile.error"}:null}getDate(e){return e===V.EMPTY?Ne().format(V.DATE_RANGE_FORMAT):e}get shortCodeControl(){return this.thirdPartyServiceform&&this.thirdPartyServiceform.get("short_code")}get fromDateControl(){return this.thirdPartyServiceform&&this.thirdPartyServiceform.get("from_date")}get untilDateControl(){return this.thirdPartyServiceform&&this.thirdPartyServiceform.get("until_date")}search(){if(!this.invalidInputControlScrollService.getFocusOnFirstErrorField(this.thirdPartyServiceform)){this.messageService.clearErrorMessages(this.messageGroup),this.shortCode=this.shortCodeControl.value,this.voiceNumber=V.VOICE_NUMBER_PATTERN.test(this.shortCodeControl.value),this.shortCode=this.shortCode.replace(/\s|-|\/|\./g,"").toLowerCase().trim();let e=this.voiceNumber?V.VOICE_ERROR_KEY:V.NON_VOICE_ERROR_KEY;this.omapiPremiumService.getOmapiPremium(this.messageGroup,this.shortCode,!0,e).subscribe({next:t=>{this.searchData=this.filterSearchResults(t)},error:t=>{this.searchData=null}})}}filterSearchResults(e){let t=this.fromDateControl.value,n=this.untilDateControl.value;return e.details=e.details.filter(o=>{let C=Ne(o.priceStartDate,this.getDateFormat(o.priceStartDate)),N=Ne(o.priceEndDate,this.getDateFormat(o.priceEndDate)),P=C.isAfter(t)||C.isSame(t),F=C.isBefore(t),q=N.isAfter(t),te=N.isBefore(n)||N.isSame(n),Te=N.isBefore(n);return F&&(q||Te)||te&&Te||P&&te}),e}getDateFormat(e){return e?V.DATE_FORMAT:void 0}static{this.\u0275fac=function(t){return new(t||i)(u.\u0275\u0275directiveInject($),u.\u0275\u0275directiveInject(u.ElementRef),u.\u0275\u0275directiveInject(tn),u.\u0275\u0275directiveInject(W),u.\u0275\u0275directiveInject(Pi))}}static{this.\u0275cmp=u.\u0275\u0275defineComponent({type:i,selectors:[["tg-third-party-services"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask"},standalone:!1,features:[u.\u0275\u0275InheritDefinitionFeature],decls:91,vars:61,consts:[[3,"enableLoader","pageType","enableMask","startByDefault"],[3,"messageGroupName"],[1,"row"],[1,"third-party-services","m--auto","col-md-8","col-xs-12"],[1,"notification","notification--info"],[1,"icon","icon-information-shape","info"],[1,"third-party-services__heading","text-font-family--t7","mb--xl","pl--l","pl--n--md","pr--s","pr--n--md"],[1,"cards--append","cards--container","background-white"],[1,"cards--body"],[1,"cards--body--inner-container"],[1,"p--xl--md","p--l"],[1,"text-font-family--t7","text--xm","text-weight--xl"],[1,"pt--l",3,"innerHTML"],[1,"display--flex","align-items--center--md","align-items--start","pt--m"],[1,"icon","icon-information-shape","icon-md"],[1,"pl--m"],[1,"text-weight--l","text--m","text-font-family--t7"],[1,"text--m","pt--xxs"],[1,"divi
2der","divider--xxs__very-light-grey"],[3,"formGroup"],[1,"col-sm-6"],["for","shortCode",1,"cursor--default"],[1,"text-font-family--t7"],[1,"tooltip","position--relative","display--inline-block"],[1,"tooltip__icon-section","display--flex","flex-direction--row--sm","flex-direction--row-reverse","align-items--center","justify-content--center","cursor--pointer","my--xxxs"],[1,"icon","icon-information-shape"],[1,"icon-label","display--flex","align-items--center"],[1,"tooltip__info-section","tooltip__info-section__arrow-left","mt--xxs","tooltip__info-section--hidden-mobile"],[1,"horizontal-center-align"],[1,"info-section__icon","icon","icon-information-shape","p-0","mr--xs","icon-no-size-override","icon-md"],[1,"info-section__description"],[1,"info-section__description__title"],[1,"info-section__description__text","mt--xs"],[1,"form__input-container"],["type","text","id","shortCode","formControlName","short_code",1,"form__input","form__input--max-width",3,"placeholder","ngClass"],["class","form__msg--error form__input__invalid-message",4,"ngIf"],[1,"hidden-desktop","mt--s"],[1,"p--l","background-very-light-grey"],[1,"display--flex"],[1,"info-section__icon","icon","icon-information-shape"],[1,"info-section__description","pl--xs"],[1,"row","pt--m"],[1,"col-sm-6","pb--n--md","pb--s--xs"],[1,"form-builder"],["for","input-date-picker-field",1,"text-font-family--t7","cursor--default"],["formControlName","from_date",3,"maxDate","minDate"],["formControlName","until_date",3,"maxDate","minDate"],[1,"pt--l"],[1,"button",3,"click"],[4,"ngIf"],[1,"form__msg--error","form__input__invalid-message"],[3,"results"],[1,"text-font-family--t7","p--xl","text--l"],[1,"pr--m","pl--m","pt--n--md","pt--m","col-12"],[1,"notification","notification--warning"],["class","icon icon-alert-shape warning",4,"ngIf"],["class","icon icon-alert-shape warning",3,"innerHTML",4,"ngIf"],[1,"icon","icon-alert-shape","warning"],[1,"icon","icon-alert-shape","warning",3,"innerHTML"]],template:function(t,n){t&1&&(u.\u0275\u0275element(0,"app-loader",0),u.\u0275\u0275elementStart(1,"app-message",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span",5),u.\u0275\u0275text(6),u.\u0275\u0275pipe(7,"translate"),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(8,"div",6),u.\u0275\u0275text(9),u.\u0275\u0275pipe(10,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementStart(11,"div",7)(12,"div",8)(13,"div",9)(14,"div")(15,"div",10)(16,"div",11),u.\u0275\u0275text(17),u.\u0275\u0275pipe(18,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275element(19,"div",12),u.\u0275\u0275pipe(20,"translate"),u.\u0275\u0275elementStart(21,"div",13),u.\u0275\u0275element(22,"span",14),u.\u0275\u0275elementStart(23,"div",15)(24,"div",16),u.\u0275\u0275text(25),u.\u0275\u0275pipe(26,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementStart(27,"div",17),u.\u0275\u0275text(28),u.\u0275\u0275pipe(29,"translate"),u.\u0275\u0275elementEnd()()()(),u.\u0275\u0275element(30,"div",18),u.\u0275\u0275elementStart(31,"form",19)(32,"div",10)(33,"div",2)(34,"div",20)(35,"label",21)(36,"span",22),u.\u0275\u0275text(37),u.\u0275\u0275pipe(38,"translate"),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(39,"div",23)(40,"div",24),u.\u0275\u0275element(41,"i",25)(42,"div",26),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementStart(43,"div",27)(44,"div",28),u.\u0275\u0275element(45,"i",29),u.\u0275\u0275elementStart(46,"div",30)(47,"b")(48,"div",31),u.\u0275\u0275text(49),u.\u0275\u0275pipe(50,"translate"),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(51,"div",32),u.\u0275\u0275text(52),u.\u0275\u0275pipe(53,"translate"),u.\u0275\u0275elementEnd()()()()(),u.\u0275\u0275elementStart(54,"div",33),u.\u0275\u0275element(55,"input",34),u.\u0275\u0275pipe(56,"translate"),u.\u0275\u0275template(57,Lm,3,2,"div",35),u.\u0275\u0275elementEnd(),u.\u0275\u0275elementStart(58,"div",36)(59,"div",37)(60,"div",38),u.\u0275\u0275element(61,"i",39),u.\u0275\u0275elementStart(62,"div",40)(63,"b")(64,"div",31),u.\u0275\u0275text(65),u.\u0275\u0275pipe(66,"translate"),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(67,"div",32),u.\u0275\u0275text(68),u.\u0275\u0275pipe(69,"translate"),u.\u0275\u0275elementEnd()()()()()()(),u.\u0275\u0275elementStart(70,"div",41)(71,"div",42)(72,"div",43)(73,"label",44),u.\u0275\u0275text(74),u.\u0275\u0275pipe(75,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275element(76,"app-care-datepicker",45),u.\u0275\u0275elementEnd()(),u.\u0275\u0275elementStart(77,"div",20)(78,"div",43)(79,"label",44),u.\u0275\u0275text(80),u.\u0275\u0275pipe(81,"translate"),u.\u0275\u0275elementEnd(),u.\u0275\u0275element(82,"app-care-datepicker",46),u.\u0275\u0275elementEnd()()(),u.\u0275\u0275elementStart(83,"div",47)(84,"button",48),u.\u0275\u0275listener("click",function(){return n.search()}),u.\u0275\u0275elementStart(85,"span"),u.\u0275\u0275text(86),u.\u0275\u0275pipe(87,"translate"),u.\u0275\u0275elementEnd()()()()(),u.\u0275\u0275element(88,"div",18),u.\u0275\u0275elementEnd()(),u.\u0275\u0275template(89,Om,2,1,"ng-container",49)(90,Bm,9,5,"ng-container",49),u.\u0275\u0275elementEnd()()()()()),t&2&&(u.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask)("startByDefault",!1),u.\u0275\u0275advance(),u.\u0275\u0275property("messageGroupName",n.messageGroup),u.\u0275\u0275advance(5),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(7,29,"ng.third-party-services.info.third-party-services-info")),u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(10,31,"ng.third-party-services.lbl.has-provider-purchased-the-number")," "),u.\u0275\u0275advance(8),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(18,33,"ng.third-party-services.lbl.how-to-look-up-contact-details")," "),u.\u0275\u0275advance(2),u.\u0275\u0275property("innerHTML",u.\u0275\u0275pipeBind1(20,35,"ng.third-party-services.info.enter-a-short-code-description"),u.\u0275\u0275sanitizeHtml),u.\u0275\u0275advance(6),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(26,37,"ng.third-party-services.lbl.can-not-find-the-contact")),u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(29,39,"ng.third-party-services.lbl.can-not-find-the-contact-description")),u.\u0275\u0275advance(3),u.\u0275\u0275property("formGroup",n.thirdPartyServiceform),u.\u0275\u0275advance(6),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(38,41,"ng.third-party-services.lbl.short-code")),u.\u0275\u0275advance(12),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(50,43,"ng.third-party-services.title.short-code")," "),u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(53,45,"ng.third-party-services.lbl.short-code-description")," "),u.\u0275\u0275advance(3),u.\u0275\u0275property("placeholder",u.\u0275\u0275pipeBind1(56,47,"ng.third-party-services.lbl.enter-a-number"))("ngClass",u.\u0275\u0275pureFunction1(59,xm,(n.shortCodeControl==null?null:n.shortCodeControl.invalid)&&
2(n.shortCodeControl==null?null:n.shortCodeControl.dirty))),u.\u0275\u0275advance(2),u.\u0275\u0275property("ngIf",(n.shortCodeControl==null?null:n.shortCodeControl.invalid)&&(n.shortCodeControl==null?null:n.shortCodeControl.dirty)),u.\u0275\u0275advance(8),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(66,49,"ng.third-party-services.title.short-code")," "),u.\u0275\u0275advance(3),u.\u0275\u0275textInterpolate1(" ",u.\u0275\u0275pipeBind1(69,51,"ng.third-party-services.lbl.short-code-description")," "),u.\u0275\u0275advance(6),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(75,53,"ng.third-party-services.lbl.from")),u.\u0275\u0275advance(2),u.\u0275\u0275property("maxDate",n.maxDateRange)("minDate",n.minDateRange),u.\u0275\u0275advance(4),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(81,55,"ng.third-party-services.lbl.until")),u.\u0275\u0275advance(2),u.\u0275\u0275property("maxDate",n.maxDateRange)("minDate",n.fromDateControl==null?null:n.fromDateControl.value),u.\u0275\u0275advance(4),u.\u0275\u0275textInterpolate(u.\u0275\u0275pipeBind1(87,57,"ng.third-party-services.lbl.submit")),u.\u0275\u0275advance(3),u.\u0275\u0275property("ngIf",n.searchData==null||n.searchData.details==null?null:n.searchData.details.length),u.\u0275\u0275advance(),u.\u0275\u0275property("ngIf",n.searchData===null))},dependencies:[gt.NgClass,gt.NgIf,be,cn,fe.\u0275NgNoValidate,fe.DefaultValueAccessor,fe.NgControlStatus,fe.NgControlStatusGroup,fe.FormGroupDirective,fe.FormControlName,Bi,Xo,Qo.TranslatePipe],encapsulation:2})}}return i})();import{EventEmitter as Rm}from"@angular/core";import"@angular/core";import{catchError as Ft,forkJoin as Mm,map as ft,of as kt,switchMap as wm}from"rxjs";var ci=(function(i){return i.MOBILE_ONLY="holding-mobile",i.INTERNET_ONLY="holding-internet",i.INTERNET_WITH_MOBILE="holding-mobile-and-internet",i})(ci||{});var bi=(function(i){return i.MOBILE="mobile_data",i.INTERNET="fixed_usage",i.BUNDLE="oob",i})(bi||{});var z=(function(i){return i.TITLE="title",i.TEXT="text",i.LINK="link",i.BUTTON="button",i})(z||{});var he=(function(i){return i.CARD="card",i.MOMENT="moment",i})(he||{});import"@angular/core";import"@ngx-translate/core";import*as Si from"@angular/core";import*as Jo from"@ngx-translate/core";var _t=(()=>{class i{constructor(e,t){this.translateService=e,this.pathCategorisationService=t}getLabelKey(e,t=z.TEXT,n={},o,C){let N=this.pathCategorisationService.isCustomerOfType(qt.BUSINESS),{MESSAGE_GROUP_STATUS_CARD:P,MESSAGE_GROUP_STATUS_MOMENT:F}=j,te=`${o===he.MOMENT?F:P}.${e}`;C&&N&&(te=`${te}-bus`);let Te=this.getLabelKeyWithType(te,t);return this.translateService.instant(Te,n)}getLabelKeyWithType(e,t){switch(t){case z.TITLE:return gi.getLabelKeyWithTypeTitle(e);case z.BUTTON:return gi.getLabelKeyWithTypeButton(e);case z.LINK:return gi.getLabelKeyByType(e,Zt.LINK);default:return gi.getLabelKeyWithTypeText(e)}}static{this.\u0275fac=function(t){return new(t||i)(Si.\u0275\u0275inject(Jo.TranslateService),Si.\u0275\u0275inject(Xt))}}static{this.\u0275prov=Si.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ce=(function(i){return i.HIGH="high",i.MEDIUM="medium",i.LOW="low",i})(Ce||{}),di=(function(i){return i.HIGH="icon icon-error-shape-filled color--icon-error",i.MEDIUM="icon icon-error-shape-filled color--icon-warning",i.LOW="icon icon-check-shape-filled color--icon-succes",i})(di||{});var mi=(function(i){return i.INTERNET="internet",i.MOBILE="mobile",i.DTV="dtv",i})(mi||{});import*as Re from"@angular/core";var ht=(()=>{class i{constructor(e,t,n,o,C){this.usageWarningService=e,this.cacheService=t,this.productService=n,this.mobileUsageLabelService=o,this.productStoreService=C}getStatusCardInfo(e,t,n){return t?this.getMemberStatusCardInfo():this.getNonMemberStatusCardInfo(e,n)}getMemberStatusCardInfo(){return this.productInfo.pipe(ft(e=>this.createCardInfoObject(e)))}getNonMemberStatusCardInfo(e,t){return Mm([this.productInfo,this.getMobileAndInternetUsageWarnings(t)]).pipe(ft(([n,o])=>{let C=this.createCardInfoObject(n,o,e);return o?C:this.getCardInfoForError(C)}))}
2createCardInfoObject(e,t,n){return{cardType:j.CARD_TYPE_USAGE,subTitle:this.getHoldingsLabel(e),link:this.getHoldingsLabel(e,z.LINK,!0),messages:t?this.getUsageWarnings(t,n):void 0}}getUsageWarnings(e,t){return e?.length?e.map(n=>this.mapToCardWarning(n,null,null,t)):Array.isArray(e)?[this.mapToCardWarning(e[0],!0,null,t)]:e||[]}mapToCardWarning(e,t,n,o){return{title:this.getWarningLabel(e,t,o,z.TITLE),subTitle:t?this.getWarningLabel(e,t,o,z.TEXT):this.getSubTitle(e,o),severity:e?.severity,actionType:n,status:e?.warningType,link:e&&this.getWarningLink(e?.warningLabel,o)}}getWarningLabel(e,t,n,o){let C=t?j.NO_USAGE_WARNING:e.warningLabel,N={days:e?.nextBillingDueDays,units:e?.usedUnits,dataUsageLimit:e?.dataUsageLimit};return this.mobileUsageLabelService.getLabelKey(C,o,N,n)}getWarningLink(e,t){let{INTERNET_ONLY:n,MOBILE_ONLY:o}=ci,{MOBILE:C,INTERNET:N}=bi;return e?.includes(C)?this.mobileUsageLabelService.getLabelKey(o,z.LINK,null,t,!0):e?.includes(N)?this.mobileUsageLabelService.getLabelKey(n,z.LINK,null,t,!0):this.mobileUsageLabelService.getLabelKey(j.MY_TELENET_LINK_LABEL,z.LINK,null,t,!0)}getSubTitle(e,t){if(e)return t===he.MOMENT?this.mobileUsageLabelService.getLabelKey(e?.warningLabel,z.TITLE,null,he.MOMENT):e?.productType}getHoldings(e){if(!e?.length)return;let t={hasInternet:!1,mobileProductCount:0},n=(o,C)=>{let N=C?.status===j.STATUS_ACTIVE&&C?.productType===mi.MOBILE;return{hasInternet:o?.hasInternet||C?.hasProductType(mi.INTERNET),mobileProductCount:o?.mobileProductCount+(N?1:0)}};return this.usageProductInfo=e.reduce((o,C)=>{let N=n(o,C);return C.productType==="bundle"&&C?.status===j.STATUS_ACTIVE&&(N=C.children?.reduce((P,F)=>n(P,F),N)||N),N},t),this.usageProductInfo}getHoldingsLabel(e,t,n){if(!e)return;let{hasInternet:o,mobileProductCount:C}=e,{INTERNET_ONLY:N,MOBILE_ONLY:P,INTERNET_WITH_MOBILE:F}=ci;if(o&&C)return this.mobileUsageLabelService.getLabelKey(F,t,{mobileProductCount:C},null,n);if(!o&&C)return this.mobileUsageLabelService.getLabelKey(P,t,{mobileProductCount:C},null,n);if(o&&!C)return this.mobileUsageLabelService.getLabelKey(N,t,null,null,n)}get productInfo(){return this.productHoldings.pipe(ft(e=>this.getHoldings(e)))}get productHoldings(){return this.productStoreService.getStoreData().pipe(wm(e=>e.productHoldings?.length?kt(this.filterProductHoldings(e.productHoldings)):this.productHoldingsFromApi),Ft(()=>this.productHoldingsFromApi))}get productHoldingsFromApi(){let{MESSAGE_GROUP_STATUS_CARD:e,STATUS_ACTIVE:t}=j;return this.productService.getAllProducts(e,t,!1).pipe(ft(n=>this.filterProductHoldings(n)),Ft(()=>kt(null)))}filterProductHoldings(e){return e.filter(t=>t.hasProductType(mi.INTERNET)||t.hasProductType(mi.MOBILE)&&t.status===j.STATUS_ACTIVE)}getMobileAndInternetUsageWarnings(e){let{MESSAGE_GROUP_STATUS_CARD:t,CARD_TYPE_USAGE:n}=j;if(!this.cacheService.get(n)||e){let o=this.usageWarningService.getMobileAndInternetUsageWarnings(t).pipe(Ft(()=>kt(null)));this.cacheService.add(n,o)}return this.cacheService.get(n)}getCardInfoForError(e){let{STATUS_CARD_TYPE_ERROR:t,STATUS_CARD_TYPE_ERROR_MESSAGE:n}=j,o=`${e?.cardType}-${n}`,{cardType:C,subTitle:N,link:P}=e||{};return{cardType:C,subTitle:N,link:P,messages:[{actionType:t,title:this.mobileUsageLabelService.getLabelKey(o,z.TITLE),subTitle:this.mobileUsageLabelService.getLabelKey(o),severity:Ce.HIGH,status:t}]}}static{this.\u0275fac=function(t){return new(t||i)(Re.\u0275\u0275inject(gn),Re.\u0275\u0275inject(nn),Re.\u0275\u0275inject(re),Re.\u0275\u0275inject(_t),Re.\u0275\u0275inject(Be))}}static{this.\u0275prov=Re.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import"@angular/core";import{EventCategoryEnum as Pm}from"@telenet/ng-lib-datalayer";var je=(function(i){return i.CARD_VIEWED="status card viewed",i.CARD_CLICKED="status card clicked",i.SERVICE_MOMENT_VIEWED="service moment viewed",i.SERVICE_MOMENT_CLICKED="service moment clicked",i.VIEW_USAGE_CLICKED="View usage button clicked",i})(je||{}),pi=(function(i){return i.CLICK="click",i.IMPRESSION="impression",i})(pi||{}),me=(function(i){return i.ALL_GOOD="all good",i.WARNING="warning",i.ERROR="error",i.ERROR_AND_TRY_AGAIN="error + try again",i.WARNING_AND_ERROR="warning + error",i.MOBILE_DATA_USAGE_EXCEEDED="Mobile data limit reached + extra usage",i.INTERNET_DATA_USAGE_EXCEEDED="Internet data limit reached + extra usage",i.BUNDLE_USAGE_EXCEEDED="Bundle limit reached + extra usage",i.ERROR_REFRESH="Error refresh",i.USAGE_PAGE_LINK="Link to usage overview",i.USAGE_INFO_HELP_LINK="Link to info/help",i.USAGE_INFO_HELP_PRODUCT_1="Link to info/help for product 1",i.USAGE_INFO_HELP_PRODUCT_2="Link to info/help for product 2",i})(me||{});import{AttributeBuilder as Am,Category as Dm}from"@telenet/ng-lib-udl";import*as vt from"@angular/core";import*as tr from"@telenet/ng-lib-datalayer";var Ct=(()=>{class i{constructor(e){this.dataLayerService=e}sendCardViewedEvent(e,t){let n=this.getStatus(t);this.sendToAnalytics(je.CARD_VIEWED,pi.IMPRESSION,e,n)}sendCardClickedEvent(e,t,n){let o=this.getStatus(t);this.sendToAnalytics(je.CARD_CLICKED,pi.CLICK,e,o,n)}sendServiceMomentClickedEvent(e,t){let n=this.getServiceMomentMessage(e);this.sendToAnalytics(je.SERVICE_MOMENT_CLICKED,pi.CLICK,t,n,je.VIEW_USAGE_CLICKED,!0)}sendServiceMomentViewedEvent(e){let t=this.getServiceMomentMessage(e);this.sendToAnalytics(je.SERVICE_MOMENT_VIEWED,pi.IMPRESSION,null,t,null,!0)}sendToAnalytics(e,t,n,o,C,N){let P=this.setStatusCardAttributes(n,o,C,N);this.addEvent(e,t,P)}addEvent(e,t,n){let o=new Dm;o.setPrimaryCategory(Pm.PRIMARY_CATEGORY_GENERAL);
2let C=this.dataLayerService.createEventInfo(e,t,[j.MESSAGE_GROUP_STATUS_CARD]);this.dataLayerService?.addEvent(C,n,o)}setStatusCardAttributes(e,t,n,o){let C=new Am().withAttribute("itemName",o?j.SERVICE_MOMENTS:j.CARD_TYPE_USAGE).withAttribute("itemData",t);return n&&C.withAttribute("itemGroup",n),e&&C.withAttribute("destinationURL",e),C.build()}getStatus(e){if(!e?.length)return;if(e[0]?.status===me.ERROR)return me.ERROR_AND_TRY_AGAIN;let t=e.some(C=>C.severity===Ce.HIGH),n=e.some(C=>C.severity===Ce.LOW||C.severity===Ce.MEDIUM);return e.some(C=>!C.status&&C.title)?me.ALL_GOOD:t&&n?me.WARNING_AND_ERROR:t?me.ERROR:n?me.WARNING:""}getServiceMomentMessage(e){let{MOBILE:t,INTERNET:n,BUNDLE:o}=bi,{MOBILE_DATA_USAGE_EXCEEDED:C,INTERNET_DATA_USAGE_EXCEEDED:N,BUNDLE_USAGE_EXCEEDED:P}=me;if(e.includes(t))return C;if(e.includes(n))return N;if(e.includes(o))return P}static{this.\u0275fac=function(t){return new(t||i)(vt.\u0275\u0275inject(tr.DataLayerService))}}static{this.\u0275prov=vt.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();import*as B from"@angular/core";import*as or from"@angular/common";import*as rr from"@ngx-translate/core";function Fm(i,r){if(i&1&&(B.\u0275\u0275elementStart(0,"h2",10),B.\u0275\u0275text(1),B.\u0275\u0275elementEnd()),i&2){let e=B.\u0275\u0275nextContext(2);B.\u0275\u0275advance(),B.\u0275\u0275textInterpolate(e.usageWarning.subTitle)}}function km(i,r){if(i&1&&(B.\u0275\u0275elementStart(0,"div"),B.\u0275\u0275text(1),B.\u0275\u0275elementEnd()),i&2){let e=B.\u0275\u0275nextContext(2);B.\u0275\u0275advance(),B.\u0275\u0275textInterpolate(e.usageWarning.title)}}function Gm(i,r){if(i&1){let e=B.\u0275\u0275getCurrentView();B.\u0275\u0275elementStart(0,"div",11)(1,"a",12),B.\u0275\u0275listener("click",function(n){B.\u0275\u0275restoreView(e);let o=B.\u0275\u0275nextContext(2);return B.\u0275\u0275resetView(o.handleUsageAction(n,o.usageWarning.link))}),B.\u0275\u0275elementStart(2,"span"),B.\u0275\u0275text(3),B.\u0275\u0275pipe(4,"translate"),B.\u0275\u0275elementEnd()()()}if(i&2){let e=B.\u0275\u0275nextContext(2);B.\u0275\u0275advance(),B.\u0275\u0275property("href",e.getLink(e.usageWarning.link),B.\u0275\u0275sanitizeUrl),B.\u0275\u0275advance(2),B.\u0275\u0275textInterpolate(B.\u0275\u0275pipeBind1(4,2,"ng.service-status.moment.usage-action.btn"))}}function Vm(i,r){if(i&1&&(B.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3),B.\u0275\u0275element(3,"i",4),B.\u0275\u0275elementEnd(),B.\u0275\u0275elementStart(4,"div",5),B.\u0275\u0275template(5,Fm,2,1,"h2",6)(6,km,2,1,"div",7),B.\u0275\u0275elementEnd(),B.\u0275\u0275template(7,Gm,5,4,"div",8),B.\u0275\u0275elementEnd(),B.\u0275\u0275element(8,"div",9),B.\u0275\u0275elementEnd()),i&2){let e=B.\u0275\u0275nextContext();B.\u0275\u0275advance(5),B.\u0275\u0275property("ngIf",e.usageWarning.subTitle),B.\u0275\u0275advance(),B.\u0275\u0275property("ngIf",e.usageWarning.title),B.\u0275\u0275advance(),B.\u0275\u0275property("ngIf",e.getLink(e.usageWarning.link))}}var ar=(()=>{class i extends G{constructor(e,t,n,o,C){super(),this.usageStatusService=e,this.cdRef=t,this.usageStatusDataLayerService=n,this.urlService=o,this.window=C,this.lazyLoadingOutputEvent=new Rm}ngOnInit(){this.initServiceMoment()}handleUsageAction(e,t){e.preventDefault(),this.usageStatusDataLayerService.sendServiceMomentClickedEvent(this.usageWarning?.status,t),this.urlService.redirectTo(t)}getLink(e){let t=this.window.location.origin;return e&&t&&!e.includes(t)&&!e.includes("http")?t.concat(e):e}initServiceMoment(){this.obs(this.usageStatusService.getStatusCardInfo(he.MOMENT)).subscribe(e=>{let t=e.messages?.find(n=>n?.status?.includes(j.USAGE_ALREADY_EXCEEDS)&&n?.status!==j.STATUS_CARD_TYPE_ERROR);if(t){this.usageWarning=t,this.usageStatusDataLayerService.sendServiceMomentViewedEvent(t?.status),this.lazyLoadingOutputEvent.emit(!0),this.cdRef.detectChanges();return}this.lazyLoadingOutputEvent.emit(!1)})}static{this.\u0275fac=function(t){return new(t||i)(B.\u0275\u0275directiveInject(ht),B.\u0275\u0275directiveInject(B.ChangeDetectorRef),B.\u
20275\u0275directiveInject(Ct),B.\u0275\u0275directiveInject($),B.\u0275\u0275directiveInject("Window"))}}static{this.\u0275cmp=B.\u0275\u0275defineComponent({type:i,selectors:[["app-mobile-usage-service-moment"]],outputs:{lazyLoadingOutputEvent:"lazyLoadingOutputEvent"},standalone:!1,features:[B.\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[["class","cmp-service-status display--flex flex-direction--column background-color--white gap--xl--lg gap--m",4,"ngIf"],[1,"cmp-service-status","display--flex","flex-direction--column","background-color--white","gap--xl--lg","gap--m"],[1,"service-moment","background-white","display--flex","flex-direction--row--lg","flex-direction--column","align-content--space-between","p--l"],[1,"service-moment__icon","background-shape--squarcle--plm","p--m","mr--n","mr--l--lg","mb--l","mb--n--lg"],["aria-hidden","true",1,"display--flex","align-items--center","justify-content--center","icon","icon--in-bg-shape","icon-no-size-override","icon-md","icon-usage"],[1,"mr--m--lg","mr--n","mb--m","mb--n--lg","flex-grow","heading--notopmargin"],["class","heading--4 mt--n",4,"ngIf"],[4,"ngIf"],["class","align-self--flex-start align-self--center--lg",4,"ngIf"],[1,"dfd-dashboard","display--grid"],[1,"heading--4","mt--n"],[1,"align-self--flex-start","align-self--center--lg"],[1,"button",3,"click","href"]],template:function(t,n){t&1&&B.\u0275\u0275template(0,Vm,9,3,"div",0),t&2&&B.\u0275\u0275property("ngIf",n.usageWarning)},dependencies:[or.NgIf,rr.TranslatePipe],encapsulation:2,changeDetection:0})}}return i})();import{EventEmitter as jm}from"@angular/core";var Gt=(function(i){return i.INTERNET_USAGE_URL="/internet/#/nav_item=usage",i.MOBILE_USAGE_URL="/mobiele-nummers/#/nav_item=usage",i.MOBILE_USAGE_FR_URL="/numeros-mobile/#/nav_item=usage",i})(Gt||{}),He=(function(i){return i.MOBILE="mobile",i.MOBIEL="mobiel",i.INTERNET="internet",i.FRENCH="fr",i})(He||{});import*as p from"@angular/core";import*as ui from"@angular/common";var sr=(i,r)=>({"margin-bottom--lg":i,"margin-bottom--xl":r});function Hm(i,r){if(i&1&&(p.\u0275\u0275elementStart(0,"div",12),p.\u0275\u0275element(1,"span",13),p.\u0275\u0275elementEnd()),i&2){let e=p.\u0275\u0275nextContext(3);p.\u0275\u0275advance(),p.\u0275\u0275property("innerHTML",e.cardInfo.subTitle,p.\u0275\u0275sanitizeHtml)}}function Ym(i,r){if(i&1){let e=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"a",6),p.\u0275\u0275listener("click",function(n){let o=p.\u0275\u0275restoreView(e).ngIf,C=p.\u0275\u0275nextContext(2);
2return p.\u0275\u0275resetView(C.handleCardNavigation(n,o,C.cardInfo.messages))}),p.\u0275\u0275elementStart(1,"div",7)(2,"div",8),p.\u0275\u0275element(3,"wink-title",9),p.\u0275\u0275elementEnd(),p.\u0275\u0275template(4,Hm,2,1,"div",10),p.\u0275\u0275elementEnd(),p.\u0275\u0275element(5,"i",11),p.\u0275\u0275elementEnd()}if(i&2){let e=r.ngIf,t=p.\u0275\u0275nextContext(2);p.\u0275\u0275property("href",e,p.\u0275\u0275sanitizeUrl),p.\u0275\u0275advance(3),p.\u0275\u0275property("text",t.getLabel("title",null,!0)),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",t.cardInfo.subTitle)}}function $m(i,r){if(i&1&&(p.\u0275\u0275elementStart(0,"div",12),p.\u0275\u0275element(1,"span",13),p.\u0275\u0275elementEnd()),i&2){let e=p.\u0275\u0275nextContext(3);p.\u0275\u0275advance(),p.\u0275\u0275property("innerHTML",e.cardInfo.subTitle,p.\u0275\u0275sanitizeHtml)}}function Wm(i,r){if(i&1&&(p.\u0275\u0275elementStart(0,"div",14)(1,"div",8),p.\u0275\u0275element(2,"wink-title",15),p.\u0275\u0275elementEnd(),p.\u0275\u0275template(3,$m,2,1,"div",10),p.\u0275\u0275elementEnd()),i&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275property("text",e.getLabel("title",null,!0)),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.cardInfo.subTitle)}}function Km(i,r){if(i&1&&p.\u0275\u0275element(0,"div",25),i&2){let e=p.\u0275\u0275nextContext(3).$implicit;p.\u0275\u0275property("innerHTML",e.subTitle,p.\u0275\u0275sanitizeHtml)}}function zm(i,r){if(i&1){let e=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"a",19),p.\u0275\u0275listener("click",function(n){p.\u0275\u0275restoreView(e);let o=p.\u0275\u0275nextContext(2).$implicit,C=p.\u0275\u0275nextContext(3);
2return p.\u0275\u0275resetView(C.handleCardNavigation(n,C.getLink(o.link,"warning"),[o]))}),p.\u0275\u0275elementStart(1,"div",20),p.\u0275\u0275element(2,"div"),p.\u0275\u0275elementStart(3,"div",21),p.\u0275\u0275element(4,"div",22),p.\u0275\u0275template(5,Km,1,1,"div",23),p.\u0275\u0275elementEnd()(),p.\u0275\u0275element(6,"div",24),p.\u0275\u0275elementEnd()}if(i&2){let e=p.\u0275\u0275nextContext(2).$implicit,t=p.\u0275\u0275nextContext(3);p.\u0275\u0275property("href",t.getLink(e.link,"warning"),p.\u0275\u0275sanitizeUrl),p.\u0275\u0275advance(),p.\u0275\u0275property("ngClass",p.\u0275\u0275pureFunction2(7,sr,e.subTitle,!e.subTitle)),p.\u0275\u0275advance(),p.\u0275\u0275classMap(p.\u0275\u0275interpolate1("align-self--top ",e.icon||t.getIconClassBySeverity(e==null?null:e.severity))),p.\u0275\u0275advance(2),p.\u0275\u0275property("innerHTML",e.title,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.subTitle)}}function qm(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0),p.\u0275\u0275template(1,zm,7,10,"a",18),p.\u0275\u0275elementContainerEnd()),i&2){let e=p.\u0275\u0275nextContext().$implicit;p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",!(e!=null&&e.hideMessage)&&e.title)}}function Xm(i,r){if(i&1&&p.\u0275\u0275element(0,"div",25),i&2){let e=p.\u0275\u0275nextContext(2).$implicit;p.\u0275\u0275property("innerHTML",e.subTitle,p.\u0275\u0275sanitizeHtml)}}function Qm(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0,26),p.\u0275\u0275elementStart(1,"div",20),p.\u0275\u0275element(2,"div"),p.\u0275\u0275elementStart(3,"div",21),p.\u0275\u0275element(4,"div",22),p.\u0275\u0275template(5,Xm,1,1,"div",23),p.\u0275\u0275elementEnd()(),p.\u0275\u0275elementContainerEnd()),i&2){let e=p.\u0275\u0275nextContext().$implicit,t=p.\u0275\u0275nextContext(3);p.\u0275\u0275advance(),p.\u0275\u0275property("ngClass",p.\u0275\u0275pureFunction2(6,sr,e.subTitle,!e.subTitle)),p.\u0275\u0275advance(),p.\u0275\u0275classMap(p.\u0275\u0275interpolate1("align-self--top ",e.icon||t.getIconClassBySeverity(e==null?null:e.severity))),p.\u0275\u0275advance(2),p.\u0275\u0275property("innerHTML",e.title,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.subTitle)}}function Zm(i,r){if(i&1){let e=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"wink-button",28),p.\u0275\u0275listener("click",function(n){p.\u0275\u0275restoreView(e);let o=p.\u0275\u0275nextContext(2).$implicit,C=p.\u0275\u0275nextContext(3);
2return p.\u0275\u0275resetView(C.handleStatusAction(n,o.actionType,o.actionLink,[o]))}),p.\u0275\u0275element(1,"span",29),p.\u0275\u0275elementEnd()}i&2&&(p.\u0275\u0275advance(),p.\u0275\u0275property("innerHTML",r,p.\u0275\u0275sanitizeHtml))}function Jm(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0),p.\u0275\u0275conditionalCreate(1,Zm,2,1,"wink-button",27),p.\u0275\u0275elementContainerEnd()),i&2){let e,t=p.\u0275\u0275nextContext().$implicit,n=p.\u0275\u0275nextContext(3);p.\u0275\u0275advance(),p.\u0275\u0275conditional((e=t.actionType&&n.getLabel("button",t.actionType))?1:-1,e)}}function ep(i,r){if(i&1){let e=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"wink-button",31),p.\u0275\u0275listener("click",function(n){p.\u0275\u0275restoreView(e);let o=p.\u0275\u0275nextContext(2).$implicit,C=p.\u0275\u0275nextContext(3);return p.\u0275\u0275resetView(C.handleStatusAction(n,o.actionType,o.actionLink,[o]))}),p.\u0275\u0275element(1,"span",29),p.\u0275\u0275elementEnd()}if(i&2){let e=p.\u0275\u0275nextContext(2).$implicit,t=p.\u0275\u0275nextContext(3);p.\u0275\u0275property("href",t.getLink(e.actionLink,e.actionType)),p.\u0275\u0275advance(),p.\u0275\u0275property("innerHTML",r,p.\u0275\u0275sanitizeHtml)}}function ip(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0),p.\u0275\u0275conditionalCreate(1,ep,2,2,"wink-button",30),p.\u0275\u0275elementContainerEnd()),i&2){let e,t=p.\u0275\u0275nextContext().$implicit,n=p.\u0275\u0275nextContext(3);p.\u0275\u0275advance(),p.\u0275\u0275conditional((e=t.actionType&&n.getLabel("button",t.actionType))?1:-1,e)}}function tp(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0),p.\u0275\u0275template(1,qm,2,1,"ng-container",4)(2,Qm,6,9,"ng-container",5)(3,Jm,2,1,"ng-container",4)(4,ip,2,1,"ng-container",4),p.\u0275\u0275elementContainerEnd()),i&2){let e=r.$implicit;p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.link),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",!e.link&&!(e!=null&&e.hideMessage)),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.actionType==="error"),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.actionType!=="error")}}function np(i,r){if(i&1&&(p.\u0275\u0275elementContainerStart(0),p.\u0275\u0275element(1,"div",16),p.\u0275\u0275template(2,tp,5,4,"ng-container",17),p.\u0275\u0275elementContainerEnd()),i&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275property("ngForOf",e.cardInfo.messages)}}function op(i,r){if(i&1){let e=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementContainerStart(0,26),p.\u0275\u0275elementStart(1,"div",32)(2,"wink-button",33),p.\u0275\u0275listener("click",function(n){p.\u0275\u0275restoreView(e);let o=p.\u0275\u0275nextContext(2);
2return p.\u0275\u0275resetView(o.handleCardNavigation(n,o.getHoldingLink(o.usageCardHoldingLabel.INTERNET_ONLY)))}),p.\u0275\u0275text(3),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(4,"wink-button",34),p.\u0275\u0275listener("click",function(n){p.\u0275\u0275restoreView(e);let o=p.\u0275\u0275nextContext(2);return p.\u0275\u0275resetView(o.handleCardNavigation(n,o.getHoldingLink(o.usageCardHoldingLabel.MOBILE_ONLY)))}),p.\u0275\u0275text(5),p.\u0275\u0275elementEnd()(),p.\u0275\u0275elementContainerEnd()}if(i&2){let e=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(3),p.\u0275\u0275textInterpolate1(" ",e.getLabel("button",e.usageCardProducts.INTERNET)," "),p.\u0275\u0275advance(2),p.\u0275\u0275textInterpolate1(" ",e.getLabel("button",e.usageCardProducts.MOBILE)," ")}}function rp(i,r){if(i&1&&(p.\u0275\u0275elementStart(0,"div",1),p.\u0275\u0275template(1,Ym,6,3,"a",2)(2,Wm,4,2,"div",3)(3,np,3,1,"ng-container",4)(4,op,6,2,"ng-container",5),p.\u0275\u0275elementEnd()),i&2){let e=p.\u0275\u0275nextContext();p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",!e.mobileInternetProduct&&e.getLink(e.cardInfo.link)),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.mobileInternetProduct),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.cardInfo.messages==null?null:e.cardInfo.messages.length),p.\u0275\u0275advance(),p.\u0275\u0275property("ngIf",e.mobileInternetProduct)}}var lr=(()=>{class i extends G{constructor(e,t,n,o,C,N){super(),this.usageStatusService=e,this.cdRef=t,this.mobileUsageLabelService=n,this.usageStatusDataLayerService=o,this.urlService=C,this.window=N,this.lazyLoadingOutputEvent=new jm,this.mobileInternetProduct=!1,this.usageRedirectionUrls=Gt,this.usageCardProducts=He,this.usageCardHoldingLabel=ci}ngOnInit(){this.initCard()}getIconClassBySeverity(e){switch(e){case Ce.HIGH:return di.HIGH;case Ce.MEDIUM:return di.MEDIUM;case Ce.LOW:return di.LOW;default:return di.LOW}}getLabel(e,t,n){let o=this.cardInfo?.cardType;return t&&(o=`${o}-${t}`),this.mobileUsageLabelService.getLabelKey(o,e,null,he.CARD,n)}getLink(e,t){e===this.usageRedirectionUrls.MOBILE_USAGE_URL?e=this.cardInfo?.link?.includes(He.FRENCH)?this.cardInfo?.link?.concat(this.usageRedirectionUrls.MOBILE_USAGE_FR_URL):this.cardInfo?.link?.concat(this.usageRedirectionUrls.MOBILE_USAGE_URL):e===this.usageRedirectionUrls.INTERNET_USAGE_URL&&(e=this.cardInfo?.link?.concat(this.usageRedirectionUrls.INTERNET_USAGE_URL));let n=e||this.getLabel(z.LINK,t,!0),o=this.window.location.origin;return n&&o&&!n.includes(o)&&!n.includes("http")?o.concat(n):n}getHoldingLink(e){return this.mobileUsageLabelService.getLabelKey(e,z.LINK,null,he.CARD,!0)}handleCardNavigation(e,t,n,o){e?.preventDefault();let C=o||me.USAGE_PAGE_LINK;this.usageStatusDataLayerService.sendCardClickedEvent(t,n,C),e&&this.urlService.redirectTo(t)}handleStatusAction(e,t,n,o){if(e?.preventDefault(),t===j.STATUS_CARD_TYPE_ERROR){this.lazyLoadingOutputEvent.emit(j.STATUS_ERROR),this.initCard(!0),this.handleCardNavigation(null,n,o,me.ERROR_REFRESH);return}let C=this.getLink(n,t);this.handleCardNavigation(null,n,o,me.USAGE_INFO_HELP_LINK),this.urlService.redirectTo(C)}initCard(e){this.obs(this.usageStatusService.getStatusCardInfo(he.CARD,this.isMember,e)).subscribe(t=>{this.cardInfo=t;let n=this.cardInfo?.subTitle?.toLocaleLowerCase();this.mobileInternetProduct=n?.includes(He.INTERNET)&&(n?.includes(He.MOBILE)||n?.includes(He.MOBIEL)),this.cdRef.detectChanges(),this.lazyLoadingOutputEvent.emit(j.STATUS_LOADED),this.usageStatusDataLayerService.sendCardViewedEvent(this.getLink(t.link),t.messages)})}static{this.\u0275fac=function(t){return new(t||i)(p.\u0275\u0275directiveInject(ht),p.\u0275\u0275directiveInject(p.ChangeDetectorRef),p.\u0275\u0275directiveInject(_t),p.\u0275\u0275directiveInject(Ct),p.\u0275\u0275directiveInject($),p.\u0275\u0275directiveInject("Window"))}}static{this.\u0275cmp=p.\u0275\u0275defineComponent({type:i,selectors:[["app-usage-status-card"]],inputs:{isMember:"isMember"},outputs:{lazyLoadingOutputEvent:"lazyLoadingOutputEvent"},standalone:!1,features:[p.\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[["class","dfd-status-card background-white dfd-dashboard--card-1 margin-bottom--lg box box--sub",4,"ngIf"],[1,"dfd-status-card","background-white","dfd-dashboard--card-1","margin-bottom--lg","box","box--sub"],["class","dfd-status-card__item display--flex flex-direction--row gap--m justify-content--between width--full margin-bottom--md",3,"href","click",4,"ngIf"],["class","margin-bottom--none mb--s",4,"ngIf"],[4,"ngIf"],["data-cs-mask","",4,"ngIf"],[1,"dfd-status-card__item","display--flex","flex-direction--row","gap--m","justify-content--between","width--full","margin-bottom--md",3,"click","href"],[1,"margin-bottom--none"],[1,"heading--nomargin"],["html-tag","span","visual-tag","display-lg","alignment","left","data-cs-mask","",3,"text"],["class","font--caption color-shade_64","data-cs-mask","",4,"ngIf"],["aria-hidden","true",1,"icon","icon-chevron-right"],["data-cs-mask","",1,"font--caption","color-shade_64"],[1,"text--s",3,"innerHTML"],[1,"margin-bottom--none","mb--s"],["html-tag","span","visual-tag","display-lg","alignment","left","data-cs-mask","",1,"mt--n","mb--n",3,"text"],[1,"divi
2der","divider--s__very-light-grey","mb--m"],[4,"ngFor","ngForOf"],["class","dfd-status-card__item display--flex flex-direction--row gap--m justify-content--between width--full margin-bottom--none",3,"href","click",4,"ngIf"],[1,"dfd-status-card__item","display--flex","flex-direction--row","gap--m","justify-content--between","width--full","margin-bottom--none",3,"click","href"],["data-cs-mask","",1,"display--flex","flex-direction--row","justify-content--start","width--full","gap--md",3,"ngClass"],[1,"align-self--center"],[1,"font--body-small-bold",3,"innerHTML"],["class","font--body-small",3,"innerHTML",4,"ngIf"],[1,"icon","icon-chevron-right","align-self--top"],[1,"font--body-small",3,"innerHTML"],["data-cs-mask",""],["theme","light","appearance","secondary","size","sm","status","none","element","button","type","button","pointer-event","auto","width","full","icon","arrow-counterclockwise-down","icon-position","left",1,"white-space--nowrap","mb--s"],["theme","light","appearance","secondary","size","sm","status","none","element","button","type","button","pointer-event","auto","width","full","icon","arrow-counterclockwise-down","icon-position","left",1,"white-space--nowrap","mb--s",3,"click"],[3,"innerHTML"],["theme","light","appearance","secondary","size","sm","status","none","element","button","type","button","pointer-event","auto","width","full",1,"white-space--nowrap","mb--s",3,"href"],["theme","light","appearance","secondary","size","sm","status","none","element","button","type","button","pointer-event","auto","width","full",1,"white-space--nowrap","mb--s",3,"click","href"],[1,"display--flex--lg","gap--md","margin-bottom--md"],["theme","light","appearance","secondary","size","sm","width","full-mobile","status","none","element","button","type","button","pointer-event","auto",1,"white-space--nowrap","margin-right--none",3,"click"],["theme","light","appearance","secondary","size","sm","width","full-mobile","status","none","element","button","type","button","pointer-event","auto",1,"white-space--nowrap","margin-top--xs","margin-top--none--lg",3,"click"]],template:function(t,n){t&1&&p.\u0275\u0275template(0,rp,5,4,"div",0),t&2&&p.\u0275\u0275property("ngIf",n.cardInfo)},dependencies:[ui.NgClass,ui.NgForOf,ui.NgIf,$e],encapsulation:2})}}return i})();import{provideHttpClient as pp}from"@angular/common/http";import*as bt from"@angular/core";var _E=(()=>{class i{static{this.components={"tg-barrings":Mn,"tg-mobile-usage-overview":fo,"tg-mobile-usage-limits":No,"tg-mobile-usage-notifications":zo,"tg-third-party-services":Zo,"tg-usage-status-card":lr,"tg-usage-service-moment":ar}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=bt.\u0275\u0275defineNgModule({type:i})}static{this.\u0275inj=bt.\u0275\u0275defineInjector({providers:[pp()],imports:[ap,sn,sp,dn,en,dp,mp,lp,cp,Se,un,Qt.forRoot(on.imagePath),se,Ee,Bi,$e]})}}return i})();export{_E as CareMobileNcModule};
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.