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