@chamn/render 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,9 @@ export declare class DefineReactAdapter {
9
9
  components: AdapterOptionType['components'];
10
10
  storeManager: StoreManager;
11
11
  variableManager: VariableManager;
12
- runtimeComponentCache: Map<any, any>;
12
+ runtimeComponentCache: Map<string, {
13
+ component: any;
14
+ }>;
13
15
  onGetRef?: AdapterOptionType['onGetRef'];
14
16
  onGetComponent: AdapterOptionType['onGetComponent'];
15
17
  onComponentMount: AdapterOptionType['onComponentMount'];
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var va=Object.defineProperty;var ma=(t,e,r)=>e in t?va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var y=(t,e,r)=>(ma(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),ga=require("react-dom");function ya(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const ba=ya(ga),_a=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Sa=["customPageRootRender"],Br=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Dn=t=>[...Br,...Sa].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Br.includes(n)&&(r[n]=_a),r},{});var ja=Object.defineProperty,Oa=(t,e,r)=>e in t?ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_=(t,e,r)=>(Oa(t,typeof e!="symbol"?e+"":e,r),r),wa=typeof global=="object"&&global&&global.Object===Object&&global;const Ln=wa;var Ca=typeof self=="object"&&self&&self.Object===Object&&self,Ea=Ln||Ca||Function("return this")();const K=Ea;var $a=K.Symbol;const z=$a;var Fn=Object.prototype,Na=Fn.hasOwnProperty,Ta=Fn.toString,Ut=z?z.toStringTag:void 0;function xa(t){var e=Na.call(t,Ut),r=t[Ut];try{t[Ut]=void 0;var n=!0}catch{}var o=Ta.call(t);return n&&(e?t[Ut]=r:delete t[Ut]),o}var Aa=Object.prototype,Ma=Aa.toString;function Pa(t){return Ma.call(t)}var Ra="[object Null]",Ia="[object Undefined]",Ur=z?z.toStringTag:void 0;function ht(t){return t==null?t===void 0?Ia:Ra:Ur&&Ur in Object(t)?xa(t):Pa(t)}function Y(t){return t!=null&&typeof t=="object"}var Da="[object Symbol]";function or(t){return typeof t=="symbol"||Y(t)&&ht(t)==Da}function ar(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var La=Array.isArray;const R=La;var Fa=1/0,kr=z?z.prototype:void 0,Vr=kr?kr.toString:void 0;function Bn(t){if(typeof t=="string")return t;if(R(t))return ar(t,Bn)+"";if(or(t))return Vr?Vr.call(t):"";var e=t+"";return e=="0"&&1/t==-Fa?"-0":e}function J(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function sr(t){return t}var Ba="[object AsyncFunction]",Ua="[object Function]",ka="[object GeneratorFunction]",Va="[object Proxy]";function ir(t){if(!J(t))return!1;var e=ht(t);return e==Ua||e==ka||e==Ba||e==Va}var za=K["__core-js_shared__"];const xe=za;var zr=function(){var t=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ga(t){return!!zr&&zr in t}var Ha=Function.prototype,Wa=Ha.toString;function vt(t){if(t!=null){try{return Wa.call(t)}catch{}try{return t+""}catch{}}return""}var Ja=/[\\^$.*+?()[\]{}|]/g,Qa=/^\[object .+?Constructor\]$/,qa=Function.prototype,Ya=Object.prototype,Ka=qa.toString,Xa=Ya.hasOwnProperty,Za=RegExp("^"+Ka.call(Xa).replace(Ja,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ts(t){if(!J(t)||Ga(t))return!1;var e=ir(t)?Za:Qa;return e.test(vt(t))}function es(t,e){return t==null?void 0:t[e]}function mt(t,e){var r=es(t,e);return ts(r)?r:void 0}var rs=mt(K,"WeakMap");const Fe=rs;var Gr=Object.create,ns=function(){function t(){}return function(e){if(!J(e))return{};if(Gr)return Gr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const os=ns;function as(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function ss(){}function Un(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var is=800,cs=16,us=Date.now;function ls(t){var e=0,r=0;return function(){var n=us(),o=cs-(n-r);if(r=n,o>0){if(++e>=is)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function fs(t){return function(){return t}}var ps=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const le=ps;var ds=le?function(t,e){return le(t,"toString",{configurable:!0,enumerable:!1,value:fs(e),writable:!0})}:sr;const hs=ds;var vs=ls(hs);const kn=vs;function ms(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function gs(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function ys(t){return t!==t}function bs(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function _s(t,e,r){return e===e?bs(t,e,r):gs(t,ys,r)}function Ss(t,e){var r=t==null?0:t.length;return!!r&&_s(t,e,0)>-1}var js=9007199254740991,Os=/^(?:0|[1-9]\d*)$/;function ve(t,e){var r=typeof t;return e=e??js,!!e&&(r=="number"||r!="symbol"&&Os.test(t))&&t>-1&&t%1==0&&t<e}function cr(t,e,r){e=="__proto__"&&le?le(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function te(t,e){return t===e||t!==t&&e!==e}var ws=Object.prototype,Cs=ws.hasOwnProperty;function ur(t,e,r){var n=t[e];(!(Cs.call(t,e)&&te(n,r))||r===void 0&&!(e in t))&&cr(t,e,r)}function Nt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?cr(r,s,c):ur(r,s,c)}return r}var Hr=Math.max;function Vn(t,e,r){return e=Hr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Hr(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),as(t,this,s)}}function zn(t,e){return kn(Vn(t,e,sr),t+"")}var Es=9007199254740991;function lr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Es}function me(t){return t!=null&&lr(t.length)&&!ir(t)}function $s(t,e,r){if(!J(r))return!1;var n=typeof e;return(n=="number"?me(r)&&ve(e,r.length):n=="string"&&e in r)?te(r[e],t):!1}function Ns(t){return zn(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&$s(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var Ts=Object.prototype;function fr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ts;return t===r}function xs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var As="[object Arguments]";function Wr(t){return Y(t)&&ht(t)==As}var Gn=Object.prototype,Ms=Gn.hasOwnProperty,Ps=Gn.propertyIsEnumerable,Rs=Wr(function(){return arguments}())?Wr:function(t){return Y(t)&&Ms.call(t,"callee")&&!Ps.call(t,"callee")};const Wt=Rs;function Is(){return!1}var Hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jr=Hn&&typeof module=="object"&&module&&!module.nodeType&&module,Ds=Jr&&Jr.exports===Hn,Qr=Ds?K.Buffer:void 0,Ls=Qr?Qr.isBuffer:void 0,Fs=Ls||Is;const Jt=Fs;var Bs="[object Arguments]",Us="[object Array]",ks="[object Boolean]",Vs="[object Date]",zs="[object Error]",Gs="[object Function]",Hs="[object Map]",Ws="[object Number]",Js="[object Object]",Qs="[object RegExp]",qs="[object Set]",Ys="[object String]",Ks="[object WeakMap]",Xs="[object ArrayBuffer]",Zs="[object DataView]",ti="[object Float32Array]",ei="[object Float64Array]",ri="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ai="[object Uint8Array]",si="[object Uint8ClampedArray]",ii="[object Uint16Array]",ci="[object Uint32Array]",$={};$[ti]=$[ei]=$[ri]=$[ni]=$[oi]=$[ai]=$[si]=$[ii]=$[ci]=!0;$[Bs]=$[Us]=$[Xs]=$[ks]=$[Zs]=$[Vs]=$[zs]=$[Gs]=$[Hs]=$[Ws]=$[Js]=$[Qs]=$[qs]=$[Ys]=$[Ks]=!1;function ui(t){return Y(t)&&lr(t.length)&&!!$[ht(t)]}function pr(t){return function(e){return t(e)}}var Wn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vt=Wn&&typeof module=="object"&&module&&!module.nodeType&&module,li=Vt&&Vt.exports===Wn,Ae=li&&Ln.process,fi=function(){try{var t=Vt&&Vt.require&&Vt.require("util").types;return t||Ae&&Ae.binding&&Ae.binding("util")}catch{}}();const _t=fi;var qr=_t&&_t.isTypedArray,pi=qr?pr(qr):ui;const dr=pi;var di=Object.prototype,hi=di.hasOwnProperty;function Jn(t,e){var r=R(t),n=!r&&Wt(t),o=!r&&!n&&Jt(t),a=!r&&!n&&!o&&dr(t),i=r||n||o||a,s=i?xs(t.length,String):[],c=s.length;for(var u in t)(e||hi.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ve(u,c)))&&s.push(u);return s}function Qn(t,e){return function(r){return t(e(r))}}var vi=Qn(Object.keys,Object);const mi=vi;var gi=Object.prototype,yi=gi.hasOwnProperty;function bi(t){if(!fr(t))return mi(t);var e=[];for(var r in Object(t))yi.call(t,r)&&r!="constructor"&&e.push(r);return e}function ge(t){return me(t)?Jn(t):bi(t)}function _i(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Si=Object.prototype,ji=Si.hasOwnProperty;function Oi(t){if(!J(t))return _i(t);var e=fr(t),r=[];for(var n in t)n=="constructor"&&(e||!ji.call(t,n))||r.push(n);return r}function ee(t){return me(t)?Jn(t,!0):Oi(t)}var wi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ci=/^\w*$/;function hr(t,e){if(R(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||or(t)?!0:Ci.test(t)||!wi.test(t)||e!=null&&t in Object(e)}var Ei=mt(Object,"create");const Qt=Ei;function $i(){this.__data__=Qt?Qt(null):{},this.size=0}function Ni(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ti="__lodash_hash_undefined__",xi=Object.prototype,Ai=xi.hasOwnProperty;function Mi(t){var e=this.__data__;if(Qt){var r=e[t];return r===Ti?void 0:r}return Ai.call(e,t)?e[t]:void 0}var Pi=Object.prototype,Ri=Pi.hasOwnProperty;function Ii(t){var e=this.__data__;return Qt?e[t]!==void 0:Ri.call(e,t)}var Di="__lodash_hash_undefined__";function Li(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Qt&&e===void 0?Di:e,this}function ft(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ft.prototype.clear=$i;ft.prototype.delete=Ni;ft.prototype.get=Mi;ft.prototype.has=Ii;ft.prototype.set=Li;function Fi(){this.__data__=[],this.size=0}function ye(t,e){for(var r=t.length;r--;)if(te(t[r][0],e))return r;return-1}var Bi=Array.prototype,Ui=Bi.splice;function ki(t){var e=this.__data__,r=ye(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ui.call(e,r,1),--this.size,!0}function Vi(t){var e=this.__data__,r=ye(e,t);return r<0?void 0:e[r][1]}function zi(t){return ye(this.__data__,t)>-1}function Gi(t,e){var r=this.__data__,n=ye(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function tt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}tt.prototype.clear=Fi;tt.prototype.delete=ki;tt.prototype.get=Vi;tt.prototype.has=zi;tt.prototype.set=Gi;var Hi=mt(K,"Map");const qt=Hi;function Wi(){this.size=0,this.__data__={hash:new ft,map:new(qt||tt),string:new ft}}function Ji(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function be(t,e){var r=t.__data__;return Ji(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Qi(t){var e=be(this,t).delete(t);return this.size-=e?1:0,e}function qi(t){return be(this,t).get(t)}function Yi(t){return be(this,t).has(t)}function Ki(t,e){var r=be(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function et(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}et.prototype.clear=Wi;et.prototype.delete=Qi;et.prototype.get=qi;et.prototype.has=Yi;et.prototype.set=Ki;var Xi="Expected a function";function vr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Xi);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(vr.Cache||et),r}vr.Cache=et;var Zi=500;function tc(t){var e=vr(t,function(n){return r.size===Zi&&r.clear(),n}),r=e.cache;return e}var ec=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rc=/\\(\\)?/g,nc=tc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ec,function(r,n,o,a){e.push(o?a.replace(rc,"$1"):n||r)}),e});const oc=nc;function ac(t){return t==null?"":Bn(t)}function Tt(t,e){return R(t)?t:hr(t,e)?[t]:oc(ac(t))}var sc=1/0;function xt(t){if(typeof t=="string"||or(t))return t;var e=t+"";return e=="0"&&1/t==-sc?"-0":e}function _e(t,e){e=Tt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[xt(e[r++])];return r&&r==n?t:void 0}function qn(t,e,r){var n=t==null?void 0:_e(t,e);return n===void 0?r:n}function mr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Yr=z?z.isConcatSpreadable:void 0;function ic(t){return R(t)||Wt(t)||!!(Yr&&t&&t[Yr])}function gr(t,e,r,n,o){var a=-1,i=t.length;for(r||(r=ic),o||(o=[]);++a<i;){var s=t[a];e>0&&r(s)?e>1?gr(s,e-1,r,n,o):mr(o,s):n||(o[o.length]=s)}return o}function cc(t){var e=t==null?0:t.length;return e?gr(t,1):[]}function uc(t){return kn(Vn(t,void 0,cc),t+"")}var lc=Qn(Object.getPrototypeOf,Object);const yr=lc;var fc="[object Object]",pc=Function.prototype,dc=Object.prototype,Yn=pc.toString,hc=dc.hasOwnProperty,vc=Yn.call(Object);function B(t){if(!Y(t)||ht(t)!=fc)return!1;var e=yr(t);if(e===null)return!0;var r=hc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Yn.call(r)==vc}function mc(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function gc(){this.__data__=new tt,this.size=0}function yc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function bc(t){return this.__data__.get(t)}function _c(t){return this.__data__.has(t)}var Sc=200;function jc(t,e){var r=this.__data__;if(r instanceof tt){var n=r.__data__;if(!qt||n.length<Sc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new et(n)}return r.set(t,e),this.size=r.size,this}function H(t){var e=this.__data__=new tt(t);this.size=e.size}H.prototype.clear=gc;H.prototype.delete=yc;H.prototype.get=bc;H.prototype.has=_c;H.prototype.set=jc;function Oc(t,e){return t&&Nt(e,ge(e),t)}function wc(t,e){return t&&Nt(e,ee(e),t)}var Kn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kr=Kn&&typeof module=="object"&&module&&!module.nodeType&&module,Cc=Kr&&Kr.exports===Kn,Xr=Cc?K.Buffer:void 0,Zr=Xr?Xr.allocUnsafe:void 0;function Xn(t,e){if(e)return t.slice();var r=t.length,n=Zr?Zr(r):new t.constructor(r);return t.copy(n),n}function Ec(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a}function Zn(){return[]}var $c=Object.prototype,Nc=$c.propertyIsEnumerable,tn=Object.getOwnPropertySymbols,Tc=tn?function(t){return t==null?[]:(t=Object(t),Ec(tn(t),function(e){return Nc.call(t,e)}))}:Zn;const br=Tc;function xc(t,e){return Nt(t,br(t),e)}var Ac=Object.getOwnPropertySymbols,Mc=Ac?function(t){for(var e=[];t;)mr(e,br(t)),t=yr(t);return e}:Zn;const to=Mc;function Pc(t,e){return Nt(t,to(t),e)}function eo(t,e,r){var n=e(t);return R(t)?n:mr(n,r(t))}function Be(t){return eo(t,ge,br)}function _r(t){return eo(t,ee,to)}var Rc=mt(K,"DataView");const Ue=Rc;var Ic=mt(K,"Promise");const ke=Ic;var Dc=mt(K,"Set");const bt=Dc;var en="[object Map]",Lc="[object Object]",rn="[object Promise]",nn="[object Set]",on="[object WeakMap]",an="[object DataView]",Fc=vt(Ue),Bc=vt(qt),Uc=vt(ke),kc=vt(bt),Vc=vt(Fe),ut=ht;(Ue&&ut(new Ue(new ArrayBuffer(1)))!=an||qt&&ut(new qt)!=en||ke&&ut(ke.resolve())!=rn||bt&&ut(new bt)!=nn||Fe&&ut(new Fe)!=on)&&(ut=function(t){var e=ht(t),r=e==Lc?t.constructor:void 0,n=r?vt(r):"";if(n)switch(n){case Fc:return an;case Bc:return en;case Uc:return rn;case kc:return nn;case Vc:return on}return e});const Yt=ut;var zc=Object.prototype,Gc=zc.hasOwnProperty;function Hc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Gc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Wc=K.Uint8Array;const fe=Wc;function Sr(t){var e=new t.constructor(t.byteLength);return new fe(e).set(new fe(t)),e}function Jc(t,e){var r=e?Sr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Qc=/\w*$/;function qc(t){var e=new t.constructor(t.source,Qc.exec(t));return e.lastIndex=t.lastIndex,e}var sn=z?z.prototype:void 0,cn=sn?sn.valueOf:void 0;function Yc(t){return cn?Object(cn.call(t)):{}}function ro(t,e){var r=e?Sr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Kc="[object Boolean]",Xc="[object Date]",Zc="[object Map]",tu="[object Number]",eu="[object RegExp]",ru="[object Set]",nu="[object String]",ou="[object Symbol]",au="[object ArrayBuffer]",su="[object DataView]",iu="[object Float32Array]",cu="[object Float64Array]",uu="[object Int8Array]",lu="[object Int16Array]",fu="[object Int32Array]",pu="[object Uint8Array]",du="[object Uint8ClampedArray]",hu="[object Uint16Array]",vu="[object Uint32Array]";function mu(t,e,r){var n=t.constructor;switch(e){case au:return Sr(t);case Kc:case Xc:return new n(+t);case su:return Jc(t,r);case iu:case cu:case uu:case lu:case fu:case pu:case du:case hu:case vu:return ro(t,r);case Zc:return new n;case tu:case nu:return new n(t);case eu:return qc(t);case ru:return new n;case ou:return Yc(t)}}function no(t){return typeof t.constructor=="function"&&!fr(t)?os(yr(t)):{}}var gu="[object Map]";function yu(t){return Y(t)&&Yt(t)==gu}var un=_t&&_t.isMap,bu=un?pr(un):yu;const _u=bu;var Su="[object Set]";function ju(t){return Y(t)&&Yt(t)==Su}var ln=_t&&_t.isSet,Ou=ln?pr(ln):ju;const wu=Ou;var Cu=1,Eu=2,$u=4,oo="[object Arguments]",Nu="[object Array]",Tu="[object Boolean]",xu="[object Date]",Au="[object Error]",ao="[object Function]",Mu="[object GeneratorFunction]",Pu="[object Map]",Ru="[object Number]",so="[object Object]",Iu="[object RegExp]",Du="[object Set]",Lu="[object String]",Fu="[object Symbol]",Bu="[object WeakMap]",Uu="[object ArrayBuffer]",ku="[object DataView]",Vu="[object Float32Array]",zu="[object Float64Array]",Gu="[object Int8Array]",Hu="[object Int16Array]",Wu="[object Int32Array]",Ju="[object Uint8Array]",Qu="[object Uint8ClampedArray]",qu="[object Uint16Array]",Yu="[object Uint32Array]",E={};E[oo]=E[Nu]=E[Uu]=E[ku]=E[Tu]=E[xu]=E[Vu]=E[zu]=E[Gu]=E[Hu]=E[Wu]=E[Pu]=E[Ru]=E[so]=E[Iu]=E[Du]=E[Lu]=E[Fu]=E[Ju]=E[Qu]=E[qu]=E[Yu]=!0;E[Au]=E[ao]=E[Bu]=!1;function zt(t,e,r,n,o,a){var i,s=e&Cu,c=e&Eu,u=e&$u;if(r&&(i=o?r(t,n,o,a):r(t)),i!==void 0)return i;if(!J(t))return t;var l=R(t);if(l){if(i=Hc(t),!s)return Un(t,i)}else{var p=Yt(t),f=p==ao||p==Mu;if(Jt(t))return Xn(t,s);if(p==so||p==oo||f&&!o){if(i=c||f?{}:no(t),!s)return c?Pc(t,wc(i,t)):xc(t,Oc(i,t))}else{if(!E[p])return o?t:{};i=mu(t,p,s)}}a||(a=new H);var d=a.get(t);if(d)return d;a.set(t,i),wu(t)?t.forEach(function(b){i.add(zt(b,e,r,b,t,a))}):_u(t)&&t.forEach(function(b,j){i.set(j,zt(b,e,r,j,t,a))});var m=u?c?_r:Be:c?ee:ge,g=l?void 0:m(t);return ms(g||t,function(b,j){g&&(j=b,b=t[j]),ur(i,j,zt(b,e,r,j,t,a))}),i}var Ku=1,Xu=4;function io(t){return zt(t,Ku|Xu)}var Zu="__lodash_hash_undefined__";function tl(t){return this.__data__.set(t,Zu),this}function el(t){return this.__data__.has(t)}function Kt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new et;++e<r;)this.add(t[e])}Kt.prototype.add=Kt.prototype.push=tl;Kt.prototype.has=el;function rl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function co(t,e){return t.has(e)}var nl=1,ol=2;function uo(t,e,r,n,o,a){var i=r&nl,s=t.length,c=e.length;if(s!=c&&!(i&&c>s))return!1;var u=a.get(t),l=a.get(e);if(u&&l)return u==e&&l==t;var p=-1,f=!0,d=r&ol?new Kt:void 0;for(a.set(t,e),a.set(e,t);++p<s;){var m=t[p],g=e[p];if(n)var b=i?n(g,m,p,e,t,a):n(m,g,p,t,e,a);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!rl(e,function(j,O){if(!co(d,O)&&(m===j||o(m,j,r,n,a)))return d.push(O)})){f=!1;break}}else if(!(m===g||o(m,g,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function al(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function jr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var sl=1,il=2,cl="[object Boolean]",ul="[object Date]",ll="[object Error]",fl="[object Map]",pl="[object Number]",dl="[object RegExp]",hl="[object Set]",vl="[object String]",ml="[object Symbol]",gl="[object ArrayBuffer]",yl="[object DataView]",fn=z?z.prototype:void 0,Me=fn?fn.valueOf:void 0;function bl(t,e,r,n,o,a,i){switch(r){case yl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case gl:return!(t.byteLength!=e.byteLength||!a(new fe(t),new fe(e)));case cl:case ul:case pl:return te(+t,+e);case ll:return t.name==e.name&&t.message==e.message;case dl:case vl:return t==e+"";case fl:var s=al;case hl:var c=n&sl;if(s||(s=jr),t.size!=e.size&&!c)return!1;var u=i.get(t);if(u)return u==e;n|=il,i.set(t,e);var l=uo(s(t),s(e),n,o,a,i);return i.delete(t),l;case ml:if(Me)return Me.call(t)==Me.call(e)}return!1}var _l=1,Sl=Object.prototype,jl=Sl.hasOwnProperty;function Ol(t,e,r,n,o,a){var i=r&_l,s=Be(t),c=s.length,u=Be(e),l=u.length;if(c!=l&&!i)return!1;for(var p=c;p--;){var f=s[p];if(!(i?f in e:jl.call(e,f)))return!1}var d=a.get(t),m=a.get(e);if(d&&m)return d==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var b=i;++p<c;){f=s[p];var j=t[f],O=e[f];if(n)var T=i?n(O,j,f,e,t,a):n(j,O,f,t,e,a);if(!(T===void 0?j===O||o(j,O,r,n,a):T)){g=!1;break}b||(b=f=="constructor")}if(g&&!b){var M=t.constructor,D=e.constructor;M!=D&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof D=="function"&&D instanceof D)&&(g=!1)}return a.delete(t),a.delete(e),g}var wl=1,pn="[object Arguments]",dn="[object Array]",ce="[object Object]",Cl=Object.prototype,hn=Cl.hasOwnProperty;function El(t,e,r,n,o,a){var i=R(t),s=R(e),c=i?dn:Yt(t),u=s?dn:Yt(e);c=c==pn?ce:c,u=u==pn?ce:u;var l=c==ce,p=u==ce,f=c==u;if(f&&Jt(t)){if(!Jt(e))return!1;i=!0,l=!1}if(f&&!l)return a||(a=new H),i||dr(t)?uo(t,e,r,n,o,a):bl(t,e,c,r,n,o,a);if(!(r&wl)){var d=l&&hn.call(t,"__wrapped__"),m=p&&hn.call(e,"__wrapped__");if(d||m){var g=d?t.value():t,b=m?e.value():e;return a||(a=new H),o(g,b,r,n,a)}}return f?(a||(a=new H),Ol(t,e,r,n,o,a)):!1}function Or(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:El(t,e,r,n,Or,o)}var $l=1,Nl=2;function Tl(t,e,r,n){var o=r.length,a=o,i=!n;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(i&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var c=s[0],u=t[c],l=s[1];if(i&&s[2]){if(u===void 0&&!(c in t))return!1}else{var p=new H;if(n)var f=n(u,l,c,t,e,p);if(!(f===void 0?Or(l,u,$l|Nl,n,p):f))return!1}}return!0}function lo(t){return t===t&&!J(t)}function xl(t){for(var e=ge(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,lo(o)]}return e}function fo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Al(t){var e=xl(t);return e.length==1&&e[0][2]?fo(e[0][0],e[0][1]):function(r){return r===t||Tl(r,t,e)}}function Ml(t,e){return t!=null&&e in Object(t)}function Pl(t,e,r){e=Tt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var i=xt(e[n]);if(!(a=t!=null&&r(t,i)))break;t=t[i]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&lr(o)&&ve(i,o)&&(R(t)||Wt(t)))}function Rl(t,e){return t!=null&&Pl(t,e,Ml)}var Il=1,Dl=2;function Ll(t,e){return hr(t)&&lo(e)?fo(xt(t),e):function(r){var n=qn(r,t);return n===void 0&&n===e?Rl(r,t):Or(e,n,Il|Dl)}}function Fl(t){return function(e){return e==null?void 0:e[t]}}function Bl(t){return function(e){return _e(e,t)}}function Ul(t){return hr(t)?Fl(xt(t)):Bl(t)}function wr(t){return typeof t=="function"?t:t==null?sr:typeof t=="object"?R(t)?Ll(t[0],t[1]):Al(t):Ul(t)}function kl(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var Vl=kl();const zl=Vl;function Ve(t,e,r){(r!==void 0&&!te(t[e],r)||r===void 0&&!(e in t))&&cr(t,e,r)}function ze(t){return Y(t)&&me(t)}function Ge(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Gl(t){return Nt(t,ee(t))}function Hl(t,e,r,n,o,a,i){var s=Ge(t,r),c=Ge(e,r),u=i.get(c);if(u){Ve(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=R(c),d=!f&&Jt(c),m=!f&&!d&&dr(c);l=c,f||d||m?R(s)?l=s:ze(s)?l=Un(s):d?(p=!1,l=Xn(c,!0)):m?(p=!1,l=ro(c,!0)):l=[]:B(c)||Wt(c)?(l=s,Wt(s)?l=Gl(s):(!J(s)||ir(s))&&(l=no(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),Ve(t,r,l)}function po(t,e,r,n,o){t!==e&&zl(e,function(a,i){if(o||(o=new H),J(a))Hl(t,e,i,r,po,n,o);else{var s=n?n(Ge(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),Ve(t,i,s)}},ee)}function Wl(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function ho(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Jl(t,e){return e.length<2?t:_e(t,mc(e,0,-1))}var Ql=Ns(function(t,e,r){po(t,e,r)});const vo=Ql;var ql="Expected a function";function Yl(t){if(typeof t!="function")throw new TypeError(ql);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Kl(t,e){return e=Tt(e,t),t=Jl(t,e),t==null||delete t[xt(ho(e))]}function Xl(t){return B(t)?void 0:t}var Zl=1,tf=2,ef=4,rf=uc(function(t,e){var r={};if(t==null)return r;var n=!1;e=ar(e,function(a){return a=Tt(a,t),n||(n=a.length>1),a}),Nt(t,_r(t),r),n&&(r=zt(r,Zl|tf|ef,Xl));for(var o=e.length;o--;)Kl(r,e[o]);return r});const mo=rf;function nf(t,e,r,n){if(!J(t))return t;e=Tt(e,t);for(var o=-1,a=e.length,i=a-1,s=t;s!=null&&++o<a;){var c=xt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=i){var l=s[c];u=n?n(l,c,s):void 0,u===void 0&&(u=J(l)?l:ve(e[o+1])?[]:{})}ur(s,c,u),s=s[c]}return t}function of(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var i=e[n],s=_e(t,i);r(s,i)&&nf(a,Tt(i,t),s)}return a}function af(t,e){if(t==null)return{};var r=ar(_r(t),function(n){return[n]});return e=wr(e),of(t,r,function(n,o){return e(n,o[0])})}function sf(t,e){return af(t,Yl(wr(e)))}var cf=1/0,uf=bt&&1/jr(new bt([,-0]))[1]==cf?function(t){return new bt(t)}:ss;const lf=uf;var ff=200;function pf(t,e,r){var n=-1,o=Ss,a=t.length,i=!0,s=[],c=s;if(r)i=!1,o=Wl;else if(a>=ff){var u=e?null:lf(t);if(u)return jr(u);i=!1,o=co,c=new Kt}else c=e?[]:s;t:for(;++n<a;){var l=t[n],p=e?e(l):l;if(l=r||l!==0?l:0,i&&p===p){for(var f=c.length;f--;)if(c[f]===p)continue t;e&&c.push(p),s.push(l)}else o(c,p,r)||(c!==s&&c.push(p),s.push(l))}return s}var df=zn(function(t){var e=ho(t);return ze(e)&&(e=void 0),pf(gr(t,1,ze,!0),wr(e))});const hf=df;class go extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:i}=e,s=i.length===0?o:"At path: "+i.join(".")+" -- "+o;super(s),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function vf(t){return W(t)&&typeof t[Symbol.iterator]=="function"}function W(t){return typeof t=="object"&&t!=null}function U(t){return typeof t=="string"?JSON.stringify(t):""+t}function mf(t){const{done:e,value:r}=t.next();return e?void 0:r}function gf(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:i}=r,{refinement:s,message:c="Expected a value of type `"+i+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+U(n)+"`"}=t;return{value:n,type:i,refinement:s,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*vn(t,e,r,n){vf(t)||(t=[t]);for(const o of t){const a=gf(o,e,r,n);a&&(yield a)}}function*Cr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:i=!1}=r,s={path:n,branch:o};if(a&&(t=e.coercer(t,s),i&&e.type!=="type"&&W(e.schema)&&W(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,s))c="not_valid",yield[u,void 0];for(let[u,l,p]of e.entries(t,s)){const f=Cr(l,p,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,l],coerce:a,mask:i});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):a&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):W(t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,s))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class X{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:i=c=>c,entries:s=function*(){}}=e;this.type=r,this.schema=n,this.entries=s,this.coercer=i,o?this.validator=(c,u)=>{const l=o(c,u);return vn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return vn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return yo(e,this)}create(e){return yf(e,this)}is(e){return _f(e,this)}mask(e){return bf(e,this)}validate(e,r){return r===void 0&&(r={}),At(e,this,r)}}function yo(t,e){const r=At(t,e);if(r[0])throw r[0]}function yf(t,e){const r=At(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function bf(t,e){const r=At(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function _f(t,e){return!At(t,e)[0]}function At(t,e,r){r===void 0&&(r={});const n=Cr(t,e,r),o=mf(n);return o[0]?[new go(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Er(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(i=>i.schema),a=Object.assign({},...o);return n?jo(a):w(a)}function st(t,e){return new X({type:t,schema:null,validator:e})}function St(t){return new X({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function bo(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return jo(n);default:return w(n)}}function x(){return st("any",()=>!0)}function P(t){return new X({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+U(e)}})}function jt(){return st("boolean",t=>typeof t=="boolean")}function He(t){const e={},r=t.map(n=>U(n)).join();for(const n of t)e[n]=n;return new X({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+U(n)}})}function _o(){return st("func",t=>typeof t=="function"||"Expected a function, but received: "+U(t))}function L(t){const e=U(t),r=typeof t;return new X({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+U(n)}})}function Sf(){return st("never",()=>!1)}function So(){return st("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+U(t))}function w(t){const e=t?Object.keys(t):[],r=Sf();return new X({type:"object",schema:t||null,*entries(n){if(t&&W(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return W(n)||"Expected an object, but received: "+U(n)},coercer(n){return W(n)?{...n}:n}})}function h(t){return new X({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Gt(t,e){return new X({type:"record",schema:null,*entries(r){if(W(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return W(r)||"Expected an object, but received: "+U(r)}})}function v(){return st("string",t=>typeof t=="string"||"Expected a string, but received: "+U(t))}function jo(t){const e=Object.keys(t);return new X({type:"type",schema:t,*entries(r){if(W(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return W(r)||"Expected an object, but received: "+U(r)}})}function F(t){const e=t.map(r=>r.type).join(" | ");return new X({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||jf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...i]=Cr(r,a,n),[s]=i;if(s[0])for(const[c]of i)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+U(r),...o]}})}function jf(){return st("unknown",()=>!0)}const $r=w({package:v(),version:v(),name:v(),exportName:h(v()),destructuring:h(jt()),subName:h(v()),main:h(v()),cssPaths:h(P(v()))}),Of=P($r),wf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var V=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(V||{}),Nr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Nr||{}),We=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(We||{});const Cf=()=>st("normalObj",t=>!B(t)||[V.SLOT,V.EXPRESSION,V.FUNCTION].includes(t==null?void 0:t.type)?!1:(At(t,Gt(v(),Tr)),!0)),Tr=F([v(),So(),jt(),w({type:L(V.SLOT),renderType:He([We.FUNC,We.COMP]),params:h(P(v())),value:St(()=>F([Ot,P(Ot)]))}),w({type:L(V.EXPRESSION),value:v()}),w({type:L(V.FUNCTION),value:v()}),Cf(),P(St(()=>Tr))]),mn=w({type:L(V.EXPRESSION),value:v()}),Ot=w({id:h(v()),title:h(v()),componentName:v(),props:h(Gt(v(),Tr)),nodeName:h(v()),state:h(Gt(v(),x())),children:St(()=>h(P(F([v(),Ot])))),configure:h(x()),css:h(x()),style:h(x()),classNames:h(P(x())),refId:h(v()),extra:h(Gt(x(),x())),condition:h(F([jt(),mn])),loop:h(w({open:jt(),data:F([P(x()),mn]),args:h(P(v())),forName:h(v()),forIndex:h(v()),key:h(x()),name:h(v())})),methods:h(P(x()))}),pe=F([v(),w({label:v(),tip:h(v())})]),Ef=w({type:L("shape"),value:P(w({name:v(),title:pe,valueType:St(()=>Se)}))}),$f=w({type:L("enums"),value:P(v())});w({type:L("array"),value:St(()=>Se)});const Nf=w({type:L("array"),value:St(()=>P(Se))}),Se=F([He(["array","boolean","number","object","string"]),He(["component","expression","function"]),Ef,$f,Nf]),Tf=F([v(),w({componentName:v(),props:h(x()),initialValue:h(x()),component:h(x())})]),Pe=w({name:v(),title:pe,valueType:Se,description:h(v()),defaultValue:x(),setters:h(P(Tf)),condition:h(_o())});F([v(),_o()]);var Je=(t=>(t.SINGLE="single",t.GROUP="group",t))(Je||{});F([v(),w({name:v(),describe:h(v()),params:h(w({name:v(),description:v()})),template:v()})]);const xf=w({id:h(v()),title:v(),snapshot:F([v(),x()]),snapshotText:h(v()),description:h(v()),tags:h(P(v())),groupName:h(v()),category:h(v()),schema:Er(bo(Ot,["id"]),w({componentName:h(v())}))}),Af=w({componentName:v(),title:v(),screenshot:h(v()),icon:h(v()),tags:h(P(v())),groupName:h(v()),category:h(v()),priority:h(So()),npm:h($r),snippets:P(xf),props:P(F([Pe,w({title:h(pe),type:L("single"),content:Pe}),w({title:h(pe),type:L("group"),content:P(Pe)})])),fixedProps:h(x()),isContainer:h(F([jt(),w({placeholder:v(),width:v(),height:v()})])),disableEditorDragDom:h(x()),isLayout:h(jt()),rootSelector:h(v()),advanceCustom:h(x()),extra:h(Gt(x(),x()))}),Mf=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
1
+ "use strict";var va=Object.defineProperty;var ma=(t,e,r)=>e in t?va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var y=(t,e,r)=>(ma(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),ga=require("react-dom");function ya(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const ba=ya(ga),_a=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Sa=["customPageRootRender"],Br=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],In=t=>[...Br,...Sa].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Br.includes(n)&&(r[n]=_a),r},{});var ja=Object.defineProperty,Oa=(t,e,r)=>e in t?ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_=(t,e,r)=>(Oa(t,typeof e!="symbol"?e+"":e,r),r),wa=typeof global=="object"&&global&&global.Object===Object&&global;const Ln=wa;var Ca=typeof self=="object"&&self&&self.Object===Object&&self,Ea=Ln||Ca||Function("return this")();const K=Ea;var $a=K.Symbol;const z=$a;var Fn=Object.prototype,Na=Fn.hasOwnProperty,Ta=Fn.toString,kt=z?z.toStringTag:void 0;function xa(t){var e=Na.call(t,kt),r=t[kt];try{t[kt]=void 0;var n=!0}catch{}var o=Ta.call(t);return n&&(e?t[kt]=r:delete t[kt]),o}var Aa=Object.prototype,Ma=Aa.toString;function Pa(t){return Ma.call(t)}var Ra="[object Null]",Da="[object Undefined]",Ur=z?z.toStringTag:void 0;function vt(t){return t==null?t===void 0?Da:Ra:Ur&&Ur in Object(t)?xa(t):Pa(t)}function Y(t){return t!=null&&typeof t=="object"}var Ia="[object Symbol]";function or(t){return typeof t=="symbol"||Y(t)&&vt(t)==Ia}function ar(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var La=Array.isArray;const R=La;var Fa=1/0,kr=z?z.prototype:void 0,Vr=kr?kr.toString:void 0;function Bn(t){if(typeof t=="string")return t;if(R(t))return ar(t,Bn)+"";if(or(t))return Vr?Vr.call(t):"";var e=t+"";return e=="0"&&1/t==-Fa?"-0":e}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function sr(t){return t}var Ba="[object AsyncFunction]",Ua="[object Function]",ka="[object GeneratorFunction]",Va="[object Proxy]";function ir(t){if(!Q(t))return!1;var e=vt(t);return e==Ua||e==ka||e==Ba||e==Va}var za=K["__core-js_shared__"];const Ae=za;var zr=function(){var t=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ga(t){return!!zr&&zr in t}var Ha=Function.prototype,Wa=Ha.toString;function mt(t){if(t!=null){try{return Wa.call(t)}catch{}try{return t+""}catch{}}return""}var Ja=/[\\^$.*+?()[\]{}|]/g,Qa=/^\[object .+?Constructor\]$/,qa=Function.prototype,Ya=Object.prototype,Ka=qa.toString,Xa=Ya.hasOwnProperty,Za=RegExp("^"+Ka.call(Xa).replace(Ja,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ts(t){if(!Q(t)||Ga(t))return!1;var e=ir(t)?Za:Qa;return e.test(mt(t))}function es(t,e){return t==null?void 0:t[e]}function gt(t,e){var r=es(t,e);return ts(r)?r:void 0}var rs=gt(K,"WeakMap");const Be=rs;var Gr=Object.create,ns=function(){function t(){}return function(e){if(!Q(e))return{};if(Gr)return Gr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const os=ns;function as(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function ss(){}function Un(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var is=800,cs=16,us=Date.now;function ls(t){var e=0,r=0;return function(){var n=us(),o=cs-(n-r);if(r=n,o>0){if(++e>=is)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function fs(t){return function(){return t}}var ps=function(){try{var t=gt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const fe=ps;var ds=fe?function(t,e){return fe(t,"toString",{configurable:!0,enumerable:!1,value:fs(e),writable:!0})}:sr;const hs=ds;var vs=ls(hs);const kn=vs;function ms(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function gs(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function ys(t){return t!==t}function bs(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function _s(t,e,r){return e===e?bs(t,e,r):gs(t,ys,r)}function Ss(t,e){var r=t==null?0:t.length;return!!r&&_s(t,e,0)>-1}var js=9007199254740991,Os=/^(?:0|[1-9]\d*)$/;function me(t,e){var r=typeof t;return e=e??js,!!e&&(r=="number"||r!="symbol"&&Os.test(t))&&t>-1&&t%1==0&&t<e}function cr(t,e,r){e=="__proto__"&&fe?fe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ee(t,e){return t===e||t!==t&&e!==e}var ws=Object.prototype,Cs=ws.hasOwnProperty;function ur(t,e,r){var n=t[e];(!(Cs.call(t,e)&&ee(n,r))||r===void 0&&!(e in t))&&cr(t,e,r)}function Nt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?cr(r,s,c):ur(r,s,c)}return r}var Hr=Math.max;function Vn(t,e,r){return e=Hr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Hr(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),as(t,this,s)}}function zn(t,e){return kn(Vn(t,e,sr),t+"")}var Es=9007199254740991;function lr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Es}function ge(t){return t!=null&&lr(t.length)&&!ir(t)}function $s(t,e,r){if(!Q(r))return!1;var n=typeof e;return(n=="number"?ge(r)&&me(e,r.length):n=="string"&&e in r)?ee(r[e],t):!1}function Ns(t){return zn(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&$s(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var Ts=Object.prototype;function fr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ts;return t===r}function xs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var As="[object Arguments]";function Wr(t){return Y(t)&&vt(t)==As}var Gn=Object.prototype,Ms=Gn.hasOwnProperty,Ps=Gn.propertyIsEnumerable,Rs=Wr(function(){return arguments}())?Wr:function(t){return Y(t)&&Ms.call(t,"callee")&&!Ps.call(t,"callee")};const Jt=Rs;function Ds(){return!1}var Hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jr=Hn&&typeof module=="object"&&module&&!module.nodeType&&module,Is=Jr&&Jr.exports===Hn,Qr=Is?K.Buffer:void 0,Ls=Qr?Qr.isBuffer:void 0,Fs=Ls||Ds;const Qt=Fs;var Bs="[object Arguments]",Us="[object Array]",ks="[object Boolean]",Vs="[object Date]",zs="[object Error]",Gs="[object Function]",Hs="[object Map]",Ws="[object Number]",Js="[object Object]",Qs="[object RegExp]",qs="[object Set]",Ys="[object String]",Ks="[object WeakMap]",Xs="[object ArrayBuffer]",Zs="[object DataView]",ti="[object Float32Array]",ei="[object Float64Array]",ri="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ai="[object Uint8Array]",si="[object Uint8ClampedArray]",ii="[object Uint16Array]",ci="[object Uint32Array]",$={};$[ti]=$[ei]=$[ri]=$[ni]=$[oi]=$[ai]=$[si]=$[ii]=$[ci]=!0;$[Bs]=$[Us]=$[Xs]=$[ks]=$[Zs]=$[Vs]=$[zs]=$[Gs]=$[Hs]=$[Ws]=$[Js]=$[Qs]=$[qs]=$[Ys]=$[Ks]=!1;function ui(t){return Y(t)&&lr(t.length)&&!!$[vt(t)]}function pr(t){return function(e){return t(e)}}var Wn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zt=Wn&&typeof module=="object"&&module&&!module.nodeType&&module,li=zt&&zt.exports===Wn,Me=li&&Ln.process,fi=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Me&&Me.binding&&Me.binding("util")}catch{}}();const St=fi;var qr=St&&St.isTypedArray,pi=qr?pr(qr):ui;const dr=pi;var di=Object.prototype,hi=di.hasOwnProperty;function Jn(t,e){var r=R(t),n=!r&&Jt(t),o=!r&&!n&&Qt(t),a=!r&&!n&&!o&&dr(t),i=r||n||o||a,s=i?xs(t.length,String):[],c=s.length;for(var u in t)(e||hi.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||me(u,c)))&&s.push(u);return s}function Qn(t,e){return function(r){return t(e(r))}}var vi=Qn(Object.keys,Object);const mi=vi;var gi=Object.prototype,yi=gi.hasOwnProperty;function bi(t){if(!fr(t))return mi(t);var e=[];for(var r in Object(t))yi.call(t,r)&&r!="constructor"&&e.push(r);return e}function ye(t){return ge(t)?Jn(t):bi(t)}function _i(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Si=Object.prototype,ji=Si.hasOwnProperty;function Oi(t){if(!Q(t))return _i(t);var e=fr(t),r=[];for(var n in t)n=="constructor"&&(e||!ji.call(t,n))||r.push(n);return r}function re(t){return ge(t)?Jn(t,!0):Oi(t)}var wi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ci=/^\w*$/;function hr(t,e){if(R(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||or(t)?!0:Ci.test(t)||!wi.test(t)||e!=null&&t in Object(e)}var Ei=gt(Object,"create");const qt=Ei;function $i(){this.__data__=qt?qt(null):{},this.size=0}function Ni(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ti="__lodash_hash_undefined__",xi=Object.prototype,Ai=xi.hasOwnProperty;function Mi(t){var e=this.__data__;if(qt){var r=e[t];return r===Ti?void 0:r}return Ai.call(e,t)?e[t]:void 0}var Pi=Object.prototype,Ri=Pi.hasOwnProperty;function Di(t){var e=this.__data__;return qt?e[t]!==void 0:Ri.call(e,t)}var Ii="__lodash_hash_undefined__";function Li(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=qt&&e===void 0?Ii:e,this}function ft(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ft.prototype.clear=$i;ft.prototype.delete=Ni;ft.prototype.get=Mi;ft.prototype.has=Di;ft.prototype.set=Li;function Fi(){this.__data__=[],this.size=0}function be(t,e){for(var r=t.length;r--;)if(ee(t[r][0],e))return r;return-1}var Bi=Array.prototype,Ui=Bi.splice;function ki(t){var e=this.__data__,r=be(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ui.call(e,r,1),--this.size,!0}function Vi(t){var e=this.__data__,r=be(e,t);return r<0?void 0:e[r][1]}function zi(t){return be(this.__data__,t)>-1}function Gi(t,e){var r=this.__data__,n=be(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function tt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}tt.prototype.clear=Fi;tt.prototype.delete=ki;tt.prototype.get=Vi;tt.prototype.has=zi;tt.prototype.set=Gi;var Hi=gt(K,"Map");const Yt=Hi;function Wi(){this.size=0,this.__data__={hash:new ft,map:new(Yt||tt),string:new ft}}function Ji(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function _e(t,e){var r=t.__data__;return Ji(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Qi(t){var e=_e(this,t).delete(t);return this.size-=e?1:0,e}function qi(t){return _e(this,t).get(t)}function Yi(t){return _e(this,t).has(t)}function Ki(t,e){var r=_e(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function et(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}et.prototype.clear=Wi;et.prototype.delete=Qi;et.prototype.get=qi;et.prototype.has=Yi;et.prototype.set=Ki;var Xi="Expected a function";function vr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Xi);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(vr.Cache||et),r}vr.Cache=et;var Zi=500;function tc(t){var e=vr(t,function(n){return r.size===Zi&&r.clear(),n}),r=e.cache;return e}var ec=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rc=/\\(\\)?/g,nc=tc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ec,function(r,n,o,a){e.push(o?a.replace(rc,"$1"):n||r)}),e});const oc=nc;function ac(t){return t==null?"":Bn(t)}function Tt(t,e){return R(t)?t:hr(t,e)?[t]:oc(ac(t))}var sc=1/0;function xt(t){if(typeof t=="string"||or(t))return t;var e=t+"";return e=="0"&&1/t==-sc?"-0":e}function Se(t,e){e=Tt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[xt(e[r++])];return r&&r==n?t:void 0}function qn(t,e,r){var n=t==null?void 0:Se(t,e);return n===void 0?r:n}function mr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Yr=z?z.isConcatSpreadable:void 0;function ic(t){return R(t)||Jt(t)||!!(Yr&&t&&t[Yr])}function gr(t,e,r,n,o){var a=-1,i=t.length;for(r||(r=ic),o||(o=[]);++a<i;){var s=t[a];e>0&&r(s)?e>1?gr(s,e-1,r,n,o):mr(o,s):n||(o[o.length]=s)}return o}function cc(t){var e=t==null?0:t.length;return e?gr(t,1):[]}function uc(t){return kn(Vn(t,void 0,cc),t+"")}var lc=Qn(Object.getPrototypeOf,Object);const yr=lc;var fc="[object Object]",pc=Function.prototype,dc=Object.prototype,Yn=pc.toString,hc=dc.hasOwnProperty,vc=Yn.call(Object);function B(t){if(!Y(t)||vt(t)!=fc)return!1;var e=yr(t);if(e===null)return!0;var r=hc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Yn.call(r)==vc}function mc(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function gc(){this.__data__=new tt,this.size=0}function yc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function bc(t){return this.__data__.get(t)}function _c(t){return this.__data__.has(t)}var Sc=200;function jc(t,e){var r=this.__data__;if(r instanceof tt){var n=r.__data__;if(!Yt||n.length<Sc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new et(n)}return r.set(t,e),this.size=r.size,this}function W(t){var e=this.__data__=new tt(t);this.size=e.size}W.prototype.clear=gc;W.prototype.delete=yc;W.prototype.get=bc;W.prototype.has=_c;W.prototype.set=jc;function Oc(t,e){return t&&Nt(e,ye(e),t)}function wc(t,e){return t&&Nt(e,re(e),t)}var Kn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kr=Kn&&typeof module=="object"&&module&&!module.nodeType&&module,Cc=Kr&&Kr.exports===Kn,Xr=Cc?K.Buffer:void 0,Zr=Xr?Xr.allocUnsafe:void 0;function Xn(t,e){if(e)return t.slice();var r=t.length,n=Zr?Zr(r):new t.constructor(r);return t.copy(n),n}function Ec(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a}function Zn(){return[]}var $c=Object.prototype,Nc=$c.propertyIsEnumerable,tn=Object.getOwnPropertySymbols,Tc=tn?function(t){return t==null?[]:(t=Object(t),Ec(tn(t),function(e){return Nc.call(t,e)}))}:Zn;const br=Tc;function xc(t,e){return Nt(t,br(t),e)}var Ac=Object.getOwnPropertySymbols,Mc=Ac?function(t){for(var e=[];t;)mr(e,br(t)),t=yr(t);return e}:Zn;const to=Mc;function Pc(t,e){return Nt(t,to(t),e)}function eo(t,e,r){var n=e(t);return R(t)?n:mr(n,r(t))}function Ue(t){return eo(t,ye,br)}function _r(t){return eo(t,re,to)}var Rc=gt(K,"DataView");const ke=Rc;var Dc=gt(K,"Promise");const Ve=Dc;var Ic=gt(K,"Set");const _t=Ic;var en="[object Map]",Lc="[object Object]",rn="[object Promise]",nn="[object Set]",on="[object WeakMap]",an="[object DataView]",Fc=mt(ke),Bc=mt(Yt),Uc=mt(Ve),kc=mt(_t),Vc=mt(Be),ut=vt;(ke&&ut(new ke(new ArrayBuffer(1)))!=an||Yt&&ut(new Yt)!=en||Ve&&ut(Ve.resolve())!=rn||_t&&ut(new _t)!=nn||Be&&ut(new Be)!=on)&&(ut=function(t){var e=vt(t),r=e==Lc?t.constructor:void 0,n=r?mt(r):"";if(n)switch(n){case Fc:return an;case Bc:return en;case Uc:return rn;case kc:return nn;case Vc:return on}return e});const Kt=ut;var zc=Object.prototype,Gc=zc.hasOwnProperty;function Hc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Gc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Wc=K.Uint8Array;const pe=Wc;function Sr(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function Jc(t,e){var r=e?Sr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Qc=/\w*$/;function qc(t){var e=new t.constructor(t.source,Qc.exec(t));return e.lastIndex=t.lastIndex,e}var sn=z?z.prototype:void 0,cn=sn?sn.valueOf:void 0;function Yc(t){return cn?Object(cn.call(t)):{}}function ro(t,e){var r=e?Sr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Kc="[object Boolean]",Xc="[object Date]",Zc="[object Map]",tu="[object Number]",eu="[object RegExp]",ru="[object Set]",nu="[object String]",ou="[object Symbol]",au="[object ArrayBuffer]",su="[object DataView]",iu="[object Float32Array]",cu="[object Float64Array]",uu="[object Int8Array]",lu="[object Int16Array]",fu="[object Int32Array]",pu="[object Uint8Array]",du="[object Uint8ClampedArray]",hu="[object Uint16Array]",vu="[object Uint32Array]";function mu(t,e,r){var n=t.constructor;switch(e){case au:return Sr(t);case Kc:case Xc:return new n(+t);case su:return Jc(t,r);case iu:case cu:case uu:case lu:case fu:case pu:case du:case hu:case vu:return ro(t,r);case Zc:return new n;case tu:case nu:return new n(t);case eu:return qc(t);case ru:return new n;case ou:return Yc(t)}}function no(t){return typeof t.constructor=="function"&&!fr(t)?os(yr(t)):{}}var gu="[object Map]";function yu(t){return Y(t)&&Kt(t)==gu}var un=St&&St.isMap,bu=un?pr(un):yu;const _u=bu;var Su="[object Set]";function ju(t){return Y(t)&&Kt(t)==Su}var ln=St&&St.isSet,Ou=ln?pr(ln):ju;const wu=Ou;var Cu=1,Eu=2,$u=4,oo="[object Arguments]",Nu="[object Array]",Tu="[object Boolean]",xu="[object Date]",Au="[object Error]",ao="[object Function]",Mu="[object GeneratorFunction]",Pu="[object Map]",Ru="[object Number]",so="[object Object]",Du="[object RegExp]",Iu="[object Set]",Lu="[object String]",Fu="[object Symbol]",Bu="[object WeakMap]",Uu="[object ArrayBuffer]",ku="[object DataView]",Vu="[object Float32Array]",zu="[object Float64Array]",Gu="[object Int8Array]",Hu="[object Int16Array]",Wu="[object Int32Array]",Ju="[object Uint8Array]",Qu="[object Uint8ClampedArray]",qu="[object Uint16Array]",Yu="[object Uint32Array]",E={};E[oo]=E[Nu]=E[Uu]=E[ku]=E[Tu]=E[xu]=E[Vu]=E[zu]=E[Gu]=E[Hu]=E[Wu]=E[Pu]=E[Ru]=E[so]=E[Du]=E[Iu]=E[Lu]=E[Fu]=E[Ju]=E[Qu]=E[qu]=E[Yu]=!0;E[Au]=E[ao]=E[Bu]=!1;function Gt(t,e,r,n,o,a){var i,s=e&Cu,c=e&Eu,u=e&$u;if(r&&(i=o?r(t,n,o,a):r(t)),i!==void 0)return i;if(!Q(t))return t;var l=R(t);if(l){if(i=Hc(t),!s)return Un(t,i)}else{var p=Kt(t),f=p==ao||p==Mu;if(Qt(t))return Xn(t,s);if(p==so||p==oo||f&&!o){if(i=c||f?{}:no(t),!s)return c?Pc(t,wc(i,t)):xc(t,Oc(i,t))}else{if(!E[p])return o?t:{};i=mu(t,p,s)}}a||(a=new W);var d=a.get(t);if(d)return d;a.set(t,i),wu(t)?t.forEach(function(b){i.add(Gt(b,e,r,b,t,a))}):_u(t)&&t.forEach(function(b,j){i.set(j,Gt(b,e,r,j,t,a))});var h=u?c?_r:Ue:c?re:ye,g=l?void 0:h(t);return ms(g||t,function(b,j){g&&(j=b,b=t[j]),ur(i,j,Gt(b,e,r,j,t,a))}),i}var Ku=1,Xu=4;function io(t){return Gt(t,Ku|Xu)}var Zu="__lodash_hash_undefined__";function tl(t){return this.__data__.set(t,Zu),this}function el(t){return this.__data__.has(t)}function Xt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new et;++e<r;)this.add(t[e])}Xt.prototype.add=Xt.prototype.push=tl;Xt.prototype.has=el;function rl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function co(t,e){return t.has(e)}var nl=1,ol=2;function uo(t,e,r,n,o,a){var i=r&nl,s=t.length,c=e.length;if(s!=c&&!(i&&c>s))return!1;var u=a.get(t),l=a.get(e);if(u&&l)return u==e&&l==t;var p=-1,f=!0,d=r&ol?new Xt:void 0;for(a.set(t,e),a.set(e,t);++p<s;){var h=t[p],g=e[p];if(n)var b=i?n(g,h,p,e,t,a):n(h,g,p,t,e,a);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!rl(e,function(j,O){if(!co(d,O)&&(h===j||o(h,j,r,n,a)))return d.push(O)})){f=!1;break}}else if(!(h===g||o(h,g,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function al(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function jr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var sl=1,il=2,cl="[object Boolean]",ul="[object Date]",ll="[object Error]",fl="[object Map]",pl="[object Number]",dl="[object RegExp]",hl="[object Set]",vl="[object String]",ml="[object Symbol]",gl="[object ArrayBuffer]",yl="[object DataView]",fn=z?z.prototype:void 0,Pe=fn?fn.valueOf:void 0;function bl(t,e,r,n,o,a,i){switch(r){case yl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case gl:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case cl:case ul:case pl:return ee(+t,+e);case ll:return t.name==e.name&&t.message==e.message;case dl:case vl:return t==e+"";case fl:var s=al;case hl:var c=n&sl;if(s||(s=jr),t.size!=e.size&&!c)return!1;var u=i.get(t);if(u)return u==e;n|=il,i.set(t,e);var l=uo(s(t),s(e),n,o,a,i);return i.delete(t),l;case ml:if(Pe)return Pe.call(t)==Pe.call(e)}return!1}var _l=1,Sl=Object.prototype,jl=Sl.hasOwnProperty;function Ol(t,e,r,n,o,a){var i=r&_l,s=Ue(t),c=s.length,u=Ue(e),l=u.length;if(c!=l&&!i)return!1;for(var p=c;p--;){var f=s[p];if(!(i?f in e:jl.call(e,f)))return!1}var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=!0;a.set(t,e),a.set(e,t);for(var b=i;++p<c;){f=s[p];var j=t[f],O=e[f];if(n)var T=i?n(O,j,f,e,t,a):n(j,O,f,t,e,a);if(!(T===void 0?j===O||o(j,O,r,n,a):T)){g=!1;break}b||(b=f=="constructor")}if(g&&!b){var M=t.constructor,I=e.constructor;M!=I&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof I=="function"&&I instanceof I)&&(g=!1)}return a.delete(t),a.delete(e),g}var wl=1,pn="[object Arguments]",dn="[object Array]",ce="[object Object]",Cl=Object.prototype,hn=Cl.hasOwnProperty;function El(t,e,r,n,o,a){var i=R(t),s=R(e),c=i?dn:Kt(t),u=s?dn:Kt(e);c=c==pn?ce:c,u=u==pn?ce:u;var l=c==ce,p=u==ce,f=c==u;if(f&&Qt(t)){if(!Qt(e))return!1;i=!0,l=!1}if(f&&!l)return a||(a=new W),i||dr(t)?uo(t,e,r,n,o,a):bl(t,e,c,r,n,o,a);if(!(r&wl)){var d=l&&hn.call(t,"__wrapped__"),h=p&&hn.call(e,"__wrapped__");if(d||h){var g=d?t.value():t,b=h?e.value():e;return a||(a=new W),o(g,b,r,n,a)}}return f?(a||(a=new W),Ol(t,e,r,n,o,a)):!1}function Or(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:El(t,e,r,n,Or,o)}var $l=1,Nl=2;function Tl(t,e,r,n){var o=r.length,a=o,i=!n;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(i&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var c=s[0],u=t[c],l=s[1];if(i&&s[2]){if(u===void 0&&!(c in t))return!1}else{var p=new W;if(n)var f=n(u,l,c,t,e,p);if(!(f===void 0?Or(l,u,$l|Nl,n,p):f))return!1}}return!0}function lo(t){return t===t&&!Q(t)}function xl(t){for(var e=ye(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,lo(o)]}return e}function fo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Al(t){var e=xl(t);return e.length==1&&e[0][2]?fo(e[0][0],e[0][1]):function(r){return r===t||Tl(r,t,e)}}function Ml(t,e){return t!=null&&e in Object(t)}function Pl(t,e,r){e=Tt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var i=xt(e[n]);if(!(a=t!=null&&r(t,i)))break;t=t[i]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&lr(o)&&me(i,o)&&(R(t)||Jt(t)))}function Rl(t,e){return t!=null&&Pl(t,e,Ml)}var Dl=1,Il=2;function Ll(t,e){return hr(t)&&lo(e)?fo(xt(t),e):function(r){var n=qn(r,t);return n===void 0&&n===e?Rl(r,t):Or(e,n,Dl|Il)}}function Fl(t){return function(e){return e==null?void 0:e[t]}}function Bl(t){return function(e){return Se(e,t)}}function Ul(t){return hr(t)?Fl(xt(t)):Bl(t)}function wr(t){return typeof t=="function"?t:t==null?sr:typeof t=="object"?R(t)?Ll(t[0],t[1]):Al(t):Ul(t)}function kl(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var Vl=kl();const zl=Vl;function ze(t,e,r){(r!==void 0&&!ee(t[e],r)||r===void 0&&!(e in t))&&cr(t,e,r)}function Ge(t){return Y(t)&&ge(t)}function He(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Gl(t){return Nt(t,re(t))}function Hl(t,e,r,n,o,a,i){var s=He(t,r),c=He(e,r),u=i.get(c);if(u){ze(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=R(c),d=!f&&Qt(c),h=!f&&!d&&dr(c);l=c,f||d||h?R(s)?l=s:Ge(s)?l=Un(s):d?(p=!1,l=Xn(c,!0)):h?(p=!1,l=ro(c,!0)):l=[]:B(c)||Jt(c)?(l=s,Jt(s)?l=Gl(s):(!Q(s)||ir(s))&&(l=no(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),ze(t,r,l)}function po(t,e,r,n,o){t!==e&&zl(e,function(a,i){if(o||(o=new W),Q(a))Hl(t,e,i,r,po,n,o);else{var s=n?n(He(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),ze(t,i,s)}},re)}function Wl(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function ho(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Jl(t,e){return e.length<2?t:Se(t,mc(e,0,-1))}var Ql=Ns(function(t,e,r){po(t,e,r)});const vo=Ql;var ql="Expected a function";function Yl(t){if(typeof t!="function")throw new TypeError(ql);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Kl(t,e){return e=Tt(e,t),t=Jl(t,e),t==null||delete t[xt(ho(e))]}function Xl(t){return B(t)?void 0:t}var Zl=1,tf=2,ef=4,rf=uc(function(t,e){var r={};if(t==null)return r;var n=!1;e=ar(e,function(a){return a=Tt(a,t),n||(n=a.length>1),a}),Nt(t,_r(t),r),n&&(r=Gt(r,Zl|tf|ef,Xl));for(var o=e.length;o--;)Kl(r,e[o]);return r});const mo=rf;function nf(t,e,r,n){if(!Q(t))return t;e=Tt(e,t);for(var o=-1,a=e.length,i=a-1,s=t;s!=null&&++o<a;){var c=xt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=i){var l=s[c];u=n?n(l,c,s):void 0,u===void 0&&(u=Q(l)?l:me(e[o+1])?[]:{})}ur(s,c,u),s=s[c]}return t}function of(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var i=e[n],s=Se(t,i);r(s,i)&&nf(a,Tt(i,t),s)}return a}function af(t,e){if(t==null)return{};var r=ar(_r(t),function(n){return[n]});return e=wr(e),of(t,r,function(n,o){return e(n,o[0])})}function sf(t,e){return af(t,Yl(wr(e)))}var cf=1/0,uf=_t&&1/jr(new _t([,-0]))[1]==cf?function(t){return new _t(t)}:ss;const lf=uf;var ff=200;function pf(t,e,r){var n=-1,o=Ss,a=t.length,i=!0,s=[],c=s;if(r)i=!1,o=Wl;else if(a>=ff){var u=e?null:lf(t);if(u)return jr(u);i=!1,o=co,c=new Xt}else c=e?[]:s;t:for(;++n<a;){var l=t[n],p=e?e(l):l;if(l=r||l!==0?l:0,i&&p===p){for(var f=c.length;f--;)if(c[f]===p)continue t;e&&c.push(p),s.push(l)}else o(c,p,r)||(c!==s&&c.push(p),s.push(l))}return s}var df=zn(function(t){var e=ho(t);return Ge(e)&&(e=void 0),pf(gr(t,1,Ge,!0),wr(e))});const hf=df;class go extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:i}=e,s=i.length===0?o:"At path: "+i.join(".")+" -- "+o;super(s),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function vf(t){return J(t)&&typeof t[Symbol.iterator]=="function"}function J(t){return typeof t=="object"&&t!=null}function U(t){return typeof t=="string"?JSON.stringify(t):""+t}function mf(t){const{done:e,value:r}=t.next();return e?void 0:r}function gf(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:i}=r,{refinement:s,message:c="Expected a value of type `"+i+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+U(n)+"`"}=t;return{value:n,type:i,refinement:s,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*vn(t,e,r,n){vf(t)||(t=[t]);for(const o of t){const a=gf(o,e,r,n);a&&(yield a)}}function*Cr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:i=!1}=r,s={path:n,branch:o};if(a&&(t=e.coercer(t,s),i&&e.type!=="type"&&J(e.schema)&&J(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,s))c="not_valid",yield[u,void 0];for(let[u,l,p]of e.entries(t,s)){const f=Cr(l,p,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,l],coerce:a,mask:i});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):a&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):J(t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,s))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class X{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:i=c=>c,entries:s=function*(){}}=e;this.type=r,this.schema=n,this.entries=s,this.coercer=i,o?this.validator=(c,u)=>{const l=o(c,u);return vn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return vn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return yo(e,this)}create(e){return yf(e,this)}is(e){return _f(e,this)}mask(e){return bf(e,this)}validate(e,r){return r===void 0&&(r={}),At(e,this,r)}}function yo(t,e){const r=At(t,e);if(r[0])throw r[0]}function yf(t,e){const r=At(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function bf(t,e){const r=At(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function _f(t,e){return!At(t,e)[0]}function At(t,e,r){r===void 0&&(r={});const n=Cr(t,e,r),o=mf(n);return o[0]?[new go(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Er(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(i=>i.schema),a=Object.assign({},...o);return n?jo(a):w(a)}function st(t,e){return new X({type:t,schema:null,validator:e})}function jt(t){return new X({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function bo(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return jo(n);default:return w(n)}}function x(){return st("any",()=>!0)}function P(t){return new X({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+U(e)}})}function pt(){return st("boolean",t=>typeof t=="boolean")}function We(t){const e={},r=t.map(n=>U(n)).join();for(const n of t)e[n]=n;return new X({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+U(n)}})}function _o(){return st("func",t=>typeof t=="function"||"Expected a function, but received: "+U(t))}function L(t){const e=U(t),r=typeof t;return new X({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+U(n)}})}function Sf(){return st("never",()=>!1)}function So(){return st("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+U(t))}function w(t){const e=t?Object.keys(t):[],r=Sf();return new X({type:"object",schema:t||null,*entries(n){if(t&&J(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return J(n)||"Expected an object, but received: "+U(n)},coercer(n){return J(n)?{...n}:n}})}function v(t){return new X({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Ht(t,e){return new X({type:"record",schema:null,*entries(r){if(J(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return J(r)||"Expected an object, but received: "+U(r)}})}function m(){return st("string",t=>typeof t=="string"||"Expected a string, but received: "+U(t))}function jo(t){const e=Object.keys(t);return new X({type:"type",schema:t,*entries(r){if(J(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return J(r)||"Expected an object, but received: "+U(r)}})}function F(t){const e=t.map(r=>r.type).join(" | ");return new X({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||jf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...i]=Cr(r,a,n),[s]=i;if(s[0])for(const[c]of i)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+U(r),...o]}})}function jf(){return st("unknown",()=>!0)}const $r=w({package:m(),version:m(),name:m(),exportName:v(m()),destructuring:v(pt()),subName:v(m()),main:v(m()),cssPaths:v(P(m()))}),Of=P($r),wf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var V=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(V||{}),Nr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Nr||{}),Je=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Je||{});const Cf=()=>st("normalObj",t=>!B(t)||[V.SLOT,V.EXPRESSION,V.FUNCTION].includes(t==null?void 0:t.type)?!1:(At(t,Ht(m(),Tr)),!0)),Tr=F([m(),So(),pt(),w({type:L(V.SLOT),renderType:We([Je.FUNC,Je.COMP]),params:v(P(m())),value:jt(()=>F([Ot,P(Ot)]))}),w({type:L(V.EXPRESSION),value:m()}),w({type:L(V.FUNCTION),value:m()}),Cf(),P(jt(()=>Tr))]),mn=w({type:L(V.EXPRESSION),value:m()}),Ot=w({id:v(m()),title:v(m()),componentName:m(),props:v(Ht(m(),Tr)),nodeName:v(m()),state:v(Ht(m(),x())),children:jt(()=>v(P(F([m(),Ot])))),configure:v(x()),css:v(x()),style:v(x()),classNames:v(P(x())),refId:v(m()),extra:v(Ht(x(),x())),condition:v(F([pt(),mn])),loop:v(w({open:pt(),data:F([P(x()),mn]),args:v(P(m())),forName:v(m()),forIndex:v(m()),key:v(x()),name:v(m())})),methods:v(P(x()))}),de=F([m(),w({label:m(),tip:v(m())})]),Ef=w({type:L("shape"),value:P(w({name:m(),title:de,valueType:jt(()=>je)}))}),$f=w({type:L("enums"),value:P(m())});w({type:L("array"),value:jt(()=>je)});const Nf=w({type:L("array"),value:jt(()=>P(je))}),je=F([We(["array","boolean","number","object","string"]),We(["component","expression","function"]),Ef,$f,Nf]),Tf=F([m(),w({componentName:m(),props:v(x()),initialValue:v(x()),component:v(x()),hiddenLabel:v(pt())})]),Re=w({name:m(),title:de,valueType:je,description:v(m()),defaultValue:x(),setters:v(P(Tf)),condition:v(_o())});F([m(),_o()]);var Qe=(t=>(t.SINGLE="single",t.GROUP="group",t))(Qe||{});F([m(),w({name:m(),describe:v(m()),params:v(w({name:m(),description:m()})),template:m()})]);const xf=w({id:v(m()),title:m(),snapshot:F([m(),x()]),snapshotText:v(m()),description:v(m()),tags:v(P(m())),groupName:v(m()),category:v(m()),schema:Er(bo(Ot,["id"]),w({componentName:v(m())}))}),Af=w({componentName:m(),title:m(),screenshot:v(m()),icon:v(m()),tags:v(P(m())),groupName:v(m()),category:v(m()),priority:v(So()),npm:v($r),snippets:P(xf),props:P(F([Re,w({title:v(de),type:L("single"),content:Re}),w({title:v(de),type:L("group"),content:P(Re)})])),fixedProps:v(x()),isContainer:v(F([pt(),w({placeholder:m(),width:m(),height:m()})])),disableEditorDragDom:v(x()),isLayout:v(pt()),rootSelector:v(m()),advanceCustom:v(x()),extra:v(Ht(x(),x()))}),Mf=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
2
2
  originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
3
3
  data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
4
4
  originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
5
5
  data struct format is invalidate`),o},xr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Mf(({data:a})=>{try{return yo(a,o),{isValidate:!0}}catch(i){let s=i;return i instanceof go&&(s=i.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
6
- `)),{isValidate:!1,message:s,error:i}}})({data:e,message:r,throwError:n})};var Mt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Mt||{});const Pf=w({type:L(V.FUNCTION),value:v()}),Rf=Er(bo(Ot,["componentName"]),w({componentName:L("RootContainer")}));function If(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const re=If(),Df=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new pt([]);return e&&(o=e.materialsMode||new pt([])),n&&(R(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):B(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class wt{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",re),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new pt([]);this.materialsMode=n,this.id=Z(),this.data=Df(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)return o.export(e);if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return R(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Oo=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Je.SINGLE?e.push(n.content):n.type===Je.GROUP&&(e=[...e,...Oo(n.content)]):e.push(r)}),e},Qe=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new wt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=qe(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Qe(n,e,r)):t},qe=(t,e,r)=>B(t)?Qe(t,e,r):R(t)?t.map(n=>Qe(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",re),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new pt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=qe(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=qe(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof wt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof A){const r=e.material;return Oo((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof wt||o instanceof A)return o.export(e);if(R(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return o};return n(r)}}const Lf=t=>{if(typeof t=="string")return!0;xr({data:t,dataStruct:Ot,throwError:!1})},gn=(t,e,r=new pt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var i;const s=(i=t.props)==null?void 0:i[a];if(s instanceof at){n.props[a]=s;return}n.props[a]=new at(a,s||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof A)return a;if(B(a)){const i=a;return new A(i,{parent:e,materials:r})}else return a}):(t.children instanceof A&&(n.children=[t.children]),n.children=[new A(t.children,{parent:e,materials:r})])),n};class A{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",re),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Lf(e);const n=(r==null?void 0:r.materials)||new pt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=gn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=gn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Mr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof A?l.export(e):l),i=n.configure||{},s=i.propsSetter||{},c={};Object.keys(s).forEach(l=>{const p=qn(s,l,!1);p&&(c[l]=p)}),i.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:i,props:o,children:a};return e==="design"&&delete u.id,u=Ar(u),u}}const yn=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:Mt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];R(t.children)?o=t.children.map(i=>i instanceof A?i:B(i)?new A(i,{parent:e,materials:r}):i):t.children instanceof A?o.push(t.children):t.children&&B(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(i=>{var s;const c=(s=t.props)==null?void 0:s[i];c instanceof at?n.props[i]=c:n.props[i]=new at(i,c||"",{parent:e,materials:r})}),n.children=o,n};class Xt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",Mt.ROOT_CONTAINER),_(this,"emitter",re),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=yn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=yn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Mr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Nr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c)};let s=mo(i,["id"]);return s=Ar(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Xt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Ff=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Bf=t=>(t==null?void 0:t.nodeType)==="NODE",Re=t=>(t==null?void 0:t.nodeType)==="PROP",Uf=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>sf(t,e=>B(e)?!Object.keys(e).length:R(e)?!e.length:!e);function kf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=s=>{if(s instanceof A){r.push(s);return}if(s instanceof wt&&a(s.value.value),s instanceof at){a(s.value);return}if(B(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(R(s)){s.forEach(c=>{a(c)});return}};a(o);const i=(n==null?void 0:n.value.children.filter(s=>s instanceof A))||[];r.push(...i)}}function Mr(t,e){return kf(t,r=>r.id===e)}const Vf=t=>{const e=io(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${Z()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class zf{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=Vf(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const Gf=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new zf(e))},Hf=t=>{t==null||t.forEach(e=>{xr({data:e,dataStruct:Af,throwError:!1})})};class pt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Hf(e),this.data=Gf(e)}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,i)=>(a.push(...i.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const i=a.groupName||"default";r.includes(i)||(r.push(i),n[i]=[]),n[i].push(a)});let o=[];return r.forEach(a=>{const i=["default"],s={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const f=p.category||"default";i.includes(f)||(i.push(f),s[f]=[]),s[f].push(p)});const u=[];i.forEach(p=>{s[p].length&&u.push({name:p,list:s[p]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,i)=>(a.name||"")>(i.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Wf=w({version:v(),name:v(),css:h(v()),renderType:h(F([L("COMPONENT"),L("PAGE")])),loadType:h(x()),lifecycle:h(x()),props:h(x()),methods:h(P(Pf)),componentsMeta:P(Er(w({componentName:v()}),$r)),thirdLibs:h(Of),componentsTree:Rf,assets:h(P(x()))}),wo=t=>(xr({data:t,dataStruct:Wf,throwError:!1}),t),Ie=(t,e,r)=>({...t,componentsTree:new Xt(t.componentsTree,{parent:e,materials:r})});class de{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",re),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),wo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new pt((r==null?void 0:r.materials)||[]),this.data=Ie(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ie(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ie(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Mr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Xt)return console.warn("Not found parent node"),!1;if(a instanceof at)return console.warn("CProp can not add node"),!1;if(a instanceof wt){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof de)return!1;const i=(a==null?void 0:a.value.children.findIndex(s=>s===r))??-1;return i>=0?(n==="BEFORE"?a==null||a.value.children.splice(i,0,e):a==null||a.value.children.splice(i+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(B(n)){const a=n;if(a.type==="CHILD"){const i=a.pos,s=a.index||0;return i==="BEFORE"?r==null||r.value.children.splice(s,0,e):r==null||r.value.children.splice(s+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new A(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=Z();const n=new A(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof A?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof A&&a instanceof A?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof wt){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof A||n instanceof Xt){const o=n.value.children,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),n.updateValue(),i}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Nr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...io(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let s={...this.data,componentsTree:Ar(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=hf(a,c=>c.package),s=mo(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}Mt.ROOT_CONTAINER;var Jf=typeof global=="object"&&global&&global.Object===Object&&global;const Co=Jf;var Qf=typeof self=="object"&&self&&self.Object===Object&&self,qf=Co||Qf||Function("return this")();const Pt=qf;var Yf=Pt.Symbol;const Ct=Yf;var Eo=Object.prototype,Kf=Eo.hasOwnProperty,Xf=Eo.toString,kt=Ct?Ct.toStringTag:void 0;function Zf(t){var e=Kf.call(t,kt),r=t[kt];try{t[kt]=void 0;var n=!0}catch{}var o=Xf.call(t);return n&&(e?t[kt]=r:delete t[kt]),o}var tp=Object.prototype,ep=tp.toString;function rp(t){return ep.call(t)}var np="[object Null]",op="[object Undefined]",bn=Ct?Ct.toStringTag:void 0;function ne(t){return t==null?t===void 0?op:np:bn&&bn in Object(t)?Zf(t):rp(t)}function Rt(t){return t!=null&&typeof t=="object"}var ap="[object Symbol]";function sp(t){return typeof t=="symbol"||Rt(t)&&ne(t)==ap}function ip(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var cp=Array.isArray;const Et=cp;var up=1/0,_n=Ct?Ct.prototype:void 0,Sn=_n?_n.toString:void 0;function $o(t){if(typeof t=="string")return t;if(Et(t))return ip(t,$o)+"";if(sp(t))return Sn?Sn.call(t):"";var e=t+"";return e=="0"&&1/t==-up?"-0":e}function gt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function No(t){return t}var lp="[object AsyncFunction]",fp="[object Function]",pp="[object GeneratorFunction]",dp="[object Proxy]";function Pr(t){if(!gt(t))return!1;var e=ne(t);return e==fp||e==pp||e==lp||e==dp}var hp=Pt["__core-js_shared__"];const De=hp;var jn=function(){var t=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vp(t){return!!jn&&jn in t}var mp=Function.prototype,gp=mp.toString;function yp(t){if(t!=null){try{return gp.call(t)}catch{}try{return t+""}catch{}}return""}var bp=/[\\^$.*+?()[\]{}|]/g,_p=/^\[object .+?Constructor\]$/,Sp=Function.prototype,jp=Object.prototype,Op=Sp.toString,wp=jp.hasOwnProperty,Cp=RegExp("^"+Op.call(wp).replace(bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ep(t){if(!gt(t)||vp(t))return!1;var e=Pr(t)?Cp:_p;return e.test(yp(t))}function $p(t,e){return t==null?void 0:t[e]}function Rr(t,e){var r=$p(t,e);return Ep(r)?r:void 0}var On=Object.create,Np=function(){function t(){}return function(e){if(!gt(e))return{};if(On)return On(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=Np;function xp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ap(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Mp=800,Pp=16,Rp=Date.now;function Ip(t){var e=0,r=0;return function(){var n=Rp(),o=Pp-(n-r);if(r=n,o>0){if(++e>=Mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Dp(t){return function(){return t}}var Lp=function(){try{var t=Rr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const he=Lp;var Fp=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:Dp(e),writable:!0})}:No;const Bp=Fp;var Up=Ip(Bp);const kp=Up;var Vp=9007199254740991,zp=/^(?:0|[1-9]\d*)$/;function To(t,e){var r=typeof t;return e=e??Vp,!!e&&(r=="number"||r!="symbol"&&zp.test(t))&&t>-1&&t%1==0&&t<e}function Ir(t,e,r){e=="__proto__"&&he?he(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function je(t,e){return t===e||t!==t&&e!==e}var Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t,e,r){var n=t[e];(!(Hp.call(t,e)&&je(n,r))||r===void 0&&!(e in t))&&Ir(t,e,r)}function Jp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?Ir(r,s,c):Wp(r,s,c)}return r}var wn=Math.max;function Qp(t,e,r){return e=wn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=wn(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),xp(t,this,s)}}function qp(t,e){return kp(Qp(t,e,No),t+"")}var Yp=9007199254740991;function xo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Yp}function Dr(t){return t!=null&&xo(t.length)&&!Pr(t)}function Kp(t,e,r){if(!gt(r))return!1;var n=typeof e;return(n=="number"?Dr(r)&&To(e,r.length):n=="string"&&e in r)?je(r[e],t):!1}function Xp(t){return qp(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&Kp(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var Zp=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Zp;return t===r}function td(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ed="[object Arguments]";function Cn(t){return Rt(t)&&ne(t)==ed}var Mo=Object.prototype,rd=Mo.hasOwnProperty,nd=Mo.propertyIsEnumerable,od=Cn(function(){return arguments}())?Cn:function(t){return Rt(t)&&rd.call(t,"callee")&&!nd.call(t,"callee")};const Ye=od;function ad(){return!1}var Po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,En=Po&&typeof module=="object"&&module&&!module.nodeType&&module,sd=En&&En.exports===Po,$n=sd?Pt.Buffer:void 0,id=$n?$n.isBuffer:void 0,cd=id||ad;const Ro=cd;var ud="[object Arguments]",ld="[object Array]",fd="[object Boolean]",pd="[object Date]",dd="[object Error]",hd="[object Function]",vd="[object Map]",md="[object Number]",gd="[object Object]",yd="[object RegExp]",bd="[object Set]",_d="[object String]",Sd="[object WeakMap]",jd="[object ArrayBuffer]",Od="[object DataView]",wd="[object Float32Array]",Cd="[object Float64Array]",Ed="[object Int8Array]",$d="[object Int16Array]",Nd="[object Int32Array]",Td="[object Uint8Array]",xd="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Md="[object Uint32Array]",N={};N[wd]=N[Cd]=N[Ed]=N[$d]=N[Nd]=N[Td]=N[xd]=N[Ad]=N[Md]=!0;N[ud]=N[ld]=N[jd]=N[fd]=N[Od]=N[pd]=N[dd]=N[hd]=N[vd]=N[md]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=!1;function Pd(t){return Rt(t)&&xo(t.length)&&!!N[ne(t)]}function Rd(t){return function(e){return t(e)}}var Io=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ht=Io&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Ht&&Ht.exports===Io,Le=Id&&Co.process,Dd=function(){try{var t=Ht&&Ht.require&&Ht.require("util").types;return t||Le&&Le.binding&&Le.binding("util")}catch{}}();const Nn=Dd;var Tn=Nn&&Nn.isTypedArray,Ld=Tn?Rd(Tn):Pd;const Do=Ld;var Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e){var r=Et(t),n=!r&&Ye(t),o=!r&&!n&&Ro(t),a=!r&&!n&&!o&&Do(t),i=r||n||o||a,s=i?td(t.length,String):[],c=s.length;for(var u in t)(e||Bd.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||To(u,c)))&&s.push(u);return s}function kd(t,e){return function(r){return t(e(r))}}function Vd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var zd=Object.prototype,Gd=zd.hasOwnProperty;function Hd(t){if(!gt(t))return Vd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Gd.call(t,n))||r.push(n);return r}function Lo(t){return Dr(t)?Ud(t,!0):Hd(t)}var Wd=Rr(Object,"create");const Zt=Wd;function Jd(){this.__data__=Zt?Zt(null):{},this.size=0}function Qd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qd="__lodash_hash_undefined__",Yd=Object.prototype,Kd=Yd.hasOwnProperty;function Xd(t){var e=this.__data__;if(Zt){var r=e[t];return r===qd?void 0:r}return Kd.call(e,t)?e[t]:void 0}var Zd=Object.prototype,th=Zd.hasOwnProperty;function eh(t){var e=this.__data__;return Zt?e[t]!==void 0:th.call(e,t)}var rh="__lodash_hash_undefined__";function nh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Zt&&e===void 0?rh:e,this}function dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}dt.prototype.clear=Jd;dt.prototype.delete=Qd;dt.prototype.get=Xd;dt.prototype.has=eh;dt.prototype.set=nh;function oh(){this.__data__=[],this.size=0}function Oe(t,e){for(var r=t.length;r--;)if(je(t[r][0],e))return r;return-1}var ah=Array.prototype,sh=ah.splice;function ih(t){var e=this.__data__,r=Oe(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sh.call(e,r,1),--this.size,!0}function ch(t){var e=this.__data__,r=Oe(e,t);return r<0?void 0:e[r][1]}function uh(t){return Oe(this.__data__,t)>-1}function lh(t,e){var r=this.__data__,n=Oe(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rt.prototype.clear=oh;rt.prototype.delete=ih;rt.prototype.get=ch;rt.prototype.has=uh;rt.prototype.set=lh;var fh=Rr(Pt,"Map");const Fo=fh;function ph(){this.size=0,this.__data__={hash:new dt,map:new(Fo||rt),string:new dt}}function dh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function we(t,e){var r=t.__data__;return dh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function hh(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e}function vh(t){return we(this,t).get(t)}function mh(t){return we(this,t).has(t)}function gh(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function It(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}It.prototype.clear=ph;It.prototype.delete=hh;It.prototype.get=vh;It.prototype.has=mh;It.prototype.set=gh;function Bo(t){return t==null?"":$o(t)}var yh=kd(Object.getPrototypeOf,Object);const Uo=yh;var bh="[object Object]",_h=Function.prototype,Sh=Object.prototype,ko=_h.toString,jh=Sh.hasOwnProperty,Oh=ko.call(Object);function $t(t){if(!Rt(t)||ne(t)!=bh)return!1;var e=Uo(t);if(e===null)return!0;var r=jh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ko.call(r)==Oh}function wh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Ch(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:wh(t,e,r)}var Eh="\\ud800-\\udfff",$h="\\u0300-\\u036f",Nh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",xh=$h+Nh+Th,Ah="\\ufe0e\\ufe0f",Mh="\\u200d",Ph=RegExp("["+Mh+Eh+xh+Ah+"]");function Vo(t){return Ph.test(t)}function Rh(t){return t.split("")}var zo="\\ud800-\\udfff",Ih="\\u0300-\\u036f",Dh="\\ufe20-\\ufe2f",Lh="\\u20d0-\\u20ff",Fh=Ih+Dh+Lh,Bh="\\ufe0e\\ufe0f",Uh="["+zo+"]",Ke="["+Fh+"]",Xe="\\ud83c[\\udffb-\\udfff]",kh="(?:"+Ke+"|"+Xe+")",Go="[^"+zo+"]",Ho="(?:\\ud83c[\\udde6-\\uddff]){2}",Wo="[\\ud800-\\udbff][\\udc00-\\udfff]",Vh="\\u200d",Jo=kh+"?",Qo="["+Bh+"]?",zh="(?:"+Vh+"(?:"+[Go,Ho,Wo].join("|")+")"+Qo+Jo+")*",Gh=Qo+Jo+zh,Hh="(?:"+[Go+Ke+"?",Ke,Ho,Wo,Uh].join("|")+")",Wh=RegExp(Xe+"(?="+Xe+")|"+Hh+Gh,"g");function Jh(t){return t.match(Wh)||[]}function Qh(t){return Vo(t)?Jh(t):Rh(t)}function qh(t){return function(e){e=Bo(e);var r=Vo(e)?Qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Ch(r,1).join(""):e.slice(1);return n[t]()+o}}var Yh=qh("toUpperCase");const Kh=Yh;function Xh(t){return Kh(Bo(t).toLowerCase())}function Zh(){this.__data__=new rt,this.size=0}function tv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ev(t){return this.__data__.get(t)}function rv(t){return this.__data__.has(t)}var nv=200;function ov(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Fo||n.length<nv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new It(n)}return r.set(t,e),this.size=r.size,this}function Dt(t){var e=this.__data__=new rt(t);this.size=e.size}Dt.prototype.clear=Zh;Dt.prototype.delete=tv;Dt.prototype.get=ev;Dt.prototype.has=rv;Dt.prototype.set=ov;var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xn=qo&&typeof module=="object"&&module&&!module.nodeType&&module,av=xn&&xn.exports===qo,An=av?Pt.Buffer:void 0,Mn=An?An.allocUnsafe:void 0;function sv(t,e){if(e)return t.slice();var r=t.length,n=Mn?Mn(r):new t.constructor(r);return t.copy(n),n}var iv=Pt.Uint8Array;const Pn=iv;function cv(t){var e=new t.constructor(t.byteLength);return new Pn(e).set(new Pn(t)),e}function uv(t,e){var r=e?cv(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function lv(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(Uo(t)):{}}function fv(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var pv=fv();const dv=pv;function Ze(t,e,r){(r!==void 0&&!je(t[e],r)||r===void 0&&!(e in t))&&Ir(t,e,r)}function hv(t){return Rt(t)&&Dr(t)}function tr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vv(t){return Jp(t,Lo(t))}function mv(t,e,r,n,o,a,i){var s=tr(t,r),c=tr(e,r),u=i.get(c);if(u){Ze(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=Et(c),d=!f&&Ro(c),m=!f&&!d&&Do(c);l=c,f||d||m?Et(s)?l=s:hv(s)?l=Ap(s):d?(p=!1,l=sv(c,!0)):m?(p=!1,l=uv(c,!0)):l=[]:$t(c)||Ye(c)?(l=s,Ye(s)?l=vv(s):(!gt(s)||Pr(s))&&(l=lv(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),Ze(t,r,l)}function Yo(t,e,r,n,o){t!==e&&dv(e,function(a,i){if(o||(o=new Dt),gt(a))mv(t,e,i,r,Yo,n,o);else{var s=n?n(tr(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),Ze(t,i,s)}},Lo)}var gv=Xp(function(t,e,r){Yo(t,e,r)});const yv=gv,bv=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Ko(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Xo(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function Zo(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
6
+ `)),{isValidate:!1,message:s,error:i}}})({data:e,message:r,throwError:n})};var Mt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Mt||{});const Pf=w({type:L(V.FUNCTION),value:m()}),Rf=Er(bo(Ot,["componentName"]),w({componentName:L("RootContainer")}));function Df(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ne=Df(),If=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new dt([]);return e&&(o=e.materialsMode||new dt([])),n&&(R(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):B(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class wt{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new dt([]);this.materialsMode=n,this.id=Z(),this.data=If(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)return o.export(e);if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return R(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Oo=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Qe.SINGLE?e.push(n.content):n.type===Qe.GROUP&&(e=[...e,...Oo(n.content)]):e.push(r)}),e},qe=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new wt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ye(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>qe(n,e,r)):t},Ye=(t,e,r)=>B(t)?qe(t,e,r):R(t)?t.map(n=>qe(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new dt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Ye(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ye(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof wt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof A){const r=e.material;return Oo((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof wt||o instanceof A)return o.export(e);if(R(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return o};return n(r)}}const Lf=t=>{if(typeof t=="string")return!0;xr({data:t,dataStruct:Ot,throwError:!1})},gn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var i;const s=(i=t.props)==null?void 0:i[a];if(s instanceof at){n.props[a]=s;return}n.props[a]=new at(a,s||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof A)return a;if(B(a)){const i=a;return new A(i,{parent:e,materials:r})}else return a}):(t.children instanceof A&&(n.children=[t.children]),n.children=[new A(t.children,{parent:e,materials:r})])),n};class A{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",ne),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Lf(e);const n=(r==null?void 0:r.materials)||new dt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=gn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=gn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Mr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof A?l.export(e):l),i=n.configure||{},s=i.propsSetter||{},c={};Object.keys(s).forEach(l=>{const p=qn(s,l,!1);p&&(c[l]=p)}),i.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:i,props:o,children:a};return e==="design"&&delete u.id,u=Ar(u),u}}const yn=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:Mt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];R(t.children)?o=t.children.map(i=>i instanceof A?i:B(i)?new A(i,{parent:e,materials:r}):i):t.children instanceof A?o.push(t.children):t.children&&B(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(i=>{var s;const c=(s=t.props)==null?void 0:s[i];c instanceof at?n.props[i]=c:n.props[i]=new at(i,c||"",{parent:e,materials:r})}),n.children=o,n};class Zt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",Mt.ROOT_CONTAINER),_(this,"emitter",ne),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=yn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=yn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Mr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Nr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c)};let s=mo(i,["id"]);return s=Ar(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Ff=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Bf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",Uf=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>sf(t,e=>B(e)?!Object.keys(e).length:R(e)?!e.length:!e);function kf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=s=>{if(s instanceof A){r.push(s);return}if(s instanceof wt&&a(s.value.value),s instanceof at){a(s.value);return}if(B(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(R(s)){s.forEach(c=>{a(c)});return}};a(o);const i=(n==null?void 0:n.value.children.filter(s=>s instanceof A))||[];r.push(...i)}}function Mr(t,e){return kf(t,r=>r.id===e)}const Vf=t=>{const e=io(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${Z()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class zf{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=Vf(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const Gf=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new zf(e))},Hf=t=>{t==null||t.forEach(e=>{xr({data:e,dataStruct:Af,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Hf(e),this.data=Gf(e)}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,i)=>(a.push(...i.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const i=a.groupName||"default";r.includes(i)||(r.push(i),n[i]=[]),n[i].push(a)});let o=[];return r.forEach(a=>{const i=["default"],s={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const f=p.category||"default";i.includes(f)||(i.push(f),s[f]=[]),s[f].push(p)});const u=[];i.forEach(p=>{s[p].length&&u.push({name:p,list:s[p]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,i)=>(a.name||"")>(i.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Wf=w({version:m(),name:m(),css:v(m()),renderType:v(F([L("COMPONENT"),L("PAGE")])),loadType:v(x()),lifecycle:v(x()),props:v(x()),methods:v(P(Pf)),componentsMeta:P(Er(w({componentName:m()}),$r)),thirdLibs:v(Of),componentsTree:Rf,assets:v(P(x()))}),wo=t=>(xr({data:t,dataStruct:Wf,throwError:!1}),t),Ie=(t,e,r)=>({...t,componentsTree:new Zt(t.componentsTree,{parent:e,materials:r})});class he{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",ne),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),wo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Ie(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ie(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ie(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Mr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Zt)return console.warn("Not found parent node"),!1;if(a instanceof at)return console.warn("CProp can not add node"),!1;if(a instanceof wt){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof he)return!1;const i=(a==null?void 0:a.value.children.findIndex(s=>s===r))??-1;return i>=0?(n==="BEFORE"?a==null||a.value.children.splice(i,0,e):a==null||a.value.children.splice(i+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(B(n)){const a=n;if(a.type==="CHILD"){const i=a.pos,s=a.index||0;return i==="BEFORE"?r==null||r.value.children.splice(s,0,e):r==null||r.value.children.splice(s+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new A(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=Z();const n=new A(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof A?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof A&&a instanceof A?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof wt){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof A||n instanceof Zt){const o=n.value.children,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),n.updateValue(),i}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Nr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...io(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let s={...this.data,componentsTree:Ar(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=hf(a,c=>c.package),s=mo(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}Mt.ROOT_CONTAINER;var Jf=typeof global=="object"&&global&&global.Object===Object&&global;const Co=Jf;var Qf=typeof self=="object"&&self&&self.Object===Object&&self,qf=Co||Qf||Function("return this")();const Pt=qf;var Yf=Pt.Symbol;const Ct=Yf;var Eo=Object.prototype,Kf=Eo.hasOwnProperty,Xf=Eo.toString,Vt=Ct?Ct.toStringTag:void 0;function Zf(t){var e=Kf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Xf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var tp=Object.prototype,ep=tp.toString;function rp(t){return ep.call(t)}var np="[object Null]",op="[object Undefined]",bn=Ct?Ct.toStringTag:void 0;function oe(t){return t==null?t===void 0?op:np:bn&&bn in Object(t)?Zf(t):rp(t)}function Rt(t){return t!=null&&typeof t=="object"}var ap="[object Symbol]";function sp(t){return typeof t=="symbol"||Rt(t)&&oe(t)==ap}function ip(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var cp=Array.isArray;const Et=cp;var up=1/0,_n=Ct?Ct.prototype:void 0,Sn=_n?_n.toString:void 0;function $o(t){if(typeof t=="string")return t;if(Et(t))return ip(t,$o)+"";if(sp(t))return Sn?Sn.call(t):"";var e=t+"";return e=="0"&&1/t==-up?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function No(t){return t}var lp="[object AsyncFunction]",fp="[object Function]",pp="[object GeneratorFunction]",dp="[object Proxy]";function Pr(t){if(!yt(t))return!1;var e=oe(t);return e==fp||e==pp||e==lp||e==dp}var hp=Pt["__core-js_shared__"];const Le=hp;var jn=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vp(t){return!!jn&&jn in t}var mp=Function.prototype,gp=mp.toString;function yp(t){if(t!=null){try{return gp.call(t)}catch{}try{return t+""}catch{}}return""}var bp=/[\\^$.*+?()[\]{}|]/g,_p=/^\[object .+?Constructor\]$/,Sp=Function.prototype,jp=Object.prototype,Op=Sp.toString,wp=jp.hasOwnProperty,Cp=RegExp("^"+Op.call(wp).replace(bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ep(t){if(!yt(t)||vp(t))return!1;var e=Pr(t)?Cp:_p;return e.test(yp(t))}function $p(t,e){return t==null?void 0:t[e]}function Rr(t,e){var r=$p(t,e);return Ep(r)?r:void 0}var On=Object.create,Np=function(){function t(){}return function(e){if(!yt(e))return{};if(On)return On(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=Np;function xp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ap(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Mp=800,Pp=16,Rp=Date.now;function Dp(t){var e=0,r=0;return function(){var n=Rp(),o=Pp-(n-r);if(r=n,o>0){if(++e>=Mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ip(t){return function(){return t}}var Lp=function(){try{var t=Rr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ve=Lp;var Fp=ve?function(t,e){return ve(t,"toString",{configurable:!0,enumerable:!1,value:Ip(e),writable:!0})}:No;const Bp=Fp;var Up=Dp(Bp);const kp=Up;var Vp=9007199254740991,zp=/^(?:0|[1-9]\d*)$/;function To(t,e){var r=typeof t;return e=e??Vp,!!e&&(r=="number"||r!="symbol"&&zp.test(t))&&t>-1&&t%1==0&&t<e}function Dr(t,e,r){e=="__proto__"&&ve?ve(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Oe(t,e){return t===e||t!==t&&e!==e}var Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t,e,r){var n=t[e];(!(Hp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Dr(t,e,r)}function Jp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?Dr(r,s,c):Wp(r,s,c)}return r}var wn=Math.max;function Qp(t,e,r){return e=wn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=wn(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),xp(t,this,s)}}function qp(t,e){return kp(Qp(t,e,No),t+"")}var Yp=9007199254740991;function xo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Yp}function Ir(t){return t!=null&&xo(t.length)&&!Pr(t)}function Kp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Ir(r)&&To(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Xp(t){return qp(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&Kp(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var Zp=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Zp;return t===r}function td(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ed="[object Arguments]";function Cn(t){return Rt(t)&&oe(t)==ed}var Mo=Object.prototype,rd=Mo.hasOwnProperty,nd=Mo.propertyIsEnumerable,od=Cn(function(){return arguments}())?Cn:function(t){return Rt(t)&&rd.call(t,"callee")&&!nd.call(t,"callee")};const Ke=od;function ad(){return!1}var Po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,En=Po&&typeof module=="object"&&module&&!module.nodeType&&module,sd=En&&En.exports===Po,$n=sd?Pt.Buffer:void 0,id=$n?$n.isBuffer:void 0,cd=id||ad;const Ro=cd;var ud="[object Arguments]",ld="[object Array]",fd="[object Boolean]",pd="[object Date]",dd="[object Error]",hd="[object Function]",vd="[object Map]",md="[object Number]",gd="[object Object]",yd="[object RegExp]",bd="[object Set]",_d="[object String]",Sd="[object WeakMap]",jd="[object ArrayBuffer]",Od="[object DataView]",wd="[object Float32Array]",Cd="[object Float64Array]",Ed="[object Int8Array]",$d="[object Int16Array]",Nd="[object Int32Array]",Td="[object Uint8Array]",xd="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Md="[object Uint32Array]",N={};N[wd]=N[Cd]=N[Ed]=N[$d]=N[Nd]=N[Td]=N[xd]=N[Ad]=N[Md]=!0;N[ud]=N[ld]=N[jd]=N[fd]=N[Od]=N[pd]=N[dd]=N[hd]=N[vd]=N[md]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=!1;function Pd(t){return Rt(t)&&xo(t.length)&&!!N[oe(t)]}function Rd(t){return function(e){return t(e)}}var Do=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Dd=Wt&&Wt.exports===Do,Fe=Dd&&Co.process,Id=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const Nn=Id;var Tn=Nn&&Nn.isTypedArray,Ld=Tn?Rd(Tn):Pd;const Io=Ld;var Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e){var r=Et(t),n=!r&&Ke(t),o=!r&&!n&&Ro(t),a=!r&&!n&&!o&&Io(t),i=r||n||o||a,s=i?td(t.length,String):[],c=s.length;for(var u in t)(e||Bd.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||To(u,c)))&&s.push(u);return s}function kd(t,e){return function(r){return t(e(r))}}function Vd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var zd=Object.prototype,Gd=zd.hasOwnProperty;function Hd(t){if(!yt(t))return Vd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Gd.call(t,n))||r.push(n);return r}function Lo(t){return Ir(t)?Ud(t,!0):Hd(t)}var Wd=Rr(Object,"create");const te=Wd;function Jd(){this.__data__=te?te(null):{},this.size=0}function Qd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qd="__lodash_hash_undefined__",Yd=Object.prototype,Kd=Yd.hasOwnProperty;function Xd(t){var e=this.__data__;if(te){var r=e[t];return r===qd?void 0:r}return Kd.call(e,t)?e[t]:void 0}var Zd=Object.prototype,th=Zd.hasOwnProperty;function eh(t){var e=this.__data__;return te?e[t]!==void 0:th.call(e,t)}var rh="__lodash_hash_undefined__";function nh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?rh:e,this}function ht(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ht.prototype.clear=Jd;ht.prototype.delete=Qd;ht.prototype.get=Xd;ht.prototype.has=eh;ht.prototype.set=nh;function oh(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var ah=Array.prototype,sh=ah.splice;function ih(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sh.call(e,r,1),--this.size,!0}function ch(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function uh(t){return we(this.__data__,t)>-1}function lh(t,e){var r=this.__data__,n=we(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rt.prototype.clear=oh;rt.prototype.delete=ih;rt.prototype.get=ch;rt.prototype.has=uh;rt.prototype.set=lh;var fh=Rr(Pt,"Map");const Fo=fh;function ph(){this.size=0,this.__data__={hash:new ht,map:new(Fo||rt),string:new ht}}function dh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ce(t,e){var r=t.__data__;return dh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function hh(t){var e=Ce(this,t).delete(t);return this.size-=e?1:0,e}function vh(t){return Ce(this,t).get(t)}function mh(t){return Ce(this,t).has(t)}function gh(t,e){var r=Ce(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=ph;Dt.prototype.delete=hh;Dt.prototype.get=vh;Dt.prototype.has=mh;Dt.prototype.set=gh;function Bo(t){return t==null?"":$o(t)}var yh=kd(Object.getPrototypeOf,Object);const Uo=yh;var bh="[object Object]",_h=Function.prototype,Sh=Object.prototype,ko=_h.toString,jh=Sh.hasOwnProperty,Oh=ko.call(Object);function $t(t){if(!Rt(t)||oe(t)!=bh)return!1;var e=Uo(t);if(e===null)return!0;var r=jh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ko.call(r)==Oh}function wh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Ch(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:wh(t,e,r)}var Eh="\\ud800-\\udfff",$h="\\u0300-\\u036f",Nh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",xh=$h+Nh+Th,Ah="\\ufe0e\\ufe0f",Mh="\\u200d",Ph=RegExp("["+Mh+Eh+xh+Ah+"]");function Vo(t){return Ph.test(t)}function Rh(t){return t.split("")}var zo="\\ud800-\\udfff",Dh="\\u0300-\\u036f",Ih="\\ufe20-\\ufe2f",Lh="\\u20d0-\\u20ff",Fh=Dh+Ih+Lh,Bh="\\ufe0e\\ufe0f",Uh="["+zo+"]",Xe="["+Fh+"]",Ze="\\ud83c[\\udffb-\\udfff]",kh="(?:"+Xe+"|"+Ze+")",Go="[^"+zo+"]",Ho="(?:\\ud83c[\\udde6-\\uddff]){2}",Wo="[\\ud800-\\udbff][\\udc00-\\udfff]",Vh="\\u200d",Jo=kh+"?",Qo="["+Bh+"]?",zh="(?:"+Vh+"(?:"+[Go,Ho,Wo].join("|")+")"+Qo+Jo+")*",Gh=Qo+Jo+zh,Hh="(?:"+[Go+Xe+"?",Xe,Ho,Wo,Uh].join("|")+")",Wh=RegExp(Ze+"(?="+Ze+")|"+Hh+Gh,"g");function Jh(t){return t.match(Wh)||[]}function Qh(t){return Vo(t)?Jh(t):Rh(t)}function qh(t){return function(e){e=Bo(e);var r=Vo(e)?Qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Ch(r,1).join(""):e.slice(1);return n[t]()+o}}var Yh=qh("toUpperCase");const Kh=Yh;function Xh(t){return Kh(Bo(t).toLowerCase())}function Zh(){this.__data__=new rt,this.size=0}function tv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ev(t){return this.__data__.get(t)}function rv(t){return this.__data__.has(t)}var nv=200;function ov(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Fo||n.length<nv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function It(t){var e=this.__data__=new rt(t);this.size=e.size}It.prototype.clear=Zh;It.prototype.delete=tv;It.prototype.get=ev;It.prototype.has=rv;It.prototype.set=ov;var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xn=qo&&typeof module=="object"&&module&&!module.nodeType&&module,av=xn&&xn.exports===qo,An=av?Pt.Buffer:void 0,Mn=An?An.allocUnsafe:void 0;function sv(t,e){if(e)return t.slice();var r=t.length,n=Mn?Mn(r):new t.constructor(r);return t.copy(n),n}var iv=Pt.Uint8Array;const Pn=iv;function cv(t){var e=new t.constructor(t.byteLength);return new Pn(e).set(new Pn(t)),e}function uv(t,e){var r=e?cv(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function lv(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(Uo(t)):{}}function fv(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var pv=fv();const dv=pv;function tr(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Dr(t,e,r)}function hv(t){return Rt(t)&&Ir(t)}function er(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vv(t){return Jp(t,Lo(t))}function mv(t,e,r,n,o,a,i){var s=er(t,r),c=er(e,r),u=i.get(c);if(u){tr(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=Et(c),d=!f&&Ro(c),h=!f&&!d&&Io(c);l=c,f||d||h?Et(s)?l=s:hv(s)?l=Ap(s):d?(p=!1,l=sv(c,!0)):h?(p=!1,l=uv(c,!0)):l=[]:$t(c)||Ke(c)?(l=s,Ke(s)?l=vv(s):(!yt(s)||Pr(s))&&(l=lv(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),tr(t,r,l)}function Yo(t,e,r,n,o){t!==e&&dv(e,function(a,i){if(o||(o=new It),yt(a))mv(t,e,i,r,Yo,n,o);else{var s=n?n(er(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),tr(t,i,s)}},Lo)}var gv=Xp(function(t,e,r){Yo(t,e,r)});const yv=gv,bv=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Ko(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Xo(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function Zo(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
7
7
  ${Object.keys(e).map(i=>`const ${i} = $$context['${i}'];`).join(`
8
8
  `)}
9
9
  return ${n};
@@ -17,7 +17,7 @@ function $$_run_$$() {
17
17
  return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
18
18
  }
19
19
  return $$_run_$$();
20
- `,new Function(a)(...o,e,r)}catch(i){console.log(a),console.warn(i)}},er=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},rr=t=>{const e={};return Object.keys(t).forEach(r=>{let n=r.replace("-webkit","Webkit");n=n.replace("-ms","ms"),n=n.replace("-moz","Moz"),n=n.replace("-o","O");let o=n.split("-");o.length>=2&&(o=o.map((a,i)=>i!==0?Xh(a):a)),e[o.join("")]=t[r]}),e},nr=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},_v=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},Sv=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(i=>{o={...o,...n[i]}}),a=o,n=o,o={},r+=1;return a},ea=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},ra=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},jv=(t,e)=>ra(t,e),Ov=(t,e)=>ra(t,e),ue="DYNAMIC",wv=["$$context","$$nodeModel"],Rn=t=>{let e;const r=new Set,n=(c,u)=>{const l=typeof c=="function"?c(e):c;if(!Object.is(l,e)){const p=e;e=u??typeof l!="object"?l:Object.assign({},e,l),r.forEach(f=>f(e,p))}},o=()=>e,s={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,o,s),s},Cv=t=>t?Rn(t):Rn;class Ev{constructor(){y(this,"storeMap",new Map)}addStore(e,r){const n=Cv(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class $v{constructor(){y(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class na{constructor(){y(this,"renderMode","normal");y(this,"components",{});y(this,"storeManager",new Ev);y(this,"variableManager",new $v);y(this,"runtimeComponentCache",new Map);y(this,"onGetRef");y(this,"onGetComponent");y(this,"onComponentMount");y(this,"onComponentDestroy");y(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return Xo(n)||(n=Zo(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:i,onComponentDestroy:s,renderMode:c,processNodeConfigHook:u}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=i,this.onComponentDestroy=s,this.processNodeConfigHook=u;const l=e.value.componentsTree,p=this.getComponent(l),f=this.convertModelToComponent(p,e.value.componentsTree),d={},m=l.props;return Object.keys(m).forEach(g=>{d[g]=m[g].value}),d.$$context=o,this.render(f,d)}transformProps(e={},{$$context:r}){const n=e,o=i=>{if(Array.isArray(i))return i.map(s=>o(s));if(Re(i))return o(i.value);if(Uf(i)){const s=i.value,c=s.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=l=>{const p=`${l.id}-${ue}`;if(this.runtimeComponentCache.get(l.id))return{key:p,component:this.runtimeComponentCache.get(l.id)};const f=this.getComponent(l),d=this.convertModelToComponent(f,l),m=s.params||[];return{component:(...j)=>{const O=er(j,m),T=this.getContext({params:O},r);return this.render(d,{$$context:T,key:p})},key:p}};if(Array.isArray(c)){const l=c==null?void 0:c.map(p=>u(p));return(...p)=>l.map(f=>Ko(f.component)?S.createElement(f.component,{$$context:r,key:f.key}):f.component(...p))}else return u(c).component}else{if(ct(i))return lt(i.value,r||{});if(Ff(i))return ta(i.value,r,this.storeManager);if($t(i)){let s=i;Re(i)&&(s=i.value);const c=s,u={};return Object.keys(s).forEach(l=>{u[l]=o(c[l])}),u}else return i}},a={};return Object.keys(n).forEach(i=>{const s=n[i];a[i]=o(s)}),a}collectSpecialProps(e={},r){const n=[],o=(a,i)=>{let s=i;Re(i)&&(s=i.value),r(s)?n.push({keyPath:a,val:s}):Et(s)?s.forEach((c,u)=>{o([...a,String(u)],c)}):$t(s)&&Object.keys(s).forEach(c=>{o([...a,c],s[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends S.Component{constructor(s){super(s);y(this,"_CONDITION",!0);y(this,"_DESIGN_BOX",!1);y(this,"_NODE_MODEL",r);y(this,"_NODE_ID",r.id);y(this,"UNIQUE_ID",`${r.id}_${Z()}`);y(this,"targetComponentRef");y(this,"listenerHandle",[]);y(this,"storeState");y(this,"storeListenDisposeList",[]);y(this,"domHeader");y(this,"mediaStyleDomMap",{});y(this,"variableSpace");y(this,"nodeName");y(this,"updateState",s=>{this.storeState.setState(s),this.forceUpdate()});y(this,"getStyleDomById",s=>{const c=this.mediaStyleDomMap;let u=c[s];return u||(u=document.createElement("style"),c[s]=u),u.id=s,u});y(this,"addMediaCSS",()=>{var u;let s=this.domHeader;if(s||(s=(u=document.getElementsByTagName("head"))==null?void 0:u[0],this.domHeader=s),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(l=>{var d;const p=`${this.UNIQUE_ID}_${l.state}`;let f=`.${c.class}`;if(l.state!=="normal"&&(f=`${f}:${l.state}`),Object.keys(l.style).length!==0){const m=this.getStyleDomById(p);m.innerText=`${f} { ${nr(l.style)} }`,s==null||s.appendChild(m)}(d=l.media)!=null&&d.length&&l.media.forEach(m=>{const g=`${p}_${m.type}_${m.value}`,b=this.getStyleDomById(g);b.media=`screen and (${m.type}:${m.value}px)`,b.innerHTML=`${f} { ${nr(m.style)} }`,s==null||s.appendChild(b)})})});y(this,"removeMediaCSS",()=>{const s=this.mediaStyleDomMap;Object.keys(s).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(s[c])}),this.mediaStyleDomMap={}});y(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(s=>s()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=S.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const u=n.storeManager.getStore(c);u?(this.storeState=u,u.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(p=>{this.setState({...p})}),this.connectStore();const l=n.variableManager.get(c);l?this.variableSpace=l:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const s=n.collectSpecialProps(r.props,f=>!!ct(f)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},f=>!!ct(f));let u=[];[...s,...c].map(f=>{const d=f.val,m=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],g=ea(d.value,m);u=[...u,...g]}).filter(Boolean);const l=Array.from(new Set(u)),p=[];l.length&&l.forEach(f=>{n.storeManager.getStore(f)||(n.storeManager.addStore(f,()=>({})),console.warn(n.storeManager,f,"not exits"));const m=n.storeManager.connect(f,()=>{this.forceUpdate()});p.push(m)}),this.storeListenDisposeList=p}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const s=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(s)}componentWillUnmount(){var s;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(s=n.onComponentDestroy)==null||s.call(n,this,r)}render(){var oe;const{$$context:s,...c}=this.props,u=r.value.nodeName||r.id,l={key:r.id,...r.props,...c},p={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(u),getStateObj:()=>n.storeManager.getStateObj(u),getStateObjById:I=>n.storeManager.getStateObj(I),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(u).methods,getMethodsById:I=>n.variableManager.get(I).methods,getStaticVar:()=>n.variableManager.get(u).staticVar,getStaticVarById:I=>n.variableManager.get(I).staticVar};r.value.componentName===Mt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState);const f=n.getContext(p,s),g=n.transformProps({methods:r.value.methods},{$$context:f}).methods.reduce((I,Q)=>(I[Q.name]=Q.define,I),{});f.methods=g,this.variableSpace.methods=Object.assign(this.variableSpace.methods,g);const b=r.value.loop;let j=[];if(b&&b.open){this.targetComponentRef.current=[];let I=b.data||[];if(ct(b.data)){const Q=b.data;I=lt(Q.value,f||{})}return j=I.map((...Q)=>{var Lr;const Ft=Q[1],yt=[b.forName||"item",b.forIndex||"index"],Ee=er(Q,yt);let $e="loopData";b.name&&($e=`${$e}${b.name}`);const Bt=n.getContext({[$e]:Ee},f),q=n.transformProps(l,{$$context:Bt}),pa=((Lr=r.value.classNames)==null?void 0:Lr.map(G=>{var ie;const se=G.name;return(ct(G.status)?lt(String(((ie=G.status)==null?void 0:ie.value)||""),Bt):!1)?se:""}))||[];let Ne=`${q.className??""} ${pa.join(" ")}`.trim();r.value.css&&(Ne=`${r.value.css.class} ${Ne}`.trim()),q.className=Ne;const da=n.transformProps(r.value.style,{$$context:Bt});r.value.style&&(q.style=rr(da||{}));const{children:ae}=q;let Te=[];if(ae!==void 0)delete q.children,Te=Array.isArray(ae)?ae:[ae];else{const G=[];r.value.children.forEach((Fr,ie)=>{const ha=n.buildComponent(Fr,{$$context:Bt,idx:ie});G.push(ha)}),Te=G}if(q.key=`${q.key}-${Ft}`,ct(b.key)){const G=b.key,se=lt(G.value,Bt||{});q.key+=`-${se}`}return q.ref=G=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[Ft]=G},n.render(e,q,...Te)}),j}const O=n.transformProps(l,{$$context:f}),{children:T}=O;let M=[];if(T!==void 0)delete O.children,M=Array.isArray(T)?T:[T];else{const I=[];r.value.children.forEach((Ft,yt)=>{const Ee=n.buildComponent(Ft,{$$context:f,idx:yt});I.push(Ee)}),M=I}O.ref=this.targetComponentRef;const D=((oe=r.value.classNames)==null?void 0:oe.map(I=>{var yt;const Q=I.name;return(ct(I.status)?lt(((yt=I.status)==null?void 0:yt.value)||"",f):!1)?Q:""}))||[];let k=`${O.className??""} ${D.join(" ")}`.trim();r.value.css&&(k=`${r.value.css.class} ${k}`.trim()),O.className=k;const Lt=n.transformProps(r.value.style,{$$context:f});r.value.style&&(O.style=rr(Lt||{}));let C=r.value.condition??!0;typeof C!="boolean"&&(C=lt(C.value,f||{}));let ot={condition:C,props:O};n.processNodeConfigHook&&(ot=n.processNodeConfigHook(ot,r));const it=n.render(e,ot.props,...M);return this._CONDITION=ot.condition,ot.condition?it:S.createElement("div",{style:{display:"none"}},it)}}return y(o,"__CP_TYPE__",ue),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):Bf(e)?(({currentNode:a})=>{const i=a.value.id;let s=null;if(n.get(i))s=n.get(i);else{const l=this.getComponent(a);s=this.convertModelToComponent(l,a)}!n.get(i)&&this.renderMode!=="design"&&n.set(i,s);const c=`${i}-${ue}`,u={$$context:r,$$nodeModel:e,key:c};return this.render(s,u)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(wv.forEach(a=>{a in r&&e.__CP_TYPE__!==ue&&delete r[a]}),S.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Nv=Dn(new na),Tv=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"];var xv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Av(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oa={exports:{}},Ce={};/**
20
+ `,new Function(a)(...o,e,r)}catch(i){console.log(a),console.warn(i)}},rr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},nr=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((i,s)=>s!==0?Xh(i):i)),e[a.join("")]=n}),e},_v=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},Sv=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},jv=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(i=>{o={...o,...n[i]}}),a=o,n=o,o={},r+=1;return a},ea=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},ra=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Ov=(t,e)=>ra(t,e),wv=(t,e)=>ra(t,e),le=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},ue="DYNAMIC",Cv=["$$context","$$nodeModel"],Rn=t=>{let e;const r=new Set,n=(c,u)=>{const l=typeof c=="function"?c(e):c;if(!Object.is(l,e)){const p=e;e=u??typeof l!="object"?l:Object.assign({},e,l),r.forEach(f=>f(e,p))}},o=()=>e,s={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,o,s),s},Ev=t=>t?Rn(t):Rn;class $v{constructor(){y(this,"storeMap",new Map)}addStore(e,r){const n=Ev(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class Nv{constructor(){y(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class na{constructor(){y(this,"renderMode","normal");y(this,"components",{});y(this,"storeManager",new $v);y(this,"variableManager",new Nv);y(this,"runtimeComponentCache",new Map);y(this,"onGetRef");y(this,"onGetComponent");y(this,"onComponentMount");y(this,"onComponentDestroy");y(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return Xo(n)||(n=Zo(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:i,onComponentDestroy:s,renderMode:c,processNodeConfigHook:u}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=i,this.onComponentDestroy=s,this.processNodeConfigHook=u;const l=e.value.componentsTree,p=this.getComponent(l),f=this.convertModelToComponent(p,e.value.componentsTree),d={},h=l.props;return Object.keys(h).forEach(g=>{d[g]=h[g].value}),d.$$context=o,this.render(f,d)}transformProps(e={},{$$context:r}){const n=e,o=i=>{if(Array.isArray(i))return i.map(s=>o(s));if(De(i))return o(i.value);if(Uf(i)){const s=i.value,c=s.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=l=>{const p=`${l.id}-${ue}`;if(this.runtimeComponentCache.get(l.id))return{key:p,component:this.runtimeComponentCache.get(l.id)};const f=this.getComponent(l),d=this.convertModelToComponent(f,l),h=s.params||[];return{component:(...j)=>{const O=rr(j,h),T=this.getContext({params:O},r);return this.render(d,{$$context:T,key:p})},key:p}};if(Array.isArray(c)){const l=c==null?void 0:c.map(p=>u(p));return(...p)=>l.map(f=>{if(Ko(f.component)){const h=f.component;return S.createElement(h,{$$context:r,key:f.key})}else{const h=f.component;return h==null?void 0:h(...p)}})}else return u(c).component}else{if(ct(i))return lt(i.value,r||{});if(Ff(i))return ta(i.value,r,this.storeManager);if($t(i)){let s=i;De(i)&&(s=i.value);const c=s,u={};return Object.keys(s).forEach(l=>{u[l]=o(c[l])}),u}else return i}},a={};return Object.keys(n).forEach(i=>{const s=n[i];a[i]=o(s)}),a}collectSpecialProps(e={},r){const n=[],o=(a,i)=>{let s=i;De(i)&&(s=i.value),r(s)?n.push({keyPath:a,val:s}):Et(s)?s.forEach((c,u)=>{o([...a,String(u)],c)}):$t(s)&&Object.keys(s).forEach(c=>{o([...a,c],s[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends S.Component{constructor(s){super(s);y(this,"_CONDITION",!0);y(this,"_DESIGN_BOX",!1);y(this,"_NODE_MODEL",r);y(this,"_NODE_ID",r.id);y(this,"UNIQUE_ID",`${r.id}_${Z()}`);y(this,"targetComponentRef");y(this,"listenerHandle",[]);y(this,"storeState");y(this,"storeListenDisposeList",[]);y(this,"domHeader");y(this,"mediaStyleDomMap",{});y(this,"variableSpace");y(this,"nodeName");y(this,"updateState",s=>{this.storeState.setState(s),this.forceUpdate()});y(this,"getStyleDomById",s=>{const c=this.mediaStyleDomMap;let u=c[s];return u||(u=document.createElement("style"),c[s]=u),u.id=s,u});y(this,"addMediaCSS",()=>{var u;let s=this.domHeader;if(s||(s=(u=document.getElementsByTagName("head"))==null?void 0:u[0],this.domHeader=s),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(l=>{var d;const p=`${this.UNIQUE_ID}_${l.state}`;let f=le(this._NODE_MODEL);if(l.state!=="normal"&&(f=`${f}:${l.state}`),l.text){const h=this.getStyleDomById(p);h.innerText=`.${f} { ${l.text} }`,s==null||s.appendChild(h)}(d=l.media)!=null&&d.length&&l.media.forEach(h=>{const g=`${p}_${h.type}_${h.value}`,b=this.getStyleDomById(g);b.media=`screen and (${h.type}:${h.value}px)`,b.innerHTML=`.${f} { ${h.text} }`,s==null||s.appendChild(b)})})});y(this,"removeMediaCSS",()=>{const s=this.mediaStyleDomMap;Object.keys(s).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(s[c])}),this.mediaStyleDomMap={}});y(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(s=>s()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=S.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const u=n.storeManager.getStore(c);u?(this.storeState=u,u.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(p=>{this.setState({...p})}),this.connectStore();const l=n.variableManager.get(c);l?this.variableSpace=l:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const s=n.collectSpecialProps(r.props,f=>!!ct(f)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},f=>!!ct(f));let u=[];[...s,...c].map(f=>{const d=f.val,h=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],g=ea(d.value,h);u=[...u,...g]}).filter(Boolean);const l=Array.from(new Set(u)),p=[];l.length&&l.forEach(f=>{n.storeManager.getStore(f)||(n.storeManager.addStore(f,()=>({})),console.warn(n.storeManager,f,"not exits"));const h=n.storeManager.connect(f,()=>{this.forceUpdate()});p.push(h)}),this.storeListenDisposeList=p}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const s=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(s)}componentWillUnmount(){var s;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(s=n.onComponentDestroy)==null||s.call(n,this,r)}render(){var ae;console.log("rerender",this.nodeName);const{$$context:s,...c}=this.props,u=r.value.nodeName||r.id,l={key:r.id,...r.props,...c},p={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(u),getStateObj:()=>n.storeManager.getStateObj(u),getStateObjById:D=>n.storeManager.getStateObj(D),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(u).methods,getMethodsById:D=>n.variableManager.get(D).methods,getStaticVar:()=>n.variableManager.get(u).staticVar,getStaticVarById:D=>n.variableManager.get(D).staticVar};r.value.componentName===Mt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState);const f=n.getContext(p,s),g=n.transformProps({methods:r.value.methods},{$$context:f}).methods.reduce((D,G)=>(D[G.name]=G.define,D),{});f.methods=g,this.variableSpace.methods=Object.assign(this.variableSpace.methods,g);const b=r.value.loop;let j=[];if(b&&b.open){this.targetComponentRef.current=[];let D=b.data||[];if(ct(b.data)){const G=b.data;D=lt(G.value,f||{})}return j=D.map((...G)=>{var Lr;const Ft=G[1],bt=[b.forName||"item",b.forIndex||"index"],$e=rr(G,bt);let Ne="loopData";b.name&&(Ne=`${Ne}${b.name}`);const Bt=n.getContext({[Ne]:$e},f),q=n.transformProps(l,{$$context:Bt}),pa=((Lr=r.value.classNames)==null?void 0:Lr.map(H=>{var ie;const Ut=H.name;return(ct(H.status)?lt(String(((ie=H.status)==null?void 0:ie.value)||""),Bt):!1)?Ut:""}))||[];let Te=`${q.className??""} ${pa.join(" ")}`.trim();r.value.css&&(Te=`${le(r)} ${Te}`.trim()),q.className=Te;const da=n.transformProps({style:r.value.style},{$$context:Bt});r.value.style&&(q.style=nr(da.style||[]));const{children:se}=q;let xe=[];if(se!==void 0)delete q.children,xe=Array.isArray(se)?se:[se];else{const H=[];r.value.children.forEach((Fr,ie)=>{const ha=n.buildComponent(Fr,{$$context:Bt,idx:ie});H.push(ha)}),xe=H}if(q.key=`${q.key}-${Ft}`,ct(b.key)){const H=b.key,Ut=lt(H.value,Bt||{});q.key+=`-${Ut}`}return q.ref=H=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[Ft]=H},n.render(e,q,...xe)}),j}const O=n.transformProps(l,{$$context:f}),{children:T}=O;let M=[];if(T!==void 0)delete O.children,M=Array.isArray(T)?T:[T];else{const D=[];r.value.children.forEach((Ft,bt)=>{const $e=n.buildComponent(Ft,{$$context:f,idx:bt});D.push($e)}),M=D}O.ref=this.targetComponentRef;const I=((ae=r.value.classNames)==null?void 0:ae.map(D=>{var bt;const G=D.name;return(ct(D.status)?lt(((bt=D.status)==null?void 0:bt.value)||"",f):!1)?G:""}))||[];let k=`${O.className??""} ${I.join(" ")}`.trim();r.value.css&&(k=`${le(r)} ${k}`.trim()),O.className=k;const Lt=n.transformProps({style:r.value.style},{$$context:f});r.value.style&&(O.style=nr(Lt.style||[]));let C=r.value.condition??!0;typeof C!="boolean"&&(C=lt(C.value,f||{}));let ot={condition:C,props:O};n.processNodeConfigHook&&(ot=n.processNodeConfigHook(ot,r));const it=n.render(e,ot.props,...M);return this._CONDITION=ot.condition,ot.condition?it:S.createElement("div",{style:{display:"none"}},it)}}return y(o,"__CP_TYPE__",ue),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):Bf(e)?(({currentNode:a})=>{const i=a.value.id;let s=null;if(n.get(i)){const l=n.get(i);s=l==null?void 0:l.component}else{const l=this.getComponent(a);s=this.convertModelToComponent(l,a),!n.get(i)&&this.renderMode!=="design"&&n.set(i,{component:s})}const c=`${i}-${ue}`,u={$$context:r,$$nodeModel:e,key:c};return this.render(s,u)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(Cv.forEach(a=>{a in r&&e.__CP_TYPE__!==ue&&delete r[a]}),S.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Tv=In(new na),xv=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"];var Av=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oa={exports:{}},Ee={};/**
21
21
  * @license React
22
22
  * react-jsx-runtime.production.min.js
23
23
  *
@@ -25,5 +25,5 @@ return $$_run_$$();
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */var Mv=S,Pv=Symbol.for("react.element"),Rv=Symbol.for("react.fragment"),Iv=Object.prototype.hasOwnProperty,Dv=Mv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Lv={key:!0,ref:!0,__self:!0,__source:!0};function aa(t,e,r){var n,o={},a=null,i=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(n in e)Iv.call(e,n)&&!Lv.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Pv,type:t,key:a,ref:i,props:o,_owner:Dv.current}}Ce.Fragment=Rv;Ce.jsx=aa;Ce.jsxs=aa;oa.exports=Ce;var Fv=oa.exports;const Bv=Fv.jsx,nt=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Uv=[...Tv,...wf],kv=Uv.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),S.createElement(e,{...o,...nt(n)},...a)},t),{}),Vv=({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(u=>u!==void 0);const{style:i={},...s}=nt(n),c={height:r,width:e,...i,...o.style||{}};return S.createElement("div",{...o,...s,style:c},...a)},zv=({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.createElement("canvas",{...n,...nt(r)})),Gv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("img",{...r,...nt(e)},...n)},Hv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("video",{...r,...nt(e)},...n)},Wv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("audio",{...r,...nt(e)},...n)},Jv=({$$attributes:t=[],content:e,...r})=>S.createElement("span",{...r,...nt(t)},e),Qv=({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),S.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),Bv("div",{...o,...nt(e),children:a})},qv=({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...i}=nt(e),s={...a,...n.style||{}};return S.createElement(r,{...n,...i,style:s},...o)},Yv={RootContainer:({children:t})=>t,...kv,CContainer:Qv,CVideo:Hv,CAudio:Wv,CBlock:Vv,CImage:Gv,CText:Jv,CCanvas:zv,CNativeTag:qv};class Kv{constructor(){y(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}class sa extends S.Component{constructor(r){super(r);y(this,"refManager");y(this,"dynamicComponentInstanceMap",new Map);y(this,"onGetRef",(r,n,o)=>{var a,i;(i=(a=this.props).onGetRef)==null||i.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});y(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if($t(r)&&wo(r)){const n=r;this.setState({pageModel:new de(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new de(r.page)},this.refManager=new Kv}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:i}=r,{pageModel:s}=this.state;if(!s)return console.warn("pageModel is null"),null;const c={...Yv,...r.components},u=this.props.$$context??{};return u.refs=this.refManager,n.pageRender(s,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:i,onComponentDestroy:a,$$context:u,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Xv=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class Zv extends S.Component{constructor(r){super(r);y(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=S.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",n.id,", node name:",n.title," component name:",n.title||n.componentName,S.createElement("p",null,"msg: ",String(this.state.error)),S.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),S.createElement("div",{style:{display:"none"}}));return S.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class ia{constructor(){y(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const ca=t=>{const{node:e}=t,r=S.useMemo(()=>{const s=e.isContainer();return $t(s)?s:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:i}=r;return S.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",width:a,height:o,...i}},n)};class tm extends S.Component{constructor(r){super(r);y(this,"instanceManager",new ia);y(this,"renderRef");y(this,"dropPlaceholder",ca);y(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const i=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;i&&(a=i(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class s extends S.Component{constructor(){super(...arguments);y(this,"_DESIGN_BOX",!0);y(this,"_NODE_MODEL",n);y(this,"_NODE_ID",n.id);y(this,"_UNIQUE_ID",`${n.id}_${Z()}`);y(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){var j,O;const{children:f=[],onlyRenderChild:d,...m}=this.props;let g=f;if(Et(f)||(g=[f]),!!!g.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Mt.ROOT_CONTAINER)){const T=(O=(j=n.material)==null?void 0:j.value.advanceCustom)==null?void 0:O.dropPlaceholder;g.push(S.createElement(T||o.dropPlaceholder,{node:n}))}return d?g:S.createElement(a,m,...g)}}return S.forwardRef(function(p,f){return S.createElement(Zv,{node:n,targetComponent:s},S.createElement(s,{ref:f,...p}))})});this.renderRef=S.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ua(r);if(!n)return null;const o=la(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(i=>{var c;if((i==null?void 0:i._STATUS)==="DESTROY")return;const s=ba.findDOMNode(i);if(s&&!(s instanceof Text))if(n){const u=Array.from(((c=s.querySelectorAll)==null?void 0:c.call(s,n))||[]);a.push(...u)}else a.push(s)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(i=>i==null?void 0:i.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),S.createElement(sa,{onGetComponent:n,...a,processNodeConfigHook:(i,s)=>{var m,g;if(s.nodeType!=="NODE")return i;const{props:c,condition:u}=i;let l={...c};const p=((m=s.value.configure)==null?void 0:m.devState)||{},f=(g=s.material)==null?void 0:g.value.fixedProps;if(f!==void 0){if($t(f))l={...l,...f};else if(typeof f=="function"){const b=f(l);l={...l,...b}}}let d=u;return p.condition===!1&&(d=p.condition),{props:yv(l,p.props||{}),condition:d}},ref:this.renderRef})}}const ua=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ua(t.parentElement)},la=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:la(t.return):null},em=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var fa={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xv,function(){var r=function(){},n={},o={},a={};function i(f,d){f=f.push?f:[f];var m=[],g=f.length,b=g,j,O,T,M;for(j=function(D,k){k.length&&m.push(D),b--,b||d(m)};g--;){if(O=f[g],T=o[O],T){j(O,T);continue}M=a[O]=a[O]||[],M.push(j)}}function s(f,d){if(f){var m=a[f];if(o[f]=d,!!m)for(;m.length;)m[0](f,d),m.splice(0,1)}}function c(f,d){f.call&&(f={success:f}),d.length?(f.error||r)(d):(f.success||r)(f)}function u(f,d,m,g){var b=document,j=m.async,O=(m.numRetries||0)+1,T=m.before||r,M=f.replace(/[\?|#].*$/,""),D=f.replace(/^(css|img|module|nomodule)!/,""),k,Lt,C;if(g=g||0,/(^css!|\.css$)/.test(M))C=b.createElement("link"),C.rel="stylesheet",C.href=D,k="hideFocus"in C,k&&C.relList&&(k=0,C.rel="preload",C.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(M))C=b.createElement("img"),C.src=D;else if(C=b.createElement("script"),C.src=D,C.async=j===void 0?!0:j,Lt="noModule"in C,/^module!/.test(M)){if(!Lt)return d(f,"l");C.type="module"}else if(/^nomodule!/.test(M)&&Lt)return d(f,"l");C.onload=C.onerror=C.onbeforeload=function(ot){var it=ot.type[0];if(k)try{C.sheet.cssText.length||(it="e")}catch(oe){oe.code!=18&&(it="e")}if(it=="e"){if(g+=1,g<O)return u(f,d,m,g)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";d(f,it,ot.defaultPrevented)},T(f,C)!==!1&&b.head.appendChild(C)}function l(f,d,m){f=f.push?f:[f];var g=f.length,b=g,j=[],O,T;for(O=function(M,D,k){if(D=="e"&&j.push(M),D=="b")if(k)j.push(M);else return;g--,g||d(j)},T=0;T<b;T++)u(f[T],O,m)}function p(f,d,m){var g,b;if(d&&d.trim&&(g=d),b=(g?m:d)||{},g){if(g in n)throw"LoadJS";n[g]=!0}function j(O,T){l(f,function(M){c(b,M),O&&c({success:O,error:T},M),s(g,M)},b)}if(b.returnPromise)return new Promise(j);j()}return p.ready=function(d,m){return i(d,function(g){c(m,g)}),p},p.done=function(d){s(d,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(d){return d in n},p})})(fa);var rm=fa.exports;const In=Av(rm);class nm{constructor(e,r){y(this,"assets");y(this,"loadStatus");y(this,"win",window);y(this,"_onSuccessList",[]);y(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=Z()),r.push(o.id);const a=o.resources.map(i=>i.src);a.length&&In(a,o.id,{async:!1,before:(i,s)=>(this.win.document.body.appendChild(s),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}In.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(i=>i(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}exports.AssetLoader=nm;exports.ComponentInstanceManager=ia;exports.DefaultDropPlaceholder=ca;exports.DefineReactAdapter=na;exports.DesignRender=tm;exports.ReactAdapter=Nv;exports.Render=sa;exports.canAcceptsRef=Xo;exports.collectVariable=_v;exports.compWrapper=Zo;exports.convertCodeStringToFunction=ta;exports.flatObject=Sv;exports.formatSourceStylePropertyName=rr;exports.getAdapter=Dn;exports.getCSSTextValue=nr;exports.getComponentsLibs=jv;exports.getMatchVal=ea;exports.getObjFromArrayMap=er;exports.getThirdLibs=Ov;exports.isClass=bv;exports.runExpression=lt;exports.shouldConstruct=Ko;exports.useDesignRender=em;exports.useRender=Xv;
28
+ */var Pv=S,Rv=Symbol.for("react.element"),Dv=Symbol.for("react.fragment"),Iv=Object.prototype.hasOwnProperty,Lv=Pv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Fv={key:!0,ref:!0,__self:!0,__source:!0};function aa(t,e,r){var n,o={},a=null,i=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(n in e)Iv.call(e,n)&&!Fv.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Rv,type:t,key:a,ref:i,props:o,_owner:Lv.current}}Ee.Fragment=Dv;Ee.jsx=aa;Ee.jsxs=aa;oa.exports=Ee;var Bv=oa.exports;const Uv=Bv.jsx,nt=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},kv=[...xv,...wf],Vv=kv.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),S.createElement(e,{...o,...nt(n)},...a)},t),{}),zv=({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(u=>u!==void 0);const{style:i={},...s}=nt(n),c={height:r,width:e,...i,...o.style||{}};return S.createElement("div",{...o,...s,style:c},...a)},Gv=({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.createElement("canvas",{...n,...nt(r)})),Hv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("img",{...r,...nt(e)},...n)},Wv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("video",{...r,...nt(e)},...n)},Jv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("audio",{...r,...nt(e)},...n)},Qv=({$$attributes:t=[],content:e,...r})=>S.createElement("span",{...r,...nt(t)},e),qv=({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),S.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),Uv("div",{...o,...nt(e),children:a})},Yv=({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...i}=nt(e),s={...a,...n.style||{}};return S.createElement(r,{...n,...i,style:s},...o)},Kv={RootContainer:({children:t})=>t,...Vv,CContainer:qv,CVideo:Wv,CAudio:Jv,CBlock:zv,CImage:Hv,CText:Qv,CCanvas:Gv,CNativeTag:Yv};class Xv{constructor(){y(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}class sa extends S.Component{constructor(r){super(r);y(this,"refManager");y(this,"dynamicComponentInstanceMap",new Map);y(this,"onGetRef",(r,n,o)=>{var a,i;(i=(a=this.props).onGetRef)==null||i.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});y(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if($t(r)&&wo(r)){const n=r;this.setState({pageModel:new he(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new he(r.page)},this.refManager=new Xv}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:i}=r,{pageModel:s}=this.state;if(!s)return console.warn("pageModel is null"),null;const c={...Kv,...r.components},u=this.props.$$context??{};return u.refs=this.refManager,n.pageRender(s,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:i,onComponentDestroy:a,$$context:u,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Zv=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class tm extends S.Component{constructor(r){super(r);y(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=S.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",n.id,", node name:",n.title," component name:",n.title||n.componentName,S.createElement("p",null,"msg: ",String(this.state.error)),S.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),S.createElement("div",{style:{display:"none"}}));return S.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class ia{constructor(){y(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const ca=t=>{const{node:e}=t,r=S.useMemo(()=>{const s=e.isContainer();return $t(s)?s:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:i}=r;return S.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",width:a,height:o,...i}},n)};class em extends S.Component{constructor(r){super(r);y(this,"instanceManager",new ia);y(this,"renderRef");y(this,"dropPlaceholder",ca);y(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const i=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;i&&(a=i(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class s extends S.Component{constructor(){super(...arguments);y(this,"_DESIGN_BOX",!0);y(this,"_NODE_MODEL",n);y(this,"_NODE_ID",n.id);y(this,"_UNIQUE_ID",`${n.id}_${Z()}`);y(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){var j,O;const{children:f=[],onlyRenderChild:d,...h}=this.props;let g=f;if(Et(f)||(g=[f]),!!!g.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Mt.ROOT_CONTAINER)){const T=(O=(j=n.material)==null?void 0:j.value.advanceCustom)==null?void 0:O.dropPlaceholder;g.push(S.createElement(T||o.dropPlaceholder,{node:n}))}return d?g:S.createElement(a,h,...g)}}return S.forwardRef(function(p,f){return S.createElement(tm,{node:n,targetComponent:s},S.createElement(s,{ref:f,...p}))})});this.renderRef=S.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ua(r);if(!n)return null;const o=la(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(i=>{var c;if((i==null?void 0:i._STATUS)==="DESTROY")return;const s=ba.findDOMNode(i);if(s&&!(s instanceof Text))if(n){const u=Array.from(((c=s.querySelectorAll)==null?void 0:c.call(s,n))||[]);a.push(...u)}else a.push(s)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(i=>i==null?void 0:i.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),S.createElement(sa,{onGetComponent:n,...a,processNodeConfigHook:(i,s)=>{var h,g;if(s.nodeType!=="NODE")return i;const{props:c,condition:u}=i;let l={...c};const p=((h=s.value.configure)==null?void 0:h.devState)||{},f=(g=s.material)==null?void 0:g.value.fixedProps;if(f!==void 0){if($t(f))l={...l,...f};else if(typeof f=="function"){const b=f(l);l={...l,...b}}}let d=u;return p.condition===!1&&(d=p.condition),{props:yv(l,p.props||{}),condition:d}},ref:this.renderRef})}}const ua=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ua(t.parentElement)},la=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:la(t.return):null},rm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var fa={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Av,function(){var r=function(){},n={},o={},a={};function i(f,d){f=f.push?f:[f];var h=[],g=f.length,b=g,j,O,T,M;for(j=function(I,k){k.length&&h.push(I),b--,b||d(h)};g--;){if(O=f[g],T=o[O],T){j(O,T);continue}M=a[O]=a[O]||[],M.push(j)}}function s(f,d){if(f){var h=a[f];if(o[f]=d,!!h)for(;h.length;)h[0](f,d),h.splice(0,1)}}function c(f,d){f.call&&(f={success:f}),d.length?(f.error||r)(d):(f.success||r)(f)}function u(f,d,h,g){var b=document,j=h.async,O=(h.numRetries||0)+1,T=h.before||r,M=f.replace(/[\?|#].*$/,""),I=f.replace(/^(css|img|module|nomodule)!/,""),k,Lt,C;if(g=g||0,/(^css!|\.css$)/.test(M))C=b.createElement("link"),C.rel="stylesheet",C.href=I,k="hideFocus"in C,k&&C.relList&&(k=0,C.rel="preload",C.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(M))C=b.createElement("img"),C.src=I;else if(C=b.createElement("script"),C.src=I,C.async=j===void 0?!0:j,Lt="noModule"in C,/^module!/.test(M)){if(!Lt)return d(f,"l");C.type="module"}else if(/^nomodule!/.test(M)&&Lt)return d(f,"l");C.onload=C.onerror=C.onbeforeload=function(ot){var it=ot.type[0];if(k)try{C.sheet.cssText.length||(it="e")}catch(ae){ae.code!=18&&(it="e")}if(it=="e"){if(g+=1,g<O)return u(f,d,h,g)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";d(f,it,ot.defaultPrevented)},T(f,C)!==!1&&b.head.appendChild(C)}function l(f,d,h){f=f.push?f:[f];var g=f.length,b=g,j=[],O,T;for(O=function(M,I,k){if(I=="e"&&j.push(M),I=="b")if(k)j.push(M);else return;g--,g||d(j)},T=0;T<b;T++)u(f[T],O,h)}function p(f,d,h){var g,b;if(d&&d.trim&&(g=d),b=(g?h:d)||{},g){if(g in n)throw"LoadJS";n[g]=!0}function j(O,T){l(f,function(M){c(b,M),O&&c({success:O,error:T},M),s(g,M)},b)}if(b.returnPromise)return new Promise(j);j()}return p.ready=function(d,h){return i(d,function(g){c(h,g)}),p},p.done=function(d){s(d,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(d){return d in n},p})})(fa);var nm=fa.exports;const Dn=Mv(nm);class om{constructor(e,r){y(this,"assets");y(this,"loadStatus");y(this,"win",window);y(this,"_onSuccessList",[]);y(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=Z()),r.push(o.id);const a=o.resources.map(i=>i.src);a.length&&Dn(a,o.id,{async:!1,before:(i,s)=>(this.win.document.body.appendChild(s),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}Dn.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(i=>i(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}exports.AssetLoader=om;exports.ComponentInstanceManager=ia;exports.DefaultDropPlaceholder=ca;exports.DefineReactAdapter=na;exports.DesignRender=em;exports.ReactAdapter=Tv;exports.Render=sa;exports.canAcceptsRef=Xo;exports.collectVariable=Sv;exports.compWrapper=Zo;exports.convertCodeStringToFunction=ta;exports.flatObject=jv;exports.formatSourceStylePropertyName=nr;exports.getAdapter=In;exports.getCSSTextValue=_v;exports.getComponentsLibs=Ov;exports.getMatchVal=ea;exports.getNodeCssClassName=le;exports.getObjFromArrayMap=rr;exports.getThirdLibs=wv;exports.isClass=bv;exports.runExpression=lt;exports.shouldConstruct=Ko;exports.useDesignRender=rm;exports.useRender=Zv;
29
29
  //# sourceMappingURL=index.js.map