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