File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/5068.76f5c706705f6227.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5068],{45068:(Y,y,a)=>{a.r(y),a.d(y,{ItemDetailPageModule:()=>N});var p=a(56610),n=a(77897),b=a(22882),_=a(36075),m=a(73308),e=a(2978);function S(o,h){if(1&o){const t=e.RV6();e.j41(0,"ion-footer",0)(1,"ion-toolbar",10)(2,"ion-button",11),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.applyFilter())}),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()}2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"BUTTON_APPLY_FILTER")))}const P=function(o){return{activeIcon:o}};let I=(()=>{class o{constructor(t,i){this.modalCtrl=t,this.navParams=i,this.valueOrder=i.get("filterOrder"),this.currentValueOrder=this.valueOrder}ngOnInit(){}cancel(t,i){this.modalCtrl.dismiss({status:t,valueOrder:i})}selectedValueOrder(t){t!=this.currentValueOrder&&(this.currentValueOrder=t)}applyFilter(){this.cancel(!0,this.currentValueOrder)}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(n.W3),e.rXU(n.y8))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["page-filters"]],decls:31,vars:28,consts:[[1,"ion-no-border"],["color","primary"],["slot","end"],["strong","","color","light",3,"click"],[1,"ion-padding"],[1,"labelTitleOrder"],[1,"ion-text-center",3,"click"],["name","list-outline",1,"iconFilter",3,"ngClass"],["name","cash-outline",1,"iconFilter",3,"ngClass"],["class","ion-no-border",4,"ngIf"],["color","light"],["color","primary","expand","block",3,"click"]],template:function(i,r){1&i&&(e.j41(0,"ion-header",0)(1,"ion-toolbar",1)(2,"ion-title"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"ion-buttons",2)(6,"ion-button",3),e.bIt("click",function(){return r.cancel(!1)}),e.EFF(7),e.nI1(8,"translate"),e.k0s()()()(),e.j41(9,"ion-content",4)(10,"ion-label",5),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.j41(13,"ion-grid")(14,"ion-row")(15,"ion-col",6),e.bIt("click",function(){return r.selectedValueOrder("order")}),e.nrm(16,"ion-icon",7),e.j41(17,"p"),e.EFF(18),e.nI1(19,"translate"),e.k0s()(),e.j41(20,"ion-col",6),e.bIt("click",function(){return r.selectedValueOrder("lowerPrice")}),e.nrm(21,"ion-icon",8),e.j41(22,"p"),e.EFF(23),e.nI1(24,"translate"),e.k0s()(),e.j41(25,"ion-col",6),e.bIt("click",function(){return r.selectedValueOrder("higherPrice")}),e.nrm(26,"ion-icon",8),e.j41(27,"p"),e.EFF(28),e.nI1(29,"translate"),e.k0s()()()()(),e.DNE(30,S,5,3,"ion-footer",9)),2&i&&(e.R7$(3),e.JRh(e.bMT(4,10,"LABEL_FILTERS")),e.R7$(4),e.JRh(e.bMT(8,12,"all.close")),e.R7$(4),e.JRh(e.bMT(12,14,"LABEL_FILTERS_ORDER")),e.R7$(5),e.Y8G("ngClass",e.eq3(22,P,"order"==r.currentValueOrder)),e.R7$(2),e.JRh(e.bMT(19,16,"LABEL_FILTERS_ORDER_OPTION1")),e.R7$(3),e.Y8G("ngClass",e.eq3(24,P,"lowerPrice"==r.currentValueOrder)),e.R7$(2),e.JRh(e.bMT(24,18,"LABEL_FILTERS_ORDER_OPTION2")),e.R7$(3),e.Y8G("ngClass",e.eq3(26,P,"higherPrice"==r.currentValueOrder)),e.R7$(2),e.JRh(e.bMT(29,20,"LABEL_FILTERS_ORDER_OPTION3")),e.R7$(2),e.Y8G("ngIf",r.currentValueOrder!=r.valueOrder))},dependencies:[p.YU,p.bT,n.Jm,n.QW,n.hU,n.W9,n.M0,n.lO,n.eU,n.iq,n.he,n.ln,n.BC,n.ai,b.D9],styles:[".labelTitleOrder[_ngcontent-%COMP%]{font-weight:600}.iconFilter[_ngcontent-%COMP%]{color:var(--ion-color-secondary);font-size:30px;border:1px solid var(--ion-color-secondary);border-radius:50%;padding:5px}.activeIcon[_ngcontent-%COMP%]{color:#fff!important;background-color:var(--ion-color-secondary)!important}"]})}return o})();var O=a(76098),C=a(57291),T=a(26173),F=a(7125),R=a(46868),k=a(54171),D=a(70047),E=a(81337);function L(o,h){if(1&o&&(e.j41(0,"ion-badge",20),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(1),e.SpI("",t.cartProvider.productsCart.length," ")}}function $(o,h){if(1&o&&(e.j41(0,"ion-segment-button",24),e.EFF(1),e.k0s()),2&o){const t=h.$implicit;e.FS9("value",t.name),e.R7$(1),e.SpI(" ",t.name," ")}}function j(o,h){if(1&o){const t=e.RV6();e.j41(0,"ion-segment",21),e.bIt("ionChange",function(r){e.eBV(t);const s=e.XpG();return e.Njj(s.changedSubcategory(r))}),e.j41(1,"div",22),e.DNE(2,$,2,2,"ion-segment-button",23),e.k0s()()}if(2&o){const t=e.XpG();e.Y8G("value",t.subCategorySegment),e.R7$(2),e.Y8G("ngForOf",t.listSubcategories)}}function G(o,h){if(1&o&&e.nrm(0,"app-empty-component",25),2&o){const t=e.XpG();e.Y8G("emptySettingsSlide",t.emptySettingsSlide)}}function M(o,h){if(1&o&&e.nrm(0,"app-product-list",31),2&o){const t=e.XpG(3);e.Y8G("listProducts",t.listProducts)}}function A(o,h){if(1&o){const t=e.RV6();e.j41(0,"div",27),e.DNE(1,M,1,1,"app-product-list",28),e.j41(2,"ion-infinite-scroll",29),e.bIt("ionInfinite",function(r){e.eBV(t);const s=e.XpG(2);return e.Njj(s.moreProducts(r))}),e.nrm(3,"ion-infinite-scroll-content",30),e.nI1(4,"translate"),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(1),e.Y8G("ngIf",t.listProducts.length),e.R7$(2),e.FS9("loadingText",e.bMT(4,2,"LOADING_MORE_PRODUCTS"))}}function x(o,h){if(1&o&&(e.j41(0,"div"),e.DNE(1,A,5,4,"div",26),e.k0s()),2&o){const t=h.$implicit;e.R7$(1),e.Y8G("ngSwitchCase",t.name)}}const w=function(o){return[o]},U=[{path:"",component:(()=>{class o{constructor(t,i,r,s,u,c,l,g,d,f,v){this.modalCtrl=t,this.sanitizer=i,this.storage=r,this.homeProvider=s,this.cityProvider=u,this.cartProvider=c,this.utilsService=l,this.alertCtrl=g,this.translate=d,this.routerOutlet=f,this.router=v,this.offset=0,this.take=10,this.listProductsSubcategory=[],this.listProducts=[],this.searchProduct="",this.listProductsChanged=0,this.valueOrder="order",this.orderSorting="ASC",this.discountCategory=[],this.category=this.homeProvider._currentCategory,this.category&&(this.backgroundImg=this.sanitizer.bypassSecurityTrustStyle("url("+u._urlGallery+"categories/"+this.category.image+")"),this.subCategorySegment=this.category.name)}ngOnInit(){this.emptySettingsSlide={showImage:!1,urlImage:"",showText:!0,text:this.translate.instant("NO_PRODUCTS")},this.loadData()}loadData(){var t=this;return(0,m.A)(function*(){yield t.storage.get("token").then(function(){var i=(0,m.A)(function*(r){r&&(yield t.utilsService.presentLoading(t.translate.instant("all.loading")).then((0,m.A)(function*(){(yield t.homeProvider.listSubcategories(t.category.id,r.access_token)).subscribe(s=>{t.utilsService.dismissLoading(),"success"==s.status&&(t.listSubcategories=s.subcategories,t.discountCategory=s.discountCategory,t.discountCategory&&t.cartProvider.validateDateDiscount(t.discountCategory)&&t.showAlertDiscountCategory(t.discountCategory,t.category.name),t.infoSubcategory=t.listSubcategories.find(u=>u.name===t.category.name),!t.infoSubcategory&&t.listSubcategories.length&&(t.infoSubcategory=t.listSubcategories[0]),t.getListProductsSubcategories(t.infoSubcategory.id,t.offset,t.take,t.valueOrder,t.orderSorting))},s=>{t.utilsService.dismissLoading(),console.log("error listSubcategories: ",s)})})))});return function(r){return i.apply(this,arguments)}}())})()}toggleInfiniteScroll(){this.infiniteScroll.disabled=!this.infiniteScroll.disabled}showAlertDiscountCategory(t,i){let r="";r=t.apply_value?t.percentage_discount?"Por compras superiores a $"+t.value_for_win+" en la categor\xeda "+i+" o en cualquiera de sus subcategor\xedas obtendr\xe1s un "+t.percentage_discount+"% de descuento en cada producto.":"Por compras superiores a $"+t.value_for_win+" en la categor\xeda "+i+" o en cualquiera de sus subcategor\xedas obtendr\xe1s $"+t.price_discount+" pesos de descuento en cada producto.":t.percentage_discount?"Por compras superiores a $"+t.value_for_win+" en la categor\xeda "+i+" o en cualquiera de sus subcategor\xedas obtendr\xe1s un "+t.percentage_discount+"% de descuento en el valor del domicilio.":"Por compras superiores a $"+t.value_for_win+" en la categor\xeda "+i+" o en cualquiera de sus subcategor\xedas obtendr\xe1s $"+t.price_discount+" pesos de descuento en el valor del domicilio.",this.alertDiscount(r)}alertDiscount(t){var i=this;return(0,m.A)(function*(){yield(yield i.alertCtrl.create({header:"\xa1 Descuento Activo !",message:t,buttons:["OK"]})).present()})()}getListProductsSubcategories(t,i,r,s,u,c){var l=this;this.storage.get("token").then(g=>{g&&this.utilsService.presentLoading(this.translate.instant("all.loading")).then((0,m.A)(function*(){(yield l.homeProvider.listProductsSubcategory(t,i,r,s,u,l.cartProvider.storeType,g.access_token)).subscribe(d=>{if(d.status="success"){for(let f=0;f<d.listProducts.length;f++){let v=d.listProducts[f];v.category=l.category,l.listProducts.push(v)}l.utilsService.dismissLoading(),c&&(c.target.complete(),l.offset>l.listProducts.length&&!l.infiniteScroll.disabled&&l.toggleInfiniteScroll())}},d=>{console.log("error getListProductsSubcategories: ",d),l.utilsService.dismissLoading()})}))})}moreProducts(t){this.offset+=10,""!=this.searchProduct?this.getProductsFilter(this.searchProduct.trim(),this.infoSubcategory.id,this.offset,this.take,t):this.getListProductsSubcategories(this.infoSubcategory.id,this.offset,this.take,this.valueOrder,this.orderSorting,t)}changedSubcategory(t){t.detail.value&&(this.listProducts=[],this.offset=0,this.subCategorySegment=t.detail.value,this.infoSubcategory=this.listSubcategories.find(i=>i.name==this.subCategorySegment),this.activeInfinite&&this.activeInfinite.enable(!0),this.getListProductsSubcategories(this.infoSubcategory.id,this.offset,this.take,this.valueOrder,this.orderSorting))}getProductsFilter(t,i,r,s,u){var c=this;this.storage.get("token").then(l=>{l&&this.utilsService.presentLoading(this.translate.instant("all.loading")).then((0,m.A)(function*(){(yield c.homeProvider.getProductsSubcategoryFilter(t,i,r,s,c.cartProvider.storeType,l.access_token)).subscribe(g=>{if(g.status="success"){for(let d=0;d<g.listProducts.length;d++)c.listProducts.push(g.listProducts[d].products[0]);c.utilsService.dismissLoading(),u&&(u.complete(),c.activeInfinite=u),u&&c.offset>c.listProducts.length?u.enable(!1):u&&c.activeInfinite.enable(!0)}},g=>{console.log("error getProductsFilter: ",g),c.utilsService.dismissLoading()})}))})}openModalTrends(){this.router.navigate("main"==this.cartProvider.storeType?["/app/tabs/shop/trends"]:["/shop/"+this.cartProvider.storeType+"/trends"])}modalFilters(t){var i=this;return(0,m.A)(function*(){const r=yield i.modalCtrl.create({component:I,swipeToClose:!0,presentingElement:i.routerOutlet.nativeEl,componentProps:{filterOrder:t}});yield r.present();const{data:s}=yield r.onWillDismiss();s.status&&("order"==s.valueOrder&&(i.valueOrder="order",i.orderSorting="ASC"),"lowerPrice"==s.valueOrder&&(i.valueOrder="price",i.orderSorting="ASC"),"higherPrice"==s.valueOrder&&(i.valueOrder="price",i.orderSorting="DESC"),i.listProducts=[],i.offset=0,i.activeInfinite&&i.activeInfinite.enable(!0),i.getListProductsSubcategories(i.infoSubcategory.id,i.offset,i.take,i.valueOrder,i.orderSorting))})()}openModalOrderProducts(){let t;"order"==this.valueOrder&&(t=this.valueOrder),"price"==this.valueOrder&&"ASC"==this.orderSorting&&(t="lowerPrice"),"price"==this.valueOrder&&"DESC"==this.orderSorting&&(t="higherPrice"),this.modalFilters(t)}goToCart(){this.router.navigate("main"==this.cartProvider.storeType?["/app/tabs/shop/cart"]:["/shop/"+this.cartProvider.storeType+"/cart"])}goBack(){this.routerOutlet.pop()}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(n.W3),e.rXU(O.up),e.rXU(C.n),e.rXU(T.X),e.rXU(F.h),e.rXU(R.m),e.rXU(k.T),e.rXU(n.hG),e.rXU(b.c$),e.rXU(n.Rg),e.rXU(_.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["page-item-detail"]],viewQuery:function(i,r){if(1&i&&e.GBs(n.Ax,5),2&i){let s;e.mGM(s=e.lsd())&&(r.infiniteScroll=s.first)}},decls:30,vars:19,consts:[[1,"ion-no-border"],["slot","start"],[3,"click"],["color","light",3,"placeholder","routerLink"],["slot","end"],["slot","icon-only","name","cart-outline",1,"button-shopping"],["color","secondary","class","badge-cart",4,"ngIf"],["slot","fixed",2,"background-color","white","width","-webkit-fill-available"],[1,"item-profile","ion-text-center"],["profilePic",""],["mode","md",3,"value","ionChange",4,"ngIf"],[1,"d-flex","justify-content-center",2,"text-align","center"],["color","secondary",1,"chip_payment",3,"click"],["name","filter-outline"],["color","secondary",1,"responsive-text"],["name","trending-up-outline"],[3,"emptySettingsSlide",4,"ngIf"],[2,"margin-top","200px"],[3,"ngSwitch"],[4,"ngFor","ngForOf"],["color","secondary",1,"badge-cart"],["mode","md",3,"value","ionChange"],[1,"segmentCategory"],["class","segmentSubCategory",3,"value",4,"ngFor","ngForOf"],[1,"segmentSubCategory",3,"value"],[3,"emptySettingsSlide"],["padding","",4,"ngSwitchCase"],["padding",""],[3,"listProducts",4,"ngIf"],[3,"ionInfinite"],["loadingSpinner","bubbles",3,"loadingText"],[3,"listProducts"]],template:function(i,r){1&i&&(e.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-buttons",1)(3,"ion-back-button",2),e.bIt("click",function(){return r.goBack()}),e.k0s()(),e.nrm(4,"ion-searchbar",3),e.nI1(5,"translate"),e.j41(6,"ion-buttons",4)(7,"div",2),e.bIt("click",function(){return r.goToCart()}),e.nrm(8,"ion-icon",5),e.DNE(9,L,2,1,"ion-badge",6),e.k0s()()()(),e.j41(10,"ion-content")(11,"div",7),e.nrm(12,"div",8,9),e.DNE(14,j,3,2,"ion-segment",10),e.j41(15,"div",11)(16,"ion-chip",12),e.bIt("click",function(){return r.openModalOrderProducts()}),e.nrm(17,"ion-icon",13),e.j41(18,"ion-label",14),e.EFF(19),e.nI1(20,"translate"),e.k0s()(),e.j41(21,"ion-chip",12),e.bIt("click",function(){return r.openModalTrends()}),e.nrm(22,"ion-icon",15),e.j41(23,"ion-label",14),e.EFF(24),e.nI1(25,"translate"),e.k0s()()()(),e.DNE(26,G,1,1,"app-empty-component",16),e.j41(27,"div",17)(28,"div",18),e.DNE(29,x,2,1,"div",19),e.k0s()()()),2&i&&(e.R7$(4),e.FS9("placeholder",e.bMT(5,11,"SEARCH_PLACEHOLDER_ITEM_DETAIL")),e.Y8G("routerLink",e.eq3(17,w,r.cartProvider.storeType&&"main"==r.cartProvider.storeType?"/app/tabs/shop/search":"/shop/"+r.cartProvider.storeType+"/search")),e.R7$(5),e.Y8G("ngIf",r.cartProvider.productsCart&&r.cartProvider.productsCart.length),e.R7$(3),e.xc7("background-image",r.backgroundImg),e.R7$(2),e.Y8G("ngIf",r.listSubcategories),e.R7$(5),e.JRh(e.bMT(20,13,"LABEL_FILTERS")),e.R7$(5),e.JRh(e.bMT(25,15,"TRENDS")),e.R7$(2),e.Y8G("ngIf",!r.listProducts.length),e.R7$(2),e.Y8G("ngSwitch",r.subCategorySegment),e.R7$(1),e.Y8G("ngForOf",r.listSubcategories))},dependencies:[p.Sq,p.bT,p.ux,p.e1,n.el,n.In,n.QW,n.ZB,n.W9,n.eU,n.iq,n.Ax,n.Hp,n.he,n.S1,n.Gp,n.eP,n.ai,n.Je,n.Gw,n.tY,n.N7,D.t,E.O,_.Wk,b.D9],styles:[".item-profile[_ngcontent-%COMP%]{width:100%;background-position:center center;background-size:cover;height:130px}.item-md.item-block[_ngcontent-%COMP%] .item-inner[_ngcontent-%COMP%]{padding-right:0!important}.segmentCategory[_ngcontent-%COMP%]{width:99%;display:inline-flex;overflow-x:auto}.segmentSubCategory[_ngcontent-%COMP%]{min-width:25%;max-width:100%;border-radius:20px!important;font-size:.8em!important;margin-left:3px;margin-right:3px;scrollbar-width:none;display:inline-table}.segmentSubCategory[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.button-shopping[_ngcontent-%COMP%]{margin-top:4px!important}.badge-cart[_ngcontent-%COMP%]{position:absolute;right:0;top:0;margin-top:2px}"]})}return o})()}];let X=(()=>{class o{static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275mod=e.$C({type:o});static#i=this.\u0275inj=e.G2t({imports:[_.iI.forChild(U),_.iI]})}return o})();var V=a(55553);let N=(()=>{class o{static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275mod=e.$C({type:o});static#i=this.\u0275inj=e.G2t({imports:[p.MD,n.bv,b.h.forChild(),V.h,X]})}return o})()}}]);