1import{M as B}from"./MagnifyingGlass-Com5-t8K.js";import{_ as C,c as l,a as t,d as p,g as S,e as T,n as b,F as c,r as g,y as f,D as _,s as L,A as P,f as w,i as k,o as r,t as u}from"./index-D4lqpvgS.js";import{_ as x}from"./no_products_found-DOck2v8m.js";const E={components:{MagnifyingGlassIcon:B},data(){return{categoryBasedBrands:[],categoryCatalogCollection:{},brandCollectionIndex:0,dialCollectionForCategories:[],creatorDiscoverCollections:[],page:0,L2s:[],isL2BrandsLoading:!1,L2Brandpage:0,currentL2:null,target:null,observer:null,paginationTarget:null,paginationObserver:null,isPageLoading:!0,fetchingCurations:!1,all:!1,receivedAllBrands:!1,failedLogos:{}}},computed:{noOfHotSellingProducts(){return this.$getObjectLength(this.$store.state.globalState.hotSellingProducts)},brandPairs(){const i=[];for(let s=0;s<this.categoryBasedBrands.length;s+=2)i.push([this.categoryBasedBrands[s],this.categoryBasedBrands[s+1]??null]);return i}},unmounted(){this.$store.dispatch("globalState/clearSelectedProducts")},beforeUpdate(){!this.target&&!this.isPageLoading&&!this.observer&&(this.target=document.querySelector(".brand-page-column"),this.target&&(this.observer=k(this.target,this.callback)))},async mounted(){w("discover:visit"),this.$store.state.globalState.discoverCollections.collections.length==0?await this.fetchCreatorDiscoverCollections():(this.isPageLoading=!1,this.$store.state.globalState.discoverCollections.collections.forEach(async i=>{i.type==="category"&&i.sub_type==="catalog"&&await this.getCategoryInfoById(i.sub_collections,i.id)})),await this.getL2()},watch:{brandCollectionIndex(i,s){if(i==1e3&&s!==1e3){this.currentL2=null,this.categoryBasedBrands=[];return}}},methods:{handleLogoError(i){this.failedLogos={...this.failedLogos,[i]:!0}},callback(i){i.forEach(s=>{s.isIntersecting&&!this.isL2BrandsLoading&&(this.currentL2?this.showBrands(this.brandCollectionIndex,this.currentL2):this.showBrands(1e3,void 0))})},discoverPagination(i){i.forEach(s=>{s.isIntersecting&&!this.fetchingCurations&&this.fetchCreatorDiscoverCollections()})},async getL2(){let i;try{i=await this.axios({method:"GET",url:this.$catalogURL+"/api/app/category/lvl2",withCredentials:!0,headers:{"Content-Type":"application/json"}}),i.data.payload.length>0&&(this.L2s=[...i.data.payload],this.$store.dispatch("globalState/setLevelTwoCategories",this.L2s)),this.showBrands(1e3,void 0)}catch(s){console.log(s)}},switchCategoryBrand(i,s){this.L2Brandpage=0,this.categoryBasedBrands=[],this.receivedAllBrands=!1,!this.observer&&this.target&&(this.observer=k(this.target,this.callback)),this.showBrands(i,s)},async showBrands(i,s){var d,n;if(s!=null&&s.id?(this.all=!1,this.currentL2=s):s==null&&(this.all=!0,this.brandCollectionIndex=i),!s&&this.currentL2&&(this.L2Brandpage=0),this.L2Brandpage==0&&(this.receivedAllBrands=!1),this.brandCollectionIndex!==i&&!this.all){this.brandCollectionIndex=i,this.L2Brandpage=0,this.categoryBasedBrands=[];return}let h=new URLSearchParams;this.all||h.append("category_id",this.currentL2.id),h.append("page",this.L2Brandpage);try{this.isL2BrandsLoading=!0;var m=await this.axios({method:"GET",url:this.$catalogURL+"/api/app/brand",params:h,withCredentials:!0,headers:{"Content-Type":"application/json"}});this.$getObjectLength(m.data.payload)==0&&this.target?(this.receivedAllBrands=!0,this.observer.unobserve(this.target)):this.$getObjectLength((d=m.data.payload)==null?void 0:d.brand_info)>0&&(this.categoryBasedBrands=[...this.categoryBasedBrands,...(n=m.data.payload)==null?void 0:n.brand_info],this.L2Brandpage++),this.receivedAllBrands||(this.target?this.observer=k(this.target,this.callback):(this.target=document.querySelector(".brand-pagination-column"),this.observer=k(this.target,this.callback))),this.isL2BrandsLoading=!1}catch(v){console.log(v),this.isL2BrandsLoading=!1}},async goToBrandPage(i){this.$router.push({name:"BrandFromDiscover",params:{brandId:i}})},goToSearch(){w("discover:search_click"),this.$router.push({name:"Search",params:{searchQuery:""}})},async getCategoryInfoById(i,s){let h={id:[]};i.forEach(d=>{h.id.push(d.lvl3_ids[0])});var m;try{m=await this.axios({method:"POST",url:this.$catalogURL+"/api/categories",data:h,withCredentials:!0,headers:{"Content-Type":"application/json"}})}catch(d){console.log(d)}m.data.payload&&(this.categoryCatalogCollection[s]=m.data.payload)},async fetchCreatorDiscoverCollections(){var m,d,n,v,e,o;this.fetchingCurations=!0;try{var i=[],s=new URLSearchParams;s.append("show_on","creator-discover-collections"),s.append("page",(m=this.$store.state.globalState.discoverCollections)==null?void 0:m.page);var h=await this.axios({method:"GET",url:this.$catalogURL+"/api/v2/app/collections",params:s,withCredentials:!0,headers:{"Content-Type":"application/json"}});h.data.payload?(this.$store.dispatch("globalState/increaseDiscoverPageCount"),i=[...i,...h.data.payload],h.data.payload.forEac
1h(async a=>{a.type==="category"&&a.sub_type==="catalog"&&await this.getCategoryInfoById(a.sub_collections,a.id)}),this.$store.dispatch("globalState/setDiscoverCollection",i),h.data.payload.length<20&&this.paginationObserver&&((d=this.paginationObserver)==null||d.unobserve(this.paginationTarget))):(n=this.paginationObserver)==null||n.unobserve(this.paginationTarget),this.isPageLoading=!1,this.fetchingCurations=!1,((v=this.$store.state.globalState.discoverCollections)==null?void 0:v.page)==1&&((o=(e=h==null?void 0:h.data)==null?void 0:e.payload)==null?void 0:o.length)>=20&&setTimeout(()=>{this.paginationTarget=document.querySelector(".discover-page-footer"),this.paginationTarget&&!this.paginationObserver&&(this.paginationObserver=k(this.paginationTarget,this.discoverPagination))},100)}catch(a){console.log(a),this.fetchingCurations=!1,this.isPageLoading=!1,this.paginationObserver.unobserve(this.paginationTarget)}},async goToSubCollection(i,s,h){w("discover:collection_click",{curation_title:i.title||i.name,curation_type:h,sub_curation_type:s}),h=="category"&&s=="catalog"?this.$router.push({name:"CategoryCollectionFromDiscover",params:{categoryId:i.id,subCollection:JSON.stringify(i)}}):s==="brand"?i.brand_ids?this.goToBrandPage(i.brand_ids[0]):this.goToBrandPage(i.brand_id):this.$router.push({name:"CollectionFromDiscover",params:{subCollectionId:i.id,subCollection:JSON.stringify(i)}})}}},I={key:0,class:"discover-container"},z={class:"search-section"},O={class:"category-brands-section"},D={class:"brands-section"},j={class:"category-brands-wrapper"},U={class:"category-name-wrapper"},A=["onClick"],M={key:0},G={class:"brands-wrapper"},N={class:"empty-screen"},F=["onClick"],H={class:"logo-wrapper"},R=["src","alt","onError"],V={key:1,class:"logo-fallback"},q=["onClick"],J={class:"logo-wrapper"},Y=["src","alt","onError"],Q={key:1,class:"logo-fallback"},W={class:"brand-container-column brand-loading-column"},K={class:"collection-title"},X=["onClick"],Z=["src","alt"],$={class:"img-fallback",style:{display:"none","border-radius":"16px"}},ss={key:1,class:"tile-collection"},ts={class:"collection-title"},es={class:"sub-collection-wrapper"},as=["onClick"],is=["src","alt"],os={class:"img-fallback",style:{display:"none"}},ls={class:"collection-title"},rs=["onClick"],ns=["src","alt"],ds={class:"img-fallback",style:{display:"none"}},cs={key:3,class:"bourbon-collection"},gs={class:"collection-title"},hs={class:"sub-collection-wrapper horizontal-scroll"},us=["onClick"],ms=["src","alt"],ps={class:"img-fallback",style:{display:"none"}},ys={class:"collection-title"},vs={class:"sub-collection-wrapper horizontal-scroll"},bs=["onClick"],fs=["src","alt"],_s={class:"img-fallback",style:{display:"none"}},ks={key:0,class:"bottom-section"},ws={class:"products-grid"},Ls=["src"],Bs={class:"products-grid"},Cs=["src"],Ss={key:1,class:"discover-container discover-skeleton"},Ts={class:"category-brands-section"},Ps={class:"brands-section"},xs={class:"category-brands-wrapper"},Es={class:"category-name-wrapper"},Is={class:"brands-wrapper"},zs={class:"brands-wrapper"},Os={class:"sub-collection-wrapper horizontal-scroll"},Ds={class:"collection-skeleton trending-collection"},js={class:"sub-collection-wrapper horizontal-scroll"},Us={class:"collection-skeleton dial-collection"},As={class:"sub-collection-wrapper horizontal-scroll"},Ms={class:"collection-skeleton bottle-collection"},Gs={class:"sub-collection-wrapper horizontal-scroll"},Ns={class:"collection-skeleton bourbon-collection"},Fs={class:"sub-collection-wrapper horizontal-scroll"},Hs={class:"collection-skeleton tile-collection"},Rs={class:"sub-collection-wrapper"},Vs={class:"collection-skeleton"},qs={class:"sub-collection-wrapper horizontal-listing",style:{"justify-content":"center"}},Js={class:"sub-collection-wrapper horizontal-listing",style:{"justify-content":"center"}};function Ys(i,s,h,m,d,n){const v=T("MagnifyingGlassIcon");return d.isPageLoading?(r(),l("div",Ss,[s[33]||(s[33]=t("div",{class:"discover-page-footer"},null,-1)),t("section",Ts,[t("div",Ps,[s[26]||(s[26]=t("div",{class:"heading",style:{"line-height":"0px"}}
1,[t("div",{class:"title-skeleton shimmer-dark"})],-1)),t("div",xs,[t("div",Es,[(r(),l(c,null,g(6,e=>t("div",{class:"category-chip category-chip-skeleton shimmer-dark",key:e})),64))]),t("div",Is,[(r(),l(c,null,g(8,e=>t("div",{key:e,class:"brand-container shimmer-dark",style:{"min-width":"85px",height:"23px"}},s[24]||(s[24]=[t("div",{class:"shimmer-dark logo logo-skeleton"},null,-1)]))),64))]),t("div",zs,[(r(),l(c,null,g(8,e=>t("div",{key:e,class:"brand-container shimmer-dark",style:{"min-width":"85px",height:"23px"}},s[25]||(s[25]=[t("div",{class:"shimmer-dark logo logo-skeleton"},null,-1)]))),64))])])])]),(r(),l(c,null,g(2,e=>t("section",{key:e,class:"collection-skeleton bottle-collection"},[s[27]||(s[27]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",Os,[(r(),l(c,null,g(6,o=>t("div",{class:"collection-thumbnail-skeleton shimmer",key:o})),64))])])),64)),t("section",Ds,[s[28]||(s[28]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",js,[(r(),l(c,null,g(6,e=>t("div",{class:"trending-thumbnail-skeleton shimmer",key:e})),64))])]),t("section",Us,[s[29]||(s[29]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",As,[(r(),l(c,null,g(6,e=>t("div",{class:"dial-thumbnail-skeleton shimmer",key:e})),64))])]),t("section",Ms,[s[30]||(s[30]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",Gs,[(r(),l(c,null,g(6,e=>t("div",{class:"collection-thumbnail-skeleton shimmer",key:e})),64))])]),t("section",Ns,[s[31]||(s[31]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",Fs,[(r(),l(c,null,g(6,e=>t("div",{class:"bourbon-thumbnail-skeleton shimmer",key:e})),64))])]),t("section",Hs,[s[32]||(s[32]=t("div",{class:"collection-title"},[t("div",{class:"title-skeleton shimmer"})],-1)),t("div",Rs,[(r(),l(c,null,g(4,e=>t("div",{class:"collection-thumbnail-skeleton shimmer",key:e})),64))])]),t("section",Vs,[t("div",qs,[(r(),l(c,null,g(5,e=>t("div",{class:"collection-thumbnail-skeleton shimmer",key:e})),64))]),t("div",Js,[(r(),l(c,null,g(8,e=>t("div",{class:"collection-thumbnail-skeleton shimmer",key:e})),64))])])])):(r(),l("div",I,[t("section",z,[t("div",{onClick:s[0]||(s[0]=(...e)=>n.goToSearch&&n.goToSearch(...e)),class:"search-wrapper"},[S(v,{class:"light-color",width:"16px"}),s[15]||(s[15]=t("span",null,"Search Brands, Products...",-1))])]),t("section",O,[t("div",D,[s[20]||(s[20]=t("div",{class:"heading"},"Brands on HYPD",-1)),t("div",j,[t("div",U,[t("div",{class:b(["category-chip",{"selected-category-chip":d.brandCollectionIndex==1e3}]),onClick:s[1]||(s[1]=e=>n.showBrands(1e3,void 0))}," All ",2),(r(!0),l(c,null,g(i.$store.state.globalState.lvlTwoCategories,(e,o)=>(r(),l("div",{class:b(["category-chip",{"selected-category-chip":d.brandCollectionIndex==o}]),onClick:a=>n.switchCategoryBrand(o,e),key:e.id},[e.parent_name=="Men"||e.parent_name=="Women"?(r(),l("span",M,u(e.parent_name)+"'s",1)):p("",!0),L(" "+u(e.name),1)],10,A))),128))]),t("div",G,[f(t("div",N,s[16]||(s[16]=[t("div",{class:"custom-loader"},null,-1)]),512),[[_,d.categoryBasedBrands.length==0&&d.isL2BrandsLoading]]),(r(!0),l(c,null,g(n.brandPairs,e=>{var o,a;return r(),l("div",{class:"brand-container-column",key:e[0].id},[t("div",{onClick:y=>n.goToBrandPage(e[0].id),class:"brand-container"},[t("div",H,[d.failedLogos[e[0].id]?(r(),l("div",V,u(e[0].name.charAt(0).toUpperCase()),1)):(r(),l("img",{key:0,class:"brand-logo",src:(o=e[0].logo)==null?void 0:o.src,alt:e[0].name,loading:"lazy",onError:y=>n.handleLogoError(e[0].id)},null,40,R))]),t("p",null,u(e[0].name),1)],8,F),e[1]?(r(),l("div",{key:0,onClick:y=>n.goToBrandPage(e[1].id),class:"brand-container"},[t("div",J,[d.failedLogos[e[1].id]?(r(),l("div",Q,u(e[1].name.charAt(0).toUpperCase()),1)):(r(),l("img",{key:0,class:"brand-logo",src:(a=e[1].logo)==null?void 0:a.src,alt:e[1].name,loading:"lazy",onError:y=>n.handleLogoError(e[1].id)},null,40,Y))]),t("p",null,u(e[1].name),1)],8,q)):p("",!0)])}),128)),f(t("div",W,s[17]||(s[17]=[t("div",{class:"brand-container shimmer-dark"},null,-1),t("div",{class:"brand-container shimmer-dark"},null,-1)]),512),[[_,d.isL2BrandsLoading&&d.categoryBasedBrands.length>
10]]),s[19]||(s[19]=t("div",{class:"brand-pagination-column"},null,-1)),f(t("div",null,s[18]||(s[18]=[t("div",{class:"empty-screen"},[t("img",{src:x,alt:""}),L(" Uh-Oh! There's no brand(s) here related to this category ")],-1)]),512),[[_,d.categoryBasedBrands.length==0&&!d.isL2BrandsLoading]])])])])]),(r(!0),l(c,null,g(i.$store.state.globalState.discoverCollections.collections,e=>(r(),l("div",{class:"creator-discover-collections",key:e.id},[e.type=="category"&&e.sub_type=="catalog"?(r(),l("section",{class:"category-collection",key:e.id},[t("div",K,u(e.title),1),(r(),l("div",{class:"sub-collection-wrapper",key:!!d.categoryCatalogCollection[e.id]},[(r(!0),l(c,null,g(d.categoryCatalogCollection[e.id],o=>(r(),l("div",{class:"sub-collection shrink-0",onClick:a=>n.goToSubCollection(o,e.sub_type,e.type),key:o.id},[o.featured_image?(r(),l("img",{key:0,style:{"border-radius":"16px"},src:o.featured_image.src,alt:o.name,class:"shimmer",loading:"lazy",onLoad:s[2]||(s[2]=a=>a.target.classList.remove("shimmer")),onError:s[3]||(s[3]=a=>{a.target.classList.remove("shimmer"),a.target.style.display="none",a.target.nextSibling.style.display="flex"})},null,40,Z)):p("",!0),t("div",$,u(o.name),1)],8,X))),128))]))])):p("",!0),e.type==="tile"?(r(),l("section",ss,[t("div",ts,u(e.title),1),t("div",es,[(r(!0),l(c,null,g(e.sub_collections,o=>(r(),l("div",{onClick:a=>n.goToSubCollection(o,e.sub_type,e.type),class:"sub-collection tile-sub-collection shrink-0",key:o.id},[t("img",{src:o.image.src,alt:o.name,class:"shimmer",loading:"lazy",onLoad:s[4]||(s[4]=a=>a.target.classList.remove("shimmer")),onError:s[5]||(s[5]=a=>{a.target.classList.remove("shimmer"),a.target.style.display="none",a.target.nextSibling.style.display="flex"})},null,40,is),t("div",os,u(o.name),1)],8,as))),128))])])):p("",!0),e.type==="bottle"?(r(),l("section",{key:2,class:b(["bottle-collection",{"bottle-catalog-collection":e.sub_type=="catalog"}])},[t("div",ls,u(e.title),1),t("div",{class:b(["sub-collection-wrapper",{"horizontal-scroll":e.sub_type==="catalog"}])},[(r(!0),l(c,null,g(e.sub_collections,o=>(r(),l("div",{onClick:a=>n.goToSubCollection(o,e.sub_type,e.type),class:"sub-collection shrink-0",key:o.id},[t("img",{src:o.image.src,alt:o.name,class:"shimmer",loading:"lazy",onLoad:s[6]||(s[6]=a=>a.target.classList.remove("shimmer")),onError:s[7]||(s[7]=a=>{a.target.classList.remove("shimmer"),a.target.style.display="none",a.target.nextSibling.style.display="flex"})},null,40,ns),t("div",ds,u(o.name),1)],8,rs))),128))],2)],2)):p("",!0),e.type=="bourbon"?(r(),l("section",cs,[t("div",gs,u(e.title),1),t("div",hs,[(r(!0),l(c,null,g(e.sub_collections,o=>(r(),l("div",{class:"sub-collection shrink-0",onClick:a=>n.goToSubCollection(o,e.sub_type,e.type),key:o.id},[t("img",{src:o.image.src,alt:o.name,class:"shimmer",loading:"lazy",onLoad:s[8]||(s[8]=a=>a.target.classList.remove("shimmer")),onError:s[9]||(s[9]=a=>{a.target.classList.remove("shimmer"),a.target.style.display="none",a.target.nextSibling.style.display="flex"})},null,40,ms),t("div",ps,u(o.name),1)],8,us))),128))])])):p("",!0),e.type=="dial"?(r(),l("section",{key:4,class:b(["dial-collection",{"dial-catalog-collection":e.sub_type=="catalog","dial-brand-collection":e.sub_type=="brand"}])},[t("div",ys,u(e.title),1),t("div",vs,[(r(!0),l(c,null,g(e.sub_collections,o=>(r(),l("div",{class:"sub-collection shrink-0",onClick:a=>n.goToSubCollection(o,e.sub_type,e.type),key:o.id},[t("img",{src:o.image.src,alt:o==null?void 0:o.name,class:"shimmer",loading:"lazy",onLoad:s[10]||(s[10]=a=>a.target.classList.remove("shimmer")),onError:s[11]||(s[11]=a=>{a.target.classList.remove("shimmer"),a.target.style.display="none",a.target.nextSibling.style.display="flex"})},null,40,fs),t("div",_s,u(o==null?void 0:o.name),1)],8,bs))),128))])],2)):p("",!0)]))),128)),s[23]||(s[23]=t("div",{class:"discover-page-footer"},null,-1)),i.$store.state.globalState.discoverCollections.collections.length>0?(r(),l("section",ks,[t("div",ws,[(r(!0),l(c,null,g(i.$store.state.globalState.hotSellingProducts,(e,o,a)=>f((r(),l("img",{class:"product-image shimmer",key:o,src:e.featured_image.src,alt:"",loading:"lazy",onLoad:s[12]||(s[12]=y=>y.target.classList.remove("shimmer"))},null,40,Ls)),[[_,a<n.noOfHotSellingProducts/2]])),128))]),t("div",Bs,[(r(!0),l(c,null,g(i.$store.state.globalState.hotSellingProducts,(e,o,a)=>f((r(),l("img",{class:"product-image shimmer",key:o,src:e.featured_image.src,alt:"",loading:"lazy",onLoad:s[13]||(s[13]=y=>y.target.classList.remove("shimmer"))},null,40,Cs)),[[_,a>n.noOfHotSellingProducts/2&&a<n.noOfHotSellingProducts]])),128))]),s[22]||(s[22]=t("div",{class:"content"},[t("div",{class:"title"},"Explore all products"),t("div",{class:"subtitle"},"5000+ products on HYPD")],-1)),t("div",{class:"explore-btn",onClick:s[14]||(s[14]=(...e)=>n.goToSearch&&n.goToSearch(...e))}
1,s[21]||(s[21]=[P('<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7f20247a><g clip-path="url(#clip0_6875_1437)" data-v-7f20247a><path d="M1.1665 8L15.1665 8" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-7f20247a></path><path d="M15.1665 8C12.9998 7.33333 11.6665 6 11.1665 4" stroke="white" stroke-width="1.5" stroke-linecap="round" data-v-7f20247a></path><path d="M15.1665 8C12.9998 8.66667 11.6665 10 11.1665 12" stroke="white" stroke-width="1.5" stroke-linecap="round" data-v-7f20247a></path></g><defs data-v-7f20247a><clipPath id="clip0_6875_1437" data-v-7f20247a><rect width="16" height="16" fill="white" transform="matrix(-1 0 0 1 16.5 0)" data-v-7f20247a></rect></clipPath></defs></svg>',1)]))])):p("",!0)]))}const Xs=C(E,[["render",Ys],["__scopeId","data-v-7f20247a"]]);export{Xs as default};
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.