import{m as f,s as g,t as y,b as h,e as k,o as m,i as u,v as d,y as o,k as n,C as b,x as c,j as _,J as C}from"./CgJMQNab.js";import{a as v,_ as N}from"./CqD2fKiR.js";import{u as S}from"./DVAL3ne1.js";import{a as T}from"./CpuDe2Sj.js";import{A as $}from"./BYzv9gyR.js";import"./CUx1UeBG.js";import"./YBjTh5Uo.js";import"./CGj-ZBUr.js";import"./4xKLIuAL.js";const w={components:{Container:g,NoteProfile:v,PropertyTable:N,Headline:y},props:{productId:{type:Number,required:!0},elementId:{type:String,required:!0},elementName:{type:String,required:!0}},setup(t){const{handleError:e}=S(),{api:i}=h(),{data:s}=T(`${t.elementName}-${t.elementId}`,async()=>{try{const a=await i(`/jsonapi/products/${t.productId}`,{params:{include:"variants.images,fragrance"}});return k(a)}catch(a){e(a)}});return{product:s||{}}},computed:{noteProfile(){const t=this.product.fragrance.components;return t.reduce((i,s)=>{const{position:a,...r}=s;return i[a.toLowerCase()].push(r),i},{top:[],middle:[],base:[]})},imageSrc(){var t,e;return(e=(t=this.product.variants[0])==null?void 0:t.images[0])==null?void 0:e.smallUrl},imageAlt(){var t,e;return(e=(t=this.product.variants[0])==null?void 0:t.images[0])==null?void 0:e.alt},productUrl(){return this.product.urlPath||""}}},A={class:"fragrance-details"},B={class:"fragrance-info-head"},V={class:"image-wrap"},q=["src","alt"],z={class:"content"},E={class:"name"},F={class:"info-container"},H={class:"fragrance-info"},L={class:"note-profile"};function U(t,e,i,s,a,r){const l=C,p=y,x=N,P=v,I=g;return s.product?(m(),u(I,{key:0,"space-before":"","space-after":""},{default:d(()=>[o("div",A,[o("div",B,[o("div",V,[o("img",{class:"image",src:r.imageSrc||"",alt:r.imageAlt,loading:"lazy"},null,8,q)]),e[2]||(e[2]=n()),o("div",z,[o("span",E,b(s.product.name),1),e[1]||(e[1]=n()),c(l,{class:"product-link",to:r.productUrl},{default:d(()=>e[0]||(e[0]=[n(" Shop Now ")])),_:1},8,["to"])])]),e[8]||(e[8]=n()),o("div",F,[o("div",H,[c(p,{level:5},{default:d(()=>e[3]||(e[3]=[n("Fragrance Info")])),_:1}),e[4]||(e[4]=n()),c(x,{properties:s.product.fragrance.infos},null,8,["properties"])]),e[7]||(e[7]=n()),o("div",L,[c(p,{level:5},{default:d(()=>e[5]||(e[5]=[n("Note Profile")])),_:1}),e[6]||(e[6]=n()),r.noteProfile?(m(),u(P,{key:0,notes:r.noteProfile},null,8,["notes"])):_("",!0)])])])]),_:1})):_("",!0)}const j=f(w,[["render",U],["__scopeId","data-v-a805c86d"]]),D={mixins:[$],computed:{fragranceTeaserProductId(){return this.getValue("fragrance")}}};function J(t,e,i,s,a,r){const l=j;return m(),u(l,{"product-id":r.fragranceTeaserProductId,"element-id":t.element.id,"element-name":t.element.name},null,8,["product-id","element-id","element-name"])}const Z=f(D,[["render",J]]);export{Z as default};