import{I as g,s as b,aj as l,x as f,Y as D,a8 as w,P as j,A as C}from"./index-D02r7Zsc.js";function h(e,t=v("injectSelf")){const{provides:n}=t;if(n&&e in n)return n[e]}function v(e,t){const n=j();if(!n)throw new Error(`[Bvn] ${e} must be called from inside a setup function`);return n}const _=(e="")=>e.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase(),p=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function d(e={},t={},n){const o={};for(const s in e)o[s]=e[s];for(const s in t){const c=e[s],a=t[s];if(p(c)&&p(a)){o[s]=d(c,a);continue}o[s]=a}return o}const A=(e,t)=>typeof e.props?.[t]<"u"||typeof e.props?.[_(t)]<"u";function E(e={},t){const n=g(l,b({})),o=v("useDefaults");if(t=t??o.type.name??o.type.__name,!t)throw new Error("[Bvn] Could not determine component name");const s=f(()=>n.value?.[e._as??t]),c=new Proxy(e,{get(u,r){const i=Reflect.get(u,r);return r==="class"||r==="style"?[s.value?.[r],i].filter(y=>y!=null):typeof r=="string"&&!A(o.vnode,r)?s.value?.[r]??n.value?.global?.[r]??i:i}}),a=D();w(()=>{if(s.value){const u=Object.entries(s.value).filter(([r])=>r.startsWith(r[0].toUpperCase()));a.value=u.length?Object.fromEntries(u):void 0}else a.value=void 0});function m(){const u=h(l,o);C(l,f(()=>a.value?d(u?.value??{},a.value):u?.value))}return{props:c,provideSubDefaults:m}}function P(e,t){const{props:n,provideSubDefaults:o}=E(e,t);return o(),n}export{P as u};
