@chamn/render 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,17 +1,47 @@
1
- (function(S,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(S=typeof globalThis<"u"?globalThis:S||self,E(S.CRender={},S.React))})(this,function(S,E){"use strict";var om=Object.defineProperty;var am=(S,E,_t)=>E in S?om(S,E,{enumerable:!0,configurable:!0,writable:!0,value:_t}):S[E]=_t;var w=(S,E,_t)=>am(S,typeof E!="symbol"?E+"":E,_t);const _t=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Ca=["customPageRootRender"],Ur=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],Br=t=>[...Ur,...Ca].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Ur.includes(n)&&(r[n]=_t),r},{});var zr=typeof global=="object"&&global&&global.Object===Object&&global,Oa=typeof self=="object"&&self&&self.Object===Object&&self,St=zr||Oa||Function("return this")(),Ct=St.Symbol,Gr=Object.prototype,ja=Gr.hasOwnProperty,wa=Gr.toString,Ut=Ct?Ct.toStringTag:void 0;function Ea(t){var e=ja.call(t,Ut),r=t[Ut];try{t[Ut]=void 0;var n=!0}catch{}var o=wa.call(t);return n&&(e?t[Ut]=r:delete t[Ut]),o}var Na=Object.prototype,$a=Na.toString;function Ta(t){return $a.call(t)}var Aa="[object Null]",xa="[object Undefined]",Hr=Ct?Ct.toStringTag:void 0;function Bt(t){return t==null?t===void 0?xa:Aa:Hr&&Hr in Object(t)?Ea(t):Ta(t)}function Ot(t){return t!=null&&typeof t=="object"}var Ma="[object Symbol]";function Ia(t){return typeof t=="symbol"||Ot(t)&&Bt(t)==Ma}function Ra(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 jt=Array.isArray,qr=Ct?Ct.prototype:void 0,Jr=qr?qr.toString:void 0;function Wr(t){if(typeof t=="string")return t;if(jt(t))return Ra(t,Wr)+"";if(Ia(t))return Jr?Jr.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ct(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Qr(t){return t}var Pa="[object AsyncFunction]",Da="[object Function]",La="[object GeneratorFunction]",Fa="[object Proxy]";function Ee(t){if(!ct(t))return!1;var e=Bt(t);return e==Da||e==La||e==Pa||e==Fa}var Ne=St["__core-js_shared__"],Yr=function(){var t=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Va(t){return!!Yr&&Yr in t}var ka=Function.prototype,Ua=ka.toString;function Ba(t){if(t!=null){try{return Ua.call(t)}catch{}try{return t+""}catch{}}return""}var za=/[\\^$.*+?()[\]{}|]/g,Ga=/^\[object .+?Constructor\]$/,Ha=Function.prototype,qa=Object.prototype,Ja=Ha.toString,Wa=qa.hasOwnProperty,Qa=RegExp("^"+Ja.call(Wa).replace(za,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ya(t){if(!ct(t)||Va(t))return!1;var e=Ee(t)?Qa:Ga;return e.test(Ba(t))}function Ka(t,e){return t==null?void 0:t[e]}function $e(t,e){var r=Ka(t,e);return Ya(r)?r:void 0}var Kr=Object.create,Xa=function(){function t(){}return function(e){if(!ct(e))return{};if(Kr)return Kr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();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 ts(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var es=800,rs=16,ns=Date.now;function os(t){var e=0,r=0;return function(){var n=ns(),o=rs-(n-r);if(r=n,o>0){if(++e>=es)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function as(t){return function(){return t}}var ce=function(){try{var t=$e(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ss=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:as(e),writable:!0})}:Qr,is=os(ss),cs=9007199254740991,us=/^(?:0|[1-9]\d*)$/;function Xr(t,e){var r=typeof t;return e=e??cs,!!e&&(r=="number"||r!="symbol"&&us.test(t))&&t>-1&&t%1==0&&t<e}function Te(t,e,r){e=="__proto__"&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ue(t,e){return t===e||t!==t&&e!==e}var ls=Object.prototype,fs=ls.hasOwnProperty;function ds(t,e,r){var n=t[e];(!(fs.call(t,e)&&ue(n,r))||r===void 0&&!(e in t))&&Te(t,e,r)}function ps(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?Te(r,i,c):ds(r,i,c)}return r}var Zr=Math.max;function hs(t,e,r){return e=Zr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Zr(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 ms(t,e){return is(hs(t,e,Qr),t+"")}var gs=9007199254740991;function tn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=gs}function Ae(t){return t!=null&&tn(t.length)&&!Ee(t)}function vs(t,e,r){if(!ct(r))return!1;var n=typeof e;return(n=="number"?Ae(r)&&Xr(e,r.length):n=="string"&&e in r)?ue(r[e],t):!1}function ys(t){return ms(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&&vs(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 bs=Object.prototype;function en(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bs;return t===r}function _s(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ss="[object Arguments]";function rn(t){return Ot(t)&&Bt(t)==Ss}var nn=Object.prototype,Cs=nn.hasOwnProperty,Os=nn.propertyIsEnumerable,xe=rn(function(){return arguments}())?rn:function(t){return Ot(t)&&Cs.call(t,"callee")&&!Os.call(t,"callee")};function js(){return!1}var on=typeof S=="object"&&S&&!S.nodeType&&S,an=on&&typeof module=="object"&&module&&!module.nodeType&&module,ws=an&&an.exports===on,sn=ws?St.Buffer:void 0,Es=sn?sn.isBuffer:void 0,cn=Es||js,Ns="[object Arguments]",$s="[object Array]",Ts="[object Boolean]",As="[object Date]",xs="[object Error]",Ms="[object Function]",Is="[object Map]",Rs="[object Number]",Ps="[object Object]",Ds="[object RegExp]",Ls="[object Set]",Fs="[object String]",Vs="[object WeakMap]",ks="[object ArrayBuffer]",Us="[object DataView]",Bs="[object Float32Array]",zs="[object Float64Array]",Gs="[object Int8Array]",Hs="[object Int16Array]",qs="[object Int32Array]",Js="[object Uint8Array]",Ws="[object Uint8ClampedArray]",Qs="[object Uint16Array]",Ys="[object Uint32Array]",R={};R[Bs]=R[zs]=R[Gs]=R[Hs]=R[qs]=R[Js]=R[Ws]=R[Qs]=R[Ys]=!0,R[Ns]=R[$s]=R[ks]=R[Ts]=R[Us]=R[As]=R[xs]=R[Ms]=R[Is]=R[Rs]=R[Ps]=R[Ds]=R[Ls]=R[Fs]=R[Vs]=!1;function Ks(t){return Ot(t)&&tn(t.length)&&!!R[Bt(t)]}function Xs(t){return function(e){return t(e)}}var un=typeof S=="object"&&S&&!S.nodeType&&S,zt=un&&typeof module=="object"&&module&&!module.nodeType&&module,Zs=zt&&zt.exports===un,Me=Zs&&zr.process,ln=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Me&&Me.binding&&Me.binding("util")}catch{}}(),fn=ln&&ln.isTypedArray,dn=fn?Xs(fn):Ks;function ti(t,e){var r=jt(t),n=!r&&xe(t),o=!r&&!n&&cn(t),a=!r&&!n&&!o&&dn(t),s=r||n||o||a,i=s?_s(t.length,String):[],c=i.length;for(var u in t)s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xr(u,c))||i.push(u);return i}function ei(t,e){return function(r){return t(e(r))}}function ri(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ni=Object.prototype,oi=ni.hasOwnProperty;function ai(t){if(!ct(t))return ri(t);var e=en(t),r=[];for(var n in t)n=="constructor"&&(e||!oi.call(t,n))||r.push(n);return r}function pn(t){return Ae(t)?ti(t):ai(t)}var Gt=$e(Object,"create");function si(){this.__data__=Gt?Gt(null):{},this.size=0}function ii(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ci="__lodash_hash_undefined__",ui=Object.prototype,li=ui.hasOwnProperty;function fi(t){var e=this.__data__;if(Gt){var r=e[t];return r===ci?void 0:r}return li.call(e,t)?e[t]:void 0}var di=Object.prototype,pi=di.hasOwnProperty;function hi(t){var e=this.__data__;return Gt?e[t]!==void 0:pi.call(e,t)}var mi="__lodash_hash_undefined__";function gi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Gt&&e===void 0?mi:e,this}function ut(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])}}ut.prototype.clear=si,ut.prototype.delete=ii,ut.prototype.get=fi,ut.prototype.has=hi,ut.prototype.set=gi;function vi(){this.__data__=[],this.size=0}function le(t,e){for(var r=t.length;r--;)if(ue(t[r][0],e))return r;return-1}var yi=Array.prototype,bi=yi.splice;function _i(t){var e=this.__data__,r=le(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():bi.call(e,r,1),--this.size,!0}function Si(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function Ci(t){return le(this.__data__,t)>-1}function Oi(t,e){var r=this.__data__,n=le(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function 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=vi,rt.prototype.delete=_i,rt.prototype.get=Si,rt.prototype.has=Ci,rt.prototype.set=Oi;var hn=$e(St,"Map");function ji(){this.size=0,this.__data__={hash:new ut,map:new(hn||rt),string:new ut}}function wi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function fe(t,e){var r=t.__data__;return wi(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Ei(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e}function Ni(t){return fe(this,t).get(t)}function $i(t){return fe(this,t).has(t)}function Ti(t,e){var r=fe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function wt(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])}}wt.prototype.clear=ji,wt.prototype.delete=Ei,wt.prototype.get=Ni,wt.prototype.has=$i,wt.prototype.set=Ti;function mn(t){return t==null?"":Wr(t)}var gn=ei(Object.getPrototypeOf,Object),Ai="[object Object]",xi=Function.prototype,Mi=Object.prototype,vn=xi.toString,Ii=Mi.hasOwnProperty,Ri=vn.call(Object);function Et(t){if(!Ot(t)||Bt(t)!=Ai)return!1;var e=gn(t);if(e===null)return!0;var r=Ii.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vn.call(r)==Ri}function Pi(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 Di(t,e,r){var n=t.length;return r=r===void 0?n:r,Pi(t,e,r)}var Li="\\ud800-\\udfff",Fi="\\u0300-\\u036f",Vi="\\ufe20-\\ufe2f",ki="\\u20d0-\\u20ff",Ui=Fi+Vi+ki,Bi="\\ufe0e\\ufe0f",zi="\\u200d",Gi=RegExp("["+zi+Li+Ui+Bi+"]");function yn(t){return Gi.test(t)}function Hi(t){return t.split("")}var bn="\\ud800-\\udfff",qi="\\u0300-\\u036f",Ji="\\ufe20-\\ufe2f",Wi="\\u20d0-\\u20ff",Qi=qi+Ji+Wi,Yi="\\ufe0e\\ufe0f",Ki="["+bn+"]",Ie="["+Qi+"]",Re="\\ud83c[\\udffb-\\udfff]",Xi="(?:"+Ie+"|"+Re+")",_n="[^"+bn+"]",Sn="(?:\\ud83c[\\udde6-\\uddff]){2}",Cn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zi="\\u200d",On=Xi+"?",jn="["+Yi+"]?",tc="(?:"+Zi+"(?:"+[_n,Sn,Cn].join("|")+")"+jn+On+")*",ec=jn+On+tc,rc="(?:"+[_n+Ie+"?",Ie,Sn,Cn,Ki].join("|")+")",nc=RegExp(Re+"(?="+Re+")|"+rc+ec,"g");function oc(t){return t.match(nc)||[]}function ac(t){return yn(t)?oc(t):Hi(t)}function sc(t){return function(e){e=mn(e);var r=yn(e)?ac(e):void 0,n=r?r[0]:e.charAt(0),o=r?Di(r,1).join(""):e.slice(1);return n[t]()+o}}var ic=sc("toUpperCase");function cc(t){return ic(mn(t).toLowerCase())}function uc(){this.__data__=new rt,this.size=0}function lc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function fc(t){return this.__data__.get(t)}function dc(t){return this.__data__.has(t)}var pc=200;function hc(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!hn||n.length<pc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new wt(n)}return r.set(t,e),this.size=r.size,this}function Nt(t){var e=this.__data__=new rt(t);this.size=e.size}Nt.prototype.clear=uc,Nt.prototype.delete=lc,Nt.prototype.get=fc,Nt.prototype.has=dc,Nt.prototype.set=hc;var wn=typeof S=="object"&&S&&!S.nodeType&&S,En=wn&&typeof module=="object"&&module&&!module.nodeType&&module,mc=En&&En.exports===wn,Nn=mc?St.Buffer:void 0;Nn&&Nn.allocUnsafe;function gc(t,e){return t.slice()}var $n=St.Uint8Array;function vc(t){var e=new t.constructor(t.byteLength);return new $n(e).set(new $n(t)),e}function yc(t,e){var r=vc(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function bc(t){return typeof t.constructor=="function"&&!en(t)?Xa(gn(t)):{}}function _c(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var Sc=_c();function Pe(t,e,r){(r!==void 0&&!ue(t[e],r)||r===void 0&&!(e in t))&&Te(t,e,r)}function Cc(t){return Ot(t)&&Ae(t)}function De(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Oc(t){return ps(t,pn(t))}function jc(t,e,r,n,o,a,s){var i=De(t,r),c=De(e,r),u=s.get(c);if(u){Pe(t,r,u);return}var f=a?a(i,c,r+"",t,e,s):void 0,l=f===void 0;if(l){var d=jt(c),p=!d&&cn(c),b=!d&&!p&&dn(c);f=c,d||p||b?jt(i)?f=i:Cc(i)?f=ts(i):p?(l=!1,f=gc(c)):b?(l=!1,f=yc(c)):f=[]:Et(c)||xe(c)?(f=i,xe(i)?f=Oc(i):(!ct(i)||Ee(i))&&(f=bc(c))):l=!1}l&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),Pe(t,r,f)}function Tn(t,e,r,n,o){t!==e&&Sc(e,function(a,s){if(o||(o=new Nt),ct(a))jc(t,e,s,r,Tn,n,o);else{var i=n?n(De(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Pe(t,s,i)}},pn)}var wc=ys(function(t,e,r){Tn(t,e,r)});const Ec=function(t){return!(!t||typeof t!="function"||!t.prototype)};function An(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function xn(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 Mn(t){class e extends E.Component{render(){return E.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
2
- ${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
3
- `)}
4
- return ${n};
5
- `;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}},Ht=t=>{const{funcBody:e,funcName:r,nodeContext:n,storeManager:o,$$response:a,actionVariableSpace:s}=t,i=r||"anonymous";return{[i]:function(...u){let f;const d=Object.keys(s||{}).map(p=>`var ${p}=$$actionVariableSpace[${JSON.stringify(p)}];`);try{return f=`
1
+ (function(C,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(C=typeof globalThis<"u"?globalThis:C||self,N(C.CRender={},C.React))})(this,function(C,N){"use strict";var Cm=Object.defineProperty;var Em=(C,N,Mt)=>N in C?Cm(C,N,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):C[N]=Mt;var w=(C,N,Mt)=>Em(C,typeof N!="symbol"?N+"":N,Mt);const Mt=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Ja=["customPageRootRender"],en=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],rn=t=>[...en,...Ja].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):en.includes(n)&&(r[n]=Mt),r},{});var nn=typeof global=="object"&&global&&global.Object===Object&&global,Wa=typeof self=="object"&&self&&self.Object===Object&&self,X=nn||Wa||Function("return this")(),lt=X.Symbol,on=Object.prototype,Ka=on.hasOwnProperty,Qa=on.toString,qt=lt?lt.toStringTag:void 0;function Ya(t){var e=Ka.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=Qa.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var Xa=Object.prototype,Za=Xa.toString;function ts(t){return Za.call(t)}var es="[object Null]",rs="[object Undefined]",an=lt?lt.toStringTag:void 0;function gt(t){return t==null?t===void 0?rs:es:an&&an in Object(t)?Ya(t):ts(t)}function ft(t){return t!=null&&typeof t=="object"}var ns="[object Symbol]";function os(t){return typeof t=="symbol"||ft(t)&&gt(t)==ns}function as(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 nt=Array.isArray,sn=lt?lt.prototype:void 0,cn=sn?sn.toString:void 0;function un(t){if(typeof t=="string")return t;if(nt(t))return as(t,un)+"";if(os(t))return cn?cn.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ln(t){return t}var ss="[object AsyncFunction]",is="[object Function]",cs="[object GeneratorFunction]",us="[object Proxy]";function Ie(t){if(!mt(t))return!1;var e=gt(t);return e==is||e==cs||e==ss||e==us}var De=X["__core-js_shared__"],fn=function(){var t=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ls(t){return!!fn&&fn in t}var fs=Function.prototype,ds=fs.toString;function vt(t){if(t!=null){try{return ds.call(t)}catch{}try{return t+""}catch{}}return""}var ps=/[\\^$.*+?()[\]{}|]/g,hs=/^\[object .+?Constructor\]$/,gs=Function.prototype,ms=Object.prototype,vs=gs.toString,ys=ms.hasOwnProperty,bs=RegExp("^"+vs.call(ys).replace(ps,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _s(t){if(!mt(t)||ls(t))return!1;var e=Ie(t)?bs:hs;return e.test(vt(t))}function Ss(t,e){return t==null?void 0:t[e]}function yt(t,e){var r=Ss(t,e);return _s(r)?r:void 0}var Le=yt(X,"WeakMap"),dn=Object.create,Os=function(){function t(){}return function(e){if(!mt(e))return{};if(dn)return dn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Cs(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 Es(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ws=800,Ns=16,$s=Date.now;function js(t){var e=0,r=0;return function(){var n=$s(),o=Ns-(n-r);if(r=n,o>0){if(++e>=ws)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function As(t){return function(){return t}}var pe=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ts=pe?function(t,e){return pe(t,"toString",{configurable:!0,enumerable:!1,value:As(e),writable:!0})}:ln,Ms=js(Ts),Ps=9007199254740991,xs=/^(?:0|[1-9]\d*)$/;function pn(t,e){var r=typeof t;return e=e??Ps,!!e&&(r=="number"||r!="symbol"&&xs.test(t))&&t>-1&&t%1==0&&t<e}function Fe(t,e,r){e=="__proto__"&&pe?pe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Jt(t,e){return t===e||t!==t&&e!==e}var Rs=Object.prototype,Is=Rs.hasOwnProperty;function Ds(t,e,r){var n=t[e];(!(Is.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&Fe(t,e,r)}function Ls(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?Fe(r,i,c):Ds(r,i,c)}return r}var hn=Math.max;function Fs(t,e,r){return e=hn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=hn(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),Cs(t,this,i)}}function Vs(t,e){return Ms(Fs(t,e,ln),t+"")}var Us=9007199254740991;function gn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Us}function he(t){return t!=null&&gn(t.length)&&!Ie(t)}function Bs(t,e,r){if(!mt(r))return!1;var n=typeof e;return(n=="number"?he(r)&&pn(e,r.length):n=="string"&&e in r)?Jt(r[e],t):!1}function Gs(t){return Vs(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&&Bs(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 ks=Object.prototype;function Ve(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ks;return t===r}function Hs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var zs="[object Arguments]";function mn(t){return ft(t)&&gt(t)==zs}var vn=Object.prototype,qs=vn.hasOwnProperty,Js=vn.propertyIsEnumerable,Ue=mn(function(){return arguments}())?mn:function(t){return ft(t)&&qs.call(t,"callee")&&!Js.call(t,"callee")};function Ws(){return!1}var yn=typeof C=="object"&&C&&!C.nodeType&&C,bn=yn&&typeof module=="object"&&module&&!module.nodeType&&module,Ks=bn&&bn.exports===yn,_n=Ks?X.Buffer:void 0,Qs=_n?_n.isBuffer:void 0,ge=Qs||Ws,Ys="[object Arguments]",Xs="[object Array]",Zs="[object Boolean]",ti="[object Date]",ei="[object Error]",ri="[object Function]",ni="[object Map]",oi="[object Number]",ai="[object Object]",si="[object RegExp]",ii="[object Set]",ci="[object String]",ui="[object WeakMap]",li="[object ArrayBuffer]",fi="[object DataView]",di="[object Float32Array]",pi="[object Float64Array]",hi="[object Int8Array]",gi="[object Int16Array]",mi="[object Int32Array]",vi="[object Uint8Array]",yi="[object Uint8ClampedArray]",bi="[object Uint16Array]",_i="[object Uint32Array]",R={};R[di]=R[pi]=R[hi]=R[gi]=R[mi]=R[vi]=R[yi]=R[bi]=R[_i]=!0,R[Ys]=R[Xs]=R[li]=R[Zs]=R[fi]=R[ti]=R[ei]=R[ri]=R[ni]=R[oi]=R[ai]=R[si]=R[ii]=R[ci]=R[ui]=!1;function Si(t){return ft(t)&&gn(t.length)&&!!R[gt(t)]}function Oi(t){return function(e){return t(e)}}var Sn=typeof C=="object"&&C&&!C.nodeType&&C,Wt=Sn&&typeof module=="object"&&module&&!module.nodeType&&module,Ci=Wt&&Wt.exports===Sn,Be=Ci&&nn.process,On=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}(),Cn=On&&On.isTypedArray,Ge=Cn?Oi(Cn):Si,Ei=Object.prototype,wi=Ei.hasOwnProperty;function En(t,e){var r=nt(t),n=!r&&Ue(t),o=!r&&!n&&ge(t),a=!r&&!n&&!o&&Ge(t),s=r||n||o||a,i=s?Hs(t.length,String):[],c=i.length;for(var u in t)(e||wi.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||pn(u,c)))&&i.push(u);return i}function wn(t,e){return function(r){return t(e(r))}}var Ni=wn(Object.keys,Object),$i=Object.prototype,ji=$i.hasOwnProperty;function Ai(t){if(!Ve(t))return Ni(t);var e=[];for(var r in Object(t))ji.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ti(t){return he(t)?En(t):Ai(t)}function Mi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Pi=Object.prototype,xi=Pi.hasOwnProperty;function Ri(t){if(!mt(t))return Mi(t);var e=Ve(t),r=[];for(var n in t)n=="constructor"&&(e||!xi.call(t,n))||r.push(n);return r}function Nn(t){return he(t)?En(t,!0):Ri(t)}var Kt=yt(Object,"create");function Ii(){this.__data__=Kt?Kt(null):{},this.size=0}function Di(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Li="__lodash_hash_undefined__",Fi=Object.prototype,Vi=Fi.hasOwnProperty;function Ui(t){var e=this.__data__;if(Kt){var r=e[t];return r===Li?void 0:r}return Vi.call(e,t)?e[t]:void 0}var Bi=Object.prototype,Gi=Bi.hasOwnProperty;function ki(t){var e=this.__data__;return Kt?e[t]!==void 0:Gi.call(e,t)}var Hi="__lodash_hash_undefined__";function zi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Kt&&e===void 0?Hi:e,this}function bt(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])}}bt.prototype.clear=Ii,bt.prototype.delete=Di,bt.prototype.get=Ui,bt.prototype.has=ki,bt.prototype.set=zi;function qi(){this.__data__=[],this.size=0}function me(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}var Ji=Array.prototype,Wi=Ji.splice;function Ki(t){var e=this.__data__,r=me(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Wi.call(e,r,1),--this.size,!0}function Qi(t){var e=this.__data__,r=me(e,t);return r<0?void 0:e[r][1]}function Yi(t){return me(this.__data__,t)>-1}function Xi(t,e){var r=this.__data__,n=me(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ot(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=qi,ot.prototype.delete=Ki,ot.prototype.get=Qi,ot.prototype.has=Yi,ot.prototype.set=Xi;var Qt=yt(X,"Map");function Zi(){this.size=0,this.__data__={hash:new bt,map:new(Qt||ot),string:new bt}}function tc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ve(t,e){var r=t.__data__;return tc(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ec(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e}function rc(t){return ve(this,t).get(t)}function nc(t){return ve(this,t).has(t)}function oc(t,e){var r=ve(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function _t(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])}}_t.prototype.clear=Zi,_t.prototype.delete=ec,_t.prototype.get=rc,_t.prototype.has=nc,_t.prototype.set=oc;function $n(t){return t==null?"":un(t)}function ac(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var jn=wn(Object.getPrototypeOf,Object),sc="[object Object]",ic=Function.prototype,cc=Object.prototype,An=ic.toString,uc=cc.hasOwnProperty,lc=An.call(Object);function Pt(t){if(!ft(t)||gt(t)!=sc)return!1;var e=jn(t);if(e===null)return!0;var r=uc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&An.call(r)==lc}function fc(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 dc(t,e,r){var n=t.length;return r=r===void 0?n:r,fc(t,e,r)}var pc="\\ud800-\\udfff",hc="\\u0300-\\u036f",gc="\\ufe20-\\ufe2f",mc="\\u20d0-\\u20ff",vc=hc+gc+mc,yc="\\ufe0e\\ufe0f",bc="\\u200d",_c=RegExp("["+bc+pc+vc+yc+"]");function Tn(t){return _c.test(t)}function Sc(t){return t.split("")}var Mn="\\ud800-\\udfff",Oc="\\u0300-\\u036f",Cc="\\ufe20-\\ufe2f",Ec="\\u20d0-\\u20ff",wc=Oc+Cc+Ec,Nc="\\ufe0e\\ufe0f",$c="["+Mn+"]",ke="["+wc+"]",He="\\ud83c[\\udffb-\\udfff]",jc="(?:"+ke+"|"+He+")",Pn="[^"+Mn+"]",xn="(?:\\ud83c[\\udde6-\\uddff]){2}",Rn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ac="\\u200d",In=jc+"?",Dn="["+Nc+"]?",Tc="(?:"+Ac+"(?:"+[Pn,xn,Rn].join("|")+")"+Dn+In+")*",Mc=Dn+In+Tc,Pc="(?:"+[Pn+ke+"?",ke,xn,Rn,$c].join("|")+")",xc=RegExp(He+"(?="+He+")|"+Pc+Mc,"g");function Rc(t){return t.match(xc)||[]}function Ic(t){return Tn(t)?Rc(t):Sc(t)}function Dc(t){return function(e){e=$n(e);var r=Tn(e)?Ic(e):void 0,n=r?r[0]:e.charAt(0),o=r?dc(r,1).join(""):e.slice(1);return n[t]()+o}}var Lc=Dc("toUpperCase");function Fc(t){return Lc($n(t).toLowerCase())}function Vc(){this.__data__=new ot,this.size=0}function Uc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Bc(t){return this.__data__.get(t)}function Gc(t){return this.__data__.has(t)}var kc=200;function Hc(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!Qt||n.length<kc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _t(n)}return r.set(t,e),this.size=r.size,this}function at(t){var e=this.__data__=new ot(t);this.size=e.size}at.prototype.clear=Vc,at.prototype.delete=Uc,at.prototype.get=Bc,at.prototype.has=Gc,at.prototype.set=Hc;var Ln=typeof C=="object"&&C&&!C.nodeType&&C,Fn=Ln&&typeof module=="object"&&module&&!module.nodeType&&module,zc=Fn&&Fn.exports===Ln,Vn=zc?X.Buffer:void 0;Vn&&Vn.allocUnsafe;function qc(t,e){return t.slice()}function Jc(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 Wc(){return[]}var Kc=Object.prototype,Qc=Kc.propertyIsEnumerable,Un=Object.getOwnPropertySymbols,Yc=Un?function(t){return t==null?[]:(t=Object(t),Jc(Un(t),function(e){return Qc.call(t,e)}))}:Wc;function Xc(t,e,r){var n=e(t);return nt(t)?n:ac(n,r(t))}function Bn(t){return Xc(t,Ti,Yc)}var ze=yt(X,"DataView"),qe=yt(X,"Promise"),Je=yt(X,"Set"),Gn="[object Map]",Zc="[object Object]",kn="[object Promise]",Hn="[object Set]",zn="[object WeakMap]",qn="[object DataView]",tu=vt(ze),eu=vt(Qt),ru=vt(qe),nu=vt(Je),ou=vt(Le),dt=gt;(ze&&dt(new ze(new ArrayBuffer(1)))!=qn||Qt&&dt(new Qt)!=Gn||qe&&dt(qe.resolve())!=kn||Je&&dt(new Je)!=Hn||Le&&dt(new Le)!=zn)&&(dt=function(t){var e=gt(t),r=e==Zc?t.constructor:void 0,n=r?vt(r):"";if(n)switch(n){case tu:return qn;case eu:return Gn;case ru:return kn;case nu:return Hn;case ou:return zn}return e});var ye=X.Uint8Array;function au(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function su(t,e){var r=au(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function iu(t){return typeof t.constructor=="function"&&!Ve(t)?Os(jn(t)):{}}var cu="__lodash_hash_undefined__";function uu(t){return this.__data__.set(t,cu),this}function lu(t){return this.__data__.has(t)}function be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _t;++e<r;)this.add(t[e])}be.prototype.add=be.prototype.push=uu,be.prototype.has=lu;function fu(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 du(t,e){return t.has(e)}var pu=1,hu=2;function Jn(t,e,r,n,o,a){var s=r&pu,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&hu?new be:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!fu(e,function(m,v){if(!du(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function gu(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function mu(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var vu=1,yu=2,bu="[object Boolean]",_u="[object Date]",Su="[object Error]",Ou="[object Map]",Cu="[object Number]",Eu="[object RegExp]",wu="[object Set]",Nu="[object String]",$u="[object Symbol]",ju="[object ArrayBuffer]",Au="[object DataView]",Wn=lt?lt.prototype:void 0,We=Wn?Wn.valueOf:void 0;function Tu(t,e,r,n,o,a,s){switch(r){case Au:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ju:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case bu:case _u:case Cu:return Jt(+t,+e);case Su:return t.name==e.name&&t.message==e.message;case Eu:case Nu:return t==e+"";case Ou:var i=gu;case wu:var c=n&vu;if(i||(i=mu),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=yu,s.set(t,e);var d=Jn(i(t),i(e),n,o,a,s);return s.delete(t),d;case $u:if(We)return We.call(t)==We.call(e)}return!1}var Mu=1,Pu=Object.prototype,xu=Pu.hasOwnProperty;function Ru(t,e,r,n,o,a){var s=r&Mu,i=Bn(t),c=i.length,u=Bn(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:xu.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<c;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Iu=1,Kn="[object Arguments]",Qn="[object Array]",_e="[object Object]",Du=Object.prototype,Yn=Du.hasOwnProperty;function Lu(t,e,r,n,o,a){var s=nt(t),i=nt(e),c=s?Qn:dt(t),u=i?Qn:dt(e);c=c==Kn?_e:c,u=u==Kn?_e:u;var d=c==_e,l=u==_e,f=c==u;if(f&&ge(t)){if(!ge(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new at),s||Ge(t)?Jn(t,e,r,n,o,a):Tu(t,e,c,r,n,o,a);if(!(r&Iu)){var h=d&&Yn.call(t,"__wrapped__"),g=l&&Yn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new at),o(b,p,r,n,a)}}return f?(a||(a=new at),Ru(t,e,r,n,o,a)):!1}function Xn(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:Lu(t,e,r,n,Xn,o)}function Fu(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var Vu=Fu();function Ke(t,e,r){(r!==void 0&&!Jt(t[e],r)||r===void 0&&!(e in t))&&Fe(t,e,r)}function Uu(t){return ft(t)&&he(t)}function Qe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bu(t){return Ls(t,Nn(t))}function Gu(t,e,r,n,o,a,s){var i=Qe(t,r),c=Qe(e,r),u=s.get(c);if(u){Ke(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=nt(c),h=!f&&ge(c),g=!f&&!h&&Ge(c);d=c,f||h||g?nt(i)?d=i:Uu(i)?d=Es(i):h?(l=!1,d=qc(c)):g?(l=!1,d=su(c)):d=[]:Pt(c)||Ue(c)?(d=i,Ue(i)?d=Bu(i):(!mt(i)||Ie(i))&&(d=iu(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),Ke(t,r,d)}function Zn(t,e,r,n,o){t!==e&&Vu(e,function(a,s){if(o||(o=new at),mt(a))Gu(t,e,s,r,Zn,n,o);else{var i=n?n(Qe(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ke(t,s,i)}},Nn)}function ku(t,e){return Xn(t,e)}var Hu=Gs(function(t,e,r){Zn(t,e,r)});const to=(t,e={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let r=t;return r[0]===String(Number(r[0]))&&(r=`_${r}`),`
2
+ var ${t} = {};
3
+
4
+ ${e.keyListVar}.forEach(function (key) {
5
+ var tempK = /^\\d/.test(key) ? ('_' + key) : key;
6
+ Object.defineProperty(${t}, tempK, {
7
+ get: function () {
8
+ ${e.getReadValCode}
9
+ },
10
+ set: function (value) {},
11
+ enumerable: true
12
+ });
13
+ });
14
+ `},zu=function(t){return!(!t||typeof t!="function"||!t.prototype)};function eo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function ro(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 no(t){class e extends N.Component{render(){return N.createElement(t,this.props)}}return e.displayName=t.displayName,e}const St=(t,e)=>{const r=n=>xt({funcBody:`function run () { return ${n}; }`,funcName:"run",nodeContext:e.nodeContext,storeManager:e.storeManager,nodeModel:e.nodeModel})();try{return r(t)}catch(n){console.warn(n);const o=`[${t}] expression run failed`;return console.warn(o),null}},xt=t=>{const{funcBody:e,funcName:r,nodeContext:n,storeManager:o,$$response:a,nodeModel:s,actionVariableSpace:i}=t,c=r||"anonymous";return{[c]:function(...d){let l;const h=Object.keys(i||{}).map(g=>`var ${g} = $$ACTION_VAR_SPACE[${JSON.stringify(g)}];`);try{return l=`
6
15
  var $$$__args__$$$ = Array.from(arguments);
7
16
  function $$_run_$$() {
8
- var extraParams = $$$__args__$$$.pop();
9
- var __$$storeManager__ = extraParams.storeManager;
10
- var $$context = extraParams.$$context;
11
- var $$response = extraParams.$$response;
12
- var $$actionVariableSpace = extraParams.actionVariableSpace;
17
+ var __extraParams = $$$__args__$$$.pop();
18
+ var __$$storeManager__ = __extraParams.storeManager;
19
+ var $ALL_NODE_IDS = Array.from(__$$storeManager__.storeMap.keys().filter(Boolean));;
20
+ var $RESPONSE = __extraParams.$$context;
21
+ var $CTX = __extraParams.$$context;
22
+ var $$context = $CTX;
23
+ var params = $$context.params;
24
+
25
+ var $ACTION_VAR_SPACE = __extraParams.actionVariableSpace;
26
+ // 新增的变量
27
+ var $N_ID = ${JSON.stringify(s.id)};
28
+ var $NODE_MODAL = __extraParams.nodeModel;
29
+ var $IDS = $ALL_NODE_IDS.reduce(function (res, id) {
30
+ res[id] = id;
31
+ return res;
32
+ }, {});
33
+ var $M = {};
34
+ var $G_STATE = __$$storeManager__.getState('globalState');
35
+ var $STATE = __$$storeManager__.getState($N_ID);
36
+ var $LOOP_DATA = $CTX.loopData;
37
+
38
+ ${to("$ALL_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return __$$storeManager__.getState(key);"})}
39
+
40
+ ${to("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (newVal) { __$$storeManager__.setState(key, newVal); }"})}
41
+
13
42
  $$context.stateManager = __$$storeManager__.getStateSnapshot();
14
- ${d.join(`;
43
+ // action flowACTION_VAR_SPACE 中定义的变量
44
+ ${h.join(`;
15
45
  `)}
16
46
 
17
47
  var $$_f_$$ = ${e.trim()||"function () {}"};
@@ -19,13 +49,14 @@
19
49
  return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
20
50
  }
21
51
  return $$_run_$$();
22
- `,new Function(f)(...u,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:s})}catch(p){console.log(f),console.warn(p)}}}[i]},Le=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},In=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((s,i)=>i!==0?cc(s):s)),e[a.join("")]=n}),e},Nc=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},$c=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o,o.__esModule&&o.default&&(r[n.globalName]=o.default))}}),r},Tc=(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},Rn=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},Pn=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Ac=(t,e)=>Pn(t,e),xc=(t,e)=>Pn(t,e),Fe=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},Dn=(t,e)=>{const r=t.split(".");let n,o=e;return r.forEach(a=>{n=o==null?void 0:o[a],o=n}),n||(()=>`Component [${t}] not found`)},Ve=(t,e)=>{const r={...t};return r.__proto__=e,r},Mc={},Ln=t=>{let e;const r=new Set,n=(f,l)=>{const d=typeof f=="function"?f(e):f;if(!Object.is(d,e)){const p=e;e=l??(typeof d!="object"||d===null)?d:Object.assign({},e,d),r.forEach(b=>b(e,p))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(Mc?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=e=t(n,o,c);return c},Ic=t=>t?Ln(t):Ln;class Rc{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=Ic(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class Pc{constructor(){w(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 ke{constructor(){w(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()}}var Dc=Object.defineProperty,Lc=(t,e,r)=>e in t?Dc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N=(t,e,r)=>Lc(t,typeof e!="symbol"?e+"":e,r),Fn=typeof global=="object"&&global&&global.Object===Object&&global,Fc=typeof self=="object"&&self&&self.Object===Object&&self,K=Fn||Fc||Function("return this")(),G=K.Symbol,Vn=Object.prototype,Vc=Vn.hasOwnProperty,kc=Vn.toString,qt=G?G.toStringTag:void 0;function Uc(t){var e=Vc.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=kc.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var Bc=Object.prototype,zc=Bc.toString;function Gc(t){return zc.call(t)}var Hc="[object Null]",qc="[object Undefined]",kn=G?G.toStringTag:void 0;function ft(t){return t==null?t===void 0?qc:Hc:kn&&kn in Object(t)?Uc(t):Gc(t)}function X(t){return t!=null&&typeof t=="object"}var Jc="[object Symbol]";function Ue(t){return typeof t=="symbol"||X(t)&&ft(t)==Jc}function Be(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 F=Array.isArray,Un=G?G.prototype:void 0,Bn=Un?Un.toString:void 0;function zn(t){if(typeof t=="string")return t;if(F(t))return Be(t,zn)+"";if(Ue(t))return Bn?Bn.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ze(t){return t}var Wc="[object AsyncFunction]",Qc="[object Function]",Yc="[object GeneratorFunction]",Kc="[object Proxy]";function Ge(t){if(!q(t))return!1;var e=ft(t);return e==Qc||e==Yc||e==Wc||e==Kc}var He=K["__core-js_shared__"],Gn=function(){var t=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Xc(t){return!!Gn&&Gn in t}var Zc=Function.prototype,tu=Zc.toString;function dt(t){if(t!=null){try{return tu.call(t)}catch{}try{return t+""}catch{}}return""}var eu=/[\\^$.*+?()[\]{}|]/g,ru=/^\[object .+?Constructor\]$/,nu=Function.prototype,ou=Object.prototype,au=nu.toString,su=ou.hasOwnProperty,iu=RegExp("^"+au.call(su).replace(eu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cu(t){if(!q(t)||Xc(t))return!1;var e=Ge(t)?iu:ru;return e.test(dt(t))}function uu(t,e){return t==null?void 0:t[e]}function pt(t,e){var r=uu(t,e);return cu(r)?r:void 0}var qe=pt(K,"WeakMap"),Hn=Object.create,lu=function(){function t(){}return function(e){if(!q(e))return{};if(Hn)return Hn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function fu(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 du(){}function qn(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var pu=800,hu=16,mu=Date.now;function gu(t){var e=0,r=0;return function(){var n=mu(),o=hu-(n-r);if(r=n,o>0){if(++e>=pu)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function vu(t){return function(){return t}}var de=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),yu=de?function(t,e){return de(t,"toString",{configurable:!0,enumerable:!1,value:vu(e),writable:!0})}:ze,Jn=gu(yu);function bu(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function _u(t,e,r,n){for(var o=t.length,a=r+-1;++a<o;)if(e(t[a],a,t))return a;return-1}function Su(t){return t!==t}function Cu(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function Ou(t,e,r){return e===e?Cu(t,e,r):_u(t,Su,r)}function ju(t,e){var r=t==null?0:t.length;return!!r&&Ou(t,e,0)>-1}var wu=9007199254740991,Eu=/^(?:0|[1-9]\d*)$/;function pe(t,e){var r=typeof t;return e=e??wu,!!e&&(r=="number"||r!="symbol"&&Eu.test(t))&&t>-1&&t%1==0&&t<e}function Je(t,e,r){e=="__proto__"&&de?de(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Jt(t,e){return t===e||t!==t&&e!==e}var Nu=Object.prototype,$u=Nu.hasOwnProperty;function We(t,e,r){var n=t[e];(!($u.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&Je(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=void 0;c===void 0&&(c=t[i]),o?Je(r,i,c):We(r,i,c)}return r}var Wn=Math.max;function Qn(t,e,r){return e=Wn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Wn(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),fu(t,this,i)}}function Yn(t,e){return Jn(Qn(t,e,ze),t+"")}var Tu=9007199254740991;function Qe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Tu}function he(t){return t!=null&&Qe(t.length)&&!Ge(t)}function Au(t,e,r){if(!q(r))return!1;var n=typeof e;return(n=="number"?he(r)&&pe(e,r.length):n=="string"&&e in r)?Jt(r[e],t):!1}function xu(t){return Yn(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&&Au(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 Mu=Object.prototype;function Ye(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Mu;return t===r}function Iu(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ru="[object Arguments]";function Kn(t){return X(t)&&ft(t)==Ru}var Xn=Object.prototype,Pu=Xn.hasOwnProperty,Du=Xn.propertyIsEnumerable,Wt=Kn(function(){return arguments}())?Kn:function(t){return X(t)&&Pu.call(t,"callee")&&!Du.call(t,"callee")};function Lu(){return!1}var Zn=typeof S=="object"&&S&&!S.nodeType&&S,to=Zn&&typeof module=="object"&&module&&!module.nodeType&&module,Fu=to&&to.exports===Zn,eo=Fu?K.Buffer:void 0,Vu=eo?eo.isBuffer:void 0,Qt=Vu||Lu,ku="[object Arguments]",Uu="[object Array]",Bu="[object Boolean]",zu="[object Date]",Gu="[object Error]",Hu="[object Function]",qu="[object Map]",Ju="[object Number]",Wu="[object Object]",Qu="[object RegExp]",Yu="[object Set]",Ku="[object String]",Xu="[object WeakMap]",Zu="[object ArrayBuffer]",tl="[object DataView]",el="[object Float32Array]",rl="[object Float64Array]",nl="[object Int8Array]",ol="[object Int16Array]",al="[object Int32Array]",sl="[object Uint8Array]",il="[object Uint8ClampedArray]",cl="[object Uint16Array]",ul="[object Uint32Array]",P={};P[el]=P[rl]=P[nl]=P[ol]=P[al]=P[sl]=P[il]=P[cl]=P[ul]=!0,P[ku]=P[Uu]=P[Zu]=P[Bu]=P[tl]=P[zu]=P[Gu]=P[Hu]=P[qu]=P[Ju]=P[Wu]=P[Qu]=P[Yu]=P[Ku]=P[Xu]=!1;function ll(t){return X(t)&&Qe(t.length)&&!!P[ft(t)]}function Ke(t){return function(e){return t(e)}}var ro=typeof S=="object"&&S&&!S.nodeType&&S,Yt=ro&&typeof module=="object"&&module&&!module.nodeType&&module,fl=Yt&&Yt.exports===ro,Xe=fl&&Fn.process,Tt=function(){try{var t=Yt&&Yt.require&&Yt.require("util").types;return t||Xe&&Xe.binding&&Xe.binding("util")}catch{}}(),no=Tt&&Tt.isTypedArray,Ze=no?Ke(no):ll,dl=Object.prototype,pl=dl.hasOwnProperty;function oo(t,e){var r=F(t),n=!r&&Wt(t),o=!r&&!n&&Qt(t),a=!r&&!n&&!o&&Ze(t),s=r||n||o||a,i=s?Iu(t.length,String):[],c=i.length;for(var u in t)(e||pl.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 ao(t,e){return function(r){return t(e(r))}}var hl=ao(Object.keys,Object),ml=Object.prototype,gl=ml.hasOwnProperty;function vl(t){if(!Ye(t))return hl(t);var e=[];for(var r in Object(t))gl.call(t,r)&&r!="constructor"&&e.push(r);return e}function me(t){return he(t)?oo(t):vl(t)}function yl(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var bl=Object.prototype,_l=bl.hasOwnProperty;function Sl(t){if(!q(t))return yl(t);var e=Ye(t),r=[];for(var n in t)n=="constructor"&&(e||!_l.call(t,n))||r.push(n);return r}function Kt(t){return he(t)?oo(t,!0):Sl(t)}var Cl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ol=/^\w*$/;function tr(t,e){if(F(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ue(t)?!0:Ol.test(t)||!Cl.test(t)||e!=null&&t in Object(e)}var Xt=pt(Object,"create");function jl(){this.__data__=Xt?Xt(null):{},this.size=0}function wl(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var El="__lodash_hash_undefined__",Nl=Object.prototype,$l=Nl.hasOwnProperty;function Tl(t){var e=this.__data__;if(Xt){var r=e[t];return r===El?void 0:r}return $l.call(e,t)?e[t]:void 0}var Al=Object.prototype,xl=Al.hasOwnProperty;function Ml(t){var e=this.__data__;return Xt?e[t]!==void 0:xl.call(e,t)}var Il="__lodash_hash_undefined__";function Rl(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Xt&&e===void 0?Il: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=jl,ht.prototype.delete=wl,ht.prototype.get=Tl,ht.prototype.has=Ml,ht.prototype.set=Rl;function Pl(){this.__data__=[],this.size=0}function ge(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}var Dl=Array.prototype,Ll=Dl.splice;function Fl(t){var e=this.__data__,r=ge(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ll.call(e,r,1),--this.size,!0}function Vl(t){var e=this.__data__,r=ge(e,t);return r<0?void 0:e[r][1]}function kl(t){return ge(this.__data__,t)>-1}function Ul(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 nt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}nt.prototype.clear=Pl,nt.prototype.delete=Fl,nt.prototype.get=Vl,nt.prototype.has=kl,nt.prototype.set=Ul;var Zt=pt(K,"Map");function Bl(){this.size=0,this.__data__={hash:new ht,map:new(Zt||nt),string:new ht}}function zl(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ve(t,e){var r=t.__data__;return zl(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Gl(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e}function Hl(t){return ve(this,t).get(t)}function ql(t){return ve(this,t).has(t)}function Jl(t,e){var r=ve(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function ot(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=Bl,ot.prototype.delete=Gl,ot.prototype.get=Hl,ot.prototype.has=ql,ot.prototype.set=Jl;var Wl="Expected a function";function er(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Wl);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(er.Cache||ot),r}er.Cache=ot;var Ql=500;function Yl(t){var e=er(t,function(n){return r.size===Ql&&r.clear(),n}),r=e.cache;return e}var Kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xl=/\\(\\)?/g,Zl=Yl(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Kl,function(r,n,o,a){e.push(o?a.replace(Xl,"$1"):n||r)}),e});function tf(t){return t==null?"":zn(t)}function At(t,e){return F(t)?t:tr(t,e)?[t]:Zl(tf(t))}function xt(t){if(typeof t=="string"||Ue(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ye(t,e){e=At(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[xt(e[r++])];return r&&r==n?t:void 0}function so(t,e,r){var n=t==null?void 0:ye(t,e);return n===void 0?r:n}function rr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var io=G?G.isConcatSpreadable:void 0;function ef(t){return F(t)||Wt(t)||!!(io&&t&&t[io])}function co(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=ef),o||(o=[]);++a<s;){var i=t[a];r(i)?rr(o,i):n||(o[o.length]=i)}return o}function rf(t){var e=t==null?0:t.length;return e?co(t):[]}function nf(t){return Jn(Qn(t,void 0,rf),t+"")}var nr=ao(Object.getPrototypeOf,Object),of="[object Object]",af=Function.prototype,sf=Object.prototype,uo=af.toString,cf=sf.hasOwnProperty,uf=uo.call(Object);function V(t){if(!X(t)||ft(t)!=of)return!1;var e=nr(t);if(e===null)return!0;var r=cf.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&uo.call(r)==uf}function lf(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 ff(){this.__data__=new nt,this.size=0}function df(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function pf(t){return this.__data__.get(t)}function hf(t){return this.__data__.has(t)}var mf=200;function gf(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Zt||n.length<mf-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ot(n)}return r.set(t,e),this.size=r.size,this}function J(t){var e=this.__data__=new nt(t);this.size=e.size}J.prototype.clear=ff,J.prototype.delete=df,J.prototype.get=pf,J.prototype.has=hf,J.prototype.set=gf;function vf(t,e){return t&&$t(e,me(e),t)}function yf(t,e){return t&&$t(e,Kt(e),t)}var lo=typeof S=="object"&&S&&!S.nodeType&&S,fo=lo&&typeof module=="object"&&module&&!module.nodeType&&module,bf=fo&&fo.exports===lo,po=bf?K.Buffer:void 0,ho=po?po.allocUnsafe:void 0;function mo(t,e){if(e)return t.slice();var r=t.length,n=ho?ho(r):new t.constructor(r);return t.copy(n),n}function _f(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 go(){return[]}var Sf=Object.prototype,Cf=Sf.propertyIsEnumerable,vo=Object.getOwnPropertySymbols,or=vo?function(t){return t==null?[]:(t=Object(t),_f(vo(t),function(e){return Cf.call(t,e)}))}:go;function Of(t,e){return $t(t,or(t),e)}var jf=Object.getOwnPropertySymbols,yo=jf?function(t){for(var e=[];t;)rr(e,or(t)),t=nr(t);return e}:go;function wf(t,e){return $t(t,yo(t),e)}function bo(t,e,r){var n=e(t);return F(t)?n:rr(n,r(t))}function ar(t){return bo(t,me,or)}function sr(t){return bo(t,Kt,yo)}var ir=pt(K,"DataView"),cr=pt(K,"Promise"),Mt=pt(K,"Set"),_o="[object Map]",Ef="[object Object]",So="[object Promise]",Co="[object Set]",Oo="[object WeakMap]",jo="[object DataView]",Nf=dt(ir),$f=dt(Zt),Tf=dt(cr),Af=dt(Mt),xf=dt(qe),W=ft;(ir&&W(new ir(new ArrayBuffer(1)))!=jo||Zt&&W(new Zt)!=_o||cr&&W(cr.resolve())!=So||Mt&&W(new Mt)!=Co||qe&&W(new qe)!=Oo)&&(W=function(t){var e=ft(t),r=e==Ef?t.constructor:void 0,n=r?dt(r):"";if(n)switch(n){case Nf:return jo;case $f:return _o;case Tf:return So;case Af:return Co;case xf:return Oo}return e});var Mf=Object.prototype,If=Mf.hasOwnProperty;function Rf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&If.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var be=K.Uint8Array;function ur(t){var e=new t.constructor(t.byteLength);return new be(e).set(new be(t)),e}function Pf(t,e){var r=e?ur(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Df=/\w*$/;function Lf(t){var e=new t.constructor(t.source,Df.exec(t));return e.lastIndex=t.lastIndex,e}var wo=G?G.prototype:void 0,Eo=wo?wo.valueOf:void 0;function Ff(t){return Eo?Object(Eo.call(t)):{}}function No(t,e){var r=e?ur(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Vf="[object Boolean]",kf="[object Date]",Uf="[object Map]",Bf="[object Number]",zf="[object RegExp]",Gf="[object Set]",Hf="[object String]",qf="[object Symbol]",Jf="[object ArrayBuffer]",Wf="[object DataView]",Qf="[object Float32Array]",Yf="[object Float64Array]",Kf="[object Int8Array]",Xf="[object Int16Array]",Zf="[object Int32Array]",td="[object Uint8Array]",ed="[object Uint8ClampedArray]",rd="[object Uint16Array]",nd="[object Uint32Array]";function od(t,e,r){var n=t.constructor;switch(e){case Jf:return ur(t);case Vf:case kf:return new n(+t);case Wf:return Pf(t,r);case Qf:case Yf:case Kf:case Xf:case Zf:case td:case ed:case rd:case nd:return No(t,r);case Uf:return new n;case Bf:case Hf:return new n(t);case zf:return Lf(t);case Gf:return new n;case qf:return Ff(t)}}function $o(t){return typeof t.constructor=="function"&&!Ye(t)?lu(nr(t)):{}}var ad="[object Map]";function sd(t){return X(t)&&W(t)==ad}var To=Tt&&Tt.isMap,id=To?Ke(To):sd,cd="[object Set]";function ud(t){return X(t)&&W(t)==cd}var Ao=Tt&&Tt.isSet,ld=Ao?Ke(Ao):ud,fd=1,dd=2,pd=4,xo="[object Arguments]",hd="[object Array]",md="[object Boolean]",gd="[object Date]",vd="[object Error]",Mo="[object Function]",yd="[object GeneratorFunction]",bd="[object Map]",_d="[object Number]",Io="[object Object]",Sd="[object RegExp]",Cd="[object Set]",Od="[object String]",jd="[object Symbol]",wd="[object WeakMap]",Ed="[object ArrayBuffer]",Nd="[object DataView]",$d="[object Float32Array]",Td="[object Float64Array]",Ad="[object Int8Array]",xd="[object Int16Array]",Md="[object Int32Array]",Id="[object Uint8Array]",Rd="[object Uint8ClampedArray]",Pd="[object Uint16Array]",Dd="[object Uint32Array]",I={};I[xo]=I[hd]=I[Ed]=I[Nd]=I[md]=I[gd]=I[$d]=I[Td]=I[Ad]=I[xd]=I[Md]=I[bd]=I[_d]=I[Io]=I[Sd]=I[Cd]=I[Od]=I[jd]=I[Id]=I[Rd]=I[Pd]=I[Dd]=!0,I[vd]=I[Mo]=I[wd]=!1;function te(t,e,r,n,o,a){var s,i=e&fd,c=e&dd,u=e&pd;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!q(t))return t;var f=F(t);if(f){if(s=Rf(t),!i)return qn(t,s)}else{var l=W(t),d=l==Mo||l==yd;if(Qt(t))return mo(t,i);if(l==Io||l==xo||d&&!o){if(s=c||d?{}:$o(t),!i)return c?wf(t,yf(s,t)):Of(t,vf(s,t))}else{if(!I[l])return o?t:{};s=od(t,l,i)}}a||(a=new J);var p=a.get(t);if(p)return p;a.set(t,s),ld(t)?t.forEach(function(h){s.add(te(h,e,r,h,t,a))}):id(t)&&t.forEach(function(h,m){s.set(m,te(h,e,r,m,t,a))});var b=u?c?sr:ar:c?Kt:me,O=f?void 0:b(t);return bu(O||t,function(h,m){O&&(m=h,h=t[m]),We(s,m,te(h,e,r,m,t,a))}),s}var Ld=1,Fd=4;function Ro(t){return te(t,Ld|Fd)}var Vd="__lodash_hash_undefined__";function kd(t){return this.__data__.set(t,Vd),this}function Ud(t){return this.__data__.has(t)}function ee(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new ot;++e<r;)this.add(t[e])}ee.prototype.add=ee.prototype.push=kd,ee.prototype.has=Ud;function Bd(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 Po(t,e){return t.has(e)}var zd=1,Gd=2;function Do(t,e,r,n,o,a){var s=r&zd,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),f=a.get(e);if(u&&f)return u==e&&f==t;var l=-1,d=!0,p=r&Gd?new ee:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var b=t[l],O=e[l];if(n)var h=s?n(O,b,l,e,t,a):n(b,O,l,t,e,a);if(h!==void 0){if(h)continue;d=!1;break}if(p){if(!Bd(e,function(m,v){if(!Po(p,v)&&(b===m||o(b,m,r,n,a)))return p.push(v)})){d=!1;break}}else if(!(b===O||o(b,O,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function Hd(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function lr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var qd=1,Jd=2,Wd="[object Boolean]",Qd="[object Date]",Yd="[object Error]",Kd="[object Map]",Xd="[object Number]",Zd="[object RegExp]",tp="[object Set]",ep="[object String]",rp="[object Symbol]",np="[object ArrayBuffer]",op="[object DataView]",Lo=G?G.prototype:void 0,fr=Lo?Lo.valueOf:void 0;function ap(t,e,r,n,o,a,s){switch(r){case op:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case np:return!(t.byteLength!=e.byteLength||!a(new be(t),new be(e)));case Wd:case Qd:case Xd:return Jt(+t,+e);case Yd:return t.name==e.name&&t.message==e.message;case Zd:case ep:return t==e+"";case Kd:var i=Hd;case tp:var c=n&qd;if(i||(i=lr),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Jd,s.set(t,e);var f=Do(i(t),i(e),n,o,a,s);return s.delete(t),f;case rp:if(fr)return fr.call(t)==fr.call(e)}return!1}var sp=1,ip=Object.prototype,cp=ip.hasOwnProperty;function up(t,e,r,n,o,a){var s=r&sp,i=ar(t),c=i.length,u=ar(e),f=u.length;if(c!=f&&!s)return!1;for(var l=c;l--;){var d=i[l];if(!(s?d in e:cp.call(e,d)))return!1}var p=a.get(t),b=a.get(e);if(p&&b)return p==e&&b==t;var O=!0;a.set(t,e),a.set(e,t);for(var h=s;++l<c;){d=i[l];var m=t[d],v=e[d];if(n)var g=s?n(v,m,d,e,t,a):n(m,v,d,t,e,a);if(!(g===void 0?m===v||o(m,v,r,n,a):g)){O=!1;break}h||(h=d=="constructor")}if(O&&!h){var _=t.constructor,j=e.constructor;_!=j&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof j=="function"&&j instanceof j)&&(O=!1)}return a.delete(t),a.delete(e),O}var lp=1,Fo="[object Arguments]",Vo="[object Array]",_e="[object Object]",fp=Object.prototype,ko=fp.hasOwnProperty;function dp(t,e,r,n,o,a){var s=F(t),i=F(e),c=s?Vo:W(t),u=i?Vo:W(e);c=c==Fo?_e:c,u=u==Fo?_e:u;var f=c==_e,l=u==_e,d=c==u;if(d&&Qt(t)){if(!Qt(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new J),s||Ze(t)?Do(t,e,r,n,o,a):ap(t,e,c,r,n,o,a);if(!(r&lp)){var p=f&&ko.call(t,"__wrapped__"),b=l&&ko.call(e,"__wrapped__");if(p||b){var O=p?t.value():t,h=b?e.value():e;return a||(a=new J),o(O,h,r,n,a)}}return d?(a||(a=new J),up(t,e,r,n,o,a)):!1}function dr(t,e,r,n,o){return t===e?!0:t==null||e==null||!X(t)&&!X(e)?t!==t&&e!==e:dp(t,e,r,n,dr,o)}var pp=1,hp=2;function mp(t,e,r,n){var o=r.length,a=o;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var i=s[0],c=t[i],u=s[1];if(s[2]){if(c===void 0&&!(i in t))return!1}else{var f=new J,l;if(!(l===void 0?dr(u,c,pp|hp,n,f):l))return!1}}return!0}function Uo(t){return t===t&&!q(t)}function gp(t){for(var e=me(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Uo(o)]}return e}function Bo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function vp(t){var e=gp(t);return e.length==1&&e[0][2]?Bo(e[0][0],e[0][1]):function(r){return r===t||mp(r,t,e)}}function yp(t,e){return t!=null&&e in Object(t)}function bp(t,e,r){e=At(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=xt(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&&Qe(o)&&pe(s,o)&&(F(t)||Wt(t)))}function _p(t,e){return t!=null&&bp(t,e,yp)}var Sp=1,Cp=2;function Op(t,e){return tr(t)&&Uo(e)?Bo(xt(t),e):function(r){var n=so(r,t);return n===void 0&&n===e?_p(r,t):dr(e,n,Sp|Cp)}}function jp(t){return function(e){return e==null?void 0:e[t]}}function wp(t){return function(e){return ye(e,t)}}function Ep(t){return tr(t)?jp(xt(t)):wp(t)}function pr(t){return typeof t=="function"?t:t==null?ze:typeof t=="object"?F(t)?Op(t[0],t[1]):vp(t):Ep(t)}function Np(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var $p=Np();function hr(t,e,r){(r!==void 0&&!Jt(t[e],r)||r===void 0&&!(e in t))&&Je(t,e,r)}function mr(t){return X(t)&&he(t)}function gr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Tp(t){return $t(t,Kt(t))}function Ap(t,e,r,n,o,a,s){var i=gr(t,r),c=gr(e,r),u=s.get(c);if(u){hr(t,r,u);return}var f=a?a(i,c,r+"",t,e,s):void 0,l=f===void 0;if(l){var d=F(c),p=!d&&Qt(c),b=!d&&!p&&Ze(c);f=c,d||p||b?F(i)?f=i:mr(i)?f=qn(i):p?(l=!1,f=mo(c,!0)):b?(l=!1,f=No(c,!0)):f=[]:V(c)||Wt(c)?(f=i,Wt(i)?f=Tp(i):(!q(i)||Ge(i))&&(f=$o(c))):l=!1}l&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),hr(t,r,f)}function zo(t,e,r,n,o){t!==e&&$p(e,function(a,s){if(o||(o=new J),q(a))Ap(t,e,s,r,zo,n,o);else{var i=n?n(gr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),hr(t,s,i)}},Kt)}function Go(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function xp(t,e){return e.length<2?t:ye(t,lf(e,0,-1))}var Ho=xu(function(t,e,r){zo(t,e,r)}),Mp="Expected a function";function Ip(t){if(typeof t!="function")throw new TypeError(Mp);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 Rp(t,e){return e=At(e,t),t=xp(t,e),t==null||delete t[xt(Go(e))]}function Pp(t){return V(t)?void 0:t}var Dp=1,Lp=2,Fp=4,qo=nf(function(t,e){var r={};if(t==null)return r;var n=!1;e=Be(e,function(a){return a=At(a,t),n||(n=a.length>1),a}),$t(t,sr(t),r),n&&(r=te(r,Dp|Lp|Fp,Pp));for(var o=e.length;o--;)Rp(r,e[o]);return r});function Vp(t,e,r,n){if(!q(t))return t;e=At(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=xt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var f=i[c];u=void 0,u===void 0&&(u=q(f)?f:pe(e[o+1])?[]:{})}We(i,c,u),i=i[c]}return t}function kp(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=ye(t,s);r(i,s)&&Vp(a,At(s,t),i)}return a}function Up(t,e){if(t==null)return{};var r=Be(sr(t),function(n){return[n]});return e=pr(e),kp(t,r,function(n,o){return e(n,o[0])})}function Bp(t,e){return Up(t,Ip(pr(e)))}var zp=1/0,Gp=Mt&&1/lr(new Mt([,-0]))[1]==zp?function(t){return new Mt(t)}:du,Hp=200;function qp(t,e,r){var n=-1,o=ju,a=t.length,s=!0,i=[],c=i;if(a>=Hp){var u=e?null:Gp(t);if(u)return lr(u);s=!1,o=Po,c=new ee}else c=e?[]:i;t:for(;++n<a;){var f=t[n],l=e?e(f):f;if(f=f!==0?f:0,s&&l===l){for(var d=c.length;d--;)if(c[d]===l)continue t;e&&c.push(l),i.push(f)}else o(c,l,r)||(c!==i&&c.push(l),i.push(f))}return i}var Jp=Yn(function(t){var e=Go(t);return mr(e)&&(e=void 0),qp(co(t,1,mr,!0),pr(e))});class Jo 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 Wp(t){return Q(t)&&typeof t[Symbol.iterator]=="function"}function Q(t){return typeof t=="object"&&t!=null}function U(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Qp(t){const{done:e,value:r}=t.next();return e?void 0:r}function Yp(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*Wo(t,e,r,n){Wp(t)||(t=[t]);for(const o of t){const a=Yp(o,e,r,n);a&&(yield a)}}function*vr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&Q(e.schema)&&Q(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,f,l]of e.entries(t,i)){const d=vr(f,l,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,f],coerce:a,mask:s});for(const p of d)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):a&&(f=p[1],u===void 0?t=f:t instanceof Map?t.set(u,f):t instanceof Set?t.add(f):Q(t)&&(f!==void 0||u in t)&&(t[u]=f))}if(c!=="not_valid")for(const u of e.refiner(t,i))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class Z{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,u)=>{const f=o(c,u);return Wo(f,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const f=a(c,u);return Wo(f,u,this,c)}:this.refiner=()=>[]}assert(e){return Qo(e,this)}create(e){return Kp(e,this)}is(e){return Zp(e,this)}mask(e){return Xp(e,this)}validate(e,r){return r===void 0&&(r={}),It(e,this,r)}}function Qo(t,e){const r=It(t,e);if(r[0])throw r[0]}function Kp(t,e){const r=It(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function Xp(t,e){const r=It(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function Zp(t,e){return!It(t,e)[0]}function It(t,e,r){r===void 0&&(r={});const n=vr(t,e,r),o=Qp(n);return o[0]?[new Jo(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function yr(){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?Zo(a):x(a)}function st(t,e){return new Z({type:t,schema:null,validator:e})}function Rt(t){return new Z({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Yo(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Zo(n);default:return x(n)}}function M(){return st("any",()=>!0)}function D(t){return new Z({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${U(e)}`}})}function mt(){return st("boolean",t=>typeof t=="boolean")}function br(t){const e={},r=t.map(n=>U(n)).join();for(const n of t)e[n]=n;return new Z({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${U(n)}`}})}function Ko(){return st("func",t=>typeof t=="function"||`Expected a function, but received: ${U(t)}`)}function B(t){const e=U(t),r=typeof t;return new Z({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${U(n)}`}})}function th(){return st("never",()=>!1)}function Xo(){return st("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${U(t)}`)}function x(t){const e=t?Object.keys(t):[],r=th();return new Z({type:"object",schema:t||null,*entries(n){if(t&&Q(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return Q(n)||`Expected an object, but received: ${U(n)}`},coercer(n){return Q(n)?{...n}:n}})}function y(t){return new Z({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function re(t,e){return new Z({type:"record",schema:null,*entries(r){if(Q(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return Q(r)||`Expected an object, but received: ${U(r)}`}})}function C(){return st("string",t=>typeof t=="string"||`Expected a string, but received: ${U(t)}`)}function Zo(t){const e=Object.keys(t);return new Z({type:"type",schema:t,*entries(r){if(Q(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Q(r)||`Expected an object, but received: ${U(r)}`}})}function z(t){const e=t.map(r=>r.type).join(" | ");return new Z({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||eh()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=vr(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 eh(){return st("unknown",()=>!0)}const _r=x({package:C(),version:C(),name:C(),exportName:y(C()),destructuring:y(mt()),subName:y(C()),main:y(C()),cssPaths:y(D(C()))}),rh=D(_r),nh=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var k=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(k||{}),Sr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Sr||{}),Cr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Cr||{});const oh=()=>st("normalObj",t=>!V(t)||[k.SLOT,k.EXPRESSION,k.FUNCTION].includes(t==null?void 0:t.type)?!1:(It(t,re(C(),Or)),!0)),Or=z([C(),Xo(),mt(),x({type:B(k.SLOT),renderType:br([Cr.FUNC,Cr.COMP]),params:y(D(C())),value:Rt(()=>z([Pt,D(Pt)]))}),x({type:B(k.EXPRESSION),value:C()}),x({type:B(k.FUNCTION),value:C()}),x({type:B(k.ACTION),handler:M()}),oh(),D(Rt(()=>Or))]);var ta=(t=>(t.COMPONENTS="COMPONENTS",t))(ta||{});const ea=x({type:B(k.EXPRESSION),value:C()}),Pt=x({id:y(C()),title:y(C()),componentName:C(),props:y(re(C(),Or)),nodeName:y(C()),state:y(re(C(),M())),children:Rt(()=>y(D(z([C(),Pt])))),eventListener:y(D(M())),configure:y(M()),css:y(M()),style:y(M()),classNames:y(D(M())),refId:y(C()),extra:y(re(M(),M())),condition:y(z([mt(),ea])),loop:y(x({open:mt(),data:z([D(M()),ea]),args:y(D(C())),forName:y(C()),forIndex:y(C()),key:y(M()),name:y(C())})),injectEnvList:y(D(M())),methods:y(D(M()))}),Se=z([C(),x({label:C(),tip:y(C())})]),ah=x({type:B("shape"),value:D(x({name:C(),title:Se,valueType:Rt(()=>Ce)}))}),sh=x({type:B("enums"),value:D(C())});x({type:B("array"),value:Rt(()=>Ce)});const ih=x({type:B("array"),value:Rt(()=>D(Ce))}),Ce=z([br(["array","boolean","number","object","string"]),br(["component","expression","function"]),ah,sh,ih]),ch=z([C(),x({componentName:C(),props:y(M()),initialValue:y(M()),component:y(M()),hiddenLabel:y(mt())})]),jr=x({name:C(),title:Se,valueType:Ce,description:y(C()),defaultValue:M(),setters:y(D(ch)),condition:y(Ko())});z([C(),Ko()]);var wr=(t=>(t.SINGLE="single",t.GROUP="group",t))(wr||{});z([C(),x({event:C(),name:y(C()),describe:y(C()),params:y(D(x({name:C(),description:C(),example:C()}))),template:y(C())})]);const uh=x({id:y(C()),title:C(),snapshot:z([C(),M()]),snapshotText:y(C()),description:y(C()),tags:y(D(C())),groupName:y(C()),category:y(C()),schema:yr(Yo(Pt,["id"]),x({componentName:y(C())}))}),lh=x({componentName:C(),title:C(),screenshot:y(C()),icon:y(C()),tags:y(D(C())),groupName:y(C()),category:y(C()),priority:y(Xo()),npm:y(_r),snippets:D(uh),props:D(z([jr,x({title:y(Se),type:B("single"),content:jr}),x({title:y(Se),type:B("group"),content:D(jr)})])),events:y(M()),methods:y(M()),fixedProps:y(M()),isContainer:y(z([mt(),x({placeholder:C(),width:C(),height:C()})])),disableEditorDragDom:y(M()),isLayout:y(mt()),rootSelector:y(C()),advanceCustom:y(M()),extra:y(re(M(),M()))}),fh=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}
52
+ `,new Function(l)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(g){console.log(l),console.warn(g)}}}[c]},Ye=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},oo=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((s,i)=>i!==0?Fc(s):s)),e[a.join("")]=n}),e},qu=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},Ju=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o,o.__esModule&&o.default&&(r[n.globalName]=o.default))}}),r},Wu=(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},ao=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},so=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Ku=(t,e)=>so(t,e),Qu=(t,e)=>so(t,e),Xe=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},io=(t,e)=>{const r=t.split(".");let n,o=e;return r.forEach(a=>{n=o==null?void 0:o[a],o=n}),n||(()=>`Component [${t}] not found`)},Ze=(t,e)=>{const r={...t};return r.__proto__=e,r},Yu={},co=t=>{let e;const r=new Set,n=(d,l)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const h=e;e=l??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(g=>g(e,h))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Yu?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=e=t(n,o,c);return c},Xu=t=>t?co(t):co;class Zu{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=Xu(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class tl{constructor(){w(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 tr{constructor(){w(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()}}var el=Object.defineProperty,rl=(t,e,r)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>rl(t,typeof e!="symbol"?e+"":e,r),uo=typeof global=="object"&&global&&global.Object===Object&&global,nl=typeof self=="object"&&self&&self.Object===Object&&self,Z=uo||nl||Function("return this")(),z=Z.Symbol,lo=Object.prototype,ol=lo.hasOwnProperty,al=lo.toString,Yt=z?z.toStringTag:void 0;function sl(t){var e=ol.call(t,Yt),r=t[Yt];try{t[Yt]=void 0;var n=!0}catch{}var o=al.call(t);return n&&(e?t[Yt]=r:delete t[Yt]),o}var il=Object.prototype,cl=il.toString;function ul(t){return cl.call(t)}var ll="[object Null]",fl="[object Undefined]",fo=z?z.toStringTag:void 0;function Ot(t){return t==null?t===void 0?fl:ll:fo&&fo in Object(t)?sl(t):ul(t)}function tt(t){return t!=null&&typeof t=="object"}var dl="[object Symbol]";function er(t){return typeof t=="symbol"||tt(t)&&Ot(t)==dl}function rr(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 F=Array.isArray,po=z?z.prototype:void 0,ho=po?po.toString:void 0;function go(t){if(typeof t=="string")return t;if(F(t))return rr(t,go)+"";if(er(t))return ho?ho.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function J(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nr(t){return t}var pl="[object AsyncFunction]",hl="[object Function]",gl="[object GeneratorFunction]",ml="[object Proxy]";function or(t){if(!J(t))return!1;var e=Ot(t);return e==hl||e==gl||e==pl||e==ml}var ar=Z["__core-js_shared__"],mo=function(){var t=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vl(t){return!!mo&&mo in t}var yl=Function.prototype,bl=yl.toString;function Ct(t){if(t!=null){try{return bl.call(t)}catch{}try{return t+""}catch{}}return""}var _l=/[\\^$.*+?()[\]{}|]/g,Sl=/^\[object .+?Constructor\]$/,Ol=Function.prototype,Cl=Object.prototype,El=Ol.toString,wl=Cl.hasOwnProperty,Nl=RegExp("^"+El.call(wl).replace(_l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $l(t){if(!J(t)||vl(t))return!1;var e=or(t)?Nl:Sl;return e.test(Ct(t))}function jl(t,e){return t==null?void 0:t[e]}function Et(t,e){var r=jl(t,e);return $l(r)?r:void 0}var sr=Et(Z,"WeakMap"),vo=Object.create,Al=function(){function t(){}return function(e){if(!J(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Tl(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 Ml(){}function yo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pl=800,xl=16,Rl=Date.now;function Il(t){var e=0,r=0;return function(){var n=Rl(),o=xl-(n-r);if(r=n,o>0){if(++e>=Pl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Dl(t){return function(){return t}}var Se=function(){try{var t=Et(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ll=Se?function(t,e){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Dl(e),writable:!0})}:nr,bo=Il(Ll);function Fl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function Vl(t,e,r,n){for(var o=t.length,a=r+-1;++a<o;)if(e(t[a],a,t))return a;return-1}function Ul(t){return t!==t}function Bl(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function Gl(t,e,r){return e===e?Bl(t,e,r):Vl(t,Ul,r)}function kl(t,e){var r=t==null?0:t.length;return!!r&&Gl(t,e,0)>-1}var Hl=9007199254740991,zl=/^(?:0|[1-9]\d*)$/;function Oe(t,e){var r=typeof t;return e=e??Hl,!!e&&(r=="number"||r!="symbol"&&zl.test(t))&&t>-1&&t%1==0&&t<e}function ir(t,e,r){e=="__proto__"&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Xt(t,e){return t===e||t!==t&&e!==e}var ql=Object.prototype,Jl=ql.hasOwnProperty;function cr(t,e,r){var n=t[e];(!(Jl.call(t,e)&&Xt(n,r))||r===void 0&&!(e in t))&&ir(t,e,r)}function Rt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?ir(r,i,c):cr(r,i,c)}return r}var _o=Math.max;function So(t,e,r){return e=_o(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=_o(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Tl(t,this,i)}}function Oo(t,e){return bo(So(t,e,nr),t+"")}var Wl=9007199254740991;function ur(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wl}function Ce(t){return t!=null&&ur(t.length)&&!or(t)}function Kl(t,e,r){if(!J(r))return!1;var n=typeof e;return(n=="number"?Ce(r)&&Oe(e,r.length):n=="string"&&e in r)?Xt(r[e],t):!1}function Ql(t){return Oo(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&&Kl(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 Yl=Object.prototype;function lr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Yl;return t===r}function Xl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Zl="[object Arguments]";function Co(t){return tt(t)&&Ot(t)==Zl}var Eo=Object.prototype,tf=Eo.hasOwnProperty,ef=Eo.propertyIsEnumerable,Zt=Co(function(){return arguments}())?Co:function(t){return tt(t)&&tf.call(t,"callee")&&!ef.call(t,"callee")};function rf(){return!1}var wo=typeof C=="object"&&C&&!C.nodeType&&C,No=wo&&typeof module=="object"&&module&&!module.nodeType&&module,nf=No&&No.exports===wo,$o=nf?Z.Buffer:void 0,of=$o?$o.isBuffer:void 0,te=of||rf,af="[object Arguments]",sf="[object Array]",cf="[object Boolean]",uf="[object Date]",lf="[object Error]",ff="[object Function]",df="[object Map]",pf="[object Number]",hf="[object Object]",gf="[object RegExp]",mf="[object Set]",vf="[object String]",yf="[object WeakMap]",bf="[object ArrayBuffer]",_f="[object DataView]",Sf="[object Float32Array]",Of="[object Float64Array]",Cf="[object Int8Array]",Ef="[object Int16Array]",wf="[object Int32Array]",Nf="[object Uint8Array]",$f="[object Uint8ClampedArray]",jf="[object Uint16Array]",Af="[object Uint32Array]",I={};I[Sf]=I[Of]=I[Cf]=I[Ef]=I[wf]=I[Nf]=I[$f]=I[jf]=I[Af]=!0,I[af]=I[sf]=I[bf]=I[cf]=I[_f]=I[uf]=I[lf]=I[ff]=I[df]=I[pf]=I[hf]=I[gf]=I[mf]=I[vf]=I[yf]=!1;function Tf(t){return tt(t)&&ur(t.length)&&!!I[Ot(t)]}function fr(t){return function(e){return t(e)}}var jo=typeof C=="object"&&C&&!C.nodeType&&C,ee=jo&&typeof module=="object"&&module&&!module.nodeType&&module,Mf=ee&&ee.exports===jo,dr=Mf&&uo.process,It=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||dr&&dr.binding&&dr.binding("util")}catch{}}(),Ao=It&&It.isTypedArray,pr=Ao?fr(Ao):Tf,Pf=Object.prototype,xf=Pf.hasOwnProperty;function To(t,e){var r=F(t),n=!r&&Zt(t),o=!r&&!n&&te(t),a=!r&&!n&&!o&&pr(t),s=r||n||o||a,i=s?Xl(t.length,String):[],c=i.length;for(var u in t)(e||xf.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Oe(u,c)))&&i.push(u);return i}function Mo(t,e){return function(r){return t(e(r))}}var Rf=Mo(Object.keys,Object),If=Object.prototype,Df=If.hasOwnProperty;function Lf(t){if(!lr(t))return Rf(t);var e=[];for(var r in Object(t))Df.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ee(t){return Ce(t)?To(t):Lf(t)}function Ff(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Vf=Object.prototype,Uf=Vf.hasOwnProperty;function Bf(t){if(!J(t))return Ff(t);var e=lr(t),r=[];for(var n in t)n=="constructor"&&(e||!Uf.call(t,n))||r.push(n);return r}function re(t){return Ce(t)?To(t,!0):Bf(t)}var Gf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kf=/^\w*$/;function hr(t,e){if(F(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||er(t)?!0:kf.test(t)||!Gf.test(t)||e!=null&&t in Object(e)}var ne=Et(Object,"create");function Hf(){this.__data__=ne?ne(null):{},this.size=0}function zf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qf="__lodash_hash_undefined__",Jf=Object.prototype,Wf=Jf.hasOwnProperty;function Kf(t){var e=this.__data__;if(ne){var r=e[t];return r===qf?void 0:r}return Wf.call(e,t)?e[t]:void 0}var Qf=Object.prototype,Yf=Qf.hasOwnProperty;function Xf(t){var e=this.__data__;return ne?e[t]!==void 0:Yf.call(e,t)}var Zf="__lodash_hash_undefined__";function td(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ne&&e===void 0?Zf:e,this}function wt(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])}}wt.prototype.clear=Hf,wt.prototype.delete=zf,wt.prototype.get=Kf,wt.prototype.has=Xf,wt.prototype.set=td;function ed(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}var rd=Array.prototype,nd=rd.splice;function od(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():nd.call(e,r,1),--this.size,!0}function ad(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function sd(t){return we(this.__data__,t)>-1}function id(t,e){var r=this.__data__,n=we(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function st(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])}}st.prototype.clear=ed,st.prototype.delete=od,st.prototype.get=ad,st.prototype.has=sd,st.prototype.set=id;var oe=Et(Z,"Map");function cd(){this.size=0,this.__data__={hash:new wt,map:new(oe||st),string:new wt}}function ud(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ne(t,e){var r=t.__data__;return ud(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ld(t){var e=Ne(this,t).delete(t);return this.size-=e?1:0,e}function fd(t){return Ne(this,t).get(t)}function dd(t){return Ne(this,t).has(t)}function pd(t,e){var r=Ne(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function it(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])}}it.prototype.clear=cd,it.prototype.delete=ld,it.prototype.get=fd,it.prototype.has=dd,it.prototype.set=pd;var hd="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(hd);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(gr.Cache||it),r}gr.Cache=it;var gd=500;function md(t){var e=gr(t,function(n){return r.size===gd&&r.clear(),n}),r=e.cache;return e}var vd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yd=/\\(\\)?/g,bd=md(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vd,function(r,n,o,a){e.push(o?a.replace(yd,"$1"):n||r)}),e});function _d(t){return t==null?"":go(t)}function Dt(t,e){return F(t)?t:hr(t,e)?[t]:bd(_d(t))}function Lt(t){if(typeof t=="string"||er(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function $e(t,e){e=Dt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lt(e[r++])];return r&&r==n?t:void 0}function Po(t,e,r){var n=t==null?void 0:$e(t,e);return n===void 0?r:n}function mr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var xo=z?z.isConcatSpreadable:void 0;function Sd(t){return F(t)||Zt(t)||!!(xo&&t&&t[xo])}function Ro(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Sd),o||(o=[]);++a<s;){var i=t[a];r(i)?mr(o,i):n||(o[o.length]=i)}return o}function Od(t){var e=t==null?0:t.length;return e?Ro(t):[]}function Cd(t){return bo(So(t,void 0,Od),t+"")}var vr=Mo(Object.getPrototypeOf,Object),Ed="[object Object]",wd=Function.prototype,Nd=Object.prototype,Io=wd.toString,$d=Nd.hasOwnProperty,jd=Io.call(Object);function V(t){if(!tt(t)||Ot(t)!=Ed)return!1;var e=vr(t);if(e===null)return!0;var r=$d.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Io.call(r)==jd}function Ad(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 Td(){this.__data__=new st,this.size=0}function Md(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Pd(t){return this.__data__.get(t)}function xd(t){return this.__data__.has(t)}var Rd=200;function Id(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!oe||n.length<Rd-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new it(n)}return r.set(t,e),this.size=r.size,this}function W(t){var e=this.__data__=new st(t);this.size=e.size}W.prototype.clear=Td,W.prototype.delete=Md,W.prototype.get=Pd,W.prototype.has=xd,W.prototype.set=Id;function Dd(t,e){return t&&Rt(e,Ee(e),t)}function Ld(t,e){return t&&Rt(e,re(e),t)}var Do=typeof C=="object"&&C&&!C.nodeType&&C,Lo=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Fd=Lo&&Lo.exports===Do,Fo=Fd?Z.Buffer:void 0,Vo=Fo?Fo.allocUnsafe:void 0;function Uo(t,e){if(e)return t.slice();var r=t.length,n=Vo?Vo(r):new t.constructor(r);return t.copy(n),n}function Vd(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 Bo(){return[]}var Ud=Object.prototype,Bd=Ud.propertyIsEnumerable,Go=Object.getOwnPropertySymbols,yr=Go?function(t){return t==null?[]:(t=Object(t),Vd(Go(t),function(e){return Bd.call(t,e)}))}:Bo;function Gd(t,e){return Rt(t,yr(t),e)}var kd=Object.getOwnPropertySymbols,ko=kd?function(t){for(var e=[];t;)mr(e,yr(t)),t=vr(t);return e}:Bo;function Hd(t,e){return Rt(t,ko(t),e)}function Ho(t,e,r){var n=e(t);return F(t)?n:mr(n,r(t))}function br(t){return Ho(t,Ee,yr)}function _r(t){return Ho(t,re,ko)}var Sr=Et(Z,"DataView"),Or=Et(Z,"Promise"),Ft=Et(Z,"Set"),zo="[object Map]",zd="[object Object]",qo="[object Promise]",Jo="[object Set]",Wo="[object WeakMap]",Ko="[object DataView]",qd=Ct(Sr),Jd=Ct(oe),Wd=Ct(Or),Kd=Ct(Ft),Qd=Ct(sr),K=Ot;(Sr&&K(new Sr(new ArrayBuffer(1)))!=Ko||oe&&K(new oe)!=zo||Or&&K(Or.resolve())!=qo||Ft&&K(new Ft)!=Jo||sr&&K(new sr)!=Wo)&&(K=function(t){var e=Ot(t),r=e==zd?t.constructor:void 0,n=r?Ct(r):"";if(n)switch(n){case qd:return Ko;case Jd:return zo;case Wd:return qo;case Kd:return Jo;case Qd:return Wo}return e});var Yd=Object.prototype,Xd=Yd.hasOwnProperty;function Zd(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Xd.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var je=Z.Uint8Array;function Cr(t){var e=new t.constructor(t.byteLength);return new je(e).set(new je(t)),e}function tp(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var ep=/\w*$/;function rp(t){var e=new t.constructor(t.source,ep.exec(t));return e.lastIndex=t.lastIndex,e}var Qo=z?z.prototype:void 0,Yo=Qo?Qo.valueOf:void 0;function np(t){return Yo?Object(Yo.call(t)):{}}function Xo(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var op="[object Boolean]",ap="[object Date]",sp="[object Map]",ip="[object Number]",cp="[object RegExp]",up="[object Set]",lp="[object String]",fp="[object Symbol]",dp="[object ArrayBuffer]",pp="[object DataView]",hp="[object Float32Array]",gp="[object Float64Array]",mp="[object Int8Array]",vp="[object Int16Array]",yp="[object Int32Array]",bp="[object Uint8Array]",_p="[object Uint8ClampedArray]",Sp="[object Uint16Array]",Op="[object Uint32Array]";function Cp(t,e,r){var n=t.constructor;switch(e){case dp:return Cr(t);case op:case ap:return new n(+t);case pp:return tp(t,r);case hp:case gp:case mp:case vp:case yp:case bp:case _p:case Sp:case Op:return Xo(t,r);case sp:return new n;case ip:case lp:return new n(t);case cp:return rp(t);case up:return new n;case fp:return np(t)}}function Zo(t){return typeof t.constructor=="function"&&!lr(t)?Al(vr(t)):{}}var Ep="[object Map]";function wp(t){return tt(t)&&K(t)==Ep}var ta=It&&It.isMap,Np=ta?fr(ta):wp,$p="[object Set]";function jp(t){return tt(t)&&K(t)==$p}var ea=It&&It.isSet,Ap=ea?fr(ea):jp,Tp=1,Mp=2,Pp=4,ra="[object Arguments]",xp="[object Array]",Rp="[object Boolean]",Ip="[object Date]",Dp="[object Error]",na="[object Function]",Lp="[object GeneratorFunction]",Fp="[object Map]",Vp="[object Number]",oa="[object Object]",Up="[object RegExp]",Bp="[object Set]",Gp="[object String]",kp="[object Symbol]",Hp="[object WeakMap]",zp="[object ArrayBuffer]",qp="[object DataView]",Jp="[object Float32Array]",Wp="[object Float64Array]",Kp="[object Int8Array]",Qp="[object Int16Array]",Yp="[object Int32Array]",Xp="[object Uint8Array]",Zp="[object Uint8ClampedArray]",th="[object Uint16Array]",eh="[object Uint32Array]",x={};x[ra]=x[xp]=x[zp]=x[qp]=x[Rp]=x[Ip]=x[Jp]=x[Wp]=x[Kp]=x[Qp]=x[Yp]=x[Fp]=x[Vp]=x[oa]=x[Up]=x[Bp]=x[Gp]=x[kp]=x[Xp]=x[Zp]=x[th]=x[eh]=!0,x[Dp]=x[na]=x[Hp]=!1;function ae(t,e,r,n,o,a){var s,i=e&Tp,c=e&Mp,u=e&Pp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!J(t))return t;var d=F(t);if(d){if(s=Zd(t),!i)return yo(t,s)}else{var l=K(t),f=l==na||l==Lp;if(te(t))return Uo(t,i);if(l==oa||l==ra||f&&!o){if(s=c||f?{}:Zo(t),!i)return c?Hd(t,Ld(s,t)):Gd(t,Dd(s,t))}else{if(!x[l])return o?t:{};s=Cp(t,l,i)}}a||(a=new W);var h=a.get(t);if(h)return h;a.set(t,s),Ap(t)?t.forEach(function(p){s.add(ae(p,e,r,p,t,a))}):Np(t)&&t.forEach(function(p,m){s.set(m,ae(p,e,r,m,t,a))});var g=u?c?_r:br:c?re:Ee,b=d?void 0:g(t);return Fl(b||t,function(p,m){b&&(m=p,p=t[m]),cr(s,m,ae(p,e,r,m,t,a))}),s}var rh=1,nh=4;function aa(t){return ae(t,rh|nh)}var oh="__lodash_hash_undefined__";function ah(t){return this.__data__.set(t,oh),this}function sh(t){return this.__data__.has(t)}function se(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}se.prototype.add=se.prototype.push=ah,se.prototype.has=sh;function ih(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 sa(t,e){return t.has(e)}var ch=1,uh=2;function ia(t,e,r,n,o,a){var s=r&ch,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&uh?new se:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!ih(e,function(m,v){if(!sa(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function lh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Er(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var fh=1,dh=2,ph="[object Boolean]",hh="[object Date]",gh="[object Error]",mh="[object Map]",vh="[object Number]",yh="[object RegExp]",bh="[object Set]",_h="[object String]",Sh="[object Symbol]",Oh="[object ArrayBuffer]",Ch="[object DataView]",ca=z?z.prototype:void 0,wr=ca?ca.valueOf:void 0;function Eh(t,e,r,n,o,a,s){switch(r){case Ch:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Oh:return!(t.byteLength!=e.byteLength||!a(new je(t),new je(e)));case ph:case hh:case vh:return Xt(+t,+e);case gh:return t.name==e.name&&t.message==e.message;case yh:case _h:return t==e+"";case mh:var i=lh;case bh:var c=n&fh;if(i||(i=Er),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=dh,s.set(t,e);var d=ia(i(t),i(e),n,o,a,s);return s.delete(t),d;case Sh:if(wr)return wr.call(t)==wr.call(e)}return!1}var wh=1,Nh=Object.prototype,$h=Nh.hasOwnProperty;function jh(t,e,r,n,o,a){var s=r&wh,i=br(t),c=i.length,u=br(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:$h.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<c;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Ah=1,ua="[object Arguments]",la="[object Array]",Ae="[object Object]",Th=Object.prototype,fa=Th.hasOwnProperty;function Mh(t,e,r,n,o,a){var s=F(t),i=F(e),c=s?la:K(t),u=i?la:K(e);c=c==ua?Ae:c,u=u==ua?Ae:u;var d=c==Ae,l=u==Ae,f=c==u;if(f&&te(t)){if(!te(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new W),s||pr(t)?ia(t,e,r,n,o,a):Eh(t,e,c,r,n,o,a);if(!(r&Ah)){var h=d&&fa.call(t,"__wrapped__"),g=l&&fa.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new W),o(b,p,r,n,a)}}return f?(a||(a=new W),jh(t,e,r,n,o,a)):!1}function Nr(t,e,r,n,o){return t===e?!0:t==null||e==null||!tt(t)&&!tt(e)?t!==t&&e!==e:Mh(t,e,r,n,Nr,o)}var Ph=1,xh=2;function Rh(t,e,r,n){var o=r.length,a=o;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var i=s[0],c=t[i],u=s[1];if(s[2]){if(c===void 0&&!(i in t))return!1}else{var d=new W,l;if(!(l===void 0?Nr(u,c,Ph|xh,n,d):l))return!1}}return!0}function da(t){return t===t&&!J(t)}function Ih(t){for(var e=Ee(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,da(o)]}return e}function pa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Dh(t){var e=Ih(t);return e.length==1&&e[0][2]?pa(e[0][0],e[0][1]):function(r){return r===t||Rh(r,t,e)}}function Lh(t,e){return t!=null&&e in Object(t)}function Fh(t,e,r){e=Dt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Lt(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&&ur(o)&&Oe(s,o)&&(F(t)||Zt(t)))}function Vh(t,e){return t!=null&&Fh(t,e,Lh)}var Uh=1,Bh=2;function Gh(t,e){return hr(t)&&da(e)?pa(Lt(t),e):function(r){var n=Po(r,t);return n===void 0&&n===e?Vh(r,t):Nr(e,n,Uh|Bh)}}function kh(t){return function(e){return e==null?void 0:e[t]}}function Hh(t){return function(e){return $e(e,t)}}function zh(t){return hr(t)?kh(Lt(t)):Hh(t)}function $r(t){return typeof t=="function"?t:t==null?nr:typeof t=="object"?F(t)?Gh(t[0],t[1]):Dh(t):zh(t)}function qh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var Jh=qh();function jr(t,e,r){(r!==void 0&&!Xt(t[e],r)||r===void 0&&!(e in t))&&ir(t,e,r)}function Ar(t){return tt(t)&&Ce(t)}function Tr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wh(t){return Rt(t,re(t))}function Kh(t,e,r,n,o,a,s){var i=Tr(t,r),c=Tr(e,r),u=s.get(c);if(u){jr(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=F(c),h=!f&&te(c),g=!f&&!h&&pr(c);d=c,f||h||g?F(i)?d=i:Ar(i)?d=yo(i):h?(l=!1,d=Uo(c,!0)):g?(l=!1,d=Xo(c,!0)):d=[]:V(c)||Zt(c)?(d=i,Zt(i)?d=Wh(i):(!J(i)||or(i))&&(d=Zo(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),jr(t,r,d)}function ha(t,e,r,n,o){t!==e&&Jh(e,function(a,s){if(o||(o=new W),J(a))Kh(t,e,s,r,ha,n,o);else{var i=n?n(Tr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),jr(t,s,i)}},re)}function ga(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Qh(t,e){return e.length<2?t:$e(t,Ad(e,0,-1))}var ma=Ql(function(t,e,r){ha(t,e,r)}),Yh="Expected a function";function Xh(t){if(typeof t!="function")throw new TypeError(Yh);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 Zh(t,e){return e=Dt(e,t),t=Qh(t,e),t==null||delete t[Lt(ga(e))]}function tg(t){return V(t)?void 0:t}var eg=1,rg=2,ng=4,va=Cd(function(t,e){var r={};if(t==null)return r;var n=!1;e=rr(e,function(a){return a=Dt(a,t),n||(n=a.length>1),a}),Rt(t,_r(t),r),n&&(r=ae(r,eg|rg|ng,tg));for(var o=e.length;o--;)Zh(r,e[o]);return r});function og(t,e,r,n){if(!J(t))return t;e=Dt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Lt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var d=i[c];u=void 0,u===void 0&&(u=J(d)?d:Oe(e[o+1])?[]:{})}cr(i,c,u),i=i[c]}return t}function ag(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=$e(t,s);r(i,s)&&og(a,Dt(s,t),i)}return a}function sg(t,e){if(t==null)return{};var r=rr(_r(t),function(n){return[n]});return e=$r(e),ag(t,r,function(n,o){return e(n,o[0])})}function ig(t,e){return sg(t,Xh($r(e)))}var cg=1/0,ug=Ft&&1/Er(new Ft([,-0]))[1]==cg?function(t){return new Ft(t)}:Ml,lg=200;function fg(t,e,r){var n=-1,o=kl,a=t.length,s=!0,i=[],c=i;if(a>=lg){var u=e?null:ug(t);if(u)return Er(u);s=!1,o=sa,c=new se}else c=e?[]:i;t:for(;++n<a;){var d=t[n],l=e?e(d):d;if(d=d!==0?d:0,s&&l===l){for(var f=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),i.push(d)}else o(c,l,r)||(c!==i&&c.push(l),i.push(d))}return i}var dg=Oo(function(t){var e=ga(t);return Ar(e)&&(e=void 0),fg(Ro(t,1,Ar,!0),$r(e))});class ya 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 pg(t){return Q(t)&&typeof t[Symbol.iterator]=="function"}function Q(t){return typeof t=="object"&&t!=null}function G(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function hg(t){const{done:e,value:r}=t.next();return e?void 0:r}function gg(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: \`${G(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*ba(t,e,r,n){pg(t)||(t=[t]);for(const o of t){const a=gg(o,e,r,n);a&&(yield a)}}function*Mr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&Q(e.schema)&&Q(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,d,l]of e.entries(t,i)){const f=Mr(d,l,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,d],coerce:a,mask:s});for(const h of f)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],u===void 0?t=d:t instanceof Map?t.set(u,d):t instanceof Set?t.add(d):Q(t)&&(d!==void 0||u in t)&&(t[u]=d))}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 et{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 d=o(c,u);return ba(d,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const d=a(c,u);return ba(d,u,this,c)}:this.refiner=()=>[]}assert(e){return _a(e,this)}create(e){return mg(e,this)}is(e){return yg(e,this)}mask(e){return vg(e,this)}validate(e,r){return r===void 0&&(r={}),Vt(e,this,r)}}function _a(t,e){const r=Vt(t,e);if(r[0])throw r[0]}function mg(t,e){const r=Vt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function vg(t,e){const r=Vt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function yg(t,e){return!Vt(t,e)[0]}function Vt(t,e,r){r===void 0&&(r={});const n=Mr(t,e,r),o=hg(n);return o[0]?[new ya(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Pr(){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?Ea(a):M(a)}function pt(t,e){return new et({type:t,schema:null,validator:e})}function Ut(t){return new et({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 Sa(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Ea(n);default:return M(n)}}function P(){return pt("any",()=>!0)}function D(t){return new et({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: ${G(e)}`}})}function Nt(){return pt("boolean",t=>typeof t=="boolean")}function xr(t){const e={},r=t.map(n=>G(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${G(n)}`}})}function Oa(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${G(t)}`)}function k(t){const e=G(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${G(n)}`}})}function bg(){return pt("never",()=>!1)}function Ca(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${G(t)}`)}function M(t){const e=t?Object.keys(t):[],r=bg();return new et({type:"object",schema:t||null,*entries(n){if(t&&Q(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return Q(n)||`Expected an object, but received: ${G(n)}`},coercer(n){return Q(n)?{...n}:n}})}function S(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ie(t,e){return new et({type:"record",schema:null,*entries(r){if(Q(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return Q(r)||`Expected an object, but received: ${G(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${G(t)}`)}function Ea(t){const e=Object.keys(t);return new et({type:"type",schema:t,*entries(r){if(Q(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Q(r)||`Expected an object, but received: ${G(r)}`}})}function H(t){const e=t.map(r=>r.type).join(" | ");return new et({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||_g()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Mr(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: ${G(r)}`,...o]}})}function _g(){return pt("unknown",()=>!0)}const Rr=M({package:E(),version:E(),name:E(),exportName:S(E()),destructuring:S(Nt()),subName:S(E()),main:S(E()),cssPaths:S(D(E()))}),Sg=D(Rr),Og=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var U=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(U||{}),Ir=(t=>(t.DESIGN="design",t.SAVE="save",t))(Ir||{}),Dr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Dr||{});const Cg=()=>pt("normalObj",t=>!V(t)||[U.SLOT,U.EXPRESSION,U.FUNCTION].includes(t==null?void 0:t.type)?!1:(Vt(t,ie(E(),Lr)),!0)),Lr=H([E(),Ca(),Nt(),M({type:k(U.SLOT),renderType:xr([Dr.FUNC,Dr.COMP]),params:S(D(E())),value:Ut(()=>H([Bt,D(Bt)]))}),M({type:k(U.EXPRESSION),value:E()}),M({type:k(U.FUNCTION),value:E()}),M({type:k(U.ACTION),handler:P()}),Cg(),D(Ut(()=>Lr))]);var wa=(t=>(t.COMPONENTS="COMPONENTS",t))(wa||{});const Na=M({type:k(U.EXPRESSION),value:E()}),Bt=M({id:S(E()),title:S(E()),componentName:E(),props:S(ie(E(),Lr)),nodeName:S(E()),state:S(ie(E(),P())),children:Ut(()=>S(D(H([E(),Bt])))),eventListener:S(D(P())),configure:S(P()),css:S(P()),style:S(P()),classNames:S(D(P())),refId:S(E()),extra:S(ie(P(),P())),condition:S(H([Nt(),Na])),loop:S(M({open:Nt(),data:H([D(P()),Na]),args:S(D(E())),forName:S(E()),forIndex:S(E()),key:S(P()),name:S(E())})),injectEnvList:S(D(P())),methods:S(D(P()))}),Te=H([E(),M({label:E(),tip:S(E())})]),Eg=M({type:k("shape"),value:D(M({name:E(),title:Te,valueType:Ut(()=>Me)}))}),wg=M({type:k("enums"),value:D(E())});M({type:k("array"),value:Ut(()=>Me)});const Ng=M({type:k("array"),value:Ut(()=>D(Me))}),Me=H([xr(["array","boolean","number","object","string"]),xr(["component","expression","function"]),Eg,wg,Ng]),$g=H([E(),M({componentName:E(),props:S(P()),initialValue:S(P()),component:S(P()),hiddenLabel:S(Nt())})]),Fr=M({name:E(),title:Te,valueType:Me,description:S(E()),defaultValue:P(),setters:S(D($g)),condition:S(Oa())});H([E(),Oa()]);var Vr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Vr||{});H([E(),M({event:E(),name:S(E()),describe:S(E()),params:S(D(M({name:E(),description:E(),example:E()}))),template:S(E())})]);const jg=M({id:S(E()),title:E(),snapshot:H([E(),P()]),snapshotText:S(E()),description:S(E()),tags:S(D(E())),groupName:S(E()),category:S(E()),schema:Pr(Sa(Bt,["id"]),M({componentName:S(E())}))}),Ag=M({componentName:E(),title:E(),screenshot:S(E()),icon:S(E()),tags:S(D(E())),groupName:S(E()),category:S(E()),priority:S(Ca()),npm:S(Rr),snippets:D(jg),props:D(H([Fr,M({title:S(Te),type:k("single"),content:Fr}),M({title:S(Te),type:k("group"),content:D(Fr)})])),events:S(P()),methods:S(P()),fixedProps:S(P()),isContainer:S(H([Nt(),M({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:S(P()),isLayout:S(Nt()),rootSelector:S(E()),advanceCustom:S(P()),extra:S(ie(P(),P()))}),Tg=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}
23
53
  originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
24
54
  data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
25
55
  originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
26
- data struct format is invalidate`),o},Er=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return fh(({data:a})=>{try{return Qo(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof Jo&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
27
- `)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Dt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Dt||{});const dh=x({type:B(k.FUNCTION),value:C()}),ph=yr(Yo(Pt,["componentName"]),x({componentName:B("RootContainer")}));function hh(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 ne=hh(),mh=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new Ft([]);return e&&(o=e.materialsMode||new Ft([])),n&&(F(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):V(n)&&r.value.push(new L(n,{parent:e,materials:o}))),r};class Lt{constructor(e,r){N(this,"nodeType","SLOT"),N(this,"rawData"),N(this,"parent"),N(this,"emitter",ne),N(this,"data"),N(this,"id"),N(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new Ft([]);this.materialsMode=n,this.id=tt(),this.data=mh(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof L)return o.export(e);if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return F(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const ra=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===wr.SINGLE?e.push(n.content):n.type===wr.GROUP&&(e=[...e,...ra(n.content)]):e.push(r)}),e},Nr=(t,e,r)=>{if(t.type)return t.type===k.SLOT?new Lt(t,{parent:e,materials:r}):t;if(V(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=$r(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Nr(n,e,r)):t},$r=(t,e,r)=>V(t)?Nr(t,e,r):F(t)?t.map(n=>Nr(n,e,r)):t;class it{constructor(e,r,n){N(this,"nodeType","PROP"),N(this,"rawData"),N(this,"parent"),N(this,"emitter",ne),N(this,"data"),N(this,"name"),N(this,"materialsMode");const o=(n==null?void 0:n.materials)||new Ft([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=$r(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=$r(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Lt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof L){const r=e.material;return ra((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof it||o instanceof Lt||o instanceof L)return o.export(e);if(F(o))return o.map(a=>n(a));if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const gh=t=>{if(typeof t=="string")return!0;Er({data:t,dataStruct:Pt,throwError:!1})},na=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??tt(),children:[],props:{},methods:t.methods||[],configure:Ho(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof it){n.props[a]=i;return}n.props[a]=new it(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof L)return a;if(V(a)){const s=a;return new L(s,{parent:e,materials:r})}else return a}):(t.children instanceof L&&(n.children=[t.children]),n.children=[new L(t.children,{parent:e,materials:r})])),n};class L{constructor(e,r){N(this,"nodeType","NODE"),N(this,"rawData"),N(this,"data"),N(this,"emitter",ne),N(this,"parent"),N(this,"materialsModel"),N(this,"listenerHandle"),N(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),gh(e);const n=(r==null?void 0:r.materials)||new Ft([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=na(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||tt()};return new L(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=na(r,this,this.materialsModel),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return xr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof L?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const d=so(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c;const u=this.materialsModel.usedMaterials.find(l=>{var d;return l.componentName===((d=this.material)==null?void 0:d.componentName)});this.material&&!u&&this.materialsModel.usedMaterials.push(this.material);let f={...n,configure:s,props:o,children:a,condition:n.condition,extra:this.data.extra};return e==="design"&&delete f.id,f=Ar(f),f}}const oa=(t,e,r)=>{const n={...t,id:tt(),props:{},componentName:Dt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Ho(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];F(t.children)?o=t.children.map(s=>s instanceof L?s:V(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&V(t.children)&&o.push(new L(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof it?n.props[s]=c:n.props[s]=new it(s,c||"",{parent:e,materials:r})}),n.children=o,n};class oe{constructor(e,{parent:r,materials:n}){N(this,"rawData"),N(this,"data"),N(this,"nodeType",Dt.ROOT_CONTAINER),N(this,"emitter",ne),N(this,"materialsModel"),N(this,"listenerHandle"),N(this,"onChangeCbQueue"),N(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=oa(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=oa(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return xr(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=Sr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition,extra:this.data.extra};let i=qo(s,["id"]);return i=Ar(i),i}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||tt()};return new oe(r,{materials:this.materialsModel,parent:null})}}const gt=t=>(t==null?void 0:t.type)===k.EXPRESSION,aa=t=>(t==null?void 0:t.type)===k.FUNCTION,vh=t=>(t==null?void 0:t.type)===k.ACTION,tt=()=>Math.random().toString(32).slice(3,9),yh=t=>(t==null?void 0:t.nodeType)==="NODE",Tr=t=>(t==null?void 0:t.nodeType)==="PROP",bh=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>Bp(t,e=>V(e)?!Object.keys(e).length:F(e)?!e.length:!e);function _h(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 L){r.push(i);return}if(i instanceof Lt&&a(i.value.value),i instanceof it){a(i.value);return}if(V(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(F(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof L))||[];r.push(...s)}}function xr(t,e){return _h(t,r=>r.id===e)}const Sh=t=>{const e=Ro(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${tt()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Ch{constructor(e){N(this,"rawData"),N(this,"data"),this.rawData=e,this.data=Sh(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 Mr=t=>{if(!F(t))throw new Error("Materials must be a array");return t.map(e=>new Ch(e))},Oh=t=>{t==null||t.forEach(e=>{Er({data:e,dataStruct:lh,throwError:!1})})};class Ft{constructor(e){N(this,"rawData"),N(this,"data"),N(this,"usedMaterials",[]),this.rawData=e,Oh(e),this.data=Mr(e)}addMaterials(e){const r=Mr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=Mr(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(l=>{const d=l.category||"default";s.includes(d)||(s.push(d),i[d]=[]),i[d].push(l)});const u=[];s.forEach(l=>{i[l].length&&u.push({name:l,list:i[l]})});const f={name:a,list:u};o.push(f)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const jh=x({version:y(C()),name:y(C()),css:y(C()),lifecycle:y(M()),props:y(M()),methods:y(D(dh)),componentsMeta:D(yr(x({componentName:C()}),_r)),thirdLibs:y(rh),componentsTree:ph,assets:y(D(M())),extra:y(M())}),sa=t=>(Er({data:t,dataStruct:jh,throwError:!1}),t),Ir=(t,e,r)=>({...t,componentsTree:new oe(t.componentsTree,{parent:e,materials:r})});class Oe{constructor(e,r){N(this,"nodeType","PAGE"),N(this,"rawData"),N(this,"emitter",ne),N(this,"data"),N(this,"parent"),N(this,"materialsModel"),N(this,"assetPackagesList"),sa(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new Ft((r==null?void 0:r.materials)||[]),this.data=Ir(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ir(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=Ir(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 xr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof oe)return console.warn("Not found parent node"),!1;if(a instanceof it)return console.warn("CProp can not add node"),!1;if(a instanceof Lt){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 Oe)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(V(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 L(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=tt();const n=new L(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 L?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 L&&a instanceof L?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 Lt){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 L||n instanceof oe){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Sr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(f=>{var l;return f.package===((l=c.value.npm)==null?void 0:l.package)});return u&&a.push(u),{componentName:c.componentName,...Ro(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Ar(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(f=>c.package===f.package);u&&a.push(u)}),i.assets=Jp(a,c=>c.package),i=qo(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Dt.ROOT_CONTAINER;const ae="DYNAMIC",ia=["$$context","$$nodeModel"],Rr="ON_DID_RENDER",Pr="ON_WILL_DESTROY",ca=[Rr,Pr],Dr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},se=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(ia.forEach(o=>{o in e&&t.__CP_TYPE__!==ae&&delete e[o]}),E.createElement(t,e,...r)),ua=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;Tr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):jt(s)?s.forEach((i,c)=>{n([...o,String(c)],i)}):Et(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Vt=(t,e)=>{const r=t.handler,{context:n,storeManager:o}=e;return e.actionVariableSpace||(e.actionVariableSpace={}),async function(...a){const s={},i=async f=>{const l=f;if(l.type==="RUN_CODE"){const d=Ht({funcName:"",funcBody:`function() {
28
- ${l.value} }`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace});let p;e.$$response!==void 0?p=d(e.$$response,...a):p=d(...a),p!=null&&p.then?s[l.id]=await p:s[l.id]=p}if(l.type==="JUMP_LINK"){const p=wh(l,e)(...a);p!=null&&p.then?s[l.id]=await p:s[l.id]=p}if(l.type==="REQUEST_API"){const{run:d,afterFailedResponse:p,afterSuccessResponse:b}=Eh(l,e);try{const O=d(...a);O!=null&&O.then?s[l.id]=await O:s[l.id]=O,l.responseVarName&&(e.actionVariableSpace[l.responseVarName]=s[l.id]);const h=b(s[l.id],...a);return h!=null&&h.then?await h:h}catch(O){const h=await p(O);return h!=null&&h.then?await h:h}}if(l.type==="CALL_NODE_METHOD"){const p=Nh(l,e)(...a);p!=null&&p.then?s[l.id]=await p:s[l.id]=p,l.returnVarName&&(e.actionVariableSpace[l.returnVarName]=s[l.id])}if(l.type==="ASSIGN_VALUE"){const d=$h(l,e);let p=[...a];e.$$response!==void 0&&(p=[e.$$response,p]);const b=d(...p);s[l.id]=await b}};let c=r[0];const u=new Set;for(;c;){if(u.has(c.id))return;await i(c),u.add(c.id),c=r.find(l=>(c==null?void 0:c.next)&&l.id===(c==null?void 0:c.next))}}};function wh(t,e){return vt(t.link,e)}const vt=(t,e)=>function(...r){return gt(t)?lt(t.value,{...e.context,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace}):aa(t)?Ht({funcName:t.name||"",funcBody:t.value,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace})(...r):t},Eh=(t,e)=>({run:function(...a){var d,p;let s="";t.apiPath&&(s=vt(t.apiPath,e)(...a));const i=t.body||{};Object.keys(i).forEach(b=>{i[b]=vt(i[b],e)(...a)});const c=t.query||{};Object.keys(c).forEach(b=>{c[b]=vt(c[b],e)(...a)});const u=t.header||{};Object.keys(u).forEach(b=>{u[b]=vt(u[b],e)(...a)});const f=t.method||"GET";return(p=(d=e.context).requestAPI)==null?void 0:p.call(d,{url:s,method:f,header:u,body:i,query:c})},afterSuccessResponse:async(a,...s)=>{if(!t.afterSuccessResponse)return a;const i=[...t.afterSuccessResponse||[],...t.afterFailedResponse||[]];return Vt({handler:i},{...e,$$response:a})(...s)},afterFailedResponse:async(a,...s)=>{if(!t.afterFailedResponse)return a;const i=[...t.afterFailedResponse||[],...t.afterSuccessResponse||[]];return Vt({handler:i},{...e,$$response:a})(...s)}}),Nh=(t,e)=>(...r)=>{const n=Ht({funcName:"",funcBody:`
56
+ data struct format is invalidate`),o},Ur=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Tg(({data:a})=>{try{return _a(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof ya&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
57
+ `)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var ct=(t=>(t.ROOT_CONTAINER="RootContainer",t))(ct||{});const Mg=M({type:k(U.FUNCTION),value:E()}),Pg=Pr(Sa(Bt,["componentName"]),M({componentName:k("RootContainer")}));function xg(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 ce=xg(),Rg=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new kt([]);return e&&(o=e.materialsMode||new kt([])),n&&(F(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):V(n)&&r.value.push(new L(n,{parent:e,materials:o}))),r};class Gt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ce),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new kt([]);this.materialsMode=n,this.id=rt(),this.data=Rg(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof L)return o.export(e);if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return F(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const $a=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Vr.SINGLE?e.push(n.content):n.type===Vr.GROUP&&(e=[...e,...$a(n.content)]):e.push(r)}),e},Br=(t,e,r)=>{if(t.type)return t.type===U.SLOT?new Gt(t,{parent:e,materials:r}):t;if(V(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Br(n,e,r)):t},Gr=(t,e,r)=>V(t)?Br(t,e,r):F(t)?t.map(n=>Br(n,e,r)):t;class ht{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ce),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new kt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Gt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof L){const r=e.material;return $a((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 ht||o instanceof Gt||o instanceof L)return o.export(e);if(F(o))return o.map(a=>n(a));if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Ig=t=>{if(typeof t=="string")return!0;Ur({data:t,dataStruct:Bt,throwError:!1})},ja=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??rt(),children:[],props:{},methods:t.methods||[],configure:ma(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 ht){n.props[a]=i;return}n.props[a]=new ht(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof L)return a;if(V(a)){const s=a;return new L(s,{parent:e,materials:r})}else return a}):(t.children instanceof L&&(n.children=[t.children]),n.children=[new L(t.children,{parent:e,materials:r})])),n};class L{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",ce),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Ig(e);const n=(r==null?void 0:r.materials)||new kt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=ja(e,this,n),this.listenerHandler=[],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.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandler.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||rt()};return new L(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ja(r,this,this.materialsModel),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return zr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof L?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const f=Po(i,l,!1);f&&(c[l]=f)}),s.propsSetter=c;const u=this.materialsModel.usedMaterials.find(l=>{var f;return l.componentName===((f=this.material)==null?void 0:f.componentName)});this.material&&!u&&this.materialsModel.usedMaterials.push(this.material);let d={...n,configure:s,props:o,children:a,condition:n.condition,extra:this.data.extra};return e==="design"&&delete d.id,d=Hr(d),d}}const Aa=(t,e,r)=>{const n={...t,id:rt(),props:{},componentName:ct.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:ma(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];F(t.children)?o=t.children.map(s=>s instanceof L?s:V(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&V(t.children)&&o.push(new L(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 ht?n.props[s]=c:n.props[s]=new ht(s,c||"",{parent:e,materials:r})}),n.children=o,n};class ue{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",ct.ROOT_CONTAINER),j(this,"emitter",ce),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Aa(e,this,n),this.listenerHandler=[],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.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=Aa(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return zr(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=Ir.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition,extra:this.data.extra};let i=va(s,["id"]);return i=Hr(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.listenerHandler.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||rt()};return new ue(r,{materials:this.materialsModel,parent:null})}}const $t=t=>(t==null?void 0:t.type)===U.EXPRESSION,Ta=t=>(t==null?void 0:t.type)===U.FUNCTION,Dg=t=>(t==null?void 0:t.type)===U.ACTION,rt=()=>Math.random().toString(32).slice(3,9),Lg=t=>(t==null?void 0:t.nodeType)==="NODE",kr=t=>(t==null?void 0:t.nodeType)==="PROP",Fg=t=>(t==null?void 0:t.nodeType)==="SLOT",Hr=t=>ig(t,e=>V(e)?!Object.keys(e).length:F(e)?!e.length:!e);function Vg(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 L){r.push(i);return}if(i instanceof Gt&&a(i.value.value),i instanceof ht){a(i.value);return}if(V(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(F(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof L))||[];r.push(...s)}}function zr(t,e){return Vg(t,r=>r.id===e)}const Ug=t=>{const e=aa(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${rt()}`,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 Bg{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Ug(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 qr=t=>{if(!F(t))throw new Error("Materials must be a array");return t.map(e=>new Bg(e))},Gg=t=>{t==null||t.forEach(e=>{Ur({data:e,dataStruct:Ag,throwError:!1})})};class kt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Gg(e),this.data=qr(e)}addMaterials(e){const r=qr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=qr(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(l=>{const f=l.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(l)});const u=[];s.forEach(l=>{i[l].length&&u.push({name:l,list:i[l]})});const d={name:a,list:u};o.push(d)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kg=M({version:S(E()),name:S(E()),css:S(E()),lifecycle:S(P()),props:S(P()),methods:S(D(Mg)),componentsMeta:D(Pr(M({componentName:E()}),Rr)),thirdLibs:S(Sg),componentsTree:Pg,assets:S(D(P())),extra:S(P())}),Ma=t=>(Ur({data:t,dataStruct:kg,throwError:!1}),t),Jr=(t,e,r)=>({...t,componentsTree:new ue(t.componentsTree,{parent:e,materials:r})});class Pe{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",ce),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),Ma(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new kt((r==null?void 0:r.materials)||[]),this.data=Jr(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(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 zr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ue)return console.warn("Not found parent node"),!1;if(a instanceof ht)return console.warn("CProp can not add node"),!1;if(a instanceof Gt){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(V(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 L(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=rt();const n=new L(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 L?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 L&&a instanceof L?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 Gt){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 L||n instanceof ue){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=Ir.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(d=>{var l;return d.package===((l=c.value.npm)==null?void 0:l.package)});return u&&a.push(u),{componentName:c.componentName,...aa(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Hr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(d=>c.package===d.package);u&&a.push(u)}),i.assets=dg(a,c=>c.package),i=va(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}ct.ROOT_CONTAINER;const le="DYNAMIC",Pa=["$$context","$$nodeModel"],Wr="ON_DID_RENDER",Kr="ON_WILL_DESTROY",xa=[Wr,Kr],Qr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},fe=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(Pa.forEach(o=>{o in e&&t.__CP_TYPE__!==le&&delete e[o]}),N.createElement(t,e,...r)),Ra=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;kr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):nt(s)?s.forEach((i,c)=>{n([...o,String(c)],i)}):Pt(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Ht=(t,e)=>{const r=t.handler,{context:n,storeManager:o}=e;return e.actionVariableSpace||(e.actionVariableSpace={}),async function(...a){const s={},i=async d=>{const l=d;if(l.type==="RUN_CODE"){const f=xt({funcName:"",funcBody:`function() {
58
+ ${l.value}
59
+ }`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel});let h;e.$$response!==void 0?h=f(e.$$response,...a):h=f(...a),h!=null&&h.then?s[l.id]=await h:s[l.id]=h}if(l.type==="JUMP_LINK"){const h=Hg(l,e)(...a);h!=null&&h.then?s[l.id]=await h:s[l.id]=h}if(l.type==="REQUEST_API"){const{run:f,afterFailedResponse:h,afterSuccessResponse:g}=zg(l,e);try{const b=f(...a);b!=null&&b.then?s[l.id]=await b:s[l.id]=b,l.responseVarName&&(e.actionVariableSpace[l.responseVarName]=s[l.id]);const p=g(s[l.id],...a);return p!=null&&p.then?await p:p}catch(b){const p=await h(b);return p!=null&&p.then?await p:p}}if(l.type==="CALL_NODE_METHOD"){const h=qg(l,e)(...a);h!=null&&h.then?s[l.id]=await h:s[l.id]=h,l.returnVarName&&(e.actionVariableSpace[l.returnVarName]=s[l.id])}if(l.type==="ASSIGN_VALUE"){const f=Jg(l,e);let h=[...a];e.$$response!==void 0&&(h=[e.$$response,h]);const g=f(...h);s[l.id]=await g}};let c=r[0];const u=new Set;for(;c;){if(u.has(c.id))return;await i(c),u.add(c.id),c=r.find(l=>(c==null?void 0:c.next)&&l.id===(c==null?void 0:c.next))}}};function Hg(t,e){return jt(t.link,e)}const jt=(t,e)=>function(...r){return $t(t)?St(t.value,{...e.context,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel}):Ta(t)?xt({funcName:t.name||"",funcBody:t.value,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel})(...r):t},zg=(t,e)=>({run:function(...a){var f,h;let s="";t.apiPath&&(s=jt(t.apiPath,e)(...a));const i=t.body||{};Object.keys(i).forEach(g=>{i[g]=jt(i[g],e)(...a)});const c=t.query||{};Object.keys(c).forEach(g=>{c[g]=jt(c[g],e)(...a)});const u=t.header||{};Object.keys(u).forEach(g=>{u[g]=jt(u[g],e)(...a)});const d=t.method||"GET";return(h=(f=e.context).requestAPI)==null?void 0:h.call(f,{url:s,method:d,header:u,body:i,query:c})},afterSuccessResponse:async(a,...s)=>{if(!t.afterSuccessResponse)return a;const i=[...t.afterSuccessResponse||[],...t.afterFailedResponse||[]];return Ht({handler:i},{...e,$$response:a})(...s)},afterFailedResponse:async(a,...s)=>{if(!t.afterFailedResponse)return a;const i=[...t.afterFailedResponse||[],...t.afterSuccessResponse||[]];return Ht({handler:i},{...e,$$response:a})(...s)}}),qg=(t,e)=>(...r)=>{const n=xt({funcName:"",funcBody:`
29
60
  function () {
30
61
  var args = arguments;
31
62
  var nodeRef = $$context.nodeRefs.get(${JSON.stringify(t.nodeId)});
@@ -35,7 +66,7 @@
35
66
  func.apply(null, args);
36
67
  }
37
68
  }
38
- }`,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response});let o=r;return Array.isArray(t.args)&&(o=t.args.map(a=>{const s=[e.$$response,...r].filter(Boolean);return vt(a,e)(...s)})),n(...o)},$h=(t,e)=>async(...r)=>{const o=vt(t.currentValue,e)(...r);let a;if(o!=null&&o.then?a=await o:a=o,t.valueType==="STATE"){const s=t.targetValueName,i=e.storeManager.getStore(s.nodeId);i&&i.setState({[s.keyPath]:a})}else t.valueType==="MEMORY"&&(e.actionVariableSpace[t.targetValueName]=a);return a},je=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=c=>{if(Array.isArray(c))return c.map(u=>s(u));if(Tr(c))return s(c.value);if(bh(c)){const u=c.value,f=u.value;if(!f)return console.warn("slot value is null, this maybe cause some error, pls check it",t),()=>{};const l=d=>{const p=`${d.id}-${ae}`,b=n(d),O=Lr(b,d,{...e}),h=u.params||[];return{component:(...g)=>{const _=Le(g,h),j=Dr({params:_,nodeRefs:r.nodeRefs},r);return se(O,{$$context:j,key:p})},key:p}};if(Array.isArray(f)){const d=f==null?void 0:f.map(p=>l(p));return(...p)=>d.map(b=>{if(An(b.component)){const h=b.component;return E.createElement(h,{$$context:r,key:b.key})}else{const h=b.component;return h==null?void 0:h(...p)}})}else return l(f).component}else{if(gt(c))return lt(c.value,r||{});if(aa(c)){const u=c;return Ht({funcBody:u.value,funcName:u.name||"",nodeContext:r,storeManager:o})}else{if(vh(c))return Vt(c,{context:r,storeManager:o,actionVariableSpace:{}});if(Et(c)){let u=c;Tr(c)&&(u=c.value);const f=u,l={};return Object.keys(u).forEach(d=>{l[d]=s(f[d])}),l}else return c}}},i={};return Object.keys(a).forEach(c=>{const u=a[c];i[c]=s(u)}),i},Th=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...c}=e;return typeof t=="string"?se(t):yh(t)?(({currentNode:f})=>{const l=f.value.id;let d=null;if(r.get(l)){const O=r.get(l);d=O==null?void 0:O.component}else{const O=o(f);d=Lr(O,f,{...c}),!r.get(l)&&a!=="design"&&r.set(l,{component:d})}const p=`${l}-${ae}`;return se(d,{$$context:n,$$nodeModel:t,key:p})})({currentNode:t}):void 0},Lr=(t,e,r)=>{const{storeManager:n,variableManager:o,onGetRef:a,onComponentMount:s,onComponentDestroy:i,refManager:c,processNodeConfigHook:u,requestAPI:f,doc:l}=r,{...d}=r;class p extends E.Component{constructor(h){super(h);w(this,"_CONDITION",!0);w(this,"_DESIGN_BOX",!1);w(this,"_NODE_MODEL",e);w(this,"_NODE_ID",e.id);w(this,"UNIQUE_ID",`${e.id}_${tt()}`);w(this,"targetComponentRef");w(this,"listenerHandle",[]);w(this,"storeState");w(this,"storeListenDisposeList",[]);w(this,"domHeader");w(this,"mediaStyleDomMap",{});w(this,"variableSpace");w(this,"nodeName");w(this,"updateState",h=>{this.storeState.setState(h)});w(this,"getStyleDomById",h=>{const m=this.mediaStyleDomMap;let v=m[h];return v||(v=l.createElement("style"),m[h]=v),v.id=h,v});w(this,"addMediaCSS",()=>{var v;let h=this.domHeader;if(h||(h=(v=l.getElementsByTagName("head"))==null?void 0:v[0],this.domHeader=h),!this.domHeader){console.warn("not found header dom");return}const m=this._NODE_MODEL.value.css;m&&m.value.forEach(g=>{var T;const _=`${this.UNIQUE_ID}_${g.state}`;let j=Fe(this._NODE_MODEL);if(g.state!=="normal"&&(j=`${j}:${g.state}`),g.text){const A=this.getStyleDomById(_);A.innerText=`.${j} { ${g.text} }`,h==null||h.appendChild(A)}(T=g.media)!=null&&T.length&&g.media.forEach(A=>{const $=`${_}_${A.type}_${A.value}`,et=this.getStyleDomById($);et.media=`screen and (${A.type}:${A.value}px)`,et.innerHTML=`.${j} { ${A.text} }`,h==null||h.appendChild(et)})})});w(this,"removeMediaCSS",()=>{const h=this.mediaStyleDomMap;Object.keys(h).forEach(m=>{var v;(v=this.domHeader)==null||v.removeChild(h[m])}),this.mediaStyleDomMap={}});w(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(h=>h()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=E.createRef(),this.state=e.value.state||{};const m=e.value.nodeName||e.id;this.nodeName=m;const v=n.getStore(m);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(m,()=>({...e.value.state||{}})),this.storeState.subscribe(_=>{this.setState({..._})}),this.connectStore();const g=o.get(m);g?this.variableSpace=g:(this.variableSpace={staticVar:{},methods:{}},o.add(m,this.variableSpace))}connectStore(){const h=ua(e.props,j=>!!gt(j)),m=ua({css:e.value.css,class:e.value.classNames},j=>!!gt(j));let v=[];[...h,...m].map(j=>{const T=j.val,A=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],$=Rn(T.value,A);v=[...v,...$]}).filter(Boolean);const g=Array.from(new Set(v)),_=[];g.length&&g.forEach(j=>{n.getStore(j)||(n.addStore(j,()=>({})),console.warn(n,j,"not exits"));const A=n.connect(j,$=>{this.setState({...$})});_.push(A)}),this.storeListenDisposeList=_}componentDidMount(){var v;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const h=(v=e.value.eventListener)==null?void 0:v.find(g=>g.name===Rr);h&&Vt(h.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{}})();const m=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(m)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(g=>g()),this.removeMediaCSS(),i==null||i(this,e);const h=Pr,m=(v=e.value.eventListener)==null?void 0:v.find(g=>g.name===h);m&&Vt(m.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{}})()}transformMethods(h){const{context:m}=h,v=je({methods:e.value.methods},{$$context:m,...d}),g=e.value.methods||[],_=v.methods,j=g.reduce((T,A,$)=>(T[A.name]=_[$],T),{});m.methods=j,this.variableSpace.methods=Object.assign(this.variableSpace.methods,j)}processRootContext(h){e.value.componentName===Dt.ROOT_CONTAINER&&(h.globalState=this.state,h.updateGlobalState=this.updateState,h.requestAPI=f,h.getGlobalState=()=>this.state)}processNodeClassName(h,m){var _;const v=((_=e.value.classNames)==null?void 0:_.map(j=>{var $;const T=j.name;return(gt(j.status)?lt((($=j.status)==null?void 0:$.value)||"",m):!1)?T:""}))||[];let g=`${h??""} ${v.join(" ")}`.trim();return e.value.css&&(g=`${Fe(e)} ${g}`.trim()),g}processNodeStyle(h){if(!e.value.style)return{};const m=je({style:e.value.style},{$$context:h,...d});return In(m.style||[])}processNodeChild(h,m){let v=[];if(h!==void 0)v=Array.isArray(h)?h:[h];else{const g=[];e.value.children.forEach((j,T)=>{const A=Th(j,{$$context:m,idx:T,...d});g.push(A)}),v=g}return v}processNodeConditionAndConfigHook(h,m,v){let g=e.value.condition??!0;typeof g!="boolean"&&(g=lt(g.value,v||{}));let _={condition:g,props:h};u&&(_=u(_,e));const j=se(t,_.props,...m);return this._CONDITION=_.condition,_.condition?j:E.createElement("div",{style:{display:"none"}},j)}processNodeEventListener(h){const m=e.value.eventListener,v={};return m==null||m.forEach(g=>{if(ca.includes(g.name))return;const _=Vt(g.func,{context:h,storeManager:n,actionVariableSpace:{}});v[g.name]=_}),v}createCurrentNodeCtx(){const{$$context:h}=this.props,m=e.value.nodeName||e.id,v=e.id,g={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(m),getStateObj:()=>n.getStateObj(m),getStateObjById:j=>n.getStateObj(j),stateManager:n.getStateSnapshot(),getMethods:()=>{const j=o.get(v).methods,T=c.get(v).current;return Ve(j,T)},getMethodsById:j=>{const T=o.get(j).methods,A=c.get(j).current;return Ve(T,A)},getStaticVar:()=>o.get(m).staticVar,getStaticVarById:j=>o.get(j).staticVar,nodeRefs:h.nodeRefs};return this.processRootContext(g),Dr(g,h)}injectEngEnv(){const h={},m=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[ta.COMPONENTS]:r.components};m.reduce((g,_)=>(g[_]=v[_],g),h)}return h}renderCore(){const{$$context:h,...m}=this.props,v={key:e.id,...e.props,...m},g=this.createCurrentNodeCtx();this.transformMethods({context:g});let _=je(v,{$$context:g,...d});const j=this.injectEngEnv();Object.assign(_,j);const T=this.processNodeClassName(_.className,g);_.className=T;const A=this.processNodeStyle(g);_.style=A;const{children:$}=_;delete _.children;const et=this.processNodeChild($,g);if(_.ref=this.targetComponentRef,e.value.eventListener){const bt=this.processNodeEventListener(g);_={..._,...bt}}return this.processNodeConditionAndConfigHook(_,et,g)}renderLoop(){const{$$context:h,...m}=this.props,v={key:e.id,...e.props,...m},g=this.createCurrentNodeCtx();this.transformMethods({context:g});const _=e.value.loop;let j=[];if(_&&_.open){this.targetComponentRef.current=[];let T=_.data||[];if(gt(_.data)){const A=_.data;T=lt(A.value,g||{})}return j=T.map((...A)=>{const $=A[1],et=[_.forName||"item",_.forIndex||"index"],yt=Le(A,et);let bt="loopData";_.name&&(bt=`${bt}${_.name}`);const kt=Dr({[bt]:yt,nodeRefs:g.nodeRefs},g),Y=je(v,{$$context:kt,...d}),Xh=this.injectEngEnv();Object.assign(Y,Xh);const Zh=this.processNodeClassName(Y.className,kt);Y.className=Zh;const tm=this.processNodeStyle(kt);Y.style=tm;const{children:em}=Y;delete Y.children;const rm=this.processNodeChild(em,kt);if(Y.key=`${Y.key}-${$}`,gt(_.key)){const kr=_.key,nm=lt(kr.value,kt||{});Y.key+=`-${nm}`}return Y.ref=kr=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[$]=kr},this.processNodeConditionAndConfigHook(Y,rm,kt)}),j}}render(){const h=e.value.loop;return h&&h.open?this.renderLoop():this.renderCore()}}return w(p,"__CP_TYPE__",ae),p.displayName=`${e.value.componentName}Dynamic`,p};class la{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new Rc);w(this,"variableManager",new Pc);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new ke);w(this,"onComponentDestroy");w(this,"processNodeConfigHook");w(this,"requestAPI",async e=>{throw console.log(e),new Error("Need to implement requestAPI for Render")})}getComponent(e){var o;const r=e.value.componentName;let n=Dn(r,this.components);return xn(n)||(n=Mn(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}pageRender(e,{components:r,onGetRef:n,refManager:o,$$context:a={nodeRefs:o},onGetComponent:s,onComponentMount:i,onComponentDestroy:c,renderMode:u,processNodeConfigHook:f,requestAPI:l,doc:d}){this.renderMode=u,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=c,this.processNodeConfigHook=f,this.refManager=o,this.requestAPI=l;const p=e.value.componentsTree,b=this.getComponent(p),O=Lr(b,e.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:f,onComponentMount:i,onComponentDestroy:c,renderMode:u,requestAPI:l,components:this.components,doc:d}),h={},m=p.props;return Object.keys(m).forEach(v=>{h[v]=m[v].value}),h.$$context=a,se(O,h)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Ah=Br(new la);function xh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fr={exports:{}},ie={};/**
69
+ }`,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,nodeModel:e.nodeModel});let o=r;return Array.isArray(t.args)&&(o=t.args.map(a=>{const s=[e.$$response,...r].filter(Boolean);return jt(a,e)(...s)})),n(...o)},Jg=(t,e)=>async(...r)=>{const o=jt(t.currentValue,e)(...r);let a;if(o!=null&&o.then?a=await o:a=o,t.valueType==="STATE"){const s=t.targetValueName,i=e.storeManager.getStore(s.nodeId);i&&i.setState({[s.keyPath]:a})}else t.valueType==="MEMORY"&&(e.actionVariableSpace[t.targetValueName]=a);return a},xe=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=c=>{if(Array.isArray(c))return c.map(u=>s(u));if(kr(c))return s(c.value);if(Fg(c)){const u=c.value,d=u.value;if(!d)return console.warn("slot value is null, this maybe cause some error, pls check it",t),()=>{};const l=f=>{const h=`${f.id}-${le}`,g=n(f),b=Yr(g,f,{...e}),p=u.params||[];return{component:(...y)=>{const _=Ye(y,p),O=Qr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return fe(b,{$$context:O,key:h})},key:h}};if(Array.isArray(d)){const f=d==null?void 0:d.map(h=>l(h));return(...h)=>f.map(g=>{if(eo(g.component)){const p=g.component;return N.createElement(p,{$$context:r,key:g.key})}else{const p=g.component;return p==null?void 0:p(...h)}})}else return l(d).component}else{if($t(c))return St(c.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(Ta(c)){const u=c;return xt({funcBody:u.value,funcName:u.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Dg(c))return Ht(c,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(Pt(c)){let u=c;kr(c)&&(u=c.value);const d=u,l={};return Object.keys(u).forEach(f=>{l[f]=s(d[f])}),l}else return c}}},i={};return Object.keys(a).forEach(c=>{const u=a[c];i[c]=s(u)}),i},Wg=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...c}=e;return typeof t=="string"?fe(t):Lg(t)?(({currentNode:d})=>{const l=d.value.id;let f=null;if(r.get(l)){const b=r.get(l);f=b==null?void 0:b.component}else{const b=o(d);f=Yr(b,d,{...c}),!r.get(l)&&a!=="design"&&r.set(l,{component:f})}const h=`${l}-${le}`;return fe(f,{$$context:n,$$nodeModel:t,key:h})})({currentNode:t}):void 0},Yr=(t,e,r)=>{const{storeManager:n,variableManager:o,onGetRef:a,onComponentMount:s,onComponentDestroy:i,refManager:c,processNodeConfigHook:u,requestAPI:d,doc:l}=r,{...f}=r;class h extends N.Component{constructor(p){super(p);w(this,"_CONDITION",!0);w(this,"_DESIGN_BOX",!1);w(this,"_NODE_MODEL",e);w(this,"_NODE_ID",e.id);w(this,"UNIQUE_ID",`${e.id}_${rt()}`);w(this,"targetComponentRef");w(this,"listenerHandler",[]);w(this,"storeState");w(this,"storeListenDisposeList",[]);w(this,"domHeader");w(this,"mediaStyleDomMap",{});w(this,"variableSpace");w(this,"nodeName");w(this,"updateState",p=>{e.value.componentName===ct.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const m=this.mediaStyleDomMap;let v=m[p];return v||(v=l.createElement("style"),m[p]=v),v.id=p,v});w(this,"addMediaCSS",()=>{var v;let p=this.domHeader;if(p||(p=(v=l.getElementsByTagName("head"))==null?void 0:v[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const m=this._NODE_MODEL.value.css;m&&m.value.forEach(y=>{var A;const _=`${this.UNIQUE_ID}_${y.state}`;let O=Xe(this._NODE_MODEL);if(y.state!=="normal"&&(O=`${O}:${y.state}`),y.text){const T=this.getStyleDomById(_);T.innerText=`.${O} { ${y.text} }`,p==null||p.appendChild(T)}(A=y.media)!=null&&A.length&&y.media.forEach(T=>{const $=`${_}_${T.type}_${T.value}`,B=this.getStyleDomById($);B.media=`screen and (${T.type}:${T.value}px)`,B.innerHTML=`.${O} { ${T.text} }`,p==null||p.appendChild(B)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(m=>{var v;(v=this.domHeader)==null||v.removeChild(p[m])}),this.mediaStyleDomMap={}});w(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(p=>p()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=N.createRef(),this.listenerHandler=[],this.state=e.value.state||{};let m=e.value.nodeName||e.id;e.value.componentName===ct.ROOT_CONTAINER&&(m="globalState"),this.nodeName=m;const v=n.getStore(m);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(m,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(O=>{this.setStateIfChanged(O)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(m);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(m,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==ct.ROOT_CONTAINER&&this.setState(m=>{const v=typeof p=="function"?p(m):p;return ku(m,{...m,...v})?null:v})}connectStore(){const p=Ra(e.props,O=>!!$t(O)),m=Ra({css:e.value.css,class:e.value.classNames},O=>!!$t(O));let v=[];[...p,...m].map(O=>{const A=O.val,T=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],$=ao(A.value,T);v=[...v,...$],/\$CTX\.globalState|\$G_STATE/.test(A.value)&&v.push("globalState")}).filter(Boolean);const y=Array.from(new Set(v)),_=[];y.length&&y.forEach(O=>{n.getStore(O)||(n.addStore(O,()=>({})),console.warn(n,O,"not exits, auto create"));const T=n.connect(O,$=>{this.setStateIfChanged($)});_.push(T)}),this.storeListenDisposeList=_}componentDidMount(){var v;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===Wr);p&&Ht(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const m=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(m)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Kr,m=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===p);m&&Ht(m.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:m}=p,v=xe({methods:e.value.methods},{$$context:m,...f,nodeModel:e}),y=e.value.methods||[],_=v.methods,O=y.reduce((A,T,$)=>(A[T.name]=_[$],A),{});m.methods=O,this.variableSpace.methods=Object.assign(this.variableSpace.methods,O)}processRootContext(p){e.value.componentName===ct.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,m){var _;const v=((_=e.value.classNames)==null?void 0:_.map(O=>{var $;const A=O.name;return($t(O.status)?St((($=O.status)==null?void 0:$.value)||"",{nodeContext:m,nodeModel:e,storeManager:n}):!1)?A:""}))||[];let y=`${p??""} ${v.join(" ")}`.trim();return e.value.css&&(y=`${Xe(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const m=xe({style:e.value.style},{$$context:p,...f,nodeModel:e});return oo(m.style||[])}processNodeChild(p,m){let v=[];if(p!==void 0)v=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((O,A)=>{const T=Wg(O,{$$context:m,idx:A,...f});y.push(T)}),v=y}return v}processNodeConditionAndConfigHook(p,m,v){let y=e.value.condition??!0;typeof y!="boolean"&&(y=St(y.value,{nodeContext:v||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};u&&(_=u(_,e));const O=fe(t,_.props,...m);return this._CONDITION=_.condition,_.condition?O:N.createElement("div",{style:{display:"none"}},O)}processNodeEventListener(p){const m=e.value.eventListener,v={};return m==null||m.forEach(y=>{if(xa.includes(y.name))return;const _=Ht(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});v[y.name]=_}),v}createCurrentNodeCtx(){const{$$context:p}=this.props,m=e.value.nodeName||e.id,v=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(m),getStateObj:()=>n.getStateObj(m),getStateObjById:O=>n.getStateObj(O),stateManager:n.getStateSnapshot(),getMethods:()=>{const O=o.get(v).methods,A=c.get(v).current;return Ze(O,A)},getMethodsById:O=>{const A=o.get(O).methods,T=c.get(O).current;return Ze(A,T)},getStaticVar:()=>o.get(m).staticVar,getStaticVarById:O=>o.get(O).staticVar,callEventMethod:(O,A)=>{var $,B;const T=c.get(v).current;(B=T==null?void 0:($=T.props)[O])==null||B.call($,A)},getProps:()=>{const O=c.get(v).current;return O==null?void 0:O.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),Qr(y,p)}injectEngEnv(){const p={},m=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[wa.COMPONENTS]:r.components};m.reduce((y,_)=>(y[_]=v[_],y),p)}return p}renderCore(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=xe(v,{$$context:y,...f,nodeModel:e});const O=this.injectEngEnv();Object.assign(_,O);const A=this.processNodeClassName(_.className,y);_.className=A;const T=this.processNodeStyle(y);_.style=T;const{children:$}=_;delete _.children;const B=this.processNodeChild($,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const Tt=this.processNodeEventListener(y);_={..._,...Tt}}return this.processNodeConditionAndConfigHook(_,B,y)}renderLoop(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let O=[];if(_&&_.open){this.targetComponentRef.current=[];let A=_.data||[];if($t(_.data)){const T=_.data;A=St(T.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return O=A.map((...T)=>{const $=T[1],B=[_.forName||"item",_.forIndex||"index"],At=Ye(T,B);let Tt="loopData";_.name&&(Tt=`${Tt}${_.name}`);const zt=Qr({[Tt]:At,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y),Y=xe(v,{$$context:zt,...f,nodeModel:e}),vm=this.injectEngEnv();Object.assign(Y,vm);const ym=this.processNodeClassName(Y.className,zt);Y.className=ym;const bm=this.processNodeStyle(zt);Y.style=bm;const{children:_m}=Y;delete Y.children;const Sm=this.processNodeChild(_m,zt);if(Y.key=`${Y.key}-${$}`,$t(_.key)){const tn=_.key,Om=St(tn.value,{nodeContext:zt||{},storeManager:n,nodeModel:e});Y.key+=`-${Om}`}return Y.ref=tn=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[$]=tn},this.processNodeConditionAndConfigHook(Y,Sm,zt)}),O}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",le),h.displayName=`${e.value.componentName}Dynamic`,h};class Ia{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new Zu);w(this,"variableManager",new tl);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new tr);w(this,"onComponentDestroy");w(this,"processNodeConfigHook");w(this,"requestAPI",async e=>{throw console.log(e),new Error("Need to implement requestAPI for Render")})}getComponent(e){var o;const r=e.value.componentName;let n=io(r,this.components);return ro(n)||(n=no(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}pageRender(e,{components:r,onGetRef:n,refManager:o,$$context:a={nodeRefs:o,getProps:function(){},callEventMethod:function(){}},onGetComponent:s,onComponentMount:i,onComponentDestroy:c,renderMode:u,processNodeConfigHook:d,requestAPI:l,doc:f}){this.renderMode=u,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=c,this.processNodeConfigHook=d,this.refManager=o,this.requestAPI=l;const h=e.value.componentsTree,g=this.getComponent(h),b=Yr(g,e.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:d,onComponentMount:i,onComponentDestroy:c,renderMode:u,requestAPI:l,components:this.components,doc:f}),p={},m=h.props;return Object.keys(m).forEach(v=>{p[v]=m[v].value}),p.$$context=a,fe(b,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Kg=rn(new Ia);function Qg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xr={exports:{}},de={};/**
39
70
  * @license React
40
71
  * react-jsx-runtime.production.min.js
41
72
  *
@@ -43,7 +74,7 @@
43
74
  *
44
75
  * This source code is licensed under the MIT license found in the
45
76
  * LICENSE file in the root directory of this source tree.
46
- */var fa;function Mh(){if(fa)return ie;fa=1;var t=E,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,c,u){var f,l={},d=null,p=null;u!==void 0&&(d=""+u),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(p=c.ref);for(f in c)n.call(c,f)&&!a.hasOwnProperty(f)&&(l[f]=c[f]);if(i&&i.defaultProps)for(f in c=i.defaultProps,c)l[f]===void 0&&(l[f]=c[f]);return{$$typeof:e,type:i,key:d,ref:p,props:l,_owner:o.current}}return ie.Fragment=r,ie.jsx=s,ie.jsxs=s,ie}var da;function Ih(){return da||(da=1,Fr.exports=Mh()),Fr.exports}var Rh=Ih();const Ph=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],at=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Dh=[...Ph,...nh].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),E.createElement(e,{...o,...at(n)},...a)},t),{}),Lh={RootContainer:({children:t})=>t,...Dh,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),E.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),Rh.jsx("div",{...o,...at(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),E.createElement("video",{...r,...at(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),E.createElement("audio",{...r,...at(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(u=>u!==void 0);const{style:s={},...i}=at(n),c={height:r,width:e,...s,...o.style||{}};return E.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),E.createElement("img",{...r,...at(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>E.createElement("span",{...r,...at(t)},e),CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(E.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),E.createElement("canvas",{...n,...at(r)})),CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=at(e),i={...a,...n.style||{}};return E.createElement(r,{...n,...s,style:i},...o)}};class pa extends E.Component{constructor(r){super(r);w(this,"refManager");w(this,"dynamicComponentInstanceMap",new Map);w(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)});w(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Et(r)&&sa(r)){const n=r;this.setState({pageModel:new Oe(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new Oe(r.page)},this.refManager=new ke}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this),window.parent&&(window.parent.__CB_RENDER_WIN__=window)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s,doc:i}=r,{pageModel:c}=this.state;if(!c)return console.warn("pageModel is null"),null;const u={...Lh,...r.components},f=this.props.$$context||{};return n.pageRender(c,{libs:{},components:u,refManager:this.refManager,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:{...f,nodeRefs:this.refManager},renderMode:r.renderMode||"normal",requestAPI:r.requestAPI??n.requestAPI,processNodeConfigHook:r.processNodeConfigHook,doc:i||document})}}const Fh=()=>{const t=E.useRef(null);return E.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class Vh extends E.Component{constructor(r){super(r);w(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=E.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,E.createElement("p",null,"msg: ",String(this.state.error)),E.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"),E.createElement("div",{style:{display:"none"}}));return E.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}var Vr={exports:{}},H={};/**
77
+ */var Da;function Yg(){if(Da)return de;Da=1;var t=N,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,c,u){var d,l={},f=null,h=null;u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(h=c.ref);for(d in c)n.call(c,d)&&!a.hasOwnProperty(d)&&(l[d]=c[d]);if(i&&i.defaultProps)for(d in c=i.defaultProps,c)l[d]===void 0&&(l[d]=c[d]);return{$$typeof:e,type:i,key:f,ref:h,props:l,_owner:o.current}}return de.Fragment=r,de.jsx=s,de.jsxs=s,de}var La;function Xg(){return La||(La=1,Xr.exports=Yg()),Xr.exports}var Zg=Xg();const tm=["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"],ut=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},em=[...tm,...Og].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),N.createElement(e,{...o,...ut(n)},...a)},t),{}),rm={RootContainer:({children:t})=>t,...em,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),N.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),Zg.jsx("div",{...o,...ut(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),N.createElement("video",{...r,...ut(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),N.createElement("audio",{...r,...ut(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(u=>u!==void 0);const{style:s={},...i}=ut(n),c={height:r,width:e,...s,...o.style||{}};return N.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),N.createElement("img",{...r,...ut(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>N.createElement("span",{...r,...ut(t)},e),CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(N.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),N.createElement("canvas",{...n,...ut(r)})),CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=ut(e),i={...a,...n.style||{}};return N.createElement(r,{...n,...s,style:i},...o)}};class Fa extends N.Component{constructor(r){super(r);w(this,"refManager");w(this,"dynamicComponentInstanceMap",new Map);w(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)});w(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Pt(r)&&Ma(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 tr}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this),window.parent&&(window.parent.__CB_RENDER_WIN__=window)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s,doc:i}=r,{pageModel:c}=this.state;if(!c)return console.warn("pageModel is null"),null;const u={...rm,...r.components},d=this.props.$$context||{};return n.pageRender(c,{libs:{},components:u,refManager:this.refManager,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:{...d,nodeRefs:this.refManager},renderMode:r.renderMode||"normal",requestAPI:r.requestAPI??n.requestAPI,processNodeConfigHook:r.processNodeConfigHook,doc:i||document})}}const nm=()=>{const t=N.useRef(null);return N.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class om extends N.Component{constructor(r){super(r);w(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=N.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,N.createElement("p",null,"msg: ",String(this.state.error)),N.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"),N.createElement("div",{style:{display:"none"}}));return N.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}var Zr={exports:{}},q={};/**
47
78
  * @license React
48
79
  * react-reconciler-reflection.production.js
49
80
  *
@@ -51,5 +82,5 @@
51
82
  *
52
83
  * This source code is licensed under the MIT license found in the
53
84
  * LICENSE file in the root directory of this source tree.
54
- */var ha;function kh(){if(ha)return H;ha=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(s){var i=s,c=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(c=i.return),s=i.return;while(s)}return i.tag===3?c:null}function r(s){if(e(s)!==s)throw Error(t(188))}function n(s){var i=s.alternate;if(!i){if(i=e(s),i===null)throw Error(t(188));return i!==s?null:s}for(var c=s,u=i;;){var f=c.return;if(f===null)break;var l=f.alternate;if(l===null){if(u=f.return,u!==null){c=u;continue}break}if(f.child===l.child){for(l=f.child;l;){if(l===c)return r(f),s;if(l===u)return r(f),i;l=l.sibling}throw Error(t(188))}if(c.return!==u.return)c=f,u=l;else{for(var d=!1,p=f.child;p;){if(p===c){d=!0,c=f,u=l;break}if(p===u){d=!0,u=f,c=l;break}p=p.sibling}if(!d){for(p=l.child;p;){if(p===c){d=!0,c=l,u=f;break}if(p===u){d=!0,u=l,c=f;break}p=p.sibling}if(!d)throw Error(t(189))}}if(c.alternate!==u)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?s:i}function o(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=o(s),i!==null)return i;s=s.sibling}return null}function a(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(i=a(s),i!==null))return i;s=s.sibling}return null}return H.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},H.findCurrentFiberUsingSlowPath=n,H.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},H.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},H.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},H.getNearestMountedFiber=e,H.getSuspenseInstanceFromFiber=function(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null},H.isFiberMounted=function(s){return e(s)===s},H.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},H.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},H}var ma;function Uh(){return ma||(ma=1,Vr.exports=kh()),Vr.exports}var Bh=Uh();function zh(t){return t._reactInternals}function mm(t){return t}function Gh(t){const e=zh(t);if(e===void 0){if(typeof t.render=="function")throw new Error("Unable to find node on an unmounted component.");{const n=Object.keys(t).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${n}`)}}const r=Bh.findCurrentHostFiber(e);return r===null?null:r.stateNode}function Hh(t){return Gh(t)}class ga{constructor(){w(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 va=t=>{const{node:e}=t,r=E.useMemo(()=>{const i=e.isContainer();return Et(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[e]),{placeholder:n,height:o,width:a,style:s}=r;return E.createElement("div",{style:{margin:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minHeight:"50px",width:a,height:o,boxSizing:"border-box",...s}},n)};class qh extends E.Component{constructor(r){super(r);w(this,"instanceManager",new ga);w(this,"renderRef");w(this,"dropPlaceholder",va);w(this,"_components",{});w(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends E.Component{constructor(){super(...arguments);w(this,"_DESIGN_BOX",!0);w(this,"_NODE_MODEL",n);w(this,"_NODE_ID",n.id);w(this,"_UNIQUE_ID",`${n.id}_${tt()}`);w(this,"_STATUS");w(this,"_design_target_component");w(this,"_dom")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}getDom(){var p,b;return((b=(p=n.material)==null?void 0:p.value.advanceCustom)==null?void 0:b.autoGetDom)??!0?Hh(this):this._dom}render(){var v,g,_,j;const{children:d=[],onlyRenderChild:p,...b}=this.props;let O=d;if(jt(d)||(O=[d]),!!!O.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Dt.ROOT_CONTAINER)){const T=(g=(v=n.material)==null?void 0:v.value.advanceCustom)==null?void 0:g.dropPlaceholder;O.push(E.createElement(T||o.dropPlaceholder,{node:n}))}return p?O:((j=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:j.autoGetDom)??!0?E.createElement(a,b,...O):E.createElement(a,{...b,$SET_DOM:A=>{this._dom=A}},...O)}}return E.forwardRef(function(l,d){return E.createElement(Vh,{node:n,targetComponent:i},E.createElement(i,{ref:d,...l}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=E.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}updateComponents(r={}){this._components=Object.assign(this._components,r),this.forceUpdate()}componentDidMount(){var r,n;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ya(r);if(!n)return null;const o=ba(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),E.createElement(pa,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var b,O;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let f={...c};const l=((b=i.value.configure)==null?void 0:b.devState)||{},d=(O=i.material)==null?void 0:O.value.fixedProps;if(d!==void 0){if(Et(d))f={...f,...d};else if(typeof d=="function"){const h=d(f);f={...f,...h}}}let p=u;return l.condition===!1&&(p=l.condition),{props:wc(f,l.props||{}),condition:p}},renderMode:"design",ref:this.renderRef})}}const ya=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ya(t.parentElement)},ba=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ba(t.return):null},Jh=()=>{const t=E.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var we={exports:{}},Wh=we.exports,_a;function Qh(){return _a||(_a=1,function(t,e){(function(r,n){t.exports=n()})(Wh,function(){var r=function(){},n={},o={},a={};function s(d,p){d=d.push?d:[d];var b=[],O=d.length,h=O,m,v,g,_;for(m=function(j,T){T.length&&b.push(j),h--,h||p(b)};O--;){if(v=d[O],g=o[v],g){m(v,g);continue}_=a[v]=a[v]||[],_.push(m)}}function i(d,p){if(d){var b=a[d];if(o[d]=p,!!b)for(;b.length;)b[0](d,p),b.splice(0,1)}}function c(d,p){d.call&&(d={success:d}),p.length?(d.error||r)(p):(d.success||r)(d)}function u(d,p,b,O){var h=document,m=b.async,v=(b.numRetries||0)+1,g=b.before||r,_=d.replace(/[\?|#].*$/,""),j=d.replace(/^(css|img|module|nomodule)!/,""),T,A,$;if(O=O||0,/(^css!|\.css$)/.test(_))$=h.createElement("link"),$.rel="stylesheet",$.href=j,T="hideFocus"in $,T&&$.relList&&(T=0,$.rel="preload",$.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))$=h.createElement("img"),$.src=j;else if($=h.createElement("script"),$.src=j,$.async=m===void 0?!0:m,A="noModule"in $,/^module!/.test(_)){if(!A)return p(d,"l");$.type="module"}else if(/^nomodule!/.test(_)&&A)return p(d,"l");$.onload=$.onerror=$.onbeforeload=function(et){var yt=et.type[0];if(T)try{$.sheet.cssText.length||(yt="e")}catch(bt){bt.code!=18&&(yt="e")}if(yt=="e"){if(O+=1,O<v)return u(d,p,b,O)}else if($.rel=="preload"&&$.as=="style")return $.rel="stylesheet";p(d,yt,et.defaultPrevented)},g(d,$)!==!1&&h.head.appendChild($)}function f(d,p,b){d=d.push?d:[d];var O=d.length,h=O,m=[],v,g;for(v=function(_,j,T){if(j=="e"&&m.push(_),j=="b")if(T)m.push(_);else return;O--,O||p(m)},g=0;g<h;g++)u(d[g],v,b)}function l(d,p,b){var O,h;if(p&&p.trim&&(O=p),h=(O?b:p)||{},O){if(O in n)throw"LoadJS";n[O]=!0}function m(v,g){f(d,function(_){c(h,_),v&&c({success:v,error:g},_),i(O,_)},h)}if(h.returnPromise)return new Promise(m);m()}return l.ready=function(p,b){return s(p,function(O){c(b,O)}),l},l.done=function(p){i(p,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(p){return p in n},l})}(we)),we.exports}var Yh=Qh();const Sa=xh(Yh);class Kh{constructor(e,r){w(this,"assets");w(this,"loadStatus");w(this,"win",window);w(this,"_onSuccessList",[]);w(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(e){const r=this.assets||[],n=[];for(let o=0;o<r.length;o++){const a=r[o];a.id||(a.id=tt()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&Sa(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}Sa.ready(n,{success:()=>{this._onSuccessList.forEach(s=>s()),o("")},error:s=>{this._onErrorList.forEach(i=>i(s)),a(s)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}S.AssetLoader=Kh,S.ComponentInstanceManager=ga,S.DYNAMIC_COMPONENT_TYPE=ae,S.DefaultDropPlaceholder=va,S.DefineReactAdapter=la,S.DesignRender=qh,S.INNER_EVENT_LIST=ca,S.InnerPropList=ia,S.ON_DID_RENDER=Rr,S.ON_WILL_DESTROY=Pr,S.ReactAdapter=Ah,S.RefManager=ke,S.Render=pa,S.canAcceptsRef=xn,S.collectVariable=$c,S.compWrapper=Mn,S.convertCodeStringToFunction=Ht,S.findComponentByChainRefer=Dn,S.flatObject=Tc,S.formatSourceStylePropertyName=In,S.getAdapter=Br,S.getCSSTextValue=Nc,S.getComponentsLibs=Ac,S.getInheritObj=Ve,S.getMatchVal=Rn,S.getNodeCssClassName=Fe,S.getObjFromArrayMap=Le,S.getThirdLibs=xc,S.isClass=Ec,S.runExpression=lt,S.shouldConstruct=An,S.useDesignRender=Jh,S.useRender=Fh,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
85
+ */var Va;function am(){if(Va)return q;Va=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(s){var i=s,c=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(c=i.return),s=i.return;while(s)}return i.tag===3?c:null}function r(s){if(e(s)!==s)throw Error(t(188))}function n(s){var i=s.alternate;if(!i){if(i=e(s),i===null)throw Error(t(188));return i!==s?null:s}for(var c=s,u=i;;){var d=c.return;if(d===null)break;var l=d.alternate;if(l===null){if(u=d.return,u!==null){c=u;continue}break}if(d.child===l.child){for(l=d.child;l;){if(l===c)return r(d),s;if(l===u)return r(d),i;l=l.sibling}throw Error(t(188))}if(c.return!==u.return)c=d,u=l;else{for(var f=!1,h=d.child;h;){if(h===c){f=!0,c=d,u=l;break}if(h===u){f=!0,u=d,c=l;break}h=h.sibling}if(!f){for(h=l.child;h;){if(h===c){f=!0,c=l,u=d;break}if(h===u){f=!0,u=l,c=d;break}h=h.sibling}if(!f)throw Error(t(189))}}if(c.alternate!==u)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?s:i}function o(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=o(s),i!==null)return i;s=s.sibling}return null}function a(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(i=a(s),i!==null))return i;s=s.sibling}return null}return q.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},q.findCurrentFiberUsingSlowPath=n,q.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},q.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},q.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},q.getNearestMountedFiber=e,q.getSuspenseInstanceFromFiber=function(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null},q.isFiberMounted=function(s){return e(s)===s},q.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},q.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},q}var Ua;function sm(){return Ua||(Ua=1,Zr.exports=am()),Zr.exports}var im=sm();function cm(t){return t._reactInternals}function Rm(t){return t}function um(t){const e=cm(t);if(e===void 0){if(typeof t.render=="function")throw new Error("Unable to find node on an unmounted component.");{const n=Object.keys(t).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${n}`)}}const r=im.findCurrentHostFiber(e);return r===null?null:r.stateNode}function lm(t){return um(t)}class Ba{constructor(){w(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 Ga=t=>{const{node:e}=t,r=N.useMemo(()=>{const i=e.isContainer();return Pt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[e]),{placeholder:n,height:o,width:a,style:s}=r;return N.createElement("div",{style:{margin:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minHeight:"50px",width:a,height:o,boxSizing:"border-box",...s}},n)};class fm extends N.Component{constructor(r){super(r);w(this,"instanceManager",new Ba);w(this,"renderRef");w(this,"dropPlaceholder",Ga);w(this,"_components",{});w(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends N.Component{constructor(){super(...arguments);w(this,"_DESIGN_BOX",!0);w(this,"_NODE_MODEL",n);w(this,"_NODE_ID",n.id);w(this,"_UNIQUE_ID",`${n.id}_${rt()}`);w(this,"_STATUS");w(this,"_design_target_component");w(this,"_dom")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}getDom(){var h,g;return((g=(h=n.material)==null?void 0:h.value.advanceCustom)==null?void 0:g.autoGetDom)??!0?lm(this):this._dom}render(){var v,y,_,O;const{children:f=[],onlyRenderChild:h,...g}=this.props;let b=f;if(nt(f)||(b=[f]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===ct.ROOT_CONTAINER)){const A=(y=(v=n.material)==null?void 0:v.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push(N.createElement(A||o.dropPlaceholder,{node:n}))}return h?b:((O=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:O.autoGetDom)??!0?N.createElement(a,g,...b):N.createElement(a,{...g,$SET_DOM:T=>{this._dom=T}},...b)}}return N.forwardRef(function(l,f){return N.createElement(om,{node:n,targetComponent:i},N.createElement(i,{ref:f,...l}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=N.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}updateComponents(r={}){this._components=Object.assign(this._components,r),this.forceUpdate()}componentDidMount(){var r,n;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ka(r);if(!n)return null;const o=Ha(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),N.createElement(Fa,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let d={...c};const l=((g=i.value.configure)==null?void 0:g.devState)||{},f=(b=i.material)==null?void 0:b.value.fixedProps;if(f!==void 0){if(Pt(f))d={...d,...f};else if(typeof f=="function"){const p=f(d);d={...d,...p}}}let h=u;return l.condition===!1&&(h=l.condition),{props:Hu(d,l.props||{}),condition:h}},renderMode:"design",ref:this.renderRef})}}const ka=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ka(t.parentElement)},Ha=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ha(t.return):null},dm=()=>{const t=N.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 Re={exports:{}},pm=Re.exports,za;function hm(){return za||(za=1,function(t,e){(function(r,n){t.exports=n()})(pm,function(){var r=function(){},n={},o={},a={};function s(f,h){f=f.push?f:[f];var g=[],b=f.length,p=b,m,v,y,_;for(m=function(O,A){A.length&&g.push(O),p--,p||h(g)};b--;){if(v=f[b],y=o[v],y){m(v,y);continue}_=a[v]=a[v]||[],_.push(m)}}function i(f,h){if(f){var g=a[f];if(o[f]=h,!!g)for(;g.length;)g[0](f,h),g.splice(0,1)}}function c(f,h){f.call&&(f={success:f}),h.length?(f.error||r)(h):(f.success||r)(f)}function u(f,h,g,b){var p=document,m=g.async,v=(g.numRetries||0)+1,y=g.before||r,_=f.replace(/[\?|#].*$/,""),O=f.replace(/^(css|img|module|nomodule)!/,""),A,T,$;if(b=b||0,/(^css!|\.css$)/.test(_))$=p.createElement("link"),$.rel="stylesheet",$.href=O,A="hideFocus"in $,A&&$.relList&&(A=0,$.rel="preload",$.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))$=p.createElement("img"),$.src=O;else if($=p.createElement("script"),$.src=O,$.async=m===void 0?!0:m,T="noModule"in $,/^module!/.test(_)){if(!T)return h(f,"l");$.type="module"}else if(/^nomodule!/.test(_)&&T)return h(f,"l");$.onload=$.onerror=$.onbeforeload=function(B){var At=B.type[0];if(A)try{$.sheet.cssText.length||(At="e")}catch(Tt){Tt.code!=18&&(At="e")}if(At=="e"){if(b+=1,b<v)return u(f,h,g,b)}else if($.rel=="preload"&&$.as=="style")return $.rel="stylesheet";h(f,At,B.defaultPrevented)},y(f,$)!==!1&&p.head.appendChild($)}function d(f,h,g){f=f.push?f:[f];var b=f.length,p=b,m=[],v,y;for(v=function(_,O,A){if(O=="e"&&m.push(_),O=="b")if(A)m.push(_);else return;b--,b||h(m)},y=0;y<p;y++)u(f[y],v,g)}function l(f,h,g){var b,p;if(h&&h.trim&&(b=h),p=(b?g:h)||{},b){if(b in n)throw"LoadJS";n[b]=!0}function m(v,y){d(f,function(_){c(p,_),v&&c({success:v,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(m);m()}return l.ready=function(h,g){return s(h,function(b){c(g,b)}),l},l.done=function(h){i(h,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(h){return h in n},l})}(Re)),Re.exports}var gm=hm();const qa=Qg(gm);class mm{constructor(e,r){w(this,"assets");w(this,"loadStatus");w(this,"win",window);w(this,"_onSuccessList",[]);w(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(e){const r=this.assets||[],n=[];for(let o=0;o<r.length;o++){const a=r[o];a.id||(a.id=rt()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&qa(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}qa.ready(n,{success:()=>{this._onSuccessList.forEach(s=>s()),o("")},error:s=>{this._onErrorList.forEach(i=>i(s)),a(s)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}C.AssetLoader=mm,C.ComponentInstanceManager=Ba,C.DYNAMIC_COMPONENT_TYPE=le,C.DefaultDropPlaceholder=Ga,C.DefineReactAdapter=Ia,C.DesignRender=fm,C.INNER_EVENT_LIST=xa,C.InnerPropList=Pa,C.ON_DID_RENDER=Wr,C.ON_WILL_DESTROY=Kr,C.ReactAdapter=Kg,C.RefManager=tr,C.Render=Fa,C.canAcceptsRef=ro,C.collectVariable=Ju,C.compWrapper=no,C.convertCodeStringToFunction=xt,C.findComponentByChainRefer=io,C.flatObject=Wu,C.formatSourceStylePropertyName=oo,C.getAdapter=rn,C.getCSSTextValue=qu,C.getComponentsLibs=Ku,C.getInheritObj=Ze,C.getMatchVal=ao,C.getNodeCssClassName=Xe,C.getObjFromArrayMap=Ye,C.getThirdLibs=Qu,C.isClass=zu,C.runExpression=St,C.shouldConstruct=eo,C.useDesignRender=dm,C.useRender=nm,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
55
86
  //# sourceMappingURL=index.umd.js.map