@chamn/render 0.9.0 → 0.9.1

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