1import{a as dt,b as Nt,c as st,d as $t}from"./chunk-UTOG35BP.js";import{a as ot,b as Mt,c as rt,d as Et}from"./chunk-5TUTIA3S.js";import{a as at,b as Vt}from"./chunk-YLLYZJIL.js";import"./chunk-2TSDZVR3.js";import"./chunk-AXF73ZCD.js";import"./chunk-EYC77AXG.js";import"./chunk-K6ARYQXT.js";import{a as nt,b as Ft}from"./chunk-NGUES7SU.js";import{a as it,b as Bt}from"./chunk-CYL7WT3Y.js";import"./chunk-HJT3VWB6.js";import"./chunk-RROTQN25.js";import"./chunk-HZQRPY4H.js";import"./chunk-66DKRHHA.js";import"./chunk-7H4FJIMS.js";import{c as Ye,d as Dt}from"./chunk-TK3DIEGZ.js";import"./chunk-IMLZOGQG.js";import{k as He,l as wt}from"./chunk-IOQQ35UR.js";import"./chunk-2DBWLJHR.js";import"./chunk-NNKJJ345.js";import"./chunk-CCCVMNJV.js";import"./chunk-EGJNU6PH.js";import{a as Je,b as At}from"./chunk-O37F2EV4.js";import"./chunk-2EUUB2FF.js";import"./chunk-TWFDIST7.js";import"./chunk-CCGI34LC.js";import"./chunk-M5U7TBQY.js";import"./chunk-M66LVL6E.js";import"./chunk-Z4XCU2XN.js";import"./chunk-EVRQQVR6.js";import{e as oe,f as tt}from"./chunk-KIWZNSJB.js";import{a as Xe,b as Tt}from"./chunk-DL3NROUC.js";import"./chunk-AO4EK6W4.js";import{c as et,f as Pt}from"./chunk-THNDJZ6M.js";import{a as ce,c as It}from"./chunk-PJNLFALK.js";import{a as V,b as Lt}from"./chunk-T4BY2JUZ.js";import{e as Ze,f as St}from"./chunk-TIAHH4QK.js";import"./chunk-TMFOOMSR.js";import"./chunk-HPXH3VTL.js";import"./chunk-EBQ7LKUY.js";import"./chunk-C3OY5QKM.js";import"./chunk-SD646YB5.js";import"./chunk-3BWZVUJL.js";import"./chunk-BYMC3CJA.js";import"./chunk-32ESLIOW.js";import"./chunk-GYVHN6GP.js";import{a as ne,b as xt}from"./chunk-LVYCKPBI.js";import{a as kt}from"./chunk-6ED7CXXN.js";import"./chunk-XEXWZOGE.js";import{B as E,R as vt,z as B}from"./chunk-4U7ZBIWP.js";import{y as Ne,z as ft}from"./chunk-O574CAJ5.js";import"./chunk-TXBWSX4X.js";import{a as Ve,b as ht}from"./chunk-5GNZDNP3.js";import"./chunk-PSWZDX6M.js";import{F as Ke,G as bt,ba as Ue,ma as ze,w as je,x as yt}from"./chunk-7V56JTTI.js";import"./chunk-PR3URSUW.js";import"./chunk-FZJDKUXZ.js";import{P as ie,R as q,b as Qe,c as gt}from"./chunk-MQHMSR6Q.js";import"./chunk-PMOKQO75.js";import"./chunk-7XZPU7YX.js";import{B as Pe,D as _t}from"./chunk-FEAIF55A.js";import{R as Oe,t as $e,y as Y}from"./chunk-II62XKAX.js";import{l as We}from"./chunk-TMHGIC5Q.js";import"./chunk-3C6JQTNE.js";import{a as te,b as qe}from"./chunk-QHF2UVGV.js";import{a as ee,c as Re,d as Ge}from"./chunk-NOQEJP5D.js";import{b as Ee}from"./chunk-WCKPNZ6H.js";import{j as Be,p as Fe,x as mt}from"./chunk-YXM3HUUI.js";import{Ka as ut,ba as Le}from"./chunk-Q2U6QXMH.js";import{a as Me,e as Ct}from"./chunk-QWXB4XKK.js";import"./chunk-BJ66ETYV.js";import"./chunk-7H4434VP.js";import"./chunk-4CCXKGS7.js";import"./chunk-TTGNNQTV.js";import{Aa as b,Ba as x,D as ae,Ec as y,Ed as ke,Ga as he,Gc as r,I as L,Jb as U,Jd as Se,Kd as M,Ma as g,Nb as ge,Oa as K,Ob as ye,Oc as xe,Pc as ve,Rd as Ae,Sd as Te,Ua as fe,Uc as z,Vc as S,Wc as H,Wd as De,Xc as P,Yc as we,ba as de,d as re,da as A,de as X,fa as me,gc as h,i as R,ia as Ce,ic as f,jc as be,lc as G,mc as Q,n as D,nb as se,nc as u,nd as Z,oc as c,od as Ie,pc as s,pd as J,qc as v,s as ue,sa as I,tb as d,xc as w,yd as l,z as _e,zd as p}from"./chunk-AAE36BVF.js";import{a as k,b as F,d as pe}from"./chunk-YZFYTRZT.js";function Gt(i,a){if(i&1&&(c(0,"div",8)(1,"a",9),S(2),l(3,"transloco"),s()()),i&2){let e=r(3);d(),u("pwrRouterLink",e.readMoreUrl),d(),H(p(3,2,"General.ReadMore"))}}function Qt(i,a){if(i&1&&(v(0,"div",7),l(1,"transloco"),h(2,Gt,4,4,"div",8)),i&2){let e=r(2);u("innerHTML",p(1,2,e.salesArgumentsDictionaryKey),se),d(2),f(e.readMoreUrl?2:-1)}}function qt(i,a){if(i&1){let e=w();c(0,"pwr-insurance-price-type-toggle",10),l(1,"pwrbreakpoint"),y("toggle",function(){b(e);let n=r(3);return x(n.togglePriceType())}),s()}if(i&2){let e=r(3);u("focusMonthlyInsurance",e.focusMonthlyAddonFamilyPrice())("variant",p(1,2,"gt-xs")?"default":"small")}}function Wt(i,a){if(i&1){let e=w();c(0,"pwr-lib-select-list",25),y("itemClick",function(n){b(e);let o=r(2).$implicit,m=r(3);return x(m.selectAddon(n,o.titleDictionaryKey))}),s()}if(i&2){let e=r(2).$implicit,t=r(3);u("items",t.addonsToSelectList(e.addons))("selected",t.groupSelectedAddon()[e.titleDictionaryKey]||0)}}function jt(i,a){if(i&1&&(c(0,"div",20),S(1),l(2,"transloco"),s()),i&2){let e=r();d(),we(" /",e.serviceMonths," ",p(2,2,"Months.Short")," ")}}function Kt(i,a){i&1&&(c(0,"div",20),S(1),l(2,"transloco"),s()),i&2&&(d(),P(" ",p(2,1,"General.PerMonth")," "))}function Ut(i,a){if(i&1){let e=w();c(0,"pwr-lib-button",26),l(1,"transloco"),y("buttonClick",function(){b(e);let n=r(),o=r(4);return x(o.addToCart(n))}),s()}i&2&&u("text",p(1,3,"General.Add"))("fullWidth",!0)("color","green")}function zt(i,a){if(i&1){let e=w();c(0,"div",24)(1,"pwr-lib-icon-button",27),l(2,"transloco"),y("buttonClick",function(){b(e);let n=r(),o=r(4);return x(o.editLineQuantity(n,-1))}),s(),c(3,"pwr-lib-loader-spinner",22)(4,"div",28),S(5),s()(),c(6,"pwr-lib-icon-button",27),l(7,"transloco"),y("buttonClick",function(){b(e);let n=r(),o=r(4);return x(o.editLineQuantity(n,1))}),s()()}if(i&2){let e=r(),t=r(4);d(),u("icon",t.productIdsQuantityInBasket()[e.serviceProductId]>1?"pwr-icon-minus-fat":"pwr-icon-trash")("iconAriaLabel",p(2,7,t.productIdsQuantityInBasket()[e.serviceProductId]>1?"Accessibility.Checkout.DecreaseQuantity":"General.Remove")),d(2),u("loading",t.quantityLoading[e.serviceProductId])("diameter",24),d(2),P(" ",t.productIdsQuantityInBasket()[e.serviceProductId]," "),d(),u("icon","pwr-icon-plus-fat")("iconAriaLabel",p(7,9,"Accessibility.Checkout.IncreaseQuantity"))}}function Ht(i,a){if(i&1&&(c(0,"div",11)(1,"div",12)(2,"div",13)(3,"div"),S(4),l(5,"transloco"),s(),v(6,"div",7),l(7,"transloco"),s(),c(8,"div",13)(9,"div",14),h(10,Wt,1,2,"pwr-lib-select-list",15),s(),c(11,"div",16)(12,"div",17)(13,"div",18),v(14,"pwr-price",19),s(),h(15,jt,3,4,"div",20)(16,Kt,3,3,"div",20),s()(),c(17,"div",21)(18,"pwr-lib-loader-spinner",22),h(19,Ut,2,5,"pwr-lib-button",23)(20,zt,8,11,"div",24),s()()()()()),i&2){let e=a,t=r().$implicit,n=r(3);d(4),H(p(5,11,t.titleDictionaryKey)),d(2),u("innerHTML",p(7,13,t.salesArgumentsDictionaryKey),se),d(4),f(t.addons.length>
11?10:-1),d(2),z(J(15,Rt,t.addons.length===1)),d(2),u("unitPrice",e.price)("vatlessPrice",e.vatlessPrice),d(),f(e.priceType==n.ProductPriceType.Standard&&e.serviceMonths?15:e.priceType==n.ProductPriceType.Monthly?16:-1),d(3),u("loading",n.addToCartLoading[e.serviceProductId])("diameter",32),d(),f(n.productIdsQuantityInBasket()[e.serviceProductId]>0?20:19)}}function Zt(i,a){if(i&1&&h(0,Ht,21,17,"div",11),i&2){let e,t=a.$implicit;f((e=t.selectedAddon)?0:-1,e)}}function Jt(i,a){if(i&1){let e=w();c(0,"div",0)(1,"div",1),S(2),l(3,"transloco"),s(),c(4,"div",2)(5,"div"),S(6),l(7,"transloco"),s(),c(8,"div",3),y("click",function(){b(e);let n=r(2);return x(n.readMoreOpen=!n.readMoreOpen)}),c(9,"div"),S(10),l(11,"transloco"),s(),v(12,"pwr-lib-icon",4),s()(),h(13,Qt,3,4),h(14,qt,2,4,"pwr-insurance-price-type-toggle",5),c(15,"div",6),G(16,Zt,1,1,null,null,be),s()()}if(i&2){let e=r(),t=r();d(2),P(" ",p(3,6,e.titleDictionaryKey)," "),d(4),P(" ",p(7,8,e.descriptionDictionaryKey)," "),d(4),H(p(11,10,"General.ReadMore")),d(2),u("icon",t.readMoreOpen?"pwr-icon-arrow-up":"pwr-icon-arrow-down"),d(),f(t.readMoreOpen?13:-1),d(),f(t.beanVisible()?14:-1),d(2),Q(t.selectedAddonGroups())}}function Xt(i,a){if(i&1&&h(0,Jt,18,12,"div",0),i&2){let e,t=r();f((e=t.focusedGroup())?0:-1,e)}}var Rt,ct,lt=pe(()=>{"use strict";X();Oe();ze();qe();gt();bt();Ce();It();tt();Mt();Dt();ht();kt();X();Rt=i=>({"no-combo-box":i});ct=(()=>{class i extends Ve{constructor(){super(),this.basketService=I(oe),this.translateService=I($e),this.currencyPipe=I(q),this.addonFamily=Ae.required(),this.focusMonthlyAddonFamilyPrice=g(!0),this.sourceComponent="AddonFamilyComponent",this.addToCartLoading={},this.quantityLoading={},this.groupSelectedAddon=g({}),this.readMoreOpen=!1,this.ProductPriceType=E,this.quantityInBasket=t=>this.productIdsQuantityInBasket()[t]??0,this.focusedGroup=M(()=>!this.addonFamily().subscriptionGroups||!this.addonFamily().subscriptionGroups?.groups.some(t=>!!t.addons.length)?this.addonFamily().upfrontGroups:!this.addonFamily().upfrontGroups||!this.addonFamily().upfrontGroups?.groups.some(t=>!!t.addons.length)?this.addonFamily().subscriptionGroups:this.focusMonthlyAddonFamilyPrice()?this.addonFamily().subscriptionGroups:this.addonFamily().upfrontGroups),this.selectedAddonGroups=M(()=>this.focusedGroup()?.groups.map(t=>({salesArgumentsDictionaryKey:t.salesArgumentsDictionaryKey,titleDictionaryKey:t.titleDictionaryKey,selectedAddon:t.addons[this.groupSelectedAddon()[t.titleDictionaryKey]??0]??t.addons[0],addons:t.addons}))??[]),this.beanVisible=M(()=>!!(this.addonFamily().subscriptionGroups?.groups.some(t=>!!t.addons.length)&&this.addonFamily().upfrontGroups?.groups.some(t=>!!t.addons.length))),this.selectAddon=(t,n)=>{this.groupSelectedAddon.update(o=>(o[n]=Number(t.id),k({},o)))},this.togglePriceType=()=>{this.focusMonthlyAddonFamilyPrice.update(t=>!t)},this.addonsToSelectList=t=>t.map((n,o)=>({id:o,text:`${this.currencyPipe.transform(n.price)} ${n.priceType===E.Standard&&n.serviceMonths?"/ "+n.serviceMonths+this.translateService.translate("Months.Short"):n.priceType===E.Monthly?this.translateService.translate("General.PerMonth"):""}`,value:n})),this.addToCart=t=>{this.addToCartLoading[t.serviceProductId]=!0,this.basketService.addProduct$(t.serviceProductId,t,"addonFamily",{}).pipe(L(1),A(this._unsubscribeAllSubject)).subscribe(()=>{this.addToCartLoading[t.serviceProductId]=!1})},this.editLineQuantity=(t,n)=>{this.quantityLoading[t.serviceProductId]=!0;let o=this.basketLineForProduct()[t.serviceProductId];this.basketService.editLineQuantity$(o,t.serviceProductId,t,n,this.sourceComponent).pipe(L(1),A(this._unsubscribeAllSubject)).subscribe(()=>{this.quantityLoading[t.serviceProductId]=!1})};let e=this.basketService;this.productIdsQuantityInBasket=ce(e.getBasket$().pipe(D(t=>{let n={};return t.basketLines.forEach(o=>n[o.productId]=o.quantity),n})),{initialValue:{}}),this.basketLineForProduct=ce(e.getBasket$().pipe(D(t=>{let n={};return t.basketLines.forEach(o=>n[o.productId]=o),n})),{initialValue:{}})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=U({type:i,selectors:[["pwr-addon-family"]],inputs:{addonFamily:[1,"addonFamily"]},features:[Z([q]),ge],decls:1,vars:1,consts:[["fxLayout","column","fxLayoutAlign","start center",1,"power-primary-50-bg","border-radius-6","p-spacer-basic","g-spacer-mini","addon-family-card"],[1,"h5","bold","text-center","my-spacer-none"],["fxLayout","column",1,"w-100-p"],["fxLayout","row","fxLayoutAlign","start center",1,"w-100-p","cursor-pointer","power-secondary-500-fg",3,"click"],[3,"icon"],[1,"my-spacer-mini",3,"focusMonthlyInsurance","variant"],["fxLayout","wrap","fxLayoutAlign","center stretch",1,"g-spacer-mini","w-100-
1p"],[1,"w-100-p",3,"innerHTML"],[1,"w-100-p"],[1,"hover-link","cursor-pointer",3,"pwrRouterLink"],[1,"my-spacer-mini",3,"toggle","focusMonthlyInsurance","variant"],["fxFlex","",1,"power-white-500","border-radius-6","elevation-00","p-spacer-mini","addon-card"],["fxLayout","column","fxLayoutAlign","space-between center",1,"gy-spacer-xmini","w-100-p"],["fxLayout","column","fxLayoutAlign","start center",1,"gy-spacer-xmini","w-100-p"],[1,"h-48"],[3,"items","selected"],[1,"h-0"],["fxLayout","row","fxLayoutAlign","start end",1,"g-spacer-solo","power-white-500-bg","price-label"],[1,"h5","bold"],[3,"unitPrice","vatlessPrice"],[1,"margin-bottom-10"],["fxLayout","column","fxLayoutAlign","center center",1,"w-152","min-h-48"],[3,"loading","diameter"],[3,"text","fullWidth","color"],["fxLayout","row","fxLayoutAlign","space-between center"],[3,"itemClick","items","selected"],[3,"buttonClick","text","fullWidth","color"],[3,"buttonClick","icon","iconAriaLabel"],[1,"w-100-p","text-center"]],template:function(t,n){if(t&1&&h(0,Xt,1,1),t&2){let o;f((o=n.addonFamily())?0:-1,o)}},dependencies:[ot,Ye,te,ee,Qe,Re,Ke,Ee,Y,ie],styles:[`.addon-family-card ul{padding-inline-start:20px!important}.addon-family-card .margin-bottom-10{margin-bottom:10px}.addon-family-card .price-label{white-space:nowrap;pointer-events:none;position:relative;top:-55px;left:-20px;width:180px;border-radius:6px;padding-left:12px;overflow:hidden}.addon-family-card .price-label.no-combo-box{left:0}@media screen and (max-width:599px){.addon-family-card .price-label{top:-52px}}@media screen and (min-width:600px){.addon-family-card .addon-card{max-width:calc(50% - 8px)}}@media screen and (max-width:599px){.addon-family-card .addon-card{width:100%;min-width:100%}} 2/*# sourceMappingURL=addon-family.component-GXU2V3RA.css.map */ 3`],encapsulation:2,changeDetection:0})}}return i})()});function oi(i,a){i&1&&v(0,"pwr-checkout-limited-stock-counter",7),i&2&&u("expires",a??void 0)("routeToCheckoutOnExpire",!1)}function ri(i,a){if(i&1&&v(0,"pwr-product-error",8),i&2){let e=r();u("error",e.error())}}function ai(i,a){if(i&1&&v(0,"pwr-product-line-v2",9),i&2){let e=r();u("_lineInput",e.bundleLine())("bundle",e.bundle())("index",0)("sourceComponent",e.sourceComponent)}}function di(i,a){if(i&1){let e=w();c(0,"pwr-product-line-v2",11),y("selectInsurance",function(n){b(e);let o=r(2);return x(o.toggleInsurance2(n))}),s()}if(i&2){let e=a,t=r(2);u("_lineInput",e)("product",t.productsDictionary()[e.productId])("index",0)("visibleAddons",t.step==="accessory"?t.allowedAddons:void 0)("showInlineBasketAddons",!0)("sourceComponent",t.sourceComponent)}}function si(i,a){i&1&&v(0,"pwr-product-error",8),i&2&&u("error",a)}function ci(i,a){if(i&1){let e=w();c(0,"pwr-product-line-v2",12),y("selectInsurance",function(n){b(e);let o=r(4);return x(o.toggleInsurance2(n))}),s(),h(1,si,1,1,"pwr-product-error",8)}if(i&2){let e,t=r().$implicit,n=r(3);u("_lineInput",t)("product",n.productsDictionary()[t.productId])("visibleAddons",n.step==="accessory"?n.allowedAddons:void 0)("index",0)("sourceComponent",n.sourceComponent),d(),f((e=n.productErrors()[t.productId])?1:-1,e)}}function li(i,a){if(i&1&&h(0,ci,2,6),i&2){let e,t=a.$implicit,n=r(3);f(t&&t.lineId!==((e=n.mainProductLine())==null?null:e.lineId)&&n.productsDictionary()[t.productId]?0:-1)}}function pi(i,a){i&1&&v(0,"pwr-product-error",8),i&2&&u("error",a)}function ui(i,a){if(i&1){let e=w();c(0,"pwr-product-line-v2",13),y("selectInsurance",function(n){b(e);let o=r(3);return x(o.toggleInsurance2(n))}),s(),h(1,pi,1,1,"pwr-product-error",8)}if(i&2){let e,t=a.$implicit,n=r(3);u("product",t)("index",0)("sourceComponent",n.sourceComponent),d(),f((e=n.productErrors()[t.productId])?1:-1,e)}}function _i(i,a){if(i&1&&(G(0,li,1,1,null,null,ii),G(2,ui,2,4,null,null,ni)),i&2){let e=r(2);Q(e.lines()),d(2),Q(e.failedProducts())}}function mi(i,a){if(i&1){let e=w();c(0,"pwr-insurance-selection",15),y("toggleInsurance",function(n){b(e);let o=r(4);return x(o.toggleInsurance(n))}),s()}if(i&2){let e=r(),t=r(3);u("insurances",e)("selectedInsurances",t.superstepBasketInsurances())("quantity",a.quantity||1)("loading",!1)("isModal",!0)("inAddToCartSidebar",!0)("isSuperstep",!0)}}function Ci(i,a){if(i&1){let e=w();c(0,"pwr-insurance-selection",15),y("toggleInsurance",function(n){b(e);
3let o=r(4);return x(o.toggleInsurance(n))}),s()}if(i&2){let e,t=r(),n=r(3);u("insurances",t)("selectedInsurances",n.superstepBasketInsurances())("quantity",((e=n.lines())==null||e[0]==null?null:e[0].quantity)||1)("loading",!1)("isModal",!0)("inAddToCartSidebar",!0)("isSuperstep",!0)}}function hi(i,a){if(i&1&&h(0,mi,1,7,"pwr-insurance-selection",14)(1,Ci,1,7,"pwr-insurance-selection",14),i&2){let e,t=r(3);f((e=t.mainProductLine())?0:1,e)}}function fi(i,a){if(i&1&&(h(0,hi,2,1),l(1,"async")),i&2){let e,t=r(2);f((e=p(1,1,t.insurances$))?0:-1,e)}}function gi(i,a){if(i&1&&(h(0,di,1,6,"pwr-product-line-v2",10),h(1,_i,4,0),h(2,fi,2,3)),i&2){let e,t=r();f((e=t.mainProductLine())?0:-1,e),d(),f(!t.mainProductLine()||t.step!=="insurance"?1:-1),d(),f(t.step==="insurance"?2:-1)}}function yi(i,a){i&1&&(c(0,"div",17),v(1,"pwr-addon-family",19),s()),i&2&&(d(),u("addonFamily",a))}function bi(i,a){if(i&1&&(c(0,"div",17),v(1,"pwr-accessory-product-list",18),l(2,"transloco"),s()),i&2){let e,t=a,n=r(2);d(),u("title",p(2,6,"Product.CC.Services"))("gaTitle","Standalone service recommendations")("products",t.value)("loading",t.loading)("sourceComponent",n.sourceComponent)("maxNumberOfProductsShownOnLoad",!((e=n.recs())==null||e.products==null)&&e.products.length?3:20)}}function xi(i,a){if(i&1&&(v(0,"pwr-lib-divider",16),c(1,"div",17),v(2,"pwr-accessory-product-list",18),l(3,"transloco"),l(4,"async"),l(5,"async"),s(),h(6,yi,2,1,"div",17),l(7,"async"),h(8,bi,3,8,"div",17),l(9,"withLoading"),l(10,"async")),i&2){let e,t,n,o,m,_,C=r();u("colorVariant","power-primary-100"),d(2),u("title",p(3,9,(e=C.recs())==null?null:e.titleKey))("gaTitle",(t=C.recs())==null?null:t.gaTitle)("products",(n=C.recs())==null?null:n.products)("loading",C.recsLoading())("sourceComponent",C.sourceComponent)("maxNumberOfProductsShownOnLoad",p(4,11,C.standaloneServiceProducts$)?(o=p(5,13,C.standaloneServiceProducts$))!=null&&o.length?3:20:3),d(4),f((m=p(7,15,C.productAddonFamily$))?6:-1,m),d(2),f((_=p(10,19,p(9,17,C.standaloneServiceProducts$)))?8:-1,_)}}function vi(i,a){if(i&1){let e=w();c(0,"div",21)(1,"pwr-lib-button",22),l(2,"transloco"),l(3,"pwrbreakpoint"),y("buttonClick",function(){b(e);let n=r(3);return x(n.noInsurance())}),s(),c(4,"pwr-lib-button",23),l(5,"transloco"),l(6,"pwrbreakpoint"),y("buttonClick",function(){b(e);let n=r(3);return x(n.saveInsurance())}),s()()}if(i&2){let e=r(3);d(),u("color","primary-light")("text",p(2,8,"Product.AddToBasket.Superstep.DoNotInsure"))("fullWidth",p(3,10,"lt-sm"))("disabled",e.loading()||e.recsLoading()),d(3),u("color","secondary")("text",p(5,12,"Product.AddToBasket.Superstep.InsureDevice"))("fullWidth",p(6,14,"lt-sm"))("disabled",e.loading()||e.recsLoading())}}function wi(i,a){if(i&1){let e=w();c(0,"div",21)(1,"pwr-lib-button",24),l(2,"transloco"),l(3,"pwrbreakpoint"),y("buttonClick",function(){b(e);let n=r(3);return x(n.close())}),s(),v(4,"pwr-lib-button",25),l(5,"transloco"),l(6,"pwrbreakpoint"),s()}i&2&&(d(),u("color","primary-light")("text",p(2,8,"Checkout.Overlay.ContinueShopping"))("fullWidth",!!p(3,10,"lt-sm")),d(3),u("color","secondary")("text",p(5,12,"MiniCart.GoToCheckout"))("url","/checkout/")("routerExtras",Ie(16,ti))("fullWidth",!!p(6,14,"lt-sm")))}function Ii(i,a){if(i&1&&h(0,vi,7,16,"div",21)(1,wi,7,17,"div",21),i&2){let e,t=r(2);f(t.step==="insurance"&&t.lines()&&t.productsDictionary()&&(((e=t.lines())==null?null:e.length)===1||t.mainProductLine())?0:1)}}function ki(i,a){if(i&1){let e=w();c(0,"pwr-lib-button",24),l(1,"transloco"),l(2,"pwrbreakpoint"),y("buttonClick",function(){b(e);let n=r(2);return x(n.close())}),s()}i&2&&u("color","primary-light")("text",p(1,3,"Checkout.Overlay.ContinueShopping"))("fullWidth",!!p(2,5,"lt-sm"))}function Si(i,a){if(i&1&&h(0,Ii,2,1)(1,ki,3,7,"pwr-lib-button",20),i&2){let e,t=r();f((e=t.data())!=null&&e.errors?1:0)}}var Yt,ei,ti,ii,ni,vn,Ai=pe(()=>{ut();X();Ct();_t();mt();Oe();ze();qe();yt();Ce();Vt();Pt();Lt();xt();At();tt();ft();St();Ft();Tt();lt();$t();Et();wt();Bt();Nt();vt();X();Yt=["dialogFooter"],ei=i=>({hidden:i}),ti=()=>({routerHint:"checkout-page",hintSource:"add-to-cart"}),ii=(i,a)=>a.lineId,ni=(i,a)=>a.productId;vn=(()=>{class i{get step(){return this._step()}set step(e){this._step.set(e),this.dialogState.update(t=>F(k({},t),{document:e}))}constructor(){this.basketService=I(oe),this.conf=I(Ne),this.userService=I(Xe),this.productService=I(Ze),this.recommendationService=I(nt),this.elementRef=I(fe),this.router=I(Fe),this.destroyRef=I(he),this.backRouteService=I(Je),this.dialogState=De.required(),this.dialogFooterRef=Te("dialogFooter"),this.data=M(()=>this.dialogState().data),this.sourceComponent="add-to-cart",this.loading=g(!1),this.error=g({}),this.basket=g(void 0),this.initialInsurances=g(void 0),this.products=g(void 0),this.mainProductLine=g(void 0),this.lines=g(void 0),this.productsDictionary=g({}),this.lineDictionary=g({}),this.productErrors=g({}),this.failedProducts=M(()=>{let e=this.products()??[],t=this.lineDictionary(),n=this.productErrors();return e.filter(o=>t[o.productId]===void 0&&n[o.productId]!==void 0)}),this.bundle=g(void 0),this.bundleLine=g(void 0),this.addingQuantity=g(void 0),this._step=g("insurance"),this.viewChanged=K(()=>{this._step(),this.elementRef.nativeElement.closest(".dialog-body")?.scrollTo(0,0)}),this.recs=g(void 0),this.recsLoading=g(!1),this.ProductPriceType=E,this.allowedAddons=B.Insurance,this.insurances=g([]),this.superstepSelectedInsurance=g(void 0),this.superstepBasketInsurances=g({}),this.initialBasketInsurances=g({}
3),this._unsubscribeAllSubject=new re,this.wasVisuallyOpen=!1,this.initEffect=K(()=>{let e=this.dialogState().data;if(!e){this.lastInitializedData=void 0;return}e!==this.lastInitializedData&&(this.lastInitializedData=e,Se(()=>this.initialize(e)))}),this.closeWatchEffect=K(()=>{let e=this.dialogState().visuallyOpen??!1;this.wasVisuallyOpen&&!e&&(this.pendingOnClose?.(We.closeOverlay,void 0),this.pendingOnClose=void 0),this.wasVisuallyOpen=e}),this.setupBasket=e=>{if(this.basket.set(e),this.lineDictionary.set(e.basketLines.filter(o=>!o.basketBundleId).reduce((o,m)=>F(k({},o),{[m.productId]:m}),{})),this.data()?.errors)return;let t=this.products();if(t){let o=e.basketLines.filter(m=>t.find(_=>_.productId===m.productId&&!m.basketBundleId));if(!o||o.length===0){this.close();return}this.lines.set(o),this.mainProductLine.set(o.find(m=>m.productId===this.data()?.mainProductId)),this.productsDictionary.set(t.reduce((m,_)=>F(k({},m),{[_.productId]:_}),{})),this.data()?.mainProductId&&!this.mainProductLine()&&o&&o?.length>0&&(this.step="accessory")}else this.lines.set(void 0);let n=this.bundle();if(n&&!n?.dynamicBundleType){let o=e.bundles.find(m=>m.bundleId===n.bundleId);if(!o){this.close();return}this.bundleLine.set(o)}n?.dynamicBundleType&&this.basketService.getDynamicBundleId$(n).pipe(ae(()=>R(void 0)),L(1),A(this._unsubscribeAllSubject)).subscribe(o=>{let m=e?.bundles.find(_=>_.dynamicBundleId===o);if(!m){this.close();return}this.bundleLine.set(m)})},this.onEditBundleQuantity=(e,t,n)=>{if(this.addingQuantity.set(!0),this.basketService.editBundleQuantity$(e,n,t.products,this.sourceComponent).pipe(L(1),ae(o=>{let m=et(o);if(m){let _=k({},this.error());for(let C of m)V.set(_,C,!0);this.error.set(_)}return R(void 0)}),A(this._unsubscribeAllSubject)).subscribe(()=>{this.addingQuantity.set(!1)}),n===-1){let o=k({},this.error());V.set(o,"product.limitedquantity",!1),V.set(o,"product.maxpercustomer",!1),this.error.set(o)}},this.backToInsurance=()=>{this.step="insurance",this.backRouteService.unregister("add-to-cart-dialog second page")},this.router.events.pipe(_e(e=>e instanceof Be),Me(this.destroyRef)).subscribe(()=>{this.dialogState().open&&this.close("navigation")})}close(e="closeButton"){this.dialogState.update(t=>F(k({},t),{open:!1,reason:e}))}ngOnDestroy(){this._unsubscribeAllSubject.next(void 0),this._unsubscribeAllSubject.complete()}initialize(e){this._unsubscribeAllSubject.next(void 0),this.pendingOnClose=e.onClose,this.loading.set(!1),this.error.set({}),this.productErrors.set({}),this.recs.set(void 0),this.recsLoading.set(!1),this.basket.set(void 0),this.bundle.set(void 0),this.bundleLine.set(void 0),this.products.set(void 0),this.lines.set(void 0),this.mainProductLine.set(void 0),this.productsDictionary.set({}),this.lineDictionary.set({}),this.insurances.set([]),this.superstepSelectedInsurance.set(void 0),this.superstepBasketInsurances.set({}),this.initialBasketInsurances.set({}),this.addingQuantity.set(void 0),e.bundle?this.bundle.set(e.bundle):e.products&&this.products.set(e.products),e.dialogLoadedCallback&&e.dialogLoadedCallback(),e.errors&&this.error.set(e.errors),e.productErrors&&this.productErrors.set(e.productErrors),this.step="insurance";let t=this.products();if(t&&!this.bundle()){this.recsLoading.set(!0);let _=new re,C=t.map(T=>T.productId)??[],W=t.length===1?t[0].manufacturerId:void 0,j=[this.recommendationService.getCompatibleProductRecommendations$(C),this.recommendationService.getProductRecommendations$({placement:"add_to_cart",productIds:C,brandId:W})];ue(...j).pipe(L(j.length),A(this._unsubscribeAllSubject),A(_)).subscribe({next:T=>{let N=T?.products.filter($=>this.lineDictionary()[$.productId]===void 0&&$.stockCount>0)??[];T&&N.length&&(this.recs.set(T),_.next())},complete:()=>{this.recsLoading.set(!1)}})}let n=this.conf.appSettings.addToCartModalAddonsEnabled;n===!1&&(this.step="accessory");let o=this.basketService.getBasket$().pipe(D(_=>(this.setupBasket(_),_)),ne(1));o.pipe(A(this._unsubscribeAllSubject)).subscribe(),this.services$=o.pipe(de(_=>{let C=this.lines(),W=this.mainProductLine();if(!n||!this.productsDictionary()||!C||C?.length!==1&&!W)return R([]);this.loading.set(!0);let j=this.basket()?.deliveryZipcode??(this.userService.getUserZipcode()||void 0),T=W??C[0];return this.basketService.getAddonsForLine$(T.lineId,T.productId,j,[B.Insurance,B.Service,B.StandaloneAddon]).pipe(D(N=>(this.loading.set(!1),N)),me(N=>{let $=N.filter(O=>O.addonType===B.Insurance);this.insurances.set($);let le=_.addons.filter(O=>O.basketLineId===T.lineId);(le.length>0||$.length===0)&&(this.step="accessory"),this.initialBasketInsurances.set(le.reduce((O,pt)=>F(k({},O),{[pt.productId]:!0}),{})),this.superstepBasketInsurances.set(this.initialBasketInsurances())}))}),ne(1)),this.insurances$=this.services$.pipe(D(_=>_.filter(C=>C.addonType===B.Insurance))),this.standaloneServiceProducts$=this.services$.pipe(D(_=>_.filter(C=>C.addonType===B.StandaloneAddon))).pipe(de(_=>this.productService.getProductsByIds$(_.flatMap(C=>C.serviceProductId))),ne(1));let m=this.lines();this.productAddonFamily$=m&&m[0]?this.basketService.getAddonFamilyForProduct$(m[0].productId):R(void 0)}toggleInsurance(e){this.superstepSelectedInsurance.set(e),this.superstepBasketInsurances.set({[e.serviceProductId]:!0})}toggleInsurance2([e,t,n]){this.superstepSelectedInsurance.set(e),this.insurances.set(t),this.superstepBasketInsurances.set(n)}saveInsurance(){let e=this.mainProductLine()??this.lines()?.[0];if(!e)return;let t=this.superstepSelectedInsurance();if(t===void 0&&this.insurances()[0]&&(t=this.insurances()[0]),t&&this.initialBasketInsurances()[t.serviceProductId]){this.step="accessory",this.loading.set(!1);return}this.loading.set(!0);let n=this.basketService.getActiveInsurance(this.insurances(),this.initialBasketInsurances());t&&n!==t?this.basketService.toggleAddon$(e,t,n,this.sourceComponent,{item_list_id:this.sourceComponent,item_list_name:"Superstep",item_origin:"add insurance"}).pipe(L(1),A(this._unsubscribeAllSubject)).subscribe({next:o=>{let m=o.addons.filter(_=>_.basketLineId===e.lineId);this.initialBasketInsurances.set(m.reduce((_,C)=>F(k({},_),{[C.productId]:!0}),{})),this.superstepBasketInsurances.set(this.initialBasketInsurances())},error:()=>{let o=k({},this.error());V.set(o,"generic.addon",!0),this.error.set(o)}}).add(()=>{this.step="accessory",this.loading.set(!1)}):(this.step="accessory",this.loading.set(!1))}noInsurance(){let e=this.mainProductLine()??this.lines()?.[0];if(!e)return;let t=this.basket()?.addons.find(o=>o.basketLineId===e.lineId),n=t?this.insurances().find(o=>o.serviceProductId===t.productId):void 0;n?(this.loading.set(!0),this.basketService.toggleAddon$(e,n,n,this.sourceComponent,{item_list_id:this.sourceComponent,item_list_name:"Superstep"}).subscribe({next:o=>{this.setupBasket(o)},error:()=>{let o=k({},this.error());V.set(o,"generic.addon",!0),this.error.set(o)}}).add(()=>{this.step="accessory",this.loading.set(!1)})):this.step="accessory",this.backRouteService.register("add-to-cart-dialog second page",this.backToInsurance)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=U({type:i,selectors:[["pwr-add-to-cart-dialog"]],viewQuery:function(t,n){t&1&&xe(n.dialogFooterRef,Yt,5),t&2&&ve()},inputs:{dialogState:[1,"dialogState"]},outputs:{dialogState:"dialogStateChange"},features:[Z([q])],decls:23,vars:23,consts:[["dialogFooter",""],[3,"loading","diameter"],["fxLayout","row","fxLayoutAlign","space-between center",1,"py-spacer-xmini","g-spacer-xmini"],["fxLayout","row","fxLayoutAlign","start center",1,"curs
3or-pointer",3,"click"],[3,"icon"],[1,"bold","center"],[3,"buttonClick","icon","iconAriaLabel"],[3,"expires","routeToCheckoutOnExpire"],[3,"error"],[3,"_lineInput","bundle","index","sourceComponent"],[3,"_lineInput","product","index","visibleAddons","showInlineBasketAddons","sourceComponent"],[3,"selectInsurance","_lineInput","product","index","visibleAddons","showInlineBasketAddons","sourceComponent"],[3,"selectInsurance","_lineInput","product","visibleAddons","index","sourceComponent"],[3,"selectInsurance","product","index","sourceComponent"],[3,"insurances","selectedInsurances","quantity","loading","isModal","inAddToCartSidebar","isSuperstep"],[3,"toggleInsurance","insurances","selectedInsurances","quantity","loading","isModal","inAddToCartSidebar","isSuperstep"],[3,"colorVariant"],[1,"mt-spacer-basic"],[3,"title","gaTitle","products","loading","sourceComponent","maxNumberOfProductsShownOnLoad"],[3,"addonFamily"],["data-testid","continue-shopping-button",3,"color","text","fullWidth"],["fxLayout-gt-xs","row","fxLayoutAlign","space-between center",1,"buttons","g-spacer-mini"],["data-testid","superstep-do-not-insure-button",3,"buttonClick","color","text","fullWidth","disabled"],["data-testid","superstep-insure-device-button",3,"buttonClick","color","text","fullWidth","disabled"],["data-testid","continue-shopping-button",3,"buttonClick","color","text","fullWidth"],["data-testid","go-to-cart-button",3,"color","text","url","routerExtras","fullWidth"]],template:function(t,n){if(t&1&&(c(0,"pwr-lib-loader-overlay",1)(1,"div",2)(2,"div"),l(3,"async"),c(4,"div",3),y("click",function(){return n.backToInsurance()}),v(5,"pwr-lib-icon",4),c(6,"div"),S(7),l(8,"transloco"),s()()(),c(9,"div")(10,"h4",5),S(11),l(12,"transloco"),s()(),c(13,"div")(14,"pwr-lib-icon-clickable",6),l(15,"transloco"),y("buttonClick",function(){return n.close("close")}),s()()(),h(16,oi,1,2,"pwr-checkout-limited-stock-counter",7),h(17,ri,1,1,"pwr-product-error",8),h(18,ai,1,4,"pwr-product-line-v2",9)(19,gi,3,3),h(20,xi,11,21),s(),ye(21,Si,2,1,"ng-template",null,0,ke)),t&2){let o,m,_,C;u("loading",n.loading()||n.recsLoading())("diameter",64),d(2),z(J(21,ei,n.step==="insurance"||!((o=p(3,13,n.insurances$))!=null&&o.length))),d(3),u("icon","pwr-icon-arrow-back"),d(2),P(" ",p(8,15,"General.Back")," "),d(4),P(" ",p(12,17,(m=n.data())!=null&&m.errors?"Checkout.Overlay.Error":"Checkout.Overlay")," "),d(3),u("icon","pwr-icon-close")("iconAriaLabel",p(15,19,"General.Close")),d(2),f((_=(_=n.basket())==null?null:_.expires)?16:-1,_),d(),f(n.error()?17:-1),d(),f(n.bundleLine()?18:(C=n.lines())!=null&&C.length&&n.productsDictionary()?19:-1),d(2),f(n.step==="accessory"?20:-1)}},dependencies:[Pe,te,je,Ue,it,Ge,rt,dt,st,ee,ct,at,Le,Y,ie,He],styles:[`@media screen and (max-width:599px){.buttons[_ngcontent-%COMP%]{flex-direction:column-reverse}}.hidden[_ngcontent-%COMP%]{visibility:hidden;pointer-events:none}.nowrap[_ngcontent-%COMP%]{white-space:nowrap}.balanced[_ngcontent-%COMP%]{text-wrap:balance} 4/*# sourceMappingURL=add-to-cart-dialog.component-C7DJKIOU.css.map */`],changeDetection:0})}}return i})()});Ai();export{vn as AddToCartDialogComponent}; 5//# sourceMappingURL=chunk-XPAM5K3X.js.map
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.