import{u as b}from"./useDefaults-DESCdb0p-CFLjYrdG.js";import{l as _,x as m,R as i,I as x,d as F,o as S,J as y,D as f,W as O}from"./index-D02r7Zsc.js";import{g as l}from"./object-0ALvRU0O-3BORTTD-.js";const B=["value","disabled","selected"],C=_({__name:"BFormSelectOption",props:{disabled:{type:Boolean,default:!1},value:{default:void 0}},setup(o){const s=b(o,"BFormSelectOption"),a=x(O,null),r=m(()=>a?a.modelValue.value===s.value:!1);return(u,e)=>(S(),F("option",{value:f(s).value,disabled:f(s).disabled,selected:r.value},[y(u.$slots,"default")],8,B))}}),D=(o,n)=>{const s=e=>typeof e=="object"&&e!==null&&"options"in e,a=e=>{const t=i(n);if(typeof e=="string")return{value:e,text:e};if(typeof e=="number")return{value:e,text:`${e}`};if(e instanceof Date)return{value:e,text:e.toLocaleString()};const p=l(e,t.valueField),c=l(e,t.textField),v=l(e,t.disabledField),d=t.optionsField?l(e,t.optionsField):void 0;return d!==void 0?{label:l(e,t.labelField)||c,options:d}:{...typeof e=="object"?e:void 0,value:p,text:c,disabled:v}},r=e=>e.map(t=>a(t));return{normalizedOptions:m(()=>r(i(o))),isComplex:s}};export{C as _,D as u};
