PageSourceSearch

https://www.costco.co.uk/spartacus/assets/chunk-7XSOZUTK.js

js costco.co.uk collected 2026-10-02 03:50:06 UTC 120,710 bytes, 2 lines download raw bytes

1import{a as ii}from"./chunk-T2C72SUQ.js";import{a as jn}from"./chunk-EMG7GVNH.js";import{f as Vn}from"./chunk-6QDM7Q5V.js";import{a as $n}from"./chunk-XPXABRQ4.js";import{a as On}from"./chunk-OMXPTFCM.js";import{c as de}from"./chunk-BEHWAJ2I.js";import{a as Bn,b as Un}from"./chunk-DZFR5FMO.js";import{B as Pn,x as Nn}from"./chunk-BNJC75RQ.js";import{$ as ei,B as xt,Ga as ze,H as _n,Ha as St,I as Xt,J as fn,Ja as Tn,K as vt,Ka as In,M as hn,N as Cn,O as $e,Oa as En,P as xn,Pa as An,Q as He,Qa as wn,R as Je,Ra as Ln,S as G,Sa as kn,Ta as Dn,Wa as bt,Xa as Rn,_ as ke,aa as Xe,ba as vn,ca as ti,cb as Mn,da as Sn,e as ye,g as pe,i as Te,j as we,m as un,n as pn,o as dn,ob as Fn,p as gn,pa as bn,q as Le,t as Jt,u as Ve,x as je,xa as yn}from"./chunk-BTU2RJ7F.js";import{$b as te,Ab as Fi,Ac as l,Ae as Zi,Bc as ut,Be as Ji,C as Ai,Ca as R,Da as Y,De as Xi,Dh as ht,Ec as O,Ee as ve,Eh as Ct,Fa as $t,Fe as Oe,Ff as X,G as wi,Gc as Pi,Gf as be,H as N,Hf as qt,Ib as m,Ja as h,Jb as p,Je as en,K as fe,Ka as C,Kb as T,Kd as Ee,Lb as E,Lc as Vi,Ld as xe,Mb as A,Md as ue,Me as Ae,N as he,Na as Fe,Nb as zt,Nd as Wi,Ne as dt,Ob as y,Od as Qi,Oe as Ze,P as Li,Pe as gt,R as U,Rb as x,Rd as Wt,Sd as Ki,Tb as d,Tc as ji,Td as Qt,Te as J,Tg as Yt,U as ct,Ua as Ht,Ud as qi,Ue as Kt,Wb as F,Xc as $i,Y as ki,Yc as Ue,Zc as P,_ as Di,a as ae,ac as ie,bb as Mi,bc as ne,cc as k,cd as Hi,cf as tn,cg as sn,d as ee,dc as f,dd as z,df as nn,eb as mt,ec as D,ef as oe,eg as an,fb as s,fc as b,ga as Ri,gb as S,gc as Bi,hf as Ne,i as Ti,if as Pe,jc as Ui,ka as Ie,kc as Oi,kd as re,kh as Zt,lc as Ni,lh as mn,me as pt,na as K,nf as _t,o as Ii,od as Gt,p as W,pd as Ye,pe as Yi,qc as ce,rc as Ce,re as Z,rf as rn,s as Ei,sa as L,sb as Be,sg as cn,ta as q,td as zi,tf as on,tg as ln,ua as lt,ub as g,ud as Gi,uf as Se,uh as B,v as M,va as v,vb as w,vh as ft,w as me,wa as Me,wb as u,yb as j,z as jt,zc as c,ze as V}from"./chunk-ZIECK5QA.js";import{a as se,b as st,l as yi,m as at}from"./chunk-3JMZ37NM.js";var Qe=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=L({token:i,factory:function(n){let o=null;return n?o=new(n||i):o=v(pt),o},providedIn:"root"});let e=i;return e})(),Ge="asm_enabled",Tt=(()=>{let i=class i{constructor(t,n,o,a){this.location=t,this.winRef=n,this.launchDialogService=o,this.featureModules=a}load(){this.isEnabled()&&this.addUi()}isEnabled(){return this.isLaunched()&&!this.isUsedBefore()&&this.winRef.localStorage&&this.winRef.localStorage.setItem(Ge,"true"),this.isLaunched()||this.isUsedBefore()||this.isEmulateInURL()}isLaunched(){let t=this.location.path().split("?")[1];return!!t&&t.split("&").includes("asm=true")}isEmulateInURL(){return this.location.path().indexOf("assisted-service/emulate?")>0}isUsedBefore(){return this.winRef.localStorage?this.winRef.localStorage.getItem(Ge)==="true":!1}addUi(){this.featureModules.resolveFeature("asm").subscribe(()=>this.launchDialogService.launch("ASM"))}};i.\u0275fac=function(n){return new(n||i)(v(ji),v(Ae),v(G),v(ht))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),yr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[{provide:Pi,useFactory:Tr,deps:[Tt],multi:!0}],imports:[re,bn]});let e=i;return e})();function Tr(e){return()=>{e.load()}}var le=function(e){return e.START_SESSION="START_SESSION",e.ORDER_HISTORY="ORDER_HISTORY",e.ACTIVE_CART="ACTIVE_CART",e}(le||{}),Ir={asm:{agentSessionTimer:{startingDelayInSeconds:600},customerSearch:{maxResults:20},customerList:{pageSize:5,showAvatar:!0,columns:[{headerLocalizationKey:"asm.customerList.tableHeader.customer",renderer:e=>e?.name??"",actionType:le.START_SESSION},{headerLocalizationKey:"asm.customerList.tableHeader.email",renderer:e=>e?.uid??""},{headerLocalizationKey:"asm.customerList.tableHeader.phone",renderer:e=>e?.defaultAddress?.phone??""},{headerLocalizationKey:"asm.customerList.tableHeader.account",renderer:e=>e?.orgUnit?.name??""},{headerLocalizationKey:"asm.customerList.tableHeader.cart",icon:{symbol:ke.CART,captionLocalizationKey:"asm.customerList.tableHeader.cart"},actionType:le.ACTIVE_CART},{headerLocalizationKey:"asm.customerList.tableHeader.order",icon:{symbol
1:ke.ORDER,captionLocalizationKey:"asm.customerList.tableHeader.order"},actionType:le.ORDER_HISTORY}]},userIdHttpHeader:{enable:!0}}},Er=(()=>{let i=class i{constructor(t,n,o){this.config=t,this.userIdService=n,this.userIdConstants=o,this.userIdHeader="sap-commerce-cloud-user-id",this.uniqueUserIdConstants=new Set(Object.values(o))}intercept(t,n){if(!this.config.asm?.userIdHttpHeader?.enable)return n.handle(t);let o=t.context.get(cn),a;if(typeof o.sendUserIdAsHeader=="string")a=W(o.sendUserIdAsHeader);else if(o.sendUserIdAsHeader)a=this.userIdService.takeUserId().pipe(M(_=>this.uniqueUserIdConstants.has(_)?void 0:_));else return n.handle(t);return a.pipe(he(_=>{if(_){let I=t.clone({headers:t.headers.set(this.userIdHeader,_)});return n.handle(I)}else return n.handle(t)}))}};i.\u0275fac=function(n){return new(n||i)(v(pt),v(Oe),v(ln))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),ge=function(e){return e.CSAgent="CSAgent",e.User="User",e}(ge||{}),et=(()=>{let i=class i extends Ze{constructor(){super(...arguments),this._tokenTarget$=new ee(ge.User)}getTokenTarget(){return this._tokenTarget$}setTokenTarget(t){this._tokenTarget$.next(t)}getEmulatedUserToken(){return this.emulatedUserToken}setEmulatedUserToken(t){this.emulatedUserToken=t}switchTokenTargetToCSAgent(){this._tokenTarget$.next(ge.CSAgent)}switchTokenTargetToUser(){this._tokenTarget$.next(ge.User)}clearEmulatedUserToken(){this.emulatedUserToken=void 0}};i.\u0275fac=(()=>{let t;return function(o){return(t||(t=Fe(i)))(o||i)}})(),i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Ke=(()=>{let i=class i{constructor(t,n,o,a,_,I){this.authService=t,this.authStorageService=n,this.userIdService=o,this.oAuthLibWrapperService=a,this.store=_,this.userAccountFacade=I}authorizeCustomerSupportAgent(t,n){return at(this,null,function*(){let o,a;this.userAccountFacade.get().subscribe(_=>a=_?.customerId).unsubscribe(),this.authStorageService.getToken().subscribe(_=>o=_).unsubscribe(),this.authStorageService.switchTokenTargetToCSAgent();try{yield this.oAuthLibWrapperService.authorizeWithPasswordFlow(t,n),this.store.dispatch(new ve.Logout),a!==void 0&&o!==void 0?(this.userIdService.setUserId(a),this.authStorageService.setEmulatedUserToken(o),this.store.dispatch(new ve.Login)):(this.userIdService.setUserId(Ji),this.authStorageService.clearEmulatedUserToken())}catch{this.authStorageService.switchTokenTargetToUser()}})}startCustomerEmulationSession(t){this.authStorageService.clearEmulatedUserToken(),this.store.dispatch(new ve.Logout),this.userIdService.setUserId(t),this.store.dispatch(new ve.Login)}isCustomerSupportAgentLoggedIn(){return me([this.authStorageService.getToken(),this.authStorageService.getTokenTarget()]).pipe(M(([t,n])=>!!(t?.access_token&&n===ge.CSAgent)))}isCustomerEmulated(){return this.userIdService.isEmulated()}getCustomerSupportAgentTokenLoading(){return W(!1)}logoutCustomerSupportAgent(){return at(this,null,function*(){let t=this.authStorageService.getEmulatedUserToken(),n;this.userIdService.isEmulated().subscribe(o=>n=o).unsubscribe(),yield this.oAuthLibWrapperService.revokeAndLogout(),this.store.dispatch({type:"[Auth] Logout Customer Support Agent"}),this.authStorageService.setTokenTarget(ge.User),n&&t?(this.store.dispatch(new ve.Logout),this.authStorageService.setToken(t),this.userIdService.setUserId(Zi),this.authStorageService.clearEmulatedUserToken(),this.store.dispatch(new ve.Login)):this.authService.logout()})}};i.\u0275fac=function(n){return new(n||i)(v(oe),v(et),v(Oe),v(dt),v(Ee),v(de))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Ar=(()=>{let i=class i extends qt{constructor(t,n,o,a,_,I,$,H){super(t,n,a,_,$,I,H),this.authService=t,this.authStorageService=n,this.csAgentAuthService=o,this.oAuthLibWrapperService=a,this.routingService=_,this.globalMessageService=I,this.occEndpointsService=$,this.authRedirectService=H}shouldAddAuthorizationHeader(t){return super.shouldAddAuthorizationHeader(t)||this.isCSAgentTokenRequest(t)}shouldCatchError(t){return super.shouldCatchError(t)||this.isCSAgentTokenRequest(t)}
1alterRequest(t,n){let o=!!this.getAuthorizationHeader(t),a=this.isCSAgentTokenRequest(t),_=super.alterRequest(t,n);return!o&&a?(_=t.clone({setHeaders:se({},this.createAuthorizationHeader(n))}),Pe.removeHeader(Ne,_)):_}isCSAgentTokenRequest(t){return!!Pe.getInterceptorParam(Ne,t.headers)}handleExpiredRefreshToken(){this.csAgentAuthService.isCustomerSupportAgentLoggedIn().pipe(U(1)).subscribe(t=>{t?(this.authService.setLogoutProgress(!0),this.csAgentAuthService.logoutCustomerSupportAgent(),this.globalMessageService.add({key:"asm.csagentTokenExpired"},X.MSG_TYPE_ERROR)):super.handleExpiredRefreshToken()})}};i.\u0275fac=function(n){return new(n||i)(v(oe),v(Ze),v(Ke),v(dt),v(J),v(be),v(_t),v(Kt))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),wr=(()=>{let i=class i extends oe{constructor(t,n,o,a,_,I,$,H){super(t,n,o,a,_,$,H),this.store=t,this.userIdService=n,this.oAuthLibWrapperService=o,this.authStorageService=a,this.authRedirectService=_,this.globalMessageService=I,this.routingService=$,this.authMultisiteIsolationService=H}canUserLogin(){let t,n;return this.authStorageService.getToken().subscribe(o=>n=o).unsubscribe(),this.authStorageService.getTokenTarget().subscribe(o=>t=o).unsubscribe(),!(n?.access_token&&t===ge.CSAgent)}warnAboutLoggedCSAgent(){this.globalMessageService.add({key:"asm.auth.agentLoggedInError"},X.MSG_TYPE_ERROR)}loginWithCredentials(t,n){return at(this,null,function*(){this.canUserLogin()?yield yi(i.prototype,this,"loginWithCredentials").call(this,t,n):this.warnAboutLoggedCSAgent()})}loginWithRedirect(){return this.canUserLogin()?(super.loginWithRedirect(),!0):(this.warnAboutLoggedCSAgent(),!1)}coreLogout(){return Ei(this.userIdService.isEmulated().pipe(U(1),Ie(t=>t?(this.authStorageService.clearEmulatedUserToken(),this.userIdService.clearUserId(),this.store.dispatch(new ve.Logout),W(!0)):Ii(super.coreLogout()))))}isUserLoggedIn(){return me([this.authStorageService.getToken(),this.userIdService.isEmulated(),this.authStorageService.getTokenTarget()]).pipe(M(([t,n,o])=>!!t?.access_token&&(o===ge.User||o===ge.CSAgent&&n)))}};i.\u0275fac=function(n){return new(n||i)(v(Ee),v(Oe),v(dt),v(et),v(Kt),v(be),v(J),v(nn))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Ka=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[Z(Ir),{provide:Ze,useExisting:et},{provide:oe,useExisting:wr},{provide:qt,useExisting:Ar},{provide:Gi,useExisting:Er,multi:!0}],imports:[yr]});let e=i;return e})(),oi="asm",It=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=L({token:i,factory:()=>Ct({facade:i,feature:oi,methods:["bindCart"]}),providedIn:"root"});let e=i;return e})(),Et=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=L({token:i,factory:()=>Ct({facade:i,feature:oi,methods:["createCustomer"]}),providedIn:"root"});let e=i;return e})(),At=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=L({token:i,factory:()=>Ct({facade:i,feature:oi,methods:["getCustomerLists","getCustomerListsState","customerListCustomersSearch","getCustomerListCustomersSearchResults","getCustomerListCustomersSearchResultsLoading","customerListCustomersSearchReset","getCustomerListCustomersSearchResultsError"]}),providedIn:"root"});let e=i;return e})(),Hn=(()=>{let i=class i{constructor(t,n,o){this.routingService=t,this.winRef=n,this.asmEnablerService=o,this.searchParams=new URLSearchParams(this.winRef?.location?.search)}isEmulateInURL(){return this.asmEnablerService?.isEmulateInURL()||!1}getSearchParameter(t){return this.searchParams.get(t)??void 0}handleNavigation(t=this.getParamsInUrl()){t.cartType==="active"?this.routingService.go({cxRoute:"cart"}):t.cartType==="saved"&&t.cartId?this.routingService.go("my-account/saved-cart/"+t.cartId):t.orderId?this.routingService.go({cxRoute:"orderDetails",params:{code:t.orderId}}):t.ticketId&&this.routingService.go({cxRoute:"supportTicketDetails",params:{ticketCode:t.ticketId}})}getParamsInUrl(){let t={customerId:this.getSearchParameter("customerId"),orderId:this.getSearchParameter("orderId"),ticketId:this.getSearchParameter("ticketId"),cartId:this.getSearchParameter("cartId"),cartType:this.getSearchParameter("cartType")};
1return Object.fromEntries(Object.entries(t).filter(([n,o])=>!!o))}};i.\u0275fac=function(n){return new(n||i)(v(J),v(Ae),v(Tt))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var si=function(e){return e.NAVIGATE="NAVIGATE",e}(si||{});var tt=class{},nt=(()=>{let i=class i{constructor(t){this.asmAdapter=t}customerSearch(t){return this.asmAdapter.customerSearch(t)}customerLists(){return this.asmAdapter.customerLists()}bindCart(t){return this.asmAdapter.bindCart(t)}createCustomer(t){return this.asmAdapter.createCustomer(t)}};i.\u0275fac=function(n){return new(n||i)(v(tt))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Qn=new lt("CustomerSearchPageNormalizer"),Kn=new lt("CustomerListsNormalizer"),zn=(()=>{let i=class i{constructor(t,n,o){this.commandService=t,this.asmConnector=n,this.userAccountFacade=o,this.bindCartCommand$=this.commandService.create(a=>this.userAccountFacade.get().pipe(M(_=>{if(_?.uid)return _.uid;throw new Error("No identifier for authenticated user found.")}),U(1),he(_=>this.asmConnector.bindCart({cartId:a,customerId:_}))))}bindCart(t){return this.bindCartCommand$.execute(t)}};i.\u0275fac=function(n){return new(n||i)(v(Zt),v(nt),v(de))},i.\u0275prov=L({token:i,factory:i.\u0275fac});let e=i;return e})(),Gn=(()=>{let i=class i{constructor(t,n){this.asmConnector=t,this.command=n,this.createCustomerCommand=this.command.create(({user:o})=>this.asmConnector.createCustomer(o))}createCustomer(t){return this.createCustomerCommand.execute({user:t})}};i.\u0275fac=function(n){return new(n||i)(v(nt),v(Zt))},i.\u0275prov=L({token:i,factory:i.\u0275fac});let e=i;return e})(),ci="[Asm] UI Update",it=class{constructor(i){this.payload=i,this.type=ci}},qn="asm",rt="[asm] Customer search data",ot="[asm] Customer list customers search data",li="[Asm] Customer Search",Yn="[Asm] Customer Search Fail",Zn="[Asm] Customer Search Success",Jn="[Asm] Customer Search Reset",mi="[Asm] Customer List Customers Search",Xn="[Asm] Customer List Customers Search Fail",er="[Asm] Customer List Customers Search Success",tr="[Asm] Customer List Customers Search Reset",Lt=class extends V.LoaderLoadAction{constructor(i){super(rt),this.payload=i,this.type=li}},kt=class extends V.LoaderFailAction{constructor(i){super(rt),this.payload=i,this.type=Yn}},Dt=class extends V.LoaderSuccessAction{constructor(i){super(rt),this.payload=i,this.type=Zn}},Rt=class extends V.LoaderResetAction{constructor(){super(rt),this.type=Jn}},Mt=class extends V.LoaderLoadAction{constructor(i){super(ot),this.payload=i,this.type=mi}},Ft=class extends V.LoaderFailAction{constructor(i){super(ot),this.payload=i,this.type=Xn}},Bt=class extends V.LoaderSuccessAction{constructor(i){super(ot),this.payload=i,this.type=er}},Ut=class extends V.LoaderResetAction{constructor(){super(ot),this.type=tr}},ui="[Auth] Logout Customer Support Agent",ai=class{constructor(){this.type=ui}},lc=Object.freeze({__proto__:null,ASM_UI_UPDATE:ci,AsmUiUpdate:it,CUSTOMER_LIST_CUSTOMERS_SEARCH:mi,CUSTOMER_LIST_CUSTOMERS_SEARCH_FAIL:Xn,CUSTOMER_LIST_CUSTOMERS_SEARCH_RESET:tr,CUSTOMER_LIST_CUSTOMERS_SEARCH_SUCCESS:er,CUSTOMER_SEARCH:li,CUSTOMER_SEARCH_FAIL:Yn,CUSTOMER_SEARCH_RESET:Jn,CUSTOMER_SEARCH_SUCCESS:Zn,CustomerListCustomersSearch:Mt,CustomerListCustomersSearchFail:Ft,CustomerListCustomersSearchReset:Ut,CustomerListCustomersSearchSuccess:Bt,CustomerSearch:Lt,CustomerSearchFail:kt,CustomerSearchReset:Rt,CustomerSearchSuccess:Dt,LOGOUT_CUSTOMER_SUPPORT_AGENT:ui,LogoutCustomerSupportAgent:ai}),Lr=(()=>{let i=class i{constructor(t,n){this.actions$=t,this.asmConnector=n,this.logger=Me(gt),this.customerSearch$=Wt(()=>this.actions$.pipe(Qt(li),M(o=>o.payload),Ie(o=>this.asmConnector.customerSearch(o).pipe(M(a=>new Dt(a)),fe(a=>W(new kt(Se(a,this.logger)))))))),this.customerListCustomersSearch$=Wt(()=>this.actions$.pipe(Qt(mi),M(o=>o.payload),Ie(o=>this.asmConnector.customerSearch(o).pipe(M(a=>new Bt(a)),fe(a=>W(new Ft(Se(a,this.logger))))))))}};i.\u0275fac=function(n){return new(n||i)(v(Ki),v(nt))},i.\u0275prov=L({token:i,factory:i.\u0275fac});let e=i;return e})(),kr=[Lr],Dr={collapsed:!1};
1function Rr(e=Dr,i){switch(i.type){case ci:return se(se({},e),i.payload);default:return e}}function Mr(){return{customerSearchResult:V.loaderReducer(rt),customerListCustomersSearchResult:V.loaderReducer(ot),asmUi:Rr}}var ir=new lt("AsmReducers"),Fr={provide:ir,useFactory:Mr};function Br(e){return function(i,r){return r.type===ui&&(i=st(se({},i),{customerSearchResult:{}})),e(i,r)}}var Ur=[Br],Ot=Wi(qn),pi=ue(Ot,e=>e.asmUi),di=ue(Ot,e=>e.customerSearchResult),nr=ue(di,e=>V.loaderValueSelector(e)),rr=ue(di,e=>V.loaderLoadingSelector(e)),Nt=ue(Ot,e=>e.customerListCustomersSearchResult),or=ue(Nt,e=>V.loaderValueSelector(e)),sr=ue(Nt,e=>V.loaderLoadingSelector(e)),ar=ue(Nt,e=>V.loaderErrorSelector(e)),mc=Object.freeze({__proto__:null,getAsmState:Ot,getAsmUi:pi,getCustomerListCustomersSearchResults:or,getCustomerListCustomersSearchResultsError:ar,getCustomerListCustomersSearchResultsLoaderState:Nt,getCustomerListCustomersSearchResultsLoading:sr,getCustomerSearchResults:nr,getCustomerSearchResultsLoaderState:di,getCustomerSearchResultsLoading:rr}),Wn=(()=>{let i=class i{constructor(t,n,o){this.queryService=t,this.asmConnector=n,this.store=o,this.customerListQuery$=this.queryService.create(()=>this.asmConnector.customerLists(),{reloadOn:void 0,resetOn:void 0})}getCustomerLists(){return this.customerListQuery$.get()}getCustomerListsState(){return this.customerListQuery$.getState()}customerListCustomersSearch(t){this.store.dispatch(new Mt(t))}getCustomerListCustomersSearchResults(){return this.store.pipe(xe(or))}getCustomerListCustomersSearchResultsLoading(){return this.store.pipe(xe(sr))}customerListCustomersSearchReset(){this.store.dispatch(new Ut)}getCustomerListCustomersSearchResultsError(){return this.store.pipe(xe(ar))}};i.\u0275fac=function(n){return new(n||i)(v(mn),v(nt),v(Ee))},i.\u0275prov=L({token:i,factory:i.\u0275fac});let e=i;return e})(),Or=[Wn,{provide:At,useExisting:Wn},zn,{provide:It,useExisting:zn},Gn,{provide:Et,useExisting:Gn}],Nr=(()=>{let i=class i{constructor(t,n,o){this.statePersistenceService=t,this.store=n,this.authStorageService=o,this.subscription=new ae,this.key="asm"}initSync(){this.subscription.add(this.statePersistenceService.syncWithStorage({key:this.key,state$:this.getAsmState(),onRead:t=>this.onRead(t)}))}getAsmState(){return me([this.store.pipe(N(t=>!!t.asm),xe(pi)),W(this.authStorageService.getEmulatedUserToken()),this.authStorageService.getTokenTarget()]).pipe(M(([t,n,o])=>{let a=n;return a&&(a=se({},n),delete a.refresh_token),{ui:t,emulatedUserToken:a,tokenTarget:o}}))}onRead(t){t&&(t.ui&&this.store.dispatch(new it(t.ui)),t.emulatedUserToken&&this.authStorageService.setEmulatedUserToken(t.emulatedUserToken),t.tokenTarget&&this.authStorageService.setTokenTarget(t.tokenTarget))}ngOnDestroy(){this.subscription.unsubscribe()}};i.\u0275fac=function(n){return new(n||i)(v(rn),v(Ee),v(et))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Pr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[Fr],imports:[re,on,Qi.forFeature(qn,ir,{metaReducers:Ur}),qi.forFeature(kr)]});let e=i;return e})();function Vr(e){return()=>e.initSync()}var cr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[nt,{provide:sn,useFactory:Vr,deps:[Nr],multi:!0},...Or],imports:[re,Pr]});let e=i;return e})(),qe=(()=>{let i=class i{constructor(t){this.store=t}customerSearch(t){this.store.dispatch(new Lt(t))}customerSearchReset(){this.store.dispatch(new Rt)}getCustomerSearchResults(){return this.store.pipe(xe(nr))}getCustomerSearchResultsLoading(){return this.store.pipe(xe(rr))}updateAsmUiState(t){this.store.dispatch(new it(t))}getAsmUiState(){return this.store.pipe(xe(pi))}};i.\u0275fac=function(n){return new(n||i)(v(Ee))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Q=function(e){return e[e.ASC=1]="ASC",e[e.DESC=-1]="DESC",e}(Q||{});function jr(e=Q.ASC){return(i,r)=>i===r?0:(i===!0?-1:1)*e}var uc=jr(Q.ASC);function $r(e=Q.ASC){return(i,r)=>i===r?0:(i<r?-1:1)*e}var pc=$r(Q.ASC);function lr(e=Q.ASC){return(i,r)=>{let t=i==null,n=r==null;return t===n?0:(t?-1:1)*e}}var dc=lr(Q.ASC),gc=lr(Q.DESC);function mr(e=Q.ASC){return(i,r)=>i===r?0:(i-r<0?-1:1)*e}var _c=mr(Q.ASC),fc=mr(Q.DESC);function Hr(e=Q.ASC,i,r){return(t,n)=>(t??"").localeCompare(n??"",i,r)*e}var hc=Hr(Q.ASC);function Gr(e,i){if(e&1){let r=y();m(0,"cx-message",16),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d(2);return C(n.closeDialogAlert())}),p()}if(e&2){let r=d(2);u("text",l(1,2,"asm.saveCart.dialog.saveInfo"))("type",r.globalMessageType.MSG_TYPE_INFO)}}function Wr(e,i){if(e&1&&(E(0),m(1,"div",14),g(2,Gr,2,4,"cx-message",15),c(3,"async"),p(),A()),e&2){let r=d();s(2),u("ngIf",l(3,1,r.showDialogAlert$))}}function Qr(e,i){if(e&1){let r=y();m(0,"cx-message",16),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d(2);return C(n.closeDialogAlert())}),p()}if(e&2){let r=d(2);u("text",l(1,2,"asm.saveCart.dialog.disableInfo"))("type",r.globalMessageType.MSG_TYPE_WARNING)}}function Kr(e,i){if(e&1&&(m(0,"div",14),g(1,Qr,2,4,"cx-message",15),c(2,"async"),p()),e&2){let r=d();s(),u("ngIf",l(2,1,r.showDialogAlert$))}}var qr=["bindToCart"],Yr=["saveInactiveCart"];function Zr(e,i){if(e&1){let r=y();m(0,"button",10,1),c(2,"async"),c(3,"async"),c(4,"async"),x("click",function(){h(r);let n=d();return C(n.bindCartToCustomer())}),m(5,"span"),c(6,"async"),f(7),c(8,"cxTranslate"),p(),T(9,"cx-dot-spinner"),c(10,"async"),c(11,"cxTranslate"),p()}if(e&2){let r=d();j("cx-asm-active",l(2,9,r.valid$))("cx-bind-loading",l(3,11,r.loading$)),u("disabled",!l(4,13,r.valid$)),s(5),w("aria-hidden",l(6,15,r.loading$)),s(2),b(" ",l(8,17,"asm.bindCart.bindCartToCustomer")," "),s(2),w("aria-hidden",!l(10,19,r.loading$))("aria-label",l(11,21,"common.loading"))}}
1function Jr(e,i){if(e&1){let r=y();m(0,"button",11,2),c(2,"async"),x("click",function(){h(r);let n=d();return C(n.onSaveInactiveCart())}),m(3,"span"),c(4,"async"),f(5),c(6,"cxTranslate"),p(),T(7,"cx-dot-spinner"),c(8,"async"),c(9,"cxTranslate"),p()}if(e&2){let r=d();j("cx-bind-loading",l(2,6,r.loading$)),s(3),w("aria-hidden",l(4,8,r.loading$)),s(2),b(" ",l(6,10,"asm.saveCart.saveCartBtn")," "),s(2),w("aria-hidden",!l(8,12,r.loading$))("aria-label",l(9,14,"common.loading"))}}function Xr(e,i){if(e&1){let r=y();m(0,"cx-message",14),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d();return C(n.closeDialogInfoAlert())}),p()}if(e&2){let r=d();u("text",l(1,2,"asm.createCustomerForm.createAccountAlert"))("type",r.globalMessageType.MSG_TYPE_INFO)}}function eo(e,i){if(e&1){let r=y();m(0,"cx-message",14),x("closeMessage",function(){h(r);let n=d().index,o=d();return C(o.closeDialogBackendErroAlert(n))}),p()}if(e&2){let r=d().$implicit,t=d();u("text",r)("type",t.globalMessageType.MSG_TYPE_ERROR)}}function to(e,i){if(e&1&&(E(0),g(1,eo,1,2,"cx-message",8),A()),e&2){let r=i.index,t=d();s(),u("ngIf",t.showDialogBackendErrorAlerts[r])}}function io(e,i){if(e&1&&(m(0,"div")(1,"div",15)(2,"label")(3,"span",16),f(4),c(5,"cxTranslate"),p(),T(6,"input",17),c(7,"cxTranslate"),T(8,"cx-form-errors",18),p()(),m(9,"div",15)(10,"label")(11,"span",16),f(12),c(13,"cxTranslate"),p(),T(14,"input",19),c(15,"cxTranslate"),T(16,"cx-form-errors",18),p()(),m(17,"div",15)(18,"label")(19,"span",16),f(20),c(21,"cxTranslate"),p(),T(22,"input",20),c(23,"cxTranslate"),T(24,"cx-form-errors",18),p()()()),e&2){let r=d();s(4),D(l(5,9,"asm.createCustomerForm.firstName.label")),s(2),F("placeholder",l(7,11,"asm.createCustomerForm.firstName.placeholder")),s(2),u("control",r.registerForm.get("firstName")),s(4),D(l(13,13,"asm.createCustomerForm.lastName.label")),s(2),F("placeholder",l(15,15,"asm.createCustomerForm.lastName.placeholder")),s(2),u("control",r.registerForm.get("lastName")),s(4),D(l(21,17,"asm.createCustomerForm.emailAddress.label")),s(2),F("placeholder",l(23,19,"asm.createCustomerForm.emailAddress.placeholder")),s(2),u("control",r.registerForm.get("email"))}}function no(e,i){e&1&&(m(0,"div",21),T(1,"cx-spinner"),p())}function ro(e,i){if(e&1){let r=y();m(0,"form",2),x("ngSubmit",function(){h(r);let n=d();return C(n.onSubmit())}),m(1,"label"),T(2,"input",3),c(3,"cxTranslate"),c(4,"cxTranslate"),T(5,"cx-form-errors",4),p(),m(6,"label"),T(7,"input",5),c(8,"cxTranslate"),c(9,"cxTranslate"),T(10,"cx-form-errors",4),p(),m(11,"button",6),f(12),c(13,"cxTranslate"),p()()}if(e&2){let r=d();u("formGroup",r.csAgentLoginForm),s(2),F("placeholder",l(3,8,"asm.loginForm.userId.label")),w("aria-label",l(4,10,"asm.loginForm.userId.label")),s(3),u("control",r.csAgentLoginForm.get("userId")),s(2),F("placeholder",l(8,12,"asm.loginForm.password.label")),w("aria-label",l(9,14,"asm.loginForm.password.label")),s(3),u("control",r.csAgentLoginForm.get("password")),s(2),b(" ",l(13,16,"asm.loginForm.submit")," ")}}function oo(e,i){e&1&&(T(0,"cx-dot-spinner",7),c(1,"cxTranslate")),e&2&&w("aria-label",l(1,1,"common.loading"))}var so=["resultList"],ao=["searchTerm"],co=["createCustomerLink"],lo=["searchResultItem"];function mo(e,i){if(e&1){let r=y();m(0,"button",12,2),x("keydown.arrowup",function(n){h(r);let o=d(2);return C(o.focusPreviousChild(n))})("keydown.arrowdown",function(n){h(r);let o=d(2);return C(o.focusNextChild(n))})("keydown.arrowright",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.arrowleft",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.enter",function(n){let o=h(r).$implicit,a=d(2);return C(a.selectCustomerFromList(n,o))})("keydown.escape",function(n){h(r);let o=d(2);return C(o.closeResults(n))})("keydown.home",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.end",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("click",function(n){let o=h(r).$implicit,a=d(2);return C(a.selectCustomerFromList(n,o))}),m(2,"span",13),f(3),p(),m(4,"span",14),f(5),p()()}if(e&2){let r=i.$implicit,t=i.index,n=d(2);j("active",n.activeFocusedButtonIndex===t),u("tabindex",n.activeFocusedButtonIndex===t?0:-1),w("aria-selected",n.activeFocusedButtonIndex===t),s(3),D(r.name),s(2),D(r.uid)}}function uo(e,i){if(e&1){let r=y();m(0,"button",15,2),x("click",function(){h(r);let n=d(2);return C(n.createCustomer())})("keydown.escape",function(n){h(r);let o=d(2);return C(o.closeResults(n))})("keydown.arrowright",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.arrowleft",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.home",function(n){h(r);let o=d(2);return C(o.focusInputText(n))})("keydown.end",function(n){h(r);let o=d(2);return C(o.focusInputText(n))}),m(2,"span"),f(3),c(4,"cxTranslate"),p(),m(5,"span",16,3),f(7),c(8,"cxTranslate"),p()()}if(e&2){let r=d(2);j("active",r.activeFocusedButtonIndex===0),w("aria-selected",r.activeFocusedButtonIndex===0),s(3),D(l(4,5,"asm.customerSearch.noMatchResult")),s(4),D(l(8,7,"asm.customerSearch.createCustomer"))}}function po(e,i){if(e&1&&(m(0,"div",9,1),g(2,mo,6,6,"button",10)(3,uo,9,9,"button",11),c(4,"async"),p()),e&2){let r=i.ngIf,t=d(),n=k(3);s(2),u("ngForOf",r.entries),s(),u("ngIf",!l(4,2,t.searchResultsLoading$)&&n.value.length>=3&&!!r.entries&&r.entries.length<=0)}}function go(e,i){e&1&&(m(0,"div",9),T(1,"cx-dot-spinner",17),c(2,"cxTranslate"),p()),e&2&&(s(),w("aria-label",l(2,1,"common.loading")))}var _o=["asmCustomer360Launcher"];function fo(e,i){if(e&1){let r=y();m(0,"button",7,0),x("click",function(){h(r);let n=d(2);return C(n.openAsmCustomer360())}
1),f(2),c(3,"cxTranslate"),p()}e&2&&(s(2),b(" ",l(3,1,"asm.asmCustomer360Button")," "))}function ho(e,i){if(e&1){let r=y();E(0),m(1,"div",2)(2,"label",3),f(3),p(),m(4,"label",4),f(5),p()(),T(6,"cx-asm-bind-cart"),g(7,fo,4,3,"button",5),m(8,"button",6),x("click",function(){h(r);let n=d();return C(n.logoutCustomer())}),f(9),c(10,"cxTranslate"),p(),A()}if(e&2){let r=d();s(3),D(r.customer==null?null:r.customer.name),s(2),D(r.customer==null?null:r.customer.uid),s(2),u("ngIf",r.isAsmCustomer360Configured&&r.customer),s(2),b(" ",l(10,4,"asm.endSession")," ")}}function Co(e,i){e&1&&(m(0,"span",3),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"asm.toggleUi.collapse")," "))}function xo(e,i){e&1&&(m(0,"span",3),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"asm.toggleUi.expand")," "))}var vo=["customerListLink"],pr=["addNewCustomerLink"];function So(e,i){if(e&1){let r=y();m(0,"div",12)(1,"a",13,0),x("click",function(){h(r);let n=d();return C(n.showCustomList())}),T(3,"cx-icon",14),m(4,"span"),f(5),c(6,"cxTranslate"),p()()()}if(e&2){let r=d();s(3),u("type",r.iconTypes.USER_FRIENDS),s(2),D(l(6,2,"asm.customers"))}}function bo(e,i){e&1&&T(0,"cx-asm-session-timer")}function yo(e,i){if(e&1){let r=y();m(0,"button",15),c(1,"cxTranslate"),x("click",function(){h(r);let n=d();return C(n.hideUi())}),p()}e&2&&F("title",l(1,1,"asm.hideUi"))}function To(e,i){if(e&1){let r=y();m(0,"button",16),c(1,"cxTranslate"),x("click",function(){h(r);let n=d();return C(n.logout())}),p()}e&2&&F("title",l(1,1,"asm.logout"))}function Io(e,i){e&1&&T(0,"cx-customer-emulation")}function Eo(e,i){if(e&1){let r=y();m(0,"cx-message",19),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d(4);return C(n.closeDialogConfirmationAlert())}),p()}if(e&2){let r=d(4);u("text",l(1,2,"asm.createCustomerSuccessfullyAlert"))("type",r.globalMessageType.MSG_TYPE_CONFIRMATION)}}function Ao(e,i){if(e&1){let r=y();m(0,"cx-message",19),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d(4);return C(n.closeDeeplinkCartInfoAlert())}),p()}if(e&2){let r=d(4);u("text",l(1,2,r.deeplinkCartAlertKey))("type",r.globalMessageType.MSG_TYPE_INFO)}}function wo(e,i){if(e&1){let r=y();m(0,"cx-message",19),c(1,"cxTranslate"),x("closeMessage",function(){h(r);let n=d(4);return C(n.closeCustomerEmulationInfoAlert())}),p()}if(e&2){let r=d(4);u("text",l(1,2,"asm.startCustomerEmulationAlertInfo"))("type",r.globalMessageType.MSG_TYPE_INFO)}}function Lo(e,i){if(e&1&&(E(0),g(1,Io,1,0,"cx-customer-emulation",9)(2,Eo,2,4,"cx-message",18)(3,Ao,2,4,"cx-message",18),c(4,"async"),g(5,wo,2,4,"cx-message",18),A()),e&2){let r=d(2).ngIf,t=d();s(),u("ngIf",r),s(),u("ngIf",r&&t.showCreateCustomerSuccessfullyAlert),s(),u("ngIf",l(4,4,t.showDeeplinkCartInfoAlert$)),s(2),u("ngIf",r&&t.showCustomerEmulationInfoAlert)}}function ko(e,i){if(e&1){let r=y();m(0,"cx-customer-selection",21),x("submitEvent",function(n){h(r);let o=d(4);return C(o.startCustomerEmulationSession(n))}),p()}}function Do(e,i){if(e&1&&g(0,ko,1,0,"cx-customer-selection",20),e&2){let r=d(2).ngIf;u("ngIf",r)}}function Ro(e,i){if(e&1&&(E(0),g(1,Lo,6,6,"ng-container",17),c(2,"async"),g(3,Do,1,1,"ng-template",null,2,O),A()),e&2){let r=k(4),t=d(2);s(),u("ngIf",l(2,2,t.customer$))("ngIfElse",r)}}function Mo(e,i){if(e&1){let r=y();m(0,"cx-csagent-login-form",23),c(1,"async"),x("submitEvent",function(n){h(r);let o=d(3);return C(o.loginCustomerSupportAgent(n))}),p()}if(e&2){let r=d(3);u("csAgentTokenLoading",l(1,1,r.csAgentTokenLoading$))}}function Fo(e,i){if(e&1&&g(0,Mo,2,3,"cx-csagent-login-form",22),e&2){let r=d().ngIf;u("ngIf",r)}}function Bo(e,i){if(e&1&&(E(0),g(1,Ro,5,4,"ng-container",17),c(2,"async"),g(3,Fo,1,1,"ng-template",null,1,O),A()),e&2){let r=k(4),t=d();s(),u("ngIf",l(2,2,t.customerSupportAgentLoggedIn$))("ngIfElse",r)}}var Uo=(e,i)=>({customerA:e,customerB:i}),Oo=e=>({customerListsPage:e}),No=e=>({customerSearchPage:e}),Po=(e,i)=>({customerEntry:e,column:i,showHeader:!1}),_i=(e,i)=>({customerEntry:e,column:i,showHeader:!0}),dr=(e,i)=>({column:e,customerEntry:i}),gr=e=>({count:e}),_r=e=>({ariaLabel:e,ariaControls:"asm-cusomer-list-table"});function Vo(e,i){}function jo(e,i){e&1&&g(0,Vo,0,0,"ng-template")}function $o(e,i){}function Ho(e,i){e&1&&g(0,$o,0,0,"ng-template")}function zo(e,i){}function Go(e,i){e&1&&g(0,zo,0,0,"ng-template")}function Wo(e,i){}function Qo(e,i){e&1&&g(0,Wo,0,0,"ng-template")}function Ko(e,i){}function qo(e,i){e&1&&g(0,Ko,0,0,"ng-template")}function Yo(e,i){if(e&1&&(m(0,"div",24),c(1,"async"),m(2,"div",25),c(3,"async"),g(4,Ho,1,0,null,26)(5,Go,1,0,null,26),c(6,"async"),p(),m(7,"div",27),c(8,"async"),g(9,Qo,1,0,null,14)(10,qo,1,0,null,14),p()()),e&2){let r=i.ngIf,t=d(),n=k(35),o=k(37),a=k(39),_=k(43);j("tablet-mobile",l(1,12,t.breakpoint$)!==t.BREAKPOINT.md),s(2),j("mobile",l(3,14,t.breakpoint$)===t.BREAKPOINT.xs),s(2),u("ngTemplateOutlet",_)("ngTemplateOutletContext",ce(20,Oo,r)),s(),u("ngTemplateOutlet",o)("ngTemplateOutletContext",ce(22,No,l(6,16,t.customerSearchPage$))),s(2),j("mobile",l(8,18,t.breakpoint$)===t.BREAKPOINT.xs),s(2),u("ngTemplateOutlet",a),s(),u("ngTemplateOutlet",n)}}function Zo(e,i){e&1&&(m(0,"div",28),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.noLists")," "))}function Jo(e,i){e&1&&(m(0,"div",28),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.listsError")," "))}function Xo(e,i){e&1&&(m(0,"div",28),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"generalErrors.pageFailure")," "))}function es(e,i){e&1&&T(0,"cx-spinner")}function ts(e,i){e&1&&(E(0),f(1),c(2,"cxTranslate"),A()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.tableHeader.customerName")," "))}function is(e,i){e&1&&(E(0),f(1),c(2,"cxTranslate"),A()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.tableHeader.emailId")," "))}function ns(e,i){if(e&1&&(E(0),f(1),c(2,"cxTranslate"),A()),e&2){let r=d(2).$implicit;s(),b(" ",l(2,1,r.headerLocalizationKey)," ")}}function rs(e,i){if(e&1&&(m(0,"span"),g(1,ts,3,3,"ng-container",20)(2,is,3,3,"ng-container",20)(3,ns,3,3,"ng-container",20),p()),e&2){let r=d().$implicit;s(),u("ngIf",r.headerLocalizationKey==="asm.customerList.tableHeader.customer"),s(),u("ngIf",r.headerLocalizationKey==="asm.customerList.tableHeader.email"),s(),u("ngIf",r.headerLocalizationKey!=="asm.customerList.tableHeader.customer"&&r.headerLocalizationKey!=="asm.customerList.tableHeader.email")}}function os(e,i){if(e&1&&(m(0,"th",36),g(1,rs,4,3,"span",20),p()),e&2){let r=i.$implicit;s(),u("ngIf",r.headerLocalizationKey&&r.headerLocalizationKey!=="hideHeaders")}}function ss(e,i){if(e&1&&(m(0,"thead")(1,"tr",34),g(2,os,2,1,"th",35),p()()),e&2){let r=d(3);s(2),u("ngForOf",r.customerListConfig==null?null:r.customerListConfig.columns)}}function as(e,i){}function cs(e,i){e&1&&g(0,as,0,0,"ng-template")}function ls(e,i){if(e&1&&(m(0,"td",39),g(1,cs,1,0,null,26),p()),e&2){let r=i.$implicit,t=d(2).$implicit;d(3);let n=k(31);s(),u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ce(2,Po,t,r))}}function ms(e,i){if(e&1&&(E(0),g(1,ls,2,5,"td",38),A()),e&2){let r=d(4);s(),u("ngForOf",r.customerListConfig==null?null:r.customerListConfig.columns)}}function us(e,i){}function ps(e,i){e&1&&g(0,us,0,0,"ng-template")}function ds(e,i){if(e&1&&(E(0),g(1,ps,1,0,null,26),A()),e&2){let r=d().$implicit,t=d(2).$implicit;d(3);let n=k(31);s(),u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ce(2,_i,t,r))}}function gs(e,i){if(e&1&&(E(0),g(1,ds,2,5,"ng-container",20),A()),e&2){let r=i.even;s(),u("ngIf",r)}}function _s(e,i){}function fs(e,i){e&1&&g(0,_s,0,0,"ng-template")}function hs(e,i){if(e&1&&(E(0),g(1,fs,1,0,null,26),A()),e&2){let r=d().$implicit,t=d(2).$implicit;d(3);let n=k(31);s(),u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ce(2,_i,t,r))}}function Cs(e,i){if(e&1&&(E(0),g(1,hs,2,5,"ng-container",20),A()),e&2){let r=i.odd;s(),u("ngIf",r)}}function xs(e,i){if(e&1&&(E(0),m(1,"td",40),g(2,gs,2,1,"ng-container",41),p(),m(3,"td",40),g(4,Cs,2,1,"ng-container",41),p(),A()),e&2){let r=d(4);s(2),u("ngForOf",r.customerListConfig==null?null:r.customerListConfig.columns),s(2),u("ngForOf",r.customerListConfig==null?null:r.customerListConfig.columns)}}function vs(e,i){}function Ss(e,i){e&1&&g(0,vs,0,0,"ng-template")}function bs(e,i){if(e&1&&(E(0),g(1,Ss,1,0,null,26),A()),e&2){let r=i.$implicit,t=d(2).$implicit;d(3);let n=k(31);s(),u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ce(2,_i,t,r))}}function ys(e,i){if(e&1&&(m(0,"td",40),g(1,bs,2,5,"ng-container",41),p()),e&2){let r=d(4);s(),u("ngForOf",r.customerListConfig==null?null:r.customerListConfig.columns)}}function Ts(e,i){if(e&1&&(m(0,"tr",34),g(1,ms,2,1,"ng-container",20),c(2,"async"),g(3,xs,5,2,"ng-container",20),c(4,"async"),g(5,ys,2,1,"td",37),c(6,"async"),p()),e&2){let r=d(3);s(),u("ngIf",l(2,3,r.breakpoint$)===r.BREAKPOINT.md),s(2),u("ngIf",l(4,5,r.breakpoint$)===r.BREAKPOINT.sm),s(2),u("ngIf",l(6,7,r.breakpoint$)===r.BREAKPOINT.xs)}}function Is(e,i){if(e&1&&(m(0,"table",31)(1,"caption",32),f(2),c(3,"c
1xTranslate"),p(),g(4,ss,3,1,"thead",20),c(5,"async"),m(6,"tbody"),g(7,Ts,7,9,"tr",33),p()()),e&2){let r=d().ngIf,t=d();s(2),b(" ",l(3,3,"asm.customerList.title")," "),s(2),u("ngIf",l(5,5,t.breakpoint$)===t.BREAKPOINT.md),s(3),u("ngForOf",r==null?null:r.entries)}}function Es(e,i){e&1&&(m(0,"div",42),f(1),c(2,"cxTranslate"),p()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.noCustomers")," "))}function As(e,i){if(e&1&&(m(0,"div"),g(1,Is,8,7,"table",29)(2,Es,3,3,"div",30),p()),e&2){let r=i.ngIf,t=d();s(),u("ngIf",t.loaded),s(),u("ngIf",!(r!=null&&r.entries.length))}}function ws(e,i){if(e&1){let r=y();m(0,"div")(1,"cx-pagination",44),x("viewPageEvent",function(n){h(r);let o=d(2);return C(o.changePage(n))}),p()()}if(e&2){let r=i.ngIf;s(),u("pagination",r.pagination)}}function Ls(e,i){if(e&1&&(m(0,"div",43),c(1,"async"),m(2,"div",27),c(3,"async"),g(4,ws,2,1,"div",20),c(5,"async"),p()()),e&2){let r=d();j("asm-mobile-pagination",l(1,5,r.breakpoint$)!==r.BREAKPOINT.md),s(2),j("mobile",l(3,7,r.breakpoint$)===r.BREAKPOINT.xs),s(2),u("ngIf",l(5,9,r.customerSearchPage$))}}function ks(e,i){if(e&1&&(m(0,"span",50),f(1),c(2,"cxTranslate"),p()),e&2){let r=d(2).column;s(),b(" ",l(2,1,r.headerLocalizationKey)," ")}}function Ds(e,i){e&1&&zt(0)}function Rs(e,i){if(e&1&&(E(0),g(1,Ds,1,0,"ng-container",26),A()),e&2){let r=d(2),t=r.customerEntry,n=r.column;d();let o=k(33);s(),u("ngTemplateOutlet",o)("ngTemplateOutletContext",Ce(2,dr,n,t))}}function Ms(e,i){if(e&1&&(T(0,"img",54),c(1,"cxTranslate")),e&2){let r=d(3).customerEntry,t=d();F("alt",l(1,2,"asm.mainLogoLabel")),w("src",(t.occConfig==null||t.occConfig.backend==null||t.occConfig.backend.occ==null?null:t.occConfig.backend.occ.baseUrl)+(r==null||r.userAvatar==null?null:r.userAvatar.url),Mi)}}function Fs(e,i){if(e&1&&(m(0,"div",55),f(1),p()),e&2){let r=d(3).customerEntry,t=d();s(),b(" ",t.getBadgeText(r)," ")}}function Bs(e,i){if(e&1&&(m(0,"div",51),g(1,Ms,2,4,"img",52)(2,Fs,2,1,"div",53),p()),e&2){let r=d(2).customerEntry;s(),u("ngIf",r==null||r.userAvatar==null?null:r.userAvatar.url),s(),u("ngIf",!(!(r==null||r.userAvatar==null)&&r.userAvatar.url))}}function Us(e,i){e&1&&zt(0)}function Os(e,i){if(e&1){let r=y();m(0,"button",56),c(1,"cxTranslate"),c(2,"cxTranslate"),x("click",function(){h(r);let n=d(2),o=n.customerEntry,a=n.column,_=d();return C(_.startColumnAction(o,a.actionType))}),g(3,Us,1,0,"ng-container",26),p()}if(e&2){let r,t,n=d(2),o=n.customerEntry,a=n.column,_=d(),I=k(33);Fi(a.actionType==="ACTIVE_CART"?"cx-cart":""),u("disabled",_.isRequired(o,a.actionType)),w("title",a.icon?l(1,7,(r=a.icon.captionLocalizationKey)!==null&&r!==void 0?r:a.headerLocalizationKey):void 0)("aria-label",a.icon?l(2,9,(t=a.icon.captionLocalizationKey)!==null&&t!==void 0?t:a.headerLocalizationKey):void 0),s(3),u("ngTemplateOutlet",I)("ngTemplateOutletContext",Ce(11,dr,a,o))}}function Ns(e,i){if(e&1&&(m(0,"div",46),g(1,ks,3,3,"span",47)(2,Rs,2,5,"ng-container",20)(3,Bs,3,2,"div",48)(4,Os,4,14,"button",49),p()),e&2){let r=d(),t=r.column,n=r.showHeader,o=d();s(),u("ngIf",n),s(),u("ngIf",!t.actionType),s(),u("ngIf",(o.customerListConfig==null?null:o.customerListConfig.showAvatar)&&(t==null?null:t.actionType)===(o.customerListColumnActionType==null?null:o.customerListColumnActionType.START_SESSION)),s(),u("ngIf",t.actionType)}}function Ps(e,i){if(e&1&&g(0,Ns,5,4,"div",45),e&2){let r=i.column;u("ngIf",r.headerLocalizationKey!=="hideHeaders")}}function Vs(e,i){if(e&1&&(m(0,"span"),f(1),p()),e&2){let r=d(),t=r.customerEntry,n=r.column;s(),D((n.renderer==null?null:n.renderer(t))||"")}}function js(e,i){if(e&1&&(T(0,"cx-icon",58),c(1,"cxTranslate"),c(2,"cxTranslate")),e&2){let r,t,n=d(),o=n.customerEntry,a=n.column,_=d();j("cx-action-color",a.actionType&&!_.isRequired(o,a.actionType)),u("type",a.icon.symbol),w("title",a.actionType?void 0:l(1,5,(r=a.icon.captionLocalizationKey)!==null&&r!==void 0?r:a.headerLocalizationKey))("aria-label",a.actionType?void 0:l(2,7,(t=a.icon.captionLocalizationKey)!==null&&t!==void 0?t:a.headerLocalizationKey))}}function $s(e,i){if(e&1&&(m(0,"div"),g(1,Vs,2,1,"span",20)(2,js,3,9,"cx-icon",57),p()),e&2){let r=i.column;s(),u("ngIf",!r.icon),s(),u("ngIf",r.icon)}}function Hs(e,i){if(e&1){let r=y();
1m(0,"div",59)(1,"input",60),c(2,"cxTranslate"),c(3,"cxTranslate"),x("keyup",function(n){h(r);let o=d();return C(o.onKey(n))}),p(),m(4,"cx-icon",61),c(5,"cxTranslate"),x("click",function(){h(r);let n=d();return C(n.searchCustomers())}),p()()}if(e&2){let r=d();s(),F("placeholder",l(2,5,"asm.customerList.searchBox")),u("formControl",r.searchBox),w("aria-label",l(3,7,"asm.customerList.enterSearchBox")),s(3),u("type",r.iconTypes.SEARCH),w("aria-label",l(5,9,"storeFinder.searchNearestStores"))}}function zs(e,i){if(e&1&&(E(0),f(1),c(2,"cxTranslate"),A()),e&2){let r=d(2).customerSearchPage;s(),b(" ",ut(2,1,"asm.customerList.noOfCustomers",ce(4,gr,r==null||r.pagination==null?null:r.pagination.totalResults))," ")}}function Gs(e,i){e&1&&(E(0),f(1),c(2,"cxTranslate"),A()),e&2&&(s(),b(" ",l(2,1,"asm.customerList.oneCustomer")," "))}function Ws(e,i){if(e&1&&(m(0,"span",63),g(1,zs,3,6,"ng-container",20)(2,Gs,3,3,"ng-container",20),p()),e&2){let r=d().customerSearchPage;s(),u("ngIf",(r==null||r.pagination==null?null:r.pagination.totalResults)>1),s(),u("ngIf",(r==null||r.pagination==null?null:r.pagination.totalResults)===1)}}function Qs(e,i){if(e&1&&g(0,Ws,3,2,"span",62),e&2){let r=i.customerSearchPage;u("ngIf",r==null||r.pagination==null?null:r.pagination.totalResults)}}function Ks(e,i){if(e&1){let r=y();m(0,"label")(1,"span",32),f(2),c(3,"cxTranslate"),p(),m(4,"cx-sorting",64),c(5,"cxTranslate"),c(6,"async"),x("sortListEvent",function(n){h(r);let o=d();return C(o.changeSortCode(n))}),p()()}if(e&2){let r=d();s(2),D(l(3,6,"asm.customerList.tableSort.sortBy")),s(2),F("placeholder",l(5,8,"asm.customerList.tableSort.sortBy")),u("sortOptions",r.sorts)("sortLabels",l(6,10,r.getSortLabels()))("selectedOption",r.sortCode)("cxNgSelectA11y",ce(12,_r,r.sortCode))}}function qs(e,i){if(e&1){let r=y();m(0,"button",68),x("click",function(){h(r);let n=d(2);return C(n.goToPreviousPage())}),T(1,"cx-icon",69),m(2,"span"),f(3),c(4,"cxTranslate"),p()()}if(e&2){let r=d(2);u("disabled",r.currentPage===0||!r.loaded),s(),u("type",r.iconTypes.CARET_LEFT),s(2),D(l(4,3,"asm.customerList.page.previous"))}}function Ys(e,i){if(e&1){let r=y();m(0,"button",70),x("click",function(){h(r);let n=d(2);return C(n.goToNextPage())}),m(1,"span"),f(2),c(3,"cxTranslate"),p(),T(4,"cx-icon",71),p()}if(e&2){let r=d(2);u("disabled",r.currentPage===r.maxPage||!r.loaded),s(2),D(l(3,3,"asm.customerList.page.next")),s(2),u("type",r.iconTypes.CARET_RIGHT)}}function Zs(e,i){if(e&1&&(m(0,"div",65)(1,"div"),f(2),c(3,"cxTranslate"),p(),g(4,qs,5,5,"button",66)(5,Ys,5,5,"button",67),p()),e&2){let r=d();s(2),b(" ",ut(3,3,"asm.customerList.page.page",ce(6,gr,r.currentPage+1))," "),s(2),u("ngIf",r.maxPage>0),s(),u("ngIf",r.maxPage>0)}}function Js(e,i){if(e&1){let r=y();m(0,"label")(1,"span",32),f(2),c(3,"cxTranslate"),p(),m(4,"ng-select",72),x("change",function(){h(r);let n=d();return C(n.onChangeCustomerGroup())}),Ni("ngModelChange",function(n){h(r);let o=d();return Oi(o.selectedUserGroupId,n)||(o.selectedUserGroupId=n),C(n)}),p()()}if(e&2){let r=i.customerListsPage,t=d();s(2),D(l(3,7,"asm.customerList.title")),s(2),u("searchable",!1)("clearable",!1)("tabIndex",0),Ui("ngModel",t.selectedUserGroupId),u("items",r==null?null:r.userGroups)("cxNgSelectA11y",ce(9,_r,t.getGroupName(r,t.selectedUserGroupId)))}}function Xs(e,i){if(e&1){let r=y();m(0,"button",73),c(1,"cxTranslate"),x("click",function(){h(r);let n=d();return C(n.closeModal("Cross click"))}),m(2,"span",74),T(3,"cx-icon",58),p()()}if(e&2){let r=d();w("aria-label",l(1,2,"common.close")),s(3),u("type",r.iconTypes.CLOSE)}}function ea(e,i){if(e&1){let r=y();m(0,"button",75),x("click",function(){h(r);let n=d();return C(n.createCustomer())}),T(1,"cx-icon",58),m(2,"span"),f(3),c(4,"cxTranslate"),p()()}if(e&2){let r=d();s(),u("type",r.iconTypes.USER_PLUS),s(2),D(l(4,2,"asm.customerList.createCustomer"))}}var Pt=function(e){return e.CANCEL="CANCEL",e.REPLACE="REPLACE",e}(Pt||{}),ta=(()=>{let i=class i{constructor(t){this.launchDialogService=t,this.BIND_CART_ACTION=Pt,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}closeModal(t){this.launchDialogService.closeDialog(t)}
1};i.\u0275fac=function(n){return new(n||i)(S(G))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-bind-cart-dialog"]],decls:20,vars:19,consts:[[1,"cx-asm-bind-cart-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["id","asm-bind-cart-dialog-title",1,"title","modal-title"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row"],[1,"cx-dialog-item"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-secondary",3,"click"]],template:function(n,o){n&1&&(m(0,"div",0),x("esc",function(){return o.closeModal(o.BIND_CART_ACTION.CANCEL)}),m(1,"div",1)(2,"div",2)(3,"h2",3),f(4),c(5,"cxTranslate"),p()(),m(6,"div",4)(7,"div",5)(8,"div",6),f(9),c(10,"cxTranslate"),p()()(),m(11,"div",7)(12,"button",8),c(13,"cxTranslate"),x("click",function(){return o.closeModal(o.BIND_CART_ACTION.REPLACE)}),f(14),c(15,"cxTranslate"),p(),m(16,"button",9),c(17,"cxTranslate"),x("click",function(){return o.closeModal(o.BIND_CART_ACTION.CANCEL)}),f(18),c(19,"cxTranslate"),p()()()()),n&2&&(u("cxFocus",o.focusConfig),s(4),b(" ",l(5,7,"asm.bindCart.dialog.title")," "),s(5),b(" ",l(10,9,"asm.bindCart.dialog.body")," "),s(3),w("aria-label",l(13,11,"asm.bindCart.dialog.actions.replace")),s(2),b(" ",l(15,13,"asm.bindCart.dialog.actions.replace")," "),s(2),w("aria-label",l(17,15,"common.cancel")),s(2),b(" ",l(19,17,"common.cancel")," "))},dependencies:[$e,B],encapsulation:2});let e=i;return e})(),Vt=function(e){return e.CANCEL="CANCEL",e.SAVE="SAVE",e}(Vt||{}),ia=(()=>{let i=class i{constructor(t,n){this.launchDialogService=t,this.savedCartFacade=n,this.BIND_CART_ACTION=Vt,this.showDialogAlert$=new ee(!0),this.globalMessageType=X,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}ngOnInit(){this.launchDialogService.data$.pipe(U(1)).subscribe(t=>{this.cart=t,this.setCartTotalQty()})}setCartTotalQty(){let t=0;if(this.cart.entries)for(let n of this.cart.entries)t+=n.quantity?n.quantity:0;this.cartQty=t}closeDialogAlert(){this.showDialogAlert$.next(!1)}closeModal(t){t===Vt.SAVE&&this.saveCart(),this.launchDialogService.closeDialog(t)}saveCart(){this.savedCartFacade.saveCart({cartId:this.cart.code,saveCartName:this.cart.code,saveCartDescription:"-"})}};i.\u0275fac=function(n){return new(n||i)(S(G),S(ii))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-save-cart-dialog"]],decls:38,vars:31,consts:[["showSaveCartWarning",""],[1,"cx-asm-save-cart-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["id","asm-save-cart-dialog-title",1,"title","modal
1-title"],[1,"cx-dialog-body","modal-body"],[4,"ngIf","ngIfElse"],[1,"cx-dialog-content"],[1,"cx-dialog-row","row"],[1,"cx-dialog-item","col-sm-6","col-md-6","text-right","item-left-text"],[1,"cx-dialog-item","col-sm-6","col-md-6","text-left","item-right-text"],[1,"cx-dialog-footer","modal-footer"],["id","asm-save-cart-dialog-btn","type","button",1,"btn","btn-primary",3,"click","disabled"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"message-container"],[3,"text","type","closeMessage",4,"ngIf"],[3,"closeMessage","text","type"]],template:function(n,o){if(n&1){let a=y();m(0,"div",1),x("esc",function(){return h(a),C(o.closeModal(o.BIND_CART_ACTION.CANCEL))}),m(1,"div",2)(2,"div",3)(3,"h2",4),f(4),c(5,"cxTranslate"),p()(),m(6,"div",5),g(7,Wr,4,3,"ng-container",6)(8,Kr,3,3,"ng-template",null,0,O),m(10,"div",7)(11,"div",8)(12,"div",9),f(13),c(14,"cxTranslate"),p(),m(15,"div",10),f(16),p()(),m(17,"div",8)(18,"div",9),f(19),c(20,"cxTranslate"),p(),m(21,"div",10),f(22),p()(),m(23,"div",8)(24,"div",9),f(25),c(26,"cxTranslate"),p(),m(27,"div",10),f(28),p()()()(),m(29,"div",11)(30,"button",12),c(31,"cxTranslate"),x("click",function(){return h(a),C(o.closeModal(o.BIND_CART_ACTION.SAVE))}),f(32),c(33,"cxTranslate"),p(),m(34,"button",13),c(35,"cxTranslate"),x("click",function(){return h(a),C(o.closeModal(o.BIND_CART_ACTION.CANCEL))}),f(36),c(37,"cxTranslate"),p()()()()}if(n&2){let a=k(9);u("cxFocus",o.focusConfig),s(4),b(" ",l(5,15,"asm.saveCart.dialog.title")," "),s(3),u("ngIf",o.cartQty>0)("ngIfElse",a),s(6),b(" ",l(14,17,"asm.saveCart.dialog.row.id")," "),s(3),b(" ",o.cart.code," "),s(3),b(" ",l(20,19,"asm.saveCart.dialog.row.qty")," "),s(3),b(" ",o.cartQty," "),s(3),b(" ",l(26,21,"asm.saveCart.dialog.row.total")," "),s(3),b(" ",o.cart.totalPriceWithTax==null?null:o.cart.totalPriceWithTax.formattedValue," "),s(2),u("disabled",o.cartQty===0),w("aria-label",l(31,23,"asm.saveCart.dialog.actions.save")),s(2),b(" ",l(33,25,"asm.saveCart.dialog.actions.save")," "),s(2),w("aria-label",l(35,27,"common.cancel")),s(2),b(" ",l(37,29,"common.cancel")," ")}},dependencies:[P,$e,bt,z,B],encapsulation:2});let e=i;return e})(),Re=(()=>{let i=class i{constructor(t,n,o,a,_){this.authService=t,this.csAgentAuthService=n,this.winRef=o,this.asmEnablerService=a,this.asmDeepLinkService=_,this.isEmulatedByDeepLink$=new ee(!1),this.showDeeplinkCartInfoAlert$=new ee(!1),this.routingService=Me(J)}getSearchParameter(t){return this.asmDeepLinkService?.getSearchParameter(t)}isEmulatedByDeepLink(){return this.isEmulatedByDeepLink$}setEmulatedByDeepLink(t){this.isEmulatedByDeepLink$.next(t)}setShowDeeplinkCartInfoAlert(t){this.showDeeplinkCartInfoAlert$.next(t)}shouldShowDeeplinkCartInfoAlert(){return this.showDeeplinkCartInfoAlert$}logoutCustomerSupportAgentAndCustomer(){this.csAgentAuthService.logoutCustomerSupportAgent()}logoutCustomer(){this.authService.logout()}isCustomerEmulationSessionInProgress(){return this.csAgentAuthService.isCustomerEmulated()}unload(){this.winRef.localStorage&&this.winRef.localStorage.removeItem(Ge)}isEmulateInURL(){return this.asmDeepLinkService?.isEmulateInURL()||!1}getDeepLinkUrlParams(){return this.asmDeepLinkService?.getParamsInUrl()}handleDeepLinkNavigation(t=this.getDeepLinkUrlParams()){this.asmDeepLinkService?.handleNavigation(t)}handleAsmDialogAction(t){typeof t=="object"&&t.actionType===si.NAVIGATE&&this.routingService.go(t.route)}};i.\u0275fac=function(n){return new(n||i)(v(oe),v(Ke),v(Ae),v(Tt),v(Hn))},i.\u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),fi=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=R({type:i,selectors:[["cx-dot-spinner"]],decls:3,vars:0,template:function(n,o){n&1&&T(0,"div")(1,"div")(2,"div")},encapsulation:2,changeDetection:0});let e=i;return e})(),na=(()=>{let i=class i{constructor(t,n,o,a,_,I,$,H){this.globalMessageService=t,this.activeCartFacade=n,this.multiCartFacade=o,this.asmBindCartFacade=a,this.launchDialogService=_,this.savedCartFacade=I,this.asmComponentService=$,this.routing=H,this.activeCartValidator=_e=>_e.value===this.activeCartId?{activeCartError:!0}:(this.deepLinkCartId&&_e.value!==this.deepLinkCartId&&this.resetDeeplinkCart(),null),this.cartId=new pn("",[pe.required,pe.minLength(1),this.activeCartValidator]),this.loading$=new ee(!1),this.valid$=this.cartId.statusChanges.pipe(M(_e=>_e==="VALID"),Ri(1)),this.activeCartId="",this.deepLinkCartId="",this.displayBindCartBtn$=new ee(!0),this.displaySaveCartBtn$=new ee(!1),this.subscription=new ae}ngOnInit(){this.subscribeForDeeplinkCart(),this.subscription.add(this.activeCartFacade.getActiveCartId().subscribe(t=>{this.activeCartId=t??"",this.cartId.setValue(this.deepLinkCartId||this.activeCartId)}))}resetInput(){this.cartId.value||this.cartId.setValue(this.activeCartId)}
1bindCartToCustomer(){let t=this.cartId.value,n=me([this.loading$.asObservable(),this.valid$]).pipe(U(1),N(([o,a])=>!o&&a),K(()=>this.loading$.next(!0)),he(()=>this.activeCartFacade.getActive().pipe(M(o=>o.deliveryItemsQuantity??0),U(1))),he(o=>Ai(()=>!!(this.activeCartId&&o),this.openDialog(this.activeCartId,t),this.simpleBindCart(t))),ki(()=>this.loading$.next(!1))).subscribe({next:()=>{this.globalMessageService.add({key:"asm.bindCart.success"},X.MSG_TYPE_CONFIRMATION)},error:o=>{this.globalMessageService.add(o.details?.[0].message??"",X.MSG_TYPE_ERROR)}});this.subscription.add(n)}onSaveInactiveCart(){this.asmComponentService?.setShowDeeplinkCartInfoAlert(!1);let t=this.asmComponentService?.getSearchParameter("customerId");this.multiCartFacade.loadCart({cartId:this.deepLinkCartId,userId:t}),this.multiCartFacade.getCartEntity(this.deepLinkCartId).pipe(N(n=>n.loading===!1&&n.success===!0),U(1),M(n=>n.value),N(n=>!!n)).subscribe(n=>{this.openASMSaveCartDialog(n)}),this.afterCloseASMSaveCartDialog()}clearText(){this.cartId.setValue(""),this.resetDeeplinkCart()}resetDeeplinkCart(){this.deepLinkCartId="",this.displayBindCartBtn$.next(!0),this.displaySaveCartBtn$.next(!1),this.asmComponentService?.setShowDeeplinkCartInfoAlert(!1)}ngOnDestroy(){this.subscription.unsubscribe()}simpleBindCart(t){return jt(()=>this.asmBindCartFacade.bindCart(t)).pipe(K(()=>this.multiCartFacade.reloadCart(Xi)))}openDialog(t,n){return jt(()=>(this.launchDialogService.openDialogAndSubscribe("ASM_BIND_CART",this.bindToCartElemRef),this.launchDialogService.dialogClose.pipe(N(o=>!!o),U(1)))).pipe(N(o=>!!o),he(o=>this.selectBindAction(t,n,o)))}selectBindAction(t,n,o){switch(o){case Pt.REPLACE:return this.replaceCart(t,n);case Pt.CANCEL:default:return Ti}}replaceCart(t,n){return this.simpleBindCart(n).pipe(K(()=>{this.savedCartFacade.saveCart({cartId:t,saveCartName:t,saveCartDescription:"-"})}))}subscribeForDeeplinkCart(){this.subscription.add(this.asmComponentService?.isEmulatedByDeepLink().pipe(N(t=>t&&!!this.asmComponentService?.getSearchParameter("cartId"))).subscribe(()=>{let t=this.asmComponentService?.getSearchParameter("cartType");(t==="inactive"||t==="active")&&(this.displayBindCartBtn$.next(!1),this.displaySaveCartBtn$.next(t==="inactive"),this.deepLinkCartId=this.asmComponentService?.getSearchParameter("cartId"),this.cartId.setValue(this.deepLinkCartId),this.asmComponentService?.setShowDeeplinkCartInfoAlert(!0),this.asmComponentService?.handleDeepLinkNavigation())}))}openASMSaveCartDialog(t){this.launchDialogService.openDialogAndSubscribe("ASM_SAVE_CART",this.saveInactiveCartElemRef,t)}afterCloseASMSaveCartDialog(){this.launchDialogService.dialogClose.pipe(N(t=>t===Vt.SAVE),U(1),K(()=>this.loading$.next(!0))).subscribe(),this.savedCartFacade.getSaveCartProcessSuccess().pipe(N(t=>t),U(1),K(()=>this.loading$.next(!1))).subscribe(()=>{this.goToSavedCartDetails(this.deepLinkCartId),this.displaySaveCartBtn$.next(!1)}),this.savedCartFacade.getSaveCartProcessError().pipe(N(t=>t),U(1),K(()=>this.loading$.next(!1))).subscribe()}goToSavedCartDetails(t){this.routing?.go({cxRoute:"savedCartsDetails",params:{savedCartId:t}})}};i.\u0275fac=function(n){return new(n||i)(S(be),S(Pn),S(Nn),S(It),S(G),S(ii),S(Re),S(J))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-bind-cart"]],viewQuery:function(n,o){if(n&1&&(te(qr,5),te(Yr,5)),n&2){let a;ie(a=ne())&&(o.bindToCartElemRef=a.first),ie(a=ne())&&(o.saveInactiveCartElemRef=a.first)}},decls:17,vars:25,consts:[["cartIdElement",""],["bindToCart",""],["saveInactiveCart",""],["for","cartNumber"],["role","search",1,"cx-asm-assignCart",3,"click"],["autocomplete","off","formcontrolname","cartNumber",3,"keydown.enter","blur","formControl"],[1,"cx-asm-reset",3,"click"],[1,"cx-icon","fas","fa-times-circle"],["class","cx-asm-bindCartToCustomer","type","submit",3,"disabled","cx-asm-active","cx-bind-loading","click",4,"ngIf"],["id","asm-save-inactive-cart-btn","class","cx-asm-bindCartToCustomer cx-asm-active","type","submit",3,"cx-bind-loading","click",4,"ngIf"],["type","submit",1,"cx-asm-bindCartToCustomer",3,"click","disabled"],["id","asm-save-inactive-cart-btn","type","submit",1,"cx-asm-bindCartToCustomer","cx-asm-active",3,"click"]],template:function(n,o){if(n&1){let a=y();
1m(0,"form")(1,"label",3),f(2),c(3,"cxTranslate"),p(),m(4,"div",4),c(5,"async"),c(6,"cxTranslate"),x("click",function(){h(a);let I=k(8);return C(I.focus())}),m(7,"input",5,0),c(9,"cxTranslate"),x("keydown.enter",function(){return h(a),C(o.bindCartToCustomer())})("blur",function(){return h(a),C(o.resetInput())}),p(),m(10,"button",6),c(11,"cxTranslate"),x("click",function(){return h(a),C(o.clearText())}),T(12,"cx-icon",7),p()(),g(13,Zr,12,23,"button",8),c(14,"async"),g(15,Jr,10,16,"button",9),c(16,"async"),p()}n&2&&(s(2),b("",l(3,11,"asm.bindCart.cartNumber")," "),s(2),j("active",l(5,13,o.valid$)),w("aria-label",l(6,15,"asm.bindCart.assignCartId")),s(3),u("formControl",o.cartId),w("aria-label",l(9,17,"asm.bindCart.enterCartId")),s(3),j("visible",(o.cartId.value==null?null:o.cartId.value.length)>0),w("aria-label",l(11,19,"asm.bindCart.resetCartId")),s(3),u("ngIf",l(14,21,o.displayBindCartBtn$)),s(2),u("ngIf",l(16,23,o.displaySaveCartBtn$)))},dependencies:[P,Le,ye,Te,we,Jt,Xe,un,fi,z,B],encapsulation:2,changeDetection:0});let e=i;return e})(),ra=(()=>{let i=class i{constructor(t,n,o,a){this.launchDialogService=t,this.fb=n,this.asmCreateCustomerFacade=o,this.translationService=a,this.iconTypes=ke,this.isLoading$=new ee(!1),this.showDialogInfoAlert=!0,this.globalMessageType=X,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0},this.registerForm=this.fb.group({firstName:["",pe.required],lastName:["",pe.required],email:["",[pe.required,Fn.emailValidator]]})}submitForm(){this.registerForm.valid?this.registerUser():this.registerForm.markAllAsTouched()}registerUser(){this.isLoading$.next(!0);let{firstName:t,lastName:n,email:o}=this.registerForm.value;this.createdCustomer={firstName:t??"",lastName:n??"",email:o??""};let a=this.asmCreateCustomerFacade.createCustomer(this.collectDataFromRegisterForm());a.subscribe({next:_=>this.onRegisterUserSuccess(_),error:_=>this.onRegisterUserFail(_)}),a.subscribe({complete:()=>this.isLoading$.next(!1)})}collectDataFromRegisterForm(){return{firstName:this.createdCustomer.firstName,lastName:this.createdCustomer.lastName,emailAddress:this.createdCustomer.email}}closeModal(t){this.launchDialogService.closeDialog(t)}closeDialogInfoAlert(){this.showDialogInfoAlert=!1}closeDialogBackendErroAlert(t){this.showDialogBackendErrorAlerts[t]=!1}onRegisterUserSuccess(t){this.launchDialogService.closeDialog(t)}onRegisterUserFail(t){this.isLoading$.next(!1),this.backendErrorMessages=[],this.showDialogBackendErrorAlerts=[];let n="httpHandlers.unknownError",o=t.details??[];o.length===0&&this.addErrorMessage(n),o.forEach(a=>{switch(a.type||""){case"ValidationError":this.addErrorMessage(`asm.createCustomerForm.validationErrors.${a.subject}`);break;case"AssistedServiceDuplicatedUidError":this.addErrorMessage("asm.createCustomerForm.badRequestDuplicatedEmail",{emailAddress:this.createdCustomer.email});break;default:this.addErrorMessage(n)}})}addErrorMessage(t,n){this.translationService.translate(t,n).pipe(Di()).subscribe(o=>{this.backendErrorMessages.push(o),this.showDialogBackendErrorAlerts.push(!0)})}};i.\u0275fac=function(n){return new(n||i)(S(G),S(_n),S(Et),S(Yt))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-create-customer-form"]],decls:23,vars:17,consts:[["loading",""],[1,"cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[3,"ngSubmit","formGroup"],[1,"cx-dialog-header","modal-header"],[1,"title","modal
1-title"],[1,"cx-dialog-body","modal-body"],[1,"message-container"],[3,"text","type","closeMessage",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"modal-footer"],["type","submit",1,"btn","cx-asm-create-customer-btn","cx-asm-create-customer-btn-create"],["type","button",1,"btn","cx-asm-create-customer-btn","cx-asm-create-customer-btn-cancel",3,"click"],[3,"closeMessage","text","type"],[1,"form-group"],[1,"label-content"],["required","true","formControlName","firstName","name","text",1,"form-control",3,"placeholder"],[3,"control"],["required","true","name","text","formControlName","lastName",1,"form-control",3,"placeholder"],["required","true","name","email","formControlName","email",1,"form-control",3,"placeholder"],[1,"cx-spinner"]],template:function(n,o){if(n&1){let a=y();m(0,"div",1),x("esc",function(){return h(a),C(o.closeModal("Escape clicked"))}),m(1,"div",2),E(2),m(3,"form",3),x("ngSubmit",function(){return h(a),C(o.submitForm())}),m(4,"div",4)(5,"h2",5),f(6),c(7,"cxTranslate"),p()(),m(8,"div",6)(9,"div",7),g(10,Xr,2,4,"cx-message",8)(11,to,2,1,"ng-container",9),p(),g(12,io,25,21,"div",10),c(13,"async"),p(),m(14,"div",11)(15,"button",12),f(16),c(17,"cxTranslate"),p(),m(18,"button",13),x("click",function(){return h(a),C(o.closeModal("Cancel click"))}),f(19),c(20,"cxTranslate"),p()()(),A(),p()(),g(21,no,2,0,"ng-template",null,0,O)}if(n&2){let a=k(22);u("cxFocus",o.focusConfig),s(3),u("formGroup",o.registerForm),s(3),b(" ",l(7,9,"asm.createCustomerForm.title")," "),s(4),u("ngIf",o.showDialogInfoAlert),s(),u("ngForOf",o.backendErrorMessages),s(),u("ngIf",!l(13,11,o.isLoading$))("ngIfElse",a),s(4),b(" ",l(17,13,"asm.createCustomerForm.createAccount")," "),s(3),b(" ",l(20,15,"asm.createCustomerForm.cancel")," ")}},dependencies:[Ue,P,Le,ye,Te,we,xt,Ve,je,ze,ti,$e,bt,z,B],encapsulation:2});let e=i;return e})(),oa={launch:{ASM_CREATE_CUSTOMER_FORM:{inlineRoot:!0,component:ra,dialogType:He.DIALOG}}},hi=(()=>{let i=class i{constructor(t){this.fb=t,this.csAgentTokenLoading=!1,this.submitEvent=new Ht}ngOnInit(){this.csAgentLoginForm=this.fb.group({userId:["",[pe.required]],password:["",[pe.required]]})}onSubmit(){this.csAgentLoginForm.valid?this.submitEvent.emit({userId:this.csAgentLoginForm.get("userId")?.value,password:this.csAgentLoginForm.get("password")?.value}):this.csAgentLoginForm.markAllAsTouched()}};i.\u0275fac=function(n){return new(n||i)(S(Xt))},i.\u0275cmp=R({type:i,selectors:[["cx-csagent-login-form"]],inputs:{csAgentTokenLoading:"csAgentTokenLoading"},outputs:{submitEvent:"submitEvent"},decls:2,vars:2,consts:[[3,"formGroup","ngSubmit",4,"ngIf"],["aria-hidden","false",4,"ngIf"],[3,"ngSubmit","formGroup"],["required","true","type","text","formControlName","userId",3,"placeholder"],[3,"control"],["required","true","type","password","formControlName","password","cxPasswordVisibilitySwitch","",3,"placeholder"],["type","submit"],["aria-hidden","false"]],template:function(n,o){n&1&&g(0,ro,14,18,"form",0)(1,oo,2,3,"cx-dot-spinner",1),n&2&&(u("ngIf",!o.csAgentTokenLoading),s(),u("ngIf",o.csAgentTokenLoading))},dependencies:[P,Le,ye,Te,we,xt,Ve,je,ze,Tn,fi,B],encapsulation:2});let e=i;return e})(),Ci=(()=>{let i=class i{constructor(t,n,o,a,_){this.fb=t,this.asmService=n,this.config=o,this.directionService=a,this.launchDialogService=_,this.subscription=new ae,this.submitEvent=new Ht,this.activeFocusedButtonIndex=-1}ngOnInit(){this.customerSelectionForm=this.fb.group({searchTerm:["",pe.required]}),this.asmService.customerSearchReset(),this.searchResultsLoading$=this.asmService.getCustomerSearchResultsLoading(),this.searchResults=this.asmService.getCustomerSearchResults(),this.subscription.add(this.customerSelectionForm.controls.searchTerm.valueChanges.pipe(Li(300)).subscribe(t=>{this.handleSearchTerm(t)}))}handleSearchTerm(t){this.selectedCustomer&&t!==this.selectedCustomer.name&&(this.selectedCustomer=void 0),!this.selectedCustomer&&(this.asmService.customerSearchReset(),this.activeFocusedButtonIndex=-1,t.trim().length>=3&&this.asmService.customerSearch({query:t,pageSize:this.config.asm?.customerSearch?.maxResults}))}selectCustomerFromList(t,n){this.selectedCustomer=n,this.customerSelectionForm.controls.searchTerm.setValue(this.selectedCustomer.name),this.asmService.customerSearchReset(),this.searchTerm.nativeElement.focus(),t.preventDefault(),t.stopPropagation()}onSubmit(){this.customerSelectionForm.valid&&this.selectedCustomer?this.submitEvent.emit({customerId:this.selectedCustomer.customerId}):this.customerSelectionForm.markAllAsTouched()}onDocumentClick(t){if(this.resultList){if(this.resultList.nativeElement.contains(t.target)||this.searchTerm.nativeElement.contains(t.target))return;this.asmService.customerSearchReset()}}closeResults(t){this.asmService.customerSearchReset(),this.searchTerm.nativeElement.focus(),t.preventDefault(),t.stopPropagation()}ngOnDestroy(){this.subscription.unsubscribe(),this.asmService.customerSearchReset()}focusFirstItem(t){t.preventDefault(),this.activeFocusedButtonIndex=0,this.updateItemIndex(this.activeFocusedButtonIndex)}setSelectionEnd(t){if(t.preventDefault(),this.searchTerm.nativeElement.value?.length){let n=this.searchTerm.nativeElement.value.length;this.searchTerm.nativeElement.selectionStart=n,this.searchTerm.nativeElement.selectionEnd=n}}focusPreviousChild(t){t.preventDefault(),this.activeFocusedButtonIndex--,this.activeFocusedButtonIndex<0&&(this.activeFocusedButtonIndex=this.searchResultItems.length-1),this.updateItemIndex(this.activeFocusedButtonIndex)}focusNextChild(t){t.preventDefault(),this.activeFocusedButtonIndex++,this.activeFocusedButtonIndex>this.searchResultItems.length-1&&(this.activeFocusedButtonIndex=0),this.updateItemIndex(this.activeFocusedButtonIndex)}focusInputText(t){if(t.preventDefault(),this.activeFocusedButtonIndex=-1,this.searchTerm.nativeElement.focus(),this.searchTerm.nativeElement.value?.length){let n=this.searchTerm.nativeElement.selectionEnd,o=this.searchTerm.nativeElement.value.length;this.isBackNavigation(t)?n=n<=0?0:n-1:this.isForwardsNavigation(t)?n=n>=o?o:n+1:t.code==="Home"?n=0:t.code==="End"&&(n=o),this.searchTerm.nativeElement.selectionStart=n,this.searchTerm.nativeElement.selectionEnd=n}}updateItemIndex(t){this.searchResultItems.toArray()?.[t]?.nativeElement.focus()}createCustomer(){this.asmService.customerSearchReset(),this.launchDialogService.openDialogAndSubscribe("ASM_CREATE_CUSTOMER_FORM",this.createCustomerLink)}isForwardsNavigation(t){return t.code==="ArrowRight"&&this.isLTRDirection()||t.code==="ArrowLeft"&&this.isRTLDirection()}isBackNavigation(t){return t.code==="ArrowLeft"&&this.isLTRDirection()||t.code==="ArrowRight"&&this.isRTLDirection()}isLTRDirection(){return this.directionService.getDirection()===ei.LTR}isRTLDirection(){return this.directionService.getDirection()===ei.RTL}};i.\u0275fac=function(n){return new(n||i)(S(Xt),S(qe),S(Qe),S(Mn),S(G))},i.\u0275cmp=R({type:i,selectors:[["cx-customer-selection"]],viewQuery:function(n,o){if(n&1&&(te(so,5),te(ao,5),te(co,5),te(lo,5)),n&2){let a;ie(a=ne())&&(o.resultList=a.first),ie(a=ne())&&(o.searchTerm=a.first),ie(a=ne())&&(o.createCustomerLink=a.first),ie(a=ne())&&(o.searchResultItems=a)}},hostBindings:function(n,o){n&1&&x("click",function(_){return o.onDocumentClick(_)},!1,mt)},outputs:{submitEvent:"submitEvent"},decls:14,vars:19,consts:[["searchTerm",""],["resultList",""],["searchResultItem",""],["createCustomerLink",""],[3,"ngSubmit","formGroup"],["required","true","type","text","formControlName","searchTerm",3,"keydown.arrowdown","keydown.end","placeholder"],[3,"control"],["type","submit"],["class","asm-results",4,"ngIf"],[1,"asm-results"],[3,"tabindex","active","keydown.arrowup","keydown.arrowdown","keydown.arrowright","keydown.arrowleft","keydown.enter","keydown.escape","keydown.home","keydown.end","click",4,"ngFor","ngForOf"],[3,"active","click","keydown.escape","keydown.arrowright","keydown.arrowleft","keydown.home","keydown.end",4,"ngIf"],[3,"keydown.arrowup","keydown.arrowdown","keydown.arrowright","keydown.arrowleft","keydown.enter","keydown.escape","keydown.home","keydown.end","click","tabindex"],[1,"result-name"],[1,"result-id"],[3,"click","keydown.escape","keydown.arrowright","keydown.arrowleft","keydown.home","keydown.end"],[1,"linkStyleLabel"],["aria-hidden","false"]],template:function(n,o){if(n&1){let a=y();m(0,"form",4),x("ngSubmit",function(){return h(a),C(o.onSubmit())}),m(1,"label")(2,"input",5,0),c(4,"cxTranslate"),c(5,"cxTranslate"),x("keydown.arrowdown",function(I){return h(a),C(o.focusFirstItem(I))})("keydown.end",function(I){return h(a),C(o.setSelectionEnd(I))}),p(),T(6,"cx-form-errors",6),p(),m(7,"button",7),f(8),c(9,"cxTranslate"),p()(),g(10,po,5,4,"div",8),c(11,"async"),g(12,go,3,3,"div",8),c(13,"async")}n&2&&(u("formGroup",o.customerSelectionForm),s(2),F("placeholder",l(4,9,"asm.customerSearch.searchTerm.label")),w("aria-label",l(5,11,"asm.customerSearch.searchTerm.label")),s(4),u("control",o.customerSelectionForm.get("searchTerm")),s(),j("active",o.selectedCustomer),s(),b(" ",l(9,13,"asm.customerSearch.submit")," "),s(2),u("ngIf",l(11,15,o.searchResults)),s(2),u("ngIf",l(13,17,o.searchResultsLoading$)))},dependencies:[Ue,P,Le,ye,Te,we,xt,Ve,je,ze,fi,z,B],encapsulation:2});let e=i;return e})(),sa=(()=>{let i=class i{transform(t){t<0&&(t=0);let n=Math.floor(t/60),o=t%60,a;n<10?a=("00"+n).slice(-2):a=n+"";let _=("00"+o).slice(-2);return`${a}:${_}`}};i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=$t({name:"formatTimer",type:i,pure:!0});let e=i;return e})(),xi=(()=>{let i=class i{constructor(t,n,o,a,_){this.config=t,this.asmComponentService=n,this.routingService=o,this.changeDetectorRef=a,this.userIdService=_,this.subscriptions=new ae,this.maxStartDelayInSeconds=6e4}ngOnInit(){this.initTimer(),this.interval=setInterval(()=>{let t=new Date().getTime()/1e3;this.timeLeft=Math.floor(this.expiredTime-t),this.timeLeft<=0&&(clearInterval(this.interval),this.asmComponentService.logoutCustomerSupportAgentAndCustomer()),this.changeDetectorRef.markForCheck()},1e3),this.resetOnNavigate(),this.resetOnCustomerSessionChange()}resetOnNavigate(){this.subscriptions.add(this.routingService.isNavigating().subscribe(t=>{t&&this.resetTimer()}))}resetOnCustomerSessionChange(){this.subscriptions.add(this.userIdService.getUserId().pipe(ct()).subscribe(()=>this.resetTimer()))}initTimer(){let t=this.getTimerStartDelayInSeconds(),n=new Date().getTime()/1e3;this.timeLeft=t,this.expiredTime=n+this.timeLeft}resetTimer(){this.timeLeft>0&&this.initTimer()}getTimerStartDelayInSeconds(){return this.config.asm?.agentSessionTimer?.startingDelayInSeconds===void 0?600:this.config.asm.agentSessionTimer.startingDelayInSeconds>this.maxStartDelayInSeconds?this.maxStartDelayInSeconds:this.config.asm.agentSessionTimer.startingDelayInSeconds}ngOnDestroy(){this.subscriptions.unsubscribe(),this.interval&&clearInterval(this.interval)}};i.\u0275fac=function(n){return new(n||i)(S(Qe),S(Re),S(J),S(Vi),S(Oe))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-session-timer"]],decls:9,vars:12,consts:[[1,"label"],[1,"time"],[1,"reset",3,"click","title"]],template:function(n,o){n&1&&(m(0,"span",0),f(1),c(2,"cxTranslate"),p(),m(3,"span",1),f(4),c(5,"formatTimer"),c(6,"cxTranslate"),p(),m(7,"button",2),c(8,"cxTranslate"),x("click",function(){return o.resetTimer()}),p()),n&2&&(s(),b("",l(2,4,"asm.agentSessionTimer.label"),":"),s(3),Bi("",l(5,6,o.timeLeft)," ",l(6,8,"asm.agentSessionTimer.minutes"),""),s(3),F("title",l(8,10,"asm.agentSessionTimer.reset")))},dependencies:[B,sa],encapsulation:2});let e=i;return e})(),vi=(()=>{let i=class i{constructor(t,n,o,a){this.asmComponentService=t,this.userAccountFacade=n,this.launchDialogService=o,this.featureModules=a,this.isAsmCustomer360Configured=!1,this.isAsmCustomer360Loaded$=new ee(!1),this.subscription=new ae}ngOnInit(){this.isAsmCustomer360Configured=this.featureModules?.isConfigured("asmCustomer360"),this.isAsmCustomer360Configured&&this.featureModules?.resolveFeature
1("asmCustomer360").subscribe(()=>{this.isAsmCustomer360Loaded$.next(!0)}),this.subscription.add(this.userAccountFacade.get().subscribe(t=>{t&&(this.customer=t)})),this.isCustomerEmulationSessionInProgress$=this.asmComponentService.isCustomerEmulationSessionInProgress()}logoutCustomer(){this.asmComponentService.logoutCustomer()}openAsmCustomer360(){this.subscription.add(this.isAsmCustomer360Loaded$.pipe(N(t=>!!t)).subscribe(()=>{let t={customer:this.customer};this.launchDialogService?.openDialogAndSubscribe("ASM_CUSTOMER_360",this.asmCustomer360LauncherElement,t),this.subscription.add(this.launchDialogService?.dialogClose.pipe(N(n=>!!n)).subscribe(n=>{this.asmComponentService.handleAsmDialogAction(n)}))}))}ngOnDestroy(){this.subscription.unsubscribe()}};i.\u0275fac=function(n){return new(n||i)(S(Re),S(de),S(G),S(ht))},i.\u0275cmp=R({type:i,selectors:[["cx-customer-emulation"]],viewQuery:function(n,o){if(n&1&&te(_o,5),n&2){let a;ie(a=ne())&&(o.asmCustomer360LauncherElement=a.first)}},decls:2,vars:3,consts:[["asmCustomer360Launcher",""],[4,"ngIf"],[1,"cx-asm-customerInfo"],[1,"cx-asm-name"],[1,"cx-asm-uid"],["class","cx-360-button",3,"click",4,"ngIf"],["formcontrolname","logoutCustomer",3,"click"],[1,"cx-360-button",3,"click"]],template:function(n,o){n&1&&(g(0,ho,11,6,"ng-container",1),c(1,"async")),n&2&&u("ngIf",l(1,1,o.isCustomerEmulationSessionInProgress$))},dependencies:[P,na,z,B],encapsulation:2});let e=i;return e})(),Si=(()=>{let i=class i{constructor(t){this.asmService=t,this.subscription=new ae}ngOnInit(){this.subscription.add(this.asmService.getAsmUiState().subscribe(t=>{this.isCollapsed=t.collapsed===void 0?!1:t.collapsed}))}toggleUi(){this.asmService.updateAsmUiState({collapsed:!this.isCollapsed})}ngOnDestroy(){this.subscription.unsubscribe()}};i.\u0275fac=function(n){return new(n||i)(S(qe))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-toggle-ui"]],decls:4,vars:3,consts:[["tabindex","0","role","button",1,"toggleUi",3,"click"],[3,"ngClass"],["class","label",4,"ngIf"],[1,"label"]],template:function(n,o){n&1&&(m(0,"a",0),x("click",function(){return o.toggleUi()}),T(1,"span",1),g(2,Co,3,3,"span",2)(3,xo,3,3,"span",2),p()),n&2&&(s(),u("ngClass",o.isCollapsed?"expandIcon":"collapseIcon"),s(),u("ngIf",!o.isCollapsed),s(),u("ngIf",o.isCollapsed))},dependencies:[$i,P,B],encapsulation:2});let e=i;return e})(),aa={active:"asm.activeCartAlertInfo",inactive:"asm.saveInactiveCartAlertInfo"},bi=(()=>{let i=class i{constructor(t,n,o,a,_,I,$,H){this.authService=t,this.csAgentAuthService=n,this.asmComponentService=o,this.globalMessageService=a,this.routingService=_,this.asmService=I,this.userAccountFacade=$,this.launchDialogService=H,this.iconTypes=ke,this.showDeeplinkCartInfoAlert$=this.asmComponentService.shouldShowDeeplinkCartInfoAlert(),this.deeplinkCartAlertKey="",this.showCreateCustomerSuccessfullyAlert=!1,this.globalMessageType=X,this.disabled=!1,this.startingCustomerSession=!1,this.showCustomerEmulationInfoAlert=!0,this.subscription=new ae}ngOnInit(){this.customerSupportAgentLoggedIn$=this.csAgentAuthService.isCustomerSupportAgentLoggedIn().pipe(ct(),K(t=>{t||this.closeModal()})),this.csAgentTokenLoading$=this.csAgentAuthService.getCustomerSupportAgentTokenLoading(),this.customer$=this.authService.isUserLoggedIn().pipe(Ie(t=>t?(this.handleCustomerSessionStartRedirection(),this.userAccountFacade.get()):W(void 0))),this.isCollapsed$=this.asmService.getAsmUiState().pipe(M(t=>t.collapsed===void 0?!1:t.collapsed)),this.subscription.add(this.launchDialogService.dialogClose.pipe(N(t=>!!t)).subscribe(t=>{typeof t!="string"&&("selectedUser"in t?(this.startCustomerEmulationSession(t.selectedUser),t.actionType===le.ORDER_HISTORY&&this.routingService.go({cxRoute:"orders"})):"customerId"in t&&(this.startCustomerEmulationSession({customerId:t.customerId}),this.showCreateCustomerSuccessfullyAlert=!0,this.routingService.go("/")),"actionType"in t&&t.actionType===le.ACTIVE_CART&&this.routingService.go({cxRoute:"cart"}))})),this.subscribeForDeeplink()}subscribeForDeeplink(){this.asmComponentService.isEmulateInURL()&&this.routingService.go("/");let t=this.asmComponentService.getDeepLinkUrlParams()??{customerId:this.asmComponentService.getSearchParameter("customerId"),orderId:this.asmComponentService.getSearchParameter("orderId"),ticketId:this.asmComponentService.getSearchParameter("ticketId"),cartId:this.asmComponentService.getSearchParameter("cartId"),cartType:this.asmComponentService.getSearchParameter("cartType"),emulated:!1};this.deeplinkCartAlertKey=aa[t.cartType||""],this.subscription.add(me([this.customerSupportAgentLoggedIn$,this.authService.isUserLoggedIn(),this.asmComponentService.isEmulatedByDeepLink()]).subscribe(([n,o,a])=>{n&&t.customerId&&(!a&&o?this.confirmSwitchCustomer(t.customerId):setTimeout(()=>this.startSessionWithParameters(st(se({},t),{emulated:a}))))}
1))}confirmSwitchCustomer(t){this.customer$.pipe(N(n=>!!n),U(1)).subscribe(n=>{n?.customerId!==t?this.userAccountFacade.getById(t).subscribe({next:o=>{this.launchDialogService.openDialogAndSubscribe("ASM_SWITCH_CUSTOMER",this.element,{curCustomer:n,switchCustomer:o})},error:o=>{this.globalMessageService.add(o.details?.[0].message??"",X.MSG_TYPE_ERROR)}}):this.asmComponentService.setEmulatedByDeepLink(!0)})}startSessionWithParameters(t){t.emulated||(this.asmComponentService.setEmulatedByDeepLink(!0),this.startCustomerEmulationSession({customerId:t.customerId},t))}handleCustomerSessionStartRedirection(){this.asmComponentService.isCustomerEmulationSessionInProgress().pipe(U(1)).subscribe(t=>{this.startingCustomerSession&&t&&(this.startingCustomerSession=!1,this.globalMessageService.remove(X.MSG_TYPE_ERROR),this.routingService.go("/"))})}loginCustomerSupportAgent({userId:t,password:n}){this.csAgentAuthService.authorizeCustomerSupportAgent(t,n)}logout(){this.asmComponentService.logoutCustomerSupportAgentAndCustomer()}startCustomerEmulationSession({customerId:t},n){t?(this.csAgentAuthService.startCustomerEmulationSession(t),this.startingCustomerSession=!0,this.showCustomerEmulationInfoAlert=!0,this.showCreateCustomerSuccessfullyAlert=!1,n&&this.asmComponentService.handleDeepLinkNavigation(se({customerId:t},n))):this.globalMessageService.add({key:"asm.error.noCustomerId"},X.MSG_TYPE_ERROR)}hideUi(){this.disabled=!0,this.asmComponentService.unload()}showCustomList(){this.launchDialogService.openDialogAndSubscribe("ASM_CUSTOMER_LIST",this.element)}closeModal(){this.launchDialogService.closeDialog("logout")}createCustomer(){this.launchDialogService?.openDialogAndSubscribe("ASM_CREATE_CUSTOMER_FORM",this.addNewCustomerLink)}closeDialogConfirmationAlert(){this.showCreateCustomerSuccessfullyAlert=!1}closeDeeplinkCartInfoAlert(){this.asmComponentService.setShowDeeplinkCartInfoAlert(!1)}closeCustomerEmulationInfoAlert(){this.showCustomerEmulationInfoAlert=!1}ngOnDestroy(){this.subscription?.unsubscribe()}};i.\u0275fac=function(n){return new(n||i)(S(oe),S(Ke),S(Re),S(be),S(J),S(qe),S(de),S(G))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-main-ui"]],viewQuery:function(n,o){if(n&1&&(te(vo,5),te(pr,5)),n&2){let a;ie(a=ne())&&(o.element=a.first),ie(a=ne())&&(o.addNewCustomerLink=a.first)}},hostVars:2,hostBindings:function(n,o){n&2&&j("hidden",o.disabled)},decls:20,vars:23,consts:[["customerListLink",""],["showLoginForm",""],["showCustomerSelection",""],[1,"asm-bar"],[1,"asm-bar-branding"],["src","data:image/png;base64,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","width","48","height","24",1,"logo",3,"alt"],[1,"asm-title"],[1,"asm-bar-actions"],["class","cx-asm-customer-list",4,"ngIf"],[4,"ngIf"],["class","close",3,"title","click",4,"ngIf"],["class","logout",3,"title","click",4,"ngIf"],[1,"cx-asm-customer-list"],["tabindex","0","role","button",1,"cx-asm-customer-list-link",3,"click"],[3,"type"],[1,"close",3,"click","title"],[1,"logout",3,"click","title"],[4,"ngIf","ngIfElse"],[3,"text","type","closeMessage",4,"ngIf"],[3,"closeMessage","text","type"],[3,"submitEvent",4,"ngIf"],[3,"submitEvent"],[3,"csAgentTokenLoading","submitEvent",4,"ngIf"],[3,"submitEvent","csAgentTokenLoading"]],template:function(n,o){n&1&&(m(0,"div",3)(1,"div",4),T(2,"img",5),c(3,"cxTranslate"),m(4,"div",6),f(5),c(6,"cxTranslate"),p()(),m(7,"div",7),g(8,So,7,4,"div",8),c(9,"async"),T(10,"cx-asm-toggle-ui"),g(11,bo,1,0,"cx-asm-session-timer",9),c(12,"async"),g(13,yo,2,3,"button",10),c(14,"async"),c(15,"async"),g(16,To,2,3,"button",11),c(17,"async"),p()(),g(18,Bo,5,4,"ng-container",9),c(19,"async")),n&2&&(s(2),F("alt",l(3,7,"asm.mainLogoLabel")),s(3),b(" ",l(6,9,"asm.mainTitle")," "),s(3),u("ngIf",l(9,11,o.customerSupportAgentLoggedIn$)),s(3),u("ngIf",l(12,13,o.customerSupportAgentLoggedIn$)),s(2),u("ngIf",!l(14,15,o.customerSupportAgentLoggedIn$)&&!l(15,17,o.csAgentTokenLoading$)),s(3),u("ngIf",l(17,19,o.customerSupportAgentLoggedIn$)),s(2),u("ngIf",!l(19,21,o.isCollapsed$)))},dependencies:[P,Xe,bt,hi,Ci,xi,vi,Si,z,B],encapsulation:2});let e=i;return e})(),gi=function(e){return e.CANCEL="CANCEL",e.SWITCH="SWITCH",e}(gi||{}),ca=(()=>{let i=class i{constructor(t,n){this.launchDialogService=t,this.asmComponentService=n,this.SWITCH_CUSTOMER_DIALOG_ACTION=gi,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}ngOnInit(){this.launchDialogService.data$.pipe(U(1)).subscribe(t=>{this.curCustomerName=t.curCustomer.name||"",this.switchCustomerName=t.switchCustomer.name||""})}closeModal(t){t===gi.SWITCH&&this.asmComponentService.logoutCustomer(),this.launchDialogService.closeDialog(t)}
1};i.\u0275fac=function(n){return new(n||i)(S(G),S(Re))},i.\u0275cmp=R({type:i,selectors:[["cx-asm-switch-customer-dialog"]],decls:23,vars:23,consts:[[1,"cx-asm-switch-customer-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["type","WARNING"],["id","asm-switch-customer-dialog-title",1,"title","modal-title"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row","switch-customer-content"],[1,"cx-dialog-item"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-secondary",3,"click"]],template:function(n,o){n&1&&(m(0,"div",0),x("esc",function(){return o.closeModal(o.SWITCH_CUSTOMER_DIALOG_ACTION.CANCEL)}),m(1,"div",1)(2,"div",2)(3,"div")(4,"span"),T(5,"cx-icon",3),p(),m(6,"span",4),f(7),c(8,"cxTranslate"),p()()(),m(9,"div",5)(10,"div",6)(11,"div",7),f(12),c(13,"cxTranslate"),p()()(),m(14,"div",8)(15,"button",9),c(16,"cxTranslate"),x("click",function(){return o.closeModal(o.SWITCH_CUSTOMER_DIALOG_ACTION.SWITCH)}),f(17),c(18,"cxTranslate"),p(),m(19,"button",10),c(20,"cxTranslate"),x("click",function(){return o.closeModal(o.SWITCH_CUSTOMER_DIALOG_ACTION.CANCEL)}),f(21),c(22,"cxTranslate"),p()()()()),n&2&&(u("cxFocus",o.focusConfig),s(7),b(" ",l(8,7,"asm.switchCustomer.dialog.title")," "),s(5),b(" ",ut(13,9,"asm.switchCustomer.dialog.body",Ce(20,Uo,o.curCustomerName,o.switchCustomerName))," "),s(3),w("aria-label",l(16,12,"asm.switchCustomer.dialog.actions.switch")),s(2),b(" ",l(18,14,"asm.switchCustomer.dialog.actions.switch")," "),s(2),w("aria-label",l(20,16,"common.cancel")),s(2),b(" ",l(22,18,"common.cancel")," "))},dependencies:[Xe,$e,B],encapsulation:2});let e=i;return e})(),la=(()=>{let i=class i{constructor(t,n,o,a,_,I){this.launchDialogService=t,this.breakpointService=n,this.asmConfig=o,this.translation=a,this.asmCustomerListFacade=_,this.occConfig=I,this.DEFAULT_PAGE_SIZE=5,this.focusConfig={trap:!0,block:!0,autofocus:"customer-list-selector",focusOnEscape:!0},this.iconTypes=ke,this.BREAKPOINT=Je,this.currentPage=0,this.maxPage=0,this.loaded=!1,this.listsError=!1,this.listsEmpty=!1,this.enableAsmB2bCustomerList=!1,this.customerListColumnActionType=le,this.searchBox=new dn,this.teardown=new ae,this.breakpoint$=this.getBreakpoint()}ngOnInit(){this.pageSize=this.asmConfig.asm?.customerList?.pageSize??this.DEFAULT_PAGE_SIZE,this.customerListConfig=this.asmConfig?.asm?.customerList,this.customerListsPage$=this.asmCustomerListFacade.getCustomerListsState().pipe(K(t=>this.listsError=!!t.error),M(t=>{if(t?.data?.userGroups?.length===0){this.listsEmpty=!0;return}else return t.data}),ct(),K(t=>{this.selectedUserGroupId||(this.selectedUserGroupId=t?.userGroups?.[0]?.uid,this.sorts=null,this.fetchCustomers())}))??wi,this.customerSearchLoading$=this.asmCustomerListFacade.getCustomerListCustomersSearchResultsLoading().pipe(K(t=>this.loaded=!t)),this.teardown.add(this.customerSearchLoading$.subscribe()),this.teardown.add(()=>this.asmCustomerListFacade.customerListCustomersSearchReset()),this.customerSearchError$=this.asmCustomerListFacade.getCustomerListCustomersSearchResultsError(),this.customerSearchPage$=this.asmCustomerListFacade.getCustomerListCustomersSearchResults().pipe(K(t=>{t?.sorts&&(this.sorts=t.sorts,this.sortCode=t.pagination?.sort),t?.entries.length<this.pageSize?this.maxPage=t.pagination?.currentPage??0:this.maxPage=this.currentPage+1}))}ngOnDestroy(){this.teardown.unsubscribe()}changePage(t){let n={customerListId:this.selectedUserGroupId,pageSize:this.pageSize,currentPage:t,sort:this.sortCode};this.searchBox?.value&&(n.query=this.searchBox.value),this.asmCustomerListFacade.customerListCustomersSearch(n)}fetchCustomers(){if(this.enableAsmB2bCustomerList=this.selectedUserGroupId==="b2bCustomerList",this.selectedUserGroupId){let t={customerListId:this.selectedUserGroupId,pageSize:this.pageSize,currentPage:this.currentPage};this.sortCode&&(t.sort=this.sortCode),this.searchBox?.value&&(t.query=this.searchBox.value),this.asmCustomerListFacade.customerListCustomersSearchReset(),this.asmCustomerListFacade.customerListCustomersSearch(t)}this.updateCustomerListColumns()}updateCustomerListColumns(){let t=this.customerListConfig?.columns||[];for(let n of t)(n.headerLocalizationKey==="asm.customerList.tableHeader.account"||n.headerLocalizationKey==="hideHeaders")&&(n.headerLocalizationKey=this.enableAsmB2bCustomerList?"asm.customerList.tableHeader.account":"hideHeaders")}onChangeCustomerGroup(){this.currentPage=0,this.sorts=null,this.sortCode="",this.fetchCustomers()}getGroupName(t,n){return t?.userGroups?.find(o=>o.uid===n)?.name??""}getBadgeText(t){return(t.firstName?.charAt(0)??"")+(t.lastName?.charAt(0)??"")}startColumnAction(t,n){this.selectedCustomer=t;let o={actionType:n,selectedUser:t};this.closeModal(o)}onKey(t){t.key==="Enter"&&this.searchCustomers()}searchCustomers(){this.currentPage=0,this.fetchCustomers()}isRequired(t,n){return n===le.ACTIVE_CART&&!t.lastCartId||n===le.ORDER_HISTORY&&t.hasOrder!==!0}changeSortCode(t){this.sortCode=t,this.fetchCustomers()}goToNextPage(){this.currentPage>=this.maxPage?this.currentPage=this.maxPage:this.loaded&&(this.currentPage++,this.fetchCustomers())}goToPreviousPage(){this.currentPage<=0?this.currentPage=0:this.loaded&&(this.currentPage--,this.fetchCustomers())}closeModal(t){this.launchDialogService.closeDialog(t)}
1getSortLabels(){return me([this.translation.translate("asm.customerList.tableSort.byName"),this.translation.translate("asm.customerList.tableSort.byNameAsc"),this.translation.translate("asm.customerList.tableSort.byNameDesc"),this.translation.translate("asm.customerList.tableSort.byDateAsc"),this.translation.translate("asm.customerList.tableSort.byDateDesc"),this.translation.translate("asm.customerList.tableSort.byOrderDateAsc"),this.translation.translate("asm.customerList.tableSort.byOrderDateDesc"),this.translation.translate("asm.customerList.tableSort.byUnit"),this.translation.translate("asm.customerList.tableSort.byUnitDesc")]).pipe(M(([t,n,o,a,_,I,$,H,_e])=>({byName:t,byNameAsc:n,byNameDesc:o,byOrderDateAsc:I,byOrderDateDesc:$,byDateAsc:a,byDateDesc:_,byUnit:H,byUnitDesc:_e})))}createCustomer(){this.launchDialogService.closeDialog("Create customer click"),this.launchDialogService?.openDialogAndSubscribe("ASM_CREATE_CUSTOMER_FORM",this.addNewCustomerLink)}getBreakpoint(){return this.breakpointService.breakpoint$.pipe(M(t=>((t===Je.lg||t===Je.xl)&&(t=Je.md),t)))}};i.\u0275fac=function(n){return new(n||i)(S(G),S(Sn),S(Qe),S(Yt),S(At),S(en))},i.\u0275cmp=R({type:i,selectors:[["cx-customer-list"]],viewQuery:function(n,o){if(n&1&&te(pr,5),n&2){let a;ie(a=ne())&&(o.addNewCustomerLink=a.first)}},decls:48,vars:28,consts:[["cell",""],["cellContent",""],["search",""],["total",""],["sort",""],["pagination",""],["groupSelector",""],["closeButton",""],["createCustomerButton",""],[1,"cx-asm-customer-list","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["id","asm-customer-list-title",1,"title","modal
1-title"],["id","asm-customer-list-desc",1,"cx-visually-hidden"],[4,"ngTemplateOutlet"],["class","cx-dialog-sub-header modal-header",3,"tablet-mobile",4,"ngIf"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row"],[1,"cx-dialog-item"],["class","cx-error-state",4,"ngIf"],[4,"ngIf"],["class","cx-dialog-sub-header modal-header cx-dialog-foot",3,"asm-mobile-pagination",4,"ngIf"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","cx-asm-customer-list-btn-cancel",3,"click"],[1,"cx-dialog-sub-header","modal-header"],[1,"cx-header-select"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"cx-header-actions"],[1,"cx-error-state"],["id","asm-cusomer-list-table","role","table","class","table",4,"ngIf"],["class","cx-empty-state",4,"ngIf"],["id","asm-cusomer-list-table","role","table",1,"table"],[1,"cx-visually-hidden"],["role","row",4,"ngFor","ngForOf"],["role","row"],["role","columnheader",4,"ngFor","ngForOf"],["role","columnheader"],["role","cell","class","cx-multi-cell",4,"ngIf"],["role","cell",4,"ngFor","ngForOf"],["role","cell"],["role","cell",1,"cx-multi-cell"],[4,"ngFor","ngForOf"],[1,"cx-empty-state"],[1,"cx-dialog-sub-header","modal-header","cx-dialog-foot"],[3,"viewPageEvent","pagination"],["class","cx-cell-container",4,"ngIf"],[1,"cx-cell-container"],["class","cx-header-text",4,"ngIf"],["class","cx-avatar",4,"ngIf"],["class","btn btn-link cx-action-link cx-btn-cell",3,"class","disabled","click",4,"ngIf"],[1,"cx-header-text"],[1,"cx-avatar"],[3,"alt",4,"ngIf"],["class","cx-avatar-text",4,"ngIf"],[3,"alt"],[1,"cx-avatar-text"],[1,"btn","btn-link","cx-action-link","cx-btn-cell",3,"click","disabled"],[3,"cx-action-color","type",4,"ngIf"],[3,"type"],[1,"form-group","search-wrapper"],["type","text",1,"form-control",3,"keyup","formControl","placeholder"],["role","button",1,"search",3,"click","type"],["class","cx-total",4,"ngIf"],[1,"cx-total"],[1,"sort-selector",3,"sortListEvent","sortOptions","sortLabels","selectedOption","placeholder","cxNgSelectA11y"],[1,"cx-pagination-buttons"],["class","btn btn-link cx-action-link cx-btn-previous",3,"disabled","click",4,"ngIf"],["class","btn btn-link cx-action-link cx-btn-next",3,"disabled","click",4,"ngIf"],[1,"btn","btn-link","cx-action-link","cx-btn-previous",3,"click","disabled"],[1,"previous",3,"type"],[1,"btn","btn-link","cx-action-link","cx-btn-next",3,"click","disabled"],[1,"next",3,"type"],["bindLabel","name","bindValue","uid",1,"customer-list-selector",3,"change","ngModelChange","searchable","clearable","tabIndex","ngModel","items","cxNgSelectA11y"],["type","button",1,"close",3,"click"],["aria-hidden","true"],["type","button",1,"btn","cx-asm-create-customer-btn",3,"click"]],template:function(n,o){if(n&1){let a=y();m(0,"div",9),x("esc",function(){return h(a),C(o.closeModal("Escape clicked"))}),m(1,"div",10),E(2),m(3,"div",11)(4,"h2",12),f(5),c(6,"cxTranslate"),p(),m(7,"div",13),f(8),c(9,"cxTranslate"),p(),g(10,jo,1,0,null,14),p(),g(11,Yo,11,24,"div",15),c(12,"async"),m(13,"div",16)(14,"div",17)(15,"div",18),g(16,Zo,3,3,"div",19)(17,Jo,3,3,"div",19)(18,Xo,3,3,"div",19),c(19,"async"),g(20,es,1,0,"cx-spinner",20),c(21,"async"),g(22,As,3,2,"div",20),c(23,"async"),p()()(),g(24,Ls,6,11,"div",21),c(25,"async"),m(26,"div",22)(27,"button",23),x("click",function(){return h(a),C(o.closeModal("Cancel click"))}),f(28),c(29,"cxTranslate"),p()(),A(),p()(),g(30,Ps,1,1,"ng-template",null,0,O)(32,$s,3,2,"ng-template",null,1,O)(34,Hs,6,11,"ng-template",null,2,O)(36,Qs,1,1,"ng-template",null,3,O)(38,Ks,7,14,"ng-template",null,4,O)(40,Zs,6,8,"ng-template",null,5,O)(42,Js,5,11,"ng-template",null,6,O)(44,Xs,4,4,"ng-template",null,7,O)(46,ea,5,4,"ng-template",null,8,O)}if(n&2){let a=k(47);u("cxFocus",o.focusConfig),s(5),b(" ",l(6,12,"asm.customerList.title")," "),s(3),b(" ",l(9,14,"asm.customerList.description")," "),s(2),u("ngTemplateOutlet",a),s(),u("ngIf",l(12,16,o.customerListsPage$)),s(5),u("ngIf",o.listsEmpty),s(),u("ngIf",o.listsError),s(),u("ngIf",l(19,18,o.customerSearchError$)),s(2),u("ngIf",l(21,20,o.customerSearchLoading$)),s(2),u("ngIf",l(23,22,o.customerSearchPage$)),s(2),u("ngIf",l(25,24,o.
1customerListsPage$)),s(4),b(" ",l(29,26,"asm.createCustomerForm.cancel")," ")}},dependencies:[Ue,P,Hi,ye,Te,Jt,Xe,hn,gn,ti,$e,En,An,kn,z,B],encapsulation:2});let e=i;return e})(),ma={launch:{ASM_CUSTOMER_LIST:{inlineRoot:!0,component:la,dialogType:He.DIALOG}}},ua={launch:{ASM:{outlet:"cx-storefront",component:bi}}},pa={pagination:{rangeCount:2,addPrevious:!0,addNext:!0,addStart:!1,addEnd:!1,addFirst:!0,addLast:!0,addDots:!0,substituteDotsForSingularPage:!0,dotsLabel:"\xB7\xB7\xB7"}},da={launch:{ASM_BIND_CART:{inlineRoot:!0,component:ta,dialogType:He.DIALOG}}},ga={launch:{ASM_SAVE_CART:{inlineRoot:!0,component:ia,dialogType:He.DIALOG}}},_a={launch:{ASM_SWITCH_CUSTOMER:{inlineRoot:!0,component:ca,dialogType:He.DIALOG}}},fr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[Z(ua),Z(da),Z(ga),Z(_a),Z(ma),Z(pa),Z(oa)],imports:[re,vt,ft,St,vn,Cn,fn,yn,In,xn,wn,Ln,Dn,Rn]});let e=i;return e})();var ha=(()=>{let i=class i{constructor(t,n,o,a,_){this.http=t,this.occEndpointsService=n,this.converterService=o,this.config=a,this.baseSiteService=_,this.logger=Me(gt),this.baseSiteService.getActive().subscribe(I=>this.activeBaseSite=I)}getHeaders(){return Pe.createHeader(Ne,!0,new Gt)}customerLists(){let t=this.getHeaders(),n=new Ye().set("baseSite",this.activeBaseSite),o=this.occEndpointsService.buildUrl("asmCustomerLists",{},{baseSite:!1,prefix:!1});return this.http.get(o,{headers:t,params:n}).pipe(fe(a=>{throw Se(a,this.logger)}),this.converterService.pipeable(Kn))}customerSearch(t){let n=this.getHeaders(),o=new Ye().set("baseSite",this.activeBaseSite);t.sort!==void 0?o=o.set("sort",t.sort):t.customerListId||(o=o.set("sort","byNameAsc")),t.query!==void 0&&(o=o.set("query",t.query)),t.pageSize!==void 0&&(o=o.set("pageSize",t.pageSize.toString())),t.currentPage!==void 0&&(o=o.set("currentPage",t.currentPage.toString())),t.customerListId!==void 0&&(o=o.set("customerListId",t.customerListId));let a=this.occEndpointsService.buildUrl("asmCustomerSearch",{},{baseSite:!1,prefix:!1});return this.http.get(a,{headers:n,params:o}).pipe(fe(_=>{throw Se(_,this.logger)}),this.converterService.pipeable(Qn))}bindCart({cartId:t,customerId:n}){let o=Pe.createHeader(Ne,!0,new Gt),a=new Ye().set("baseSite",this.activeBaseSite).set("cartId",t).set("customerId",n),_=this.occEndpointsService.buildUrl("asmBindCart",{},{baseSite:!1,prefix:!1});return this.http.post(_,{},{headers:o,params:a}).pipe(fe(I=>{throw Se(I,this.logger)}))}createCustomer(t){let n=this.getHeaders(),o=new Ye().set("baseSite",this.activeBaseSite),a=this.occEndpointsService.buildUrl("asmCreateCustomer",{},{baseSite:!1,prefix:!1});return this.http.post(a,t,{headers:n,params:o}).pipe(fe(_=>{throw Se(_,this.logger)}))}};i.\u0275fac=function(n){return new(n||i)(v(zi),v(_t),v(an),v(Qe),v(tn))},i.\u0275prov=L({token:i,factory:i.\u0275fac});let e=i;return e})(),Ca={backend:{occ:{endpoints:{asmCustomerSearch:"/assistedservicewebservices/customers/search",asmCustomerLists:"/assistedservicewebservices/customerlists",asmBindCart:"/assistedservicewebservices/bind-cart",asmCreateCustomer:"/assistedservicewebservices/customers"}}}},hr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[Z(Ca),{provide:tt,useClass:ha}],imports:[re]});let e=i;return e})();var Cr=e=>({static:e});function xa(e,i){if(e&1){let r=y();m(0,"button",10),x("click",function(n){let o=h(r).$implicit,a=d(2);return C(a.selectCustomerFromList(n,o))}),m(1,"span",11),f(2),p(),m(3,"span",12),f(4),p()()}if(e&2){let r=i.$implicit;s(2),D(r.name),s(2),D(r.uid)}}function va(e,i){if(e&1){let r=y();m(0,"button",10),x("click",function(n){h(r);let o=d(2);return C(o.closeResults(n))}),f(1),c(2,"cxTranslate"),p()}e&2&&(s(),b(" ",l(2,1,"asm.customerSearch.noMatch")," "))}function Sa(e,i){if(e&1&&(m(0,"div",7,1),g(2,xa,5,2,"button",8)(3,va,3,3,"button",9),c(4,"async"),p()),e&2){let r=i.ngIf,t=d(),n=k(3);s(2),u("ngForOf",r.entries),s(),u("ngIf",!l(4,2,t.searchResultsLoading$)&&n.value.length>=3&&!!r.entries&&r.entries.length<=0)}}function ba(e,i){e&1&&(m(0,"div",7),T(1,"sip-spinner",13),p())}var xr=(()=>{let i=class i extends Ci{constructor(){super(...arguments),this.SIP_DATA_SELECTOR=Bn}onSubmit(){this.customerSelectionForm.valid&&this.selectedCustomer?this.submitEvent.emit({customerId:this.selectedCustomer.memberEmail}):this.customerSelectionForm.markAllAsTouched()}};i.\u0275fac=(()=>{let t;return function(o){return(t||(t=Fe(i)))(o||i)}})(),i.\u0275cmp=R({type:i,selectors:[["sip-customer-selection"]],hostBindings:function(n,o){n&1&&x("click",function(_){return o.onDocumentClick(_)},!1,mt)},features:[Be],decls:13,vars:21,consts:[["searchTerm",""],["resultList",""],[3,"ngSubmit","formGroup","sipDataSelector"],["type","text","formControlName","searchTerm",3,"placeholder"],[3,"control"],["type","submit",3,"disabled","sipDataSelector"],["class","asm-results",4,"ngIf"],[1,"asm-results"],[3,"click",4,"ngFor","ngForOf"],[3,"click",4,"ngIf"],[3,"click"],[1,"result-name"],[1,"result-id"],["customClass","blue"]],template:function(n,o){if(n&1){let a=y();m(0,"form",2),x("ngSubmit",function(){return h(a),C(o.onSubmit())}),m(1,"label"),T(2,"input",3,0),c(4,"cxTranslate"),T(5,"cx-form-errors",4),p(),m(6,"button",5),f(7),c(8,"cxTranslate"),p()(),g(9,Sa,5,4,"div",6),c(10,"async"),g(11,ba,2,0,"div",6),c(12,"async")}n&2&&(u("formGroup",o.customerSelectionForm)("sipDataSelector",ce(17,Cr,o.SIP_DATA_SELECTOR.FORM)),s(2),F("placeholder",l(4,9,"asm.customerSearch.searchTerm.label")),s(3),u("control",o.customerSelectionForm.get("searchTerm")),s(),u("disabled",!o.selectedCustomer)("sipDataSelector",ce(19,Cr,o.SIP_DATA_SELECTOR.SUBMIT_BUTTON)),s(),b(" ",l(8,11,"asm.customerSearch.submit")," "),s(2),u("ngIf",l(10,13,o.searchResults)),s(2),u("ngIf",l(12,15,o.searchResultsLoading$)))},dependencies:[Ue,P,Le,ye,Te,we,Ve,je,ze,Un,On,z,B],encapsulation:2,changeDetection:0});let e=i;return e})();function Ta(e,i){if(e&1){let r=y();E(0),m(1,"div",1)(2,"label",2),f(3),p(),m(4,"label",3),f(5),p()(),m(6,"button",4),x("click",function(){h(r);let n=d();return C(n.logoutCustomer())}),f(7),c(8,"cxTranslate"),p(),A()}if(e&2){let r=d();s(3),D(r.customer==null?null:r.customer.name),s(2),D(r.customer==null?null:r.customer.uid),s(2),b(" ",l(8,3,"asm.endSession")," ")}}var vr=(()=>{let i=class i extends vi{};i.\u0275fac=(()=>{let t;return function(o){return(t||(t=Fe(i)))(o||i)}})(),i.\u0275cmp=R({type:i,selectors:[["sip-customer-emulation"]],features:[Be],decls:2,vars:3,consts:[[4,"ngIf"],[1,"cx-asm-customerInfo"],[1,"cx-asm-name"],[1,"cx-asm-uid"],["formcontrolname","logoutCustomer",3,"click"]],template:function(n,o){n&1&&(g(0,Ta,9,5,"ng-container",0),c(1,"async")),n&2&&u("ngIf",l(1,1,o.isCustomerEmulationSessionInProgress$))},dependencies:[P,z,B],encapsulation:2,changeDetection:0});let e=i;return e})();function Ea(e,i){e&1&&T(0,"cx-asm-session-timer")}function Aa(e,i){if(e&1){let r=y();m(0,"button",9),c(1,"cxTranslate"),x("click",function(){h(r);let n=d(2);return C(n.hideUi())}),p()}e&2&&F("title",l(1,1,"asm.hideUi"))}function wa(e,i){if(e&1){let r=y();m(0,"button",10),c(1,"cxTranslate"),x("click",function(){h(r);let n=d(2);return C(n.logout())}),p()}e&2&&F("title",l(1,1,"asm.logout"))}function La(e,i){e&1&&T(0,"sip-customer-emulation")}function ka(e,i){if(e&1&&(E(0),g(1,La,1,0,"sip-customer-emulation",2),A()),e&2){let r=d(2).ngIf;s(),u("ngIf",r)}}function Da(e,i){if(e&1){let r=y();m(0,"sip-customer-selection",13),x("submitEvent",function(n){h(r);let o=d(5);return C(o.startCustomerEmulationSession(n))}),p()}}function Ra(e,i){if(e&1&&g(0,Da,1,0,"sip-customer-selection",12),e&2){let r=d(2).ngIf;u("ngIf",r)}}function Ma(e,i){if(e&1&&(E(0),g(1,ka,2,1,"ng-container",11),c(2,"async"),g(3,Ra,1,1,"ng-template",null,1,O),A()),e&2){let r=k(4),t=d(3);s(),u("ngIf",l(2,2,t.customer$))("ngIfElse",r)}}function Fa(e,i){if(e&1){let r=y();m(0,"cx-csagent-login-form",15),c(1,"async"),x("submitEvent",function(n){h(r);let o=d(4);return C(o.loginCustomerSupportAgent(n))}),p()}if(e&2){let r=d(4);u("csAgentTokenLoading",l(1,1,r.csAgentTokenLoading$))}}function Ba(e,i){if(e&1&&g(0,Fa,2,3,"cx-csagent-login-form",14),e&2){let r=d().ngIf;u("ngIf",r)}}function Ua(e,i){if(e&1&&(E(0),g(1,Ma,5,4,"ng-container",11),c(2,"async"),g(3,Ba,1,1,"ng-template",null,0,O),A()),e&2){let r=k(4),t=d(2);s(),u("ngIf",l(2,2,t.customerSupportAgentLoggedIn$))("ngIfElse",r)}}function Oa(e,i){if(e&1&&(E(0),m(1,"div",3)(2,"div",4)(3,"div",5),f(4),c(5,"cxTranslate"),p()(),m(6,"div",6),T(7,"cx-asm-toggle-ui"),g(8,Ea,1,0,"cx-asm-session-timer",2),c(9,"async"),g(10,Aa,2,3,"button",7),c(11,"async"),c(12,"async"),g(13,wa,2,3,"button",8),c(14,"async"),p()(),g(15,Ua,5,4,"ng-container",2),c(16,"async"),A()),e&2){let r=d();s(4),b(" ",l(5,5,"asm.mainTitle")," "),s(4),u("ngIf",l(9,7,r.customerSupportAgentLoggedIn$)),s(2),u("ngIf",!l(11,9,r.customerSupportAgentLoggedIn$)&&!l(12,11,r.csAgentTokenLoading$)),s(3),u("ngIf",l(14,13,r.customerSupportAgentLoggedIn$)),s(2),u("ngIf",!l(16,15,r.isCollapsed$))}}var Sr=(()=>{let i=class i extends bi{constructor(t,n,o,a,_,I,$,H,_e){super(t,n,o,a,_,I,$,H),this.authService=t,this.csAgentAuthService=n,this.asmComponentService=o,this.globalMessageService=a,this.routingService=_,this.asmService=I,this.userAccountFacade=$,this.launchDialogService=H,this.windowRef=_e,this.isAsmLocalStorageEnabled$=this.windowRef.isBrowser()?W(this.windowRef.localStorage?.getItem(Ge)==="true"):W(!1)}};i.\u0275fac=function(n){return new(n||i)(S(oe),S(Ke),S(Re),S(be),S(J),S(qe),S(de),S(G),S(Ae))},i.\u0275cmp=R({type:i,selectors:[["sip-asm-main-ui"]],features:[Be],decls:2,vars:3,consts:[["showLoginForm",""],["showCustomerSelection",""],[4,"ngIf"],[1,"asm-bar"],[1,"asm-bar-branding"],[1,"asm-title"],[1,"asm-bar-actions"],["class","close",3,"title","click",4,"ngIf"],["class","logout",3,"title","click",4,"ngIf"],[1,"close",3,"click","title"],[1,"logout",3,"click","title"],[4,"ngIf","ngIfElse"],[3,"submitEvent",4,"ngIf"],[3,"submitEvent"],[3,"csAgentTokenLoading","submitEvent",4,"ngIf"],[3,"submitEvent","csAgentTokenLoading"]],template:function(n,o){n&1&&(g(0,Oa,17,17,"ng-container",2),c(1,"async")),n&2&&u("ngIf",l(1,1,o.isAsmLocalStorageEnabled$))},dependencies:[P,hi,xi,Si,xr,vr,z,B],styles:[`sip-asm-main-ui{font-size:14px;width:100%;display:flex;flex-direction:column}sip-asm-main-ui .close,sip-asm-main-ui .logout{cursor:pointer;padding:0;flex:none;width:16px;height:16px;border:transparent;background-color:transparent}sip-asm-main-ui .close{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z'/%3
1E%3C/svg%3E")}sip-asm-main-ui .logout{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%230064D9' d='M11,2.7c1.2,0.6,2.2,1.5,2.9,2.6c1.3,1.9,1.5,4.4,0.6,6.5c-0.3,0.8-0.8,1.6-1.5,2.2c-0.6,0.6-1.4,1.1-2.2,1.5 C9.9,15.8,9,16,8,16c-0.9,0-1.9-0.2-2.7-0.5c-0.8-0.4-1.6-0.9-2.2-1.5c-0.6-0.6-1.1-1.4-1.5-2.2C0.7,9.6,0.9,7.2,2.1,5.3 c0.7-1.1,1.7-2,2.9-2.6v1.1C4.1,4.3,3.3,5.1,2.8,6C2.3,6.9,2,7.9,2,9c0,1.6,0.6,3.2,1.8,4.3c0.5,0.5,1.2,1,1.9,1.3 c1.5,0.6,3.2,0.6,4.7,0c0.7-0.3,1.4-0.7,1.9-1.3C13.4,12.1,14,10.6,14,9c0-1.1-0.3-2.1-0.8-3c-0.5-0.9-1.3-1.7-2.2-2.2 C11,3.8,11,2.7,11,2.7z M8,9C7.7,9,7.5,8.9,7.3,8.7C7.1,8.5,7,8.3,7,8V1c0-0.3,0.1-0.5,0.3-0.7c0.4-0.4,1-0.4,1.4,0 C8.9,0.5,9,0.7,9,1v7c0,0.3-0.1,0.5-0.3,0.7C8.5,8.9,8.2,9,8,9z'/%3E%3C/svg%3E%0A")}sip-asm-main-ui button[type=submit]{padding:0 12px;white-space:nowrap;border-radius:4px;height:36px;font-weight:400;border-style:solid;border-width:1px}sip-asm-main-ui button[type=submit]:disabled{opacity:.4;cursor:not-allowed}sip-asm-main-ui.hidden{display:none}sip-asm-main-ui .asm-bar{color:#fff;background-color:#354a5f;height:48px;display:flex;padding:0 2rem;justify-content:space-between;z-index:1;color:inherit;background-color:#fff;box-shadow:2px 2px #556b821a,inset 0 -1px #556b8233}sip-asm-main-ui .asm-bar-branding{display:flex;align-items:center}sip-asm-main-ui .asm-bar-branding .logo{margin-inline-end:8px}sip-asm-main-ui .asm-bar-branding .asm-title{font-size:16px;font-weight:700}sip-asm-main-ui .asm-bar-actions{display:flex;justify-content:flex-end;align-items:center}sip-asm-main-ui .asm-bar-actions .cx-asm-customer-list{cursor:pointer}sip-asm-main-ui .asm-bar-actions .cx-asm-customer-list cx-icon{padding-top:0;padding-inline-end:7px;padding-bottom:0;padding-inline-start:0;color:#1e3050}sip-asm-main-ui .asm-bar-actions .cx-asm-customer-list .cx-asm-customer-list-link{color:#0064d9;text-decoration:none}sip-asm-main-ui .asm-bar-actions .cx-asm-customer-list .cx-asm-customer-list-link:hover{text-decoration:underline}sip-asm-main-ui>*:nth-child(2){padding:1rem 2rem;display:flex;width:100%}sip-asm-main-ui input{outline:0;border:1px solid #89919a;color:#32363a;background-color:#fff;border-radius:4px;padding:0 12px;height:36px}sip-asm-main-ui input:focus{box-shadow:0 0 0 1px #fafafa}sip-asm-main-ui input:hover{border-color:#085caf}sip-asm-main-ui input::placeholder{color:#74777a;font-style:italic}@media (max-width: 575px){sip-asm-main-ui .asm-bar-branding .asm-title{display:none}sip-asm-main-ui .asm-alert{margin-top:30px}}cx-asm-session-timer{display:flex;align-items:center;height:16px;margin:0 15px}cx-asm-session-timer .label{margin:0 6px}@media (max-width: 575px){cx-asm-session-timer .label{display:none}}cx-asm-session-timer .time{font-weight:600}cx-asm-session-timer .reset{margin:0 15px;cursor:pointer;width:16px;height:16px;background:url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%230064D9' d='M14.9,7.5l-1,0.2c0.2,0.9,0.1,1.7-0.1,2.5c-0.3,1-0.8,2-1.5,2.7c-1.1,1.1-2.7,1.8-4.2,1.8 c-0.8,0-1.5-0.1-2.3-0.4c-1.5-0.6-2.7-1.8-3.3-3.3C2.1,10.2,2,9.5,2,8.7c0-1.6,0.7-3.1,1.8-4.3c0.7-0.8,1.7-1.3,2.7-1.5 c1-0.3,2-0.2,3,0l0,0v-1c-1-0.2-2.1-0.2-3.1,0C4.2,2.4,2.4,4,1.5,6.1C1.2,6.9,1,7.8,1,8.7c0,0.9,0.2,1.8,0.5,2.6 c0.4,0.9,0.9,1.7,1.5,2.3c0.7,0.7,1.4,1.2,2.3,1.5c0.8,0.3,1.7,0.5,2.6,0.5c0.9,0,1.8-0.2,2.6-0.5c2.1-0.9,3.7-2.7,4.2-5 C15,9.3,15,8.4,14.9,7.5z'/%3E%3Cpolygon fill='%23d1e3ff' points='11.5,2.8 9.2,4.5 9.7,0.5 '/%3E%3C/svg%3E%0A") no-repeat center center;border:transparent;background-color:transparent}cx-asm-toggle-ui{cursor:pointer;display:flex;align-items:center;height:16px;margin:0 15px}cx-asm-toggle-ui .toggleUi{display:inherit;align-items:inherit}cx-asm-toggle-ui .toggleUi .label{margin-inline-start:5px;color:#d50101}@media (max-width: 575px){cx-asm-toggle-ui .toggleUi .label{display:none}}cx-asm-toggle-ui .toggleUi .collapseIcon,cx-asm-toggle-ui .toggleUi .expandIcon{width:16px;height:16px;font-family:cds-icons;display:inline-block;text-decoration:inherit;text-align:center;vertical-align:middle}cx-asm-toggle-ui .toggleUi .collapseIcon:before{content:"\\e80e"}cx-asm-toggle-ui .toggleUi .expandIcon:before{content:"\\e80d"}cx-asm-bind-cart{display:flex;justify-content:flex-start;align-items:baseline;flex:1;width:100%}@media (max-width: 575px){cx-asm-bind-cart>*{margin-bottom:12px}}@media (min-width: 575px){cx-asm-bind-cart button{margin-inline-start:8px}}cx-asm-bind-cart button.cx-asm-bindCartToCustomer{background-color:#0070f2;border:1px solid #0070f2;color:#fff;opacity:.4;transition:opacity .3s;position:relative}cx-asm-bind-cart button.cx-asm-bindCartToCustomer.cx-asm-active{opacity:1}cx-asm-bind-cart button.cx-asm-bindCartToCustomer cx-dot-spinner{position:absolute;inset:0;display:none}cx-asm-bind-cart button.cx-asm-bindCartToCustomer.cx-bind-loading span{opacity:0}
1cx-asm-bind-cart button.cx-asm-bindCartToCustomer.cx-bind-loading cx-dot-spinner{display:flex}cx-asm-bind-cart form{display:flex;align-items:center;min-width:auto;margin:0;flex:1;width:100%}@media (max-width: 575px){cx-asm-bind-cart form{flex-direction:column;gap:10px;align-items:flex-start}}cx-asm-bind-cart label{color:#556b82}cx-asm-bind-cart input{border:none;background-color:transparent}cx-asm-bind-cart input:focus{box-shadow:none;outline-style:none}cx-asm-bind-cart .cx-asm-assignCart{border:none;border-radius:4px;background-color:#eff1f2;box-shadow:0 4px 4px #00000040;margin-inline-start:6px;margin-inline-end:15px;max-width:20rem;display:flex;align-items:center;padding-inline-end:15px}@media (max-width: 575px){cx-asm-bind-cart .cx-asm-assignCart{margin-inline-end:0;margin-inline-start:0;min-width:100%;max-width:100%}}cx-asm-bind-cart .cx-asm-assignCart:focus,cx-asm-bind-cart .cx-asm-assignCart:focus-within,cx-asm-bind-cart .cx-asm-assignCart:active,cx-asm-bind-cart .cx-asm-assignCart.active{background-color:#fff;outline-style:solid;outline-color:var(--cx-color-visual-focus);outline-width:var(--cx-visual-focus-width, 2px);outline-offset:4px}cx-asm-bind-cart .cx-asm-assignCart .cx-asm-reset{visibility:hidden;background-color:transparent;border:none;color:inherit}cx-csagent-login-form form{display:flex;width:100%}@media (max-width: 575px){cx-csagent-login-form form{flex-direction:column}}cx-csagent-login-form form label{margin:0 0 15px;min-width:auto}@media (min-width: 575px){cx-csagent-login-form form label{margin-inline-end:15px;margin-top:0;margin-bottom:0;margin-inline-start:0;min-width:15rem}}cx-csagent-login-form form label input{width:100%}cx-csagent-login-form button[type=submit]{color:#fff;border-color:#0a6ed1;background-color:#0a6ed1}cx-csagent-login-form button[type=submit]:hover{background-color:#085caf}cx-csagent-login-form cx-dot-spinner{color:#0a6ed1}sip-customer-emulation{display:flex;justify-content:flex-start;align-items:baseline}@media (max-width: 940px){sip-customer-emulation{flex-direction:column}sip-customer-emulation>*{margin-bottom:12px}}sip-customer-emulation button{color:#aa0808;font-weight:700;background-color:#ffd6ea;border:1px solid #ffd6ea;border-radius:8px;padding:6px 10px}@media (max-width: 940px){sip-customer-emulation button{width:100%}}sip-customer-emulation label{margin-inline-end:10px;margin-inline-start:0;margin-top:0;margin-bottom:0;color:#556b82}sip-customer-emulation .cx-asm-customerInfo{display:flex;flex-direction:column;margin-inline-end:15px}sip-customer-emulation .cx-asm-customerInfo .cx-asm-name{color:#1d2d3e}sip-customer-emulation .cx-asm-customerInfo .cx-asm-uid{color:#556b82}.asm-alert{padding:9px 12px;border-radius:4px;border:1px solid #89919a;background-color:#f4f4f4;color:#32363a;text-align:center;flex:1}sip-customer-selection{position:relative}sip-customer-selection form{display:flex;width:100%}@media (max-width: 575px){sip-customer-selection form{flex-direction:column}}sip-customer-selection form label{margin:0 0 15px;min-width:auto}sip-customer-selection form label .input-contaier{display:flex}sip-customer-selection form label .input-contaier .icon-wrapper{display:flex;outline:0;border:1px solid #89919a;color:#fff;background-color:#1672b7;padding:0 12px;height:36px;border-top-left-radius:4px;border-bottom-left-radius:4px;border-right-width:0px;cursor:pointer}sip-customer-selection form label .input-contaier input{border:none;border-radius:4px;background-color:#eff1f2;box-shadow:0 4px 4px #00000040}@media (min-width: 575px){sip-customer-selection form label{margin-inline-end:15px;min-width:20rem;margin-bottom:0;min-width:25rem}}sip-customer-selection form label .searchTermLabel{display:flex;align-items:center;color:#556b82;min-width:auto;margin:0 15px 0 0}sip-customer-selection form label input{width:100%}sip-customer-selection form button[type=submit]{background-color:#ebf5cb;border:1px solid #ebf5cb;border-radius:8px;color:#256f3a;font-weight:700;transition:opacity .3s}sip-customer-selection form button[type=submit].active{opacity:1}sip-customer-selection .asm-results{border:solid 1px #89919a;position:absolute;line-height:1.5rem;left:2rem;top:4rem;z-index:11;box-shadow:0 5px 20px #d9d9d9,0 2px 8px #ededed;background-color:#fff;border-radius:4px;width:100%;max-width:50vw;max-height:70vh;overflow-y:auto}@media (max-width: 1200px){sip-customer-selection .asm-results{max-width:calc(100% - 4rem)}}sip-customer-selection .asm-results cx-dot-spinner{height:42px;color:#0a6ed1}sip-customer-selection .asm-results button{margin:0;appearance:none;outline:0;border:0;text-decoration:none;-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;background-color:transparent;color:#51555a;display:flex;flex-direction:column;
1cursor:pointer;padding:10px;width:100%;align-items:flex-start;justify-content:flex-start}@media (min-width: 767px){sip-customer-selection .asm-results button{flex-direction:row}}sip-customer-selection .asm-results button.active{color:#32363a;background-color:#d3d6db}sip-customer-selection .asm-results button:hover{color:#32363a;background-color:#d3d6db}sip-customer-selection .asm-results button span{margin-inline-end:15px;margin-top:0;margin-bottom:0;margin-inline-start:0;word-break:break-all;white-space:normal;text-align:start}@media (min-width: 575px){sip-customer-selection .asm-results button span:last-of-type{margin:0}}cx-password-visibility-toggle{position:absolute;transform:translateY(-50%);top:50%;inset-inline-end:10px;display:flex}cx-password-visibility-toggle>button{font-size:17px;margin:0!important;border:transparent;border-radius:4px;background:none;color:var(--cx-color-secondary)}cx-password-visibility-toggle>button cx-icon{opacity:.8;width:21px}.cx-password-input-wrapper{position:relative}
2`],encapsulation:2,changeDetection:0});let e=i;return e})();var yl=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=Y({type:i}),i.\u0275inj=q({providers:[Yi({cmsComponents:{AssistedServiceComponent:{component:Sr,disableSSR:!0}}})],imports:[re,fr,cr,hr,vt,St,ft,$n,Vn,jn]});let e=i;return e})();export{Ge as a,et as b,Ke as c,Ar as d,Ka as e,qn as f,lc as g,mc as h,Nr as i,Sr as j,yl as k};

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.