@chamn/render 0.0.10 → 0.0.11

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