const e=require("../utils/valueUtil.js"),t=require("../utils/commonUtil.js");let n=require("vue");function r(e,n){return t.toArray(e).join(``).toUpperCase().includes(n)}var i=(t,i,a,o,s)=>(0,n.computed)(()=>{let n=a.value,c=s?.value,l=o?.value;if(!n||l===!1)return t.value;let{options:u,label:d,value:f}=i.value,p=[],m=typeof l==`function`,h=n.toUpperCase(),g=m?l:(e,t)=>c?r(t[c],h):t[u]?r(t[d===`children`?`label`:d],h):r(t[f],h),_=m?t=>e.injectPropsWithOption(t):e=>e;return t.value.forEach(e=>{if(e[u]){if(g(n,_(e)))p.push(e);else{let t=e[u].filter(e=>g(n,_(e)));t.length&&p.push({...e,[u]:t})}return}g(n,_(e))&&p.push(e)}),p});exports.default=i;