import{a as k,u as O,n as q}from"./fieldsStore-CQRN0FvQ.js";import{u as C}from"./pageBreakerStore-BevSHYnU.js";import{u as P}from"./settingsStore-8bwiLMEn.js";import{t as b,r as d}from"./vendor-vue-reactivity-CheHbvBM.js";import{e as a}from"./vendor-vue-runtime-core-DwK6Ry68.js";function N(f){const{field:t}=b(f),g=k(),v=C(),s=O(),m=q(),S=d("default"),l=d([]),V=a(()=>s.checkFieldRequired(t.value)),F=a(()=>t.value.selectedOption||[]),r=a(()=>{var e;return(e=F.value)==null?void 0:e.map(o=>o.optionValue)}),y=a(()=>{var e;return((e=r.value)==null?void 0:e.map(o=>o.split("_")[1]||9999).join("_"))||9999}),c=e=>{var n,i;t.value.selectedOption=e;let o=0;if(Array.isArray(e))for(const u of e){const p=+((i=(n=u.optionValue)==null?void 0:n.toString())==null?void 0:i.split("_"))[0];!isNaN(p)&&t.value.summaryView!=="show_label_not_calculable"&&(o+=p)}t.value.value=o,t.value.displayValue=m.getMultipleOptionsFieldDisplayView(t.value),s.updateField(t.value.alias,t.value),g.applyConditionForField(t.value.alias),s.getPageBreakEnabled&&s.getActivePage.action==="not_skip"&&v.checkPageFieldsConditions()},_=e=>{l.value=[];const o=e.split(",");for(const n of o){const i=t.value.options.find(u=>u.optionValue===n);i&&l.value.push(i)}c(l.value)},h=a(()=>{var o;return((o=P().getWarningTexts)==null?void 0:o.requiredMsg)||""});return{style:S,selectedOptions:l,updateValue:c,applyChanges:_,isRequired:V,fieldValue:r,getKey:y,requiredWarningText:h}}export{N as u};
//# sourceMappingURL=useMultiOptionsFieldShared-Ma2tkgMo.js.map
