import{F as h,ai as C,P as p,Q as l,R as s,T as r,X as V,a0 as i,r as B,a5 as b,a6 as N,aN as f,_ as k,W as w,m as E,a1 as T,a2 as $,Z as R}from"./vendor-CHzKNe_Q.js";import{b7 as c,A as S}from"./index-D6o2tNli.js";const z={class:"rounded border bg-neutral-50 px-4 py-2"},F=["title"],L=h({__name:"configuration-items",props:{configurationItems:{},lineItemId:{},allowEdit:{type:Boolean},route:{}},setup(u){const t=u,{t:_}=C(),x=f(t,"configurationItems"),d=f(t,"lineItemId"),a=B(!0),v=E(()=>typeof t.route=="string"?{path:t.route,query:{lineItemId:d.value}}:typeof t.route=="object"?{...t.route,query:{lineItemId:d.value}}:"");function m(e){switch(e.type){case c.text:return _("shared.cart.configuration_items.selected_text",{text:e.customText??""});case c.product:return e.name??"";case c.file:return S(e.files?.map(n=>n.name)??[]);default:return""}}return(e,n)=>{const y=p("VcIcon"),I=p("VcButton");return s(),l("div",z,[r("button",{type:"button",class:"flex items-center gap-1 text-xs font-bold",onClick:n[0]||(n[0]=o=>a.value=!a.value)},[r("span",null,i(e.$t("shared.cart.configuration_items.title")),1),V(y,{class:"text-primary",name:a.value?"chevron-down":"chevron-up",size:"xs"},null,8,["name"])]),r("ul",{class:R(["space-y-1.5 pt-2 text-xs",{hidden:a.value}])},[(s(!0),l(b,null,N(x.value,(o,g)=>(s(),l("li",{key:o.id,class:"max-w-lg truncate",title:m(o)},i(`${g+1}. ${m(o)}`),9,F))),128)),r("li",null,[u.allowEdit?(s(),k(I,{key:0,size:"xs",to:v.value,"append-icon":"edit",variant:"outline"},{default:T(()=>[$(i(e.$t("shared.cart.configuration_items.edit_configuration")),1)]),_:1},8,["to"])):w("",!0)])],2)])}}});export{L as _};
//# sourceMappingURL=configuration-items.vue_vue_type_script_setup_true_lang-DVokRUD4.js.map
