@chamn/render 0.3.15 → 0.3.17

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