1"use strict";(self.webpackChunkhot_b2b=self.webpackChunkhot_b2b||[]).push([[5114],{45114(b,S,t){t.d(S,{EmptiesModule:()=>k});var P=t(49769),I=t(89417),A=t(80498),p=t(93049),C=t(69830),g=t(93563),D=t(34623),O=t(17274),m=t(59640),R=t(21413),d=t(5964),T=t(53993),E=t(56977),s=t(35547),u=t(85802),j=t(50429),H=t(40149),W=t(81699),V=t(82858),U=t(12087),B=t(7761),$=t(73927),x=t(24123),N=t(74961),r=t(90001),M=t(15921),l=t(40591),c=t(26293),h=t(73955);function K(n,w){1&n&&(s.j41(0,"h1",4),s.EFF(1),s.nI1(2,"translate"),s.k0s()),2&n&&(s.R7$(),s.JRh(s.bMT(2,1,"catalog.empties.title")))}function F(n,w){if(1&n){const e=s.RV6();s.j41(0,"div",5)(1,"hot-button",6),s.nI1(2,"translate"),s.bIt("click",function(){u.eBV(e);const a=s.XpG();return u.Njj(a.loadAllEmpties())}),s.k0s()()}2&n&&(s.R7$(),s.Y8G("caption",s.bMT(2,1,"catalog.empties.see-all")))}let f=(()=>{class n{constructor(e,o,a,v,i,y){this.store=e,this.analyticService=o,this.featuresService=a,this.productService=v,this.screenDimensionService=i,this.itemlocationService=y,this.pageName=O.L.EMPTIES,this.isUpLg=()=>this.screenDimensionService.upLg(),this.isAllProductsLoaded=!1,this.analyticProductLocation="empties page",this.subscriptionDestroy$=new R.B,this.isCartHavingFP=!1,this.featureSplitOrderByRpms=this.featuresService.SplitOrderByRpms,this.emptiesProducts$=this.store.pipe((0,m.Lt)(D.Lx)),this.cartData$=this.store.pipe((0,m.Lt)(C.XE))}ngOnInit(){this.store.dispatch(new g.BZ),this.emptiesProducts$.pipe((0,d.p)(e=>!!e?.length),(0,T.E)(this.store.select(C.VE)),(0,E.Q)(this.subscriptionDestroy$)).subscribe(([e,o])=>{if(this.allEmptiesProducts=e,this.isAllProductsLoaded)this.loadedProducts=e;else{if(this.loadedProducts=this.loadEmptiesProducts(e,o),"true"===localStorage.getItem("auto-add-empties")){const v=o?.filter(y=>y?.isReturnableEmpty).map(y=>y?.sku),i=this.collectEmptiesToAutoAdd(e,o,v);this.processAutoAddedEmpties(i)}this.isAllProductsLoaded=this.loadedProducts.length===e.length}}),this.cartData$.pipe((0,E.Q)(this.subscriptionDestroy$)).subscribe(e=>{this.isCartHavingFP=this.featureSplitOrderByRpms&&e.items.some(o=>!o.isReturnableEmpty)})}loadEmptiesProducts(e,o){return e.filter(a=>o.some(v=>v.product.returnableEmptySku===a.sku||a.unitsOfMeasure?.some(i=>i.sku===v.product.returnableEmptySku)))}collectEmptiesToAutoAdd(e,o,a){const v=[];return e?.forEach(i=>o?.forEach(y=>{(y.product?.returnableEmptySku===i.sku||i.unitsOfMeasure?.some(q=>q?.sku===y.product?.returnableEmptySku))&&!a?.includes(i.sku)&&!this.productService?.autoAddedEmptiesRemovedFromCartTracker?.includes(i?.sku)&&this.inCartEmpty(v,y,i)})),v}processAutoAddedEmpties(e){e?.forEach(o=>{this.itemlocationService.addItemLocation(o.sku,this.analyticProductLocation),this.analyticService.sendAddCartEventInfo([o.emptyProduct],this.analyticProductLocation),this.productService.sendProductHandler(o.emptyProduct,o.quantity)})}inCartEmpty(e,o,a){let v=e?.find(i=>i.sku==a?.sku);return v?v.quantity+=o.quantity:e.push({sku:a.sku,emptyProduct:a,quantity:o.quantity}),e}addToCartHandler(e){this.itemlocationService.addItemLocation(e.sku,this.analyticProductLocation),this.analyticService.sendAddCartEventInfo([e],this.analyticProductLocation,!1,e.addMethod),this.productService.sendProductHandler(e,e.quantity)}removeFromCartHandler(e){e?.isReturnableEmpty&&this.productService.addProductToAutoAddEmptiesRemovedFromCartTracker(e?.sku),this.itemlocationService.removeItemLocation(e.sku,this.analyticProductLocation),this.analyticService.sendRemoveCartEventInfo(e,this.analyticProductLocation,e.addMethod),this.productService.sendProductHandler(e,0)}sendChangeQuantityHandler(e){this.itemlocationService.addItemLocation(e.sku,this.analyticProductLocation),this.analyticService.sendAddCartEventInfo([e],this.analyticProductLocation,!0,e.addMethod),this.productService.sendProductHandler(e,e.quantity)}loadAllEmpties(){this.isAllProductsLoaded=!0,this.loadedProducts=this.allEmptiesProducts}ngOnDestroy(){this.subscriptionDestroy$.next(!0),this.productService.clearAutoAddEmptiesRemovedFromCartTracker(),localStorage.removeItem("auto-add-empties")}static{this.\u0275fac=function(o){return new(o||n)(s.rXU(m.il),s.rXU(j.L),s.rXU(H.D),s.rXU(W.b),s.rXU(V.m),s.rXU(U.k))}}static{this.\u0275cmp=s.VBU({type:n,selectors:[["hot-empties-page"]],standalone:!1,decls:9,vars:5,consts:[["block","empties"],["block","page-title",4,"ngIf"],["elem","list",3,"addToCart","removeFromCart","sendChangeQuantity","products","pageName","
1isEmpties"],["elem","button-wrapper",4,"ngIf"],["block","page-title"],["elem","button-wrapper"],["elem","button","modifier","rounded bordered","pageName","Empties page",3,"click","caption"]],template:function(o,a){1&o&&(s.j41(0,"hot-base-page"),s.nrm(1,"hot-back-button"),s.j41(2,"hot-content")(3,"div",0),s.DNE(4,K,3,3,"h1",1),s.j41(5,"hot-product-list",2),s.bIt("addToCart",function(i){return a.addToCartHandler(i)})("removeFromCart",function(i){return a.removeFromCartHandler(i)})("sendChangeQuantity",function(i){return a.sendChangeQuantityHandler(i)}),s.k0s(),s.DNE(6,F,3,3,"div",3),s.k0s()(),s.j41(7,"hot-sidebar"),s.nrm(8,"hot-cart-sidebar"),s.k0s()()),2&o&&(s.R7$(4),s.Y8G("ngIf",a.isUpLg()),s.R7$(),s.Y8G("products",a.loadedProducts)("pageName",a.pageName)("isEmpties",!0),s.R7$(),s.Y8G("ngIf",!a.isAllProductsLoaded&&!a.isCartHavingFP))},dependencies:[P.bT,B.vq,B.vK,$.b,x.X,N.y,r.B,M.m,l.t,c.k,h.D9],encapsulation:2})}}return n})();var X=t(51049),G=t(77753),L=t(52909),Q=t(76583),Y=t(5553),J=t(826);const Z=[{path:"",children:[{path:"",component:f,canActivate:[X.g,G.V,L.p,Q.w,Y.v,J.R],data:{analytics:{pageType:"plp",primaryCategory:"empties"}},pathMatch:"full"}]}];let z=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=s.$C({type:n})}static{this.\u0275inj=u.G2t({imports:[p.iI.forChild(Z),p.iI]})}}return n})(),k=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=s.$C({type:n})}static{this.\u0275inj=u.G2t({imports:[P.MD,z,I.YN,A.G]})}}return n})()},77753(b,S,t){t.d(S,{V:()=>N});var P=t(7673),I=t(96697),A=t(24845),p=t(7503),C=t(35878),g=t(6327),D=t(70563),O=t(6944),m=t(66513),R=t(43744),d=O.A?O.A.isConcatSpreadable:void 0;const E=function T(r){return(0,R.A)(r)||(0,m.A)(r)||!!(d&&r&&r[d])},u=function s(r,M,l,c,h){var K=-1,F=r.length;for(l||(l=E),h||(h=[]);++K<F;){var f=r[K];M>0&&l(f)?M>1?s(f,M-1,l,c,h):(0,D.A)(h,f):c||(h[h.length]=f)}return h};var j=t(94528);const W=function H(){var r=arguments.length;if(!r)return[];for(var M=Array(r-1),l=arguments[0],c=r;c--;)M[c-1]=arguments[c];return(0,D.A)((0,R.A)(l)?(0,j.A)(l):[l],u(M,1))};var V=t(76209),U=t(85802),B=t(37702),$=t(69727),x=t(79989);let N=(()=>{class r{constructor(l,c,h){this.router=l,this.storeService=c,this.navigationService=h,this.commonRoutes=["/privacy-policy","/profile"],this.accountTypes=A.C}canActivate(l,c){return(0,P.of)(this.checkRoute(c))}checkRoute(l){const c=this.storeService.getSelector(C.Wo),h=c?c.userType:localStorage.getItem(p.c.userType),K=localStorage.getItem(p.c.subDistributorMode);return(h===this.accountTypes.Distributor||h===this.accountTypes.OpcoDistributor||h===this.accountTypes.SubDistributor&&"Distributor"===K)&&this.navigationService.getNavigationItems().pipe((0,I.s)(1)).subscribe(F=>{const f=(0,g.A)(F,L=>L.link),X=W(f,this.commonRoutes);return!!(0,V.A)(X,L=>l.url===L)||(this.router.navigate([f.length?f[0]:"/notFound"]),!1)}),!0}static{this.\u0275fac=function(c){return new(c||r)(U.KVO(B.Ix),U.KVO($.n),U.KVO(x.o))}}static{this.\u0275prov=U.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()},5553(b,S,t){t.d(S,{v:()=>R});var P=t(5964),I=t(96354),A=t(72127),p=t(76209),C=t(30554),g=t(85802),D=t(37702),O=t(59640),m=t(69727);let R=(()=>{class d{constructor(E,s,u){this.router=E,this.store=s,this.storeService=u}canActivate(E,s){return this.store.select(A.lC).pipe((0,P.p)(u=>u),(0,I.T)(()=>this.checkRoute(s)))}checkRoute(E){const s=this.storeService.getSelector(A.Hv),u=(0,p.A)(s,["url",E.url]);return!(0,C.A)(u)||(this.router.navigate([u.redirect.length>0||u.redirect?u.redirect:"/"]),!1)}static{this.\u0275fac=function(s){return new(s||d)(g.KVO(D.Ix),g.KVO(O.il),g.KVO(m.n))}}static{this.\u0275prov=g.jDH({token:d,factory:d.\u0275fac,providedIn:"root"})}}return d})()},76583(b,S,t){t.d(S,{w:()=>O});var P=t(5964),I=t(96354),A=t(72127),p=t(85802),C=t(37702),g=t(59640),D=t(69727);let O=(()=>{class m{constructor(d,T,E){this.router=d,this.store=T,this.storeService=E}canActivate(){return this.store.select(A.x3).pipe((0,P.p)(d=>!!d.length),(0,I.T)(()=>!0))}static{this.\u0275fac=function(T){return new(T||m)(p.KVO(C.Ix),p.KVO(g.il),p.KVO(D.n)
1)}}static{this.\u0275prov=p.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()}}]);
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.