import B from"./CTAcmMAz.js";import{Y as I,y as L,z as O,f as u,m as p,j as d,k as n,l as s,w as y,p as t,_ as T,A as V,q as k,t as a,F as q,B as A,v as F}from"./BCLrUOBx.js";import S from"./a5umXhxZ.js";import{u as D}from"./DamcjH0I.js";import{u as R}from"./Ce8lFovl.js";import"./Bxmfm8sn.js";const U={class:"mn-w-200x-md"},E={class:"block"},H={class:"mr-15"},M={class:"mr-10"},X={__name:"OrderedProduct",props:{ordered:{type:Object},cart:{type:Object}},setup(_){const h=_,{cart:e}=I(h),w=R(),{setProduct:x}=w,{dataFromObject:C,productLink:b,getThumbImageURL:P}=L(),{shippingTypes:N}=O(),{getProductImage:$}=D(),f=()=>{x(g.value)},j=u(()=>$(g.value,v.value));u(()=>{var r;return(r=e.value)==null?void 0:r.product_images});const g=u(()=>{var r;return(r=e.value)==null?void 0:r.product}),v=u(()=>{var r,o;return(o=(r=e.value)==null?void 0:r.updated_inventory)==null?void 0:o.inventory_attributes}),z=u(()=>{var r;return(r=v.value)==null?void 0:r.map(o=>{var i,c,l;return[(c=(i=o==null?void 0:o.attribute_value)==null?void 0:i.attribute)==null?void 0:c.title,(l=o==null?void 0:o.attribute_value)==null?void 0:l.title]})});return(r,o)=>{const i=B,c=T,l=S;return d(),p("tr",null,[n("td",null,[s(c,{to:t(b)(t(e).product),class:"img-wrap",title:t(e).product.title,onClick:f},{default:y(()=>[s(i,{"lazy-src":t(P)(t(j)),title:t(e).product.title,alt:t(e).product.title},null,8,["lazy-src","title","alt"])]),_:1},8,["to","title"])]),n("td",U,[s(c,{to:t(b)(t(e).product),title:t(e).product.title,class:"mb-5 block",onClick:f},{default:y(()=>[k(a(t(e).product.title),1)]),_:1},8,["to","title"]),n("span",E,[(d(!0),p(q,null,A(t(z),m=>(d(),p("span",H,[n("b",M,a(m[0]),1),k(" : "+a(m[1]),1)]))),256))]),_.ordered.cancelled?V("",!0):(d(),p("button",{key:0,"aria-label":"submit",class:"link-color",onClick:o[0]||(o[0]=F(m=>r.$emit("rate-now",t(e).product.id),["prevent"]))},a(r.$t("ratePopup.rateNow")),1))]),n("td",null,a(t(N)[t(e).shipping_type]),1),n("td",null,[s(l,{price:t(e).shipping_price},null,8,["price"])]),n("td",null,a(t(e).quantity),1),n("td",null,[s(l,{price:t(e).selling*t(C)(t(e),"bundle_offer",0)},null,8,["price"])]),n("td",null,[s(l,{price:t(e).selling},null,8,["price"])]),n("td",null,[s(l,{price:t(e).selling*t(e).quantity},null,8,["price"])])])}}};export{X as default};
