var E=Object.defineProperty;var h=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var j=(t,n,e)=>n in t?E(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,_=(t,n)=>{for(var e in n||(n={}))S.call(n,e)&&j(t,e,n[e]);if(h)for(var e of h(n))F.call(n,e)&&j(t,e,n[e]);return t};import{P as $,J as O,K as L,L as l,M,N as p,A as b}from"./index.8886c9a8.js";import{p as d,a as m,u as C}from"./parser.fb27fa44.js";function N(t,n){var s;const e=["capture","once","passive"],i=(s=n.modifiers)==null?void 0:s.find(r=>e.includes(r));if(i){const r={capture:"Capture",once:"Once",passive:"OnceCapture"};return`on${C(t)}${r[i]}`}return`on${C(t)}`}function g(t,n={}){const e={};for(let[i,s]of Object.entries(n)){const r=N(i,s);p(s.handler)&&(e[r]=m(s.handler,t))}return e}function A(t,n,e){const{id:i,props:s={},className:r,style:u,ref:o,events:v}=n,a={};for(let[f,c]of Object.entries(s))a[f]=l(c)?d(c,t):c;return r&&(a.class=l(r)?d(r,t):r),u&&(a.style=l(u)?d(u,t):u),a.ref=e?f=>{if(!f)return;const c=f.$el||f;c.__vtj__=i,o&&t.__vtj_refs__&&(t.__vtj_refs__[o]=f)}:o,v&&Object.assign(a,g(t,v)),a}function y(t,n,e,i={},s){if(s&&e.id){const o=s.nodeMap[e.id];if(o&&!o.visible)return null}if(!(e!=null&&e.name))return null;let r=i[e.name]||e.name;if(!r)return null;[$,O].includes(r)&&(r="div");let u;return L(e.children)?u=e.children:l(e.children)?u=d(e.children,n):u=(e.children||[]).map(o=>o.name===O?t(I(t),{schema:o,components:i}):y(t,n,o,i,s)),t(r,A(n,e,s),{default:()=>u})}function T(){const t={};for(let n of M)t[n]=function(){const{schema:e}=this,i=e!=null&&e.lifeCycles?e.lifeCycles[n]:null;if(!i)return;const s=p(i)?m(i,this):null;try{s&&s.apply(this,arguments)}catch(r){b.error(`\u751F\u547D\u5468\u671F ${n} \u51FA\u9519`)}};return t}function J(t,n){const e={},i=n.state||{};for(let[s,r]of Object.entries(i))e[s]=l(r)||p(r)?d(r,t):r;return e}function P(t,n){const e={},i=n.methods||{};for(let[s,r]of Object.entries(i))p(r)?e[s]=m(r,t):b.warn(`method ${s} is not a function`);return e}function I(t){const n={data(){return{__vtj_refs__:{}}},mounted(){Object.assign(this.$refs.__proto__,this.__vtj_refs__)}};return t.defineComponent(_({name:"SchemaRenderer",mixins:[n],props:{schema:{type:Object,required:!0},components:Object,model:Object},data(){return _({state:_({},J(this,this.schema))},P(this,this.schema))},render(){const{schema:e,components:i={},model:s}=this;return y(t.h,this,e,i,s)}},T()))}export{I as c};
