1import{_ as V}from"./CH3D0Dsh.js";import{l as te,m as R,b,ao as oe,I as S,k as se,O as c,P as $,Q as x,u as a,aj as C,V as o,U as i,Z as ne,Y as u,R as p,M as A,a3 as ae,a4 as ce,a5 as ie,a6 as re,a7 as le,a8 as de,X as E,n as ue,a9 as pe,aa as ve}from"./BShK0cFd.js";import{A as _e,o as D,j as me,b as F,h as we,c as he,a as fe,w as ye}from"./CO_CenIX.js";const ke=(e,v)=>e.replace(/(\/)(\d+)(?=\/|$)/,`$1${v}`).replace(/^(.*?)(\/)?(\?.*)?$/,(t,r,l,_)=>/\d+(?=\/|$)/.test(r)?t:`${r.replace(/\/$/,"")}/${v}${_||""}`),ge=e=>{const t=e.startsWith("/")?"http://example.com"+e:e,r=new URL(t),l={};return r.searchParams.forEach((_,N)=>{l[N]=_}),{path:r.pathname,query:l}},be={class:"product-card__img"},$e={class:"product-card__img-wrap"},xe={class:"product-card__image"},Ce=["src"],Ne={key:0,class:"jewelry-card__slider-wrapper"},Pe={class:"swiper swiper-container"},Se={class:"swiper-wrapper"},Ae={class:"swiper-slide swiper-slide-active"},Ee={key:0,class:"product-card_admin"},Ie={class:"checkbox"},Le=["checked"],Me={class:"checkbox__span"},Be={class:"product-card__info"},je={class:"product-card__name"},Oe={key:0,class:"product-card__collection"},Te={key:1,class:"product-card__price"},Ue=te({__name:"ProductCard",props:{product:{type:Object,required:!0},withDelete:{type:Boolean},hidePrice:{type:Boolean,default:!1},page:{type:Number}},emits:["deleteFavorite","onClick"],setup(e,{emit:v}){var O;const t=e,r=v,l=_e(),_=["jewelry-category","jewelry-category-filter","coronation","opera","pirouette","fans","pique"],N=R(()=>{const s=F().name;return l.isAdminSelectionMode&&_.includes(s)}),I=`/jewelry/${t.product.category.code}/${(O=t.product)==null?void 0:O.code}/${t.product.skuId?`skuid_${t.product.skuId}/`:""}`,m=b(null),P=b(null),d=b(!0),w=oe(),U=async()=>{var s;!t.product.video||window.innerWidth<768||((s=m.value)==null||s.pause(),d.value=!0)},q=async()=>{var s;!t.product.video||window.innerWidth<768||(await((s=m.value)==null?void 0:s.play()),d.value=!1)},H=R(()=>{var s;return(s=t.product)==null?void 0:s.previews.map(n=>n[Object.keys(n)[0]])}),J={el:`#${w} .swiper-pagination`,enabled:!0,clickable:!1,renderBullet:(s,n)=>`
2 <span class="${n}"> 3 <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 4 <path d="M23.9642 0L0 15.198V24L24 11.665L23.9642 0Z" fill="black" /> 5 </svg> 6 </span> 7 `},W={enabled:!0,nextEl:`#${w} .swiper-navigation-next`,prevEl:`#${w} .swiper-navigation-prev`};S(async()=>{const s=new IntersectionObserver(n=>{var h,k;n[0].isIntersecting?t.product.video&&((h=m.value)==null||h.play(),d.value=!1):t.product.video&&((k=m.value)==null||k.pause(),d.value=!0)},{rootMargin:"0px"});P.value&&s.observe(P.value.$el)});const Q=()=>{l.adminJewelryToggle(t.product.code)},L=()=>{l.addAdminSelectedJewelries([t.product.code])};S(()=>{D().on("ADMIN_SELECTION_ALL",L)}),se(()=>{D().off("ADMIN_SELECTION_ALL",L)});const Z=async()=>{try{await he().$wishlist.remove(t.product.skuId),r("deleteFavorite")}catch{}},M=b(!1);S(()=>{M.value=!0});const f=t.product.previews.at(0),B=f==null?void 0:f[Object.keys(f)[0]],j=me(),z=F().fullPath,K=async()=>{if(t.page){const s=ke(z,t.page),{path:n,query:y}=ge(s);await j.replace({path:n,query:y})}ue(async()=>{await j.push(I),r("onClick")})};return(s,n)=>{const y=V,h=V,k=pe,g=fe,X=ve,Y=ye,G=we;return c(),$(G,{id:a(w),ref_key:"rootEl",ref:P,class:"product-card",to:I,onClick:C(K,["prevent"]),onMouseenter:U,onMouseleave:q},{default:x(()=>[o("div",be,[o("div",$e,[o("div",xe,[e.product.video?(c(),i("div",{key:0,class:ne({hidden:a(d)})},[o("video",{ref_key:"video",ref:m,loop:"",playsinline:"",muted:"",preload:"auto"},[o("source",{type:"video/mp4",src:e.product.video},null,8,Ce)],512)],2)):u("",!0),a(M)?a(d)&&e.product.previews.length>1?(c(),$(Y,{key:2},{default:x(()=>[p(X,{class:"swiper-container",init:"",loop:"","slides-per-view":"auto","watch-overflow":"","grab-cursor":"",navigation:W,pagination:J,speed:800,modules:[a(ce),a(ie),a(re),a(le),a(de)]},{default:x(()=>[(c(!0),i(A,null,ae(e.product.previews,(T,ee)=>(c(),$(k,{key:`${a(w)}_${ee}`,class:"swiper-slide"},{default:x(()=>[p(h,{picture:T[Object.keys(T)[0]]},null,8,["picture"])]),_:2},1024))),128)),!e.product.video&&a(d)&&e.product.previews.length>1?(c(),i(A,{key:0},[o("span",{class:"swiper-navigation-button swiper-navigation-prev",onClick:n[0]||(n[0]=C(()=>{},["stop"]))},[p(g,{name:"icon-left"})]),o("span",{class:"swiper-navigation-button swiper-navigation-next",onClick:n[1]||(n[1]=C(()=>{},["stop"]))},[p(g,{name:"icon-right"})]),n[2]||(n[2]=o("div",{class:"swiper-pagination"},null,-1))],64)):u("",!0)]),_:1},8,["modules"])]),_:1})):a(d)?(c(),$(h,{key:3,picture:a(H)[0]},null,8,["picture"])):u("",!0):(c(),i(A,{key:1},[a(B)?(c(),i("div",Ne,[o("div",Pe,[o("div",Se,[o("div",Ae,[p(y,{picture:a(B)},null,8,["picture"])])])])])):u("",!0)],64))]),e.withDelete?(c(),i("button",{key:0,class:"product-card__del",type:"button",onClick:C(Z,["stop","prevent"])},[p(g,{name:"del-fav",width:"24",height:"24"})])):u("",!0)]),a(N)?(c(),i("div",Ee,[o("div",Ie,[o("label",null,[o("input",{class:"checkbox__input",type:"checkbox",checked:a(l).adminSelectedJewelries.includes(t.product.code),onInput:Q},null,40,Le),n[3]||(n[3]=o("p",{class:"checkbox__text"},null,-1)),o("span",Me,[p(g,{name:"checkbox-active",width:"8",height:"6"})])])])])):u("",!0)]),o("div",Be,[o("p",je,E(e.product.name),1),e.product.subTitle||e.product.collectionName?(c(),i("div",Oe,E(e.product.subTitle||e.product.collectionName),1)):u("",!0),e.product.price&&!e.hidePrice?(c(),i("div",Te,"ÐÑ "+E(s.$f.prettyPrice(e.product.price)),1)):u("",!0)])]),_:1},8,["id"])}}});export{Ue as _};
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.