1import{d as j,D as q,Z as nt,$ as ct,a0 as it,a1 as rt,a2 as S,I as lt,m as r,f as c,i as x,e as t,c as m,h as e,t as s,F as P,p as A,a as T,b as l,a3 as ut,g as I,s as w,y as dt,a4 as _,r as N,a5 as mt,a6 as pt,a7 as _t,_ as yt,V as xt,a8 as ht,a9 as ft,aa as gt,ab as bt,ac as vt,N as kt}from"#entry";import{_ as Pt,a as wt}from"./npUZlnde.js";import{s as Tt,a as Ct,b as Vt}from"./DCy-MLxd.js";const M={es:{title:"Mi cesta",recentlyViewed:"Basado en lo que viste recientemente",empty:"Tu cesta está vacÃa. Tienes más de 50.000 productos dentales disponibles para llenarla ;)",checkout:"Tramitar pedido",summary:"Resumen",base:"Base",discount:"Descuento",taxes:"Impuestos",vat:"IVA",total:"Total",ref:"Ref",unit:"/u",colProduct:"Producto",colPrice:"Precio",colQty:"Cantidad",colTotal:"Total"},pt:{title:"Meu carrinho",recentlyViewed:"Com base no que viu recentemente",empty:"O teu carrinho está vazio. Tens mais de 50.000 produtos dentários disponÃveis para enchê-lo ;)",checkout:"Finalizar compra",summary:"Resumo",base:"Base",discount:"Desconto",taxes:"Taxas",vat:"IVA",total:"Total",ref:"Ref",unit:"/u",colProduct:"Produto",colPrice:"Preço",colQty:"Quantidade",colTotal:"Total"},fr:{title:"Mon panier",recentlyViewed:"Basé sur vos consultations récentes",empty:"Votre panier est vide. Vous avez plus de 50.000 produits dentaires disponibles pour le remplir ;)",checkout:"Passer la commande",summary:"Résumé",base:"Base",discount:"Réduction",taxes:"Taxes",vat:"TVA",total:"Total",ref:"Réf",unit:"/u",colProduct:"Produit",colPrice:"Prix",colQty:"Quantité",colTotal:"Total"},en:{title:"My cart",recentlyViewed:"Based on your recent views",empty:"Your cart is empty. You can fill it with our more than 50,000 dental products!",checkout:"Checkout",summary:"Summary",base:"Base",discount:"Discount",taxes:"Taxes",vat:"VAT",total:"Total",ref:"Ref",unit:"/u",colProduct:"Product",colPrice:"Price",colQty:"Quantity",colTotal:"Total"},it:{title:"Il mio carrello",recentlyViewed:"In base a ciò che hai visto di recente",empty:"Il tuo carrello è vuoto. Puoi riempirlo con più di 50.000 prodotti odontoiatrici!",checkout:"Procedi all'ordine",summary:"Riepilogo",base:"Base",discount:"Sconto",taxes:"IVA",vat:"IVA",total:"Totale",ref:"Rif",unit:"/u",colProduct:"Prodotto",colPrice:"Prezzo",colQty:"Quantità ",colTotal:"Totale"}},Bt={class:"container mx-auto px-4 py-6"},Rt={key:0,class:"py-16 text-center"},Qt={class:"text-2xl font-bold text-primary mb-4"},Dt={class:"text-gray-500"},Lt={key:1,class:"flex flex-col lg:flex-row gap-8"},St={class:"flex-1 min-w-0"},At={class:"text-2xl font-bold text-primary mb-6"},It={class:"hidden sm:flex gap-4 pb-3 border-b border-gray-300 text-xs font-semibold text-gray-500 uppercase tracking-wide"},Nt={class:"w-28 shrink-0 text-center"},jt={class:"w-24 shrink-0 text-right"},qt={class:"divide-y divide-gray-200"},Mt={class:"flex gap-4"},zt={class:"w-20 h-20 shrink-0"},Ft={class:"flex-1 min-w-0 flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4"},$t={class:"flex-1 min-w-0"},Ot={class:"font-semibold text-primary text-sm line-clamp-2"},Ut={key:0,class:"text-xs text-gray-500 mt-0.5"},Gt={key:1,class:"text-sm text-gray-600 mt-1"},Yt={class:"flex items-center gap-4"},Et={class:"w-28 h-8 shrink-0"},Zt={key:0,class:"w-24 text-right shrink-0 font-semibold text-sm"},Ht={class:"w-full lg:w-80 shrink-0"},Jt={class:"lg:sticky lg:top-4 lg:mt-[55px] pb-5 border border-gray-300 rounded-md"},Kt={class:"p-4"},Wt={class:"text-lg font-semibold text-gray-800"},Xt={key:0,class:"mt-3 space-y-1"},te={key:0,class:"flex items-baseline justify-between"},ee={class:"text-gray-700"},se={class:"text-gray-900 tabular-nums"},oe={key:1,class:"flex items-baseline justify-between gap-2","data-testid":"summary-auto-discount"},ae={class:"text-gray-700 flex items-baseline gap-1.5 min-w-0"},ne={class:"shrink-0"},ce=["title"],ie={class:"text-green-700 tabular-nums shrink-0","data-testid":"summary-auto-discount-amount"},re={class:"text-gray-700"},le={class:"text-gray-900 tabular-nums"},ue={key:3,class:"flex items-baseline justify-between"},de={class:"text-gray-700"},me={class:"text-gray-900 tabular-nums"},pe={key:1,class:"flex items-baseline justify-between"},_e={class:"text-lg font-semibold text-gray-800"},ye={class:"text-lg font-semibold text-gray-900 tabular-nums"},xe=j({__name:"index",setup(z){const{t:i,locale:d}=q({messages:M}),C=nt();function h(o){return ht(o.price,ft(o.product?.taxRate),C.value)}const F=ct(),{openLogin:$}=gt(),V=it(),f=rt(),{cart:p,loading:O}=S(f);function U(){if(!F.isLoggedIn){$({prompt:!0,redirectTo:V("/checkout")});return}bt(V("/checkout"))}const G=lt(),{shippingData:Y}=S(G),B=m(()=>Y.value?.freeShipping),R=m(()=>p.value?Object.values(p.value.lines).filter(o=>!o.isPromotionGift).sort((o,n)=>(o.created??0)-(n.created??0)):[]),u=m(()=>p.value?.totalPrice??null),g=m(()=>p.value?.discounts??[]),Q=m(()=>Tt(g.value)),b=m(()=>Ct(g.value)),E=m(()=>{const o=u.value?.base;return o?{...o,value:o.value+Vt(g.value)}:null}),Z=m(()=>Number(p.value?.shippingMethod?.amount?.number??0)),D=m(()=>p.value?.taxes??[]),v=N({}),k=N({});async function H(o,n){v.value[o]=!0,n.qty<=0?await f.deleteOrderLine(o):await f.updateOrderLine(o,n.qty),v.value[o]=!1,k.value[o]=(k.value[o]??0)+1}function J(o){const[n,y]=(o.product?.productModel?.pathAlias??"").split("/").filter(
1Boolean);return!n||!y?"/":{name:`firstParam-secondParam___${d.value}`,params:{firstParam:n,secondParam:y}}}function L(o){const n=h(o);return n?{value:n.value*(o.qty??0),currency:n.currency}:null}function K(o){const n=o*100;return`${Number.isInteger(n)?n.toFixed(0):n.toFixed(2).replace(/\.?0+$/,"")}%`}return(o,n)=>{const y=vt,W=dt,X=_t,tt=Pt,et=yt,st=wt,ot=xt;return c(),r("div",Bt,[!t(p)||t(R).length===0?(c(),r("div",Rt,[e("h1",Qt,s(t(i)("title")),1),e("p",Dt,s(t(i)("empty")),1)])):(c(),r("div",Lt,[e("div",St,[e("h1",At,s(t(i)("title")),1),e("div",It,[n[0]||(n[0]=e("div",{class:"w-20 shrink-0"},null,-1)),n[1]||(n[1]=e("div",{class:"flex-1 min-w-0"},null,-1)),e("div",Nt,s(t(i)("colQty")),1),e("div",jt,s(t(i)("colTotal")),1)]),e("div",qt,[(c(!0),r(P,null,A(t(R),a=>(c(),r("div",{key:a.id,class:"flex flex-col py-4"},[e("div",Mt,[e("div",zt,[a.product?.image?(c(),T(y,ut({key:0,ref_for:!0},a.product.image,{loading:"lazy",class:"w-full h-full object-contain"}),null,16)):l("",!0)]),e("div",Ft,[e("div",$t,[x(W,{to:J(a)},{default:I(()=>[e("p",Ot,[w(s(a.title),1),a.product?.type?(c(),r(P,{key:0},[w(" | "+s(a.product.type),1)],64)):l("",!0)])]),_:2},1032,["to"]),a.product?.sku?(c(),r("p",Ut,s(t(i)("ref"))+": "+s(a.product.sku),1)):l("",!0),a.price?(c(),r("p",Gt,s(t(_)(h(a),t(d)))+s(t(i)("unit")),1)):l("",!0)]),e("div",Yt,[e("div",Et,[x(X,{class:"gap-1 text-xs",qty:a.qty??0,step:t(pt)(a.product),max:t(mt)(a.product),disabled:t(O)||t(v)[a.id],"sync-tick":t(k)[a.id]??0,onUpdateQty:at=>H(a.id,at)},null,8,["qty","step","max","disabled","sync-tick","onUpdateQty"])]),L(a)?(c(),r("div",Zt,s(t(_)(L(a),t(d))),1)):l("",!0)])])]),x(tt,{gifts:a.gifts,class:"ml-24"},null,8,["gifts"])]))),128))])]),e("aside",Ht,[e("div",Jt,[e("div",Kt,[x(et,{class:"w-full py-2 mb-3",onClick:U},{default:I(()=>[w(s(t(i)("checkout")),1)]),_:1}),e("h2",Wt,s(t(i)("summary")),1),t(u)?(c(),r("dl",Xt,[t(u).base?(c(),r("div",te,[e("dt",ee,s(t(i)("base")),1),e("dd",se,s(t(_)(t(E)??t(u).base,t(d))),1)])):l("",!0),t(Q)?(c(),r("div",oe,[e("dt",ae,[e("span",ne,s(t(i)("discount")),1),t(b)?(c(),r("span",{key:0,class:"text-xs text-gray-500 truncate",title:t(b),"data-testid":"summary-auto-discount-label"},s(t(b)),9,ce)):l("",!0)]),e("dd",ie,s(t(_)(t(Q),t(d))),1)])):l("",!0),t(D).length>0?(c(!0),r(P,{key:2},A(t(D),a=>(c(),r("div",{key:a.rate,class:"flex items-baseline justify-between"},[e("dt",re,s(t(i)("vat"))+" "+s(K(a.rate)),1),e("dd",le,s(t(_)(a.tax,t(d))),1)]))),128)):t(u).taxes?(c(),r("div",ue,[e("dt",de,s(t(i)("taxes")),1),e("dd",me,s(t(_)(t(u).taxes,t(d))),1)])):l("",!0)])):l("",!0),n[2]||(n[2]=e("hr",{class:"my-4 border-gray-200"},null,-1)),t(u)?.total?(c(),r("div",pe,[e("span",_e,s(t(i)("total")),1),e("span",ye,s(t(_)(t(u).total,t(d))),1)])):l("",!0)]),t(u)?.base&&t(B)?(c(),T(st,{key:0,price:t(u).base.value,currency:t(u).base.currency,"price-milestone":t(B),"shipping-cost":t(Z)},null,8,["price","currency","price-milestone","shipping-cost"])):l("",!0)])])])),x(ot,{"widget-id":"4badd185-f26d-4c7a-9625-d26352734f84",heading:t(i)("recentlyViewed"),personalized:""},null,8,["heading"])])}}}),he=Object.assign(xe,{__name:"CartPage"}),ve=j({__name:"cart",setup(z){const{t:i}=q({messages:M});return kt({title:i("title"),description:"",noindex:!0}),(d,C)=>{const h=he;return c(),T(h)}}});export{ve 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.