"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("vue"),j=require("../utils/commonUtil.js"),q=require("../utils/valueUtil.js");function p(u,o){return j.toArray(u).join("").toUpperCase().includes(o)}const y=(u,o,O,b,V)=>g.computed(()=>{const t=O.value,f=V?.value,s=b?.value;if(!t||s===!1)return u.value;const{options:l,label:d,value:F}=o.value,n=[],h=typeof s=="function",i=t.toUpperCase(),c=h?s:(e,r)=>f?p(r[f],i):r[l]?p(r[d!=="children"?d:"label"],i):p(r[F],i),a=h?e=>q.injectPropsWithOption(e):e=>e;return u.value.forEach(e=>{if(e[l]){if(c(t,a(e)))n.push(e);else{const v=e[l].filter(U=>c(t,a(U)));v.length&&n.push({...e,[l]:v})}return}c(t,a(e))&&n.push(e)}),n});exports.default=y;
