@chamn/render 0.0.4 → 0.0.7

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