import{_ as Y}from"./DmL3Yn_-.js";import{a as tt,_ as et}from"./qdHSkIKp.js";import{_ as ot}from"./GYmkBNmV.js";import{_ as rt}from"./BXWa2zJH.js";import{_ as ct}from"./ByD8WwIX.js";import{_ as at}from"./BuIOOL-k.js";import{_ as it}from"./DnPmYU5H.js";import{u as st}from"./DBU1PwkR.js";import{d as nt,u as lt,x as ut,a4 as dt,F as pt,h as r,o as i,c as s,z as _t,f as a,e as n,n as o,E as p,b as f,t as A,B as mt,am as gt,s as vt,v as ht,aZ as ft,a7 as yt,_ as kt}from"./LrfSKRHt.js";import{b as bt,a as Pt}from"./DHIedM6L.js";import{r as Ct}from"./CSGs8R6P.js";import{u as It,I as xt}from"./BjEum0Xp.js";const St=l=>(vt("data-v-52cbc75f"),l=l(),ht(),l),wt=St(()=>a("div",{class:"product-card__spacer"},null,-1)),Tt={class:"product-card__image-container"},zt={class:"product-card__image-overlay-pills"},At={class:"product-card__info"},Nt={key:1,class:"product-card__not-reviewed"},Rt={class:"product-card__name-wrapper"},Bt={class:"product-card__name"},Ft={class:"product-card__price-wrapper"},Lt={class:"product-card__price"},Ot={key:0},$t={key:1},Dt={class:"product-card__color-swatches"},Et={class:"product-card__more-colors-label"},N=100,Vt=nt({__name:"ProductCardInternalFormat",props:{product:{},position:{},listId:{},listName:{},selectedSize:{},lazyLoading:{type:Boolean},highFetchPriority:{type:Boolean}},emits:["click"],setup(l,{emit:R}){const e=l,y=lt(),_=ut(),{clubPriceExists:B,isVisibleClubPrice:m,isCampaignPrice:k,listPrice:b,sellingPrice:g,discountPillContent:P}=st(e.product),{$toAbsoluteMediaUrl:C}=dt();function I(t){const c=(F(t.height,N)+1)*N;return{height:c,width:c}}function F(t,c){return t/c}const L=R,x=pt(),O=r(()=>e.product.url+(e.selectedSize?`&Size=${e.selectedSize}`:"")),$=r(()=>e.product.rating*.2),S=r(()=>e.product.ratingCount),D=r(()=>{if(!e.product.primaryImage)return;const t={width:740,height:948};return C(e.product.primaryImage,{...I(t),fillArea:t,fancyName:`${(e.product.articleNumber||e.product.googleAnalyticsName||"image").toLowerCase()}.jpg`,skipPixelRatioDetection:!0,staticPixelRatio:1})}),E=r(()=>{if(!e.product.primaryImage)return;const t={width:592,height:720};return C(e.product.primaryImage,{...I(t),fillArea:t,fancyName:`${(e.product.articleNumber||e.product.googleAnalyticsName||"image").toLowerCase()}.jpg`,skipPixelRatioDetection:!0,staticPixelRatio:1})}),V=r(()=>e.product.primaryImageAltText||[w.value,e.product.color,U.value].filter(t=>t).join(" ")),w=r(()=>e.product.name),T=r(()=>bt(e.product)),j=r(()=>tt(e.product)),U=r(()=>{var c;const t=(c=e.product)==null?void 0:c.gender;return t.toLowerCase()!=="unisex"?t:""}),M=r(()=>{const t=e.product.numberOfColors;if(t===1)return y.websiteTexts.productcard__productcolor;const c=y.websiteTexts.productcard__productcolors;return Ct(c,{count:t.toString()})}),q=r(()=>k&&!T.value),v=r(()=>{if(P.value)return P.value;if(j.value)return{type:"deal-tag",text:void 0};const t=Pt(e.product.blobText);if(t)return t}),d=r(()=>T.value&&!m.value?"outlet":B.value?"club-tag":"invisible"),G=t=>{t.list&&(_.addItemImpression(t),_.push({event:"productView",ecommerce:{impressions:[t]}}))},H=()=>{const t=ft(e.product,e.listName,(e.position??0)+1,e.listId);t&&_.sendItemClick(t)},Z=async()=>{var t;e.product.elevateTicket&&await((t=yt().notify)==null?void 0:t.click(e.product.elevateTicket))};It(x,()=>{const t=gt(e.product,e.listName,(e.position??0)+1,e.listId);G(t)},xt.RunOnce,{threshold:.5});const J=()=>{L("click"),H(),Z()};return(t,c)=>{const z=Y,h=et,K=ot,Q=rt,u=ct,W=at,X=it;return i(),s(X,{class:"product-card",to:o(O),"data-cy":"product",onClick:J},{default:_t(()=>[wt,a("div",{ref_key:"productCardTemplateRef",ref:x,class:"product-card__content"},[a("div",Tt,[n(z,{"desktop-image-url":o(D),"mobile-image-url":o(E),alt:o(V),"object-position":"50% 50%",width:"100%","desktop-width":"100%",height:"100%","desktop-height":"100%","object-fit":"cover","desktop-object-fit":"cover","lazy-loading":t.lazyLoading,"high-fetch-priority":t.highFetchPriority},null,8,["desktop-image-url","mobile-image-url","alt","lazy-loading","high-fetch-priority"]),a("div",zt,[o(v)?(i(),s(h,{key:0,"custom-text":o(v).text,type:o(v).type,size:"large",class:"product-card__pill"},null,8,["custom-text","type"])):p("",!0)]),t.product.outOfStock?(i(),s(K,{key:0,class:"product-card__out-of-order-banner"})):p("",!0)]),a("div",At,[o(S)!==0?(i(),s(Q,{key:0,class:"product-card__rating",average:o($),count:o(S)},null,8,["average","count"])):(i(),f("div",Nt)),a("div",Rt,[a("p",Bt,A(o(w)),1)]),o(d)!=="invisible"?(i(),s(h,{key:2,type:o(d),size:"large",class:"product-card__pill"},null,8,["type"])):p("",!0),a("div",Ft,[a("div",Lt,[o(m)?(i(),f("div",Ot,[n(u,{value:o(b),class:"product-card__price-item--original"},null,8,["value"]),n(u,{value:o(g),class:"product-card__price-item--club"},null,8,["value"])])):o(k)&&!o(m)?(i(),f("div",$t,[n(u,{value:o(b),class:"product-card__price-item--original"},null,8,["value"]),n(u,{value:o(g),class:mt(["product-card__price-item--campaign",{"product-card__price-item--campaign-red-color":o(q)}])},null,8,["value","class"])])):(i(),s(u,{key:2,value:o(g)},null,8,["value"]))])]),a("div",Dt,[n(W,{color:"all"}),a("span",Et,A(o(M)),1)]),o(d)==="invisible"?(i(),s(h,{key:3,type:o(d),size:"large",class:"product-card__pill"},null,8,["type"])):p("",!0)])],512)]),_:1},8,["to"])}}}),te=kt(Vt,[["__scopeId","data-v-52cbc75f"]]);export{te as _};