1import{a as R,b as Ct}from"./chunk-H3I3VFV3.js";import{a as _t}from"./chunk-XHUVSLX7.js";import{a as gt}from"./chunk-UTPIJ7IP.js";import"./chunk-OXSDDBCX.js";import{a as ft}from"./chunk-SPOWF5DX.js";import"./chunk-O46B62AW.js";import"./chunk-MXHRVII7.js";import"./chunk-G3YL45HI.js";import"./chunk-4QTQVH57.js";import"./chunk-MS4JTPVI.js";import{a as ht}from"./chunk-ERO6SYSO.js";import"./chunk-2EWLA452.js";import"./chunk-JZOTZR4V.js";import"./chunk-XLM3PHBJ.js";import"./chunk-M5ZOELTG.js";import"./chunk-4X43S6HD.js";import"./chunk-BTFFCKQN.js";import"./chunk-LJEKTB7Y.js";import"./chunk-VSX7QPBC.js";import{c as ut}from"./chunk-4TLFZBIT.js";import"./chunk-Y7UKFOBD.js";import{a as dt}from"./chunk-DAJ4XMZ3.js";import"./chunk-E4OOEWH6.js";import"./chunk-ZCRYBQQX.js";import"./chunk-T7KQE6HW.js";import{b as pt,d as mt}from"./chunk-UDVNABZO.js";import"./chunk-CK4L6HJX.js";import"./chunk-UWROHWTK.js";import"./chunk-GSYJEAVZ.js";import"./chunk-I4YYPFKR.js";import"./chunk-VZS7PRIT.js";import"./chunk-WJK2THVF.js";import"./chunk-TNYTWBPN.js";import"./chunk-KI5KWZ6P.js";import"./chunk-PEU67C6J.js";import"./chunk-4RQKLANU.js";import"./chunk-U37OFNKH.js";import"./chunk-2TXMBPSO.js";import"./chunk-MR6SBMUW.js";import"./chunk-624RHLPA.js";import"./chunk-I6TFQSWG.js";import"./chunk-JSCSFFY6.js";import"./chunk-A3KR7GWF.js";import"./chunk-5BEEXEIJ.js";import"./chunk-BECIFPPZ.js";import"./chunk-ZH66IXOP.js";import"./chunk-F25Q44KB.js";import"./chunk-UGA564ZN.js";import"./chunk-SNPCKK7E.js";import"./chunk-A7LDNCFW.js";import"./chunk-DNYG7EM7.js";import"./chunk-TEFUAKT2.js";import"./chunk-A4GYQBFW.js";import"./chunk-ETNMBXFH.js";import"./chunk-WJZYPAXF.js";import"./chunk-5MKXZXTK.js";import"./chunk-IAHJFMAZ.js";import"./chunk-DF7G2DJU.js";import"./chunk-NXU5XRGR.js";import"./chunk-IJGV6PEH.js";import"./chunk-UXFYXNZB.js";import"./chunk-2PZQVO5M.js";import"./chunk-YSEUWOBF.js";import"./chunk-5UOHIPKD.js";import"./chunk-XTGJWW32.js";import"./chunk-5J364GZE.js";import{q as it,w as ot}from"./chunk-24RBYWHK.js";import{x as nt}from"./chunk-LYGGRJPP.js";import"./chunk-CLFYICNC.js";import"./chunk-U7N5LJKI.js";import"./chunk-65TISXPA.js";import"./chunk-2MNCRMEG.js";import"./chunk-WAKOINC4.js";import{m as q}from"./chunk-CQVGPCJN.js";import"./chunk-2JZU3INV.js";import"./chunk-VU6FXXNN.js";import"./chunk-R65BPLEU.js";import{a as lt}from"./chunk-WTQLJPFM.js";import"./chunk-66W4FRMO.js";import"./chunk-Q2HHPJLL.js";import"./chunk-WCZ7ODOR.js";import{d as T}from"./chunk-MRPA26HF.js";import{a as rt,r as at,w as st,x as ct}from"./chunk-QPY6YZD2.js";import"./chunk-YNOYMHTV.js";import"./chunk-RYYSJJVE.js";import{$ as et}from"./chunk-DSTH3QV4.js";import{Ab as p,Bb as M,Ha as U,Ka as l,Kb as x,Kc as W,Mb as m,O as Y,Ob as r,Oc as $,Qa as d,T as F,U as z,W as N,Wb as Q,X as h,Ya as G,Yb as b,Za as Z,Zb as S,a as u,ca as s,d as E,da as c,fb as H,fd as J,ga as w,hc as K,id as tt,jc as f,jd as I,kc as g,o as D,oa as B,pb as O,rb as P,tb as k,yb as v,zb as a}from"./chunk-6KO6CXQN.js";import{a as L}from"./chunk-Q5ZUIUCT.js";var y=new N("CART_PROMO_OVERLAY_DATA");var C=class{constructor(_){this.overlayRef=_}close(){this.overlayRef.dispose()}afterClosed(){return this.overlayRef.detachments()}};var St=o=>({var1:o});function It(o,_){if(o&1){let t=x();a(0,"app-may-like-accessories",16),m("addToCart",function(e){s(t);let n=r(2);return c(n.addToCart(e))}),p()}if(o&2){let t=r(2);v("category",t.product?.category??null)("brand",t.product?.brand??null)}}function Tt(o,_){if(o&1){let t=x();a(0,"div",10)(1,"app-insurance-card",17),m("addInsurance",function(e){s(t);let n=r(2);return c(n.onAddInsurance(e))})("removeInsurance",function(e){s(t);let n=r(2);return c(n.onRemoveInsurance(e))}),p()()}if(o&2){let t=r(2);l(),v("item",t.cartItem())("promoMode",!0)}}function Rt(o,_){if(o&1){let t=x();a(0,"button",18,0),m("click",function(){let e=s(t),n=r(2);return c(n.onGoToPreviousCheckout(e))})("elementLoaded",function(){s(t);let e=r(2);return c(e.onBuyNowButtonLoaded())}),a(2,"span",13),b(3,"Continue Previous Checkout"),p()()}if(o&2){let t=r().$implicit;O("aria-label",t("action_buy_now"))}}function At(o,_){if(o&1){let t=x();a(0,"div",2),f(1,"async"),f(2,"async"),f(3,"async"),a(4,"div",3),M(5,"popsy-icon-tick-outlined",4),a(6,"h4"),b(7),p(),M(8,"span",5),a(9,"button",6),m("click",function(){s(t);let e=r();return c(e.dismiss())}),M(10,"popsy-icon-remove",7),p()(),a(11,"div",8),P(12,It,1,2,"app-may-like-accessories",9),P(13,Tt,2,2,"div",10),p(),a(14,"div",11)(15,"button",12,0),f(17,"async"),m("click",function(){s(t);let e=r();return c(e.dismiss())})("elementLoaded",function(){s(t);let e=r();return c(e.onBuyNowButtonLoaded())}),a(18,"span",13),b(19),p()(),a(20,"button",14,0),f(22,"async"),m("click",function(){s(t);let e=r();return c(e.onGoToCart())})("elementLoaded",function(){s(t);let e=r();return c(e.onBuyNowButtonLoaded())}),a(23,"span",13),b(24),p()(),P(25,Rt,4,1,"button",15),f(26,"async"),p()()}if(o&2){let t,i=_.$implicit,e=r();Q("rtl",g(1,18,e.rtlMode$))("phone",g(2,20,e.lessThan$)?.mobileL===!0)("widescreen",g(3,22,e.biggerThan$)?.mobileL),l(4),Q("progress",e.newItemAdded()),l(3),S(i("label_added_to_cart",K(30,St,e.itemTitle()||e.product?.model))),l(5),k(e.product?.category&&e.product?.brand?12:-1),l(),k(e.product?.insuranceIds?.length?13:-1),l(2),v("disabled",(g(17,24,e.cartItems$)?.length||0)<=0),O("aria-label",i("action_buy_now")),l(4),S(i("action_keep_browsing")),l(),v("disabled",(g(22,26,e.cartItems$)?.length||0)<=0),O("aria-label",i("action_buy_now")),l(4),S(i("action_continue_cart")),l(),k((t=g(26,28,e.previousCartSessionId$))?25:-1,t)}}var A=(()=>{class o{constructor(t,i,e,n,V,X,vt,xt,bt,wt){this.analytics=t,this.akitaCartQuery=i,this.akitaCartService=e,this.akitaRouterQuery=n,this.akitaScreenQuery=V,this.akitaRouterService=X,this.dateUtilsService=vt,this.cartPromoOverlayRef=xt,this.akitaCheckoutService=bt,this.data=wt,this.product=null,this.itemTitle=B(null),this.newItemAdded=B(null),this.loadingCartItems$=this.akitaCartQuery.selectLoadingCartItems(),this.updatingCart$=this.akitaCartQuery.selectUpdatingCart(),this.rtlMode$=this.akitaRouterQuery.selectIsRtlLayout(),this.lessThan$=this.akitaScreenQuery.selectLessThan(),this.biggerThan$=this.akitaScreenQuery.selectBiggerThan(),this.product=this.data.product,this.onBuySubscription=new u,this.destroySubject=ne
1w E,this.hideTidioChat(),this.queryParamsToKeep$=this.akitaRouterQuery.selectQueryParamsToKeep(),this.cartItems$=this.akitaCartQuery.selectCartItems(),this.cartItem=J(this.akitaCartQuery.selectCartItems().pipe(D(Ot=>Ot.find(Pt=>Pt.product.id===this.product?.id)||null)),{initialValue:null}),this.previousCartSessionId$=this.akitaCartQuery.selectLastSessionId()}handleKeydown(){this.dismiss()}dismiss(){this.cartPromoOverlayRef.close(),this.showTidioChat()}onOpenItem(t){this.dismiss();let i=this.akitaRouterQuery.getProductUrlFragment(t.product.id,t.product.titleEn);return this.akitaRouterService.navigate(i),!1}onRemove(t){this.akitaCartService.removeQtyFromCartAsync(t.product.id)}addToCart(t){return this.newItemAdded.set(null),t?.id&&this.onBuySubscription.add(this.akitaCartService.addNewProductToCart(t,t.selectedInsurance,"cart-popup").pipe(Y(this.destroySubject)).subscribe({next:()=>{ot(this.analytics.logEventWrapper,t,"cart-popup"),this.itemTitle.set(t.model),this.newItemAdded.set(!0)}})),!1}onAdd(t){this.akitaCartService.increaseQtyFromCartAsync(t.product.id)}onAddInsurance(t){t&&t.id&&t.productId&&this.akitaCartService.addInsuranceToCartAsync(t,"cart-popup")}onRemoveInsurance(t){t&&t.id&&t.productId&&this.akitaCartService.removeInsuranceFromCartAsync(t,"cart-popup")}onGoToCart(){this.dismiss();let t=this.akitaRouterQuery.homeUrlFragment;return t.push("cart"),this.akitaRouterService.navigate(t),!1}onGoToCheckout(){let t=this.akitaCartQuery.getSessionId();if(t){this.dismiss();let i=this.akitaRouterQuery.getCheckoutUrlFragment(t);this.akitaRouterService.navigate(i)}else this.onBuySubscription.add(this.akitaCheckoutService.createSession().pipe(Y(this.destroySubject)).subscribe({next:i=>{if(i){this.dismiss();let e=this.akitaRouterQuery.getCheckoutUrlFragment(i.id);this.akitaRouterService.navigate(e)}}}));return!1}onGoToPreviousCheckout(t){if(t){this.dismiss();let i=this.akitaRouterQuery.getCheckoutUrlFragment(t);this.akitaRouterService.navigate(i)}return!1}onBuyNowButtonLoaded(){this.dismiss(),it(this.analytics.logEventWrapper,"detail")}hideTidioChat(){try{window.tidioChatApi.hide()}catch(t){}}showTidioChat(){try{window.tidioChatApi.show()}catch(t){}}preventEventBubbling(t){return t&&t.stopPropagation&&(t.stopPropagation(),t.stopImmediatePropagation()),!1}ngOnDestroy(){this.onBuySubscription.unsubscribe(),this.destroySubject.next(),this.destroySubject.complete()}static{this.\u0275fac=function(i){return new(i||o)(d(nt),d(pt),d(mt),d(et),d(T),d(dt),d(_t),d(C),d(ut),d(y))}}static{this.\u0275cmp=G({type:o,selectors:[["app-cart-promo-overlay"]],hostBindings:function(i,e){i&1&&m("keydown.escape",function(){return e.handleKeydown()},U)},decls:1,vars:0,consts:[["buyButton",""],["class","options-dialog popsy-cart-promo",3,"rtl","phone","widescreen",4,"transloco"],[1,"options-dialog","popsy-cart-promo"],[1,"header"],[1,"icon","white-stroke"],["aria-hidden","true",1,"dynamic-space"],["tabindex","-1",1,"popsy-button-icon","close-button",3,"click"],[1,"icon","gray-light"],[1,"content","flex","flex-col","justify-between"],[3,"category","brand"],[1,"p-16"],[1,"actions"],["appElementLoaded","","href","#",1,"button","popsy-button-option","full-width",3,"click","elementLoaded","disabled"],[1,"text"],["appElementLoaded","","href","#",1,"button","popsy-button-primary","highlight","buy-button","full-width",3,"click","elementLoaded","disabled"],["appElementLoaded","","href","#",1,"button","popsy-button-secondary","highlight","buy-button","full-width"],[3,"addToCart","category","brand"],[3,"addInsurance","removeInsurance","item","promoMode"],["appElementLoaded","","href","#",1,"button","popsy-button-secondary","highlight","buy-button","full-width",3,"click","elementLoaded"]],template:function(i,e){i&1&&H(0,At,27,32,"div",1)},dependencies:[I,tt,lt,ft,R,gt,W],styles:["@keyframes _ngcontent-%COMP%_loading{0%{transform:translate(-45%)}to{transform:translate(345%)}}.options-dialog[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;display:flex;flex-direction:column;width:100%;max-width:100vw;padding:0;height:100%;border-radius:9px;overflow:auto;box-shadow:0 3px 16px -3px #00000038!important;background-color:#fff}.options-dialog.widescreen[_ngcontent-%COMP%]{max-width:600px;min-width:600px}.options-dialog.rtl[_ngcontent-%COMP%]{direction:rtl}.options-dialog[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;background-color:#ee568a;color:#fff}.options-dialog[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h4[_ng
1content-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:18px}.options-dialog[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;line-height:24px;min-height:16px;font-display:swap;padding:8px 16px;margin:0;text-align:center;border-bottom:1px solid #f4f4f4}.options-dialog[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{width:24px;height:24px;min-width:24px;padding:0;line-height:24px;border:0}.options-dialog[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:12px;height:12px;min-height:12px;max-height:12px;width:12px;min-width:12px;max-width:12px;line-height:12px}.options-dialog[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:24px;height:24px;min-height:24px;max-height:24px;width:24px;min-width:24px;max-width:24px;line-height:24px}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{height:100%;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;background-color:#f3f4f7;margin:0}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .empty-cart[_ngcontent-%COMP%]{font-size:14px;line-height:21px;min-height:15px;font-display:swap;padding:8px 16px;margin:0;width:100%;text-align:center;color:#42526e}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;display:flex;align-items:center;justify-content:center;width:100%;height:64px;cursor:pointer}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .row.actions-row[_ngcontent-%COMP%]{height:fit-content;justify-content:flex-end}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .col[_ngcontent-%COMP%], .options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .cart-item[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .media-col[_ngcontent-%COMP%]{flex:0;width:fit-content;height:100%;min-width:64px;min-height:64px}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .media-col[_ngcontent-%COMP%] .picture[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;padding:0;width:64px;height:64px;max-width:64px;max-height:64px;min-width:64px;min-height:64px;object-fit:cover;object-position:center;border-radius:5px;overflow:hidden}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .info-col[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;flex:1;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:100%;height:100%;min-width:100px}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .info-col[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;line-height:21px;min-height:15px;font-display:swap;font-weight:400;margin:0;padding:0;text-overflow:ellipsis;word-break:break-all;white-space:nowrap;overflow:hidden;max-width:100%;color:#172b4d}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .info-col[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{font-size:14px;line-height:21px;min-height:15px;font-display:swap;font-weight:700;margin:0;padding:0;text-overflow:ellipsis;word-break:break-all;white-space:nowrap;overflow:hidden;font-size:18px;color:#172b4d;max-width:100%}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .info-col[_ngcontent-%COMP%] .added-on[_ngcontent-%COMP%]{line-height:21px;min-height:15px;font-display:swap;text-overflow:ellipsis;word-break:break-all;white-space:nowrap;overflow:hidden;font-weight:400;font-size:14px;color:#6b778c;max-width:100%}.options-dialog[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .actions-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;min-width:100px}.options-dialog[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:flex-end;width:100%;margin:0;padding:8px;background-color:#e5e7eb}.progress[_ngcontent-%COMP%]{background-color:#fff;color:#fff;animation:_ngcontent-%COMP%_fill-head .7s ease-out forwards}@keyframes _ngcontent-%COMP%_fill-head{0%{background-color:#fff}80%{background-color:#c6e1f0}to{background-color:#ee568a}}"]})}}return o}
1)();var jt=10,Vt={hasBackdrop:!0,backdropClass:"popsy-transparent-backdrop",panelClass:"popsy-overlay-panel"},j=(()=>{class o{constructor(t,i,e){this.injector=t,this.overlay=i,this.akitaScreenQuery=e,this.subscriptions=new u}clearSubscriptions(){this.subscriptions&&this.subscriptions.unsubscribe()}open(t={}){this.clearSubscriptions(),this.subscriptions=new u;let i=L(L({},Vt),t),e=this.createOverlay(i),n=new C(e);return this.attachDialogContainer(e,i,n),this.subscriptions.add(e.backdropClick().subscribe({next:()=>n.close(),error:()=>{}})),n}createOverlay(t){let i=this.getOverlayConfig(t);return this.overlay.create(i)}attachDialogContainer(t,i,e){let n=this.createInjector(i,e),V=new rt(A,null,n);return t.attach(V).instance}createInjector(t,i){let e=new Array(0);return e.push({provide:C,useValue:i}),e.push({provide:y,useValue:t.data||{}}),w.create({providers:e,parent:this.injector,name:"cart-promo-overlay"})}getOverlayConfig(t){let i=this.akitaScreenQuery.lessThan,e;if(t.elementRef&&!i.mobileL){let n=[{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top",offsetX:0,offsetY:8},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top",offsetX:0,offsetY:8},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",offsetX:0,offsetY:8}];t.startFromTop&&(n=[{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",offsetX:0,offsetY:-8},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",offsetX:0,offsetY:-8},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",offsetX:0,offsetY:-8},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top",offsetX:0,offsetY:8},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top",offsetX:0,offsetY:8},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",offsetX:0,offsetY:8}]),e=this.overlay.position().flexibleConnectedTo(t.elementRef).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(jt).withGrowAfterOpen(!!t.isBrowser).withLockedPosition(!t.isBrowser).withPositions(n)}else e=this.overlay.position().global().right("0").top("0");return new at({height:"100%",hasBackdrop:t.hasBackdrop||void 0,backdropClass:t.backdropClass||void 0,panelClass:t.panelClass||void 0,scrollStrategy:this.overlay.scrollStrategies.close(),positionStrategy:e})}static{this.\u0275fac=function(i){return new(i||o)(h(w),h(st),h(T))}}static{this.\u0275prov=F({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var Yt=[A],Ve=(()=>{class o{constructor(t,i){this.cartPromoOverlayService=t,this.cartPromoOverlayDynamicService=i,this.cartPromoOverlaySubscription=new u,this.cartPromoOverlaySubscription.add(this.cartPromoOverlayDynamicService.observe.subscribe({next:e=>{if(e){let n=this.cartPromoOverlayService.open(e);this.cartPromoOverlaySubscription.add(n.afterClosed().subscribe({next:()=>{this.cartPromoOverlayDynamicService.close()},error:()=>{}}))}}}))}static{this.\u0275fac=function(i){return new(i||o)(h(j),h(ht))}}static{this.\u0275mod=Z({type:o})}static{this.\u0275inj=z({providers:[j,{provide:y,useValue:{}}],imports:[$,q,I,Ct,R,ct,Yt]})}}return o})();export{Ve as CartPromoOverlayModule};
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.