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