import{v as _,j as h}from"./entry.e017eb4f.js";async function v(l){const m=_("cart",()=>[]);let a;return await $fetch(h().public.API_URL+"/api/cart",{method:"POST",body:{products:l}}).then(e=>{var o;(o=e==null?void 0:e.accessories)==null||o.forEach(s=>{var p;const r=(p=m.value.find(t=>t.id==="accessory-"+s.id))==null?void 0:p.specs;r&&Object.keys(r).forEach(t=>{var u,f;const n=(u=s.accessory_specs)==null?void 0:u.find(i=>parseInt(i.id)===parseInt(t)),c=(f=n==null?void 0:n.accessory_spec_values)==null?void 0:f.find(i=>parseInt(i.id)===parseInt(r[t]));c&&(s.name+=" - "+n.name+": "+c.value,s.price_net+=c.price_net)})}),a=e}),a}export{v as g};