@chamn/render 0.0.12 → 0.0.14

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